@kvass/widgets 1.8.25 → 1.8.26

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/index.es2.js CHANGED
@@ -1,11 +1,11 @@
1
- import{G as ka,q as Q,r as X,e as $,o as E,X as qt,E as Ee,b as I,c as O,i as qn,d as R,z as Va,A as Rg,a as z,n as Ce,g as F,C as $e,t as oe,y as Cr,w as Z,j as he,v as B,m as ne,f as Qe,ai as He,H as Lc,I as Pg,ae as mk,V as Qd,R as ep,a3 as gk,a4 as vk,P as yk,J as be,K as Ie,F as De,l as _t,D as ao,M as Fg,N as Cs,B as tp,O as Lg,a0 as bk,s as ns,S as np,a1 as kr,a2 as kk,u as Vg,Q as rp,U as wk,W as xk,Z as ip,k as Ba,$ as Bg,a9 as op,L as Co,h as sp,af as Ek,Y as Ck,T as Sk}from"./_plugin-vue_export-helper.js";var Tk=Object.defineProperty,Ok=(t,e,n)=>e in t?Tk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Yt=(t,e,n)=>(Ok(t,typeof e!="symbol"?e+"":e,n),n);function $g(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=$g(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Ak(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=$g(t))&&(r&&(r+=" "),r+=e);return r}const Ah=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Mh=Ak,rn=(t,e)=>n=>{var r;if(e?.variants==null)return Mh(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=Ah(c)||Ah(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 Mh(t,s,l,n?.class,n?.className)},jg=/^[a-z0-9]+(-[a-z0-9]+)*$/,Gl=(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&&!wa(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&&!wa(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:o};return e&&!wa(a,n)?null:a}return null},wa=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1,zg=Object.freeze({left:0,top:0,width:16,height:16}),$a=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Jl=Object.freeze({...zg,...$a}),Vc=Object.freeze({...Jl,body:"",hidden:!1});function Mk(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 _h(t,e){const n=Mk(t,e);for(const r in Vc)r in $a?r in t&&!(r in n)&&(n[r]=$a[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function _k(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 Dk(t,e,n){const r=t.icons,i=t.aliases||Object.create(null);let o={};function s(a){o=_h(r[a]||i[a],o)}return s(e),n.forEach(s),_h(t,o)}function Hg(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=_k(t);for(const i in r){const o=r[i];o&&(e(i,Dk(t,i,o)),n.push(i))}return n}const Nk={provider:"",aliases:{},not_found:{},...zg};function Lu(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function qg(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!Lu(t,Nk))return null;const n=e.icons;for(const i in n){const o=n[i];if(!i||typeof o.body!="string"||!Lu(o,Vc))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]||!Lu(o,Vc))return null}return e}const Dh=Object.create(null);function Ik(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function Hi(t,e){const n=Dh[t]||(Dh[t]=Object.create(null));return n[e]||(n[e]=Ik(t,e))}function Wg(t,e){return qg(e)?Hg(e,(n,r)=>{r?t.icons[n]=r:t.missing.add(n)}):[]}function Rk(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}let rs=!1;function Ug(t){return typeof t=="boolean"&&(rs=t),rs}function Pk(t){const e=typeof t=="string"?Gl(t,!0,rs):t;if(e){const n=Hi(e.provider,e.prefix),r=e.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Fk(t,e){const n=Gl(t,!0,rs);if(!n)return!1;const r=Hi(n.provider,n.prefix);return e?Rk(r,n.name,e):(r.missing.add(n.name),!0)}function Lk(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),rs&&!e&&!t.prefix){let i=!1;return qg(t)&&(t.prefix="",Hg(t,(o,s)=>{Fk(o,s)&&(i=!0)})),i}const n=t.prefix;if(!wa({prefix:n,name:"a"}))return!1;const r=Hi(e,n);return!!Wg(r,t)}const Kg=Object.freeze({width:null,height:null}),Gg=Object.freeze({...Kg,...$a}),Vk=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Bk=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Nh(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(Vk);if(r===null||!r.length)return t;const i=[];let o=r.shift(),s=Bk.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 $k(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 jk(t,e){return t?"<defs>"+t+"</defs>"+e:e}function zk(t,e,n){const r=$k(t);return jk(r.defs,e+r.content+n)}const Hk=t=>t==="unset"||t==="undefined"||t==="none";function qk(t,e){const n={...Jl,...t},r={...Gg,...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=zk(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=Nh(d,l/u)):(c=s==="auto"?l:s,d=a===null?Nh(c,u/l):a==="auto"?u:a);const h={},p=(m,g)=>{Hk(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 Wk=/\sid="(\S+)"/g,Uk="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Kk=0;function Gk(t,e=Uk){const n=[];let r;for(;r=Wk.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+(Kk++).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 Bc=Object.create(null);function Jk(t,e){Bc[t]=e}function $c(t){return Bc[t]||Bc[""]}function ap(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 lp=Object.create(null),Js=["https://api.simplesvg.com","https://api.unisvg.com"],jc=[];for(;Js.length>0;)Js.length===1||Math.random()>.5?jc.push(Js.shift()):jc.push(Js.pop());lp[""]=ap({resources:["https://api.iconify.design"].concat(jc)});function Jg(t,e){const n=ap(e);return n===null?!1:(lp[t]=n,!0)}function up(t){return lp[t]}const Xk=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let Ih=Xk();function Yk(t,e){const n=up(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 Zk(t){return t===404}const Qk=(t,e,n)=>{const r=[],i=Yk(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 ew(t){if(typeof t=="string"){const e=up(t);if(e)return e.path}return"/"}const tw=(t,e,n)=>{if(!Ih){n("abort",424);return}let r=ew(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;Ih(t+r).then(o=>{const s=o.status;if(s!==200){setTimeout(()=>{n(Zk(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)})},nw={prepare:Qk,send:tw};function rw(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]=Hi(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 Xg(t,e){t.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==e))})}function iw(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||Xg([t],o.id),o.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),o.abort))})}))}let ow=0;function sw(t,e,n){const r=ow++,i=Xg.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 aw(t,e=!0,n=!1){const r=[];return t.forEach(i=>{const o=typeof i=="string"?Gl(i,e,n):i;o&&r.push(o)}),r}var lw={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function uw(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 C=Math.floor(Math.random()*x.length);s.push(x[C]),x=x.slice(0,C).concat(x.slice(C+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,C){C&&(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,C,N){const A=C!=="success";switch(h=h.filter(S=>S!==x),l){case"pending":break;case"failed":if(A||!t.dataAfterTimeout)return;break;default:return}if(C==="abort"){c=N,b();return}if(A){c=N,h.length||(s.length?w():b());return}if(f(),k(),!t.random){const S=t.resources.indexOf(x.resource);S!==-1&&S!==t.index&&(t.index=S)}l="completed",p.forEach(S=>{S(N)})}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 C={status:"pending",resource:x,callback:(N,A)=>{v(C,N,A)}};h.push(C),u++,d=setTimeout(w,t.rotate),n(x,e,C.callback)}return setTimeout(w),y}function Yg(t){const e={...lw,...t};let n=[];function r(){n=n.filter(s=>s().status==="pending")}function i(s,a,l){const u=uw(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 Rh(){}const Vu=Object.create(null);function cw(t){if(!Vu[t]){const e=up(t);if(!e)return;const n=Yg(e),r={config:e,redundancy:n};Vu[t]=r}return Vu[t]}function dw(t,e,n){let r,i;if(typeof t=="string"){const o=$c(t);if(!o)return n(void 0,424),Rh;i=o.send;const s=cw(t);s&&(r=s.redundancy)}else{const o=ap(t);if(o){r=Yg(o);const s=t.resources?t.resources[0]:"",a=$c(s);a&&(i=a.send)}}return!r||!i?(n(void 0,424),Rh):r.query(e,i,n)().abort}function Ph(){}function pw(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,iw(t)}))}function hw(t){const e=[],n=[];return t.forEach(r=>{(r.match(jg)?e:n).push(r)}),{valid:e,invalid:n}}function vo(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(!Wg(t,n).length){r();return}}catch(i){console.error(i)}r(),pw(t)}function Fh(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function fw(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)){Fh(t.loadIcons(i,r,n),u=>{vo(t,i,u)});return}if(o){i.forEach(u=>{const c=o(u,r,n);Fh(c,d=>{const h=d?{prefix:r,icons:{[u]:d}}:null;vo(t,[u],h)})});return}const{valid:s,invalid:a}=hw(i);if(a.length&&vo(t,a,null),!s.length)return;const l=r.match(jg)?$c(n):null;if(!l){vo(t,s,null);return}l.prepare(n,r,s).forEach(u=>{dw(n,u,c=>{vo(t,u.icons,c)})})}))}const mw=(t,e)=>{const n=aw(t,!0,Ug()),r=rw(n);if(!r.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(r.loaded,r.missing,r.pending,Ph)}),()=>{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(Hi(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=Hi(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&&fw(l,u)}),e?sw(e,r,o):Ph};function gw(t,e){const n={...t};for(const r in e){const i=e[r],o=typeof i;r in Kg?(i===null||i&&(o==="string"||o==="number"))&&(n[r]=i):o===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const vw=/[\s,]+/;function yw(t,e){e.split(vw).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function bw(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 kw(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 ww(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function xw(t){return"data:image/svg+xml,"+ww(t)}function Ew(t){return'url("'+xw(t)+'")'}const Lh={...Gg,inline:!1},Cw={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Sw={display:"inline-block"},zc={backgroundColor:"currentColor"},Zg={backgroundColor:"transparent"},Vh={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Bh={webkitMask:zc,mask:zc,background:Zg};for(const t in Bh){const e=Bh[t];for(const n in Vh)e[t+n]=Vh[n]}const xa={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";xa[t+"-flip"]=e,xa[t.slice(0,1)+"-flip"]=e,xa[t+"Flip"]=e});function $h(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const jh=(t,e)=>{const n=gw(Lh,e),r={...Cw},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"&&yw(n,g);break;case"color":o.color=g;break;case"rotate":typeof g=="string"?n[m]=bw(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=xa[m];y?(g===!0||g==="true"||g===1)&&(n[y]=!0):Lh[m]===void 0&&(r[m]=g)}}}const l=qk(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=Gk(l.body,g?()=>g+"ID"+m++:"iconifyVue"),ns("svg",r)}const{body:c,width:d,height:h}=t,p=i==="mask"||(i==="bg"?!1:c.indexOf("currentColor")!==-1),f=kw(c,{...u,width:d+"",height:h+""});return r.style={...o,"--svg":Ew(f),width:$h(u.width),height:$h(u.height),...Sw,...p?zc:Zg,...a},ns("span",r)};Ug(!0);Jk("",nw);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"||!Lk(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;Jg(n,i)||console.error(r)}catch{console.error(r)}}}}const Tw={...Jl,body:""},Ze=Q({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=Gl(t,!1,!0))===null)return this.abortLoading(),null;let i=Pk(r);if(!i)return(!this._loadingIcon||this._loadingIcon.name!==t)&&(this.abortLoading(),this._name="",i!==null&&(this._loadingIcon={name:t,abort:mw([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 jh(Tw,t);let n=t;return e.classes&&(n={...t,class:(typeof t.class=="string"?t.class+" ":"")+e.classes.join(" ")}),jh({...Jl,...e.data},n)}});Jg("",{resources:["https://icons.ui.kvass.no"]});function Ow(t){return!t||typeof t!="object"?!1:typeof t.then=="function"&&typeof t.catch=="function"}const Aw=["xxs","xs","sm","default","lg","xl","xxl","3xl","4xl"],Mw=(t,e)=>e==="default"?`var(--k-ui-${t})`:`var(--k-ui-${t}-${e})`,ja=t=>{switch(t){case"start":case"end":return`flex-${t}`;default:return t}},cp=(t,e="spacing")=>t.split(" ").map(n=>typeof n=="number"||typeof n=="string"&&n.match(/^\d+$/)?`${n}rem`:typeof n=="string"&&Aw.includes(n)?Mw(e,n):n).join(" ");function _w(){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 Qg=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,r])=>[`--k-${t}-${n}`,r])),Dw=function(t){return Object.prototype.toString.call(t)==="[object Object]"};function Nw(t){return Array.isArray(t)}const ev=Q({__name:"Spinner",props:{size:{default:"medium"}},setup(t){return(e,n)=>(E(),O("span",{class:Ce(`k-spinner k-spinner--size-${e.size}`)},null,2))}}),Iw={class:"k-button__content"},Rw={key:0,class:"k-button__icon k-button__icon--left"},Pw={key:1,class:"k-button__icon k-button__icon--right"},Fw={key:2,class:"k-button__confirm-label"},ze=Q({__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=I(()=>!h.value||u.value==="loading"?n.variant:u.value=="confirm"?"warning":i[u.value]||n.variant),s=I(()=>n.loading||u.value==="loading"),a=X(),l=I(()=>{if(u.value)return["error","success"].includes(u.value)||s.value}),u=X("idle"),c=X(),d=X(),h=I(()=>u.value||s.value),p=I(()=>["error","success"].includes(u.value)),f=I(()=>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=C=>{g(),n.stateTimeout?(u.value=C,c.value=setTimeout(()=>{g(),r(C)},n.stateTimeout)):r(C)};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"}Ee(()=>n.promise,w=>{w&&Ow(w)&&m(w)});const y=X(),b=I(()=>u.value==="confirm");function k(w){if(n.confirm&&u.value!=="confirm")return u.value="confirm";g(),r("click",w)}const v=rn("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(),$(Qe(w.is),ne({type:"button",class:B(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:Z(()=>[Va(z("span",Iw,[w.icon||w.iconLeft||w.$slots.icon||w.$slots["icon-left"]?(E(),O("span",Rw,[F(w.$slots,"icon-left",{},()=>[F(w.$slots,"icon",{},()=>[he(B(Ze),{icon:w.icon||w.iconLeft},null,8,["icon"])])])])):R("",!0),F(w.$slots,"default",{},()=>[$e(oe(w.label),1)]),w.iconRight||w.$slots["icon-right"]?(E(),O("span",Pw,[F(w.$slots,"icon-right",{},()=>[he(B(Ze),{icon:w.iconRight},null,8,["icon"])])])):R("",!0)],512),[[Rg,!b.value]]),s.value?(E(),$(ev,{key:0})):R("",!0),p.value?(E(),$(B(Ze),{key:1,class:"k-button__state-indicator",icon:f.value},null,8,["icon"])):R("",!0),b.value?(E(),O("span",Fw,oe(w.confirmLabel),1)):R("",!0)]),_:3},16,["class","aria-busy","inert"]))}}),Lw={class:"k-alert__content"},Vw={key:0,class:"k-alert__title"},Bw={class:"k-alert__icon"},mL=Q({__name:"Alert",props:{variant:{default:"neutral"},icon:{},title:{},content:{},action:{}},emits:["action"],setup(t,{emit:e}){const n=t,r=e,i=rn("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(),O("div",{role:"alert",class:Ce(B(i)({...n}))},[z("div",Lw,[s.title||s.$slots.title?(E(),O("div",Vw,[F(s.$slots,"title",{},()=>[z("strong",null,oe(s.title),1)])])):R("",!0),F(s.$slots,"default",{},()=>[z("span",null,oe(s.content),1)]),s.action?(E(),$(ze,{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"])):R("",!0)]),z("div",Bw,[F(s.$slots,"icon",{},()=>[s.icon||o[s.variant]?(E(),$(B(Ze),{key:0,icon:s.icon||o[s.variant]},null,8,["icon"])):R("",!0)])])],2))}}),$w={class:"k-badge__label"},gL=Q({__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=rn("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=X(!1);function a(){s.value=!0,r("dismiss",n)}return(l,u)=>s.value?R("",!0):(E(),O("span",{key:0,class:Ce(B(o)({appearance:l.appearance,variant:l.variant,rounded:l.rounded}))},[F(l.$slots,"icon",{},()=>[l.icon||i[l.appearance]?(E(),$(B(Ze),{key:0,icon:l.icon||i[l.appearance],class:"k-badge__icon"},null,8,["icon"])):R("",!0)]),F(l.$slots,"default",{},()=>[z("span",$w,oe(l.label),1)]),l.dismissable?(E(),O("button",{key:0,class:"k-badge__dismiss",onClick:a},[he(B(Ze),{icon:"fa-pro-light:times"})])):R("",!0)],2))}});var Ln=(t,e=[])=>({parts:(...n)=>{if(jw(e))return Ln(t,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Ln(t,[...e,...n]),rename:n=>Ln(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(),jw=t=>t.length===0,zh=t=>Math.max(0,Math.min(1,t)),Bu=(...t)=>e=>t.reduce((n,r)=>r(n),e),Xs=()=>{},Xl=t=>typeof t=="object"&&t!==null,G=t=>t?"":void 0,zw=t=>t?"true":void 0,Hw=1,qw=9,Ww=11,dt=t=>Xl(t)&&t.nodeType===Hw&&typeof t.nodeName=="string",dp=t=>Xl(t)&&t.nodeType===qw,Uw=t=>Xl(t)&&t===t.window,tv=t=>dt(t)?t.localName||"":"#document";function Kw(t){return["html","body","#document"].includes(tv(t))}var Gw=t=>Xl(t)&&t.nodeType!==void 0,za=t=>Gw(t)&&t.nodeType===Ww&&"host"in t,Jw=t=>dt(t)&&t.localName==="input",Xw=t=>dt(t)?t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0:!1,Yw=/(textarea|select)/;function Zw(t){if(t==null||!dt(t))return!1;try{return Jw(t)&&t.selectionStart!=null||Yw.test(t.localName)||t.isContentEditable||t.getAttribute("contenteditable")==="true"||t.getAttribute("contenteditable")===""}catch{return!1}}function qi(t,e){var n;if(!t||!e||!dt(t)||!dt(e))return!1;const r=(n=e.getRootNode)==null?void 0:n.call(e);if(t===e||t.contains(e))return!0;if(r&&za(r)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Kt(t){return dp(t)?t:Uw(t)?t.document:t?.ownerDocument??document}function Qw(t){return Kt(t).documentElement}function xt(t){var e;return za(t)?xt(t.host):dp(t)?t.defaultView??window:dt(t)?((e=t.ownerDocument)==null?void 0:e.defaultView)??window:window}function nv(t){let e=t.activeElement;for(;e!=null&&e.shadowRoot;){const n=e.shadowRoot.activeElement;if(n===e)break;e=n}return e}function ex(t){if(tv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||za(t)&&t.host||Qw(t);return za(e)?e.host:e}var $u=new WeakMap;function tx(t){return $u.has(t)||$u.set(t,xt(t).getComputedStyle(t)),$u.get(t)}var rv=()=>typeof document<"u";function nx(){const t=navigator.userAgentData;return t?.platform??navigator.platform}var pp=t=>rv()&&t.test(nx()),rx=t=>rv()&&t.test(navigator.vendor),iv=()=>pp(/^Mac/),ix=()=>ox()&&rx(/apple/i),ox=()=>pp(/mac|iphone|ipad|ipod/i),hp=()=>pp(/iP(hone|ad|od)|iOS/);function sx(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 ct(t){const e=sx(t);return e?.[0]??t.target}var ax=t=>qi(t.currentTarget,ct(t)),lx=t=>t.button===0,ux=t=>t.button===2||iv()&&t.ctrlKey&&t.button===0,cx=t=>t.ctrlKey||t.altKey||t.metaKey,dx=t=>"touches"in t&&t.touches.length>0,px={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Hh={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function ov(t,e={}){const{dir:n="ltr",orientation:r="horizontal"}=e;let i=t.key;return i=px[i]??i,n==="rtl"&&r==="horizontal"&&i in Hh&&(i=Hh[i]),i}var hx=new Set(["PageUp","PageDown"]),fx=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function mx(t){return t.ctrlKey||t.metaKey?.1:hx.has(t.key)||t.shiftKey&&fx.has(t.key)?10:1}function fp(t,e="client"){const n=dx(t)?t.touches[0]||t.changedTouches[0]:t;return{x:n[`${e}X`],y:n[`${e}Y`]}}var Ne=(t,e,n,r)=>{const i=typeof t=="function"?t():t;return i?.addEventListener(e,n,r),()=>{i?.removeEventListener(e,n,r)}};function sv(t,e){const{type:n="HTMLInputElement",property:r="value"}=e,i=xt(t)[n].prototype;return Object.getOwnPropertyDescriptor(i,r)??{}}function gx(t){if(t.localName==="input")return"HTMLInputElement";if(t.localName==="textarea")return"HTMLTextAreaElement";if(t.localName==="select")return"HTMLSelectElement"}function av(t,e,n="value"){var r;if(!t)return;const i=gx(t);i&&((r=sv(t,{type:i,property:n}).set)==null||r.call(t,e)),t.setAttribute(n,e)}function mp(t,e){var n;t&&((n=sv(t,{type:"HTMLInputElement",property:"checked"}).set)==null||n.call(t,e),e?t.setAttribute("checked",""):t.removeAttribute("checked"))}function vx(t,e){const{value:n,bubbles:r=!0}=e;if(!t)return;const i=xt(t);t instanceof i.HTMLInputElement&&(av(t,`${n}`),t.dispatchEvent(new i.Event("input",{bubbles:r})))}function gp(t,e){const{checked:n,bubbles:r=!0}=e;if(!t)return;const i=xt(t);t instanceof i.HTMLInputElement&&(mp(t,n),t.dispatchEvent(new i.Event("click",{bubbles:r})))}function yx(t){return bx(t)?t.form:t.closest("form")}function bx(t){return t.matches("textarea, input, select, button")}function kx(t,e){if(!t)return;const n=yx(t),r=i=>{i.defaultPrevented||e()};return n?.addEventListener("reset",r,{passive:!0}),()=>n?.removeEventListener("reset",r)}function wx(t,e){const n=t?.closest("fieldset");if(!n)return;e(n.disabled);const r=xt(n),i=new r.MutationObserver(()=>e(n.disabled));return i.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>i.disconnect()}function Yl(t,e){if(!t)return;const{onFieldsetDisabledChange:n,onFormReset:r}=e,i=[kx(t,r),wx(t,n)];return()=>i.forEach(o=>o?.())}var lv=t=>dt(t)&&t.tagName==="IFRAME",xx=t=>!Number.isNaN(parseInt(t.getAttribute("tabindex")||"0",10)),Ex=t=>parseInt(t.getAttribute("tabindex")||"0",10)<0,vp="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",uv=(t,e=!1)=>{if(!t)return[];const n=Array.from(t.querySelectorAll(vp));(e==!0||e=="if-empty"&&n.length===0)&&dt(t)&&dr(t)&&n.unshift(t);const r=n.filter(dr);return r.forEach((i,o)=>{if(lv(i)&&i.contentDocument){const s=i.contentDocument.body;r.splice(o,1,...uv(s))}}),r};function dr(t){return!t||t.closest("[inert]")?!1:t.matches(vp)&&Xw(t)}function cv(t,e){if(!t)return[];const n=Array.from(t.querySelectorAll(vp)),r=n.filter(Vr);return r.forEach((i,o)=>{if(lv(i)&&i.contentDocument){const s=i.contentDocument.body,a=cv(s);r.splice(o,1,...a)}}),!r.length&&e?n:r}function Vr(t){return t!=null&&t.tabIndex>0?!0:dr(t)&&!Ex(t)}function yo(t){return t.tabIndex<0&&(/^(audio|video|details)$/.test(t.localName)||Zw(t))&&!xx(t)?0:t.tabIndex}function dv(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 At(t){let e;const n=globalThis.requestAnimationFrame(()=>{e=t()});return()=>{globalThis.cancelAnimationFrame(n),e?.()}}function Hc(t){const e=ex(t);return Kw(e)?Kt(e).body:dt(e)&&Sx(e)?e:Hc(e)}var Cx=/auto|scroll|overlay|hidden|clip/;function Sx(t){const e=xt(t),{overflow:n,overflowX:r,overflowY:i,display:o}=e.getComputedStyle(t);return Cx.test(n+i+r)&&!["inline","contents"].includes(o)}function Tx(t,e){const{left:n,top:r,width:i,height:o}=e.getBoundingClientRect(),s={x:t.x-n,y:t.y-r},a={x:zh(s.x/i),y:zh(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}}var Di="default",qc="",Ea=new WeakMap;function Ox(t={}){const{target:e,doc:n}=t,r=n??document,i=r.documentElement;return hp()?(Di==="default"&&(qc=i.style.webkitUserSelect,i.style.webkitUserSelect="none"),Di="disabled"):e&&(Ea.set(e,e.style.userSelect),e.style.userSelect="none"),()=>Ax({target:e,doc:r})}function Ax(t={}){const{target:e,doc:n}=t,r=(n??document).documentElement;if(hp()){if(Di!=="disabled")return;Di="restoring",setTimeout(()=>{dv(()=>{Di==="restoring"&&(r.style.webkitUserSelect==="none"&&(r.style.webkitUserSelect=qc||""),qc="",Di="default")})},300)}else if(e&&Ea.has(e)){const i=Ea.get(e);e.style.userSelect==="none"&&(e.style.userSelect=i??""),e.getAttribute("style")===""&&e.removeAttribute("style"),Ea.delete(e)}}function Mx(t={}){const{defer:e,target:n,...r}=t,i=e?At:s=>s(),o=[];return o.push(i(()=>{const s=typeof n=="function"?n():n;o.push(Ox({...r,target:s}))})),()=>{o.forEach(s=>s?.())}}function _x(t,e){const{onPointerMove:n,onPointerUp:r}=e,i=[Ne(t,"pointermove",o=>{const s=fp(o),a=Math.sqrt(s.x**2+s.y**2),l=o.pointerType==="touch"?10:5;if(!(a<l)){if(o.pointerType==="mouse"&&o.button===0){r();return}n({point:s,event:o})}},!1),Ne(t,"pointerup",r,!1),Ne(t,"pointercancel",r,!1),Ne(t,"contextmenu",r,!1),Mx({doc:t})];return()=>{i.forEach(o=>o())}}function pv(t){const{pointerNode:e,keyboardNode:n=e,onPress:r,onPressStart:i,onPressEnd:o,isValidKey:s=b=>b.key==="Enter"}=t;if(!e)return Xs;const a=xt(e),l=Kt(e);let u=Xs,c=Xs,d=Xs;const h=b=>({point:fp(b),event:b});function p(b){i?.(h(b))}function f(b){o?.(h(b))}const m=Ne(e,"pointerdown",b=>{c();const k=Ne(a,"pointerup",w=>{const x=ct(w);qi(e,x)?r?.(h(w)):o?.(h(w))},{passive:!r,once:!0}),v=Ne(a,"pointercancel",f,{passive:!o,once:!0});c=Bu(k,v),l.activeElement===n&&b.pointerType==="mouse"&&b.preventDefault(),p(b)},{passive:!i}),g=Ne(n,"focus",y);u=Bu(m,g);function y(){const b=x=>{if(!s(x))return;const C=A=>{if(!s(A))return;const S=new a.PointerEvent("pointerup"),_=h(S);r?.(_),o?.(_)};c(),c=Ne(n,"keyup",C);const N=new a.PointerEvent("pointerdown");p(N)},k=()=>{const x=new a.PointerEvent("pointercancel");f(x)},v=Ne(n,"keydown",b),w=Ne(n,"blur",k);d=Bu(v,w)}return()=>{u(),c(),d()}}function yp(t,e){return Array.from(t?.querySelectorAll(e)??[])}var hv=t=>t.id;function Dx(t,e,n=hv){return t.find(r=>n(r)===e)}function fv(t,e,n=hv){const r=Dx(t,e,n);return r?t.indexOf(r):-1}function Nx(t,e,n=!0){let r=fv(t,e);return r=n?(r+1)%t.length:Math.min(r+1,t.length-1),t[r]}function Ix(t,e,n=!0){let r=fv(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])}var ju=new WeakMap;function Rx(t,e,n){ju.has(t)||ju.set(t,new Map);const r=ju.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 Px(t,e){return t?Rx(t,"style",()=>{const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}):()=>{}}var bp={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},Fx=1e3/60;function Lx(t,e){const n=t();if(dt(n)&&n.isConnected)return e(n),()=>{};{const r=setInterval(()=>{const i=t();dt(i)&&i.isConnected&&(e(i),clearInterval(r))},Fx);return()=>clearInterval(r)}}function Vx(t,e){const n=[];return t?.forEach(r=>{const i=Lx(r,e);n.push(i)}),()=>{n.forEach(r=>r())}}function Bx(t){return t.mozInputSource===0&&t.isTrusted?!0:t.detail===0&&!t.pointerType}function $x(t){return!(t.metaKey||!iv()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}var jx=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function zx(t,e,n){const r=n?ct(n):null,i=xt(r);return t=t||r instanceof i.HTMLInputElement&&!jx.has(r?.type)||r instanceof i.HTMLTextAreaElement||r instanceof i.HTMLElement&&r.isContentEditable,!(t&&e==="keyboard"&&n instanceof i.KeyboardEvent&&!Reflect.has(Hx,n.key))}var ci=null,Wc=new Set,Lo=new Map,ti=!1,Uc=!1,Hx={Tab:!0,Escape:!0};function Zl(t,e){for(let n of Wc)n(t,e)}function Ha(t){ti=!0,$x(t)&&(ci="keyboard",Zl("keyboard",t))}function Bt(t){ci="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(ti=!0,Zl("pointer",t))}function mv(t){Bx(t)&&(ti=!0,ci="virtual")}function gv(t){const e=ct(t);e===xt(e)||e===Kt(e)||(!ti&&!Uc&&(ci="virtual",Zl("virtual",t)),ti=!1,Uc=!1)}function vv(){ti=!1,Uc=!0}function qx(t){if(typeof window>"u"||Lo.get(xt(t)))return;const e=xt(t),n=Kt(t);let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){ci="virtual",Zl("virtual",null),ti=!0,r.apply(this,arguments)},n.addEventListener("keydown",Ha,!0),n.addEventListener("keyup",Ha,!0),n.addEventListener("click",mv,!0),e.addEventListener("focus",gv,!0),e.addEventListener("blur",vv,!1),typeof e.PointerEvent<"u"?(n.addEventListener("pointerdown",Bt,!0),n.addEventListener("pointermove",Bt,!0),n.addEventListener("pointerup",Bt,!0)):(n.addEventListener("mousedown",Bt,!0),n.addEventListener("mousemove",Bt,!0),n.addEventListener("mouseup",Bt,!0)),e.addEventListener("beforeunload",()=>{Wx(t)},{once:!0}),Lo.set(e,{focus:r})}var Wx=(t,e)=>{const n=xt(t),r=Kt(t);Lo.has(n)&&(n.HTMLElement.prototype.focus=Lo.get(n).focus,r.removeEventListener("keydown",Ha,!0),r.removeEventListener("keyup",Ha,!0),r.removeEventListener("click",mv,!0),n.removeEventListener("focus",gv,!0),n.removeEventListener("blur",vv,!1),typeof n.PointerEvent<"u"?(r.removeEventListener("pointerdown",Bt,!0),r.removeEventListener("pointermove",Bt,!0),r.removeEventListener("pointerup",Bt,!0)):(r.removeEventListener("mousedown",Bt,!0),r.removeEventListener("mousemove",Bt,!0),r.removeEventListener("mouseup",Bt,!0)),Lo.delete(n))};function is(){return ci==="keyboard"}function kp(t={}){const{isTextInput:e,autoFocus:n,onChange:r,root:i}=t;qx(i),r?.({isFocusVisible:n||is(),modality:ci});const o=(s,a)=>{zx(!!e,s,a)&&r?.({isFocusVisible:is(),modality:s})};return Wc.add(o),()=>{Wc.delete(o)}}function Ux(t){return t?Array.isArray(t)?t:[t]:[]}var yv=t=>t[0],bv=t=>t[t.length-1],Kx=(t,e)=>t.indexOf(e)!==-1,Gx=(t,...e)=>t.concat(e),Jx=(t,...e)=>t.filter(n=>!e.includes(n)),Xx=(t,e)=>Kx(t,e)?Jx(t,e):Gx(t,e),qh=t=>t?.constructor.name==="Array",Yx=(t,e)=>{if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Ss(t[n],e[n]))return!1;return!0},Ss=(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(qh(t)&&qh(e))return Yx(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(!Ss(t[o],e[o]))return!1}return!0},Wh=(...t)=>(...e)=>{t.forEach(function(n){n?.(...e)})},Zx=t=>Array.isArray(t),kv=t=>typeof t=="string",Ni=t=>typeof t=="function",Qx=Function.prototype.toString;Qx.call(Object);var{floor:Uh,abs:qa,round:wv,min:e1,max:t1,pow:n1,sign:r1}=Math,So=t=>Number.isNaN(t),wp=t=>So(t)?0:t,i1=(t,e,n)=>t===0?n:e[t-1],o1=(t,e,n)=>t===e.length-1?n:e[t+1],s1=(t,e,n)=>wv((wp(t)-e)/n)*n+e,Ql=(t,e,n)=>e1(t1(wp(t),e),n),xp=(t,e,n)=>(wp(t)-e)/(n-e),xv=(t,e,n,r)=>Ql(s1(t*(n-e)+e,e,r),e,n),Ys=(t,e)=>{let n=t,r=e.toString(),i=r.indexOf("."),o=i>=0?r.length-i:0;if(o>0){let s=n1(10,o);n=wv(n*s)/s}return n},Ev=(t,e,n,r)=>{e=Number(e),n=Number(n);let i=(t-(So(e)?0:e))%r,o=Ys(qa(i)*2>=r?t+r1(i)*(r-qa(i)):t-i,r);return So(e)?!So(n)&&o>n&&(o=e+Uh(Ys((n-e)/r,r))*r):o<e?o=e:!So(n)&&o>n&&(o=e+Uh(Ys((n-e)/r,r))*r),Ys(o,r)},To=(t,e,n)=>t[e]===n?t:[...t.slice(0,e),n,...t.slice(e+1)];function Cv(t,e){const n=i1(t,e.values,e.min),r=o1(t,e.values,e.max);let i=e.values.slice();return function(o){let s=Ev(o,n,r,e.step);return i=To(i,t,o),i[t]=s,i}}function a1(t,e){const n=e.values[t]+e.step;return Cv(t,e)(n)}function l1(t,e){const n=e.values[t]-e.step;return Cv(t,e)(n)}var u1=(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 qa(r-e)<qa(i-e)?n-1:n},c1=(t,e,n,r)=>t.map((i,o)=>({min:o===0?e:t[o-1]+r,max:o===t.length-1?n:t[o+1]-r,value:i})),Kc=(t,e)=>{const[n,r]=t,[i,o]=e;return s=>n===r||i===o?i:i+(o-i)/(r-n)*(s-n)};function Sv(t){if(!d1(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]=Sv(i))}return n}var d1=t=>t&&typeof t=="object"&&t.constructor===Object;function Gc(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}function p1(t,e){if(t==null)throw new Error(e)}function h1(t,e,n){let r=[];for(const i of e)t[i]==null&&r.push(i);if(r.length>0)throw new Error(`[zag-js] missing required props: ${r.join(", ")}`)}function eu(){return{and:(...t)=>function(e){return t.every(n=>e.guard(n))},or:(...t)=>function(e){return t.some(n=>e.guard(n))},not:t=>function(e){return!e.guard(t)}}}function f1(t){const e=()=>{var o;return((o=t.getRootNode)==null?void 0:o.call(t))??document},n=()=>Kt(e()),r=()=>n().defaultView??window,i=()=>nv(e());return{...t,getRootNode:e,getDoc:n,getWin:r,getActiveElement:i,isActiveElement:o=>o===i(),getById:o=>e().getElementById(o)}}function m1(t){return new Proxy({},{get(e,n){return n==="style"?r=>t({style:r}).style:t}})}var Wn=()=>t=>Array.from(new Set(t)),g1=Ln("checkbox").parts("root","label","control","indicator"),Zs=g1.build(),Tv=t=>{var e;return((e=t.ids)==null?void 0:e.root)??`checkbox:${t.id}`},Kh=t=>{var e;return((e=t.ids)==null?void 0:e.label)??`checkbox:${t.id}:label`},v1=t=>{var e;return((e=t.ids)==null?void 0:e.control)??`checkbox:${t.id}:control`},Jc=t=>{var e;return((e=t.ids)==null?void 0:e.hiddenInput)??`checkbox:${t.id}:input`},y1=t=>t.getById(Tv(t)),Oo=t=>t.getById(Jc(t));function b1(t,e){const{send:n,context:r,prop:i,computed:o,scope:s}=t,a=i("disabled"),l=i("readOnly"),u=!a&&r.get("focused"),c=!a&&r.get("focusVisible"),d=o("checked"),h=o("indeterminate"),p={"data-active":G(r.get("active")),"data-focus":G(u),"data-focus-visible":G(c),"data-readonly":G(l),"data-hover":G(r.get("hovered")),"data-disabled":G(a),"data-state":h?"indeterminate":d?"checked":"unchecked","data-invalid":i("invalid")};return{checked:d,disabled:a,indeterminate:h,focused:u,checkedState:d,setChecked(f){n({type:"CHECKED.SET",checked:f,isTrusted:!1})},toggleChecked(){n({type:"CHECKED.TOGGLE",checked:d,isTrusted:!1})},getRootProps(){return e.label({...Zs.root.attrs,...p,dir:i("dir"),id:Tv(s),htmlFor:Jc(s),onPointerMove(){a||n({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){a||n({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(f){ct(f)===Oo(s)&&f.stopPropagation()}})},getLabelProps(){return e.element({...Zs.label.attrs,...p,dir:i("dir"),id:Kh(s)})},getControlProps(){return e.element({...Zs.control.attrs,...p,dir:i("dir"),id:v1(s),"aria-hidden":!0})},getIndicatorProps(){return e.element({...Zs.indicator.attrs,...p,dir:i("dir"),hidden:!h&&!d})},getHiddenInputProps(){return e.input({id:Jc(s),type:"checkbox",required:i("required"),defaultChecked:d,disabled:a,"aria-labelledby":Kh(s),"aria-invalid":i("invalid"),name:i("name"),form:i("form"),value:i("value"),style:bp,onFocus(){const f=is();n({type:"CONTEXT.SET",context:{focused:!0,focusVisible:f}})},onBlur(){n({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(f){if(l){f.preventDefault();return}const m=f.currentTarget.checked;n({type:"CHECKED.SET",checked:m,isTrusted:!0})}})}}}var{not:Gh}=eu(),k1={props({props:t}){return{value:"on",...t,defaultChecked:!!t.defaultChecked}},initialState(){return"ready"},context({prop:t,bindable:e}){return{checked:e(()=>({defaultValue:t("defaultChecked"),value:t("checked"),onChange(n){var r;(r=t("onCheckedChange"))==null||r({checked:n})}})),fieldsetDisabled:e(()=>({defaultValue:!1})),focusVisible:e(()=>({defaultValue:!1})),active:e(()=>({defaultValue:!1})),focused:e(()=>({defaultValue:!1})),hovered:e(()=>({defaultValue:!1}))}},watch({track:t,context:e,prop:n,action:r}){t([()=>n("disabled")],()=>{r(["removeFocusIfNeeded"])}),t([()=>e.get("checked")],()=>{r(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:Gh("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:Gh("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{indeterminate:({context:t})=>Ca(t.get("checked")),checked:({context:t})=>w1(t.get("checked")),disabled:({context:t,prop:e})=>!!e("disabled")||t.get("fieldsetDisabled")},states:{ready:{}},implementations:{guards:{isTrusted:({event:t})=>!!t.isTrusted},effects:{trackPressEvent({context:t,computed:e,scope:n}){if(!e("disabled"))return pv({pointerNode:y1(n),keyboardNode:Oo(n),isValidKey:r=>r.key===" ",onPress:()=>t.set("active",!1),onPressStart:()=>t.set("active",!0),onPressEnd:()=>t.set("active",!1)})},trackFocusVisible({computed:t,scope:e}){var n;if(!t("disabled"))return kp({root:(n=e.getRootNode)==null?void 0:n.call(e)})},trackFormControlState({context:t,scope:e}){return Yl(Oo(e),{onFieldsetDisabledChange(n){t.set("fieldsetDisabled",n)},onFormReset(){t.set("checked",t.initial("checked"))}})}},actions:{setContext({context:t,event:e}){for(const n in e.context)t.set(n,e.context[n])},syncInputElement({context:t,computed:e,scope:n}){const r=Oo(n);r&&(mp(r,e("checked")),r.indeterminate=Ca(t.get("checked")))},removeFocusIfNeeded({context:t,prop:e}){e("disabled")&&t.get("focused")&&(t.set("focused",!1),t.set("focusVisible",!1))},setChecked({context:t,event:e}){t.set("checked",e.checked)},toggleChecked({context:t,computed:e}){const n=Ca(e("checked"))?!0:!e("checked");t.set("checked",n)},dispatchChangeEvent({computed:t,scope:e}){queueMicrotask(()=>{const n=Oo(e);gp(n,{checked:t("checked")})})}}}};function Ca(t){return t==="indeterminate"}function w1(t){return Ca(t)?!1:!!t}Wn()(["defaultChecked","checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]);function x1(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}var Jh={htmlFor:"for",className:"class",onDoubleClick:"onDblclick",onChange:"onInput",onFocus:"onFocusin",onBlur:"onFocusout",defaultValue:"value",defaultChecked:"checked"},E1="viewBox,className,preserveAspectRatio,fillRule,clipPath,clipRule,strokeWidth,strokeLinecap,strokeLinejoin,strokeDasharray,strokeDashoffset,strokeMiterlimit".split(",");function C1(t){return t in Jh?Jh[t]:t.startsWith("on")?`on${x1(t.substr(2))}`:E1.includes(t)?t:t.toLowerCase()}var di=m1(t=>{const e={};for(const n in t){const r=t[n];n==="children"?typeof r=="string"&&(e.innerHTML=r):e[C1(n)]=t[n]}return e});function Xh(t){const e=t().defaultValue??t().value,n=t().isEqual??Ss,r=qt(e),i=I(()=>t().value!==void 0),o=qt(i.value?t().value:r.value);return{initial:e,ref:o,get(){return i.value?t().value:r.value},set(s){var a,l;const u=i.value?t().value:r.value,c=Ni(s)?s(u):s;t().debug&&console.log(`[bindable > ${t().debug}] setValue`,{next:c,prev:u}),i.value||(r.value=c),n(c,u)||(l=(a=t()).onChange)==null||l.call(a,c,u)},invoke(s,a){var l,u;(u=(l=t()).onChange)==null||u.call(l,s,a)},hash(s){var a,l;return((l=(a=t()).hash)==null?void 0:l.call(a,s))??String(s)}}}function S1(t){const e=X(t);return{get(n){return e.value[n]},set(n,r){e.value[n]=r}}}var T1=(t,e)=>{Ee(()=>[...t.map(n=>n())],(n,r)=>{let i=!1;for(let o=0;o<n.length;o++)if(!Ss(r[o],He(n[o]))){i=!0;break}i&&e()})};function pi(t,e={}){var n,r,i;const o=I(()=>{const{id:S,ids:_,getRootNode:L}=He(e);return f1({id:S,ids:_,getRootNode:L})}),s=(...S)=>{t.debug&&console.log(...S)},a=I(()=>{var S;return((S=t.props)==null?void 0:S.call(t,{props:Sv(He(e)),get scope(){return o.value}}))??He(e)}),l=O1(a),u=((n=t.context)==null?void 0:n.call(t,{prop:l,bindable:Xh,get scope(){return o.value},flush:Yh,getContext(){return c},getComputed(){return C}}))??{},c={get(S){var _;return(_=u[S])==null?void 0:_.get()},set(S,_){var L;(L=u[S])==null||L.set(_)},initial(S){var _;return(_=u[S])==null?void 0:_.initial},hash(S){var _,L;const W=(_=u[S])==null?void 0:_.get();return(L=u[S])==null?void 0:L.hash(W)}};let d=new Map,h=null,p={current:null},f={current:{type:"__init__"}};const m=()=>({...f.current,current(){return f.current},previous(){return p.current}}),g=()=>({...N,matches(...S){const _=N.get();return S.includes(_)},hasTag(S){var _,L;const W=N.get();return!!((L=(_=t.states[W])==null?void 0:_.tags)!=null&&L.includes(S))}}),y=S1(((r=t.refs)==null?void 0:r.call(t,{prop:l,context:c}))??{}),b=()=>({state:g(),context:c,event:m(),prop:l,send:A,action:k,guard:v,track:T1,refs:y,computed:C,flush:Yh,get scope(){return o.value},choose:x}),k=S=>{const _=Ni(S)?S(b()):S;if(!_)return;const L=_.map(W=>{var q,K;const J=(K=(q=t.implementations)==null?void 0:q.actions)==null?void 0:K[W];return J||Gc(`[zag-js] No implementation found for action "${JSON.stringify(W)}"`),J});for(const W of L)W?.(b())},v=S=>{var _,L;return Ni(S)?S(b()):(L=(_=t.implementations)==null?void 0:_.guards)==null?void 0:L[S](b())},w=S=>{const _=Ni(S)?S(b()):S;if(!_)return;const L=_.map(q=>{var K,J;const ue=(J=(K=t.implementations)==null?void 0:K.effects)==null?void 0:J[q];return ue||Gc(`[zag-js] No implementation found for effect "${JSON.stringify(q)}"`),ue}),W=[];for(const q of L){const K=q?.(b());K&&W.push(K)}return()=>W.forEach(q=>q?.())},x=S=>Ux(S).find(_=>{let L=!_.guard;return kv(_.guard)?L=!!v(_.guard):Ni(_.guard)&&(L=_.guard(b())),L}),C=S=>{p1(t.computed,"[zag-js] No computed object found on machine");const _=t.computed[S];return _({context:c,event:m(),prop:l,refs:y,get scope(){return o.value},computed:C})},N=Xh(()=>({defaultValue:t.initialState({prop:l}),onChange(S,_){var L,W,q;if(_){const J=d.get(_);J?.(),d.delete(_)}_&&k((L=t.states[_])==null?void 0:L.exit),k(h?.actions);const K=w((W=t.states[S])==null?void 0:W.effects);if(K&&d.set(S,K),_==="__init__"){k(t.entry);const J=w(t.effects);J&&d.set("__init__",J)}k((q=t.states[S])==null?void 0:q.entry)}}));qn(()=>{N.invoke(N.initial,"__init__")}),ao(()=>{const S=d.values();for(const _ of S)_?.();d=new Map,k(t.exit)});const A=S=>{var _,L;p.current=f.current,f.current=S,s("send",S);let W=N.get();const q=((_=t.states[W].on)==null?void 0:_[S.type])??((L=t.on)==null?void 0:L[S.type]),K=x(q);if(!K)return;h=K;const J=K.target??W;s("transition",K),J!==W?N.set(J):k(K.actions)};return(i=t.watch)==null||i.call(t,b()),{state:g(),send:A,context:c,prop:l,get scope(){return o.value},refs:y,computed:C,event:m()}}function O1(t){return function(e){return t.value[e]}}var Yh=t=>{kr().then(()=>{t()})};function Qt(t={}){const{prefix:e}=t,n=_w();return e?`${e}-${n}`:n}const A1={key:0,class:"k-checkbox__help"},Zh=Q({__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:l,value:u}=n;return l instanceof Array?l.some(c=>Co(c)===Co(u)):!!l};function o(l){const{modelValue:u,value:c}=n;if(!(u instanceof Array))return r("update:modelValue",typeof l=="boolean"?l:void 0);if(!(typeof l!="boolean"||!c))return l?r("update:modelValue",[...u,c]):r("update:modelValue",u.filter(d=>Co(d)!==Co(c)))}const s=pi(k1,{id:Qt(),defaultChecked:i(),onCheckedChange:({checked:l})=>{if(i()!==l)return o(l)},disabled:n.disabled,required:n.required}),a=I(()=>b1(s,di));return Ee(()=>n.modelValue,()=>{const l=i();if(a.value.checked!==l)return a.value.setChecked(l)}),(l,u)=>(E(),O("label",ne({class:"k-checkbox"},a.value.getRootProps()),[z("div",be(Ie(a.value.getControlProps())),[a.value.checked?(E(),$(B(Ze),{key:0,icon:"fa-pro-solid:check"})):R("",!0)],16),l.label||l.$slots.help||l.$slots.default?(E(),O("span",be(ne({key:0},a.value.getLabelProps())),[z("span",{class:Ce(["k-checkbox__label",{"k-checkbox__label-required":l.required}])},[F(l.$slots,"default",{},()=>[$e(oe(l.label),1)])],2),l.$slots.help||l.help?(E(),O("span",A1,[F(l.$slots,"help",{},()=>[$e(oe(l.help),1)])])):R("",!0)],16)):R("",!0),z("input",be(Ie(a.value.getHiddenInputProps())),null,16)],16))}}),tu=Symbol("form-control"),M1={class:"k-formcontrol"},_1=["for"],D1={key:1,class:"k-formcontrol__error"},N1={key:2,class:"k-formcontrol__help"},I1=Q({__name:"FormControl",props:{label:{},help:{},error:{},required:{type:Boolean}},emits:["blur","focus"],setup(t,{emit:e}){const n=t,r=e,i=Qt({prefix:"k-formcontrol"}),o=I(()=>`${i}_label`),s=I(()=>`${i}_help`),a={onBlur:()=>r("blur"),onFocus:()=>r("focus")};return bk(tu,I(()=>({...n,id:i,labelId:o.value,helpId:s.value,invalid:!!n.error,required:n.required,events:a}))),(l,u)=>(E(),O("div",M1,[l.$slots.label||l.label?(E(),O("label",{key:0,class:Ce(["k-formcontrol__label",{"k-formcontrol__label-required":l.required}]),for:B(i)},[F(l.$slots,"label",{},()=>[$e(oe(l.label),1)])],10,_1)):R("",!0),F(l.$slots,"default",{id:B(i)}),l.$slots.error||l.error?(E(),O("span",D1,[F(l.$slots,"error",{},()=>[$e(oe(l.error),1)])])):R("",!0),l.$slots.help||l.help?(E(),O("span",N1,[F(l.$slots,"help",{},()=>[$e(oe(l.help),1)])])):R("",!0)]))}}),R1={class:"k-filter-type-dropdown"},P1=Q({__name:"Dropdown",props:Lc({label:{},items:{}},{modelValue:{default:""},modelModifiers:{}}),emits:Lc(["disable"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=Pg(t,"modelValue"),i=I(()=>{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=I(()=>n.items.map(a=>({...a,action:()=>s.value=a.value}))),s=I({get(){return r.value},set(a){r.value=a}});return(a,l)=>(E(),O("div",R1,[he(B(I1),{label:a.label},{default:Z(()=>[he(B(pu),{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"])]))}}),F1=Object.freeze(Object.defineProperty({__proto__:null,default:P1},Symbol.toStringTag,{value:"Module"}));function L1(t,e){let n,r,i;const o=qt(!0),s=()=>{o.value=!0,i()};Ee(t,s,{flush:"sync"});const a=typeof e=="function"?e:e.get,l=typeof e=="function"?void 0:e.set,u=ep((c,d)=>(r=c,i=d,{get(){return o.value&&(n=a(n),o.value=!1),r(),n},set(h){l?.(h)}}));return Object.isExtensible(u)&&(u.trigger=s),u}function Ts(t){return gk()?(vk(t),!0):!1}const Os=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const V1=t=>t!=null,B1=Object.prototype.toString,Ov=t=>B1.call(t)==="[object Object]",$1=()=>{},Qh=j1();function j1(){var t,e;return Os&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window?.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function z1(...t){if(t.length!==1)return mk(...t);const e=t[0];return typeof e=="function"?Qd(ep(()=>({get:e,set:$1}))):X(e)}function H1(t){let e;function n(){return e||(e=t()),e}return n.reset=async()=>{const r=e;e=void 0,r&&await r},n}function Gr(t){return Array.isArray(t)?t:[t]}function q1(t,e,n={}){const{immediate:r=!0,immediateCallback:i=!1}=n,o=qt(!1);let s=null;function a(){s&&(clearTimeout(s),s=null)}function l(){o.value=!1,a()}function u(...c){i&&t(),a(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=null,t(...c)},He(e))}return r&&(o.value=!0,Os&&u()),Ts(l),{isPending:Qd(o),start:u,stop:l}}function Av(t,e,n){return Ee(t,e,{...n,immediate:!0})}const Mv=Os?window:void 0,_v=Os?window.navigator:void 0;function Dv(t){var e;const n=He(t);return(e=n?.$el)!=null?e:n}function Ep(...t){const e=[],n=()=>{e.forEach(a=>a()),e.length=0},r=(a,l,u,c)=>(a.addEventListener(l,u,c),()=>a.removeEventListener(l,u,c)),i=I(()=>{const a=Gr(He(t[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),o=Av(()=>{var a,l;return[(l=(a=i.value)==null?void 0:a.map(u=>Dv(u)))!=null?l:[Mv].filter(u=>u!=null),Gr(He(i.value?t[1]:t[0])),Gr(B(i.value?t[2]:t[1])),He(i.value?t[3]:t[2])]},([a,l,u,c])=>{if(n(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(u!=null&&u.length))return;const d=Ov(c)?{...c}:c;e.push(...a.flatMap(h=>l.flatMap(p=>u.map(f=>r(h,p,f,d)))))},{flush:"post"}),s=()=>{o(),n()};return Ts(n),s}function W1(){const t=qt(!1),e=np();return e&&qn(()=>{t.value=!0},e),t}function Cp(t){const e=W1();return I(()=>(e.value,!!t()))}function U1(t,e,n={}){const{window:r=Mv,...i}=n;let o;const s=Cp(()=>r&&"MutationObserver"in r),a=()=>{o&&(o.disconnect(),o=void 0)},l=I(()=>{const h=He(t),p=Gr(h).map(Dv).filter(V1);return new Set(p)}),u=Ee(()=>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=()=>{u(),a()};return Ts(d),{isSupported:s,stop:d,takeRecords:c}}function ef(t,e={}){const{controls:n=!1,navigator:r=_v}=e,i=Cp(()=>r&&"permissions"in r),o=qt(),s=typeof t=="string"?{name:t}:t,a=qt(),l=()=>{var c,d;a.value=(d=(c=o.value)==null?void 0:c.state)!=null?d:"prompt"};Ep(o,"change",l,{passive:!0});const u=H1(async()=>{if(i.value){if(!o.value)try{o.value=await r.permissions.query(s)}catch{o.value=void 0}finally{l()}if(n)return Co(o.value)}});return u(),n?{state:a,isSupported:i,query:u}:a}function K1(t={}){const{navigator:e=_v,read:n=!1,source:r,copiedDuring:i=1500,legacy:o=!1}=t,s=Cp(()=>e&&"clipboard"in e),a=ef("clipboard-read"),l=ef("clipboard-write"),u=I(()=>s.value||o),c=qt(""),d=qt(!1),h=q1(()=>d.value=!1,i,{immediate:!1});async function p(){let b=!(s.value&&y(a.value));if(!b)try{c.value=await e.clipboard.readText()}catch{b=!0}b&&(c.value=g())}u.value&&n&&Ep(["copy","cut"],p,{passive:!0});async function f(b=He(r)){if(u.value&&b!=null){let k=!(s.value&&y(l.value));if(!k)try{await e.clipboard.writeText(b)}catch{k=!0}k&&m(b),c.value=b,d.value=!0,h.start()}}function m(b){const k=document.createElement("textarea");k.value=b??"",k.style.position="absolute",k.style.opacity="0",document.body.appendChild(k),k.select(),document.execCommand("copy"),k.remove()}function g(){var b,k,v;return(v=(k=(b=document?.getSelection)==null?void 0:b.call(document))==null?void 0:k.toString())!=null?v:""}function y(b){return b==="granted"||b==="prompt"}return{isSupported:u,text:c,copied:d,copy:f}}function nu(t){const e=np(),n=L1(()=>null,()=>e.proxy.$el);return yk(n.trigger),qn(n.trigger),n}const G1={class:"k-filter-type-range"},J1={class:"k-filter-type-range__header"},X1={class:"k-filter-type-range__header-label"},Y1={class:"k-filter-type-range__value"},Z1={class:"k-filter-type-range__value-display"},Q1=Q({__name:"RangeSlider",props:Lc({min:{},max:{},label:{},suffix:{},step:{},type:{}},{modelValue:{default:[0,1e3]},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=Pg(t,"modelValue"),n=nu();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(),O("div",G1,[z("div",J1,[z("label",X1,[z("span",null,oe(s.label),1),he(B(Ze),{icon:s.$attrs.icon},null,8,["icon"])]),F(s.$slots,"remove")]),z("div",Y1,[he(B(cC),ne({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"]),z("div",Z1,[z("span",null,oe(o(e.value[0])),1),z("span",null,oe(o(e.value[1])),1)])])]))}}),eE=Object.freeze(Object.defineProperty({__proto__:null,default:Q1},Symbol.toStringTag,{value:"Module"})),tf=Object.assign({"./Dropdown.vue":F1,"./RangeSlider.vue":eE});for(const t in tf)t.replace(/(\.\/|\.vue)/g,""),tf[t].default;function pr(t){return typeof t=="string"||t instanceof String}function nf(t){var e;return typeof t=="object"&&t!=null&&(t==null||(e=t.constructor)==null?void 0:e.name)==="Object"}function Nv(t,e){return Array.isArray(e)?Nv(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 U={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function tE(t){switch(t){case U.LEFT:return U.FORCE_LEFT;case U.RIGHT:return U.FORCE_RIGHT;default:return t}}function zu(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Wa(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(!Wa(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(!Wa(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 nE{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?U.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?U.RIGHT:U.LEFT}}function ie(t,e){return new ie.InputMask(t,e)}function Iv(t){if(t==null)throw new Error("mask property should be defined");return t instanceof RegExp?ie.MaskedRegExp:pr(t)?ie.MaskedPattern:t===Date?ie.MaskedDate:t===Number?ie.MaskedNumber:Array.isArray(t)||t===Array?ie.MaskedDynamic:ie.Masked&&t.prototype instanceof ie.Masked?t:ie.Masked&&t instanceof ie.Masked?t.constructor:t instanceof Function?ie.MaskedFunction:(console.warn("Mask not found for mask",t),ie.Masked)}function ss(t){if(!t)throw new Error("Options in not defined");if(ie.Masked){if(t.prototype instanceof ie.Masked)return{mask:t};const{mask:e=void 0,...n}=t instanceof ie.Masked?{mask:t}:nf(t)&&t.mask instanceof ie.Masked?t:{};if(e){const r=e.mask;return{...Nv(e,(i,o)=>!o.startsWith("_")),mask:e.constructor,_mask:r,...n}}}return nf(t)?{...t}:{mask:t}}function $n(t){if(ie.Masked&&t instanceof ie.Masked)return t;const e=ss(t),n=Iv(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)}ie.createMask=$n;class Sp{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}}ie.MaskElement=Sp;const rf=90,rE=89;class ru extends Sp{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===rf&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===rE&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===rf&&(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={}}}ie.HTMLMaskElement=ru;class iE extends ru{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}}ie.HTMLMaskElement=ru;class Rv extends ru{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}}ie.HTMLContenteditableMaskElement=Rv;class iu{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>iu.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}}iu.MAX_LENGTH=100;class oE{constructor(e,n){this.el=e instanceof Sp?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new Rv(e):new iE(e),this.masked=$n(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new iu,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 ie.Masked)&&this.masked.constructor===Iv(e)){this.masked.updateOptions({mask:e});return}const n=e instanceof ie.Masked?e:$n({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,U.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 nE({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:U.NONE;let s=this.masked.nearestInputPos(n.startChangePos+i,o);o!==U.NONE&&(s=this.masked.nearestInputPos(s,U.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}}ie.InputMask=oE;class de{static normalize(e){return Array.isArray(e)?e:[e,new de]}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}}ie.ChangeDetails=de;class mn{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 it{constructor(e){this._value="",this._update({...it.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 mn(this.extractInput(e,n),e)}appendTail(e){return pr(e)&&(e=new mn(String(e))),e.appendTo(this)}_appendCharRaw(e,n){return e?(this._value+=e,new de({inserted:e,rawInserted:e})):new de}_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 de,this.state=i,r&&s&&(r.state=s))}return o}_appendPlaceholder(){return new de}_appendEager(){return new de}append(e,n,r){if(!pr(e))throw new Error("value should be string");const i=pr(r)?new mn(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 de}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={}),de.normalize(this.prepare?this.prepare(e,this,n):e)}doPrepareChar(e,n){return n===void 0&&(n={}),de.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=U.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=tE(i),u=this.extractInput(0,s,{raw:!0}));let c=e;const d=new de;if(i!==U.NONE&&(c=this.nearestInputPos(e,n>1&&e!==0&&!l?U.NONE:i),d.tailShift=c-e),d.aggregate(this.remove(c)),l&&i!==U.NONE&&u===this.rawInputValue)if(i===U.FORCE_LEFT){let h;for(;u===this.rawInputValue&&(h=this.displayValue.length);)d.aggregate(new de({tailShift:-1})).aggregate(this.remove(h-1))}else i===U.FORCE_RIGHT&&a.unshift();return d.aggregate(this.append(r,o,a))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!Wa(this,e)}typedValueEquals(e){const n=this.typedValue;return e===n||it.EMPTY_VALUES.includes(e)&&it.EMPTY_VALUES.includes(n)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new de}}it.DEFAULTS={skipInvalid:!0};it.EMPTY_VALUES=[void 0,null,""];ie.Masked=it;class qr{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=pr(e)?new mn(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 mn)r?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof qr){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 ie.MaskedPattern))return new mn(this.toString()).appendTo(e);const n=new de;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 qr||e._stops.indexOf(s)>=0)&&n.aggregate(e._appendPlaceholder(s)),a=i instanceof qr&&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 qr:new mn;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 sE{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,U.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,U.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,U.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,U.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,U.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,U.NONE),!0})}}class Pv{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 de}nearestInputPos(e,n){n===void 0&&(n=U.NONE);const r=0,i=this._value.length;switch(n){case U.LEFT:case U.FORCE_LEFT:return r;case U.NONE:case U.RIGHT:case U.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 de;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 de({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 de;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new mn("")}appendTail(e){return pr(e)&&(e=new mn(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 Ua{constructor(e){const{parent:n,isOptional:r,placeholderChar:i,displayChar:o,lazy:s,eager:a,...l}=e;this.masked=$n(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 de}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 de;const r=this.masked.state;let i=this.masked._appendChar(e,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i=new de,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 de:(this.isFilled=!0,new de({inserted:this.placeholderChar}))}_appendEager(){return new de}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=U.NONE);const r=0,i=this.value.length,o=Math.min(Math.max(e,r),i);switch(n){case U.LEFT:case U.FORCE_LEFT:return this.isComplete?o:r;case U.RIGHT:case U.FORCE_RIGHT:return this.isComplete?o:i;case U.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 de}}Ua.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 aE extends it{updateOptions(e){super.updateOptions(e)}_update(e){const n=e.mask;n&&(e.validate=r=>r.search(n)>=0),super._update(e)}}ie.MaskedRegExp=aE;class ot extends it{constructor(e){super({...ot.DEFAULTS,...e,definitions:Object.assign({},Ua.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}=ss(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 ie.RepeatBlock(m):$n(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===ot.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(s==="{"||s==="}"){r=!r;continue}if(s==="["||s==="]"){i=!i;continue}if(s===ot.ESCAPE_CHAR){if(++o,s=n[o],!s)break;a=!1}const l=a?new Ua({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...ss(e[s]),parent:this}):new Pv({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 de;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 de;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 qr;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 qr&&(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 de;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=U.NONE),!this._blocks.length)return 0;const r=new sE(this,e);if(n===U.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===U.LEFT||n===U.FORCE_LEFT){if(n===U.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===e)return e;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===U.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===U.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===U.RIGHT||n===U.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===U.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(e,U.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 de;return this._forEachBlocksInRange(0,this.displayValue.length,r=>n.aggregate(r.pad(e))),n}}ot.DEFAULTS={...it.DEFAULTS,lazy:!0,placeholderChar:"_"};ot.STOP_CHAR="`";ot.ESCAPE_CHAR="\\";ot.InputDefinition=Ua;ot.FixedDefinition=Pv;ie.MaskedPattern=ot;class Sa extends ot{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 de;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}}ie.MaskedRange=Sa;const lE="d{.}`m{.}`Y";class In extends ot{static extractPatternOptions(e){const{mask:n,pattern:r,...i}=e;return{...i,mask:pr(n)?n:r}}constructor(e){super(In.extractPatternOptions({...In.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:n,pattern:r,blocks:i,...o}={...In.DEFAULTS,...e},s=Object.assign({},In.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:pr(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(In.extractPatternOptions(e))}}In.GET_DEFAULT_BLOCKS=()=>({d:{mask:Sa,from:1,to:31,maxLength:2},m:{mask:Sa,from:1,to:12,maxLength:2},Y:{mask:Sa,from:1900,to:9999}});In.DEFAULTS={...ot.DEFAULTS,mask:Date,pattern:lE,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)}};ie.MaskedDate=In;class ou extends it{constructor(e){super({...ou.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}=ss(n),o=$n({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 de,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 de;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 de;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 Wa(n,o)&&n.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(e))}}ou.DEFAULTS={...it.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,U.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,U.FORCE_LEFT)))}});return o.sort((s,a)=>a.weight-s.weight||a.totalInputPositions-s.totalInputPositions),e.compiledMasks[o[0].index]}};ie.MaskedDynamic=ou;class su extends ot{constructor(e){super({...su.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,U.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 de({skip:!this.isComplete})}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new mn("",e)}remove(e,n){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),e===n)return new de;const r=Math.min(super.nearestInputPos(0,U.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}}su.DEFAULTS={...ot.DEFAULTS,matchValue:(t,e,n)=>t.indexOf(e,n)===n};ie.MaskedEnum=su;class uE extends it{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}ie.MaskedFunction=uE;var Fv;class St extends it{constructor(e){super({...St.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+zu(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(zu).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(zu(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(St.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 de({inserted:this._value.slice(o.length),rawInserted:l?"":e,skip:l}):(this._value=o,u=new de),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 de({tailShift:(s-o)*this.thousandsSeparator.length})}nearestInputPos(e,n){if(!this.thousandsSeparator)return e;switch(n){case U.NONE:case U.LEFT:case U.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===U.FORCE_LEFT)return r}break}case U.RIGHT:case U.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===St.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,St.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(St.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)||St.EMPTY_VALUES.includes(e)&&St.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}Fv=St;St.UNMASKED_RADIX=".";St.EMPTY_VALUES=[...it.EMPTY_VALUES,0];St.DEFAULTS={...it.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Fv.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})};ie.MaskedNumber=St;const Xc={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Lv(t,e,n){e===void 0&&(e=Xc.MASKED),n===void 0&&(n=Xc.MASKED);const r=$n(t);return i=>r.runIsolated(o=>(o[e]=i,o[n]))}function cE(t,e,n,r){return Lv(e,n,r)(t)}ie.PIPE_TYPE=Xc;ie.createPipe=Lv;ie.pipe=cE;class dE extends ot{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}=ss(e);this._blockOpts=Object.assign({},this._blockOpts,s);const a=$n(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($n(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,n){n===void 0&&(n={});const r=new de;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}}ie.RepeatBlock=dE;try{globalThis.IMask=ie}catch{}function pE(t,e){let{emit:n,onAccept:r,onComplete:i,defaultValue:o,defaultUnmaskedValue:s,defaultTypedValue:a}=e===void 0?{}:e;const l=wk(t)?t:X(t),u=X(),c=X(),d=X(""),h=X(""),p=X();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(S){b(),n&&(n("accept",d.value,S),n("accept:masked",d.value,S),n("accept:typed",p.value,S),n("accept:unmasked",h.value,S)),r?.(S)}function v(S){n&&(n("complete",c.value.value,S),n("complete:masked",c.value.value,S),n("complete:typed",c.value.typedValue,S),n("complete:unmasked",c.value.unmaskedValue,S)),i?.(S)}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)};Ee(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)};Ee(d,x);const C=()=>{!c.value||p.value===void 0||(y!==p.value&&(c.value.typedValue=p.value,c.value.masked.typedValueEquals(p.value)||k()),y=void 0)};Ee(p,C);function N(){f=u.value;const S=l.value;!f||!(S!=null&&S.mask)||(c.value=ie(f,S),o!==void 0&&(d.value=o),s!==void 0&&(h.value=s),a!==void 0&&(p.value=a),w(),x(),C(),b(),c.value.on("accept",k).on("complete",v))}function A(){var S;(S=c.value)==null||S.destroy(),c.value=void 0}return qn(N),xk(A),Ee([u,l],()=>{const S=u.value,_=l.value;(!(_!=null&&_.mask)||S!==f)&&A(),S&&(c.value?c.value.updateOptions(_):N())}),{el:u,mask:Qd(c),masked:d,unmasked:h,typed:p}}const hE={key:0,class:"k-input__prefix"},fE=["id","aria-labelledby","aria-describedby","required","type"],mE={key:1,class:"k-input__suffix"},gE=Q({__name:"Input",props:{invalid:{type:Boolean},id:{},modelValue:{},prefix:{},suffix:{},mask:{},align:{default:"left"},type:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=Vg(),r=t,i=e;function o(p){r.mask||i("update:modelValue",p.target.value)}const s=rn("k-input",{variants:{invalid:{true:"k-input--invalid"},align:{left:"k-input--align-left",right:"k-input--align-right"}}}),a=rp(tu,I(()=>({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}=pE(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 qn(()=>{Ee(()=>r.modelValue,p=>{r.mask&&c.value!==String(p)&&(c.value=String(p)),r.mask||(h.value.value=p)},{immediate:!0})}),(p,f)=>(E(),O("div",{class:Ce(B(s)({invalid:B(a).invalid,align:p.align}))},[p.$slots.prefix||p.prefix?(E(),O("span",hE,[F(p.$slots,"prefix",{},()=>[$e(oe(p.prefix),1)])])):R("",!0),z("input",ne({class:"k-input__input",id:B(a).id,"aria-labelledby":B(a).labelId,"aria-describedby":B(a).helpId,required:B(a).required,onInput:o,onBlur:u,onFocus:l,ref_key:"el",ref:h,type:r.type},{...B(a).events,...p.$attrs}),null,16,fE),p.$slots.suffix||p.suffix?(E(),O("span",mE,[F(p.$slots,"suffix",{},()=>[$e(oe(p.suffix),1)])])):R("",!0)],2))}}),vE=["id","value","aria-labelledby","aria-describedby"],vL=Q({__name:"TextArea",props:{invalid:{type:Boolean},id:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(a){r("update:modelValue",a.target.value)}const o=rn("k-textarea",{variants:{invalid:{true:"k-textarea--invalid"}}}),s=rp(tu,I(()=>({id:n.id,invalid:n.invalid})));return(a,l)=>(E(),O("textarea",ne({class:B(o)({invalid:B(s).invalid}),id:B(s).id,value:a.modelValue,"aria-labelledby":B(s).labelId,"aria-describedby":B(s).helpId,onInput:i},a.$attrs),null,16,vE))}});let yE=class{constructor(t,e){Yt(this,"key"),Yt(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(){}},bE=class{constructor(t,e){Yt(this,"key"),Yt(this,"goto"),Yt(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 kE{constructor(e,n){Yt(this,"key"),Yt(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 wE=Object.freeze(Object.defineProperty({__proto__:null,localStorage:yE,none:bE,sessionStorage:kE},Symbol.toStringTag,{value:"Module"})),xE=["data-step"],EE={key:0,class:"k-stepper-breadcrumbs-wrapper"},CE={key:0,class:"k-stepper__breadcrumb-arrow"},SE=["disabled","onClick"],TE={class:"k-stepper__breadcrumb-icon"},OE={class:"k-stepper__breadcrumb-label"},AE={class:"k-stepper__component-wrapper"},ME={key:0,class:"k-stepper__navigation"},yL=Q({__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=X(),i=X(),o=X(n.steps[0].id);let s;const a=typeof n.stateHandler=="string"?wE[n.stateHandler]:n.stateHandler;s=new a(n.stateKey,f),ao(()=>s.destroy());const l=I(()=>c(o.value)),u=I(()=>{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=sp({next:h,prev:p,goto:f});Ee(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 C=["top","bottom"].includes(x)?"h":"v";return`k-stepper-${v}-${C}-${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(),O("div",{class:Ce(`k-stepper k-stepper--breadcrumb-placement-${k.breadcrumbPlacement}`),"data-step":o.value},[k.hidebreadcrumbs?R("",!0):(E(),O("div",EE,[F(k.$slots,"before-breadcrumbs",be(Ie({meta:l.value,navigate:m}))),z("div",{class:"k-stepper__breadcrumbs",ref_key:"breadcrumb",ref:r},[(E(!0),O(De,null,_t(k.steps,(w,x)=>(E(),O(De,null,[x>0?(E(),O("div",CE)):R("",!0),F(k.$slots,"breadcrumb",{step:w,isActive:w.id===o.value,index:x,select:()=>f(w.id)},()=>[z("button",{type:"button",class:Ce(["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:C=>f(w.id)},[z("span",TE,[F(k.$slots,"breadcrumb-icon",{step:w},()=>[w.isValid===!0?(E(),$(B(Ze),{key:0,icon:"heroicons-solid:check",width:12})):w.isValid===!1?(E(),$(B(Ze),{key:1,icon:"heroicons:exclamation-triangle",width:17})):(E(),O(De,{key:2},[$e(oe(x+1),1)],64))])]),z("span",OE,oe(w.label),1)],10,SE)])],64))),256))],512),F(k.$slots,"after-breadcrumbs",be(Ie({meta:l.value,navigate:m})))])),F(k.$slots,"before-content",be(Ie({meta:l.value,navigate:m}))),z("div",AE,[he(tp,{name:y(),mode:"out-in",onAfterEnter:b},{default:Z(()=>[k.keepAlive?(E(),$(Ek,{key:0},[(E(),$(Qe(u.value.step.component),ne({key:o.value},u.value),null,16))],1024)):(E(),$(Qe(u.value.step.component),ne({key:o.value},u.value),null,16))]),_:1},8,["name"]),k.$slots.navigation?(E(),O("div",ME,[F(k.$slots,"navigation",be(Ie({meta:l.value,navigate:m})))])):R("",!0)]),F(k.$slots,"after-content",be(Ie({meta:l.value,navigate:m})))],10,xE))}}),_E=["src","alt"],au=Q({__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=X(),o=X(!1),s=X(!1),a=X(),l=I(()=>({"--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 qn(()=>{var d;return((d=i.value)==null?void 0:d.complete)&&u()}),(d,h)=>(E(),O("figure",{class:Ce(["k-image",[`k-image--size-${d.size}`,{"k-image--loaded":o.value,"k-image--loading":!o.value}]]),style:Cr(l.value)},[o.value?R("",!0):(E(),$(ev,{key:0,size:"small"})),Va(z("img",{src:d.src,alt:d.alt||d.caption,onLoad:u,onError:c,ref_key:"image",ref:i},null,40,_E),[[Rg,!s.value]]),d.$slots.caption||d.caption?(E(),O("figcaption",{key:1,class:Ce(`k-image__caption k-image__caption--visibility-${d.captionVisibility} k-image__caption--theme-${!o.value||s.value?"light":d.captionTheme}`)},[F(d.$slots,"caption",{},()=>[$e(oe(d.caption),1)])],2)):R("",!0)],6))}}),ni=Q({__name:"Flex",props:{is:{default:"div"},gap:{default:"default"},justify:{},align:{},direction:{default:"row"},nowrap:{type:Boolean}},setup(t){const e=t,n=I(()=>Qg("flex",{justify:ja(e.justify)||"initial",align:ja(e.align)||"initial",wrap:e.nowrap?"nowrap":"wrap",gap:cp(e.gap),direction:e.direction}));return(r,i)=>(E(),$(Qe(r.is),{class:"k-flex",style:Cr(n.value)},{default:Z(()=>[F(r.$slots,"default")]),_:3},8,["style"]))}}),DE={key:0,class:"k-card__thumbnail"},NE={key:0,class:"k-card__title"},IE={key:1,class:"k-card__subtitle"},RE={key:2,class:"k-card__content"},PE=Q({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=ip(),r=I(()=>e.thumbnail||n.thumbnail),i=I(()=>e.title||e.subtitle||n.header),o=I(()=>n.actions),s=I(()=>n.default);return(a,l)=>(E(),$(Qe(a.is),ne({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:Z(()=>[r.value?(E(),O("div",DE,[F(a.$slots,"thumbnail",{},()=>[a.thumbnail?(E(),$(au,ne({key:0},a.thumbnailOptions,{src:a.thumbnail}),null,16,["src"])):R("",!0)])])):R("",!0),i.value?(E(),$(ni,{key:1,is:"header",direction:"column",gap:"0rem",class:"k-card__header"},{default:Z(()=>[F(a.$slots,"header",{},()=>[a.title?(E(),O("div",NE,oe(a.title),1)):R("",!0),a.subtitle?(E(),O("div",IE,oe(a.subtitle),1)):R("",!0)])]),_:3})):R("",!0),s.value?(E(),O("div",RE,[F(a.$slots,"default")])):R("",!0),o.value?(E(),$(ni,{key:3,justify:"center",align:"center",class:"k-card__actions"},{default:Z(()=>[F(a.$slots,"actions")]),_:3})):R("",!0)]),_:3},16,["class"]))}}),bL=Q({__name:"Skeleton",props:{variant:{default:"shiny"},aspectRatio:{},width:{},height:{},rounding:{}},setup(t){const e=()=>t.rounding?t.rounding==="full"?"9999px":cp(t.rounding,"rounding"):"initial",n=I(()=>({"--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(),O("span",{class:Ce(["k-skeleton",`k-skeleton--variant-${r.variant}`]),style:Cr(n.value)},[F(r.$slots,"default")],6))}});function FE(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 LE(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)=>FE(u,d=>{r(d,c)}));i.push(...l)}if(s(),n){const a=VE(o,s);i.push(a)}return()=>{i.forEach(a=>{a?.()})}}function VE(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 BE=Ln("slider").parts("root","label","thumb","valueText","track","range","control","markerGroup","marker","draggingIndicator"),ln=BE.build(),Vv=t=>{var e;return((e=t.ids)==null?void 0:e.root)??`slider:${t.id}`},Bv=(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}`},Yc=(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}`},$v=t=>{var e;return((e=t.ids)==null?void 0:e.control)??`slider:${t.id}:control`},$E=t=>{var e;return((e=t.ids)==null?void 0:e.track)??`slider:${t.id}:track`},jE=t=>{var e;return((e=t.ids)==null?void 0:e.range)??`slider:${t.id}:range`},of=t=>{var e;return((e=t.ids)==null?void 0:e.label)??`slider:${t.id}:label`},zE=t=>{var e;return((e=t.ids)==null?void 0:e.valueText)??`slider:${t.id}:value-text`},HE=(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}`},qE=t=>t.getById(Vv(t)),WE=(t,e)=>t.getById(Bv(t,e)),jv=(t,e)=>t.getById(Yc(t,e)),zv=t=>t.getById($v(t)),Hv=t=>yp(zv(t),"[role=slider]"),UE=t=>Hv(t)[0],sf=(t,e)=>{const{prop:n,scope:r}=t,i=zv(r);if(!i)return;const o=Tx(e,i).getPercentValue({orientation:n("orientation"),dir:n("dir"),inverted:{y:!0}});return xv(o,n("min"),n("max"),n("step"))},KE=(t,e)=>{e.forEach((n,r)=>{const i=jv(t,r);i&&vx(i,{value:n})})};function GE(t){const e=t[0],n=t[t.length-1];return[e,n]}function JE(t){const{prop:e,computed:n}=t,r=n("valuePercent"),[i,o]=GE(r);if(r.length===1){if(e("origin")==="center"){const s=r[0]<50,a=s?`${r[0]}%`:"50%",l=s?"50%":`${100-r[0]}%`;return{start:a,end:l}}return{start:"0%",end:`${100-o}%`}}return{start:`${i}%`,end:`${100-o}%`}}function XE(t){const{computed:e}=t,n=e("isVertical"),r=e("isRtl");return n?{position:"absolute",bottom:"var(--slider-range-start)",top:"var(--slider-range-end)"}:{position:"absolute",[r?"right":"left"]:"var(--slider-range-start)",[r?"left":"right"]:"var(--slider-range-end)"}}function YE(t,e){const{context:n,prop:r}=t,{height:i=0}=n.get("thumbSize")??{},o=Kc([r("min"),r("max")],[-i/2,i/2]);return parseFloat(o(e).toFixed(2))}function ZE(t,e){const{computed:n,context:r,prop:i}=t,{width:o=0}=r.get("thumbSize")??{};if(n("isRtl")){const a=Kc([i("max"),i("min")],[-o/2,o/2]);return-1*parseFloat(a(e).toFixed(2))}const s=Kc([i("min"),i("max")],[-o/2,o/2]);return parseFloat(s(e).toFixed(2))}function QE(t,e,n){const{computed:r,prop:i}=t;if(i("thumbAlignment")==="center")return`${e}%`;const o=r("isVertical")?YE(t,n):ZE(t,n);return`calc(${e}% - ${o}px)`}function qv(t,e){const{prop:n}=t,r=xp(e,n("min"),n("max"))*100;return QE(t,r,e)}function Wv(t){const{computed:e,prop:n}=t;let r="visible";return n("thumbAlignment")==="contain"&&!e("hasMeasuredThumbSize")&&(r="hidden"),r}function af(t,e){const{computed:n}=t,r=n("isVertical")?"bottom":"insetInlineStart";return{visibility:Wv(t),position:"absolute",transform:"var(--slider-thumb-transform)",[r]:`var(--slider-thumb-offset-${e})`}}function eC(){return{touchAction:"none",userSelect:"none",WebkitUserSelect:"none",position:"relative"}}function tC(t){const{context:e,computed:n}=t,r=n("isVertical"),i=n("isRtl"),o=JE(t);return{...e.get("value").reduce((s,a,l)=>{const u=qv(t,a);return{...s,[`--slider-thumb-offset-${l}`]:u}},{}),"--slider-thumb-transform":r?"translateY(50%)":i?"translateX(50%)":"translateX(-50%)","--slider-range-start":o.start,"--slider-range-end":o.end}}function nC(t,e){const{computed:n}=t,r=n("isHorizontal"),i=n("isRtl");return{visibility:Wv(t),position:"absolute",pointerEvents:"none",[r?"insetInlineStart":"bottom"]:qv(t,e),translate:"var(--tx) var(--ty)","--tx":r?i?"50%":"-50%":"0%","--ty":r?"0%":"50%"}}function rC(){return{userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none",position:"relative"}}function iC(t,e){return e.map((n,r)=>Zc(t,n,r))}function hr(t,e){const{context:n,prop:r}=t;return c1(n.get("value"),r("min"),r("max"),r("minStepsBetweenThumbs"))[e]}function Zc(t,e,n){const{prop:r}=t,i=hr(t,n),o=Ev(e,r("min"),r("max"),r("step"));return Ql(o,i.min,i.max)}function oC(t,e,n){const{context:r,prop:i}=t,o=e??r.get("focusedIndex"),s=hr(t,o),a=l1(o,{...s,step:n??i("step"),values:r.get("value")});return a[o]=Ql(a[o],s.min,s.max),a}function sC(t,e,n){const{context:r,prop:i}=t,o=e??r.get("focusedIndex"),s=hr(t,o),a=a1(o,{...s,step:n??i("step"),values:r.get("value")});return a[o]=Ql(a[o],s.min,s.max),a}function aC(t,e){const{context:n}=t;return u1(n.get("value"),e)}function Uv(t,e){const{state:n,send:r,context:i,prop:o,computed:s,scope:a}=t,l=o("aria-label"),u=o("aria-labelledby"),c=i.get("value"),d=i.get("focusedIndex"),h=n.matches("focus"),p=n.matches("dragging"),f=s("isDisabled"),m=o("invalid"),g=s("isInteractive"),y=o("orientation")==="horizontal",b=o("orientation")==="vertical";function k(w){return xp(w,o("min"),o("max"))}function v(w){return xv(w,o("min"),o("max"),o("step"))}return{value:c,dragging:p,focused:h,setValue(w){r({type:"SET_VALUE",value:w})},getThumbValue(w){return c[w]},setThumbValue(w,x){r({type:"SET_VALUE",index:w,value:x})},getValuePercent:k,getPercentValue:v,getThumbPercent(w){return k(c[w])},setThumbPercent(w,x){const C=v(x);r({type:"SET_VALUE",index:w,value:C})},getThumbMin(w){return hr(t,w).min},getThumbMax(w){return hr(t,w).max},increment(w){r({type:"INCREMENT",index:w})},decrement(w){r({type:"DECREMENT",index:w})},focus(){g&&r({type:"FOCUS",index:0})},getLabelProps(){return e.label({...ln.label.attrs,dir:o("dir"),"data-disabled":G(f),"data-orientation":o("orientation"),"data-invalid":G(m),"data-dragging":G(p),"data-focus":G(h),id:of(a),htmlFor:Yc(a,0),onClick(w){var x;g&&(w.preventDefault(),(x=UE(a))==null||x.focus())},style:{userSelect:"none",WebkitUserSelect:"none"}})},getRootProps(){return e.element({...ln.root.attrs,"data-disabled":G(f),"data-orientation":o("orientation"),"data-dragging":G(p),"data-invalid":G(m),"data-focus":G(h),id:Vv(a),dir:o("dir"),style:tC(t)})},getValueTextProps(){return e.element({...ln.valueText.attrs,dir:o("dir"),"data-disabled":G(f),"data-orientation":o("orientation"),"data-invalid":G(m),"data-focus":G(h),id:zE(a)})},getTrackProps(){return e.element({...ln.track.attrs,dir:o("dir"),id:$E(a),"data-disabled":G(f),"data-invalid":G(m),"data-dragging":G(p),"data-orientation":o("orientation"),"data-focus":G(h),style:{position:"relative"}})},getThumbProps(w){var x;const{index:C=0,name:N}=w,A=c[C],S=hr(t,C),_=(x=o("getAriaValueText"))==null?void 0:x({value:A,index:C}),L=Array.isArray(l)?l[C]:l,W=Array.isArray(u)?u[C]:u;return e.element({...ln.thumb.attrs,dir:o("dir"),"data-index":C,"data-name":N,id:Bv(a,C),"data-disabled":G(f),"data-orientation":o("orientation"),"data-focus":G(h&&d===C),"data-dragging":G(p&&d===C),draggable:!1,"aria-disabled":zw(f),"aria-label":L,"aria-labelledby":W??of(a),"aria-orientation":o("orientation"),"aria-valuemax":S.max,"aria-valuemin":S.min,"aria-valuenow":c[C],"aria-valuetext":_,role:"slider",tabIndex:f?void 0:0,style:af(t,C),onPointerDown(q){g&&(r({type:"THUMB_POINTER_DOWN",index:C}),q.stopPropagation())},onBlur(){g&&r({type:"BLUR"})},onFocus(){g&&r({type:"FOCUS",index:C})},onKeyDown(q){if(q.defaultPrevented||!g)return;const K=mx(q)*o("step"),J={ArrowUp(){y||r({type:"ARROW_INC",step:K,src:"ArrowUp"})},ArrowDown(){y||r({type:"ARROW_DEC",step:K,src:"ArrowDown"})},ArrowLeft(){b||r({type:"ARROW_DEC",step:K,src:"ArrowLeft"})},ArrowRight(){b||r({type:"ARROW_INC",step:K,src:"ArrowRight"})},PageUp(){r({type:"ARROW_INC",step:K,src:"PageUp"})},PageDown(){r({type:"ARROW_DEC",step:K,src:"PageDown"})},Home(){r({type:"HOME"})},End(){r({type:"END"})}},ue=ov(q,{dir:o("dir"),orientation:o("orientation")}),ge=J[ue];ge&&(ge(q),q.preventDefault(),q.stopPropagation())}})},getHiddenInputProps(w){const{index:x=0,name:C}=w;return e.input({name:C??(o("name")?o("name")+(c.length>1?"[]":""):void 0),form:o("form"),type:"text",hidden:!0,defaultValue:c[x],id:Yc(a,x)})},getRangeProps(){return e.element({id:jE(a),...ln.range.attrs,dir:o("dir"),"data-dragging":G(p),"data-focus":G(h),"data-invalid":G(m),"data-disabled":G(f),"data-orientation":o("orientation"),style:XE(t)})},getControlProps(){return e.element({...ln.control.attrs,dir:o("dir"),id:$v(a),"data-dragging":G(p),"data-disabled":G(f),"data-orientation":o("orientation"),"data-invalid":G(m),"data-focus":G(h),style:eC(),onPointerDown(w){if(!g||!lx(w)||cx(w))return;const x=fp(w);r({type:"POINTER_DOWN",point:x}),w.preventDefault(),w.stopPropagation()}})},getMarkerGroupProps(){return e.element({...ln.markerGroup.attrs,role:"presentation",dir:o("dir"),"aria-hidden":!0,"data-orientation":o("orientation"),style:rC()})},getMarkerProps(w){const x=nC(t,w.value);let C;return w.value<yv(c)?C="under-value":w.value>bv(c)?C="over-value":C="at-value",e.element({...ln.marker.attrs,id:HE(a,w.value),role:"presentation",dir:o("dir"),"data-orientation":o("orientation"),"data-value":w.value,"data-disabled":G(f),"data-state":C,style:x})},getDraggingIndicatorProps(w){const{index:x=0}=w,C=x===d&&p;return e.element({...ln.draggingIndicator.attrs,role:"presentation",dir:o("dir"),hidden:!C,"data-orientation":o("orientation"),"data-state":C?"open":"closed",style:af(t,x)})}}}var lC=(t,e)=>t?.width===e?.width&&t?.height===e?.height,Kv={props({props:t}){return{dir:"ltr",thumbAlignment:"contain",min:0,max:100,step:1,defaultValue:[0],origin:"start",orientation:"horizontal",minStepsBetweenThumbs:0,...t}},initialState(){return"idle"},context({prop:t,bindable:e,getContext:n}){return{thumbSize:e(()=>({defaultValue:t("thumbSize")||null})),value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),hash(r){return r.join(",")},onChange(r){var i;(i=t("onValueChange"))==null||i({value:r})}})),focusedIndex:e(()=>({defaultValue:-1,onChange(r){var i;const o=n();(i=t("onFocusChange"))==null||i({focusedIndex:r,value:o.get("value")})}})),fieldsetDisabled:e(()=>({defaultValue:!1}))}},computed:{isHorizontal:({prop:t})=>t("orientation")==="horizontal",isVertical:({prop:t})=>t("orientation")==="vertical",isRtl:({prop:t})=>t("orientation")==="horizontal"&&t("dir")==="rtl",isDisabled:({context:t,prop:e})=>!!e("disabled")||t.get("fieldsetDisabled"),isInteractive:({prop:t,computed:e})=>!(t("readOnly")||e("isDisabled")),hasMeasuredThumbSize:({context:t})=>t.get("thumbSize")!=null,valuePercent({context:t,prop:e}){return t.get("value").map(n=>100*xp(n,e("min"),e("max")))}},watch({track:t,action:e,context:n}){t([()=>n.hash("value")],()=>{e(["syncInputElements","dispatchChangeEvent"])})},effects:["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"],effects:["trackPointerMove"],on:{POINTER_UP:{target:"focus",actions:["invokeOnChangeEnd"]},POINTER_MOVE:{actions:["setPointerValue"]}}}},implementations:{guards:{hasIndex:({event:t})=>t.index!=null},effects:{trackFormControlState({context:t,scope:e}){return Yl(qE(e),{onFieldsetDisabledChange(n){t.set("fieldsetDisabled",n)},onFormReset(){t.set("value",t.initial("value"))}})},trackPointerMove({scope:t,send:e}){return _x(t.getDoc(),{onPointerMove(n){e({type:"POINTER_MOVE",point:n.point})},onPointerUp(){e({type:"POINTER_UP"})}})},trackThumbsSize({context:t,scope:e,prop:n}){if(!(n("thumbAlignment")!=="contain"||t.get("thumbSize")))return LE({getNodes:()=>Hv(e),observeMutation:!0,callback(r){!r||lC(t.get("thumbSize"),r)||t.set("thumbSize",r)}})}},actions:{dispatchChangeEvent({context:t,scope:e}){KE(e,t.get("value"))},syncInputElements({context:t,scope:e}){t.get("value").forEach((n,r)=>{const i=jv(e,r);av(i,n.toString())})},invokeOnChangeEnd({prop:t,context:e}){var n;(n=t("onValueChangeEnd"))==null||n({value:e.get("value")})},setClosestThumbIndex(t){const{context:e,event:n}=t,r=sf(t,n.point);if(r==null)return;const i=aC(t,r);e.set("focusedIndex",i)},setFocusedIndex({context:t,event:e}){t.set("focusedIndex",e.index)},clearFocusedIndex({context:t}){t.set("focusedIndex",-1)},setPointerValue(t){queueMicrotask(()=>{const{context:e,event:n}=t,r=sf(t,n.point);if(r==null)return;const i=e.get("focusedIndex"),o=Zc(t,r,i);e.set("value",s=>To(s,i,o))})},focusActiveThumb({scope:t,context:e}){At(()=>{const n=WE(t,e.get("focusedIndex"));n?.focus({preventScroll:!0})})},decrementThumbAtIndex(t){const{context:e,event:n}=t,r=oC(t,n.index,n.step);e.set("value",r)},incrementThumbAtIndex(t){const{context:e,event:n}=t,r=sC(t,n.index,n.step);e.set("value",r)},setFocusedThumbToMin(t){const{context:e}=t,n=e.get("focusedIndex"),{min:r}=hr(t,n);e.set("value",i=>To(i,n,r))},setFocusedThumbToMax(t){const{context:e}=t,n=e.get("focusedIndex"),{max:r}=hr(t,n);e.set("value",i=>To(i,n,r))},setValueAtIndex(t){const{context:e,event:n}=t,r=Zc(t,n.value,n.index);e.set("value",i=>To(i,n.index,r))},setValue(t){const{context:e,event:n}=t,r=iC(t,n.value);e.set("value",r)}}}};Wn()(["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","defaultValue"]);Wn()(["index","name"]);const uC=["data-value"],cC=Q({__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=pi(Kv,{id:Qt(),...n,defaultValue:n.modelValue,onValueChangeEnd:({value:l})=>{const[u,c]=[o.value.getThumbMin(0),o.value.getThumbMax(0)],[d,h]=[o.value.getThumbMin(1),o.value.getThumbMax(1)],p=Math.max(u,Math.min(c,l[0])),f=Math.min(h,Math.max(d,l[1]));n.modelValue[0]===p&&n.modelValue[1]===f||r("update:modelValue",[p,f])}}),o=I(()=>Uv(i,di)),s=l=>{const[u,c]=[o.value.getThumbMin(0),o.value.getThumbMax(0)],[d,h]=[o.value.getThumbMin(1),o.value.getThumbMax(1)],[p,f]=[o.value.getThumbValue(0),o.value.getThumbValue(1)],[m,g]=l;if(m===p&&g===f)return;const y=Math.max(u,Math.min(c,m)),b=Math.min(h,Math.max(d,g));return p===y&&f===b?r("update:modelValue",[y,b]):o.value.setValue([y,b])},a=I(()=>{if(!n.marker)return[];const l=Math.floor(n.max/n.marker)+1;return Array(l).fill(void 0).map((u,c)=>{const d=(n.marker||0)*c;return{value:d,label:n.markerFormat?n.markerFormat(d):n.format(d)}})});return Ee(()=>n.modelValue,s,{deep:!0}),(l,u)=>(E(),O("div",ne(o.value.getRootProps(),{class:"k-rangeslider"}),[z("div",be(Ie(o.value.getControlProps())),[z("div",be(Ie(o.value.getTrackProps())),[z("div",be(Ie(o.value.getRangeProps())),null,16)],16),(E(!0),O(De,null,_t(o.value.value,(c,d)=>(E(),O("div",ne({key:d,ref_for:!0},o.value.getThumbProps({index:d})),[z("input",ne({ref_for:!0},o.value.getHiddenInputProps({index:d})),null,16)],16))),128))],16),a.value.length?(E(),O("div",be(ne({key:0},o.value.getMarkerGroupProps())),[(E(!0),O(De,null,_t(a.value,c=>(E(),O("span",ne({ref_for:!0},o.value.getMarkerProps({value:c.value}),{"data-value":c.label}),null,16,uC))),256))],16)):R("",!0)],16))}}),dC=["data-value"],kL=Q({__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=pi(Kv,{id:Qt(),...n,defaultValue:[n.modelValue],onValueChange:({value:l})=>{r("update:modelValue",l[0])}}),o=I(()=>Uv(i,di)),s=l=>o.value.setValue([Math.max(n.min||l,Math.min(n.max||l,l))]),a=I(()=>{const l=c=>n.markerFormat?n.markerFormat(c):n.format(c);if(!n.marker)return[];if(n.marker instanceof Array)return n.marker.map(c=>({value:c,label:l(c)}));const u=Math.floor((n.max-n.min)/n.marker)+1;return Array(u).fill(void 0).map((c,d)=>{const h=n.min+n.marker*d;return{value:h,label:l(h)}})});return Ee(()=>n.modelValue,s,{deep:!0}),(l,u)=>(E(),O("div",ne(o.value.getRootProps(),{class:["k-slider",{"k-slider--marker-highlight":l.markerHighlight}]}),[z("div",be(Ie(o.value.getControlProps())),[z("div",be(Ie(o.value.getTrackProps())),[z("div",be(Ie(o.value.getRangeProps())),null,16)],16),z("div",be(Ie(o.value.getThumbProps({index:0}))),[z("input",be(Ie(o.value.getHiddenInputProps({index:0}))),null,16)],16),z("output",be(Ie(o.value.getValueTextProps())),[F(l.$slots,"value",{value:o.value.value},()=>[$e(oe(l.format(o.value.value.at(0))),1)])],16)],16),a.value.length?(E(),O("div",be(ne({key:0},o.value.getMarkerGroupProps())),[(E(!0),O(De,null,_t(a.value,c=>(E(),O("span",ne({ref_for:!0},o.value.getMarkerProps({value:c.value}),{"data-value":c.label}),null,16,dC))),256))],16)):R("",!0)],16))}}),Qc=Math.min,Fi=Math.max,Ka=Math.round,Qs=Math.floor,vn=t=>({x:t,y:t}),pC={left:"right",right:"left",bottom:"top",top:"bottom"},hC={start:"end",end:"start"};function Tp(t,e){return typeof t=="function"?t(e):t}function Wi(t){return t.split("-")[0]}function lu(t){return t.split("-")[1]}function fC(t){return t==="x"?"y":"x"}function Gv(t){return t==="y"?"height":"width"}function as(t){return["top","bottom"].includes(Wi(t))?"y":"x"}function Jv(t){return fC(as(t))}function mC(t,e,n){n===void 0&&(n=!1);const r=lu(t),i=Jv(t),o=Gv(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Ga(s)),[s,Ga(s)]}function gC(t){const e=Ga(t);return[ed(t),e,ed(e)]}function ed(t){return t.replace(/start|end/g,e=>hC[e])}function vC(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 yC(t,e,n,r){const i=lu(t);let o=vC(Wi(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ed)))),o}function Ga(t){return t.replace(/left|right|bottom|top/g,e=>pC[e])}function bC(t){return{top:0,right:0,bottom:0,left:0,...t}}function kC(t){return typeof t!="number"?bC(t):{top:t,right:t,bottom:t,left:t}}function Ja(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 lf(t,e,n){let{reference:r,floating:i}=t;const o=as(e),s=Jv(e),a=Gv(s),l=Wi(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 wC=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}=lf(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}=lf(u,h,l)),m=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:p}};async function xC(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=kC(p),m=a[h?d==="floating"?"reference":"floating":d],g=Ja(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=Ja(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 EC=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=Wi(i),b=as(a),k=Wi(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=h||(k||!m?[Ga(a)]:gC(a)),x=f!=="none";!h&&x&&w.push(...yC(a,m,f,v));const C=[a,...w],N=await xC(e,g),A=[];let S=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&A.push(N[y]),d){const q=mC(i,s,v);A.push(N[q[0]],N[q[1]])}if(S=[...S,{placement:i,overflows:A}],!A.every(q=>q<=0)){var _,L;const q=(((_=o.flip)==null?void 0:_.index)||0)+1,K=C[q];if(K)return{data:{index:q,overflows:S},reset:{placement:K}};let J=(L=S.filter(ue=>ue.overflows[0]<=0).sort((ue,ge)=>ue.overflows[1]-ge.overflows[1])[0])==null?void 0:L.placement;if(!J)switch(p){case"bestFit":{var W;const ue=(W=S.filter(ge=>{if(x){const Te=as(ge.placement);return Te===b||Te==="y"}return!0}).map(ge=>[ge.placement,ge.overflows.filter(Te=>Te>0).reduce((Te,mt)=>Te+mt,0)]).sort((ge,Te)=>ge[1]-Te[1])[0])==null?void 0:W[0];ue&&(J=ue);break}case"initialPlacement":J=a;break}if(i!==J)return{reset:{placement:J}}}return{}}}};async function CC(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Wi(n),a=lu(n),l=as(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 SC=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 CC(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 uu(){return typeof window<"u"}function lo(t){return Xv(t)?(t.nodeName||"").toLowerCase():"#document"}function Dt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Sn(t){var e;return(e=(Xv(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Xv(t){return uu()?t instanceof Node||t instanceof Dt(t).Node:!1}function en(t){return uu()?t instanceof Element||t instanceof Dt(t).Element:!1}function kn(t){return uu()?t instanceof HTMLElement||t instanceof Dt(t).HTMLElement:!1}function uf(t){return!uu()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Dt(t).ShadowRoot}function As(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=tn(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function TC(t){return["table","td","th"].includes(lo(t))}function cu(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Op(t){const e=Ap(),n=en(t)?tn(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 OC(t){let e=wr(t);for(;kn(e)&&!Ui(e);){if(Op(e))return e;if(cu(e))return null;e=wr(e)}return null}function Ap(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ui(t){return["html","body","#document"].includes(lo(t))}function tn(t){return Dt(t).getComputedStyle(t)}function du(t){return en(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function wr(t){if(lo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||uf(t)&&t.host||Sn(t);return uf(e)?e.host:e}function Yv(t){const e=wr(t);return Ui(e)?t.ownerDocument?t.ownerDocument.body:t.body:kn(e)&&As(e)?e:Yv(e)}function ls(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Yv(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Dt(i);if(o){const a=td(s);return e.concat(s,s.visualViewport||[],As(i)?i:[],a&&n?ls(a):[])}return e.concat(i,ls(i,[],n))}function td(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Zv(t){const e=tn(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=kn(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Ka(n)!==o||Ka(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Mp(t){return en(t)?t:t.contextElement}function Li(t){const e=Mp(t);if(!kn(e))return vn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Zv(e);let s=(o?Ka(n.width):n.width)/r,a=(o?Ka(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const AC=vn(0);function Qv(t){const e=Dt(t);return!Ap()||!e.visualViewport?AC:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function MC(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Dt(t)?!1:e}function ri(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Mp(t);let s=vn(1);e&&(r?en(r)&&(s=Li(r)):s=Li(t));const a=MC(o,n,r)?Qv(o):vn(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=Dt(o),p=r&&en(r)?Dt(r):r;let f=h,m=td(f);for(;m&&r&&p!==f;){const g=Li(m),y=m.getBoundingClientRect(),b=tn(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=Dt(m),m=td(f)}}return Ja({width:c,height:d,x:l,y:u})}function _p(t,e){const n=du(t).scrollLeft;return e?e.left+n:ri(Sn(t)).left+n}function ey(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:_p(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function _C(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Sn(r),a=e?cu(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=vn(1);const c=vn(0),d=kn(r);if((d||!d&&!o)&&((lo(r)!=="body"||As(s))&&(l=du(r)),kn(r))){const p=ri(r);u=Li(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=s&&!d&&!o?ey(s,l,!0):vn(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 DC(t){return Array.from(t.getClientRects())}function NC(t){const e=Sn(t),n=du(t),r=t.ownerDocument.body,i=Fi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Fi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+_p(t);const a=-n.scrollTop;return tn(r).direction==="rtl"&&(s+=Fi(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function IC(t,e){const n=Dt(t),r=Sn(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=Ap();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function RC(t,e){const n=ri(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=kn(t)?Li(t):vn(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 cf(t,e,n){let r;if(e==="viewport")r=IC(t,n);else if(e==="document")r=NC(Sn(t));else if(en(e))r=RC(e,n);else{const i=Qv(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ja(r)}function ty(t,e){const n=wr(t);return n===e||!en(n)||Ui(n)?!1:tn(n).position==="fixed"||ty(n,e)}function PC(t,e){const n=e.get(t);if(n)return n;let r=ls(t,[],!1).filter(a=>en(a)&&lo(a)!=="body"),i=null;const o=tn(t).position==="fixed";let s=o?wr(t):t;for(;en(s)&&!Ui(s);){const a=tn(s),l=Op(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&i&&["absolute","fixed"].includes(i.position)||As(s)&&!l&&ty(t,s))?r=r.filter(u=>u!==s):i=a,s=wr(s)}return e.set(t,r),r}function FC(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?cu(e)?[]:PC(e,this._c):[].concat(n),r],s=o[0],a=o.reduce((l,u)=>{const c=cf(e,u,i);return l.top=Fi(c.top,l.top),l.right=Qc(c.right,l.right),l.bottom=Qc(c.bottom,l.bottom),l.left=Fi(c.left,l.left),l},cf(e,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function LC(t){const{width:e,height:n}=Zv(t);return{width:e,height:n}}function VC(t,e,n){const r=kn(e),i=Sn(e),o=n==="fixed",s=ri(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=vn(0);if(r||!r&&!o)if((lo(e)!=="body"||As(i))&&(a=du(e)),r){const h=ri(e,!0,o,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&(l.x=_p(i));const u=i&&!r&&!o?ey(i,a):vn(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 Hu(t){return tn(t).position==="static"}function df(t,e){if(!kn(t)||tn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Sn(t)===n&&(n=n.ownerDocument.body),n}function ny(t,e){const n=Dt(t);if(cu(t))return n;if(!kn(t)){let i=wr(t);for(;i&&!Ui(i);){if(en(i)&&!Hu(i))return i;i=wr(i)}return n}let r=df(t,e);for(;r&&TC(r)&&Hu(r);)r=df(r,e);return r&&Ui(r)&&Hu(r)&&!Op(r)?n:r||OC(t)||n}const BC=async function(t){const e=this.getOffsetParent||ny,n=this.getDimensions,r=await n(t.floating);return{reference:VC(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $C(t){return tn(t).direction==="rtl"}const nd={convertOffsetParentRelativeRectToViewportRelativeRect:_C,getDocumentElement:Sn,getClippingRect:FC,getOffsetParent:ny,getElementRects:BC,getClientRects:DC,getDimensions:LC,getScale:Li,isElement:en,isRTL:$C};function ry(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function jC(t,e){let n=null,r;const i=Sn(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=Qs(d),m=Qs(i.clientWidth-(c+h)),g=Qs(i.clientHeight-(d+p)),y=Qs(c),b={rootMargin:-f+"px "+-m+"px "+-g+"px "+-y+"px",threshold:Fi(0,Qc(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&&!ry(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 zC(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=Mp(t),c=i||o?[...u?ls(u):[],...ls(e)]:[];c.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const d=u&&a?jC(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?ri(t):null;l&&g();function g(){const y=ri(t);m&&!ry(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 HC=SC,qC=EC,WC=(t,e,n)=>{const r=new Map,i={platform:nd,...n},o={...i.platform,_c:r};return wC(t,e,{...i,platform:o})};function UC(t){return KC(t)}function qu(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function KC(t){for(let e=t;e;e=qu(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=qu(t);e;e=qu(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 pu=Q({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=I(()=>{const{items:v,placement:w,teleport:x,keepOpen:C,...N}=n;return N}),i=X(!1),o=nu(),s=X(),a=X(),l=X({top:"",left:"",position:""});let u=()=>{};function c(){!s.value||!a.value||(u=zC(s.value.$el,a.value,()=>{!s.value||!a.value||WC(s.value.$el,a.value,{placement:n.placement,middleware:[HC(n.offset),qC()],platform:{...nd,getOffsetParent:v=>nd.getOffsetParent(v,UC)}}).then(({x:v,y:w})=>{l.value={top:`${w}px`,left:`${v}px`,position:"absolute"}})}))}ao(u),Fg(()=>{if(i.value)return c();u()});const d=({target:v},w="dom")=>{if(v instanceof Element&&!(!s.value||!a.value)){if(w==="dom")return[s.value.$el,a.value].some(x=>x&&(v===x||x.contains(v)))?void 0:p(!1);if(w==="shadow-dom"){const x=o.value.getRootNode();return v.shadowRoot===x?void 0:p(!1)}}},h=({key:v})=>v==="Escape"&&p(!1),p=(v=!i.value)=>(v?b():k(),i.value=v,!0),f=I(()=>o.value.getRootNode()),m=I(()=>f.value instanceof ShadowRoot);function g(v){d(v,"dom")}function y(v){d(v,"shadow-dom")}function b(){window.addEventListener("keydown",h),m.value?(f.value.addEventListener("click",g),window.addEventListener("click",y)):window.addEventListener("click",g)}function k(){window.removeEventListener("keydown",h),m.value?(f.value.removeEventListener("click",g),window.removeEventListener("click",y)):window.removeEventListener("click",g)}return e({isOpen:i}),(v,w)=>(E(),O(De,null,[he(ze,ne({...r.value,...v.$attrs},{onClick:w[0]||(w[0]=()=>p()),ref_key:"trigger",ref:s,class:["k-dropdown-trigger",{"k-dropdown-trigger--open":!!i.value}]}),Cs({_:2},[v.$slots["icon-left"]?{name:"icon-left",fn:Z(()=>[F(v.$slots,"icon-left")]),key:"0"}:void 0,v.$slots.trigger?{name:"default",fn:Z(()=>[F(v.$slots,"trigger")]),key:"1"}:void 0,v.$slots["icon-right"]?{name:"icon-right",fn:Z(()=>[F(v.$slots,"icon-right")]),key:"2"}:void 0]),1040,["class"]),(E(),$(Lg,{to:v.teleportTo,disabled:!v.teleport},[he(tp,{name:"k-dropdown"},{default:Z(()=>[i.value?(E(),O("div",{key:0,class:Ce(`k-dropdown k-dropdown--theme-${v.theme}`),style:Cr(l.value),ref_key:"content",ref:a,onClick:w[1]||(w[1]=()=>!v.keepOpen&&p(!1))},[F(v.$slots,"default",{close:p.bind(null,!1)},()=>[(E(!0),O(De,null,_t(v.items,({action:x,icon:C,...N})=>(E(),$(ze,ne({ref_for:!0},N,{variant:"tertiary","icon-right":N.iconRight||C,onClick:()=>x()}),null,16,["icon-right","onClick"]))),256))])],6)):R("",!0)]),_:3})],8,["to","disabled"]))],64))}}),GC={key:0,class:"k-datatable__row"},JC={key:0,class:"k-datatable__cell k-datatable__cell-select"},XC=["data-col-id","onClick"],YC=["innerHTML"],ZC={key:1,class:"k-datatable__cell k-datatable__cell-actions"},QC={key:0,class:"k-datatable__cell k-datatable__cell-select"},eS={key:1,class:"k-datatable__cell k-datatable__cell-actions"},tS={key:0,class:"k-datatable__footer"},wL=Q({__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=ip(),i=e,o=X([-1]),s=I(()=>n.items.filter(f=>!n.isDisabled(f))),a=I(()=>!!n.selected),l=I(()=>!!(Object.keys(n.sortBy||{}).length&&n.sortableBy.length)),u=I(()=>!!r.rowActions),c=I({get:()=>!!(s.value.length&&s.value.every(f=>n.selected&&n.selected.includes(f))),set:f=>i("update:selected",f?[...s.value]:[])}),d=I(()=>[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(),O("div",{class:Ce([`k-datatable k-datatable--${f.theme}`,{"k-datatable--sticky":!!f.sticky,"k-datatable--no-header":!f.header}]),style:Cr(`--k-datatable-layout: ${d.value}; --k-datatable-sticky-top: ${typeof f.sticky=="string"?f.sticky:"0"}`)},[f.header?(E(),O("div",GC,[a.value?(E(),O("div",JC,[he(Zh,{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"])])):R("",!0),(E(!0),O(De,null,_t(f.columns.filter(({disabled:g})=>!g),g=>(E(),O("div",{class:Ce(["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)},[F(f.$slots,`${g.id}-label`,{item:g},()=>[z("span",{innerHTML:g.label},null,8,YC)]),he(B(Ze),{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,XC))),128)),u.value?(E(),O("div",ZC)):R("",!0)])):R("",!0),(E(!0),O(De,null,_t(f.items,(g,y)=>(E(),O("div",{class:"k-datatable__row",key:f.sortBy?g?.id||B(Qt)():y},[a.value?(E(),O("div",QC,[he(Zh,{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]=Ba(()=>{},["prevent"])),onClick:b=>p(b,y),disabled:f.isDisabled(g)},null,8,["model-value","value","onClick","disabled"])])):R("",!0),(E(),$(Qe(f.rowWrapper(g).component),ne({class:"k-datatable__row-wrapper",ref_for:!0},f.rowWrapper(g).bind,Bg(f.rowWrapper(g).listeners)),{default:Z(()=>[(E(!0),O(De,null,_t(f.columns.filter(({disabled:b})=>!b),(b,k)=>(E(),$(Qe(f.cellWrapper(g,b).component),ne({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:Z(()=>[F(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(),O("div",eS,[F(f.$slots,"row-actions",{item:g})])):R("",!0)]))),128)),he(tp,{name:"k-datatable-footer"},{default:Z(()=>{var g,y;return[f.$slots.footer||(g=f.selected)!=null&&g.length?(E(),O("div",tS,[(y=f.selected)!=null&&y.length?(E(),$(pu,{key:0,label:`${f.labels.selection} (${f.selected.length})`,teleport:!0},{default:Z(()=>[F(f.$slots,"select-actions"),he(ze,{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"])):R("",!0),F(f.$slots,"footer")])):R("",!0)]}),_:3})],6))}});var rd,Br=new Map,nS=t=>t.getBoundingClientRect();function rS(t,e){const{scope:n="rect",getRect:r=nS,onChange:i}=e,o=iS({scope:n,getRect:r}),s=Br.get(t);return s?(s.callbacks.push(i),i(r(t))):(Br.set(t,{rect:{},callbacks:[i]}),Br.size===1&&(rd=requestAnimationFrame(o))),function(){const a=Br.get(t);if(!a)return;const l=a.callbacks.indexOf(i);l>-1&&a.callbacks.splice(l,1),a.callbacks.length===0&&(Br.delete(t),Br.size===0&&cancelAnimationFrame(rd))}}function iS(t){const{scope:e,getRect:n}=t,r=sS(e);return function i(){const o=[];Br.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))}),rd=requestAnimationFrame(i)}}var iy=(t,e)=>t.width===e.width&&t.height===e.height,oy=(t,e)=>t.top===e.top&&t.left===e.left,oS=(t,e)=>iy(t,e)&&oy(t,e);function sS(t){return t==="size"?iy:t==="position"?oy:oS}var aS=Ln("radio-group").parts("root","label","item","itemText","itemControl","indicator"),ki=aS.build(),Xa=t=>{var e;return((e=t.ids)==null?void 0:e.root)??`radio-group:${t.id}`},pf=t=>{var e;return((e=t.ids)==null?void 0:e.label)??`radio-group:${t.id}:label`},sy=(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}`},hf=(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}`},lS=(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}`},uS=(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}`},ay=t=>{var e;return((e=t.ids)==null?void 0:e.indicator)??`radio-group:${t.id}:indicator`},hu=t=>t.getById(Xa(t)),cS=t=>t.getById(ay(t)),dS=t=>{var e;return(e=hu(t))==null?void 0:e.querySelector("input:not(:disabled)")},pS=t=>{var e;return(e=hu(t))==null?void 0:e.querySelector("input:not(:disabled):checked")},ff=t=>{const e=`input[type=radio][data-ownedby='${CSS.escape(Xa(t))}']:not([disabled])`;return yp(hu(t),e)},hS=(t,e)=>{if(e)return t.getById(sy(t,e))},fS=t=>({left:t?.offsetLeft??0,top:t?.offsetTop??0,width:t?.offsetWidth??0,height:t?.offsetHeight??0}),mS=t=>({width:`${t.width}px`,height:`${t.height}px`,left:`${t.left}px`,top:`${t.top}px`});function gS(t,e){const{context:n,send:r,computed:i,prop:o,scope:s}=t,a=i("isDisabled"),l=o("readOnly");function u(h){return{invalid:!!h.invalid,disabled:!!h.disabled||a,checked:n.get("value")===h.value,focused:n.get("focusedValue")===h.value,hovered:n.get("hoveredValue")===h.value,active:n.get("activeValue")===h.value}}function c(h){const p=u(h);return{"data-focus":G(p.focused),"data-focus-visible":G(p.focused&&n.get("focusVisible")),"data-disabled":G(p.disabled),"data-readonly":G(l),"data-state":p.checked?"checked":"unchecked","data-hover":G(p.hovered),"data-invalid":G(p.invalid),"data-orientation":o("orientation"),"data-ssr":G(n.get("ssr"))}}const d=()=>{const h=pS(s);if(h){h.focus();return}const p=dS(s);p?.focus()};return{focus:d,value:n.get("value"),setValue(h){r({type:"SET_VALUE",value:h,isTrusted:!1})},clearValue(){r({type:"SET_VALUE",value:null,isTrusted:!1})},getRootProps(){return e.element({...ki.root.attrs,role:"radiogroup",id:Xa(s),"aria-labelledby":pf(s),"data-orientation":o("orientation"),"data-disabled":G(a),"aria-orientation":o("orientation"),dir:o("dir"),style:{position:"relative"}})},getLabelProps(){return e.element({...ki.label.attrs,dir:o("dir"),"data-orientation":o("orientation"),"data-disabled":G(a),id:pf(s),onClick:d})},getItemState:u,getItemProps(h){const p=u(h);return e.label({...ki.item.attrs,dir:o("dir"),id:sy(s,h.value),htmlFor:hf(s,h.value),...c(h),onPointerMove(){p.disabled||p.hovered||r({type:"SET_HOVERED",value:h.value,hovered:!0})},onPointerLeave(){p.disabled||r({type:"SET_HOVERED",value:null})},onPointerDown(f){p.disabled||(p.focused&&f.pointerType==="mouse"&&f.preventDefault(),r({type:"SET_ACTIVE",value:h.value,active:!0}))},onPointerUp(){p.disabled||r({type:"SET_ACTIVE",value:null})}})},getItemTextProps(h){return e.element({...ki.itemText.attrs,dir:o("dir"),id:uS(s,h.value),...c(h)})},getItemControlProps(h){const p=u(h);return e.element({...ki.itemControl.attrs,dir:o("dir"),id:lS(s,h.value),"data-active":G(p.active),"aria-hidden":!0,...c(h)})},getItemHiddenInputProps(h){const p=u(h);return e.input({"data-ownedby":Xa(s),id:hf(s,h.value),type:"radio",name:o("name")||o("id"),form:o("form"),value:h.value,onClick(f){if(l){f.preventDefault();return}f.currentTarget.checked&&r({type:"SET_VALUE",value:h.value,isTrusted:!0})},onBlur(){r({type:"SET_FOCUSED",value:null,focused:!1,focusVisible:!1})},onFocus(){const f=is();r({type:"SET_FOCUSED",value:h.value,focused:!0,focusVisible:f})},onKeyDown(f){f.defaultPrevented||f.key===" "&&r({type:"SET_ACTIVE",value:h.value,active:!0})},onKeyUp(f){f.defaultPrevented||f.key===" "&&r({type:"SET_ACTIVE",value:null})},disabled:p.disabled,defaultChecked:p.checked,style:bp})},getIndicatorProps(){const h=n.get("indicatorRect");return e.element({id:ay(s),...ki.indicator.attrs,dir:o("dir"),hidden:n.get("value")==null,"data-disabled":G(a),"data-orientation":o("orientation"),style:{"--transition-property":"left, top, width, height","--left":h?.left,"--top":h?.top,"--width":h?.width,"--height":h?.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:n.get("canIndicatorTransition")?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[o("orientation")==="horizontal"?"left":"top"]:o("orientation")==="horizontal"?"var(--left)":"var(--top)"}})}}}var{not:vS}=eu(),yS={props({props:t}){return{orientation:"vertical",...t}},initialState(){return"idle"},context({prop:t,bindable:e}){return{value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),onChange(n){var r;(r=t("onValueChange"))==null||r({value:n})}})),activeValue:e(()=>({defaultValue:null})),focusedValue:e(()=>({defaultValue:null})),hoveredValue:e(()=>({defaultValue:null})),indicatorRect:e(()=>({defaultValue:{}})),canIndicatorTransition:e(()=>({defaultValue:!1})),fieldsetDisabled:e(()=>({defaultValue:!1})),focusVisible:e(()=>({defaultValue:!1})),ssr:e(()=>({defaultValue:!0}))}},refs(){return{indicatorCleanup:null}},computed:{isDisabled:({prop:t,context:e})=>!!t("disabled")||e.get("fieldsetDisabled")},entry:["syncIndicatorRect","syncSsr"],exit:["cleanupObserver"],effects:["trackFormControlState","trackFocusVisible"],watch({track:t,action:e,context:n}){t([()=>n.get("value")],()=>{e(["setIndicatorTransition","syncIndicatorRect","syncInputElements"])})},on:{SET_VALUE:[{guard:vS("isTrusted"),actions:["setValue","dispatchChangeEvent"]},{actions:["setValue"]}],SET_HOVERED:{actions:["setHovered"]},SET_ACTIVE:{actions:["setActive"]},SET_FOCUSED:{actions:["setFocused"]}},states:{idle:{}},implementations:{guards:{isTrusted:({event:t})=>!!t.isTrusted},effects:{trackFormControlState({context:t,scope:e}){return Yl(hu(e),{onFieldsetDisabledChange(n){t.set("fieldsetDisabled",n)},onFormReset(){t.set("value",t.initial("value"))}})},trackFocusVisible({scope:t}){var e;return kp({root:(e=t.getRootNode)==null?void 0:e.call(t)})}},actions:{setValue({context:t,event:e}){t.set("value",e.value)},setHovered({context:t,event:e}){t.set("hoveredValue",e.value)},setActive({context:t,event:e}){t.set("activeValue",e.value)},setFocused({context:t,event:e}){t.set("focusedValue",e.value),t.set("focusVisible",e.focusVisible)},syncInputElements({context:t,scope:e}){ff(e).forEach(n=>{n.checked=n.value===t.get("value")})},setIndicatorTransition({context:t}){t.set("canIndicatorTransition",kv(t.get("value")))},cleanupObserver({refs:t}){var e;(e=t.get("indicatorCleanup"))==null||e()},syncSsr({context:t}){t.set("ssr",!1)},syncIndicatorRect({context:t,scope:e,refs:n}){var r;if((r=n.get("indicatorCleanup"))==null||r(),!cS(e))return;const i=t.get("value"),o=hS(e,i);if(i==null||!o){t.set("indicatorRect",{});return}const s=rS(o,{getRect(a){return fS(a)},onChange(a){t.set("indicatorRect",mS(a)),dv(()=>{t.set("canIndicatorTransition",!1)})}});n.set("indicatorCleanup",s)},dispatchChangeEvent({context:t,scope:e}){ff(e).forEach(n=>{const r=n.value===t.get("value");r!==n.checked&&gp(n,{checked:r})})}}}};Wn()(["dir","disabled","form","getRootNode","id","ids","name","onValueChange","orientation","readOnly","value","defaultValue"]);Wn()(["value","disabled","invalid"]);const bS=["aria-describedby"],xL=Q({__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=rp(tu,I(()=>({label:""}))),r=t,i=e,o=pi(yS,{id:Qt(),name:Qt(),...r,defaultValue:r.modelValue,onValueChange:({value:a})=>i("update:modelValue",a)}),s=I(()=>gS(o,di));return Ee(()=>r.modelValue,a=>s.value.setValue(a)),(a,l)=>(E(),O("div",ne({class:["k-radiogroup",`k-radiogroup--variant-${a.variant} k-radiogroup--direction-${a.direction}`]},s.value.getRootProps(),{"aria-describedby":B(n).helpId}),[a.variant==="radio"&&(B(n).label||a.label)?(E(),O("span",be(ne({key:0},s.value.getLabelProps())),oe(B(n).label||a.label),17)):R("",!0),a.variant==="segment"?(E(),O("div",be(ne({key:1},s.value.getIndicatorProps())),null,16)):R("",!0),(E(!0),O(De,null,_t(a.items,u=>(E(),O("label",ne({ref_for:!0},s.value.getItemProps({value:u.id})),[z("span",ne({ref_for:!0},s.value.getItemTextProps({value:u.id})),oe(u.label),17),z("input",ne({ref_for:!0},s.value.getItemHiddenInputProps({value:u.id})),null,16),z("div",ne({ref_for:!0},s.value.getItemControlProps({value:u.id})),null,16)],16))),256))],16,bS))}}),EL=Q({__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(`
1
+ import{G as ka,q as Q,r as X,e as $,o as E,X as qt,E as Ee,b as I,c as O,i as qn,d as R,z as Va,A as Rg,a as z,n as Ce,g as F,C as $e,t as oe,y as Cr,w as Z,j as he,v as B,m as ne,f as Qe,ai as He,H as Lc,I as Pg,ae as mk,V as Qd,R as ep,a3 as gk,a4 as vk,P as yk,J as be,K as Ie,F as De,l as _t,D as ao,M as Fg,N as Cs,B as tp,O as Lg,a0 as bk,s as ns,S as np,a1 as kr,a2 as kk,u as Vg,Q as rp,U as wk,W as xk,Z as ip,k as Ba,$ as Bg,a9 as op,L as Co,h as sp,af as Ek,Y as Ck,T as Sk}from"./_plugin-vue_export-helper.js";var Tk=Object.defineProperty,Ok=(t,e,n)=>e in t?Tk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Yt=(t,e,n)=>(Ok(t,typeof e!="symbol"?e+"":e,n),n);function $g(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=$g(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Ak(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=$g(t))&&(r&&(r+=" "),r+=e);return r}const Ah=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Mh=Ak,rn=(t,e)=>n=>{var r;if(e?.variants==null)return Mh(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=Ah(c)||Ah(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 Mh(t,s,l,n?.class,n?.className)},jg=/^[a-z0-9]+(-[a-z0-9]+)*$/,Gl=(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&&!wa(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&&!wa(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:o};return e&&!wa(a,n)?null:a}return null},wa=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1,zg=Object.freeze({left:0,top:0,width:16,height:16}),$a=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Jl=Object.freeze({...zg,...$a}),Vc=Object.freeze({...Jl,body:"",hidden:!1});function Mk(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 _h(t,e){const n=Mk(t,e);for(const r in Vc)r in $a?r in t&&!(r in n)&&(n[r]=$a[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function _k(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 Dk(t,e,n){const r=t.icons,i=t.aliases||Object.create(null);let o={};function s(a){o=_h(r[a]||i[a],o)}return s(e),n.forEach(s),_h(t,o)}function Hg(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=_k(t);for(const i in r){const o=r[i];o&&(e(i,Dk(t,i,o)),n.push(i))}return n}const Nk={provider:"",aliases:{},not_found:{},...zg};function Lu(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function qg(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!Lu(t,Nk))return null;const n=e.icons;for(const i in n){const o=n[i];if(!i||typeof o.body!="string"||!Lu(o,Vc))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]||!Lu(o,Vc))return null}return e}const Dh=Object.create(null);function Ik(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function Hi(t,e){const n=Dh[t]||(Dh[t]=Object.create(null));return n[e]||(n[e]=Ik(t,e))}function Wg(t,e){return qg(e)?Hg(e,(n,r)=>{r?t.icons[n]=r:t.missing.add(n)}):[]}function Rk(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}let rs=!1;function Ug(t){return typeof t=="boolean"&&(rs=t),rs}function Pk(t){const e=typeof t=="string"?Gl(t,!0,rs):t;if(e){const n=Hi(e.provider,e.prefix),r=e.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Fk(t,e){const n=Gl(t,!0,rs);if(!n)return!1;const r=Hi(n.provider,n.prefix);return e?Rk(r,n.name,e):(r.missing.add(n.name),!0)}function Lk(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),rs&&!e&&!t.prefix){let i=!1;return qg(t)&&(t.prefix="",Hg(t,(o,s)=>{Fk(o,s)&&(i=!0)})),i}const n=t.prefix;if(!wa({prefix:n,name:"a"}))return!1;const r=Hi(e,n);return!!Wg(r,t)}const Kg=Object.freeze({width:null,height:null}),Gg=Object.freeze({...Kg,...$a}),Vk=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Bk=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Nh(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(Vk);if(r===null||!r.length)return t;const i=[];let o=r.shift(),s=Bk.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 $k(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 jk(t,e){return t?"<defs>"+t+"</defs>"+e:e}function zk(t,e,n){const r=$k(t);return jk(r.defs,e+r.content+n)}const Hk=t=>t==="unset"||t==="undefined"||t==="none";function qk(t,e){const n={...Jl,...t},r={...Gg,...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=zk(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=Nh(d,l/u)):(c=s==="auto"?l:s,d=a===null?Nh(c,u/l):a==="auto"?u:a);const h={},p=(m,g)=>{Hk(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 Wk=/\sid="(\S+)"/g,Uk="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Kk=0;function Gk(t,e=Uk){const n=[];let r;for(;r=Wk.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+(Kk++).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 Bc=Object.create(null);function Jk(t,e){Bc[t]=e}function $c(t){return Bc[t]||Bc[""]}function ap(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 lp=Object.create(null),Js=["https://api.simplesvg.com","https://api.unisvg.com"],jc=[];for(;Js.length>0;)Js.length===1||Math.random()>.5?jc.push(Js.shift()):jc.push(Js.pop());lp[""]=ap({resources:["https://api.iconify.design"].concat(jc)});function Jg(t,e){const n=ap(e);return n===null?!1:(lp[t]=n,!0)}function up(t){return lp[t]}const Xk=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let Ih=Xk();function Yk(t,e){const n=up(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 Zk(t){return t===404}const Qk=(t,e,n)=>{const r=[],i=Yk(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 ew(t){if(typeof t=="string"){const e=up(t);if(e)return e.path}return"/"}const tw=(t,e,n)=>{if(!Ih){n("abort",424);return}let r=ew(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;Ih(t+r).then(o=>{const s=o.status;if(s!==200){setTimeout(()=>{n(Zk(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)})},nw={prepare:Qk,send:tw};function rw(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]=Hi(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 Xg(t,e){t.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==e))})}function iw(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||Xg([t],o.id),o.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),o.abort))})}))}let ow=0;function sw(t,e,n){const r=ow++,i=Xg.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 aw(t,e=!0,n=!1){const r=[];return t.forEach(i=>{const o=typeof i=="string"?Gl(i,e,n):i;o&&r.push(o)}),r}var lw={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function uw(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 S=Math.floor(Math.random()*x.length);s.push(x[S]),x=x.slice(0,S).concat(x.slice(S+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,S){S&&(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,S,N){const A=S!=="success";switch(h=h.filter(C=>C!==x),l){case"pending":break;case"failed":if(A||!t.dataAfterTimeout)return;break;default:return}if(S==="abort"){c=N,b();return}if(A){c=N,h.length||(s.length?w():b());return}if(f(),k(),!t.random){const C=t.resources.indexOf(x.resource);C!==-1&&C!==t.index&&(t.index=C)}l="completed",p.forEach(C=>{C(N)})}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 S={status:"pending",resource:x,callback:(N,A)=>{v(S,N,A)}};h.push(S),u++,d=setTimeout(w,t.rotate),n(x,e,S.callback)}return setTimeout(w),y}function Yg(t){const e={...lw,...t};let n=[];function r(){n=n.filter(s=>s().status==="pending")}function i(s,a,l){const u=uw(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 Rh(){}const Vu=Object.create(null);function cw(t){if(!Vu[t]){const e=up(t);if(!e)return;const n=Yg(e),r={config:e,redundancy:n};Vu[t]=r}return Vu[t]}function dw(t,e,n){let r,i;if(typeof t=="string"){const o=$c(t);if(!o)return n(void 0,424),Rh;i=o.send;const s=cw(t);s&&(r=s.redundancy)}else{const o=ap(t);if(o){r=Yg(o);const s=t.resources?t.resources[0]:"",a=$c(s);a&&(i=a.send)}}return!r||!i?(n(void 0,424),Rh):r.query(e,i,n)().abort}function Ph(){}function pw(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,iw(t)}))}function hw(t){const e=[],n=[];return t.forEach(r=>{(r.match(jg)?e:n).push(r)}),{valid:e,invalid:n}}function vo(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(!Wg(t,n).length){r();return}}catch(i){console.error(i)}r(),pw(t)}function Fh(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function fw(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)){Fh(t.loadIcons(i,r,n),u=>{vo(t,i,u)});return}if(o){i.forEach(u=>{const c=o(u,r,n);Fh(c,d=>{const h=d?{prefix:r,icons:{[u]:d}}:null;vo(t,[u],h)})});return}const{valid:s,invalid:a}=hw(i);if(a.length&&vo(t,a,null),!s.length)return;const l=r.match(jg)?$c(n):null;if(!l){vo(t,s,null);return}l.prepare(n,r,s).forEach(u=>{dw(n,u,c=>{vo(t,u.icons,c)})})}))}const mw=(t,e)=>{const n=aw(t,!0,Ug()),r=rw(n);if(!r.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(r.loaded,r.missing,r.pending,Ph)}),()=>{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(Hi(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=Hi(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&&fw(l,u)}),e?sw(e,r,o):Ph};function gw(t,e){const n={...t};for(const r in e){const i=e[r],o=typeof i;r in Kg?(i===null||i&&(o==="string"||o==="number"))&&(n[r]=i):o===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const vw=/[\s,]+/;function yw(t,e){e.split(vw).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function bw(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 kw(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 ww(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function xw(t){return"data:image/svg+xml,"+ww(t)}function Ew(t){return'url("'+xw(t)+'")'}const Lh={...Gg,inline:!1},Cw={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Sw={display:"inline-block"},zc={backgroundColor:"currentColor"},Zg={backgroundColor:"transparent"},Vh={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Bh={webkitMask:zc,mask:zc,background:Zg};for(const t in Bh){const e=Bh[t];for(const n in Vh)e[t+n]=Vh[n]}const xa={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";xa[t+"-flip"]=e,xa[t.slice(0,1)+"-flip"]=e,xa[t+"Flip"]=e});function $h(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const jh=(t,e)=>{const n=gw(Lh,e),r={...Cw},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"&&yw(n,g);break;case"color":o.color=g;break;case"rotate":typeof g=="string"?n[m]=bw(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=xa[m];y?(g===!0||g==="true"||g===1)&&(n[y]=!0):Lh[m]===void 0&&(r[m]=g)}}}const l=qk(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=Gk(l.body,g?()=>g+"ID"+m++:"iconifyVue"),ns("svg",r)}const{body:c,width:d,height:h}=t,p=i==="mask"||(i==="bg"?!1:c.indexOf("currentColor")!==-1),f=kw(c,{...u,width:d+"",height:h+""});return r.style={...o,"--svg":Ew(f),width:$h(u.width),height:$h(u.height),...Sw,...p?zc:Zg,...a},ns("span",r)};Ug(!0);Jk("",nw);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"||!Lk(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;Jg(n,i)||console.error(r)}catch{console.error(r)}}}}const Tw={...Jl,body:""},Ze=Q({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=Gl(t,!1,!0))===null)return this.abortLoading(),null;let i=Pk(r);if(!i)return(!this._loadingIcon||this._loadingIcon.name!==t)&&(this.abortLoading(),this._name="",i!==null&&(this._loadingIcon={name:t,abort:mw([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 jh(Tw,t);let n=t;return e.classes&&(n={...t,class:(typeof t.class=="string"?t.class+" ":"")+e.classes.join(" ")}),jh({...Jl,...e.data},n)}});Jg("",{resources:["https://icons.ui.kvass.no"]});function Ow(t){return!t||typeof t!="object"?!1:typeof t.then=="function"&&typeof t.catch=="function"}const Aw=["xxs","xs","sm","default","lg","xl","xxl","3xl","4xl"],Mw=(t,e)=>e==="default"?`var(--k-ui-${t})`:`var(--k-ui-${t}-${e})`,ja=t=>{switch(t){case"start":case"end":return`flex-${t}`;default:return t}},cp=(t,e="spacing")=>t.split(" ").map(n=>typeof n=="number"||typeof n=="string"&&n.match(/^\d+$/)?`${n}rem`:typeof n=="string"&&Aw.includes(n)?Mw(e,n):n).join(" ");function _w(){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 Qg=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,r])=>[`--k-${t}-${n}`,r])),Dw=function(t){return Object.prototype.toString.call(t)==="[object Object]"};function Nw(t){return Array.isArray(t)}const ev=Q({__name:"Spinner",props:{size:{default:"medium"}},setup(t){return(e,n)=>(E(),O("span",{class:Ce(`k-spinner k-spinner--size-${e.size}`)},null,2))}}),Iw={class:"k-button__content"},Rw={key:0,class:"k-button__icon k-button__icon--left"},Pw={key:1,class:"k-button__icon k-button__icon--right"},Fw={key:2,class:"k-button__confirm-label"},ze=Q({__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=I(()=>!h.value||u.value==="loading"?n.variant:u.value=="confirm"?"warning":i[u.value]||n.variant),s=I(()=>n.loading||u.value==="loading"),a=X(),l=I(()=>{if(u.value)return["error","success"].includes(u.value)||s.value}),u=X("idle"),c=X(),d=X(),h=I(()=>u.value||s.value),p=I(()=>["error","success"].includes(u.value)),f=I(()=>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=S=>{g(),n.stateTimeout?(u.value=S,c.value=setTimeout(()=>{g(),r(S)},n.stateTimeout)):r(S)};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"}Ee(()=>n.promise,w=>{w&&Ow(w)&&m(w)});const y=X(),b=I(()=>u.value==="confirm");function k(w){if(n.confirm&&u.value!=="confirm")return u.value="confirm";g(),r("click",w)}const v=rn("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(),$(Qe(w.is),ne({type:"button",class:B(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:Z(()=>[Va(z("span",Iw,[w.icon||w.iconLeft||w.$slots.icon||w.$slots["icon-left"]?(E(),O("span",Rw,[F(w.$slots,"icon-left",{},()=>[F(w.$slots,"icon",{},()=>[he(B(Ze),{icon:w.icon||w.iconLeft},null,8,["icon"])])])])):R("",!0),F(w.$slots,"default",{},()=>[$e(oe(w.label),1)]),w.iconRight||w.$slots["icon-right"]?(E(),O("span",Pw,[F(w.$slots,"icon-right",{},()=>[he(B(Ze),{icon:w.iconRight},null,8,["icon"])])])):R("",!0)],512),[[Rg,!b.value]]),s.value?(E(),$(ev,{key:0})):R("",!0),p.value?(E(),$(B(Ze),{key:1,class:"k-button__state-indicator",icon:f.value},null,8,["icon"])):R("",!0),b.value?(E(),O("span",Fw,oe(w.confirmLabel),1)):R("",!0)]),_:3},16,["class","aria-busy","inert"]))}}),Lw={class:"k-alert__content"},Vw={key:0,class:"k-alert__title"},Bw={class:"k-alert__icon"},mL=Q({__name:"Alert",props:{variant:{default:"neutral"},icon:{},title:{},content:{},action:{}},emits:["action"],setup(t,{emit:e}){const n=t,r=e,i=rn("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(),O("div",{role:"alert",class:Ce(B(i)({...n}))},[z("div",Lw,[s.title||s.$slots.title?(E(),O("div",Vw,[F(s.$slots,"title",{},()=>[z("strong",null,oe(s.title),1)])])):R("",!0),F(s.$slots,"default",{},()=>[z("span",null,oe(s.content),1)]),s.action?(E(),$(ze,{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"])):R("",!0)]),z("div",Bw,[F(s.$slots,"icon",{},()=>[s.icon||o[s.variant]?(E(),$(B(Ze),{key:0,icon:s.icon||o[s.variant]},null,8,["icon"])):R("",!0)])])],2))}}),$w={class:"k-badge__label"},gL=Q({__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=rn("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=X(!1);function a(){s.value=!0,r("dismiss",n)}return(l,u)=>s.value?R("",!0):(E(),O("span",{key:0,class:Ce(B(o)({appearance:l.appearance,variant:l.variant,rounded:l.rounded}))},[F(l.$slots,"icon",{},()=>[l.icon||i[l.appearance]?(E(),$(B(Ze),{key:0,icon:l.icon||i[l.appearance],class:"k-badge__icon"},null,8,["icon"])):R("",!0)]),F(l.$slots,"default",{},()=>[z("span",$w,oe(l.label),1)]),l.dismissable?(E(),O("button",{key:0,class:"k-badge__dismiss",onClick:a},[he(B(Ze),{icon:"fa-pro-light:times"})])):R("",!0)],2))}});var Ln=(t,e=[])=>({parts:(...n)=>{if(jw(e))return Ln(t,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Ln(t,[...e,...n]),rename:n=>Ln(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(),jw=t=>t.length===0,zh=t=>Math.max(0,Math.min(1,t)),Bu=(...t)=>e=>t.reduce((n,r)=>r(n),e),Xs=()=>{},Xl=t=>typeof t=="object"&&t!==null,G=t=>t?"":void 0,zw=t=>t?"true":void 0,Hw=1,qw=9,Ww=11,dt=t=>Xl(t)&&t.nodeType===Hw&&typeof t.nodeName=="string",dp=t=>Xl(t)&&t.nodeType===qw,Uw=t=>Xl(t)&&t===t.window,tv=t=>dt(t)?t.localName||"":"#document";function Kw(t){return["html","body","#document"].includes(tv(t))}var Gw=t=>Xl(t)&&t.nodeType!==void 0,za=t=>Gw(t)&&t.nodeType===Ww&&"host"in t,Jw=t=>dt(t)&&t.localName==="input",Xw=t=>dt(t)?t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0:!1,Yw=/(textarea|select)/;function Zw(t){if(t==null||!dt(t))return!1;try{return Jw(t)&&t.selectionStart!=null||Yw.test(t.localName)||t.isContentEditable||t.getAttribute("contenteditable")==="true"||t.getAttribute("contenteditable")===""}catch{return!1}}function qi(t,e){var n;if(!t||!e||!dt(t)||!dt(e))return!1;const r=(n=e.getRootNode)==null?void 0:n.call(e);if(t===e||t.contains(e))return!0;if(r&&za(r)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Kt(t){return dp(t)?t:Uw(t)?t.document:t?.ownerDocument??document}function Qw(t){return Kt(t).documentElement}function xt(t){var e;return za(t)?xt(t.host):dp(t)?t.defaultView??window:dt(t)?((e=t.ownerDocument)==null?void 0:e.defaultView)??window:window}function nv(t){let e=t.activeElement;for(;e!=null&&e.shadowRoot;){const n=e.shadowRoot.activeElement;if(n===e)break;e=n}return e}function ex(t){if(tv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||za(t)&&t.host||Qw(t);return za(e)?e.host:e}var $u=new WeakMap;function tx(t){return $u.has(t)||$u.set(t,xt(t).getComputedStyle(t)),$u.get(t)}var rv=()=>typeof document<"u";function nx(){const t=navigator.userAgentData;return t?.platform??navigator.platform}var pp=t=>rv()&&t.test(nx()),rx=t=>rv()&&t.test(navigator.vendor),iv=()=>pp(/^Mac/),ix=()=>ox()&&rx(/apple/i),ox=()=>pp(/mac|iphone|ipad|ipod/i),hp=()=>pp(/iP(hone|ad|od)|iOS/);function sx(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 ct(t){const e=sx(t);return e?.[0]??t.target}var ax=t=>qi(t.currentTarget,ct(t)),lx=t=>t.button===0,ux=t=>t.button===2||iv()&&t.ctrlKey&&t.button===0,cx=t=>t.ctrlKey||t.altKey||t.metaKey,dx=t=>"touches"in t&&t.touches.length>0,px={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Hh={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function ov(t,e={}){const{dir:n="ltr",orientation:r="horizontal"}=e;let i=t.key;return i=px[i]??i,n==="rtl"&&r==="horizontal"&&i in Hh&&(i=Hh[i]),i}var hx=new Set(["PageUp","PageDown"]),fx=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function mx(t){return t.ctrlKey||t.metaKey?.1:hx.has(t.key)||t.shiftKey&&fx.has(t.key)?10:1}function fp(t,e="client"){const n=dx(t)?t.touches[0]||t.changedTouches[0]:t;return{x:n[`${e}X`],y:n[`${e}Y`]}}var Ne=(t,e,n,r)=>{const i=typeof t=="function"?t():t;return i?.addEventListener(e,n,r),()=>{i?.removeEventListener(e,n,r)}};function sv(t,e){const{type:n="HTMLInputElement",property:r="value"}=e,i=xt(t)[n].prototype;return Object.getOwnPropertyDescriptor(i,r)??{}}function gx(t){if(t.localName==="input")return"HTMLInputElement";if(t.localName==="textarea")return"HTMLTextAreaElement";if(t.localName==="select")return"HTMLSelectElement"}function av(t,e,n="value"){var r;if(!t)return;const i=gx(t);i&&((r=sv(t,{type:i,property:n}).set)==null||r.call(t,e)),t.setAttribute(n,e)}function mp(t,e){var n;t&&((n=sv(t,{type:"HTMLInputElement",property:"checked"}).set)==null||n.call(t,e),e?t.setAttribute("checked",""):t.removeAttribute("checked"))}function vx(t,e){const{value:n,bubbles:r=!0}=e;if(!t)return;const i=xt(t);t instanceof i.HTMLInputElement&&(av(t,`${n}`),t.dispatchEvent(new i.Event("input",{bubbles:r})))}function gp(t,e){const{checked:n,bubbles:r=!0}=e;if(!t)return;const i=xt(t);t instanceof i.HTMLInputElement&&(mp(t,n),t.dispatchEvent(new i.Event("click",{bubbles:r})))}function yx(t){return bx(t)?t.form:t.closest("form")}function bx(t){return t.matches("textarea, input, select, button")}function kx(t,e){if(!t)return;const n=yx(t),r=i=>{i.defaultPrevented||e()};return n?.addEventListener("reset",r,{passive:!0}),()=>n?.removeEventListener("reset",r)}function wx(t,e){const n=t?.closest("fieldset");if(!n)return;e(n.disabled);const r=xt(n),i=new r.MutationObserver(()=>e(n.disabled));return i.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>i.disconnect()}function Yl(t,e){if(!t)return;const{onFieldsetDisabledChange:n,onFormReset:r}=e,i=[kx(t,r),wx(t,n)];return()=>i.forEach(o=>o?.())}var lv=t=>dt(t)&&t.tagName==="IFRAME",xx=t=>!Number.isNaN(parseInt(t.getAttribute("tabindex")||"0",10)),Ex=t=>parseInt(t.getAttribute("tabindex")||"0",10)<0,vp="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",uv=(t,e=!1)=>{if(!t)return[];const n=Array.from(t.querySelectorAll(vp));(e==!0||e=="if-empty"&&n.length===0)&&dt(t)&&dr(t)&&n.unshift(t);const r=n.filter(dr);return r.forEach((i,o)=>{if(lv(i)&&i.contentDocument){const s=i.contentDocument.body;r.splice(o,1,...uv(s))}}),r};function dr(t){return!t||t.closest("[inert]")?!1:t.matches(vp)&&Xw(t)}function cv(t,e){if(!t)return[];const n=Array.from(t.querySelectorAll(vp)),r=n.filter(Vr);return r.forEach((i,o)=>{if(lv(i)&&i.contentDocument){const s=i.contentDocument.body,a=cv(s);r.splice(o,1,...a)}}),!r.length&&e?n:r}function Vr(t){return t!=null&&t.tabIndex>0?!0:dr(t)&&!Ex(t)}function yo(t){return t.tabIndex<0&&(/^(audio|video|details)$/.test(t.localName)||Zw(t))&&!xx(t)?0:t.tabIndex}function dv(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 At(t){let e;const n=globalThis.requestAnimationFrame(()=>{e=t()});return()=>{globalThis.cancelAnimationFrame(n),e?.()}}function Hc(t){const e=ex(t);return Kw(e)?Kt(e).body:dt(e)&&Sx(e)?e:Hc(e)}var Cx=/auto|scroll|overlay|hidden|clip/;function Sx(t){const e=xt(t),{overflow:n,overflowX:r,overflowY:i,display:o}=e.getComputedStyle(t);return Cx.test(n+i+r)&&!["inline","contents"].includes(o)}function Tx(t,e){const{left:n,top:r,width:i,height:o}=e.getBoundingClientRect(),s={x:t.x-n,y:t.y-r},a={x:zh(s.x/i),y:zh(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}}var Di="default",qc="",Ea=new WeakMap;function Ox(t={}){const{target:e,doc:n}=t,r=n??document,i=r.documentElement;return hp()?(Di==="default"&&(qc=i.style.webkitUserSelect,i.style.webkitUserSelect="none"),Di="disabled"):e&&(Ea.set(e,e.style.userSelect),e.style.userSelect="none"),()=>Ax({target:e,doc:r})}function Ax(t={}){const{target:e,doc:n}=t,r=(n??document).documentElement;if(hp()){if(Di!=="disabled")return;Di="restoring",setTimeout(()=>{dv(()=>{Di==="restoring"&&(r.style.webkitUserSelect==="none"&&(r.style.webkitUserSelect=qc||""),qc="",Di="default")})},300)}else if(e&&Ea.has(e)){const i=Ea.get(e);e.style.userSelect==="none"&&(e.style.userSelect=i??""),e.getAttribute("style")===""&&e.removeAttribute("style"),Ea.delete(e)}}function Mx(t={}){const{defer:e,target:n,...r}=t,i=e?At:s=>s(),o=[];return o.push(i(()=>{const s=typeof n=="function"?n():n;o.push(Ox({...r,target:s}))})),()=>{o.forEach(s=>s?.())}}function _x(t,e){const{onPointerMove:n,onPointerUp:r}=e,i=[Ne(t,"pointermove",o=>{const s=fp(o),a=Math.sqrt(s.x**2+s.y**2),l=o.pointerType==="touch"?10:5;if(!(a<l)){if(o.pointerType==="mouse"&&o.button===0){r();return}n({point:s,event:o})}},!1),Ne(t,"pointerup",r,!1),Ne(t,"pointercancel",r,!1),Ne(t,"contextmenu",r,!1),Mx({doc:t})];return()=>{i.forEach(o=>o())}}function pv(t){const{pointerNode:e,keyboardNode:n=e,onPress:r,onPressStart:i,onPressEnd:o,isValidKey:s=b=>b.key==="Enter"}=t;if(!e)return Xs;const a=xt(e),l=Kt(e);let u=Xs,c=Xs,d=Xs;const h=b=>({point:fp(b),event:b});function p(b){i?.(h(b))}function f(b){o?.(h(b))}const m=Ne(e,"pointerdown",b=>{c();const k=Ne(a,"pointerup",w=>{const x=ct(w);qi(e,x)?r?.(h(w)):o?.(h(w))},{passive:!r,once:!0}),v=Ne(a,"pointercancel",f,{passive:!o,once:!0});c=Bu(k,v),l.activeElement===n&&b.pointerType==="mouse"&&b.preventDefault(),p(b)},{passive:!i}),g=Ne(n,"focus",y);u=Bu(m,g);function y(){const b=x=>{if(!s(x))return;const S=A=>{if(!s(A))return;const C=new a.PointerEvent("pointerup"),_=h(C);r?.(_),o?.(_)};c(),c=Ne(n,"keyup",S);const N=new a.PointerEvent("pointerdown");p(N)},k=()=>{const x=new a.PointerEvent("pointercancel");f(x)},v=Ne(n,"keydown",b),w=Ne(n,"blur",k);d=Bu(v,w)}return()=>{u(),c(),d()}}function yp(t,e){return Array.from(t?.querySelectorAll(e)??[])}var hv=t=>t.id;function Dx(t,e,n=hv){return t.find(r=>n(r)===e)}function fv(t,e,n=hv){const r=Dx(t,e,n);return r?t.indexOf(r):-1}function Nx(t,e,n=!0){let r=fv(t,e);return r=n?(r+1)%t.length:Math.min(r+1,t.length-1),t[r]}function Ix(t,e,n=!0){let r=fv(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])}var ju=new WeakMap;function Rx(t,e,n){ju.has(t)||ju.set(t,new Map);const r=ju.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 Px(t,e){return t?Rx(t,"style",()=>{const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}):()=>{}}var bp={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},Fx=1e3/60;function Lx(t,e){const n=t();if(dt(n)&&n.isConnected)return e(n),()=>{};{const r=setInterval(()=>{const i=t();dt(i)&&i.isConnected&&(e(i),clearInterval(r))},Fx);return()=>clearInterval(r)}}function Vx(t,e){const n=[];return t?.forEach(r=>{const i=Lx(r,e);n.push(i)}),()=>{n.forEach(r=>r())}}function Bx(t){return t.mozInputSource===0&&t.isTrusted?!0:t.detail===0&&!t.pointerType}function $x(t){return!(t.metaKey||!iv()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}var jx=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function zx(t,e,n){const r=n?ct(n):null,i=xt(r);return t=t||r instanceof i.HTMLInputElement&&!jx.has(r?.type)||r instanceof i.HTMLTextAreaElement||r instanceof i.HTMLElement&&r.isContentEditable,!(t&&e==="keyboard"&&n instanceof i.KeyboardEvent&&!Reflect.has(Hx,n.key))}var ci=null,Wc=new Set,Lo=new Map,ti=!1,Uc=!1,Hx={Tab:!0,Escape:!0};function Zl(t,e){for(let n of Wc)n(t,e)}function Ha(t){ti=!0,$x(t)&&(ci="keyboard",Zl("keyboard",t))}function Bt(t){ci="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(ti=!0,Zl("pointer",t))}function mv(t){Bx(t)&&(ti=!0,ci="virtual")}function gv(t){const e=ct(t);e===xt(e)||e===Kt(e)||(!ti&&!Uc&&(ci="virtual",Zl("virtual",t)),ti=!1,Uc=!1)}function vv(){ti=!1,Uc=!0}function qx(t){if(typeof window>"u"||Lo.get(xt(t)))return;const e=xt(t),n=Kt(t);let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){ci="virtual",Zl("virtual",null),ti=!0,r.apply(this,arguments)},n.addEventListener("keydown",Ha,!0),n.addEventListener("keyup",Ha,!0),n.addEventListener("click",mv,!0),e.addEventListener("focus",gv,!0),e.addEventListener("blur",vv,!1),typeof e.PointerEvent<"u"?(n.addEventListener("pointerdown",Bt,!0),n.addEventListener("pointermove",Bt,!0),n.addEventListener("pointerup",Bt,!0)):(n.addEventListener("mousedown",Bt,!0),n.addEventListener("mousemove",Bt,!0),n.addEventListener("mouseup",Bt,!0)),e.addEventListener("beforeunload",()=>{Wx(t)},{once:!0}),Lo.set(e,{focus:r})}var Wx=(t,e)=>{const n=xt(t),r=Kt(t);Lo.has(n)&&(n.HTMLElement.prototype.focus=Lo.get(n).focus,r.removeEventListener("keydown",Ha,!0),r.removeEventListener("keyup",Ha,!0),r.removeEventListener("click",mv,!0),n.removeEventListener("focus",gv,!0),n.removeEventListener("blur",vv,!1),typeof n.PointerEvent<"u"?(r.removeEventListener("pointerdown",Bt,!0),r.removeEventListener("pointermove",Bt,!0),r.removeEventListener("pointerup",Bt,!0)):(r.removeEventListener("mousedown",Bt,!0),r.removeEventListener("mousemove",Bt,!0),r.removeEventListener("mouseup",Bt,!0)),Lo.delete(n))};function is(){return ci==="keyboard"}function kp(t={}){const{isTextInput:e,autoFocus:n,onChange:r,root:i}=t;qx(i),r?.({isFocusVisible:n||is(),modality:ci});const o=(s,a)=>{zx(!!e,s,a)&&r?.({isFocusVisible:is(),modality:s})};return Wc.add(o),()=>{Wc.delete(o)}}function Ux(t){return t?Array.isArray(t)?t:[t]:[]}var yv=t=>t[0],bv=t=>t[t.length-1],Kx=(t,e)=>t.indexOf(e)!==-1,Gx=(t,...e)=>t.concat(e),Jx=(t,...e)=>t.filter(n=>!e.includes(n)),Xx=(t,e)=>Kx(t,e)?Jx(t,e):Gx(t,e),qh=t=>t?.constructor.name==="Array",Yx=(t,e)=>{if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Ss(t[n],e[n]))return!1;return!0},Ss=(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(qh(t)&&qh(e))return Yx(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(!Ss(t[o],e[o]))return!1}return!0},Wh=(...t)=>(...e)=>{t.forEach(function(n){n?.(...e)})},Zx=t=>Array.isArray(t),kv=t=>typeof t=="string",Ni=t=>typeof t=="function",Qx=Function.prototype.toString;Qx.call(Object);var{floor:Uh,abs:qa,round:wv,min:e1,max:t1,pow:n1,sign:r1}=Math,So=t=>Number.isNaN(t),wp=t=>So(t)?0:t,i1=(t,e,n)=>t===0?n:e[t-1],o1=(t,e,n)=>t===e.length-1?n:e[t+1],s1=(t,e,n)=>wv((wp(t)-e)/n)*n+e,Ql=(t,e,n)=>e1(t1(wp(t),e),n),xp=(t,e,n)=>(wp(t)-e)/(n-e),xv=(t,e,n,r)=>Ql(s1(t*(n-e)+e,e,r),e,n),Ys=(t,e)=>{let n=t,r=e.toString(),i=r.indexOf("."),o=i>=0?r.length-i:0;if(o>0){let s=n1(10,o);n=wv(n*s)/s}return n},Ev=(t,e,n,r)=>{e=Number(e),n=Number(n);let i=(t-(So(e)?0:e))%r,o=Ys(qa(i)*2>=r?t+r1(i)*(r-qa(i)):t-i,r);return So(e)?!So(n)&&o>n&&(o=e+Uh(Ys((n-e)/r,r))*r):o<e?o=e:!So(n)&&o>n&&(o=e+Uh(Ys((n-e)/r,r))*r),Ys(o,r)},To=(t,e,n)=>t[e]===n?t:[...t.slice(0,e),n,...t.slice(e+1)];function Cv(t,e){const n=i1(t,e.values,e.min),r=o1(t,e.values,e.max);let i=e.values.slice();return function(o){let s=Ev(o,n,r,e.step);return i=To(i,t,o),i[t]=s,i}}function a1(t,e){const n=e.values[t]+e.step;return Cv(t,e)(n)}function l1(t,e){const n=e.values[t]-e.step;return Cv(t,e)(n)}var u1=(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 qa(r-e)<qa(i-e)?n-1:n},c1=(t,e,n,r)=>t.map((i,o)=>({min:o===0?e:t[o-1]+r,max:o===t.length-1?n:t[o+1]-r,value:i})),Kc=(t,e)=>{const[n,r]=t,[i,o]=e;return s=>n===r||i===o?i:i+(o-i)/(r-n)*(s-n)};function Sv(t){if(!d1(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]=Sv(i))}return n}var d1=t=>t&&typeof t=="object"&&t.constructor===Object;function Gc(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}function p1(t,e){if(t==null)throw new Error(e)}function h1(t,e,n){let r=[];for(const i of e)t[i]==null&&r.push(i);if(r.length>0)throw new Error(`[zag-js] missing required props: ${r.join(", ")}`)}function eu(){return{and:(...t)=>function(e){return t.every(n=>e.guard(n))},or:(...t)=>function(e){return t.some(n=>e.guard(n))},not:t=>function(e){return!e.guard(t)}}}function f1(t){const e=()=>{var o;return((o=t.getRootNode)==null?void 0:o.call(t))??document},n=()=>Kt(e()),r=()=>n().defaultView??window,i=()=>nv(e());return{...t,getRootNode:e,getDoc:n,getWin:r,getActiveElement:i,isActiveElement:o=>o===i(),getById:o=>e().getElementById(o)}}function m1(t){return new Proxy({},{get(e,n){return n==="style"?r=>t({style:r}).style:t}})}var Wn=()=>t=>Array.from(new Set(t)),g1=Ln("checkbox").parts("root","label","control","indicator"),Zs=g1.build(),Tv=t=>{var e;return((e=t.ids)==null?void 0:e.root)??`checkbox:${t.id}`},Kh=t=>{var e;return((e=t.ids)==null?void 0:e.label)??`checkbox:${t.id}:label`},v1=t=>{var e;return((e=t.ids)==null?void 0:e.control)??`checkbox:${t.id}:control`},Jc=t=>{var e;return((e=t.ids)==null?void 0:e.hiddenInput)??`checkbox:${t.id}:input`},y1=t=>t.getById(Tv(t)),Oo=t=>t.getById(Jc(t));function b1(t,e){const{send:n,context:r,prop:i,computed:o,scope:s}=t,a=i("disabled"),l=i("readOnly"),u=!a&&r.get("focused"),c=!a&&r.get("focusVisible"),d=o("checked"),h=o("indeterminate"),p={"data-active":G(r.get("active")),"data-focus":G(u),"data-focus-visible":G(c),"data-readonly":G(l),"data-hover":G(r.get("hovered")),"data-disabled":G(a),"data-state":h?"indeterminate":d?"checked":"unchecked","data-invalid":i("invalid")};return{checked:d,disabled:a,indeterminate:h,focused:u,checkedState:d,setChecked(f){n({type:"CHECKED.SET",checked:f,isTrusted:!1})},toggleChecked(){n({type:"CHECKED.TOGGLE",checked:d,isTrusted:!1})},getRootProps(){return e.label({...Zs.root.attrs,...p,dir:i("dir"),id:Tv(s),htmlFor:Jc(s),onPointerMove(){a||n({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){a||n({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(f){ct(f)===Oo(s)&&f.stopPropagation()}})},getLabelProps(){return e.element({...Zs.label.attrs,...p,dir:i("dir"),id:Kh(s)})},getControlProps(){return e.element({...Zs.control.attrs,...p,dir:i("dir"),id:v1(s),"aria-hidden":!0})},getIndicatorProps(){return e.element({...Zs.indicator.attrs,...p,dir:i("dir"),hidden:!h&&!d})},getHiddenInputProps(){return e.input({id:Jc(s),type:"checkbox",required:i("required"),defaultChecked:d,disabled:a,"aria-labelledby":Kh(s),"aria-invalid":i("invalid"),name:i("name"),form:i("form"),value:i("value"),style:bp,onFocus(){const f=is();n({type:"CONTEXT.SET",context:{focused:!0,focusVisible:f}})},onBlur(){n({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(f){if(l){f.preventDefault();return}const m=f.currentTarget.checked;n({type:"CHECKED.SET",checked:m,isTrusted:!0})}})}}}var{not:Gh}=eu(),k1={props({props:t}){return{value:"on",...t,defaultChecked:!!t.defaultChecked}},initialState(){return"ready"},context({prop:t,bindable:e}){return{checked:e(()=>({defaultValue:t("defaultChecked"),value:t("checked"),onChange(n){var r;(r=t("onCheckedChange"))==null||r({checked:n})}})),fieldsetDisabled:e(()=>({defaultValue:!1})),focusVisible:e(()=>({defaultValue:!1})),active:e(()=>({defaultValue:!1})),focused:e(()=>({defaultValue:!1})),hovered:e(()=>({defaultValue:!1}))}},watch({track:t,context:e,prop:n,action:r}){t([()=>n("disabled")],()=>{r(["removeFocusIfNeeded"])}),t([()=>e.get("checked")],()=>{r(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:Gh("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:Gh("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{indeterminate:({context:t})=>Ca(t.get("checked")),checked:({context:t})=>w1(t.get("checked")),disabled:({context:t,prop:e})=>!!e("disabled")||t.get("fieldsetDisabled")},states:{ready:{}},implementations:{guards:{isTrusted:({event:t})=>!!t.isTrusted},effects:{trackPressEvent({context:t,computed:e,scope:n}){if(!e("disabled"))return pv({pointerNode:y1(n),keyboardNode:Oo(n),isValidKey:r=>r.key===" ",onPress:()=>t.set("active",!1),onPressStart:()=>t.set("active",!0),onPressEnd:()=>t.set("active",!1)})},trackFocusVisible({computed:t,scope:e}){var n;if(!t("disabled"))return kp({root:(n=e.getRootNode)==null?void 0:n.call(e)})},trackFormControlState({context:t,scope:e}){return Yl(Oo(e),{onFieldsetDisabledChange(n){t.set("fieldsetDisabled",n)},onFormReset(){t.set("checked",t.initial("checked"))}})}},actions:{setContext({context:t,event:e}){for(const n in e.context)t.set(n,e.context[n])},syncInputElement({context:t,computed:e,scope:n}){const r=Oo(n);r&&(mp(r,e("checked")),r.indeterminate=Ca(t.get("checked")))},removeFocusIfNeeded({context:t,prop:e}){e("disabled")&&t.get("focused")&&(t.set("focused",!1),t.set("focusVisible",!1))},setChecked({context:t,event:e}){t.set("checked",e.checked)},toggleChecked({context:t,computed:e}){const n=Ca(e("checked"))?!0:!e("checked");t.set("checked",n)},dispatchChangeEvent({computed:t,scope:e}){queueMicrotask(()=>{const n=Oo(e);gp(n,{checked:t("checked")})})}}}};function Ca(t){return t==="indeterminate"}function w1(t){return Ca(t)?!1:!!t}Wn()(["defaultChecked","checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]);function x1(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}var Jh={htmlFor:"for",className:"class",onDoubleClick:"onDblclick",onChange:"onInput",onFocus:"onFocusin",onBlur:"onFocusout",defaultValue:"value",defaultChecked:"checked"},E1="viewBox,className,preserveAspectRatio,fillRule,clipPath,clipRule,strokeWidth,strokeLinecap,strokeLinejoin,strokeDasharray,strokeDashoffset,strokeMiterlimit".split(",");function C1(t){return t in Jh?Jh[t]:t.startsWith("on")?`on${x1(t.substr(2))}`:E1.includes(t)?t:t.toLowerCase()}var di=m1(t=>{const e={};for(const n in t){const r=t[n];n==="children"?typeof r=="string"&&(e.innerHTML=r):e[C1(n)]=t[n]}return e});function Xh(t){const e=t().defaultValue??t().value,n=t().isEqual??Ss,r=qt(e),i=I(()=>t().value!==void 0),o=qt(i.value?t().value:r.value);return{initial:e,ref:o,get(){return i.value?t().value:r.value},set(s){var a,l;const u=i.value?t().value:r.value,c=Ni(s)?s(u):s;t().debug&&console.log(`[bindable > ${t().debug}] setValue`,{next:c,prev:u}),i.value||(r.value=c),n(c,u)||(l=(a=t()).onChange)==null||l.call(a,c,u)},invoke(s,a){var l,u;(u=(l=t()).onChange)==null||u.call(l,s,a)},hash(s){var a,l;return((l=(a=t()).hash)==null?void 0:l.call(a,s))??String(s)}}}function S1(t){const e=X(t);return{get(n){return e.value[n]},set(n,r){e.value[n]=r}}}var T1=(t,e)=>{Ee(()=>[...t.map(n=>n())],(n,r)=>{let i=!1;for(let o=0;o<n.length;o++)if(!Ss(r[o],He(n[o]))){i=!0;break}i&&e()})};function pi(t,e={}){var n,r,i;const o=I(()=>{const{id:C,ids:_,getRootNode:L}=He(e);return f1({id:C,ids:_,getRootNode:L})}),s=(...C)=>{t.debug&&console.log(...C)},a=I(()=>{var C;return((C=t.props)==null?void 0:C.call(t,{props:Sv(He(e)),get scope(){return o.value}}))??He(e)}),l=O1(a),u=((n=t.context)==null?void 0:n.call(t,{prop:l,bindable:Xh,get scope(){return o.value},flush:Yh,getContext(){return c},getComputed(){return S}}))??{},c={get(C){var _;return(_=u[C])==null?void 0:_.get()},set(C,_){var L;(L=u[C])==null||L.set(_)},initial(C){var _;return(_=u[C])==null?void 0:_.initial},hash(C){var _,L;const W=(_=u[C])==null?void 0:_.get();return(L=u[C])==null?void 0:L.hash(W)}};let d=new Map,h=null,p={current:null},f={current:{type:"__init__"}};const m=()=>({...f.current,current(){return f.current},previous(){return p.current}}),g=()=>({...N,matches(...C){const _=N.get();return C.includes(_)},hasTag(C){var _,L;const W=N.get();return!!((L=(_=t.states[W])==null?void 0:_.tags)!=null&&L.includes(C))}}),y=S1(((r=t.refs)==null?void 0:r.call(t,{prop:l,context:c}))??{}),b=()=>({state:g(),context:c,event:m(),prop:l,send:A,action:k,guard:v,track:T1,refs:y,computed:S,flush:Yh,get scope(){return o.value},choose:x}),k=C=>{const _=Ni(C)?C(b()):C;if(!_)return;const L=_.map(W=>{var q,K;const J=(K=(q=t.implementations)==null?void 0:q.actions)==null?void 0:K[W];return J||Gc(`[zag-js] No implementation found for action "${JSON.stringify(W)}"`),J});for(const W of L)W?.(b())},v=C=>{var _,L;return Ni(C)?C(b()):(L=(_=t.implementations)==null?void 0:_.guards)==null?void 0:L[C](b())},w=C=>{const _=Ni(C)?C(b()):C;if(!_)return;const L=_.map(q=>{var K,J;const ue=(J=(K=t.implementations)==null?void 0:K.effects)==null?void 0:J[q];return ue||Gc(`[zag-js] No implementation found for effect "${JSON.stringify(q)}"`),ue}),W=[];for(const q of L){const K=q?.(b());K&&W.push(K)}return()=>W.forEach(q=>q?.())},x=C=>Ux(C).find(_=>{let L=!_.guard;return kv(_.guard)?L=!!v(_.guard):Ni(_.guard)&&(L=_.guard(b())),L}),S=C=>{p1(t.computed,"[zag-js] No computed object found on machine");const _=t.computed[C];return _({context:c,event:m(),prop:l,refs:y,get scope(){return o.value},computed:S})},N=Xh(()=>({defaultValue:t.initialState({prop:l}),onChange(C,_){var L,W,q;if(_){const J=d.get(_);J?.(),d.delete(_)}_&&k((L=t.states[_])==null?void 0:L.exit),k(h?.actions);const K=w((W=t.states[C])==null?void 0:W.effects);if(K&&d.set(C,K),_==="__init__"){k(t.entry);const J=w(t.effects);J&&d.set("__init__",J)}k((q=t.states[C])==null?void 0:q.entry)}}));qn(()=>{N.invoke(N.initial,"__init__")}),ao(()=>{const C=d.values();for(const _ of C)_?.();d=new Map,k(t.exit)});const A=C=>{var _,L;p.current=f.current,f.current=C,s("send",C);let W=N.get();const q=((_=t.states[W].on)==null?void 0:_[C.type])??((L=t.on)==null?void 0:L[C.type]),K=x(q);if(!K)return;h=K;const J=K.target??W;s("transition",K),J!==W?N.set(J):k(K.actions)};return(i=t.watch)==null||i.call(t,b()),{state:g(),send:A,context:c,prop:l,get scope(){return o.value},refs:y,computed:S,event:m()}}function O1(t){return function(e){return t.value[e]}}var Yh=t=>{kr().then(()=>{t()})};function Qt(t={}){const{prefix:e}=t,n=_w();return e?`${e}-${n}`:n}const A1={key:0,class:"k-checkbox__help"},Zh=Q({__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:l,value:u}=n;return l instanceof Array?l.some(c=>Co(c)===Co(u)):!!l};function o(l){const{modelValue:u,value:c}=n;if(!(u instanceof Array))return r("update:modelValue",typeof l=="boolean"?l:void 0);if(!(typeof l!="boolean"||!c))return l?r("update:modelValue",[...u,c]):r("update:modelValue",u.filter(d=>Co(d)!==Co(c)))}const s=pi(k1,{id:Qt(),defaultChecked:i(),onCheckedChange:({checked:l})=>{if(i()!==l)return o(l)},disabled:n.disabled,required:n.required}),a=I(()=>b1(s,di));return Ee(()=>n.modelValue,()=>{const l=i();if(a.value.checked!==l)return a.value.setChecked(l)}),(l,u)=>(E(),O("label",ne({class:"k-checkbox"},a.value.getRootProps()),[z("div",be(Ie(a.value.getControlProps())),[a.value.checked?(E(),$(B(Ze),{key:0,icon:"fa-pro-solid:check"})):R("",!0)],16),l.label||l.$slots.help||l.$slots.default?(E(),O("span",be(ne({key:0},a.value.getLabelProps())),[z("span",{class:Ce(["k-checkbox__label",{"k-checkbox__label-required":l.required}])},[F(l.$slots,"default",{},()=>[$e(oe(l.label),1)])],2),l.$slots.help||l.help?(E(),O("span",A1,[F(l.$slots,"help",{},()=>[$e(oe(l.help),1)])])):R("",!0)],16)):R("",!0),z("input",be(Ie(a.value.getHiddenInputProps())),null,16)],16))}}),tu=Symbol("form-control"),M1={class:"k-formcontrol"},_1=["for"],D1={key:1,class:"k-formcontrol__error"},N1={key:2,class:"k-formcontrol__help"},I1=Q({__name:"FormControl",props:{label:{},help:{},error:{},required:{type:Boolean}},emits:["blur","focus"],setup(t,{emit:e}){const n=t,r=e,i=Qt({prefix:"k-formcontrol"}),o=I(()=>`${i}_label`),s=I(()=>`${i}_help`),a={onBlur:()=>r("blur"),onFocus:()=>r("focus")};return bk(tu,I(()=>({...n,id:i,labelId:o.value,helpId:s.value,invalid:!!n.error,required:n.required,events:a}))),(l,u)=>(E(),O("div",M1,[l.$slots.label||l.label?(E(),O("label",{key:0,class:Ce(["k-formcontrol__label",{"k-formcontrol__label-required":l.required}]),for:B(i)},[F(l.$slots,"label",{},()=>[$e(oe(l.label),1)])],10,_1)):R("",!0),F(l.$slots,"default",{id:B(i)}),l.$slots.error||l.error?(E(),O("span",D1,[F(l.$slots,"error",{},()=>[$e(oe(l.error),1)])])):R("",!0),l.$slots.help||l.help?(E(),O("span",N1,[F(l.$slots,"help",{},()=>[$e(oe(l.help),1)])])):R("",!0)]))}}),R1={class:"k-filter-type-dropdown"},P1=Q({__name:"Dropdown",props:Lc({label:{},items:{}},{modelValue:{default:""},modelModifiers:{}}),emits:Lc(["disable"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=Pg(t,"modelValue"),i=I(()=>{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=I(()=>n.items.map(a=>({...a,action:()=>s.value=a.value}))),s=I({get(){return r.value},set(a){r.value=a}});return(a,l)=>(E(),O("div",R1,[he(B(I1),{label:a.label},{default:Z(()=>[he(B(pu),{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"])]))}}),F1=Object.freeze(Object.defineProperty({__proto__:null,default:P1},Symbol.toStringTag,{value:"Module"}));function L1(t,e){let n,r,i;const o=qt(!0),s=()=>{o.value=!0,i()};Ee(t,s,{flush:"sync"});const a=typeof e=="function"?e:e.get,l=typeof e=="function"?void 0:e.set,u=ep((c,d)=>(r=c,i=d,{get(){return o.value&&(n=a(n),o.value=!1),r(),n},set(h){l?.(h)}}));return Object.isExtensible(u)&&(u.trigger=s),u}function Ts(t){return gk()?(vk(t),!0):!1}const Os=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const V1=t=>t!=null,B1=Object.prototype.toString,Ov=t=>B1.call(t)==="[object Object]",$1=()=>{},Qh=j1();function j1(){var t,e;return Os&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window?.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function z1(...t){if(t.length!==1)return mk(...t);const e=t[0];return typeof e=="function"?Qd(ep(()=>({get:e,set:$1}))):X(e)}function H1(t){let e;function n(){return e||(e=t()),e}return n.reset=async()=>{const r=e;e=void 0,r&&await r},n}function Gr(t){return Array.isArray(t)?t:[t]}function q1(t,e,n={}){const{immediate:r=!0,immediateCallback:i=!1}=n,o=qt(!1);let s=null;function a(){s&&(clearTimeout(s),s=null)}function l(){o.value=!1,a()}function u(...c){i&&t(),a(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=null,t(...c)},He(e))}return r&&(o.value=!0,Os&&u()),Ts(l),{isPending:Qd(o),start:u,stop:l}}function Av(t,e,n){return Ee(t,e,{...n,immediate:!0})}const Mv=Os?window:void 0,_v=Os?window.navigator:void 0;function Dv(t){var e;const n=He(t);return(e=n?.$el)!=null?e:n}function Ep(...t){const e=[],n=()=>{e.forEach(a=>a()),e.length=0},r=(a,l,u,c)=>(a.addEventListener(l,u,c),()=>a.removeEventListener(l,u,c)),i=I(()=>{const a=Gr(He(t[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),o=Av(()=>{var a,l;return[(l=(a=i.value)==null?void 0:a.map(u=>Dv(u)))!=null?l:[Mv].filter(u=>u!=null),Gr(He(i.value?t[1]:t[0])),Gr(B(i.value?t[2]:t[1])),He(i.value?t[3]:t[2])]},([a,l,u,c])=>{if(n(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(u!=null&&u.length))return;const d=Ov(c)?{...c}:c;e.push(...a.flatMap(h=>l.flatMap(p=>u.map(f=>r(h,p,f,d)))))},{flush:"post"}),s=()=>{o(),n()};return Ts(n),s}function W1(){const t=qt(!1),e=np();return e&&qn(()=>{t.value=!0},e),t}function Cp(t){const e=W1();return I(()=>(e.value,!!t()))}function U1(t,e,n={}){const{window:r=Mv,...i}=n;let o;const s=Cp(()=>r&&"MutationObserver"in r),a=()=>{o&&(o.disconnect(),o=void 0)},l=I(()=>{const h=He(t),p=Gr(h).map(Dv).filter(V1);return new Set(p)}),u=Ee(()=>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=()=>{u(),a()};return Ts(d),{isSupported:s,stop:d,takeRecords:c}}function ef(t,e={}){const{controls:n=!1,navigator:r=_v}=e,i=Cp(()=>r&&"permissions"in r),o=qt(),s=typeof t=="string"?{name:t}:t,a=qt(),l=()=>{var c,d;a.value=(d=(c=o.value)==null?void 0:c.state)!=null?d:"prompt"};Ep(o,"change",l,{passive:!0});const u=H1(async()=>{if(i.value){if(!o.value)try{o.value=await r.permissions.query(s)}catch{o.value=void 0}finally{l()}if(n)return Co(o.value)}});return u(),n?{state:a,isSupported:i,query:u}:a}function K1(t={}){const{navigator:e=_v,read:n=!1,source:r,copiedDuring:i=1500,legacy:o=!1}=t,s=Cp(()=>e&&"clipboard"in e),a=ef("clipboard-read"),l=ef("clipboard-write"),u=I(()=>s.value||o),c=qt(""),d=qt(!1),h=q1(()=>d.value=!1,i,{immediate:!1});async function p(){let b=!(s.value&&y(a.value));if(!b)try{c.value=await e.clipboard.readText()}catch{b=!0}b&&(c.value=g())}u.value&&n&&Ep(["copy","cut"],p,{passive:!0});async function f(b=He(r)){if(u.value&&b!=null){let k=!(s.value&&y(l.value));if(!k)try{await e.clipboard.writeText(b)}catch{k=!0}k&&m(b),c.value=b,d.value=!0,h.start()}}function m(b){const k=document.createElement("textarea");k.value=b??"",k.style.position="absolute",k.style.opacity="0",document.body.appendChild(k),k.select(),document.execCommand("copy"),k.remove()}function g(){var b,k,v;return(v=(k=(b=document?.getSelection)==null?void 0:b.call(document))==null?void 0:k.toString())!=null?v:""}function y(b){return b==="granted"||b==="prompt"}return{isSupported:u,text:c,copied:d,copy:f}}function nu(t){const e=np(),n=L1(()=>null,()=>e.proxy.$el);return yk(n.trigger),qn(n.trigger),n}const G1={class:"k-filter-type-range"},J1={class:"k-filter-type-range__header"},X1={class:"k-filter-type-range__header-label"},Y1={class:"k-filter-type-range__value"},Z1={class:"k-filter-type-range__value-display"},Q1=Q({__name:"RangeSlider",props:Lc({min:{},max:{},label:{},suffix:{},step:{},type:{}},{modelValue:{default:[0,1e3]},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=Pg(t,"modelValue"),n=nu();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(),O("div",G1,[z("div",J1,[z("label",X1,[z("span",null,oe(s.label),1),he(B(Ze),{icon:s.$attrs.icon},null,8,["icon"])]),F(s.$slots,"remove")]),z("div",Y1,[he(B(cC),ne({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"]),z("div",Z1,[z("span",null,oe(o(e.value[0])),1),z("span",null,oe(o(e.value[1])),1)])])]))}}),eE=Object.freeze(Object.defineProperty({__proto__:null,default:Q1},Symbol.toStringTag,{value:"Module"})),tf=Object.assign({"./Dropdown.vue":F1,"./RangeSlider.vue":eE});for(const t in tf)t.replace(/(\.\/|\.vue)/g,""),tf[t].default;function pr(t){return typeof t=="string"||t instanceof String}function nf(t){var e;return typeof t=="object"&&t!=null&&(t==null||(e=t.constructor)==null?void 0:e.name)==="Object"}function Nv(t,e){return Array.isArray(e)?Nv(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 U={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function tE(t){switch(t){case U.LEFT:return U.FORCE_LEFT;case U.RIGHT:return U.FORCE_RIGHT;default:return t}}function zu(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Wa(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(!Wa(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(!Wa(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 nE{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?U.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?U.RIGHT:U.LEFT}}function ie(t,e){return new ie.InputMask(t,e)}function Iv(t){if(t==null)throw new Error("mask property should be defined");return t instanceof RegExp?ie.MaskedRegExp:pr(t)?ie.MaskedPattern:t===Date?ie.MaskedDate:t===Number?ie.MaskedNumber:Array.isArray(t)||t===Array?ie.MaskedDynamic:ie.Masked&&t.prototype instanceof ie.Masked?t:ie.Masked&&t instanceof ie.Masked?t.constructor:t instanceof Function?ie.MaskedFunction:(console.warn("Mask not found for mask",t),ie.Masked)}function ss(t){if(!t)throw new Error("Options in not defined");if(ie.Masked){if(t.prototype instanceof ie.Masked)return{mask:t};const{mask:e=void 0,...n}=t instanceof ie.Masked?{mask:t}:nf(t)&&t.mask instanceof ie.Masked?t:{};if(e){const r=e.mask;return{...Nv(e,(i,o)=>!o.startsWith("_")),mask:e.constructor,_mask:r,...n}}}return nf(t)?{...t}:{mask:t}}function $n(t){if(ie.Masked&&t instanceof ie.Masked)return t;const e=ss(t),n=Iv(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)}ie.createMask=$n;class Sp{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}}ie.MaskElement=Sp;const rf=90,rE=89;class ru extends Sp{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===rf&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===rE&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===rf&&(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={}}}ie.HTMLMaskElement=ru;class iE extends ru{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}}ie.HTMLMaskElement=ru;class Rv extends ru{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}}ie.HTMLContenteditableMaskElement=Rv;class iu{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>iu.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}}iu.MAX_LENGTH=100;class oE{constructor(e,n){this.el=e instanceof Sp?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new Rv(e):new iE(e),this.masked=$n(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new iu,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 ie.Masked)&&this.masked.constructor===Iv(e)){this.masked.updateOptions({mask:e});return}const n=e instanceof ie.Masked?e:$n({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,U.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 nE({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:U.NONE;let s=this.masked.nearestInputPos(n.startChangePos+i,o);o!==U.NONE&&(s=this.masked.nearestInputPos(s,U.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}}ie.InputMask=oE;class de{static normalize(e){return Array.isArray(e)?e:[e,new de]}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}}ie.ChangeDetails=de;class mn{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 it{constructor(e){this._value="",this._update({...it.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 mn(this.extractInput(e,n),e)}appendTail(e){return pr(e)&&(e=new mn(String(e))),e.appendTo(this)}_appendCharRaw(e,n){return e?(this._value+=e,new de({inserted:e,rawInserted:e})):new de}_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 de,this.state=i,r&&s&&(r.state=s))}return o}_appendPlaceholder(){return new de}_appendEager(){return new de}append(e,n,r){if(!pr(e))throw new Error("value should be string");const i=pr(r)?new mn(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 de}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={}),de.normalize(this.prepare?this.prepare(e,this,n):e)}doPrepareChar(e,n){return n===void 0&&(n={}),de.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=U.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=tE(i),u=this.extractInput(0,s,{raw:!0}));let c=e;const d=new de;if(i!==U.NONE&&(c=this.nearestInputPos(e,n>1&&e!==0&&!l?U.NONE:i),d.tailShift=c-e),d.aggregate(this.remove(c)),l&&i!==U.NONE&&u===this.rawInputValue)if(i===U.FORCE_LEFT){let h;for(;u===this.rawInputValue&&(h=this.displayValue.length);)d.aggregate(new de({tailShift:-1})).aggregate(this.remove(h-1))}else i===U.FORCE_RIGHT&&a.unshift();return d.aggregate(this.append(r,o,a))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!Wa(this,e)}typedValueEquals(e){const n=this.typedValue;return e===n||it.EMPTY_VALUES.includes(e)&&it.EMPTY_VALUES.includes(n)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new de}}it.DEFAULTS={skipInvalid:!0};it.EMPTY_VALUES=[void 0,null,""];ie.Masked=it;class qr{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=pr(e)?new mn(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 mn)r?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof qr){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 ie.MaskedPattern))return new mn(this.toString()).appendTo(e);const n=new de;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 qr||e._stops.indexOf(s)>=0)&&n.aggregate(e._appendPlaceholder(s)),a=i instanceof qr&&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 qr:new mn;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 sE{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,U.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,U.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,U.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,U.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,U.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,U.NONE),!0})}}class Pv{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 de}nearestInputPos(e,n){n===void 0&&(n=U.NONE);const r=0,i=this._value.length;switch(n){case U.LEFT:case U.FORCE_LEFT:return r;case U.NONE:case U.RIGHT:case U.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 de;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 de({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 de;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new mn("")}appendTail(e){return pr(e)&&(e=new mn(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 Ua{constructor(e){const{parent:n,isOptional:r,placeholderChar:i,displayChar:o,lazy:s,eager:a,...l}=e;this.masked=$n(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 de}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 de;const r=this.masked.state;let i=this.masked._appendChar(e,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i=new de,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 de:(this.isFilled=!0,new de({inserted:this.placeholderChar}))}_appendEager(){return new de}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=U.NONE);const r=0,i=this.value.length,o=Math.min(Math.max(e,r),i);switch(n){case U.LEFT:case U.FORCE_LEFT:return this.isComplete?o:r;case U.RIGHT:case U.FORCE_RIGHT:return this.isComplete?o:i;case U.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 de}}Ua.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 aE extends it{updateOptions(e){super.updateOptions(e)}_update(e){const n=e.mask;n&&(e.validate=r=>r.search(n)>=0),super._update(e)}}ie.MaskedRegExp=aE;class ot extends it{constructor(e){super({...ot.DEFAULTS,...e,definitions:Object.assign({},Ua.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}=ss(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 ie.RepeatBlock(m):$n(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===ot.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(s==="{"||s==="}"){r=!r;continue}if(s==="["||s==="]"){i=!i;continue}if(s===ot.ESCAPE_CHAR){if(++o,s=n[o],!s)break;a=!1}const l=a?new Ua({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...ss(e[s]),parent:this}):new Pv({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 de;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 de;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 qr;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 qr&&(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 de;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=U.NONE),!this._blocks.length)return 0;const r=new sE(this,e);if(n===U.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===U.LEFT||n===U.FORCE_LEFT){if(n===U.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===e)return e;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===U.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===U.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===U.RIGHT||n===U.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===U.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(e,U.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 de;return this._forEachBlocksInRange(0,this.displayValue.length,r=>n.aggregate(r.pad(e))),n}}ot.DEFAULTS={...it.DEFAULTS,lazy:!0,placeholderChar:"_"};ot.STOP_CHAR="`";ot.ESCAPE_CHAR="\\";ot.InputDefinition=Ua;ot.FixedDefinition=Pv;ie.MaskedPattern=ot;class Sa extends ot{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 de;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}}ie.MaskedRange=Sa;const lE="d{.}`m{.}`Y";class In extends ot{static extractPatternOptions(e){const{mask:n,pattern:r,...i}=e;return{...i,mask:pr(n)?n:r}}constructor(e){super(In.extractPatternOptions({...In.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:n,pattern:r,blocks:i,...o}={...In.DEFAULTS,...e},s=Object.assign({},In.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:pr(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(In.extractPatternOptions(e))}}In.GET_DEFAULT_BLOCKS=()=>({d:{mask:Sa,from:1,to:31,maxLength:2},m:{mask:Sa,from:1,to:12,maxLength:2},Y:{mask:Sa,from:1900,to:9999}});In.DEFAULTS={...ot.DEFAULTS,mask:Date,pattern:lE,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)}};ie.MaskedDate=In;class ou extends it{constructor(e){super({...ou.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}=ss(n),o=$n({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 de,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 de;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 de;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 Wa(n,o)&&n.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(e))}}ou.DEFAULTS={...it.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,U.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,U.FORCE_LEFT)))}});return o.sort((s,a)=>a.weight-s.weight||a.totalInputPositions-s.totalInputPositions),e.compiledMasks[o[0].index]}};ie.MaskedDynamic=ou;class su extends ot{constructor(e){super({...su.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,U.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 de({skip:!this.isComplete})}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new mn("",e)}remove(e,n){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),e===n)return new de;const r=Math.min(super.nearestInputPos(0,U.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}}su.DEFAULTS={...ot.DEFAULTS,matchValue:(t,e,n)=>t.indexOf(e,n)===n};ie.MaskedEnum=su;class uE extends it{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}ie.MaskedFunction=uE;var Fv;class St extends it{constructor(e){super({...St.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+zu(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(zu).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(zu(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(St.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 de({inserted:this._value.slice(o.length),rawInserted:l?"":e,skip:l}):(this._value=o,u=new de),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 de({tailShift:(s-o)*this.thousandsSeparator.length})}nearestInputPos(e,n){if(!this.thousandsSeparator)return e;switch(n){case U.NONE:case U.LEFT:case U.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===U.FORCE_LEFT)return r}break}case U.RIGHT:case U.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===St.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,St.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(St.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)||St.EMPTY_VALUES.includes(e)&&St.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}Fv=St;St.UNMASKED_RADIX=".";St.EMPTY_VALUES=[...it.EMPTY_VALUES,0];St.DEFAULTS={...it.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Fv.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})};ie.MaskedNumber=St;const Xc={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Lv(t,e,n){e===void 0&&(e=Xc.MASKED),n===void 0&&(n=Xc.MASKED);const r=$n(t);return i=>r.runIsolated(o=>(o[e]=i,o[n]))}function cE(t,e,n,r){return Lv(e,n,r)(t)}ie.PIPE_TYPE=Xc;ie.createPipe=Lv;ie.pipe=cE;class dE extends ot{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}=ss(e);this._blockOpts=Object.assign({},this._blockOpts,s);const a=$n(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($n(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,n){n===void 0&&(n={});const r=new de;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}}ie.RepeatBlock=dE;try{globalThis.IMask=ie}catch{}function pE(t,e){let{emit:n,onAccept:r,onComplete:i,defaultValue:o,defaultUnmaskedValue:s,defaultTypedValue:a}=e===void 0?{}:e;const l=wk(t)?t:X(t),u=X(),c=X(),d=X(""),h=X(""),p=X();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(C){b(),n&&(n("accept",d.value,C),n("accept:masked",d.value,C),n("accept:typed",p.value,C),n("accept:unmasked",h.value,C)),r?.(C)}function v(C){n&&(n("complete",c.value.value,C),n("complete:masked",c.value.value,C),n("complete:typed",c.value.typedValue,C),n("complete:unmasked",c.value.unmaskedValue,C)),i?.(C)}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)};Ee(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)};Ee(d,x);const S=()=>{!c.value||p.value===void 0||(y!==p.value&&(c.value.typedValue=p.value,c.value.masked.typedValueEquals(p.value)||k()),y=void 0)};Ee(p,S);function N(){f=u.value;const C=l.value;!f||!(C!=null&&C.mask)||(c.value=ie(f,C),o!==void 0&&(d.value=o),s!==void 0&&(h.value=s),a!==void 0&&(p.value=a),w(),x(),S(),b(),c.value.on("accept",k).on("complete",v))}function A(){var C;(C=c.value)==null||C.destroy(),c.value=void 0}return qn(N),xk(A),Ee([u,l],()=>{const C=u.value,_=l.value;(!(_!=null&&_.mask)||C!==f)&&A(),C&&(c.value?c.value.updateOptions(_):N())}),{el:u,mask:Qd(c),masked:d,unmasked:h,typed:p}}const hE={key:0,class:"k-input__prefix"},fE=["id","aria-labelledby","aria-describedby","required","type"],mE={key:1,class:"k-input__suffix"},gE=Q({__name:"Input",props:{invalid:{type:Boolean},id:{},modelValue:{},prefix:{},suffix:{},mask:{},align:{default:"left"},type:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=Vg(),r=t,i=e;function o(p){r.mask||i("update:modelValue",p.target.value)}const s=rn("k-input",{variants:{invalid:{true:"k-input--invalid"},align:{left:"k-input--align-left",right:"k-input--align-right"}}}),a=rp(tu,I(()=>({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}=pE(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 qn(()=>{Ee(()=>r.modelValue,p=>{r.mask&&c.value!==String(p)&&(c.value=String(p)),r.mask||(h.value.value=p)},{immediate:!0})}),(p,f)=>(E(),O("div",{class:Ce(B(s)({invalid:B(a).invalid,align:p.align}))},[p.$slots.prefix||p.prefix?(E(),O("span",hE,[F(p.$slots,"prefix",{},()=>[$e(oe(p.prefix),1)])])):R("",!0),z("input",ne({class:"k-input__input",id:B(a).id,"aria-labelledby":B(a).labelId,"aria-describedby":B(a).helpId,required:B(a).required,onInput:o,onBlur:u,onFocus:l,ref_key:"el",ref:h,type:r.type},{...B(a).events,...p.$attrs}),null,16,fE),p.$slots.suffix||p.suffix?(E(),O("span",mE,[F(p.$slots,"suffix",{},()=>[$e(oe(p.suffix),1)])])):R("",!0)],2))}}),vE=["id","value","aria-labelledby","aria-describedby"],vL=Q({__name:"TextArea",props:{invalid:{type:Boolean},id:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(a){r("update:modelValue",a.target.value)}const o=rn("k-textarea",{variants:{invalid:{true:"k-textarea--invalid"}}}),s=rp(tu,I(()=>({id:n.id,invalid:n.invalid})));return(a,l)=>(E(),O("textarea",ne({class:B(o)({invalid:B(s).invalid}),id:B(s).id,value:a.modelValue,"aria-labelledby":B(s).labelId,"aria-describedby":B(s).helpId,onInput:i},a.$attrs),null,16,vE))}});let yE=class{constructor(t,e){Yt(this,"key"),Yt(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(){}},bE=class{constructor(t,e){Yt(this,"key"),Yt(this,"goto"),Yt(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 kE{constructor(e,n){Yt(this,"key"),Yt(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 wE=Object.freeze(Object.defineProperty({__proto__:null,localStorage:yE,none:bE,sessionStorage:kE},Symbol.toStringTag,{value:"Module"})),xE=["data-step"],EE={key:0,class:"k-stepper-breadcrumbs-wrapper"},CE={key:0,class:"k-stepper__breadcrumb-arrow"},SE=["disabled","onClick"],TE={class:"k-stepper__breadcrumb-icon"},OE={class:"k-stepper__breadcrumb-label"},AE={class:"k-stepper__component-wrapper"},ME={key:0,class:"k-stepper__navigation"},yL=Q({__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=X(),i=X(),o=X(n.steps[0].id);let s;const a=typeof n.stateHandler=="string"?wE[n.stateHandler]:n.stateHandler;s=new a(n.stateKey,f),ao(()=>s.destroy());const l=I(()=>c(o.value)),u=I(()=>{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=sp({next:h,prev:p,goto:f});Ee(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 S=["top","bottom"].includes(x)?"h":"v";return`k-stepper-${v}-${S}-${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(),O("div",{class:Ce(`k-stepper k-stepper--breadcrumb-placement-${k.breadcrumbPlacement}`),"data-step":o.value},[k.hidebreadcrumbs?R("",!0):(E(),O("div",EE,[F(k.$slots,"before-breadcrumbs",be(Ie({meta:l.value,navigate:m}))),z("div",{class:"k-stepper__breadcrumbs",ref_key:"breadcrumb",ref:r},[(E(!0),O(De,null,_t(k.steps,(w,x)=>(E(),O(De,null,[x>0?(E(),O("div",CE)):R("",!0),F(k.$slots,"breadcrumb",{step:w,isActive:w.id===o.value,index:x,select:()=>f(w.id)},()=>[z("button",{type:"button",class:Ce(["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:S=>f(w.id)},[z("span",TE,[F(k.$slots,"breadcrumb-icon",{step:w},()=>[w.isValid===!0?(E(),$(B(Ze),{key:0,icon:"heroicons-solid:check",width:12})):w.isValid===!1?(E(),$(B(Ze),{key:1,icon:"heroicons:exclamation-triangle",width:17})):(E(),O(De,{key:2},[$e(oe(x+1),1)],64))])]),z("span",OE,oe(w.label),1)],10,SE)])],64))),256))],512),F(k.$slots,"after-breadcrumbs",be(Ie({meta:l.value,navigate:m})))])),F(k.$slots,"before-content",be(Ie({meta:l.value,navigate:m}))),z("div",AE,[he(tp,{name:y(),mode:"out-in",onAfterEnter:b},{default:Z(()=>[k.keepAlive?(E(),$(Ek,{key:0},[(E(),$(Qe(u.value.step.component),ne({key:o.value},u.value),null,16))],1024)):(E(),$(Qe(u.value.step.component),ne({key:o.value},u.value),null,16))]),_:1},8,["name"]),k.$slots.navigation?(E(),O("div",ME,[F(k.$slots,"navigation",be(Ie({meta:l.value,navigate:m})))])):R("",!0)]),F(k.$slots,"after-content",be(Ie({meta:l.value,navigate:m})))],10,xE))}}),_E=["src","alt"],au=Q({__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=X(),o=X(!1),s=X(!1),a=X(),l=I(()=>({"--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 qn(()=>{var d;return((d=i.value)==null?void 0:d.complete)&&u()}),(d,h)=>(E(),O("figure",{class:Ce(["k-image",[`k-image--size-${d.size}`,{"k-image--loaded":o.value,"k-image--loading":!o.value}]]),style:Cr(l.value)},[o.value?R("",!0):(E(),$(ev,{key:0,size:"small"})),Va(z("img",{src:d.src,alt:d.alt||d.caption,onLoad:u,onError:c,ref_key:"image",ref:i},null,40,_E),[[Rg,!s.value]]),d.$slots.caption||d.caption?(E(),O("figcaption",{key:1,class:Ce(`k-image__caption k-image__caption--visibility-${d.captionVisibility} k-image__caption--theme-${!o.value||s.value?"light":d.captionTheme}`)},[F(d.$slots,"caption",{},()=>[$e(oe(d.caption),1)])],2)):R("",!0)],6))}}),ni=Q({__name:"Flex",props:{is:{default:"div"},gap:{default:"default"},justify:{},align:{},direction:{default:"row"},nowrap:{type:Boolean}},setup(t){const e=t,n=I(()=>Qg("flex",{justify:ja(e.justify)||"initial",align:ja(e.align)||"initial",wrap:e.nowrap?"nowrap":"wrap",gap:cp(e.gap),direction:e.direction}));return(r,i)=>(E(),$(Qe(r.is),{class:"k-flex",style:Cr(n.value)},{default:Z(()=>[F(r.$slots,"default")]),_:3},8,["style"]))}}),DE={key:0,class:"k-card__thumbnail"},NE={key:0,class:"k-card__title"},IE={key:1,class:"k-card__subtitle"},RE={key:2,class:"k-card__content"},PE=Q({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=ip(),r=I(()=>e.thumbnail||n.thumbnail),i=I(()=>e.title||e.subtitle||n.header),o=I(()=>n.actions),s=I(()=>n.default);return(a,l)=>(E(),$(Qe(a.is),ne({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:Z(()=>[r.value?(E(),O("div",DE,[F(a.$slots,"thumbnail",{},()=>[a.thumbnail?(E(),$(au,ne({key:0},a.thumbnailOptions,{src:a.thumbnail}),null,16,["src"])):R("",!0)])])):R("",!0),i.value?(E(),$(ni,{key:1,is:"header",direction:"column",gap:"0rem",class:"k-card__header"},{default:Z(()=>[F(a.$slots,"header",{},()=>[a.title?(E(),O("div",NE,oe(a.title),1)):R("",!0),a.subtitle?(E(),O("div",IE,oe(a.subtitle),1)):R("",!0)])]),_:3})):R("",!0),s.value?(E(),O("div",RE,[F(a.$slots,"default")])):R("",!0),o.value?(E(),$(ni,{key:3,justify:"center",align:"center",class:"k-card__actions"},{default:Z(()=>[F(a.$slots,"actions")]),_:3})):R("",!0)]),_:3},16,["class"]))}}),bL=Q({__name:"Skeleton",props:{variant:{default:"shiny"},aspectRatio:{},width:{},height:{},rounding:{}},setup(t){const e=()=>t.rounding?t.rounding==="full"?"9999px":cp(t.rounding,"rounding"):"initial",n=I(()=>({"--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(),O("span",{class:Ce(["k-skeleton",`k-skeleton--variant-${r.variant}`]),style:Cr(n.value)},[F(r.$slots,"default")],6))}});function FE(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 LE(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)=>FE(u,d=>{r(d,c)}));i.push(...l)}if(s(),n){const a=VE(o,s);i.push(a)}return()=>{i.forEach(a=>{a?.()})}}function VE(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 BE=Ln("slider").parts("root","label","thumb","valueText","track","range","control","markerGroup","marker","draggingIndicator"),ln=BE.build(),Vv=t=>{var e;return((e=t.ids)==null?void 0:e.root)??`slider:${t.id}`},Bv=(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}`},Yc=(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}`},$v=t=>{var e;return((e=t.ids)==null?void 0:e.control)??`slider:${t.id}:control`},$E=t=>{var e;return((e=t.ids)==null?void 0:e.track)??`slider:${t.id}:track`},jE=t=>{var e;return((e=t.ids)==null?void 0:e.range)??`slider:${t.id}:range`},of=t=>{var e;return((e=t.ids)==null?void 0:e.label)??`slider:${t.id}:label`},zE=t=>{var e;return((e=t.ids)==null?void 0:e.valueText)??`slider:${t.id}:value-text`},HE=(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}`},qE=t=>t.getById(Vv(t)),WE=(t,e)=>t.getById(Bv(t,e)),jv=(t,e)=>t.getById(Yc(t,e)),zv=t=>t.getById($v(t)),Hv=t=>yp(zv(t),"[role=slider]"),UE=t=>Hv(t)[0],sf=(t,e)=>{const{prop:n,scope:r}=t,i=zv(r);if(!i)return;const o=Tx(e,i).getPercentValue({orientation:n("orientation"),dir:n("dir"),inverted:{y:!0}});return xv(o,n("min"),n("max"),n("step"))},KE=(t,e)=>{e.forEach((n,r)=>{const i=jv(t,r);i&&vx(i,{value:n})})};function GE(t){const e=t[0],n=t[t.length-1];return[e,n]}function JE(t){const{prop:e,computed:n}=t,r=n("valuePercent"),[i,o]=GE(r);if(r.length===1){if(e("origin")==="center"){const s=r[0]<50,a=s?`${r[0]}%`:"50%",l=s?"50%":`${100-r[0]}%`;return{start:a,end:l}}return{start:"0%",end:`${100-o}%`}}return{start:`${i}%`,end:`${100-o}%`}}function XE(t){const{computed:e}=t,n=e("isVertical"),r=e("isRtl");return n?{position:"absolute",bottom:"var(--slider-range-start)",top:"var(--slider-range-end)"}:{position:"absolute",[r?"right":"left"]:"var(--slider-range-start)",[r?"left":"right"]:"var(--slider-range-end)"}}function YE(t,e){const{context:n,prop:r}=t,{height:i=0}=n.get("thumbSize")??{},o=Kc([r("min"),r("max")],[-i/2,i/2]);return parseFloat(o(e).toFixed(2))}function ZE(t,e){const{computed:n,context:r,prop:i}=t,{width:o=0}=r.get("thumbSize")??{};if(n("isRtl")){const a=Kc([i("max"),i("min")],[-o/2,o/2]);return-1*parseFloat(a(e).toFixed(2))}const s=Kc([i("min"),i("max")],[-o/2,o/2]);return parseFloat(s(e).toFixed(2))}function QE(t,e,n){const{computed:r,prop:i}=t;if(i("thumbAlignment")==="center")return`${e}%`;const o=r("isVertical")?YE(t,n):ZE(t,n);return`calc(${e}% - ${o}px)`}function qv(t,e){const{prop:n}=t,r=xp(e,n("min"),n("max"))*100;return QE(t,r,e)}function Wv(t){const{computed:e,prop:n}=t;let r="visible";return n("thumbAlignment")==="contain"&&!e("hasMeasuredThumbSize")&&(r="hidden"),r}function af(t,e){const{computed:n}=t,r=n("isVertical")?"bottom":"insetInlineStart";return{visibility:Wv(t),position:"absolute",transform:"var(--slider-thumb-transform)",[r]:`var(--slider-thumb-offset-${e})`}}function eC(){return{touchAction:"none",userSelect:"none",WebkitUserSelect:"none",position:"relative"}}function tC(t){const{context:e,computed:n}=t,r=n("isVertical"),i=n("isRtl"),o=JE(t);return{...e.get("value").reduce((s,a,l)=>{const u=qv(t,a);return{...s,[`--slider-thumb-offset-${l}`]:u}},{}),"--slider-thumb-transform":r?"translateY(50%)":i?"translateX(50%)":"translateX(-50%)","--slider-range-start":o.start,"--slider-range-end":o.end}}function nC(t,e){const{computed:n}=t,r=n("isHorizontal"),i=n("isRtl");return{visibility:Wv(t),position:"absolute",pointerEvents:"none",[r?"insetInlineStart":"bottom"]:qv(t,e),translate:"var(--tx) var(--ty)","--tx":r?i?"50%":"-50%":"0%","--ty":r?"0%":"50%"}}function rC(){return{userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none",position:"relative"}}function iC(t,e){return e.map((n,r)=>Zc(t,n,r))}function hr(t,e){const{context:n,prop:r}=t;return c1(n.get("value"),r("min"),r("max"),r("minStepsBetweenThumbs"))[e]}function Zc(t,e,n){const{prop:r}=t,i=hr(t,n),o=Ev(e,r("min"),r("max"),r("step"));return Ql(o,i.min,i.max)}function oC(t,e,n){const{context:r,prop:i}=t,o=e??r.get("focusedIndex"),s=hr(t,o),a=l1(o,{...s,step:n??i("step"),values:r.get("value")});return a[o]=Ql(a[o],s.min,s.max),a}function sC(t,e,n){const{context:r,prop:i}=t,o=e??r.get("focusedIndex"),s=hr(t,o),a=a1(o,{...s,step:n??i("step"),values:r.get("value")});return a[o]=Ql(a[o],s.min,s.max),a}function aC(t,e){const{context:n}=t;return u1(n.get("value"),e)}function Uv(t,e){const{state:n,send:r,context:i,prop:o,computed:s,scope:a}=t,l=o("aria-label"),u=o("aria-labelledby"),c=i.get("value"),d=i.get("focusedIndex"),h=n.matches("focus"),p=n.matches("dragging"),f=s("isDisabled"),m=o("invalid"),g=s("isInteractive"),y=o("orientation")==="horizontal",b=o("orientation")==="vertical";function k(w){return xp(w,o("min"),o("max"))}function v(w){return xv(w,o("min"),o("max"),o("step"))}return{value:c,dragging:p,focused:h,setValue(w){r({type:"SET_VALUE",value:w})},getThumbValue(w){return c[w]},setThumbValue(w,x){r({type:"SET_VALUE",index:w,value:x})},getValuePercent:k,getPercentValue:v,getThumbPercent(w){return k(c[w])},setThumbPercent(w,x){const S=v(x);r({type:"SET_VALUE",index:w,value:S})},getThumbMin(w){return hr(t,w).min},getThumbMax(w){return hr(t,w).max},increment(w){r({type:"INCREMENT",index:w})},decrement(w){r({type:"DECREMENT",index:w})},focus(){g&&r({type:"FOCUS",index:0})},getLabelProps(){return e.label({...ln.label.attrs,dir:o("dir"),"data-disabled":G(f),"data-orientation":o("orientation"),"data-invalid":G(m),"data-dragging":G(p),"data-focus":G(h),id:of(a),htmlFor:Yc(a,0),onClick(w){var x;g&&(w.preventDefault(),(x=UE(a))==null||x.focus())},style:{userSelect:"none",WebkitUserSelect:"none"}})},getRootProps(){return e.element({...ln.root.attrs,"data-disabled":G(f),"data-orientation":o("orientation"),"data-dragging":G(p),"data-invalid":G(m),"data-focus":G(h),id:Vv(a),dir:o("dir"),style:tC(t)})},getValueTextProps(){return e.element({...ln.valueText.attrs,dir:o("dir"),"data-disabled":G(f),"data-orientation":o("orientation"),"data-invalid":G(m),"data-focus":G(h),id:zE(a)})},getTrackProps(){return e.element({...ln.track.attrs,dir:o("dir"),id:$E(a),"data-disabled":G(f),"data-invalid":G(m),"data-dragging":G(p),"data-orientation":o("orientation"),"data-focus":G(h),style:{position:"relative"}})},getThumbProps(w){var x;const{index:S=0,name:N}=w,A=c[S],C=hr(t,S),_=(x=o("getAriaValueText"))==null?void 0:x({value:A,index:S}),L=Array.isArray(l)?l[S]:l,W=Array.isArray(u)?u[S]:u;return e.element({...ln.thumb.attrs,dir:o("dir"),"data-index":S,"data-name":N,id:Bv(a,S),"data-disabled":G(f),"data-orientation":o("orientation"),"data-focus":G(h&&d===S),"data-dragging":G(p&&d===S),draggable:!1,"aria-disabled":zw(f),"aria-label":L,"aria-labelledby":W??of(a),"aria-orientation":o("orientation"),"aria-valuemax":C.max,"aria-valuemin":C.min,"aria-valuenow":c[S],"aria-valuetext":_,role:"slider",tabIndex:f?void 0:0,style:af(t,S),onPointerDown(q){g&&(r({type:"THUMB_POINTER_DOWN",index:S}),q.stopPropagation())},onBlur(){g&&r({type:"BLUR"})},onFocus(){g&&r({type:"FOCUS",index:S})},onKeyDown(q){if(q.defaultPrevented||!g)return;const K=mx(q)*o("step"),J={ArrowUp(){y||r({type:"ARROW_INC",step:K,src:"ArrowUp"})},ArrowDown(){y||r({type:"ARROW_DEC",step:K,src:"ArrowDown"})},ArrowLeft(){b||r({type:"ARROW_DEC",step:K,src:"ArrowLeft"})},ArrowRight(){b||r({type:"ARROW_INC",step:K,src:"ArrowRight"})},PageUp(){r({type:"ARROW_INC",step:K,src:"PageUp"})},PageDown(){r({type:"ARROW_DEC",step:K,src:"PageDown"})},Home(){r({type:"HOME"})},End(){r({type:"END"})}},ue=ov(q,{dir:o("dir"),orientation:o("orientation")}),ge=J[ue];ge&&(ge(q),q.preventDefault(),q.stopPropagation())}})},getHiddenInputProps(w){const{index:x=0,name:S}=w;return e.input({name:S??(o("name")?o("name")+(c.length>1?"[]":""):void 0),form:o("form"),type:"text",hidden:!0,defaultValue:c[x],id:Yc(a,x)})},getRangeProps(){return e.element({id:jE(a),...ln.range.attrs,dir:o("dir"),"data-dragging":G(p),"data-focus":G(h),"data-invalid":G(m),"data-disabled":G(f),"data-orientation":o("orientation"),style:XE(t)})},getControlProps(){return e.element({...ln.control.attrs,dir:o("dir"),id:$v(a),"data-dragging":G(p),"data-disabled":G(f),"data-orientation":o("orientation"),"data-invalid":G(m),"data-focus":G(h),style:eC(),onPointerDown(w){if(!g||!lx(w)||cx(w))return;const x=fp(w);r({type:"POINTER_DOWN",point:x}),w.preventDefault(),w.stopPropagation()}})},getMarkerGroupProps(){return e.element({...ln.markerGroup.attrs,role:"presentation",dir:o("dir"),"aria-hidden":!0,"data-orientation":o("orientation"),style:rC()})},getMarkerProps(w){const x=nC(t,w.value);let S;return w.value<yv(c)?S="under-value":w.value>bv(c)?S="over-value":S="at-value",e.element({...ln.marker.attrs,id:HE(a,w.value),role:"presentation",dir:o("dir"),"data-orientation":o("orientation"),"data-value":w.value,"data-disabled":G(f),"data-state":S,style:x})},getDraggingIndicatorProps(w){const{index:x=0}=w,S=x===d&&p;return e.element({...ln.draggingIndicator.attrs,role:"presentation",dir:o("dir"),hidden:!S,"data-orientation":o("orientation"),"data-state":S?"open":"closed",style:af(t,x)})}}}var lC=(t,e)=>t?.width===e?.width&&t?.height===e?.height,Kv={props({props:t}){return{dir:"ltr",thumbAlignment:"contain",min:0,max:100,step:1,defaultValue:[0],origin:"start",orientation:"horizontal",minStepsBetweenThumbs:0,...t}},initialState(){return"idle"},context({prop:t,bindable:e,getContext:n}){return{thumbSize:e(()=>({defaultValue:t("thumbSize")||null})),value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),hash(r){return r.join(",")},onChange(r){var i;(i=t("onValueChange"))==null||i({value:r})}})),focusedIndex:e(()=>({defaultValue:-1,onChange(r){var i;const o=n();(i=t("onFocusChange"))==null||i({focusedIndex:r,value:o.get("value")})}})),fieldsetDisabled:e(()=>({defaultValue:!1}))}},computed:{isHorizontal:({prop:t})=>t("orientation")==="horizontal",isVertical:({prop:t})=>t("orientation")==="vertical",isRtl:({prop:t})=>t("orientation")==="horizontal"&&t("dir")==="rtl",isDisabled:({context:t,prop:e})=>!!e("disabled")||t.get("fieldsetDisabled"),isInteractive:({prop:t,computed:e})=>!(t("readOnly")||e("isDisabled")),hasMeasuredThumbSize:({context:t})=>t.get("thumbSize")!=null,valuePercent({context:t,prop:e}){return t.get("value").map(n=>100*xp(n,e("min"),e("max")))}},watch({track:t,action:e,context:n}){t([()=>n.hash("value")],()=>{e(["syncInputElements","dispatchChangeEvent"])})},effects:["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"],effects:["trackPointerMove"],on:{POINTER_UP:{target:"focus",actions:["invokeOnChangeEnd"]},POINTER_MOVE:{actions:["setPointerValue"]}}}},implementations:{guards:{hasIndex:({event:t})=>t.index!=null},effects:{trackFormControlState({context:t,scope:e}){return Yl(qE(e),{onFieldsetDisabledChange(n){t.set("fieldsetDisabled",n)},onFormReset(){t.set("value",t.initial("value"))}})},trackPointerMove({scope:t,send:e}){return _x(t.getDoc(),{onPointerMove(n){e({type:"POINTER_MOVE",point:n.point})},onPointerUp(){e({type:"POINTER_UP"})}})},trackThumbsSize({context:t,scope:e,prop:n}){if(!(n("thumbAlignment")!=="contain"||t.get("thumbSize")))return LE({getNodes:()=>Hv(e),observeMutation:!0,callback(r){!r||lC(t.get("thumbSize"),r)||t.set("thumbSize",r)}})}},actions:{dispatchChangeEvent({context:t,scope:e}){KE(e,t.get("value"))},syncInputElements({context:t,scope:e}){t.get("value").forEach((n,r)=>{const i=jv(e,r);av(i,n.toString())})},invokeOnChangeEnd({prop:t,context:e}){var n;(n=t("onValueChangeEnd"))==null||n({value:e.get("value")})},setClosestThumbIndex(t){const{context:e,event:n}=t,r=sf(t,n.point);if(r==null)return;const i=aC(t,r);e.set("focusedIndex",i)},setFocusedIndex({context:t,event:e}){t.set("focusedIndex",e.index)},clearFocusedIndex({context:t}){t.set("focusedIndex",-1)},setPointerValue(t){queueMicrotask(()=>{const{context:e,event:n}=t,r=sf(t,n.point);if(r==null)return;const i=e.get("focusedIndex"),o=Zc(t,r,i);e.set("value",s=>To(s,i,o))})},focusActiveThumb({scope:t,context:e}){At(()=>{const n=WE(t,e.get("focusedIndex"));n?.focus({preventScroll:!0})})},decrementThumbAtIndex(t){const{context:e,event:n}=t,r=oC(t,n.index,n.step);e.set("value",r)},incrementThumbAtIndex(t){const{context:e,event:n}=t,r=sC(t,n.index,n.step);e.set("value",r)},setFocusedThumbToMin(t){const{context:e}=t,n=e.get("focusedIndex"),{min:r}=hr(t,n);e.set("value",i=>To(i,n,r))},setFocusedThumbToMax(t){const{context:e}=t,n=e.get("focusedIndex"),{max:r}=hr(t,n);e.set("value",i=>To(i,n,r))},setValueAtIndex(t){const{context:e,event:n}=t,r=Zc(t,n.value,n.index);e.set("value",i=>To(i,n.index,r))},setValue(t){const{context:e,event:n}=t,r=iC(t,n.value);e.set("value",r)}}}};Wn()(["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","defaultValue"]);Wn()(["index","name"]);const uC=["data-value"],cC=Q({__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=pi(Kv,{id:Qt(),...n,defaultValue:n.modelValue,onValueChangeEnd:({value:l})=>{const[u,c]=[o.value.getThumbMin(0),o.value.getThumbMax(0)],[d,h]=[o.value.getThumbMin(1),o.value.getThumbMax(1)],p=Math.max(u,Math.min(c,l[0])),f=Math.min(h,Math.max(d,l[1]));n.modelValue[0]===p&&n.modelValue[1]===f||r("update:modelValue",[p,f])}}),o=I(()=>Uv(i,di)),s=l=>{const[u,c]=[o.value.getThumbMin(0),o.value.getThumbMax(0)],[d,h]=[o.value.getThumbMin(1),o.value.getThumbMax(1)],[p,f]=[o.value.getThumbValue(0),o.value.getThumbValue(1)],[m,g]=l;if(m===p&&g===f)return;const y=Math.max(u,Math.min(c,m)),b=Math.min(h,Math.max(d,g));return p===y&&f===b?r("update:modelValue",[y,b]):o.value.setValue([y,b])},a=I(()=>{if(!n.marker)return[];const l=Math.floor(n.max/n.marker)+1;return Array(l).fill(void 0).map((u,c)=>{const d=(n.marker||0)*c;return{value:d,label:n.markerFormat?n.markerFormat(d):n.format(d)}})});return Ee(()=>n.modelValue,s,{deep:!0}),(l,u)=>(E(),O("div",ne(o.value.getRootProps(),{class:"k-rangeslider"}),[z("div",be(Ie(o.value.getControlProps())),[z("div",be(Ie(o.value.getTrackProps())),[z("div",be(Ie(o.value.getRangeProps())),null,16)],16),(E(!0),O(De,null,_t(o.value.value,(c,d)=>(E(),O("div",ne({key:d,ref_for:!0},o.value.getThumbProps({index:d})),[z("input",ne({ref_for:!0},o.value.getHiddenInputProps({index:d})),null,16)],16))),128))],16),a.value.length?(E(),O("div",be(ne({key:0},o.value.getMarkerGroupProps())),[(E(!0),O(De,null,_t(a.value,c=>(E(),O("span",ne({ref_for:!0},o.value.getMarkerProps({value:c.value}),{"data-value":c.label}),null,16,uC))),256))],16)):R("",!0)],16))}}),dC=["data-value"],kL=Q({__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=pi(Kv,{id:Qt(),...n,defaultValue:[n.modelValue],onValueChange:({value:l})=>{r("update:modelValue",l[0])}}),o=I(()=>Uv(i,di)),s=l=>o.value.setValue([Math.max(n.min||l,Math.min(n.max||l,l))]),a=I(()=>{const l=c=>n.markerFormat?n.markerFormat(c):n.format(c);if(!n.marker)return[];if(n.marker instanceof Array)return n.marker.map(c=>({value:c,label:l(c)}));const u=Math.floor((n.max-n.min)/n.marker)+1;return Array(u).fill(void 0).map((c,d)=>{const h=n.min+n.marker*d;return{value:h,label:l(h)}})});return Ee(()=>n.modelValue,s,{deep:!0}),(l,u)=>(E(),O("div",ne(o.value.getRootProps(),{class:["k-slider",{"k-slider--marker-highlight":l.markerHighlight}]}),[z("div",be(Ie(o.value.getControlProps())),[z("div",be(Ie(o.value.getTrackProps())),[z("div",be(Ie(o.value.getRangeProps())),null,16)],16),z("div",be(Ie(o.value.getThumbProps({index:0}))),[z("input",be(Ie(o.value.getHiddenInputProps({index:0}))),null,16)],16),z("output",be(Ie(o.value.getValueTextProps())),[F(l.$slots,"value",{value:o.value.value},()=>[$e(oe(l.format(o.value.value.at(0))),1)])],16)],16),a.value.length?(E(),O("div",be(ne({key:0},o.value.getMarkerGroupProps())),[(E(!0),O(De,null,_t(a.value,c=>(E(),O("span",ne({ref_for:!0},o.value.getMarkerProps({value:c.value}),{"data-value":c.label}),null,16,dC))),256))],16)):R("",!0)],16))}}),Qc=Math.min,Fi=Math.max,Ka=Math.round,Qs=Math.floor,vn=t=>({x:t,y:t}),pC={left:"right",right:"left",bottom:"top",top:"bottom"},hC={start:"end",end:"start"};function Tp(t,e){return typeof t=="function"?t(e):t}function Wi(t){return t.split("-")[0]}function lu(t){return t.split("-")[1]}function fC(t){return t==="x"?"y":"x"}function Gv(t){return t==="y"?"height":"width"}function as(t){return["top","bottom"].includes(Wi(t))?"y":"x"}function Jv(t){return fC(as(t))}function mC(t,e,n){n===void 0&&(n=!1);const r=lu(t),i=Jv(t),o=Gv(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Ga(s)),[s,Ga(s)]}function gC(t){const e=Ga(t);return[ed(t),e,ed(e)]}function ed(t){return t.replace(/start|end/g,e=>hC[e])}function vC(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 yC(t,e,n,r){const i=lu(t);let o=vC(Wi(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ed)))),o}function Ga(t){return t.replace(/left|right|bottom|top/g,e=>pC[e])}function bC(t){return{top:0,right:0,bottom:0,left:0,...t}}function kC(t){return typeof t!="number"?bC(t):{top:t,right:t,bottom:t,left:t}}function Ja(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 lf(t,e,n){let{reference:r,floating:i}=t;const o=as(e),s=Jv(e),a=Gv(s),l=Wi(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 wC=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}=lf(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}=lf(u,h,l)),m=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:p}};async function xC(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=kC(p),m=a[h?d==="floating"?"reference":"floating":d],g=Ja(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=Ja(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 EC=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=Wi(i),b=as(a),k=Wi(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=h||(k||!m?[Ga(a)]:gC(a)),x=f!=="none";!h&&x&&w.push(...yC(a,m,f,v));const S=[a,...w],N=await xC(e,g),A=[];let C=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&A.push(N[y]),d){const q=mC(i,s,v);A.push(N[q[0]],N[q[1]])}if(C=[...C,{placement:i,overflows:A}],!A.every(q=>q<=0)){var _,L;const q=(((_=o.flip)==null?void 0:_.index)||0)+1,K=S[q];if(K)return{data:{index:q,overflows:C},reset:{placement:K}};let J=(L=C.filter(ue=>ue.overflows[0]<=0).sort((ue,ge)=>ue.overflows[1]-ge.overflows[1])[0])==null?void 0:L.placement;if(!J)switch(p){case"bestFit":{var W;const ue=(W=C.filter(ge=>{if(x){const Te=as(ge.placement);return Te===b||Te==="y"}return!0}).map(ge=>[ge.placement,ge.overflows.filter(Te=>Te>0).reduce((Te,mt)=>Te+mt,0)]).sort((ge,Te)=>ge[1]-Te[1])[0])==null?void 0:W[0];ue&&(J=ue);break}case"initialPlacement":J=a;break}if(i!==J)return{reset:{placement:J}}}return{}}}};async function CC(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Wi(n),a=lu(n),l=as(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 SC=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 CC(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 uu(){return typeof window<"u"}function lo(t){return Xv(t)?(t.nodeName||"").toLowerCase():"#document"}function Dt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Sn(t){var e;return(e=(Xv(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Xv(t){return uu()?t instanceof Node||t instanceof Dt(t).Node:!1}function en(t){return uu()?t instanceof Element||t instanceof Dt(t).Element:!1}function kn(t){return uu()?t instanceof HTMLElement||t instanceof Dt(t).HTMLElement:!1}function uf(t){return!uu()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Dt(t).ShadowRoot}function As(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=tn(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function TC(t){return["table","td","th"].includes(lo(t))}function cu(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Op(t){const e=Ap(),n=en(t)?tn(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 OC(t){let e=wr(t);for(;kn(e)&&!Ui(e);){if(Op(e))return e;if(cu(e))return null;e=wr(e)}return null}function Ap(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ui(t){return["html","body","#document"].includes(lo(t))}function tn(t){return Dt(t).getComputedStyle(t)}function du(t){return en(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function wr(t){if(lo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||uf(t)&&t.host||Sn(t);return uf(e)?e.host:e}function Yv(t){const e=wr(t);return Ui(e)?t.ownerDocument?t.ownerDocument.body:t.body:kn(e)&&As(e)?e:Yv(e)}function ls(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Yv(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Dt(i);if(o){const a=td(s);return e.concat(s,s.visualViewport||[],As(i)?i:[],a&&n?ls(a):[])}return e.concat(i,ls(i,[],n))}function td(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Zv(t){const e=tn(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=kn(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Ka(n)!==o||Ka(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Mp(t){return en(t)?t:t.contextElement}function Li(t){const e=Mp(t);if(!kn(e))return vn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Zv(e);let s=(o?Ka(n.width):n.width)/r,a=(o?Ka(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const AC=vn(0);function Qv(t){const e=Dt(t);return!Ap()||!e.visualViewport?AC:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function MC(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Dt(t)?!1:e}function ri(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Mp(t);let s=vn(1);e&&(r?en(r)&&(s=Li(r)):s=Li(t));const a=MC(o,n,r)?Qv(o):vn(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=Dt(o),p=r&&en(r)?Dt(r):r;let f=h,m=td(f);for(;m&&r&&p!==f;){const g=Li(m),y=m.getBoundingClientRect(),b=tn(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=Dt(m),m=td(f)}}return Ja({width:c,height:d,x:l,y:u})}function _p(t,e){const n=du(t).scrollLeft;return e?e.left+n:ri(Sn(t)).left+n}function ey(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:_p(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function _C(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Sn(r),a=e?cu(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=vn(1);const c=vn(0),d=kn(r);if((d||!d&&!o)&&((lo(r)!=="body"||As(s))&&(l=du(r)),kn(r))){const p=ri(r);u=Li(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=s&&!d&&!o?ey(s,l,!0):vn(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 DC(t){return Array.from(t.getClientRects())}function NC(t){const e=Sn(t),n=du(t),r=t.ownerDocument.body,i=Fi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Fi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+_p(t);const a=-n.scrollTop;return tn(r).direction==="rtl"&&(s+=Fi(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function IC(t,e){const n=Dt(t),r=Sn(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=Ap();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function RC(t,e){const n=ri(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=kn(t)?Li(t):vn(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 cf(t,e,n){let r;if(e==="viewport")r=IC(t,n);else if(e==="document")r=NC(Sn(t));else if(en(e))r=RC(e,n);else{const i=Qv(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ja(r)}function ty(t,e){const n=wr(t);return n===e||!en(n)||Ui(n)?!1:tn(n).position==="fixed"||ty(n,e)}function PC(t,e){const n=e.get(t);if(n)return n;let r=ls(t,[],!1).filter(a=>en(a)&&lo(a)!=="body"),i=null;const o=tn(t).position==="fixed";let s=o?wr(t):t;for(;en(s)&&!Ui(s);){const a=tn(s),l=Op(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&i&&["absolute","fixed"].includes(i.position)||As(s)&&!l&&ty(t,s))?r=r.filter(u=>u!==s):i=a,s=wr(s)}return e.set(t,r),r}function FC(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?cu(e)?[]:PC(e,this._c):[].concat(n),r],s=o[0],a=o.reduce((l,u)=>{const c=cf(e,u,i);return l.top=Fi(c.top,l.top),l.right=Qc(c.right,l.right),l.bottom=Qc(c.bottom,l.bottom),l.left=Fi(c.left,l.left),l},cf(e,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function LC(t){const{width:e,height:n}=Zv(t);return{width:e,height:n}}function VC(t,e,n){const r=kn(e),i=Sn(e),o=n==="fixed",s=ri(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=vn(0);if(r||!r&&!o)if((lo(e)!=="body"||As(i))&&(a=du(e)),r){const h=ri(e,!0,o,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&(l.x=_p(i));const u=i&&!r&&!o?ey(i,a):vn(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 Hu(t){return tn(t).position==="static"}function df(t,e){if(!kn(t)||tn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Sn(t)===n&&(n=n.ownerDocument.body),n}function ny(t,e){const n=Dt(t);if(cu(t))return n;if(!kn(t)){let i=wr(t);for(;i&&!Ui(i);){if(en(i)&&!Hu(i))return i;i=wr(i)}return n}let r=df(t,e);for(;r&&TC(r)&&Hu(r);)r=df(r,e);return r&&Ui(r)&&Hu(r)&&!Op(r)?n:r||OC(t)||n}const BC=async function(t){const e=this.getOffsetParent||ny,n=this.getDimensions,r=await n(t.floating);return{reference:VC(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $C(t){return tn(t).direction==="rtl"}const nd={convertOffsetParentRelativeRectToViewportRelativeRect:_C,getDocumentElement:Sn,getClippingRect:FC,getOffsetParent:ny,getElementRects:BC,getClientRects:DC,getDimensions:LC,getScale:Li,isElement:en,isRTL:$C};function ry(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function jC(t,e){let n=null,r;const i=Sn(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=Qs(d),m=Qs(i.clientWidth-(c+h)),g=Qs(i.clientHeight-(d+p)),y=Qs(c),b={rootMargin:-f+"px "+-m+"px "+-g+"px "+-y+"px",threshold:Fi(0,Qc(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&&!ry(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 zC(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=Mp(t),c=i||o?[...u?ls(u):[],...ls(e)]:[];c.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const d=u&&a?jC(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?ri(t):null;l&&g();function g(){const y=ri(t);m&&!ry(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 HC=SC,qC=EC,WC=(t,e,n)=>{const r=new Map,i={platform:nd,...n},o={...i.platform,_c:r};return wC(t,e,{...i,platform:o})};function UC(t){return KC(t)}function qu(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function KC(t){for(let e=t;e;e=qu(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=qu(t);e;e=qu(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 pu=Q({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=I(()=>{const{items:v,placement:w,teleport:x,keepOpen:S,...N}=n;return N}),i=X(!1),o=nu(),s=X(),a=X(),l=X({top:"",left:"",position:""});let u=()=>{};function c(){!s.value||!a.value||(u=zC(s.value.$el,a.value,()=>{!s.value||!a.value||WC(s.value.$el,a.value,{placement:n.placement,middleware:[HC(n.offset),qC()],platform:{...nd,getOffsetParent:v=>nd.getOffsetParent(v,UC)}}).then(({x:v,y:w})=>{l.value={top:`${w}px`,left:`${v}px`,position:"absolute"}})}))}ao(u),Fg(()=>{if(i.value)return c();u()});const d=({target:v},w="dom")=>{if(v instanceof Element&&!(!s.value||!a.value)){if(w==="dom")return[s.value.$el,a.value].some(x=>x&&(v===x||x.contains(v)))?void 0:p(!1);if(w==="shadow-dom"){const x=o.value.getRootNode();return v.shadowRoot===x?void 0:p(!1)}}},h=({key:v})=>v==="Escape"&&p(!1),p=(v=!i.value)=>(v?b():k(),i.value=v,!0),f=I(()=>o.value.getRootNode()),m=I(()=>f.value instanceof ShadowRoot);function g(v){d(v,"dom")}function y(v){d(v,"shadow-dom")}function b(){window.addEventListener("keydown",h),m.value?(f.value.addEventListener("click",g),window.addEventListener("click",y)):window.addEventListener("click",g)}function k(){window.removeEventListener("keydown",h),m.value?(f.value.removeEventListener("click",g),window.removeEventListener("click",y)):window.removeEventListener("click",g)}return e({isOpen:i}),(v,w)=>(E(),O(De,null,[he(ze,ne({...r.value,...v.$attrs},{onClick:w[0]||(w[0]=()=>p()),ref_key:"trigger",ref:s,class:["k-dropdown-trigger",{"k-dropdown-trigger--open":!!i.value}]}),Cs({_:2},[v.$slots["icon-left"]?{name:"icon-left",fn:Z(()=>[F(v.$slots,"icon-left")]),key:"0"}:void 0,v.$slots.trigger?{name:"default",fn:Z(()=>[F(v.$slots,"trigger")]),key:"1"}:void 0,v.$slots["icon-right"]?{name:"icon-right",fn:Z(()=>[F(v.$slots,"icon-right")]),key:"2"}:void 0]),1040,["class"]),(E(),$(Lg,{to:v.teleportTo,disabled:!v.teleport},[he(tp,{name:"k-dropdown"},{default:Z(()=>[i.value?(E(),O("div",{key:0,class:Ce(`k-dropdown k-dropdown--theme-${v.theme}`),style:Cr(l.value),ref_key:"content",ref:a,onClick:w[1]||(w[1]=()=>!v.keepOpen&&p(!1))},[F(v.$slots,"default",{close:p.bind(null,!1)},()=>[(E(!0),O(De,null,_t(v.items,({action:x,icon:S,...N})=>(E(),$(ze,ne({ref_for:!0},N,{variant:"tertiary","icon-right":N.iconRight||S,onClick:()=>x()}),null,16,["icon-right","onClick"]))),256))])],6)):R("",!0)]),_:3})],8,["to","disabled"]))],64))}}),GC={key:0,class:"k-datatable__row"},JC={key:0,class:"k-datatable__cell k-datatable__cell-select"},XC=["data-col-id","onClick"],YC=["innerHTML"],ZC={key:1,class:"k-datatable__cell k-datatable__cell-actions"},QC={key:0,class:"k-datatable__cell k-datatable__cell-select"},eS={key:1,class:"k-datatable__cell k-datatable__cell-actions"},tS={key:0,class:"k-datatable__footer"},wL=Q({__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=ip(),i=e,o=X([-1]),s=I(()=>n.items.filter(f=>!n.isDisabled(f))),a=I(()=>!!n.selected),l=I(()=>!!(Object.keys(n.sortBy||{}).length&&n.sortableBy.length)),u=I(()=>!!r.rowActions),c=I({get:()=>!!(s.value.length&&s.value.every(f=>n.selected&&n.selected.includes(f))),set:f=>i("update:selected",f?[...s.value]:[])}),d=I(()=>[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(),O("div",{class:Ce([`k-datatable k-datatable--${f.theme}`,{"k-datatable--sticky":!!f.sticky,"k-datatable--no-header":!f.header}]),style:Cr(`--k-datatable-layout: ${d.value}; --k-datatable-sticky-top: ${typeof f.sticky=="string"?f.sticky:"0"}`)},[f.header?(E(),O("div",GC,[a.value?(E(),O("div",JC,[he(Zh,{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"])])):R("",!0),(E(!0),O(De,null,_t(f.columns.filter(({disabled:g})=>!g),g=>(E(),O("div",{class:Ce(["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)},[F(f.$slots,`${g.id}-label`,{item:g},()=>[z("span",{innerHTML:g.label},null,8,YC)]),he(B(Ze),{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,XC))),128)),u.value?(E(),O("div",ZC)):R("",!0)])):R("",!0),(E(!0),O(De,null,_t(f.items,(g,y)=>(E(),O("div",{class:"k-datatable__row",key:f.sortBy?g?.id||B(Qt)():y},[a.value?(E(),O("div",QC,[he(Zh,{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]=Ba(()=>{},["prevent"])),onClick:b=>p(b,y),disabled:f.isDisabled(g)},null,8,["model-value","value","onClick","disabled"])])):R("",!0),(E(),$(Qe(f.rowWrapper(g).component),ne({class:"k-datatable__row-wrapper",ref_for:!0},f.rowWrapper(g).bind,Bg(f.rowWrapper(g).listeners)),{default:Z(()=>[(E(!0),O(De,null,_t(f.columns.filter(({disabled:b})=>!b),(b,k)=>(E(),$(Qe(f.cellWrapper(g,b).component),ne({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:Z(()=>[F(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(),O("div",eS,[F(f.$slots,"row-actions",{item:g})])):R("",!0)]))),128)),he(tp,{name:"k-datatable-footer"},{default:Z(()=>{var g,y;return[f.$slots.footer||(g=f.selected)!=null&&g.length?(E(),O("div",tS,[(y=f.selected)!=null&&y.length?(E(),$(pu,{key:0,label:`${f.labels.selection} (${f.selected.length})`,teleport:!0},{default:Z(()=>[F(f.$slots,"select-actions"),he(ze,{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"])):R("",!0),F(f.$slots,"footer")])):R("",!0)]}),_:3})],6))}});var rd,Br=new Map,nS=t=>t.getBoundingClientRect();function rS(t,e){const{scope:n="rect",getRect:r=nS,onChange:i}=e,o=iS({scope:n,getRect:r}),s=Br.get(t);return s?(s.callbacks.push(i),i(r(t))):(Br.set(t,{rect:{},callbacks:[i]}),Br.size===1&&(rd=requestAnimationFrame(o))),function(){const a=Br.get(t);if(!a)return;const l=a.callbacks.indexOf(i);l>-1&&a.callbacks.splice(l,1),a.callbacks.length===0&&(Br.delete(t),Br.size===0&&cancelAnimationFrame(rd))}}function iS(t){const{scope:e,getRect:n}=t,r=sS(e);return function i(){const o=[];Br.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))}),rd=requestAnimationFrame(i)}}var iy=(t,e)=>t.width===e.width&&t.height===e.height,oy=(t,e)=>t.top===e.top&&t.left===e.left,oS=(t,e)=>iy(t,e)&&oy(t,e);function sS(t){return t==="size"?iy:t==="position"?oy:oS}var aS=Ln("radio-group").parts("root","label","item","itemText","itemControl","indicator"),ki=aS.build(),Xa=t=>{var e;return((e=t.ids)==null?void 0:e.root)??`radio-group:${t.id}`},pf=t=>{var e;return((e=t.ids)==null?void 0:e.label)??`radio-group:${t.id}:label`},sy=(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}`},hf=(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}`},lS=(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}`},uS=(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}`},ay=t=>{var e;return((e=t.ids)==null?void 0:e.indicator)??`radio-group:${t.id}:indicator`},hu=t=>t.getById(Xa(t)),cS=t=>t.getById(ay(t)),dS=t=>{var e;return(e=hu(t))==null?void 0:e.querySelector("input:not(:disabled)")},pS=t=>{var e;return(e=hu(t))==null?void 0:e.querySelector("input:not(:disabled):checked")},ff=t=>{const e=`input[type=radio][data-ownedby='${CSS.escape(Xa(t))}']:not([disabled])`;return yp(hu(t),e)},hS=(t,e)=>{if(e)return t.getById(sy(t,e))},fS=t=>({left:t?.offsetLeft??0,top:t?.offsetTop??0,width:t?.offsetWidth??0,height:t?.offsetHeight??0}),mS=t=>({width:`${t.width}px`,height:`${t.height}px`,left:`${t.left}px`,top:`${t.top}px`});function gS(t,e){const{context:n,send:r,computed:i,prop:o,scope:s}=t,a=i("isDisabled"),l=o("readOnly");function u(h){return{invalid:!!h.invalid,disabled:!!h.disabled||a,checked:n.get("value")===h.value,focused:n.get("focusedValue")===h.value,hovered:n.get("hoveredValue")===h.value,active:n.get("activeValue")===h.value}}function c(h){const p=u(h);return{"data-focus":G(p.focused),"data-focus-visible":G(p.focused&&n.get("focusVisible")),"data-disabled":G(p.disabled),"data-readonly":G(l),"data-state":p.checked?"checked":"unchecked","data-hover":G(p.hovered),"data-invalid":G(p.invalid),"data-orientation":o("orientation"),"data-ssr":G(n.get("ssr"))}}const d=()=>{const h=pS(s);if(h){h.focus();return}const p=dS(s);p?.focus()};return{focus:d,value:n.get("value"),setValue(h){r({type:"SET_VALUE",value:h,isTrusted:!1})},clearValue(){r({type:"SET_VALUE",value:null,isTrusted:!1})},getRootProps(){return e.element({...ki.root.attrs,role:"radiogroup",id:Xa(s),"aria-labelledby":pf(s),"data-orientation":o("orientation"),"data-disabled":G(a),"aria-orientation":o("orientation"),dir:o("dir"),style:{position:"relative"}})},getLabelProps(){return e.element({...ki.label.attrs,dir:o("dir"),"data-orientation":o("orientation"),"data-disabled":G(a),id:pf(s),onClick:d})},getItemState:u,getItemProps(h){const p=u(h);return e.label({...ki.item.attrs,dir:o("dir"),id:sy(s,h.value),htmlFor:hf(s,h.value),...c(h),onPointerMove(){p.disabled||p.hovered||r({type:"SET_HOVERED",value:h.value,hovered:!0})},onPointerLeave(){p.disabled||r({type:"SET_HOVERED",value:null})},onPointerDown(f){p.disabled||(p.focused&&f.pointerType==="mouse"&&f.preventDefault(),r({type:"SET_ACTIVE",value:h.value,active:!0}))},onPointerUp(){p.disabled||r({type:"SET_ACTIVE",value:null})}})},getItemTextProps(h){return e.element({...ki.itemText.attrs,dir:o("dir"),id:uS(s,h.value),...c(h)})},getItemControlProps(h){const p=u(h);return e.element({...ki.itemControl.attrs,dir:o("dir"),id:lS(s,h.value),"data-active":G(p.active),"aria-hidden":!0,...c(h)})},getItemHiddenInputProps(h){const p=u(h);return e.input({"data-ownedby":Xa(s),id:hf(s,h.value),type:"radio",name:o("name")||o("id"),form:o("form"),value:h.value,onClick(f){if(l){f.preventDefault();return}f.currentTarget.checked&&r({type:"SET_VALUE",value:h.value,isTrusted:!0})},onBlur(){r({type:"SET_FOCUSED",value:null,focused:!1,focusVisible:!1})},onFocus(){const f=is();r({type:"SET_FOCUSED",value:h.value,focused:!0,focusVisible:f})},onKeyDown(f){f.defaultPrevented||f.key===" "&&r({type:"SET_ACTIVE",value:h.value,active:!0})},onKeyUp(f){f.defaultPrevented||f.key===" "&&r({type:"SET_ACTIVE",value:null})},disabled:p.disabled,defaultChecked:p.checked,style:bp})},getIndicatorProps(){const h=n.get("indicatorRect");return e.element({id:ay(s),...ki.indicator.attrs,dir:o("dir"),hidden:n.get("value")==null,"data-disabled":G(a),"data-orientation":o("orientation"),style:{"--transition-property":"left, top, width, height","--left":h?.left,"--top":h?.top,"--width":h?.width,"--height":h?.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:n.get("canIndicatorTransition")?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[o("orientation")==="horizontal"?"left":"top"]:o("orientation")==="horizontal"?"var(--left)":"var(--top)"}})}}}var{not:vS}=eu(),yS={props({props:t}){return{orientation:"vertical",...t}},initialState(){return"idle"},context({prop:t,bindable:e}){return{value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),onChange(n){var r;(r=t("onValueChange"))==null||r({value:n})}})),activeValue:e(()=>({defaultValue:null})),focusedValue:e(()=>({defaultValue:null})),hoveredValue:e(()=>({defaultValue:null})),indicatorRect:e(()=>({defaultValue:{}})),canIndicatorTransition:e(()=>({defaultValue:!1})),fieldsetDisabled:e(()=>({defaultValue:!1})),focusVisible:e(()=>({defaultValue:!1})),ssr:e(()=>({defaultValue:!0}))}},refs(){return{indicatorCleanup:null}},computed:{isDisabled:({prop:t,context:e})=>!!t("disabled")||e.get("fieldsetDisabled")},entry:["syncIndicatorRect","syncSsr"],exit:["cleanupObserver"],effects:["trackFormControlState","trackFocusVisible"],watch({track:t,action:e,context:n}){t([()=>n.get("value")],()=>{e(["setIndicatorTransition","syncIndicatorRect","syncInputElements"])})},on:{SET_VALUE:[{guard:vS("isTrusted"),actions:["setValue","dispatchChangeEvent"]},{actions:["setValue"]}],SET_HOVERED:{actions:["setHovered"]},SET_ACTIVE:{actions:["setActive"]},SET_FOCUSED:{actions:["setFocused"]}},states:{idle:{}},implementations:{guards:{isTrusted:({event:t})=>!!t.isTrusted},effects:{trackFormControlState({context:t,scope:e}){return Yl(hu(e),{onFieldsetDisabledChange(n){t.set("fieldsetDisabled",n)},onFormReset(){t.set("value",t.initial("value"))}})},trackFocusVisible({scope:t}){var e;return kp({root:(e=t.getRootNode)==null?void 0:e.call(t)})}},actions:{setValue({context:t,event:e}){t.set("value",e.value)},setHovered({context:t,event:e}){t.set("hoveredValue",e.value)},setActive({context:t,event:e}){t.set("activeValue",e.value)},setFocused({context:t,event:e}){t.set("focusedValue",e.value),t.set("focusVisible",e.focusVisible)},syncInputElements({context:t,scope:e}){ff(e).forEach(n=>{n.checked=n.value===t.get("value")})},setIndicatorTransition({context:t}){t.set("canIndicatorTransition",kv(t.get("value")))},cleanupObserver({refs:t}){var e;(e=t.get("indicatorCleanup"))==null||e()},syncSsr({context:t}){t.set("ssr",!1)},syncIndicatorRect({context:t,scope:e,refs:n}){var r;if((r=n.get("indicatorCleanup"))==null||r(),!cS(e))return;const i=t.get("value"),o=hS(e,i);if(i==null||!o){t.set("indicatorRect",{});return}const s=rS(o,{getRect(a){return fS(a)},onChange(a){t.set("indicatorRect",mS(a)),dv(()=>{t.set("canIndicatorTransition",!1)})}});n.set("indicatorCleanup",s)},dispatchChangeEvent({context:t,scope:e}){ff(e).forEach(n=>{const r=n.value===t.get("value");r!==n.checked&&gp(n,{checked:r})})}}}};Wn()(["dir","disabled","form","getRootNode","id","ids","name","onValueChange","orientation","readOnly","value","defaultValue"]);Wn()(["value","disabled","invalid"]);const bS=["aria-describedby"],xL=Q({__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=rp(tu,I(()=>({label:""}))),r=t,i=e,o=pi(yS,{id:Qt(),name:Qt(),...r,defaultValue:r.modelValue,onValueChange:({value:a})=>i("update:modelValue",a)}),s=I(()=>gS(o,di));return Ee(()=>r.modelValue,a=>s.value.setValue(a)),(a,l)=>(E(),O("div",ne({class:["k-radiogroup",`k-radiogroup--variant-${a.variant} k-radiogroup--direction-${a.direction}`]},s.value.getRootProps(),{"aria-describedby":B(n).helpId}),[a.variant==="radio"&&(B(n).label||a.label)?(E(),O("span",be(ne({key:0},s.value.getLabelProps())),oe(B(n).label||a.label),17)):R("",!0),a.variant==="segment"?(E(),O("div",be(ne({key:1},s.value.getIndicatorProps())),null,16)):R("",!0),(E(!0),O(De,null,_t(a.items,u=>(E(),O("label",ne({ref_for:!0},s.value.getItemProps({value:u.id})),[z("span",ne({ref_for:!0},s.value.getItemTextProps({value:u.id})),oe(u.label),17),z("input",ne({ref_for:!0},s.value.getItemHiddenInputProps({value:u.id})),null,16),z("div",ne({ref_for:!0},s.value.getItemControlProps({value:u.id})),null,16)],16))),256))],16,bS))}}),EL=Q({__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
2
  `):o.split("|").map(s=>s.trim()).map(s=>`"${s}"`).join(`
3
3
  `)},i=I(()=>Qg("grid",{columns:n(e.columns,"1fr"),align:ja(e.align)||"initial",rows:n(e.rows,"auto"),gap:cp(e.gap),areas:r(e.areas)||"unset"}));return(o,s)=>(E(),$(Qe(o.is),{class:"k-grid",style:Cr(i.value)},{default:Z(()=>[F(o.$slots,"default")]),_:3},8,["style"]))}});function ly(t){return t?t.flatMap(e=>{const{type:n,children:r}=e;return n===De?ly(r):[e]}):[]}const CL=Q({props:{area:String,align:String},inheritAttrs:!1,setup({area:t,align:e},{slots:n}){return()=>{if(!n.default)return null;const[r]=ly(n.default());if(!r)return null;const i=ne({style:{"--k-grid-item-area":t,"--k-grid-item-align-self":ja(e)||"initial"}},r.props??{});return kk(r,i)}}}),kS={key:0,class:"k-scroller__indicator"},SL=Q({__name:"Scroller",props:{is:{default:"div"},appearance:{default:"default"},treshhold:{default:80}},setup(t){const e=nu(),n=Qt({prefix:"k-scroller-"}),r=t,i=X({top:!1,right:!1,left:!1,bottom:!1}),o=I(()=>Object.entries(i.value).filter(([,a])=>a).map(([a])=>a)),s=a=>{const{scrollWidth:l,scrollHeight:u,clientWidth:c,clientHeight:d,scrollTop:h,scrollLeft:p}=a,f=l-c>=r.treshhold,m=u-d>=r.treshhold;i.value={top:m&&h<=r.treshhold,left:f&&p<=r.treshhold,bottom:m&&h>=u-d-r.treshhold,right:f&&p>=l-c-r.treshhold}};return qn(()=>{const a=e.value;a&&(Ep(a,"scroll",()=>s(a)),U1(a,()=>s(a),{childList:!0,subtree:!0}))}),(a,l)=>(E(),$(Qe(a.is),{id:B(n),class:Ce([`k-scroller k-scroller--appearance-${a.appearance}`,...o.value.map(u=>`k-scroller--scrolled-to-${u}`)])},{default:Z(()=>[a.appearance==="indicator"?(E(),O("div",kS,[F(a.$slots,"indicator",{},()=>[he(B(Ze),{icon:"fa-pro-thin:arrow-right"})])])):R("",!0),F(a.$slots,"default")]),_:3},8,["id","class"]))}});var wi=new WeakMap,ea=new WeakMap,ta={},Wu=0,uy=t=>t&&(t.host||uy(t.parentNode)),wS=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=uy(n);return r&&t.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",t,". Doing nothing"),null)}).filter(n=>!!n),xS=t=>t.localName==="next-route-announcer"||t.localName==="script"||t.hasAttribute("aria-live")?!0:t.matches("[data-live-announcer]"),ES=(t,e)=>{const{parentNode:n,markerName:r,controlAttribute:i,explicitBooleanValue:o}=e,s=wS(n,Array.isArray(t)?t:[t]);ta[r]||(ta[r]=new WeakMap);const a=ta[r],l=[],u=new Set,c=new Set(s),d=p=>{!p||u.has(p)||(u.add(p),d(p.parentNode))};s.forEach(d);const h=p=>{!p||c.has(p)||Array.prototype.forEach.call(p.children,f=>{if(u.has(f))h(f);else try{if(xS(f))return;const m=f.getAttribute(i),g=o?m==="true":m!==null&&m!=="false",y=(wi.get(f)||0)+1,b=(a.get(f)||0)+1;wi.set(f,y),a.set(f,b),l.push(f),y===1&&g&&ea.set(f,!0),b===1&&f.setAttribute(r,""),g||f.setAttribute(i,o?"true":"")}catch(m){console.error("[zag-js > ariaHidden] cannot operate on ",f,m)}})};return h(n),u.clear(),Wu++,()=>{l.forEach(p=>{const f=wi.get(p)-1,m=a.get(p)-1;wi.set(p,f),a.set(p,m),f||(ea.has(p)||p.removeAttribute(i),ea.delete(p)),m||p.removeAttribute(r)}),Wu--,Wu||(wi=new WeakMap,wi=new WeakMap,ea=new WeakMap,ta={})}},CS=t=>(Array.isArray(t)?t[0]:t).ownerDocument.body,SS=(t,e=CS(t),n="data-aria-hidden")=>{if(e)return ES(t,{parentNode:e,markerName:n,controlAttribute:"aria-hidden",explicitBooleanValue:!0})},TS=t=>{const e=requestAnimationFrame(()=>t());return()=>cancelAnimationFrame(e)};function OS(t,e={}){const{defer:n=!0}=e,r=n?TS:o=>o(),i=[];return i.push(r(()=>{const o=(typeof t=="function"?t():t).filter(Boolean);o.length!==0&&i.push(SS(o))})),()=>{i.forEach(o=>o?.())}}function AS(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 MS(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 mf="pointerdown.outside",gf="focus.outside";function _S(t){for(const e of t)if(dt(e)&&dr(e))return!0;return!1}var cy=t=>"clientY"in t;function DS(t,e){if(!cy(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 NS(t,e){return t.y<=e.y&&e.y<=t.y+t.height&&t.x<=e.x&&e.x<=t.x+t.width}function vf(t,e){if(!e||!cy(t))return!1;const n=e.scrollHeight>e.clientHeight,r=n&&t.clientX>e.offsetLeft+e.clientWidth,i=e.scrollWidth>e.clientWidth,o=i&&t.clientY>e.offsetTop+e.clientHeight,s={x:e.offsetLeft,y:e.offsetTop,width:e.clientWidth+(n?16:0),height:e.clientHeight+(i?16:0)},a={x:t.clientX,y:t.clientY};return NS(s,a)?r||o:!1}function IS(t,e){const{exclude:n,onFocusOutside:r,onPointerDownOutside:i,onInteractOutside:o,defer:s}=e;if(!t)return;const a=Kt(t),l=xt(t),u=AS(l),c=MS(l);function d(y){const b=ct(y);if(!dt(b)||!b.isConnected||qi(t,b)||DS(t,y))return!1;const k=a.querySelector(`[aria-controls="${t.id}"]`);if(k){const w=Hc(k);if(vf(y,w))return!1}const v=Hc(t);return vf(y,v)?!1:!(n!=null&&n(b))}const h=new Set;function p(y){function b(){var k;const v=s?At:x=>x(),w=((k=y.composedPath)==null?void 0:k.call(y))??[y.target];v(()=>{if(!(!t||!d(y))){if(i||o){const x=Wh(i,o);t.addEventListener(mf,x,{once:!0})}yf(t,mf,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:ux(y),focusable:_S(w)}})}})}y.pointerType==="touch"?(h.forEach(k=>k()),h.add(Ne(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(Ne(a,"pointerdown",p,!0)),f.add(c.addEventListener("pointerdown",p,!0)),f.add(u.addEventListener("pointerdown",p,!0))},0);function g(y){(s?At:b=>b())(()=>{if(!(!t||!d(y))){if(r||o){const b=Wh(r,o);t.addEventListener(gf,b,{once:!0})}yf(t,gf,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:!1,focusable:dr(ct(y))}})}})}return f.add(Ne(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 RS(t,e){const{defer:n}=e,r=n?At:o=>o(),i=[];return i.push(r(()=>{const o=typeof t=="function"?t():t;i.push(IS(o,e))})),()=>{i.forEach(o=>o?.())}}function yf(t,e,n){const r=t.ownerDocument.defaultView||window,i=new r.CustomEvent(e,n);return t.dispatchEvent(i)}function PS(t,e){const n=r=>{r.key==="Escape"&&(r.isComposing||e==null||e(r))};return Ne(Kt(t),"keydown",n,{capture:!0})}var Jt={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=>qi(n.node,e))},isInBranch(t){return Array.from(this.branches).some(e=>qi(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)}},bf;function kf(){Jt.layers.forEach(({node:t})=>{t.style.pointerEvents=Jt.isBelowPointerBlockingLayer(t)?"none":"auto"})}function FS(t){t.style.pointerEvents=""}function LS(t,e){const n=Kt(t),r=[];if(Jt.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(bf=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),e){const i=Vx(e,o=>{r.push(Px(o,{pointerEvents:"auto"}))});r.push(i)}return()=>{Jt.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=bf,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(i=>i()))}}function VS(t,e){const{warnOnMissingNode:n=!0}=e;if(n&&!t){Gc("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!t)return;const{onDismiss:r,pointerBlocking:i,exclude:o,debug:s}=e,a={dismiss:r,node:t,pointerBlocking:i};Jt.add(a),kf();function l(p){var f,m;const g=ct(p.detail.originalEvent);Jt.isBelowPointerBlockingLayer(t)||Jt.isInBranch(g)||((f=e.onPointerDownOutside)==null||f.call(e,p),(m=e.onInteractOutside)==null||m.call(e,p),!p.defaultPrevented&&(s&&console.log("onPointerDownOutside:",p.detail.originalEvent),r?.()))}function u(p){var f,m;const g=ct(p.detail.originalEvent);Jt.isInBranch(g)||((f=e.onFocusOutside)==null||f.call(e,p),(m=e.onInteractOutside)==null||m.call(e,p),!p.defaultPrevented&&(s&&console.log("onFocusOutside:",p.detail.originalEvent),r?.()))}function c(p){var f;Jt.isTopMost(t)&&((f=e.onEscapeKeyDown)==null||f.call(e,p),!p.defaultPrevented&&r&&(p.preventDefault(),r()))}function d(p){var f;if(!t)return!1;const m=typeof o=="function"?o():o,g=Array.isArray(m)?m:[m],y=(f=e.persistentElements)==null?void 0:f.map(b=>b()).filter(dt);return y&&g.push(...y),g.some(b=>qi(b,p))||Jt.isInNestedLayer(t,p)}const h=[i?LS(t,e.persistentElements):void 0,PS(t,c),RS(t,{exclude:d,onFocusOutside:u,onPointerDownOutside:l,defer:e.defer})];return()=>{Jt.remove(t),kf(),FS(t),h.forEach(p=>p?.())}}function BS(t,e){const{defer:n}=e,r=n?At:o=>o(),i=[];return i.push(r(()=>{const o=Ni(t)?t():t;i.push(VS(o,e))})),()=>{i.forEach(o=>o?.())}}var $S=Object.defineProperty,jS=(t,e,n)=>e in t?$S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Se=(t,e,n)=>jS(t,typeof e!="symbol"?e+"":e,n),wf={activateTrap(t,e){if(t.length>0){const r=t[t.length-1];r!==e&&r.pause()}const n=t.indexOf(e);n===-1||t.splice(n,1),t.push(e)},deactivateTrap(t,e){const n=t.indexOf(e);n!==-1&&t.splice(n,1),t.length>0&&t[t.length-1].unpause()}},zS=[],HS=class{constructor(t,e){Se(this,"trapStack"),Se(this,"config"),Se(this,"doc"),Se(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Se(this,"listenerCleanups",[]),Se(this,"handleFocus",r=>{const i=ct(r),o=this.findContainerIndex(i,r)>=0;if(o||dp(i))o&&(this.state.mostRecentlyFocusedNode=i);else{r.stopImmediatePropagation();let s,a=!0;if(this.state.mostRecentlyFocusedNode)if(yo(this.state.mostRecentlyFocusedNode)>0){const l=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:u}=this.state.containerGroups[l];if(u.length>0){const c=u.findIndex(d=>d===this.state.mostRecentlyFocusedNode);c>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?c+1<u.length&&(s=u[c+1],a=!1):c-1>=0&&(s=u[c-1],a=!1))}}else this.state.containerGroups.some(l=>l.tabbableNodes.some(u=>yo(u)>0))||(a=!1);else a=!1;a&&(s=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),s?this.tryFocus(s):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Se(this,"handlePointerDown",r=>{const i=ct(r);if(!(this.findContainerIndex(i,r)>=0)){if(ko(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}ko(this.config.allowOutsideClick,r)||r.preventDefault()}}),Se(this,"handleClick",r=>{const i=ct(r);this.findContainerIndex(i,r)>=0||ko(this.config.clickOutsideDeactivates,r)||ko(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),Se(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const i=this.config.isKeyBackward(r),o=this.findNextNavNode({event:r,isBackward:i});if(!o)return;bo(r)&&r.preventDefault(),this.tryFocus(o)}}),Se(this,"handleEscapeKey",r=>{qS(r)&&ko(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),Se(this,"_mutationObserver"),Se(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(i=>{i.some(o=>Array.from(o.removedNodes).some(s=>s===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode())})}),Se(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&this.state.containers.map(i=>{var o;(o=this._mutationObserver)==null||o.observe(i,{subtree:!0,childList:!0})})}),Se(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!dr(r))if(this.findContainerIndex(this.doc.activeElement)>=0)r=this.doc.activeElement;else{const i=this.state.tabbableGroups[0];r=i&&i.firstTabbableNode||this.getNodeForOption("fallbackFocus")}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),Se(this,"tryFocus",r=>{if(r!==!1&&r!==nv(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,WS(r)&&r.select()}}),Se(this,"deactivate",r=>{if(!this.state.active)return this;const i={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...r};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),wf.deactivateTrap(this.trapStack,this);const o=this.getOption(i,"onDeactivate"),s=this.getOption(i,"onPostDeactivate"),a=this.getOption(i,"checkCanReturnFocus"),l=this.getOption(i,"returnFocus","returnFocusOnDeactivate");o?.();const u=()=>{xf(()=>{if(l){const c=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(c)}s?.()})};if(l&&a){const c=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return a(c).then(u,u),this}return u(),this}),Se(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const i=this.getOption(r,"onPause"),o=this.getOption(r,"onPostPause");return this.state.paused=!0,i?.(),this.removeListeners(),this.updateObservedNodes(),o?.(),this}),Se(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const i=this.getOption(r,"onUnpause"),o=this.getOption(r,"onPostUnpause");return this.state.paused=!1,i?.(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),o?.(),this}),Se(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Se(this,"getReturnFocusNode",r=>{const i=this.getNodeForOption("setReturnFocus",{params:[r]});return i||(i===!1?!1:r)}),Se(this,"getOption",(r,i,o)=>r&&r[i]!==void 0?r[i]:this.config[o||i]),Se(this,"getNodeForOption",(r,{hasFallback:i=!1,params:o=[]}={})=>{let s=this.config[r];if(typeof s=="function"&&(s=s(...o)),s===!0&&(s=void 0),!s){if(s===void 0||s===!1)return s;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let a=s;if(typeof s=="string"){try{a=this.doc.querySelector(s)}catch(l){throw new Error(`\`${r}\` appears to be an invalid selector; error="${l.message}"`)}if(!a&&!i)throw new Error(`\`${r}\` as selector refers to no known node`)}return a}),Se(this,"findNextNavNode",r=>{const{event:i,isBackward:o=!1}=r,s=r.target||ct(i);this.updateTabbableNodes();let a=null;if(this.state.tabbableGroups.length>0){const l=this.findContainerIndex(s,i),u=l>=0?this.state.containerGroups[l]:void 0;if(l<0)o?a=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:a=this.state.tabbableGroups[0].firstTabbableNode;else if(o){let c=this.state.tabbableGroups.findIndex(({firstTabbableNode:d})=>s===d);if(c<0&&(u?.container===s||dr(s)&&!Vr(s)&&!(u!=null&&u.nextTabbableNode(s,!1)))&&(c=l),c>=0){const d=c===0?this.state.tabbableGroups.length-1:c-1,h=this.state.tabbableGroups[d];a=yo(s)>=0?h.lastTabbableNode:h.lastDomTabbableNode}else bo(i)||(a=u?.nextTabbableNode(s,!1))}else{let c=this.state.tabbableGroups.findIndex(({lastTabbableNode:d})=>s===d);if(c<0&&(u?.container===s||dr(s)&&!Vr(s)&&!(u!=null&&u.nextTabbableNode(s)))&&(c=l),c>=0){const d=c===this.state.tabbableGroups.length-1?0:c+1,h=this.state.tabbableGroups[d];a=yo(s)>=0?h.firstTabbableNode:h.firstDomTabbableNode}else bo(i)||(a=u?.nextTabbableNode(s))}}else a=this.getNodeForOption("fallbackFocus");return a}),this.trapStack=e.trapStack||zS;const n={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward(r){return bo(r)&&!r.shiftKey},isKeyBackward(r){return bo(r)&&r.shiftKey},...e};this.doc=n.document||Kt(Array.isArray(t)?t[0]:t),this.config=n,this.updateContainerElements(t),this.setupMutationObserver()}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(t,e){const n=typeof e?.composedPath=="function"?e.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:i})=>r.contains(t)||n?.includes(r)||i.find(o=>o===t))}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(t=>{const e=cv(t),n=uv(t),r=e.length>0?e[0]:void 0,i=e.length>0?e[e.length-1]:void 0,o=n.find(u=>Vr(u)),s=n.slice().reverse().find(u=>Vr(u)),a=!!e.find(u=>yo(u)>0);function l(u,c=!0){const d=e.indexOf(u);return d<0?c?n.slice(n.indexOf(u)+1).find(h=>Vr(h)):n.slice(0,n.indexOf(u)).reverse().find(h=>Vr(h)):e[d+(c?1:-1)]}return{container:t,tabbableNodes:e,focusableNodes:n,posTabIndexesFound:a,firstTabbableNode:r,lastTabbableNode:i,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:l}}),this.state.tabbableGroups=this.state.containerGroups.filter(t=>t.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("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(this.state.containerGroups.find(t=>t.posTabIndexesFound)&&this.state.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.")}addListeners(){if(this.state.active)return wf.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?xf(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(Ne(this.doc,"focusin",this.handleFocus,!0),Ne(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),Ne(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),Ne(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),Ne(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),Ne(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(t=>t()),this.listenerCleanups=[],this}activate(t){if(this.state.active)return this;const e=this.getOption(t,"onActivate"),n=this.getOption(t,"onPostActivate"),r=this.getOption(t,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=this.doc.activeElement||null,e?.();const i=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n?.()};return r?(r(this.state.containers.concat()).then(i,i),this):(i(),this)}},bo=t=>t.key==="Tab",ko=(t,...e)=>typeof t=="function"?t(...e):t,qS=t=>!t.isComposing&&t.key==="Escape",xf=t=>setTimeout(t,0),WS=t=>t.localName==="input"&&"select"in t&&typeof t.select=="function";function US(t,e={}){let n;const r=At(()=>{const i=typeof t=="function"?t():t;if(i){n=new HS(i,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:i,...e,document:Kt(i)});try{n.activate()}catch{}}});return function(){n?.deactivate(),r()}}var Uu="data-scroll-lock";function Ef(t,e){if(!t)return;const n=Object.keys(e).reduce((r,i)=>(r[i]=t.style.getPropertyValue(i),r),{});return Object.assign(t.style,e),()=>{Object.assign(t.style,n)}}function KS(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 GS(t){const e=t.getBoundingClientRect().left;return Math.round(e)+t.scrollLeft?"paddingLeft":"paddingRight"}function JS(t){const e=t??document,n=e.defaultView??window,{documentElement:r,body:i}=e;if(i.hasAttribute(Uu))return;i.setAttribute(Uu,"");const o=n.innerWidth-r.clientWidth,s=()=>KS(r,"--scrollbar-width",`${o}px`),a=GS(r),l=()=>Ef(i,{overflow:"hidden",[a]:`${o}px`}),u=()=>{const{scrollX:d,scrollY:h,visualViewport:p}=n,f=p?.offsetLeft??0,m=p?.offsetTop??0,g=Ef(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(),hp()?u():l()];return()=>{c.forEach(d=>d?.()),i.removeAttribute(Uu)}}var XS=Ln("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Rr=XS.build(),dy=t=>{var e;return((e=t.ids)==null?void 0:e.positioner)??`dialog:${t.id}:positioner`},py=t=>{var e;return((e=t.ids)==null?void 0:e.backdrop)??`dialog:${t.id}:backdrop`},id=t=>{var e;return((e=t.ids)==null?void 0:e.content)??`dialog:${t.id}:content`},hy=t=>{var e;return((e=t.ids)==null?void 0:e.trigger)??`dialog:${t.id}:trigger`},od=t=>{var e;return((e=t.ids)==null?void 0:e.title)??`dialog:${t.id}:title`},sd=t=>{var e;return((e=t.ids)==null?void 0:e.description)??`dialog:${t.id}:description`},fy=t=>{var e;return((e=t.ids)==null?void 0:e.closeTrigger)??`dialog:${t.id}:close`},na=t=>t.getById(id(t)),YS=t=>t.getById(dy(t)),ZS=t=>t.getById(py(t)),QS=t=>t.getById(hy(t)),eT=t=>t.getById(od(t)),tT=t=>t.getById(sd(t)),nT=t=>t.getById(fy(t));function rT(t,e){const{state:n,send:r,context:i,prop:o,scope:s}=t,a=o("aria-label"),l=n.matches("open");return{open:l,setOpen(u){u!==l&&r({type:u?"OPEN":"CLOSE"})},getTriggerProps(){return e.button({...Rr.trigger.attrs,dir:o("dir"),id:hy(s),"aria-haspopup":"dialog",type:"button","aria-expanded":l,"data-state":l?"open":"closed","aria-controls":id(s),onClick(u){u.defaultPrevented||r({type:"TOGGLE"})}})},getBackdropProps(){return e.element({...Rr.backdrop.attrs,dir:o("dir"),hidden:!l,id:py(s),"data-state":l?"open":"closed"})},getPositionerProps(){return e.element({...Rr.positioner.attrs,dir:o("dir"),id:dy(s),style:{pointerEvents:l?void 0:"none"}})},getContentProps(){const u=i.get("rendered");return e.element({...Rr.content.attrs,dir:o("dir"),role:o("role"),hidden:!l,id:id(s),tabIndex:-1,"data-state":l?"open":"closed","aria-modal":!0,"aria-label":a||void 0,"aria-labelledby":a||!u.title?void 0:od(s),"aria-describedby":u.description?sd(s):void 0})},getTitleProps(){return e.element({...Rr.title.attrs,dir:o("dir"),id:od(s)})},getDescriptionProps(){return e.element({...Rr.description.attrs,dir:o("dir"),id:sd(s)})},getCloseTriggerProps(){return e.button({...Rr.closeTrigger.attrs,dir:o("dir"),id:fy(s),type:"button",onClick(u){u.defaultPrevented||(u.stopPropagation(),r({type:"CLOSE"}))}})}}}var iT={props({props:t,scope:e}){const n=t.role==="alertdialog";return{role:"dialog",modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:n?()=>nT(e):void 0,...t}},initialState({prop:t}){return t("open")||t("defaultOpen")?"open":"closed"},context({bindable:t}){return{rendered:t(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:t,action:e,prop:n}){t([()=>n("open")],()=>{e(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["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"]}]}}},implementations:{guards:{isOpenControlled:({prop:t})=>t("open")!=null},effects:{trackDismissableElement({scope:t,send:e,prop:n}){return BS(()=>na(t),{defer:!0,pointerBlocking:n("modal"),exclude:[QS(t)],onInteractOutside(r){var i;(i=n("onInteractOutside"))==null||i(r),n("closeOnInteractOutside")||r.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onEscapeKeyDown(r){var i;(i=n("onEscapeKeyDown"))==null||i(r),n("closeOnEscape")||r.preventDefault()},onDismiss(){e({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:t,prop:e}){if(e("preventScroll"))return JS(t.getDoc())},trapFocus({scope:t,prop:e}){return!e("trapFocus")||!e("modal")?void 0:US(()=>na(t),{preventScroll:!0,returnFocusOnDeactivate:!!e("restoreFocus"),initialFocus:e("initialFocusEl"),setReturnFocus:n=>{var r;return((r=e("finalFocusEl"))==null?void 0:r())??n}})},hideContentBelow({scope:t,prop:e}){return e("modal")?OS(()=>[na(t)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:t,scope:e}){At(()=>{t.set("rendered",{title:!!eT(e),description:!!tT(e)})})},syncZIndex({scope:t}){At(()=>{const e=na(t);if(!e)return;const n=tx(e);[YS(t),ZS(t)].forEach(r=>{r?.style.setProperty("--z-index",n.zIndex)})})},invokeOnClose({prop:t}){var e;(e=t("onOpenChange"))==null||e({open:!1})},invokeOnOpen({prop:t}){var e;(e=t("onOpenChange"))==null||e({open:!0})},toggleVisibility({prop:t,send:e,event:n}){e({type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}};Wn()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const oT=["data-id"],sT=["data-id"],aT=["data-id"],lT=Q({__name:"Dialog",props:{title:{},subtitle:{},role:{default:"dialog"},closeOnEsc:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean,default:!0},alignment:{default:"top"},triggerLabel:{},showCloseTrigger:{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=nu(),s=pi(iT,{id:Qt({prefix:"dialog"}),closeOnEscape:r.closeOnEsc,modal:!0,closeOnInteractOutside:r.closeOnOutsideClick,onOpenChange(){if(!a.value.open)return i("open");i("close")},onPointerDownOutside(){i("clickoutside")},getRootNode:()=>{var u;return r.teleport?document:(u=o.value)==null?void 0:u.getRootNode()},...r}),a=I(()=>rT(s,di)),l=u=>r.dialogId?`${r.dialogId}-${u}`:"";return e({open:()=>{a.value.setOpen(!0)},close:()=>{a.value.setOpen(!1)}}),(u,c)=>(E(),O("div",{class:"k-dialog","data-id":u.dialogId},[F(u.$slots,"trigger",{triggerProps:a.value.getTriggerProps()},()=>[u.triggerLabel?(E(),$(ze,ne({key:0,class:"k-dialog__trigger",variant:"secondary"},a.value.getTriggerProps(),{disabled:u.disabled}),{default:Z(()=>[$e(oe(u.triggerLabel),1)]),_:1},16,["disabled"])):R("",!0)]),(E(),$(Lg,{to:"body",disabled:!u.teleport},[a.value.open?(E(),O(De,{key:0},[z("div",ne({class:"k-dialog__backdrop"},a.value.getBackdropProps(),{"data-id":l("backdrop")}),null,16,sT),z("div",ne({class:`k-dialog__container k-dialog--align-${u.alignment}`},a.value.getPositionerProps(),{"data-id":l("container")}),[he(PE,ne({class:"k-dialog__card",variant:u.variant,appearance:"shadow"},a.value.getContentProps(),{"data-id":l("dialog"),thumbnail:u.thumbnail,thumbnailOptions:u.thumbnailOptions}),Cs({_:2},[u.$slots.header||u.$slots.title||u.$slots.subtitle||u.title||u.subtitle||u.showCloseTrigger?{name:"header",fn:Z(()=>[F(u.$slots,"header",{titleProps:a.value.getTitleProps(),descriptionProps:a.value.getDescriptionProps(),closeTriggerProps:a.value.getCloseTriggerProps()},()=>[F(u.$slots,"title",{titleProps:a.value.getTitleProps()},()=>[u.title?(E(),O("div",ne({key:0,class:"k-dialog__title k-card__title"},a.value.getTitleProps()),oe(u.title),17)):R("",!0)]),F(u.$slots,"subtitle",{descriptionProps:a.value.getDescriptionProps()},()=>[u.subtitle?(E(),O("div",ne({key:0,class:"k-dialog__subtitle k-card__subtitle"},a.value.getDescriptionProps()),oe(u.subtitle),17)):R("",!0)]),u.showCloseTrigger?(E(),$(ze,ne({key:0,class:"k-dialog__close-trigger",variant:"tertiary",icon:"fa-pro-light:times",size:"small"},a.value.getCloseTriggerProps()),null,16)):R("",!0)])]),key:"0"}:void 0,u.$slots.default?{name:"default",fn:Z(()=>[F(u.$slots,"default",{descriptionProps:a.value.getDescriptionProps()})]),key:"1"}:void 0,u.$slots.actions?{name:"actions",fn:Z(()=>[F(u.$slots,"actions",{close:()=>a.value.setOpen(!1)})]),key:"2"}:void 0]),1040,["variant","data-id","thumbnail","thumbnailOptions"])],16,aT)],64)):R("",!0)],8,["disabled"]))],8,oT))}});function fu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function mu(){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)}mu.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)}}};mu.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};mu.prototype.getExtension=function(t){return t=/^\s*([^;\s]*)/.test(t)&&RegExp.$1,t&&this._extensions[t.toLowerCase()]||null};var uT=mu,cT={"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 dT=uT;var pT=new dT(cT);const Dp=fu(pT);function Np(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 Cf(t){return JSON.parse(JSON.stringify(t))}function Ip(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(".")?Dp.getType(i.substring(1))===t.type:i.includes("*")?t.type.startsWith(i.replace("*","")):t.type===i):!0}const Sf={counter:0,total:0,progress:0,bytes:0,result:[]};class my{constructor(e){Yt(this,"queue"),Yt(this,"upload"),Yt(this,"uploadOptions"),Yt(this,"accept"),this.queue=sp(Cf(Sf)),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,Cf(Sf))}async run(e){e=Array.from(e).filter(o=>Ip(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 Tf={"image/*":["jpeg","png","gif"]};function hT(t){return t?(Array.isArray(t)?t:t.split(",")).map(e=>e.trim()).map(e=>e.startsWith(".")?e.substring(1):e in Tf?Tf[e]:Dp.getExtension(e)).flat():[]}function ad(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,Dp.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 fT={class:"k-media-thumbnail-actions"},gy=Q({__name:"ThumbnailActions",props:{value:{},disabled:{type:Boolean}},emits:["delete"],setup(t,{emit:e}){const n=t,r=I(()=>n.value.type.startsWith("image/")?{component:"button",bind:{onClick:()=>{ad(n.value)}}}:{component:"a",bind:{href:n.value.url,download:n.value.name,target:"_blank"}});return(i,o)=>(E(),O("div",fT,[i.disabled?R("",!0):(E(),$(ze,{key:0,class:"k-media-thumbnail-actions__delete",icon:"fa-pro-solid:trash",variant:"danger",onClick:o[0]||(o[0]=Ba(s=>i.$emit("delete"),["stop"]))})),he(ze,ne({variant:"primary",is:r.value.component,class:"k-media-thumbnail-actions__download"},r.value.bind,{icon:"fa-pro-solid:arrow-alt-circle-down"}),null,16,["is"])]))}}),mT=Q({__name:"Thumbnail",props:{value:{},size:{default:"4rem"},disabled:{type:Boolean}},setup(t){const e=t,n=Vg(),r=I(()=>n["data-draggable"]),i=I(()=>{let s={};for(const a in n){if(a==="data-draggable")return;s[a]=n[a]}return s}),o=I(()=>({width:e.size,height:e.size}));return(s,a)=>(E(),O("div",ne({class:"k-media-thumbnail"},r.value,{class:{"k-media-thumbnail--selected":s.value.selected}}),[(E(),$(Qe(s.value.typeConfig.components.Thumbnail),ne({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"])),he(gy,{value:s.value,disabled:s.disabled,onDelete:a[0]||(a[0]=l=>s.$emit("delete",s.value))},null,8,["value","disabled"])],16))}}),gT={key:0,class:"k-media-type-selector"},vT={class:"k-media-type-selector__info"},yT=Q({__name:"TypeSelector",props:{value:{},upload:{type:Function},labels:{}},emits:["add","cancel","success","openFileWindow"],setup(t,{emit:e}){const n=t,r=e,i=X(null),o=X(),s=X(!0),a=X(!1),l=X(),u=X();Ee(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=I(()=>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?R("",!0):(E(),O("div",gT,[z("span",vT,oe(g.labels.selectMessage),1),he(pu,{teleport:!0,label:g.labels.select,iconRight:"fa6-solid:plus",theme:"shadow",placement:"bottom-end"},{default:Z(()=>[(E(!0),O(De,null,_t(g.value,b=>(E(),$(Qe(b.components.CreateTrigger),{key:b.name,label:m(b.name.toLowerCase()),onClick:k=>h(b)},null,8,["label","onClick"]))),128))]),_:1},8,["label"]),he(lT,{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:Z(()=>[i.value?(E(),$(Qe(i.value.components.Create),ne({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"])):R("",!0)]),footer:Z(()=>[he(ze,{label:g.labels.cancel,type:"button",onClick:p},null,8,["label"]),he(ze,{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)]))}}),bT=Q({__name:"Description",props:{modelValue:{},placeholder:{}},emits:["update:modelValue"],setup(t,{emit:e}){return(n,r)=>(E(),$(gE,{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"]))}}),kT={class:"k-media-uploader"},wT={class:"k-media-uploader__bar"},xT={class:"k-media-uploader__meta"},ET={key:0},CT={key:1},ST=Q({__name:"Uploader",props:{value:{},bytes:{},current:{default:1},total:{default:1}},setup(t){const e=t,n=I(()=>e.total>1),r=I(()=>Np(e.bytes)),i=I(()=>Math.floor(e.value));return(o,s)=>(E(),O("div",kT,[z("div",null,oe(i.value)+" %",1),z("div",wT,[z("div",{class:"k-media-uploader__bar-value",style:Cr({width:o.value+"%"})},null,4)]),z("div",xT,[n.value?(E(),O("div",ET,oe(o.current)+" / "+oe(o.total),1)):R("",!0),o.bytes?(E(),O("div",CT,"("+oe(r.value)+")",1)):R("",!0)])]))}}),TT=["innerHTML"],OT=Q({__name:"SlotHandler",props:{value:{}},setup(t){const e=t,n=I(()=>typeof e.value=="string"?e.value:void 0),r=I(()=>typeof e.value=="string"?"div":e.value);return(i,o)=>(E(),$(Qe(r.value),be(Ie(i.$attrs)),{default:Z(()=>[n.value?(E(),O("span",{key:0,innerHTML:n.value},null,8,TT)):R("",!0)]),_:1},16))}}),AT={class:"k-media-droparea__instruction"},MT=["type","accept","required","disabled","multiple"],_T=Q({__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=X(!1),o=X(!0),s=X(),a=I(()=>!!(!n.required||n.value)),l=I(()=>n.disabled),u=I(()=>!l.value&&!d.total),{run:c,queue:d}=new my(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)&&kr(()=>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=>Ip(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=rn("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(),O(De,null,[z("div",{class:Ce(B(y)({active:i.value,invalid:!o.value,selected:!!k.selected,disabled:l.value})),onDrop:f,onDragover:m,onDragleave:g},[F(k.$slots,"preview"),z("div",AT,[u.value?(E(),O("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,MT)):R("",!0),o.value?(E(),O(De,{key:1},[F(k.$slots,"drop-message",{},()=>[he(OT,{value:k.dropMessage},null,8,["value"])]),F(k.$slots,"default",{openFileWindow:b})],64)):(E(),$(B(Ze),{key:2,icon:"fa-pro-light:ban",style:{"font-size":"2rem"}})),F(k.$slots,"custom-message")]),!k.multiple&&k.selected?(E(),$(gy,{key:0,value:k.selected,disabled:l.value,onDelete:v[0]||(v[0]=w=>k.$emit("remove",k.selected))},null,8,["value","disabled"])):R("",!0)],34),B(d).total?(E(),$(ST,{key:0,value:B(d).progress,bytes:B(d).bytes,current:B(d).counter,total:B(d).total},null,8,["value","bytes","current","total"])):R("",!0)],64))}}),DT=Q({__name:"CreateTrigger",props:{label:{}},setup(t){return(e,n)=>(E(),$(ze,{type:"button",label:e.label,iconRight:"fa6-solid:image",size:"small",variant:"tertiary"},null,8,["label"]))}}),NT=Q({__name:"Thumbnail",props:{value:{}},setup(t){const e=t;return(n,r)=>(E(),$(au,{class:"k-media-image__thumbnail",src:e.value.url,onClick:r[0]||(r[0]=i=>n.$emit("click"))},null,8,["src"]))}}),IT=Q({__name:"Preview",props:{value:{},size:{}},setup(t){const e=t;return(n,r)=>(E(),$(au,{src:e.value.url,class:"k-media-image-preview",size:n.size,width:"100%",height:"100%"},null,8,["src","size"]))}}),RT={name:"Image",condition:t=>/^image\/.+/i.test(t.type),components:{CreateTrigger:ka(DT),Thumbnail:ka(NT),Preview:ka(IT)}},PT={Image:RT};/**!
4
4
  * Sortable 1.14.0
5
5
  * @author RubaXa <trash@rubaxa.org>
6
6
  * @author owenm <owen23355@gmail.com>
7
7
  * @license MIT
8
- */function Of(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 wn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Of(Object(n),!0).forEach(function(r){FT(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Of(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ta(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ta=function(e){return typeof e}:Ta=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ta(t)}function FT(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jn(){return jn=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},jn.apply(this,arguments)}function LT(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 VT(t,e){if(t==null)return{};var n=LT(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 BT="1.14.0";function Vn(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Un=Vn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ms=Vn(/Edge/i),Af=Vn(/firefox/i),Vo=Vn(/safari/i)&&!Vn(/chrome/i)&&!Vn(/android/i),vy=Vn(/iP(ad|od|hone)/i),$T=Vn(/chrome/i)&&Vn(/android/i),yy={capture:!1,passive:!1};function ve(t,e,n){t.addEventListener(e,n,!Un&&yy)}function me(t,e,n){t.removeEventListener(e,n,!Un&&yy)}function Ya(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 jT(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function hn(t,e,n,r){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&Ya(t,e):Ya(t,e))||r&&t===n)return t;if(t===n)break}while(t=jT(t))}return null}var Mf=/\s+/g;function Et(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(Mf," ").replace(" "+e+" "," ");t.className=(r+(n?" "+e:"")).replace(Mf," ")}}function ee(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 Vi(t,e){var n="";if(typeof t=="string")n=t;else do{var r=ee(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 by(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 yn(){var t=document.scrollingElement;return t||document.documentElement}function Be(t,e,n,r,i){if(!(!t.getBoundingClientRect&&t!==window)){var o,s,a,l,u,c,d;if(t!==window&&t.parentNode&&t!==yn()?(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,!Un))do if(i&&i.getBoundingClientRect&&(ee(i,"transform")!=="none"||n&&ee(i,"position")!=="static")){var h=i.getBoundingClientRect();s-=h.top+parseInt(ee(i,"border-top-width")),a-=h.left+parseInt(ee(i,"border-left-width")),l=s+o.height,u=a+o.width;break}while(i=i.parentNode);if(r&&t!==window){var p=Vi(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 _f(t,e,n){for(var r=sr(t,!0),i=Be(t)[e];r;){var o=Be(r)[n],s=void 0;if(s=i>=o,!s)return r;if(r===yn())break;r=sr(r,!1)}return!1}function Ki(t,e,n,r){for(var i=0,o=0,s=t.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==te.ghost&&(r||s[o]!==te.dragged)&&hn(s[o],n.draggable,t,!1)){if(i===e)return s[o];i++}o++}return null}function Rp(t,e){for(var n=t.lastElementChild;n&&(n===te.ghost||ee(n,"display")==="none"||e&&!Ya(n,e));)n=n.previousElementSibling;return n||null}function Lt(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==te.clone&&(!e||Ya(t,e))&&n++;return n}function Df(t){var e=0,n=0,r=yn();if(t)do{var i=Vi(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 zT(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 sr(t,e){if(!t||!t.getBoundingClientRect)return yn();var n=t,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=ee(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 yn();if(r||e)return n;r=!0}}while(n=n.parentNode);return yn()}function HT(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Ku(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 Bo;function ky(t,e){return function(){if(!Bo){var n=arguments,r=this;n.length===1?t.call(r,n[0]):t.apply(r,n),Bo=setTimeout(function(){Bo=void 0},e)}}}function qT(){clearTimeout(Bo),Bo=void 0}function wy(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function xy(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 Tt="Sortable"+new Date().getTime();function WT(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(r){if(!(ee(r,"display")==="none"||r===te.ghost)){t.push({target:r,rect:Be(r)});var i=wn({},t[t.length-1].rect);if(r.thisAnimationDuration){var o=Vi(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(zT(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=Be(l),d=l.prevFromRect,h=l.prevToRect,p=s.rect,f=Vi(l,!0);f&&(c.top-=f.f,c.left-=f.e),l.toRect=c,l.thisAnimationDuration&&Ku(d,c)&&!Ku(u,c)&&(p.top-c.top)/(p.left-c.left)===(u.top-c.top)/(u.left-c.left)&&(a=KT(p,d,h,r.options)),Ku(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){ee(n,"transition",""),ee(n,"transform","");var s=Vi(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,ee(n,"transform","translate3d("+u+"px,"+c+"px,0)"),this.forRepaintDummy=UT(n),ee(n,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),ee(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){ee(n,"transition",""),ee(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},o)}}}}function UT(t){return t.offsetWidth}function KT(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 xi=[],Gu={initializeByDefault:!0},_s={mount:function(t){for(var e in Gu)Gu.hasOwnProperty(e)&&!(e in t)&&(t[e]=Gu[e]);xi.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),xi.push(t)},pluginEvent:function(t,e,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=t+"Global";xi.forEach(function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](wn({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](wn({sortable:e},n)))})},initializePlugins:function(t,e,n,r){xi.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,jn(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 xi.forEach(function(r){typeof r.eventProperties=="function"&&jn(n,r.eventProperties.call(e[r.pluginName],t))}),n},modifyOption:function(t,e,n){var r;return xi.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[e]=="function"&&(r=i.optionListeners[e].call(t[i.pluginName],n))}),r}};function GT(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[Tt],!!e){var m,g=e.options,y="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Un&&!Ms?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=wn(wn({},f),_s.getEventProperties(r,e));for(var k in b)m[k]=b[k];n&&n.dispatchEvent(m),g[y]&&g[y].call(e,m)}}var JT=["evt"],gt=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=VT(n,JT);_s.pluginEvent.bind(te)(t,e,wn({dragEl:P,parentEl:Ae,ghostEl:ae,rootEl:xe,nextEl:$r,lastDownEl:Oa,cloneEl:Me,cloneHidden:rr,dragStarted:Ao,putSortable:Ge,activeSortable:te.active,originalEvent:r,oldIndex:Ii,oldDraggableIndex:$o,newIndex:Ct,newDraggableIndex:Qn,hideGhostForTarget:Ty,unhideGhostForTarget:Oy,cloneNowHidden:function(){rr=!0},cloneNowShown:function(){rr=!1},dispatchSortableEvent:function(o){ut({sortable:e,name:o,originalEvent:r})}},i))};function ut(t){GT(wn({putSortable:Ge,cloneEl:Me,targetEl:P,rootEl:xe,oldIndex:Ii,oldDraggableIndex:$o,newIndex:Ct,newDraggableIndex:Qn},t))}var P,Ae,ae,xe,$r,Oa,Me,rr,Ii,Ct,$o,Qn,ra,Ge,Ti=!1,Za=!1,Qa=[],Pr,Gt,Ju,Xu,Nf,If,Ao,Ei,jo,zo=!1,ia=!1,Aa,tt,Yu=[],ld=!1,el=[],gu=typeof document<"u",oa=vy,Rf=Ms||Un?"cssFloat":"float",XT=gu&&!$T&&!vy&&"draggable"in document.createElement("div"),Ey=function(){if(gu){if(Un)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),Cy=function(t,e){var n=ee(t),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Ki(t,0,e),o=Ki(t,1,e),s=i&&ee(i),a=o&&ee(o),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Be(i).width,u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Be(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[Rf]==="none"||o&&n[Rf]==="none"&&l+u>r)?"vertical":"horizontal"},YT=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},ZT=function(t,e){var n;return Qa.some(function(r){var i=r[Tt].options.emptyInsertThreshold;if(!(!i||Rp(r))){var o=Be(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},Sy=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||Ta(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},Ty=function(){!Ey&&ae&&ee(ae,"display","none")},Oy=function(){!Ey&&ae&&ee(ae,"display","")};gu&&document.addEventListener("click",function(t){if(Za)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Za=!1,!1},!0);var Fr=function(t){if(P){t=t.touches?t.touches[0]:t;var e=ZT(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[Tt]._onDragOver(n)}}},QT=function(t){P&&P.parentNode[Tt]._isOutsideThisEl(t.target)};function te(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=jn({},e),t[Tt]=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 Cy(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:te.supportPointer!==!1&&"PointerEvent"in window&&!Vo,emptyInsertThreshold:5};_s.initializePlugins(this,t,n);for(var r in n)!(r in e)&&(e[r]=n[r]);Sy(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:XT,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?ve(t,"pointerdown",this._onTapStart):(ve(t,"mousedown",this._onTapStart),ve(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(ve(t,"dragover",this),ve(t,"dragenter",this)),Qa.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),jn(this,WT())}te.prototype={constructor:te,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Ei=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,P):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(aO(n),!P&&!(/mousedown|pointerdown/.test(o)&&t.button!==0||r.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&Vo&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=hn(a,r.draggable,n,!1),!(a&&a.animated)&&Oa!==a)){if(Ii=Lt(a),$o=Lt(a,r.draggable),typeof u=="function"){if(u.call(this,t,a,this)){ut({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),gt("filter",e,{evt:t}),i&&t.cancelable&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(c){if(c=hn(l,c.trim(),n,!1),c)return ut({sortable:e,rootEl:c,name:"filter",targetEl:a,fromEl:n,toEl:n}),gt("filter",e,{evt:t}),!0}),u)){i&&t.cancelable&&t.preventDefault();return}r.handle&&!hn(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&&!P&&n.parentNode===i){var l=Be(n);if(xe=i,P=n,Ae=P.parentNode,$r=P.nextSibling,Oa=n,ra=o.group,te.dragged=P,Pr={target:P,clientX:(e||t).clientX,clientY:(e||t).clientY},Nf=Pr.clientX-l.left,If=Pr.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,P.style["will-change"]="all",a=function(){if(gt("delayEnded",r,{evt:t}),te.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Af&&r.nativeDraggable&&(P.draggable=!0),r._triggerDragStart(t,e),ut({sortable:r,name:"choose",originalEvent:t}),Et(P,o.chosenClass,!0)},o.ignore.split(",").forEach(function(u){by(P,u.trim(),Zu)}),ve(s,"dragover",Fr),ve(s,"mousemove",Fr),ve(s,"touchmove",Fr),ve(s,"mouseup",r._onDrop),ve(s,"touchend",r._onDrop),ve(s,"touchcancel",r._onDrop),Af&&this.nativeDraggable&&(this.options.touchStartThreshold=4,P.draggable=!0),gt("delayStart",this,{evt:t}),o.delay&&(!o.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(Ms||Un))){if(te.eventCanceled){this._onDrop();return}ve(s,"mouseup",r._disableDelayedDrag),ve(s,"touchend",r._disableDelayedDrag),ve(s,"touchcancel",r._disableDelayedDrag),ve(s,"mousemove",r._delayedDragTouchMoveHandler),ve(s,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&ve(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(){P&&Zu(P),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;me(t,"mouseup",this._disableDelayedDrag),me(t,"touchend",this._disableDelayedDrag),me(t,"touchcancel",this._disableDelayedDrag),me(t,"mousemove",this._delayedDragTouchMoveHandler),me(t,"touchmove",this._delayedDragTouchMoveHandler),me(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?ve(document,"pointermove",this._onTouchMove):e?ve(document,"touchmove",this._onTouchMove):ve(document,"mousemove",this._onTouchMove):(ve(P,"dragend",this),ve(xe,"dragstart",this._onDragStart));try{document.selection?Ma(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Ti=!1,xe&&P){gt("dragStarted",this,{evt:e}),this.nativeDraggable&&ve(document,"dragover",QT);var n=this.options;!t&&Et(P,n.dragClass,!1),Et(P,n.ghostClass,!0),te.active=this,t&&this._appendGhost(),ut({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Gt){this._lastX=Gt.clientX,this._lastY=Gt.clientY,Ty();for(var t=document.elementFromPoint(Gt.clientX,Gt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Gt.clientX,Gt.clientY),t!==e);)e=t;if(P.parentNode[Tt]._isOutsideThisEl(t),e)do{if(e[Tt]){var n=void 0;if(n=e[Tt]._onDragOver({clientX:Gt.clientX,clientY:Gt.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Oy()}},_onTouchMove:function(t){if(Pr){var e=this.options,n=e.fallbackTolerance,r=e.fallbackOffset,i=t.touches?t.touches[0]:t,o=ae&&Vi(ae,!0),s=ae&&o&&o.a,a=ae&&o&&o.d,l=oa&&tt&&Df(tt),u=(i.clientX-Pr.clientX+r.x)/(s||1)+(l?l[0]-Yu[0]:0)/(s||1),c=(i.clientY-Pr.clientY+r.y)/(a||1)+(l?l[1]-Yu[1]:0)/(a||1);if(!te.active&&!Ti){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(ae){o?(o.e+=u-(Ju||0),o.f+=c-(Xu||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,")");ee(ae,"webkitTransform",d),ee(ae,"mozTransform",d),ee(ae,"msTransform",d),ee(ae,"transform",d),Ju=u,Xu=c,Gt=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!ae){var t=this.options.fallbackOnBody?document.body:xe,e=Be(P,!0,oa,!0,t),n=this.options;if(oa){for(tt=t;ee(tt,"position")==="static"&&ee(tt,"transform")==="none"&&tt!==document;)tt=tt.parentNode;tt!==document.body&&tt!==document.documentElement?(tt===document&&(tt=yn()),e.top+=tt.scrollTop,e.left+=tt.scrollLeft):tt=yn(),Yu=Df(tt)}ae=P.cloneNode(!0),Et(ae,n.ghostClass,!1),Et(ae,n.fallbackClass,!0),Et(ae,n.dragClass,!0),ee(ae,"transition",""),ee(ae,"transform",""),ee(ae,"box-sizing","border-box"),ee(ae,"margin",0),ee(ae,"top",e.top),ee(ae,"left",e.left),ee(ae,"width",e.width),ee(ae,"height",e.height),ee(ae,"opacity","0.8"),ee(ae,"position",oa?"absolute":"fixed"),ee(ae,"zIndex","100000"),ee(ae,"pointerEvents","none"),te.ghost=ae,t.appendChild(ae),ee(ae,"transform-origin",Nf/parseInt(ae.style.width)*100+"% "+If/parseInt(ae.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,r=t.dataTransfer,i=n.options;if(gt("dragStart",this,{evt:t}),te.eventCanceled){this._onDrop();return}gt("setupClone",this),te.eventCanceled||(Me=xy(P),Me.draggable=!1,Me.style["will-change"]="",this._hideClone(),Et(Me,this.options.chosenClass,!1),te.clone=Me),n.cloneId=Ma(function(){gt("clone",n),!te.eventCanceled&&(n.options.removeCloneOnHide||xe.insertBefore(Me,P),n._hideClone(),ut({sortable:n,name:"clone"}))}),!e&&Et(P,i.dragClass,!0),e?(Za=!0,n._loopId=setInterval(n._emulateDragOver,50)):(me(document,"mouseup",n._onDrop),me(document,"touchend",n._onDrop),me(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(n,r,P)),ve(document,"drop",n),ee(P,"transform","translateZ(0)")),Ti=!0,n._dragStartId=Ma(n._dragStarted.bind(n,e,t)),ve(document,"selectstart",n),Ao=!0,Vo&&ee(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=te.active,u=ra===a,c=s.sort,d=Ge||l,h,p=this,f=!1;if(ld)return;function m(ue,ge){gt(ue,p,wn({evt:t,isOwner:u,axis:h?"vertical":"horizontal",revert:o,dragRect:r,targetRect:i,canSort:c,fromSortable:d,target:n,completed:y,onMove:function(Te,mt){return sa(xe,e,P,r,Te,Be(Te),t,mt)},changed:b},ge))}function g(){m("dragOverAnimationCapture"),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function y(ue){return m("dragOverCompleted",{insertion:ue}),ue&&(u?l._hideClone():l._showClone(p),p!==d&&(Et(P,Ge?Ge.options.ghostClass:l.options.ghostClass,!1),Et(P,s.ghostClass,!0)),Ge!==p&&p!==te.active?Ge=p:p===te.active&&Ge&&(Ge=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){m("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===P&&!P.animated||n===e&&!n.animated)&&(Ei=null),!s.dragoverBubble&&!t.rootEl&&n!==document&&(P.parentNode[Tt]._isOutsideThisEl(t.target),!ue&&Fr(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function b(){Ct=Lt(P),Qn=Lt(P,s.draggable),ut({sortable:p,name:"change",toEl:e,newIndex:Ct,newDraggableIndex:Qn,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=hn(n,s.draggable,e,!0),m("dragOver"),te.eventCanceled)return f;if(P.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return y(!1);if(Za=!1,l&&!s.disabled&&(u?c||(o=Ae!==xe):Ge===this||(this.lastPutMode=ra.checkPull(this,l,P,t))&&a.checkPut(this,l,P,t))){if(h=this._getDirection(t,n)==="vertical",r=Be(P),m("dragOverValid"),te.eventCanceled)return f;if(o)return Ae=xe,g(),this._hideClone(),m("revert"),te.eventCanceled||($r?xe.insertBefore(P,$r):xe.appendChild(P)),y(!0);var k=Rp(e,s.draggable);if(!k||rO(t,h,this)&&!k.animated){if(k===P)return y(!1);if(k&&e===t.target&&(n=k),n&&(i=Be(n)),sa(xe,e,P,r,n,i,t,!!n)!==!1)return g(),e.appendChild(P),Ae=e,b(),y(!0)}else if(k&&nO(t,h,this)){var v=Ki(e,0,s,!0);if(v===P)return y(!1);if(n=v,i=Be(n),sa(xe,e,P,r,n,i,t,!1)!==!1)return g(),e.insertBefore(P,v),Ae=e,b(),y(!0)}else if(n.parentNode===e){i=Be(n);var w=0,x,C=P.parentNode!==e,N=!YT(P.animated&&P.toRect||r,n.animated&&n.toRect||i,h),A=h?"top":"left",S=_f(n,"top","top")||_f(P,"top","top"),_=S?S.scrollTop:void 0;Ei!==n&&(x=i[A],zo=!1,ia=!N&&s.invertSwap||C),w=iO(t,n,i,h,N?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,ia,Ei===n);var L;if(w!==0){var W=Lt(P);do W-=w,L=Ae.children[W];while(L&&(ee(L,"display")==="none"||L===ae))}if(w===0||L===n)return y(!1);Ei=n,jo=w;var q=n.nextElementSibling,K=!1;K=w===1;var J=sa(xe,e,P,r,n,i,t,K);if(J!==!1)return(J===1||J===-1)&&(K=J===1),ld=!0,setTimeout(tO,30),g(),K&&!q?e.appendChild(P):n.parentNode.insertBefore(P,K?q:n),S&&wy(S,0,_-S.scrollTop),Ae=P.parentNode,x!==void 0&&!ia&&(Aa=Math.abs(x-Be(n)[A])),b(),y(!0)}if(e.contains(P))return y(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){me(document,"mousemove",this._onTouchMove),me(document,"touchmove",this._onTouchMove),me(document,"pointermove",this._onTouchMove),me(document,"dragover",Fr),me(document,"mousemove",Fr),me(document,"touchmove",Fr)},_offUpEvents:function(){var t=this.el.ownerDocument;me(t,"mouseup",this._onDrop),me(t,"touchend",this._onDrop),me(t,"pointerup",this._onDrop),me(t,"touchcancel",this._onDrop),me(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;if(Ct=Lt(P),Qn=Lt(P,n.draggable),gt("drop",this,{evt:t}),Ae=P&&P.parentNode,Ct=Lt(P),Qn=Lt(P,n.draggable),te.eventCanceled){this._nulling();return}Ti=!1,ia=!1,zo=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ud(this.cloneId),ud(this._dragStartId),this.nativeDraggable&&(me(document,"drop",this),me(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Vo&&ee(document.body,"user-select",""),ee(P,"transform",""),t&&(Ao&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),ae&&ae.parentNode&&ae.parentNode.removeChild(ae),(xe===Ae||Ge&&Ge.lastPutMode!=="clone")&&Me&&Me.parentNode&&Me.parentNode.removeChild(Me),P&&(this.nativeDraggable&&me(P,"dragend",this),Zu(P),P.style["will-change"]="",Ao&&!Ti&&Et(P,Ge?Ge.options.ghostClass:this.options.ghostClass,!1),Et(P,this.options.chosenClass,!1),ut({sortable:this,name:"unchoose",toEl:Ae,newIndex:null,newDraggableIndex:null,originalEvent:t}),xe!==Ae?(Ct>=0&&(ut({rootEl:Ae,name:"add",toEl:Ae,fromEl:xe,originalEvent:t}),ut({sortable:this,name:"remove",toEl:Ae,originalEvent:t}),ut({rootEl:Ae,name:"sort",toEl:Ae,fromEl:xe,originalEvent:t}),ut({sortable:this,name:"sort",toEl:Ae,originalEvent:t})),Ge&&Ge.save()):Ct!==Ii&&Ct>=0&&(ut({sortable:this,name:"update",toEl:Ae,originalEvent:t}),ut({sortable:this,name:"sort",toEl:Ae,originalEvent:t})),te.active&&((Ct==null||Ct===-1)&&(Ct=Ii,Qn=$o),ut({sortable:this,name:"end",toEl:Ae,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){gt("nulling",this),xe=P=Ae=ae=$r=Me=Oa=rr=Pr=Gt=Ao=Ct=Qn=Ii=$o=Ei=jo=Ge=ra=te.dragged=te.ghost=te.clone=te.active=null,el.forEach(function(t){t.checked=!0}),el.length=Ju=Xu=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":P&&(this._onDragOver(t),eO(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],hn(e,o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||sO(e));return t},sort:function(t,e){var n={},r=this.el;this.toArray().forEach(function(i,o){var s=r.children[o];hn(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 hn(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=_s.modifyOption(this,t,e);typeof r<"u"?n[t]=r:n[t]=e,t==="group"&&Sy(n)},destroy:function(){gt("destroy",this);var t=this.el;t[Tt]=null,me(t,"mousedown",this._onTapStart),me(t,"touchstart",this._onTapStart),me(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(me(t,"dragover",this),me(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Qa.splice(Qa.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!rr){if(gt("hideClone",this),te.eventCanceled)return;ee(Me,"display","none"),this.options.removeCloneOnHide&&Me.parentNode&&Me.parentNode.removeChild(Me),rr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(rr){if(gt("showClone",this),te.eventCanceled)return;P.parentNode==xe&&!this.options.group.revertClone?xe.insertBefore(Me,P):$r?xe.insertBefore(Me,$r):xe.appendChild(Me),this.options.group.revertClone&&this.animate(P,Me),ee(Me,"display",""),rr=!1}}};function eO(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function sa(t,e,n,r,i,o,s,a){var l,u=t[Tt],c=u.options.onMove,d;return window.CustomEvent&&!Un&&!Ms?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||Be(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),c&&(d=c.call(u,l,s)),d}function Zu(t){t.draggable=!1}function tO(){ld=!1}function nO(t,e,n){var r=Be(Ki(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 rO(t,e,n){var r=Be(Rp(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 iO(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&&Aa<u*i){if(!zo&&(jo===1?l>c+u*o/2:l<d-u*o/2)&&(zo=!0),zo)h=!0;else if(jo===1?l<c+Aa:l>d-Aa)return-jo}else if(l>c+u*(1-i)/2&&l<d-u*(1-i)/2)return oO(e)}return h=h||s,h&&(l<c+u*o/2||l>d-u*o/2)?l>c+u/2?1:-1:0}function oO(t){return Lt(P)<Lt(t)?1:-1}function sO(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 aO(t){el.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var r=e[n];r.checked&&el.push(r)}}function Ma(t){return setTimeout(t,0)}function ud(t){return clearTimeout(t)}gu&&ve(document,"touchmove",function(t){(te.active||Ti)&&t.cancelable&&t.preventDefault()});te.utils={on:ve,off:me,css:ee,find:by,is:function(t,e){return!!hn(t,e,t,!1)},extend:HT,throttle:ky,closest:hn,toggleClass:Et,clone:xy,index:Lt,nextTick:Ma,cancelNextTick:ud,detectDirection:Cy,getChild:Ki};te.get=function(t){return t[Tt]};te.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&&(te.utils=wn(wn({},te.utils),r.utils)),_s.mount(r)})};te.create=function(t,e){return new te(t,e)};te.version=BT;var Re=[],Mo,cd,dd=!1,Qu,ec,tl,_o;function lO(){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?ve(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ve(document,"pointermove",this._handleFallbackAutoScroll):n.touches?ve(document,"touchmove",this._handleFallbackAutoScroll):ve(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var n=e.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?me(document,"dragover",this._handleAutoScroll):(me(document,"pointermove",this._handleFallbackAutoScroll),me(document,"touchmove",this._handleFallbackAutoScroll),me(document,"mousemove",this._handleFallbackAutoScroll)),Pf(),_a(),qT()},nulling:function(){tl=cd=Mo=dd=_o=Qu=ec=null,Re.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(tl=e,n||this.options.forceAutoScrollFallback||Ms||Un||Vo){tc(e,this.options,s,n);var a=sr(s,!0);dd&&(!_o||i!==Qu||o!==ec)&&(_o&&Pf(),_o=setInterval(function(){var l=sr(document.elementFromPoint(i,o),!0);l!==a&&(a=l,_a()),tc(e,r.options,l,n)},10),Qu=i,ec=o)}else{if(!this.options.bubbleScroll||sr(s,!0)===yn()){_a();return}tc(e,this.options,sr(s,!1),!1)}}},jn(t,{pluginName:"scroll",initializeByDefault:!0})}function _a(){Re.forEach(function(t){clearInterval(t.pid)}),Re=[]}function Pf(){clearInterval(_o)}var tc=ky(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=yn(),u=!1,c;cd!==n&&(cd=n,_a(),Mo=e.scroll,c=e.scrollFn,Mo===!0&&(Mo=sr(n,!0)));var d=0,h=Mo;do{var p=h,f=Be(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,C=p.scrollWidth,N=p.scrollHeight,A=ee(p),S=p.scrollLeft,_=p.scrollTop;p===l?(w=k<C&&(A.overflowX==="auto"||A.overflowX==="scroll"||A.overflowX==="visible"),x=v<N&&(A.overflowY==="auto"||A.overflowY==="scroll"||A.overflowY==="visible")):(w=k<C&&(A.overflowX==="auto"||A.overflowX==="scroll"),x=v<N&&(A.overflowY==="auto"||A.overflowY==="scroll"));var L=w&&(Math.abs(b-i)<=s&&S+k<C)-(Math.abs(y-i)<=s&&!!S),W=x&&(Math.abs(g-o)<=s&&_+v<N)-(Math.abs(m-o)<=s&&!!_);if(!Re[d])for(var q=0;q<=d;q++)Re[q]||(Re[q]={});(Re[d].vx!=L||Re[d].vy!=W||Re[d].el!==p)&&(Re[d].el=p,Re[d].vx=L,Re[d].vy=W,clearInterval(Re[d].pid),(L!=0||W!=0)&&(u=!0,Re[d].pid=setInterval(function(){r&&this.layer===0&&te.active._onTouchMove(tl);var K=Re[this.layer].vy?Re[this.layer].vy*a:0,J=Re[this.layer].vx?Re[this.layer].vx*a:0;typeof c=="function"&&c.call(te.dragged.parentNode[Tt],J,K,t,tl,Re[this.layer].el)!=="continue"||wy(Re[this.layer].el,J,K)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&h!==l&&(h=sr(h,!1)));dd=u}},30),Ay=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 Pp(){}Pp.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=Ki(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:Ay};jn(Pp,{pluginName:"revertOnSpill"});function Fp(){}Fp.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:Ay};jn(Fp,{pluginName:"removeOnSpill"});te.mount(new lO);te.mount(Fp,Pp);function nc(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function Ff(t,e,n){const r=n===0?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,r)}function uO(){return typeof window<"u"?window.console:global.console}const cO=uO();function dO(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const pO=/-(\w)/g,hO=dO(t=>t.replace(pO,(e,n)=>n.toUpperCase())),My=["Start","Add","Remove","Update","End"],_y=["Choose","Unchoose","Sort","Filter","Clone"],Dy=["Move"],fO=[Dy,My,_y].flatMap(t=>t).map(t=>`on${t}`),pd={manage:Dy,manageAndEmit:My,emit:_y};function mO(t){return fO.indexOf(t)!==-1}const gO=["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 vO(t){return gO.includes(t)}function yO(t){return["transition-group","TransitionGroup"].includes(t)}function Ny(t){return["id","class","role","style"].includes(t)||t.startsWith("data-")||t.startsWith("aria-")||t.startsWith("on")}function Iy(t){return t.reduce((e,[n,r])=>(e[n]=r,e),{})}function bO({$attrs:t,componentData:e={}}){return{...Iy(Object.entries(t).filter(([n,r])=>Ny(n))),...e}}function kO({$attrs:t,callBackBuilder:e}){const n=Iy(Ry(t));Object.entries(e).forEach(([i,o])=>{pd[i].forEach(s=>{n[`on${s}`]=o(s)})});const r=`[data-draggable]${n.draggable||""}`;return{...n,draggable:r}}function Ry(t){return Object.entries(t).filter(([e,n])=>!Ny(e)).map(([e,n])=>[hO(e),n]).filter(([e,n])=>!mO(e))}const Lf=({el:t})=>t,wO=(t,e)=>t.__draggable_context=e,Vf=t=>t.__draggable_context;class xO{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)=>{wO(Lf(r),{element:n[i],index:i})})}getUnderlyingVm(e){return Vf(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=Vf(s);if(a)return a.index;if(i===0)return 0;const l=Lf(r[0]),u=[...o].findIndex(c=>c===l);return e<u?0:i}}function EO(t,e){const n=t[e];return n?n():[]}function CO({$slots:t,realList:e,getKey:n}){const r=e||[],[i,o]=["header","footer"].map(l=>EO(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 SO(t){const e=yO(t),n=!vO(t)&&!e;return{transition:e,externalComponent:n,tag:n?Ck(t):e?Sk:t}}function TO({$slots:t,tag:e,realList:n,getKey:r}){const i=CO({$slots:t,realList:n,getKey:r}),o=SO(e);return new xO({nodes:i,root:o,realList:n})}function Py(t,e){kr(()=>this.$emit(t.toLowerCase(),e))}function Fy(t){return(e,n)=>{if(this.realList!==null)return this[`onDrag${t}`](e,n)}}function OO(t){const e=Fy.call(this,t);return(n,r)=>{e.call(this,n,r),Py.call(this,t,n)}}let rc=null;const AO={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}},MO=["update:modelValue","change",...[...pd.manageAndEmit,...pd.emit].map(t=>t.toLowerCase())],Ly=Q({name:"draggable",inheritAttrs:!1,props:AO,emits:MO,data(){return{error:!1}},render(){try{this.error=!1;const{$slots:t,$attrs:e,tag:n,componentData:r,realList:i,getKey:o}=this,s=TO({$slots:t,tag:n,realList:i,getKey:o});this.componentStructure=s;const a=bO({$attrs:e,componentData:r});return s.render(ns,a)}catch(t){return this.error=!0,ns("pre",{style:{color:"red"}},t.stack)}},created(){this.list!==null&&this.modelValue!==null&&cO.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=kO({$attrs:t,callBackBuilder:{manageAndEmit:o=>OO.call(this,o),emit:o=>Py.bind(this,o),manage:o=>Fy.call(this,o)}}),i=e.nodeType===1?e:e.parentElement;this._sortable=new te(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&&Ry(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){kr(()=>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),rc=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(Ff(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),Ff(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(rc)!==-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(){rc=null}}}),_O={key:0,class:"k-media__label-wrapper"},DO={key:1,class:"k-media__sublabel"},TL=Q({__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=X(null),o=I(()=>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=I({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=I(()=>n.types.map(p=>typeof p=="string"?PT[p]:p).filter(Boolean));Ee(()=>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&&kr(()=>{l()})}function c(p){r("update:modelValue",n.multiple?[...n.modelValue||[],p]:p),kr(()=>l(s.value.find(f=>f.url===p.url)))}function d(p){r("update:modelValue",p)}const h=rn("k-media",{variants:{placement:{outside:"k-media--placement-outside",inside:"k-media--placement-inside"}}});return(p,f)=>(E(),O("div",{class:Ce(B(h)({placement:p.placement}))},[p.label||p.sublabel||p.$slots.sublabel||p.$slots.label?(E(),O("div",_O,[p.label||p.$slots.label?(E(),O("label",{key:0,class:Ce(["k-media__label",{"k-media__label-required":p.required}])},[F(p.$slots,"label",{},()=>[$e(oe(p.label),1)])],2)):R("",!0),p.sublabel||p.$slots.sublabel?(E(),O("span",DO,[F(p.$slots,"sublabel",{},()=>[$e(oe(p.sublabel),1)])])):R("",!0)])):R("",!0),he(_T,{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},Cs({default:Z(({openFileWindow:m})=>[he(yT,{onOpenFileWindow:m,ref:"typeSelector",value:a.value,onAdd:c,labels:p.labels,upload:p.upload},null,8,["onOpenFileWindow","value","labels","upload"])]),"drop-message":Z(()=>[F(p.$slots,"drop-message")]),"custom-message":Z(()=>[F(p.$slots,"custom-message")]),_:2},[i.value?{name:"preview",fn:Z(()=>[p.description&&o.value?(E(),$(bT,{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"])):R("",!0),(E(),$(Qe(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"]),F(p.$slots,"bottom"),p.multiple?(E(),$(B(Ly),{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,onEnd:f[2]||(f[2]=(m,g)=>{i.value=s.value[m.newIndex]})},{item:Z(({element:m,index:g})=>[(E(),$(mT,{onKeydown:op(y=>i.value=m,["enter"]),tabindex:"0",size:p.thumbnailSize,key:m.url,value:m,disabled:p.disabled,onClick:y=>i.value=m,onDelete:y=>u(m)},null,8,["onKeydown","size","value","disabled","onClick","onDelete"]))]),_:1},8,["modelValue","sort"])):R("",!0)],2))}});var NO=Ln("switch").parts("root","label","control","thumb"),aa=NO.build(),Vy=t=>{var e;return((e=t.ids)==null?void 0:e.root)??`switch:${t.id}`},Bf=t=>{var e;return((e=t.ids)==null?void 0:e.label)??`switch:${t.id}:label`},IO=t=>{var e;return((e=t.ids)==null?void 0:e.thumb)??`switch:${t.id}:thumb`},RO=t=>{var e;return((e=t.ids)==null?void 0:e.control)??`switch:${t.id}:control`},hd=t=>{var e;return((e=t.ids)==null?void 0:e.hiddenInput)??`switch:${t.id}:input`},PO=t=>t.getById(Vy(t)),Do=t=>t.getById(hd(t));function FO(t,e){const{context:n,send:r,prop:i,scope:o}=t,s=i("disabled"),a=i("readOnly"),l=!!n.get("checked"),u=!s&&n.get("focused"),c=!s&&n.get("focusVisible"),d={"data-active":G(n.get("active")),"data-focus":G(u),"data-focus-visible":G(c),"data-readonly":G(a),"data-hover":G(n.get("hovered")),"data-disabled":G(s),"data-state":l?"checked":"unchecked","data-invalid":G(i("invalid"))};return{checked:l,disabled:s,focused:u,setChecked(h){r({type:"CHECKED.SET",checked:h,isTrusted:!1})},toggleChecked(){r({type:"CHECKED.TOGGLE",checked:l,isTrusted:!1})},getRootProps(){return e.label({...aa.root.attrs,...d,dir:i("dir"),id:Vy(o),htmlFor:hd(o),onPointerMove(){s||r({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){s||r({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(h){s||ct(h)===Do(o)&&h.stopPropagation()}})},getLabelProps(){return e.element({...aa.label.attrs,...d,dir:i("dir"),id:Bf(o)})},getThumbProps(){return e.element({...aa.thumb.attrs,...d,dir:i("dir"),id:IO(o),"aria-hidden":!0})},getControlProps(){return e.element({...aa.control.attrs,...d,dir:i("dir"),id:RO(o),"aria-hidden":!0})},getHiddenInputProps(){return e.input({id:hd(o),type:"checkbox",required:i("required"),defaultChecked:l,disabled:s,"aria-labelledby":Bf(o),"aria-invalid":i("invalid"),name:i("name"),form:i("form"),value:i("value"),style:bp,onFocus(){const h=is();r({type:"CONTEXT.SET",context:{focused:!0,focusVisible:h}})},onBlur(){r({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(h){if(a){h.preventDefault();return}const p=h.currentTarget.checked;r({type:"CHECKED.SET",checked:p,isTrusted:!0})}})}}}var{not:$f}=eu(),LO={props({props:t}){return{defaultChecked:!1,label:"switch",value:"on",...t}},initialState(){return"ready"},context({prop:t,bindable:e}){return{checked:e(()=>({defaultValue:t("defaultChecked"),value:t("checked"),onChange(n){var r;(r=t("onCheckedChange"))==null||r({checked:n})}})),fieldsetDisabled:e(()=>({defaultValue:!1})),focusVisible:e(()=>({defaultValue:!1})),active:e(()=>({defaultValue:!1})),focused:e(()=>({defaultValue:!1})),hovered:e(()=>({defaultValue:!1}))}},computed:{isDisabled:({context:t,prop:e})=>e("disabled")||t.get("fieldsetDisabled")},watch({track:t,prop:e,context:n,action:r}){t([()=>e("disabled")],()=>{r(["removeFocusIfNeeded"])}),t([()=>n.get("checked")],()=>{r(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:$f("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:$f("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},states:{ready:{}},implementations:{guards:{isTrusted:({event:t})=>!!t.isTrusted},effects:{trackPressEvent({computed:t,scope:e,context:n}){if(!t("isDisabled"))return pv({pointerNode:PO(e),keyboardNode:Do(e),isValidKey:r=>r.key===" ",onPress:()=>n.set("active",!1),onPressStart:()=>n.set("active",!0),onPressEnd:()=>n.set("active",!1)})},trackFocusVisible({computed:t,scope:e}){if(!t("isDisabled"))return kp({root:e.getRootNode()})},trackFormControlState({context:t,send:e,scope:n}){return Yl(Do(n),{onFieldsetDisabledChange(r){t.set("fieldsetDisabled",r)},onFormReset(){const r=t.initial("checked");e({type:"CHECKED.SET",checked:!!r,src:"form-reset"})}})}},actions:{setContext({context:t,event:e}){for(const n in e.context)t.set(n,e.context[n])},syncInputElement({context:t,scope:e}){const n=Do(e);n&&mp(n,!!t.get("checked"))},removeFocusIfNeeded({context:t,prop:e}){e("disabled")&&t.set("focused",!1)},setChecked({context:t,event:e}){t.set("checked",e.checked)},toggleChecked({context:t}){t.set("checked",!t.get("checked"))},dispatchChangeEvent({context:t,scope:e}){const n=Do(e);gp(n,{checked:t.get("checked")})}}}};Wn()(["checked","defaultChecked","dir","disabled","form","getRootNode","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]);const VO={class:"k-switch__label"},OL=Q({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},getRootNode:{type:Function},labels:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=pi(LO,{id:Qt(),...n,defaultChecked:n.modelValue,onCheckedChange:({checked:s})=>r("update:modelValue",s)}),o=I(()=>FO(i,di));return Ee(()=>n.modelValue,()=>{if(o.value.checked!==n.modelValue)return o.value.setChecked(n.modelValue)}),(s,a)=>(E(),O("label",ne({class:"k-switch"},o.value.getRootProps()),[z("input",be(Ie(o.value.getHiddenInputProps())),null,16),z("span",be(Ie(o.value.getControlProps())),[z("span",be(Ie(o.value.getThumbProps())),null,16)],16),s.labels||s.$slots.default?(E(),O("span",be(ne({key:0},o.value.getLabelProps())),[z("span",VO,[F(s.$slots,"default",{checked:o.value.checked},()=>[$e(oe(o.value.checked?s.labels.on:s.labels.off),1)])])],16)):R("",!0)],16))}}),AL=Q({__name:"LazyLoad",props:{wrapperTag:{default:"div"},threshold:{default:0},observerRoot:{default:null}},emits:["intersect"],setup(t,{emit:e}){const n=t,r=e,i=X(!1);function o(u){const c=u[0];c.isIntersecting&&(i.value=!0,kr(()=>{r("intersect",c),l()}))}const s=X(),a=X();qn(()=>{s.value=new IntersectionObserver(o,{root:n.observerRoot,threshold:n.threshold}),s.value.observe(a.value)}),ao(()=>{l()});function l(){s.value&&s.value.disconnect()}return(u,c)=>(E(),$(Qe(u.wrapperTag),{ref_key:"rootRef",ref:a,class:"k-lazyload"},{default:Z(()=>[i.value?F(u.$slots,"default",{key:0}):F(u.$slots,"placeholder",{key:1})]),_:3},512))}}),BO={class:"k-file-uploader__bar"},$O={class:"k-file-uploader__meta"},jO={key:0},zO={key:1},HO=Q({__name:"Uploader",props:{value:{},bytes:{},current:{default:1},total:{default:1}},setup(t){const e=t,n=I(()=>e.total>1),r=I(()=>Np(e.bytes)),i=I(()=>Math.floor(e.value));return(o,s)=>(E(),$(ni,{class:"k-file-uploader",align:"center",justify:"space-between",gap:"0rem"},{default:Z(()=>[z("div",null,oe(i.value)+" %",1),z("div",BO,[z("div",{class:"k-file-uploader__bar-value",style:Cr({width:o.value+"%"})},null,4)]),z("div",$O,[n.value?(E(),O("div",jO,oe(o.current)+" / "+oe(o.total),1)):R("",!0),o.bytes?(E(),O("div",zO,"("+oe(r.value)+")",1)):R("",!0)])]),_:1}))}}),qO=["innerHTML"],jf=Q({__name:"SlotHandler",props:{value:{}},setup(t){const e=t,n=I(()=>typeof e.value=="string"?e.value:void 0),r=I(()=>typeof e.value=="string"?"div":e.value);return(i,o)=>(E(),$(Qe(r.value),be(Ie(i.$attrs)),{default:Z(()=>[n.value?(E(),O("span",{key:0,innerHTML:n.value},null,8,qO)):R("",!0)]),_:1},16))}}),WO={class:"k-file-droparea__instruction"},UO=["accept","required","disabled","multiple"],KO={key:0,class:"k-file-droparea__max-size"},GO=Q({__name:"DropArea",props:{value:{},multiple:{type:Boolean},upload:{},uploadOptions:{},accept:{},dropMessage:{},fileSizeError:{},disabled:{type:Boolean},required:{type:Boolean},rename:{type:Boolean},labels:{}},emits:["input"],setup(t,{emit:e}){const n=t,r=e,i=X(!1),o=X(!0),s=X(),a=X(!1),l=I(()=>!!n.required),u=I(()=>n.disabled),c=I(()=>!u.value&&!p.total),d=I(()=>hT(n.accept)),{run:h,queue:p}=new my(n);function f(C){return h(C).then(N=>{!N||!N.length||r("input",n.multiple?[...n.value||[],...N]:N[0])})}function m(C){if(!C)return 0;const N={bytes:1,b:1,kb:1024,mb:1024**2,gb:1024**3,tb:1024**4,pb:1024**5},A=C.trim().toLowerCase().match(/^([\d.]+)\s*(bytes|b|kb|mb|gb|tb|pb)$/);if(!A)throw new Error("Invalid size format");const S=parseFloat(A[1]),_=A[2];return Math.round(S*N[_])}function g(){return o.value=!1,a.value=!0,setTimeout(()=>{w()},1500)}function y(C=0){return m(n.uploadOptions.maxSize)<C}async function b(C){if(u.value)return;let N=C.target.files||[];if(Array.from(N).some(A=>y(A.size))&&n.uploadOptions.maxSize)return g();n.uploadOptions.preTransform&&(N=await n.uploadOptions.preTransform(C)),f(N),s.value&&(s.value.value="")}async function k(C){var N;if(u.value||!s.value)return;C.preventDefault();let A=(N=C.dataTransfer)==null?void 0:N.files;if(A!=null&&A.length){if(Array.from(A).some(S=>y(S.size))&&n.uploadOptions.maxSize)return g();if(!o.value)return w();w(),n.uploadOptions.preTransform&&(A=await n.uploadOptions.preTransform(C)),A!=null&&A.length&&(s.value.files=C.dataTransfer.files,s.value.dispatchEvent(new InputEvent("input")),f(A))}}function v(C){if(u.value||!C.dataTransfer)return;const N=Array.from(C.dataTransfer.items).every(S=>Ip(S,n.accept)),A=n.multiple?!0:C.dataTransfer.items.length===1;o.value=N&&A,i.value=!0,C.preventDefault()}function w(){o.value=!0,i.value=!1,a.value=!1}const x=rn("k-file-droparea",{variants:{active:{true:"k-file-droparea--active"},invalid:{true:"k-file-droparea--invalid"},disabled:{true:"k-file-droparea--disabled"}}});return(C,N)=>(E(),O(De,null,[z("div",{class:Ce(B(x)({active:i.value,invalid:!o.value,disabled:u.value})),onDrop:k,onDragover:v,onDragleave:w},[F(C.$slots,"preview"),z("div",WO,[c.value?(E(),O("input",{key:0,type:"file",accept:Array.isArray(C.accept)?C.accept.join(","):C.accept,required:l.value,ref_key:"input",ref:s,onChange:b,disabled:!c.value,multiple:C.multiple,class:"k-file-droparea__input"},null,40,UO)):R("",!0),o.value?(E(),O(De,{key:1},[F(C.$slots,"drop-message",{extensions:d.value},()=>[he(jf,{value:C.dropMessage,extensions:d.value},null,8,["value","extensions"])]),n.uploadOptions.maxSize?(E(),O("div",KO,[z("span",null,oe(`${C.labels.maxSize}: ${n.uploadOptions.maxSize}`),1)])):R("",!0)],64)):(E(),$(B(Ze),{key:2,icon:"fa-pro-light:ban",style:{"font-size":"2rem"}})),a.value?F(C.$slots,"file-size-error",{key:3,extensions:d.value},()=>[he(jf,{class:"k-file-droparea__file-size-error",value:C.fileSizeError,extensions:d.value},null,8,["value","extensions"])]):R("",!0),F(C.$slots,"custom-message")])],34),B(p).total?(E(),$(HO,{key:0,value:B(p).progress,bytes:B(p).bytes,current:B(p).counter,total:B(p).total},null,8,["value","bytes","current","total"])):R("",!0)],64))}}),JO=Os?window:void 0;function XO(t){var e;const n=He(t);return(e=n?.$el)!=null?e:n}function YO(...t){const e=[],n=()=>{e.forEach(a=>a()),e.length=0},r=(a,l,u,c)=>(a.addEventListener(l,u,c),()=>a.removeEventListener(l,u,c)),i=I(()=>{const a=Gr(He(t[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),o=Av(()=>{var a,l;return[(l=(a=i.value)==null?void 0:a.map(u=>XO(u)))!=null?l:[JO].filter(u=>u!=null),Gr(He(i.value?t[1]:t[0])),Gr(B(i.value?t[2]:t[1])),He(i.value?t[3]:t[2])]},([a,l,u,c])=>{if(n(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(u!=null&&u.length))return;const d=Ov(c)?{...c}:c;e.push(...a.flatMap(h=>l.flatMap(p=>u.map(f=>r(h,p,f,d)))))},{flush:"post"}),s=()=>{o(),n()};return Ts(n),s}const ZO=Q({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(t,{slots:e}){const n=sp(K1(t));return()=>{var r;return(r=e.default)==null?void 0:r.call(e,n)}}});function ic(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function By(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:By(n)}}function QO(t){const e=t||window.event,n=e.target;return By(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const oc=new WeakMap;function eA(t,e=!1){const n=qt(e);let r=null,i="";Ee(z1(t),a=>{const l=ic(He(a));if(l){const u=l;if(oc.get(u)||oc.set(u,u.style.overflow),u.style.overflow!=="hidden"&&(i=u.style.overflow),u.style.overflow==="hidden")return n.value=!0;if(n.value)return u.style.overflow="hidden"}},{immediate:!0});const o=()=>{const a=ic(He(t));!a||n.value||(Qh&&(r=YO(a,"touchmove",l=>{QO(l)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},s=()=>{const a=ic(He(t));!a||!n.value||(Qh&&r?.(),a.style.overflow=i,oc.delete(a),n.value=!1)};return Ts(s),I({get(){return n.value},set(a){a?o():s()}})}function tA(){let t=!1;const e=qt(!1);return(n,r)=>{if(e.value=r.value,t)return;t=!0;const i=eA(n,r.value);Ee(e,o=>i.value=o)}}tA();var nA=Ln("toggle-group").parts("root","item"),zf=nA.build(),nl=t=>{var e;return((e=t.ids)==null?void 0:e.root)??`toggle-group:${t.id}`},rA=(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}`},$y=t=>t.getById(nl(t)),vu=t=>{const e=`[data-ownedby='${CSS.escape(nl(t))}']:not([data-disabled])`;return yp($y(t),e)},Hf=t=>yv(vu(t)),iA=t=>bv(vu(t)),oA=(t,e,n)=>Nx(vu(t),e,n),sA=(t,e,n)=>Ix(vu(t),e,n);function aA(t,e){const{context:n,send:r,prop:i,scope:o}=t,s=n.get("value"),a=i("disabled"),l=!i("multiple"),u=i("rovingFocus"),c=i("orientation")==="horizontal";function d(h){const p=rA(o,h.value);return{id:p,disabled:!!(h.disabled||a),pressed:!!s.includes(h.value),focused:n.get("focusedId")===p}}return{value:s,setValue(h){r({type:"VALUE.SET",value:h})},getRootProps(){return e.element({...zf.root.attrs,id:nl(o),dir:i("dir"),role:l?"radiogroup":"group",tabIndex:n.get("isTabbingBackward")?-1:0,"data-disabled":G(a),"data-orientation":i("orientation"),"data-focus":G(n.get("focusedId")!=null),style:{outline:"none"},onMouseDown(){a||r({type:"ROOT.MOUSE_DOWN"})},onFocus(h){a||h.currentTarget===ct(h)&&(n.get("isClickFocus")||n.get("isTabbingBackward")||r({type:"ROOT.FOCUS"}))},onBlur(){a||r({type:"ROOT.BLUR"})}})},getItemState:d,getItemProps(h){const p=d(h),f=p.focused?0:-1;return e.button({...zf.item.attrs,id:p.id,type:"button","data-ownedby":nl(o),"data-focus":G(p.focused),disabled:p.disabled,tabIndex:u?f:void 0,role:l?"radio":void 0,"aria-checked":l?p.pressed:void 0,"aria-pressed":l?void 0:p.pressed,"data-disabled":G(p.disabled),"data-orientation":i("orientation"),dir:i("dir"),"data-state":p.pressed?"on":"off",onFocus(){p.disabled||r({type:"TOGGLE.FOCUS",id:p.id})},onClick(m){p.disabled||(r({type:"TOGGLE.CLICK",id:p.id,value:h.value}),ix()&&m.currentTarget.focus({preventScroll:!0}))},onKeyDown(m){if(m.defaultPrevented||!ax(m)||p.disabled)return;const g={Tab(y){const b=y.shiftKey;r({type:"TOGGLE.SHIFT_TAB",isShiftTab:b})},ArrowLeft(){!u||!c||r({type:"TOGGLE.FOCUS_PREV"})},ArrowRight(){!u||!c||r({type:"TOGGLE.FOCUS_NEXT"})},ArrowUp(){!u||c||r({type:"TOGGLE.FOCUS_PREV"})},ArrowDown(){!u||c||r({type:"TOGGLE.FOCUS_NEXT"})},Home(){u&&r({type:"TOGGLE.FOCUS_FIRST"})},End(){u&&r({type:"TOGGLE.FOCUS_LAST"})}}[ov(m)];g&&(g(m),m.key!=="Tab"&&m.preventDefault())}})}}}var{not:qf,and:lA}=eu(),uA={props({props:t}){return{defaultValue:[],orientation:"horizontal",rovingFocus:!0,loopFocus:!0,...t}},initialState(){return"idle"},context({prop:t,bindable:e}){return{value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),onChange(n){var r;(r=t("onValueChange"))==null||r({value:n})}})),focusedId:e(()=>({defaultValue:null})),isTabbingBackward:e(()=>({defaultValue:!1})),isClickFocus:e(()=>({defaultValue:!1})),isWithinToolbar:e(()=>({defaultValue:!1}))}},computed:{currentLoopFocus:({context:t,prop:e})=>e("loopFocus")&&!t.get("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:qf(lA("isClickFocus","isTabbingBackward")),actions:["focusFirstToggle","clearClickFocus"]},"TOGGLE.FOCUS":{target:"focused",actions:["setFocusedId"]}}},focused:{on:{"ROOT.BLUR":{target:"idle",actions:["clearIsTabbingBackward","clearFocusedId"]},"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":[{guard:qf("isFirstToggleFocused"),target:"idle",actions:["setIsTabbingBackward"]},{actions:["setIsTabbingBackward"]}]}}},implementations:{guards:{isClickFocus:({context:t})=>t.get("isClickFocus"),isTabbingBackward:({context:t})=>t.get("isTabbingBackward"),isFirstToggleFocused:({context:t,scope:e})=>{var n;return t.get("focusedId")===((n=Hf(e))==null?void 0:n.id)}},actions:{setIsTabbingBackward({context:t}){t.set("isTabbingBackward",!0)},clearIsTabbingBackward({context:t}){t.set("isTabbingBackward",!1)},setClickFocus({context:t}){t.set("isClickFocus",!0)},clearClickFocus({context:t}){t.set("isClickFocus",!1)},checkIfWithinToolbar({context:t,scope:e}){var n;const r=(n=$y(e))==null?void 0:n.closest("[role=toolbar]");t.set("isWithinToolbar",!!r)},setFocusedId({context:t,event:e}){t.set("focusedId",e.id)},clearFocusedId({context:t}){t.set("focusedId",null)},setValue({context:t,event:e,prop:n}){h1(e,["value"]);let r=t.get("value");Zx(e.value)?r=e.value:n("multiple")?r=Xx(r,e.value):r=Ss(r,[e.value])?[]:[e.value],t.set("value",r)},focusNextToggle({context:t,scope:e,prop:n}){At(()=>{var r;const i=t.get("focusedId");i&&((r=oA(e,i,n("loopFocus")))==null||r.focus({preventScroll:!0}))})},focusPrevToggle({context:t,scope:e,prop:n}){At(()=>{var r;const i=t.get("focusedId");i&&((r=sA(e,i,n("loopFocus")))==null||r.focus({preventScroll:!0}))})},focusFirstToggle({scope:t}){At(()=>{var e;(e=Hf(t))==null||e.focus({preventScroll:!0})})},focusLastToggle({scope:t}){At(()=>{var e;(e=iA(t))==null||e.focus({preventScroll:!0})})}}}};Wn()(["dir","disabled","getRootNode","id","ids","loopFocus","multiple","onValueChange","orientation","rovingFocus","value","defaultValue"]);Wn()(["value","disabled"]);const jy=Q({__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=t,r=e,i=pi(uA,{id:Qt(),...n,orientation:n.direction,defaultValue:n.modelValue,onValueChange:({value:a})=>{r("update:modelValue",a)},rovingFocus:!0,loopFocus:!0}),o=I(()=>aA(i,di)),s=X();return Ee(()=>{var a;return(a=s.value)==null?void 0:a.isOpen},a=>{a||!o.value.value.includes("dropdown")||o.value.setValue(o.value.value.filter(l=>l!=="dropdown"))}),Ee(()=>n.modelValue,a=>{o.value.setValue([...a])},{deep:!1}),(a,l)=>(E(),O("div",ne({class:["k-buttongroup",`k-buttongroup--direction-${a.direction}`]},o.value.getRootProps()),[F(a.$slots,"default",{getItemProps:o.value.getItemProps},()=>[a.items?(E(!0),O(De,{key:0},_t(a.items,({id:u,...c})=>(E(),$(ze,ne({class:"k-buttongroup__item",variant:"tertiary",ref_for:!0},{...c,...o.value.getItemProps({value:u})}),null,16))),256)):R("",!0)]),a.dropdownItems||a.$slots.dropdown?(E(),$(pu,ne({key:0,ref_key:"dropdown",ref:s,keepOpen:!0,items:a.dropdownItems},o.value.getItemProps({value:"dropdown"})),{default:Z(({close:u})=>[F(a.$slots,"dropdown",{close:u,getItemProps:o.value.getItemProps})]),_:3},16,["items"])):R("",!0)],16))}}),cA=["href"],dA={class:"k-file-thumbnail__info"},pA=["value","disabled"],hA={class:"k-file-thumbnail__info-footer"},fA={key:0,class:"k-file-thumbnail__size"},mA=Q({__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=I(()=>{let p=[...n,...r.icons].find(f=>r.value.type.match(f.pattern));return p?.icon||"fa-pro-solid:file"}),o=I(()=>r.disabled?"a":"div"),s=I(()=>r.disabled?{click:p=>{p.preventDefault(),ad(r.value)}}:{}),a=I(()=>r.disabled?{title:r.disabled?"Download":null}:{});function l(){r.disabled||ad(r.value)}const u=X(),c=X([]),d=X();function h(){var p;(p=u.value)==null||p.blur()}return(p,f)=>(E(),$(Qe(o.value),ne({class:["k-file-thumbnail",{"k-file-thumbnail--clickable":p.disabled}]},a.value,Bg(s.value)),{default:Z(()=>[he(ni,{class:"k-file-thumbnail__preview",gap:"0rem",justify:"center",align:"center"},{default:Z(()=>[F(p.$slots,"icon",{},()=>[p.value.type.includes("image")?(E(),O("a",{key:0,href:p.value.url,target:"_blank"},[he(au,{class:"k-file-thumbnail__preview-image",src:p.value.url,alt:p.value.name,size:"contain",aspectRatio:"1/1"},null,8,["src","alt"])],8,cA)):(E(),$(B(Ze),{key:1,icon:i.value,class:"k-file-thumbnail__preview-icon"},null,8,["icon"]))])]),_:3}),z("div",dA,[z("input",{type:"text",ref_key:"input",ref:u,class:"k-file-thumbnail__name",value:p.value.name,onKeypress:op(h,["enter"]),disabled:p.disabled||!p.rename,onInput:f[0]||(f[0]=m=>p.$emit("rename",m.target.value))},null,40,pA),z("div",hA,[p.value.size?(E(),O("span",fA,oe(B(Np)(p.value.size)),1)):R("",!0)])]),he(jy,{modelValue:c.value,"onUpdate:modelValue":f[2]||(f[2]=m=>{c.value=m.filter(g=>g!=="download")}),disabled:p.disabled},{default:Z(({getItemProps:m})=>[p.value.url?(E(),$(ze,ne({key:0,is:"a",href:p.value.url,class:"k-file-thumbnail__download",onClick:Ba(l,["prevent"]),icon:"fa-pro-light:arrow-down-to-line",variant:"tertiary"},m({value:"download"})),null,16,["href"])):R("",!0)]),dropdown:Z(({close:m})=>[p.value.url?(E(),$(ze,{key:0,is:"a",href:p.value.url,class:"k-file-thumbnail__download",onClick:Ba(l,["prevent"]),iconRight:"fa-pro-light:arrow-down-to-line",label:p.labels.download,variant:"tertiary"},null,8,["href","label"])):R("",!0),he(B(ZO),null,{default:Z(({copy:g,copied:y})=>[p.value.url?(E(),$(ze,{key:0,class:"k-file-thumbnail__copy",iconRight:"fa-pro-light:copy",label:p.labels.copy,variant:"tertiary",promise:d.value,onClick:()=>{d.value=g(p.value.url)}},null,8,["label","promise","onClick"])):R("",!0)]),_:1}),p.disabled?R("",!0):(E(),$(ze,{key:1,variant:"danger",label:p.labels.delete,class:"k-file-thumbnail__delete",iconRight:"fa-pro-light:times",onClick:f[1]||(f[1]=g=>p.$emit("delete"))},null,8,["label"]))]),_:1},8,["modelValue","disabled"]),p.sortable?(E(),$(B(Ze),{key:0,icon:"fa-pro-solid:arrows-alt-v",class:"k-file-thumbnail__handle"})):R("",!0)]),_:3},16,["class"]))}}),gA={key:0,class:"k-file__label-wrapper"},vA={key:1,class:"k-file__sublabel"},ML=Q({__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."},fileSizeError:{default:"The file size exceeds the allowed limit."},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",copy:"Copy link",maxSize:"Maximum size"})}},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=I(()=>n.multiple||!n.modelValue),a=I({get(){return n.modelValue?n.modelValue instanceof Array?n.modelValue:[n.modelValue]:[]},set(u){n.multiple&&i(u)}}),l=rn("k-file",{variants:{}});return(u,c)=>(E(),O("div",{class:Ce(B(l)({}))},[u.label||u.sublabel||u.$slots.sublabel||u.$slots.label?(E(),O("div",gA,[u.label||u.$slots.label?(E(),O("label",{key:0,class:Ce(["k-file__label",{"k-file__label-required":u.required}])},[F(u.$slots,"label",{},()=>[$e(oe(u.label),1)])],2)):R("",!0),u.sublabel||u.$slots.sublabel?(E(),O("span",vA,[F(u.$slots,"sublabel",{},()=>[$e(oe(u.sublabel),1)])])):R("",!0)])):R("",!0),he(ni,{direction:"column"},{default:Z(()=>[a.value.length?(E(),$(B(Ly),{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:Z(({element:d,index:h})=>[(E(),$(mA,{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},Cs({_:2},[_t(u.$slots,(p,f)=>({name:f,fn:Z(()=>[F(u.$slots,f,{item:d})])}))]),1032,["disabled","sortable","rename","value","onRename","onDelete","icons","labels"]))]),_:3},8,["modelValue","disabled"])):R("",!0),s.value?(E(),$(GO,{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,fileSizeError:u.fileSizeError,rename:u.rename,labels:u.labels},{"drop-message":Z(({extensions:d})=>[F(u.$slots,"drop-message",{extensions:d})]),"custom-message":Z(()=>[F(u.$slots,"custom-message")]),_:3},8,["accept","value","multiple","required","disabled","upload-options","upload","dropMessage","fileSizeError","rename","labels"])):R("",!0)]),_:3})],2))}}),zy=new Set,yt=new WeakMap,Gi=new WeakMap,ii=new WeakMap,fd=new WeakMap,yA=new WeakMap,Ji=new WeakMap,rl=new WeakMap,No=new WeakSet;let xr,Lp=0,Vp=0;const Rn="__aa_tgt",us="__aa_del",il="__aa_new",bA=t=>{const e=SA(t);e&&e.forEach(n=>TA(n))},kA=t=>{t.forEach(e=>{e.target===xr&&xA(),yt.has(e.target)&&hi(e.target)})};function wA(t){const e=fd.get(t);e?.disconnect();let n=yt.get(t),r=0;const i=5;n||(n=Xi(t),yt.set(t,n));const{offsetWidth:o,offsetHeight:s}=xr,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&&hi(t)},{root:xr,threshold:1,rootMargin:a});l.observe(t),fd.set(t,l)}function hi(t){clearTimeout(rl.get(t));const e=yu(t),n=cs(e)?500:e.duration;rl.set(t,setTimeout(async()=>{const r=ii.get(t);try{await r?.finished,yt.set(t,Xi(t)),wA(t)}catch{}},n))}function xA(){clearTimeout(rl.get(xr)),rl.set(xr,setTimeout(()=>{zy.forEach(t=>Uy(t,e=>Hy(()=>hi(e))))},100))}function EA(t){setTimeout(()=>{yA.set(t,setInterval(()=>Hy(hi.bind(null,t)),2e3))},Math.round(2e3*Math.random()))}function Hy(t){typeof requestIdleCallback=="function"?requestIdleCallback(()=>t()):requestAnimationFrame(()=>t())}let md,Ho;const CA=typeof window<"u"&&"ResizeObserver"in window;CA&&(xr=document.documentElement,md=new MutationObserver(bA),Ho=new ResizeObserver(kA),window.addEventListener("scroll",()=>{Vp=window.scrollY,Lp=window.scrollX}),Ho.observe(xr));function SA(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(sc(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(us in i)return!1;sc(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(us in i)return!1;i instanceof Element&&(e.add(i),sc(n.target,i),Gi.set(i,[n.previousSibling,n.nextSibling]))}}return e},new Set)}function sc(t,e){!e&&!(Rn in t)?Object.defineProperty(t,Rn,{value:t}):e&&!(Rn in e)&&Object.defineProperty(e,Rn,{value:t})}function TA(t){var e;const n=t.isConnected,r=yt.has(t);n&&Gi.has(t)&&Gi.delete(t),ii.has(t)&&((e=ii.get(t))===null||e===void 0||e.cancel()),il in t?Wf(t):r&&n?AA(t):r&&!n?MA(t):Wf(t)}function un(t){return Number(t.replace(/[^0-9.\-]/g,""))}function OA(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 Xi(t){const e=t.getBoundingClientRect(),{x:n,y:r}=OA(t);return{top:e.top+r,left:e.left+n,width:e.width,height:e.height}}function qy(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=un(a.paddingTop)+un(a.paddingBottom)+un(a.borderTopWidth)+un(a.borderBottomWidth),u=un(a.paddingLeft)+un(a.paddingRight)+un(a.borderRightWidth)+un(a.borderLeftWidth);r-=u,o-=u,i-=l,s-=l}return[r,o,i,s].map(Math.round)}function yu(t){return Rn in t&&Ji.has(t[Rn])?Ji.get(t[Rn]):{duration:250,easing:"ease-in-out"}}function Wy(t){if(Rn in t)return t[Rn]}function Bp(t){const e=Wy(t);return e?No.has(e):!1}function Uy(t,...e){e.forEach(n=>n(t,Ji.has(t)));for(let n=0;n<t.children.length;n++){const r=t.children.item(n);r&&e.forEach(i=>i(r,Ji.has(r)))}}function $p(t){return Array.isArray(t)?t:[t]}function cs(t){return typeof t=="function"}function AA(t){const e=yt.get(t),n=Xi(t);if(!Bp(t))return yt.set(t,n);let r;if(!e)return;const i=yu(t);if(typeof i!="function"){const o=e.left-n.left,s=e.top-n.top,[a,l,u,c]=qy(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]=$p(i(t,"remain",e,n));r=new Animation(o),r.play()}ii.set(t,r),yt.set(t,n),r.addEventListener("finish",hi.bind(null,t))}function Wf(t){il in t&&delete t[il];const e=Xi(t);yt.set(t,e);const n=yu(t);if(!Bp(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]=$p(n(t,"add",e));r=new Animation(i),r.play()}ii.set(t,r),r.addEventListener("finish",hi.bind(null,t))}function Uf(t,e){var n;t.remove(),yt.delete(t),Gi.delete(t),ii.delete(t),(n=fd.get(t))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(us in t&&delete t[us],Object.defineProperty(t,il,{value:!0,configurable:!0}),e&&t instanceof HTMLElement)for(const r in e)t.style[r]=""},0)}function MA(t){var e;if(!Gi.has(t)||!yt.has(t))return;const[n,r]=Gi.get(t);Object.defineProperty(t,us,{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=Wy(t))===null||e===void 0||e.appendChild(t),!Bp(t))return Uf(t);const[s,a,l,u]=DA(t),c=yu(t),d=yt.get(t);(i!==Lp||o!==Vp)&&_A(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(!cs(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]=$p(c(t,"remove",d));m?.styleReset!==!1&&(p=m?.styleReset||p,Object.assign(t.style,p)),h=new Animation(f),h.play()}ii.set(t,h),h.addEventListener("finish",Uf.bind(null,t,p))}function _A(t,e,n,r){const i=Lp-e,o=Vp-n,s=document.documentElement.style.scrollBehavior;if(getComputedStyle(xr).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(!cs(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 DA(t){const e=yt.get(t),[n,,r]=qy(t,e,Xi(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=yt.get(i)||Xi(i),a=Math.round(e.top-s.top)-un(o.borderTopWidth),l=Math.round(e.left-s.left)-un(o.borderLeftWidth);return[a,l,n,r]}function NA(t,e={}){return md&&Ho&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!cs(e)&&!e.disrespectUserMotionPreference||(No.add(t),getComputedStyle(t).position==="static"&&Object.assign(t.style,{position:"relative"}),Uy(t,hi,EA,n=>Ho?.observe(n)),cs(e)?Ji.set(t,e):Ji.set(t,{duration:250,easing:"ease-in-out",...e}),md.observe(t,{childList:!0}),zy.add(t))),Object.freeze({parent:t,enable:()=>{No.add(t)},disable:()=>{No.delete(t)},isEnabled:()=>No.has(t)})}const Kf={mounted:(t,e)=>{NA(t,e.value||{})},getSSRProps:()=>({})},IA=["disabled"],RA={key:0,class:"k-expandable__title"},PA={key:1,class:"k-expandable__subtitle"},FA={key:2,class:"k-expandable__actions"},_L=Q({__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=ip(),r=I(()=>n.actions),i=I(()=>n.footer),o=I(()=>n.default),s=X(e.expanded),a=()=>{!e.expandable||!o.value||(s.value=!s.value)},l=rn("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)=>Va((E(),O("fieldset",{disabled:u.disabled,class:Ce(B(l)({disabled:u.disabled,expandable:u.expandable,expanded:s.value,variant:u.variant}))},[he(ze,{class:Ce(["k-expandable__header",{"k-expandable__header--open":s.value}]),is:"legend",tabindex:"0",onKeydown:op(a,["enter"]),onClick:a,variant:"tertiary"},Cs({default:Z(()=>[u.$slots.title||u.title?(E(),O("span",RA,[F(u.$slots,"title",{},()=>[$e(oe(u.title),1)])])):R("",!0),u.$slots.subtitle||u.subtitle?(E(),O("span",PA,[F(u.$slots,"subtitle",{},()=>[$e(oe(u.subtitle),1)])])):R("",!0),r.value?(E(),O("span",FA,[F(u.$slots,"actions")])):R("",!0)]),_:2},[u.expandable?{name:"icon-left",fn:Z(()=>[he(B(Ze),{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(),O(De,{key:0},[Va((E(),$(ni,{class:"k-expandable__content",direction:"column",gap:u.gap},{default:Z(()=>[F(u.$slots,"default")]),_:3},8,["gap"])),[[B(Kf)]]),i.value?(E(),$(ni,{key:0,justify:"center",align:"center",class:"k-expandable__footer"},{default:Z(()=>[F(u.$slots,"footer")]),_:3})):R("",!0)],64)):R("",!0)],10,IA)),[[B(Kf)]])}});function Je(t){this.content=t}Je.prototype={constructor:Je,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 Je(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 Je(n)},addToStart:function(t,e){return new Je([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Je(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 Je(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=Je.from(t),t.size?new Je(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Je.from(t),t.size?new Je(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Je.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}};Je.from=function(t){if(t instanceof Je)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Je(e)};function Ky(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=Ky(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Gy(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=Gy(s.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class M{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 M(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 M(r,i)}cutByIndex(e,n){return e==n?M.empty:e==0&&n==this.content.length?this:new M(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 M(i,o)}addToStart(e){return new M([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new M(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 Ky(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Gy(this,e,n,r)}findIndex(e,n=-1){if(e==0)return la(0,e);if(e==this.size)return la(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?la(r+1,s):la(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 M.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new M(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return M.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 M(n||e,r)}static from(e){if(!e)return M.empty;if(e instanceof M)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new M([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}M.empty=new M([],0);const ac={index:0,offset:0};function la(t,e){return ac.index=t,ac.offset=e,ac}function ol(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(!ol(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ol(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ke=class gd{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&&ol(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 gd.none;if(e instanceof gd)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ke.none=[];class sl 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=Xy(this.content,e+this.openStart,n);return r&&new V(r,this.openStart,this.openEnd)}removeBetween(e,n){return new V(Jy(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(M.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(M.empty,0,0);function Jy(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(Jy(o.content,e-i-1,n-i-1)))}function Xy(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=Xy(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function LA(t,e,n){if(n.openStart>t.depth)throw new sl("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new sl("Inconsistent open depths");return Yy(t,e,n,0)}function Yy(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=Yy(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 Xr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=VA(n,t);return Xr(o,Qy(t,s,a,e,r))}else return Xr(o,al(t,e,r))}function Zy(t,e){if(!e.type.compatibleContent(t.type))throw new sl("Cannot join "+e.type.name+" onto "+t.type.name)}function vd(t,e,n){let r=t.node(n);return Zy(r,e.node(n)),r}function Jr(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 qo(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&&(Jr(t.nodeAfter,r),o++));for(let a=o;a<s;a++)Jr(i.child(a),r);e&&e.depth==n&&e.textOffset&&Jr(e.nodeBefore,r)}function Xr(t,e){return t.type.checkContent(e),t.copy(e)}function Qy(t,e,n,r,i){let o=t.depth>i&&vd(t,e,i+1),s=r.depth>i&&vd(n,r,i+1),a=[];return qo(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(Zy(o,s),Jr(Xr(o,Qy(t,e,n,r,i+1)),a)):(o&&Jr(Xr(o,al(t,e,i+1)),a),qo(e,n,i,a),s&&Jr(Xr(s,al(n,r,i+1)),a)),qo(r,null,i,a),new M(a)}function al(t,e,n){let r=[];if(qo(null,t,n,r),t.depth>n){let i=vd(t,e,n+1);Jr(Xr(i,al(t,e,n+1)),r)}return qo(e,null,n,r),new M(r)}function VA(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(M.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class ds{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 ke.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 ll(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 ds(n,r,o)}static resolveCached(e,n){let r=Gf.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 Gf.set(e,r=new BA);let i=r.elts[r.i]=ds.resolve(e,n);return r.i=(r.i+1)%$A,i}}class BA{constructor(){this.elts=[],this.i=0}}const $A=12,Gf=new WeakMap;class ll{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 jA=Object.create(null);let fr=class yd{constructor(e,n,r,i=ke.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||M.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&&ol(this.attrs,n||e.defaultAttrs||jA)&&ke.sameSet(this.marks,r||ke.none)}copy(e=null){return e==this.content?this:new yd(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new yd(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 LA(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 ds.resolveCached(this,e)}resolveNoCache(e){return ds.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()+")"),eb(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=M.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=ke.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(!ke.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=M.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};fr.prototype.text=void 0;class ul extends fr{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):eb(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 ul(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ul(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 eb(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class oi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new zA(e,n);if(r.next==null)return oi.empty;let i=tb(r);r.next&&r.err("Unexpected trailing text");let o=JA(GA(i));return XA(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 M.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(`
8
+ */function Of(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 wn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Of(Object(n),!0).forEach(function(r){FT(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Of(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ta(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ta=function(e){return typeof e}:Ta=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ta(t)}function FT(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jn(){return jn=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},jn.apply(this,arguments)}function LT(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 VT(t,e){if(t==null)return{};var n=LT(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 BT="1.14.0";function Vn(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Un=Vn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ms=Vn(/Edge/i),Af=Vn(/firefox/i),Vo=Vn(/safari/i)&&!Vn(/chrome/i)&&!Vn(/android/i),vy=Vn(/iP(ad|od|hone)/i),$T=Vn(/chrome/i)&&Vn(/android/i),yy={capture:!1,passive:!1};function ve(t,e,n){t.addEventListener(e,n,!Un&&yy)}function me(t,e,n){t.removeEventListener(e,n,!Un&&yy)}function Ya(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 jT(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function hn(t,e,n,r){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&Ya(t,e):Ya(t,e))||r&&t===n)return t;if(t===n)break}while(t=jT(t))}return null}var Mf=/\s+/g;function Et(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(Mf," ").replace(" "+e+" "," ");t.className=(r+(n?" "+e:"")).replace(Mf," ")}}function ee(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 Vi(t,e){var n="";if(typeof t=="string")n=t;else do{var r=ee(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 by(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 yn(){var t=document.scrollingElement;return t||document.documentElement}function Be(t,e,n,r,i){if(!(!t.getBoundingClientRect&&t!==window)){var o,s,a,l,u,c,d;if(t!==window&&t.parentNode&&t!==yn()?(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,!Un))do if(i&&i.getBoundingClientRect&&(ee(i,"transform")!=="none"||n&&ee(i,"position")!=="static")){var h=i.getBoundingClientRect();s-=h.top+parseInt(ee(i,"border-top-width")),a-=h.left+parseInt(ee(i,"border-left-width")),l=s+o.height,u=a+o.width;break}while(i=i.parentNode);if(r&&t!==window){var p=Vi(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 _f(t,e,n){for(var r=sr(t,!0),i=Be(t)[e];r;){var o=Be(r)[n],s=void 0;if(s=i>=o,!s)return r;if(r===yn())break;r=sr(r,!1)}return!1}function Ki(t,e,n,r){for(var i=0,o=0,s=t.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==te.ghost&&(r||s[o]!==te.dragged)&&hn(s[o],n.draggable,t,!1)){if(i===e)return s[o];i++}o++}return null}function Rp(t,e){for(var n=t.lastElementChild;n&&(n===te.ghost||ee(n,"display")==="none"||e&&!Ya(n,e));)n=n.previousElementSibling;return n||null}function Lt(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==te.clone&&(!e||Ya(t,e))&&n++;return n}function Df(t){var e=0,n=0,r=yn();if(t)do{var i=Vi(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 zT(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 sr(t,e){if(!t||!t.getBoundingClientRect)return yn();var n=t,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=ee(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 yn();if(r||e)return n;r=!0}}while(n=n.parentNode);return yn()}function HT(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Ku(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 Bo;function ky(t,e){return function(){if(!Bo){var n=arguments,r=this;n.length===1?t.call(r,n[0]):t.apply(r,n),Bo=setTimeout(function(){Bo=void 0},e)}}}function qT(){clearTimeout(Bo),Bo=void 0}function wy(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function xy(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 Tt="Sortable"+new Date().getTime();function WT(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(r){if(!(ee(r,"display")==="none"||r===te.ghost)){t.push({target:r,rect:Be(r)});var i=wn({},t[t.length-1].rect);if(r.thisAnimationDuration){var o=Vi(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(zT(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=Be(l),d=l.prevFromRect,h=l.prevToRect,p=s.rect,f=Vi(l,!0);f&&(c.top-=f.f,c.left-=f.e),l.toRect=c,l.thisAnimationDuration&&Ku(d,c)&&!Ku(u,c)&&(p.top-c.top)/(p.left-c.left)===(u.top-c.top)/(u.left-c.left)&&(a=KT(p,d,h,r.options)),Ku(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){ee(n,"transition",""),ee(n,"transform","");var s=Vi(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,ee(n,"transform","translate3d("+u+"px,"+c+"px,0)"),this.forRepaintDummy=UT(n),ee(n,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),ee(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){ee(n,"transition",""),ee(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},o)}}}}function UT(t){return t.offsetWidth}function KT(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 xi=[],Gu={initializeByDefault:!0},_s={mount:function(t){for(var e in Gu)Gu.hasOwnProperty(e)&&!(e in t)&&(t[e]=Gu[e]);xi.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),xi.push(t)},pluginEvent:function(t,e,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=t+"Global";xi.forEach(function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](wn({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](wn({sortable:e},n)))})},initializePlugins:function(t,e,n,r){xi.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,jn(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 xi.forEach(function(r){typeof r.eventProperties=="function"&&jn(n,r.eventProperties.call(e[r.pluginName],t))}),n},modifyOption:function(t,e,n){var r;return xi.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[e]=="function"&&(r=i.optionListeners[e].call(t[i.pluginName],n))}),r}};function GT(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[Tt],!!e){var m,g=e.options,y="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Un&&!Ms?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=wn(wn({},f),_s.getEventProperties(r,e));for(var k in b)m[k]=b[k];n&&n.dispatchEvent(m),g[y]&&g[y].call(e,m)}}var JT=["evt"],gt=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=VT(n,JT);_s.pluginEvent.bind(te)(t,e,wn({dragEl:P,parentEl:Ae,ghostEl:ae,rootEl:xe,nextEl:$r,lastDownEl:Oa,cloneEl:Me,cloneHidden:rr,dragStarted:Ao,putSortable:Ge,activeSortable:te.active,originalEvent:r,oldIndex:Ii,oldDraggableIndex:$o,newIndex:Ct,newDraggableIndex:Qn,hideGhostForTarget:Ty,unhideGhostForTarget:Oy,cloneNowHidden:function(){rr=!0},cloneNowShown:function(){rr=!1},dispatchSortableEvent:function(o){ut({sortable:e,name:o,originalEvent:r})}},i))};function ut(t){GT(wn({putSortable:Ge,cloneEl:Me,targetEl:P,rootEl:xe,oldIndex:Ii,oldDraggableIndex:$o,newIndex:Ct,newDraggableIndex:Qn},t))}var P,Ae,ae,xe,$r,Oa,Me,rr,Ii,Ct,$o,Qn,ra,Ge,Ti=!1,Za=!1,Qa=[],Pr,Gt,Ju,Xu,Nf,If,Ao,Ei,jo,zo=!1,ia=!1,Aa,tt,Yu=[],ld=!1,el=[],gu=typeof document<"u",oa=vy,Rf=Ms||Un?"cssFloat":"float",XT=gu&&!$T&&!vy&&"draggable"in document.createElement("div"),Ey=function(){if(gu){if(Un)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),Cy=function(t,e){var n=ee(t),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Ki(t,0,e),o=Ki(t,1,e),s=i&&ee(i),a=o&&ee(o),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Be(i).width,u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Be(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[Rf]==="none"||o&&n[Rf]==="none"&&l+u>r)?"vertical":"horizontal"},YT=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},ZT=function(t,e){var n;return Qa.some(function(r){var i=r[Tt].options.emptyInsertThreshold;if(!(!i||Rp(r))){var o=Be(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},Sy=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||Ta(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},Ty=function(){!Ey&&ae&&ee(ae,"display","none")},Oy=function(){!Ey&&ae&&ee(ae,"display","")};gu&&document.addEventListener("click",function(t){if(Za)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Za=!1,!1},!0);var Fr=function(t){if(P){t=t.touches?t.touches[0]:t;var e=ZT(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[Tt]._onDragOver(n)}}},QT=function(t){P&&P.parentNode[Tt]._isOutsideThisEl(t.target)};function te(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=jn({},e),t[Tt]=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 Cy(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:te.supportPointer!==!1&&"PointerEvent"in window&&!Vo,emptyInsertThreshold:5};_s.initializePlugins(this,t,n);for(var r in n)!(r in e)&&(e[r]=n[r]);Sy(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:XT,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?ve(t,"pointerdown",this._onTapStart):(ve(t,"mousedown",this._onTapStart),ve(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(ve(t,"dragover",this),ve(t,"dragenter",this)),Qa.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),jn(this,WT())}te.prototype={constructor:te,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Ei=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,P):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(aO(n),!P&&!(/mousedown|pointerdown/.test(o)&&t.button!==0||r.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&Vo&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=hn(a,r.draggable,n,!1),!(a&&a.animated)&&Oa!==a)){if(Ii=Lt(a),$o=Lt(a,r.draggable),typeof u=="function"){if(u.call(this,t,a,this)){ut({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),gt("filter",e,{evt:t}),i&&t.cancelable&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(c){if(c=hn(l,c.trim(),n,!1),c)return ut({sortable:e,rootEl:c,name:"filter",targetEl:a,fromEl:n,toEl:n}),gt("filter",e,{evt:t}),!0}),u)){i&&t.cancelable&&t.preventDefault();return}r.handle&&!hn(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&&!P&&n.parentNode===i){var l=Be(n);if(xe=i,P=n,Ae=P.parentNode,$r=P.nextSibling,Oa=n,ra=o.group,te.dragged=P,Pr={target:P,clientX:(e||t).clientX,clientY:(e||t).clientY},Nf=Pr.clientX-l.left,If=Pr.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,P.style["will-change"]="all",a=function(){if(gt("delayEnded",r,{evt:t}),te.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Af&&r.nativeDraggable&&(P.draggable=!0),r._triggerDragStart(t,e),ut({sortable:r,name:"choose",originalEvent:t}),Et(P,o.chosenClass,!0)},o.ignore.split(",").forEach(function(u){by(P,u.trim(),Zu)}),ve(s,"dragover",Fr),ve(s,"mousemove",Fr),ve(s,"touchmove",Fr),ve(s,"mouseup",r._onDrop),ve(s,"touchend",r._onDrop),ve(s,"touchcancel",r._onDrop),Af&&this.nativeDraggable&&(this.options.touchStartThreshold=4,P.draggable=!0),gt("delayStart",this,{evt:t}),o.delay&&(!o.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(Ms||Un))){if(te.eventCanceled){this._onDrop();return}ve(s,"mouseup",r._disableDelayedDrag),ve(s,"touchend",r._disableDelayedDrag),ve(s,"touchcancel",r._disableDelayedDrag),ve(s,"mousemove",r._delayedDragTouchMoveHandler),ve(s,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&ve(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(){P&&Zu(P),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;me(t,"mouseup",this._disableDelayedDrag),me(t,"touchend",this._disableDelayedDrag),me(t,"touchcancel",this._disableDelayedDrag),me(t,"mousemove",this._delayedDragTouchMoveHandler),me(t,"touchmove",this._delayedDragTouchMoveHandler),me(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?ve(document,"pointermove",this._onTouchMove):e?ve(document,"touchmove",this._onTouchMove):ve(document,"mousemove",this._onTouchMove):(ve(P,"dragend",this),ve(xe,"dragstart",this._onDragStart));try{document.selection?Ma(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Ti=!1,xe&&P){gt("dragStarted",this,{evt:e}),this.nativeDraggable&&ve(document,"dragover",QT);var n=this.options;!t&&Et(P,n.dragClass,!1),Et(P,n.ghostClass,!0),te.active=this,t&&this._appendGhost(),ut({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Gt){this._lastX=Gt.clientX,this._lastY=Gt.clientY,Ty();for(var t=document.elementFromPoint(Gt.clientX,Gt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Gt.clientX,Gt.clientY),t!==e);)e=t;if(P.parentNode[Tt]._isOutsideThisEl(t),e)do{if(e[Tt]){var n=void 0;if(n=e[Tt]._onDragOver({clientX:Gt.clientX,clientY:Gt.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Oy()}},_onTouchMove:function(t){if(Pr){var e=this.options,n=e.fallbackTolerance,r=e.fallbackOffset,i=t.touches?t.touches[0]:t,o=ae&&Vi(ae,!0),s=ae&&o&&o.a,a=ae&&o&&o.d,l=oa&&tt&&Df(tt),u=(i.clientX-Pr.clientX+r.x)/(s||1)+(l?l[0]-Yu[0]:0)/(s||1),c=(i.clientY-Pr.clientY+r.y)/(a||1)+(l?l[1]-Yu[1]:0)/(a||1);if(!te.active&&!Ti){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(ae){o?(o.e+=u-(Ju||0),o.f+=c-(Xu||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,")");ee(ae,"webkitTransform",d),ee(ae,"mozTransform",d),ee(ae,"msTransform",d),ee(ae,"transform",d),Ju=u,Xu=c,Gt=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!ae){var t=this.options.fallbackOnBody?document.body:xe,e=Be(P,!0,oa,!0,t),n=this.options;if(oa){for(tt=t;ee(tt,"position")==="static"&&ee(tt,"transform")==="none"&&tt!==document;)tt=tt.parentNode;tt!==document.body&&tt!==document.documentElement?(tt===document&&(tt=yn()),e.top+=tt.scrollTop,e.left+=tt.scrollLeft):tt=yn(),Yu=Df(tt)}ae=P.cloneNode(!0),Et(ae,n.ghostClass,!1),Et(ae,n.fallbackClass,!0),Et(ae,n.dragClass,!0),ee(ae,"transition",""),ee(ae,"transform",""),ee(ae,"box-sizing","border-box"),ee(ae,"margin",0),ee(ae,"top",e.top),ee(ae,"left",e.left),ee(ae,"width",e.width),ee(ae,"height",e.height),ee(ae,"opacity","0.8"),ee(ae,"position",oa?"absolute":"fixed"),ee(ae,"zIndex","100000"),ee(ae,"pointerEvents","none"),te.ghost=ae,t.appendChild(ae),ee(ae,"transform-origin",Nf/parseInt(ae.style.width)*100+"% "+If/parseInt(ae.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,r=t.dataTransfer,i=n.options;if(gt("dragStart",this,{evt:t}),te.eventCanceled){this._onDrop();return}gt("setupClone",this),te.eventCanceled||(Me=xy(P),Me.draggable=!1,Me.style["will-change"]="",this._hideClone(),Et(Me,this.options.chosenClass,!1),te.clone=Me),n.cloneId=Ma(function(){gt("clone",n),!te.eventCanceled&&(n.options.removeCloneOnHide||xe.insertBefore(Me,P),n._hideClone(),ut({sortable:n,name:"clone"}))}),!e&&Et(P,i.dragClass,!0),e?(Za=!0,n._loopId=setInterval(n._emulateDragOver,50)):(me(document,"mouseup",n._onDrop),me(document,"touchend",n._onDrop),me(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(n,r,P)),ve(document,"drop",n),ee(P,"transform","translateZ(0)")),Ti=!0,n._dragStartId=Ma(n._dragStarted.bind(n,e,t)),ve(document,"selectstart",n),Ao=!0,Vo&&ee(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=te.active,u=ra===a,c=s.sort,d=Ge||l,h,p=this,f=!1;if(ld)return;function m(ue,ge){gt(ue,p,wn({evt:t,isOwner:u,axis:h?"vertical":"horizontal",revert:o,dragRect:r,targetRect:i,canSort:c,fromSortable:d,target:n,completed:y,onMove:function(Te,mt){return sa(xe,e,P,r,Te,Be(Te),t,mt)},changed:b},ge))}function g(){m("dragOverAnimationCapture"),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function y(ue){return m("dragOverCompleted",{insertion:ue}),ue&&(u?l._hideClone():l._showClone(p),p!==d&&(Et(P,Ge?Ge.options.ghostClass:l.options.ghostClass,!1),Et(P,s.ghostClass,!0)),Ge!==p&&p!==te.active?Ge=p:p===te.active&&Ge&&(Ge=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){m("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===P&&!P.animated||n===e&&!n.animated)&&(Ei=null),!s.dragoverBubble&&!t.rootEl&&n!==document&&(P.parentNode[Tt]._isOutsideThisEl(t.target),!ue&&Fr(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function b(){Ct=Lt(P),Qn=Lt(P,s.draggable),ut({sortable:p,name:"change",toEl:e,newIndex:Ct,newDraggableIndex:Qn,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=hn(n,s.draggable,e,!0),m("dragOver"),te.eventCanceled)return f;if(P.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return y(!1);if(Za=!1,l&&!s.disabled&&(u?c||(o=Ae!==xe):Ge===this||(this.lastPutMode=ra.checkPull(this,l,P,t))&&a.checkPut(this,l,P,t))){if(h=this._getDirection(t,n)==="vertical",r=Be(P),m("dragOverValid"),te.eventCanceled)return f;if(o)return Ae=xe,g(),this._hideClone(),m("revert"),te.eventCanceled||($r?xe.insertBefore(P,$r):xe.appendChild(P)),y(!0);var k=Rp(e,s.draggable);if(!k||rO(t,h,this)&&!k.animated){if(k===P)return y(!1);if(k&&e===t.target&&(n=k),n&&(i=Be(n)),sa(xe,e,P,r,n,i,t,!!n)!==!1)return g(),e.appendChild(P),Ae=e,b(),y(!0)}else if(k&&nO(t,h,this)){var v=Ki(e,0,s,!0);if(v===P)return y(!1);if(n=v,i=Be(n),sa(xe,e,P,r,n,i,t,!1)!==!1)return g(),e.insertBefore(P,v),Ae=e,b(),y(!0)}else if(n.parentNode===e){i=Be(n);var w=0,x,S=P.parentNode!==e,N=!YT(P.animated&&P.toRect||r,n.animated&&n.toRect||i,h),A=h?"top":"left",C=_f(n,"top","top")||_f(P,"top","top"),_=C?C.scrollTop:void 0;Ei!==n&&(x=i[A],zo=!1,ia=!N&&s.invertSwap||S),w=iO(t,n,i,h,N?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,ia,Ei===n);var L;if(w!==0){var W=Lt(P);do W-=w,L=Ae.children[W];while(L&&(ee(L,"display")==="none"||L===ae))}if(w===0||L===n)return y(!1);Ei=n,jo=w;var q=n.nextElementSibling,K=!1;K=w===1;var J=sa(xe,e,P,r,n,i,t,K);if(J!==!1)return(J===1||J===-1)&&(K=J===1),ld=!0,setTimeout(tO,30),g(),K&&!q?e.appendChild(P):n.parentNode.insertBefore(P,K?q:n),C&&wy(C,0,_-C.scrollTop),Ae=P.parentNode,x!==void 0&&!ia&&(Aa=Math.abs(x-Be(n)[A])),b(),y(!0)}if(e.contains(P))return y(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){me(document,"mousemove",this._onTouchMove),me(document,"touchmove",this._onTouchMove),me(document,"pointermove",this._onTouchMove),me(document,"dragover",Fr),me(document,"mousemove",Fr),me(document,"touchmove",Fr)},_offUpEvents:function(){var t=this.el.ownerDocument;me(t,"mouseup",this._onDrop),me(t,"touchend",this._onDrop),me(t,"pointerup",this._onDrop),me(t,"touchcancel",this._onDrop),me(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;if(Ct=Lt(P),Qn=Lt(P,n.draggable),gt("drop",this,{evt:t}),Ae=P&&P.parentNode,Ct=Lt(P),Qn=Lt(P,n.draggable),te.eventCanceled){this._nulling();return}Ti=!1,ia=!1,zo=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ud(this.cloneId),ud(this._dragStartId),this.nativeDraggable&&(me(document,"drop",this),me(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Vo&&ee(document.body,"user-select",""),ee(P,"transform",""),t&&(Ao&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),ae&&ae.parentNode&&ae.parentNode.removeChild(ae),(xe===Ae||Ge&&Ge.lastPutMode!=="clone")&&Me&&Me.parentNode&&Me.parentNode.removeChild(Me),P&&(this.nativeDraggable&&me(P,"dragend",this),Zu(P),P.style["will-change"]="",Ao&&!Ti&&Et(P,Ge?Ge.options.ghostClass:this.options.ghostClass,!1),Et(P,this.options.chosenClass,!1),ut({sortable:this,name:"unchoose",toEl:Ae,newIndex:null,newDraggableIndex:null,originalEvent:t}),xe!==Ae?(Ct>=0&&(ut({rootEl:Ae,name:"add",toEl:Ae,fromEl:xe,originalEvent:t}),ut({sortable:this,name:"remove",toEl:Ae,originalEvent:t}),ut({rootEl:Ae,name:"sort",toEl:Ae,fromEl:xe,originalEvent:t}),ut({sortable:this,name:"sort",toEl:Ae,originalEvent:t})),Ge&&Ge.save()):Ct!==Ii&&Ct>=0&&(ut({sortable:this,name:"update",toEl:Ae,originalEvent:t}),ut({sortable:this,name:"sort",toEl:Ae,originalEvent:t})),te.active&&((Ct==null||Ct===-1)&&(Ct=Ii,Qn=$o),ut({sortable:this,name:"end",toEl:Ae,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){gt("nulling",this),xe=P=Ae=ae=$r=Me=Oa=rr=Pr=Gt=Ao=Ct=Qn=Ii=$o=Ei=jo=Ge=ra=te.dragged=te.ghost=te.clone=te.active=null,el.forEach(function(t){t.checked=!0}),el.length=Ju=Xu=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":P&&(this._onDragOver(t),eO(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],hn(e,o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||sO(e));return t},sort:function(t,e){var n={},r=this.el;this.toArray().forEach(function(i,o){var s=r.children[o];hn(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 hn(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=_s.modifyOption(this,t,e);typeof r<"u"?n[t]=r:n[t]=e,t==="group"&&Sy(n)},destroy:function(){gt("destroy",this);var t=this.el;t[Tt]=null,me(t,"mousedown",this._onTapStart),me(t,"touchstart",this._onTapStart),me(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(me(t,"dragover",this),me(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Qa.splice(Qa.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!rr){if(gt("hideClone",this),te.eventCanceled)return;ee(Me,"display","none"),this.options.removeCloneOnHide&&Me.parentNode&&Me.parentNode.removeChild(Me),rr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(rr){if(gt("showClone",this),te.eventCanceled)return;P.parentNode==xe&&!this.options.group.revertClone?xe.insertBefore(Me,P):$r?xe.insertBefore(Me,$r):xe.appendChild(Me),this.options.group.revertClone&&this.animate(P,Me),ee(Me,"display",""),rr=!1}}};function eO(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function sa(t,e,n,r,i,o,s,a){var l,u=t[Tt],c=u.options.onMove,d;return window.CustomEvent&&!Un&&!Ms?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||Be(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),c&&(d=c.call(u,l,s)),d}function Zu(t){t.draggable=!1}function tO(){ld=!1}function nO(t,e,n){var r=Be(Ki(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 rO(t,e,n){var r=Be(Rp(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 iO(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&&Aa<u*i){if(!zo&&(jo===1?l>c+u*o/2:l<d-u*o/2)&&(zo=!0),zo)h=!0;else if(jo===1?l<c+Aa:l>d-Aa)return-jo}else if(l>c+u*(1-i)/2&&l<d-u*(1-i)/2)return oO(e)}return h=h||s,h&&(l<c+u*o/2||l>d-u*o/2)?l>c+u/2?1:-1:0}function oO(t){return Lt(P)<Lt(t)?1:-1}function sO(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 aO(t){el.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var r=e[n];r.checked&&el.push(r)}}function Ma(t){return setTimeout(t,0)}function ud(t){return clearTimeout(t)}gu&&ve(document,"touchmove",function(t){(te.active||Ti)&&t.cancelable&&t.preventDefault()});te.utils={on:ve,off:me,css:ee,find:by,is:function(t,e){return!!hn(t,e,t,!1)},extend:HT,throttle:ky,closest:hn,toggleClass:Et,clone:xy,index:Lt,nextTick:Ma,cancelNextTick:ud,detectDirection:Cy,getChild:Ki};te.get=function(t){return t[Tt]};te.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&&(te.utils=wn(wn({},te.utils),r.utils)),_s.mount(r)})};te.create=function(t,e){return new te(t,e)};te.version=BT;var Re=[],Mo,cd,dd=!1,Qu,ec,tl,_o;function lO(){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?ve(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ve(document,"pointermove",this._handleFallbackAutoScroll):n.touches?ve(document,"touchmove",this._handleFallbackAutoScroll):ve(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var n=e.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?me(document,"dragover",this._handleAutoScroll):(me(document,"pointermove",this._handleFallbackAutoScroll),me(document,"touchmove",this._handleFallbackAutoScroll),me(document,"mousemove",this._handleFallbackAutoScroll)),Pf(),_a(),qT()},nulling:function(){tl=cd=Mo=dd=_o=Qu=ec=null,Re.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(tl=e,n||this.options.forceAutoScrollFallback||Ms||Un||Vo){tc(e,this.options,s,n);var a=sr(s,!0);dd&&(!_o||i!==Qu||o!==ec)&&(_o&&Pf(),_o=setInterval(function(){var l=sr(document.elementFromPoint(i,o),!0);l!==a&&(a=l,_a()),tc(e,r.options,l,n)},10),Qu=i,ec=o)}else{if(!this.options.bubbleScroll||sr(s,!0)===yn()){_a();return}tc(e,this.options,sr(s,!1),!1)}}},jn(t,{pluginName:"scroll",initializeByDefault:!0})}function _a(){Re.forEach(function(t){clearInterval(t.pid)}),Re=[]}function Pf(){clearInterval(_o)}var tc=ky(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=yn(),u=!1,c;cd!==n&&(cd=n,_a(),Mo=e.scroll,c=e.scrollFn,Mo===!0&&(Mo=sr(n,!0)));var d=0,h=Mo;do{var p=h,f=Be(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,S=p.scrollWidth,N=p.scrollHeight,A=ee(p),C=p.scrollLeft,_=p.scrollTop;p===l?(w=k<S&&(A.overflowX==="auto"||A.overflowX==="scroll"||A.overflowX==="visible"),x=v<N&&(A.overflowY==="auto"||A.overflowY==="scroll"||A.overflowY==="visible")):(w=k<S&&(A.overflowX==="auto"||A.overflowX==="scroll"),x=v<N&&(A.overflowY==="auto"||A.overflowY==="scroll"));var L=w&&(Math.abs(b-i)<=s&&C+k<S)-(Math.abs(y-i)<=s&&!!C),W=x&&(Math.abs(g-o)<=s&&_+v<N)-(Math.abs(m-o)<=s&&!!_);if(!Re[d])for(var q=0;q<=d;q++)Re[q]||(Re[q]={});(Re[d].vx!=L||Re[d].vy!=W||Re[d].el!==p)&&(Re[d].el=p,Re[d].vx=L,Re[d].vy=W,clearInterval(Re[d].pid),(L!=0||W!=0)&&(u=!0,Re[d].pid=setInterval(function(){r&&this.layer===0&&te.active._onTouchMove(tl);var K=Re[this.layer].vy?Re[this.layer].vy*a:0,J=Re[this.layer].vx?Re[this.layer].vx*a:0;typeof c=="function"&&c.call(te.dragged.parentNode[Tt],J,K,t,tl,Re[this.layer].el)!=="continue"||wy(Re[this.layer].el,J,K)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&h!==l&&(h=sr(h,!1)));dd=u}},30),Ay=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 Pp(){}Pp.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=Ki(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:Ay};jn(Pp,{pluginName:"revertOnSpill"});function Fp(){}Fp.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:Ay};jn(Fp,{pluginName:"removeOnSpill"});te.mount(new lO);te.mount(Fp,Pp);function nc(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function Ff(t,e,n){const r=n===0?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,r)}function uO(){return typeof window<"u"?window.console:global.console}const cO=uO();function dO(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const pO=/-(\w)/g,hO=dO(t=>t.replace(pO,(e,n)=>n.toUpperCase())),My=["Start","Add","Remove","Update","End"],_y=["Choose","Unchoose","Sort","Filter","Clone"],Dy=["Move"],fO=[Dy,My,_y].flatMap(t=>t).map(t=>`on${t}`),pd={manage:Dy,manageAndEmit:My,emit:_y};function mO(t){return fO.indexOf(t)!==-1}const gO=["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 vO(t){return gO.includes(t)}function yO(t){return["transition-group","TransitionGroup"].includes(t)}function Ny(t){return["id","class","role","style"].includes(t)||t.startsWith("data-")||t.startsWith("aria-")||t.startsWith("on")}function Iy(t){return t.reduce((e,[n,r])=>(e[n]=r,e),{})}function bO({$attrs:t,componentData:e={}}){return{...Iy(Object.entries(t).filter(([n,r])=>Ny(n))),...e}}function kO({$attrs:t,callBackBuilder:e}){const n=Iy(Ry(t));Object.entries(e).forEach(([i,o])=>{pd[i].forEach(s=>{n[`on${s}`]=o(s)})});const r=`[data-draggable]${n.draggable||""}`;return{...n,draggable:r}}function Ry(t){return Object.entries(t).filter(([e,n])=>!Ny(e)).map(([e,n])=>[hO(e),n]).filter(([e,n])=>!mO(e))}const Lf=({el:t})=>t,wO=(t,e)=>t.__draggable_context=e,Vf=t=>t.__draggable_context;class xO{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)=>{wO(Lf(r),{element:n[i],index:i})})}getUnderlyingVm(e){return Vf(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=Vf(s);if(a)return a.index;if(i===0)return 0;const l=Lf(r[0]),u=[...o].findIndex(c=>c===l);return e<u?0:i}}function EO(t,e){const n=t[e];return n?n():[]}function CO({$slots:t,realList:e,getKey:n}){const r=e||[],[i,o]=["header","footer"].map(l=>EO(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 SO(t){const e=yO(t),n=!vO(t)&&!e;return{transition:e,externalComponent:n,tag:n?Ck(t):e?Sk:t}}function TO({$slots:t,tag:e,realList:n,getKey:r}){const i=CO({$slots:t,realList:n,getKey:r}),o=SO(e);return new xO({nodes:i,root:o,realList:n})}function Py(t,e){kr(()=>this.$emit(t.toLowerCase(),e))}function Fy(t){return(e,n)=>{if(this.realList!==null)return this[`onDrag${t}`](e,n)}}function OO(t){const e=Fy.call(this,t);return(n,r)=>{e.call(this,n,r),Py.call(this,t,n)}}let rc=null;const AO={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}},MO=["update:modelValue","change",...[...pd.manageAndEmit,...pd.emit].map(t=>t.toLowerCase())],Ly=Q({name:"draggable",inheritAttrs:!1,props:AO,emits:MO,data(){return{error:!1}},render(){try{this.error=!1;const{$slots:t,$attrs:e,tag:n,componentData:r,realList:i,getKey:o}=this,s=TO({$slots:t,tag:n,realList:i,getKey:o});this.componentStructure=s;const a=bO({$attrs:e,componentData:r});return s.render(ns,a)}catch(t){return this.error=!0,ns("pre",{style:{color:"red"}},t.stack)}},created(){this.list!==null&&this.modelValue!==null&&cO.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=kO({$attrs:t,callBackBuilder:{manageAndEmit:o=>OO.call(this,o),emit:o=>Py.bind(this,o),manage:o=>Fy.call(this,o)}}),i=e.nodeType===1?e:e.parentElement;this._sortable=new te(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&&Ry(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){kr(()=>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),rc=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(Ff(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),Ff(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(rc)!==-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(){rc=null}}}),_O={key:0,class:"k-media__label-wrapper"},DO={key:1,class:"k-media__sublabel"},TL=Q({__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=X(null),o=I(()=>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=I({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=I(()=>n.types.map(p=>typeof p=="string"?PT[p]:p).filter(Boolean));Ee(()=>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&&kr(()=>{l()})}function c(p){r("update:modelValue",n.multiple?[...n.modelValue||[],p]:p),kr(()=>l(s.value.find(f=>f.url===p.url)))}function d(p){r("update:modelValue",p)}const h=rn("k-media",{variants:{placement:{outside:"k-media--placement-outside",inside:"k-media--placement-inside"}}});return(p,f)=>(E(),O("div",{class:Ce(B(h)({placement:p.placement}))},[p.label||p.sublabel||p.$slots.sublabel||p.$slots.label?(E(),O("div",_O,[p.label||p.$slots.label?(E(),O("label",{key:0,class:Ce(["k-media__label",{"k-media__label-required":p.required}])},[F(p.$slots,"label",{},()=>[$e(oe(p.label),1)])],2)):R("",!0),p.sublabel||p.$slots.sublabel?(E(),O("span",DO,[F(p.$slots,"sublabel",{},()=>[$e(oe(p.sublabel),1)])])):R("",!0)])):R("",!0),he(_T,{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},Cs({default:Z(({openFileWindow:m})=>[he(yT,{onOpenFileWindow:m,ref:"typeSelector",value:a.value,onAdd:c,labels:p.labels,upload:p.upload},null,8,["onOpenFileWindow","value","labels","upload"])]),"drop-message":Z(()=>[F(p.$slots,"drop-message")]),"custom-message":Z(()=>[F(p.$slots,"custom-message")]),_:2},[i.value?{name:"preview",fn:Z(()=>[p.description&&o.value?(E(),$(bT,{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"])):R("",!0),(E(),$(Qe(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"]),F(p.$slots,"bottom"),p.multiple?(E(),$(B(Ly),{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,onEnd:f[2]||(f[2]=(m,g)=>{i.value=s.value[m.newIndex]})},{item:Z(({element:m,index:g})=>[(E(),$(mT,{onKeydown:op(y=>i.value=m,["enter"]),tabindex:"0",size:p.thumbnailSize,key:m.url,value:m,disabled:p.disabled,onClick:y=>i.value=m,onDelete:y=>u(m)},null,8,["onKeydown","size","value","disabled","onClick","onDelete"]))]),_:1},8,["modelValue","sort"])):R("",!0)],2))}});var NO=Ln("switch").parts("root","label","control","thumb"),aa=NO.build(),Vy=t=>{var e;return((e=t.ids)==null?void 0:e.root)??`switch:${t.id}`},Bf=t=>{var e;return((e=t.ids)==null?void 0:e.label)??`switch:${t.id}:label`},IO=t=>{var e;return((e=t.ids)==null?void 0:e.thumb)??`switch:${t.id}:thumb`},RO=t=>{var e;return((e=t.ids)==null?void 0:e.control)??`switch:${t.id}:control`},hd=t=>{var e;return((e=t.ids)==null?void 0:e.hiddenInput)??`switch:${t.id}:input`},PO=t=>t.getById(Vy(t)),Do=t=>t.getById(hd(t));function FO(t,e){const{context:n,send:r,prop:i,scope:o}=t,s=i("disabled"),a=i("readOnly"),l=!!n.get("checked"),u=!s&&n.get("focused"),c=!s&&n.get("focusVisible"),d={"data-active":G(n.get("active")),"data-focus":G(u),"data-focus-visible":G(c),"data-readonly":G(a),"data-hover":G(n.get("hovered")),"data-disabled":G(s),"data-state":l?"checked":"unchecked","data-invalid":G(i("invalid"))};return{checked:l,disabled:s,focused:u,setChecked(h){r({type:"CHECKED.SET",checked:h,isTrusted:!1})},toggleChecked(){r({type:"CHECKED.TOGGLE",checked:l,isTrusted:!1})},getRootProps(){return e.label({...aa.root.attrs,...d,dir:i("dir"),id:Vy(o),htmlFor:hd(o),onPointerMove(){s||r({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){s||r({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(h){s||ct(h)===Do(o)&&h.stopPropagation()}})},getLabelProps(){return e.element({...aa.label.attrs,...d,dir:i("dir"),id:Bf(o)})},getThumbProps(){return e.element({...aa.thumb.attrs,...d,dir:i("dir"),id:IO(o),"aria-hidden":!0})},getControlProps(){return e.element({...aa.control.attrs,...d,dir:i("dir"),id:RO(o),"aria-hidden":!0})},getHiddenInputProps(){return e.input({id:hd(o),type:"checkbox",required:i("required"),defaultChecked:l,disabled:s,"aria-labelledby":Bf(o),"aria-invalid":i("invalid"),name:i("name"),form:i("form"),value:i("value"),style:bp,onFocus(){const h=is();r({type:"CONTEXT.SET",context:{focused:!0,focusVisible:h}})},onBlur(){r({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(h){if(a){h.preventDefault();return}const p=h.currentTarget.checked;r({type:"CHECKED.SET",checked:p,isTrusted:!0})}})}}}var{not:$f}=eu(),LO={props({props:t}){return{defaultChecked:!1,label:"switch",value:"on",...t}},initialState(){return"ready"},context({prop:t,bindable:e}){return{checked:e(()=>({defaultValue:t("defaultChecked"),value:t("checked"),onChange(n){var r;(r=t("onCheckedChange"))==null||r({checked:n})}})),fieldsetDisabled:e(()=>({defaultValue:!1})),focusVisible:e(()=>({defaultValue:!1})),active:e(()=>({defaultValue:!1})),focused:e(()=>({defaultValue:!1})),hovered:e(()=>({defaultValue:!1}))}},computed:{isDisabled:({context:t,prop:e})=>e("disabled")||t.get("fieldsetDisabled")},watch({track:t,prop:e,context:n,action:r}){t([()=>e("disabled")],()=>{r(["removeFocusIfNeeded"])}),t([()=>n.get("checked")],()=>{r(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:$f("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:$f("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},states:{ready:{}},implementations:{guards:{isTrusted:({event:t})=>!!t.isTrusted},effects:{trackPressEvent({computed:t,scope:e,context:n}){if(!t("isDisabled"))return pv({pointerNode:PO(e),keyboardNode:Do(e),isValidKey:r=>r.key===" ",onPress:()=>n.set("active",!1),onPressStart:()=>n.set("active",!0),onPressEnd:()=>n.set("active",!1)})},trackFocusVisible({computed:t,scope:e}){if(!t("isDisabled"))return kp({root:e.getRootNode()})},trackFormControlState({context:t,send:e,scope:n}){return Yl(Do(n),{onFieldsetDisabledChange(r){t.set("fieldsetDisabled",r)},onFormReset(){const r=t.initial("checked");e({type:"CHECKED.SET",checked:!!r,src:"form-reset"})}})}},actions:{setContext({context:t,event:e}){for(const n in e.context)t.set(n,e.context[n])},syncInputElement({context:t,scope:e}){const n=Do(e);n&&mp(n,!!t.get("checked"))},removeFocusIfNeeded({context:t,prop:e}){e("disabled")&&t.set("focused",!1)},setChecked({context:t,event:e}){t.set("checked",e.checked)},toggleChecked({context:t}){t.set("checked",!t.get("checked"))},dispatchChangeEvent({context:t,scope:e}){const n=Do(e);gp(n,{checked:t.get("checked")})}}}};Wn()(["checked","defaultChecked","dir","disabled","form","getRootNode","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]);const VO={class:"k-switch__label"},OL=Q({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},getRootNode:{type:Function},labels:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=pi(LO,{id:Qt(),...n,defaultChecked:n.modelValue,onCheckedChange:({checked:s})=>r("update:modelValue",s)}),o=I(()=>FO(i,di));return Ee(()=>n.modelValue,()=>{if(o.value.checked!==n.modelValue)return o.value.setChecked(n.modelValue)}),(s,a)=>(E(),O("label",ne({class:"k-switch"},o.value.getRootProps()),[z("input",be(Ie(o.value.getHiddenInputProps())),null,16),z("span",be(Ie(o.value.getControlProps())),[z("span",be(Ie(o.value.getThumbProps())),null,16)],16),s.labels||s.$slots.default?(E(),O("span",be(ne({key:0},o.value.getLabelProps())),[z("span",VO,[F(s.$slots,"default",{checked:o.value.checked},()=>[$e(oe(o.value.checked?s.labels.on:s.labels.off),1)])])],16)):R("",!0)],16))}}),AL=Q({__name:"LazyLoad",props:{wrapperTag:{default:"div"},threshold:{default:0},observerRoot:{default:null}},emits:["intersect"],setup(t,{emit:e}){const n=t,r=e,i=X(!1);function o(u){const c=u[0];c.isIntersecting&&(i.value=!0,kr(()=>{r("intersect",c),l()}))}const s=X(),a=X();qn(()=>{s.value=new IntersectionObserver(o,{root:n.observerRoot,threshold:n.threshold}),s.value.observe(a.value)}),ao(()=>{l()});function l(){s.value&&s.value.disconnect()}return(u,c)=>(E(),$(Qe(u.wrapperTag),{ref_key:"rootRef",ref:a,class:"k-lazyload"},{default:Z(()=>[i.value?F(u.$slots,"default",{key:0}):F(u.$slots,"placeholder",{key:1})]),_:3},512))}}),BO={class:"k-file-uploader__bar"},$O={class:"k-file-uploader__meta"},jO={key:0},zO={key:1},HO=Q({__name:"Uploader",props:{value:{},bytes:{},current:{default:1},total:{default:1}},setup(t){const e=t,n=I(()=>e.total>1),r=I(()=>Np(e.bytes)),i=I(()=>Math.floor(e.value));return(o,s)=>(E(),$(ni,{class:"k-file-uploader",align:"center",justify:"space-between",gap:"0rem"},{default:Z(()=>[z("div",null,oe(i.value)+" %",1),z("div",BO,[z("div",{class:"k-file-uploader__bar-value",style:Cr({width:o.value+"%"})},null,4)]),z("div",$O,[n.value?(E(),O("div",jO,oe(o.current)+" / "+oe(o.total),1)):R("",!0),o.bytes?(E(),O("div",zO,"("+oe(r.value)+")",1)):R("",!0)])]),_:1}))}}),qO=["innerHTML"],jf=Q({__name:"SlotHandler",props:{value:{}},setup(t){const e=t,n=I(()=>typeof e.value=="string"?e.value:void 0),r=I(()=>typeof e.value=="string"?"div":e.value);return(i,o)=>(E(),$(Qe(r.value),be(Ie(i.$attrs)),{default:Z(()=>[n.value?(E(),O("span",{key:0,innerHTML:n.value},null,8,qO)):R("",!0)]),_:1},16))}}),WO={class:"k-file-droparea__instruction"},UO=["accept","required","disabled","multiple"],KO={key:0,class:"k-file-droparea__max-size"},GO=Q({__name:"DropArea",props:{value:{},multiple:{type:Boolean},upload:{},uploadOptions:{},accept:{},dropMessage:{},fileSizeError:{},disabled:{type:Boolean},required:{type:Boolean},rename:{type:Boolean},labels:{}},emits:["input"],setup(t,{emit:e}){const n=t,r=e,i=X(!1),o=X(!0),s=X(),a=X(!1),l=I(()=>!!n.required),u=I(()=>n.disabled),c=I(()=>!u.value&&!p.total),d=I(()=>hT(n.accept)),{run:h,queue:p}=new my(n);function f(S){return h(S).then(N=>{!N||!N.length||r("input",n.multiple?[...n.value||[],...N]:N[0])})}function m(S){if(!S)return 0;const N={bytes:1,b:1,kb:1024,mb:1024**2,gb:1024**3,tb:1024**4,pb:1024**5},A=S.trim().toLowerCase().match(/^([\d.]+)\s*(bytes|b|kb|mb|gb|tb|pb)$/);if(!A)throw new Error("Invalid size format");const C=parseFloat(A[1]),_=A[2];return Math.round(C*N[_])}function g(){return o.value=!1,a.value=!0,setTimeout(()=>{w()},1500)}function y(S=0){var N;return m((N=n?.uploadOptions)==null?void 0:N.maxSize)<S}async function b(S){var N;if(u.value)return;let A=S.target.files||[];if(Array.from(A).some(C=>y(C.size))&&(N=n.uploadOptions)!=null&&N.maxSize)return g();n.uploadOptions.preTransform&&(A=await n.uploadOptions.preTransform(S)),f(A),s.value&&(s.value.value="")}async function k(S){var N,A;if(u.value||!s.value)return;S.preventDefault();let C=(N=S.dataTransfer)==null?void 0:N.files;if(C!=null&&C.length){if(Array.from(C).some(_=>y(_.size))&&(A=n.uploadOptions)!=null&&A.maxSize)return g();if(!o.value)return w();w(),n.uploadOptions.preTransform&&(C=await n.uploadOptions.preTransform(S)),C!=null&&C.length&&(s.value.files=S.dataTransfer.files,s.value.dispatchEvent(new InputEvent("input")),f(C))}}function v(S){if(u.value||!S.dataTransfer)return;const N=Array.from(S.dataTransfer.items).every(C=>Ip(C,n.accept)),A=n.multiple?!0:S.dataTransfer.items.length===1;o.value=N&&A,i.value=!0,S.preventDefault()}function w(){o.value=!0,i.value=!1,a.value=!1}const x=rn("k-file-droparea",{variants:{active:{true:"k-file-droparea--active"},invalid:{true:"k-file-droparea--invalid"},disabled:{true:"k-file-droparea--disabled"}}});return(S,N)=>{var A,C,_;return E(),O(De,null,[z("div",{class:Ce(B(x)({active:i.value,invalid:!o.value,disabled:u.value})),onDrop:k,onDragover:v,onDragleave:w},[F(S.$slots,"preview"),z("div",WO,[c.value?(E(),O("input",{key:0,type:"file",accept:Array.isArray(S.accept)?S.accept.join(","):S.accept,required:l.value,ref_key:"input",ref:s,onChange:b,disabled:!c.value,multiple:S.multiple,class:"k-file-droparea__input"},null,40,UO)):R("",!0),o.value?(E(),O(De,{key:1},[F(S.$slots,"drop-message",{extensions:d.value},()=>[he(jf,{value:S.dropMessage,extensions:d.value},null,8,["value","extensions"])]),(A=n.uploadOptions)!=null&&A.maxSize?(E(),O("div",KO,[z("span",null,oe(`${(C=S.labels)==null?void 0:C.maxSize}: ${(_=n?.uploadOptions)==null?void 0:_.maxSize}`),1)])):R("",!0)],64)):(E(),$(B(Ze),{key:2,icon:"fa-pro-light:ban",style:{"font-size":"2rem"}})),a.value?F(S.$slots,"file-size-error",{key:3,extensions:d.value},()=>[he(jf,{class:"k-file-droparea__file-size-error",value:S.fileSizeError,extensions:d.value},null,8,["value","extensions"])]):R("",!0),F(S.$slots,"custom-message")])],34),B(p).total?(E(),$(HO,{key:0,value:B(p).progress,bytes:B(p).bytes,current:B(p).counter,total:B(p).total},null,8,["value","bytes","current","total"])):R("",!0)],64)}}}),JO=Os?window:void 0;function XO(t){var e;const n=He(t);return(e=n?.$el)!=null?e:n}function YO(...t){const e=[],n=()=>{e.forEach(a=>a()),e.length=0},r=(a,l,u,c)=>(a.addEventListener(l,u,c),()=>a.removeEventListener(l,u,c)),i=I(()=>{const a=Gr(He(t[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),o=Av(()=>{var a,l;return[(l=(a=i.value)==null?void 0:a.map(u=>XO(u)))!=null?l:[JO].filter(u=>u!=null),Gr(He(i.value?t[1]:t[0])),Gr(B(i.value?t[2]:t[1])),He(i.value?t[3]:t[2])]},([a,l,u,c])=>{if(n(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(u!=null&&u.length))return;const d=Ov(c)?{...c}:c;e.push(...a.flatMap(h=>l.flatMap(p=>u.map(f=>r(h,p,f,d)))))},{flush:"post"}),s=()=>{o(),n()};return Ts(n),s}const ZO=Q({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(t,{slots:e}){const n=sp(K1(t));return()=>{var r;return(r=e.default)==null?void 0:r.call(e,n)}}});function ic(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function By(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:By(n)}}function QO(t){const e=t||window.event,n=e.target;return By(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const oc=new WeakMap;function eA(t,e=!1){const n=qt(e);let r=null,i="";Ee(z1(t),a=>{const l=ic(He(a));if(l){const u=l;if(oc.get(u)||oc.set(u,u.style.overflow),u.style.overflow!=="hidden"&&(i=u.style.overflow),u.style.overflow==="hidden")return n.value=!0;if(n.value)return u.style.overflow="hidden"}},{immediate:!0});const o=()=>{const a=ic(He(t));!a||n.value||(Qh&&(r=YO(a,"touchmove",l=>{QO(l)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},s=()=>{const a=ic(He(t));!a||!n.value||(Qh&&r?.(),a.style.overflow=i,oc.delete(a),n.value=!1)};return Ts(s),I({get(){return n.value},set(a){a?o():s()}})}function tA(){let t=!1;const e=qt(!1);return(n,r)=>{if(e.value=r.value,t)return;t=!0;const i=eA(n,r.value);Ee(e,o=>i.value=o)}}tA();var nA=Ln("toggle-group").parts("root","item"),zf=nA.build(),nl=t=>{var e;return((e=t.ids)==null?void 0:e.root)??`toggle-group:${t.id}`},rA=(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}`},$y=t=>t.getById(nl(t)),vu=t=>{const e=`[data-ownedby='${CSS.escape(nl(t))}']:not([data-disabled])`;return yp($y(t),e)},Hf=t=>yv(vu(t)),iA=t=>bv(vu(t)),oA=(t,e,n)=>Nx(vu(t),e,n),sA=(t,e,n)=>Ix(vu(t),e,n);function aA(t,e){const{context:n,send:r,prop:i,scope:o}=t,s=n.get("value"),a=i("disabled"),l=!i("multiple"),u=i("rovingFocus"),c=i("orientation")==="horizontal";function d(h){const p=rA(o,h.value);return{id:p,disabled:!!(h.disabled||a),pressed:!!s.includes(h.value),focused:n.get("focusedId")===p}}return{value:s,setValue(h){r({type:"VALUE.SET",value:h})},getRootProps(){return e.element({...zf.root.attrs,id:nl(o),dir:i("dir"),role:l?"radiogroup":"group",tabIndex:n.get("isTabbingBackward")?-1:0,"data-disabled":G(a),"data-orientation":i("orientation"),"data-focus":G(n.get("focusedId")!=null),style:{outline:"none"},onMouseDown(){a||r({type:"ROOT.MOUSE_DOWN"})},onFocus(h){a||h.currentTarget===ct(h)&&(n.get("isClickFocus")||n.get("isTabbingBackward")||r({type:"ROOT.FOCUS"}))},onBlur(){a||r({type:"ROOT.BLUR"})}})},getItemState:d,getItemProps(h){const p=d(h),f=p.focused?0:-1;return e.button({...zf.item.attrs,id:p.id,type:"button","data-ownedby":nl(o),"data-focus":G(p.focused),disabled:p.disabled,tabIndex:u?f:void 0,role:l?"radio":void 0,"aria-checked":l?p.pressed:void 0,"aria-pressed":l?void 0:p.pressed,"data-disabled":G(p.disabled),"data-orientation":i("orientation"),dir:i("dir"),"data-state":p.pressed?"on":"off",onFocus(){p.disabled||r({type:"TOGGLE.FOCUS",id:p.id})},onClick(m){p.disabled||(r({type:"TOGGLE.CLICK",id:p.id,value:h.value}),ix()&&m.currentTarget.focus({preventScroll:!0}))},onKeyDown(m){if(m.defaultPrevented||!ax(m)||p.disabled)return;const g={Tab(y){const b=y.shiftKey;r({type:"TOGGLE.SHIFT_TAB",isShiftTab:b})},ArrowLeft(){!u||!c||r({type:"TOGGLE.FOCUS_PREV"})},ArrowRight(){!u||!c||r({type:"TOGGLE.FOCUS_NEXT"})},ArrowUp(){!u||c||r({type:"TOGGLE.FOCUS_PREV"})},ArrowDown(){!u||c||r({type:"TOGGLE.FOCUS_NEXT"})},Home(){u&&r({type:"TOGGLE.FOCUS_FIRST"})},End(){u&&r({type:"TOGGLE.FOCUS_LAST"})}}[ov(m)];g&&(g(m),m.key!=="Tab"&&m.preventDefault())}})}}}var{not:qf,and:lA}=eu(),uA={props({props:t}){return{defaultValue:[],orientation:"horizontal",rovingFocus:!0,loopFocus:!0,...t}},initialState(){return"idle"},context({prop:t,bindable:e}){return{value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),onChange(n){var r;(r=t("onValueChange"))==null||r({value:n})}})),focusedId:e(()=>({defaultValue:null})),isTabbingBackward:e(()=>({defaultValue:!1})),isClickFocus:e(()=>({defaultValue:!1})),isWithinToolbar:e(()=>({defaultValue:!1}))}},computed:{currentLoopFocus:({context:t,prop:e})=>e("loopFocus")&&!t.get("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:qf(lA("isClickFocus","isTabbingBackward")),actions:["focusFirstToggle","clearClickFocus"]},"TOGGLE.FOCUS":{target:"focused",actions:["setFocusedId"]}}},focused:{on:{"ROOT.BLUR":{target:"idle",actions:["clearIsTabbingBackward","clearFocusedId"]},"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":[{guard:qf("isFirstToggleFocused"),target:"idle",actions:["setIsTabbingBackward"]},{actions:["setIsTabbingBackward"]}]}}},implementations:{guards:{isClickFocus:({context:t})=>t.get("isClickFocus"),isTabbingBackward:({context:t})=>t.get("isTabbingBackward"),isFirstToggleFocused:({context:t,scope:e})=>{var n;return t.get("focusedId")===((n=Hf(e))==null?void 0:n.id)}},actions:{setIsTabbingBackward({context:t}){t.set("isTabbingBackward",!0)},clearIsTabbingBackward({context:t}){t.set("isTabbingBackward",!1)},setClickFocus({context:t}){t.set("isClickFocus",!0)},clearClickFocus({context:t}){t.set("isClickFocus",!1)},checkIfWithinToolbar({context:t,scope:e}){var n;const r=(n=$y(e))==null?void 0:n.closest("[role=toolbar]");t.set("isWithinToolbar",!!r)},setFocusedId({context:t,event:e}){t.set("focusedId",e.id)},clearFocusedId({context:t}){t.set("focusedId",null)},setValue({context:t,event:e,prop:n}){h1(e,["value"]);let r=t.get("value");Zx(e.value)?r=e.value:n("multiple")?r=Xx(r,e.value):r=Ss(r,[e.value])?[]:[e.value],t.set("value",r)},focusNextToggle({context:t,scope:e,prop:n}){At(()=>{var r;const i=t.get("focusedId");i&&((r=oA(e,i,n("loopFocus")))==null||r.focus({preventScroll:!0}))})},focusPrevToggle({context:t,scope:e,prop:n}){At(()=>{var r;const i=t.get("focusedId");i&&((r=sA(e,i,n("loopFocus")))==null||r.focus({preventScroll:!0}))})},focusFirstToggle({scope:t}){At(()=>{var e;(e=Hf(t))==null||e.focus({preventScroll:!0})})},focusLastToggle({scope:t}){At(()=>{var e;(e=iA(t))==null||e.focus({preventScroll:!0})})}}}};Wn()(["dir","disabled","getRootNode","id","ids","loopFocus","multiple","onValueChange","orientation","rovingFocus","value","defaultValue"]);Wn()(["value","disabled"]);const jy=Q({__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=t,r=e,i=pi(uA,{id:Qt(),...n,orientation:n.direction,defaultValue:n.modelValue,onValueChange:({value:a})=>{r("update:modelValue",a)},rovingFocus:!0,loopFocus:!0}),o=I(()=>aA(i,di)),s=X();return Ee(()=>{var a;return(a=s.value)==null?void 0:a.isOpen},a=>{a||!o.value.value.includes("dropdown")||o.value.setValue(o.value.value.filter(l=>l!=="dropdown"))}),Ee(()=>n.modelValue,a=>{o.value.setValue([...a])},{deep:!1}),(a,l)=>(E(),O("div",ne({class:["k-buttongroup",`k-buttongroup--direction-${a.direction}`]},o.value.getRootProps()),[F(a.$slots,"default",{getItemProps:o.value.getItemProps},()=>[a.items?(E(!0),O(De,{key:0},_t(a.items,({id:u,...c})=>(E(),$(ze,ne({class:"k-buttongroup__item",variant:"tertiary",ref_for:!0},{...c,...o.value.getItemProps({value:u})}),null,16))),256)):R("",!0)]),a.dropdownItems||a.$slots.dropdown?(E(),$(pu,ne({key:0,ref_key:"dropdown",ref:s,keepOpen:!0,items:a.dropdownItems},o.value.getItemProps({value:"dropdown"})),{default:Z(({close:u})=>[F(a.$slots,"dropdown",{close:u,getItemProps:o.value.getItemProps})]),_:3},16,["items"])):R("",!0)],16))}}),cA=["href"],dA={class:"k-file-thumbnail__info"},pA=["value","disabled"],hA={class:"k-file-thumbnail__info-footer"},fA={key:0,class:"k-file-thumbnail__size"},mA=Q({__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=I(()=>{let p=[...n,...r.icons].find(f=>r.value.type.match(f.pattern));return p?.icon||"fa-pro-solid:file"}),o=I(()=>r.disabled?"a":"div"),s=I(()=>r.disabled?{click:p=>{p.preventDefault(),ad(r.value)}}:{}),a=I(()=>r.disabled?{title:r.disabled?"Download":null}:{});function l(){r.disabled||ad(r.value)}const u=X(),c=X([]),d=X();function h(){var p;(p=u.value)==null||p.blur()}return(p,f)=>(E(),$(Qe(o.value),ne({class:["k-file-thumbnail",{"k-file-thumbnail--clickable":p.disabled}]},a.value,Bg(s.value)),{default:Z(()=>[he(ni,{class:"k-file-thumbnail__preview",gap:"0rem",justify:"center",align:"center"},{default:Z(()=>[F(p.$slots,"icon",{},()=>[p.value.type.includes("image")?(E(),O("a",{key:0,href:p.value.url,target:"_blank"},[he(au,{class:"k-file-thumbnail__preview-image",src:p.value.url,alt:p.value.name,size:"contain",aspectRatio:"1/1"},null,8,["src","alt"])],8,cA)):(E(),$(B(Ze),{key:1,icon:i.value,class:"k-file-thumbnail__preview-icon"},null,8,["icon"]))])]),_:3}),z("div",dA,[z("input",{type:"text",ref_key:"input",ref:u,class:"k-file-thumbnail__name",value:p.value.name,onKeypress:op(h,["enter"]),disabled:p.disabled||!p.rename,onInput:f[0]||(f[0]=m=>p.$emit("rename",m.target.value))},null,40,pA),z("div",hA,[p.value.size?(E(),O("span",fA,oe(B(Np)(p.value.size)),1)):R("",!0)])]),he(jy,{modelValue:c.value,"onUpdate:modelValue":f[2]||(f[2]=m=>{c.value=m.filter(g=>g!=="download")}),disabled:p.disabled},{default:Z(({getItemProps:m})=>[p.value.url?(E(),$(ze,ne({key:0,is:"a",href:p.value.url,class:"k-file-thumbnail__download",onClick:Ba(l,["prevent"]),icon:"fa-pro-light:arrow-down-to-line",variant:"tertiary"},m({value:"download"})),null,16,["href"])):R("",!0)]),dropdown:Z(({close:m})=>[p.value.url?(E(),$(ze,{key:0,is:"a",href:p.value.url,class:"k-file-thumbnail__download",onClick:Ba(l,["prevent"]),iconRight:"fa-pro-light:arrow-down-to-line",label:p.labels.download,variant:"tertiary"},null,8,["href","label"])):R("",!0),he(B(ZO),null,{default:Z(({copy:g,copied:y})=>[p.value.url?(E(),$(ze,{key:0,class:"k-file-thumbnail__copy",iconRight:"fa-pro-light:copy",label:p.labels.copy,variant:"tertiary",promise:d.value,onClick:()=>{d.value=g(p.value.url)}},null,8,["label","promise","onClick"])):R("",!0)]),_:1}),p.disabled?R("",!0):(E(),$(ze,{key:1,variant:"danger",label:p.labels.delete,class:"k-file-thumbnail__delete",iconRight:"fa-pro-light:times",onClick:f[1]||(f[1]=g=>p.$emit("delete"))},null,8,["label"]))]),_:1},8,["modelValue","disabled"]),p.sortable?(E(),$(B(Ze),{key:0,icon:"fa-pro-solid:arrows-alt-v",class:"k-file-thumbnail__handle"})):R("",!0)]),_:3},16,["class"]))}}),gA={key:0,class:"k-file__label-wrapper"},vA={key:1,class:"k-file__sublabel"},ML=Q({__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."},fileSizeError:{default:"The file size exceeds the allowed limit."},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",copy:"Copy link",maxSize:"Maximum size"})}},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=I(()=>n.multiple||!n.modelValue),a=I({get(){return n.modelValue?n.modelValue instanceof Array?n.modelValue:[n.modelValue]:[]},set(u){n.multiple&&i(u)}}),l=rn("k-file",{variants:{}});return(u,c)=>(E(),O("div",{class:Ce(B(l)({}))},[u.label||u.sublabel||u.$slots.sublabel||u.$slots.label?(E(),O("div",gA,[u.label||u.$slots.label?(E(),O("label",{key:0,class:Ce(["k-file__label",{"k-file__label-required":u.required}])},[F(u.$slots,"label",{},()=>[$e(oe(u.label),1)])],2)):R("",!0),u.sublabel||u.$slots.sublabel?(E(),O("span",vA,[F(u.$slots,"sublabel",{},()=>[$e(oe(u.sublabel),1)])])):R("",!0)])):R("",!0),he(ni,{direction:"column"},{default:Z(()=>[a.value.length?(E(),$(B(Ly),{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:Z(({element:d,index:h})=>[(E(),$(mA,{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},Cs({_:2},[_t(u.$slots,(p,f)=>({name:f,fn:Z(()=>[F(u.$slots,f,{item:d})])}))]),1032,["disabled","sortable","rename","value","onRename","onDelete","icons","labels"]))]),_:3},8,["modelValue","disabled"])):R("",!0),s.value?(E(),$(GO,{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,fileSizeError:u.fileSizeError,rename:u.rename,labels:u.labels},{"drop-message":Z(({extensions:d})=>[F(u.$slots,"drop-message",{extensions:d})]),"custom-message":Z(()=>[F(u.$slots,"custom-message")]),_:3},8,["accept","value","multiple","required","disabled","upload-options","upload","dropMessage","fileSizeError","rename","labels"])):R("",!0)]),_:3})],2))}}),zy=new Set,yt=new WeakMap,Gi=new WeakMap,ii=new WeakMap,fd=new WeakMap,yA=new WeakMap,Ji=new WeakMap,rl=new WeakMap,No=new WeakSet;let xr,Lp=0,Vp=0;const Rn="__aa_tgt",us="__aa_del",il="__aa_new",bA=t=>{const e=SA(t);e&&e.forEach(n=>TA(n))},kA=t=>{t.forEach(e=>{e.target===xr&&xA(),yt.has(e.target)&&hi(e.target)})};function wA(t){const e=fd.get(t);e?.disconnect();let n=yt.get(t),r=0;const i=5;n||(n=Xi(t),yt.set(t,n));const{offsetWidth:o,offsetHeight:s}=xr,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&&hi(t)},{root:xr,threshold:1,rootMargin:a});l.observe(t),fd.set(t,l)}function hi(t){clearTimeout(rl.get(t));const e=yu(t),n=cs(e)?500:e.duration;rl.set(t,setTimeout(async()=>{const r=ii.get(t);try{await r?.finished,yt.set(t,Xi(t)),wA(t)}catch{}},n))}function xA(){clearTimeout(rl.get(xr)),rl.set(xr,setTimeout(()=>{zy.forEach(t=>Uy(t,e=>Hy(()=>hi(e))))},100))}function EA(t){setTimeout(()=>{yA.set(t,setInterval(()=>Hy(hi.bind(null,t)),2e3))},Math.round(2e3*Math.random()))}function Hy(t){typeof requestIdleCallback=="function"?requestIdleCallback(()=>t()):requestAnimationFrame(()=>t())}let md,Ho;const CA=typeof window<"u"&&"ResizeObserver"in window;CA&&(xr=document.documentElement,md=new MutationObserver(bA),Ho=new ResizeObserver(kA),window.addEventListener("scroll",()=>{Vp=window.scrollY,Lp=window.scrollX}),Ho.observe(xr));function SA(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(sc(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(us in i)return!1;sc(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(us in i)return!1;i instanceof Element&&(e.add(i),sc(n.target,i),Gi.set(i,[n.previousSibling,n.nextSibling]))}}return e},new Set)}function sc(t,e){!e&&!(Rn in t)?Object.defineProperty(t,Rn,{value:t}):e&&!(Rn in e)&&Object.defineProperty(e,Rn,{value:t})}function TA(t){var e;const n=t.isConnected,r=yt.has(t);n&&Gi.has(t)&&Gi.delete(t),ii.has(t)&&((e=ii.get(t))===null||e===void 0||e.cancel()),il in t?Wf(t):r&&n?AA(t):r&&!n?MA(t):Wf(t)}function un(t){return Number(t.replace(/[^0-9.\-]/g,""))}function OA(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 Xi(t){const e=t.getBoundingClientRect(),{x:n,y:r}=OA(t);return{top:e.top+r,left:e.left+n,width:e.width,height:e.height}}function qy(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=un(a.paddingTop)+un(a.paddingBottom)+un(a.borderTopWidth)+un(a.borderBottomWidth),u=un(a.paddingLeft)+un(a.paddingRight)+un(a.borderRightWidth)+un(a.borderLeftWidth);r-=u,o-=u,i-=l,s-=l}return[r,o,i,s].map(Math.round)}function yu(t){return Rn in t&&Ji.has(t[Rn])?Ji.get(t[Rn]):{duration:250,easing:"ease-in-out"}}function Wy(t){if(Rn in t)return t[Rn]}function Bp(t){const e=Wy(t);return e?No.has(e):!1}function Uy(t,...e){e.forEach(n=>n(t,Ji.has(t)));for(let n=0;n<t.children.length;n++){const r=t.children.item(n);r&&e.forEach(i=>i(r,Ji.has(r)))}}function $p(t){return Array.isArray(t)?t:[t]}function cs(t){return typeof t=="function"}function AA(t){const e=yt.get(t),n=Xi(t);if(!Bp(t))return yt.set(t,n);let r;if(!e)return;const i=yu(t);if(typeof i!="function"){const o=e.left-n.left,s=e.top-n.top,[a,l,u,c]=qy(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]=$p(i(t,"remain",e,n));r=new Animation(o),r.play()}ii.set(t,r),yt.set(t,n),r.addEventListener("finish",hi.bind(null,t))}function Wf(t){il in t&&delete t[il];const e=Xi(t);yt.set(t,e);const n=yu(t);if(!Bp(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]=$p(n(t,"add",e));r=new Animation(i),r.play()}ii.set(t,r),r.addEventListener("finish",hi.bind(null,t))}function Uf(t,e){var n;t.remove(),yt.delete(t),Gi.delete(t),ii.delete(t),(n=fd.get(t))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(us in t&&delete t[us],Object.defineProperty(t,il,{value:!0,configurable:!0}),e&&t instanceof HTMLElement)for(const r in e)t.style[r]=""},0)}function MA(t){var e;if(!Gi.has(t)||!yt.has(t))return;const[n,r]=Gi.get(t);Object.defineProperty(t,us,{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=Wy(t))===null||e===void 0||e.appendChild(t),!Bp(t))return Uf(t);const[s,a,l,u]=DA(t),c=yu(t),d=yt.get(t);(i!==Lp||o!==Vp)&&_A(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(!cs(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]=$p(c(t,"remove",d));m?.styleReset!==!1&&(p=m?.styleReset||p,Object.assign(t.style,p)),h=new Animation(f),h.play()}ii.set(t,h),h.addEventListener("finish",Uf.bind(null,t,p))}function _A(t,e,n,r){const i=Lp-e,o=Vp-n,s=document.documentElement.style.scrollBehavior;if(getComputedStyle(xr).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(!cs(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 DA(t){const e=yt.get(t),[n,,r]=qy(t,e,Xi(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=yt.get(i)||Xi(i),a=Math.round(e.top-s.top)-un(o.borderTopWidth),l=Math.round(e.left-s.left)-un(o.borderLeftWidth);return[a,l,n,r]}function NA(t,e={}){return md&&Ho&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!cs(e)&&!e.disrespectUserMotionPreference||(No.add(t),getComputedStyle(t).position==="static"&&Object.assign(t.style,{position:"relative"}),Uy(t,hi,EA,n=>Ho?.observe(n)),cs(e)?Ji.set(t,e):Ji.set(t,{duration:250,easing:"ease-in-out",...e}),md.observe(t,{childList:!0}),zy.add(t))),Object.freeze({parent:t,enable:()=>{No.add(t)},disable:()=>{No.delete(t)},isEnabled:()=>No.has(t)})}const Kf={mounted:(t,e)=>{NA(t,e.value||{})},getSSRProps:()=>({})},IA=["disabled"],RA={key:0,class:"k-expandable__title"},PA={key:1,class:"k-expandable__subtitle"},FA={key:2,class:"k-expandable__actions"},_L=Q({__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=ip(),r=I(()=>n.actions),i=I(()=>n.footer),o=I(()=>n.default),s=X(e.expanded),a=()=>{!e.expandable||!o.value||(s.value=!s.value)},l=rn("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)=>Va((E(),O("fieldset",{disabled:u.disabled,class:Ce(B(l)({disabled:u.disabled,expandable:u.expandable,expanded:s.value,variant:u.variant}))},[he(ze,{class:Ce(["k-expandable__header",{"k-expandable__header--open":s.value}]),is:"legend",tabindex:"0",onKeydown:op(a,["enter"]),onClick:a,variant:"tertiary"},Cs({default:Z(()=>[u.$slots.title||u.title?(E(),O("span",RA,[F(u.$slots,"title",{},()=>[$e(oe(u.title),1)])])):R("",!0),u.$slots.subtitle||u.subtitle?(E(),O("span",PA,[F(u.$slots,"subtitle",{},()=>[$e(oe(u.subtitle),1)])])):R("",!0),r.value?(E(),O("span",FA,[F(u.$slots,"actions")])):R("",!0)]),_:2},[u.expandable?{name:"icon-left",fn:Z(()=>[he(B(Ze),{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(),O(De,{key:0},[Va((E(),$(ni,{class:"k-expandable__content",direction:"column",gap:u.gap},{default:Z(()=>[F(u.$slots,"default")]),_:3},8,["gap"])),[[B(Kf)]]),i.value?(E(),$(ni,{key:0,justify:"center",align:"center",class:"k-expandable__footer"},{default:Z(()=>[F(u.$slots,"footer")]),_:3})):R("",!0)],64)):R("",!0)],10,IA)),[[B(Kf)]])}});function Je(t){this.content=t}Je.prototype={constructor:Je,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 Je(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 Je(n)},addToStart:function(t,e){return new Je([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Je(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 Je(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=Je.from(t),t.size?new Je(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Je.from(t),t.size?new Je(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Je.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}};Je.from=function(t){if(t instanceof Je)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Je(e)};function Ky(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=Ky(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Gy(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=Gy(s.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class M{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 M(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 M(r,i)}cutByIndex(e,n){return e==n?M.empty:e==0&&n==this.content.length?this:new M(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 M(i,o)}addToStart(e){return new M([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new M(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 Ky(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Gy(this,e,n,r)}findIndex(e,n=-1){if(e==0)return la(0,e);if(e==this.size)return la(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?la(r+1,s):la(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 M.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new M(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return M.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 M(n||e,r)}static from(e){if(!e)return M.empty;if(e instanceof M)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new M([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}M.empty=new M([],0);const ac={index:0,offset:0};function la(t,e){return ac.index=t,ac.offset=e,ac}function ol(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(!ol(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ol(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ke=class gd{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&&ol(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 gd.none;if(e instanceof gd)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ke.none=[];class sl 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=Xy(this.content,e+this.openStart,n);return r&&new V(r,this.openStart,this.openEnd)}removeBetween(e,n){return new V(Jy(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(M.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(M.empty,0,0);function Jy(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(Jy(o.content,e-i-1,n-i-1)))}function Xy(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=Xy(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function LA(t,e,n){if(n.openStart>t.depth)throw new sl("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new sl("Inconsistent open depths");return Yy(t,e,n,0)}function Yy(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=Yy(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 Xr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=VA(n,t);return Xr(o,Qy(t,s,a,e,r))}else return Xr(o,al(t,e,r))}function Zy(t,e){if(!e.type.compatibleContent(t.type))throw new sl("Cannot join "+e.type.name+" onto "+t.type.name)}function vd(t,e,n){let r=t.node(n);return Zy(r,e.node(n)),r}function Jr(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 qo(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&&(Jr(t.nodeAfter,r),o++));for(let a=o;a<s;a++)Jr(i.child(a),r);e&&e.depth==n&&e.textOffset&&Jr(e.nodeBefore,r)}function Xr(t,e){return t.type.checkContent(e),t.copy(e)}function Qy(t,e,n,r,i){let o=t.depth>i&&vd(t,e,i+1),s=r.depth>i&&vd(n,r,i+1),a=[];return qo(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(Zy(o,s),Jr(Xr(o,Qy(t,e,n,r,i+1)),a)):(o&&Jr(Xr(o,al(t,e,i+1)),a),qo(e,n,i,a),s&&Jr(Xr(s,al(n,r,i+1)),a)),qo(r,null,i,a),new M(a)}function al(t,e,n){let r=[];if(qo(null,t,n,r),t.depth>n){let i=vd(t,e,n+1);Jr(Xr(i,al(t,e,n+1)),r)}return qo(e,null,n,r),new M(r)}function VA(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(M.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class ds{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 ke.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 ll(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 ds(n,r,o)}static resolveCached(e,n){let r=Gf.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 Gf.set(e,r=new BA);let i=r.elts[r.i]=ds.resolve(e,n);return r.i=(r.i+1)%$A,i}}class BA{constructor(){this.elts=[],this.i=0}}const $A=12,Gf=new WeakMap;class ll{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 jA=Object.create(null);let fr=class yd{constructor(e,n,r,i=ke.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||M.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&&ol(this.attrs,n||e.defaultAttrs||jA)&&ke.sameSet(this.marks,r||ke.none)}copy(e=null){return e==this.content?this:new yd(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new yd(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 LA(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 ds.resolveCached(this,e)}resolveNoCache(e){return ds.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()+")"),eb(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=M.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=ke.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(!ke.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=M.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};fr.prototype.text=void 0;class ul extends fr{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):eb(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 ul(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ul(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 eb(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class oi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new zA(e,n);if(r.next==null)return oi.empty;let i=tb(r);r.next&&r.err("Unexpected trailing text");let o=JA(GA(i));return XA(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 M.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(`
9
9
  `)}}oi.empty=new oi(!0);class zA{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 tb(t){let e=[];do e.push(HA(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function HA(t){let e=[];do e.push(qA(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function qA(t){let e=KA(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=WA(t,e);else break;return e}function Jf(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function WA(t,e){let n=Jf(t),r=n;return t.eat(",")&&(t.next!="}"?r=Jf(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function UA(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 KA(t){if(t.eat("(")){let e=tb(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=UA(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 GA(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 nb(t,e){return e-t}function Xf(t,e){let n=[];return r(e),n.sort(nb);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 JA(t){let e=Object.create(null);return n(Xf(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]);Xf(t,l).forEach(c=>{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[r.join(",")]=new oi(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(nb);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function XA(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 rb(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 ib(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 ob(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 sb(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new ZA(t,r,e[r]);return n}let Yf=class ab{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=sb(e,r.attrs),this.defaultAttrs=rb(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==oi.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:ib(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new fr(this,this.computeAttrs(e),M.from(n),ke.setFrom(r))}createChecked(e=null,n,r){return n=M.from(n),this.checkContent(n),new fr(this,this.computeAttrs(e),n,ke.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=M.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(M.empty,!0);return o?new fr(this,e,n.append(o),ke.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){ob(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:ke.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new ab(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 YA(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 ZA{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?YA(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class bu{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=sb(e,i.attrs),this.excluded=null;let o=rb(this.attrs);this.instance=o?new ke(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ke(this,ib(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new bu(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){ob(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class lb{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=Je.from(e.nodes),n.marks=Je.from(e.marks||{}),this.nodes=Yf.compile(this.spec.nodes,this),this.marks=bu.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]=oi.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?Zf(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==""?[]:Zf(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 Yf){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 ul(r,r.defaultAttrs,e,ke.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return fr.fromJSON(this,e)}markFromJSON(e){return ke.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Zf(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 QA(t){return t.tag!=null}function eM(t){return t.style!=null}class mr{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(QA(i))this.tags.push(i);else if(eM(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 em(this,n,!1);return r.addAll(e,ke.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new em(this,n,!0);return r.addAll(e,ke.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(rM(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=tm(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=tm(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new mr(e,mr.schemaRules(e)))}}const ub={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},tM={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},cb={ol:!0,ul:!0},ps=1,bd=2,Da=4;function Qf(t,e,n){return e!=null?(e?ps:0)|(e==="full"?bd:0):t&&t.whitespace=="pre"?ps|bd:n&-5}class ua{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=ke.none,this.match=o||(s&Da?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(M.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&ps)){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=M.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(M.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&&!ub.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class em{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=Qf(null,n.preserveWhitespace,0)|(r?Da:0);i?o=new ua(i.type,i.attrs,ke.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new ua(null,null,ke.none,!0,null,s):o=new ua(e.schema.topNodeType,null,ke.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&bd?"full":this.localPreserveWS||(i.options&ps)>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,`
10
10
  `);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;cb.hasOwnProperty(s)&&this.parser.normalizeLists&&nM(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:tM.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(ub.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(`
11
11
  `),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=ke.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):nm(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=Qf(e,o,s.options);s.options&Da&&s.content.length==0&&(a|=Da);let l=ke.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):nm(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new ua(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|=ps)}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 nM(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&cb.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function rM(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function tm(t){let e={};for(let n in t)e[n]=t[n];return e}function nm(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 fi{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=lc(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}=Na(lc(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&&Na(lc(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Na(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new fi(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=rm(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return rm(e.marks)}}function rm(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function lc(t){return t.document||window.document}const im=new WeakMap;function iM(t){let e=im.get(t);return e===void 0&&im.set(t,e=oM(t)),e}function oM(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 Na(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=iM(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}=Na(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 db=65535,pb=Math.pow(2,16);function sM(t,e){return t+e*pb}function om(t){return t&db}function aM(t){return(t-(t&db))/pb}const hb=1,fb=2,Ia=4,mb=8;class kd{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&mb)>0}get deletedBefore(){return(this.delInfo&(hb|Ia))>0}get deletedAfter(){return(this.delInfo&(fb|Ia))>0}get deletedAcross(){return(this.delInfo&Ia)>0}}class Ot{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Ot.empty)return Ot.empty}recover(e){let n=0,r=om(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+aM(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:sM(a/3,e-l),m=e==l?fb:e==d?hb:Ia;return(n<0?e!=l:e!=d)&&(m|=mb),new kd(p,m,f)}i+=c-u}return r?e+i:new kd(e+i,0,null)}touches(e,n){let r=0,i=om(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 Ot(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ot.empty:new Ot(e<0?[0,-e,0]:[0,0,e])}}Ot.empty=new Ot([]);class Bi{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 Bi(this.maps,this.mirror,e,n)}copy(){return new Bi(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 Bi;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 kd(e,i,null)}}const uc=Object.create(null);class st{getMap(){return Ot.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=uc[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 uc)throw new RangeError("Duplicate use of step JSON ID "+e);return uc[e]=n,n.prototype.jsonID=e,n}}class Fe{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Fe(e,null)}static fail(e){return new Fe(null,e)}static fromReplace(e,n,r,i){try{return Fe.ok(e.replace(n,r,i))}catch(o){if(o instanceof sl)return Fe.fail(o.message);throw o}}}function jp(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(jp(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return M.fromArray(r)}class ar extends st{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(jp(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 Fe.fromReplace(e,this.from,this.to,o)}invert(){return new gn(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 ar(n.pos,r.pos,this.mark)}merge(e){return e instanceof ar&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ar(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 ar(n.from,n.to,e.markFromJSON(n.mark))}}st.jsonID("addMark",ar);class gn extends st{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(jp(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Fe.fromReplace(e,this.from,this.to,r)}invert(){return new ar(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 gn(n.pos,r.pos,this.mark)}merge(e){return e instanceof gn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new gn(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 gn(n.from,n.to,e.markFromJSON(n.mark))}}st.jsonID("removeMark",gn);class lr extends st{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new V(M.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 lr(this.pos,n.marks[i]);return new lr(this.pos,this.mark)}}return new Yi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new lr(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 lr(n.pos,e.markFromJSON(n.mark))}}st.jsonID("addNodeMark",lr);class Yi extends st{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new V(M.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new lr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Yi(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 Yi(n.pos,e.markFromJSON(n.mark))}}st.jsonID("removeNodeMark",Yi);class je extends st{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&wd(e,this.from,this.to)?Fe.fail("Structure replace would overwrite content"):Fe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ot([this.from,this.to-this.from,this.slice.size])}invert(e){return new je(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 je(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof je)||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 je(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 je(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 je(n.from,n.to,V.fromJSON(e,n.slice),!!n.structure)}}st.jsonID("replace",je);class qe extends st{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&&(wd(e,this.from,this.gapFrom)||wd(e,this.gapTo,this.to)))return Fe.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Fe.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Fe.fromReplace(e,this.from,this.to,r):Fe.fail("Content does not fit in gap")}getMap(){return new Ot([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 qe(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 qe(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 qe(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(e,n.slice),n.insert,!!n.structure)}}st.jsonID("replaceAround",qe);function wd(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 lM(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 gn(h,p,d[m])));a&&a.to==h?a.to=p:o.push(a=new ar(h,p,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function uM(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 bu){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 gn(s.from,s.to,s.style)))}function zp(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 je(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 gn(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(M.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),s.push(new je(a+h.index,a+h.index+h[0].length,f))}}a=c}if(!r.validEnd){let l=r.fillBefore(M.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 cM(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function uo(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||!cM(r,i,o))break}return null}function dM(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=M.empty,d=0;for(let f=o,m=!1;f>n;f--)m||r.index(f)>0?(m=!0,c=M.from(r.node(f).copy(c)),d++):l--;let h=M.empty,p=0;for(let f=o,m=!1;f>n;f--)m||i.after(f+1)<i.end(f)?(m=!0,h=M.from(i.node(f).copy(h)),p++):u++;t.step(new qe(l,u,s,a,new V(c.append(h),d,p),c.size-d,!0))}function Hp(t,e,n=null,r=t){let i=pM(t,e),o=i&&hM(r,e);return o?i.map(sm).concat({type:e,attrs:n}).concat(o.map(sm)):null}function sm(t){return{type:t,attrs:null}}function pM(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 hM(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 fM(t,e,n){let r=M.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=M.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new qe(i,o,i,o,new V(r,0,0),n.length,!0))}function mM(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)&&gM(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&&vb(t,s,a,o),zp(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 qe(d,h,d+1,h-1,new V(M.from(r.create(l,null,s.marks)),0,0),1,!0)),u===!0&&gb(t,s,a,o),!1}})}function gb(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 vb(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(`
@@ -13,11 +13,11 @@ import{G as ka,q as Q,r as X,e as $,o as E,X as qt,E as Ee,b as I,c as O,i as qn
13
13
  `),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:Xe(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(nn&&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&&pt)&&si(a.node,a.offset,c.anchorNode,c.anchorOffset)&&si(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?Wr:wm,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=En:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Wr:En}r=s}this.dirty=Wr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Wr:wm;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Pb extends Is{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==zt&&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 n_ extends Is{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 ai extends Is{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=fi.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ai(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&En||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=En&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=zt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=zt}}slice(e,n,r){let i=ai.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Od(o,n,s,r)),e>0&&(o=Od(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 vr extends Is{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}=fi.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=Bb(c,r,n),u?l=new r_(e,n,r,i,c,d||null,h,u,o,s+1):n.isText?new Cu(e,n,r,i,c,h,o):new vr(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=()=>M.empty)}return e}matchesNode(e,n,r){return this.dirty==zt&&e.eq(this.node)&&cl(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 o_(this,s&&s.node,e);l_(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?ke.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==Wr)&&(s&&this.protectLocalComposition(e,s),Lb(this.contentDOM,this.children,e),Qi&&u_(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof se)||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=c_(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 n_(this,o,n,i);e.input.compositionNodes.push(s),this.children=Od(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==En||!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=zt}updateOuterDeco(e){if(cl(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Vb(this.dom,this.nodeDOM,Td(this.outerDeco,this.node,n),Td(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 xm(t,e,n,r,i){Bb(r,e,t);let o=new vr(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Cu extends vr{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==En||this.dirty!=zt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=zt||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=zt,!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 Cu(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=En)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Fb extends Is{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==zt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class r_ extends vr{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==En)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 Lb(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=Em(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof ai){let l=r?r.previousSibling:t.lastChild;Lb(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Em(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Wo=function(t){t&&(this.nodeName=t)};Wo.prototype=Object.create(null);const Ur=[new Wo];function Td(t,e,n){if(t.length==0)return Ur;let r=n?Ur[0]:new Wo,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new Wo(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new Wo(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 Vb(t,e,n,r){if(n==Ur&&r==Ur)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=Ur[0]),i=l}i_(i,a||Ur[0],s)}return i}function i_(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 Bb(t,e,n){return Vb(t,t,Ur,Td(e,n,t.nodeType!=1))}function cl(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 Em(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class o_{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=s_(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=zt,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=ai.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==En&&s.dom==s.contentDOM&&(s.dirty=Wr),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 vr){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!=En&&cl(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=Wr,d.updateChildren(i,s+1),d.dirty=zt),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)||!cl(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=vr.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=vr.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 Pb(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 ai;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Cu)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((pt||rt)&&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 Fb(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 s_(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 ai)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 a_(t,e){return t.type.side-e.type.side}function l_(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(a_);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 u_(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 c_(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 Od(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 Up(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(Eu(n)){for(l=s;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&Y.isSelectable(d)&&i.parent&&!(d.isInline&&FM(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;u=new Y(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=Kp(t,c,a,d)}return u}function $b(t){return t.editable?t.hasFocus():zb(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Bn(t,e=!1){let n=t.state.selection;if(jb(t,n),!!$b(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&rt){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&si(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)p_(t);else{let{anchor:r,head:i}=n,o,s;Cm&&!(n instanceof se)&&(n.$from.parent.inlineContent||(o=Sm(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Sm(t,n.to))),t.docView.setSelection(r,i,t,e),Cm&&(o&&Tm(o),s&&Tm(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&d_(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Cm=pt||rt&&Ab<63;function Sm(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(pt&&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",pt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Tm(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function d_(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(()=>{(!$b(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function p_(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,Xe(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&bt&&gr<=11&&(r.disabled=!0,r.disabled=!1)}function jb(t,e){if(e instanceof Y){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Om(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Om(t)}function Om(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Kp(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||se.between(e,n,r)}function Am(t){return t.editable&&!t.hasFocus()?!1:zb(t)}function zb(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 h_(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return si(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Ad(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&&le.findFrom(o,e)}function er(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Mm(t,e,n){let r=t.state.selection;if(r instanceof se)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 er(t,new se(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Ad(t.state,e);return i&&i instanceof Y?er(t,i):!1}else if(!(Vt&&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?Y.isSelectable(o)?er(t,new Y(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Ns?er(t,new se(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Y&&r.node.isInline)return er(t,new se(e>0?r.$to:r.$from));{let i=Ad(t.state,e);return i?er(t,i):!1}}}function dl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Uo(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Si(t,e){return e<0?f_(t):m_(t)}function f_(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(nn&&n.nodeType==1&&r<dl(n)&&Uo(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Uo(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Hb(n))break;{let a=n.previousSibling;for(;a&&Uo(a,-1);)i=n.parentNode,o=Xe(a),a=a.previousSibling;if(a)n=a,r=dl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Md(t,n,r):i&&Md(t,i,o)}function m_(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=dl(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Uo(a,1))o=n,s=++r;else break}else{if(Hb(n))break;{let a=n.nextSibling;for(;a&&Uo(a,1);)o=a.parentNode,s=Xe(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=dl(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Md(t,o,s)}function Hb(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function g_(t,e){for(;t&&e==t.childNodes.length&&!Ds(t);)e=Xe(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 v_(t,e){for(;t&&!e&&!Ds(t);)e=Xe(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 Md(t,e,n){if(e.nodeType!=3){let o,s;(s=g_(e,n))?(e=s,n=0):(o=v_(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Eu(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&&Bn(t)},50)}function _m(t,e){let n=t.state.doc.resolve(e);if(!(rt||BM)&&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 Dm(t,e,n){let r=t.state.selection;if(r instanceof se&&!r.empty||n.indexOf("s")>-1||Vt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Ad(t.state,e);if(s&&s instanceof Y)return er(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof jt?le.near(s,e):le.findFrom(s,e);return a?er(t,a):!1}return!1}function Nm(t,e){if(!(t.state.selection instanceof se))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 Im(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function y_(t){if(!pt||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;Im(t,r,"true"),setTimeout(()=>Im(t,r,"false"),20)}return!1}function b_(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function k_(t,e){let n=e.keyCode,r=b_(e);if(n==8||Vt&&n==72&&r=="c")return Nm(t,-1)||Si(t,-1);if(n==46&&!e.shiftKey||Vt&&n==68&&r=="c")return Nm(t,1)||Si(t,1);if(n==13||n==27)return!0;if(n==37||Vt&&n==66&&r=="c"){let i=n==37?_m(t,t.state.selection.from)=="ltr"?-1:1:-1;return Mm(t,i,r)||Si(t,i)}else if(n==39||Vt&&n==70&&r=="c"){let i=n==39?_m(t,t.state.selection.from)=="ltr"?1:-1:1;return Mm(t,i,r)||Si(t,i)}else{if(n==38||Vt&&n==80&&r=="c")return Dm(t,-1,r)||Si(t,-1);if(n==40||Vt&&n==78&&r=="c")return y_(t)||Dm(t,1,r)||Si(t,1);if(r==(Vt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Gp(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")||fi.fromSchema(t.state.schema),a=Jb(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u=l.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=Gb[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,`
14
14
 
15
15
  `);return{dom:l,text:h,slice:e}}function qb(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(M.from(t.state.schema.text(e.replace(/\r\n?/g,`
16
- `))),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=fi.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=C_(n),Ns&&S_(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")||mr.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!w_.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)a=T_(Rm(a,+c[1],+c[2]),c[4]);else if(a=V.maxOpen(x_(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=Rm(a,d,h)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const w_=/^(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 x_(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&&Ub(a,i,s,o[o.length-1],0))o[o.length-1]=l;else{o.length&&(o[o.length-1]=Kb(o[o.length-1],i.length));let u=Wb(s,a);o.push(u),r=r.matchType(u.type),i=a}}),o)return M.from(o)}return t}function Wb(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,M.from(t));return t}function Ub(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Ub(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(M.from(Wb(n,t,i+1))))}}function Kb(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Kb(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(M.empty,!0);return t.copy(n.append(r))}function _d(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=_d(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(M.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Rm(t,e,n){return e<t.openStart&&(t=new V(_d(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new V(_d(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Gb={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 Pm=null;function Jb(){return Pm||(Pm=document.implementation.createHTMLDocument("title"))}let vc=null;function E_(t){let e=window.trustedTypes;return e?(vc||(vc=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),vc.createHTML(t)):t}function C_(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Jb().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Gb[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=E_(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function S_(t){let e=t.querySelectorAll(rt?"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 T_(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=M.from(l.create(r[a+1],i)),o++,s++}return new V(i,o,s)}const ht={},ft={},O_={touchstart:!0,touchmove:!0};class A_{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 M_(t){for(let e in ht){let n=ht[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{D_(t,r)&&!Jp(t,r)&&(t.editable||!(r.type in ft))&&n(t,r)},O_[e]?{passive:!0}:void 0)}pt&&t.dom.addEventListener("input",()=>null),Dd(t)}function ur(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function __(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 Dd(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Jp(t,r))})}function Jp(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function D_(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 N_(t,e){!Jp(t,e)&&ht[e.type]&&(t.editable||!(e.type in ft))&&ht[e.type](t,e)}ft.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Yb(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Pn&&rt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Qi&&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,zr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||k_(t,n)?n.preventDefault():ur(t,"key")};ft.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ft.keypress=(t,e)=>{let n=e;if(Yb(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Vt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof se)||!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 Su(t){return{left:t.clientX,top:t.clientY}}function I_(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Xp(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 zi(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 R_(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(zi(t,new Y(n)),!0):!1}function P_(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof Y&&(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(Y.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?(zi(t,Y.create(t.state.doc,i)),!0):!1}function F_(t,e,n,r,i){return Xp(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?P_(t,n):R_(t,n))}function L_(t,e,n,r){return Xp(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function V_(t,e,n,r){return Xp(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||B_(t,n,r)}function B_(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(zi(t,se.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)zi(t,se.create(r,a+1,a+1+s.content.size));else if(Y.isSelectable(s))zi(t,Y.create(r,a));else continue;return!0}}function Yp(t){return pl(t)}const Xb=Vt?"metaKey":"ctrlKey";ht.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Yp(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&I_(n,t.input.lastClick)&&!n[Xb]&&(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(Su(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new $_(t,s,n,!!r)):(o=="doubleClick"?L_:V_)(t,s.pos,s.inside,n)?n.preventDefault():ur(t,"pointer"))};class $_{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[Xb],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 Y&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&nn&&!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)),ur(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(()=>Bn(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(Su(e))),this.updateAllowDefault(e),this.allowDefault||!n?ur(this.view,"pointer"):F_(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pt&&this.mightDrag&&!this.mightDrag.node.isAtom||rt&&!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)?(zi(this.view,le.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):ur(this.view,"pointer")}move(e){this.updateAllowDefault(e),ur(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)}}ht.touchstart=t=>{t.input.lastTouch=Date.now(),Yp(t),ur(t,"pointer")};ht.touchmove=t=>{t.input.lastTouch=Date.now(),ur(t,"pointer")};ht.contextmenu=t=>Yp(t);function Yb(t,e){return t.composing?!0:pt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const j_=Pn?5e3:-1;ft.compositionstart=ft.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof se&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),pl(t,!0),t.markCursor=null;else if(pl(t,!e.selection.empty),nn&&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}Zb(t,j_)};ft.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++,Zb(t,20))};function Zb(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>pl(t),e))}function Qb(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=H_());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function z_(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=RM(e.focusNode,e.focusOffset),r=PM(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 H_(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function pl(t,e=!1){if(!(Pn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Qb(t),e||t.docView&&t.docView.dirty){let n=Up(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 q_(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 ms=bt&&gr<15||Qi&&$M<604;ht.copy=ft.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=ms?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Gp(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):q_(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function W_(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function U_(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?gs(t,r.value,null,i,e):gs(t,r.textContent,r.innerHTML,i,e)},50)}function gs(t,e,n,r,i){let o=qb(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=W_(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 e0(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," "):""}ft.paste=(t,e)=>{let n=e;if(t.composing&&!Pn)return;let r=ms?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&gs(t,e0(r),r.getData("text/html"),i,n)?n.preventDefault():U_(t,n)};class t0{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const n0=Vt?"altKey":"ctrlKey";ht.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(Su(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)s=Y.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=Y.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:u,slice:c}=Gp(t,a);(!n.dataTransfer.files.length||!rt||Ab>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ms?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ms||n.dataTransfer.setData("text/plain",u),t.dragging=new t0(c,!n[n0],s)};ht.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ft.dragover=ft.dragenter=(t,e)=>e.preventDefault();ft.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Su(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=qb(t,e0(n.dataTransfer),ms?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[n0]);if(t.someProp("handleDrop",f=>f(t,n,s||V.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?bb(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&&Y.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new Y(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(Kp(t,p,u.doc.resolve(f)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))};ht.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())&&Bn(t)},20))};ht.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)};ht.beforeinput=(t,e)=>{if(rt&&Pn&&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,zr(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 ft)ht[t]=ft[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 hl{constructor(e,n){this.toDOM=e,this.spec=n||Yr,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 Mt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof hl&&(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 yr{constructor(e,n){this.attrs=e,this.spec=n||Yr}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 Mt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof yr&&vs(this.attrs,e.attrs)&&vs(this.spec,e.spec)}static is(e){return e.type instanceof yr}destroy(){}}class Zp{constructor(e,n){this.attrs=e,this.spec=n||Yr}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 Mt(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 Zp&&vs(this.attrs,e.attrs)&&vs(this.spec,e.spec)}destroy(){}}class Mt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Mt(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 Mt(e,e,new hl(n,r))}static inline(e,n,r,i){return new Mt(e,n,new yr(r,i))}static node(e,n,r,i){return new Mt(e,n,new Zp(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof yr}get widget(){return this.type instanceof hl}}const Ai=[],Yr={};class Pe{constructor(e,n){this.local=e.length?e:Ai,this.children=n.length?n:Ai}static create(e,n){return n.length?fl(n,e,0,Yr):nt}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==nt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Yr)}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?K_(this.children,s||[],e,n,r,i,o):s?new Pe(s.sort(Zr),Ai):nt}add(e,n){return n.length?this==nt?Pe.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=i0(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,fl(c,a,u+1,Yr)),o+=3}});let s=r0(o?o0(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Pe(s.length?this.local.concat(s).sort(Zr):this.local,i||this.children)}remove(e){return e.length==0||this==nt?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!=nt?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 Pe(i,r):nt}forChild(e,n){if(this==nt)return this;if(n.isLeaf)return Pe.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 yr){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 Pe(i.sort(Zr),Ai);return r?new ir([a,r]):a}return r||nt}eq(e){if(this==e)return!0;if(!(e instanceof Pe)||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 Qp(this.localsInner(e))}localsInner(e){if(this==nt)return Ai;if(e.inlineContent||!this.local.some(yr.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof yr||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Pe.empty=new Pe([],[]);Pe.removeOverlap=Qp;const nt=Pe.empty;class ir{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Yr));return ir.from(r)}forChild(e,n){if(n.isLeaf)return Pe.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=nt&&(o instanceof ir?r=r.concat(o.members):r.push(o))}return ir.from(r)}eq(e){if(!(e instanceof ir)||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?Qp(r?n:n.sort(Zr)):Ai}static from(e){switch(e.length){case 0:return nt;case 1:return e[0];default:return new ir(e.every(n=>n instanceof Pe)?e:e.reduce((n,r)=>n.concat(r instanceof Pe?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function K_(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!=nt?(a[u]=d,a[u+1]=p,a[u+2]=y):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=G_(a,t,e,n,i,o,s),c=fl(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 Pe(e.sort(Zr),a)}function r0(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 Mt(i.from+e,i.to+e,i.type))}return n}function G_(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 i0(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 o0(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function fl(t,e,n,r){let i=[],o=!1;e.forEach((a,l)=>{let u=i0(t,a,l+n);if(u){o=!0;let c=fl(u,a,n+l+1,r);c!=nt&&i.push(l,l+a.nodeSize,c)}});let s=r0(o?o0(t):t,-n).sort(Zr);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 Pe(s,i):nt}function Zr(t,e){return t.from-e.from||t.to-e.to}function Qp(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),Fm(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),Fm(e,i,r.copy(o.from,r.to)));break}}}return e}function Fm(t,e,n){for(;e<t.length&&Zr(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!=nt&&e.push(r)}),t.cursorWrapper&&e.push(Pe.create(t.state.doc,[t.cursorWrapper.deco])),ir.from(e)}const J_={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},X_=bt&&gr<=11;class Y_{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 Z_{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Y_,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]);bt&&gr<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),X_&&(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,J_)),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(Am(this.view)){if(this.suppressingSelectionUpdates)return Bn(this.view);if(bt&&gr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&si(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)&&Am(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(nn&&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||tD(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&&Eu(r)&&(u=Up(e))&&u.eq(le.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Bn(e),this.currentSelection.set(r)):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),Q_(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Bn(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(bt&&gr<=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?Xe(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?Xe(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 Lm=new WeakMap,Vm=!1;function Q_(t){if(!Lm.has(t)&&(Lm.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=nn,Vm)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."),Vm=!0}}function Bm(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return si(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function eD(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Bm(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?Bm(t,n):null}function tD(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 nD(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}],Eu(l)||u.push({node:l.focusNode,offset:l.focusOffset})),rt&&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")||mr.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:rD,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 rD(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(pt&&/^(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||pt&&/^(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 iD=/^(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 oD(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let A=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,S=Up(t,A);if(S&&!t.state.selection.eq(S)){if(rt&&Pn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",L=>L(t,zr(13,"Enter"))))return;let _=t.state.tr.setSelection(S);A=="pointer"?_.setMeta("pointer",!0):A=="key"&&_.scrollIntoView(),o&&_.setMeta("composition",o),t.dispatch(_)}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=nD(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=lD(d.content,u.doc.content,u.from,h,p);if(f&&t.input.domChangeCount++,(Qi&&t.input.lastIOSEnter>Date.now()-225||Pn)&&i.some(A=>A.nodeType==1&&!iD.test(A.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",A=>A(t,zr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!f)if(r&&l instanceof se&&!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 A=$m(t,t.state.doc,u.sel);if(A&&!A.eq(t.state.selection)){let S=t.state.tr.setSelection(A);o&&S.setMeta("composition",o),t.dispatch(S)}}return}t.state.selection.from<t.state.selection.to&&f.start==f.endB&&t.state.selection instanceof se&&(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)),bt&&gr<=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((Qi&&t.input.lastIOSEnter>Date.now()-225&&(!b||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!b&&m.pos<u.doc.content.size&&!m.sameParent(g)&&(k=le.findFrom(u.doc.resolve(m.pos+1),1,!0))&&k.head==g.pos)&&t.someProp("handleKeyDown",A=>A(t,zr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>f.start&&aD(c,f.start,f.endA,m,g)&&t.someProp("handleKeyDown",A=>A(t,zr(8,"Backspace")))){Pn&&rt&&t.domObserver.suppressSelectionUpdates();return}rt&&f.endB==f.start&&(t.input.lastChromeDelete=Date.now()),Pn&&!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(A){return A(t,zr(13,"Enter"))})},20));let v=f.start,w=f.endA,x,C,N;if(b){if(m.pos==g.pos)bt&&gr<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Bn(t),20)),x=t.state.tr.delete(v,w),C=c.resolve(f.start).marksAcross(c.resolve(f.endA));else if(f.endA==f.endB&&(N=sD(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start()))))x=t.state.tr,N.type=="add"?x.addMark(v,w,N.mark):x.removeMark(v,w,N.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let A=m.parent.textBetween(m.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",S=>S(t,v,w,A)))return;x=t.state.tr.insertText(A,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 A=$m(t,x.doc,u.sel);A&&!(rt&&t.composing&&A.empty&&(f.start!=f.endB||t.input.lastChromeDelete<Date.now()-100)&&(A.head==v||A.head==x.mapping.map(w)-1)||bt&&A.empty&&A.head==v)&&x.setSelection(A)}C&&x.ensureMarks(C),o&&x.setMeta("composition",o),t.dispatch(x.scrollIntoView())}function $m(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Kp(t,e.resolve(n.anchor),e.resolve(n.head))}function sD(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(M.from(u).eq(t))return{mark:a,type:s}}function aD(t,e,n,r,i){if(n-e<=i.pos-r.pos||bc(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(bc(o,!0,!0));return!s.parent.isTextblock||s.pos>n||bc(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function bc(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 lD(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&&jm(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&&jm(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function jm(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 uD{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 A_,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Um),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=qm(this),Hm(this),this.nodeViews=Wm(this),this.docView=xm(this.state.doc,zm(this),yc(this),this.dom,this),this.domObserver=new Z_(this,(r,i,o,s)=>oD(this,r,i,o,s)),this.domObserver.start(),M_(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&&Dd(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Um),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&&(Qb(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=Wm(this);dD(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Dd(this),this.editable=qm(this),Hm(this);let l=yc(this),u=zm(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&&HM(this);if(s){this.domObserver.stop();let p=d&&(bt||rt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&cD(i.selection,e.selection);if(d){let f=rt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=z_(this)),(o||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=xm(e.doc,u,l,this.dom,this)),f&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&h_(this))?Bn(this,p):(jb(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&&qM(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 Y){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&gm(this,n.getBoundingClientRect(),e)}else gm(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 t0(e.slice,e.move,i<0?void 0:Y.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(bt){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&&WM(this.dom),Bn(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 XM(this,e)}coordsAtPos(e,n=1){return Ib(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 t_(this,n||this.state,e)}pasteHTML(e,n){return gs(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return gs(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Gp(this,e)}destroy(){this.docView&&(__(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,NM())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return N_(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?pt&&this.root.nodeType===11&&LM(this.dom.ownerDocument)==this.dom&&eD(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function zm(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"),[Mt.node(0,t.state.doc.content.size,e)]}function Hm(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:Mt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function qm(t){return!t.someProp("editable",e=>e(t.state)===!1)}function cD(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 Wm(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 dD(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 Um(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 Er={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:"'"},ml={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},pD=typeof navigator<"u"&&/Mac/.test(navigator.platform),hD=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ye=0;Ye<10;Ye++)Er[48+Ye]=Er[96+Ye]=String(Ye);for(var Ye=1;Ye<=24;Ye++)Er[Ye+111]="F"+Ye;for(var Ye=65;Ye<=90;Ye++)Er[Ye]=String.fromCharCode(Ye+32),ml[Ye]=String.fromCharCode(Ye);for(var kc in Er)ml.hasOwnProperty(kc)||(ml[kc]=Er[kc]);function fD(t){var e=pD&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||hD&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ml:Er)[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 mD=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function gD(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))mD?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 vD(t){let e=Object.create(null);for(let n in t)e[gD(n)]=t[n];return e}function wc(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 yD(t){return new Ve({props:{handleKeyDown:s0(t)}})}function s0(t){let e=vD(t);return function(n,r){let i=fD(r),o,s=e[wc(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[wc(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=Er[r.keyCode])&&o!=i){let a=e[wc(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const bD=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function a0(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset>0?null:n}const kD=(t,e,n)=>{let r=a0(t);if(!r)return!1;let i=eh(r);if(!i){let s=r.blockRange(),a=s&&uo(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(d0(t,i,e,-1))return!0;if(r.parent.content.size==0&&(eo(o,"end")||Y.isSelectable(o)))for(let s=r.depth;;s--){let a=wu(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(eo(o,"end")?le.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):Y.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},wD=(t,e,n)=>{let r=a0(t);if(!r)return!1;let i=eh(r);return i?l0(t,i,e):!1},xD=(t,e,n)=>{let r=u0(t);if(!r)return!1;let i=th(r);return i?l0(t,i,e):!1};function l0(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=wu(t.doc,o,l,V.empty);if(!u||u.from!=o||u instanceof je&&u.slice.size>=l-o)return!1;if(n){let c=t.tr.step(u);c.setSelection(se.create(c.doc,o)),n(c.scrollIntoView())}return!0}function eo(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 ED=(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=eh(r)}let s=o&&o.nodeBefore;return!s||!Y.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function eh(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 u0(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset<n.parent.content.size?null:n}const CD=(t,e,n)=>{let r=u0(t);if(!r)return!1;let i=th(r);if(!i)return!1;let o=i.nodeAfter;if(d0(t,i,e,1))return!0;if(r.parent.content.size==0&&(eo(o,"start")||Y.isSelectable(o))){let s=wu(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(eo(o,"start")?le.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):Y.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},SD=(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=th(r)}let s=o&&o.nodeAfter;return!s||!Y.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,o.pos)).scrollIntoView()),!0)};function th(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 TD=(t,e)=>{let n=t.selection,r=n instanceof Y,i;if(r){if(n.node.isTextblock||!Sr(t.doc,n.from))return!1;i=n.from}else if(i=ku(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(Y.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},OD=(t,e)=>{let n=t.selection,r;if(n instanceof Y){if(n.node.isTextblock||!Sr(t.doc,n.to))return!1;r=n.to}else if(r=ku(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},AD=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&uo(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},MD=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
16
+ `))),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=fi.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=C_(n),Ns&&S_(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")||mr.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!w_.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)a=T_(Rm(a,+c[1],+c[2]),c[4]);else if(a=V.maxOpen(x_(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=Rm(a,d,h)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const w_=/^(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 x_(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&&Ub(a,i,s,o[o.length-1],0))o[o.length-1]=l;else{o.length&&(o[o.length-1]=Kb(o[o.length-1],i.length));let u=Wb(s,a);o.push(u),r=r.matchType(u.type),i=a}}),o)return M.from(o)}return t}function Wb(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,M.from(t));return t}function Ub(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Ub(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(M.from(Wb(n,t,i+1))))}}function Kb(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Kb(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(M.empty,!0);return t.copy(n.append(r))}function _d(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=_d(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(M.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Rm(t,e,n){return e<t.openStart&&(t=new V(_d(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new V(_d(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Gb={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 Pm=null;function Jb(){return Pm||(Pm=document.implementation.createHTMLDocument("title"))}let vc=null;function E_(t){let e=window.trustedTypes;return e?(vc||(vc=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),vc.createHTML(t)):t}function C_(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Jb().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Gb[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=E_(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function S_(t){let e=t.querySelectorAll(rt?"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 T_(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=M.from(l.create(r[a+1],i)),o++,s++}return new V(i,o,s)}const ht={},ft={},O_={touchstart:!0,touchmove:!0};class A_{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 M_(t){for(let e in ht){let n=ht[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{D_(t,r)&&!Jp(t,r)&&(t.editable||!(r.type in ft))&&n(t,r)},O_[e]?{passive:!0}:void 0)}pt&&t.dom.addEventListener("input",()=>null),Dd(t)}function ur(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function __(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 Dd(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Jp(t,r))})}function Jp(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function D_(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 N_(t,e){!Jp(t,e)&&ht[e.type]&&(t.editable||!(e.type in ft))&&ht[e.type](t,e)}ft.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Yb(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Pn&&rt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Qi&&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,zr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||k_(t,n)?n.preventDefault():ur(t,"key")};ft.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ft.keypress=(t,e)=>{let n=e;if(Yb(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Vt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof se)||!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 Su(t){return{left:t.clientX,top:t.clientY}}function I_(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Xp(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 zi(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 R_(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(zi(t,new Y(n)),!0):!1}function P_(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof Y&&(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(Y.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?(zi(t,Y.create(t.state.doc,i)),!0):!1}function F_(t,e,n,r,i){return Xp(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?P_(t,n):R_(t,n))}function L_(t,e,n,r){return Xp(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function V_(t,e,n,r){return Xp(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||B_(t,n,r)}function B_(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(zi(t,se.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)zi(t,se.create(r,a+1,a+1+s.content.size));else if(Y.isSelectable(s))zi(t,Y.create(r,a));else continue;return!0}}function Yp(t){return pl(t)}const Xb=Vt?"metaKey":"ctrlKey";ht.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Yp(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&I_(n,t.input.lastClick)&&!n[Xb]&&(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(Su(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new $_(t,s,n,!!r)):(o=="doubleClick"?L_:V_)(t,s.pos,s.inside,n)?n.preventDefault():ur(t,"pointer"))};class $_{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[Xb],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 Y&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&nn&&!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)),ur(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(()=>Bn(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(Su(e))),this.updateAllowDefault(e),this.allowDefault||!n?ur(this.view,"pointer"):F_(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pt&&this.mightDrag&&!this.mightDrag.node.isAtom||rt&&!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)?(zi(this.view,le.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):ur(this.view,"pointer")}move(e){this.updateAllowDefault(e),ur(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)}}ht.touchstart=t=>{t.input.lastTouch=Date.now(),Yp(t),ur(t,"pointer")};ht.touchmove=t=>{t.input.lastTouch=Date.now(),ur(t,"pointer")};ht.contextmenu=t=>Yp(t);function Yb(t,e){return t.composing?!0:pt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const j_=Pn?5e3:-1;ft.compositionstart=ft.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof se&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),pl(t,!0),t.markCursor=null;else if(pl(t,!e.selection.empty),nn&&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}Zb(t,j_)};ft.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++,Zb(t,20))};function Zb(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>pl(t),e))}function Qb(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=H_());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function z_(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=RM(e.focusNode,e.focusOffset),r=PM(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 H_(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function pl(t,e=!1){if(!(Pn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Qb(t),e||t.docView&&t.docView.dirty){let n=Up(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 q_(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 ms=bt&&gr<15||Qi&&$M<604;ht.copy=ft.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=ms?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Gp(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):q_(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function W_(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function U_(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?gs(t,r.value,null,i,e):gs(t,r.textContent,r.innerHTML,i,e)},50)}function gs(t,e,n,r,i){let o=qb(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=W_(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 e0(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," "):""}ft.paste=(t,e)=>{let n=e;if(t.composing&&!Pn)return;let r=ms?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&gs(t,e0(r),r.getData("text/html"),i,n)?n.preventDefault():U_(t,n)};class t0{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const n0=Vt?"altKey":"ctrlKey";ht.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(Su(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)s=Y.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=Y.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:u,slice:c}=Gp(t,a);(!n.dataTransfer.files.length||!rt||Ab>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ms?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ms||n.dataTransfer.setData("text/plain",u),t.dragging=new t0(c,!n[n0],s)};ht.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ft.dragover=ft.dragenter=(t,e)=>e.preventDefault();ft.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Su(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=qb(t,e0(n.dataTransfer),ms?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[n0]);if(t.someProp("handleDrop",f=>f(t,n,s||V.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?bb(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&&Y.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new Y(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(Kp(t,p,u.doc.resolve(f)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))};ht.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())&&Bn(t)},20))};ht.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)};ht.beforeinput=(t,e)=>{if(rt&&Pn&&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,zr(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 ft)ht[t]=ft[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 hl{constructor(e,n){this.toDOM=e,this.spec=n||Yr,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 Mt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof hl&&(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 yr{constructor(e,n){this.attrs=e,this.spec=n||Yr}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 Mt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof yr&&vs(this.attrs,e.attrs)&&vs(this.spec,e.spec)}static is(e){return e.type instanceof yr}destroy(){}}class Zp{constructor(e,n){this.attrs=e,this.spec=n||Yr}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 Mt(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 Zp&&vs(this.attrs,e.attrs)&&vs(this.spec,e.spec)}destroy(){}}class Mt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Mt(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 Mt(e,e,new hl(n,r))}static inline(e,n,r,i){return new Mt(e,n,new yr(r,i))}static node(e,n,r,i){return new Mt(e,n,new Zp(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof yr}get widget(){return this.type instanceof hl}}const Ai=[],Yr={};class Pe{constructor(e,n){this.local=e.length?e:Ai,this.children=n.length?n:Ai}static create(e,n){return n.length?fl(n,e,0,Yr):nt}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==nt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Yr)}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?K_(this.children,s||[],e,n,r,i,o):s?new Pe(s.sort(Zr),Ai):nt}add(e,n){return n.length?this==nt?Pe.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=i0(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,fl(c,a,u+1,Yr)),o+=3}});let s=r0(o?o0(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Pe(s.length?this.local.concat(s).sort(Zr):this.local,i||this.children)}remove(e){return e.length==0||this==nt?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!=nt?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 Pe(i,r):nt}forChild(e,n){if(this==nt)return this;if(n.isLeaf)return Pe.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 yr){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 Pe(i.sort(Zr),Ai);return r?new ir([a,r]):a}return r||nt}eq(e){if(this==e)return!0;if(!(e instanceof Pe)||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 Qp(this.localsInner(e))}localsInner(e){if(this==nt)return Ai;if(e.inlineContent||!this.local.some(yr.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof yr||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Pe.empty=new Pe([],[]);Pe.removeOverlap=Qp;const nt=Pe.empty;class ir{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Yr));return ir.from(r)}forChild(e,n){if(n.isLeaf)return Pe.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=nt&&(o instanceof ir?r=r.concat(o.members):r.push(o))}return ir.from(r)}eq(e){if(!(e instanceof ir)||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?Qp(r?n:n.sort(Zr)):Ai}static from(e){switch(e.length){case 0:return nt;case 1:return e[0];default:return new ir(e.every(n=>n instanceof Pe)?e:e.reduce((n,r)=>n.concat(r instanceof Pe?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function K_(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!=nt?(a[u]=d,a[u+1]=p,a[u+2]=y):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=G_(a,t,e,n,i,o,s),c=fl(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 Pe(e.sort(Zr),a)}function r0(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 Mt(i.from+e,i.to+e,i.type))}return n}function G_(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 i0(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 o0(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function fl(t,e,n,r){let i=[],o=!1;e.forEach((a,l)=>{let u=i0(t,a,l+n);if(u){o=!0;let c=fl(u,a,n+l+1,r);c!=nt&&i.push(l,l+a.nodeSize,c)}});let s=r0(o?o0(t):t,-n).sort(Zr);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 Pe(s,i):nt}function Zr(t,e){return t.from-e.from||t.to-e.to}function Qp(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),Fm(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),Fm(e,i,r.copy(o.from,r.to)));break}}}return e}function Fm(t,e,n){for(;e<t.length&&Zr(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!=nt&&e.push(r)}),t.cursorWrapper&&e.push(Pe.create(t.state.doc,[t.cursorWrapper.deco])),ir.from(e)}const J_={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},X_=bt&&gr<=11;class Y_{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 Z_{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Y_,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]);bt&&gr<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),X_&&(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,J_)),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(Am(this.view)){if(this.suppressingSelectionUpdates)return Bn(this.view);if(bt&&gr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&si(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)&&Am(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(nn&&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||tD(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&&Eu(r)&&(u=Up(e))&&u.eq(le.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Bn(e),this.currentSelection.set(r)):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),Q_(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Bn(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(bt&&gr<=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?Xe(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?Xe(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 Lm=new WeakMap,Vm=!1;function Q_(t){if(!Lm.has(t)&&(Lm.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=nn,Vm)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."),Vm=!0}}function Bm(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return si(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function eD(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Bm(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?Bm(t,n):null}function tD(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 nD(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}],Eu(l)||u.push({node:l.focusNode,offset:l.focusOffset})),rt&&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")||mr.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:rD,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 rD(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(pt&&/^(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||pt&&/^(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 iD=/^(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 oD(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let A=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,C=Up(t,A);if(C&&!t.state.selection.eq(C)){if(rt&&Pn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",L=>L(t,zr(13,"Enter"))))return;let _=t.state.tr.setSelection(C);A=="pointer"?_.setMeta("pointer",!0):A=="key"&&_.scrollIntoView(),o&&_.setMeta("composition",o),t.dispatch(_)}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=nD(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=lD(d.content,u.doc.content,u.from,h,p);if(f&&t.input.domChangeCount++,(Qi&&t.input.lastIOSEnter>Date.now()-225||Pn)&&i.some(A=>A.nodeType==1&&!iD.test(A.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",A=>A(t,zr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!f)if(r&&l instanceof se&&!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 A=$m(t,t.state.doc,u.sel);if(A&&!A.eq(t.state.selection)){let C=t.state.tr.setSelection(A);o&&C.setMeta("composition",o),t.dispatch(C)}}return}t.state.selection.from<t.state.selection.to&&f.start==f.endB&&t.state.selection instanceof se&&(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)),bt&&gr<=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((Qi&&t.input.lastIOSEnter>Date.now()-225&&(!b||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!b&&m.pos<u.doc.content.size&&!m.sameParent(g)&&(k=le.findFrom(u.doc.resolve(m.pos+1),1,!0))&&k.head==g.pos)&&t.someProp("handleKeyDown",A=>A(t,zr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>f.start&&aD(c,f.start,f.endA,m,g)&&t.someProp("handleKeyDown",A=>A(t,zr(8,"Backspace")))){Pn&&rt&&t.domObserver.suppressSelectionUpdates();return}rt&&f.endB==f.start&&(t.input.lastChromeDelete=Date.now()),Pn&&!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(A){return A(t,zr(13,"Enter"))})},20));let v=f.start,w=f.endA,x,S,N;if(b){if(m.pos==g.pos)bt&&gr<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Bn(t),20)),x=t.state.tr.delete(v,w),S=c.resolve(f.start).marksAcross(c.resolve(f.endA));else if(f.endA==f.endB&&(N=sD(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start()))))x=t.state.tr,N.type=="add"?x.addMark(v,w,N.mark):x.removeMark(v,w,N.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let A=m.parent.textBetween(m.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",C=>C(t,v,w,A)))return;x=t.state.tr.insertText(A,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 A=$m(t,x.doc,u.sel);A&&!(rt&&t.composing&&A.empty&&(f.start!=f.endB||t.input.lastChromeDelete<Date.now()-100)&&(A.head==v||A.head==x.mapping.map(w)-1)||bt&&A.empty&&A.head==v)&&x.setSelection(A)}S&&x.ensureMarks(S),o&&x.setMeta("composition",o),t.dispatch(x.scrollIntoView())}function $m(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Kp(t,e.resolve(n.anchor),e.resolve(n.head))}function sD(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(M.from(u).eq(t))return{mark:a,type:s}}function aD(t,e,n,r,i){if(n-e<=i.pos-r.pos||bc(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(bc(o,!0,!0));return!s.parent.isTextblock||s.pos>n||bc(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function bc(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 lD(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&&jm(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&&jm(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function jm(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 uD{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 A_,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Um),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=qm(this),Hm(this),this.nodeViews=Wm(this),this.docView=xm(this.state.doc,zm(this),yc(this),this.dom,this),this.domObserver=new Z_(this,(r,i,o,s)=>oD(this,r,i,o,s)),this.domObserver.start(),M_(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&&Dd(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Um),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&&(Qb(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=Wm(this);dD(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Dd(this),this.editable=qm(this),Hm(this);let l=yc(this),u=zm(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&&HM(this);if(s){this.domObserver.stop();let p=d&&(bt||rt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&cD(i.selection,e.selection);if(d){let f=rt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=z_(this)),(o||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=xm(e.doc,u,l,this.dom,this)),f&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&h_(this))?Bn(this,p):(jb(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&&qM(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 Y){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&gm(this,n.getBoundingClientRect(),e)}else gm(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 t0(e.slice,e.move,i<0?void 0:Y.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(bt){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&&WM(this.dom),Bn(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 XM(this,e)}coordsAtPos(e,n=1){return Ib(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 t_(this,n||this.state,e)}pasteHTML(e,n){return gs(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return gs(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Gp(this,e)}destroy(){this.docView&&(__(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,NM())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return N_(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?pt&&this.root.nodeType===11&&LM(this.dom.ownerDocument)==this.dom&&eD(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function zm(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"),[Mt.node(0,t.state.doc.content.size,e)]}function Hm(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:Mt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function qm(t){return!t.someProp("editable",e=>e(t.state)===!1)}function cD(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 Wm(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 dD(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 Um(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 Er={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:"'"},ml={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},pD=typeof navigator<"u"&&/Mac/.test(navigator.platform),hD=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ye=0;Ye<10;Ye++)Er[48+Ye]=Er[96+Ye]=String(Ye);for(var Ye=1;Ye<=24;Ye++)Er[Ye+111]="F"+Ye;for(var Ye=65;Ye<=90;Ye++)Er[Ye]=String.fromCharCode(Ye+32),ml[Ye]=String.fromCharCode(Ye);for(var kc in Er)ml.hasOwnProperty(kc)||(ml[kc]=Er[kc]);function fD(t){var e=pD&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||hD&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ml:Er)[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 mD=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function gD(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))mD?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 vD(t){let e=Object.create(null);for(let n in t)e[gD(n)]=t[n];return e}function wc(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 yD(t){return new Ve({props:{handleKeyDown:s0(t)}})}function s0(t){let e=vD(t);return function(n,r){let i=fD(r),o,s=e[wc(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[wc(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=Er[r.keyCode])&&o!=i){let a=e[wc(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const bD=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function a0(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset>0?null:n}const kD=(t,e,n)=>{let r=a0(t);if(!r)return!1;let i=eh(r);if(!i){let s=r.blockRange(),a=s&&uo(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(d0(t,i,e,-1))return!0;if(r.parent.content.size==0&&(eo(o,"end")||Y.isSelectable(o)))for(let s=r.depth;;s--){let a=wu(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(eo(o,"end")?le.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):Y.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},wD=(t,e,n)=>{let r=a0(t);if(!r)return!1;let i=eh(r);return i?l0(t,i,e):!1},xD=(t,e,n)=>{let r=u0(t);if(!r)return!1;let i=th(r);return i?l0(t,i,e):!1};function l0(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=wu(t.doc,o,l,V.empty);if(!u||u.from!=o||u instanceof je&&u.slice.size>=l-o)return!1;if(n){let c=t.tr.step(u);c.setSelection(se.create(c.doc,o)),n(c.scrollIntoView())}return!0}function eo(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 ED=(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=eh(r)}let s=o&&o.nodeBefore;return!s||!Y.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function eh(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 u0(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset<n.parent.content.size?null:n}const CD=(t,e,n)=>{let r=u0(t);if(!r)return!1;let i=th(r);if(!i)return!1;let o=i.nodeAfter;if(d0(t,i,e,1))return!0;if(r.parent.content.size==0&&(eo(o,"start")||Y.isSelectable(o))){let s=wu(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(eo(o,"start")?le.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):Y.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},SD=(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=th(r)}let s=o&&o.nodeAfter;return!s||!Y.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,o.pos)).scrollIntoView()),!0)};function th(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 TD=(t,e)=>{let n=t.selection,r=n instanceof Y,i;if(r){if(n.node.isTextblock||!Sr(t.doc,n.from))return!1;i=n.from}else if(i=ku(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(Y.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},OD=(t,e)=>{let n=t.selection,r;if(n instanceof Y){if(n.node.isTextblock||!Sr(t.doc,n.to))return!1;r=n.to}else if(r=ku(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},AD=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&uo(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},MD=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
17
17
  `).scrollIntoView()),!0)};function c0(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 _D=(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=c0(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(le.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},DD=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof jt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=c0(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(se.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},ND=(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($i(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&uo(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},ID=(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(Y.create(t.doc,i))),!0)};function RD(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||Sr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function d0(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&RD(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=M.empty;for(let y=s.length-1;y>=0;y--)f=M.from(s[y].create(null,f));f=M.from(i.copy(f));let m=t.tr.step(new qe(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&&Sr(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let c=o.type.spec.isolating||r>0&&l?null:le.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),h=d&&uo(d);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(d,h).scrollIntoView()),!0;if(u&&eo(o,"start",!0)&&eo(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=M.empty;for(let k=f.length-1;k>=0;k--)y=M.from(f[k].copy(y));let b=t.tr.step(new qe(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 p0(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(se.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const PD=p0(-1),FD=p0(1);function LD(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Hp(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Km(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 VD(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 BD(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function BD(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 ll(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new ll(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=Hp(o,n,r,e);return a?(t&&$D(t,e,a,i,n),!0):!1}function $D(t,e,n,r,i){let o=M.empty;for(let c=n.length-1;c>=0;c--)o=M.from(n[c].type.create(n[c].attrs,o));t.step(new qe(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&&$i(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(c).nodeSize;return t}function jD(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?zD(e,n,t,o):HD(e,n,o):!0:!1}}function zD(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new qe(o-1,s,o,s,new V(M.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ll(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=uo(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(o,-1)-1;return Sr(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function HD(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?M.empty:M.from(i))))return!1;let d=o.pos,h=d+s.nodeSize;return r.step(new qe(d-(a?1:0),h+(l?1:0),d+1,h-1,new V((a?M.empty:M.from(i.copy(M.empty))).append(l?M.empty:M.from(i.copy(M.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function qD(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=M.from(u?t.create():null),d=new V(M.from(t.create(null,M.from(a.type.create(null,c)))),u?3:1,0),h=o.start,p=o.end;n(e.tr.step(new qe(h-(u?3:1),p,h,p,d,1,!0)).scrollIntoView())}return!0}}function Tu(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 Ou{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:Tu({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 WD{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 j(t,e,n){return t.config[e]===void 0&&t.parent?j(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?j(t.parent,e,n):null}):t.config[e]}function Au(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 h0(t){const e=[],{nodeExtensions:n,markExtensions:r}=Au(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=j(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=j(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 Ue(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 et(...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 Nd(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)=>et(n,r),{})}function f0(t){return typeof t=="function"}function pe(t,e=void 0,...n){return f0(t)?e?t.bind(e)(...n):t(...n):t}function UD(t={}){return Object.keys(t).length===0&&t.constructor===Object}function KD(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Gm(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):KD(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function Jm(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&UD(n)?!1:n!=null))}function GD(t,e){var n;const r=h0(t),{nodeExtensions:i,markExtensions:o}=Au(t),s=(n=i.find(u=>j(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=j(b,"extendNodeSchema",d);return{...y,...k?k(u):{}}},{}),p=Jm({...h,content:pe(j(u,"content",d)),marks:pe(j(u,"marks",d)),group:pe(j(u,"group",d)),inline:pe(j(u,"inline",d)),atom:pe(j(u,"atom",d)),selectable:pe(j(u,"selectable",d)),draggable:pe(j(u,"draggable",d)),code:pe(j(u,"code",d)),whitespace:pe(j(u,"whitespace",d)),linebreakReplacement:pe(j(u,"linebreakReplacement",d)),defining:pe(j(u,"defining",d)),isolating:pe(j(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=pe(j(u,"parseHTML",d));f&&(p.parseDOM=f.map(y=>Gm(y,c)));const m=j(u,"renderHTML",d);m&&(p.toDOM=y=>m({node:y,HTMLAttributes:Nd(y,c)}));const g=j(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=j(y,"extendMarkSchema",d);return{...g,...b?b(u):{}}},{}),p=Jm({...h,inclusive:pe(j(u,"inclusive",d)),excludes:pe(j(u,"excludes",d)),group:pe(j(u,"group",d)),spanning:pe(j(u,"spanning",d)),code:pe(j(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=pe(j(u,"parseHTML",d));f&&(p.parseDOM=f.map(g=>Gm(g,c)));const m=j(u,"renderHTML",d);return m&&(p.toDOM=g=>m({mark:g,HTMLAttributes:Nd(g,c)})),[u.name,p]}));return new lb({topNode:s,nodes:a,marks:l})}function xc(t,e){return e.nodes[t]||e.marks[t]||null}function Xm(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function nh(t,e){const n=fi.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}const JD=(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 rh(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Mu{constructor(e){this.find=e.find,this.handler=e.handler}}const XD=(t,e)=>{if(rh(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 ca(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=JD(u)+o;return s.forEach(h=>{if(c)return;const p=XD(d,h.find);if(!p)return;const f=l.state.tr,m=Tu({state:l.state,transaction:f}),g={from:r-(p[0].length-o.length),to:i},{commands:y,chain:b,can:k}=new Ou({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 YD(t){const{editor:e,rules:n}=t,r=new Ve({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=nh(M.from(u),s.schema);const{from:c}=l,d=c+u.length;ca({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 ca({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&ca({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?ca({editor:e,from:s.pos,to:s.pos,text:`
18
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function ZD(t){return Object.prototype.toString.call(t).slice(8,-1)}function da(t){return ZD(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function _u(t,e){const n={...t};return da(t)&&da(e)&&Object.keys(e).forEach(r=>{da(e[r])&&da(t[r])?n[r]=_u(t[r],e[r]):n[r]=e[r]}),n}class zn{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=pe(j(this,"addOptions",{name:this.name}))),this.storage=pe(j(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new zn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>_u(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new zn(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=pe(j(n,"addOptions",{name:n.name})),n.storage=pe(j(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 QD(t){return typeof t=="number"}class eN{constructor(e){this.find=e.find,this.handler=e.handler}}const tN=(t,e,n)=>{if(rh(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 nN(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:u,can:c}=new Ou({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,"");tN(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 pa=null;const rN=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 iN(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=Tu({state:u,transaction:f});if(!(!nN({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 Ve({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&&(pa=e)},h=()=>{pa&&(pa=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=pa;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=nh(M.from(v),h.schema);const{from:w}=g,x=w+v.length,C=rN(v);return l({rule:u,state:h,from:w,to:{b:x},pasteEvt:C})}const b=d.doc.content.findDiffStart(h.doc.content),k=d.doc.content.findDiffEnd(h.doc.content);if(!(!QD(b)||!k||b===k.b))return l({rule:u,state:h,from:b,to:k,pasteEvt:s})}}))}function oN(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Pi{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Pi.resolve(e),this.schema=GD(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Pi.sort(Pi.flatten(e)),r=oN(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=j(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((n,r)=>{const i=j(n,"priority")||100,o=j(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:xc(n.name,this.schema)},i=j(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=Pi.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:xc(s.name,this.schema)},l=[],u=j(s,"addKeyboardShortcuts",a);let c={};if(s.type==="mark"&&j(s,"exitable",a)&&(c.ArrowRight=()=>zn.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=yD(c);l.push(d);const h=j(s,"addInputRules",a);Xm(s,e.options.enableInputRules)&&h&&r.push(...h());const p=j(s,"addPasteRules",a);Xm(s,e.options.enablePasteRules)&&p&&i.push(...p());const f=j(s,"addProseMirrorPlugins",a);if(f){const m=f();l.push(...m)}return l}).flat();return[YD({editor:e,rules:r}),...iN({editor:e,rules:i}),...o]}get attributes(){return h0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Au(this.extensions);return Object.fromEntries(n.filter(r=>!!j(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:Ue(r.name,this.schema)},s=j(r,"addNodeView",o);if(!s)return[];const a=(l,u,c,d,h)=>{const p=Nd(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:xc(e.name,this.schema)};e.type==="mark"&&(!((n=pe(j(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=j(e,"onBeforeCreate",r),o=j(e,"onCreate",r),s=j(e,"onUpdate",r),a=j(e,"onSelectionUpdate",r),l=j(e,"onTransaction",r),u=j(e,"onFocus",r),c=j(e,"onBlur",r),d=j(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 Ke{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=pe(j(this,"addOptions",{name:this.name}))),this.storage=pe(j(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ke(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>_u(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ke({...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=pe(j(n,"addOptions",{name:n.name})),n.storage=pe(j(n,"addStorage",{name:n.name,options:n.options})),n}}function m0(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
18
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function ZD(t){return Object.prototype.toString.call(t).slice(8,-1)}function da(t){return ZD(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function _u(t,e){const n={...t};return da(t)&&da(e)&&Object.keys(e).forEach(r=>{da(e[r])&&da(t[r])?n[r]=_u(t[r],e[r]):n[r]=e[r]}),n}class zn{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=pe(j(this,"addOptions",{name:this.name}))),this.storage=pe(j(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new zn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>_u(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new zn(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=pe(j(n,"addOptions",{name:n.name})),n.storage=pe(j(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 QD(t){return typeof t=="number"}class eN{constructor(e){this.find=e.find,this.handler=e.handler}}const tN=(t,e,n)=>{if(rh(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 nN(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:u,can:c}=new Ou({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,"");tN(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 pa=null;const rN=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 iN(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=Tu({state:u,transaction:f});if(!(!nN({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 Ve({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&&(pa=e)},h=()=>{pa&&(pa=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=pa;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=nh(M.from(v),h.schema);const{from:w}=g,x=w+v.length,S=rN(v);return l({rule:u,state:h,from:w,to:{b:x},pasteEvt:S})}const b=d.doc.content.findDiffStart(h.doc.content),k=d.doc.content.findDiffEnd(h.doc.content);if(!(!QD(b)||!k||b===k.b))return l({rule:u,state:h,from:b,to:k,pasteEvt:s})}}))}function oN(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Pi{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Pi.resolve(e),this.schema=GD(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Pi.sort(Pi.flatten(e)),r=oN(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=j(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((n,r)=>{const i=j(n,"priority")||100,o=j(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:xc(n.name,this.schema)},i=j(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=Pi.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:xc(s.name,this.schema)},l=[],u=j(s,"addKeyboardShortcuts",a);let c={};if(s.type==="mark"&&j(s,"exitable",a)&&(c.ArrowRight=()=>zn.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=yD(c);l.push(d);const h=j(s,"addInputRules",a);Xm(s,e.options.enableInputRules)&&h&&r.push(...h());const p=j(s,"addPasteRules",a);Xm(s,e.options.enablePasteRules)&&p&&i.push(...p());const f=j(s,"addProseMirrorPlugins",a);if(f){const m=f();l.push(...m)}return l}).flat();return[YD({editor:e,rules:r}),...iN({editor:e,rules:i}),...o]}get attributes(){return h0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Au(this.extensions);return Object.fromEntries(n.filter(r=>!!j(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:Ue(r.name,this.schema)},s=j(r,"addNodeView",o);if(!s)return[];const a=(l,u,c,d,h)=>{const p=Nd(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:xc(e.name,this.schema)};e.type==="mark"&&(!((n=pe(j(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=j(e,"onBeforeCreate",r),o=j(e,"onCreate",r),s=j(e,"onUpdate",r),a=j(e,"onSelectionUpdate",r),l=j(e,"onTransaction",r),u=j(e,"onFocus",r),c=j(e,"onBlur",r),d=j(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 Ke{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=pe(j(this,"addOptions",{name:this.name}))),this.storage=pe(j(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ke(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>_u(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ke({...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=pe(j(n,"addOptions",{name:n.name})),n.storage=pe(j(n,"addStorage",{name:n.name,options:n.options})),n}}function m0(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
19
19
 
20
- `,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 ih(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const sN=Ke.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ve({key:new at("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=ih(n);return m0(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),aN=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),lN=(t=!1)=>({commands:e})=>e.setContent("",t),uN=()=>({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=uo(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},cN=t=>e=>t(e),dN=()=>({state:t,dispatch:e})=>DD(t,e),pN=(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 se(r.doc.resolve(s-1))),!0},hN=()=>({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},fN=t=>({tr:e,state:n,dispatch:r})=>{const i=Ue(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},mN=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},gN=()=>({state:t,dispatch:e})=>bD(t,e),vN=()=>({commands:t})=>t.keyboardShortcut("Enter"),yN=()=>({state:t,dispatch:e})=>_D(t,e);function gl(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:rh(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function g0(t,e,n={}){return t.find(r=>r.type===e&&gl(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Ym(t,e,n={}){return!!g0(t,e,n)}function oh(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),!g0([...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&&Ym([...t.parent.child(o-1).marks],e,n);)o-=1,s-=t.parent.child(o).nodeSize;for(;a<t.parent.childCount&&Ym([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Or(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 bN=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=Or(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const d=oh(l,o,e);if(d&&d.from<=u&&d.to>=c){const h=se.create(s,d.from,d.to);n.setSelection(h)}}return!0},kN=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 sh(t){return t instanceof se}function Fn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function v0(t,e=null){if(!e)return null;const n=le.atStart(t),r=le.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?se.create(t,Fn(0,i,o),Fn(t.content.size,i,o)):se.create(t,Fn(e,i,o),Fn(e,i,o))}function wN(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function ah(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const xN=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(ah()||wN())&&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&&!sh(n.state.selection))return s(),!0;const a=v0(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},EN=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),CN=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),y0=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&&y0(r)}return t};function ha(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return y0(n)}function vl(t,e,n){if(t instanceof fr||t instanceof M)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 M.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),vl("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="";const l=new lb({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?mr.fromSchema(l).parseSlice(ha(t),n.parseOptions):mr.fromSchema(l).parse(ha(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=mr.fromSchema(e);return n.slice?o.parseSlice(ha(t),n.parseOptions).content:o.parse(ha(t),n.parseOptions)}return vl("",e,n)}function SN(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof je||i instanceof qe))return;const o=t.mapping.maps[r];let s=0;o.forEach((a,l,u,c)=>{s===0&&(s=c)}),t.setSelection(le.near(t.doc.resolve(s),n))}const TN=t=>!("type"in t),ON=(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=vl(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((TN(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 M){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&&SN(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},AN=()=>({state:t,dispatch:e})=>TD(t,e),MN=()=>({state:t,dispatch:e})=>OD(t,e),_N=()=>({state:t,dispatch:e})=>kD(t,e),DN=()=>({state:t,dispatch:e})=>CD(t,e),NN=()=>({state:t,dispatch:e,tr:n})=>{try{const r=ku(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},IN=()=>({state:t,dispatch:e,tr:n})=>{try{const r=ku(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},RN=()=>({state:t,dispatch:e})=>wD(t,e),PN=()=>({state:t,dispatch:e})=>xD(t,e);function b0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function FN(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))ah()||b0()?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 LN=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=FN(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 ys(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Ue(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=>gl(c.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((c,d)=>c+d.to-d.from,0)>=l}const VN=(t,e={})=>({state:n,dispatch:r})=>{const i=Ue(t,n.schema);return ys(n,i,e)?AD(n,r):!1},BN=()=>({state:t,dispatch:e})=>ND(t,e),$N=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return jD(r)(e,n)},jN=()=>({state:t,dispatch:e})=>MD(t,e);function Du(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Zm(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 zN=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Du(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Ue(t,r.schema)),a==="mark"&&(s=Or(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,Zm(u.attrs,e)),s&&u.marks.length&&u.marks.forEach(d=>{s===d.type&&n.addMark(c,c+u.nodeSize,s.create(Zm(d.attrs,e)))})})}),!0):!1},HN=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),qN=()=>({tr:t,dispatch:e})=>{if(e){const n=new jt(t.doc);t.setSelection(n)}return!0},WN=()=>({state:t,dispatch:e})=>ED(t,e),UN=()=>({state:t,dispatch:e})=>SD(t,e),KN=()=>({state:t,dispatch:e})=>ID(t,e),GN=()=>({state:t,dispatch:e})=>FD(t,e),JN=()=>({state:t,dispatch:e})=>PD(t,e);function Id(t,e,n={},r={}){return vl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const XN=(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=Id(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 k0(t,e){const n=Or(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 YN(t,e){const n=new Cb(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function ZN(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 QN(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function eI(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 lh(t){return e=>eI(e.$from,t)}function w0(t,e){const n={from:0,to:t.content.size};return m0(t,n,e)}function tI(t,e){const n=Ue(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 x0(t,e){const n=Du(typeof e=="string"?e:e.name,t.schema);return n==="node"?tI(t,e):n==="mark"?k0(t,e):{}}function nI(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 rI(t){const e=nI(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 iI(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}})})}),rI(r)}function uh(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=oh(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 Ra(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 Rd(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Or(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(c=>o?o.name===c.type.name:!0).find(c=>gl(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=>gl(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 oI(t,e,n={}){if(!e)return ys(t,null,n)||Rd(t,null,n);const r=Du(e,t.schema);return r==="node"?ys(t,e,n):r==="mark"?Rd(t,e,n):!1}function Qm(t,e){const{nodeExtensions:n}=Au(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=pe(j(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Nu(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&&(Nu(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function E0(t){return t instanceof Y}function C0(t,e,n){const r=t.state.doc.content.size,i=Fn(e,0,r),o=Fn(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 sI(t,e,n){var r;const{selection:i}=e;let o=null;if(sh(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 aI=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Or(t,r.schema);if(i)if(s){const u=k0(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 sI(r,n,l)},lI=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),uI=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Ue(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})=>Km(o,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>Km(o,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},cI=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Fn(t,0,r.content.size),o=Y.create(r,i);e.setSelection(o)}return!0},dI=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=se.atStart(r).from,a=se.atEnd(r).to,l=Fn(i,s,a),u=Fn(o,s,a),c=se.create(r,l,u);e.setSelection(c)}return!0},pI=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return qD(r)(e,n)};function eg(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 hI=({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=Ra(u,a.node().type.name,a.node().attrs);if(o instanceof Y&&o.node.isBlock)return!a.parentOffset||!$i(s,a.pos)?!1:(r&&(t&&eg(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:ZN(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=d&&h?[{type:h,attrs:c}]:void 0,f=$i(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!f&&$i(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 se&&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&&eg(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},fI=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const a=Ue(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=M.empty;const b=l.index(-1)?1:l.index(-2)?2:3;for(let N=l.depth-b;N>=l.depth-3;N-=1)y=M.from(l.node(N).copy(y));const k=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,v={...Ra(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(M.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 C=-1;n.doc.nodesBetween(x,n.doc.content.size,(N,A)=>{if(C>-1)return!1;N.isTextblock&&N.content.size===0&&(C=A+1)}),C>-1&&n.setSelection(se.near(n.doc.resolve(C))),n.scrollIntoView()}return!0}const p=u.pos===l.end()?d.contentMatchAt(0).defaultType:null,f={...Ra(h,d.type.name,d.attrs),...e},m={...Ra(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(!$i(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},Ec=(t,e)=>{const n=lh(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&&Sr(t.doc,n.pos)&&t.join(n.pos),!0},Cc=(t,e)=>{const n=lh(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&&Sr(t.doc,r)&&t.join(r),!0},mI=(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=Ue(t,s.schema),f=Ue(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=lh(x=>Qm(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(Qm(w.node.type.name,d)&&p.validContent(w.node.content)&&a)return l().command(()=>(o.setNodeMarkup(w.pos,p),!0)).command(()=>Ec(o,p)).command(()=>Cc(o,p)).run()}return!n||!v||!a?l().command(()=>c().wrapInList(p,r)?!0:u.clearNodes()).wrapInList(p,r).command(()=>Ec(o,p)).command(()=>Cc(o,p)).run():l().command(()=>{const x=c().wrapInList(p,r),C=v.filter(N=>h.includes(N.type.name));return o.ensureMarks(C),x?!0:u.clearNodes()}).wrapInList(p,r).command(()=>Ec(o,p)).command(()=>Cc(o,p)).run()},gI=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Or(t,r.schema);return Rd(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},vI=(t,e,n={})=>({state:r,commands:i})=>{const o=Ue(t,r.schema),s=Ue(e,r.schema),a=ys(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})},yI=(t,e={})=>({state:n,commands:r})=>{const i=Ue(t,n.schema);return ys(n,i,e)?r.lift(i):r.wrapIn(i,e)},bI=()=>({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},kI=()=>({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},wI=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Or(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=oh(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},xI=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Du(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Ue(t,r.schema)),a==="mark"&&(s=Or(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},EI=(t,e={})=>({state:n,dispatch:r})=>{const i=Ue(t,n.schema);return LD(i,e)(n,r)},CI=(t,e={})=>({state:n,dispatch:r})=>{const i=Ue(t,n.schema);return VD(i,e)(n,r)};var SI=Object.freeze({__proto__:null,blur:aN,clearContent:lN,clearNodes:uN,command:cN,createParagraphNear:dN,cut:pN,deleteCurrentNode:hN,deleteNode:fN,deleteRange:mN,deleteSelection:gN,enter:vN,exitCode:yN,extendMarkRange:bN,first:kN,focus:xN,forEach:EN,insertContent:CN,insertContentAt:ON,joinBackward:_N,joinDown:MN,joinForward:DN,joinItemBackward:NN,joinItemForward:IN,joinTextblockBackward:RN,joinTextblockForward:PN,joinUp:AN,keyboardShortcut:LN,lift:VN,liftEmptyBlock:BN,liftListItem:$N,newlineInCode:jN,resetAttributes:zN,scrollIntoView:HN,selectAll:qN,selectNodeBackward:WN,selectNodeForward:UN,selectParentNode:KN,selectTextblockEnd:GN,selectTextblockStart:JN,setContent:XN,setMark:aI,setMeta:lI,setNode:uI,setNodeSelection:cI,setTextSelection:dI,sinkListItem:pI,splitBlock:hI,splitListItem:fI,toggleList:mI,toggleMark:gI,toggleNode:vI,toggleWrap:yI,undoInputRule:bI,unsetAllMarks:kI,unsetMark:wI,updateAttributes:xI,wrapIn:EI,wrapInList:CI});const TI=Ke.create({name:"commands",addCommands(){return{...SI}}}),OI=Ke.create({name:"drop",addProseMirrorPlugins(){return[new Ve({key:new at("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),AI=Ke.create({name:"editable",addProseMirrorPlugins(){return[new Ve({key:new at("editable"),props:{editable:()=>this.editor.options.editable}})]}}),MI=Ke.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ve({key:new at("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}}}})]}}),_I=Ke.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:le.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 ah()||b0()?i:r},addProseMirrorPlugins(){return[new Ve({key:new at("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=le.atStart(e.doc).from,u=le.atEnd(e.doc).to;if(o||!(s===l&&a===u)||!Nu(n.doc))return;const c=n.tr,d=Tu({state:n,transaction:c}),{commands:h}=new Ou({editor:this.editor,state:d});if(h.clearNodes(),!!c.steps.length)return c}})]}}),DI=Ke.create({name:"paste",addProseMirrorPlugins(){return[new Ve({key:new at("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),NI=Ke.create({name:"tabindex",addProseMirrorPlugins(){return[new Ve({key:new at("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Hr{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 Hr(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 Hr(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 Hr(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 Hr(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new Hr(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 II=`.ProseMirror {
20
+ `,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 ih(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const sN=Ke.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ve({key:new at("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=ih(n);return m0(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),aN=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),lN=(t=!1)=>({commands:e})=>e.setContent("",t),uN=()=>({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=uo(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},cN=t=>e=>t(e),dN=()=>({state:t,dispatch:e})=>DD(t,e),pN=(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 se(r.doc.resolve(s-1))),!0},hN=()=>({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},fN=t=>({tr:e,state:n,dispatch:r})=>{const i=Ue(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},mN=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},gN=()=>({state:t,dispatch:e})=>bD(t,e),vN=()=>({commands:t})=>t.keyboardShortcut("Enter"),yN=()=>({state:t,dispatch:e})=>_D(t,e);function gl(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:rh(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function g0(t,e,n={}){return t.find(r=>r.type===e&&gl(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Ym(t,e,n={}){return!!g0(t,e,n)}function oh(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),!g0([...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&&Ym([...t.parent.child(o-1).marks],e,n);)o-=1,s-=t.parent.child(o).nodeSize;for(;a<t.parent.childCount&&Ym([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Or(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 bN=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=Or(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const d=oh(l,o,e);if(d&&d.from<=u&&d.to>=c){const h=se.create(s,d.from,d.to);n.setSelection(h)}}return!0},kN=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 sh(t){return t instanceof se}function Fn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function v0(t,e=null){if(!e)return null;const n=le.atStart(t),r=le.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?se.create(t,Fn(0,i,o),Fn(t.content.size,i,o)):se.create(t,Fn(e,i,o),Fn(e,i,o))}function wN(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function ah(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const xN=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(ah()||wN())&&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&&!sh(n.state.selection))return s(),!0;const a=v0(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},EN=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),CN=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),y0=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&&y0(r)}return t};function ha(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return y0(n)}function vl(t,e,n){if(t instanceof fr||t instanceof M)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 M.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),vl("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="";const l=new lb({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?mr.fromSchema(l).parseSlice(ha(t),n.parseOptions):mr.fromSchema(l).parse(ha(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=mr.fromSchema(e);return n.slice?o.parseSlice(ha(t),n.parseOptions).content:o.parse(ha(t),n.parseOptions)}return vl("",e,n)}function SN(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof je||i instanceof qe))return;const o=t.mapping.maps[r];let s=0;o.forEach((a,l,u,c)=>{s===0&&(s=c)}),t.setSelection(le.near(t.doc.resolve(s),n))}const TN=t=>!("type"in t),ON=(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=vl(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((TN(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 M){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&&SN(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},AN=()=>({state:t,dispatch:e})=>TD(t,e),MN=()=>({state:t,dispatch:e})=>OD(t,e),_N=()=>({state:t,dispatch:e})=>kD(t,e),DN=()=>({state:t,dispatch:e})=>CD(t,e),NN=()=>({state:t,dispatch:e,tr:n})=>{try{const r=ku(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},IN=()=>({state:t,dispatch:e,tr:n})=>{try{const r=ku(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},RN=()=>({state:t,dispatch:e})=>wD(t,e),PN=()=>({state:t,dispatch:e})=>xD(t,e);function b0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function FN(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))ah()||b0()?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 LN=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=FN(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 ys(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Ue(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=>gl(c.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((c,d)=>c+d.to-d.from,0)>=l}const VN=(t,e={})=>({state:n,dispatch:r})=>{const i=Ue(t,n.schema);return ys(n,i,e)?AD(n,r):!1},BN=()=>({state:t,dispatch:e})=>ND(t,e),$N=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return jD(r)(e,n)},jN=()=>({state:t,dispatch:e})=>MD(t,e);function Du(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Zm(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 zN=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Du(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Ue(t,r.schema)),a==="mark"&&(s=Or(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,Zm(u.attrs,e)),s&&u.marks.length&&u.marks.forEach(d=>{s===d.type&&n.addMark(c,c+u.nodeSize,s.create(Zm(d.attrs,e)))})})}),!0):!1},HN=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),qN=()=>({tr:t,dispatch:e})=>{if(e){const n=new jt(t.doc);t.setSelection(n)}return!0},WN=()=>({state:t,dispatch:e})=>ED(t,e),UN=()=>({state:t,dispatch:e})=>SD(t,e),KN=()=>({state:t,dispatch:e})=>ID(t,e),GN=()=>({state:t,dispatch:e})=>FD(t,e),JN=()=>({state:t,dispatch:e})=>PD(t,e);function Id(t,e,n={},r={}){return vl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const XN=(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=Id(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 k0(t,e){const n=Or(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 YN(t,e){const n=new Cb(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function ZN(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 QN(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function eI(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 lh(t){return e=>eI(e.$from,t)}function w0(t,e){const n={from:0,to:t.content.size};return m0(t,n,e)}function tI(t,e){const n=Ue(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 x0(t,e){const n=Du(typeof e=="string"?e:e.name,t.schema);return n==="node"?tI(t,e):n==="mark"?k0(t,e):{}}function nI(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 rI(t){const e=nI(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 iI(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}})})}),rI(r)}function uh(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=oh(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 Ra(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 Rd(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Or(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(c=>o?o.name===c.type.name:!0).find(c=>gl(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=>gl(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 oI(t,e,n={}){if(!e)return ys(t,null,n)||Rd(t,null,n);const r=Du(e,t.schema);return r==="node"?ys(t,e,n):r==="mark"?Rd(t,e,n):!1}function Qm(t,e){const{nodeExtensions:n}=Au(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=pe(j(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Nu(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&&(Nu(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function E0(t){return t instanceof Y}function C0(t,e,n){const r=t.state.doc.content.size,i=Fn(e,0,r),o=Fn(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 sI(t,e,n){var r;const{selection:i}=e;let o=null;if(sh(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 aI=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Or(t,r.schema);if(i)if(s){const u=k0(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 sI(r,n,l)},lI=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),uI=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Ue(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})=>Km(o,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>Km(o,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},cI=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Fn(t,0,r.content.size),o=Y.create(r,i);e.setSelection(o)}return!0},dI=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=se.atStart(r).from,a=se.atEnd(r).to,l=Fn(i,s,a),u=Fn(o,s,a),c=se.create(r,l,u);e.setSelection(c)}return!0},pI=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return qD(r)(e,n)};function eg(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 hI=({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=Ra(u,a.node().type.name,a.node().attrs);if(o instanceof Y&&o.node.isBlock)return!a.parentOffset||!$i(s,a.pos)?!1:(r&&(t&&eg(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:ZN(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=d&&h?[{type:h,attrs:c}]:void 0,f=$i(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!f&&$i(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 se&&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&&eg(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},fI=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const a=Ue(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=M.empty;const b=l.index(-1)?1:l.index(-2)?2:3;for(let N=l.depth-b;N>=l.depth-3;N-=1)y=M.from(l.node(N).copy(y));const k=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,v={...Ra(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(M.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 S=-1;n.doc.nodesBetween(x,n.doc.content.size,(N,A)=>{if(S>-1)return!1;N.isTextblock&&N.content.size===0&&(S=A+1)}),S>-1&&n.setSelection(se.near(n.doc.resolve(S))),n.scrollIntoView()}return!0}const p=u.pos===l.end()?d.contentMatchAt(0).defaultType:null,f={...Ra(h,d.type.name,d.attrs),...e},m={...Ra(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(!$i(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},Ec=(t,e)=>{const n=lh(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&&Sr(t.doc,n.pos)&&t.join(n.pos),!0},Cc=(t,e)=>{const n=lh(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&&Sr(t.doc,r)&&t.join(r),!0},mI=(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=Ue(t,s.schema),f=Ue(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=lh(x=>Qm(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(Qm(w.node.type.name,d)&&p.validContent(w.node.content)&&a)return l().command(()=>(o.setNodeMarkup(w.pos,p),!0)).command(()=>Ec(o,p)).command(()=>Cc(o,p)).run()}return!n||!v||!a?l().command(()=>c().wrapInList(p,r)?!0:u.clearNodes()).wrapInList(p,r).command(()=>Ec(o,p)).command(()=>Cc(o,p)).run():l().command(()=>{const x=c().wrapInList(p,r),S=v.filter(N=>h.includes(N.type.name));return o.ensureMarks(S),x?!0:u.clearNodes()}).wrapInList(p,r).command(()=>Ec(o,p)).command(()=>Cc(o,p)).run()},gI=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Or(t,r.schema);return Rd(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},vI=(t,e,n={})=>({state:r,commands:i})=>{const o=Ue(t,r.schema),s=Ue(e,r.schema),a=ys(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})},yI=(t,e={})=>({state:n,commands:r})=>{const i=Ue(t,n.schema);return ys(n,i,e)?r.lift(i):r.wrapIn(i,e)},bI=()=>({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},kI=()=>({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},wI=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Or(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=oh(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},xI=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Du(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Ue(t,r.schema)),a==="mark"&&(s=Or(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},EI=(t,e={})=>({state:n,dispatch:r})=>{const i=Ue(t,n.schema);return LD(i,e)(n,r)},CI=(t,e={})=>({state:n,dispatch:r})=>{const i=Ue(t,n.schema);return VD(i,e)(n,r)};var SI=Object.freeze({__proto__:null,blur:aN,clearContent:lN,clearNodes:uN,command:cN,createParagraphNear:dN,cut:pN,deleteCurrentNode:hN,deleteNode:fN,deleteRange:mN,deleteSelection:gN,enter:vN,exitCode:yN,extendMarkRange:bN,first:kN,focus:xN,forEach:EN,insertContent:CN,insertContentAt:ON,joinBackward:_N,joinDown:MN,joinForward:DN,joinItemBackward:NN,joinItemForward:IN,joinTextblockBackward:RN,joinTextblockForward:PN,joinUp:AN,keyboardShortcut:LN,lift:VN,liftEmptyBlock:BN,liftListItem:$N,newlineInCode:jN,resetAttributes:zN,scrollIntoView:HN,selectAll:qN,selectNodeBackward:WN,selectNodeForward:UN,selectParentNode:KN,selectTextblockEnd:GN,selectTextblockStart:JN,setContent:XN,setMark:aI,setMeta:lI,setNode:uI,setNodeSelection:cI,setTextSelection:dI,sinkListItem:pI,splitBlock:hI,splitListItem:fI,toggleList:mI,toggleMark:gI,toggleNode:vI,toggleWrap:yI,undoInputRule:bI,unsetAllMarks:kI,unsetMark:wI,updateAttributes:xI,wrapIn:EI,wrapInList:CI});const TI=Ke.create({name:"commands",addCommands(){return{...SI}}}),OI=Ke.create({name:"drop",addProseMirrorPlugins(){return[new Ve({key:new at("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),AI=Ke.create({name:"editable",addProseMirrorPlugins(){return[new Ve({key:new at("editable"),props:{editable:()=>this.editor.options.editable}})]}}),MI=Ke.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ve({key:new at("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}}}})]}}),_I=Ke.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:le.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 ah()||b0()?i:r},addProseMirrorPlugins(){return[new Ve({key:new at("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=le.atStart(e.doc).from,u=le.atEnd(e.doc).to;if(o||!(s===l&&a===u)||!Nu(n.doc))return;const c=n.tr,d=Tu({state:n,transaction:c}),{commands:h}=new Ou({editor:this.editor,state:d});if(h.clearNodes(),!!c.steps.length)return c}})]}}),DI=Ke.create({name:"paste",addProseMirrorPlugins(){return[new Ve({key:new at("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),NI=Ke.create({name:"tabindex",addProseMirrorPlugins(){return[new Ve({key:new at("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Hr{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 Hr(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 Hr(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 Hr(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 Hr(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new Hr(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 II=`.ProseMirror {
21
21
  position: relative;
22
22
  }
23
23
 
@@ -93,8 +93,8 @@ img.ProseMirror-separator {
93
93
  opacity: 0
94
94
  }`;function RI(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 PI=class extends WD{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=RI(II,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=f0(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?[AI,sN.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)===null||t===void 0?void 0:t.clipboardTextSerializer)===null||e===void 0?void 0:e.blockSeparator}),TI,MI,_I,NI,OI,DI].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 Pi(n,this)}createCommandManager(){this.commandManager=new Ou({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let e;try{e=Id(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=Id(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=v0(e,this.options.autofocus);this.view=new uD(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:Ri.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 x0(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return oI(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return nh(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
95
95
 
96
- `,textSerializers:n={}}=t||{};return w0(this.state.doc,{blockSeparator:e,textSerializers:{...ih(this.schema),...n}})}get isEmpty(){return Nu(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 Hr(e,this)}get $doc(){return this.$pos(0)}};function to(t){return new Mu({find:t.find,handler:({state:e,range:n,match:r})=>{const i=pe(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(uh(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 FI(t){return new Mu({find:t.find,handler:({state:e,range:n,match:r})=>{const i=pe(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 Pd(t){return new Mu({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=pe(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 bs(t){return new Mu({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=pe(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&Hp(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&&Sr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let on=class Fd{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=pe(j(this,"addOptions",{name:this.name}))),this.storage=pe(j(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Fd(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>_u(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Fd(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=pe(j(n,"addOptions",{name:n.name})),n.storage=pe(j(n,"addStorage",{name:n.name,options:n.options})),n}};function li(t){return new eN({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=pe(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(uh(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 kt="top",Wt="bottom",Ut="right",wt="left",ch="auto",Rs=[kt,Wt,Ut,wt],no="start",ks="end",LI="clippingParents",S0="viewport",xo="popper",VI="reference",tg=Rs.reduce(function(t,e){return t.concat([e+"-"+no,e+"-"+ks])},[]),T0=[].concat(Rs,[ch]).reduce(function(t,e){return t.concat([e,e+"-"+no,e+"-"+ks])},[]),BI="beforeRead",$I="read",jI="afterRead",zI="beforeMain",HI="main",qI="afterMain",WI="beforeWrite",UI="write",KI="afterWrite",GI=[BI,$I,jI,zI,HI,qI,WI,UI,KI];function Cn(t){return t?(t.nodeName||"").toLowerCase():null}function Nt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ui(t){var e=Nt(t).Element;return t instanceof e||t instanceof Element}function Ht(t){var e=Nt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function dh(t){if(typeof ShadowRoot>"u")return!1;var e=Nt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function JI(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];!Ht(o)||!Cn(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 XI(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},{});!Ht(i)||!Cn(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const O0={name:"applyStyles",enabled:!0,phase:"write",fn:JI,effect:XI,requires:["computeStyles"]};function bn(t){return t.split("-")[0]}var Qr=Math.max,yl=Math.min,ro=Math.round;function Ld(){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 A0(){return!/^((?!chrome|android).)*safari/i.test(Ld())}function io(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Ht(t)&&(i=t.offsetWidth>0&&ro(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&ro(r.height)/t.offsetHeight||1);var s=ui(t)?Nt(t):window,a=s.visualViewport,l=!A0()&&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 ph(t){var e=io(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 M0(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&dh(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Hn(t){return Nt(t).getComputedStyle(t)}function YI(t){return["table","td","th"].indexOf(Cn(t))>=0}function Ar(t){return((ui(t)?t.ownerDocument:t.document)||window.document).documentElement}function Iu(t){return Cn(t)==="html"?t:t.assignedSlot||t.parentNode||(dh(t)?t.host:null)||Ar(t)}function ng(t){return!Ht(t)||Hn(t).position==="fixed"?null:t.offsetParent}function ZI(t){var e=/firefox/i.test(Ld()),n=/Trident/i.test(Ld());if(n&&Ht(t)){var r=Hn(t);if(r.position==="fixed")return null}var i=Iu(t);for(dh(i)&&(i=i.host);Ht(i)&&["html","body"].indexOf(Cn(i))<0;){var o=Hn(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 Ps(t){for(var e=Nt(t),n=ng(t);n&&YI(n)&&Hn(n).position==="static";)n=ng(n);return n&&(Cn(n)==="html"||Cn(n)==="body"&&Hn(n).position==="static")?e:n||ZI(t)||e}function hh(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ko(t,e,n){return Qr(t,yl(e,n))}function QI(t,e,n){var r=Ko(t,e,n);return r>n?n:r}function _0(){return{top:0,right:0,bottom:0,left:0}}function D0(t){return Object.assign({},_0(),t)}function N0(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var eR=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,D0(typeof t!="number"?t:N0(t,Rs))};function tR(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=bn(n.placement),l=hh(a),u=[wt,Ut].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var d=eR(i.padding,n),h=ph(o),p=l==="y"?kt:wt,f=l==="y"?Wt:Ut,m=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],g=s[l]-n.rects.reference[l],y=Ps(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,C=Ko(v,x,w),N=l;n.modifiersData[r]=(e={},e[N]=C,e.centerOffset=C-x,e)}}function nR(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)||M0(e.elements.popper,i)&&(e.elements.arrow=i))}const rR={name:"arrow",enabled:!0,phase:"main",fn:tR,effect:nR,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function oo(t){return t.split("-")[1]}var iR={top:"auto",right:"auto",bottom:"auto",left:"auto"};function oR(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:ro(n*i)/i||0,y:ro(r*i)/i||0}}function rg(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=wt,v=kt,w=window;if(u){var x=Ps(n),C="clientHeight",N="clientWidth";if(x===Nt(n)&&(x=Ar(n),Hn(x).position!=="static"&&a==="absolute"&&(C="scrollHeight",N="scrollWidth")),x=x,i===kt||(i===wt||i===Ut)&&o===ks){v=Wt;var A=d&&x===w&&w.visualViewport?w.visualViewport.height:x[C];m-=A-r.height,m*=l?1:-1}if(i===wt||(i===kt||i===Wt)&&o===ks){k=Ut;var S=d&&x===w&&w.visualViewport?w.visualViewport.width:x[N];p-=S-r.width,p*=l?1:-1}}var _=Object.assign({position:a},u&&iR),L=c===!0?oR({x:p,y:m},Nt(n)):{x:p,y:m};if(p=L.x,m=L.y,l){var W;return Object.assign({},_,(W={},W[v]=b?"0":"",W[k]=y?"0":"",W.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",W))}return Object.assign({},_,(e={},e[v]=b?m+"px":"",e[k]=y?p+"px":"",e.transform="",e))}function sR(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:bn(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,rg(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,rg(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 aR={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:sR,data:{}};var fa={passive:!0};function lR(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=Nt(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,fa)}),a&&l.addEventListener("resize",n.update,fa),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,fa)}),a&&l.removeEventListener("resize",n.update,fa)}}const uR={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:lR,data:{}};var cR={left:"right",right:"left",bottom:"top",top:"bottom"};function Pa(t){return t.replace(/left|right|bottom|top/g,function(e){return cR[e]})}var dR={start:"end",end:"start"};function ig(t){return t.replace(/start|end/g,function(e){return dR[e]})}function fh(t){var e=Nt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function mh(t){return io(Ar(t)).left+fh(t).scrollLeft}function pR(t,e){var n=Nt(t),r=Ar(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=A0();(u||!u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+mh(t),y:l}}function hR(t){var e,n=Ar(t),r=fh(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Qr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Qr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+mh(t),l=-r.scrollTop;return Hn(i||n).direction==="rtl"&&(a+=Qr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function gh(t){var e=Hn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function I0(t){return["html","body","#document"].indexOf(Cn(t))>=0?t.ownerDocument.body:Ht(t)&&gh(t)?t:I0(Iu(t))}function Go(t,e){var n;e===void 0&&(e=[]);var r=I0(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Nt(r),s=i?[o].concat(o.visualViewport||[],gh(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(Go(Iu(s)))}function Vd(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function fR(t,e){var n=io(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 og(t,e,n){return e===S0?Vd(pR(t,n)):ui(e)?fR(e,n):Vd(hR(Ar(t)))}function mR(t){var e=Go(Iu(t)),n=["absolute","fixed"].indexOf(Hn(t).position)>=0,r=n&&Ht(t)?Ps(t):t;return ui(r)?e.filter(function(i){return ui(i)&&M0(i,r)&&Cn(i)!=="body"}):[]}function gR(t,e,n,r){var i=e==="clippingParents"?mR(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,u){var c=og(t,u,r);return l.top=Qr(c.top,l.top),l.right=yl(c.right,l.right),l.bottom=yl(c.bottom,l.bottom),l.left=Qr(c.left,l.left),l},og(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 R0(t){var e=t.reference,n=t.element,r=t.placement,i=r?bn(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 kt:l={x:s,y:e.y-n.height};break;case Wt:l={x:s,y:e.y+e.height};break;case Ut:l={x:e.x+e.width,y:a};break;case wt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=i?hh(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case no:l[u]=l[u]-(e[c]/2-n[c]/2);break;case ks:l[u]=l[u]+(e[c]/2-n[c]/2);break}}return l}function ws(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?LI:a,u=n.rootBoundary,c=u===void 0?S0:u,d=n.elementContext,h=d===void 0?xo:d,p=n.altBoundary,f=p===void 0?!1:p,m=n.padding,g=m===void 0?0:m,y=D0(typeof g!="number"?g:N0(g,Rs)),b=h===xo?VI:xo,k=t.rects.popper,v=t.elements[f?b:h],w=gR(ui(v)?v:v.contextElement||Ar(t.elements.popper),l,c,s),x=io(t.elements.reference),C=R0({reference:x,element:k,placement:i}),N=Vd(Object.assign({},k,C)),A=h===xo?N:x,S={top:w.top-A.top+y.top,bottom:A.bottom-w.bottom+y.bottom,left:w.left-A.left+y.left,right:A.right-w.right+y.right},_=t.modifiersData.offset;if(h===xo&&_){var L=_[i];Object.keys(S).forEach(function(W){var q=[Ut,Wt].indexOf(W)>=0?1:-1,K=[kt,Wt].indexOf(W)>=0?"y":"x";S[W]+=L[K]*q})}return S}function vR(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?T0:l,c=oo(r),d=c?a?tg:tg.filter(function(f){return oo(f)===c}):Rs,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]=ws(t,{placement:m,boundary:i,rootBoundary:o,padding:s})[bn(m)],f},{});return Object.keys(p).sort(function(f,m){return p[f]-p[m]})}function yR(t){if(bn(t)===ch)return[];var e=Pa(t);return[ig(t),e,ig(e)]}function bR(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=bn(g),b=y===g,k=l||(b||!f?[Pa(g)]:yR(g)),v=[g].concat(k).reduce(function(an,It){return an.concat(bn(It)===ch?vR(e,{placement:It,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):It)},[]),w=e.rects.reference,x=e.rects.popper,C=new Map,N=!0,A=v[0],S=0;S<v.length;S++){var _=v[S],L=bn(_),W=oo(_)===no,q=[kt,Wt].indexOf(L)>=0,K=q?"width":"height",J=ws(e,{placement:_,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),ue=q?W?Ut:wt:W?Wt:kt;w[K]>x[K]&&(ue=Pa(ue));var ge=Pa(ue),Te=[];if(o&&Te.push(J[L]<=0),a&&Te.push(J[ue]<=0,J[ge]<=0),Te.every(function(an){return an})){A=_,N=!1;break}C.set(_,Te)}if(N)for(var mt=f?3:1,Mr=function(an){var It=v.find(function(Kn){var Dr=C.get(Kn);if(Dr)return Dr.slice(0,an).every(function(Gn){return Gn})});if(It)return A=It,"break"},sn=mt;sn>0;sn--){var _r=Mr(sn);if(_r==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const kR={name:"flip",enabled:!0,phase:"main",fn:bR,requiresIfExists:["offset"],data:{_skip:!1}};function sg(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 ag(t){return[kt,Ut,Wt,wt].some(function(e){return t[e]>=0})}function wR(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=ws(e,{elementContext:"reference"}),a=ws(e,{altBoundary:!0}),l=sg(s,r),u=sg(a,i,o),c=ag(l),d=ag(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 xR={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:wR};function ER(t,e,n){var r=bn(t),i=[wt,kt].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,[wt,Ut].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function CR(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=T0.reduce(function(c,d){return c[d]=ER(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 SR={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:CR};function TR(t){var e=t.state,n=t.name;e.modifiersData[n]=R0({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const OR={name:"popperOffsets",enabled:!0,phase:"read",fn:TR,data:{}};function AR(t){return t==="x"?"y":"x"}function MR(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=ws(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),y=bn(e.placement),b=oo(e.placement),k=!b,v=hh(y),w=AR(v),x=e.modifiersData.popperOffsets,C=e.rects.reference,N=e.rects.popper,A=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,S=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(x){if(o){var W,q=v==="y"?kt:wt,K=v==="y"?Wt:Ut,J=v==="y"?"height":"width",ue=x[v],ge=ue+g[q],Te=ue-g[K],mt=p?-N[J]/2:0,Mr=b===no?C[J]:N[J],sn=b===no?-N[J]:-C[J],_r=e.elements.arrow,an=p&&_r?ph(_r):{width:0,height:0},It=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:_0(),Kn=It[q],Dr=It[K],Gn=Ko(0,C[J],an[J]),Fs=k?C[J]/2-mt-Gn-Kn-S.mainAxis:Mr-Gn-Kn-S.mainAxis,Jn=k?-C[J]/2+mt+Gn+Dr+S.mainAxis:sn+Gn+Dr+S.mainAxis,gi=e.elements.arrow&&Ps(e.elements.arrow),Ls=gi?v==="y"?gi.clientTop||0:gi.clientLeft||0:0,po=(W=_?.[v])!=null?W:0,Vs=ue+Fs-po-Ls,Bs=ue+Jn-po,ho=Ko(p?yl(ge,Vs):ge,ue,p?Qr(Te,Bs):Te);x[v]=ho,L[v]=ho-ue}if(a){var fo,$s=v==="x"?kt:wt,js=v==="x"?Wt:Ut,Tn=x[w],Xn=w==="y"?"height":"width",mo=Tn+g[$s],Nr=Tn-g[js],go=[kt,wt].indexOf(y)!==-1,zs=(fo=_?.[w])!=null?fo:0,Hs=go?mo:Tn-C[Xn]-N[Xn]-zs+S.altAxis,qs=go?Tn+C[Xn]+N[Xn]-zs-S.altAxis:Nr,Ws=p&&go?QI(Hs,Tn,qs):Ko(p?Hs:mo,Tn,p?qs:Nr);x[w]=Ws,L[w]=Ws-Tn}e.modifiersData[r]=L}}const _R={name:"preventOverflow",enabled:!0,phase:"main",fn:MR,requiresIfExists:["offset"]};function DR(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function NR(t){return t===Nt(t)||!Ht(t)?fh(t):DR(t)}function IR(t){var e=t.getBoundingClientRect(),n=ro(e.width)/t.offsetWidth||1,r=ro(e.height)/t.offsetHeight||1;return n!==1||r!==1}function RR(t,e,n){n===void 0&&(n=!1);var r=Ht(e),i=Ht(e)&&IR(e),o=Ar(e),s=io(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Cn(e)!=="body"||gh(o))&&(a=NR(e)),Ht(e)?(l=io(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=mh(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function PR(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 FR(t){var e=PR(t);return GI.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function LR(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function VR(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 lg={placement:"bottom",modifiers:[],strategy:"absolute"};function ug(){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 BR(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?lg:i;return function(s,a,l){l===void 0&&(l=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},lg,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:ui(s)?Go(s):s.contextElement?Go(s.contextElement):[],popper:Go(a)};var y=FR(VR([].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(ug(g,y)){u.rects={reference:RR(g,Ps(y),u.options.strategy==="fixed"),popper:ph(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(N){return u.modifiersData[N.name]=Object.assign({},N.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,C=k.name;typeof v=="function"&&(u=v({state:u,options:x,name:C,instance:h})||u)}}}},update:LR(function(){return new Promise(function(m){h.forceUpdate(),m(u)})}),destroy:function(){f(),d=!0}};if(!ug(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 $R=[uR,OR,aR,O0,SR,kR,_R,rR,xR],jR=BR({defaultModifiers:$R}),zR="tippy-box",P0="tippy-content",HR="tippy-backdrop",F0="tippy-arrow",L0="tippy-svg-arrow",jr={passive:!0,capture:!0},V0=function(){return document.body};function Sc(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function vh(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function B0(t,e){return typeof t=="function"?t.apply(void 0,e):t}function cg(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function qR(t){return t.split(/\s+/).filter(Boolean)}function Mi(t){return[].concat(t)}function dg(t,e){t.indexOf(e)===-1&&t.push(e)}function WR(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function UR(t){return t.split("-")[0]}function bl(t){return[].slice.call(t)}function pg(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Jo(){return document.createElement("div")}function Ru(t){return["Element","Fragment"].some(function(e){return vh(t,e)})}function KR(t){return vh(t,"NodeList")}function GR(t){return vh(t,"MouseEvent")}function JR(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function XR(t){return Ru(t)?[t]:KR(t)?bl(t):Array.isArray(t)?t:bl(document.querySelectorAll(t))}function Tc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function hg(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function YR(t){var e,n=Mi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function ZR(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=UR(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 Oc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function fg(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 fn={isTouch:!1},mg=0;function QR(){fn.isTouch||(fn.isTouch=!0,window.performance&&document.addEventListener("mousemove",$0))}function $0(){var t=performance.now();t-mg<20&&(fn.isTouch=!1,document.removeEventListener("mousemove",$0)),mg=t}function eP(){var t=document.activeElement;if(JR(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function tP(){document.addEventListener("touchstart",QR,jr),window.addEventListener("blur",eP)}var nP=typeof window<"u"&&typeof document<"u",rP=nP?!!window.msCrypto:!1,iP={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},oP={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Zt=Object.assign({appendTo:V0,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},iP,oP),sP=Object.keys(Zt),aP=function(t){var e=Object.keys(t);e.forEach(function(n){Zt[n]=t[n]})};function j0(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=Zt[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function lP(t,e){var n=e?Object.keys(j0(Object.assign({},Zt,{plugins:e}))):sP,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 gg(t,e){var n=Object.assign({},e,{content:B0(e.content,[t])},e.ignoreAttributes?{}:lP(t,e.plugins));return n.aria=Object.assign({},Zt.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 uP=function(){return"innerHTML"};function Bd(t,e){t[uP()]=e}function vg(t){var e=Jo();return t===!0?e.className=F0:(e.className=L0,Ru(t)?e.appendChild(t):Bd(e,t)),e}function yg(t,e){Ru(e.content)?(Bd(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Bd(t,e.content):t.textContent=e.content)}function $d(t){var e=t.firstElementChild,n=bl(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(P0)}),arrow:n.find(function(r){return r.classList.contains(F0)||r.classList.contains(L0)}),backdrop:n.find(function(r){return r.classList.contains(HR)})}}function z0(t){var e=Jo(),n=Jo();n.className=zR,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Jo();r.className=P0,r.setAttribute("data-state","hidden"),yg(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=$d(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)&&yg(u,t.props),s.arrow?c?o.arrow!==s.arrow&&(l.removeChild(c),l.appendChild(vg(s.arrow))):l.appendChild(vg(s.arrow)):c&&l.removeChild(c)}return{popper:e,onUpdate:i}}z0.$$tippy=!0;var cP=1,ma=[],Ac=[];function dP(t,e){var n=gg(t,Object.assign({},Zt,j0(pg(e)))),r,i,o,s=!1,a=!1,l=!1,u=!1,c,d,h,p=[],f=cg(Vs,n.interactiveDebounce),m,g=cP++,y=null,b=WR(n.plugins),k={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:g,reference:t,popper:Jo(),popperInstance:y,props:n,state:k,plugins:b,clearDelayTimeouts:Hs,setProps:qs,setContent:Ws,show:uk,hide:ck,hideWithInteractivity:dk,enable:go,disable:zs,unmount:pk,destroy:hk};if(!n.render)return v;var w=n.render(v),x=w.popper,C=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+v.id,v.popper=x,t._tippy=v,x._tippy=v;var N=b.map(function(T){return T.fn(v)}),A=t.hasAttribute("aria-expanded");return gi(),mt(),ue(),ge("onCreate",[v]),n.showOnCreate&&mo(),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&&q().addEventListener("mousemove",f)}),v;function S(){var T=v.props.touch;return Array.isArray(T)?T:[T,0]}function _(){return S()[0]==="hold"}function L(){var T;return!!((T=v.props.render)!=null&&T.$$tippy)}function W(){return m||t}function q(){var T=W().parentNode;return T?YR(T):document}function K(){return $d(x)}function J(T){return v.state.isMounted&&!v.state.isVisible||fn.isTouch||c&&c.type==="focus"?0:Sc(v.props.delay,T?0:1,Zt.delay)}function ue(T){T===void 0&&(T=!1),x.style.pointerEvents=v.props.interactive&&!T?"":"none",x.style.zIndex=""+v.props.zIndex}function ge(T,H,re){if(re===void 0&&(re=!0),N.forEach(function(fe){fe[T]&&fe[T].apply(fe,H)}),re){var ye;(ye=v.props)[T].apply(ye,H)}}function Te(){var T=v.props.aria;if(T.content){var H="aria-"+T.content,re=x.id,ye=Mi(v.props.triggerTarget||t);ye.forEach(function(fe){var lt=fe.getAttribute(H);if(v.state.isVisible)fe.setAttribute(H,lt?lt+" "+re:re);else{var Rt=lt&&lt.replace(re,"").trim();Rt?fe.setAttribute(H,Rt):fe.removeAttribute(H)}})}}function mt(){if(!(A||!v.props.aria.expanded)){var T=Mi(v.props.triggerTarget||t);T.forEach(function(H){v.props.interactive?H.setAttribute("aria-expanded",v.state.isVisible&&H===W()?"true":"false"):H.removeAttribute("aria-expanded")})}}function Mr(){q().removeEventListener("mousemove",f),ma=ma.filter(function(T){return T!==f})}function sn(T){if(!(fn.isTouch&&(l||T.type==="mousedown"))){var H=T.composedPath&&T.composedPath()[0]||T.target;if(!(v.props.interactive&&fg(x,H))){if(Mi(v.props.triggerTarget||t).some(function(re){return fg(re,H)})){if(fn.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else ge("onClickOutside",[v,T]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),a=!0,setTimeout(function(){a=!1}),v.state.isMounted||Kn())}}}function _r(){l=!0}function an(){l=!1}function It(){var T=q();T.addEventListener("mousedown",sn,!0),T.addEventListener("touchend",sn,jr),T.addEventListener("touchstart",an,jr),T.addEventListener("touchmove",_r,jr)}function Kn(){var T=q();T.removeEventListener("mousedown",sn,!0),T.removeEventListener("touchend",sn,jr),T.removeEventListener("touchstart",an,jr),T.removeEventListener("touchmove",_r,jr)}function Dr(T,H){Fs(T,function(){!v.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&H()})}function Gn(T,H){Fs(T,H)}function Fs(T,H){var re=K().box;function ye(fe){fe.target===re&&(Oc(re,"remove",ye),H())}if(T===0)return H();Oc(re,"remove",d),Oc(re,"add",ye),d=ye}function Jn(T,H,re){re===void 0&&(re=!1);var ye=Mi(v.props.triggerTarget||t);ye.forEach(function(fe){fe.addEventListener(T,H,re),p.push({node:fe,eventType:T,handler:H,options:re})})}function gi(){_()&&(Jn("touchstart",po,{passive:!0}),Jn("touchend",Bs,{passive:!0})),qR(v.props.trigger).forEach(function(T){if(T!=="manual")switch(Jn(T,po),T){case"mouseenter":Jn("mouseleave",Bs);break;case"focus":Jn(rP?"focusout":"blur",ho);break;case"focusin":Jn("focusout",ho);break}})}function Ls(){p.forEach(function(T){var H=T.node,re=T.eventType,ye=T.handler,fe=T.options;H.removeEventListener(re,ye,fe)}),p=[]}function po(T){var H,re=!1;if(!(!v.state.isEnabled||fo(T)||a)){var ye=((H=c)==null?void 0:H.type)==="focus";c=T,m=T.currentTarget,mt(),!v.state.isVisible&&GR(T)&&ma.forEach(function(fe){return fe(T)}),T.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||s)&&v.props.hideOnClick!==!1&&v.state.isVisible?re=!0:mo(T),T.type==="click"&&(s=!re),re&&!ye&&Nr(T)}}function Vs(T){var H=T.target,re=W().contains(H)||x.contains(H);if(!(T.type==="mousemove"&&re)){var ye=Xn().concat(x).map(function(fe){var lt,Rt=fe._tippy,vi=(lt=Rt.popperInstance)==null?void 0:lt.state;return vi?{popperRect:fe.getBoundingClientRect(),popperState:vi,props:n}:null}).filter(Boolean);ZR(ye,T)&&(Mr(),Nr(T))}}function Bs(T){var H=fo(T)||v.props.trigger.indexOf("click")>=0&&s;if(!H){if(v.props.interactive){v.hideWithInteractivity(T);return}Nr(T)}}function ho(T){v.props.trigger.indexOf("focusin")<0&&T.target!==W()||v.props.interactive&&T.relatedTarget&&x.contains(T.relatedTarget)||Nr(T)}function fo(T){return fn.isTouch?_()!==T.type.indexOf("touch")>=0:!1}function $s(){js();var T=v.props,H=T.popperOptions,re=T.placement,ye=T.offset,fe=T.getReferenceClientRect,lt=T.moveTransition,Rt=L()?$d(x).arrow:null,vi=fe?{getBoundingClientRect:fe,contextElement:fe.contextElement||W()}:t,Us={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ks){var yi=Ks.state;if(L()){var fk=K(),Fu=fk.box;["placement","reference-hidden","escaped"].forEach(function(Gs){Gs==="placement"?Fu.setAttribute("data-placement",yi.placement):yi.attributes.popper["data-popper-"+Gs]?Fu.setAttribute("data-"+Gs,""):Fu.removeAttribute("data-"+Gs)}),yi.attributes.popper={}}}},Ir=[{name:"offset",options:{offset:ye}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!lt}},Us];L()&&Rt&&Ir.push({name:"arrow",options:{element:Rt,padding:3}}),Ir.push.apply(Ir,H?.modifiers||[]),v.popperInstance=jR(vi,x,Object.assign({},H,{placement:re,onFirstUpdate:h,modifiers:Ir}))}function js(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Tn(){var T=v.props.appendTo,H,re=W();v.props.interactive&&T===V0||T==="parent"?H=re.parentNode:H=B0(T,[re]),H.contains(x)||H.appendChild(x),v.state.isMounted=!0,$s()}function Xn(){return bl(x.querySelectorAll("[data-tippy-root]"))}function mo(T){v.clearDelayTimeouts(),T&&ge("onTrigger",[v,T]),It();var H=J(!0),re=S(),ye=re[0],fe=re[1];fn.isTouch&&ye==="hold"&&fe&&(H=fe),H?r=setTimeout(function(){v.show()},H):v.show()}function Nr(T){if(v.clearDelayTimeouts(),ge("onUntrigger",[v,T]),!v.state.isVisible){Kn();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(T.type)>=0&&s)){var H=J(!1);H?i=setTimeout(function(){v.state.isVisible&&v.hide()},H):o=requestAnimationFrame(function(){v.hide()})}}function go(){v.state.isEnabled=!0}function zs(){v.hide(),v.state.isEnabled=!1}function Hs(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function qs(T){if(!v.state.isDestroyed){ge("onBeforeUpdate",[v,T]),Ls();var H=v.props,re=gg(t,Object.assign({},H,pg(T),{ignoreAttributes:!0}));v.props=re,gi(),H.interactiveDebounce!==re.interactiveDebounce&&(Mr(),f=cg(Vs,re.interactiveDebounce)),H.triggerTarget&&!re.triggerTarget?Mi(H.triggerTarget).forEach(function(ye){ye.removeAttribute("aria-expanded")}):re.triggerTarget&&t.removeAttribute("aria-expanded"),mt(),ue(),C&&C(H,re),v.popperInstance&&($s(),Xn().forEach(function(ye){requestAnimationFrame(ye._tippy.popperInstance.forceUpdate)})),ge("onAfterUpdate",[v,T])}}function Ws(T){v.setProps({content:T})}function uk(){var T=v.state.isVisible,H=v.state.isDestroyed,re=!v.state.isEnabled,ye=fn.isTouch&&!v.props.touch,fe=Sc(v.props.duration,0,Zt.duration);if(!(T||H||re||ye)&&!W().hasAttribute("disabled")&&(ge("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,L()&&(x.style.visibility="visible"),ue(),It(),v.state.isMounted||(x.style.transition="none"),L()){var lt=K(),Rt=lt.box,vi=lt.content;Tc([Rt,vi],0)}h=function(){var Us;if(!(!v.state.isVisible||u)){if(u=!0,x.offsetHeight,x.style.transition=v.props.moveTransition,L()&&v.props.animation){var Ir=K(),Ks=Ir.box,yi=Ir.content;Tc([Ks,yi],fe),hg([Ks,yi],"visible")}Te(),mt(),dg(Ac,v),(Us=v.popperInstance)==null||Us.forceUpdate(),ge("onMount",[v]),v.props.animation&&L()&&Gn(fe,function(){v.state.isShown=!0,ge("onShown",[v])})}},Tn()}}function ck(){var T=!v.state.isVisible,H=v.state.isDestroyed,re=!v.state.isEnabled,ye=Sc(v.props.duration,1,Zt.duration);if(!(T||H||re)&&(ge("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,u=!1,s=!1,L()&&(x.style.visibility="hidden"),Mr(),Kn(),ue(!0),L()){var fe=K(),lt=fe.box,Rt=fe.content;v.props.animation&&(Tc([lt,Rt],ye),hg([lt,Rt],"hidden"))}Te(),mt(),v.props.animation?L()&&Dr(ye,v.unmount):v.unmount()}}function dk(T){q().addEventListener("mousemove",f),dg(ma,f),f(T)}function pk(){v.state.isVisible&&v.hide(),v.state.isMounted&&(js(),Xn().forEach(function(T){T._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),Ac=Ac.filter(function(T){return T!==v}),v.state.isMounted=!1,ge("onHidden",[v]))}function hk(){!v.state.isDestroyed&&(v.clearDelayTimeouts(),v.unmount(),Ls(),delete t._tippy,v.state.isDestroyed=!0,ge("onDestroy",[v]))}}function co(t,e){e===void 0&&(e={});var n=Zt.plugins.concat(e.plugins||[]);tP();var r=Object.assign({},e,{plugins:n}),i=XR(t),o=i.reduce(function(s,a){var l=a&&dP(a,r);return l&&s.push(l),s},[]);return Ru(t)?o[0]:o}co.defaultProps=Zt;co.setDefaultProps=aP;co.currentInput=fn;Object.assign({},O0,{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)}});co.setDefaultProps({render:z0});class pP{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&&sh(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(E0(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 C0(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=co(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 hP=t=>new Ve({key:typeof t.pluginKey=="string"?new at(t.pluginKey):t.pluginKey,view:e=>new pP({view:e,...t})});Ke.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[hP({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class fP{getTextContent(e){return w0(e,{textSerializers:ih(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=co(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)||(()=>C0(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 mP=t=>new Ve({key:typeof t.pluginKey=="string"?new at(t.pluginKey):t.pluginKey,view:e=>new fP({view:e,...t})});Ke.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[mP({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});function bg(t){return ep((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class gP extends PI{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=bg(this.view.state),this.reactiveExtensionStorage=bg(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),ka(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 vP=Q({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=X(),n=np();return Fg(()=>{const r=t.editor;r&&r.options.element&&e.value&&kr(()=>{if(!e.value||!r.options.element.firstChild)return;const i=B(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()})}),ao(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return ns("div",{ref:t=>{this.rootEl=t}})}}),yP=(t={})=>{const e=qt();return qn(()=>{e.value=new gP(t)}),ao(()=>{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},bP="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",kP="ελ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",so=(t,e)=>{for(const n in e)t[n]=e[n];return t},jd="numeric",zd="ascii",Hd="alpha",Xo="asciinumeric",Fo="alphanumeric",qd="domain",H0="emoji",wP="scheme",xP="slashscheme",Mc="whitespace";function EP(t,e){return t in e||(e[t]=[]),e[t]}function Kr(t,e,n){e[jd]&&(e[Xo]=!0,e[Fo]=!0),e[zd]&&(e[Xo]=!0,e[Hd]=!0),e[Xo]&&(e[Fo]=!0),e[Hd]&&(e[Fo]=!0),e[Fo]&&(e[qd]=!0),e[H0]&&(e[qd]=!0);for(const r in e){const i=EP(r,n);i.indexOf(t)<0&&i.push(t)}}function CP(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function vt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}vt.groups={};vt.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||vt.groups;let i;return e&&e.j?i=e:(i=new vt(e),n&&r&&Kr(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||vt.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 vt,so(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new vt,o){if(r)if(s.t&&typeof s.t=="string"){const l=so(CP(s.t,r),n);Kr(o,l,r)}else n&&Kr(o,n,r);s.t=o}return i.j[t]=s,s}};const ce=(t,e,n,r,i)=>t.ta(e,n,r,i),Oe=(t,e,n,r,i)=>t.tr(e,n,r,i),kg=(t,e,n,r,i)=>t.ts(e,n,r,i),D=(t,e,n,r,i)=>t.tt(e,n,r,i),Dn="WORD",Wd="UWORD",q0="ASCIINUMERICAL",W0="ALPHANUMERICAL",xs="LOCALHOST",Ud="TLD",Kd="UTLD",Fa="SCHEME",_i="SLASH_SCHEME",yh="NUM",Gd="WS",bh="NL",Yo="OPENBRACE",Zo="CLOSEBRACE",kl="OPENBRACKET",wl="CLOSEBRACKET",xl="OPENPAREN",El="CLOSEPAREN",Cl="OPENANGLEBRACKET",Sl="CLOSEANGLEBRACKET",Tl="FULLWIDTHLEFTPAREN",Ol="FULLWIDTHRIGHTPAREN",Al="LEFTCORNERBRACKET",Ml="RIGHTCORNERBRACKET",_l="LEFTWHITECORNERBRACKET",Dl="RIGHTWHITECORNERBRACKET",Nl="FULLWIDTHLESSTHAN",Il="FULLWIDTHGREATERTHAN",Rl="AMPERSAND",kh="APOSTROPHE",Pl="ASTERISK",tr="AT",Fl="BACKSLASH",Ll="BACKTICK",Vl="CARET",or="COLON",wh="COMMA",Bl="DOLLAR",cn="DOT",$l="EQUALS",xh="EXCLAMATION",Ft="HYPHEN",Qo="PERCENT",jl="PIPE",zl="PLUS",Hl="POUND",es="QUERY",Eh="QUOTE",U0="FULLWIDTHMIDDLEDOT",Ch="SEMI",dn="SLASH",ts="TILDE",ql="UNDERSCORE",K0="EMOJI",Wl="SYM";var G0=Object.freeze({__proto__:null,WORD:Dn,UWORD:Wd,ASCIINUMERICAL:q0,ALPHANUMERICAL:W0,LOCALHOST:xs,TLD:Ud,UTLD:Kd,SCHEME:Fa,SLASH_SCHEME:_i,NUM:yh,WS:Gd,NL:bh,OPENBRACE:Yo,CLOSEBRACE:Zo,OPENBRACKET:kl,CLOSEBRACKET:wl,OPENPAREN:xl,CLOSEPAREN:El,OPENANGLEBRACKET:Cl,CLOSEANGLEBRACKET:Sl,FULLWIDTHLEFTPAREN:Tl,FULLWIDTHRIGHTPAREN:Ol,LEFTCORNERBRACKET:Al,RIGHTCORNERBRACKET:Ml,LEFTWHITECORNERBRACKET:_l,RIGHTWHITECORNERBRACKET:Dl,FULLWIDTHLESSTHAN:Nl,FULLWIDTHGREATERTHAN:Il,AMPERSAND:Rl,APOSTROPHE:kh,ASTERISK:Pl,AT:tr,BACKSLASH:Fl,BACKTICK:Ll,CARET:Vl,COLON:or,COMMA:wh,DOLLAR:Bl,DOT:cn,EQUALS:$l,EXCLAMATION:xh,HYPHEN:Ft,PERCENT:Qo,PIPE:jl,PLUS:zl,POUND:Hl,QUERY:es,QUOTE:Eh,FULLWIDTHMIDDLEDOT:U0,SEMI:Ch,SLASH:dn,TILDE:ts,UNDERSCORE:ql,EMOJI:K0,SYM:Wl});const An=/[a-z]/,Eo=/\p{L}/u,_c=/\p{Emoji}/u,Mn=/\d/,Dc=/\s/,wg="\r",Nc=`
97
- `,SP="️",TP="‍",Ic="";let ga=null,va=null;function OP(t=[]){const e={};vt.groups=e;const n=new vt;ga==null&&(ga=xg(bP)),va==null&&(va=xg(kP)),D(n,"'",kh),D(n,"{",Yo),D(n,"}",Zo),D(n,"[",kl),D(n,"]",wl),D(n,"(",xl),D(n,")",El),D(n,"<",Cl),D(n,">",Sl),D(n,"(",Tl),D(n,")",Ol),D(n,"「",Al),D(n,"」",Ml),D(n,"『",_l),D(n,"』",Dl),D(n,"<",Nl),D(n,">",Il),D(n,"&",Rl),D(n,"*",Pl),D(n,"@",tr),D(n,"`",Ll),D(n,"^",Vl),D(n,":",or),D(n,",",wh),D(n,"$",Bl),D(n,".",cn),D(n,"=",$l),D(n,"!",xh),D(n,"-",Ft),D(n,"%",Qo),D(n,"|",jl),D(n,"+",zl),D(n,"#",Hl),D(n,"?",es),D(n,'"',Eh),D(n,"/",dn),D(n,";",Ch),D(n,"~",ts),D(n,"_",ql),D(n,"\\",Fl),D(n,"・",U0);const r=Oe(n,Mn,yh,{[jd]:!0});Oe(r,Mn,r);const i=Oe(r,An,q0,{[Xo]:!0}),o=Oe(r,Eo,W0,{[Fo]:!0}),s=Oe(n,An,Dn,{[zd]:!0});Oe(s,Mn,i),Oe(s,An,s),Oe(i,Mn,i),Oe(i,An,i);const a=Oe(n,Eo,Wd,{[Hd]:!0});Oe(a,An),Oe(a,Mn,o),Oe(a,Eo,a),Oe(o,Mn,o),Oe(o,An),Oe(o,Eo,o);const l=D(n,Nc,bh,{[Mc]:!0}),u=D(n,wg,Gd,{[Mc]:!0}),c=Oe(n,Dc,Gd,{[Mc]:!0});D(n,Ic,c),D(u,Nc,l),D(u,Ic,c),Oe(u,Dc,c),D(c,wg),D(c,Nc),Oe(c,Dc,c),D(c,Ic,c);const d=Oe(n,_c,K0,{[H0]:!0});D(d,"#"),Oe(d,_c,d),D(d,SP,d);const h=D(d,TP);D(h,"#"),Oe(h,_c,d);const p=[[An,s],[Mn,i]],f=[[An,null],[Eo,a],[Mn,o]];for(let m=0;m<ga.length;m++)Yn(n,ga[m],Ud,Dn,p);for(let m=0;m<va.length;m++)Yn(n,va[m],Kd,Wd,f);Kr(Ud,{tld:!0,ascii:!0},e),Kr(Kd,{utld:!0,alpha:!0},e),Yn(n,"file",Fa,Dn,p),Yn(n,"mailto",Fa,Dn,p),Yn(n,"http",_i,Dn,p),Yn(n,"https",_i,Dn,p),Yn(n,"ftp",_i,Dn,p),Yn(n,"ftps",_i,Dn,p),Kr(Fa,{scheme:!0,ascii:!0},e),Kr(_i,{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]?{[wP]:!0}:{[xP]:!0};g.indexOf("-")>=0?y[qd]=!0:An.test(g)?Mn.test(g)?y[Xo]=!0:y[zd]=!0:y[jd]=!0,kg(n,g,g,y)}return kg(n,"localhost",xs,{ascii:!0}),n.jd=new vt(Wl),{start:n,tokens:so({groups:e},G0)}}function J0(t,e){const n=AP(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 AP(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 Yn(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 vt(r),o.jr=i.slice(),t.j[l]=o),t=o}return o=new vt(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}function xg(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 Es={defaultProtocol:"http",events:null,format:Eg,formatHref:Eg,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Sh(t,e=null){let n=so({},Es);t&&(n=so(n,t instanceof Sh?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}Sh.prototype={o:Es,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]:Es[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 Eg(t){return t}function X0(t,e){this.t="token",this.v=t,this.tk=e}X0.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=Es.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&&so(s,c),{tagName:i,attributes:s,content:o,eventListeners:d}}};function Pu(t,e){class n extends X0{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 Cg=Pu("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Sg=Pu("text"),MP=Pu("nl"),ya=Pu("url",{isLink:!0,toHref(t=Es.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==xs&&t[1].t===or}}),Pt=t=>new vt(t);function _P({groups:t}){const e=t.domain.concat([Rl,Pl,tr,Fl,Ll,Vl,Bl,$l,Ft,yh,Qo,jl,zl,Hl,dn,Wl,ts,ql]),n=[or,wh,cn,xh,Qo,es,Eh,Ch,Cl,Sl,Yo,Zo,wl,kl,xl,El,Tl,Ol,Al,Ml,_l,Dl,Nl,Il],r=[Rl,kh,Pl,Fl,Ll,Vl,Bl,$l,Ft,Yo,Zo,Qo,jl,zl,Hl,es,dn,Wl,ts,ql],i=Pt(),o=D(i,ts);ce(o,r,o),ce(o,t.domain,o);const s=Pt(),a=Pt(),l=Pt();ce(i,t.domain,s),ce(i,t.scheme,a),ce(i,t.slashscheme,l),ce(s,r,o),ce(s,t.domain,s);const u=D(s,tr);D(o,tr,u),D(a,tr,u),D(l,tr,u);const c=D(o,cn);ce(c,r,o),ce(c,t.domain,o);const d=Pt();ce(u,t.domain,d),ce(d,t.domain,d);const h=D(d,cn);ce(h,t.domain,d);const p=Pt(Cg);ce(h,t.tld,p),ce(h,t.utld,p),D(u,xs,p);const f=D(d,Ft);D(f,Ft,f),ce(f,t.domain,d),ce(p,t.domain,d),D(p,cn,h),D(p,Ft,f);const m=D(p,or);ce(m,t.numeric,Cg);const g=D(s,Ft),y=D(s,cn);D(g,Ft,g),ce(g,t.domain,s),ce(y,r,o),ce(y,t.domain,s);const b=Pt(ya);ce(y,t.tld,b),ce(y,t.utld,b),ce(b,t.domain,s),ce(b,r,o),D(b,cn,y),D(b,Ft,g),D(b,tr,u);const k=D(b,or),v=Pt(ya);ce(k,t.numeric,v);const w=Pt(ya),x=Pt();ce(w,e,w),ce(w,n,x),ce(x,e,w),ce(x,n,x),D(b,dn,w),D(v,dn,w);const C=D(a,or),N=D(l,or),A=D(N,dn),S=D(A,dn);ce(a,t.domain,s),D(a,cn,y),D(a,Ft,g),ce(l,t.domain,s),D(l,cn,y),D(l,Ft,g),ce(C,t.domain,w),D(C,dn,w),D(C,es,w),ce(S,t.domain,w),ce(S,e,w),D(S,dn,w);const _=[[Yo,Zo],[kl,wl],[xl,El],[Cl,Sl],[Tl,Ol],[Al,Ml],[_l,Dl],[Nl,Il]];for(let L=0;L<_.length;L++){const[W,q]=_[L],K=D(w,W);D(x,W,K),D(K,q,w);const J=Pt(ya);ce(K,e,J);const ue=Pt();ce(K,n),ce(J,e,J),ce(J,n,ue),ce(ue,e,J),ce(ue,n,ue),D(J,q,w),D(ue,q,w)}return D(i,xs,b),D(i,bh,MP),{start:i,tokens:G0}}function DP(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(Rc(Sg,e,s)),s=[]),i-=h,c-=h;const p=d.t,f=n.slice(i-c,i);o.push(Rc(p,e,f))}}return s.length>0&&o.push(Rc(Sg,e,s)),o}function Rc(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 NP=typeof console<"u"&&console&&console.warn||(()=>{}),IP="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",we={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function RP(){return vt.groups={},we.scanner=null,we.parser=null,we.tokenQueue=[],we.pluginQueue=[],we.customSchemes=[],we.initialized=!1,we}function Tg(t,e=!1){if(we.initialized&&NP(`linkifyjs: already initialized - will not register custom scheme "${t}" ${IP}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
96
+ `,textSerializers:n={}}=t||{};return w0(this.state.doc,{blockSeparator:e,textSerializers:{...ih(this.schema),...n}})}get isEmpty(){return Nu(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 Hr(e,this)}get $doc(){return this.$pos(0)}};function to(t){return new Mu({find:t.find,handler:({state:e,range:n,match:r})=>{const i=pe(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(uh(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 FI(t){return new Mu({find:t.find,handler:({state:e,range:n,match:r})=>{const i=pe(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 Pd(t){return new Mu({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=pe(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 bs(t){return new Mu({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=pe(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&Hp(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&&Sr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let on=class Fd{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=pe(j(this,"addOptions",{name:this.name}))),this.storage=pe(j(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Fd(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>_u(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Fd(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=pe(j(n,"addOptions",{name:n.name})),n.storage=pe(j(n,"addStorage",{name:n.name,options:n.options})),n}};function li(t){return new eN({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=pe(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(uh(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 kt="top",Wt="bottom",Ut="right",wt="left",ch="auto",Rs=[kt,Wt,Ut,wt],no="start",ks="end",LI="clippingParents",S0="viewport",xo="popper",VI="reference",tg=Rs.reduce(function(t,e){return t.concat([e+"-"+no,e+"-"+ks])},[]),T0=[].concat(Rs,[ch]).reduce(function(t,e){return t.concat([e,e+"-"+no,e+"-"+ks])},[]),BI="beforeRead",$I="read",jI="afterRead",zI="beforeMain",HI="main",qI="afterMain",WI="beforeWrite",UI="write",KI="afterWrite",GI=[BI,$I,jI,zI,HI,qI,WI,UI,KI];function Cn(t){return t?(t.nodeName||"").toLowerCase():null}function Nt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ui(t){var e=Nt(t).Element;return t instanceof e||t instanceof Element}function Ht(t){var e=Nt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function dh(t){if(typeof ShadowRoot>"u")return!1;var e=Nt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function JI(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];!Ht(o)||!Cn(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 XI(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},{});!Ht(i)||!Cn(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const O0={name:"applyStyles",enabled:!0,phase:"write",fn:JI,effect:XI,requires:["computeStyles"]};function bn(t){return t.split("-")[0]}var Qr=Math.max,yl=Math.min,ro=Math.round;function Ld(){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 A0(){return!/^((?!chrome|android).)*safari/i.test(Ld())}function io(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Ht(t)&&(i=t.offsetWidth>0&&ro(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&ro(r.height)/t.offsetHeight||1);var s=ui(t)?Nt(t):window,a=s.visualViewport,l=!A0()&&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 ph(t){var e=io(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 M0(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&dh(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Hn(t){return Nt(t).getComputedStyle(t)}function YI(t){return["table","td","th"].indexOf(Cn(t))>=0}function Ar(t){return((ui(t)?t.ownerDocument:t.document)||window.document).documentElement}function Iu(t){return Cn(t)==="html"?t:t.assignedSlot||t.parentNode||(dh(t)?t.host:null)||Ar(t)}function ng(t){return!Ht(t)||Hn(t).position==="fixed"?null:t.offsetParent}function ZI(t){var e=/firefox/i.test(Ld()),n=/Trident/i.test(Ld());if(n&&Ht(t)){var r=Hn(t);if(r.position==="fixed")return null}var i=Iu(t);for(dh(i)&&(i=i.host);Ht(i)&&["html","body"].indexOf(Cn(i))<0;){var o=Hn(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 Ps(t){for(var e=Nt(t),n=ng(t);n&&YI(n)&&Hn(n).position==="static";)n=ng(n);return n&&(Cn(n)==="html"||Cn(n)==="body"&&Hn(n).position==="static")?e:n||ZI(t)||e}function hh(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ko(t,e,n){return Qr(t,yl(e,n))}function QI(t,e,n){var r=Ko(t,e,n);return r>n?n:r}function _0(){return{top:0,right:0,bottom:0,left:0}}function D0(t){return Object.assign({},_0(),t)}function N0(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var eR=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,D0(typeof t!="number"?t:N0(t,Rs))};function tR(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=bn(n.placement),l=hh(a),u=[wt,Ut].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var d=eR(i.padding,n),h=ph(o),p=l==="y"?kt:wt,f=l==="y"?Wt:Ut,m=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],g=s[l]-n.rects.reference[l],y=Ps(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,S=Ko(v,x,w),N=l;n.modifiersData[r]=(e={},e[N]=S,e.centerOffset=S-x,e)}}function nR(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)||M0(e.elements.popper,i)&&(e.elements.arrow=i))}const rR={name:"arrow",enabled:!0,phase:"main",fn:tR,effect:nR,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function oo(t){return t.split("-")[1]}var iR={top:"auto",right:"auto",bottom:"auto",left:"auto"};function oR(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:ro(n*i)/i||0,y:ro(r*i)/i||0}}function rg(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=wt,v=kt,w=window;if(u){var x=Ps(n),S="clientHeight",N="clientWidth";if(x===Nt(n)&&(x=Ar(n),Hn(x).position!=="static"&&a==="absolute"&&(S="scrollHeight",N="scrollWidth")),x=x,i===kt||(i===wt||i===Ut)&&o===ks){v=Wt;var A=d&&x===w&&w.visualViewport?w.visualViewport.height:x[S];m-=A-r.height,m*=l?1:-1}if(i===wt||(i===kt||i===Wt)&&o===ks){k=Ut;var C=d&&x===w&&w.visualViewport?w.visualViewport.width:x[N];p-=C-r.width,p*=l?1:-1}}var _=Object.assign({position:a},u&&iR),L=c===!0?oR({x:p,y:m},Nt(n)):{x:p,y:m};if(p=L.x,m=L.y,l){var W;return Object.assign({},_,(W={},W[v]=b?"0":"",W[k]=y?"0":"",W.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",W))}return Object.assign({},_,(e={},e[v]=b?m+"px":"",e[k]=y?p+"px":"",e.transform="",e))}function sR(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:bn(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,rg(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,rg(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 aR={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:sR,data:{}};var fa={passive:!0};function lR(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=Nt(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,fa)}),a&&l.addEventListener("resize",n.update,fa),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,fa)}),a&&l.removeEventListener("resize",n.update,fa)}}const uR={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:lR,data:{}};var cR={left:"right",right:"left",bottom:"top",top:"bottom"};function Pa(t){return t.replace(/left|right|bottom|top/g,function(e){return cR[e]})}var dR={start:"end",end:"start"};function ig(t){return t.replace(/start|end/g,function(e){return dR[e]})}function fh(t){var e=Nt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function mh(t){return io(Ar(t)).left+fh(t).scrollLeft}function pR(t,e){var n=Nt(t),r=Ar(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=A0();(u||!u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+mh(t),y:l}}function hR(t){var e,n=Ar(t),r=fh(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Qr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Qr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+mh(t),l=-r.scrollTop;return Hn(i||n).direction==="rtl"&&(a+=Qr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function gh(t){var e=Hn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function I0(t){return["html","body","#document"].indexOf(Cn(t))>=0?t.ownerDocument.body:Ht(t)&&gh(t)?t:I0(Iu(t))}function Go(t,e){var n;e===void 0&&(e=[]);var r=I0(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Nt(r),s=i?[o].concat(o.visualViewport||[],gh(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(Go(Iu(s)))}function Vd(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function fR(t,e){var n=io(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 og(t,e,n){return e===S0?Vd(pR(t,n)):ui(e)?fR(e,n):Vd(hR(Ar(t)))}function mR(t){var e=Go(Iu(t)),n=["absolute","fixed"].indexOf(Hn(t).position)>=0,r=n&&Ht(t)?Ps(t):t;return ui(r)?e.filter(function(i){return ui(i)&&M0(i,r)&&Cn(i)!=="body"}):[]}function gR(t,e,n,r){var i=e==="clippingParents"?mR(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,u){var c=og(t,u,r);return l.top=Qr(c.top,l.top),l.right=yl(c.right,l.right),l.bottom=yl(c.bottom,l.bottom),l.left=Qr(c.left,l.left),l},og(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 R0(t){var e=t.reference,n=t.element,r=t.placement,i=r?bn(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 kt:l={x:s,y:e.y-n.height};break;case Wt:l={x:s,y:e.y+e.height};break;case Ut:l={x:e.x+e.width,y:a};break;case wt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=i?hh(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case no:l[u]=l[u]-(e[c]/2-n[c]/2);break;case ks:l[u]=l[u]+(e[c]/2-n[c]/2);break}}return l}function ws(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?LI:a,u=n.rootBoundary,c=u===void 0?S0:u,d=n.elementContext,h=d===void 0?xo:d,p=n.altBoundary,f=p===void 0?!1:p,m=n.padding,g=m===void 0?0:m,y=D0(typeof g!="number"?g:N0(g,Rs)),b=h===xo?VI:xo,k=t.rects.popper,v=t.elements[f?b:h],w=gR(ui(v)?v:v.contextElement||Ar(t.elements.popper),l,c,s),x=io(t.elements.reference),S=R0({reference:x,element:k,placement:i}),N=Vd(Object.assign({},k,S)),A=h===xo?N:x,C={top:w.top-A.top+y.top,bottom:A.bottom-w.bottom+y.bottom,left:w.left-A.left+y.left,right:A.right-w.right+y.right},_=t.modifiersData.offset;if(h===xo&&_){var L=_[i];Object.keys(C).forEach(function(W){var q=[Ut,Wt].indexOf(W)>=0?1:-1,K=[kt,Wt].indexOf(W)>=0?"y":"x";C[W]+=L[K]*q})}return C}function vR(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?T0:l,c=oo(r),d=c?a?tg:tg.filter(function(f){return oo(f)===c}):Rs,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]=ws(t,{placement:m,boundary:i,rootBoundary:o,padding:s})[bn(m)],f},{});return Object.keys(p).sort(function(f,m){return p[f]-p[m]})}function yR(t){if(bn(t)===ch)return[];var e=Pa(t);return[ig(t),e,ig(e)]}function bR(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=bn(g),b=y===g,k=l||(b||!f?[Pa(g)]:yR(g)),v=[g].concat(k).reduce(function(an,It){return an.concat(bn(It)===ch?vR(e,{placement:It,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):It)},[]),w=e.rects.reference,x=e.rects.popper,S=new Map,N=!0,A=v[0],C=0;C<v.length;C++){var _=v[C],L=bn(_),W=oo(_)===no,q=[kt,Wt].indexOf(L)>=0,K=q?"width":"height",J=ws(e,{placement:_,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),ue=q?W?Ut:wt:W?Wt:kt;w[K]>x[K]&&(ue=Pa(ue));var ge=Pa(ue),Te=[];if(o&&Te.push(J[L]<=0),a&&Te.push(J[ue]<=0,J[ge]<=0),Te.every(function(an){return an})){A=_,N=!1;break}S.set(_,Te)}if(N)for(var mt=f?3:1,Mr=function(an){var It=v.find(function(Kn){var Dr=S.get(Kn);if(Dr)return Dr.slice(0,an).every(function(Gn){return Gn})});if(It)return A=It,"break"},sn=mt;sn>0;sn--){var _r=Mr(sn);if(_r==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const kR={name:"flip",enabled:!0,phase:"main",fn:bR,requiresIfExists:["offset"],data:{_skip:!1}};function sg(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 ag(t){return[kt,Ut,Wt,wt].some(function(e){return t[e]>=0})}function wR(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=ws(e,{elementContext:"reference"}),a=ws(e,{altBoundary:!0}),l=sg(s,r),u=sg(a,i,o),c=ag(l),d=ag(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 xR={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:wR};function ER(t,e,n){var r=bn(t),i=[wt,kt].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,[wt,Ut].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function CR(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=T0.reduce(function(c,d){return c[d]=ER(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 SR={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:CR};function TR(t){var e=t.state,n=t.name;e.modifiersData[n]=R0({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const OR={name:"popperOffsets",enabled:!0,phase:"read",fn:TR,data:{}};function AR(t){return t==="x"?"y":"x"}function MR(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=ws(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),y=bn(e.placement),b=oo(e.placement),k=!b,v=hh(y),w=AR(v),x=e.modifiersData.popperOffsets,S=e.rects.reference,N=e.rects.popper,A=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,C=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(x){if(o){var W,q=v==="y"?kt:wt,K=v==="y"?Wt:Ut,J=v==="y"?"height":"width",ue=x[v],ge=ue+g[q],Te=ue-g[K],mt=p?-N[J]/2:0,Mr=b===no?S[J]:N[J],sn=b===no?-N[J]:-S[J],_r=e.elements.arrow,an=p&&_r?ph(_r):{width:0,height:0},It=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:_0(),Kn=It[q],Dr=It[K],Gn=Ko(0,S[J],an[J]),Fs=k?S[J]/2-mt-Gn-Kn-C.mainAxis:Mr-Gn-Kn-C.mainAxis,Jn=k?-S[J]/2+mt+Gn+Dr+C.mainAxis:sn+Gn+Dr+C.mainAxis,gi=e.elements.arrow&&Ps(e.elements.arrow),Ls=gi?v==="y"?gi.clientTop||0:gi.clientLeft||0:0,po=(W=_?.[v])!=null?W:0,Vs=ue+Fs-po-Ls,Bs=ue+Jn-po,ho=Ko(p?yl(ge,Vs):ge,ue,p?Qr(Te,Bs):Te);x[v]=ho,L[v]=ho-ue}if(a){var fo,$s=v==="x"?kt:wt,js=v==="x"?Wt:Ut,Tn=x[w],Xn=w==="y"?"height":"width",mo=Tn+g[$s],Nr=Tn-g[js],go=[kt,wt].indexOf(y)!==-1,zs=(fo=_?.[w])!=null?fo:0,Hs=go?mo:Tn-S[Xn]-N[Xn]-zs+C.altAxis,qs=go?Tn+S[Xn]+N[Xn]-zs-C.altAxis:Nr,Ws=p&&go?QI(Hs,Tn,qs):Ko(p?Hs:mo,Tn,p?qs:Nr);x[w]=Ws,L[w]=Ws-Tn}e.modifiersData[r]=L}}const _R={name:"preventOverflow",enabled:!0,phase:"main",fn:MR,requiresIfExists:["offset"]};function DR(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function NR(t){return t===Nt(t)||!Ht(t)?fh(t):DR(t)}function IR(t){var e=t.getBoundingClientRect(),n=ro(e.width)/t.offsetWidth||1,r=ro(e.height)/t.offsetHeight||1;return n!==1||r!==1}function RR(t,e,n){n===void 0&&(n=!1);var r=Ht(e),i=Ht(e)&&IR(e),o=Ar(e),s=io(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Cn(e)!=="body"||gh(o))&&(a=NR(e)),Ht(e)?(l=io(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=mh(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function PR(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 FR(t){var e=PR(t);return GI.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function LR(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function VR(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 lg={placement:"bottom",modifiers:[],strategy:"absolute"};function ug(){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 BR(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?lg:i;return function(s,a,l){l===void 0&&(l=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},lg,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:ui(s)?Go(s):s.contextElement?Go(s.contextElement):[],popper:Go(a)};var y=FR(VR([].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(ug(g,y)){u.rects={reference:RR(g,Ps(y),u.options.strategy==="fixed"),popper:ph(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(N){return u.modifiersData[N.name]=Object.assign({},N.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,S=k.name;typeof v=="function"&&(u=v({state:u,options:x,name:S,instance:h})||u)}}}},update:LR(function(){return new Promise(function(m){h.forceUpdate(),m(u)})}),destroy:function(){f(),d=!0}};if(!ug(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 $R=[uR,OR,aR,O0,SR,kR,_R,rR,xR],jR=BR({defaultModifiers:$R}),zR="tippy-box",P0="tippy-content",HR="tippy-backdrop",F0="tippy-arrow",L0="tippy-svg-arrow",jr={passive:!0,capture:!0},V0=function(){return document.body};function Sc(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function vh(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function B0(t,e){return typeof t=="function"?t.apply(void 0,e):t}function cg(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function qR(t){return t.split(/\s+/).filter(Boolean)}function Mi(t){return[].concat(t)}function dg(t,e){t.indexOf(e)===-1&&t.push(e)}function WR(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function UR(t){return t.split("-")[0]}function bl(t){return[].slice.call(t)}function pg(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Jo(){return document.createElement("div")}function Ru(t){return["Element","Fragment"].some(function(e){return vh(t,e)})}function KR(t){return vh(t,"NodeList")}function GR(t){return vh(t,"MouseEvent")}function JR(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function XR(t){return Ru(t)?[t]:KR(t)?bl(t):Array.isArray(t)?t:bl(document.querySelectorAll(t))}function Tc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function hg(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function YR(t){var e,n=Mi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function ZR(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=UR(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 Oc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function fg(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 fn={isTouch:!1},mg=0;function QR(){fn.isTouch||(fn.isTouch=!0,window.performance&&document.addEventListener("mousemove",$0))}function $0(){var t=performance.now();t-mg<20&&(fn.isTouch=!1,document.removeEventListener("mousemove",$0)),mg=t}function eP(){var t=document.activeElement;if(JR(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function tP(){document.addEventListener("touchstart",QR,jr),window.addEventListener("blur",eP)}var nP=typeof window<"u"&&typeof document<"u",rP=nP?!!window.msCrypto:!1,iP={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},oP={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Zt=Object.assign({appendTo:V0,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},iP,oP),sP=Object.keys(Zt),aP=function(t){var e=Object.keys(t);e.forEach(function(n){Zt[n]=t[n]})};function j0(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=Zt[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function lP(t,e){var n=e?Object.keys(j0(Object.assign({},Zt,{plugins:e}))):sP,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 gg(t,e){var n=Object.assign({},e,{content:B0(e.content,[t])},e.ignoreAttributes?{}:lP(t,e.plugins));return n.aria=Object.assign({},Zt.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 uP=function(){return"innerHTML"};function Bd(t,e){t[uP()]=e}function vg(t){var e=Jo();return t===!0?e.className=F0:(e.className=L0,Ru(t)?e.appendChild(t):Bd(e,t)),e}function yg(t,e){Ru(e.content)?(Bd(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Bd(t,e.content):t.textContent=e.content)}function $d(t){var e=t.firstElementChild,n=bl(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(P0)}),arrow:n.find(function(r){return r.classList.contains(F0)||r.classList.contains(L0)}),backdrop:n.find(function(r){return r.classList.contains(HR)})}}function z0(t){var e=Jo(),n=Jo();n.className=zR,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Jo();r.className=P0,r.setAttribute("data-state","hidden"),yg(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=$d(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)&&yg(u,t.props),s.arrow?c?o.arrow!==s.arrow&&(l.removeChild(c),l.appendChild(vg(s.arrow))):l.appendChild(vg(s.arrow)):c&&l.removeChild(c)}return{popper:e,onUpdate:i}}z0.$$tippy=!0;var cP=1,ma=[],Ac=[];function dP(t,e){var n=gg(t,Object.assign({},Zt,j0(pg(e)))),r,i,o,s=!1,a=!1,l=!1,u=!1,c,d,h,p=[],f=cg(Vs,n.interactiveDebounce),m,g=cP++,y=null,b=WR(n.plugins),k={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:g,reference:t,popper:Jo(),popperInstance:y,props:n,state:k,plugins:b,clearDelayTimeouts:Hs,setProps:qs,setContent:Ws,show:uk,hide:ck,hideWithInteractivity:dk,enable:go,disable:zs,unmount:pk,destroy:hk};if(!n.render)return v;var w=n.render(v),x=w.popper,S=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+v.id,v.popper=x,t._tippy=v,x._tippy=v;var N=b.map(function(T){return T.fn(v)}),A=t.hasAttribute("aria-expanded");return gi(),mt(),ue(),ge("onCreate",[v]),n.showOnCreate&&mo(),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&&q().addEventListener("mousemove",f)}),v;function C(){var T=v.props.touch;return Array.isArray(T)?T:[T,0]}function _(){return C()[0]==="hold"}function L(){var T;return!!((T=v.props.render)!=null&&T.$$tippy)}function W(){return m||t}function q(){var T=W().parentNode;return T?YR(T):document}function K(){return $d(x)}function J(T){return v.state.isMounted&&!v.state.isVisible||fn.isTouch||c&&c.type==="focus"?0:Sc(v.props.delay,T?0:1,Zt.delay)}function ue(T){T===void 0&&(T=!1),x.style.pointerEvents=v.props.interactive&&!T?"":"none",x.style.zIndex=""+v.props.zIndex}function ge(T,H,re){if(re===void 0&&(re=!0),N.forEach(function(fe){fe[T]&&fe[T].apply(fe,H)}),re){var ye;(ye=v.props)[T].apply(ye,H)}}function Te(){var T=v.props.aria;if(T.content){var H="aria-"+T.content,re=x.id,ye=Mi(v.props.triggerTarget||t);ye.forEach(function(fe){var lt=fe.getAttribute(H);if(v.state.isVisible)fe.setAttribute(H,lt?lt+" "+re:re);else{var Rt=lt&&lt.replace(re,"").trim();Rt?fe.setAttribute(H,Rt):fe.removeAttribute(H)}})}}function mt(){if(!(A||!v.props.aria.expanded)){var T=Mi(v.props.triggerTarget||t);T.forEach(function(H){v.props.interactive?H.setAttribute("aria-expanded",v.state.isVisible&&H===W()?"true":"false"):H.removeAttribute("aria-expanded")})}}function Mr(){q().removeEventListener("mousemove",f),ma=ma.filter(function(T){return T!==f})}function sn(T){if(!(fn.isTouch&&(l||T.type==="mousedown"))){var H=T.composedPath&&T.composedPath()[0]||T.target;if(!(v.props.interactive&&fg(x,H))){if(Mi(v.props.triggerTarget||t).some(function(re){return fg(re,H)})){if(fn.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else ge("onClickOutside",[v,T]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),a=!0,setTimeout(function(){a=!1}),v.state.isMounted||Kn())}}}function _r(){l=!0}function an(){l=!1}function It(){var T=q();T.addEventListener("mousedown",sn,!0),T.addEventListener("touchend",sn,jr),T.addEventListener("touchstart",an,jr),T.addEventListener("touchmove",_r,jr)}function Kn(){var T=q();T.removeEventListener("mousedown",sn,!0),T.removeEventListener("touchend",sn,jr),T.removeEventListener("touchstart",an,jr),T.removeEventListener("touchmove",_r,jr)}function Dr(T,H){Fs(T,function(){!v.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&H()})}function Gn(T,H){Fs(T,H)}function Fs(T,H){var re=K().box;function ye(fe){fe.target===re&&(Oc(re,"remove",ye),H())}if(T===0)return H();Oc(re,"remove",d),Oc(re,"add",ye),d=ye}function Jn(T,H,re){re===void 0&&(re=!1);var ye=Mi(v.props.triggerTarget||t);ye.forEach(function(fe){fe.addEventListener(T,H,re),p.push({node:fe,eventType:T,handler:H,options:re})})}function gi(){_()&&(Jn("touchstart",po,{passive:!0}),Jn("touchend",Bs,{passive:!0})),qR(v.props.trigger).forEach(function(T){if(T!=="manual")switch(Jn(T,po),T){case"mouseenter":Jn("mouseleave",Bs);break;case"focus":Jn(rP?"focusout":"blur",ho);break;case"focusin":Jn("focusout",ho);break}})}function Ls(){p.forEach(function(T){var H=T.node,re=T.eventType,ye=T.handler,fe=T.options;H.removeEventListener(re,ye,fe)}),p=[]}function po(T){var H,re=!1;if(!(!v.state.isEnabled||fo(T)||a)){var ye=((H=c)==null?void 0:H.type)==="focus";c=T,m=T.currentTarget,mt(),!v.state.isVisible&&GR(T)&&ma.forEach(function(fe){return fe(T)}),T.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||s)&&v.props.hideOnClick!==!1&&v.state.isVisible?re=!0:mo(T),T.type==="click"&&(s=!re),re&&!ye&&Nr(T)}}function Vs(T){var H=T.target,re=W().contains(H)||x.contains(H);if(!(T.type==="mousemove"&&re)){var ye=Xn().concat(x).map(function(fe){var lt,Rt=fe._tippy,vi=(lt=Rt.popperInstance)==null?void 0:lt.state;return vi?{popperRect:fe.getBoundingClientRect(),popperState:vi,props:n}:null}).filter(Boolean);ZR(ye,T)&&(Mr(),Nr(T))}}function Bs(T){var H=fo(T)||v.props.trigger.indexOf("click")>=0&&s;if(!H){if(v.props.interactive){v.hideWithInteractivity(T);return}Nr(T)}}function ho(T){v.props.trigger.indexOf("focusin")<0&&T.target!==W()||v.props.interactive&&T.relatedTarget&&x.contains(T.relatedTarget)||Nr(T)}function fo(T){return fn.isTouch?_()!==T.type.indexOf("touch")>=0:!1}function $s(){js();var T=v.props,H=T.popperOptions,re=T.placement,ye=T.offset,fe=T.getReferenceClientRect,lt=T.moveTransition,Rt=L()?$d(x).arrow:null,vi=fe?{getBoundingClientRect:fe,contextElement:fe.contextElement||W()}:t,Us={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ks){var yi=Ks.state;if(L()){var fk=K(),Fu=fk.box;["placement","reference-hidden","escaped"].forEach(function(Gs){Gs==="placement"?Fu.setAttribute("data-placement",yi.placement):yi.attributes.popper["data-popper-"+Gs]?Fu.setAttribute("data-"+Gs,""):Fu.removeAttribute("data-"+Gs)}),yi.attributes.popper={}}}},Ir=[{name:"offset",options:{offset:ye}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!lt}},Us];L()&&Rt&&Ir.push({name:"arrow",options:{element:Rt,padding:3}}),Ir.push.apply(Ir,H?.modifiers||[]),v.popperInstance=jR(vi,x,Object.assign({},H,{placement:re,onFirstUpdate:h,modifiers:Ir}))}function js(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Tn(){var T=v.props.appendTo,H,re=W();v.props.interactive&&T===V0||T==="parent"?H=re.parentNode:H=B0(T,[re]),H.contains(x)||H.appendChild(x),v.state.isMounted=!0,$s()}function Xn(){return bl(x.querySelectorAll("[data-tippy-root]"))}function mo(T){v.clearDelayTimeouts(),T&&ge("onTrigger",[v,T]),It();var H=J(!0),re=C(),ye=re[0],fe=re[1];fn.isTouch&&ye==="hold"&&fe&&(H=fe),H?r=setTimeout(function(){v.show()},H):v.show()}function Nr(T){if(v.clearDelayTimeouts(),ge("onUntrigger",[v,T]),!v.state.isVisible){Kn();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(T.type)>=0&&s)){var H=J(!1);H?i=setTimeout(function(){v.state.isVisible&&v.hide()},H):o=requestAnimationFrame(function(){v.hide()})}}function go(){v.state.isEnabled=!0}function zs(){v.hide(),v.state.isEnabled=!1}function Hs(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function qs(T){if(!v.state.isDestroyed){ge("onBeforeUpdate",[v,T]),Ls();var H=v.props,re=gg(t,Object.assign({},H,pg(T),{ignoreAttributes:!0}));v.props=re,gi(),H.interactiveDebounce!==re.interactiveDebounce&&(Mr(),f=cg(Vs,re.interactiveDebounce)),H.triggerTarget&&!re.triggerTarget?Mi(H.triggerTarget).forEach(function(ye){ye.removeAttribute("aria-expanded")}):re.triggerTarget&&t.removeAttribute("aria-expanded"),mt(),ue(),S&&S(H,re),v.popperInstance&&($s(),Xn().forEach(function(ye){requestAnimationFrame(ye._tippy.popperInstance.forceUpdate)})),ge("onAfterUpdate",[v,T])}}function Ws(T){v.setProps({content:T})}function uk(){var T=v.state.isVisible,H=v.state.isDestroyed,re=!v.state.isEnabled,ye=fn.isTouch&&!v.props.touch,fe=Sc(v.props.duration,0,Zt.duration);if(!(T||H||re||ye)&&!W().hasAttribute("disabled")&&(ge("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,L()&&(x.style.visibility="visible"),ue(),It(),v.state.isMounted||(x.style.transition="none"),L()){var lt=K(),Rt=lt.box,vi=lt.content;Tc([Rt,vi],0)}h=function(){var Us;if(!(!v.state.isVisible||u)){if(u=!0,x.offsetHeight,x.style.transition=v.props.moveTransition,L()&&v.props.animation){var Ir=K(),Ks=Ir.box,yi=Ir.content;Tc([Ks,yi],fe),hg([Ks,yi],"visible")}Te(),mt(),dg(Ac,v),(Us=v.popperInstance)==null||Us.forceUpdate(),ge("onMount",[v]),v.props.animation&&L()&&Gn(fe,function(){v.state.isShown=!0,ge("onShown",[v])})}},Tn()}}function ck(){var T=!v.state.isVisible,H=v.state.isDestroyed,re=!v.state.isEnabled,ye=Sc(v.props.duration,1,Zt.duration);if(!(T||H||re)&&(ge("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,u=!1,s=!1,L()&&(x.style.visibility="hidden"),Mr(),Kn(),ue(!0),L()){var fe=K(),lt=fe.box,Rt=fe.content;v.props.animation&&(Tc([lt,Rt],ye),hg([lt,Rt],"hidden"))}Te(),mt(),v.props.animation?L()&&Dr(ye,v.unmount):v.unmount()}}function dk(T){q().addEventListener("mousemove",f),dg(ma,f),f(T)}function pk(){v.state.isVisible&&v.hide(),v.state.isMounted&&(js(),Xn().forEach(function(T){T._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),Ac=Ac.filter(function(T){return T!==v}),v.state.isMounted=!1,ge("onHidden",[v]))}function hk(){!v.state.isDestroyed&&(v.clearDelayTimeouts(),v.unmount(),Ls(),delete t._tippy,v.state.isDestroyed=!0,ge("onDestroy",[v]))}}function co(t,e){e===void 0&&(e={});var n=Zt.plugins.concat(e.plugins||[]);tP();var r=Object.assign({},e,{plugins:n}),i=XR(t),o=i.reduce(function(s,a){var l=a&&dP(a,r);return l&&s.push(l),s},[]);return Ru(t)?o[0]:o}co.defaultProps=Zt;co.setDefaultProps=aP;co.currentInput=fn;Object.assign({},O0,{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)}});co.setDefaultProps({render:z0});class pP{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&&sh(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(E0(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 C0(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=co(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 hP=t=>new Ve({key:typeof t.pluginKey=="string"?new at(t.pluginKey):t.pluginKey,view:e=>new pP({view:e,...t})});Ke.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[hP({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class fP{getTextContent(e){return w0(e,{textSerializers:ih(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=co(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)||(()=>C0(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 mP=t=>new Ve({key:typeof t.pluginKey=="string"?new at(t.pluginKey):t.pluginKey,view:e=>new fP({view:e,...t})});Ke.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[mP({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});function bg(t){return ep((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class gP extends PI{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=bg(this.view.state),this.reactiveExtensionStorage=bg(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),ka(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 vP=Q({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=X(),n=np();return Fg(()=>{const r=t.editor;r&&r.options.element&&e.value&&kr(()=>{if(!e.value||!r.options.element.firstChild)return;const i=B(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()})}),ao(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return ns("div",{ref:t=>{this.rootEl=t}})}}),yP=(t={})=>{const e=qt();return qn(()=>{e.value=new gP(t)}),ao(()=>{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},bP="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",kP="ελ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",so=(t,e)=>{for(const n in e)t[n]=e[n];return t},jd="numeric",zd="ascii",Hd="alpha",Xo="asciinumeric",Fo="alphanumeric",qd="domain",H0="emoji",wP="scheme",xP="slashscheme",Mc="whitespace";function EP(t,e){return t in e||(e[t]=[]),e[t]}function Kr(t,e,n){e[jd]&&(e[Xo]=!0,e[Fo]=!0),e[zd]&&(e[Xo]=!0,e[Hd]=!0),e[Xo]&&(e[Fo]=!0),e[Hd]&&(e[Fo]=!0),e[Fo]&&(e[qd]=!0),e[H0]&&(e[qd]=!0);for(const r in e){const i=EP(r,n);i.indexOf(t)<0&&i.push(t)}}function CP(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function vt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}vt.groups={};vt.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||vt.groups;let i;return e&&e.j?i=e:(i=new vt(e),n&&r&&Kr(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||vt.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 vt,so(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new vt,o){if(r)if(s.t&&typeof s.t=="string"){const l=so(CP(s.t,r),n);Kr(o,l,r)}else n&&Kr(o,n,r);s.t=o}return i.j[t]=s,s}};const ce=(t,e,n,r,i)=>t.ta(e,n,r,i),Oe=(t,e,n,r,i)=>t.tr(e,n,r,i),kg=(t,e,n,r,i)=>t.ts(e,n,r,i),D=(t,e,n,r,i)=>t.tt(e,n,r,i),Dn="WORD",Wd="UWORD",q0="ASCIINUMERICAL",W0="ALPHANUMERICAL",xs="LOCALHOST",Ud="TLD",Kd="UTLD",Fa="SCHEME",_i="SLASH_SCHEME",yh="NUM",Gd="WS",bh="NL",Yo="OPENBRACE",Zo="CLOSEBRACE",kl="OPENBRACKET",wl="CLOSEBRACKET",xl="OPENPAREN",El="CLOSEPAREN",Cl="OPENANGLEBRACKET",Sl="CLOSEANGLEBRACKET",Tl="FULLWIDTHLEFTPAREN",Ol="FULLWIDTHRIGHTPAREN",Al="LEFTCORNERBRACKET",Ml="RIGHTCORNERBRACKET",_l="LEFTWHITECORNERBRACKET",Dl="RIGHTWHITECORNERBRACKET",Nl="FULLWIDTHLESSTHAN",Il="FULLWIDTHGREATERTHAN",Rl="AMPERSAND",kh="APOSTROPHE",Pl="ASTERISK",tr="AT",Fl="BACKSLASH",Ll="BACKTICK",Vl="CARET",or="COLON",wh="COMMA",Bl="DOLLAR",cn="DOT",$l="EQUALS",xh="EXCLAMATION",Ft="HYPHEN",Qo="PERCENT",jl="PIPE",zl="PLUS",Hl="POUND",es="QUERY",Eh="QUOTE",U0="FULLWIDTHMIDDLEDOT",Ch="SEMI",dn="SLASH",ts="TILDE",ql="UNDERSCORE",K0="EMOJI",Wl="SYM";var G0=Object.freeze({__proto__:null,WORD:Dn,UWORD:Wd,ASCIINUMERICAL:q0,ALPHANUMERICAL:W0,LOCALHOST:xs,TLD:Ud,UTLD:Kd,SCHEME:Fa,SLASH_SCHEME:_i,NUM:yh,WS:Gd,NL:bh,OPENBRACE:Yo,CLOSEBRACE:Zo,OPENBRACKET:kl,CLOSEBRACKET:wl,OPENPAREN:xl,CLOSEPAREN:El,OPENANGLEBRACKET:Cl,CLOSEANGLEBRACKET:Sl,FULLWIDTHLEFTPAREN:Tl,FULLWIDTHRIGHTPAREN:Ol,LEFTCORNERBRACKET:Al,RIGHTCORNERBRACKET:Ml,LEFTWHITECORNERBRACKET:_l,RIGHTWHITECORNERBRACKET:Dl,FULLWIDTHLESSTHAN:Nl,FULLWIDTHGREATERTHAN:Il,AMPERSAND:Rl,APOSTROPHE:kh,ASTERISK:Pl,AT:tr,BACKSLASH:Fl,BACKTICK:Ll,CARET:Vl,COLON:or,COMMA:wh,DOLLAR:Bl,DOT:cn,EQUALS:$l,EXCLAMATION:xh,HYPHEN:Ft,PERCENT:Qo,PIPE:jl,PLUS:zl,POUND:Hl,QUERY:es,QUOTE:Eh,FULLWIDTHMIDDLEDOT:U0,SEMI:Ch,SLASH:dn,TILDE:ts,UNDERSCORE:ql,EMOJI:K0,SYM:Wl});const An=/[a-z]/,Eo=/\p{L}/u,_c=/\p{Emoji}/u,Mn=/\d/,Dc=/\s/,wg="\r",Nc=`
97
+ `,SP="️",TP="‍",Ic="";let ga=null,va=null;function OP(t=[]){const e={};vt.groups=e;const n=new vt;ga==null&&(ga=xg(bP)),va==null&&(va=xg(kP)),D(n,"'",kh),D(n,"{",Yo),D(n,"}",Zo),D(n,"[",kl),D(n,"]",wl),D(n,"(",xl),D(n,")",El),D(n,"<",Cl),D(n,">",Sl),D(n,"(",Tl),D(n,")",Ol),D(n,"「",Al),D(n,"」",Ml),D(n,"『",_l),D(n,"』",Dl),D(n,"<",Nl),D(n,">",Il),D(n,"&",Rl),D(n,"*",Pl),D(n,"@",tr),D(n,"`",Ll),D(n,"^",Vl),D(n,":",or),D(n,",",wh),D(n,"$",Bl),D(n,".",cn),D(n,"=",$l),D(n,"!",xh),D(n,"-",Ft),D(n,"%",Qo),D(n,"|",jl),D(n,"+",zl),D(n,"#",Hl),D(n,"?",es),D(n,'"',Eh),D(n,"/",dn),D(n,";",Ch),D(n,"~",ts),D(n,"_",ql),D(n,"\\",Fl),D(n,"・",U0);const r=Oe(n,Mn,yh,{[jd]:!0});Oe(r,Mn,r);const i=Oe(r,An,q0,{[Xo]:!0}),o=Oe(r,Eo,W0,{[Fo]:!0}),s=Oe(n,An,Dn,{[zd]:!0});Oe(s,Mn,i),Oe(s,An,s),Oe(i,Mn,i),Oe(i,An,i);const a=Oe(n,Eo,Wd,{[Hd]:!0});Oe(a,An),Oe(a,Mn,o),Oe(a,Eo,a),Oe(o,Mn,o),Oe(o,An),Oe(o,Eo,o);const l=D(n,Nc,bh,{[Mc]:!0}),u=D(n,wg,Gd,{[Mc]:!0}),c=Oe(n,Dc,Gd,{[Mc]:!0});D(n,Ic,c),D(u,Nc,l),D(u,Ic,c),Oe(u,Dc,c),D(c,wg),D(c,Nc),Oe(c,Dc,c),D(c,Ic,c);const d=Oe(n,_c,K0,{[H0]:!0});D(d,"#"),Oe(d,_c,d),D(d,SP,d);const h=D(d,TP);D(h,"#"),Oe(h,_c,d);const p=[[An,s],[Mn,i]],f=[[An,null],[Eo,a],[Mn,o]];for(let m=0;m<ga.length;m++)Yn(n,ga[m],Ud,Dn,p);for(let m=0;m<va.length;m++)Yn(n,va[m],Kd,Wd,f);Kr(Ud,{tld:!0,ascii:!0},e),Kr(Kd,{utld:!0,alpha:!0},e),Yn(n,"file",Fa,Dn,p),Yn(n,"mailto",Fa,Dn,p),Yn(n,"http",_i,Dn,p),Yn(n,"https",_i,Dn,p),Yn(n,"ftp",_i,Dn,p),Yn(n,"ftps",_i,Dn,p),Kr(Fa,{scheme:!0,ascii:!0},e),Kr(_i,{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]?{[wP]:!0}:{[xP]:!0};g.indexOf("-")>=0?y[qd]=!0:An.test(g)?Mn.test(g)?y[Xo]=!0:y[zd]=!0:y[jd]=!0,kg(n,g,g,y)}return kg(n,"localhost",xs,{ascii:!0}),n.jd=new vt(Wl),{start:n,tokens:so({groups:e},G0)}}function J0(t,e){const n=AP(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 AP(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 Yn(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 vt(r),o.jr=i.slice(),t.j[l]=o),t=o}return o=new vt(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}function xg(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 Es={defaultProtocol:"http",events:null,format:Eg,formatHref:Eg,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Sh(t,e=null){let n=so({},Es);t&&(n=so(n,t instanceof Sh?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}Sh.prototype={o:Es,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]:Es[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 Eg(t){return t}function X0(t,e){this.t="token",this.v=t,this.tk=e}X0.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=Es.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&&so(s,c),{tagName:i,attributes:s,content:o,eventListeners:d}}};function Pu(t,e){class n extends X0{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 Cg=Pu("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Sg=Pu("text"),MP=Pu("nl"),ya=Pu("url",{isLink:!0,toHref(t=Es.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==xs&&t[1].t===or}}),Pt=t=>new vt(t);function _P({groups:t}){const e=t.domain.concat([Rl,Pl,tr,Fl,Ll,Vl,Bl,$l,Ft,yh,Qo,jl,zl,Hl,dn,Wl,ts,ql]),n=[or,wh,cn,xh,Qo,es,Eh,Ch,Cl,Sl,Yo,Zo,wl,kl,xl,El,Tl,Ol,Al,Ml,_l,Dl,Nl,Il],r=[Rl,kh,Pl,Fl,Ll,Vl,Bl,$l,Ft,Yo,Zo,Qo,jl,zl,Hl,es,dn,Wl,ts,ql],i=Pt(),o=D(i,ts);ce(o,r,o),ce(o,t.domain,o);const s=Pt(),a=Pt(),l=Pt();ce(i,t.domain,s),ce(i,t.scheme,a),ce(i,t.slashscheme,l),ce(s,r,o),ce(s,t.domain,s);const u=D(s,tr);D(o,tr,u),D(a,tr,u),D(l,tr,u);const c=D(o,cn);ce(c,r,o),ce(c,t.domain,o);const d=Pt();ce(u,t.domain,d),ce(d,t.domain,d);const h=D(d,cn);ce(h,t.domain,d);const p=Pt(Cg);ce(h,t.tld,p),ce(h,t.utld,p),D(u,xs,p);const f=D(d,Ft);D(f,Ft,f),ce(f,t.domain,d),ce(p,t.domain,d),D(p,cn,h),D(p,Ft,f);const m=D(p,or);ce(m,t.numeric,Cg);const g=D(s,Ft),y=D(s,cn);D(g,Ft,g),ce(g,t.domain,s),ce(y,r,o),ce(y,t.domain,s);const b=Pt(ya);ce(y,t.tld,b),ce(y,t.utld,b),ce(b,t.domain,s),ce(b,r,o),D(b,cn,y),D(b,Ft,g),D(b,tr,u);const k=D(b,or),v=Pt(ya);ce(k,t.numeric,v);const w=Pt(ya),x=Pt();ce(w,e,w),ce(w,n,x),ce(x,e,w),ce(x,n,x),D(b,dn,w),D(v,dn,w);const S=D(a,or),N=D(l,or),A=D(N,dn),C=D(A,dn);ce(a,t.domain,s),D(a,cn,y),D(a,Ft,g),ce(l,t.domain,s),D(l,cn,y),D(l,Ft,g),ce(S,t.domain,w),D(S,dn,w),D(S,es,w),ce(C,t.domain,w),ce(C,e,w),D(C,dn,w);const _=[[Yo,Zo],[kl,wl],[xl,El],[Cl,Sl],[Tl,Ol],[Al,Ml],[_l,Dl],[Nl,Il]];for(let L=0;L<_.length;L++){const[W,q]=_[L],K=D(w,W);D(x,W,K),D(K,q,w);const J=Pt(ya);ce(K,e,J);const ue=Pt();ce(K,n),ce(J,e,J),ce(J,n,ue),ce(ue,e,J),ce(ue,n,ue),D(J,q,w),D(ue,q,w)}return D(i,xs,b),D(i,bh,MP),{start:i,tokens:G0}}function DP(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(Rc(Sg,e,s)),s=[]),i-=h,c-=h;const p=d.t,f=n.slice(i-c,i);o.push(Rc(p,e,f))}}return s.length>0&&o.push(Rc(Sg,e,s)),o}function Rc(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 NP=typeof console<"u"&&console&&console.warn||(()=>{}),IP="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",we={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function RP(){return vt.groups={},we.scanner=null,we.parser=null,we.tokenQueue=[],we.pluginQueue=[],we.customSchemes=[],we.initialized=!1,we}function Tg(t,e=!1){if(we.initialized&&NP(`linkifyjs: already initialized - will not register custom scheme "${t}" ${IP}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
98
98
  1. Must only contain digits, lowercase ASCII letters or "-"
99
99
  2. Cannot start or end with "-"
100
100
  3. "-" cannot repeat`);we.customSchemes.push([t,e])}function PP(){we.scanner=OP(we.customSchemes);for(let t=0;t<we.tokenQueue.length;t++)we.tokenQueue[t][1]({scanner:we.scanner});we.parser=_P(we.scanner.tokens);for(let t=0;t<we.pluginQueue.length;t++)we.pluginQueue[t][1]({scanner:we.scanner,parser:we.parser});return we.initialized=!0,we}function Th(t){return we.initialized||PP(),DP(we.parser.start,t,J0(we.scanner.start,t))}Th.scan=J0;function Y0(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 Sh(n),i=Th(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 FP(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function LP(t){return new Ve({key:new at("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=YN(n.doc,[...e]);if(iI(a).forEach(({newRange:l})=>{const u=QN(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=Th(p).map(g=>g.toObject(t.defaultProtocol));if(!FP(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=>{uh(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 VP(t){return new Ve({key:new at("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=x0(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 BP(t){return new Ve({key:new at("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=Y0(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 $P=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Lr(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($P,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const jP=zn.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"){Tg(t);return}Tg(t.scheme,t.optionalSlashes)})},onDestroy(){RP()},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)=>!!Lr(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=>!!Lr(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=>!!Lr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",et(this.options.HTMLAttributes,t),0]:["a",et(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Lr(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=>!!Lr(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[li({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=Y0(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!Lr(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(LP({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Lr(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(VP({type:this.type})),this.options.linkOnPaste&&t.push(BP({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),zP=Ke.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Ve({key:new at("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&&Nu(s);if((l||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];o&&c.push(this.options.emptyEditorClass);const d=Mt.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}),Pe.create(t,i)}}})]}}),HP=/^\s*>\s$/,qP=on.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",et(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[bs({find:HP,type:this.type})]}}),WP=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,UP=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,KP=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,GP=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,JP=zn.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",et(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[to({find:WP,type:this.type}),to({find:KP,type:this.type})]},addPasteRules(){return[li({find:UP,type:this.type}),li({find:GP,type:this.type})]}}),XP="listItem",Og="textStyle",Ag=/^\s*([-+*])\s$/,YP=on.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",et(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(XP,this.editor.getAttributes(Og)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=bs({find:Ag,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=bs({find:Ag,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Og),editor:this.editor})),[t]}}),ZP=/(^|[^`])`([^`]+)`(?!`)/,QP=/(^|[^`])`([^`]+)`(?!`)/g,eF=zn.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",et(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[to({find:ZP,type:this.type})]},addPasteRules(){return[li({find:QP,type:this.type})]}}),tF=/^```([a-z]+)?[\s\n]$/,nF=/^~~~([a-z]+)?[\s\n]$/,rF=on.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",et(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(`