@thebase/ui 1.1.6 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -1
- package/README.md +9 -5
- package/bin/create-baseui-app.mjs +31 -8
- package/dist/baseui.apidoc.esm.js +68 -60
- package/dist/baseui.apidoc.min.js +68 -60
- package/dist/baseui.esm.js +44 -47
- package/dist/baseui.icons.esm.js +1 -1
- package/dist/baseui.min.css +2 -2
- package/dist/baseui.min.js +62 -46
- package/dist/baseui.pwa.esm.js +71 -9
- package/dist/baseui.registry.json +26 -33
- package/dist/baseui.templates.xml +353 -370
- package/dist/baseui.vite.esm.js +116 -0
- package/dist/runtime/lazy/apidoc.logic.js +20 -0
- package/dist/runtime/milkdown/milkdown-editor.js +1 -1
- package/dist/runtime/milkdown/milkdown-text-editor.js +1 -1
- package/dist/themes/baseui-dark.css +80 -1
- package/dist/themes/baseui-dark.min.css +1 -0
- package/dist/themes/baseui-light.css +81 -1
- package/dist/themes/baseui-light.min.css +1 -0
- package/dist/types/pwa.d.ts +1 -45
- package/dist/types/vite.d.ts +4 -0
- package/docs/analytics.md +3 -3
- package/docs/base-ui-skill.md +54 -0
- package/docs/blocks.md +1 -1
- package/docs/components/accordion.md +4 -4
- package/docs/components/apidoc.md +1 -1
- package/docs/components/block-viewer.md +1 -1
- package/docs/components/breadcrumb.md +1 -1
- package/docs/components/button.md +1 -1
- package/docs/components/chart.md +2 -0
- package/docs/components/code-editor.md +77 -0
- package/docs/components/combobox.md +10 -0
- package/docs/components/data-table.md +2 -2
- package/docs/components/date-picker.md +10 -0
- package/docs/components/dialog.md +5 -5
- package/docs/components/empty.md +1 -1
- package/docs/components/field.md +8 -0
- package/docs/components/form.md +29 -29
- package/docs/components/input.md +28 -2
- package/docs/components/kbd.md +3 -6
- package/docs/components/markdown.md +3 -1
- package/docs/components/message-scroller.md +3 -8
- package/docs/components/native-select.md +13 -0
- package/docs/components/navigation-menu.md +2 -0
- package/docs/components/pwa.md +1 -1
- package/docs/components/select.md +16 -0
- package/docs/components/shell.md +4 -2
- package/docs/components/sidebar.md +18 -16
- package/docs/components/switch.md +11 -0
- package/docs/components/text-editor.md +1 -1
- package/docs/components/textarea.md +23 -0
- package/docs/components/theme-button.md +1 -1
- package/docs/components/toast.md +10 -10
- package/docs/components/typography.md +21 -2
- package/docs/icons.md +1 -1
- package/docs/installation.md +2 -2
- package/docs/owl-components.md +1 -1
- package/docs/runtime-api.md +2 -2
- package/docs/theming.md +33 -3
- package/docs/usage-guide.md +23 -6
- package/package.json +6 -1
- package/docs/components/input-group.md +0 -68
package/dist/baseui.esm.js
CHANGED
|
@@ -7,55 +7,52 @@
|
|
|
7
7
|
/* Vendored from @odoo/owl@2.8.3's dist/owl.iife.min.js, patched to key off globalThis instead of top-level `this` (safe in both classic scripts and ES modules) — see scripts/build.mjs and src/owl/owl-dev-shim.js. */
|
|
8
8
|
!function(t){"use strict";function e(t){t=t.slice();const e=[];let n;for(;(n=t[0])&&"string"==typeof n;)e.push(t.shift());return{modifiers:e,data:t}}const n={shouldNormalizeDom:!0,mainEventHandler:(t,n,o)=>("function"==typeof t?t(n):Array.isArray(t)&&(t=e(t).data)[0](t[1],n),!1)};class o{constructor(t,e){this.key=t,this.child=e}mount(t,e){this.parentEl=t,this.child.mount(t,e)}moveBeforeDOMNode(t,e){this.child.moveBeforeDOMNode(t,e)}moveBeforeVNode(t,e){this.moveBeforeDOMNode(t&&t.firstNode()||e)}patch(t,e){if(this===t)return;let n=this.child,o=t.child;this.key===t.key?n.patch(o,e):(o.mount(this.parentEl,n.firstNode()),e&&n.beforeRemove(),n.remove(),this.child=o,this.key=t.key)}beforeRemove(){this.child.beforeRemove()}remove(){this.child.remove()}firstNode(){return this.child.firstNode()}toString(){return this.child.toString()}}function s(t,e){return new o(t,e)}class r extends Error{}let i,l,a,c;if("undefined"!=typeof Element){({setAttribute:i,removeAttribute:l}=Element.prototype);const t=DOMTokenList.prototype;a=t.add,c=t.remove}const h=Array.isArray,{split:u,trim:d}=String.prototype,f=/\s+/;function p(t,e){switch(e){case!1:case void 0:l.call(this,t);break;case!0:i.call(this,t,"");break;default:i.call(this,t,e)}}function m(t){return function(e){p.call(this,t,e)}}function g(t){if(h(t))"class"===t[0]?y.call(this,t[1]):p.call(this,t[0],t[1]);else for(let e in t)"class"===e?y.call(this,t[e]):p.call(this,e,t[e])}function b(t,e){if(h(t)){const n=t[0],o=t[1];if(n===e[0]){if(o===e[1])return;"class"===n?w.call(this,o,e[1]):p.call(this,n,o)}else l.call(this,e[0]),p.call(this,n,o)}else{for(let n in e)n in t||("class"===n?w.call(this,"",e[n]):l.call(this,n));for(let n in t){const o=t[n];o!==e[n]&&("class"===n?w.call(this,o,e[n]):p.call(this,n,o))}}}function v(t){const e={};switch(typeof t){case"string":const n=d.call(t);if(!n)return{};let o=u.call(n,f);for(let t=0,n=o.length;t<n;t++)e[o[t]]=!0;return e;case"object":for(let n in t){const o=t[n];if(o){if(n=d.call(n),!n)continue;const t=u.call(n,f);for(let n of t)e[n]=o}}return e;case"undefined":return{};case"number":return{[t]:!0};default:return{[t]:!0}}}function y(t){t=""===t?{}:v(t);const e=this.classList;for(let n in t)a.call(e,n)}function w(t,e){e=""===e?{}:v(e),t=""===t?{}:v(t);const n=this.classList;for(let o in e)o in t||c.call(n,o);for(let o in t)o in e||a.call(n,o)}function $(t){let e=!1;return async(...n)=>{e||(e=!0,await Promise.resolve(),e=!1,t(...n))}}function x(t){if(!t)return!1;if(t.ownerDocument.contains(t))return!0;const e=t.getRootNode();return e instanceof ShadowRoot&&t.ownerDocument.contains(e.host)}class N extends EventTarget{trigger(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e}))}}class k extends String{}function T(t){return t instanceof k?t:void 0===t?E(""):"number"==typeof t?E(String(t)):([["&","&"],["<","<"],[">",">"],["'","'"],['"',"""],["`","`"]].forEach((e=>{t=String(t).replace(new RegExp(e[0],"g"),e[1])})),E(t))}function E(t,...e){if(!Array.isArray(t))return new k(t);const n=t;let o="",s=0;for(;s<e.length;++s)o+=n[s]+T(e[s]);return o+=n[s],new k(o)}function A(t){const e=t.split(".")[0],o=t.includes(".capture");return t.includes(".synthetic")?function(t,e=!1){let o=`__event__synthetic_${t}`;e&&(o=`${o}_capture`);!function(t,e,o=!1){if(D[e])return;document.addEventListener(t,(t=>function(t,e){let o=e.target;for(;null!==o;){const s=o[t];if(s)for(const t of Object.values(s)){if(n.mainEventHandler(t,e,o))return}o=o.parentNode}}(e,t)),{capture:o}),D[e]=!0}(t,o,e);const s=C++;function r(t){const e=this[o]||{};e[s]=t,this[o]=e}function i(){delete this[o]}return{setup:r,update:r,remove:i}}(e,o):function(t,e=!1){let o=`__event__${t}_${_++}`;e&&(o=`${o}_capture`);function s(t){const e=t.currentTarget;if(!e||!x(e))return;const s=e[o];s&&n.mainEventHandler(s,t,e)}function r(n){this[o]=n,this.addEventListener(t,s,{capture:e})}function i(){delete this[o],this.removeEventListener(t,s,{capture:e})}function l(t){this[o]=t}return{setup:r,update:l,remove:i}}(e,o)}let _=1;let C=1;const D={};let S,O,R;if("undefined"!=typeof Node){const t=Node.prototype;S=t.insertBefore,O=(L=t,B="textContent",Object.getOwnPropertyDescriptor(L,B)).set,R=t.removeChild}var L,B;class P{constructor(t){this.children=t}mount(t,e){const n=this.children,o=n.length,s=new Array(o);for(let r=0;r<o;r++){let o=n[r];if(o)o.mount(t,e);else{const n=document.createTextNode("");s[r]=n,S.call(t,n,e)}}this.anchors=s,this.parentEl=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;const n=this.children,o=this.anchors;for(let s=0,r=n.length;s<r;s++){let r=n[s];if(r)r.moveBeforeDOMNode(t,e);else{const n=o[s];S.call(e,n,t)}}}moveBeforeVNode(t,e){if(t){const n=t.children[0];e=(n?n.firstNode():t.anchors[0])||null}const n=this.children,o=this.parentEl,s=this.anchors;for(let t=0,r=n.length;t<r;t++){let r=n[t];if(r)r.moveBeforeVNode(null,e);else{const n=s[t];S.call(o,n,e)}}}patch(t,e){if(this===t)return;const n=this.children,o=t.children,s=this.anchors,r=this.parentEl;for(let t=0,i=n.length;t<i;t++){const i=n[t],l=o[t];if(i)if(l)i.patch(l,e);else{const o=i.firstNode(),l=document.createTextNode("");s[t]=l,S.call(r,l,o),e&&i.beforeRemove(),i.remove(),n[t]=void 0}else if(l){n[t]=l;const e=s[t];l.mount(r,e),R.call(r,e)}}}beforeRemove(){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];n&&n.beforeRemove()}}remove(){const t=this.parentEl;if(this.isOnlyChild)O.call(t,"");else{const e=this.children,n=this.anchors;for(let o=0,s=e.length;o<s;o++){const s=e[o];s?s.remove():R.call(t,n[o])}}}firstNode(){const t=this.children[0];return t?t.firstNode():this.anchors[0]}toString(){return this.children.map((t=>t?t.toString():"")).join("")}}function j(t){return new P(t)}let M,I,W;if("undefined"!=typeof Node){const t=Node.prototype;M=t.insertBefore,W=t.removeChild,I=((t,e)=>Object.getOwnPropertyDescriptor(t,e))(CharacterData.prototype,"data").set}class V{constructor(t){this.text=t}mountNode(t,e,n){this.parentEl=e,M.call(e,t,n),this.el=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,M.call(e,this.el,t)}moveBeforeVNode(t,e){M.call(this.parentEl,this.el,t?t.el:e)}beforeRemove(){}remove(){W.call(this.parentEl,this.el)}firstNode(){return this.el}toString(){return this.text}}class F extends V{mount(t,e){this.mountNode(document.createTextNode(U(this.text)),t,e)}patch(t){const e=t.text;this.text!==e&&(I.call(this.el,U(e)),this.text=e)}}class K extends V{mount(t,e){this.mountNode(document.createComment(U(this.text)),t,e)}patch(){}}function z(t){return new F(t)}function H(t){return new K(t)}function U(t){switch(typeof t){case"string":return t;case"number":return String(t);case"boolean":return t?"true":"false";default:return t||""}}const q=(t,e)=>Object.getOwnPropertyDescriptor(t,e);let G,X,Y,Z,J;"undefined"!=typeof Node&&(G=Node.prototype,X=Element.prototype,Y=q(CharacterData.prototype,"data").set,Z=q(G,"firstChild").get,J=q(G,"nextSibling").get);const Q=()=>{};function tt(t){return function(e){this[t]=0===e?0:e?e.valueOf():""}}const et={};function nt(t){if(t in et)return et[t];const e=(new DOMParser).parseFromString(`<t>${t}</t>`,"text/xml").firstChild.firstChild;n.shouldNormalizeDom&&ot(e);const o=st(e),s=lt(o),r=function(t,e){let n=function(t,e){const{refN:n,collectors:o,children:s}=e,r=o.length;e.locations.sort(((t,e)=>t.idx-e.idx));const i=e.locations.map((t=>({refIdx:t.refIdx,setData:t.setData,updateData:t.updateData}))),l=i.length,a=s.length,c=s,h=n>0,u=G.cloneNode,d=G.insertBefore,f=X.remove;class p{constructor(t){this.data=t}beforeRemove(){}remove(){f.call(this.el)}firstNode(){return this.el}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,d.call(e,this.el,t)}moveBeforeVNode(t,e){d.call(this.parentEl,this.el,t?t.el:e)}toString(){const t=document.createElement("div");return this.mount(t,null),t.innerHTML}mount(e,n){const o=u.call(t,!0);d.call(e,o,n),this.el=o,this.parentEl=e}patch(t,e){}}h&&(p.prototype.mount=function(e,s){const h=u.call(t,!0),f=new Array(n);this.refs=f,f[0]=h;for(let t=0;t<r;t++){const e=o[t];f[e.idx]=e.getVal.call(f[e.prevIdx])}if(l){const t=this.data;for(let e=0;e<l;e++){const n=i[e];n.setData.call(f[n.refIdx],t[e])}}if(d.call(e,h,s),a){const t=this.children;for(let e=0;e<a;e++){const n=t[e];if(n){const t=c[e],o=t.afterRefIdx?f[t.afterRefIdx]:null;n.isOnlyChild=t.isOnlyChild,n.mount(f[t.parentRefIdx],o)}}}this.el=h,this.parentEl=e},p.prototype.patch=function(t,e){if(this===t)return;const n=this.refs;if(l){const e=this.data,o=t.data;for(let t=0;t<l;t++){const s=e[t],r=o[t];if(s!==r){const e=i[t];e.updateData.call(n[e.refIdx],r,s)}}this.data=o}if(a){let o=this.children;const s=t.children;for(let t=0;t<a;t++){const r=o[t],i=s[t];if(r)i?r.patch(i,e):(e&&r.beforeRemove(),r.remove(),o[t]=void 0);else if(i){const e=c[t],s=e.afterRefIdx?n[e.afterRefIdx]:null;i.mount(n[e.parentRefIdx],s),o[t]=i}}}});return p}(t,e);if(e.cbRefs.length){const t=e.cbRefs,o=e.refList;let s=t.length;n=class extends n{mount(t,e){o.push(new Array(s)),super.mount(t,e);for(let t of o.pop())t()}remove(){super.remove();for(let e of t){(0,this.data[e])(null)}}}}if(e.children.length)return n=class extends n{constructor(t,e){super(t),this.children=e}},n.prototype.beforeRemove=P.prototype.beforeRemove,(t,e=[])=>new n(t,e);return t=>new n(t)}(o.el,s);return et[t]=r,r}function ot(t){if(t.nodeType!==Node.TEXT_NODE||/\S/.test(t.textContent)){if(t.nodeType!==Node.ELEMENT_NODE||"pre"!==t.tagName)for(let e=t.childNodes.length-1;e>=0;--e)ot(t.childNodes.item(e))}else t.remove()}function st(t,e=null,n=null){switch(t.nodeType){case Node.ELEMENT_NODE:{let o=n&&n.currentNS;const s=t.tagName;let r;const i=[];if(s.startsWith("block-text-")){const t=parseInt(s.slice(11),10);i.push({type:"text",idx:t}),r=document.createTextNode("")}if(s.startsWith("block-child-")){n.isRef||rt(n);const t=parseInt(s.slice(12),10);i.push({type:"child",idx:t}),r=document.createTextNode("")}if(o||(o=t.namespaceURI),r||(r=o?document.createElementNS(o,s):document.createElement(s)),r instanceof Element){if(!n){document.createElement("template").content.appendChild(r)}const e=t.attributes;for(let t=0;t<e.length;t++){const n=e[t].name,o=e[t].value;if(n.startsWith("block-handler-")){const t=parseInt(n.slice(14),10);i.push({type:"handler",idx:t,event:o})}else if(n.startsWith("block-attribute-")){const t=parseInt(n.slice(16),10);i.push({type:"attribute",idx:t,name:o,tag:s})}else if(n.startsWith("block-property-")){const t=parseInt(n.slice(15),10);i.push({type:"property",idx:t,name:o,tag:s})}else"block-attributes"===n?i.push({type:"attributes",idx:parseInt(o,10)}):"block-ref"===n?i.push({type:"ref",idx:parseInt(o,10)}):r.setAttribute(e[t].name,o)}}const l={parent:e,firstChild:null,nextSibling:null,el:r,info:i,refN:0,currentNS:o};if(t.firstChild){const e=t.childNodes[0];if(1===t.childNodes.length&&e.nodeType===Node.ELEMENT_NODE&&e.tagName.startsWith("block-child-")){const t=e.tagName,n=parseInt(t.slice(12),10);i.push({idx:n,type:"child",isOnlyChild:!0})}else{l.firstChild=st(t.firstChild,l,l),r.appendChild(l.firstChild.el);let e=t.firstChild,n=l.firstChild;for(;e=e.nextSibling;)n.nextSibling=st(e,n,l),r.appendChild(n.nextSibling.el),n=n.nextSibling}}return l.info.length&&rt(l),l}case Node.TEXT_NODE:case Node.COMMENT_NODE:return{parent:e,firstChild:null,nextSibling:null,el:t.nodeType===Node.TEXT_NODE?document.createTextNode(t.textContent):document.createComment(t.textContent),info:[],refN:0,currentNS:null}}throw new r("boom")}function rt(t){t.isRef=!0;do{t.refN++}while(t=t.parent)}function it(t){let e=t.parent;for(;e&&e.nextSibling===t;)t=e,e=e.parent;return e}function lt(t,e,n){if(!e){e={collectors:[],locations:[],children:new Array(t.info.filter((t=>"child"===t.type)).length),cbRefs:[],refN:t.refN,refList:[]},n=0}if(t.refN){const o=n,s=t.isRef,r=t.firstChild?t.firstChild.refN:0,i=t.nextSibling?t.nextSibling.refN:0;if(s){for(let e of t.info)e.refIdx=o;t.refIdx=o,function(t,e){for(let n of e.info)switch(n.type){case"text":t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:at,updateData:at});break;case"child":n.isOnlyChild?t.children[n.idx]={parentRefIdx:n.refIdx,isOnlyChild:!0}:t.children[n.idx]={parentRefIdx:it(e).refIdx,afterRefIdx:n.refIdx};break;case"property":{const e=n.refIdx,o=tt(n.name);t.locations.push({idx:n.idx,refIdx:e,setData:o,updateData:o});break}case"attribute":{const e=n.refIdx;let o,s;"class"===n.name?(s=y,o=w):(s=m(n.name),o=s),t.locations.push({idx:n.idx,refIdx:e,setData:s,updateData:o});break}case"attributes":t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:g,updateData:b});break;case"handler":{const{setup:e,update:o}=A(n.event);t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:e,updateData:o});break}case"ref":const o=t.cbRefs.push(n.idx)-1;t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:ct(o,t.refList),updateData:Q})}}(e,t),n++}if(i){const s=n+r;e.collectors.push({idx:s,prevIdx:o,getVal:J}),lt(t.nextSibling,e,s)}r&&(e.collectors.push({idx:n,prevIdx:o,getVal:Z}),lt(t.firstChild,e,n))}return e}function at(t){Y.call(this,U(t))}function ct(t,e){return function(n){e[e.length-1][t]=()=>n(this)}}let ht,ut,dt,ft,pt,mt;if("undefined"!=typeof Node){const t=Node.prototype;ht=t.insertBefore,ut=t.appendChild,dt=t.removeChild,ft=((t,e)=>Object.getOwnPropertyDescriptor(t,e))(t,"textContent").set}class gt{constructor(t){this.children=t}mount(t,e){const n=this.children,o=document.createTextNode("");this.anchor=o,ht.call(t,o,e);const s=n.length;if(s){const e=n[0].mount;for(let r=0;r<s;r++)e.call(n[r],t,o)}this.parentEl=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;const n=this.children;for(let o=0,s=n.length;o<s;o++)n[o].moveBeforeDOMNode(t,e);e.insertBefore(this.anchor,t)}moveBeforeVNode(t,e){if(t){const n=t.children[0];e=(n?n.firstNode():t.anchor)||null}const n=this.children;for(let t=0,o=n.length;t<o;t++)n[t].moveBeforeVNode(null,e);this.parentEl.insertBefore(this.anchor,e)}patch(t,e){if(this===t)return;const n=this.children,o=t.children;if(0===o.length&&0===n.length)return;this.children=o;const s=o[0]||n[0],{mount:r,patch:i,remove:l,beforeRemove:a,moveBeforeVNode:c,firstNode:h}=s,u=this.anchor,d=this.isOnlyChild,f=this.parentEl;if(0===o.length&&d){if(e)for(let t=0,e=n.length;t<e;t++)a.call(n[t]);return ft.call(f,""),void ut.call(f,u)}let p,m=0,g=0,b=n[0],v=o[0],y=n.length-1,w=o.length-1,$=n[y],x=o[w];for(;m<=y&&g<=w;){if(null===b){b=n[++m];continue}if(null===$){$=n[--y];continue}let t=b.key,s=v.key;if(t===s){i.call(b,v,e),o[g]=b,b=n[++m],v=o[++g];continue}let l=$.key,a=x.key;if(l===a){i.call($,x,e),o[w]=$,$=n[--y],x=o[--w];continue}if(t===a){i.call(b,x,e),o[w]=b;const t=o[w+1];c.call(b,t,u),b=n[++m],x=o[--w];continue}if(l===s){i.call($,v,e),o[g]=$;const t=n[m];c.call($,t,u),$=n[--y],v=o[++g];continue}p=p||vt(n,m,y);let d=p[s];if(void 0===d)r.call(v,f,h.call(b)||null);else{const t=n[d];c.call(t,b,null),i.call(t,v,e),o[g]=t,n[d]=null}v=o[++g]}if(m<=y||g<=w)if(m>y){const t=o[w+1],e=t?h.call(t)||null:u;for(let t=g;t<=w;t++)r.call(o[t],f,e)}else for(let t=m;t<=y;t++){let o=n[t];o&&(e&&a.call(o),l.call(o))}}beforeRemove(){const t=this.children,e=t.length;if(e){const n=t[0].beforeRemove;for(let o=0;o<e;o++)n.call(t[o])}}remove(){const{parentEl:t,anchor:e}=this;if(this.isOnlyChild)ft.call(t,"");else{const n=this.children,o=n.length;if(o){const t=n[0].remove;for(let e=0;e<o;e++)t.call(n[e])}dt.call(t,e)}}firstNode(){const t=this.children[0];return t?t.firstNode():void 0}toString(){return this.children.map((t=>t.toString())).join("")}}function bt(t){return new gt(t)}function vt(t,e,n){let o={};for(let s=e;s<=n;s++)o[t[s].key]=s;return o}if("undefined"!=typeof Node){const t=Node.prototype;pt=t.insertBefore,mt=t.removeChild}class yt{constructor(t){this.content=[],this.html=t}mount(t,e){this.parentEl=t;const n=document.createElement("template");n.innerHTML=this.html,this.content=[...n.content.childNodes];for(let n of this.content)pt.call(t,n,e);if(!this.content.length){const n=document.createTextNode("");this.content.push(n),pt.call(t,n,e)}}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;for(let n of this.content)pt.call(e,n,t)}moveBeforeVNode(t,e){const n=t?t.content[0]:e;this.moveBeforeDOMNode(n)}patch(t){if(this===t)return;const e=t.html;if(this.html!==e){const n=this.parentEl,o=this.content[0],s=document.createElement("template");s.innerHTML=e;const r=[...s.content.childNodes];for(let t of r)pt.call(n,t,o);if(!r.length){const t=document.createTextNode("");r.push(t),pt.call(n,t,o)}this.remove(),this.content=r,this.html=t.html}}beforeRemove(){}remove(){const t=this.parentEl;for(let e of this.content)mt.call(t,e)}firstNode(){return this.content[0]}toString(){return this.html}}function wt(t){return new yt(t)}function $t(t,e,n=null){t.mount(e,n)}const xt=new WeakMap,Nt=new WeakMap;function kt(t,e){if(!t)return!1;const n=t.fiber;n&&xt.set(n,e);const o=Nt.get(t);if(o){let t=!1;for(let n=o.length-1;n>=0;n--)try{o[n](e),t=!0;break}catch(t){e=t}if(t)return!0}return kt(t.parent,e)}function Tt(t){let{error:e}=t;e instanceof r||(e=Object.assign(new r('An error occured in the owl lifecycle (see this Error\'s "cause" property)'),{cause:e}));const n="node"in t?t.node:t.fiber.node,o="fiber"in t?t.fiber:n.fiber;if(o){let t=o;do{t.node.fiber=t,xt.set(t,e),t=t.parent}while(t);xt.set(o.root,e)}if(!kt(n,e)){console.warn("[Owl] Unhandled error. Destroying the root component");try{n.app.destroy()}catch(t){console.error(t)}throw e}}function Et(){throw new r("Attempted to render cancelled fiber")}function At(t){let e=0;for(let n of t){let t=n.node;n.render=Et,0===t.status&&t.cancel(),t.fiber=null,n.bdom?t.forceNextRender=!0:e++,e+=At(n.children)}return e}class _t{constructor(t,e){if(this.bdom=null,this.children=[],this.appliedToDom=!1,this.deep=!1,this.childrenMap={},this.node=t,this.parent=e,e){this.deep=e.deep;const t=e.root;t.setCounter(t.counter+1),this.root=t,e.children.push(this)}else this.root=this}render(){let t=this.root.node,e=t.app.scheduler,n=t.parent;for(;n;){if(n.fiber){let o=n.fiber.root;if(0!==o.counter||!(t.parentKey in n.fiber.childrenMap))return void e.delayedRenders.push(this);n=o.node}t=n,n=n.parent}this._render()}_render(){const t=this.node,e=this.root;if(e){try{this.bdom=!0,this.bdom=t.renderFn()}catch(e){t.app.handleError({node:t,error:e})}e.setCounter(e.counter-1)}}}class Ct extends _t{constructor(){super(...arguments),this.counter=1,this.willPatch=[],this.patched=[],this.mounted=[],this.locked=!1}complete(){const t=this.node;let e;this.locked=!0;let n=this.mounted;try{for(e of this.willPatch){let t=e.node;if(t.fiber===e){const e=t.component;for(let n of t.willPatch)n.call(e)}}for(e=void 0,t._patch(),this.locked=!1;e=n.pop();)if(e.appliedToDom)for(let t of e.node.mounted)t();let o=this.patched;for(;e=o.pop();)if(e.appliedToDom)for(let t of e.node.patched)t()}catch(o){for(let t of n)t.node.willUnmount=[];this.locked=!1,t.app.handleError({fiber:e||this,error:o})}}setCounter(t){this.counter=t,0===t&&this.node.app.scheduler.flush()}}class Dt extends Ct{constructor(t,e,n={}){super(t,null),this.target=e,this.position=n.position||"last-child"}complete(){let t=this;try{const e=this.node;if(e.children=this.childrenMap,e.app.constructor.validateTarget(this.target),e.bdom)e.updateDom();else if(e.bdom=this.bdom,"last-child"===this.position||0===this.target.childNodes.length)$t(e.bdom,this.target);else{const t=this.target.childNodes[0];$t(e.bdom,this.target,t)}e.fiber=null,e.status=1,this.appliedToDom=!0;let n=this.mounted;for(;t=n.pop();)if(t.appliedToDom)for(let e of t.node.mounted)e()}catch(e){this.node.app.handleError({fiber:t,error:e})}}}const St=Symbol("Key changes"),Ot=()=>{throw new Error("Called NO_CALLBACK. Owl is broken, please report this to the maintainers.")},Rt=Object.prototype.toString,Lt=Object.prototype.hasOwnProperty,Bt=["Object","Array","Set","Map","WeakMap"],Pt=["Set","Map","WeakMap"];function jt(t){return Rt.call(Ft(t)).slice(8,-1)}function Mt(t){return"object"==typeof t&&Bt.includes(jt(t))}function It(t,e){return Mt(t)?Yt(t,e):t}const Wt=new WeakSet;function Vt(t){return Wt.add(t),t}function Ft(t){return Gt.has(t)?Gt.get(t):t}const Kt=new WeakMap;function zt(t,e,n){if(n===Ot)return;Kt.get(t)||Kt.set(t,new Map);const o=Kt.get(t);o.get(e)||o.set(e,new Set),o.get(e).add(n),Ut.has(n)||Ut.set(n,new Set),Ut.get(n).add(t)}function Ht(t,e){const n=Kt.get(t);if(!n)return;const o=n.get(e);if(o)for(const t of[...o])qt(t),t()}const Ut=new WeakMap;function qt(t){const e=Ut.get(t);if(e){for(const n of e){const e=Kt.get(n);if(e)for(const[n,o]of e.entries())o.delete(t),o.size||e.delete(n)}e.clear()}}const Gt=new WeakMap,Xt=new WeakMap;function Yt(t,e=Ot){if(!Mt(t))throw new r("Cannot make the given value reactive");if(Wt.has(t))return t;if(Gt.has(t))return Yt(Gt.get(t),e);Xt.has(t)||Xt.set(t,new WeakMap);const n=Xt.get(t);if(!n.has(e)){const o=jt(t),s=Pt.includes(o)?function(t,e,n){const o=oe[n](t,e);return Object.assign(Zt(e),{get:(t,n)=>Lt.call(o,n)?o[n]:(zt(t,n,e),It(t[n],e))})}(t,e,o):Zt(e),r=new Proxy(t,s);n.set(e,r),Gt.set(r,t)}return n.get(e)}function Zt(t){return{get(e,n,o){const s=Object.getOwnPropertyDescriptor(e,n);return!s||s.writable||s.configurable?(zt(e,n,t),It(Reflect.get(e,n,o),t)):Reflect.get(e,n,o)},set(t,e,n,o){const s=Lt.call(t,e),r=Reflect.get(t,e,o),i=Reflect.set(t,e,Ft(n),o);return!s&&Lt.call(t,e)&&Ht(t,St),(r!==Reflect.get(t,e,o)||"length"===e&&Array.isArray(t))&&Ht(t,e),i},deleteProperty(t,e){const n=Reflect.deleteProperty(t,e);return Ht(t,St),Ht(t,e),n},ownKeys:e=>(zt(e,St,t),Reflect.ownKeys(e)),has:(e,n)=>(zt(e,St,t),Reflect.has(e,n))}}function Jt(t,e,n){return o=>(o=Ft(o),zt(e,o,n),It(e[t](o),n))}function Qt(t,e,n){return function*(){zt(e,St,n);const o=e.keys();for(const s of e[t]()){const t=o.next().value;zt(e,t,n),yield It(s,n)}}}function te(t,e){return function(n,o){zt(t,St,e),t.forEach((function(s,r,i){zt(t,r,e),n.call(o,It(s,e),It(r,e),It(i,e))}),o)}}function ee(t,e,n){return(o,s)=>{o=Ft(o);const r=n.has(o),i=n[e](o),l=n[t](o,s);return r!==n.has(o)&&Ht(n,St),i!==n[e](o)&&Ht(n,o),l}}function ne(t){return()=>{const e=[...t.keys()];t.clear(),Ht(t,St);for(const n of e)Ht(t,n)}}const oe={Set:(t,e)=>({has:Jt("has",t,e),add:ee("add","has",t),delete:ee("delete","has",t),keys:Qt("keys",t,e),values:Qt("values",t,e),entries:Qt("entries",t,e),[Symbol.iterator]:Qt(Symbol.iterator,t,e),forEach:te(t,e),clear:ne(t),get size(){return zt(t,St,e),t.size}}),Map:(t,e)=>({has:Jt("has",t,e),get:Jt("get",t,e),set:ee("set","get",t),delete:ee("delete","has",t),keys:Qt("keys",t,e),values:Qt("values",t,e),entries:Qt("entries",t,e),[Symbol.iterator]:Qt(Symbol.iterator,t,e),forEach:te(t,e),clear:ne(t),get size(){return zt(t,St,e),t.size}}),WeakMap:(t,e)=>({has:Jt("has",t,e),get:Jt("get",t,e),set:ee("set","get",t),delete:ee("delete","has",t)})};let se=null;function re(){if(!se)throw new r("No active component (a hook function should only be called in 'setup')");return se}function ie(t,e){for(let n in e)void 0===t[n]&&(t[n]=e[n])}const le=new WeakMap;function ae(t){const e=re();let n=le.get(e);if(!n){const t={fn:$(e.render.bind(e,!1))};n=(...e)=>t.fn(...e),le.set(e,n),e.willDestroy.push(he.bind(null,t,n))}return Yt(t,n)}const ce=()=>{};function he(t,e){t.fn=ce,qt(e)}class ue{constructor(t,e,n,o,s){this.fiber=null,this.bdom=null,this.status=0,this.forceNextRender=!1,this.nextProps=null,this.children=Object.create(null),this.refs={},this.willStart=[],this.willUpdateProps=[],this.willUnmount=[],this.mounted=[],this.willPatch=[],this.patched=[],this.willDestroy=[],se=this,this.app=n,this.parent=o,this.props=e,this.parentKey=s;const r=t.defaultProps;e=Object.assign({},e),r&&ie(e,r);const i=o&&o.childEnv||n.env;this.childEnv=i;for(const t in e){const n=e[t];n&&"object"==typeof n&&Gt.has(n)&&(e[t]=ae(n))}this.component=new t(e,i,this);const l=Object.assign(Object.create(this.component),{this:this.component});this.renderFn=n.getTemplate(t.template).bind(this.component,l,this),this.component.setup(),se=null}mountComponent(t,e){const n=new Dt(this,t,e);this.app.scheduler.addFiber(n),this.initiateRender(n)}async initiateRender(t){this.fiber=t,this.mounted.length&&t.root.mounted.push(t);const e=this.component;try{await Promise.all(this.willStart.map((t=>t.call(e))))}catch(t){return void this.app.handleError({node:this,error:t})}0===this.status&&this.fiber===t&&t.render()}async render(t){if(this.status>=2)return;let e=this.fiber;if(e&&(e.root.locked||!0===e.bdom)&&(await Promise.resolve(),e=this.fiber),e){if(!e.bdom&&!xt.has(e))return void(t&&(e.deep=t));t=t||e.deep}else if(!this.bdom)return;const n=function(t){let e=t.fiber;if(e){let t=e.root;return t.locked=!0,t.setCounter(t.counter+1-At(e.children)),t.locked=!1,e.children=[],e.childrenMap={},e.bdom=null,xt.has(e)&&(xt.delete(e),xt.delete(t),e.appliedToDom=!1,e instanceof Ct&&(e.mounted=e instanceof Dt?[e]:[])),e}const n=new Ct(t,null);return t.willPatch.length&&n.willPatch.push(n),t.patched.length&&n.patched.push(n),n}(this);n.deep=t,this.fiber=n,this.app.scheduler.addFiber(n),await Promise.resolve(),this.status>=2||this.fiber!==n||!e&&n.parent||n.render()}cancel(){this._cancel(),delete this.parent.children[this.parentKey],this.app.scheduler.scheduleDestroy(this)}_cancel(){this.status=2;const t=this.children;for(let e in t)t[e]._cancel()}destroy(){let t=1===this.status;this._destroy(),t&&this.bdom.remove()}_destroy(){const t=this.component;if(1===this.status)for(let e of this.willUnmount)e.call(t);for(let t of Object.values(this.children))t._destroy();if(this.willDestroy.length)try{for(let e of this.willDestroy)e.call(t)}catch(t){this.app.handleError({error:t,node:this})}this.status=3}async updateAndRender(t,e){this.nextProps=t,t=Object.assign({},t);const n=function(t,e){let n=t.fiber;return n&&(At(n.children),n.root=null),new _t(t,e)}(this,e);this.fiber=n;const o=this.component,s=o.constructor.defaultProps;s&&ie(t,s),se=this;for(const e in t){const n=t[e];n&&"object"==typeof n&&Gt.has(n)&&(t[e]=ae(n))}se=null;const r=Promise.all(this.willUpdateProps.map((e=>e.call(o,t))));if(await r,n!==this.fiber)return;o.props=t,n.render();const i=e.root;this.willPatch.length&&i.willPatch.push(n),this.patched.length&&i.patched.push(n)}updateDom(){if(this.fiber)if(this.bdom===this.fiber.bdom)for(let t in this.children){this.children[t].updateDom()}else this.bdom.patch(this.fiber.bdom,!1),this.fiber.appliedToDom=!0,this.fiber=null}setRef(t,e){e&&(this.refs[t]=e)}firstNode(){const t=this.bdom;return t?t.firstNode():void 0}mount(t,e){const n=this.fiber.bdom;this.bdom=n,n.mount(t,e),this.status=1,this.fiber.appliedToDom=!0,this.children=this.fiber.childrenMap,this.fiber=null}moveBeforeDOMNode(t,e){this.bdom.moveBeforeDOMNode(t,e)}moveBeforeVNode(t,e){this.bdom.moveBeforeVNode(t?t.bdom:null,e)}patch(){this.fiber&&this.fiber.parent&&(this._patch(),this.props=this.nextProps)}_patch(){let t=!1;for(let e in this.children){t=!0;break}const e=this.fiber;this.children=e.childrenMap,this.bdom.patch(e.bdom,t),e.appliedToDom=!0,this.fiber=null}beforeRemove(){this._destroy()}remove(){this.bdom.remove()}get name(){return this.component.constructor.name}get subscriptions(){const t=le.get(this);return t?(e=t,[...Ut.get(e)||[]].map((t=>{const n=Kt.get(t);let o=[];if(n)for(const[t,s]of n)s.has(e)&&o.push(t);return{target:t,keys:o}}))):[];var e}}const de=Symbol("timeout"),fe={onWillStart:3e3,onWillUpdateProps:3e3};function pe(t,e){const n=new r,o=new r,s=re();return(...r)=>{const i=t=>{throw n.cause=t,n.message=t instanceof Error?`The following error occurred in ${e}: "${t.message}"`:`Something that is not an Error was thrown in ${e} (see this Error's "cause" property)`,n};let l;try{l=t(...r)}catch(t){i(t)}if(!(l instanceof Promise))return l;const a=fe[e];if(a){const t=s.fiber;Promise.race([l.catch((()=>{})),new Promise((t=>setTimeout((()=>t(de)),a)))]).then((n=>{n===de&&s.fiber===t&&s.status<=2&&(o.message=`${e}'s promise hasn't resolved after ${a/1e3} seconds`,console.log(o))}))}return l.catch(i)}}function me(t){const e=re(),n=e.app.dev?pe:t=>t;e.mounted.push(n(t.bind(e.component),"onMounted"))}function ge(t){const e=re(),n=e.app.dev?pe:t=>t;e.patched.push(n(t.bind(e.component),"onPatched"))}function be(t){const e=re(),n=e.app.dev?pe:t=>t;e.willUnmount.unshift(n(t.bind(e.component),"onWillUnmount"))}class ve{constructor(t,e,n){this.props=t,this.env=e,this.__owl__=n}setup(){}render(t=!1){this.__owl__.render(!0===t)}}ve.template="";const ye=z("").constructor;class we extends ye{constructor(t,e){super(""),this.target=null,this.selector=t,this.content=e}mount(t,e){super.mount(t,e),this.target=document.querySelector(this.selector),this.target?this.content.mount(this.target,null):this.content.mount(t,e)}beforeRemove(){this.content.beforeRemove()}remove(){this.content&&(super.remove(),this.content.remove(),this.content=null)}patch(t){super.patch(t),this.content?this.content.patch(t.content,!0):(this.content=t.content,this.content.mount(this.target,null))}}class $e extends ve{setup(){const t=this.__owl__;me((()=>{const e=t.bdom;if(!e.target){const t=document.querySelector(this.props.target);if(!t)throw new r("invalid portal target");e.content.moveBeforeDOMNode(t.firstChild,t)}})),be((()=>{t.bdom.remove()}))}}$e.template="__portal__",$e.props={target:{type:String},slots:!0};const xe=t=>Array.isArray(t),Ne=t=>"object"!=typeof t,ke=t=>"object"==typeof t&&t&&"value"in t;function Te(t){return"object"==typeof t&&"optional"in t&&t.optional||!1}function Ee(t){return"*"===t||!0===t?"value":t.name.toLowerCase()}function Ae(t){return Ne(t)?Ee(t):xe(t)?t.map(Ae).join(" or "):ke(t)?String(t.value):"element"in t?`list of ${Ae({type:t.element,optional:!1})}s`:"shape"in t?"object":Ae(t.type||"*")}function _e(t,e){var n;Array.isArray(e)&&(n=e,e=Object.fromEntries(n.map((t=>t.endsWith("?")?[t.slice(0,-1),{optional:!0}]:[t,{type:"*",optional:!1}])))),t=Ft(t);let o=[];for(let n in t)if(n in e){let s=Ce(n,t[n],e[n]);s&&o.push(s)}else"*"in e||o.push(`unknown key '${n}'`);for(let n in e){const s=e[n];if("*"!==n&&!Te(s)&&!(n in t)){const t="object"==typeof s&&!Array.isArray(s);let e="*"===s||(t&&"type"in s?"*"===s.type:t)?"":` (should be a ${Ae(s)})`;o.push(`'${n}' is missing${e}`)}}return o}function Ce(t,e,n){if(void 0===e)return Te(n)?null:`'${t}' is undefined (should be a ${Ae(n)})`;if(Ne(n))return function(t,e,n){if("function"==typeof n)if("object"==typeof e){if(!(e instanceof n))return`'${t}' is not a ${Ee(n)}`}else if(typeof e!==n.name.toLowerCase())return`'${t}' is not a ${Ee(n)}`;return null}(t,e,n);if(ke(n))return e===n.value?null:`'${t}' is not equal to '${n.value}'`;if(xe(n)){let o=n.find((n=>!Ce(t,e,n)));return o?null:`'${t}' is not a ${Ae(n)}`}let o=null;if("element"in n)o=function(t,e,n){if(!Array.isArray(e))return`'${t}' is not a list of ${Ae(n)}s`;for(let o=0;o<e.length;o++){const s=Ce(`${t}[${o}]`,e[o],n);if(s)return s}return null}(t,e,n.element);else if("shape"in n)if("object"!=typeof e||Array.isArray(e))o=`'${t}' is not an object`;else{const s=_e(e,n.shape);s.length&&(o=`'${t}' doesn't have the correct shape (${s.join(", ")})`)}else if("values"in n)if("object"!=typeof e||Array.isArray(e))o=`'${t}' is not an object`;else{const s=Object.entries(e).map((([t,e])=>Ce(t,e,n.values))).filter(Boolean);s.length&&(o=`some of the values in '${t}' are invalid (${s.join(", ")})`)}return"type"in n&&!o&&(o=Ce(t,e,n.type)),"validate"in n&&!o&&(o=n.validate(e)?null:`'${t}' is not valid`),o}const De=Object.create;function Se(t){const e=De(t);for(let n in t)e[n]=t[n];return e}const Oe=Symbol("isBoundary");class Re{constructor(t,e,n,o,s){this.fn=t,this.ctx=Se(e),this.component=n,this.node=o,this.key=s}evaluate(){return this.fn.call(this.component,this.ctx,this.node,this.key)}toString(){return this.evaluate().toString()}}function Le(t,e,n){const o="string"!=typeof t?t:n.constructor.components[t];if(!o)return;const s=o.props;if(!s)return void(n.__owl__.app.warnIfNoStaticProps&&console.warn(`Component '${o.name}' does not have a static props description`));const i=o.defaultProps;if(i){let t=t=>Array.isArray(s)?s.includes(t):t in s&&!("*"in s)&&!Te(s[t]);for(let e in i)if(t(e))throw new r(`A default value cannot be defined for a mandatory prop (name: '${e}', component: ${o.name})`)}const l=_e(e,s);if(l.length)throw new r(`Invalid props for component '${o.name}': `+l.join(", "))}const Be={withDefault:function(t,e){return null==t||!1===t?e:t},zero:Symbol("zero"),isBoundary:Oe,callSlot:function(t,e,n,o,r,i,l){n=n+"__slot_"+o;const a=t.props.slots||{},{__render:c,__ctx:h,__scope:u}=a[o]||{},d=De(h||{});u&&(d[u]=i);const f=c?c(d,e,n):null;if(l){let i,a;return f?i=r?s(o,f):f:a=l(t,e,n),j([i,a])}return f||z("")},capture:Se,withKey:function(t,e){return t.key=e,t},prepareList:function(t){let e,n;if(Array.isArray(t))e=t,n=t;else if(t instanceof Map)e=[...t.keys()],n=[...t.values()];else if(Symbol.iterator in Object(t))e=[...t],n=e;else{if(!t||"object"!=typeof t)throw new r(`Invalid loop expression: "${t}" is not iterable`);n=Object.values(t),e=Object.keys(t)}const o=n.length;return[e,n,o,new Array(o)]},setContextValue:function(t,e,n){const o=t;for(;!t.hasOwnProperty(e)&&!t.hasOwnProperty(Oe);){const e=t.__proto__;if(!e){t=o;break}t=e}t[e]=n},shallowEqual:function(t,e){for(let n=0,o=t.length;n<o;n++)if(t[n]!==e[n])return!1;return!0},toNumber:function(t){const e=parseFloat(t);return isNaN(e)?t:e},validateProps:Le,LazyValue:Re,safeOutput:function(t,e){if(null==t)return e?s("default",e):s("undefined",z(""));let n,o;switch(typeof t){case"object":t instanceof k?(n="string_safe",o=wt(t)):t instanceof Re?(n="lazy_value",o=t.evaluate()):t instanceof String?(n="string_unsafe",o=z(t)):(n="block_safe",o=t);break;case"string":n="string_unsafe",o=z(t);break;default:n="string_unsafe",o=z(String(t))}return s(n,o)},createCatcher:function(t){const e=Object.keys(t).length;class n{constructor(t,e){this.handlerFns=[],this.afterNode=null,this.child=t,this.handlerData=e}mount(e,n){this.parentEl=e,this.child.mount(e,n),this.afterNode=document.createTextNode(""),e.insertBefore(this.afterNode,n),this.wrapHandlerData();for(let n in t){const o=t[n],s=A(n);this.handlerFns[o]=s,s.setup.call(e,this.handlerData[o])}}wrapHandlerData(){for(let t=0;t<e;t++){let e=this.handlerData[t],n=e.length-2,o=e[n];const s=this;e[n]=function(t){const e=t.target;let n=s.child.firstNode();const r=s.afterNode;for(;n&&n!==r;){if(n.contains(e))return o.call(this,t);n=n.nextSibling}}}}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,this.child.moveBeforeDOMNode(t,e),e.insertBefore(this.afterNode,t)}moveBeforeVNode(t,e){t&&(e=t.firstNode()||e),this.child.moveBeforeVNode(t?t.child:null,e),this.parentEl.insertBefore(this.afterNode,e)}patch(t,n){if(this!==t){this.handlerData=t.handlerData,this.wrapHandlerData();for(let t=0;t<e;t++)this.handlerFns[t].update.call(this.parentEl,this.handlerData[t]);this.child.patch(t.child,n)}}beforeRemove(){this.child.beforeRemove()}remove(){for(let t=0;t<e;t++)this.handlerFns[t].remove.call(this.parentEl);this.child.remove(),this.afterNode.remove()}firstNode(){return this.child.firstNode()}toString(){return this.child.toString()}}return function(t,e){return new n(t,e)}},markRaw:Vt,OwlError:r,makeRefWrapper:function(t){let e=new Set;return(n,o)=>{if(e.has(n))throw new r(`Cannot set the same ref more than once in the same component, ref "${n}" was set multiple times in ${t.name}`);return e.add(n),o}}};function Pe(t){const e=(new DOMParser).parseFromString(t,"text/xml");if(e.getElementsByTagName("parsererror").length){let n="Invalid XML in template.";const o=e.getElementsByTagName("parsererror")[0].textContent;if(o){n+="\nThe parser has produced the following error message:\n"+o;const e=/\d+/g,s=e.exec(o);if(s){const r=Number(s[0]),i=t.split("\n")[r-1],l=e.exec(o);if(i&&l){const t=Number(l[0])-1;i[t]&&(n+=`\nThe error might be located at xml line ${r} column ${t}\n${i}\n${"-".repeat(t-1)}^`)}}}throw new r(n)}return e}const je={text:z,createBlock:nt,list:bt,multi:j,html:wt,toggler:s,comment:H};class Me{constructor(t={}){if(this.rawTemplates=Object.create(Ie),this.templates={},this.Portal=$e,this.dev=t.dev||!1,this.translateFn=t.translateFn,this.translatableAttributes=t.translatableAttributes,t.templates)if(t.templates instanceof Document||"string"==typeof t.templates)this.addTemplates(t.templates);else for(const e in t.templates)this.addTemplate(e,t.templates[e]);this.getRawTemplate=t.getTemplate,this.customDirectives=t.customDirectives||{},this.runtimeUtils={...Be,__globals__:t.globalValues||{}},this.hasGlobalValues=Boolean(t.globalValues&&Object.keys(t.globalValues).length)}static registerTemplate(t,e){Ie[t]=e}addTemplate(t,e){if(t in this.rawTemplates){if(!this.dev)return;const n=this.rawTemplates[t];if(("string"==typeof n?n:n instanceof Element?n.outerHTML:n.toString())===("string"==typeof e?e:e.outerHTML))return;throw new r(`Template ${t} already defined with different content`)}this.rawTemplates[t]=e}addTemplates(t){if(t){t=t instanceof Document?t:Pe(t);for(const e of t.querySelectorAll("[t-name]")){const t=e.getAttribute("t-name");this.addTemplate(t,e)}}}getTemplate(t){var e;if(!(t in this.templates)){const n=(null===(e=this.getRawTemplate)||void 0===e?void 0:e.call(this,t))||this.rawTemplates[t];if(void 0===n){let e="";try{e=` (for component "${re().component.constructor.name}")`}catch{}throw new r(`Missing template: "${t}"${e}`)}const o="function"==typeof n&&!(n instanceof Element)?n:this._compileTemplate(t,n),s=this.templates;this.templates[t]=function(e,n){return s[t].call(this,e,n)};const i=o(this,je,this.runtimeUtils);this.templates[t]=i}return this.templates[t]}_compileTemplate(t,e){throw new r("Unable to compile a template. Please use owl full build instead")}callTemplate(t,e,n,o,r){return s(e,this.getTemplate(e).call(t,n,o,r+e))}}const Ie={};function We(...t){const e="__template__"+We.nextId++,n=String.raw(...t);return Ie[e]=n,e}We.nextId=1,Me.registerTemplate("__portal__",(function(t,e,n){let{callSlot:o}=n;return function(t,e,n=""){return new we(t.props.target,o(t,e,n,"default",!1,null))}}));const Ve="true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,eval,void,Math,RegExp,Array,Object,Date,__globals__".split(","),Fe=Object.assign(Object.create(null),{and:"&&",or:"||",gt:">",gte:">=",lt:"<",lte:"<="}),Ke=Object.assign(Object.create(null),{"{":"LEFT_BRACE","}":"RIGHT_BRACE","[":"LEFT_BRACKET","]":"RIGHT_BRACKET",":":"COLON",",":"COMMA","(":"LEFT_PAREN",")":"RIGHT_PAREN"}),ze="...,.,===,==,+,!==,!=,!,||,&&,>=,>,<=,<,?,-,*,/,%,typeof ,=>,=,;,in ,new ,|,&,^,~".split(",");const He=[function(t){let e=t[0],n=e;if("'"!==e&&'"'!==e&&"`"!==e)return!1;let o,s=1;for(;t[s]&&t[s]!==n;){if(o=t[s],e+=o,"\\"===o){if(s++,o=t[s],!o)throw new r("Invalid expression");e+=o}s++}if(t[s]!==n)throw new r("Invalid expression");return e+=n,"`"===n?{type:"TEMPLATE_STRING",value:e,replace:t=>e.replace(/\$\{(.*?)\}/g,((e,n)=>"${"+t(n)+"}"))}:{type:"VALUE",value:e}},function(t){let e=t[0];if(e&&e.match(/[0-9]/)){let n=1;for(;t[n]&&t[n].match(/[0-9]|\./);)e+=t[n],n++;return{type:"VALUE",value:e}}return!1},function(t){for(let e of ze)if(t.startsWith(e))return{type:"OPERATOR",value:e};return!1},function(t){let e=t[0];if(e&&e.match(/[a-zA-Z_\$]/)){let n=1;for(;t[n]&&t[n].match(/\w/);)e+=t[n],n++;return e in Fe?{type:"OPERATOR",value:Fe[e],size:e.length}:{type:"SYMBOL",value:e}}return!1},function(t){const e=t[0];return!(!e||!(e in Ke))&&{type:Ke[e],value:e}}];const Ue=t=>t&&("LEFT_BRACE"===t.type||"COMMA"===t.type),qe=t=>t&&("RIGHT_BRACE"===t.type||"COMMA"===t.type);function Ge(t){const e=new Set,n=function(t){const e=[];let n,o=!0,s=t;try{for(;o;)if(s=s.trim(),s){for(let t of He)if(o=t(s),o){e.push(o),s=s.slice(o.size||o.value.length);break}}else o=!1}catch(t){n=t}if(s.length||n)throw new r(`Tokenizer error: could not tokenize \`${t}\``);return e}(t);let o=0,s=[];for(;o<n.length;){let t=n[o],r=n[o-1],i=n[o+1],l=s[s.length-1];switch(t.type){case"LEFT_BRACE":case"LEFT_BRACKET":case"LEFT_PAREN":s.push(t.type);break;case"RIGHT_BRACE":case"RIGHT_BRACKET":case"RIGHT_PAREN":s.pop()}let a="SYMBOL"===t.type&&!Ve.includes(t.value);if("SYMBOL"!==t.type||Ve.includes(t.value)||r&&("LEFT_BRACE"===l&&Ue(r)&&qe(i)&&(n.splice(o+1,0,{type:"COLON",value:":"},{...t}),i=n[o+1]),"OPERATOR"===r.type&&"."===r.value?a=!1:"LEFT_BRACE"!==r.type&&"COMMA"!==r.type||i&&"COLON"===i.type&&(a=!1)),"TEMPLATE_STRING"===t.type&&(t.value=t.replace((t=>Ye(t)))),i&&"OPERATOR"===i.type&&"=>"===i.value)if("RIGHT_PAREN"===t.type){let t=o-1;for(;t>0&&"LEFT_PAREN"!==n[t].type;)"SYMBOL"===n[t].type&&n[t].originalValue&&(n[t].value=n[t].originalValue,e.add(n[t].value)),t--}else e.add(t.value);a&&(t.varName=t.value,e.has(t.value)||(t.originalValue=t.value,t.value=`ctx['${t.value}']`)),o++}for(const t of n)"SYMBOL"===t.type&&t.varName&&e.has(t.value)&&(t.originalValue=t.value,t.value=`_${t.value}`,t.isLocal=!0);return n}const Xe=new Map([["in "," in "]]);function Ye(t){return Ge(t).map((t=>Xe.get(t.value)||t.value)).join("")}const Ze=/\{\{.*?\}\}|\#\{.*?\}/g;function Je(t,e){let n=t.match(Ze);if(n&&n[0].length===t.length)return`(${e(t.slice(2,"{"===n[0][0]?-2:-1))})`;let o=t.replace(Ze,(t=>"${"+e(t.slice(2,"{"===t[0]?-2:-1))+"}"));return"`"+o+"`"}function Qe(t){return Je(t,Ye)}const tn=/\s+/g;let en;"undefined"!=typeof document&&(en=document.implementation.createDocument(null,null,null));const nn=new Set(["stop","capture","prevent","self","synthetic"]);let on={};function sn(t=""){return on[t]=(on[t]||0)+1,t+on[t]}function rn(t,e){switch(t){case"input":return"checked"===e||"indeterminate"===e||"value"===e||"readonly"===e||"readOnly"===e||"disabled"===e;case"option":return"selected"===e||"disabled"===e;case"textarea":return"value"===e||"readonly"===e||"readOnly"===e||"disabled"===e;case"select":return"value"===e||"disabled"===e;case"button":case"optgroup":return"disabled"===e}return!1}function ln(t){return`\`${t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/,"\\${")}\``}class an{constructor(t,e){this.dynamicTagName=null,this.isRoot=!1,this.hasDynamicChildren=!1,this.children=[],this.data=[],this.childNumber=0,this.parentVar="",this.id=an.nextBlockId++,this.varName="b"+this.id,this.blockName="block"+this.id,this.target=t,this.type=e}insertData(t,e="d"){const n=sn(e);return this.target.addLine(`let ${n} = ${t};`),this.data.push(n)-1}insert(t){this.currentDom?this.currentDom.appendChild(t):this.dom=t}generateExpr(t){if("block"===this.type){const t=this.children.length;let e=this.data.length?`[${this.data.join(", ")}]`:t?"[]":"";return t&&(e+=", ["+this.children.map((t=>t.varName)).join(", ")+"]"),this.dynamicTagName?`toggler(${this.dynamicTagName}, ${this.blockName}(${this.dynamicTagName})(${e}))`:`${this.blockName}(${e})`}return"list"===this.type?`list(c_block${this.id})`:t}asXmlString(){const t=en.createElement("t");return t.appendChild(this.dom),t.innerHTML}}function cn(t,e){return Object.assign({block:null,index:0,forceNewBlock:!0,translate:t.translate,translationCtx:t.translationCtx,tKeyExpr:null,nameSpace:t.nameSpace,tModelSelectedExpr:t.tModelSelectedExpr},e)}an.nextBlockId=1;class hn{constructor(t,e){this.indentLevel=0,this.loopLevel=0,this.code=[],this.hasRoot=!1,this.hasCache=!1,this.shouldProtectScope=!1,this.hasRefWrapper=!1,this.name=t,this.on=e||null}addLine(t,e){const n=new Array(this.indentLevel+2).join(" ");void 0===e?this.code.push(n+t):this.code.splice(e,0,n+t)}generateCode(){let t=[];t.push(`function ${this.name}(ctx, node, key = "") {`),this.shouldProtectScope&&(t.push(" ctx = Object.create(ctx);"),t.push(" ctx[isBoundary] = 1")),this.hasRefWrapper&&t.push(" let refWrapper = makeRefWrapper(this.__owl__);"),this.hasCache&&(t.push(" let cache = ctx.cache || {};"),t.push(" let nextCache = ctx.cache = {};"));for(let e of this.code)t.push(e);return this.hasRoot||t.push("return text('');"),t.push("}"),t.join("\n ")}currentKey(t){let e=this.loopLevel?`key${this.loopLevel}`:"key";return t.tKeyExpr&&(e=`${t.tKeyExpr} + ${e}`),e}}const un=["alt","aria-label","aria-placeholder","aria-roledescription","aria-valuetext","label","placeholder","title"],dn=/^(\s*)([\s\S]+?)(\s*)$/;class fn{constructor(t,e){if(this.blocks=[],this.nextBlockId=1,this.isDebug=!1,this.targets=[],this.target=new hn("template"),this.translatableAttributes=un,this.staticDefs=[],this.slotNames=new Set,this.helpers=new Set,this.translateFn=e.translateFn||(t=>t),e.translatableAttributes){const t=new Set(un);for(let n of e.translatableAttributes)n.startsWith("-")?t.delete(n.slice(1)):t.add(n);this.translatableAttributes=[...t]}this.hasSafeContext=e.hasSafeContext||!1,this.dev=e.dev||!1,this.ast=t,this.templateName=e.name,e.hasGlobalValues&&this.helpers.add("__globals__")}generateCode(){const t=this.ast;this.isDebug=12===t.type,an.nextBlockId=1,on={},this.compileAST(t,{block:null,index:0,forceNewBlock:!1,isLast:!0,translate:!0,translationCtx:"",tKeyExpr:null});let e=[" let { text, createBlock, list, multi, html, toggler, comment } = bdom;"];this.helpers.size&&e.push(`let { ${[...this.helpers].join(", ")} } = helpers;`),this.templateName&&e.push(`// Template name: "${this.templateName}"`);for(let{id:t,expr:n}of this.staticDefs)e.push(`const ${t} = ${n};`);if(this.blocks.length){e.push("");for(let t of this.blocks)if(t.dom){let n=ln(t.asXmlString());t.dynamicTagName?(n=n.replace(/^`<\w+/,`\`<\${tag || '${t.dom.nodeName}'}`),n=n.replace(/\w+>`$/,`\${tag || '${t.dom.nodeName}'}>\``),e.push(`let ${t.blockName} = tag => createBlock(${n});`)):e.push(`let ${t.blockName} = createBlock(${n});`)}}if(this.targets.length)for(let t of this.targets)e.push(""),e=e.concat(t.generateCode());e.push(""),e=e.concat("return "+this.target.generateCode());const n=e.join("\n ");if(this.isDebug){const t=`[Owl Debug]\n${n}`;console.log(t)}return n}compileInNewTarget(t,e,n,o){const s=sn(t),r=this.target,i=new hn(s,o);return this.targets.push(i),this.target=i,this.compileAST(e,cn(n)),this.target=r,s}addLine(t,e){this.target.addLine(t,e)}define(t,e){this.addLine(`const ${t} = ${e};`)}insertAnchor(t,e=t.children.length){const n=`block-child-${e}`,o=en.createElement(n);t.insert(o)}createBlock(t,e,n){const o=this.target.hasRoot,s=new an(this.target,e);return o||(this.target.hasRoot=!0,s.isRoot=!0),t&&(t.children.push(s),"list"===t.type&&(s.parentVar=`c_block${t.id}`)),s}insertBlock(t,e,n){let o=e.generateExpr(t);if(e.parentVar){let t=this.target.currentKey(n);return this.helpers.add("withKey"),void this.addLine(`${e.parentVar}[${n.index}] = withKey(${o}, ${t});`)}n.tKeyExpr&&(o=`toggler(${n.tKeyExpr}, ${o})`),e.isRoot?(this.target.on&&(o=this.wrapWithEventCatcher(o,this.target.on)),this.addLine(`return ${o};`)):this.define(e.varName,o)}captureExpression(t,e=!1){if(!e&&!t.includes("=>"))return Ye(t);const n=Ge(t),o=new Map;return n.map((t=>{if(t.varName&&!t.isLocal){if(!o.has(t.varName)){const e=sn("v");o.set(t.varName,e),this.define(e,t.value)}t.value=o.get(t.varName)}return t.value})).join("")}translate(t,e){const n=dn.exec(t);return n[1]+this.translateFn(n[2],e)+n[3]}compileAST(t,e){switch(t.type){case 1:return this.compileComment(t,e);case 0:return this.compileText(t,e);case 2:return this.compileTDomNode(t,e);case 4:return this.compileTEsc(t,e);case 8:return this.compileTOut(t,e);case 5:return this.compileTIf(t,e);case 9:return this.compileTForeach(t,e);case 10:return this.compileTKey(t,e);case 3:return this.compileMulti(t,e);case 7:return this.compileTCall(t,e);case 15:return this.compileTCallBlock(t,e);case 6:return this.compileTSet(t,e);case 11:return this.compileComponent(t,e);case 12:return this.compileDebug(t,e);case 13:return this.compileLog(t,e);case 14:return this.compileTSlot(t,e);case 16:return this.compileTTranslation(t,e);case 17:return this.compileTTranslationContext(t,e);case 18:return this.compileTPortal(t,e)}}compileDebug(t,e){return this.addLine("debugger;"),t.content?this.compileAST(t.content,e):null}compileLog(t,e){return this.addLine(`console.log(${Ye(t.expr)});`),t.content?this.compileAST(t.content,e):null}compileComment(t,e){let{block:n,forceNewBlock:o}=e;if(!n||o)n=this.createBlock(n,"comment",e),this.insertBlock(`comment(${ln(t.value)})`,n,{...e,forceNewBlock:o&&!n});else{const e=en.createComment(t.value);n.insert(e)}return n.varName}compileText(t,e){let{block:n,forceNewBlock:o}=e,s=t.value;if(s&&!1!==e.translate&&(s=this.translate(s,e.translationCtx)),e.inPreTag||(s=s.replace(tn," ")),!n||o)n=this.createBlock(n,"text",e),this.insertBlock(`text(${ln(s)})`,n,{...e,forceNewBlock:o&&!n});else{const e=0===t.type?en.createTextNode:en.createComment;n.insert(e.call(en,s))}return n.varName}generateHandlerCode(t,e){const n=t.split(".").slice(1).map((t=>{if(!nn.has(t))throw new r(`Unknown event modifier: '${t}'`);return`"${t}"`}));let o="";return n.length&&(o=`${n.join(",")}, `),`[${o}${this.captureExpression(e)}, ctx]`}compileTDomNode(t,e){var n;let{block:o,forceNewBlock:s}=e;const r=!o||s||null!==t.dynamicTag||t.ns;let i=this.target.code.length;if(r&&((t.dynamicTag||e.tKeyExpr||t.ns)&&e.block&&this.insertAnchor(e.block),o=this.createBlock(o,"block",e),this.blocks.push(o),t.dynamicTag)){const e=sn("tag");this.define(e,Ye(t.dynamicTag)),o.dynamicTagName=e}const l={};for(let s in t.attrs){let r,i;if(s.startsWith("t-attf")){r=Qe(t.attrs[s]);const e=o.insertData(r,"attr");i=s.slice(7),l["block-attribute-"+e]=i}else if(s.startsWith("t-att"))if(i="t-att"===s?null:s.slice(6),r=Ye(t.attrs[s]),i&&rn(t.tag,i)){"readonly"===i&&(i="readOnly"),r="value"===i?`new String((${r}) === 0 ? 0 : ((${r}) || ""))`:`new Boolean(${r})`;l[`block-property-${o.insertData(r,"prop")}`]=i}else{const t=o.insertData(r,"attr");"t-att"===s?l["block-attributes"]=String(t):l[`block-attribute-${t}`]=i}else if(this.translatableAttributes.includes(s)){const o=(null===(n=t.attrsTranslationCtx)||void 0===n?void 0:n[s])||e.translationCtx;l[s]=this.translateFn(t.attrs[s],o)}else r=`"${t.attrs[s]}"`,i=s,l[s]=t.attrs[s];if("value"===i&&e.tModelSelectedExpr){l[`block-attribute-${o.insertData(`${e.tModelSelectedExpr} === ${r}`,"attr")}`]="selected"}}let a;if(t.model){const{hasDynamicChildren:e,baseExpr:n,expr:s,eventType:r,shouldNumberize:i,shouldTrim:c,targetAttr:h,specialInitTargetAttr:u}=t.model,d=Ye(n),f=sn("bExpr");this.define(f,d);const p=Ye(s),m=sn("expr");this.define(m,p);const g=`${f}[${m}]`;let b;if(u){let e=h in l&&`'${l[h]}'`;if(!e&&t.attrs){const n=t.attrs[`t-att-${h}`];n&&(e=Ye(n))}b=o.insertData(`${g} === ${e}`,"prop"),l[`block-property-${b}`]=u}else if(e){a=`${sn("bValue")}`,this.define(a,g)}else b=o.insertData(`${g}`,"prop"),l[`block-property-${b}`]=h;this.helpers.add("toNumber");let v=`ev.target.${h}`;v=c?`${v}.trim()`:v,v=i?`toNumber(${v})`:v;const y=`[(ev) => { ${g} = ${v}; }]`;b=o.insertData(y,"hdlr"),l[`block-handler-${b}`]=r}for(let e in t.on){const n=this.generateHandlerCode(e,t.on[e]);l[`block-handler-${o.insertData(n,"hdlr")}`]=e}if(t.ref){this.dev&&(this.helpers.add("makeRefWrapper"),this.target.hasRefWrapper=!0);const e=Ze.test(t.ref);let n=`\`${t.ref}\``;e&&(n=Je(t.ref,(t=>this.captureExpression(t,!0))));let s=`(el) => this.__owl__.setRef((${n}), el)`;this.dev&&(s=`refWrapper(${n}, ${s})`);const r=o.insertData(s,"ref");l["block-ref"]=String(r)}const c=t.ns||e.nameSpace,h=c?en.createElementNS(c,t.tag):en.createElement(t.tag);for(const[t,e]of Object.entries(l))"class"===t&&""===e||h.setAttribute(t,e);if(o.insert(h),t.content.length){const n=o.currentDom;o.currentDom=h;const s=t.content;for(let n=0;n<s.length;n++){const r=t.content[n],i=cn(e,{block:o,index:o.childNumber,forceNewBlock:!1,isLast:e.isLast&&n===s.length-1,tKeyExpr:e.tKeyExpr,nameSpace:c,tModelSelectedExpr:a,inPreTag:e.inPreTag||"pre"===t.tag});this.compileAST(r,i)}o.currentDom=n}if(r&&(this.insertBlock(`${o.blockName}(ddd)`,o,e),o.children.length&&o.hasDynamicChildren)){const t=this.target.code,e=o.children.slice();let n=e.shift();for(let o=i;o<t.length&&(!t[o].trimStart().startsWith(`const ${n.varName} `)||(t[o]=t[o].replace(`const ${n.varName}`,n.varName),n=e.shift(),n));o++);this.addLine(`let ${o.children.map((t=>t.varName)).join(", ")};`,i)}return o.varName}compileTEsc(t,e){let n,{block:o,forceNewBlock:s}=e;if("0"===t.expr?(this.helpers.add("zero"),n="ctx[zero]"):(n=Ye(t.expr),t.defaultValue&&(this.helpers.add("withDefault"),n=`withDefault(${n}, ${ln(t.defaultValue)})`)),!o||s)o=this.createBlock(o,"text",e),this.insertBlock(`text(${n})`,o,{...e,forceNewBlock:s&&!o});else{const t=o.insertData(n,"txt"),e=en.createElement(`block-text-${t}`);o.insert(e)}return o.varName}compileTOut(t,e){let n,{block:o}=e;if(o&&this.insertAnchor(o),o=this.createBlock(o,"html",e),"0"===t.expr)this.helpers.add("zero"),n="ctx[zero]";else if(t.body){let o=null;o=an.nextBlockId;const s=cn(e);this.compileAST({type:3,content:t.body},s),this.helpers.add("safeOutput"),n=`safeOutput(${Ye(t.expr)}, b${o})`}else this.helpers.add("safeOutput"),n=`safeOutput(${Ye(t.expr)})`;return this.insertBlock(n,o,e),o.varName}compileTIfBranch(t,e,n){this.target.indentLevel++;let o=e.children.length;this.compileAST(t,cn(n,{block:e,index:n.index})),e.children.length>o&&this.insertAnchor(e,o),this.target.indentLevel--}compileTIf(t,e,n){let{block:o,forceNewBlock:s}=e;const r=this.target.code.length,i=!o||"multi"!==o.type&&s;if(o&&(o.hasDynamicChildren=!0),(!o||"multi"!==o.type&&s)&&(o=this.createBlock(o,"multi",e)),this.addLine(`if (${Ye(t.condition)}) {`),this.compileTIfBranch(t.content,o,e),t.tElif)for(let n of t.tElif)this.addLine(`} else if (${Ye(n.condition)}) {`),this.compileTIfBranch(n.content,o,e);if(t.tElse&&(this.addLine("} else {"),this.compileTIfBranch(t.tElse,o,e)),this.addLine("}"),i){if(o.children.length){const t=this.target.code,e=o.children.slice();let n=e.shift();for(let o=r;o<t.length&&(!t[o].trimStart().startsWith(`const ${n.varName} `)||(t[o]=t[o].replace(`const ${n.varName}`,n.varName),n=e.shift(),n));o++);this.addLine(`let ${o.children.map((t=>t.varName)).join(", ")};`,r)}const t=o.children.map((t=>t.varName)).join(", ");this.insertBlock(`multi([${t}])`,o,e)}return o.varName}compileTForeach(t,e){let{block:n}=e;n&&this.insertAnchor(n),n=this.createBlock(n,"list",e),this.target.loopLevel++;const o=`i${this.target.loopLevel}`;this.addLine("ctx = Object.create(ctx);");const s=`v_block${n.id}`,r=`k_block${n.id}`,i=`l_block${n.id}`,l=`c_block${n.id}`;let a;this.helpers.add("prepareList"),this.define(`[${r}, ${s}, ${i}, ${l}]`,`prepareList(${Ye(t.collection)});`),this.dev&&this.define(`keys${n.id}`,"new Set()"),this.addLine(`for (let ${o} = 0; ${o} < ${i}; ${o}++) {`),this.target.indentLevel++,this.addLine(`ctx[\`${t.elem}\`] = ${r}[${o}];`),t.hasNoFirst||this.addLine(`ctx[\`${t.elem}_first\`] = ${o} === 0;`),t.hasNoLast||this.addLine(`ctx[\`${t.elem}_last\`] = ${o} === ${r}.length - 1;`),t.hasNoIndex||this.addLine(`ctx[\`${t.elem}_index\`] = ${o};`),t.hasNoValue||this.addLine(`ctx[\`${t.elem}_value\`] = ${s}[${o}];`),this.define(`key${this.target.loopLevel}`,t.key?Ye(t.key):o),this.dev&&(this.helpers.add("OwlError"),this.addLine(`if (keys${n.id}.has(String(key${this.target.loopLevel}))) { throw new OwlError(\`Got duplicate key in t-foreach: \${key${this.target.loopLevel}}\`)}`),this.addLine(`keys${n.id}.add(String(key${this.target.loopLevel}));`)),t.memo&&(this.target.hasCache=!0,a=sn(),this.define(`memo${a}`,Ye(t.memo)),this.define(`vnode${a}`,`cache[key${this.target.loopLevel}];`),this.addLine(`if (vnode${a}) {`),this.target.indentLevel++,this.addLine(`if (shallowEqual(vnode${a}.memo, memo${a})) {`),this.target.indentLevel++,this.addLine(`${l}[${o}] = vnode${a};`),this.addLine(`nextCache[key${this.target.loopLevel}] = vnode${a};`),this.addLine("continue;"),this.target.indentLevel--,this.addLine("}"),this.target.indentLevel--,this.addLine("}"));const c=cn(e,{block:n,index:o});return this.compileAST(t.body,c),t.memo&&this.addLine(`nextCache[key${this.target.loopLevel}] = Object.assign(${l}[${o}], {memo: memo${a}});`),this.target.indentLevel--,this.target.loopLevel--,this.addLine("}"),e.isLast||this.addLine("ctx = ctx.__proto__;"),this.insertBlock("l",n,e),n.varName}compileTKey(t,e){const n=sn("tKey_");return this.define(n,Ye(t.expr)),e=cn(e,{tKeyExpr:n,block:e.block,index:e.index}),this.compileAST(t.content,e)}compileMulti(t,e){let{block:n,forceNewBlock:o}=e;const s=!n||o;let r=this.target.code.length;if(s){let o=null;if(t.content.filter((t=>!t.hasNoRepresentation)).length<=1){for(let n of t.content){const t=this.compileAST(n,e);o=o||t}return o}n=this.createBlock(n,"multi",e)}let i=0;for(let o=0,s=t.content.length;o<s;o++){const r=t.content[o],l=!r.hasNoRepresentation,a=cn(e,{block:n,index:i,forceNewBlock:l,isLast:e.isLast&&o===s-1});this.compileAST(r,a),l&&i++}if(s){if(n.hasDynamicChildren&&n.children.length){const t=this.target.code,e=n.children.slice();let o=e.shift();for(let n=r;n<t.length&&(!t[n].trimStart().startsWith(`const ${o.varName} `)||(t[n]=t[n].replace(`const ${o.varName}`,o.varName),o=e.shift(),o));n++);this.addLine(`let ${n.children.map((t=>t.varName)).join(", ")};`,r)}const t=n.children.map((t=>t.varName)).join(", ");this.insertBlock(`multi([${t}])`,n,e)}return n.varName}compileTCall(t,e){let{block:n,forceNewBlock:o}=e,s=e.ctxVar||"ctx";t.context&&(s=sn("ctx"),this.addLine(`let ${s} = ${Ye(t.context)};`));const r=Ze.test(t.name),i=r?Qe(t.name):"`"+t.name+"`";if(n&&!o&&this.insertAnchor(n),n=this.createBlock(n,"multi",e),t.body){this.addLine(`${s} = Object.create(${s});`),this.addLine(`${s}[isBoundary] = 1;`),this.helpers.add("isBoundary");const n=cn(e,{ctxVar:s}),o=this.compileMulti({type:3,content:t.body},n);o&&(this.helpers.add("zero"),this.addLine(`${s}[zero] = ${o};`))}const l=this.generateComponentKey();if(r){const t=sn("template");this.staticDefs.find((t=>"call"===t.id))||this.staticDefs.push({id:"call",expr:"app.callTemplate.bind(app)"}),this.define(t,i),this.insertBlock(`call(this, ${t}, ${s}, node, ${l})`,n,{...e,forceNewBlock:!n})}else{const t=sn("callTemplate_");this.staticDefs.push({id:t,expr:`app.getTemplate(${i})`}),this.insertBlock(`${t}.call(this, ${s}, node, ${l})`,n,{...e,forceNewBlock:!n})}return t.body&&!e.isLast&&this.addLine(`${s} = ${s}.__proto__;`),n.varName}compileTCallBlock(t,e){let{block:n,forceNewBlock:o}=e;return n&&(o||this.insertAnchor(n)),n=this.createBlock(n,"multi",e),this.insertBlock(Ye(t.name),n,{...e,forceNewBlock:!n}),n.varName}compileTSet(t,e){this.target.shouldProtectScope=!0,this.helpers.add("isBoundary").add("withDefault");const n=t.value?Ye(t.value||""):"null";if(t.body){this.helpers.add("LazyValue");const o={type:3,content:t.body};let s=`new LazyValue(${this.compileInNewTarget("value",o,e)}, ctx, this, node, ${this.target.currentKey(e)})`;s=t.value?s?`withDefault(${n}, ${s})`:n:s,this.addLine(`ctx[\`${t.name}\`] = ${s};`)}else{let o;if(t.defaultValue){const s=ln(e.translate?this.translate(t.defaultValue,e.translationCtx):t.defaultValue);o=t.value?`withDefault(${n}, ${s})`:s}else o=n;this.helpers.add("setContextValue"),this.addLine(`setContextValue(${e.ctxVar||"ctx"}, "${t.name}", ${o});`)}return null}generateComponentKey(t="key"){const e=[sn("__")];for(let t=0;t<this.target.loopLevel;t++)e.push(`\${key${t+1}}`);return`${t} + \`${e.join("__")}\``}formatProp(t,e,n,o){if(t.endsWith(".translate")){const s=(null==n?void 0:n[t])||o;e=ln(this.translateFn(e,s))}else e=this.captureExpression(e);if(t.includes(".")){let[n,o]=t.split(".");switch(t=n,o){case"bind":e=`(${e}).bind(this)`;break;case"alike":case"translate":break;default:throw new r(`Invalid prop suffix: ${o}`)}}return`${t=/^[a-z_]+$/i.test(t)?t:`'${t}'`}: ${e||void 0}`}formatPropObject(t,e,n){return Object.entries(t).map((([t,o])=>this.formatProp(t,o,e,n)))}getPropString(t,e){let n=`{${t.join(",")}}`;return e&&(n=`Object.assign({}, ${Ye(e)}${t.length?", "+n:""})`),n}compileComponent(t,e){let{block:n}=e;const o="slots"in(t.props||{}),s=t.props?this.formatPropObject(t.props,t.propsTranslationCtx,e.translationCtx):[];let r="";if(t.slots){let n="ctx";!this.target.loopLevel&&this.hasSafeContext||(n=sn("ctx"),this.helpers.add("capture"),this.define(n,"capture(ctx)"));let o=[];for(let s in t.slots){const r=t.slots[s],i=[];if(r.content){const t=this.compileInNewTarget("slot",r.content,e,r.on);i.push(`__render: ${t}.bind(this), __ctx: ${n}`)}const l=t.slots[s].scope;l&&i.push(`__scope: "${l}"`),t.slots[s].attrs&&i.push(...this.formatPropObject(t.slots[s].attrs,t.slots[s].attrsTranslationCtx,e.translationCtx));const a=`{${i.join(", ")}}`;o.push(`'${s}': ${a}`)}r=`{${o.join(", ")}}`}!r||t.dynamicProps||o||(this.helpers.add("markRaw"),s.push(`slots: markRaw(${r})`));let i,l,a=this.getPropString(s,t.dynamicProps);(r&&(t.dynamicProps||o)||this.dev)&&(i=sn("props"),this.define(i,a),a=i),r&&(t.dynamicProps||o)&&(this.helpers.add("markRaw"),this.addLine(`${i}.slots = markRaw(Object.assign(${r}, ${i}.slots))`)),t.isDynamic?(l=sn("Comp"),this.define(l,Ye(t.name))):l=`\`${t.name}\``,this.dev&&this.addLine(`helpers.validateProps(${l}, ${i}, this);`),n&&(!1===e.forceNewBlock||e.tKeyExpr)&&this.insertAnchor(n);let c=this.generateComponentKey();e.tKeyExpr&&(c=`${e.tKeyExpr} + ${c}`);let h=sn("comp");const u=[];for(let e in t.props||{}){let[t,n]=e.split(".");n||u.push(`"${t}"`)}this.staticDefs.push({id:h,expr:`app.createComponent(${t.isDynamic?null:l}, ${!t.isDynamic}, ${!!t.slots}, ${!!t.dynamicProps}, [${u}])`}),t.isDynamic&&(c=`(${l}).name + ${c}`);let d=`${h}(${a}, ${c}, node, this, ${t.isDynamic?l:null})`;return t.isDynamic&&(d=`toggler(${l}, ${d})`),t.on&&(d=this.wrapWithEventCatcher(d,t.on)),n=this.createBlock(n,"multi",e),this.insertBlock(d,n,e),n.varName}wrapWithEventCatcher(t,e){this.helpers.add("createCatcher");let n=sn("catcher"),o={},s=[];for(let t in e){let n=sn("hdlr"),r=s.push(n)-1;o[t]=r;const i=this.generateHandlerCode(t,e[t]);this.define(n,i)}return this.staticDefs.push({id:n,expr:`createCatcher(${JSON.stringify(o)})`}),`${n}(${t}, [${s.join(",")}])`}compileTSlot(t,e){this.helpers.add("callSlot");let n,o,{block:s}=e,r=!1,i=!1;t.name.match(Ze)?(r=!0,i=!0,o=Qe(t.name)):(o="'"+t.name+"'",i=i||this.slotNames.has(t.name),this.slotNames.add(t.name));const l={...t.attrs},a=l["t-props"];delete l["t-props"];let c=this.target.loopLevel?`key${this.target.loopLevel}`:"key";i&&(c=this.generateComponentKey(c));const h=t.attrs?this.formatPropObject(l,t.attrsTranslationCtx,e.translationCtx):[],u=this.getPropString(h,a);if(t.defaultContent){n=`callSlot(ctx, node, ${c}, ${o}, ${r}, ${u}, ${this.compileInNewTarget("defaultContent",t.defaultContent,e)}.bind(this))`}else if(r){let t=sn("slot");this.define(t,o),n=`toggler(${t}, callSlot(ctx, node, ${c}, ${t}, ${r}, ${u}))`}else n=`callSlot(ctx, node, ${c}, ${o}, ${r}, ${u})`;return t.on&&(n=this.wrapWithEventCatcher(n,t.on)),s&&this.insertAnchor(s),s=this.createBlock(s,"multi",e),this.insertBlock(n,s,{...e,forceNewBlock:!1}),s.varName}compileTTranslation(t,e){return t.content?this.compileAST(t.content,Object.assign({},e,{translate:!1})):null}compileTTranslationContext(t,e){return t.content?this.compileAST(t.content,Object.assign({},e,{translationCtx:t.translationCtx})):null}compileTPortal(t,e){this.staticDefs.find((t=>"Portal"===t.id))||this.staticDefs.push({id:"Portal",expr:"app.Portal"});let{block:n}=e;const o=this.compileInNewTarget("slot",t.content,e);let s="ctx";!this.target.loopLevel&&this.hasSafeContext||(s=sn("ctx"),this.helpers.add("capture"),this.define(s,"capture(ctx)"));let r=sn("comp");this.staticDefs.push({id:r,expr:"app.createComponent(null, false, true, false, false)"});const i=`${r}({target: ${Ye(t.target)},slots: {'default': {__render: ${o}.bind(this), __ctx: ${s}}}}, ${this.generateComponentKey()}, node, ctx, Portal)`;return n&&this.insertAnchor(n),n=this.createBlock(n,"multi",e),this.insertBlock(i,n,{...e,forceNewBlock:!1}),n.varName}}const pn=new WeakMap;function mn(t,e){var n;return function(t){let e=t.querySelectorAll("[t-elif], [t-else]");for(let t=0,n=e.length;t<n;t++){let n=e[t],o=n.previousElementSibling,s=t=>o.getAttribute(t),i=t=>+!!n.getAttribute(t);if(!o||!s("t-if")&&!s("t-elif"))throw new r("t-elif and t-else directives must be preceded by a t-if or t-elif directive");{if(s("t-foreach"))throw new r("t-if cannot stay at the same level as t-foreach when using t-elif or t-else");if(["t-if","t-elif","t-else"].map(i).reduce((function(t,e){return t+e}))>1)throw new r("Only one conditional branching directive is allowed per node");let t;for(;(t=n.previousSibling)!==o;){if(t.nodeValue.trim().length&&8!==t.nodeType)throw new r("text is not allowed between branching directives");t.remove()}}}}(n=t),function(t){for(const e of["t-esc","t-out"]){const n=[...t.querySelectorAll(`[${e}]`)].filter((t=>t.tagName[0]===t.tagName[0].toUpperCase()||t.hasAttribute("t-component")));for(const t of n){if(t.childNodes.length)throw new r(`Cannot have ${e} on a component that already has content`);const n=t.getAttribute(e);t.removeAttribute(e);const o=t.ownerDocument.createElement("t");null!=n&&o.setAttribute(e,n),t.appendChild(o)}}}(n),gn(t,e)||{type:0,value:""}}function gn(t,e){return t instanceof Element?function(t,e){if(!e.customDirectives)return null;const n=t.getAttributeNames();for(let o of n){if("t-custom"===o||"t-custom-"===o)throw new r("Missing custom directive name with t-custom directive");if(o.startsWith("t-custom-")){const n=o.split(".")[0].slice(9),s=e.customDirectives[n];if(!s)throw new r(`Custom directive "${n}" is not defined`);const i=t.getAttribute(o),l=o.split(".").slice(1);t.removeAttribute(o);try{s(t,i,l)}catch(t){throw new r(`Custom directive "${n}" throw the following error: ${t}`)}return gn(t,e)}}return null}(t,e)||function(t,e){if(t.hasAttribute("t-debug")){t.removeAttribute("t-debug");const n=gn(t,e),o={type:12,content:n};return(null==n?void 0:n.hasNoRepresentation)&&(o.hasNoRepresentation=!0),o}if(t.hasAttribute("t-log")){const n=t.getAttribute("t-log");t.removeAttribute("t-log");const o=gn(t,e),s={type:13,expr:n,content:o};return(null==o?void 0:o.hasNoRepresentation)&&(s.hasNoRepresentation=!0),s}return null}(t,e)||function(t,e){if(!t.hasAttribute("t-foreach"))return null;const n=t.outerHTML,o=t.getAttribute("t-foreach");t.removeAttribute("t-foreach");const s=t.getAttribute("t-as")||"";t.removeAttribute("t-as");const i=t.getAttribute("t-key");if(!i)throw new r(`"Directive t-foreach should always be used with a t-key!" (expression: t-foreach="${o}" t-as="${s}")`);t.removeAttribute("t-key");const l=t.getAttribute("t-memo")||"";t.removeAttribute("t-memo");const a=gn(t,e);if(!a)return null;const c=!n.includes("t-call"),h=c&&!n.includes(`${s}_first`),u=c&&!n.includes(`${s}_last`),d=c&&!n.includes(`${s}_index`),f=c&&!n.includes(`${s}_value`);return{type:9,collection:o,elem:s,body:a,memo:l,key:i,hasNoFirst:h,hasNoLast:u,hasNoIndex:d,hasNoValue:f}}(t,e)||function(t,e){if(!t.hasAttribute("t-if"))return null;const n=t.getAttribute("t-if");t.removeAttribute("t-if");const o=gn(t,e)||{type:0,value:""};let s=t.nextElementSibling;const r=[];for(;s&&s.hasAttribute("t-elif");){const t=s.getAttribute("t-elif");s.removeAttribute("t-elif");const n=gn(s,e),o=s.nextElementSibling;s.remove(),s=o,n&&r.push({condition:t,content:n})}let i=null;s&&s.hasAttribute("t-else")&&(s.removeAttribute("t-else"),i=gn(s,e),s.remove());return{type:5,condition:n,content:o,tElif:r.length?r:null,tElse:i}}(t,e)||function(t,e){if(!t.hasAttribute("t-portal"))return null;const n=t.getAttribute("t-portal");t.removeAttribute("t-portal");const o=gn(t,e);if(!o)return{type:0,value:""};return{type:18,target:n,content:o}}(t,e)||function(t,e){if(!t.hasAttribute("t-call"))return null;const n=t.getAttribute("t-call"),o=t.getAttribute("t-call-context");if(t.removeAttribute("t-call"),t.removeAttribute("t-call-context"),"t"!==t.tagName){const s=gn(t,e),r={type:7,name:n,body:null,context:o};if(s&&2===s.type)return s.content=[r],s;if(s&&11===s.type)return{...s,slots:{default:{content:r,scope:null,on:null,attrs:null,attrsTranslationCtx:null}}}}const s=kn(t,e);return{type:7,name:n,body:s.length?s:null,context:o}}(t,e)||function(t,e){if(!t.hasAttribute("t-call-block"))return null;const n=t.getAttribute("t-call-block");return{type:15,name:n}}(t)||function(t,e){if("off"!==t.getAttribute("t-translation"))return null;t.removeAttribute("t-translation");const n=gn(t,e);if(3===(null==n?void 0:n.type)){return Tn(n.content.map(xn))}return xn(n)}(t,e)||function(t,e){const n=t.getAttribute("t-translation-context");if(!n)return null;t.removeAttribute("t-translation-context");const o=gn(t,e);if(3===(null==o?void 0:o.type)){return Tn(o.content.map((t=>Nn(t,n))))}return Nn(o,n)}(t,e)||function(t,e){if(!t.hasAttribute("t-key"))return null;const n=t.getAttribute("t-key");t.removeAttribute("t-key");const o=gn(t,e);if(!o)return null;const s={type:10,expr:n,content:o};o.hasNoRepresentation&&(s.hasNoRepresentation=!0);return s}(t,e)||function(t,e){if(!t.hasAttribute("t-esc"))return null;const n=t.getAttribute("t-esc");t.removeAttribute("t-esc");const o={type:4,expr:n,defaultValue:t.textContent||""};let s=t.getAttribute("t-ref");t.removeAttribute("t-ref");const r=gn(t,e);if(!r)return o;if(2===r.type)return{...r,ref:s,content:[o]};return o}(t,e)||function(t,e){if(!t.hasAttribute("t-out")&&!t.hasAttribute("t-raw"))return null;t.hasAttribute("t-raw")&&console.warn('t-raw has been deprecated in favor of t-out. If the value to render is not wrapped by the "markup" function, it will be escaped');const n=t.getAttribute("t-out")||t.getAttribute("t-raw");t.removeAttribute("t-out"),t.removeAttribute("t-raw");const o={type:8,expr:n,body:null},s=t.getAttribute("t-ref");t.removeAttribute("t-ref");const r=gn(t,e);if(!r)return o;if(2===r.type)return o.body=r.content.length?r.content:null,{...r,ref:s,content:[o]};return o}(t,e)||function(t,e){if(!t.hasAttribute("t-slot"))return null;const n=t.getAttribute("t-slot");t.removeAttribute("t-slot");let o=null,s=null,r=null;for(let e of t.getAttributeNames()){const n=t.getAttribute(e);if(e.startsWith("t-on-"))r=r||{},r[e.slice(5)]=n;else if(e.startsWith("t-translation-context-")){s=s||{},s[e.slice(22)]=n}else o=o||{},o[e]=n}return{type:14,name:n,attrs:o,attrsTranslationCtx:s,on:r,defaultContent:En(t,e)}}(t,e)||function(t,e){let n=t.tagName;const o=n[0];let s=t.hasAttribute("t-component");if(s&&"t"!==n)throw new r(`Directive 't-component' can only be used on <t> nodes (used on a <${n}>)`);if(o!==o.toUpperCase()&&!s)return null;s&&(n=t.getAttribute("t-component"),t.removeAttribute("t-component"));const i=t.getAttribute("t-props");t.removeAttribute("t-props");const l=t.getAttribute("t-slot-scope");t.removeAttribute("t-slot-scope");let a=null,c=null,h=null;for(let e of t.getAttributeNames()){const n=t.getAttribute(e);if(e.startsWith("t-translation-context-")){h=h||{},h[e.slice(22)]=n}else if(e.startsWith("t-")){if(!e.startsWith("t-on-")){const t=$n.get(e.split("-").slice(0,2).join("-"));throw new r(t||`unsupported directive on Component: ${e}`)}a=a||{},a[e.slice(5)]=n}else c=c||{},c[e]=n}let u=null;if(t.hasChildNodes()){const n=t.cloneNode(!0),o=Array.from(n.querySelectorAll("[t-set-slot]"));for(let t of o){if("t"!==t.tagName)throw new r(`Directive 't-set-slot' can only be used on <t> nodes (used on a <${t.tagName}>)`);const o=t.getAttribute("t-set-slot");let s=t.parentElement,i=!1;for(;s&&s!==n;){if(s.hasAttribute("t-component")||s.tagName[0]===s.tagName[0].toUpperCase()){i=!0;break}s=s.parentElement}if(i||!s)continue;t.removeAttribute("t-set-slot"),t.remove();const l=gn(t,e);let a=null,c=null,h=null,d=null;for(let e of t.getAttributeNames()){const n=t.getAttribute(e);if("t-slot-scope"!==e)if(e.startsWith("t-translation-context-")){h=h||{},h[e.slice(22)]=n}else e.startsWith("t-on-")?(a=a||{},a[e.slice(5)]=n):(c=c||{},c[e]=n);else d=n}u=u||{},u[o]={content:l,on:a,attrs:c,attrsTranslationCtx:h,scope:d}}const s=En(n,e);u=u||{},s&&!u.default&&(u.default={content:s,on:a,attrs:null,attrsTranslationCtx:null,scope:l})}return{type:11,name:n,isDynamic:s,dynamicProps:i,props:c,propsTranslationCtx:h,slots:u,on:a}}(t,e)||function(t,e){const{tagName:n}=t,o=t.getAttribute("t-tag");if(t.removeAttribute("t-tag"),"t"===n&&!o)return null;if(n.startsWith("block-"))throw new r(`Invalid tag name: '${n}'`);e=Object.assign({},e),"pre"===n&&(e.inPreTag=!0);let s=!e.nameSpace&&wn.has(n)?"http://www.w3.org/2000/svg":null;const i=t.getAttribute("t-ref");t.removeAttribute("t-ref");const l=t.getAttributeNames();let a=null,c=null,h=null,u=null;for(let o of l){const i=t.getAttribute(o);if("t-on"===o||"t-on-"===o)throw new r("Missing event name with t-on directive");if(o.startsWith("t-on-"))h=h||{},h[o.slice(5)]=i;else if(o.startsWith("t-model")){if(!["input","select","textarea"].includes(n))throw new r("The t-model directive only works with <input>, <textarea> and <select>");let s,l;if(vn.test(i)){const t=i.lastIndexOf(".");s=i.slice(0,t),l=`'${i.slice(t+1)}'`}else{if(!yn.test(i))throw new r(`Invalid t-model expression: "${i}" (it should be assignable)`);{const t=i.lastIndexOf("[");s=i.slice(0,t),l=i.slice(t+1,-1)}}const a=t.getAttribute("type"),c="input"===n,h="select"===n,d=c&&"checkbox"===a,f=c&&"radio"===a,p=o.includes(".trim"),m=p||o.includes(".lazy");u={baseExpr:s,expr:l,targetAttr:d?"checked":"value",specialInitTargetAttr:f?"checked":null,eventType:f?"click":h||m?"change":"input",hasDynamicChildren:!1,shouldTrim:p,shouldNumberize:o.includes(".number")},h&&((e=Object.assign({},e)).tModelInfo=u)}else{if(o.startsWith("block-"))throw new r(`Invalid attribute: '${o}'`);if("xmlns"===o)s=i;else if(o.startsWith("t-translation-context-")){c=c||{},c[o.slice(22)]=i}else if("t-name"!==o){if(o.startsWith("t-")&&!o.startsWith("t-att"))throw new r(`Unknown QWeb directive: '${o}'`);const t=e.tModelInfo;t&&["t-att-value","t-attf-value"].includes(o)&&(t.hasDynamicChildren=!0),a=a||{},a[o]=i}}}s&&(e.nameSpace=s);const d=kn(t,e);return{type:2,tag:n,dynamicTag:o,attrs:a,attrsTranslationCtx:c,on:h,ref:i,content:d,model:u,ns:s}}(t,e)||function(t,e){if(!t.hasAttribute("t-set"))return null;const n=t.getAttribute("t-set"),o=t.getAttribute("t-value")||null,s=t.innerHTML===t.textContent&&t.textContent||null;let r=null;t.textContent!==t.innerHTML&&(r=kn(t,e));return{type:6,name:n,value:o,defaultValue:s,body:r,hasNoRepresentation:!0}}(t,e)||function(t,e){if("t"!==t.tagName)return null;return En(t,e)}(t,e):function(t,e){if(t.nodeType===Node.TEXT_NODE){let n=t.textContent||"";return e.inPreTag||!bn.test(n)||n.trim()?{type:0,value:n}:null}if(t.nodeType===Node.COMMENT_NODE)return{type:1,value:t.textContent||""};return null}(t,e)}const bn=/[\r\n]/;const vn=/\.[\w_]+\s*$/,yn=/\[[^\[]+\]\s*$/,wn=new Set(["svg","g","path"]);const $n=new Map([["t-ref","t-ref is no longer supported on components. Consider exposing only the public part of the component's API through a callback prop."],["t-att","t-att makes no sense on component: props are already treated as expressions"],["t-attf","t-attf is not supported on components: use template strings for string interpolation in props"]]);function xn(t){const e={type:16,content:t};return(null==t?void 0:t.hasNoRepresentation)&&(e.hasNoRepresentation=!0),e}function Nn(t,e){const n={type:17,content:t,translationCtx:e};return(null==t?void 0:t.hasNoRepresentation)&&(n.hasNoRepresentation=!0),n}function kn(t,e){const n=[];for(let o of t.childNodes){const t=gn(o,e);t&&(3===t.type?n.push(...t.content):n.push(t))}return n}function Tn(t){const e={type:3,content:t};return t.every((t=>t.hasNoRepresentation))&&(e.hasNoRepresentation=!0),e}function En(t,e){const n=kn(t,e);switch(n.length){case 0:return null;case 1:return n[0];default:return Tn(n)}}function An(t,e={hasGlobalValues:!1}){const n=function(t,e){const n={inPreTag:!1,customDirectives:e};if("string"==typeof t)return mn(Pe(`<t>${t}</t>`).firstChild,n);let o=pn.get(t);return o||(o=mn(t.cloneNode(!0),n),pn.set(t,o)),o}(t,e.customDirectives),o=t instanceof Node?!(t instanceof Element)||null===t.querySelector("[t-set], [t-call]"):!t.includes("t-set")&&!t.includes("t-call"),s=new fn(n,{...e,hasSafeContext:o}).generateCode();try{return new Function("app, bdom, helpers",s)}catch(t){const{name:n}=e,o=new r(`Failed to compile ${n?`template "${n}"`:"anonymous template"}: ${t.message}\n\ngenerated code:\nfunction(app, bdom, helpers) {\n${s}\n}`);throw o.cause=t,o}}let _n;"undefined"!=typeof window&&(_n=window.requestAnimationFrame.bind(window));class Cn{constructor(){this.tasks=new Set,this.frame=0,this.delayedRenders=[],this.cancelledNodes=new Set,this.processing=!1,this.requestAnimationFrame=Cn.requestAnimationFrame}addFiber(t){this.tasks.add(t.root)}scheduleDestroy(t){this.cancelledNodes.add(t),0===this.frame&&(this.frame=this.requestAnimationFrame((()=>this.processTasks())))}flush(){if(this.delayedRenders.length){let t=this.delayedRenders;this.delayedRenders=[];for(let e of t)e.root&&3!==e.node.status&&e.node.fiber===e&&e.render()}0===this.frame&&(this.frame=this.requestAnimationFrame((()=>this.processTasks())))}processTasks(){if(!this.processing){this.processing=!0,this.frame=0;for(let t of this.cancelledNodes)t._destroy();this.cancelledNodes.clear();for(let t of this.tasks)this.processFiber(t);for(let t of this.tasks)3===t.node.status&&this.tasks.delete(t);this.processing=!1}}processFiber(t){if(t.root!==t)return void this.tasks.delete(t);const e=xt.has(t);e&&0!==t.counter?this.tasks.delete(t):3!==t.node.status?0===t.counter&&(e||t.complete(),t.appliedToDom&&this.tasks.delete(t)):this.tasks.delete(t)}}Cn.requestAnimationFrame=_n;let Dn=!1;const Sn=new Set;"undefined"!=typeof window&&(window.__OWL_DEVTOOLS__||(window.__OWL_DEVTOOLS__={apps:Sn,Fiber:_t,RootFiber:Ct,toRaw:Ft,reactive:Yt}));class On extends Me{constructor(t,e={}){super(e),this.scheduler=new Cn,this.subRoots=new Set,this.root=null,this.name=e.name||"",this.Root=t,Sn.add(this),e.test&&(this.dev=!0),this.warnIfNoStaticProps=e.warnIfNoStaticProps||!1,!this.dev||e.test||Dn||(console.info("Owl is running in 'dev' mode."),Dn=!0);const n=e.env||{},o=Object.getOwnPropertyDescriptors(n);this.env=Object.freeze(Object.create(Object.getPrototypeOf(n),o)),this.props=e.props||{}}mount(t,e){const n=this.createRoot(this.Root,{props:this.props});return this.root=n.node,this.subRoots.delete(n.node),n.mount(t,e)}createRoot(t,e={}){const n=e.props||{},o=this.env;e.env&&(this.env=e.env);const s=function(){let t=se;return()=>{se=t}}(),r=this.makeNode(t,n);return s(),e.env&&(this.env=o),this.subRoots.add(r),{node:r,mount:(e,o)=>{On.validateTarget(e),this.dev&&Le(t,n,{__owl__:{app:this}});return this.mountNode(r,e,o)},destroy:()=>{this.subRoots.delete(r),r.destroy(),this.scheduler.processTasks()}}}makeNode(t,e){return new ue(t,e,this,null,null)}mountNode(t,e,n){const o=new Promise(((e,n)=>{let o=!1;t.mounted.push((()=>{e(t.component),o=!0}));let s=Nt.get(t);s||(s=[],Nt.set(t,s)),s.unshift((t=>{throw o||n(t),t}))}));return t.mountComponent(e,n),o}destroy(){if(this.root){for(let t of this.subRoots)t.destroy();this.root.destroy(),this.scheduler.processTasks()}Sn.delete(this)}createComponent(t,e,n,o,s){const i=!e;let l;const a=0===s.length;l=n?(t,e)=>!0:o?function(t,e){for(let n in t)if(t[n]!==e[n])return!0;return Object.keys(t).length!==Object.keys(e).length}:a?(t,e)=>!1:function(t,e){for(let n of s)if(t[n]!==e[n])return!0;return!1};const c=ue.prototype.updateAndRender,h=ue.prototype.initiateRender;return(n,o,s,a,u)=>{let d=s.children,f=d[o];i&&f&&f.component.constructor!==u&&(f=void 0);const p=s.fiber;if(f)(l(f.props,n)||p.deep||f.forceNextRender)&&(f.forceNextRender=!1,c.call(f,n,p));else{if(e){const e=a.constructor.components;if(!e)throw new r(`Cannot find the definition of component "${t}", missing static components key in parent`);if(!(u=e[t]))throw new r(`Cannot find the definition of component "${t}"`);if(!(u.prototype instanceof ve))throw new r(`"${t}" is not a Component. It must inherit from the Component class`)}f=new ue(u,n,this,s,o),d[o]=f,h.call(f,new _t(f,p))}return p.childrenMap[o]=f,f}}handleError(...t){return Tt(...t)}}On.validateTarget=function(t){const e=t&&t.ownerDocument;if(e){if(!e.defaultView)throw new r("Cannot mount a component: the target document is not attached to a window (defaultView is missing)");if(t instanceof e.defaultView.HTMLElement||t instanceof ShadowRoot){if(!function(t,e){let n=t;const o=e.defaultView.ShadowRoot;for(;n;){if(n===e)return!0;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof o&&n.host))return!1;n=n.host}}return!1}(t,e))throw new r("Cannot mount a component on a detached dom node");return}}throw new r("Cannot mount component: the target is not a valid DOM element")},On.apps=Sn,On.version="2.8.3";function Rn(t,e){const n=Object.create(t),o=Object.getOwnPropertyDescriptors(e);return Object.freeze(Object.defineProperties(n,o))}function Ln(t){const e=re();e.childEnv=Rn(e.childEnv,t)}n.shouldNormalizeDom=!1,n.mainEventHandler=(t,n,o)=>{const{data:s,modifiers:i}=e(t);t=s;let l=!1;if(i.length){let t=!1;const e=n.target===o;for(const o of i)switch(o){case"self":if(t=!0,e)continue;return l;case"prevent":(t&&e||!t)&&n.preventDefault();continue;case"stop":(t&&e||!t)&&n.stopPropagation(),l=!0;continue}}if(Object.hasOwnProperty.call(t,0)){const e=t[0];if("function"!=typeof e)throw new r(`Invalid handler (expected a function, received: '${e}')`);let o=t[1]?t[1].__owl__:null;o&&1!==o.status||e.call(o?o.component:null,n)}return l};const Bn={config:n,mount:$t,patch:function(t,e,n=!1){t.patch(e,n)},remove:function(t,e=!1){e&&t.beforeRemove(),t.remove()},list:bt,multi:j,text:z,toggler:s,createBlock:nt,html:wt,comment:H},Pn={version:On.version};Me.prototype._compileTemplate=function(t,e){return An(e,{name:t,dev:this.dev,translateFn:this.translateFn,translatableAttributes:this.translatableAttributes,customDirectives:this.customDirectives,hasGlobalValues:this.hasGlobalValues})},t.App=On,t.Component=ve,t.EventBus=N,t.OwlError=r,t.__info__=Pn,t.batched=$,t.blockDom=Bn,t.htmlEscape=T,t.loadFile=async function(t){const e=await fetch(t);if(!e.ok)throw new r("Error while fetching xml templates");return await e.text()},t.markRaw=Vt,t.markup=E,t.mount=async function(t,e,n={}){return new On(t,n).mount(e,n)},t.onError=function(t){const e=re();let n=Nt.get(e);n||(n=[],Nt.set(e,n)),n.push(t.bind(e.component))},t.onMounted=me,t.onPatched=ge,t.onRendered=function(t){const e=re(),n=e.renderFn,o=e.app.dev?pe:t=>t;t=o(t.bind(e.component),"onRendered"),e.renderFn=()=>{const e=n();return t(),e}},t.onWillDestroy=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willDestroy.push(n(t.bind(e.component),"onWillDestroy"))},t.onWillPatch=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willPatch.unshift(n(t.bind(e.component),"onWillPatch"))},t.onWillRender=function(t){const e=re(),n=e.renderFn,o=e.app.dev?pe:t=>t;t=o(t.bind(e.component),"onWillRender"),e.renderFn=()=>(t(),n())},t.onWillStart=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willStart.push(n(t.bind(e.component),"onWillStart"))},t.onWillUnmount=be,t.onWillUpdateProps=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willUpdateProps.push(n(t.bind(e.component),"onWillUpdateProps"))},t.reactive=Yt,t.status=function(t){switch(t.__owl__.status){case 0:return"new";case 2:return"cancelled";case 1:return"mounted";case 3:return"destroyed"}},t.toRaw=Ft,t.useChildSubEnv=Ln,t.useComponent=function(){return se.component},t.useEffect=function(t,e=(()=>[NaN])){let n,o;me((()=>{o=e(),n=t(...o)})),ge((()=>{const s=e();s.some(((t,e)=>t!==o[e]))&&(o=s,n&&n(),n=t(...o))})),be((()=>n&&n()))},t.useEnv=function(){return re().component.env},t.useExternalListener=function(t,e,n,o){const s=re(),r=n.bind(s.component);me((()=>t.addEventListener(e,r,o))),be((()=>t.removeEventListener(e,r,o)))},t.useRef=function(t){const e=re().refs;return{get el(){const n=e[t];return x(n)?n:null}}},t.useState=ae,t.useSubEnv=function(t){const e=re();e.component.env=Rn(e.component.env,t),Ln(t)},t.validate=function(t,e){let n=_e(t,e);if(n.length)throw new r("Invalid object: "+n.join(", "))},t.validateType=Ce,t.whenReady=function(t){return new Promise((function(t){"loading"!==document.readyState?t(!0):document.addEventListener("DOMContentLoaded",t,!1)})).then(t||function(){})},t.xml=We,Object.defineProperty(t,"__esModule",{value:!0}),Pn.date="2026-03-30T13:05:32.099Z",Pn.hash="efae3e4",Pn.url="https://github.com/odoo/owl"}(globalThis.owl=globalThis.owl||{});
|
|
9
9
|
|
|
10
|
-
var ba=Object.defineProperty;var Ln=(t,e,s)=>e in t?ba(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var St=(t,e,s)=>()=>{if(s)throw s[0];try{return t&&(e=t(t=0)),e}catch(o){throw s=[o],o}};var ha=(t,e)=>{for(var s in e)ba(t,s,{get:e[s],enumerable:!0})};var r=(t,e,s)=>Ln(t,typeof e!="symbol"?e+"":e,s);function On(t){return typeof t=="string"?document.querySelector(t):t instanceof Element?t:null}function Bi(t,e,s={}){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}function Tn(t,e={}){return t.hasAttribute("b-icon")?"icon":e.name||t.getAttribute("b-ui")}function Bn(t,e){return e===document||e===t||e.contains(t)}function In(t,e={}){return!e.allowBootstrapControl&&t.matches(Nn)}function fa(t){return b.version=t,b}function ma(){if(typeof MutationObserver>"u")return;let t=new MutationObserver(e=>{for(let s of e)for(let o of s.addedNodes)o instanceof Element&&b.mountAll(o)});return t.observe(document.documentElement,{childList:!0,subtree:!0}),t}function ga(){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{b.mountAll(),ma()},{once:!0}):(b.mountAll(),ma()))}var kn,Ti,Wr,oi,Nn,Ii,b,E=St(()=>{kn="__BASEUI_VERSION__",Ti=new Map,Wr=new WeakMap,oi="[b-ui], [b-icon]",Nn="[data-bs-toggle], [data-bs-target], [data-bs-dismiss]";Ii=typeof window<"u"?window.thebase:void 0,b=Ii?.register?Ii:Object.assign(Ii||{},{version:kn,register(t,e){if(!t||!e)throw new Error("BaseUI.register requires a name and component definition.");return Ti.set(t,e),this},component(t){return Ti.get(t)},mount(t,e={}){let s=On(t);if(!s||In(s,e))return null;let o=Tn(s,e),a=Ti.get(o);if(!a)return null;let n=Wr.get(s);if(n?.name===o)return n;n&&(n.destroy?.(),Wr.delete(s),Bi(s,"baseui:destroyed",{name:n.name}));let u=a.mount?.(s,this,e)||{},p={name:o,element:s,destroy:u.destroy};return Wr.set(s,p),Bi(s,"baseui:mounted",{name:o,instance:p}),p},mountAll(t=document){let e=t||document,s=[...e.querySelectorAll?.(oi)||[]];return e instanceof Element&&e.matches(oi)&&s.unshift(e),s.map(o=>this.mount(o)).filter(Boolean)},destroy(t=document){let e=t||document,s=[...e.querySelectorAll?.(oi)||[]];e instanceof Element&&e.matches(oi)&&s.unshift(e);for(let o of s){let a=Wr.get(o);a&&Bn(o,e)&&(a.destroy?.(),Wr.delete(o),Bi(o,"baseui:destroyed",{name:a.name}))}},theme:{set(t){let e=document.documentElement;if(typeof t=="string"){e.setAttribute("b-theme",t),e.dataset.bsTheme=t;return}for(let[s,o]of Object.entries(t||{})){let a=s==="radius"||s==="--b-radius"?"--base-radius":s.startsWith("--")?s:`--b-${s}`;e.style.setProperty(a,o)}}}});typeof window<"u"&&(window.thebase=b,window.BaseUI=b)});function m(...t){let e=[];for(let s of t)if(s){if(typeof s=="string")e.push(s);else if(Array.isArray(s)){let o=m(...s);o&&e.push(o)}else if(typeof s=="object")for(let[o,a]of Object.entries(s))a&&e.push(o)}return e.join(" ")}function i(t){return{type:t,optional:!0}}function Z(t,e,s){return t[e]??(s?t[s]:void 0)}function _(t){return t===!0||t==="open"||t==="on"||t==="active"}function H(...t){let e=[];for(let s of t)if(s){if(typeof s=="string"){let o=s.trim().replace(/;$/,"");o&&e.push(o)}else if(typeof s=="object")for(let[o,a]of Object.entries(s)){if(a==null||a==="")continue;let n=o.replace(/[A-Z]/g,u=>"-"+u.toLowerCase());e.push(`${n}:${a}`)}}return e.join(";")}function j(t){return t.state!==void 0?_(t.state):t.open!==void 0?t.open:t["default-open"]!==void 0?t["default-open"]:t.defaultOpen??!1}function re(t){return t.state!==void 0||t.open!==void 0}var l,y=St(()=>{l={className:i(String),style:i([String,Object]),slots:i(Object)}});var I,$n,ya,Un,Pn,qn,Mn,jn,zn,ie,_n,Ri,$i,Dn,U,W,Fn,ae,Hn,Wn,nt,P,V,Vn,Kn,Gn,N,Zn,st,Jn,rs,L,w,Xn,Yn,Qn,tc,ri,Ui=St(()=>{I=globalThis.owl;if(!I)throw new Error("BaseUI: load dist/baseui.min.js or dist/baseui.esm.js before this script (globalThis.owl is not set).");$n=I.App,ya=I.Component,Un=I.EventBus,Pn=I.OwlError,qn=I.__info__,Mn=I.batched,jn=I.blockDom,zn=I.htmlEscape,ie=I.loadFile,_n=I.markRaw,Ri=I.markup,$i=I.mount,Dn=I.onError,U=I.onMounted,W=I.onPatched,Fn=I.onRendered,ae=I.onWillDestroy,Hn=I.onWillPatch,Wn=I.onWillRender,nt=I.onWillStart,P=I.onWillUnmount,V=I.onWillUpdateProps,Vn=I.reactive,Kn=I.status,Gn=I.toRaw,N=I.useChildSubEnv,Zn=I.useComponent,st=I.useEffect,Jn=I.useEnv,rs=I.useExternalListener,L=I.useRef,w=I.useState,Xn=I.useSubEnv,Yn=I.validate,Qn=I.validateType,tc=I.whenReady,ri=I.xml});function xa(t){Object.assign(Vr,t)}function ec(t){let e=t.components;e?e!==Vr&&Object.getPrototypeOf(e)===Object.prototype&&Object.setPrototypeOf(e,Vr):t.components=Object.create(Vr)}function Sa(t){return typeof t!="string"||!/\st-(att|attf|model)([.\s=-]|$)/.test(t)?t:t.replace(/<([A-Z][\w.:-]*)(\s[^<>]*?)?(\/?)>/g,(e,s,o="",a="")=>`<${s}${sc(s,o)}${a}>`)}function sc(t,e){let s=/\st-(att|attf|model|on)([.\s=-]|$)/.test(e),o=e.replace(/(\s)t-att\s*=/g,"$1t-props=").replace(/(\s)t-att-([A-Za-z_][\w:.-]*)\s*=/g,"$1$2=").replace(/(\s)t-attf-([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(a,n,u,p,d)=>`${n}${u}=${p}${ac(d)}${p}`);return o=o.replace(/(\s)t-model((?:\.[\w-]+)*)\s*=\s*(["'])(.*?)\3/g,(a,n,u,p,d)=>nc(t,n,u,p,d,o)),s?oc(o):o}function oc(t){return t.replace(/(\s)([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(e,s,o,a,n)=>o.startsWith("t-")||o==="t-props"||ic(n)?e:`${s}${o}=${a}${rc(n)}${a}`)}function rc(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function ic(t){let e=t.trim();return!e||/^(['"`[{(]|-?\d+(?:\.\d+)?$)/.test(e)||/[?.()[\]+*/]|=>|===|!==|&&|\|\|/.test(e)||/^(true|false|null|undefined)$/.test(e)}function ac(t){return`\`${t.replace(/`/g,"\\`").replace(/{{\s*([\s\S]*?)\s*}}|#\{\s*([\s\S]*?)\s*\}/g,(e,s,o)=>`\${${s||o}}`)}\``}function nc(t,e,s,o,a,n){let u=/^(Checkbox|Switch)$/.test(t),p=cc(t,s),d=u?"checked":"value",h=new RegExp(`\\s${d}\\s*=`).test(n)?"":`${e}${d}=${o}${a}${o}`,f=new RegExp(`\\s${p}\\s*=`).test(n)?"":`${e}${p}=${o}${uc(a,s,u)}${o}`;return`${h}${f}`}function cc(t,e){return e.includes(".lazy")?"onChange":/^(Input|Textarea|InputGroupInput|InputGroupTextarea)$/.test(t)?"onInput":"onChange"}function uc(t,e,s){if(s)return`(value) => { ${t} = value; }`;let o="value";return e.includes(".trim")&&(o=`(typeof ${o} === 'string' ? ${o}.trim() : ${o})`),e.includes(".number")&&(o=`Number.isNaN(Number(${o})) ? ${o} : Number(${o})`),`(value) => { ${t} = ${o}; }`}function wa(t,...e){return Array.isArray(t?.raw)?ri({raw:t.raw.map(Sa)},...e):ri(t,...e)}function is(t,e,s={}){let o=Sa(s.templates);return t.components={...Vr,...t.components||{}},$i(t,e,o===s.templates?s:{...s,templates:o})}async function cd(t){let e=await(await fetch(t,{cache:"reload"})).text(),o=new DOMParser().parseFromString(e,"application/xml").querySelector("templates > t[t-name]");return o?o.innerHTML:e}var ad,nd,Vr,c,S=St(()=>{Ui();Ui();ad=$i,nd=ri,Vr={};c=class extends ya{constructor(...e){super(...e),ec(this.constructor)}}});function dc(t){return typeof Image>"u"?Promise.resolve(!0):(Pi.has(t)||Pi.set(t,new Promise(e=>{let s=new Image;s.onload=()=>e(!0),s.onerror=()=>e(!1),s.src=t})),Pi.get(t))}function ii(t){return String(t||"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function Kr(t,e={}){let s=ii(t);if(!pc.test(s))throw new Error(`BaseUI icon name is invalid: ${t}`);return`${String(e.baseUrl||b.icons.lucide.cdnBaseUrl).replace(/\/+$/,"")}/${s}.svg`}function z(t,e,s={}){let o=s.url||Kr(e,s),a=s.label??t.getAttribute("aria-label")??"";t.classList.add("bu-icon"),t.style.setProperty("--b-icon-url",`url("${o.replace(/"/g,"%22")}")`),(s.size||t.getAttribute("b-att-size"))&&t.style.setProperty("--b-icon-size",s.size||t.getAttribute("b-att-size")),a?(t.setAttribute("role","img"),t.setAttribute("aria-label",a)):t.setAttribute("aria-hidden","true");let n=s.fallback===!1?null:s.fallback||ai;return n&&!s.url&&ii(e)!==ii(n)&&dc(o).then(u=>{if(u||!t.isConnected)return;let p=Kr(n,s);t.style.setProperty("--b-icon-url",`url("${p.replace(/"/g,"%22")}")`)}),t}var Aa,lc,ai,pc,Pi,it=St(()=>{E();Aa="1.31.0",lc=`https://cdn.jsdelivr.net/npm/lucide-static@${Aa}/icons`,ai="file",pc=/^[a-z0-9][a-z0-9-]*$/,Pi=new Map;b.icons={...b.icons||{},lucide:{version:Aa,cdnBaseUrl:lc,normalizeName:ii,url:Kr,render:z}}});var K,J,as=St(()=>{K={default:"btn-primary",secondary:"btn-secondary",destructive:"btn-danger",outline:"btn-outline-secondary",ghost:"btn-light",link:"btn-link"},J={xs:"btn-xs",sm:"btn-sm",lg:"btn-lg",icon:"btn-icon","icon-xs":"btn-icon-xs","icon-sm":"btn-icon-sm","icon-lg":"btn-icon-lg"}});function ni({variant:t="default",size:e,className:s}={}){return m("btn","bu-button","bu-clipboard-button",K[t]||K.default,J[e],s)}async function ns(t){let e=String(t??"");if(globalThis.navigator?.clipboard?.writeText)try{await globalThis.navigator.clipboard.writeText(e);return}catch{}if(typeof document>"u")throw new Error("BaseUI ClipboardButton: no clipboard API available in this environment.");let s=document.createElement("textarea");s.value=e,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",s.style.pointerEvents="none",document.body.append(s),s.select(),s.setSelectionRange(0,e.length);let o;try{o=document.execCommand("copy")}catch{o=!1}if(s.remove(),!o)throw new Error("BaseUI ClipboardButton: clipboard copy is unavailable in this browser/context.")}var qi,ci=St(()=>{y();as();qi=["btn","bu-button","bu-clipboard-button",...Object.values(K),...Object.values(J)]});var Fa={};ha(Fa,{destroyBaseUiPreviews:()=>Rr,enhanceMarkdownDiagrams:()=>Jr,expandSelfClosingTags:()=>Qc,extractTagCaseMap:()=>Mc,mountMarkdownEditor:()=>Xr,normalizeOwlPreviewMarkup:()=>eu,parseMarkdown:()=>Zr,primeBaseUiTemplates:()=>su,renderBaseUiBlocks:()=>Da,renderMermaidBlocks:()=>za});function Ic(){return Di??(Di=import("./runtime/marked/marked.min.js").then(t=>{let e=t.marked||t.default?.marked||globalThis.marked;if(!e?.parse)throw new Error("BaseUI markdown: failed to load src/runtime/marked/marked.min.js");return e})),Di}function Rc(t){let e=t.closest("[data-bs-theme]")?.getAttribute("data-bs-theme")||document.documentElement.getAttribute("data-bs-theme");return(e?e==="dark":window.matchMedia?.("(prefers-color-scheme: dark)").matches)?"dark":"default"}function $c(){return Fi??(Fi=import("./runtime/mermaid/mermaid.esm.min.mjs").then(t=>{let e=t.default||t;return e.initialize({startOnLoad:!1,securityLevel:"strict"}),e})),Fi}function Uc(){return Hi??(Hi=import("./runtime/milkdown/milkdown-editor.js")),Hi}async function Zr(t,e={}){return(await Ic()).parse(String(t??""),{gfm:!0,breaks:!1,...e})}function Vi(t,e,s,o=""){t.classList.add("bu-markdown-diagram-error"),t.replaceChildren();let a=document.createElement("p");if(a.className="bu-markdown-diagram-error-message",a.textContent=`Unable to render ${e} diagram: ${s?.message||s}`,t.append(a),o){let n=document.createElement("pre"),u=document.createElement("code");u.textContent=o,n.append(u),t.append(n)}}async function za(t){let e=[...t.querySelectorAll("pre > code.language-mermaid")];if(!e.length)return;let s;try{s=await $c()}catch(o){e.forEach(a=>{let n=a.closest("pre");n.replaceChildren(),n.className="bu-markdown-diagram bu-markdown-mermaid",Vi(n,"mermaid",o,a.textContent)});return}s.initialize({startOnLoad:!1,securityLevel:"strict",theme:Rc(t)});for(let o of e){let a=o.textContent,n=o.closest("pre");n.replaceChildren(),n.className="bu-markdown-diagram bu-markdown-mermaid";try{let{svg:u}=await s.render(`bu-mermaid-${++Bc}`,a);n.innerHTML=u}catch(u){Vi(n,"mermaid",u,a)}}}function Pc(t){let e=globalThis.thebase;if(!e?.mountAll)return;let s=document.createElement("div");s.setAttribute("b-ui","toast"),s.setAttribute("b-att-state","open"),s.setAttribute("b-att-delay","2000"),s.className="bu-markdown-bu-copy-toast",s.textContent=t,document.body.append(s),e.mountAll(s),s.addEventListener("baseui:close",()=>s.remove(),{once:!0})}function qc(t){let e=document.createElement("div");e.className="bu-markdown-bu-code";let s=document.createElement("button");s.type="button",s.className="bu-markdown-bu-copy";let o=document.createElement("span");z(o,"copy",{label:"Copy code"}),s.append(o),s.addEventListener("click",async()=>{try{await ns(t),s.dispatchEvent(new CustomEvent("baseui:markdown-copy",{bubbles:!0,detail:{source:t}})),Pc("Copied to clipboard")}catch(u){s.dispatchEvent(new CustomEvent("baseui:markdown-copy-error",{bubbles:!0,detail:{error:u}}))}}),e.append(s);let a=document.createElement("pre"),n=document.createElement("code");n.className="bu-markdown-bu-code-lines";for(let u of t.replace(/\n$/,"").split(`
|
|
11
|
-
`)){let p=document.createElement("span");p.className="bu-markdown-bu-code-line",p.textContent=u,n.append(p)}return a.append(n),e.append(a),e}function Pa(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Mc(t){let e=new Map;for(let s of t.matchAll(/<\/?([A-Z][A-Za-z0-9]*)\b/g))e.set(s[1].toLowerCase(),s[1]);return e}function jc(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=globalThis.thebase,o=t.get(e.localName)||e.localName,a=Pa(o),n=!!s?.component?.(a),u=M(e.getAttribute("className")||e.getAttribute("class"));if(!n){let p=`bu-${a}`;return e.className=u?`${p} ${u}`:p,e}e.setAttribute("b-ui",a),u&&(e.className=u);for(let p of[...e.attributes]){if(p.name==="class"||p.name==="className"||p.name==="b-ui"||/^on[A-Z]/.test(p.name))continue;let d=M(p.value);e.removeAttribute(p.name),!(d===""||d==="false")&&e.setAttribute(`b-att-${Pa(p.name)}`,d==="true"?"true":d)}return e}}function M(t){if(!t)return"";let e=t.trim();return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function gi(t,e){for(;t.firstChild;)e.append(t.firstChild)}function rt(t,e){return gi(t,e),t.replaceWith(e),e}function zc(t){let e=document.createElement("div");e.setAttribute("b-field-group","");let s=M(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),rt(t,e)}function _c(t){let e=document.createElement("div");e.setAttribute("b-ui","field");let s=M(t.getAttribute("orientation")||""),o=M(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-orientation",s),o&&(e.className=o),rt(t,e)}function Dc(t){let e=document.createElement("label");e.setAttribute("b-field-label","");let s=M(t.getAttribute("for")||""),o=M(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("for",s),o&&(e.className=o),rt(t,e)}function qa(t,e,s){let o=document.createElement(e);o.setAttribute(s,"");let a=M(t.getAttribute("className")||t.getAttribute("class"));return a&&(o.className=a),rt(t,o)}function Fc(t){let e=t.getAttribute("type")||"",s=t.hasAttribute("variant")||t.hasAttribute("size")||t.hasAttribute("className")||t.hasAttribute("onClick")||t.hasAttribute("label")||e.trim().startsWith("'")||e.trim().startsWith('"');if(t.hasAttribute("b-ui")||!s)return t;let o=document.createElement("button");o.setAttribute("b-ui","button");let a=M(e||"button"),n=M(t.getAttribute("variant")||""),u=M(t.getAttribute("size")||""),p=M(t.getAttribute("className")||t.getAttribute("class")),d=M(t.getAttribute("label")||"");return o.type=a||"button",n&&o.setAttribute("b-att-variant",n),u&&o.setAttribute("b-att-size",u),p&&(o.className=p),d&&!t.childNodes.length&&(o.textContent=d),rt(t,o)}function Hc(t){if(t.hasAttribute("b-ui")||t.hasAttribute("b-icon"))return t;let e=M(t.getAttribute("name")||t.getAttribute("icon")||"");if(!e)return t;let s=document.createElement("span");s.setAttribute("b-ui","icon"),s.setAttribute("b-att-icon",e);let o=M(t.getAttribute("size")||""),a=M(t.getAttribute("label")||""),n=M(t.getAttribute("className")||t.getAttribute("class"));return o&&s.setAttribute("b-att-size",o),a&&s.setAttribute("b-att-label",a),n&&(s.className=n),rt(t,s)}function Wc(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","alert");let s=M(t.getAttribute("variant")||""),o=M(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-variant",s),o&&(e.className=o),rt(t,e)}function Wi(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=document.createElement("div"),o=M(e.getAttribute("className")||e.getAttribute("class"));return s.className=o?`${t} ${o}`:t,rt(e,s)}}function Vc(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","accordion"),M(t.getAttribute("multiple"))==="true"&&e.setAttribute("b-att-multiple","true");let s=M(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),rt(t,e)}function Kc(t){if(t.hasAttribute("b-accordion-item"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-item",""),M(t.getAttribute("state"))==="open"&&e.setAttribute("b-att-state","open");let s=M(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),rt(t,e)}function Gc(t){if(t.hasAttribute("b-accordion-trigger"))return t;let e=document.createElement("button");e.type="button",e.setAttribute("b-accordion-trigger","");let s=M(t.getAttribute("className")||t.getAttribute("class"));s&&(e.className=s),gi(t,e);let o=document.createElement("span");return o.setAttribute("b-icon","chevron-down"),o.className="bu-accordion-trigger-icon",e.append(o),t.replaceWith(e),e}function Zc(t){if(t.hasAttribute("b-accordion-panel"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-panel","");let s=M(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),rt(t,e)}function Jc(t){return Ma+=1,`${t}-${Ma}`}function ot(t,e,s){return o=>{if(o.hasAttribute("b-ui"))return o;let a=document.createElement(t);t==="button"&&(a.type="button"),s&&a.setAttribute(s,"");let n=M(o.getAttribute("className")||o.getAttribute("class"));return a.className=n?`${e} ${n}`:e,rt(o,a)}}function Xc(){let t=document.createElement("button");t.type="button",t.className="btn bu-button btn-light btn-icon-sm bu-dialog-close bu-dialog-close-control",t.setAttribute("b-dialog-close",""),t.setAttribute("aria-label","Close");let e=document.createElement("span");e.setAttribute("b-ui","icon"),e.setAttribute("b-att-icon","x");let s=document.createElement("span");return s.className="visually-hidden",s.textContent="Close",t.append(e,s),t}function ja({tagPrefix:t,componentName:e,triggerTag:s,triggerClassName:o,panelClassName:a,closeButton:n}){return u=>{if(u.hasAttribute("b-ui"))return u;let p=u.querySelector(`:scope > ${t}trigger`),d=u.querySelector(`:scope > ${t}content`);if(!d)return u;let h=Jc(`bu-preview-${e}`),f=document.createElement(s);s==="button"&&(f.type="button"),f.className=o,f.setAttribute("b-att-trigger",`#${h}`),p&&gi(p,f);let g=document.createElement("div");g.setAttribute("b-ui",e),g.id=h,g.setAttribute("b-att-trigger",`[b-att-trigger='#${h}']`);let C=document.createElement("div");C.className=a;let k=M(d.getAttribute("size")||"");return k&&C.setAttribute("data-size",k),gi(d,C),n&&C.append(n()),g.append(C),u.before(f,g),u.remove(),g}}function Qc(t){return t.replace(/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^"'>])*?)\/>/g,(e,s,o)=>Yc.has(s.toLowerCase())?e:`<${s}${o}></${s}>`)}function tu(t){t.querySelectorAll("t[t-esc]").forEach(e=>{let o=e.getAttribute("t-esc")?.includes(".length")?"0":"";e.replaceWith(document.createTextNode(`${o}${e.textContent||""}`))})}function eu(t,e){tu(t);let s={fieldgroup:zc,field:_c,fieldlabel:Dc,fielddescription:a=>qa(a,"p","b-field-description"),fielderror:a=>qa(a,"p","b-field-error"),button:Fc,icon:Hc,alert:Wc,alerttitle:Wi("bu-alert-title"),alertdescription:Wi("bu-alert-description"),alertaction:Wi("bu-alert-action"),accordion:Vc,accordionitem:Kc,accordiontrigger:Gc,accordioncontent:Zc,dialog:ja({tagPrefix:"dialog",componentName:"dialog",triggerTag:"span",triggerClassName:"bu-dialog-trigger",panelClassName:"bu-dialog-panel",closeButton:Xc}),dialogheader:ot("div","bu-dialog-header"),dialogfooter:ot("div","bu-dialog-footer"),dialogtitle:ot("h2","bu-dialog-title"),dialogdescription:ot("p","bu-dialog-description"),dialogclose:ot("button","btn bu-button btn-outline-secondary bu-dialog-close","b-dialog-close"),alertdialog:ja({tagPrefix:"alertdialog",componentName:"alert-dialog",triggerTag:"button",triggerClassName:"btn bu-button btn-outline-secondary bu-alert-dialog-trigger",panelClassName:"bu-dialog-panel bu-alert-dialog-panel"}),alertdialogheader:ot("div","bu-dialog-header bu-alert-dialog-header"),alertdialogfooter:ot("div","bu-dialog-footer bu-alert-dialog-footer"),alertdialogmedia:ot("div","bu-alert-dialog-media"),alertdialogtitle:ot("h2","bu-dialog-title bu-alert-dialog-title"),alertdialogdescription:ot("p","bu-dialog-description bu-alert-dialog-description"),alertdialogcancel:ot("button","btn bu-button btn-outline-secondary bu-alert-dialog-cancel","b-alert-dialog-cancel"),alertdialogaction:ot("button","btn bu-button btn-primary bu-alert-dialog-action","b-alert-dialog-action")},o=jc(e);for(let a of[...t.querySelectorAll("*")]){let n=a.localName.toLowerCase();s[n]?s[n](a):e.has(n)&&o(a)}}function su(t){fi=Promise.resolve(t)}function ou(){return fi??(fi=ie("/dist/baseui.templates.xml")),fi}function Rr(t){let e=Ki.get(t);if(e){Ki.delete(t);for(let s of e)try{s.destroy()}catch{}}}function iu(t){return new Set([...t.matchAll(ru)].map(e=>e[1]))}function cu(t){let e=new Set;for(let s of t.matchAll(au))e.add(s[1]);for(let s of t.matchAll(nu))e.add(s[2]);return e}function uu(t){let e=wa({raw:[t]}),s=iu(t);class o extends c{setup(){this.state=w(Object.fromEntries([...s].map(n=>[n,""])))}}r(o,"template",e);for(let a of cu(t))o.prototype[a]=function(){};return o}function _a(t){t.querySelector("[data-slot='dropdown-menu'], .bu-dropdown-menu, [b-ui='dropdown-menu'], [b-dropdown-menu]")&&t.classList.add("bu-markdown-bu-preview-overlay")}async function lu(t,e){let[s,o]=await Promise.all([ou(),uu(e)]),a=await is(o,t,{templates:s});return _a(t),a}function pu(t,e){let s=globalThis.thebase;if(!s?.mountAll)throw new Error("BaseUI runtime not found on the page \u2014 load dist/baseui.min.js before mounting Markdown.");t.innerHTML=e,_a(t),s.mountAll(t)}async function Da(t){Rr(t);let e=[...t.querySelectorAll("pre > code.language-base-ui")];if(!e.length)return;let s=new Set;for(let o of e){let a=o.textContent,n=o.closest("pre");n.replaceChildren(),n.className="bu-markdown-live bu-markdown-baseui";let u=document.createElement("div");u.className="bu-markdown-bu-preview",n.append(u,qc(a));try{/<[A-Z]/.test(a)?s.add(await lu(u,a)):pu(u,a)}catch(p){Vi(n,"BaseUI component",p,a)}}s.size&&Ki.set(t,s)}async function Jr(t,{mermaid:e=!0,baseUi:s=!0}={}){e&&await za(t),s&&await Da(t)}async function Xr(t){return(await Uc()).createMilkdownMarkdownEditor(t)}var Di,Fi,Hi,Bc,Ma,Yc,fi,Ki,ru,au,nu,vi=St(()=>{S();it();ci();Bc=0;Ma=0;Yc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);Ki=new WeakMap;ru=/\bstate\.([A-Za-z_$][\w$]*)/g;au=/\bthis\.([A-Za-z_$][\w$]*)\s*\(/g,nu=/\bt-on-[\w:-]+\s*=\s*(["'])([A-Za-z_$][\w$]*)\1/g});E();y();var va="1.1.6";S();var ua={};ha(ua,{Accordion:()=>Co,AccordionContent:()=>ko,AccordionItem:()=>Lo,AccordionTrigger:()=>Le,Alert:()=>le,AlertAction:()=>gs,AlertDescription:()=>fs,AlertDialog:()=>Ws,AlertDialogAction:()=>ve,AlertDialogCancel:()=>ge,AlertDialogContent:()=>Vs,AlertDialogDescription:()=>Xs,AlertDialogFooter:()=>Gs,AlertDialogHeader:()=>Ks,AlertDialogMedia:()=>Zs,AlertDialogTitle:()=>Js,AlertDialogTrigger:()=>fe,AlertTitle:()=>ms,ApiDoc:()=>yt,ApiDocGroup:()=>xt,AspectRatio:()=>vr,Attachment:()=>rr,AttachmentAction:()=>Ve,AttachmentActions:()=>ur,AttachmentContent:()=>ar,AttachmentDescription:()=>cr,AttachmentDropzone:()=>pr,AttachmentGroup:()=>lr,AttachmentMedia:()=>ir,AttachmentTitle:()=>nr,AttachmentTrigger:()=>Ke,Avatar:()=>dr,Badge:()=>at,BlockViewer:()=>ts,Breadcrumb:()=>Dt,BreadcrumbEllipsis:()=>Ne,BreadcrumbItem:()=>Ht,BreadcrumbLink:()=>Wt,BreadcrumbList:()=>Ft,BreadcrumbPage:()=>Vt,BreadcrumbSeparator:()=>bt,Bubble:()=>yr,Button:()=>x,ButtonGroup:()=>wr,ButtonGroupSeparator:()=>Ar,ButtonGroupText:()=>Er,Calendar:()=>Fe,Card:()=>cs,CardBody:()=>ls,CardDescription:()=>bs,CardFooter:()=>ps,CardHeader:()=>us,CardTitle:()=>ds,Carousel:()=>tr,CarouselNext:()=>We,CarouselPrevious:()=>He,CarouselSlide:()=>er,Chart:()=>Qo,Checkbox:()=>Pt,ClipboardButton:()=>ne,Collapsible:()=>No,CollapsibleContent:()=>Oo,CollapsibleTrigger:()=>ke,Combobox:()=>Xo,Command:()=>Yo,ContextMenu:()=>So,ContextMenuContent:()=>Ao,ContextMenuItem:()=>Eo,ContextMenuTrigger:()=>wo,DataTable:()=>De,DatePicker:()=>Jo,Dialog:()=>Nt,DialogClose:()=>ue,DialogContent:()=>ut,DialogDescription:()=>It,DialogFooter:()=>Tt,DialogHeader:()=>Ot,DialogTitle:()=>Bt,DialogTrigger:()=>hs,Direction:()=>xr,Drawer:()=>Ys,DrawerClose:()=>xe,DrawerContent:()=>Qs,DrawerDescription:()=>oo,DrawerFooter:()=>eo,DrawerHeader:()=>to,DrawerTitle:()=>so,DrawerTrigger:()=>ye,DropdownMenu:()=>qt,DropdownMenuCheckboxItem:()=>Ee,DropdownMenuContent:()=>Mt,DropdownMenuGroup:()=>fo,DropdownMenuItem:()=>jt,DropdownMenuLabel:()=>go,DropdownMenuRadioGroup:()=>vo,DropdownMenuRadioItem:()=>Ce,DropdownMenuSeparator:()=>yo,DropdownMenuShortcut:()=>xo,DropdownMenuSub:()=>zt,DropdownMenuSubContent:()=>_t,DropdownMenuSubTrigger:()=>pt,DropdownMenuTrigger:()=>lt,Empty:()=>vs,EmptyContent:()=>As,EmptyDescription:()=>ws,EmptyHeader:()=>ys,EmptyMedia:()=>xs,EmptyTitle:()=>Ss,Field:()=>Yt,FieldContent:()=>kr,FieldDescription:()=>te,FieldError:()=>ee,FieldGroup:()=>Xt,FieldLabel:()=>Qt,FieldLegend:()=>Lr,FieldSeparator:()=>Or,FieldSet:()=>Cr,FieldTitle:()=>Nr,Form:()=>os,HoverCard:()=>bo,HoverCardContent:()=>mo,HoverCardTrigger:()=>ho,Icon:()=>R,Input:()=>At,InputGroup:()=>Rs,InputGroupAddon:()=>$s,InputGroupButton:()=>he,InputGroupInput:()=>Ps,InputGroupText:()=>Us,InputGroupTextarea:()=>qs,InputOtp:()=>Ms,Item:()=>Sr,Kbd:()=>ks,Label:()=>Tr,Markdown:()=>vt,MarkdownTree:()=>Qe,MarkdownTreeNode:()=>ei,Marker:()=>Ns,Menubar:()=>$o,Message:()=>br,MessageScroller:()=>hr,NativeSelect:()=>Ut,NavigationMenu:()=>Io,NavigationMenuItem:()=>Ro,Pagination:()=>To,PaginationItem:()=>Bo,Popover:()=>lo,PopoverContent:()=>po,PopoverTrigger:()=>Ae,Progress:()=>gr,Pwa:()=>Pr,PwaBody:()=>_r,PwaClose:()=>ss,PwaContent:()=>qr,PwaDescription:()=>zr,PwaFooter:()=>Fr,PwaHeader:()=>Mr,PwaSteps:()=>Dr,PwaTitle:()=>jr,PwaTrigger:()=>es,Questionnaire:()=>mr,QuestionnaireNext:()=>Ze,QuestionnairePrevious:()=>Ge,QuestionnaireStep:()=>fr,RadioGroup:()=>Os,RadioGroupItem:()=>Ts,Resizable:()=>sr,ScrollArea:()=>or,Select:()=>zs,SelectContent:()=>_s,SelectItem:()=>Ds,SelectTrigger:()=>me,Separator:()=>Es,Sheet:()=>ro,SheetClose:()=>we,SheetContent:()=>io,SheetDescription:()=>uo,SheetFooter:()=>no,SheetHeader:()=>ao,SheetTitle:()=>co,SheetTrigger:()=>Se,Shell:()=>Pe,ShellContent:()=>Me,ShellHeader:()=>Go,ShellMain:()=>Ko,ShellNav:()=>Vo,ShellSidebar:()=>qe,ShellSidebarHeader:()=>Wo,ShellUserMenu:()=>je,Sidebar:()=>mt,SidebarClose:()=>Be,SidebarContent:()=>Kt,SidebarFooter:()=>Po,SidebarGroup:()=>Gt,SidebarGroupAction:()=>Ie,SidebarGroupCollapsible:()=>Re,SidebarGroupContent:()=>zo,SidebarGroupLabel:()=>Zt,SidebarHeader:()=>Uo,SidebarInput:()=>Mo,SidebarInset:()=>qo,SidebarMenu:()=>ft,SidebarMenuAction:()=>$e,SidebarMenuBadge:()=>Do,SidebarMenuButton:()=>ht,SidebarMenuItem:()=>Jt,SidebarMenuSkeleton:()=>Fo,SidebarMenuSub:()=>_o,SidebarMenuSubButton:()=>Ue,SidebarMenuSubItem:()=>Ho,SidebarProvider:()=>Gr,SidebarRail:()=>Te,SidebarSeparator:()=>jo,SidebarTrigger:()=>Oe,Skeleton:()=>Rt,Slider:()=>Is,Spinner:()=>Cs,Switch:()=>Bs,TabContent:()=>kt,TabTrigger:()=>ct,Table:()=>Zo,Tabs:()=>Et,TabsContainer:()=>Ct,TabsList:()=>Lt,TextEditor:()=>Hr,Textarea:()=>$t,ThemeButton:()=>gt,Toast:()=>dt,Toggle:()=>Je,ToggleGroup:()=>Ir,ToggleGroupItem:()=>Xe,Tooltip:()=>wt,Typography:()=>Ls,createNamedIcon:()=>Ea,findMarkdownTreeNode:()=>na,iconComponentName:()=>Ia});S();y();S();it();y();var R=class extends c{setup(){this.state=w({failed:!1}),st(e=>{if(this.state.failed=!1,typeof Image>"u"||!e||e===ai)return;let s=new Image;return s.onerror=()=>{this.state.failed=!0},s.src=this.buildUrl(e),()=>{s.onload=null,s.onerror=null}},()=>[this.name])}buildUrl(e){return Kr(e,{baseUrl:Z(this.props,"base-url","baseUrl")})}get name(){return Z(this.props,"icon","name")}get url(){return this.buildUrl(this.state.failed?ai:this.name)}get style(){let e=[`--b-icon-url:url("${this.url.replace(/"/g,"%22")}")`];return this.props.size&&e.push(`--b-icon-size:${this.props.size}`),H(e.join(";"),this.props.style)}get classNames(){return m("bu-icon",this.props.className)}};r(R,"template","baseui.Icon"),r(R,"props",{icon:i(String),name:i(String),label:i(String),title:i(String),size:i(String),"base-url":i(String),baseUrl:i(String),className:i(String),style:i([String,Object])});function Ea(t){return class extends R{get name(){return Z(this.props,"icon","name")||t}}}as();var x=class extends c{setup(){this.rootRef=L("root"),this.props.getRef&&(U(()=>this.props.getRef(this.rootRef.el)),P(()=>this.props.getRef(null)))}get classNames(){return this.props.unstyled?m(this.props.className):m("btn","bu-button",K[this.props.variant]||K.default,J[this.props.size],this.isIconOnly&&"bu-button-icon",this.props.className)}get iconPosition(){return Z(this.props,"icon-position","iconPosition")==="end"?"end":"start"}get ariaLabel(){return Z(this.props,"aria-label","ariaLabel")}get ariaPressed(){return Z(this.props,"aria-pressed","ariaPressed")}get ariaInvalid(){let e=Z(this.props,"aria-invalid","ariaInvalid");return e===!0?"true":e}get isIconOnly(){return!!(this.props.icon&&!this.props.label&&!this.props.slots?.default)}onClick(e){if(this.props.href&&this.props.disabled){e.preventDefault();return}this.props.onClick?.(e)}};r(x,"template","baseui.Button"),r(x,"components",{Icon:R}),r(x,"props",{variant:i(String),size:i(String),type:i(String),href:i(String),disabled:i(Boolean),label:i(String),icon:i(String),"icon-position":i(String),iconPosition:i(String),unstyled:i(Boolean),attrs:i(Object),getRef:i(Function),...l,id:i(String),title:i(String),"aria-label":i(String),ariaLabel:i(String),"aria-pressed":i(String),ariaPressed:i(String),"aria-invalid":i([String,Boolean]),ariaInvalid:i([String,Boolean]),onClick:i(Function)});S();y();ci();var ne=class extends c{setup(){this.state=w({copied:!1}),this.resetTimer=null,P(()=>window.clearTimeout(this.resetTimer))}get classNames(){return ni(this.props)}get resetDelay(){return Z(this.props,"reset-delay","resetDelay")??2e3}get iconName(){return this.state.copied?this.props.copiedIcon||"check":this.props.icon||"copy"}get label(){return this.state.copied&&this.props.copiedLabel?this.props.copiedLabel:this.props.label}get ariaLabel(){return Z(this.props,"aria-label","ariaLabel")||this.label}get attrs(){return{"data-copied":this.state.copied?"true":void 0}}async onClick(e){if(this.props.disabled)return;let s=this.props.getValue?this.props.getValue():this.props.value??"";try{await ns(s),this.state.copied=!0,window.clearTimeout(this.resetTimer),this.resetTimer=window.setTimeout(()=>{this.state.copied=!1},this.resetDelay),this.props.onCopy?.({value:s,event:e})}catch(o){this.props.onCopyError?.({error:o,event:e})}}};r(ne,"template","baseui.ClipboardButton"),r(ne,"components",{Button:x}),r(ne,"props",{variant:i(String),size:i(String),value:i(String),getValue:i(Function),label:i(String),copiedLabel:i(String),icon:i(String),copiedIcon:i(String),"reset-delay":i(Number),resetDelay:i(Number),disabled:i(Boolean),...l,"aria-label":i(String),ariaLabel:i(String),onCopy:i(Function),onCopyError:i(Function)});S();y();var ce={primary:"bu-badge-primary",secondary:"bu-badge-secondary",success:"bu-badge-success",warning:"bu-badge-warning",danger:"bu-badge-danger",info:"bu-badge-info",muted:"bu-badge-muted"};var at=class extends c{get classNames(){return m("badge",ce[this.props.variant]||ce.secondary,this.props.pill&&"rounded-pill",this.props.className)}};r(at,"template","baseui.Badge"),r(at,"props",{variant:i(String),pill:i(Boolean),label:i(String),...l});S();y();var cs=class extends c{get tag(){return this.props.tag||"div"}};r(cs,"template","baseui.Card"),r(cs,"props",{...l,tag:i(String)});var us=class extends c{};r(us,"template","baseui.CardHeader"),r(us,"props",l);var ls=class extends c{};r(ls,"template","baseui.CardBody"),r(ls,"props",l);var ps=class extends c{};r(ps,"template","baseui.CardFooter"),r(ps,"props",l);var ds=class extends c{};r(ds,"template","baseui.CardTitle"),r(ds,"props",l);var bs=class extends c{};r(bs,"template","baseui.CardDescription"),r(bs,"props",l);y();S();y();S();function O(){let t=globalThis.bootstrap;if(!t)throw new Error("BaseUI: load dist/bootstrap.bundle.min.js before this script (globalThis.bootstrap is not set).");return t}y();var wt=class extends c{setup(){this.state=w({open:_(this.props.state)}),this.triggerRef=L("trigger"),this.bufferRef=L("buffer"),this.bootstrapTooltip=null,this.lastContentHtml=null,this.onShown=()=>{this.state.open=!0},this.onHidden=()=>{this.state.open=!1},U(()=>{this.lastContentHtml=this.currentContentHtml();let e=this.triggerElement();this.bootstrapTooltip=new(O()).Tooltip(e,{title:this.lastContentHtml,html:!0,trigger:"hover focus"}),e.addEventListener("shown.bs.tooltip",this.onShown),e.addEventListener("hidden.bs.tooltip",this.onHidden),_(this.props.state)&&this.bootstrapTooltip.show()}),W(()=>{let e=this.currentContentHtml();e!==this.lastContentHtml&&(this.lastContentHtml=e,this.bootstrapTooltip?.setContent({".tooltip-inner":e}))}),P(()=>{let e=this.triggerElement();e?.removeEventListener("shown.bs.tooltip",this.onShown),e?.removeEventListener("hidden.bs.tooltip",this.onHidden),this.bootstrapTooltip?.dispose()})}triggerElement(){return this.triggerRef.el?.firstElementChild||this.triggerRef.el}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}show(){this.bootstrapTooltip?.show()}hide(){this.bootstrapTooltip?.hide()}};r(wt,"template","baseui.Tooltip"),r(wt,"props",{content:i(String),state:i(String),...l});var bc=0,tt={label:i(String),labelBackground:i(String),supportingText:i(String),useTip:i(Number),errorText:i(String),leadingIcon:i(String),trailingIcon:i(String),maxLength:i(Number),invalid:i(Boolean),placeholder:i(String),disabled:i(Boolean)},G=class extends c{setup(){this.supportId=`bu-input-support-${bc++}`}get field(){return this.env.fieldProps?.()??{}}get label(){return this.props.label??this.field.label}get labelStyle(){let e=this.props.labelBackground??this.field.labelBackground;return e?`--bu-label-bg:${e}`:void 0}get isOutlined(){return!!this.label}get isInvalid(){return!!(this.props.invalid||this.field.invalid||this.errorText)}get errorText(){return this.props.errorText??this.field.error}get helperText(){return this.props.supportingText||this.field.description}get useTip(){return Number(this.props.useTip??this.field.useTip??0)===1}get supportingText(){return this.errorText||(this.useTip?void 0:this.helperText)}get tipText(){return this.useTip&&!this.errorText?this.helperText:void 0}get leadingIcon(){return this.props.leadingIcon}get trailingIcon(){return this.isInvalid?"circle-alert":this.props.trailingIcon}get fieldPlaceholder(){return this.props.placeholder??(this.isOutlined?" ":void 0)}get counter(){return`${(this.props.value??"").length}/${this.props.maxLength}`}get controlClass(){return this.isOutlined&&"bu-outlined-control"}get describedBy(){return this.supportingText?this.supportId:void 0}get outlinedClassNames(){return m("bu-input-outlined",this.isInvalid&&"is-invalid",this.props.disabled&&"is-disabled",this.props.placeholder&&"has-placeholder",this.tipText&&"has-tip",this.leadingIcon&&"has-leading",this.trailingIcon&&"has-trailing")}};r(G,"components",{Icon:R,Tooltip:wt});function ui({tag:t="input",type:e}={}){return t==="select"?"form-select":e==="checkbox"||e==="radio"?"form-check-input":"form-control"}var At=class extends G{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return m("bu-input",ui({tag:"input",type:this.props.type}),this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(At,"template","baseui.Input"),r(At,"props",{...tt,value:i(String),type:i(String),readonly:i(Boolean),className:i(String),style:i([String,Object]),id:i(String),list:i(String),autocomplete:i(String),"aria-label":i(String),ariaLabel:i(String),min:i([String,Number]),max:i([String,Number]),step:i([String,Number]),onInput:i(Function),onChange:i(Function)});S();y();var Mi={default:"bu-tabs-list-default",line:"bu-tabs-list-line"};function li(t,e,s,o="horizontal"){let a=o==="vertical",p=t===(a?"ArrowDown":"ArrowRight")?1:t===(a?"ArrowUp":"ArrowLeft")?-1:0;return!p||s===0?-1:(e+p+s)%s}var hc=0;function Ca(t){return String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}var Et=class extends c{setup(){this.tabsState=w({active:this.props.value??this.props.defaultValue??""}),this.instanceId=`t${++hc}`,N({tabs:this.tabsState,selectTab:e=>this.select(e),tabsId:this.instanceId,orientation:this.orientation}),V(e=>{e.value!==void 0&&(this.tabsState.active=e.value)})}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return m("bu-tabs",this.props.className)}select(e){this.props.value===void 0&&(this.tabsState.active=e),this.props.onChange?.(e)}};r(Et,"template","baseui.Tabs"),r(Et,"props",{value:i(String),defaultValue:i(String),orientation:i(String),onChange:i(Function),...l});var Ct=class extends c{};r(Ct,"template","baseui.TabsContainer"),r(Ct,"props",{...l});var Lt=class extends c{setup(){this.listRef=L("list")}get classNames(){return m("bu-tabs-list",Mi[this.props.variant]||Mi.default,this.props.className)}onKeyDown(e){let s=[...this.listRef.el.querySelectorAll("[role='tab']")],o=s.indexOf(e.target),a=li(e.key,o,s.length,this.env.orientation);a!==-1&&(e.preventDefault(),s[a].focus(),s[a].click())}};r(Lt,"template","baseui.TabsList"),r(Lt,"props",{variant:i(String),...l});var ct=class extends c{setup(){this.rootEl=null,this.tabInstance=null,this.onShown=()=>this.env.selectTab(this.props.value)}onRootRef(e){e?(this.rootEl=e,this.tabInstance=O().Tab.getOrCreateInstance(e),e.addEventListener("shown.bs.tab",this.onShown)):this.rootEl&&(this.rootEl.removeEventListener("shown.bs.tab",this.onShown),this.tabInstance?.dispose(),this.tabInstance=null,this.rootEl=null)}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`bu-tabs-panel-${this.env.tabsId}-${Ca(this.props.value)}`}get classNames(){return m("bu-tabs-trigger",this.isActive&&"active",this.props.className)}get tabAttrs(){return{role:"tab","data-bs-target":`#${this.panelId}`,"aria-selected":this.isActive?"true":"false",tabindex:this.isActive?0:-1}}onClick(){this.props.disabled||this.tabInstance?.show()}};r(ct,"template","baseui.TabTrigger"),r(ct,"components",{Button:x}),r(ct,"props",{value:{type:String},disabled:i(Boolean),...l});var kt=class extends c{setup(){this.initialActive=this.isActive}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`bu-tabs-panel-${this.env.tabsId}-${Ca(this.props.value)}`}};r(kt,"template","baseui.TabContent"),r(kt,"props",{value:{type:String},...l});S();y();S();y();function X(t,e){V(s=>{re(s)&&(t.open=j(s),t.open?e?.instance?.show():e?.instance?.hide())})}function Y(t,e,s){re(t)||(e.open=s),t.onOpenChange?.(s)}function pi(t,e){let s=null;U(()=>{s=new(O()).Collapse(t.el,{toggle:!1})}),W(()=>{if(!s)return;let o=t.el.classList.contains("show");e()&&!o?s.show():!e()&&o&&s.hide()}),P(()=>s?.dispose())}var Nt=class extends c{setup(){this.dialogState=w({open:j(this.props)}),this.control={instance:null},N({dialog:this.dialogState,dialogControl:this.control,setDialogOpen:e=>this.setOpen(e)}),X(this.dialogState,this.control)}setOpen(e){Y(this.props,this.dialogState,e)}};r(Nt,"template","baseui.Dialog"),r(Nt,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),style:i([String,Object]),slots:i(Object)});var hs=class extends c{onClick(){this.env.dialogControl.instance?.show()}};r(hs,"template","baseui.DialogTrigger"),r(hs,"props",l);var ut=class extends c{setup(){this.rootRef=L("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDialogOpen(!0),this.onHidden=()=>{this.env.setDialogOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},U(()=>{this.env.dialogControl.instance=O().Modal.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,focus:!0}),this.rootRef.el.addEventListener("show.bs.modal",this.onShow),this.rootRef.el.addEventListener("shown.bs.modal",this.onShown),this.rootRef.el.addEventListener("hidden.bs.modal",this.onHidden),this.env.dialog.open&&this.env.dialogControl.instance.show()}),P(()=>{this.rootRef.el.removeEventListener("show.bs.modal",this.onShow),this.rootRef.el.removeEventListener("shown.bs.modal",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.modal",this.onHidden),this.env.dialogControl.instance?.dispose(),this.env.dialogControl.instance=null})}get showCloseButton(){return this.props.showCloseButton!==!1&&this.props["show-close-button"]!==!1}};r(ut,"template","baseui.DialogContent"),r(ut,"components",{Button:x}),r(ut,"props",{...l,showCloseButton:i(Boolean),"show-close-button":i(Boolean)});var Ot=class extends c{};r(Ot,"template","baseui.DialogHeader"),r(Ot,"props",l);var Tt=class extends c{};r(Tt,"template","baseui.DialogFooter"),r(Tt,"props",l);var Bt=class extends c{};r(Bt,"template","baseui.DialogTitle"),r(Bt,"props",l);var It=class extends c{};r(It,"template","baseui.DialogDescription"),r(It,"props",l);var ue=class extends c{};r(ue,"template","baseui.DialogClose"),r(ue,"components",{Button:x}),r(ue,"props",l);S();y();var La={default:"bu-alert-default",destructive:"bu-alert-destructive",info:"bu-alert-default",success:"alert-success",warning:"alert-warning",danger:"bu-alert-destructive"},le=class extends c{setup(){this.rootRef=L("root"),this.bootstrapAlert=null,this.props.dismissible&&(U(()=>{this.bootstrapAlert=new(O()).Alert(this.rootRef.el)}),P(()=>{this.bootstrapAlert?.dispose()}))}get classNames(){return m("alert","bu-alert",La[this.props.variant]||La.default,this.props.dismissible&&"alert-dismissible",this.props.dismissible&&"fade",this.props.dismissible&&"show",this.props.className)}};r(le,"template","baseui.Alert"),r(le,"components",{Button:x}),r(le,"props",{variant:i(String),dismissible:i(Boolean),...l});var ms=class extends c{};r(ms,"template","baseui.AlertTitle"),r(ms,"props",l);var fs=class extends c{};r(fs,"template","baseui.AlertDescription"),r(fs,"props",l);var gs=class extends c{};r(gs,"template","baseui.AlertAction"),r(gs,"props",l);S();y();var ka={default:"bu-empty-default",outline:"bu-empty-outline",background:"bu-empty-background"},mc={default:"bu-empty-media-default",icon:"bu-empty-media-icon"},vs=class extends c{get classNames(){return m("bu-empty",ka[this.props.variant]||ka.default,this.props.className)}};r(vs,"template","baseui.Empty"),r(vs,"props",{variant:i(String),...l});var ys=class extends c{};r(ys,"template","baseui.EmptyHeader"),r(ys,"props",l);var xs=class extends c{get variant(){return this.props.variant==="icon"?"icon":"default"}get classNames(){return m("bu-empty-media",mc[this.variant],this.props.className)}};r(xs,"template","baseui.EmptyMedia"),r(xs,"props",{variant:i(String),...l});var Ss=class extends c{};r(Ss,"template","baseui.EmptyTitle"),r(Ss,"props",l);var ws=class extends c{};r(ws,"template","baseui.EmptyDescription"),r(ws,"props",l);var As=class extends c{};r(As,"template","baseui.EmptyContent"),r(As,"props",l);S();y();var Es=class extends c{get vertical(){return this.props.orientation==="vertical"}get classNames(){return m("bu-separator",this.vertical?"bu-separator-vertical":"bu-separator-horizontal",this.props.className)}};r(Es,"template","baseui.Separator"),r(Es,"props",{orientation:i(String),className:i(String),style:i([String,Object])});S();y();var Rt=class extends c{get classNames(){return m("bu-skeleton",this.props.shape==="circle"?"bu-skeleton-circle":"bu-skeleton-block",this.props.className)}};r(Rt,"template","baseui.Skeleton"),r(Rt,"props",{shape:i(String),className:i(String),style:i([String,Object])});S();y();var Cs=class extends c{get classNames(){return m("bu-spinner",this.props.type==="grow"?"spinner-grow":"spinner-border",this.props.className)}get label(){return this.props.label||"Loading"}};r(Cs,"template","baseui.Spinner"),r(Cs,"props",{type:i(String),label:i(String),className:i(String),style:i([String,Object])});S();y();var fc={lead:"lead",muted:"text-body-secondary",code:"bu-code",kbd:"bu-kbd"},Ls=class extends c{get classNames(){return m("bu-typography",fc[this.props.variant],this.props.className)}};r(Ls,"template","baseui.Typography"),r(Ls,"props",{variant:i(String),...l});S();y();var ks=class extends c{get classNames(){return m("bu-kbd",this.props.className)}};r(ks,"template","baseui.Kbd"),r(ks,"props",{...l});S();y();var Ns=class extends c{get classNames(){return m("bu-marker",this.props.className)}get variant(){return this.props.variant}};r(Ns,"template","baseui.Marker"),r(Ns,"props",{variant:i(String),...l});y();var $t=class extends G{get outlinedClassNames(){return m(super.outlinedClassNames,"is-anchored")}get classNames(){return m("form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.resize==="none"&&"bu-textarea-no-resize",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};r($t,"template","baseui.Textarea"),r($t,"props",{...tt,value:i(String),rows:i(Number),readonly:i(Boolean),resize:i(String),className:i(String),style:i([String,Object]),id:i(String),onInput:i(Function),onChange:i(Function)});y();var Ut=class extends G{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return m("bu-native-select","form-select",this.controlClass,this.isInvalid&&"is-invalid",(this.props.size==="sm"||this.props.size==="lg")&&`form-select-${this.props.size}`,this.props.className)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(Ut,"template","baseui.NativeSelect"),r(Ut,"props",{...tt,value:i(String),size:i(String),...l,"aria-label":i(String),ariaLabel:i(String),id:i(String),onChange:i(Function)});S();y();var Pt=class extends c{onChange(e){this.props.onChange?.(e.target.checked,e)}};r(Pt,"template","baseui.Checkbox"),r(Pt,"props",{checked:i(Boolean),disabled:i(Boolean),...l,id:i(String),onChange:i(Function)});S();y();var Os=class extends c{setup(){N({radioGroupValue:()=>this.props.value,radioGroupDisabled:()=>this.props.disabled,radioGroupName:()=>this.props.name||"bu-radio-group",selectRadio:e=>this.props.onChange?.(e)})}get classNames(){return m("bu-radio-group",this.props.className)}};r(Os,"template","baseui.RadioGroup"),r(Os,"props",{value:i(String),name:i(String),disabled:i(Boolean),...l,onChange:i(Function)});var Ts=class extends c{get checked(){return this.env.radioGroupValue()===this.props.value}get disabled(){return this.props.disabled||this.env.radioGroupDisabled()}onChange(){this.disabled||this.env.selectRadio(this.props.value)}};r(Ts,"template","baseui.RadioGroupItem"),r(Ts,"props",{value:{type:String},disabled:i(Boolean),...l});S();y();var Bs=class extends c{onChange(e){this.props.onChange?.(e.target.checked,e)}};r(Bs,"template","baseui.Switch"),r(Bs,"props",{checked:i(Boolean),disabled:i(Boolean),...l,onChange:i(Function)});S();y();var Is=class extends c{get classNames(){return m("bu-slider",this.props.className)}onInput(e){e.target.style.setProperty("--b-slider-value",`${e.target.value}%`),this.props.onChange?.(e.target.value,e)}};r(Is,"template","baseui.Slider"),r(Is,"props",{value:i([Number,String]),min:i([Number,String]),max:i([Number,String]),step:i([Number,String]),disabled:i(Boolean),className:i(String),style:i([String,Object]),onChange:i(Function)});S();y();var pe={"inline-start":"bu-input-group-addon-inline-start","inline-end":"bu-input-group-addon-inline-end","block-start":"bu-input-group-addon-block-start","block-end":"bu-input-group-addon-block-end"},de={default:"btn-primary",primary:"btn-primary",destructive:"btn-danger",danger:"btn-danger",outline:"btn-outline-secondary",secondary:"btn-secondary",ghost:"btn-light",link:"btn-link"},be={xs:"bu-input-group-button-xs",sm:"bu-input-group-button-sm","icon-xs":"bu-input-group-button-icon-xs","icon-sm":"bu-input-group-button-icon-sm"};function di(t){t.parentElement?.querySelector("[data-slot='input-group-control'], input, textarea")?.focus()}var Rs=class extends G{setup(){super.setup(),N({inputGroupLabeled:()=>this.isOutlined})}get trailingIcon(){}get classNames(){return m("bu-input-group",this.props.className)}};r(Rs,"template","baseui.InputGroup"),r(Rs,"props",{...tt,...l});var $s=class extends c{get align(){return pe[this.props.align]?this.props.align:"inline-start"}get classNames(){return m("bu-input-group-addon",pe[this.align],this.props.className)}onClick(e){this.props.onClick?.(e),e.target.closest("button")||di(e.currentTarget)}};r($s,"template","baseui.InputGroupAddon"),r($s,"props",{align:i(String),...l,onClick:i(Function)});var he=class extends c{get size(){return be[this.props.size]?this.props.size:"xs"}get classNames(){return m("btn","bu-button","bu-input-group-button",de[this.props.variant]||de.ghost,be[this.size],this.props.className||this.props.class)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get buttonAttrs(){return{"data-size":this.size,"aria-label":this.ariaLabel,"data-slot":"input-group-button"}}onClick(e){this.props.onClick?.(e)}};r(he,"template","baseui.InputGroupButton"),r(he,"components",{Button:x}),r(he,"props",{variant:i(String),size:i(String),type:i(String),disabled:i(Boolean),label:i(String),class:i(String),...l,"aria-label":i(String),ariaLabel:i(String),onClick:i(Function)});var Us=class extends c{get classNames(){return m("bu-input-group-text",this.props.className)}};r(Us,"template","baseui.InputGroupText"),r(Us,"props",{...l});var Ps=class extends c{get fieldPlaceholder(){return this.props.placeholder??(this.env.inputGroupLabeled?.()?" ":void 0)}get classNames(){return m("form-control","bu-input-group-control","bu-input-group-input",this.props.invalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(Ps,"template","baseui.InputGroupInput"),r(Ps,"props",{value:i(String),id:i(String),name:i(String),autocomplete:i(String),placeholder:i(String),type:i(String),disabled:i(Boolean),readonly:i(Boolean),invalid:i(Boolean),className:i(String),style:i([String,Object]),onInput:i(Function),onChange:i(Function)});var qs=class extends c{get fieldPlaceholder(){return this.props.placeholder??(this.env.inputGroupLabeled?.()?" ":void 0)}get classNames(){return m("form-control","bu-input-group-control","bu-input-group-textarea",this.props.resize==="none"&&"bu-textarea-no-resize",this.props.invalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(qs,"template","baseui.InputGroupTextarea"),r(qs,"props",{value:i(String),placeholder:i(String),rows:i(Number),disabled:i(Boolean),readonly:i(Boolean),invalid:i(Boolean),resize:i(String),className:i(String),style:i([String,Object]),onInput:i(Function),onChange:i(Function)});S();y();var Ms=class extends c{setup(){this.length=this.props.length||6;let e=(this.props.value||"").split("");this.state=w({digits:Array.from({length:this.length},(s,o)=>e[o]||"")}),this.rootRef=L("root")}get classNames(){return m("bu-input-otp",this.props.className)}get boxes(){return this.state.digits.map((e,s)=>({index:s,value:e}))}emit(){this.props.onChange?.(this.state.digits.join(""))}onInput(e,s){let o=s.target.value.slice(-1);this.state.digits[e]=o,o&&this.rootRef.el&&[...this.rootRef.el.querySelectorAll("input")][e+1]?.focus(),this.emit()}onPaste(e){let s=e.clipboardData.getData("text").trim();if(s){e.preventDefault();for(let o=0;o<this.length;o++)this.state.digits[o]=s[o]||"";this.emit()}}};r(Ms,"template","baseui.InputOtp"),r(Ms,"props",{length:i(Number),value:i(String),disabled:i(Boolean),className:i(String),style:i([String,Object]),onChange:i(Function)});S();S();function js(t,{defaultOpen:e=!1,onOpenChange:s}={}){let o=w({open:e}),a=d=>{o.open!==d&&(o.open=d,s?.(d))},n=()=>a(!o.open),u=d=>{t.el&&!t.el.contains(d.target)&&a(!1)},p=d=>{d.key==="Escape"&&a(!1)};return st(d=>{if(d)return document.addEventListener("click",u),document.addEventListener("keydown",p),()=>{document.removeEventListener("click",u),document.removeEventListener("keydown",p)}},()=>[o.open]),P(()=>{document.removeEventListener("click",u),document.removeEventListener("keydown",p)}),{state:o,setOpen:a,toggle:n}}y();var zs=class extends G{setup(){super.setup(),this.rootRef=L("root");let{state:e,setOpen:s,toggle:o}=js(this.rootRef,{defaultOpen:_(this.props.state)});this.disclosure=e,N({select:this.disclosure,selectValue:()=>this.props.value,selectToggle:o,selectClose:()=>s(!1),selectChoose:a=>{this.props.onChange?.(a),s(!1)}})}get outlinedClassNames(){return m(super.outlinedClassNames,"is-anchored",this.props.value&&"is-floated")}get rootStyle(){return H(this.labelStyle,this.props.style)}get classNames(){return m("bu-select",this.isOutlined&&this.outlinedClassNames,this.props.className)}};r(zs,"template","baseui.Select"),r(zs,"props",{...tt,value:i(String),state:i(String),onChange:i(Function),...l});var me=class extends c{get attrs(){return{"aria-haspopup":"listbox","aria-expanded":this.env.select.open?"true":"false"}}onClick(){this.env.selectToggle()}};r(me,"template","baseui.SelectTrigger"),r(me,"components",{Button:x}),r(me,"props",l);var _s=class extends c{get open(){return this.env.select.open}};r(_s,"template","baseui.SelectContent"),r(_s,"props",l);var Ds=class extends c{get selected(){return this.env.selectValue()===this.props.value}onClick(){this.env.selectChoose(this.props.value)}};r(Ds,"template","baseui.SelectItem"),r(Ds,"props",{value:{type:String},...l});S();function Fs(t){return[...t.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")].filter(e=>!e.disabled&&!e.hidden)}function ji(t,e){if(t.key!=="Tab")return;let s=Fs(e);if(!s.length){t.preventDefault();return}let o=s[0],a=s[s.length-1];t.shiftKey&&document.activeElement===o?(t.preventDefault(),a.focus()):!t.shiftKey&&document.activeElement===a&&(t.preventDefault(),o.focus())}function bi(t,{closeSelector:e,trapFocus:s=!1}={}){let o=t.getAttribute("b-att-trigger"),a=o?document.querySelector(o):null,n=[...t.querySelectorAll(e)],u=null,p=()=>Fs(t),d=()=>{u=document.activeElement,t.hidden=!1,t.setAttribute("b-att-state","open"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),p()[0]?.focus(),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},h=()=>{t.hidden=!0,t.setAttribute("b-att-state","closed"),u?.focus?.(),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))},f=C=>{if(C.key==="Escape"){h();return}!s||t.hidden||ji(C,t)},g=C=>{C.target===t&&h()};return a?.addEventListener("click",d),n.forEach(C=>C.addEventListener("click",h)),t.addEventListener("keydown",f),t.addEventListener("click",g),(!t.getAttribute("b-att-state")||t.getAttribute("b-att-state")==="closed")&&(t.hidden=!0),{open:d,close:h,destroy:()=>{a?.removeEventListener("click",d),n.forEach(C=>C.removeEventListener("click",h)),t.removeEventListener("keydown",f),t.removeEventListener("click",g)}}}function Hs(t,e,s,o){let a=t.getAttribute("b-att-trigger"),n=a?document.querySelector(a):null,u=null,p=()=>{u=document.activeElement},d=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},h=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0})),u?.focus?.(),u=null},f=()=>e.show(),g=()=>e.hide();return t.addEventListener(`show.bs.${s}`,p),t.addEventListener(`shown.bs.${s}`,d),t.addEventListener(`hidden.bs.${s}`,h),n?.addEventListener("click",f),t.setAttribute("b-att-state","closed"),t[o]={open:f,close:g},{destroy:()=>{n?.removeEventListener("click",f),t.removeEventListener(`show.bs.${s}`,p),t.removeEventListener(`shown.bs.${s}`,d),t.removeEventListener(`hidden.bs.${s}`,h),e.dispose(),delete t[o]}}}y();var Ws=class extends c{setup(){this.alertDialogState=w({open:j(this.props)}),N({alertDialog:this.alertDialogState,setAlertDialogOpen:e=>this.setOpen(e)}),X(this.alertDialogState)}setOpen(e){Y(this.props,this.alertDialogState,e)}};r(Ws,"template","baseui.AlertDialog"),r(Ws,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var fe=class extends c{get attrs(){return{"data-slot":"alert-dialog-trigger"}}onClick(){this.env.setAlertDialogOpen(!0)}};r(fe,"template","baseui.AlertDialogTrigger"),r(fe,"components",{Button:x}),r(fe,"props",l);var Vs=class extends c{get size(){return this.props.size==="sm"?"sm":"default"}setup(){this.rootRef=L("root"),st(e=>{if(!e)return;let s=document.activeElement;return Fs(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.alertDialog.open])}get open(){return this.env.alertDialog.open}onKeyDown(e){if(e.key==="Escape"){this.env.setAlertDialogOpen(!1);return}ji(e,this.rootRef.el)}};r(Vs,"template","baseui.AlertDialogContent"),r(Vs,"props",{...l,size:i(String)});var Ks=class extends c{};r(Ks,"template","baseui.AlertDialogHeader"),r(Ks,"props",l);var Gs=class extends c{};r(Gs,"template","baseui.AlertDialogFooter"),r(Gs,"props",l);var Zs=class extends c{};r(Zs,"template","baseui.AlertDialogMedia"),r(Zs,"props",l);var Js=class extends c{};r(Js,"template","baseui.AlertDialogTitle"),r(Js,"props",l);var Xs=class extends c{};r(Xs,"template","baseui.AlertDialogDescription"),r(Xs,"props",l);var ge=class extends c{get attrs(){return{"data-slot":"alert-dialog-cancel"}}onClick(){this.env.setAlertDialogOpen(!1)}};r(ge,"template","baseui.AlertDialogCancel"),r(ge,"components",{Button:x}),r(ge,"props",l);var ve=class extends c{get attrs(){return{"data-slot":"alert-dialog-action"}}onClick(){this.props.onClick?.(),this.env.setAlertDialogOpen(!1)}};r(ve,"template","baseui.AlertDialogAction"),r(ve,"components",{Button:x}),r(ve,"props",{...l,onClick:i(Function)});S();y();var Ys=class extends c{setup(){this.drawerState=w({open:j(this.props)}),this.control={instance:null},N({drawer:this.drawerState,drawerControl:this.control,setDrawerOpen:e=>this.setOpen(e)}),X(this.drawerState,this.control)}setOpen(e){Y(this.props,this.drawerState,e)}};r(Ys,"template","baseui.Drawer"),r(Ys,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var ye=class extends c{onClick(){this.env.drawerControl.instance?.show()}};r(ye,"template","baseui.DrawerTrigger"),r(ye,"components",{Button:x}),r(ye,"props",l);var Qs=class extends c{setup(){this.rootRef=L("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDrawerOpen(!0),this.onHidden=()=>{this.env.setDrawerOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},U(()=>{this.env.drawerControl.instance=O().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawer.open&&this.env.drawerControl.instance.show()}),P(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawerControl.instance?.dispose(),this.env.drawerControl.instance=null})}get open(){return this.env.drawer.open}};r(Qs,"template","baseui.DrawerContent"),r(Qs,"props",l);var to=class extends c{};r(to,"template","baseui.DrawerHeader"),r(to,"props",l);var eo=class extends c{};r(eo,"template","baseui.DrawerFooter"),r(eo,"props",l);var so=class extends c{};r(so,"template","baseui.DrawerTitle"),r(so,"props",l);var oo=class extends c{};r(oo,"template","baseui.DrawerDescription"),r(oo,"props",l);var xe=class extends c{get attrs(){return{"data-bs-dismiss":"offcanvas"}}};r(xe,"template","baseui.DrawerClose"),r(xe,"components",{Button:x}),r(xe,"props",l);S();y();var ro=class extends c{setup(){this.sheetState=w({open:j(this.props),side:this.props.side}),this.control={instance:null},N({sheet:this.sheetState,sheetControl:this.control,setSheetOpen:e=>this.setOpen(e)}),X(this.sheetState,this.control),V(e=>{this.sheetState.side=e.side})}setOpen(e){Y(this.props,this.sheetState,e)}};r(ro,"template","baseui.Sheet"),r(ro,"props",{open:i(Boolean),state:i(String),side:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var Se=class extends c{onClick(){this.env.sheetControl.instance?.show()}};r(Se,"template","baseui.SheetTrigger"),r(Se,"components",{Button:x}),r(Se,"props",l);var io=class extends c{setup(){this.rootRef=L("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setSheetOpen(!0),this.onHidden=()=>{this.env.setSheetOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},U(()=>{this.env.sheetControl.instance=O().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheet.open&&this.env.sheetControl.instance.show()}),P(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheetControl.instance?.dispose(),this.env.sheetControl.instance=null})}get open(){return this.env.sheet.open}get side(){return this.props.side??this.env.sheet.side}get placementClass(){return this.side==="left"?"offcanvas-start":"offcanvas-end"}};r(io,"template","baseui.SheetContent"),r(io,"props",{...l,side:i(String)});var ao=class extends c{};r(ao,"template","baseui.SheetHeader"),r(ao,"props",l);var no=class extends c{};r(no,"template","baseui.SheetFooter"),r(no,"props",l);var co=class extends c{};r(co,"template","baseui.SheetTitle"),r(co,"props",l);var uo=class extends c{};r(uo,"template","baseui.SheetDescription"),r(uo,"props",l);var we=class extends c{};r(we,"template","baseui.SheetClose"),r(we,"components",{Button:x}),r(we,"props",l);S();y();var lo=class extends c{setup(){let e=w({open:_(this.props.state)});this.control={instance:null,bufferEl:null,lastContentHtml:null};let s=o=>{e.open!==o&&(e.open=o,this.props.onOpenChange?.(o))};N({popover:e,popoverControl:this.control,popoverSetOpen:s,popoverToggle:()=>this.control.instance?.toggle(),popoverClose:()=>this.control.instance?.hide()})}};r(lo,"template","baseui.Popover"),r(lo,"props",{state:i(String),onOpenChange:i(Function),...l});var Ae=class extends c{setup(){this.rootRef={el:null},this.getRef=e=>{this.rootRef.el=e},this.onShown=()=>this.env.popoverSetOpen(!0),this.onHidden=()=>this.env.popoverSetOpen(!1),U(()=>{let e=this.env.popoverControl,s=e.bufferEl?.innerHTML??"";e.lastContentHtml=s,e.instance=new(O()).Popover(this.rootRef.el,{content:s,html:!0,trigger:"manual"}),this.rootRef.el.addEventListener("shown.bs.popover",this.onShown),this.rootRef.el.addEventListener("hidden.bs.popover",this.onHidden)}),P(()=>{this.rootRef.el.removeEventListener("shown.bs.popover",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.popover",this.onHidden),this.env.popoverControl.instance?.dispose(),this.env.popoverControl.instance=null})}get attrs(){return{"aria-haspopup":"dialog","aria-expanded":this.env.popover.open?"true":"false"}}onClick(){this.env.popoverControl.instance?.toggle()}};r(Ae,"template","baseui.PopoverTrigger"),r(Ae,"components",{Button:x}),r(Ae,"props",l);var po=class extends c{get style(){return H("display:none",this.props.style)}setup(){this.bufferRef=L("buffer"),U(()=>{this.env.popoverControl.bufferEl=this.bufferRef.el}),W(()=>{let e=this.env.popoverControl;e.bufferEl=this.bufferRef.el;let s=this.currentContentHtml();e.instance&&s!==e.lastContentHtml&&(e.lastContentHtml=s,e.instance.setContent({".popover-body":s}))})}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}};r(po,"template","baseui.PopoverContent"),r(po,"props",{...l,content:i(String)});S();y();var bo=class extends c{setup(){this.state=w({open:!1}),N({hoverCard:this.state})}open(){this.state.open=!0}close(){this.state.open=!1}onKeyDown(e){e.key==="Escape"&&this.close()}};r(bo,"template","baseui.HoverCard"),r(bo,"props",{...l});var ho=class extends c{};r(ho,"template","baseui.HoverCardTrigger"),r(ho,"props",l);var mo=class extends c{get open(){return this.env.hoverCard.open}};r(mo,"template","baseui.HoverCardContent"),r(mo,"props",l);S();y();var zi={...l,disabled:i(Boolean),inset:i(Boolean),onClick:i(Function),onSelect:i(Function),variant:i(String)},qt=class extends c{setup(){this.rootRef=L("root");let e=w({open:_(this.props.state)});this.control={instance:null};let s=n=>{e.open!==n&&(e.open=n,this.props.onOpenChange?.(n))};N({dropdownMenu:e,dropdownControl:this.control,dropdownSetOpen:s,dropdownToggle:()=>this.control.instance?.toggle(),dropdownClose:()=>this.control.instance?.hide()});let o=n=>{this.rootRef.el&&!this.rootRef.el.contains(n.target)&&this.control.instance?.hide()},a=n=>{n.key==="Escape"&&this.control.instance?.hide()};st(n=>{if(n)return document.addEventListener("click",o),document.addEventListener("keydown",a),()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",a)}},()=>[e.open]),P(()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",a)})}};r(qt,"template","baseui.DropdownMenu"),r(qt,"props",{state:i(String),onOpenChange:i(Function),...l});var lt=class extends c{setup(){this.rootRef={el:null},this.onShown=()=>this.env.dropdownSetOpen(!0),this.onHidden=()=>this.env.dropdownSetOpen(!1),this.getRef=e=>{e?(this.rootRef.el=e,this.env.dropdownControl.instance=O().Dropdown.getOrCreateInstance(e),e.addEventListener("shown.bs.dropdown",this.onShown),e.addEventListener("hidden.bs.dropdown",this.onHidden)):this.rootRef.el&&(this.rootRef.el.removeEventListener("shown.bs.dropdown",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.dropdown",this.onHidden),this.env.dropdownControl.instance?.dispose(),this.env.dropdownControl.instance=null,this.rootRef.el=null)}}get classNames(){return m("btn","bu-button","btn-outline-secondary","bu-dropdown-menu-trigger",this.props.className)}get attrs(){return{"data-slot":"dropdown-menu-trigger","aria-haspopup":"menu","aria-expanded":this.env.dropdownMenu.open?"true":"false"}}onClick(){this.env.dropdownToggle()}};r(lt,"template","baseui.DropdownMenuTrigger"),r(lt,"components",{Button:x}),r(lt,"props",l);var Mt=class extends c{get open(){return this.env.dropdownMenu.open}get classNames(){return m("bu-dropdown-menu-content","dropdown-menu",this.open?"show":"",this.props.className)}};r(Mt,"template","baseui.DropdownMenuContent"),r(Mt,"props",{...l,align:i(String),alignOffset:i(Number),side:i(String),sideOffset:i(Number)});var fo=class extends c{};r(fo,"template","baseui.DropdownMenuGroup"),r(fo,"props",l);var go=class extends c{};r(go,"template","baseui.DropdownMenuLabel"),r(go,"props",{...l,inset:i(Boolean)});var jt=class extends c{get variant(){return this.props.variant||"default"}onClick(e){this.props.disabled||(this.props.onClick?.(e),this.props.onSelect?.(e),this.env.dropdownClose())}};r(jt,"template","baseui.DropdownMenuItem"),r(jt,"props",zi);var Ee=class extends c{onClick(e){this.props.disabled||(this.props.onCheckedChange?.(!this.props.checked,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};r(Ee,"template","baseui.DropdownMenuCheckboxItem"),r(Ee,"components",{Icon:R}),r(Ee,"props",{...zi,checked:i(Boolean),onCheckedChange:i(Function)});var vo=class extends c{setup(){N({dropdownRadio:{value:this.props.value,onValueChange:this.props.onValueChange}})}};r(vo,"template","baseui.DropdownMenuRadioGroup"),r(vo,"props",{...l,value:i(String),onValueChange:i(Function)});var Ce=class extends c{get checked(){return this.env.dropdownRadio?.value===this.props.value}onClick(e){this.props.disabled||(this.env.dropdownRadio?.onValueChange?.(this.props.value,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};r(Ce,"template","baseui.DropdownMenuRadioItem"),r(Ce,"components",{Icon:R}),r(Ce,"props",{...zi,value:i(String)});var yo=class extends c{};r(yo,"template","baseui.DropdownMenuSeparator"),r(yo,"props",l);var xo=class extends c{};r(xo,"template","baseui.DropdownMenuShortcut"),r(xo,"props",l);var zt=class extends c{setup(){this.rootRef=L("root");let{state:e,setOpen:s,toggle:o}=js(this.rootRef);N({dropdownSub:e,dropdownSubToggle:o,dropdownSubOpen:()=>s(!0),dropdownSubClose:()=>s(!1)})}};r(zt,"template","baseui.DropdownMenuSub"),r(zt,"props",l);var pt=class extends c{onMouseEnter(){this.props.disabled||this.env.dropdownSubOpen()}onClick(){this.props.disabled||this.env.dropdownSubToggle()}};r(pt,"template","baseui.DropdownMenuSubTrigger"),r(pt,"components",{Icon:R}),r(pt,"props",{...l,disabled:i(Boolean),inset:i(Boolean)});var _t=class extends c{get open(){return this.env.dropdownSub.open}};r(_t,"template","baseui.DropdownMenuSubContent"),r(_t,"props",l);S();y();var So=class extends c{setup(){this.state=w({open:!1,x:0,y:0});let e=()=>{this.state.open=!1};this.close=e,N({contextMenu:this.state,contextMenuOpenAt:(s,o)=>{this.state.open=!0,this.state.x=s,this.state.y=o},contextMenuClose:e}),document.addEventListener("click",e),P(()=>document.removeEventListener("click",e))}};r(So,"template","baseui.ContextMenu"),r(So,"props",{className:i(String),slots:i(Object)});var wo=class extends c{onContextMenu(e){e.preventDefault(),this.env.contextMenuOpenAt(e.clientX,e.clientY)}};r(wo,"template","baseui.ContextMenuTrigger"),r(wo,"props",l);var Ao=class extends c{setup(){this.rootRef=L("root")}get open(){return this.env.contextMenu.open}get style(){return H(`left:${this.env.contextMenu.x}px;top:${this.env.contextMenu.y}px`,this.props.style)}};r(Ao,"template","baseui.ContextMenuContent"),r(Ao,"props",l);var Eo=class extends c{onClick(){this.props.onClick?.(),this.env.contextMenuClose()}};r(Eo,"template","baseui.ContextMenuItem"),r(Eo,"props",{...l,onClick:i(Function)});S();y();var gc={"top-left":["top-0","start-0"],"top-right":["top-0","end-0"],"bottom-left":["bottom-0","start-0"],"bottom-right":["bottom-0","end-0"]};function hi(t){let e=gc[t];return e?["toast-container","position-fixed","p-3","pe-auto",...e]:null}var dt=class extends c{setup(){this.state=w({open:j(this.props)}),this.rootRef=L("root"),this.bootstrapToast=null,this.handleShown=()=>{this.state.open=!0},this.handleHidden=()=>{this.state.open=!1,this.props.onOpenChange?.(!1)},U(()=>{this.mountBootstrapToast(this.props.delay),this.state.open&&this.bootstrapToast.show()}),V(e=>{let s=re(e)?j(e):this.state.open;e.delay!==this.props.delay?(this.bootstrapToast?.dispose(),this.mountBootstrapToast(e.delay),s&&this.bootstrapToast.show()):s!==this.state.open&&(s?this.bootstrapToast?.show():this.bootstrapToast?.hide())}),P(()=>{this.bootstrapToast?.dispose()})}mountBootstrapToast(e){let s=this.rootRef.el,o=e??3e3;this.bootstrapToast=new(O()).Toast(s,{autohide:o>0,delay:o||3e3}),s.addEventListener("shown.bs.toast",this.handleShown),s.addEventListener("hidden.bs.toast",this.handleHidden)}get classNames(){return m("toast","fade","bu-toast",hi(this.props.position),this.props.className)}get role(){return this.props.variant==="danger"?"alert":"status"}get hasActionSlot(){return!!this.props.slots?.action}close(){this.bootstrapToast?.hide()}};r(dt,"template","baseui.Toast"),r(dt,"components",{Button:x}),r(dt,"props",{open:i(Boolean),state:i(String),variant:i(String),delay:i(Number),position:i(String),...l,onOpenChange:i(Function)});S();y();var Co=class extends c{setup(){this.state=w({open:new Set}),N({accordion:this.state,accordionToggle:e=>this.toggle(e)})}toggle(e){let s=!this.state.open.has(e);this.props.multiple||this.state.open.clear(),s?this.state.open.add(e):this.state.open.delete(e),this.props.onChange?.(s)}};r(Co,"template","baseui.Accordion"),r(Co,"props",{multiple:i(Boolean),onChange:i(Function),...l});var Lo=class extends c{setup(){N({accordionItemState:this.props.state,accordionItemValue:this.props.value})}};r(Lo,"template","baseui.AccordionItem"),r(Lo,"props",{value:{type:String},state:i(String),...l});var Le=class extends c{get open(){return this.env.accordionItemState!==void 0?_(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}get triggerAttrs(){return{"data-slot":"accordion-trigger","aria-expanded":this.open?"true":"false"}}onClick(){this.env.accordionToggle(this.env.accordionItemValue)}};r(Le,"template","baseui.AccordionTrigger"),r(Le,"components",{Icon:R,Button:x}),r(Le,"props",l);var ko=class extends c{setup(){this.rootRef=L("root"),this.initialOpen=this.open,pi(this.rootRef,()=>this.open)}get open(){return this.env.accordionItemState!==void 0?_(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}};r(ko,"template","baseui.AccordionContent"),r(ko,"props",l);S();y();var No=class extends c{setup(){this.state=w({open:j(this.props)}),N({collapsible:this.state,collapsibleToggle:()=>this.toggle()}),X(this.state)}toggle(){let e=!this.state.open;Y(this.props,this.state,e)}};r(No,"template","baseui.Collapsible"),r(No,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),...l});var ke=class extends c{get attrs(){return{"aria-expanded":this.env.collapsible.open?"true":"false"}}onClick(){this.env.collapsibleToggle()}};r(ke,"template","baseui.CollapsibleTrigger"),r(ke,"components",{Button:x}),r(ke,"props",l);var Oo=class extends c{setup(){this.rootRef=L("root"),this.initialOpen=this.open,pi(this.rootRef,()=>this.open)}get open(){return this.env.collapsible.open}};r(Oo,"template","baseui.CollapsibleContent"),r(Oo,"props",l);S();y();var Dt=class extends c{};r(Dt,"template","baseui.Breadcrumb"),r(Dt,"props",{...l});var Ft=class extends c{};r(Ft,"template","baseui.BreadcrumbList"),r(Ft,"props",{...l});var Ht=class extends c{get classNames(){return m("bu-breadcrumb-item",this.props.current&&"bu-breadcrumb-page",this.props.className)}};r(Ht,"template","baseui.BreadcrumbItem"),r(Ht,"props",{current:i(Boolean),...l});var Wt=class extends c{get classNames(){return m("bu-breadcrumb-link",this.props.className)}onClick(e){this.props.onClick?.(e)}};r(Wt,"template","baseui.BreadcrumbLink"),r(Wt,"props",{href:i(String),target:i(String),rel:i(String),...l,onClick:i(Function)});var Vt=class extends c{get classNames(){return m("bu-breadcrumb-page",this.props.className)}};r(Vt,"template","baseui.BreadcrumbPage"),r(Vt,"props",{...l});var bt=class extends c{get classNames(){return m("bu-breadcrumb-separator",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};r(bt,"template","baseui.BreadcrumbSeparator"),r(bt,"components",{Icon:R}),r(bt,"props",{...l});var Ne=class extends c{get classNames(){return m("bu-breadcrumb-ellipsis",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};r(Ne,"template","baseui.BreadcrumbEllipsis"),r(Ne,"components",{Icon:R}),r(Ne,"props",{...l});S();y();var To=class extends c{get classNames(){return m("bu-pagination",this.props.className)}};r(To,"template","baseui.Pagination"),r(To,"props",{...l});var Bo=class extends c{get classNames(){return m("page-item",this.props.current&&"active",this.props.disabled&&"disabled")}onClick(){this.props.disabled||this.props.onClick?.()}};r(Bo,"template","baseui.PaginationItem"),r(Bo,"props",{current:i(Boolean),disabled:i(Boolean),style:i([String,Object]),onClick:i(Function),slots:i(Object)});S();y();var Io=class extends c{setup(){this.rootRef=L("root")}onKeyDown(e){let s=[...this.rootRef.el.querySelectorAll("a, button")].filter(n=>!n.disabled),o=s.indexOf(e.target),a=e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;!a||o<0||(e.preventDefault(),s[(o+a+s.length)%s.length]?.focus())}};r(Io,"template","baseui.NavigationMenu"),r(Io,"props",{...l});var Ro=class extends c{};r(Ro,"template","baseui.NavigationMenuItem"),r(Ro,"props",{href:i(String),...l});S();y();var $o=class extends c{get classNames(){return m("bu-menubar",this.props.className)}};r($o,"template","baseui.Menubar"),r($o,"props",{...l});S();y();var Na={...l,href:i(String)};function Oa(t){globalThis.matchMedia?.("(max-width: 767.98px)").matches&&t.setSidebarOpen?.(!1)}var mt=class extends c{setup(){this.state=w({open:j(this.props)}),N({sidebar:this.state,setSidebarOpen:e=>this.setOpen(e)}),X(this.state)}setOpen(e){Y(this.props,this.state,e)}get sidebarState(){return this.state.open?"expanded":"collapsed"}get side(){return this.props.side||"left"}get variant(){return this.props.variant||"sidebar"}get collapsible(){return this.props.collapsible||"offcanvas"}get classNames(){return m("bu-sidebar-root",this.props.className)}onKeyDown(e){e.key==="Escape"&&this.setOpen(!1)}};r(mt,"template","baseui.Sidebar"),r(mt,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),side:i(String),variant:i(String),collapsible:i(String),...l});var Gr=class extends mt{};r(Gr,"template","baseui.Sidebar");var Oe=class extends c{onClick(){if(this.env.setShellCollapsed&&!globalThis.matchMedia?.("(max-width: 767.98px)").matches){this.env.setShellCollapsed(!this.env.shell.collapsed);return}this.env.setSidebarOpen(!this.env.sidebar.open)}};r(Oe,"template","baseui.SidebarTrigger"),r(Oe,"components",{Icon:R,Button:x}),r(Oe,"props",{...l,icon:i(String),label:i(String)});var Kt=class extends c{get open(){return this.env.sidebar.open}};r(Kt,"template","baseui.SidebarContent"),r(Kt,"props",l);var Uo=class extends c{};r(Uo,"template","baseui.SidebarHeader"),r(Uo,"props",l);var Po=class extends c{};r(Po,"template","baseui.SidebarFooter"),r(Po,"props",l);var qo=class extends c{};r(qo,"template","baseui.SidebarInset"),r(qo,"props",l);var Te=class extends c{onClick(){this.env.setSidebarOpen(!this.env.sidebar.open)}};r(Te,"template","baseui.SidebarRail"),r(Te,"components",{Button:x}),r(Te,"props",l);var Mo=class extends c{};r(Mo,"template","baseui.SidebarInput"),r(Mo,"props",{className:i(String),style:i([String,Object]),placeholder:i(String),value:i(String),type:i(String)});var jo=class extends c{};r(jo,"template","baseui.SidebarSeparator"),r(jo,"props",l);var Be=class extends c{onClick(){this.env.setSidebarOpen(!1)}};r(Be,"template","baseui.SidebarClose"),r(Be,"components",{Icon:R,Button:x}),r(Be,"props",{...l,icon:i(String),label:i(String)});var Gt=class extends c{};r(Gt,"template","baseui.SidebarGroup"),r(Gt,"props",{muted:i(Boolean),...l});var Zt=class extends c{};r(Zt,"template","baseui.SidebarGroupLabel"),r(Zt,"props",Na);var Ie=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r(Ie,"template","baseui.SidebarGroupAction"),r(Ie,"components",{Button:x}),r(Ie,"props",{icon:i(String),"aria-label":i(String),ariaLabel:i(String),onClick:i(Function),...l});var zo=class extends c{};r(zo,"template","baseui.SidebarGroupContent"),r(zo,"props",l);var Re=class extends c{setup(){let e=this.props["default-open"]!==void 0||this.props.defaultOpen!==void 0;this.state=w({open:re(this.props)||e?j(this.props):!0}),X(this.state)}get open(){return this.state.open}toggle(){let e=!this.state.open;Y(this.props,this.state,e)}};r(Re,"template","baseui.SidebarGroupCollapsible"),r(Re,"components",{Icon:R,Button:x}),r(Re,"props",{label:{type:String},open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),...l});var ft=class extends c{};r(ft,"template","baseui.SidebarMenu"),r(ft,"props",l);var Jt=class extends c{};r(Jt,"template","baseui.SidebarMenuItem"),r(Jt,"props",l);var ht=class extends c{get classNames(){return m("bu-sidebar-menu-button",this.isActive&&"is-active",this.props.variant&&`is-${this.props.variant}`,this.props.size&&`is-${this.props.size}`,this.props.className)}get isActive(){return this.props.active||this.props.isActive}onClick(e){this.props.onClick?.(e),Oa(this.env)}};r(ht,"template","baseui.SidebarMenuButton"),r(ht,"components",{Icon:R,Button:x}),r(ht,"props",{href:i(String),icon:i(String),active:i(Boolean),isActive:i(Boolean),variant:i(String),size:i(String),tooltip:i(String),disabled:i(Boolean),onClick:i(Function),...l});var $e=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r($e,"template","baseui.SidebarMenuAction"),r($e,"components",{Button:x}),r($e,"props",{icon:i(String),"aria-label":i(String),ariaLabel:i(String),showOnHover:i(Boolean),onClick:i(Function),...l});var _o=class extends c{};r(_o,"template","baseui.SidebarMenuSub"),r(_o,"props",l);var Do=class extends c{};r(Do,"template","baseui.SidebarMenuBadge"),r(Do,"props",l);var Fo=class extends c{setup(){this.state=w({width:this.props.width||`${Math.floor(Math.random()*40)+50}%`})}get style(){return H(`--b-sidebar-skeleton-width:${this.state.width}`,this.props.style)}};r(Fo,"template","baseui.SidebarMenuSkeleton"),r(Fo,"props",{showIcon:i(Boolean),width:i(String),className:i(String),style:i([String,Object])});var Ho=class extends c{};r(Ho,"template","baseui.SidebarMenuSubItem"),r(Ho,"props",l);var Ue=class extends c{get classNames(){return m("bu-sidebar-menu-sub-button",(this.props.active||this.props.isActive)&&"is-active",this.props.size&&`is-${this.props.size}`,this.props.className)}onClick(e){this.props.onClick?.(e),Oa(this.env)}};r(Ue,"template","baseui.SidebarMenuSubButton"),r(Ue,"components",{Button:x}),r(Ue,"props",{...Na,active:i(Boolean),isActive:i(Boolean),size:i(String),onClick:i(Function)});S();y();var Pe=class extends c{setup(){this.state=w({collapsed:this.props.collapsed??this.props.defaultCollapsed??!1,authState:this.props.authState??null}),N({shell:this.state,setShellCollapsed:e=>this.setCollapsed(e)}),V(e=>{e.collapsed!==void 0&&(this.state.collapsed=e.collapsed),this.state.authState=e.authState??null})}setCollapsed(e){this.props.collapsed===void 0&&(this.state.collapsed=e),this.props.onCollapsedChange?.(e)}dismissToast(){this.props.onToastOpenChange?.(!1)}runToastAction(){this.props.toast?.onAction?.()}};r(Pe,"template","baseui.Shell"),r(Pe,"components",{Sidebar:mt,Toast:dt,Button:x}),r(Pe,"props",{open:i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),collapsed:i(Boolean),defaultCollapsed:i(Boolean),onCollapsedChange:i(Function),authState:i(Object),toast:i(Object),onToastOpenChange:i(Function),notificationPage:i(Function),pwa:i(Function),...l});var qe=class extends c{};r(qe,"template","baseui.ShellSidebar"),r(qe,"components",{SidebarContent:Kt}),r(qe,"props",l);var Wo=class extends c{};r(Wo,"template","baseui.ShellSidebarHeader"),r(Wo,"props",l);var Vo=class extends c{};r(Vo,"template","baseui.ShellNav"),r(Vo,"props",l);var Ko=class extends c{};r(Ko,"template","baseui.ShellMain"),r(Ko,"props",l);var Go=class extends c{};r(Go,"template","baseui.ShellHeader"),r(Go,"props",l);var Me=class extends c{};r(Me,"template","baseui.ShellContent"),r(Me,"components",{Skeleton:Rt}),r(Me,"props",{loading:i(Boolean),...l});var je=class extends c{get authState(){return this.env.shell.authState}logout(){this.authState?.onLogout?.()}};r(je,"template","baseui.ShellUserMenu"),r(je,"components",{Button:x}),r(je,"props",l);S();y();var Zo=class extends c{get classNames(){return m("table","bu-table",this.props.striped!==!1&&"table-striped",this.props.hover!==!1&&"table-hover",this.props.className)}};r(Zo,"template","baseui.Table"),r(Zo,"props",{striped:i(Boolean),hover:i(Boolean),responsive:i(Boolean),...l});S();y();var vc=[{key:"status",label:"Status",format:"capitalize"},{key:"email",label:"Email",sortable:!0,filterable:!0},{key:"amount",label:"Amount",align:"right",format:"currency"}],yc=[{id:"728ed52f",status:"success",email:"ken99@example.com",amount:316},{id:"489e1d42",status:"success",email:"abe45@example.com",amount:242},{id:"6b0888f6",status:"processing",email:"monserrat44@example.com",amount:837},{id:"a1dc8c4e",status:"success",email:"silas22@example.com",amount:874},{id:"15b96de0",status:"failed",email:"carmella@example.com",amount:721}],xc=[{label:"Copy payment ID"},{label:"View customer"},{label:"View payment details"}],ze=4,_e=8,Sc=32,De=class extends c{setup(){this.state=w({query:"",sortKey:null,sortDir:1,page:0,pageSize:this.initialPageSize,selectedKeys:[],hiddenColumns:this.columns.filter(e=>e.hidden||e.visible===!1).map(e=>e.key),columnsOpen:!1,actionRowKey:null,actionMenuStyle:null}),this.actionsMenuRef=L("actionsMenu"),this.actionsMenuTriggerEl=null,rs(window,"click",this.onWindowClick,!0),rs(window,"keydown",this.onWindowKeydown),rs(window,"resize",this.closeRowActions),rs(window,"scroll",this.closeRowActions,!0),W(()=>this.refreshActionsMenuPosition())}get columns(){return this.props.columns?.length?this.props.columns:vc}get rows(){return this.props.rows?.length?this.props.rows:yc}get usesDefaultRows(){return!this.props.rows?.length}get initialPageSize(){return this.props["page-size"]??this.props.pageSize??10}get pageSizeOptions(){return this.props["page-size-options"]??this.props.pageSizeOptions??[10,20,50,80]}get rowActions(){return this.props["row-actions"]??this.props.rowActions??(this.usesDefaultRows?xc:[])}get variant(){return this.props.variant||"default"}get classNames(){return m("bu-data-table",`bu-data-table-${this.variant}`,this.props.className)}get viewportStyle(){let e=this.props["max-height"]??this.props.maxHeight;return e?`max-height: ${typeof e=="number"?`${e}px`:e};`:""}get hasSearch(){return this.props.searchable!==!1}get hasSorting(){return this.props.sortable!==!1}get hasPagination(){return this.props.pagination!==!1}get hasColumnToggle(){return this.props["column-toggle"]??this.props.columnToggle??!0}get hasToolbarActions(){return!!this.props.slots?.toolbarActions}get hasSelection(){return this.props.selectable??this.usesDefaultRows}get visibleColumns(){return this.columns.filter(e=>!this.state.hiddenColumns.includes(e.key))}get visibleRows(){let e=this.state.query.toLowerCase(),s=this.columns.filter(n=>n.filterable===!0),o=(s.length?s:this.columns).map(n=>n.key),a=this.rows.filter(n=>!e||o.some(u=>String(n[u]).toLowerCase().includes(e)));return this.state.sortKey&&(a=[...a].sort((n,u)=>String(n[this.state.sortKey]).localeCompare(String(u[this.state.sortKey]))*this.state.sortDir)),a}get pageCount(){return Math.max(1,Math.ceil(this.visibleRows.length/this.state.pageSize))}get pageRows(){if(!this.hasPagination)return this.visibleRows;let s=Math.min(this.state.page,this.pageCount-1)*this.state.pageSize;return this.visibleRows.slice(s,s+this.state.pageSize)}get selectedCount(){return this.state.selectedKeys.length}get selectionLabel(){return`${this.selectedCount} of ${this.visibleRows.length} row(s) selected.`}get emptyLabel(){return this.props["empty-label"]??this.props.emptyLabel??"No results."}get filterPlaceholder(){return this.props["filter-placeholder"]??this.props.filterPlaceholder??"Filter emails..."}get canPreviousPage(){return this.hasPagination&&this.state.page>0}get canNextPage(){return this.hasPagination&&this.state.page<this.pageCount-1}get pageLabel(){return`Page ${Math.min(this.state.page,this.pageCount-1)+1} of ${this.pageCount}`}rowKey(e,s){return e.id??e.key??s}isSelected(e,s){return this.state.selectedKeys.includes(this.rowKey(e,s))}isColumnSortable(e){return this.hasSorting&&e.sortable===!0}onSearchInput(e){this.state.query=e.target.value,this.state.page=0}sortBy(e){let s=this.columns.find(o=>o.key===e);!s||!this.isColumnSortable(s)||(this.state.sortKey===e?this.state.sortDir=-this.state.sortDir:(this.state.sortKey=e,this.state.sortDir=1))}sortIcon(e){return this.state.sortKey!==e?"arrow-up-down":this.state.sortDir===1?"arrow-up":"arrow-down"}toggleColumn(e){this.state.hiddenColumns.includes(e)?this.state.hiddenColumns=this.state.hiddenColumns.filter(s=>s!==e):this.state.hiddenColumns=[...this.state.hiddenColumns,e]}toggleColumnsMenu(){this.state.columnsOpen=!this.state.columnsOpen}toggleRowActions(e,s,o){let a=this.rowKey(e,s);if(this.state.actionRowKey===a){this.closeRowActions();return}this.actionsMenuTriggerEl=o.currentTarget,this.state.actionRowKey=a,this.state.actionMenuStyle=this.estimateActionMenuStyle(o.currentTarget)}closeRowActions(){this.state.actionRowKey!==null&&(this.state.actionRowKey=null,this.state.actionMenuStyle=null,this.actionsMenuTriggerEl=null)}get openRowAction(){if(this.state.actionRowKey===null)return null;let e=this.pageRows.findIndex((s,o)=>this.rowKey(s,o)===this.state.actionRowKey);return e===-1?null:{row:this.pageRows[e],index:e}}estimateActionMenuStyle(e){let s=e.getBoundingClientRect(),o=this.rowActions.length*Sc+ze*2,a=window.innerHeight-s.bottom,u=a<o+ze&&s.top>a?Math.max(_e,s.top-ze-o):s.bottom+ze,p=Math.min(Math.max(_e,s.right-160),window.innerWidth-160-_e);return`position: fixed; top: ${Math.round(u)}px; left: ${Math.round(p)}px;`}refreshActionsMenuPosition(){if(this.state.actionRowKey===null||!this.actionsMenuTriggerEl)return;let e=this.actionsMenuRef.el;if(!e)return;let s=this.actionsMenuTriggerEl.getBoundingClientRect(),o=e.getBoundingClientRect(),a=window.innerHeight-s.bottom,n=s.top,p=a<o.height+ze&&n>a?Math.max(_e,s.top-ze-o.height):Math.min(s.bottom+ze,window.innerHeight-o.height-_e),d=Math.min(Math.max(_e,s.right-o.width),window.innerWidth-o.width-_e),h=`position: fixed; top: ${Math.round(p)}px; left: ${Math.round(d)}px;`;this.state.actionMenuStyle!==h&&(this.state.actionMenuStyle=h)}onWindowClick(e){this.state.actionRowKey===null||this.actionsMenuRef.el?.contains(e.target)||this.actionsMenuTriggerEl?.contains(e.target)||this.closeRowActions()}onWindowKeydown(e){e.key==="Escape"&&this.closeRowActions()}setPage(e){this.state.page=Math.max(0,Math.min(e,this.pageCount-1))}setPageSize(e){this.state.pageSize=Number(e),this.state.page=0}optionValue(e){return`${e}`}toggleRow(e,s,o){let a=this.rowKey(e,s);this.state.selectedKeys=o?[...new Set([...this.state.selectedKeys,a])]:this.state.selectedKeys.filter(n=>n!==a),this.props.onSelectionChange?.(this.state.selectedKeys)}toggleAllVisible(e){let s=this.pageRows.map((o,a)=>this.rowKey(o,a));this.state.selectedKeys=e?[...new Set([...this.state.selectedKeys,...s])]:this.state.selectedKeys.filter(o=>!s.includes(o)),this.props.onSelectionChange?.(this.state.selectedKeys)}onAction(e,s,o){e.onSelect?.(s,o),this.props.onRowAction?.(e,s,o),this.closeRowActions()}columnLabel(e){return e.label??e.key}cellValue(e,s){let o=e[s.key];if(s.format==="currency"){let a=Number(o);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(Number.isFinite(a)?a:0)}if(s.format==="capitalize"){let a=String(o??"");return a.charAt(0).toUpperCase()+a.slice(1)}return o??""}cellComponentProps(e,s){return s.componentProps?s.componentProps(e,s):{row:e,column:s,value:e[s.key]}}};r(De,"template","baseui.DataTable"),r(De,"components",{Button:x,Icon:R}),r(De,"props",{columns:i(Array),rows:i(Array),variant:i(String),searchable:i(Boolean),sortable:i(Boolean),pagination:i(Boolean),selectable:i(Boolean),"column-toggle":i(Boolean),columnToggle:i(Boolean),"row-actions":i(Array),rowActions:i(Array),"page-size":i(Number),pageSize:i(Number),"page-size-options":i(Array),pageSizeOptions:i(Array),"filter-placeholder":i(String),filterPlaceholder:i(String),"empty-label":i(String),emptyLabel:i(String),onRowAction:i(Function),onSelectionChange:i(Function),...l,"max-height":i([String,Number]),maxHeight:i([String,Number])});S();y();var wc=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}),Ac=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Fe=class extends c{get baseDate(){return this.props.selected?new Date(`${this.props.selected}T00:00:00`):new Date}get month0(){return(this.props.month??this.baseDate.getMonth()+1)-1}get year(){return this.props.year??this.baseDate.getFullYear()}get headerLabel(){return wc.format(new Date(this.year,this.month0,1))}get weekdays(){return Ac}get days(){let e=new Date(this.year,this.month0+1,0).getDate(),s=new Date(this.year,this.month0,1).getDay(),o=[];for(let a=0;a<s;a++)o.push(null);for(let a=1;a<=e;a++){let n=`${this.year}-${String(this.month0+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`;o.push({day:a,value:n,selected:n===this.props.selected})}return o}onSelect(e){this.props.onChange?.(e)}};r(Fe,"template","baseui.Calendar"),r(Fe,"components",{Button:x}),r(Fe,"props",{selected:i(String),month:i(Number),year:i(Number),className:i(String),style:i([String,Object]),onChange:i(Function)});y();var Jo=class extends G{get classNames(){return m("bu-date-picker","form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onChange?.(e.target.value,e)}};r(Jo,"template","baseui.DatePicker"),r(Jo,"props",{...tt,value:i(String),className:i(String),style:i([String,Object]),onChange:i(Function)});S();y();var Xo=class extends G{setup(){super.setup(),this.rootRef=L("root");let{state:e}=js(this.rootRef);this.disclosure=e,this.state=w({query:this.selectedLabel})}get classNames(){return m("form-control",this.controlClass,this.isInvalid&&"is-invalid")}get selectedLabel(){return this.props.options.find(e=>e.value===this.props.value)?.label||""}get filteredOptions(){let e=this.state.query.toLowerCase();return this.props.options.filter(s=>s.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value,this.disclosure.open=!0}onFocus(){this.disclosure.open=!0}choose(e){this.state.query=e.label,this.disclosure.open=!1,this.props.onChange?.(e.value)}};r(Xo,"template","baseui.Combobox"),r(Xo,"props",{options:{type:Array},...tt,value:i(String),className:i(String),style:i([String,Object]),id:i(String),onChange:i(Function)});S();y();var Yo=class extends c{setup(){this.state=w({query:""})}get filteredItems(){let e=this.state.query.toLowerCase();return this.props.items.filter(s=>s.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value}select(e){this.props.onSelect?.(e.value)}};r(Yo,"template","baseui.Command"),r(Yo,"props",{items:{type:Array},placeholder:i(String),className:i(String),style:i([String,Object]),onSelect:i(Function)});S();y();var Qo=class extends c{get classNames(){return m("bu-chart",this.props.type&&`bu-chart-${this.props.type}`,this.props.variant&&`bu-chart-${this.props.variant}`,this.props.className)}};r(Qo,"template","baseui.Chart"),r(Qo,"props",{config:i([String,Object]),label:i(String),type:i(String),value:i([String,Number]),variant:i(String),...l});S();y();var tr=class extends c{setup(){this.state=w({index:this.props.defaultIndex??0}),this.rootRef=L("root"),this.bootstrapCarousel=null,this.onSlid=e=>{this.state.index=e.to,this.props.onChange?.(this.state.index)},N({carousel:this.state,carouselInstance:()=>this.bootstrapCarousel}),U(()=>{this.bootstrapCarousel=new(O()).Carousel(this.rootRef.el,{interval:!1,wrap:!0,touch:!0}),this.rootRef.el.addEventListener("slid.bs.carousel",this.onSlid)}),P(()=>{this.rootRef.el.removeEventListener("slid.bs.carousel",this.onSlid),this.bootstrapCarousel?.dispose()})}};r(tr,"template","baseui.Carousel"),r(tr,"props",{slideCount:{type:Number},defaultIndex:i(Number),onChange:i(Function),...l});var er=class extends c{setup(){this.rootRef=L("root"),this.initialActive=this.active,W(()=>{if(!this.rootRef.el)return;let e=this.rootRef.el.classList.contains("active");this.active&&!e?this.rootRef.el.classList.add("active"):!this.active&&e&&this.rootRef.el.classList.remove("active")})}get active(){return this.props.state!==void 0?_(this.props.state):this.env.carousel.index===this.props.index}};r(er,"template","baseui.CarouselSlide"),r(er,"props",{index:{type:Number},state:i(String),...l});var He=class extends c{onClick(){this.env.carouselInstance()?.prev()}};r(He,"template","baseui.CarouselPrevious"),r(He,"components",{Button:x}),r(He,"props",l);var We=class extends c{onClick(){this.env.carouselInstance()?.next()}};r(We,"template","baseui.CarouselNext"),r(We,"components",{Button:x}),r(We,"props",l);S();y();var sr=class extends c{setup(){this.panelRef=L("panel"),this.state=w({width:null})}get panelStyle(){return this.state.width?`width:${this.state.width}px`:""}onPointerDown(e){let s=e.clientX,o=this.panelRef.el.getBoundingClientRect().width,a=this.props.min||160,n=this.props.max||720,u=d=>{this.state.width=Math.min(n,Math.max(a,o+d.clientX-s))},p=()=>{document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",p),this.props.onChange?.(this.state.width)};document.addEventListener("pointermove",u),document.addEventListener("pointerup",p)}};r(sr,"template","baseui.Resizable"),r(sr,"props",{min:i(Number),max:i(Number),onChange:i(Function),...l});S();y();var or=class extends c{get classNames(){return m("bu-scroll-area",this.props.className)}};r(or,"template","baseui.ScrollArea"),r(or,"props",l);S();y();var Ta={idle:"bu-attachment-idle",uploading:"bu-attachment-uploading",processing:"bu-attachment-processing",error:"bu-attachment-error",done:"bu-attachment-done"},Ba={default:"bu-attachment-default",sm:"bu-attachment-sm",xs:"bu-attachment-xs"},rr=class extends c{get state(){return Ta[this.props.state]?this.props.state:"done"}get size(){return Ba[this.props.size]?this.props.size:"default"}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return m("bu-attachment",Ta[this.state],Ba[this.size],`bu-attachment-${this.orientation}`,!this.hasContent&&"bu-attachment-picker",this.props.className)}get hasContent(){return!!this.props.slots?.default}onChange(e){this.props.onChange?.([...e.target.files])}};r(rr,"template","baseui.Attachment"),r(rr,"props",{state:i(String),size:i(String),orientation:i(String),multiple:i(Boolean),...l,onChange:i(Function)});var ir=class extends c{get variant(){return this.props.variant==="image"?"image":"icon"}get classNames(){return m("bu-attachment-media",`bu-attachment-media-${this.variant}`,this.props.className)}};r(ir,"template","baseui.AttachmentMedia"),r(ir,"props",{variant:i(String),...l});var ar=class extends c{};r(ar,"template","baseui.AttachmentContent"),r(ar,"props",l);var nr=class extends c{};r(nr,"template","baseui.AttachmentTitle"),r(nr,"props",l);var cr=class extends c{};r(cr,"template","baseui.AttachmentDescription"),r(cr,"props",l);var ur=class extends c{};r(ur,"template","baseui.AttachmentActions"),r(ur,"props",l);var Ve=class extends c{get variant(){return this.props.variant||"ghost"}get size(){return this.props.size||"icon-xs"}get className(){return m("bu-button-icon","bu-attachment-action",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r(Ve,"template","baseui.AttachmentAction"),r(Ve,"components",{Button:x}),r(Ve,"props",{type:i(String),variant:i(String),size:i(String),disabled:i(Boolean),label:i(String),...l,"aria-label":i(String),ariaLabel:i(String),onClick:i(Function)});var Ke=class extends c{get classNames(){return m("bu-attachment-trigger",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r(Ke,"template","baseui.AttachmentTrigger"),r(Ke,"components",{Button:x}),r(Ke,"props",{href:i(String),target:i(String),rel:i(String),type:i(String),className:i(String),style:i([String,Object]),"aria-label":i(String),ariaLabel:i(String),onClick:i(Function)});var lr=class extends c{get classNames(){return m("bu-attachment-group",this.props.className)}};r(lr,"template","baseui.AttachmentGroup"),r(lr,"props",{...l});var pr=class extends c{setup(){this.state=w({dragging:!1}),this.fileInput=L("fileInput")}get hasContent(){return!!this.props.slots?.default}get classNames(){return m("bu-attachment-dropzone",this.state.dragging&&"bu-attachment-dropzone-dragging",this.props.disabled&&"bu-attachment-dropzone-disabled",this.props.className)}openPicker(){this.props.disabled||this.fileInput.el?.click()}onInputChange(e){let s=Array.from(e.target.files??[]);e.target.value="",s.length&&this.props.onFilesSelected?.(s)}onDragOver(e){e.preventDefault(),!this.props.disabled&&(this.state.dragging=!0)}onDragLeave(){this.state.dragging=!1}onDrop(e){if(e.preventDefault(),this.state.dragging=!1,this.props.disabled)return;let s=Array.from(e.dataTransfer?.files??[]);s.length&&this.props.onFilesSelected?.(s)}};r(pr,"template","baseui.AttachmentDropzone"),r(pr,"props",{multiple:i(Boolean),disabled:i(Boolean),...l,onFilesSelected:i(Function)});S();y();var dr=class extends c{setup(){this.state=w({errored:!1})}get showImage(){return!!this.props.src&&!this.state.errored}onError(){this.state.errored=!0}};r(dr,"template","baseui.Avatar"),r(dr,"props",{src:i(String),alt:i(String),title:i(String),...l});S();y();var br=class extends c{get classNames(){return m("bu-message",this.props.className)}get side(){return this.props.side||"incoming"}};r(br,"template","baseui.Message"),r(br,"props",{side:i(String),...l});S();y();var hr=class extends c{setup(){this.rootRef=L("root"),st(()=>{this.props.autoscroll!==!1&&this.rootRef.el&&(this.rootRef.el.scrollTop=this.rootRef.el.scrollHeight)})}};r(hr,"template","baseui.MessageScroller"),r(hr,"props",{autoscroll:i(Boolean),...l});S();y();var mr=class extends c{setup(){this.state=w({index:0}),N({questionnaire:this.state,questionnaireShow:e=>this.show(e)})}show(e){this.state.index=Math.min(this.props.stepCount-1,Math.max(0,e)),this.props.onChange?.(this.state.index)}};r(mr,"template","baseui.Questionnaire"),r(mr,"props",{stepCount:{type:Number},onChange:i(Function),...l});var fr=class extends c{get active(){return this.props.state!==void 0?_(this.props.state):this.env.questionnaire.index===this.props.index}};r(fr,"template","baseui.QuestionnaireStep"),r(fr,"props",{index:{type:Number},state:i(String),...l});var Ge=class extends c{get disabled(){return this.env.questionnaire.index===0}onClick(){this.env.questionnaireShow(this.env.questionnaire.index-1)}};r(Ge,"template","baseui.QuestionnairePrevious"),r(Ge,"components",{Button:x}),r(Ge,"props",l);var Ze=class extends c{onClick(){this.env.questionnaireShow(this.env.questionnaire.index+1)}};r(Ze,"template","baseui.QuestionnaireNext"),r(Ze,"components",{Button:x}),r(Ze,"props",{...l,stepCount:i(Number)});S();y();var gr=class extends c{get max(){return this.props.max||100}get value(){return Math.min(this.max,Math.max(0,this.props.value||0))}get style(){return H(`--b-progress-value:${this.value/this.max*100}%`,this.props.style)}get classNames(){return m("bu-progress",this.props.className)}};r(gr,"template","baseui.Progress"),r(gr,"props",{value:i(Number),max:i(Number),className:i(String),style:i([String,Object])});S();y();var vr=class extends c{get classNames(){return m("bu-aspect-ratio",this.props.className)}get style(){let e=this.props.ratio||`${this.props.width||16} / ${this.props.height||9}`;return H(`--b-aspect-ratio:${e}`,this.props.style)}};r(vr,"template","baseui.AspectRatio"),r(vr,"props",{ratio:i(String),width:i(Number),height:i(Number),...l});S();y();var yr=class extends c{get classNames(){return m("bu-bubble",this.props.className)}get side(){return this.props.side}};r(yr,"template","baseui.Bubble"),r(yr,"props",{side:i(String),...l});S();y();var xr=class extends c{get dir(){return this.props.dir==="rtl"?"rtl":"ltr"}};r(xr,"template","baseui.Direction"),r(xr,"props",{dir:i(String),...l});S();y();var Sr=class extends c{get classNames(){return m("bu-item",this.props.className)}get variant(){return this.props.variant}};r(Sr,"template","baseui.Item"),r(Sr,"props",{variant:i(String),...l});S();y();var wr=class extends c{get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return m("bu-button-group",this.orientation==="vertical"?"btn-group-vertical":"btn-group",(this.props.size==="sm"||this.props.size==="lg")&&`btn-group-${this.props.size}`,this.props.className)}get ariaLabel(){return this.props["aria-label"]}get ariaLabelledby(){return this.props["aria-labelledby"]}};r(wr,"template","baseui.ButtonGroup"),r(wr,"props",{orientation:i(String),size:i(String),"aria-label":i(String),"aria-labelledby":i(String),...l});var Ar=class extends c{get orientation(){return this.props.orientation==="horizontal"?"horizontal":"vertical"}get classNames(){return m("bu-button-group-separator",`bu-button-group-separator-${this.orientation}`,this.props.className)}};r(Ar,"template","baseui.ButtonGroupSeparator"),r(Ar,"props",{orientation:i(String),className:i(String),style:i([String,Object])});var Er=class extends c{get classNames(){return m("bu-button-group-text",this.props.className)}};r(Er,"template","baseui.ButtonGroupText"),r(Er,"props",{...l});S();y();var Cr=class extends c{get classNames(){return m("bu-field-set",this.props.className)}};r(Cr,"template","baseui.FieldSet"),r(Cr,"props",{...l});var Lr=class extends c{get variant(){return this.props.variant||"legend"}get classNames(){return m("bu-field-legend",this.props.className)}};r(Lr,"template","baseui.FieldLegend"),r(Lr,"props",{variant:i(String),...l});var Xt=class extends c{get classNames(){return m("bu-field-group",this.props.className)}};r(Xt,"template","baseui.FieldGroup"),r(Xt,"props",{...l});var Yt=class extends c{setup(){N({fieldProps:()=>this.props})}get orientation(){return this.props.orientation||"vertical"}get classNames(){return m("bu-field",`bu-field-orientation-${this.orientation}`,this.props.className)}};r(Yt,"template","baseui.Field"),r(Yt,"props",{orientation:i(String),invalid:i(Boolean),label:i(String),labelBackground:i(String),description:i(String),useTip:i(Number),error:i(String),...l});var kr=class extends c{get classNames(){return m("bu-field-content",this.props.className)}};r(kr,"template","baseui.FieldContent"),r(kr,"props",{...l});var Qt=class extends c{get classNames(){return m("bu-field-label",this.props.className)}};r(Qt,"template","baseui.FieldLabel"),r(Qt,"props",{for:i(String),...l});var Nr=class extends c{get classNames(){return m("bu-field-title",this.props.className)}};r(Nr,"template","baseui.FieldTitle"),r(Nr,"props",{...l});var te=class extends c{get classNames(){return m("bu-field-description",this.props.className)}};r(te,"template","baseui.FieldDescription"),r(te,"props",{...l});var Or=class extends c{get hasContent(){return!!this.props.slots?.default}get classNames(){return m("bu-field-separator",this.props.className)}};r(Or,"template","baseui.FieldSeparator"),r(Or,"props",{...l});var ee=class extends c{get classNames(){return m("bu-field-error",this.props.className)}};r(ee,"template","baseui.FieldError"),r(ee,"props",{message:i(String),...l});function Ia(t){return`Icon${String(t).split("-").filter(Boolean).map(s=>s[0].toUpperCase()+s.slice(1)).join("")}`}S();y();var Tr=class extends c{get classNames(){return m("form-label","b-label","bu-label",this.props.className)}get state(){return this.props.state||(this.props.required?"required":void 0)}};r(Tr,"template","baseui.Label"),r(Tr,"props",{for:i(String),required:i(Boolean),state:i(String),...l});S();var Ec="bu-theme",Cc="theme",Lc="[b-theme-toggle]",kc="[b-theme-label]";function _i(t){return t==="dark"?"dark":"light"}function Nc(t){return typeof globalThis.location>"u"?null:new URLSearchParams(globalThis.location.search).get(t)}function Oc(t,e=document.documentElement){let s=_i(t);return globalThis.thebase?.theme?.set?globalThis.thebase.theme.set(s):e&&(e.setAttribute("b-theme",s),e.setAttribute("data-bs-theme",s)),s}function Ra(t,e,s){try{t.contentWindow?.BaseUI?.theme.set(e),t.contentDocument?.documentElement.setAttribute("b-theme",e),t.contentDocument?.documentElement.setAttribute("data-bs-theme",e)}catch{let o=new URL(t.getAttribute("src"),globalThis.location.href);o.searchParams.set(s,e),t.setAttribute("src",o.pathname+o.search+o.hash)}}function Tc(t){typeof document>"u"||typeof CustomEvent>"u"||document.dispatchEvent(new CustomEvent("baseui:theme-change",{detail:{theme:t}}))}function se(t={}){let e=t.storageKey||Ec,s=t.queryKey||Cc,o=t.toggleSelector??Lc,a=t.labelSelector??kc,n=t.root||(typeof document>"u"?null:document.documentElement);function u(){return Nc(s)}function p(){return _i(u()||globalThis.localStorage?.getItem(e)||n?.getAttribute("b-theme")||"light")}function d(k){typeof document>"u"||!o||document.querySelectorAll(o).forEach(v=>{v.setAttribute("aria-pressed",k==="dark"?"true":"false");let A=a?v.querySelector(a):null;A&&(A.textContent=k==="dark"?"Light theme":"Dark theme")})}function h(k){typeof document>"u"||document.querySelectorAll("iframe").forEach(v=>Ra(v,k,s))}function f(k,v={}){let A=Oc(k,n);return!v.skipStorage&&!u()&&globalThis.localStorage?.setItem(e,A),d(A),h(A),Tc(A),A}function g(){return f(n?.getAttribute("b-theme")==="dark"?"light":"dark")}function C(){if(typeof document>"u")return p();let k=p();return f(k,{skipStorage:!!u()}),o&&document.addEventListener("click",v=>{v.target.closest?.(o)&&g()}),document.querySelectorAll("iframe").forEach(v=>{v.addEventListener("load",()=>Ra(v,n?.getAttribute("b-theme")||k,s))}),k}return{current:p,set:f,toggle:g,syncFrames:h,init:C}}var $a=se();typeof window<"u"&&(window.BaseUITheme=$a);y();y();as();var Ua=["btn","bu-theme-button",...Object.values(K),...Object.values(J)];function Br(t){let e=t==="dark";return{icon:e?"sun":"moon",label:e?"Switch to light theme":"Switch to dark theme",pressed:e?"true":"false"}}function mi({variant:t="outline",size:e,className:s}={}){return m("btn","bu-theme-button",K[t]||K.outline,J[e],s)}var gt=class extends c{setup(){this.theme=se({storageKey:Z(this.props,"storage-key","storageKey")}),this.state=w({theme:this.theme.current()}),this.onThemeChange=e=>{this.state.theme=e.detail?.theme||this.theme.current()},U(()=>{this.state.theme=this.theme.set(this.theme.current(),{skipStorage:!0}),document.addEventListener("baseui:theme-change",this.onThemeChange)}),P(()=>document.removeEventListener("baseui:theme-change",this.onThemeChange))}get iconName(){return Br(this.state.theme).icon}get baseUrl(){return Z(this.props,"base-url")}get label(){return Br(this.state.theme).label}get pressed(){return Br(this.state.theme).pressed}get classNames(){return mi(this.props)}get attrs(){return{"b-theme-button":""}}onClick(){let e=this.theme.toggle();this.state.theme=e,this.props.onChange?.(e)}};r(gt,"template","baseui.ThemeButton"),r(gt,"components",{Icon:R,Button:x}),r(gt,"props",{variant:i(String),size:i(String),"base-url":i(String),"storage-key":i(String),storageKey:i(String),className:i(String),style:i([String,Object]),onChange:i(Function)});S();y();var Je=class extends c{get classNames(){return m("bu-toggle","btn",this.props.variant==="outline"?"btn-outline-secondary":"btn-light",this.props.className)}get pressed(){return this.props.state!==void 0?_(this.props.state):!!this.props.pressed}onClick(){this.props.onChange?.(!this.pressed)}};r(Je,"template","baseui.Toggle"),r(Je,"components",{Button:x}),r(Je,"props",{pressed:i(Boolean),state:i(String),variant:i(String),...l,onChange:i(Function)});S();y();var Ir=class extends c{setup(){this.state=w({selected:new Set}),N({toggleGroup:this.state,toggleGroupSelect:e=>this.select(e)})}select(e){this.props.multiple?this.state.selected.has(e)?this.state.selected.delete(e):this.state.selected.add(e):this.state.selected=this.state.selected.has(e)?new Set:new Set([e]);let s=this.props.multiple?[...this.state.selected]:[...this.state.selected][0];this.props.onChange?.(s)}};r(Ir,"template","baseui.ToggleGroup"),r(Ir,"props",{multiple:i(Boolean),onChange:i(Function),...l});var Xe=class extends c{get pressed(){return this.env.toggleGroup.selected.has(this.props.value)}onClick(){this.env.toggleGroupSelect(this.props.value)}};r(Xe,"template","baseui.ToggleGroupItem"),r(Xe,"components",{Button:x}),r(Xe,"props",{value:{type:String},...l});S();y();S();y();vi();function yi(t){let e=String(t??""),s=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e);if(!s)return{data:{},content:e};let o={};for(let a of s[1].split(/\r?\n/)){let n=a.trim();if(!n||n.startsWith("#"))continue;let u=n.indexOf(":");if(u===-1)continue;let p=n.slice(0,u).trim();p&&(o[p]=du(n.slice(u+1).trim()))}return{data:o,content:e.slice(s[0].length)}}function Ha(t){return t.length>=2&&(t[0]==='"'&&t.at(-1)==='"'||t[0]==="'"&&t.at(-1)==="'")?t.slice(1,-1):t}function du(t){if(t==="")return"";if(t==="true")return!0;if(t==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1).trim();return e?e.split(",").map(s=>Ha(s.trim())):[]}return Ha(t)}var vt=class extends c{setup(){this.rootRef=L("root"),this.editorRef=L("editor"),this.editorHandle=null,this.state=w({html:"",source:"",status:"loading",error:"",frontmatter:{}}),nt(()=>this.load(this.props)),V(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),U(()=>this.afterRender()),W(()=>this.afterRender()),ae(()=>{this.destroyEditor(),this.rootRef.el&&Rr(this.rootRef.el)})}get classNames(){return m("bu-markdown",this.props.className)}get editorLabel(){return this.props.collaborative?"Collaborative Markdown editor":"Markdown editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src}shouldRestartEditor(e){return e.editable!==this.props.editable||e.collaborative!==this.props.collaborative||e.room!==this.props.room||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=e.content??"";if(e.src)try{let o=await fetch(e.src);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);s=await o.text()}catch(o){this.state.status="error",this.state.error=o.message||String(o);return}try{this.state.source=s;let{data:o,content:a}=yi(s);this.state.frontmatter=o,this.state.html=Ri(await Zr(a)),this.state.status="ready"}catch(o){this.state.status="error",this.state.error=o.message||String(o)}}get hasFrontmatterMeta(){let e=this.state.frontmatter;return!!(e.tags?.length||e.authors?.length)}enhance(){let e=this.rootRef.el;!e||this.state.status!=="ready"||Jr(e,{mermaid:this.props.mermaid!==!1,baseUi:this.props.baseUi!==!1})}afterRender(){this.props.editable?this.mountEditor():this.enhance()}async mountEditor(){let e=this.editorRef.el;if(!(!e||this.editorHandle||this.state.status!=="ready"))try{this.editorHandle=await Xr({root:e,value:this.state.source,collaborative:!!this.props.collaborative,room:this.props.room||"bu-markdown",password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(s,o,a)=>{this.state.source=s,this.props.onChange?.(s,o,a)}})}catch(s){this.state.status="error",this.state.error=s.message||String(s)}}destroyEditor(){this.editorHandle?.destroy?.(),this.editorHandle=null}};r(vt,"template","baseui.Markdown"),r(vt,"components",{Badge:at}),r(vt,"props",{content:i(String),src:i(String),mermaid:i(Boolean),baseUi:i(Boolean),editable:i(Boolean),collaborative:i(Boolean),room:i(String),password:i(String),signaling:i(Array),user:i(Object),onChange:i(Function),className:i(String),style:i([String,Object])});var Ji=["get","post","put","patch","delete","options","head","trace","query"];function bu(t,e,s){let o=String(t||"").trim();if(!o)return"";let a=o.replace(/\{([^}]+)\}/g,(n,u)=>{let p=s&&typeof s=="object"?s[u]:null;return p&&p.default!==void 0?String(p.default):`{${u}}`});try{return new URL(a,`${e}/`).href.replace(/\/$/,"")}catch{return a.replace(/\/$/,"")}}function D(t,e){if(t&&typeof t=="object"&&typeof t.$ref=="string"){let s=t.$ref.replace(/^#\//,"").split("/"),o=e;for(let a of s)o=o?.[decodeURIComponent(a.replace(/~1/g,"/").replace(/~0/g,"~"))];return o?{...o}:{}}return t}function Yi(t,e){if(!Array.isArray(t?.allOf))return t;let s={...t,properties:{...t.properties},required:[...t.required||[]]};delete s.allOf;for(let o of t.allOf){let a=Yi(D(o,e),e)||{};Object.assign(s.properties,a.properties),s.required.push(...a.required||[]),s.type||(s.type=a.type)}return s}function hu(t,e){if(!t)return null;let s=D(t,e);return!s||typeof s!="object"?null:s}function Xi(t){return t&&typeof t.$ref=="string"?t.$ref.split("/").pop():null}function Va(t,e){if(!t||typeof t!="object")return null;for(let[s,o]of Object.entries(t)){let a=hu(o,e);if(a){if(a.dataValue!==void 0)return{key:s,label:a.summary||s,value:a.dataValue,isAuto:!1};if(a.serializedValue!==void 0)return{key:s,label:a.summary||s,value:a.serializedValue,isAuto:!1};if(a.value!==void 0)return{key:s,label:a.summary||s,value:a.value,isAuto:!1};if(a.externalValue)return{key:s,label:a.summary||s,value:a.externalValue,isAuto:!1}}}return null}function Qi(t){if(t){if(t.example!==void 0)return t.example;if(t.default!==void 0)return t.default;if(Array.isArray(t.enum)&&t.enum.length)return t.enum[0]}}function Gi(t,e){if(!t)return null;let s=Va(t.examples,e);if(s)return s;if(t.example!==void 0)return{label:"media example",value:t.example,isAuto:!1};let o=D(t.schema,e),a=Qi(o);return a!==void 0?{label:"schema example",value:a,isAuto:!1}:null}function Ka(t,e){let s=Va(t.examples,e);if(s)return s;if(t.example!==void 0)return{label:"example",value:t.example,isAuto:!1};let o=D(t.schema,e),a=Qi(o);return a!==void 0?{label:"schema example",value:a,isAuto:!1}:null}function $r(t,e,s=new Set){if(!t)return null;let o=Xi(t);if(o){if(s.has(o))return{};s=new Set(s).add(o)}let a=Yi(D(t,e),e);if(!a)return null;let n=Qi(a);if(n!==void 0)return n;if(a.type==="array"||a.items)return[$r(a.items||{},e,s)];if(a.properties||a.type==="object"){let u={};for(let[p,d]of Object.entries(a.properties||{}))u[p]=$r(d,e,s);return u}switch(a.type){case"integer":return a.minimum??0;case"number":return a.minimum??0;case"boolean":return!0;case"string":return a.format==="date-time"?new Date().toISOString():a.format==="date"?new Date().toISOString().slice(0,10):a.format==="byte"?"base64==":a.title||"string";default:return null}}function Yr(t,e,{depth:s=0,prefix:o="",seen:a=new Set,required:n=!1,selfRow:u=!0}={}){if(!t||s>4)return[];let p=Xi(t);if(p){if(a.has(p))return[];a=new Set(a).add(p)}let d=Yi(D(t,e),e),h=[],f=d.contentMediaType||d.contentEncoding?[d.contentMediaType,d.contentEncoding&&`encoding:${d.contentEncoding}`].filter(Boolean).join(", "):"",g=d.discriminator?.propertyName?`discriminator: ${d.discriminator.propertyName}`:"";if(Array.isArray(d.prefixItems))return u&&h.push({path:o||"items",type:"tuple",required:n,description:d.description||""}),d.prefixItems.forEach((C,k)=>{h.push(...Yr(C,e,{depth:s+1,prefix:`${o}[${k}]`,seen:a,required:!1}))}),d.items&&h.push(...Yr(d.items,e,{depth:s+1,prefix:`${o}[n]`,seen:a,required:!1})),h;if(d.type==="array"||d.items)return u&&h.push({path:o||"items",type:"array",required:n,description:d.description||""}),h.push(...Yr(d.items||{},e,{depth:s+1,prefix:`${o}[]`,seen:a,required:!1})),h;if(d.properties||d.type==="object"||d.patternProperties){let C=new Set(d.required||[]);for(let[k,v]of Object.entries(d.properties||{})){let A=D(v,e),T=o?`${o}.${k}`:k;h.push({path:T,type:A.type||(A.$ref?Xi(v):"any")||"any",format:A.format||"",enum:A.enum,required:C.has(k),description:A.description||""}),(A.type==="object"||A.properties||A.type==="array"||A.items)&&h.push(...Yr(v,e,{depth:s+1,prefix:T,seen:a,required:C.has(k),selfRow:!1}))}for(let[k,v]of Object.entries(d.patternProperties||{})){let A=D(v,e);h.push({path:o?`${o}.<${k}>`:`<${k}>`,type:A.type||"any",format:A.format||"",required:!1,description:A.description||""})}return h}return h.push({path:o||"value",type:d.type||"any",format:d.format||"",enum:d.enum,required:n,description:[d.description,f,g].filter(Boolean).join(" \u2014 ")}),h}function mu(t){let e=Ka(t,this);return{name:t.name,in:t.in,required:!!t.required,type:t.type||t.schema?.type||"string",format:t.format||t.schema?.format||"",description:t.description||"",default:t.default??t.schema?.default,enum:t.enum||t.schema?.enum,example:e?e.value:void 0,exampleLabel:e?e.label:""}}var fu={authorizationCode:"accessCode",implicit:"implicit",password:"password",clientCredentials:"application"};function gu(t){if(t.type==="http")return{...t,type:String(t.scheme).toLowerCase()==="basic"?"basic":"bearer"};if(t.type==="openIdConnect")return{...t,type:"bearer",oauth2MetadataUrl:t.openIdConnectUrl};if(t.type!=="oauth2"||!t.flows)return t;let[e,s]=Object.entries(t.flows)[0]||[];return{...t,...s,flow:fu[e]||e,scopes:s?.scopes||{}}}function Ga(t){let e=t.securityDefinitions||t.components?.securitySchemes||{};return Object.fromEntries(Object.entries(e).map(([s,o])=>[s,gu(D(o,t))]))}function vu(t,e){let s=Ga(e),o=t.security||e.security||[],a=[];for(let n of o)for(let u of Object.keys(n)){let p=s[u];p&&a.push({key:u,...p})}return a}function Zi(t,e,s,o){let a={path:[],query:[],header:[],formData:[],body:null};for(let h of o.parameters||[]){let f=D(h,t);if(f.in==="body"){let g={schema:f.schema},C=Gi(g,t);a.body={required:!!f.required,schema:f.schema,description:f.description||"",contentType:"application/json",example:C?C.value:$r(f.schema,t),exampleLabel:C?C.label:"auto",exampleIsAuto:!C}}else a[f.in]&&a[f.in].push(mu.call(t,f))}if(o.requestBody){let h=D(o.requestBody,t)||{},[f,g]=Object.entries(h.content||{})[0]||[];if(f&&g){let C=Gi(g,t);a.body={required:!!h.required,schema:g.schema||null,description:h.description||"",contentType:f,encoding:g.encoding||null,itemSchema:g.itemSchema||null,example:C?C.value:$r(g.schema,t),exampleLabel:C?C.label:"auto",exampleIsAuto:!C}}}let n=Object.entries(o.responses||{}).map(([h,f])=>{let g=D(f,t)||{},[C,k]=Object.entries(g.content||{})[0]||[],v=k?Gi(k,t):null;return{status:h,summary:g.summary||"",description:g.description||"",contentType:C||"application/json",schema:k?.schema||g.schema||null,encoding:k?.encoding||null,headers:yu(g.headers,t),links:xu(g.links,t),example:v?v.value:k?.schema?$r(k.schema,t):null,exampleLabel:v?v.label:"auto",exampleIsAuto:!v&&!!k?.schema}}).sort((h,f)=>{let g=Wa(h.status),C=Wa(f.status);return g-C}),u=Su(o.callbacks,t),p=s.toUpperCase();return{id:(o.operationId||`${s}-${e}`).replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase(),method:p,path:e,tag:o.tags&&o.tags[0]||"default",summary:o.summary||o.operationId||`${p} ${e}`,description:o.description||"",deprecated:!!o.deprecated,produces:o.produces||t.produces||["application/json"],consumes:o.consumes||t.consumes||(a.body?["application/json"]:[]),parameters:a,responses:n,callbacks:u,externalDocs:o.externalDocs||null,security:vu(o,t)}}function yu(t,e){return!t||typeof t!="object"?[]:Object.entries(t).map(([s,o])=>{let a=D(o,e)||{},n=Ka({...a,in:"header"},e);return{name:s,required:!!a.required,deprecated:!!a.deprecated,type:a.schema?.type||"string",description:a.description||"",example:n?n.value:void 0}})}function xu(t,e){return!t||typeof t!="object"?[]:Object.entries(t).map(([s,o])=>{let a=D(o,e)||{};return{name:s,operationId:a.operationId||"",operationRef:a.operationRef||"",description:a.description||"",parameters:a.parameters||{}}})}function Su(t,e){if(!t||typeof t!="object")return[];let s=[];for(let[o,a]of Object.entries(t)){let n=D(a,e)||{};for(let[u,p]of Object.entries(n)){let d=D(p,e)||{};for(let h of Ji)d[h]&&s.push({name:o,expression:u,method:h.toUpperCase(),summary:d[h].summary||"",description:d[h].description||""})}}return s}function Wa(t){if(t==="default")return 999;let e=parseInt(t,10);return Number.isNaN(e)?998:e}async function ta(t,e=""){let s=await fetch(t);if(!s.ok)throw new Error(`Failed to fetch spec: HTTP ${s.status}`);return xi(await s.json(),e)}function xi(t,e=""){if(!t||typeof t!="object"||!t.paths&&!t.webhooks)throw new Error("Not an OpenAPI document (missing paths).");let s=t.schemes&&t.schemes.includes("https")?"https":t.schemes?.[0]||"https",o=t.host||location.host,a=t.basePath||"",n=`${s}://${o}${a}`.replace(/\/$/,""),u=e?[{name:"",url:e.replace(/\/$/,""),description:""}]:Array.isArray(t.servers)&&t.servers.length?t.servers.map(v=>({name:v?.name||"",url:bu(v?.url,n,v?.variables),description:String(v?.description||"").trim()})).filter(v=>v.url):[{name:"",url:n,description:""}],p=u[0]?.url||n,d=(t.tags||[]).map(v=>v.name),h=new Map((t.tags||[]).map(v=>[v.name,v])),f=[];for(let[v,A]of Object.entries(t.paths||{})){let T=D(A,t)||{};for(let q of Ji)T[q]&&f.push(Zi(t,v,q,T[q]));for(let[q,B]of Object.entries(T.additionalOperations||{}))f.push(Zi(t,v,q.toLowerCase(),B))}let g=[];for(let[v,A]of Object.entries(t.webhooks||{})){let T=D(A,t)||{};for(let q of Ji)T[q]&&g.push(Zi(t,v,q,T[q]))}let k=[...new Set([...d,...f.map(v=>v.tag)])].map(v=>{let A=h.get(v);return{id:v.replace(/[^a-zA-Z0-9]+/g,"-").toLowerCase(),name:v,summary:A?.summary||"",description:A?.description||"",parent:A?.parent||"",kind:A?.kind||"",items:f.filter(T=>T.tag===v)}}).filter(v=>v.items.length);return{spec:t,info:t.info||{},baseUrl:p,derivedBaseUrl:n,servers:u,securityDefinitions:Ga(t),groups:k,webhooks:g,resolveRef:v=>D(v,t),generateExample:v=>$r(v,t),schemaRows:v=>Yr(v,t),findOperation:v=>f.find(A=>A.id===v)||g.find(A=>A.id===v),firstOperation:()=>f[0]}}var Qr=[{id:"curl",label:"CURL",icon:"img/bash-plain.svg"},{id:"csharp",label:"CSHARP",icon:"img/csharp-original.svg"},{id:"go",label:"GO",icon:"img/go-original-wordmark.svg"},{id:"node",label:"NODEJS",icon:"img/nodejs-original.svg"},{id:"ruby",label:"RUBY",icon:"img/ruby-plain.svg"},{id:"php",label:"PHP",icon:"img/php-original.svg"},{id:"javascript",label:"JAVASCRIPT",icon:"img/javascript-original.svg"},{id:"python",label:"PYTHON",icon:"img/python-original.svg"},{id:"java",label:"JAVA",icon:"img/java-original.svg"},{id:"c",label:"C",icon:"img/c-original.svg"},{id:"swift",label:"SWIFT",icon:"img/swift-original.svg"},{id:"objc",label:"OBJECTIVE-C",icon:"img/objectivec-plain.svg"},{id:"kotlin",label:"KOTLIN",icon:"img/kotlin-original.svg"},{id:"rust",label:"RUST",icon:"img/rust-original.svg"},{id:"powershell",label:"POWERSHELL",icon:"img/windows8-original.svg"},{id:"dart",label:"DART",icon:"img/dart-original.svg"},{id:"lua",label:"LUA",icon:"img/lua.svg"}];function wu(t){let e=new URL(t.url);return(t.query||[]).forEach(([s,o])=>{s&&e.searchParams.set(s,String(o||""))}),e.toString()}function Au(t,e){let s=[];return(t.headers||[]).forEach(([a,n])=>{a&&s.push([a,String(n??"")])}),e&&t.bodyText&&!Eu(s,"Content-Type")&&s.push(["Content-Type",t.mimeType||"application/json"]),s}function Eu(t,e){let s=e.toLowerCase();return t.some(function(o){return String(o[0]||"").toLowerCase()===s})}function Cu(t,e){return String(t||"").split(`
|
|
12
|
-
|
|
13
|
-
`)}function
|
|
14
|
-
`)
|
|
15
|
-
|
|
16
|
-
`)
|
|
17
|
-
`
|
|
18
|
-
`)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`)}
|
|
22
|
-
`)}
|
|
23
|
-
`)
|
|
24
|
-
`)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
`)}function Hu(t,e,s){let o=["$headers = @{"];return s.forEach(function(a){o.push(' "'+Ei(a[0])+'" = "'+Ei(a[1])+'"')}),o.push("}",""),t.bodyText&&o.push('$body = @"',t.bodyText,'"@',""),o.push("$response = Invoke-RestMethod -Method "+t.method+' -Uri "'+Ei(e)+'" -Headers $headers'+(t.bodyText?' -Body $body -ContentType "'+Ei(t.mimeType||"application/json")+'"':""),"$response | ConvertTo-Json -Depth 10"),o.join(`
|
|
28
|
-
`)}function
|
|
29
|
-
`)}function
|
|
30
|
-
`)
|
|
31
|
-
`)
|
|
32
|
-
`)
|
|
33
|
-
`)
|
|
34
|
-
`),a=o.filter(u=>u.trim()).map(u=>u.match(/^\s*/)?.[0].length||0),n=a.length?Math.min(...a):0;return o.map(u=>u.slice(n)).join(`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
`);await is(o,e,{templates:`<templates>${a}</templates>`}),Ci.set(Ci.current(),{skipStorage:!0})}mountStaticBaseUI(e=document){il(e),globalThis.thebase?.mountAll(e),Ci.set(Ci.current(),{skipStorage:!0})}};r(ts,"template","baseui.BlockViewer"),r(ts,"components",{Button:x,Icon:R,ThemeButton:gt}),r(ts,"props",{navItems:i(Array)});S();y();var Pr=class extends c{setup(){this.pwaState=w({open:j(this.props)}),N({pwa:this.pwaState,setPwaOpen:e=>this.setOpen(e)}),X(this.pwaState)}setOpen(e){Y(this.props,this.pwaState,e)}};r(Pr,"template","baseui.Pwa"),r(Pr,"props",{open:i(Boolean),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var es=class extends c{onClick(){this.env.setPwaOpen(!0)}};r(es,"template","baseui.PwaTrigger"),r(es,"components",{Button:x}),r(es,"props",l);var qr=class extends c{setup(){this.rootRef=L("root"),st(e=>{if(!e)return;let s=document.activeElement;return Fs(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.pwa.open])}get open(){return this.env.pwa.open}onKeyDown(e){e.key==="Escape"&&this.env.setPwaOpen(!1)}onBackdropClick(e){e.target===this.rootRef.el&&this.env.setPwaOpen(!1)}};r(qr,"template","baseui.PwaContent"),r(qr,"props",l);var Mr=class extends c{};r(Mr,"template","baseui.PwaHeader"),r(Mr,"props",l);var jr=class extends c{};r(jr,"template","baseui.PwaTitle"),r(jr,"props",l);var zr=class extends c{};r(zr,"template","baseui.PwaDescription"),r(zr,"props",l);var _r=class extends c{};r(_r,"template","baseui.PwaBody"),r(_r,"props",l);var Dr=class extends c{get steps(){return Array.isArray(this.props.steps)?this.props.steps:[]}};r(Dr,"template","baseui.PwaSteps"),r(Dr,"props",{...l,steps:i(Array)});var Fr=class extends c{};r(Fr,"template","baseui.PwaFooter"),r(Fr,"props",l);var ss=class extends c{onClick(){this.env.setPwaOpen(!1)}};r(ss,"template","baseui.PwaClose"),r(ss,"components",{Button:x}),r(ss,"props",l);S();y();var dn="",bn="";function hn(t,e){return typeof t=="string"?t:e}function al(t){return{title:t.submitted&&t.title.trim().length>0&&t.title.trim().length<5?"Bug title must be at least 5 characters.":"",description:t.submitted&&t.description.length>0&&t.description.length<20?"Description must be at least 20 characters.":""}}var os=class extends c{setup(){this.state=w({title:hn(this.props.title,dn),description:hn(this.props.description,bn),submitted:!1})}get classNames(){return m("bu-form",this.props.className)}get titlePlaceholder(){return this.props.titlePlaceholder||"Login button not working on mobile"}get descriptionPlaceholder(){return this.props.descriptionPlaceholder||"I'm having an issue with the login button on mobile."}get maxDescriptionLength(){return this.props.maxDescriptionLength||100}get descriptionLength(){return this.state.description.length}get errors(){return al(this.state)}get titleInvalid(){return!!this.errors.title}get descriptionInvalid(){return!!this.errors.description}reset(){this.state.title=dn,this.state.description=bn,this.state.submitted=!1}submit(e){e.preventDefault(),this.state.submitted=!0,!this.titleInvalid&&!this.descriptionInvalid&&this.props.onSubmit?.({title:this.state.title.trim(),description:this.state.description})}};r(os,"template","baseui.Form"),r(os,"components",{Button:x,Field:Yt,FieldDescription:te,FieldError:ee,FieldGroup:Xt,FieldLabel:Qt}),r(os,"props",{title:i(String),description:i(String),titlePlaceholder:i(String),descriptionPlaceholder:i(String),maxDescriptionLength:i(Number),className:i(String),style:i([String,Object]),onSubmit:i(Function)});S();y();var ca;function nl(){return ca??(ca=import("./runtime/milkdown/milkdown-text-editor.js")),ca}async function Li(t){return(await nl()).createMilkdownTextEditor(t)}function ki({collaborative:t,providerType:e,url:s}={}){return!!t||!!(e&&s)}var Hr=class extends c{setup(){this.editorRef=L("editor"),this.editorHandle=null,this.mountPromise=null,this.mountToken=0,this.isDestroyed=!1,this.state=w({content:"",status:"loading",error:""}),nt(()=>this.load(this.props)),V(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),U(()=>this.mountEditor()),W(()=>this.mountEditor()),ae(()=>{this.isDestroyed=!0,this.destroyEditor()})}get classNames(){return m("bu-text-editor",this.props.className)}get isCollaborative(){return ki({collaborative:this.props.collaborative,providerType:this.props.provider,url:this.props.url})}get editorLabel(){return this.isCollaborative?"Collaborative rich text editor":"Rich text editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src}shouldRestartEditor(e){return e.collaborative!==this.props.collaborative||e.provider!==this.props.provider||e.room!==this.props.room||e.url!==this.props.url||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=e.content??"";if(e.src)try{let o=await fetch(e.src);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);s=await o.text()}catch(o){this.state.status="error",this.state.error=o.message||String(o);return}this.state.content=s,this.state.status="ready"}async mountEditor(){let e=this.editorRef.el;if(this.isDestroyed||!e||this.editorHandle||this.mountPromise||this.state.status!=="ready")return;let s=++this.mountToken;return this.mountPromise=(async()=>{try{let o=await Li({root:e,value:this.state.content,placeholder:this.props.placeholder,collaborative:this.isCollaborative,providerType:this.props.provider,room:this.props.room||"bu-text-editor",url:this.props.url,password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(a,n,u)=>{this.state.content=a,this.props.onChange?.(a,n,u)}});if(s!==this.mountToken){o.destroy?.();return}this.editorHandle=o}catch(o){s===this.mountToken&&(this.state.status="error",this.state.error=o.message||String(o))}finally{this.mountPromise=null,this.isDestroyed||this.mountEditor()}})(),this.mountPromise}destroyEditor(){this.mountToken++,this.editorHandle?.destroy?.(),this.editorHandle=null}};r(Hr,"template","baseui.TextEditor"),r(Hr,"props",{content:i(String),src:i(String),placeholder:i(String),collaborative:i(Boolean),provider:i(String),room:i(String),url:i(String),password:i(String),signaling:i(Array),user:i(Object),onChange:i(Function),className:i(String),style:i([String,Object])});E();function cl(t){let{open:e,close:s,destroy:o}=bi(t,{closeSelector:"[b-alert-dialog-cancel], [b-alert-dialog-action], [b-alert-dialog-close]",trapFocus:!0});return t.setAttribute("role","alertdialog"),t.BaseUIAlertDialog={open:e,close:s},{destroy:()=>{o(),delete t.BaseUIAlertDialog}}}b.register("alert-dialog",{type:"owl",mount:cl});E();var la={default:"bu-alert-default",destructive:"bu-alert-destructive",info:"bu-alert-default",success:"alert-success",warning:"alert-warning",danger:"bu-alert-destructive"};function ul(t){t.classList.add("alert","bu-alert",la[t.getAttribute("b-att-variant")||"default"]||la.default),t.setAttribute("role",t.getAttribute("role")||"alert");let e=null;if(!!t.getAttribute("b-att-dismissible")){if(t.classList.add("alert-dismissible","fade","show"),!t.querySelector('[data-bs-dismiss="alert"]')){let o=document.createElement("button");o.type="button",o.className="btn-close",o.setAttribute("data-bs-dismiss","alert"),o.setAttribute("aria-label","Close"),t.appendChild(o)}e=new(O()).Alert(t)}return{destroy:()=>{e?.dispose(),t.classList.remove("alert","bu-alert","alert-dismissible","fade","show",...Object.values(la))}}}b.register("alert",{type:"static",mount:ul});S();E();function mn(t,e){return t.getAttribute(e)!=="false"}function ll(t){let e=t.getAttribute("b-att-templates");if(e)return e;let s=[...document.scripts].find(o=>/\/baseui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(o.src));return s?s.src.replace(/[?#].*$/,"").replace(/[^/]*$/,"baseui.templates.xml"):"/dist/baseui.templates.xml"}function pl(t){let e=(o,a)=>t.dispatchEvent(new CustomEvent(`baseui:${o}`,{bubbles:!0,detail:a})),s=t.getAttribute("b-att-languages");return{src:t.getAttribute("b-att-src")||void 0,title:t.getAttribute("b-att-title")||void 0,serverUrl:t.getAttribute("b-att-server-url")||void 0,theme:t.getAttribute("b-att-theme")||void 0,themeToggle:t.getAttribute("b-att-theme-toggle")==="true",hash:t.getAttribute("b-att-hash")==="true",operation:t.getAttribute("b-att-operation")||void 0,tryIt:mn(t,"b-att-try-it"),authorize:mn(t,"b-att-authorize"),languages:s?s.split(",").map(o=>o.trim()).filter(Boolean):void 0,language:t.getAttribute("b-att-language")||void 0,assetBase:t.getAttribute("b-att-asset-base")??void 0,oauthRedirectUri:t.getAttribute("b-att-oauth-redirect-uri")||void 0,height:t.getAttribute("b-att-height")||void 0,onLoad:o=>e("load",{info:o.info,operations:o.groups.flatMap(a=>a.items).length}),onError:o=>e("error",{error:o}),onNavigate:o=>e("navigate",{id:o})}}function dl(t){let e=pl(t),s=ie(ll(t)).then(o=>is(yt,t,{templates:o,props:e}));return{destroy:async()=>{(await s).destroy()}}}b.register("apidoc",{type:"owl",mount:dl});E();function bl(t){let e=[...t.querySelectorAll("[b-accordion-item]")],s=t.getAttribute("b-att-multiple")==="true",o=new Map,a=new Map,n=new Map,u=(p,d)=>{let h=p.querySelector("[b-accordion-trigger]");p.setAttribute("b-att-state",d?"open":"closed"),h?.setAttribute("aria-expanded",String(d)),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{open:d}}))};return t.setAttribute("role","presentation"),e.forEach((p,d)=>{let h=p.querySelector("[b-accordion-trigger]"),f=p.querySelector("[b-accordion-panel]");if(!f)return;let g=f.id||`bu-accordion-panel-${d}`;f.id=g;let C=p.getAttribute("b-att-state")==="open";f.classList.add("collapse"),C&&f.classList.add("show");let k=new(O()).Collapse(f,{toggle:!1});n.set(p,k);let v=()=>u(p,!0),A=()=>u(p,!1);f.addEventListener("shown.bs.collapse",v),f.addEventListener("hidden.bs.collapse",A),a.set(p,{onShown:v,onHidden:A}),h?.setAttribute("aria-expanded",String(C)),h?.setAttribute("aria-controls",g);let T=()=>{let q=f.classList.contains("show");!s&&!q&&e.forEach(B=>{if(B===p)return;let F=n.get(B),et=B.querySelector("[b-accordion-panel]");F&&et?.classList.contains("show")&&F.hide()}),q?k.hide():k.show()};o.set(p,T),h?.addEventListener("click",T)}),{destroy:()=>{e.forEach(p=>{let d=p.querySelector("[b-accordion-trigger]"),h=p.querySelector("[b-accordion-panel]");d?.removeEventListener("click",o.get(p));let f=a.get(p);h&&f&&(h.removeEventListener("shown.bs.collapse",f.onShown),h.removeEventListener("hidden.bs.collapse",f.onHidden)),n.get(p)?.dispose()}),o.clear(),a.clear(),n.clear()}}}b.register("accordion",{type:"owl",mount:bl});E();function hl(t){let e=t.getAttribute("b-att-ratio")||`${t.getAttribute("b-att-width")||16} / ${t.getAttribute("b-att-height")||9}`;return t.classList.add("bu-aspect-ratio"),t.style.setProperty("--b-aspect-ratio",e),{destroy:()=>t.classList.remove("bu-aspect-ratio")}}b.register("aspect-ratio",{type:"static",mount:hl});E();as();var ml=["idle","uploading","processing","error","done"],fl=["default","sm","xs"],gl=["content","title","description","actions"];function fn(t,e){t.classList.add(`bu-attachment-${e}`),t.setAttribute("data-slot",`attachment-${e}`)}function vl(t){let e=t.querySelector("input[type='file']"),s=t.querySelector("[b-attachment-list]"),o=ml.includes(t.getAttribute("b-att-state"))?t.getAttribute("b-att-state"):"done",a=fl.includes(t.getAttribute("b-att-size"))?t.getAttribute("b-att-size"):"default",n=t.getAttribute("b-att-orientation")==="vertical"?"vertical":"horizontal";t.classList.add("bu-attachment"),t.classList.add(`bu-attachment-${o}`,`bu-attachment-${a}`,`bu-attachment-${n}`),t.setAttribute("data-state",o),t.setAttribute("data-size",a),t.setAttribute("data-orientation",n),t.setAttribute("data-slot","attachment"),e&&t.classList.add("bu-attachment-picker"),t.querySelectorAll("[b-attachment-media]").forEach(p=>{let d=p.getAttribute("b-att-variant")==="image"?"image":"icon";fn(p,"media"),p.classList.add(`bu-attachment-media-${d}`),p.setAttribute("data-variant",d)}),gl.forEach(p=>t.querySelectorAll(`[b-attachment-${p}]`).forEach(d=>fn(d,p))),t.querySelectorAll("[b-attachment-action]").forEach(p=>{let d=K[p.getAttribute("b-att-variant")]||K.ghost,h=J[p.getAttribute("b-att-size")]||J["icon-xs"];p.classList.add("btn","bu-button",d,h,"bu-button-icon","bu-attachment-action"),p.setAttribute("data-slot","attachment-action"),!p.getAttribute("type")&&p.tagName==="BUTTON"&&p.setAttribute("type","button")}),t.querySelectorAll("[b-attachment-trigger]").forEach(p=>{p.classList.add("bu-attachment-trigger"),p.setAttribute("data-slot","attachment-trigger"),!p.getAttribute("type")&&p.tagName==="BUTTON"&&p.setAttribute("type","button")}),e?.classList.add("form-control");let u=()=>{s&&(s.innerHTML=[...e.files].map(p=>`<li>${p.name}</li>`).join("")),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{files:[...e.files]}}))};return e?.addEventListener("change",u),{destroy:()=>e?.removeEventListener("change",u)}}function yl(t){return t.classList.add("bu-attachment-group"),t.setAttribute("data-slot","attachment-group"),{destroy:()=>t.classList.remove("bu-attachment-group")}}function xl(t){let e=t.querySelector("input[type='file']");t.classList.add("bu-attachment-dropzone"),t.setAttribute("data-slot","attachment-dropzone");let s=()=>e?.click(),o=d=>{d.preventDefault(),t.classList.add("bu-attachment-dropzone-dragging")},a=()=>t.classList.remove("bu-attachment-dropzone-dragging"),n=d=>{d.length&&t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{files:d}}))},u=d=>{d.preventDefault(),t.classList.remove("bu-attachment-dropzone-dragging"),n([...d.dataTransfer?.files??[]])},p=()=>{n([...e?.files??[]]),e&&(e.value="")};return t.addEventListener("click",s),t.addEventListener("dragover",o),t.addEventListener("dragleave",a),t.addEventListener("drop",u),e?.addEventListener("change",p),{destroy:()=>{t.removeEventListener("click",s),t.removeEventListener("dragover",o),t.removeEventListener("dragleave",a),t.removeEventListener("drop",u),e?.removeEventListener("change",p)}}}b.register("attachment",{type:"owl",mount:vl});b.register("attachment-group",{type:"static",mount:yl});b.register("attachment-dropzone",{type:"static",mount:xl});E();function Sl(t){t.classList.add("bu-avatar");let e=t.querySelector("img"),s=t.querySelector("[b-avatar-fallback]");if(e&&s){let o=()=>{e.hidden=!0,s.hidden=!1};return s.hidden=!!e.getAttribute("src"),e.addEventListener("error",o),{destroy:()=>e.removeEventListener("error",o)}}return{}}b.register("avatar",{type:"static",mount:Sl});E();function wl(t){let e=ce[t.getAttribute("b-att-variant")||"secondary"]||ce.secondary;return t.classList.add("badge",e),t.getAttribute("b-att-pill")==="true"&&t.classList.add("rounded-pill"),{destroy:()=>t.classList.remove("badge","rounded-pill",...Object.values(ce))}}b.register("badge",{type:"static",mount:wl});E();it();function gn(t){return[...t.children].filter(e=>!e.matches("[b-breadcrumb-separator], .bu-breadcrumb-separator"))}function yn(t,e,s){return z(t,e,{size:s}),t}function Al(){let t=document.createElement("li"),e=document.createElement("span");return t.setAttribute("b-breadcrumb-separator",""),t.setAttribute("data-slot","breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),t.className="bu-breadcrumb-separator",e.className="bu-breadcrumb-separator-icon",t.append(yn(e,"chevron-right","var(--b3_5)")),t}function El(t){t.classList.add("bu-breadcrumb-separator"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true")}function Cl(t){if(t.classList.add("bu-breadcrumb-ellipsis"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-ellipsis"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),!t.querySelector(".bu-icon")){let e=document.createElement("span");e.className="bu-breadcrumb-ellipsis-icon",t.prepend(yn(e,"ellipsis","var(--b4)"))}if(!t.querySelector(".visually-hidden")){let e=document.createElement("span");e.className="visually-hidden",e.textContent="More",t.append(e)}}function vn(t){t.classList.add("bu-breadcrumb-page"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-page"),t.setAttribute("role",t.getAttribute("role")||"link"),t.setAttribute("aria-disabled","true"),t.setAttribute("aria-current","page")}function Ll(t){let e=t.querySelector("ol, ul")||t;t.classList.add("bu-breadcrumb"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb"),t.setAttribute("aria-label",t.getAttribute("aria-label")||"breadcrumb"),e.classList.add("breadcrumb","bu-breadcrumb-list"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"breadcrumb-list");for(let o of e.querySelectorAll("[b-breadcrumb-separator], .bu-breadcrumb-separator"))El(o);for(let o of e.querySelectorAll("[b-breadcrumb-ellipsis], .bu-breadcrumb-ellipsis"))Cl(o);for(let o of e.querySelectorAll("[b-breadcrumb-page], .bu-breadcrumb-page"))vn(o);e.querySelector("[b-breadcrumb-separator], .bu-breadcrumb-separator")||gn(e).slice(0,-1).forEach(a=>a.after(Al()));let s=gn(e);return s.forEach((o,a)=>{o.classList.add("bu-breadcrumb-item"),o.setAttribute("data-slot",o.getAttribute("data-slot")||"breadcrumb-item");for(let n of o.querySelectorAll("a"))n.classList.add("bu-breadcrumb-link"),n.setAttribute("data-slot",n.getAttribute("data-slot")||"breadcrumb-link");if(a===s.length-1){let n=o.querySelector("[b-breadcrumb-page], .bu-breadcrumb-page");n?vn(n):(o.classList.add("bu-breadcrumb-page"),o.setAttribute("aria-current",o.getAttribute("aria-current")||"page"))}}),{destroy:()=>{t.classList.remove("bu-breadcrumb"),e.classList.remove("breadcrumb","bu-breadcrumb-list");for(let o of e.querySelectorAll("[b-breadcrumb-separator]"))o.remove()}}}b.register("breadcrumb",{type:"owl",mount:Ll});E();function kl(t){return t.classList.add("bu-bubble"),t.getAttribute("role")||t.setAttribute("role","listitem"),{destroy:()=>t.classList.remove("bu-bubble")}}b.register("bubble",{type:"static",mount:kl});E();it();as();function Nl(t){return[...t.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE&&e.textContent.trim()).map(e=>{let s=document.createElement("span");return s.textContent=e.textContent.trim(),e.replaceWith(s),s})}function Ol(t){let e=t.getAttribute("b-att-icon"),s=t.getAttribute("b-att-icon-position")==="end"?"end":"start",o=!!t.textContent.trim(),a=e&&o?Nl(t):[],n=null;return t.classList.add("btn","bu-button",K[t.getAttribute("b-att-variant")||"default"]||"btn-primary"),J[t.getAttribute("b-att-size")]&&t.classList.add(J[t.getAttribute("b-att-size")]),t.dataset.slot="button",e&&(n=document.createElement("span"),n.setAttribute("b-icon",e),n.dataset.icon=`inline-${s}`,z(n,e,{label:""}),t.insertBefore(n,s==="end"?null:t.firstChild),t.dataset.icon=`inline-${s}`,o||(t.dataset.iconOnly="true",t.classList.add("bu-button-icon"))),{destroy:()=>{n?.remove();for(let u of a)u.replaceWith(document.createTextNode(u.textContent));t.classList.remove("btn","bu-button","bu-button-icon",...Object.values(K),...Object.values(J)),t.removeAttribute("data-slot"),t.removeAttribute("data-icon"),t.removeAttribute("data-icon-only")}}}b.register("button",{type:"static",mount:Ol});E();function Tl(t){let e=t.getAttribute("b-att-orientation")==="vertical",s=t.getAttribute("b-att-size"),o=[...t.querySelectorAll("[b-button-group-separator]")],a=[...t.querySelectorAll("[b-button-group-text]")];return t.classList.add("bu-button-group",e?"btn-group-vertical":"btn-group"),(s==="sm"||s==="lg")&&t.classList.add(`btn-group-${s}`),t.setAttribute("role",t.getAttribute("role")||"group"),o.forEach(n=>{let u=n.getAttribute("b-att-orientation")==="horizontal"?"horizontal":"vertical";n.classList.add("bu-button-group-separator",`bu-button-group-separator-${u}`),n.setAttribute("data-orientation",u),n.setAttribute("role","separator")}),a.forEach(n=>{n.classList.add("bu-button-group-text")}),{destroy:()=>{t.classList.remove("bu-button-group","btn-group","btn-group-vertical","btn-group-sm","btn-group-lg")}}}b.register("button-group",{type:"static",mount:Tl});E();var Bl=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"});function Il(t){let e=t.getAttribute("b-att-selected")?new Date(`${t.getAttribute("b-att-selected")}T00:00:00`):new Date,s=Number(t.getAttribute("b-att-month")??e.getMonth()+1)-1,o=Number(t.getAttribute("b-att-year")??e.getFullYear()),a=new Date(o,s,1),n=new Date(o,s+1,0).getDate(),u=a.getDay();t.classList.add("bu-calendar"),t.querySelector("[b-calendar-grid]")||(t.innerHTML=`
|
|
38
|
-
<div class="bu-calendar__header">${Bl.format(a)}</div>
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
`);let p=t.querySelector("[b-calendar-grid]");p.innerHTML="";for(let h=0;h<u;h+=1)p.append(document.createElement("span"));for(let h=1;h<=n;h+=1){let f=document.createElement("button"),g=`${o}-${String(s+1).padStart(2,"0")}-${String(h).padStart(2,"0")}`;f.type="button",f.textContent=String(h),f.setAttribute("b-att-value",g),f.setAttribute("aria-pressed",String(g===t.getAttribute("b-att-selected"))),p.append(f)}let d=h=>{let f=h.target.closest("button[b-att-value]");f&&(t.setAttribute("b-att-selected",f.getAttribute("b-att-value")),p.querySelectorAll("button").forEach(g=>g.setAttribute("aria-pressed",String(g===f))),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:f.getAttribute("b-att-value")}})))};return p.addEventListener("click",d),{destroy:()=>p.removeEventListener("click",d)}}b.register("calendar",{type:"owl",mount:Il});E();function Rl(t){return t.classList.add("card","bu-card"),t.querySelector("[b-card-header]")?.classList.add("card-header"),t.querySelector("[b-card-body]")?.classList.add("card-body"),t.querySelector("[b-card-footer]")?.classList.add("card-footer"),{destroy:()=>t.classList.remove("card","bu-card")}}b.register("card",{type:"static",mount:Rl});E();function $l(t){let e=[...t.querySelectorAll("[b-carousel-slide]")],s=t.querySelector("[b-carousel-prev]"),o=t.querySelector("[b-carousel-next]");if(t.classList.add("carousel","slide"),e.length&&!e[0].parentElement.classList.contains("carousel-inner")){let h=document.createElement("div");h.classList.add("carousel-inner"),e[0].before(h),e.forEach(f=>h.appendChild(f))}let a=Math.max(0,e.findIndex(h=>h.getAttribute("b-att-state")==="active"));e.forEach((h,f)=>{h.classList.add("carousel-item"),f===a&&h.classList.add("active"),h.setAttribute("b-att-state",f===a?"active":"inactive")});let n=e.length?new(O()).Carousel(t,{interval:!1,wrap:!0,touch:!0}):null,u=h=>{e.forEach((f,g)=>{f.setAttribute("b-att-state",g===h.to?"active":"inactive")}),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{index:h.to}}))};t.addEventListener("slid.bs.carousel",u);let p=()=>n?.prev(),d=()=>n?.next();return s?.addEventListener("click",p),o?.addEventListener("click",d),{destroy:()=>{s?.removeEventListener("click",p),o?.removeEventListener("click",d),t.removeEventListener("slid.bs.carousel",u),n?.dispose()}}}b.register("carousel",{type:"owl",mount:$l});E();function xn(t,e,s=0){let o=Number(t.getAttribute(e));return Number.isFinite(o)?o:s}function Ul(t){let e=t.getAttribute("b-att-config")||t.querySelector("script[type='application/json']")?.textContent;if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Pl(t,e){let s=globalThis.getComputedStyle(t),o=[1,2,3,4,5].map(u=>s.getPropertyValue(`--b-chart-${u}`).trim()),a=s.getPropertyValue("--b-muted-foreground").trim(),n=s.getPropertyValue("--b-chart-grid").trim()||s.getPropertyValue("--b-border").trim();return e.options={maintainAspectRatio:!1,plugins:{legend:{labels:{boxWidth:8,boxHeight:8,color:a,font:{size:12}}},tooltip:{titleFont:{size:12},bodyFont:{size:12},cornerRadius:10,padding:10},...e.options?.plugins||{}},scales:{x:{border:{display:!1},grid:{display:!1},ticks:{color:a,font:{size:12}}},y:{border:{display:!1},grid:{color:n},ticks:{color:a,font:{size:12}}},...e.options?.scales||{}},...e.options},e.data?.datasets?.forEach((u,p)=>{u.backgroundColor||(u.backgroundColor=o[p%o.length]),u.borderColor||(u.borderColor=o[p%o.length]),u.borderRadius??(u.borderRadius=4)}),e}function ql(t,e,s){if(t.querySelector("[b-chart-tooltip]"))return;let o=document.createElement("span");o.setAttribute("b-chart-tooltip",""),o.textContent=`${e}: ${s}`,t.append(o)}function Ml(t){t.classList.add("bu-chart"),t.setAttribute("role",t.getAttribute("role")||"figure");let e=t.querySelector("canvas"),s=null;if(e&&globalThis.Chart){let n=Ul(t);n&&(s=new globalThis.Chart(e,Pl(t,n)))}let o=[...t.querySelectorAll("[b-att-value]")],a=Math.max(1,...o.map(n=>xn(n,"b-att-value")));return o.forEach((n,u)=>{let p=xn(n,"b-att-value"),d=n.getAttribute("b-att-label")||n.textContent.trim()||`Series ${u+1}`,h=Math.max(0,Math.min(100,p/a*100));n.style.setProperty("--b-chart-value",`${h}%`),n.style.setProperty("--b-chart-index",String(u%5+1)),n.style.setProperty("--b-chart-color",`var(--b-chart-${u%5+1})`),n.setAttribute("role",n.getAttribute("role")||"listitem"),n.setAttribute("aria-label",n.getAttribute("aria-label")||`${d} ${p}`),ql(n,d,p)}),[...t.querySelectorAll("[b-chart-series], [b-chart-legend] > *")].forEach((n,u)=>{n.style.setProperty("--b-chart-color",n.style.getPropertyValue("--b-chart-color")||`var(--b-chart-${u%5+1})`)}),{destroy:()=>{s?.destroy?.(),t.classList.remove("bu-chart")}}}b.register("chart",{type:"static",mount:Ml});E();function Ni(t,e){let s=t.matches("input")?t:t.querySelector(`input[type='${e}']`),o=t.matches("input")?t.closest("label, .form-check"):t;return s?.classList.add("form-check-input"),o?.classList.add("form-check","bu-check"),{destroy:()=>{s?.classList.remove("form-check-input"),o?.classList.remove("form-check","bu-check")}}}b.register("checkbox",{type:"static",mount:t=>Ni(t,"checkbox")});E();it();ci();function jl(t){let e=t.getAttribute("b-att-value");if(e!==null)return e;let s=t.getAttribute("b-att-target");if(s){let o=document.querySelector(s);if(o)return o.textContent??""}return t.textContent??""}function zl(t){t.classList.remove(...qi),t.className=`${t.className} ${ni({variant:t.getAttribute("b-att-variant")||"default",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button";let e=t.querySelector("[b-clipboard-button-icon]");e||(e=document.createElement("span"),e.setAttribute("b-clipboard-button-icon",""),t.prepend(e));let s=t.getAttribute("b-att-icon")||"copy",o=t.getAttribute("b-att-copied-icon")||"check";z(e,s,{label:""});let a=null,n=async()=>{if(t.disabled)return;let u=jl(t);try{await ns(u),z(e,o,{label:""}),t.setAttribute("data-copied","true"),t.dispatchEvent(new CustomEvent("baseui:clipboard-copy",{bubbles:!0,detail:{value:u}})),window.clearTimeout(a),a=window.setTimeout(()=>{z(e,s,{label:""}),t.removeAttribute("data-copied")},Number(t.getAttribute("b-att-reset-delay"))||2e3)}catch(p){t.dispatchEvent(new CustomEvent("baseui:clipboard-copy-error",{bubbles:!0,detail:{error:p}}))}};return t.addEventListener("click",n),{destroy:()=>{t.removeEventListener("click",n),window.clearTimeout(a),e.remove(),t.classList.remove(...qi),t.removeAttribute("data-copied")}}}b.register("clipboard-button",{type:"static",mount:zl});E();function _l(t){let e=t.querySelector("[b-collapsible-trigger]"),s=t.querySelector("[b-collapsible-panel]"),o=h=>{t.setAttribute("b-att-state",h?"open":"closed"),e?.setAttribute("aria-expanded",String(h)),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{open:h}}))};if(!s){let h=()=>o(t.getAttribute("b-att-state")!=="open");return e?.setAttribute("aria-expanded",String(t.getAttribute("b-att-state")==="open")),e?.addEventListener("click",h),{destroy:()=>e?.removeEventListener("click",h)}}let a=t.getAttribute("b-att-state")==="open";s.classList.add("collapse"),a&&s.classList.add("show");let n=new(O()).Collapse(s,{toggle:!1}),u=()=>o(!0),p=()=>o(!1);s.addEventListener("shown.bs.collapse",u),s.addEventListener("hidden.bs.collapse",p),e?.setAttribute("aria-expanded",String(a));let d=()=>{s.classList.contains("show")?n.hide():n.show()};return e?.addEventListener("click",d),{destroy:()=>{e?.removeEventListener("click",d),s.removeEventListener("shown.bs.collapse",u),s.removeEventListener("hidden.bs.collapse",p),n.dispose()}}}b.register("collapsible",{type:"owl",mount:_l});E();function Dl(t){let e=t.querySelector("input"),s=t.querySelector("[b-combobox-list]"),o=()=>[...s?.querySelectorAll("[b-att-value]")||[]];t.classList.add("bu-combobox"),e?.setAttribute("role","combobox"),e?.setAttribute("aria-expanded","false"),s?.setAttribute("role","listbox"),s&&(s.hidden=!0);let a=p=>{s&&(s.hidden=!p),e?.setAttribute("aria-expanded",String(p))},n=()=>{let p=e.value.toLowerCase();o().forEach(d=>{d.hidden=!d.textContent.toLowerCase().includes(p)}),a(!0)},u=p=>{let d=p.target.closest("[b-att-value]");d&&(e.value=d.textContent.trim(),t.setAttribute("b-att-value",d.getAttribute("b-att-value")),a(!1),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:d.getAttribute("b-att-value")}})))};return e?.addEventListener("input",n),e?.addEventListener("focus",()=>a(!0)),s?.addEventListener("click",u),{destroy:()=>{e?.removeEventListener("input",n),s?.removeEventListener("click",u)}}}b.register("combobox",{type:"owl",mount:Dl});E();function Fl(t){let e=t.querySelector("input"),s=()=>[...t.querySelectorAll("[b-command-item]")];t.classList.add("bu-command"),t.setAttribute("role",t.getAttribute("role")||"dialog"),e?.classList.add("form-control");let o=()=>{let n=(e?.value||"").toLowerCase();s().forEach(u=>{u.hidden=!u.textContent.toLowerCase().includes(n)})},a=n=>{let u=n.target.closest("[b-command-item]");u&&t.dispatchEvent(new CustomEvent("baseui:select",{bubbles:!0,detail:{value:u.getAttribute("b-att-value")||u.textContent.trim()}}))};return e?.addEventListener("input",o),t.addEventListener("click",a),{destroy:()=>{e?.removeEventListener("input",o),t.removeEventListener("click",a)}}}b.register("command",{type:"owl",mount:Fl});E();function Hl(t){let e=t.querySelector("[b-context-menu-content]");if(!e)return{};e.hidden=!0,e.setAttribute("role","menu");let s=n=>{n.preventDefault(),e.hidden=!1,e.style.left=`${n.clientX}px`,e.style.top=`${n.clientY}px`,t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},o=()=>{e.hidden=!0,t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))},a=n=>{n.key==="Escape"&&o()};return t.addEventListener("contextmenu",s),document.addEventListener("click",o),t.addEventListener("keydown",a),{destroy:()=>{t.removeEventListener("contextmenu",s),document.removeEventListener("click",o),t.removeEventListener("keydown",a)}}}b.register("context-menu",{type:"owl",mount:Hl});E();it();var Sn=[["728ed52f","Success","ken99@example.com","$316.00"],["489e1d42","Success","abe45@example.com","$242.00"],["6b0888f6","Processing","monserrat44@example.com","$837.00"],["a1dc8c4e","Success","silas22@example.com","$874.00"],["15b96de0","Failed","carmella@example.com","$721.00"]];function Wl(t){t.querySelector("table")||(t.innerHTML=`
|
|
42
|
-
<div class="bu-data-table__toolbar">
|
|
43
|
-
<input b-table-search type="search" class="form-control bu-data-table__search" placeholder="Filter emails...">
|
|
44
|
-
<div class="bu-data-table__columns"><button type="button" class="btn bu-button btn-outline-secondary" data-slot="button" data-icon="inline-end" aria-label="Toggle columns"><span>Columns</span><span b-icon="chevron-down" data-icon="inline-end"></span></button></div>
|
|
10
|
+
var Gi=Object.defineProperty;var mn=(t,e,s)=>e in t?Gi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var St=(t,e,s)=>()=>{if(s)throw s[0];try{return t&&(e=t(t=0)),e}catch(o){throw s=[o],o}};var Ji=(t,e)=>{for(var s in e)Gi(t,s,{get:e[s],enumerable:!0})};var r=(t,e,s)=>mn(t,typeof e!="symbol"?e+"":e,s);function vn(t){return typeof t=="string"?document.querySelector(t):t instanceof Element?t:null}function yi(t,e,s={}){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}function yn(t,e={}){return t.hasAttribute("b-icon")?"icon":e.name||t.getAttribute("b-ui")}function xn(t,e){return e===document||e===t||e.contains(t)}function wn(t,e={}){return!e.allowBootstrapControl&&t.matches(gn)}function Yi(t){return d.version=t,d}function Xi(){if(typeof MutationObserver>"u")return;let t=new MutationObserver(e=>{for(let s of e)for(let o of s.addedNodes)o instanceof Element&&d.mountAll(o)});return t.observe(document.documentElement,{childList:!0,subtree:!0}),t}function Qi(){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{d.mountAll(),Xi()},{once:!0}):(d.mountAll(),Xi()))}var fn,vi,Ur,Gr,gn,xi,d,S=St(()=>{fn="__BASEUI_VERSION__",vi=new Map,Ur=new WeakMap,Gr="[b-ui], [b-icon]",gn="[data-bs-toggle], [data-bs-target], [data-bs-dismiss]";xi=typeof window<"u"?window.thebase:void 0,d=xi?.register?xi:Object.assign(xi||{},{version:fn,register(t,e){if(!t||!e)throw new Error("BaseUI.register requires a name and component definition.");return vi.set(t,e),this},component(t){return vi.get(t)},mount(t,e={}){let s=vn(t);if(!s||wn(s,e))return null;let o=yn(s,e),a=vi.get(o);if(!a)return null;let n=Ur.get(s);if(n?.name===o)return n;n&&(n.destroy?.(),Ur.delete(s),yi(s,"baseui:destroyed",{name:n.name}));let l=a.mount?.(s,this,e)||{},u={name:o,element:s,destroy:l.destroy};return Ur.set(s,u),yi(s,"baseui:mounted",{name:o,instance:u}),u},mountAll(t=document){let e=t||document,s=[...e.querySelectorAll?.(Gr)||[]];return e instanceof Element&&e.matches(Gr)&&s.unshift(e),s.map(o=>this.mount(o)).filter(Boolean)},destroy(t=document){let e=t||document,s=[...e.querySelectorAll?.(Gr)||[]];e instanceof Element&&e.matches(Gr)&&s.unshift(e);for(let o of s){let a=Ur.get(o);a&&xn(o,e)&&(a.destroy?.(),Ur.delete(o),yi(o,"baseui:destroyed",{name:a.name}))}},theme:{set(t){let e=document.documentElement;if(typeof t=="string"){e.setAttribute("b-theme",t),e.dataset.bsTheme=t;return}for(let[s,o]of Object.entries(t||{})){let a=s==="radius"||s==="--b-radius"?"--base-radius":s.startsWith("--")?s:`--b-${s}`;e.style.setProperty(a,o)}}}});typeof window<"u"&&(window.thebase=d,window.BaseUI=d)});function h(...t){let e=[];for(let s of t)if(s){if(typeof s=="string")e.push(s);else if(Array.isArray(s)){let o=h(...s);o&&e.push(o)}else if(typeof s=="object")for(let[o,a]of Object.entries(s))a&&e.push(o)}return e.join(" ")}function i(t){return{type:t,optional:!0}}function K(t,e,s){return t[e]??(s?t[s]:void 0)}function D(t){return t===!0||t==="open"||t==="on"||t==="active"}function H(...t){let e=[];for(let s of t)if(s){if(typeof s=="string"){let o=s.trim().replace(/;$/,"");o&&e.push(o)}else if(typeof s=="object")for(let[o,a]of Object.entries(s)){if(a==null||a==="")continue;let n=o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase());e.push(`${n}:${a}`)}}return e.join(";")}function M(t){return t.state!==void 0?D(t.state):t.open!==void 0?t.open:t["default-open"]!==void 0?t["default-open"]:t.defaultOpen??!1}function ne(t){return t.state!==void 0||t.open!==void 0}var p,v=St(()=>{p={className:i(String),style:i([String,Object]),slots:i(Object)}});var B,An,ea,En,Cn,kn,Ln,Nn,On,ce,Bn,wi,Si,In,T,P,Tn,le,Rn,$n,ot,q,j,qn,Un,Pn,L,Mn,Y,_n,rs,A,y,zn,Dn,jn,Fn,Jr,Ai=St(()=>{B=globalThis.owl;if(!B)throw new Error("BaseUI: load dist/baseui.min.js or dist/baseui.esm.js before this script (globalThis.owl is not set).");An=B.App,ea=B.Component,En=B.EventBus,Cn=B.OwlError,kn=B.__info__,Ln=B.batched,Nn=B.blockDom,On=B.htmlEscape,ce=B.loadFile,Bn=B.markRaw,wi=B.markup,Si=B.mount,In=B.onError,T=B.onMounted,P=B.onPatched,Tn=B.onRendered,le=B.onWillDestroy,Rn=B.onWillPatch,$n=B.onWillRender,ot=B.onWillStart,q=B.onWillUnmount,j=B.onWillUpdateProps,qn=B.reactive,Un=B.status,Pn=B.toRaw,L=B.useChildSubEnv,Mn=B.useComponent,Y=B.useEffect,_n=B.useEnv,rs=B.useExternalListener,A=B.useRef,y=B.useState,zn=B.useSubEnv,Dn=B.validate,jn=B.validateType,Fn=B.whenReady,Jr=B.xml});function sa(t){Object.assign(Pr,t)}function Hn(t){let e=t.components;e?e!==Pr&&Object.getPrototypeOf(e)===Object.prototype&&Object.setPrototypeOf(e,Pr):t.components=Object.create(Pr)}function oa(t){return typeof t!="string"||!/\st-(att|attf|model)([.\s=-]|$)/.test(t)?t:t.replace(/<([A-Z][\w.:-]*)(\s[^<>]*?)?(\/?)>/g,(e,s,o="",a="")=>`<${s}${Wn(s,o)}${a}>`)}function Wn(t,e){let s=/\st-(att|attf|model|on)([.\s=-]|$)/.test(e),o=e.replace(/(\s)t-att\s*=/g,"$1t-props=").replace(/(\s)t-att-([A-Za-z_][\w:.-]*)\s*=/g,"$1$2=").replace(/(\s)t-attf-([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(a,n,l,u,b)=>`${n}${l}=${u}${Gn(b)}${u}`);return o=o.replace(/(\s)t-model((?:\.[\w-]+)*)\s*=\s*(["'])(.*?)\3/g,(a,n,l,u,b)=>Jn(t,n,l,u,b,o)),s?Kn(o):o}function Kn(t){return t.replace(/(\s)([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(e,s,o,a,n)=>o.startsWith("t-")||o==="t-props"||Zn(n)?e:`${s}${o}=${a}${Vn(n)}${a}`)}function Vn(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function Zn(t){let e=t.trim();return!e||/^(['"`[{(]|-?\d+(?:\.\d+)?$)/.test(e)||/[?.()[\]+*/]|=>|===|!==|&&|\|\|/.test(e)||/^(true|false|null|undefined)$/.test(e)}function Gn(t){return`\`${t.replace(/`/g,"\\`").replace(/{{\s*([\s\S]*?)\s*}}|#\{\s*([\s\S]*?)\s*\}/g,(e,s,o)=>`\${${s||o}}`)}\``}function Jn(t,e,s,o,a,n){let l=/^(Checkbox|Switch)$/.test(t),u=Xn(t,s),b=l?"checked":"value",m=new RegExp(`\\s${b}\\s*=`).test(n)?"":`${e}${b}=${o}${a}${o}`,f=new RegExp(`\\s${u}\\s*=`).test(n)?"":`${e}${u}=${o}${Yn(a,s,l)}${o}`;return`${m}${f}`}function Xn(t,e){return e.includes(".lazy")?"onChange":/^(Input|Textarea)$/.test(t)?"onInput":"onChange"}function Yn(t,e,s){if(s)return`(value) => { ${t} = value; }`;let o="value";return e.includes(".trim")&&(o=`(typeof ${o} === 'string' ? ${o}.trim() : ${o})`),e.includes(".number")&&(o=`Number.isNaN(Number(${o})) ? ${o} : Number(${o})`),`(value) => { ${t} = ${o}; }`}function ra(t,...e){return Array.isArray(t?.raw)?Jr({raw:t.raw.map(oa)},...e):Jr(t,...e)}function is(t,e,s={}){let o=oa(s.templates);return t.components={...Pr,...t.components||{}},Si(t,e,o===s.templates?s:{...s,templates:o})}async function Zu(t){let e=await(await fetch(t,{cache:"reload"})).text(),o=new DOMParser().parseFromString(e,"application/xml").querySelector("templates > t[t-name]");return o?o.innerHTML:e}var Ku,Vu,Pr,c,w=St(()=>{Ai();Ai();Ku=Si,Vu=Jr,Pr={};c=class extends ea{constructor(...e){super(...e),Hn(this.constructor)}}});function ec(t){return typeof Image>"u"?Promise.resolve(!0):(Ei.has(t)||Ei.set(t,new Promise(e=>{let s=new Image;s.onload=()=>e(!0),s.onerror=()=>e(!1),s.src=t})),Ei.get(t))}function Xr(t){return String(t||"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function Mr(t,e={}){let s=Xr(t);if(!tc.test(s))throw new Error(`BaseUI icon name is invalid: ${t}`);return`${String(e.baseUrl||d.icons.lucide.cdnBaseUrl).replace(/\/+$/,"")}/${s}.svg`}function _(t,e,s={}){let o=s.url||Mr(e,s),a=s.label??t.getAttribute("aria-label")??"";t.classList.add("b-icon"),t.style.setProperty("--b-icon-url",`url("${o.replace(/"/g,"%22")}")`),(s.size||t.getAttribute("b-att-size"))&&t.style.setProperty("--b-icon-size",s.size||t.getAttribute("b-att-size")),a?(t.setAttribute("role","img"),t.setAttribute("aria-label",a)):t.setAttribute("aria-hidden","true");let n=s.fallback===!1?null:s.fallback||Yr;return n&&!s.url&&Xr(e)!==Xr(n)&&ec(o).then(l=>{if(l||!t.isConnected)return;let u=Mr(n,s);t.style.setProperty("--b-icon-url",`url("${u.replace(/"/g,"%22")}")`)}),t}var ia,Qn,Yr,tc,Ei,rt=St(()=>{S();ia="1.31.0",Qn=`https://cdn.jsdelivr.net/npm/lucide-static@${ia}/icons`,Yr="file",tc=/^[a-z0-9][a-z0-9-]*$/,Ei=new Map;d.icons={...d.icons||{},lucide:{version:ia,cdnBaseUrl:Qn,normalizeName:Xr,url:Mr,render:_}}});var W,V,ns=St(()=>{W={default:"btn-primary",secondary:"btn-secondary",destructive:"btn-danger",outline:"btn-outline-secondary",ghost:"btn-light",link:"btn-link"},V={xs:"btn-xs",sm:"btn-sm",lg:"btn-lg",icon:"btn-icon","icon-xs":"btn-icon-xs","icon-sm":"btn-icon-sm","icon-lg":"btn-icon-lg"}});function Qr({variant:t="default",size:e,className:s}={}){return h("btn","b-button","b-clipboard-button",W[t]||W.default,V[e],s)}async function cs(t){let e=String(t??"");if(globalThis.navigator?.clipboard?.writeText)try{await globalThis.navigator.clipboard.writeText(e);return}catch{}if(typeof document>"u")throw new Error("BaseUI ClipboardButton: no clipboard API available in this environment.");let s=document.createElement("textarea");s.value=e,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",s.style.pointerEvents="none",document.body.append(s),s.select(),s.setSelectionRange(0,e.length);let o;try{o=document.execCommand("copy")}catch{o=!1}if(s.remove(),!o)throw new Error("BaseUI ClipboardButton: clipboard copy is unavailable in this browser/context.")}var Ci,ti=St(()=>{v();ns();Ci=["btn","b-button","b-clipboard-button",...Object.values(W),...Object.values(V)]});var Ua={};Ji(Ua,{destroyBaseUiPreviews:()=>Cr,enhanceMarkdownDiagrams:()=>Hr,expandSelfClosingTags:()=>yl,extractTagCaseMap:()=>rl,mountMarkdownEditor:()=>Wr,normalizeOwlPreviewMarkup:()=>wl,parseMarkdown:()=>Fr,primeBaseUiTemplates:()=>Sl,renderBaseUiBlocks:()=>qa,renderMermaidBlocks:()=>Ra});function Yc(){return Ti??(Ti=import("./runtime/marked/marked.min.js").then(t=>{let e=t.marked||t.default?.marked||globalThis.marked;if(!e?.parse)throw new Error("BaseUI markdown: failed to load src/runtime/marked/marked.min.js");return e})),Ti}function Qc(t){let e=t.closest("[data-bs-theme]")?.getAttribute("data-bs-theme")||document.documentElement.getAttribute("data-bs-theme");return(e?e==="dark":window.matchMedia?.("(prefers-color-scheme: dark)").matches)?"dark":"default"}function tl(){return Ri??(Ri=import("./runtime/mermaid/mermaid.esm.min.mjs").then(t=>{let e=t.default||t;return e.initialize({startOnLoad:!1,securityLevel:"strict"}),e})),Ri}function el(){return $i??($i=import("./runtime/milkdown/milkdown-editor.js")),$i}async function Fr(t,e={}){return(await Yc()).parse(String(t??""),{gfm:!0,breaks:!1,...e})}function Ui(t,e,s,o=""){t.classList.add("b-markdown-diagram-error"),t.replaceChildren();let a=document.createElement("p");if(a.className="b-markdown-diagram-error-message",a.textContent=`Unable to render ${e} diagram: ${s?.message||s}`,t.append(a),o){let n=document.createElement("pre"),l=document.createElement("code");l.textContent=o,n.append(l),t.append(n)}}async function Ra(t){let e=[...t.querySelectorAll("pre > code.language-mermaid")];if(!e.length)return;let s;try{s=await tl()}catch(o){e.forEach(a=>{let n=a.closest("pre");n.replaceChildren(),n.className="b-markdown-diagram b-markdown-mermaid",Ui(n,"mermaid",o,a.textContent)});return}s.initialize({startOnLoad:!1,securityLevel:"strict",theme:Qc(t)});for(let o of e){let a=o.textContent,n=o.closest("pre");n.replaceChildren(),n.className="b-markdown-diagram b-markdown-mermaid";try{let{svg:l}=await s.render(`b-mermaid-${++Xc}`,a);n.innerHTML=l}catch(l){Ui(n,"mermaid",l,a)}}}function sl(t){let e=globalThis.thebase;if(!e?.mountAll)return;let s=document.createElement("div");s.setAttribute("b-ui","toast"),s.setAttribute("b-att-state","open"),s.setAttribute("b-att-delay","2000"),s.className="b-markdown-b-copy-toast",s.textContent=t,document.body.append(s),e.mountAll(s),s.addEventListener("baseui:close",()=>s.remove(),{once:!0})}function ol(t){let e=document.createElement("div");e.className="b-markdown-b-code";let s=document.createElement("button");s.type="button",s.className="b-markdown-b-copy";let o=document.createElement("span");_(o,"copy",{label:"Copy code"}),s.append(o),s.addEventListener("click",async()=>{try{await cs(t),s.dispatchEvent(new CustomEvent("baseui:markdown-copy",{bubbles:!0,detail:{source:t}})),sl("Copied to clipboard")}catch(l){s.dispatchEvent(new CustomEvent("baseui:markdown-copy-error",{bubbles:!0,detail:{error:l}}))}}),e.append(s);let a=document.createElement("pre"),n=document.createElement("code");n.className="b-markdown-b-code-lines";for(let l of t.replace(/\n$/,"").split(`
|
|
11
|
+
`)){let u=document.createElement("span");u.className="b-markdown-b-code-line",u.textContent=l,n.append(u)}return a.append(n),e.append(a),e}function Oa(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function rl(t){let e=new Map;for(let s of t.matchAll(/<\/?([A-Z][A-Za-z0-9]*)\b/g))e.set(s[1].toLowerCase(),s[1]);return e}function il(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=globalThis.thebase,o=t.get(e.localName)||e.localName,a=Oa(o),n=!!s?.component?.(a),l=U(e.getAttribute("className")||e.getAttribute("class"));if(!n){let u=`b-${a}`;return e.className=l?`${u} ${l}`:u,e}e.setAttribute("b-ui",a),l&&(e.className=l);for(let u of[...e.attributes]){if(u.name==="class"||u.name==="className"||u.name==="b-ui"||/^on[A-Z]/.test(u.name))continue;let b=U(u.value);e.removeAttribute(u.name),!(b===""||b==="false")&&e.setAttribute(`b-att-${Oa(u.name)}`,b==="true"?"true":b)}return e}}function U(t){if(!t)return"";let e=t.trim();return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function pi(t,e){for(;t.firstChild;)e.append(t.firstChild)}function st(t,e){return pi(t,e),t.replaceWith(e),e}function al(t){let e=document.createElement("div");e.setAttribute("b-field-group","");let s=U(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),st(t,e)}function nl(t){let e=document.createElement("div");e.setAttribute("b-ui","field");let s=U(t.getAttribute("orientation")||""),o=U(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-orientation",s),o&&(e.className=o),st(t,e)}function cl(t){let e=document.createElement("label");e.setAttribute("b-field-label","");let s=U(t.getAttribute("for")||""),o=U(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("for",s),o&&(e.className=o),st(t,e)}function Ba(t,e,s){let o=document.createElement(e);o.setAttribute(s,"");let a=U(t.getAttribute("className")||t.getAttribute("class"));return a&&(o.className=a),st(t,o)}function ll(t){let e=t.getAttribute("type")||"",s=t.hasAttribute("variant")||t.hasAttribute("size")||t.hasAttribute("className")||t.hasAttribute("onClick")||t.hasAttribute("label")||e.trim().startsWith("'")||e.trim().startsWith('"');if(t.hasAttribute("b-ui")||!s)return t;let o=document.createElement("button");o.setAttribute("b-ui","button");let a=U(e||"button"),n=U(t.getAttribute("variant")||""),l=U(t.getAttribute("size")||""),u=U(t.getAttribute("className")||t.getAttribute("class")),b=U(t.getAttribute("label")||"");return o.type=a||"button",n&&o.setAttribute("b-att-variant",n),l&&o.setAttribute("b-att-size",l),u&&(o.className=u),b&&!t.childNodes.length&&(o.textContent=b),st(t,o)}function pl(t){if(t.hasAttribute("b-ui")||t.hasAttribute("b-icon"))return t;let e=U(t.getAttribute("name")||t.getAttribute("icon")||"");if(!e)return t;let s=document.createElement("span");s.setAttribute("b-ui","icon"),s.setAttribute("b-att-icon",e);let o=U(t.getAttribute("size")||""),a=U(t.getAttribute("label")||""),n=U(t.getAttribute("className")||t.getAttribute("class"));return o&&s.setAttribute("b-att-size",o),a&&s.setAttribute("b-att-label",a),n&&(s.className=n),st(t,s)}function ul(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","alert");let s=U(t.getAttribute("variant")||""),o=U(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-variant",s),o&&(e.className=o),st(t,e)}function qi(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=document.createElement("div"),o=U(e.getAttribute("className")||e.getAttribute("class"));return s.className=o?`${t} ${o}`:t,st(e,s)}}function dl(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","accordion"),U(t.getAttribute("multiple"))==="true"&&e.setAttribute("b-att-multiple","true");let s=U(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),st(t,e)}function bl(t){if(t.hasAttribute("b-accordion-item"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-item",""),U(t.getAttribute("state"))==="open"&&e.setAttribute("b-att-state","open");let s=U(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),st(t,e)}function hl(t){if(t.hasAttribute("b-accordion-trigger"))return t;let e=document.createElement("button");e.type="button",e.setAttribute("b-accordion-trigger","");let s=U(t.getAttribute("className")||t.getAttribute("class"));s&&(e.className=s),pi(t,e);let o=document.createElement("span");return o.setAttribute("b-icon","chevron-down"),o.className="b-accordion-trigger-icon",e.append(o),t.replaceWith(e),e}function ml(t){if(t.hasAttribute("b-accordion-panel"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-panel","");let s=U(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),st(t,e)}function fl(t){return Ia+=1,`${t}-${Ia}`}function et(t,e,s){return o=>{if(o.hasAttribute("b-ui"))return o;let a=document.createElement(t);t==="button"&&(a.type="button"),s&&a.setAttribute(s,"");let n=U(o.getAttribute("className")||o.getAttribute("class"));return a.className=n?`${e} ${n}`:e,st(o,a)}}function gl(){let t=document.createElement("button");t.type="button",t.className="btn b-button btn-light btn-icon-sm b-dialog-close b-dialog-close-control",t.setAttribute("b-dialog-close",""),t.setAttribute("aria-label","Close");let e=document.createElement("span");e.setAttribute("b-ui","icon"),e.setAttribute("b-att-icon","x");let s=document.createElement("span");return s.className="visually-hidden",s.textContent="Close",t.append(e,s),t}function Ta({tagPrefix:t,componentName:e,triggerTag:s,triggerClassName:o,panelClassName:a,closeButton:n}){return l=>{if(l.hasAttribute("b-ui"))return l;let u=l.querySelector(`:scope > ${t}trigger`),b=l.querySelector(`:scope > ${t}content`);if(!b)return l;let m=fl(`b-preview-${e}`),f=document.createElement(s);s==="button"&&(f.type="button"),f.className=o,f.setAttribute("b-att-trigger",`#${m}`),u&&pi(u,f);let g=document.createElement("div");g.setAttribute("b-ui",e),g.id=m,g.setAttribute("b-att-trigger",`[b-att-trigger='#${m}']`);let E=document.createElement("div");E.className=a;let N=U(b.getAttribute("size")||"");return N&&E.setAttribute("data-size",N),pi(b,E),n&&E.append(n()),g.append(E),l.before(f,g),l.remove(),g}}function yl(t){return t.replace(/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^"'>])*?)\/>/g,(e,s,o)=>vl.has(s.toLowerCase())?e:`<${s}${o}></${s}>`)}function xl(t){t.querySelectorAll("t[t-esc]").forEach(e=>{let o=e.getAttribute("t-esc")?.includes(".length")?"0":"";e.replaceWith(document.createTextNode(`${o}${e.textContent||""}`))})}function wl(t,e){xl(t);let s={fieldgroup:al,field:nl,fieldlabel:cl,fielddescription:a=>Ba(a,"p","b-field-description"),fielderror:a=>Ba(a,"p","b-field-error"),button:ll,icon:pl,alert:ul,alerttitle:qi("b-alert-title"),alertdescription:qi("b-alert-description"),alertaction:qi("b-alert-action"),accordion:dl,accordionitem:bl,accordiontrigger:hl,accordioncontent:ml,dialog:Ta({tagPrefix:"dialog",componentName:"dialog",triggerTag:"span",triggerClassName:"b-dialog-trigger",panelClassName:"b-dialog-panel",closeButton:gl}),dialogheader:et("div","b-dialog-header"),dialogfooter:et("div","b-dialog-footer"),dialogtitle:et("h2","b-dialog-title"),dialogdescription:et("p","b-dialog-description"),dialogclose:et("button","btn b-button btn-outline-secondary b-dialog-close","b-dialog-close"),alertdialog:Ta({tagPrefix:"alertdialog",componentName:"alert-dialog",triggerTag:"button",triggerClassName:"btn b-button btn-outline-secondary b-alert-dialog-trigger",panelClassName:"b-dialog-panel b-alert-dialog-panel"}),alertdialogheader:et("div","b-dialog-header b-alert-dialog-header"),alertdialogfooter:et("div","b-dialog-footer b-alert-dialog-footer"),alertdialogmedia:et("div","b-alert-dialog-media"),alertdialogtitle:et("h2","b-dialog-title b-alert-dialog-title"),alertdialogdescription:et("p","b-dialog-description b-alert-dialog-description"),alertdialogcancel:et("button","btn b-button btn-outline-secondary b-alert-dialog-cancel","b-alert-dialog-cancel"),alertdialogaction:et("button","btn b-button btn-primary b-alert-dialog-action","b-alert-dialog-action")},o=il(e);for(let a of[...t.querySelectorAll("*")]){let n=a.localName.toLowerCase();s[n]?s[n](a):e.has(n)&&o(a)}}function Sl(t){li=Promise.resolve(t)}function Al(){return li??(li=ce("/dist/baseui.templates.xml")),li}function Cr(t){let e=Pi.get(t);if(e){Pi.delete(t);for(let s of e)try{s.destroy()}catch{}}}function Cl(t){return new Set([...t.matchAll(El)].map(e=>e[1]))}function Nl(t){let e=new Set;for(let s of t.matchAll(kl))e.add(s[1]);for(let s of t.matchAll(Ll))e.add(s[2]);return e}function Ol(t){let e=ra({raw:[t]}),s=Cl(t);class o extends c{setup(){this.state=y(Object.fromEntries([...s].map(n=>[n,""])))}}r(o,"template",e);for(let a of Nl(t))o.prototype[a]=function(){};return o}function $a(t){t.querySelector("[data-slot='dropdown-menu'], .b-dropdown-menu, [b-ui='dropdown-menu'], [b-dropdown-menu]")&&t.classList.add("b-markdown-b-preview-overlay")}async function Bl(t,e){let[s,o]=await Promise.all([Al(),Ol(e)]),a=await is(o,t,{templates:s});return $a(t),a}function Il(t,e){let s=globalThis.thebase;if(!s?.mountAll)throw new Error("BaseUI runtime not found on the page \u2014 load dist/baseui.min.js before mounting Markdown.");t.innerHTML=e,$a(t),s.mountAll(t)}async function qa(t){Cr(t);let e=[...t.querySelectorAll("pre > code.language-base-ui")];if(!e.length)return;let s=new Set;for(let o of e){let a=o.textContent,n=o.closest("pre");n.replaceChildren(),n.className="b-markdown-live b-markdown-baseui";let l=document.createElement("div");l.className="b-markdown-b-preview",n.append(l,ol(a));try{/<[A-Z]/.test(a)?s.add(await Bl(l,a)):Il(l,a)}catch(u){Ui(n,"BaseUI component",u,a)}}s.size&&Pi.set(t,s)}function Tl(t){for(let e of t.querySelectorAll("li > input[type=checkbox]:not([aria-label])"))e.setAttribute("aria-label",e.parentElement.textContent.trim())}async function Hr(t,{mermaid:e=!0,baseUi:s=!0}={}){Tl(t),e&&await Ra(t),s&&await qa(t)}async function Wr(t){return(await el()).createMilkdownMarkdownEditor(t)}var Ti,Ri,$i,Xc,Ia,vl,li,Pi,El,kl,Ll,ui=St(()=>{w();rt();ti();Xc=0;Ia=0;vl=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);Pi=new WeakMap;El=/\bstate\.([A-Za-z_$][\w$]*)/g;kl=/\bthis\.([A-Za-z_$][\w$]*)\s*\(/g,Ll=/\bt-on-[\w:-]+\s*=\s*(["'])([A-Za-z_$][\w$]*)\1/g});S();v();var ta="1.2.0";w();var Wi={};Ji(Wi,{Accordion:()=>go,AccordionContent:()=>yo,AccordionItem:()=>vo,AccordionTrigger:()=>ke,Alert:()=>ct,AlertAction:()=>ps,AlertDescription:()=>At,AlertDialog:()=>Ps,AlertDialogAction:()=>ve,AlertDialogCancel:()=>ge,AlertDialogContent:()=>Ms,AlertDialogDescription:()=>Fs,AlertDialogFooter:()=>zs,AlertDialogHeader:()=>_s,AlertDialogMedia:()=>Ds,AlertDialogTitle:()=>js,AlertDialogTrigger:()=>fe,AlertTitle:()=>ls,ApiDoc:()=>xt,ApiDocGroup:()=>wt,AspectRatio:()=>pr,Attachment:()=>Jo,AttachmentAction:()=>Ke,AttachmentActions:()=>er,AttachmentContent:()=>Yo,AttachmentDescription:()=>tr,AttachmentDropzone:()=>or,AttachmentGroup:()=>sr,AttachmentMedia:()=>Xo,AttachmentTitle:()=>Qo,AttachmentTrigger:()=>Ve,Avatar:()=>rr,Badge:()=>Q,BlockViewer:()=>ts,Breadcrumb:()=>Wt,BreadcrumbEllipsis:()=>Ne,BreadcrumbItem:()=>Vt,BreadcrumbLink:()=>Zt,BreadcrumbList:()=>Kt,BreadcrumbPage:()=>Gt,BreadcrumbSeparator:()=>ht,Bubble:()=>ur,Button:()=>x,ButtonGroup:()=>hr,ButtonGroupSeparator:()=>mr,ButtonGroupText:()=>fr,Calendar:()=>Fe,Card:()=>us,CardBody:()=>bs,CardDescription:()=>fs,CardFooter:()=>hs,CardHeader:()=>ds,CardTitle:()=>ms,Carousel:()=>Ko,CarouselNext:()=>We,CarouselPrevious:()=>He,CarouselSlide:()=>Vo,Chart:()=>Wo,Checkbox:()=>_t,ClipboardButton:()=>nt,CodeEditor:()=>de,Collapsible:()=>xo,CollapsibleContent:()=>wo,CollapsibleTrigger:()=>Le,Combobox:()=>Fo,Command:()=>Ho,ContextMenu:()=>bo,ContextMenuContent:()=>mo,ContextMenuItem:()=>fo,ContextMenuTrigger:()=>ho,DataTable:()=>je,DatePicker:()=>jo,Dialog:()=>It,DialogClose:()=>be,DialogContent:()=>pt,DialogDescription:()=>qt,DialogFooter:()=>Rt,DialogHeader:()=>Tt,DialogTitle:()=>$t,DialogTrigger:()=>gs,Direction:()=>dr,Drawer:()=>Hs,DrawerClose:()=>xe,DrawerContent:()=>Ws,DrawerDescription:()=>Gs,DrawerFooter:()=>Vs,DrawerHeader:()=>Ks,DrawerTitle:()=>Zs,DrawerTrigger:()=>ye,DropdownMenu:()=>zt,DropdownMenuCheckboxItem:()=>Ee,DropdownMenuContent:()=>Dt,DropdownMenuGroup:()=>no,DropdownMenuItem:()=>jt,DropdownMenuLabel:()=>co,DropdownMenuRadioGroup:()=>lo,DropdownMenuRadioItem:()=>Ce,DropdownMenuSeparator:()=>po,DropdownMenuShortcut:()=>uo,DropdownMenuSub:()=>Ft,DropdownMenuSubContent:()=>Ht,DropdownMenuSubTrigger:()=>dt,DropdownMenuTrigger:()=>ut,Empty:()=>vs,EmptyContent:()=>As,EmptyDescription:()=>Ss,EmptyHeader:()=>ys,EmptyMedia:()=>xs,EmptyTitle:()=>ws,Field:()=>ee,FieldContent:()=>yr,FieldDescription:()=>oe,FieldError:()=>re,FieldGroup:()=>te,FieldLabel:()=>se,FieldLegend:()=>vr,FieldSeparator:()=>wr,FieldSet:()=>gr,FieldTitle:()=>xr,Form:()=>os,HoverCard:()=>ro,HoverCardContent:()=>ao,HoverCardTrigger:()=>io,Icon:()=>R,Input:()=>kt,InputOtp:()=>Bs,Item:()=>br,Kbd:()=>Et,Label:()=>Sr,Markdown:()=>yt,MarkdownTree:()=>Qe,MarkdownTreeNode:()=>Vr,Marker:()=>ks,Menubar:()=>ko,Message:()=>ir,MessageScroller:()=>ar,NativeSelect:()=>Mt,NavigationMenu:()=>Eo,NavigationMenuItem:()=>Co,Pagination:()=>So,PaginationItem:()=>Ao,Popover:()=>so,PopoverContent:()=>oo,PopoverTrigger:()=>Ae,Progress:()=>lr,Pwa:()=>Lr,PwaBody:()=>Tr,PwaClose:()=>ss,PwaContent:()=>Nr,PwaDescription:()=>Ir,PwaFooter:()=>$r,PwaHeader:()=>Or,PwaSteps:()=>Rr,PwaTitle:()=>Br,PwaTrigger:()=>es,Questionnaire:()=>nr,QuestionnaireNext:()=>Ge,QuestionnairePrevious:()=>Ze,QuestionnaireStep:()=>cr,RadioGroup:()=>Ls,RadioGroupItem:()=>Ns,Resizable:()=>Zo,ScrollArea:()=>Go,Select:()=>Ts,SelectContent:()=>Rs,SelectItem:()=>$s,SelectTrigger:()=>me,Separator:()=>Es,Sheet:()=>Js,SheetClose:()=>Se,SheetContent:()=>Xs,SheetDescription:()=>eo,SheetFooter:()=>Qs,SheetHeader:()=>Ys,SheetTitle:()=>to,SheetTrigger:()=>we,Shell:()=>Ue,ShellContent:()=>Me,ShellHeader:()=>zo,ShellMain:()=>_o,ShellNav:()=>Mo,ShellSidebar:()=>Pe,ShellSidebarHeader:()=>Po,ShellUserMenu:()=>_e,Sidebar:()=>ft,SidebarClose:()=>Ie,SidebarContent:()=>Jt,SidebarFooter:()=>No,SidebarGroup:()=>Xt,SidebarGroupAction:()=>Te,SidebarGroupCollapsible:()=>Re,SidebarGroupContent:()=>To,SidebarGroupLabel:()=>Yt,SidebarHeader:()=>Lo,SidebarInput:()=>Bo,SidebarInset:()=>Oo,SidebarMenu:()=>gt,SidebarMenuAction:()=>$e,SidebarMenuBadge:()=>$o,SidebarMenuButton:()=>mt,SidebarMenuItem:()=>Qt,SidebarMenuSkeleton:()=>qo,SidebarMenuSub:()=>Ro,SidebarMenuSubButton:()=>qe,SidebarMenuSubItem:()=>Uo,SidebarProvider:()=>jr,SidebarRail:()=>Be,SidebarSeparator:()=>Io,SidebarTrigger:()=>Oe,Skeleton:()=>Ut,Slider:()=>Os,Spinner:()=>Ct,Switch:()=>he,TabContent:()=>Bt,TabTrigger:()=>lt,Table:()=>Do,Tabs:()=>Lt,TabsContainer:()=>Nt,TabsList:()=>Ot,TextEditor:()=>qr,Textarea:()=>Pt,ThemeButton:()=>vt,Toast:()=>bt,Toggle:()=>Je,ToggleGroup:()=>Er,ToggleGroupItem:()=>Xe,Tooltip:()=>at,Typography:()=>Cs,createNamedIcon:()=>as,findMarkdownTreeNode:()=>Fi,iconComponentName:()=>Ca});w();v();w();rt();v();var R=class extends c{setup(){this.state=y({failed:!1}),Y(e=>{if(this.state.failed=!1,typeof Image>"u"||!e||e===Yr)return;let s=new Image;return s.onerror=()=>{this.state.failed=!0},s.src=this.buildUrl(e),()=>{s.onload=null,s.onerror=null}},()=>[this.name])}buildUrl(e){return Mr(e,{baseUrl:K(this.props,"base-url","baseUrl")})}get name(){return K(this.props,"icon","name")}get url(){return this.buildUrl(this.state.failed?Yr:this.name)}get style(){let e=[`--b-icon-url:url("${this.url.replace(/"/g,"%22")}")`];return this.props.size&&e.push(`--b-icon-size:${this.props.size}`),H(e.join(";"),this.props.style)}get classNames(){return h("b-icon",this.props.className)}};r(R,"template","baseui.Icon"),r(R,"props",{icon:i(String),name:i(String),label:i(String),title:i(String),size:i(String),"base-url":i(String),baseUrl:i(String),className:i(String),style:i([String,Object])});function as(t){return class extends R{get name(){return K(this.props,"icon","name")||t}}}ns();var x=class extends c{setup(){this.rootRef=A("root"),this.props.getRef&&(T(()=>this.props.getRef(this.rootRef.el)),q(()=>this.props.getRef(null)))}get classNames(){return this.props.unstyled?h(this.props.className):h("btn","b-button",W[this.props.variant]||W.default,V[this.props.size],this.isIconOnly&&"b-button-icon",this.props.className)}get iconPosition(){return K(this.props,"icon-position","iconPosition")==="end"?"end":"start"}get ariaLabel(){return K(this.props,"aria-label","ariaLabel")}get ariaPressed(){return K(this.props,"aria-pressed","ariaPressed")}get ariaInvalid(){let e=K(this.props,"aria-invalid","ariaInvalid");return e===!0?"true":e}get isIconOnly(){return!!(this.props.icon&&!this.props.label&&!this.props.slots?.default)}onClick(e){if(this.props.href&&this.props.disabled){e.preventDefault();return}this.props.onClick?.(e)}};r(x,"template","baseui.Button"),r(x,"components",{Icon:R}),r(x,"props",{variant:i(String),size:i(String),type:i(String),href:i(String),disabled:i(Boolean),label:i(String),icon:i(String),"icon-position":i(String),iconPosition:i(String),unstyled:i(Boolean),attrs:i(Object),getRef:i(Function),...p,id:i(String),title:i(String),"aria-label":i(String),ariaLabel:i(String),"aria-pressed":i(String),ariaPressed:i(String),"aria-invalid":i([String,Boolean]),ariaInvalid:i([String,Boolean]),onClick:i(Function)});w();v();ti();var nt=class extends c{setup(){this.state=y({copied:!1}),this.resetTimer=null,q(()=>window.clearTimeout(this.resetTimer))}get classNames(){return Qr(this.props)}get resetDelay(){return K(this.props,"reset-delay","resetDelay")??2e3}get iconName(){return this.state.copied?this.props.copiedIcon||"check":this.props.icon||"copy"}get label(){return this.state.copied&&this.props.copiedLabel?this.props.copiedLabel:this.props.label}get ariaLabel(){return K(this.props,"aria-label","ariaLabel")||this.label}get attrs(){return{"data-copied":this.state.copied?"true":void 0}}async onClick(e){if(this.props.disabled)return;let s=this.props.getValue?this.props.getValue():this.props.value??"";try{await cs(s),this.state.copied=!0,window.clearTimeout(this.resetTimer),this.resetTimer=window.setTimeout(()=>{this.state.copied=!1},this.resetDelay),this.props.onCopy?.({value:s,event:e})}catch(o){this.props.onCopyError?.({error:o,event:e})}}};r(nt,"template","baseui.ClipboardButton"),r(nt,"components",{Button:x}),r(nt,"props",{variant:i(String),size:i(String),value:i(String),getValue:i(Function),label:i(String),copiedLabel:i(String),icon:i(String),copiedIcon:i(String),"reset-delay":i(Number),resetDelay:i(Number),disabled:i(Boolean),...p,"aria-label":i(String),ariaLabel:i(String),onCopy:i(Function),onCopyError:i(Function)});w();v();w();function k(){let t=globalThis.bootstrap;if(!t)throw new Error("BaseUI: load dist/bootstrap.bundle.min.js before this script (globalThis.bootstrap is not set).");return t}v();var aa={default:"b-alert-default",destructive:"b-alert-destructive",info:"b-alert-default",success:"alert-success",warning:"alert-warning",danger:"b-alert-destructive"},ct=class extends c{setup(){this.rootRef=A("root"),this.bootstrapAlert=null,this.props.dismissible&&(T(()=>{this.bootstrapAlert=new(k()).Alert(this.rootRef.el)}),q(()=>{this.bootstrapAlert?.dispose()}))}get classNames(){return h("alert","b-alert",aa[this.props.variant]||aa.default,this.props.dismissible&&"alert-dismissible",this.props.dismissible&&"fade",this.props.dismissible&&"show",this.props.className)}};r(ct,"template","baseui.Alert"),r(ct,"components",{Button:x}),r(ct,"props",{variant:i(String),dismissible:i(Boolean),...p});var ls=class extends c{};r(ls,"template","baseui.AlertTitle"),r(ls,"props",p);var At=class extends c{};r(At,"template","baseui.AlertDescription"),r(At,"props",p);var ps=class extends c{};r(ps,"template","baseui.AlertAction"),r(ps,"props",p);w();v();var pe={primary:"b-badge-primary",secondary:"b-badge-secondary",success:"b-badge-success",warning:"b-badge-warning",danger:"b-badge-danger",info:"b-badge-info",muted:"b-badge-muted"};var Q=class extends c{get classNames(){return h("badge",pe[this.props.variant]||pe.secondary,this.props.pill&&"rounded-pill",this.props.className)}};r(Q,"template","baseui.Badge"),r(Q,"props",{variant:i(String),pill:i(Boolean),label:i(String),...p});w();v();var Et=class extends c{get classNames(){return h("b-kbd",this.props.className)}};r(Et,"template","baseui.Kbd"),r(Et,"props",{...p});w();v();var Ct=class extends c{get classNames(){return h("b-spinner",this.props.type==="grow"?"spinner-grow":"spinner-border",this.props.className)}get label(){return this.props.label||"Loading"}};r(Ct,"template","baseui.Spinner"),r(Ct,"props",{type:i(String),label:i(String),className:i(String),style:i([String,Object])});var it={line:["//"],block:["/*","*/"],quotes:`"'`},ei={line:["#"],quotes:`"'`},na="auto break case char const continue default do double else enum extern float for goto if inline int long register restrict return short signed sizeof static struct switch typedef union unsigned void volatile while include define ifdef ifndef endif pragma",sc="abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new null package private protected public return short static strictfp super switch synchronized this throw throws transient true false try var void volatile while record",ca="async await break case catch class const continue debugger default delete do else export extends false finally for from function if import in instanceof let new null of return static super switch this throw true try typeof undefined var void while with yield",_r={plaintext:{label:"Plain text",indent:" "},javascript:{label:"JavaScript",...it,quotes:"\"'`",multiline:"`",indent:" ",keywords:ca,builtins:"console document window JSON Math Object Array Promise Map Set Date Number String Boolean Symbol require module exports process"},typescript:{annotations:!0,label:"TypeScript",...it,quotes:"\"'`",multiline:"`",indent:" ",keywords:`${ca} abstract as declare enum implements interface keyof namespace private protected public readonly type`,builtins:"console JSON Math Object Array Promise Map Set Date Number string number boolean any unknown never void Record Partial Readonly"},go:{label:"Go",...it,quotes:"\"'`",multiline:"`",indent:" ",keywords:"break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var nil true false",builtins:"append cap close complex copy delete imag len make new panic print println real recover string int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 uintptr float32 float64 bool byte rune error any context fmt"},c:{label:"C",...it,indent:" ",keywords:na,builtins:"NULL size_t printf scanf malloc free memcpy memset strlen strcmp FILE stdin stdout stderr uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t bool"},cpp:{label:"C++",...it,indent:" ",keywords:`${na} alignas alignof and bool catch class constexpr const_cast decltype delete dynamic_cast explicit export false friend mutable namespace new noexcept nullptr operator or private protected public reinterpret_cast static_assert static_cast template this throw true try typeid typename using virtual override final`,builtins:"std string vector map set unordered_map unique_ptr shared_ptr cout cin endl size_t NULL"},java:{annotations:!0,label:"Java",...it,indent:" ",keywords:sc,builtins:"String System Object Integer Long Double Boolean List Map Set ArrayList HashMap Exception Override Math"},csharp:{label:"C#",...it,indent:" ",keywords:"abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using var virtual void volatile while async await record",builtins:"Console String List Dictionary Task Math Exception"},kotlin:{annotations:!0,label:"Kotlin",...it,quotes:`"'`,indent:" ",keywords:"abstract as break by catch class companion const constructor continue data do else enum false final finally for fun if import in infix init inline interface internal is lateinit null object open operator override package private protected public return sealed super suspend this throw true try typealias val var when while",builtins:"String Int Long Double Boolean List Map Set Any Unit println"},swift:{label:"Swift",...it,indent:" ",keywords:"as associatedtype break case catch class continue default defer deinit do else enum extension fallthrough false fileprivate for func guard if import in init inout internal is let nil open operator private protocol public repeat rethrows return self static struct subscript super switch throw throws true try typealias var where while async await",builtins:"String Int Double Bool Array Dictionary Set Any print"},rust:{label:"Rust",...it,quotes:'"',indent:" ",keywords:"as async await break const continue crate dyn else enum extern false fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait true type unsafe use where while",builtins:"String Vec Option Result Some None Ok Err Box Rc Arc println format vec i8 i16 i32 i64 u8 u16 u32 u64 usize isize f32 f64 bool str"},php:{label:"PHP",variables:!0,line:["//","#"],block:["/*","*/"],quotes:`"'`,indent:" ",keywords:"abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty extends final finally fn for foreach function global if implements include instanceof interface isset namespace new null or print private protected public require return static switch this throw trait true false try unset use var while yield",builtins:"count strlen array_map array_filter in_array json_encode json_decode var_dump"},python:{annotations:!0,label:"Python",...ei,indent:" ",keywords:"and as assert async await break class continue def del elif else except False finally for from global if import in is lambda None nonlocal not or pass raise return True try while with yield match case",builtins:"print len range str int float bool list dict set tuple open isinstance super self cls enumerate zip map filter sorted sum min max abs"},ruby:{label:"Ruby",...ei,indent:" ",keywords:"BEGIN END alias and begin break case class def defined do else elsif end ensure false for if in module next nil not or redo rescue retry return self super then true undef unless until when while yield",builtins:"puts print require require_relative attr_accessor attr_reader attr_writer lambda proc raise"},bash:{label:"Shell",variables:!0,...ei,indent:" ",keywords:"case do done elif else esac fi for function if in select then until while",builtins:"echo cd ls cat grep sed awk export source exit read printf test set unset local return trap"},sql:{label:"SQL",line:["--"],block:["/*","*/"],quotes:`"'`,indent:" ",ci:!0,keywords:"add all alter and as asc begin between by case check column commit constraint create cross database default delete desc distinct drop else end exists foreign from full group having if in index inner insert into is join key left like limit not null offset on or order outer primary references returning right rollback select set table then transaction union unique update values view when where with",builtins:"count sum avg min max coalesce now cast varchar text integer int bigint boolean timestamp date numeric serial"},json:{label:"JSON",plainWords:!0,keys:!0,quotes:'"',indent:" ",keywords:"true false null"},yaml:{label:"YAML",plainWords:!0,keys:!0,...ei,indent:" ",keywords:"true false null yes no on off"},css:{label:"CSS",plainWords:!0,keys:"prop",dashed:!0,hex:!0,block:["/*","*/"],quotes:`"'`,indent:" ",keywords:"important inherit initial unset auto none",builtins:"var calc rgb rgba hsl hsla url"},html:{label:"HTML",plainWords:!0,tags:!0,block:["<!--","-->"],quotes:`"'`,indent:" "},lua:{label:"Lua",line:["--"],block:["--[[","]]"],quotes:`"'`,indent:" ",keywords:"and break do else elseif end false for function goto if in local nil not or repeat return then true until while",builtins:"assert error ipairs next pairs pcall print select tonumber tostring type unpack xpcall string table math os"}};_r.xml={..._r.html,label:"XML"};var oc={js:"javascript",jsx:"javascript",node:"javascript",ts:"typescript",tsx:"typescript",golang:"go",h:"c","c++":"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"csharp","c#":"csharp",kt:"kotlin",rs:"rust",py:"python",rb:"ruby",sh:"bash",shell:"bash",zsh:"bash",postgres:"sql",postgresql:"sql",mysql:"sql",mjs:"javascript",cjs:"javascript",htm:"html",yml:"yaml",svg:"xml",text:"plaintext",txt:"plaintext"},rc={comment:"b-code-comment",string:"b-code-string",number:"b-code-number",keyword:"b-code-keyword",builtin:"b-code-builtin",function:"b-code-function",type:"b-code-type",tag:"b-code-tag",attr:"b-code-attr",meta:"b-code-meta",variable:"b-code-variable",plain:""},Li=/[A-Za-z_$]/,ba=/[A-Za-z0-9_$]/,ha=/[A-Za-z0-9_:-]/,ic=/[0-9A-Za-z_.]/,la=/[0-9]/,ac=/[A-Za-z0-9_-]/,pa=/^#[0-9a-fA-F]{3,8}\b/,nc=/^&#?\w+;/,cc=/[A-Za-z/!?]/,ki=new Map;function ua(t,e){return new Set((t?e?t.toLowerCase():t:"").split(" ").filter(Boolean))}function Dr(t){let e=String(t??"").trim().toLowerCase(),s=oc[e]??e,o=s in _r?s:"plaintext";if(!ki.has(o)){let a=_r[o];ki.set(o,{id:o,...a,keywordSet:ua(a.keywords,a.ci),builtinSet:ua(a.builtins,a.ci)})}return ki.get(o)}function ma(t){let e=String(t??"").split(/[?#]/)[0].split("/").pop();return e.includes(".")?e.split(".").pop().toLowerCase():""}var jd=Object.keys(_r);function zr(t,e,s){let o=e;for(;o<t.length&&s.test(t[o]);)o+=1;return o}function lc(t,e,s){if(s.block&&t.startsWith(s.block[0],e)){let a=t.indexOf(s.block[1],e+s.block[0].length);return a===-1?t.length:a+s.block[1].length}if(!s.line?.some(a=>t.startsWith(a,e)))return-1;let o=t.indexOf(`
|
|
12
|
+
`,e);return o===-1?t.length:o}function fa(t,e,s){let o=t[e],a=s.multiline?.includes(o),n=e+1;for(;n<t.length&&t[n]!==o&&(a||t[n]!==`
|
|
13
|
+
`);)n+=t[n]==="\\"?2:1;return Math.min(t.length,t[n]===o?n+1:n)}function pc(t,e){let s=e-1;for(;s>=0&&/\s/.test(t[s]);)s-=1;return t[s]}function da(t,e,s,o){return!o.keys||!/^\s*:(?!:|\/\/)/.test(t.slice(s,s+8))?!1:o.keys!=="prop"||"{;".includes(pc(t,e))}function uc(t,e,s,o){let a=o.ci?t.slice(e,s).toLowerCase():t.slice(e,s);if(o.keywordSet.has(a))return"keyword";let n=t[e-1]==="."||t[e-1]===":";return o.builtinSet.has(a)&&!n?"builtin":o.plainWords?"plain":/^\s*\(/.test(t.slice(s,s+8))?"function":/^[A-Z][A-Za-z0-9_$]*[a-z]/.test(a)?"type":"plain"}function dc(t,e,s,o){let a=t[e],n=/^(\/|\?)?>/.exec(t.slice(e,e+2));return n?(o.inTag=!1,["tag",e+n[0].length]):s.quotes.includes(a)?["string",fa(t,e,s)]:Li.test(a)?["attr",zr(t,e+1,ha)]:["plain",e+1]}function bc(t,e,s){if(t[e]==="<"&&cc.test(t[e+1]??""))return s.inTag=!0,["tag",zr(t,e+2,ha)];let o=t[e]==="&"?nc.exec(t.slice(e,e+12)):null;return o?["number",e+o[0].length]:["plain",e+1]}function hc(t,e,s){let o=t[e];return!(o==="$"&&s.variables||o==="@"&&s.annotations)||!Li.test(t[e+1]??"")?null:[o==="$"?"variable":"meta",zr(t,e+2,ba)]}function mc(t,e,s,o,a){let n=t[e];if(a.inTag)return dc(t,e,s,a);let l=lc(t,e,s);if(l!==-1)return["comment",l];if(s.tags)return bc(t,e,a);if(s.quotes?.includes(n)){let E=fa(t,e,s);return[da(t,e,E,s)?"attr":"string",E]}if(s.hex&&n==="#"&&pa.test(t.slice(e,e+10)))return["number",e+pa.exec(t.slice(e,e+10))[0].length];if(la.test(n)||n==="."&&la.test(t[e+1]??""))return["number",zr(t,e+1,ic)];let u=hc(t,e,s);if(u)return u;let b=s.dashed&&n==="-"&&/[A-Za-z-]/.test(t[e+1]??"");if(!Li.test(n)&&!b)return["plain",e+1];let m=zr(t,e+1,s.dashed?ac:ba);if(da(t,e,m,s))return["attr",m];let f=uc(t,e,m,s);return[f==="plain"&&o.has(t.slice(e,m))&&t[e-1]!=="."?"builtin":f,m]}function si(t,e,s=[]){let o=Dr(e),a=new Set(s),n={inTag:!1},l=[],u=0;for(;u<t.length;){let[b,m]=mc(t,u,o,a,n),f=t.slice(u,m),g=l[l.length-1];b==="plain"&&g?.kind==="plain"?g.text+=f:l.push({kind:b,text:f,className:rc[b]}),u=m}return l}function ga(t,e){return t.startsWith(" ")?1:/^ */.exec(t.slice(0,e.length))[0].length}var fc=new Set(["javascript","typescript","go","c","cpp","java","csharp","kotlin","swift","rust","php","css","lua","html","xml"]),gc=new Set("area base br col embed hr img input link meta source track wbr".split(" ")),vc=/^[}\])]+/,yc=/\b(function|if|for|while|repeat)\b/g,xc=/\b(end|until)\b/g,wc=/^(else|elseif)\b/,Sc=/^(end|until)\b/;function ue(t,e){return(t.match(e)??[]).length}function Ac(t,e){let s=new Uint8Array(t.length),o="",a=0;for(let{kind:n,text:l}of si(t,e)){let u=n==="comment"||n==="string";o+=u?l.replace(/[^\n]/g," "):l,u&&s.fill(1,a,a+l.length),a+=l.length}return{masked:o,inside:s}}function Ec(t,e){let s=u=>!(e&&gc.has(u.toLowerCase())),o=[...t.matchAll(/<([A-Za-z][\w:.-]*)/g)].filter(u=>s(u[1])).length,a=[...t.matchAll(/<([A-Za-z][\w:.-]*)[^<>]*\/>/g)].filter(u=>s(u[1])).length,n=t.includes("<")?0:ue(t,/\/>/g);return{leading:ue(/^(?:<\/[^>]*>\s*)+/.exec(t)?.[0]??"",/<\//g),net:o-a-n-ue(t,/<\//g)}}function Cc(t,e){let s=t.trim();if(e.tags)return Ec(s,e.id==="html");let o=e.id==="lua",a=vc.exec(s)?.[0].length??0,n=ue(s,/[{([]/g)-ue(s,/[})\]]/g);if(!o)return{leading:a,net:n};let l=ue(s,yc)+(/^do\b/.test(s)?1:0)-ue(s,xc);return{leading:a||(wc.test(s)||Sc.test(s)?1:0),net:n+l}}function kc(t,e){return(t.id==="c"||t.id==="cpp")&&e.startsWith("#")}function Lc(t,e){let{masked:s,inside:o}=Ac(t,e.id),a=[],n=0,l=0;for(let u of t.split(`
|
|
14
|
+
`)){let b=s.slice(l,l+u.length),m=l>0&&o[l-1]===1;l+=u.length+1;let f=u.trim(),{leading:g,net:E}=Cc(b,e);m?a.push(u.trimEnd()):f?kc(e,f)?a.push(f):a.push(e.indent.repeat(Math.max(0,n-g))+f):a.push(""),n=Math.max(0,n+E)}return a}function Nc(t){return t.split(`
|
|
15
|
+
`).map(e=>e.trimEnd())}function Oc(t){return`${t.filter((s,o)=>s!==""||o>0&&t[o-1]!=="").join(`
|
|
16
|
+
`).replace(/^\n+|\n+$/g,"")}
|
|
17
|
+
`}function va(t,e){let s=Dr(e),o=String(t??"").replace(/\r\n?/g,`
|
|
18
|
+
`);return o.trim()?s.id==="json"?`${JSON.stringify(JSON.parse(o),null,2)}
|
|
19
|
+
`:Oc(fc.has(s.id)?Lc(o,s):Nc(o)):""}var de=class extends c{setup(){this.state=y({text:null,name:"",loading:!1,error:"",editing:!this.props.readonly}),this.fileInput=A("fileInput"),this.input=A("input"),this.controller=null,T(()=>this.syncInput()),P(()=>this.syncInput()),ot(()=>this.loadUrl(this.props.src)),j(e=>{if(e.readonly!==this.props.readonly&&(this.state.editing=!e.readonly),e.src!==this.props.src)return this.loadUrl(e.src)}),q(()=>this.controller?.abort()),this.tabReleased=!1}get classNames(){return h("b-code-editor",this.props.className)}get code(){return this.state.text??this.props.value??""}get codeLang(){return this.props.codeLang??ma(this.state.name||this.props.src)}get language(){return Dr(this.codeLang)}get globals(){return this.props.globals??[]}get isReadonly(){return!this.state.editing}get showToggle(){return this.props.toggle!==!1}get showFormat(){return this.props.format!==!1&&!this.isReadonly}get ariaLabel(){return this.props.title||`${this.language.label} code`}get tokens(){return si(`${this.code}
|
|
20
|
+
`,this.codeLang,this.globals)}get lineCount(){return this.code.split(`
|
|
21
|
+
`).length}get lineLabel(){return`${this.lineCount} ${this.lineCount===1?"line":"lines"}`}get lineNumbers(){return Array.from({length:this.lineCount},(e,s)=>s+1).join(`
|
|
22
|
+
`)}commit(e){(this.state.text!==null||!this.props.onChange)&&(this.state.text=e),this.props.onChange?.(e)}async loadUrl(e){if(this.controller?.abort(),!!e){this.controller=new globalThis.AbortController,this.state.loading=!0,this.state.error="";try{let s=await fetch(e,{signal:this.controller.signal});if(!s.ok)throw new Error(`Could not load ${e} (HTTP ${s.status})`);this.setFile(await s.text(),e)}catch(s){s.name!=="AbortError"&&this.fail(s)}this.state.loading=!1}}syncInput(){let e=this.input.el;if(!e||e.value===this.code)return;let{selectionStart:s,selectionEnd:o}=e;e.value=this.code,e.setSelectionRange(Math.min(s,this.code.length),Math.min(o,this.code.length))}toggleEditing(){this.state.editing=!this.state.editing}format(){try{this.commit(va(this.code,this.codeLang)),this.state.error=""}catch(e){this.fail(e)}}openPicker(){this.fileInput.el.click()}async onFileChange(e){let s=e.target.files[0];if(e.target.value="",!!s)try{this.setFile(await s.text(),s.name)}catch(o){this.fail(o)}}setFile(e,s){Object.assign(this.state,{text:e,name:s,error:""}),this.props.onLoad?.({code:e,name:s})}fail(e){this.state.error=e.message,this.props.onError?.(e)}onInput(e){this.commit(e.target.value),this.revealCaret(e.target)}revealCaret(e){let s=e.closest(".b-code-editor-box");if(!s||!e.isConnected)return;let o=getComputedStyle(e),a=parseFloat(o.paddingTop)||0,n=parseFloat(o.lineHeight)||21,l=e.value.slice(0,e.selectionEnd),u=l.split(`
|
|
23
|
+
`).length-1,b=a+u*n;b-a<s.scrollTop?s.scrollTop=Math.max(0,b-a):b+n+a>s.scrollTop+s.clientHeight&&(s.scrollTop=b+n+a-s.clientHeight);let m=l.slice(l.lastIndexOf(`
|
|
24
|
+
`)+1).replaceAll(" "," ".repeat(4)).length,f=this.measure??(this.measure=document.createElement("canvas").getContext("2d"));if(!f)return;f.font=`${o.fontSize} ${o.fontFamily}`;let g=e.offsetLeft+parseFloat(o.paddingLeft)+m*f.measureText("0").width,E=s.querySelector(".b-code-editor-gutter")?.offsetWidth??0;g<s.scrollLeft+E?s.scrollLeft=Math.max(0,g-E-a):g+a>s.scrollLeft+s.clientWidth&&(s.scrollLeft=g+a-s.clientWidth)}onKeydown(e){let s=e.target;if(requestAnimationFrame(()=>this.revealCaret(s)),e.key==="F"&&e.shiftKey&&e.altKey&&this.showFormat){e.preventDefault(),this.format();return}if(e.key==="Escape"){this.tabReleased=!0;return}let o=this.tabReleased;if(this.tabReleased=!1,e.key==="Tab"&&!o)e.preventDefault(),e.shiftKey?this.outdentLine(s):s.setRangeText(this.language.indent,s.selectionStart,s.selectionEnd,"end");else if(e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.altKey){e.preventDefault();let a=s.value.lastIndexOf(`
|
|
25
|
+
`,s.selectionStart-1)+1,n=/^[ \t]*/.exec(s.value.slice(a,s.selectionStart))[0];s.setRangeText(`
|
|
26
|
+
${n}`,s.selectionStart,s.selectionEnd,"end")}else return;this.commit(s.value)}outdentLine(e){let s=e.value.lastIndexOf(`
|
|
27
|
+
`,e.selectionStart-1)+1,o=ga(e.value.slice(s),this.language.indent);if(!o)return;let{selectionStart:a,selectionEnd:n}=e;e.setRangeText("",s,s+o,"preserve"),e.setSelectionRange(Math.max(s,a-o),Math.max(s,n-o))}};r(de,"template","baseui.CodeEditor"),r(de,"components",{Alert:ct,AlertDescription:At,Badge:Q,Button:x,ClipboardButton:nt,Kbd:Et,Spinner:Ct}),r(de,"props",{value:i(String),codeLang:i(String),src:i(String),upload:i(Boolean),format:i(Boolean),toggle:i(Boolean),onChange:i(Function),onLoad:i(Function),onError:i(Function),readonly:i(Boolean),title:i(String),globals:i(Array),hint:i(String),id:i(String),...p});w();v();var us=class extends c{get tag(){return this.props.tag||"div"}};r(us,"template","baseui.Card"),r(us,"props",{...p,tag:i(String)});var ds=class extends c{};r(ds,"template","baseui.CardHeader"),r(ds,"props",p);var bs=class extends c{};r(bs,"template","baseui.CardBody"),r(bs,"props",p);var hs=class extends c{};r(hs,"template","baseui.CardFooter"),r(hs,"props",p);var ms=class extends c{};r(ms,"template","baseui.CardTitle"),r(ms,"props",p);var fs=class extends c{};r(fs,"template","baseui.CardDescription"),r(fs,"props",p);v();w();v();w();v();var at=class extends c{setup(){this.state=y({open:D(this.props.state)}),this.triggerRef=A("trigger"),this.bufferRef=A("buffer"),this.bootstrapTooltip=null,this.lastContentHtml=null,this.onShown=()=>{this.state.open=!0},this.onHidden=()=>{this.state.open=!1},T(()=>{this.lastContentHtml=this.currentContentHtml();let e=this.triggerElement();this.bootstrapTooltip=new(k()).Tooltip(e,{title:this.lastContentHtml,html:!0,trigger:"hover focus"}),e.addEventListener("shown.bs.tooltip",this.onShown),e.addEventListener("hidden.bs.tooltip",this.onHidden),D(this.props.state)&&this.bootstrapTooltip.show()}),P(()=>{let e=this.currentContentHtml();e!==this.lastContentHtml&&(this.lastContentHtml=e,this.bootstrapTooltip?.setContent({".tooltip-inner":e}))}),q(()=>{let e=this.triggerElement();e?.removeEventListener("shown.bs.tooltip",this.onShown),e?.removeEventListener("hidden.bs.tooltip",this.onHidden),this.bootstrapTooltip?.dispose()})}triggerElement(){return this.triggerRef.el?.firstElementChild||this.triggerRef.el}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}show(){this.bootstrapTooltip?.show()}hide(){this.bootstrapTooltip?.hide()}};r(at,"template","baseui.Tooltip"),r(at,"props",{content:i(String),state:i(String),...p});var Bc=as("circle-question-mark"),Ic=0,tt={label:i(String),labelBackground:i(String),supportingText:i(String),useTip:i(Number),errorText:i(String),leadingIcon:i(String),trailingIcon:i(String),maxLength:i(Number),invalid:i(Boolean),placeholder:i(String),disabled:i(Boolean),slots:i(Object)},Z=class extends c{setup(){this.supportId=`b-input-support-${Ic++}`,this.box=A("box"),this.slotRefs={start:A("start"),end:A("end"),footer:A("footer")},T(()=>this.measureSlots()),P(()=>this.measureSlots())}get field(){return this.env.fieldProps?.()??{}}get label(){return this.props.label??this.field.label}get labelStyle(){let e=this.props.labelBackground??this.field.labelBackground;return e?`--b-label-bg:${e}`:void 0}get isOutlined(){return!!this.label||this.hasStart||this.hasEnd||this.hasFooter}get hasStart(){return!!this.props.slots?.start}get hasEnd(){return!!this.props.slots?.end}get hasFooter(){return!!this.props.slots?.footer}measureSlots(){let e=this.box.el;if(!e)return;let{start:s,end:o,footer:a}=this.slotRefs;e.style.setProperty("--b-slot-start",`${s.el?.offsetWidth??0}px`),e.style.setProperty("--b-slot-end",`${o.el?.offsetWidth??0}px`),e.style.setProperty("--b-slot-footer",`${a.el?.offsetHeight??0}px`)}get isInvalid(){return!!(this.props.invalid||this.field.invalid||this.errorText)}get errorText(){return this.props.errorText??this.field.error}get helperText(){return this.props.supportingText||this.field.description}get useTip(){return Number(this.props.useTip??this.field.useTip??0)===1}get supportingText(){return this.errorText||(this.useTip?void 0:this.helperText)}get tipText(){return this.useTip&&!this.errorText?this.helperText:void 0}get leadingIcon(){return this.props.leadingIcon}get trailingIcon(){return this.isInvalid?"circle-alert":this.props.trailingIcon}get fieldPlaceholder(){return this.props.placeholder??(this.isOutlined?" ":void 0)}get counter(){return`${(this.props.value??"").length}/${this.props.maxLength}`}get controlClass(){return this.isOutlined&&"b-outlined-control"}get describedBy(){return this.supportingText?this.supportId:void 0}get outlinedClassNames(){return h("b-input-outlined",this.isInvalid&&"is-invalid",this.props.disabled&&"is-disabled",this.props.placeholder&&"has-placeholder",this.leadingIcon&&"has-leading",this.trailingIcon&&"has-trailing",this.hasStart&&"has-start",this.hasEnd&&"has-end",this.hasFooter&&"has-footer")}};r(Z,"components",{Icon:R,IconCircleQuestionMark:Bc,Tooltip:at});function oi({tag:t="input",type:e}={}){return t==="select"?"form-select":e==="checkbox"||e==="radio"?"form-check-input":"form-control"}var kt=class extends Z{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return h("b-input",oi({tag:"input",type:this.props.type}),this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(kt,"template","baseui.Input"),r(kt,"props",{...tt,value:i(String),type:i(String),readonly:i(Boolean),className:i(String),style:i([String,Object]),id:i(String),list:i(String),autocomplete:i(String),"aria-label":i(String),ariaLabel:i(String),min:i([String,Number]),max:i([String,Number]),step:i([String,Number]),onInput:i(Function),onChange:i(Function)});w();v();var Ni={default:"b-tabs-list-default",line:"b-tabs-list-line"};function ri(t,e,s,o="horizontal"){let a=o==="vertical",u=t===(a?"ArrowDown":"ArrowRight")?1:t===(a?"ArrowUp":"ArrowLeft")?-1:0;return!u||s===0?-1:(e+u+s)%s}var Tc=0;function ya(t){return String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}var Lt=class extends c{setup(){this.tabsState=y({active:this.props.value??this.props.defaultValue??""}),this.instanceId=`t${++Tc}`,L({tabs:this.tabsState,selectTab:e=>this.select(e),tabsId:this.instanceId,orientation:this.orientation}),j(e=>{e.value!==void 0&&(this.tabsState.active=e.value)})}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return h("b-tabs",this.props.className)}select(e){this.props.value===void 0&&(this.tabsState.active=e),this.props.onChange?.(e)}};r(Lt,"template","baseui.Tabs"),r(Lt,"props",{value:i(String),defaultValue:i(String),orientation:i(String),onChange:i(Function),...p});var Nt=class extends c{};r(Nt,"template","baseui.TabsContainer"),r(Nt,"props",{...p});var Ot=class extends c{setup(){this.listRef=A("list")}get classNames(){return h("nav","b-tabs-list",Ni[this.props.variant]||Ni.default,this.props.className)}onKeyDown(e){let s=[...this.listRef.el.querySelectorAll("[role='tab']")],o=s.indexOf(e.target),a=ri(e.key,o,s.length,this.env.orientation);a!==-1&&(e.preventDefault(),s[a].focus(),s[a].click())}};r(Ot,"template","baseui.TabsList"),r(Ot,"props",{variant:i(String),...p});var lt=class extends c{setup(){this.rootEl=null,this.tabInstance=null,this.onShown=()=>this.env.selectTab(this.props.value)}onRootRef(e){e?(this.rootEl=e,this.tabInstance=k().Tab.getOrCreateInstance(e),e.addEventListener("shown.bs.tab",this.onShown)):this.rootEl&&(this.rootEl.removeEventListener("shown.bs.tab",this.onShown),this.tabInstance?.dispose(),this.tabInstance=null,this.rootEl=null)}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`b-tabs-panel-${this.env.tabsId}-${ya(this.props.value)}`}get classNames(){return h("nav-link","b-tabs-trigger",this.isActive&&"active",this.props.className)}get tabAttrs(){return{role:"tab","data-bs-target":`#${this.panelId}`,"aria-selected":this.isActive?"true":"false",tabindex:this.isActive?0:-1}}onClick(){this.props.disabled||this.tabInstance?.show()}};r(lt,"template","baseui.TabTrigger"),r(lt,"components",{Button:x}),r(lt,"props",{value:{type:String},disabled:i(Boolean),...p});var Bt=class extends c{setup(){this.initialActive=this.isActive}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`b-tabs-panel-${this.env.tabsId}-${ya(this.props.value)}`}};r(Bt,"template","baseui.TabContent"),r(Bt,"props",{value:{type:String},...p});w();v();w();v();function G(t,e){j(s=>{ne(s)&&(t.open=M(s),t.open?e?.instance?.show():e?.instance?.hide())})}function J(t,e,s){ne(t)||(e.open=s),t.onOpenChange?.(s)}function ii(t,e){let s=null;T(()=>{s=new(k()).Collapse(t.el,{toggle:!1})}),P(()=>{if(!s)return;let o=t.el.classList.contains("show");e()&&!o?s.show():!e()&&o&&s.hide()}),q(()=>s?.dispose())}var It=class extends c{setup(){this.dialogState=y({open:M(this.props)}),this.control={instance:null},L({dialog:this.dialogState,dialogControl:this.control,setDialogOpen:e=>this.setOpen(e)}),G(this.dialogState,this.control)}setOpen(e){J(this.props,this.dialogState,e)}};r(It,"template","baseui.Dialog"),r(It,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),style:i([String,Object]),slots:i(Object)});var gs=class extends c{onClick(){this.env.dialogControl.instance?.show()}};r(gs,"template","baseui.DialogTrigger"),r(gs,"props",p);var pt=class extends c{setup(){this.rootRef=A("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDialogOpen(!0),this.onHidden=()=>{this.env.setDialogOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},T(()=>{this.env.dialogControl.instance=k().Modal.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,focus:!0}),this.rootRef.el.addEventListener("show.bs.modal",this.onShow),this.rootRef.el.addEventListener("shown.bs.modal",this.onShown),this.rootRef.el.addEventListener("hidden.bs.modal",this.onHidden),this.env.dialog.open&&this.env.dialogControl.instance.show()}),q(()=>{this.rootRef.el.removeEventListener("show.bs.modal",this.onShow),this.rootRef.el.removeEventListener("shown.bs.modal",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.modal",this.onHidden),this.env.dialogControl.instance?.dispose(),this.env.dialogControl.instance=null})}get showCloseButton(){return this.props.showCloseButton!==!1&&this.props["show-close-button"]!==!1}};r(pt,"template","baseui.DialogContent"),r(pt,"components",{Button:x}),r(pt,"props",{...p,showCloseButton:i(Boolean),"show-close-button":i(Boolean)});var Tt=class extends c{};r(Tt,"template","baseui.DialogHeader"),r(Tt,"props",p);var Rt=class extends c{};r(Rt,"template","baseui.DialogFooter"),r(Rt,"props",p);var $t=class extends c{};r($t,"template","baseui.DialogTitle"),r($t,"props",p);var qt=class extends c{};r(qt,"template","baseui.DialogDescription"),r(qt,"props",p);var be=class extends c{};r(be,"template","baseui.DialogClose"),r(be,"components",{Button:x}),r(be,"props",p);w();v();var xa={default:"b-empty-default",outline:"b-empty-outline",background:"b-empty-background"},Rc={default:"b-empty-media-default",icon:"b-empty-media-icon"},vs=class extends c{get classNames(){return h("b-empty",xa[this.props.variant]||xa.default,this.props.className)}};r(vs,"template","baseui.Empty"),r(vs,"props",{variant:i(String),...p});var ys=class extends c{};r(ys,"template","baseui.EmptyHeader"),r(ys,"props",p);var xs=class extends c{get variant(){return this.props.variant==="icon"?"icon":"default"}get classNames(){return h("b-empty-media",Rc[this.variant],this.props.className)}};r(xs,"template","baseui.EmptyMedia"),r(xs,"props",{variant:i(String),...p});var ws=class extends c{};r(ws,"template","baseui.EmptyTitle"),r(ws,"props",p);var Ss=class extends c{};r(Ss,"template","baseui.EmptyDescription"),r(Ss,"props",p);var As=class extends c{};r(As,"template","baseui.EmptyContent"),r(As,"props",p);w();v();var Es=class extends c{get vertical(){return this.props.orientation==="vertical"}get classNames(){return h("b-separator",this.vertical?"b-separator-vertical":"b-separator-horizontal",this.props.className)}};r(Es,"template","baseui.Separator"),r(Es,"props",{orientation:i(String),className:i(String),style:i([String,Object])});w();v();var Ut=class extends c{get classNames(){return h("b-skeleton",this.props.shape==="circle"?"b-skeleton-circle":"b-skeleton-block",this.props.className)}};r(Ut,"template","baseui.Skeleton"),r(Ut,"props",{shape:i(String),className:i(String),style:i([String,Object])});w();v();var $c={lead:"lead",muted:"text-body-secondary",code:"b-code",kbd:"b-kbd",h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"b-list"},qc={h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"ul"},Cs=class extends c{get tag(){return this.props.tag||qc[this.props.variant]||"p"}get classNames(){return h("b-typography",$c[this.props.variant],this.props.className)}};r(Cs,"template","baseui.Typography"),r(Cs,"props",{variant:i(String),tag:i(String),...p});w();v();var ks=class extends c{get classNames(){return h("b-marker",this.props.className)}get variant(){return this.props.variant}};r(ks,"template","baseui.Marker"),r(ks,"props",{variant:i(String),...p});v();var Pt=class extends Z{get outlinedClassNames(){return h(super.outlinedClassNames,"is-anchored")}get classNames(){return h("form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.resize==="none"&&"b-textarea-no-resize",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(Pt,"template","baseui.Textarea"),r(Pt,"props",{...tt,value:i(String),rows:i(Number),readonly:i(Boolean),resize:i(String),className:i(String),style:i([String,Object]),id:i(String),onInput:i(Function),onChange:i(Function)});v();var Mt=class extends Z{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return h("b-native-select","form-select",this.controlClass,this.isInvalid&&"is-invalid",(this.props.size==="sm"||this.props.size==="lg")&&`form-select-${this.props.size}`,this.props.className)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(Mt,"template","baseui.NativeSelect"),r(Mt,"props",{...tt,value:i(String),size:i(String),...p,"aria-label":i(String),ariaLabel:i(String),id:i(String),onChange:i(Function)});w();v();var _t=class extends c{onChange(e){this.props.onChange?.(e.target.checked,e)}};r(_t,"template","baseui.Checkbox"),r(_t,"props",{checked:i(Boolean),disabled:i(Boolean),...p,id:i(String),onChange:i(Function)});w();v();var Ls=class extends c{setup(){L({radioGroupValue:()=>this.props.value,radioGroupDisabled:()=>this.props.disabled,radioGroupName:()=>this.props.name||"b-radio-group",selectRadio:e=>this.props.onChange?.(e)})}get classNames(){return h("b-radio-group",this.props.className)}};r(Ls,"template","baseui.RadioGroup"),r(Ls,"props",{value:i(String),name:i(String),disabled:i(Boolean),...p,onChange:i(Function)});var Ns=class extends c{get checked(){return this.env.radioGroupValue()===this.props.value}get disabled(){return this.props.disabled||this.env.radioGroupDisabled()}onChange(){this.disabled||this.env.selectRadio(this.props.value)}};r(Ns,"template","baseui.RadioGroupItem"),r(Ns,"props",{value:{type:String},disabled:i(Boolean),...p});w();v();var Uc=as("circle-question-mark"),he=class extends c{get tipText(){return Number(this.props.useTip??0)===1?this.props.supportingText:void 0}get supportingText(){return this.tipText?void 0:this.props.supportingText}onChange(e){this.props.onChange?.(e.target.checked,e)}};r(he,"template","baseui.Switch"),r(he,"components",{IconCircleQuestionMark:Uc,Tooltip:at}),r(he,"props",{checked:i(Boolean),disabled:i(Boolean),supportingText:i(String),useTip:i(Number),...p,onChange:i(Function)});w();v();var Os=class extends c{get classNames(){return h("b-slider",this.props.className)}onInput(e){e.target.style.setProperty("--b-slider-value",`${e.target.value}%`),this.props.onChange?.(e.target.value,e)}};r(Os,"template","baseui.Slider"),r(Os,"props",{value:i([Number,String]),min:i([Number,String]),max:i([Number,String]),step:i([Number,String]),disabled:i(Boolean),className:i(String),style:i([String,Object]),onChange:i(Function)});w();v();var Bs=class extends c{setup(){this.length=this.props.length||6;let e=(this.props.value||"").split("");this.state=y({digits:Array.from({length:this.length},(s,o)=>e[o]||"")}),this.rootRef=A("root")}get classNames(){return h("b-input-otp",this.props.className)}get boxes(){return this.state.digits.map((e,s)=>({index:s,value:e}))}emit(){this.props.onChange?.(this.state.digits.join(""))}onInput(e,s){let o=s.target.value.slice(-1);this.state.digits[e]=o,o&&this.rootRef.el&&[...this.rootRef.el.querySelectorAll("input")][e+1]?.focus(),this.emit()}onPaste(e){let s=e.clipboardData.getData("text").trim();if(s){e.preventDefault();for(let o=0;o<this.length;o++)this.state.digits[o]=s[o]||"";this.emit()}}};r(Bs,"template","baseui.InputOtp"),r(Bs,"props",{length:i(Number),value:i(String),disabled:i(Boolean),className:i(String),style:i([String,Object]),onChange:i(Function)});w();w();function Is(t,{defaultOpen:e=!1,onOpenChange:s}={}){let o=y({open:e}),a=b=>{o.open!==b&&(o.open=b,s?.(b))},n=()=>a(!o.open),l=b=>{t.el&&!t.el.contains(b.target)&&a(!1)},u=b=>{b.key==="Escape"&&a(!1)};return Y(b=>{if(b)return document.addEventListener("click",l),document.addEventListener("keydown",u),()=>{document.removeEventListener("click",l),document.removeEventListener("keydown",u)}},()=>[o.open]),q(()=>{document.removeEventListener("click",l),document.removeEventListener("keydown",u)}),{state:o,setOpen:a,toggle:n}}v();var Ts=class extends Z{setup(){super.setup(),this.rootRef=A("root");let{state:e,setOpen:s,toggle:o}=Is(this.rootRef,{defaultOpen:D(this.props.state)});this.disclosure=e,L({select:this.disclosure,selectValue:()=>this.props.value,selectToggle:o,selectClose:()=>s(!1),selectChoose:a=>{this.props.onChange?.(a),s(!1)}})}get outlinedClassNames(){return h(super.outlinedClassNames,"is-anchored",this.props.value&&"is-floated")}get rootStyle(){return H(this.labelStyle,this.props.style)}get classNames(){return h("b-select",this.isOutlined&&this.outlinedClassNames,this.props.className)}};r(Ts,"template","baseui.Select"),r(Ts,"props",{...tt,value:i(String),state:i(String),onChange:i(Function),...p});var me=class extends c{get attrs(){return{"aria-haspopup":"listbox","aria-expanded":this.env.select.open?"true":"false"}}onClick(){this.env.selectToggle()}};r(me,"template","baseui.SelectTrigger"),r(me,"components",{Button:x}),r(me,"props",p);var Rs=class extends c{get open(){return this.env.select.open}};r(Rs,"template","baseui.SelectContent"),r(Rs,"props",p);var $s=class extends c{get selected(){return this.env.selectValue()===this.props.value}onClick(){this.env.selectChoose(this.props.value)}};r($s,"template","baseui.SelectItem"),r($s,"props",{value:{type:String},...p});w();function qs(t){return[...t.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")].filter(e=>!e.disabled&&!e.hidden)}function Oi(t,e){if(t.key!=="Tab")return;let s=qs(e);if(!s.length){t.preventDefault();return}let o=s[0],a=s[s.length-1];t.shiftKey&&document.activeElement===o?(t.preventDefault(),a.focus()):!t.shiftKey&&document.activeElement===a&&(t.preventDefault(),o.focus())}function ai(t,{closeSelector:e,trapFocus:s=!1}={}){let o=t.getAttribute("b-att-trigger"),a=o?document.querySelector(o):null,n=[...t.querySelectorAll(e)],l=null,u=()=>qs(t),b=()=>{l=document.activeElement,t.hidden=!1,t.setAttribute("b-att-state","open"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),u()[0]?.focus(),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},m=()=>{t.hidden=!0,t.setAttribute("b-att-state","closed"),l?.focus?.(),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))},f=E=>{if(E.key==="Escape"){m();return}!s||t.hidden||Oi(E,t)},g=E=>{E.target===t&&m()};return a?.addEventListener("click",b),n.forEach(E=>E.addEventListener("click",m)),t.addEventListener("keydown",f),t.addEventListener("click",g),(!t.getAttribute("b-att-state")||t.getAttribute("b-att-state")==="closed")&&(t.hidden=!0),{open:b,close:m,destroy:()=>{a?.removeEventListener("click",b),n.forEach(E=>E.removeEventListener("click",m)),t.removeEventListener("keydown",f),t.removeEventListener("click",g)}}}function Us(t,e,s,o){let a=t.getAttribute("b-att-trigger"),n=a?document.querySelector(a):null,l=null,u=()=>{l=document.activeElement},b=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},m=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0})),l?.focus?.(),l=null},f=()=>e.show(),g=()=>e.hide();return t.addEventListener(`show.bs.${s}`,u),t.addEventListener(`shown.bs.${s}`,b),t.addEventListener(`hidden.bs.${s}`,m),n?.addEventListener("click",f),t.setAttribute("b-att-state","closed"),t[o]={open:f,close:g},{destroy:()=>{n?.removeEventListener("click",f),t.removeEventListener(`show.bs.${s}`,u),t.removeEventListener(`shown.bs.${s}`,b),t.removeEventListener(`hidden.bs.${s}`,m),e.dispose(),delete t[o]}}}v();var Ps=class extends c{setup(){this.alertDialogState=y({open:M(this.props)}),L({alertDialog:this.alertDialogState,setAlertDialogOpen:e=>this.setOpen(e)}),G(this.alertDialogState)}setOpen(e){J(this.props,this.alertDialogState,e)}};r(Ps,"template","baseui.AlertDialog"),r(Ps,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var fe=class extends c{get attrs(){return{"data-slot":"alert-dialog-trigger"}}onClick(){this.env.setAlertDialogOpen(!0)}};r(fe,"template","baseui.AlertDialogTrigger"),r(fe,"components",{Button:x}),r(fe,"props",p);var Ms=class extends c{get size(){return this.props.size==="sm"?"sm":"default"}setup(){this.rootRef=A("root"),Y(e=>{if(!e)return;let s=document.activeElement;return qs(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.alertDialog.open])}get open(){return this.env.alertDialog.open}onKeyDown(e){if(e.key==="Escape"){this.env.setAlertDialogOpen(!1);return}Oi(e,this.rootRef.el)}};r(Ms,"template","baseui.AlertDialogContent"),r(Ms,"props",{...p,size:i(String)});var _s=class extends c{};r(_s,"template","baseui.AlertDialogHeader"),r(_s,"props",p);var zs=class extends c{};r(zs,"template","baseui.AlertDialogFooter"),r(zs,"props",p);var Ds=class extends c{};r(Ds,"template","baseui.AlertDialogMedia"),r(Ds,"props",p);var js=class extends c{};r(js,"template","baseui.AlertDialogTitle"),r(js,"props",p);var Fs=class extends c{};r(Fs,"template","baseui.AlertDialogDescription"),r(Fs,"props",p);var ge=class extends c{get attrs(){return{"data-slot":"alert-dialog-cancel"}}onClick(){this.env.setAlertDialogOpen(!1)}};r(ge,"template","baseui.AlertDialogCancel"),r(ge,"components",{Button:x}),r(ge,"props",p);var ve=class extends c{get attrs(){return{"data-slot":"alert-dialog-action"}}onClick(){this.props.onClick?.(),this.env.setAlertDialogOpen(!1)}};r(ve,"template","baseui.AlertDialogAction"),r(ve,"components",{Button:x}),r(ve,"props",{...p,onClick:i(Function)});w();v();var Hs=class extends c{setup(){this.drawerState=y({open:M(this.props)}),this.control={instance:null},L({drawer:this.drawerState,drawerControl:this.control,setDrawerOpen:e=>this.setOpen(e)}),G(this.drawerState,this.control)}setOpen(e){J(this.props,this.drawerState,e)}};r(Hs,"template","baseui.Drawer"),r(Hs,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var ye=class extends c{onClick(){this.env.drawerControl.instance?.show()}};r(ye,"template","baseui.DrawerTrigger"),r(ye,"components",{Button:x}),r(ye,"props",p);var Ws=class extends c{setup(){this.rootRef=A("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDrawerOpen(!0),this.onHidden=()=>{this.env.setDrawerOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},T(()=>{this.env.drawerControl.instance=k().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawer.open&&this.env.drawerControl.instance.show()}),q(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawerControl.instance?.dispose(),this.env.drawerControl.instance=null})}get open(){return this.env.drawer.open}};r(Ws,"template","baseui.DrawerContent"),r(Ws,"props",p);var Ks=class extends c{};r(Ks,"template","baseui.DrawerHeader"),r(Ks,"props",p);var Vs=class extends c{};r(Vs,"template","baseui.DrawerFooter"),r(Vs,"props",p);var Zs=class extends c{};r(Zs,"template","baseui.DrawerTitle"),r(Zs,"props",p);var Gs=class extends c{};r(Gs,"template","baseui.DrawerDescription"),r(Gs,"props",p);var xe=class extends c{get attrs(){return{"data-bs-dismiss":"offcanvas"}}};r(xe,"template","baseui.DrawerClose"),r(xe,"components",{Button:x}),r(xe,"props",p);w();v();var Js=class extends c{setup(){this.sheetState=y({open:M(this.props),side:this.props.side}),this.control={instance:null},L({sheet:this.sheetState,sheetControl:this.control,setSheetOpen:e=>this.setOpen(e)}),G(this.sheetState,this.control),j(e=>{this.sheetState.side=e.side})}setOpen(e){J(this.props,this.sheetState,e)}};r(Js,"template","baseui.Sheet"),r(Js,"props",{open:i(Boolean),state:i(String),side:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var we=class extends c{onClick(){this.env.sheetControl.instance?.show()}};r(we,"template","baseui.SheetTrigger"),r(we,"components",{Button:x}),r(we,"props",p);var Xs=class extends c{setup(){this.rootRef=A("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setSheetOpen(!0),this.onHidden=()=>{this.env.setSheetOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},T(()=>{this.env.sheetControl.instance=k().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheet.open&&this.env.sheetControl.instance.show()}),q(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheetControl.instance?.dispose(),this.env.sheetControl.instance=null})}get open(){return this.env.sheet.open}get side(){return this.props.side??this.env.sheet.side}get placementClass(){return this.side==="left"?"offcanvas-start":"offcanvas-end"}};r(Xs,"template","baseui.SheetContent"),r(Xs,"props",{...p,side:i(String)});var Ys=class extends c{};r(Ys,"template","baseui.SheetHeader"),r(Ys,"props",p);var Qs=class extends c{};r(Qs,"template","baseui.SheetFooter"),r(Qs,"props",p);var to=class extends c{};r(to,"template","baseui.SheetTitle"),r(to,"props",p);var eo=class extends c{};r(eo,"template","baseui.SheetDescription"),r(eo,"props",p);var Se=class extends c{};r(Se,"template","baseui.SheetClose"),r(Se,"components",{Button:x}),r(Se,"props",p);w();v();var so=class extends c{setup(){let e=y({open:D(this.props.state)});this.control={instance:null,bufferEl:null,lastContentHtml:null};let s=o=>{e.open!==o&&(e.open=o,this.props.onOpenChange?.(o))};L({popover:e,popoverControl:this.control,popoverSetOpen:s,popoverToggle:()=>this.control.instance?.toggle(),popoverClose:()=>this.control.instance?.hide()})}};r(so,"template","baseui.Popover"),r(so,"props",{state:i(String),onOpenChange:i(Function),...p});var Ae=class extends c{setup(){this.rootRef={el:null},this.getRef=e=>{this.rootRef.el=e},this.onShown=()=>this.env.popoverSetOpen(!0),this.onHidden=()=>this.env.popoverSetOpen(!1),T(()=>{let e=this.env.popoverControl,s=e.bufferEl?.innerHTML??"";e.lastContentHtml=s,e.instance=new(k()).Popover(this.rootRef.el,{content:s,html:!0,trigger:"manual"}),this.rootRef.el.addEventListener("shown.bs.popover",this.onShown),this.rootRef.el.addEventListener("hidden.bs.popover",this.onHidden)}),q(()=>{this.rootRef.el.removeEventListener("shown.bs.popover",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.popover",this.onHidden),this.env.popoverControl.instance?.dispose(),this.env.popoverControl.instance=null})}get attrs(){return{"aria-haspopup":"dialog","aria-expanded":this.env.popover.open?"true":"false"}}onClick(){this.env.popoverControl.instance?.toggle()}};r(Ae,"template","baseui.PopoverTrigger"),r(Ae,"components",{Button:x}),r(Ae,"props",p);var oo=class extends c{get style(){return H("display:none",this.props.style)}setup(){this.bufferRef=A("buffer"),T(()=>{this.env.popoverControl.bufferEl=this.bufferRef.el}),P(()=>{let e=this.env.popoverControl;e.bufferEl=this.bufferRef.el;let s=this.currentContentHtml();e.instance&&s!==e.lastContentHtml&&(e.lastContentHtml=s,e.instance.setContent({".popover-body":s}))})}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}};r(oo,"template","baseui.PopoverContent"),r(oo,"props",{...p,content:i(String)});w();v();var ro=class extends c{setup(){this.state=y({open:!1}),L({hoverCard:this.state})}open(){this.state.open=!0}close(){this.state.open=!1}onKeyDown(e){e.key==="Escape"&&this.close()}};r(ro,"template","baseui.HoverCard"),r(ro,"props",{...p});var io=class extends c{};r(io,"template","baseui.HoverCardTrigger"),r(io,"props",p);var ao=class extends c{get open(){return this.env.hoverCard.open}};r(ao,"template","baseui.HoverCardContent"),r(ao,"props",p);w();v();var Bi={...p,disabled:i(Boolean),inset:i(Boolean),onClick:i(Function),onSelect:i(Function),variant:i(String)},zt=class extends c{setup(){this.rootRef=A("root");let e=y({open:D(this.props.state)});this.control={instance:null};let s=n=>{e.open!==n&&(e.open=n,this.props.onOpenChange?.(n))};L({dropdownMenu:e,dropdownControl:this.control,dropdownSetOpen:s,dropdownToggle:()=>this.control.instance?.toggle(),dropdownClose:()=>this.control.instance?.hide()});let o=n=>{this.rootRef.el&&!this.rootRef.el.contains(n.target)&&this.control.instance?.hide()},a=n=>{n.key==="Escape"&&this.control.instance?.hide()};Y(n=>{if(n)return document.addEventListener("click",o),document.addEventListener("keydown",a),()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",a)}},()=>[e.open]),q(()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",a)})}};r(zt,"template","baseui.DropdownMenu"),r(zt,"props",{state:i(String),onOpenChange:i(Function),...p});var ut=class extends c{setup(){this.rootRef={el:null},this.onShown=()=>this.env.dropdownSetOpen(!0),this.onHidden=()=>this.env.dropdownSetOpen(!1),this.getRef=e=>{e?(this.rootRef.el=e,this.env.dropdownControl.instance=k().Dropdown.getOrCreateInstance(e),e.addEventListener("shown.bs.dropdown",this.onShown),e.addEventListener("hidden.bs.dropdown",this.onHidden)):this.rootRef.el&&(this.rootRef.el.removeEventListener("shown.bs.dropdown",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.dropdown",this.onHidden),this.env.dropdownControl.instance?.dispose(),this.env.dropdownControl.instance=null,this.rootRef.el=null)}}get classNames(){return h("btn","b-button","btn-outline-secondary","b-dropdown-menu-trigger",this.props.className)}get attrs(){return{"data-slot":"dropdown-menu-trigger","aria-haspopup":"menu","aria-expanded":this.env.dropdownMenu.open?"true":"false"}}onClick(){this.env.dropdownToggle()}};r(ut,"template","baseui.DropdownMenuTrigger"),r(ut,"components",{Button:x}),r(ut,"props",p);var Dt=class extends c{get open(){return this.env.dropdownMenu.open}get classNames(){return h("b-dropdown-menu-content","dropdown-menu",this.open?"show":"",this.props.className)}};r(Dt,"template","baseui.DropdownMenuContent"),r(Dt,"props",{...p,align:i(String),alignOffset:i(Number),side:i(String),sideOffset:i(Number)});var no=class extends c{};r(no,"template","baseui.DropdownMenuGroup"),r(no,"props",p);var co=class extends c{};r(co,"template","baseui.DropdownMenuLabel"),r(co,"props",{...p,inset:i(Boolean)});var jt=class extends c{get variant(){return this.props.variant||"default"}onClick(e){this.props.disabled||(this.props.onClick?.(e),this.props.onSelect?.(e),this.env.dropdownClose())}};r(jt,"template","baseui.DropdownMenuItem"),r(jt,"props",Bi);var Ee=class extends c{onClick(e){this.props.disabled||(this.props.onCheckedChange?.(!this.props.checked,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};r(Ee,"template","baseui.DropdownMenuCheckboxItem"),r(Ee,"components",{Icon:R}),r(Ee,"props",{...Bi,checked:i(Boolean),onCheckedChange:i(Function)});var lo=class extends c{setup(){L({dropdownRadio:{value:this.props.value,onValueChange:this.props.onValueChange}})}};r(lo,"template","baseui.DropdownMenuRadioGroup"),r(lo,"props",{...p,value:i(String),onValueChange:i(Function)});var Ce=class extends c{get checked(){return this.env.dropdownRadio?.value===this.props.value}onClick(e){this.props.disabled||(this.env.dropdownRadio?.onValueChange?.(this.props.value,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};r(Ce,"template","baseui.DropdownMenuRadioItem"),r(Ce,"components",{Icon:R}),r(Ce,"props",{...Bi,value:i(String)});var po=class extends c{};r(po,"template","baseui.DropdownMenuSeparator"),r(po,"props",p);var uo=class extends c{};r(uo,"template","baseui.DropdownMenuShortcut"),r(uo,"props",p);var Ft=class extends c{setup(){this.rootRef=A("root");let{state:e,setOpen:s,toggle:o}=Is(this.rootRef);L({dropdownSub:e,dropdownSubToggle:o,dropdownSubOpen:()=>s(!0),dropdownSubClose:()=>s(!1)})}};r(Ft,"template","baseui.DropdownMenuSub"),r(Ft,"props",p);var dt=class extends c{onMouseEnter(){this.props.disabled||this.env.dropdownSubOpen()}onClick(){this.props.disabled||this.env.dropdownSubToggle()}};r(dt,"template","baseui.DropdownMenuSubTrigger"),r(dt,"components",{Icon:R}),r(dt,"props",{...p,disabled:i(Boolean),inset:i(Boolean)});var Ht=class extends c{get open(){return this.env.dropdownSub.open}};r(Ht,"template","baseui.DropdownMenuSubContent"),r(Ht,"props",p);w();v();var bo=class extends c{setup(){this.state=y({open:!1,x:0,y:0});let e=()=>{this.state.open=!1};this.close=e,L({contextMenu:this.state,contextMenuOpenAt:(s,o)=>{this.state.open=!0,this.state.x=s,this.state.y=o},contextMenuClose:e}),document.addEventListener("click",e),q(()=>document.removeEventListener("click",e))}};r(bo,"template","baseui.ContextMenu"),r(bo,"props",{className:i(String),slots:i(Object)});var ho=class extends c{onContextMenu(e){e.preventDefault(),this.env.contextMenuOpenAt(e.clientX,e.clientY)}};r(ho,"template","baseui.ContextMenuTrigger"),r(ho,"props",p);var mo=class extends c{setup(){this.rootRef=A("root")}get open(){return this.env.contextMenu.open}get style(){return H(`left:${this.env.contextMenu.x}px;top:${this.env.contextMenu.y}px`,this.props.style)}};r(mo,"template","baseui.ContextMenuContent"),r(mo,"props",p);var fo=class extends c{onClick(){this.props.onClick?.(),this.env.contextMenuClose()}};r(fo,"template","baseui.ContextMenuItem"),r(fo,"props",{...p,onClick:i(Function)});w();v();var Pc={"top-left":["top-0","start-0"],"top-right":["top-0","end-0"],"bottom-left":["bottom-0","start-0"],"bottom-right":["bottom-0","end-0"]};function ni(t){let e=Pc[t];return e?["toast-container","position-fixed","p-3","pe-auto",...e]:null}var bt=class extends c{setup(){this.state=y({open:M(this.props)}),this.rootRef=A("root"),this.bootstrapToast=null,this.handleShown=()=>{this.state.open=!0},this.handleHidden=()=>{this.state.open=!1,this.props.onOpenChange?.(!1)},T(()=>{this.mountBootstrapToast(this.props.delay),this.state.open&&this.bootstrapToast.show()}),j(e=>{let s=ne(e)?M(e):this.state.open;e.delay!==this.props.delay?(this.bootstrapToast?.dispose(),this.mountBootstrapToast(e.delay),s&&this.bootstrapToast.show()):s!==this.state.open&&(s?this.bootstrapToast?.show():this.bootstrapToast?.hide())}),q(()=>{this.bootstrapToast?.dispose()})}mountBootstrapToast(e){let s=this.rootRef.el,o=e??3e3;this.bootstrapToast=new(k()).Toast(s,{autohide:o>0,delay:o||3e3}),s.addEventListener("shown.bs.toast",this.handleShown),s.addEventListener("hidden.bs.toast",this.handleHidden)}get classNames(){return h("toast","fade","b-toast",ni(this.props.position),this.props.className)}get role(){return this.props.variant==="danger"?"alert":"status"}get hasActionSlot(){return!!this.props.slots?.action}close(){this.bootstrapToast?.hide()}};r(bt,"template","baseui.Toast"),r(bt,"components",{Button:x}),r(bt,"props",{open:i(Boolean),state:i(String),variant:i(String),delay:i(Number),position:i(String),...p,onOpenChange:i(Function)});w();v();var go=class extends c{setup(){this.state=y({open:new Set}),L({accordion:this.state,accordionToggle:e=>this.toggle(e)})}toggle(e){let s=!this.state.open.has(e);this.props.multiple||this.state.open.clear(),s?this.state.open.add(e):this.state.open.delete(e),this.props.onChange?.(s)}};r(go,"template","baseui.Accordion"),r(go,"props",{multiple:i(Boolean),onChange:i(Function),...p});var vo=class extends c{setup(){L({accordionItemState:this.props.state,accordionItemValue:this.props.value})}};r(vo,"template","baseui.AccordionItem"),r(vo,"props",{value:{type:String},state:i(String),...p});var ke=class extends c{get open(){return this.env.accordionItemState!==void 0?D(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}get triggerAttrs(){return{"data-slot":"accordion-trigger","aria-expanded":this.open?"true":"false"}}onClick(){this.env.accordionToggle(this.env.accordionItemValue)}};r(ke,"template","baseui.AccordionTrigger"),r(ke,"components",{Icon:R,Button:x}),r(ke,"props",p);var yo=class extends c{setup(){this.rootRef=A("root"),this.initialOpen=this.open,ii(this.rootRef,()=>this.open)}get open(){return this.env.accordionItemState!==void 0?D(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}};r(yo,"template","baseui.AccordionContent"),r(yo,"props",p);w();v();var xo=class extends c{setup(){this.state=y({open:M(this.props)}),L({collapsible:this.state,collapsibleToggle:()=>this.toggle()}),G(this.state)}toggle(){let e=!this.state.open;J(this.props,this.state,e)}};r(xo,"template","baseui.Collapsible"),r(xo,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),...p});var Le=class extends c{get attrs(){return{"aria-expanded":this.env.collapsible.open?"true":"false"}}onClick(){this.env.collapsibleToggle()}};r(Le,"template","baseui.CollapsibleTrigger"),r(Le,"components",{Button:x}),r(Le,"props",p);var wo=class extends c{setup(){this.rootRef=A("root"),this.initialOpen=this.open,ii(this.rootRef,()=>this.open)}get open(){return this.env.collapsible.open}};r(wo,"template","baseui.CollapsibleContent"),r(wo,"props",p);w();v();var Wt=class extends c{};r(Wt,"template","baseui.Breadcrumb"),r(Wt,"props",{...p});var Kt=class extends c{};r(Kt,"template","baseui.BreadcrumbList"),r(Kt,"props",{...p});var Vt=class extends c{get classNames(){return h("b-breadcrumb-item",this.props.current&&"b-breadcrumb-page",this.props.className)}};r(Vt,"template","baseui.BreadcrumbItem"),r(Vt,"props",{current:i(Boolean),...p});var Zt=class extends c{get classNames(){return h("b-breadcrumb-link",this.props.className)}onClick(e){this.props.onClick?.(e)}};r(Zt,"template","baseui.BreadcrumbLink"),r(Zt,"props",{href:i(String),target:i(String),rel:i(String),...p,onClick:i(Function)});var Gt=class extends c{get classNames(){return h("b-breadcrumb-page",this.props.className)}};r(Gt,"template","baseui.BreadcrumbPage"),r(Gt,"props",{...p});var ht=class extends c{get classNames(){return h("b-breadcrumb-separator",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};r(ht,"template","baseui.BreadcrumbSeparator"),r(ht,"components",{Icon:R}),r(ht,"props",{...p});var Ne=class extends c{get classNames(){return h("b-breadcrumb-ellipsis",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};r(Ne,"template","baseui.BreadcrumbEllipsis"),r(Ne,"components",{Icon:R}),r(Ne,"props",{...p});w();v();var So=class extends c{get classNames(){return h("b-pagination",this.props.className)}};r(So,"template","baseui.Pagination"),r(So,"props",{...p});var Ao=class extends c{get classNames(){return h("page-item",this.props.current&&"active",this.props.disabled&&"disabled")}onClick(){this.props.disabled||this.props.onClick?.()}};r(Ao,"template","baseui.PaginationItem"),r(Ao,"props",{current:i(Boolean),disabled:i(Boolean),style:i([String,Object]),onClick:i(Function),slots:i(Object)});w();v();var Eo=class extends c{setup(){this.rootRef=A("root")}onKeyDown(e){let s=[...this.rootRef.el.querySelectorAll("a, button")].filter(n=>!n.disabled),o=s.indexOf(e.target),a=e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;!a||o<0||(e.preventDefault(),s[(o+a+s.length)%s.length]?.focus())}};r(Eo,"template","baseui.NavigationMenu"),r(Eo,"props",{...p});var Co=class extends c{};r(Co,"template","baseui.NavigationMenuItem"),r(Co,"props",{href:i(String),...p});w();v();var ko=class extends c{get classNames(){return h("b-menubar",this.props.className)}};r(ko,"template","baseui.Menubar"),r(ko,"props",{...p});w();v();var wa={...p,href:i(String)};function Sa(t){globalThis.matchMedia?.("(max-width: 991.98px)").matches&&t.setSidebarOpen?.(!1)}var ft=class extends c{setup(){this.state=y({open:M(this.props)}),L({sidebar:this.state,setSidebarOpen:e=>this.setOpen(e)}),G(this.state)}setOpen(e){J(this.props,this.state,e)}get sidebarState(){return this.state.open?"expanded":"collapsed"}get side(){return this.props.side||"left"}get variant(){return this.props.variant||"sidebar"}get collapsible(){return this.props.collapsible||"offcanvas"}get classNames(){return h("b-sidebar-root",this.props.className)}onKeyDown(e){e.key==="Escape"&&this.setOpen(!1)}};r(ft,"template","baseui.Sidebar"),r(ft,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),side:i(String),variant:i(String),collapsible:i(String),...p});var jr=class extends ft{};r(jr,"template","baseui.Sidebar");var Oe=class extends c{onClick(){if(this.env.setShellCollapsed&&!globalThis.matchMedia?.("(max-width: 991.98px)").matches){this.env.setShellCollapsed(!this.env.shell.collapsed);return}this.env.setSidebarOpen(!this.env.sidebar.open)}};r(Oe,"template","baseui.SidebarTrigger"),r(Oe,"components",{Icon:R,Button:x}),r(Oe,"props",{...p,icon:i(String),label:i(String)});var Jt=class extends c{get open(){return this.env.sidebar.open}};r(Jt,"template","baseui.SidebarContent"),r(Jt,"props",p);var Lo=class extends c{};r(Lo,"template","baseui.SidebarHeader"),r(Lo,"props",p);var No=class extends c{};r(No,"template","baseui.SidebarFooter"),r(No,"props",p);var Oo=class extends c{};r(Oo,"template","baseui.SidebarInset"),r(Oo,"props",p);var Be=class extends c{onClick(){this.env.setSidebarOpen(!this.env.sidebar.open)}};r(Be,"template","baseui.SidebarRail"),r(Be,"components",{Button:x}),r(Be,"props",p);var Bo=class extends c{};r(Bo,"template","baseui.SidebarInput"),r(Bo,"props",{className:i(String),style:i([String,Object]),placeholder:i(String),value:i(String),type:i(String)});var Io=class extends c{};r(Io,"template","baseui.SidebarSeparator"),r(Io,"props",p);var Ie=class extends c{onClick(){this.env.setSidebarOpen(!1)}};r(Ie,"template","baseui.SidebarClose"),r(Ie,"components",{Icon:R,Button:x}),r(Ie,"props",{...p,icon:i(String),label:i(String)});var Xt=class extends c{};r(Xt,"template","baseui.SidebarGroup"),r(Xt,"props",{muted:i(Boolean),...p});var Yt=class extends c{};r(Yt,"template","baseui.SidebarGroupLabel"),r(Yt,"props",wa);var Te=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r(Te,"template","baseui.SidebarGroupAction"),r(Te,"components",{Button:x}),r(Te,"props",{icon:i(String),"aria-label":i(String),ariaLabel:i(String),onClick:i(Function),...p});var To=class extends c{};r(To,"template","baseui.SidebarGroupContent"),r(To,"props",p);var Re=class extends c{setup(){let e=this.props["default-open"]!==void 0||this.props.defaultOpen!==void 0;this.state=y({open:ne(this.props)||e?M(this.props):!0}),G(this.state)}get open(){return this.state.open}toggle(){let e=!this.state.open;J(this.props,this.state,e)}};r(Re,"template","baseui.SidebarGroupCollapsible"),r(Re,"components",{Icon:R,Button:x}),r(Re,"props",{label:{type:String},open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),...p});var gt=class extends c{};r(gt,"template","baseui.SidebarMenu"),r(gt,"props",p);var Qt=class extends c{};r(Qt,"template","baseui.SidebarMenuItem"),r(Qt,"props",p);var mt=class extends c{get classNames(){return h("b-sidebar-menu-button",this.isActive&&"is-active",this.props.variant&&`is-${this.props.variant}`,this.props.size&&`is-${this.props.size}`,this.props.className)}get isActive(){return this.props.active||this.props.isActive}onClick(e){this.props.onClick?.(e),Sa(this.env)}};r(mt,"template","baseui.SidebarMenuButton"),r(mt,"components",{Icon:R,Button:x}),r(mt,"props",{href:i(String),icon:i(String),active:i(Boolean),isActive:i(Boolean),variant:i(String),size:i(String),tooltip:i(String),disabled:i(Boolean),onClick:i(Function),...p});var $e=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r($e,"template","baseui.SidebarMenuAction"),r($e,"components",{Button:x}),r($e,"props",{icon:i(String),"aria-label":i(String),ariaLabel:i(String),showOnHover:i(Boolean),onClick:i(Function),...p});var Ro=class extends c{};r(Ro,"template","baseui.SidebarMenuSub"),r(Ro,"props",p);var $o=class extends c{};r($o,"template","baseui.SidebarMenuBadge"),r($o,"props",p);var qo=class extends c{setup(){this.state=y({width:this.props.width||`${Math.floor(Math.random()*40)+50}%`})}get style(){return H(`--b-sidebar-skeleton-width:${this.state.width}`,this.props.style)}};r(qo,"template","baseui.SidebarMenuSkeleton"),r(qo,"props",{showIcon:i(Boolean),width:i(String),className:i(String),style:i([String,Object])});var Uo=class extends c{};r(Uo,"template","baseui.SidebarMenuSubItem"),r(Uo,"props",p);var qe=class extends c{get classNames(){return h("b-sidebar-menu-sub-button",(this.props.active||this.props.isActive)&&"is-active",this.props.size&&`is-${this.props.size}`,this.props.className)}onClick(e){this.props.onClick?.(e),Sa(this.env)}};r(qe,"template","baseui.SidebarMenuSubButton"),r(qe,"components",{Button:x}),r(qe,"props",{...wa,active:i(Boolean),isActive:i(Boolean),size:i(String),onClick:i(Function)});w();v();var Ue=class extends c{setup(){this.state=y({collapsed:this.props.collapsed??this.props.defaultCollapsed??!1,authState:this.props.authState??null}),L({shell:this.state,setShellCollapsed:e=>this.setCollapsed(e)}),j(e=>{e.collapsed!==void 0&&(this.state.collapsed=e.collapsed),this.state.authState=e.authState??null})}setCollapsed(e){this.props.collapsed===void 0&&(this.state.collapsed=e),this.props.onCollapsedChange?.(e)}dismissToast(){this.props.onToastOpenChange?.(!1)}runToastAction(){this.props.toast?.onAction?.()}};r(Ue,"template","baseui.Shell"),r(Ue,"components",{Sidebar:ft,Toast:bt,Button:x}),r(Ue,"props",{open:i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),collapsed:i(Boolean),defaultCollapsed:i(Boolean),onCollapsedChange:i(Function),authState:i(Object),toast:i(Object),onToastOpenChange:i(Function),notificationPage:i(Function),pwa:i(Function),...p});var Pe=class extends c{};r(Pe,"template","baseui.ShellSidebar"),r(Pe,"components",{SidebarContent:Jt}),r(Pe,"props",p);var Po=class extends c{};r(Po,"template","baseui.ShellSidebarHeader"),r(Po,"props",p);var Mo=class extends c{};r(Mo,"template","baseui.ShellNav"),r(Mo,"props",p);var _o=class extends c{};r(_o,"template","baseui.ShellMain"),r(_o,"props",p);var zo=class extends c{};r(zo,"template","baseui.ShellHeader"),r(zo,"props",p);var Me=class extends c{};r(Me,"template","baseui.ShellContent"),r(Me,"components",{Skeleton:Ut}),r(Me,"props",{loading:i(Boolean),...p});var _e=class extends c{get authState(){return this.env.shell.authState}logout(){this.authState?.onLogout?.()}};r(_e,"template","baseui.ShellUserMenu"),r(_e,"components",{Button:x}),r(_e,"props",p);w();v();var Do=class extends c{get classNames(){return h("table","b-table",this.props.striped!==!1&&"table-striped",this.props.hover!==!1&&"table-hover",this.props.className)}};r(Do,"template","baseui.Table"),r(Do,"props",{striped:i(Boolean),hover:i(Boolean),responsive:i(Boolean),...p});w();v();var Mc=[{key:"status",label:"Status",format:"capitalize"},{key:"email",label:"Email",sortable:!0,filterable:!0},{key:"amount",label:"Amount",align:"right",format:"currency"}],_c=[{id:"728ed52f",status:"success",email:"ken99@example.com",amount:316},{id:"489e1d42",status:"success",email:"abe45@example.com",amount:242},{id:"6b0888f6",status:"processing",email:"monserrat44@example.com",amount:837},{id:"a1dc8c4e",status:"success",email:"silas22@example.com",amount:874},{id:"15b96de0",status:"failed",email:"carmella@example.com",amount:721}],zc=[{label:"Copy payment ID"},{label:"View customer"},{label:"View payment details"}],ze=4,De=8,Dc=32,je=class extends c{setup(){this.state=y({query:"",sortKey:null,sortDir:1,page:0,pageSize:this.initialPageSize,selectedKeys:[],hiddenColumns:this.columns.filter(e=>e.hidden||e.visible===!1).map(e=>e.key),columnsOpen:!1,actionRowKey:null,actionMenuStyle:null}),this.actionsMenuRef=A("actionsMenu"),this.actionsMenuTriggerEl=null,rs(window,"click",this.onWindowClick,!0),rs(window,"keydown",this.onWindowKeydown),rs(window,"resize",this.closeRowActions),rs(window,"scroll",this.closeRowActions,!0),P(()=>this.refreshActionsMenuPosition())}get columns(){return this.props.columns?.length?this.props.columns:Mc}get rows(){return this.props.rows?.length?this.props.rows:_c}get usesDefaultRows(){return!this.props.rows?.length}get initialPageSize(){return this.props["page-size"]??this.props.pageSize??10}get pageSizeOptions(){return this.props["page-size-options"]??this.props.pageSizeOptions??[10,20,50,80]}get rowActions(){return this.props["row-actions"]??this.props.rowActions??(this.usesDefaultRows?zc:[])}get variant(){return this.props.variant||"default"}get classNames(){return h("b-data-table",`b-data-table-${this.variant}`,this.props.className)}get viewportStyle(){let e=this.props["max-height"]??this.props.maxHeight;return e?`max-height: ${typeof e=="number"?`${e}px`:e};`:""}get hasSearch(){return this.props.searchable!==!1}get hasSorting(){return this.props.sortable!==!1}get hasPagination(){return this.props.pagination!==!1}get hasColumnToggle(){return this.props["column-toggle"]??this.props.columnToggle??!0}get hasToolbarActions(){return!!this.props.slots?.toolbarActions}get hasSelection(){return this.props.selectable??this.usesDefaultRows}get visibleColumns(){return this.columns.filter(e=>!this.state.hiddenColumns.includes(e.key))}get visibleRows(){let e=this.state.query.toLowerCase(),s=this.columns.filter(n=>n.filterable===!0),o=(s.length?s:this.columns).map(n=>n.key),a=this.rows.filter(n=>!e||o.some(l=>String(n[l]).toLowerCase().includes(e)));return this.state.sortKey&&(a=[...a].sort((n,l)=>String(n[this.state.sortKey]).localeCompare(String(l[this.state.sortKey]))*this.state.sortDir)),a}get pageCount(){return Math.max(1,Math.ceil(this.visibleRows.length/this.state.pageSize))}get pageRows(){if(!this.hasPagination)return this.visibleRows;let s=Math.min(this.state.page,this.pageCount-1)*this.state.pageSize;return this.visibleRows.slice(s,s+this.state.pageSize)}get selectedCount(){return this.state.selectedKeys.length}get selectionLabel(){return`${this.selectedCount} of ${this.visibleRows.length} row(s) selected.`}get emptyLabel(){return this.props["empty-label"]??this.props.emptyLabel??"No results."}get filterPlaceholder(){return this.props["filter-placeholder"]??this.props.filterPlaceholder??"Filter emails..."}get canPreviousPage(){return this.hasPagination&&this.state.page>0}get canNextPage(){return this.hasPagination&&this.state.page<this.pageCount-1}get pageLabel(){return`Page ${Math.min(this.state.page,this.pageCount-1)+1} of ${this.pageCount}`}rowKey(e,s){return e.id??e.key??s}isSelected(e,s){return this.state.selectedKeys.includes(this.rowKey(e,s))}isColumnSortable(e){return this.hasSorting&&e.sortable===!0}onSearchInput(e){this.state.query=e.target.value,this.state.page=0}sortBy(e){let s=this.columns.find(o=>o.key===e);!s||!this.isColumnSortable(s)||(this.state.sortKey===e?this.state.sortDir=-this.state.sortDir:(this.state.sortKey=e,this.state.sortDir=1))}sortIcon(e){return this.state.sortKey!==e?"arrow-up-down":this.state.sortDir===1?"arrow-up":"arrow-down"}toggleColumn(e){this.state.hiddenColumns.includes(e)?this.state.hiddenColumns=this.state.hiddenColumns.filter(s=>s!==e):this.state.hiddenColumns=[...this.state.hiddenColumns,e]}toggleColumnsMenu(){this.state.columnsOpen=!this.state.columnsOpen}toggleRowActions(e,s,o){let a=this.rowKey(e,s);if(this.state.actionRowKey===a){this.closeRowActions();return}this.actionsMenuTriggerEl=o.currentTarget,this.state.actionRowKey=a,this.state.actionMenuStyle=this.estimateActionMenuStyle(o.currentTarget)}closeRowActions(){this.state.actionRowKey!==null&&(this.state.actionRowKey=null,this.state.actionMenuStyle=null,this.actionsMenuTriggerEl=null)}get openRowAction(){if(this.state.actionRowKey===null)return null;let e=this.pageRows.findIndex((s,o)=>this.rowKey(s,o)===this.state.actionRowKey);return e===-1?null:{row:this.pageRows[e],index:e}}estimateActionMenuStyle(e){let s=e.getBoundingClientRect(),o=this.rowActions.length*Dc+ze*2,a=window.innerHeight-s.bottom,l=a<o+ze&&s.top>a?Math.max(De,s.top-ze-o):s.bottom+ze,u=Math.min(Math.max(De,s.right-160),window.innerWidth-160-De);return`position: fixed; top: ${Math.round(l)}px; left: ${Math.round(u)}px;`}refreshActionsMenuPosition(){if(this.state.actionRowKey===null||!this.actionsMenuTriggerEl)return;let e=this.actionsMenuRef.el;if(!e)return;let s=this.actionsMenuTriggerEl.getBoundingClientRect(),o=e.getBoundingClientRect(),a=window.innerHeight-s.bottom,n=s.top,u=a<o.height+ze&&n>a?Math.max(De,s.top-ze-o.height):Math.min(s.bottom+ze,window.innerHeight-o.height-De),b=Math.min(Math.max(De,s.right-o.width),window.innerWidth-o.width-De),m=`position: fixed; top: ${Math.round(u)}px; left: ${Math.round(b)}px;`;this.state.actionMenuStyle!==m&&(this.state.actionMenuStyle=m)}onWindowClick(e){this.state.actionRowKey===null||this.actionsMenuRef.el?.contains(e.target)||this.actionsMenuTriggerEl?.contains(e.target)||this.closeRowActions()}onWindowKeydown(e){e.key==="Escape"&&this.closeRowActions()}setPage(e){this.state.page=Math.max(0,Math.min(e,this.pageCount-1))}setPageSize(e){this.state.pageSize=Number(e),this.state.page=0}optionValue(e){return`${e}`}toggleRow(e,s,o){let a=this.rowKey(e,s);this.state.selectedKeys=o?[...new Set([...this.state.selectedKeys,a])]:this.state.selectedKeys.filter(n=>n!==a),this.props.onSelectionChange?.(this.state.selectedKeys)}toggleAllVisible(e){let s=this.pageRows.map((o,a)=>this.rowKey(o,a));this.state.selectedKeys=e?[...new Set([...this.state.selectedKeys,...s])]:this.state.selectedKeys.filter(o=>!s.includes(o)),this.props.onSelectionChange?.(this.state.selectedKeys)}onAction(e,s,o){e.onSelect?.(s,o),this.props.onRowAction?.(e,s,o),this.closeRowActions()}columnLabel(e){return e.label??e.key}cellValue(e,s){let o=e[s.key];if(s.format==="currency"){let a=Number(o);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(Number.isFinite(a)?a:0)}if(s.format==="capitalize"){let a=String(o??"");return a.charAt(0).toUpperCase()+a.slice(1)}return o??""}cellComponentProps(e,s){return s.componentProps?s.componentProps(e,s):{row:e,column:s,value:e[s.key]}}};r(je,"template","baseui.DataTable"),r(je,"components",{Button:x,Icon:R}),r(je,"props",{columns:i(Array),rows:i(Array),variant:i(String),searchable:i(Boolean),sortable:i(Boolean),pagination:i(Boolean),selectable:i(Boolean),"column-toggle":i(Boolean),columnToggle:i(Boolean),"row-actions":i(Array),rowActions:i(Array),"page-size":i(Number),pageSize:i(Number),"page-size-options":i(Array),pageSizeOptions:i(Array),"filter-placeholder":i(String),filterPlaceholder:i(String),"empty-label":i(String),emptyLabel:i(String),onRowAction:i(Function),onSelectionChange:i(Function),...p,"max-height":i([String,Number]),maxHeight:i([String,Number])});w();v();var jc=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}),Fc=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Fe=class extends c{get baseDate(){return this.props.selected?new Date(`${this.props.selected}T00:00:00`):new Date}get month0(){return(this.props.month??this.baseDate.getMonth()+1)-1}get year(){return this.props.year??this.baseDate.getFullYear()}get headerLabel(){return jc.format(new Date(this.year,this.month0,1))}get weekdays(){return Fc}get days(){let e=new Date(this.year,this.month0+1,0).getDate(),s=new Date(this.year,this.month0,1).getDay(),o=[];for(let a=0;a<s;a++)o.push(null);for(let a=1;a<=e;a++){let n=`${this.year}-${String(this.month0+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`;o.push({day:a,value:n,selected:n===this.props.selected})}return o}onSelect(e){this.props.onChange?.(e)}};r(Fe,"template","baseui.Calendar"),r(Fe,"components",{Button:x}),r(Fe,"props",{selected:i(String),month:i(Number),year:i(Number),className:i(String),style:i([String,Object]),onChange:i(Function)});v();var jo=class extends Z{get classNames(){return h("b-date-picker","form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onChange?.(e.target.value,e)}};r(jo,"template","baseui.DatePicker"),r(jo,"props",{...tt,value:i(String),className:i(String),style:i([String,Object]),onChange:i(Function)});w();v();var Fo=class extends Z{setup(){super.setup(),this.rootRef=A("root");let{state:e}=Is(this.rootRef);this.disclosure=e,this.state=y({query:this.selectedLabel})}get classNames(){return h("form-control",this.controlClass,this.isInvalid&&"is-invalid")}get selectedLabel(){return this.props.options.find(e=>e.value===this.props.value)?.label||""}get filteredOptions(){let e=this.state.query.toLowerCase();return this.props.options.filter(s=>s.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value,this.disclosure.open=!0}onFocus(){this.disclosure.open=!0}choose(e){this.state.query=e.label,this.disclosure.open=!1,this.props.onChange?.(e.value)}};r(Fo,"template","baseui.Combobox"),r(Fo,"props",{options:{type:Array},...tt,value:i(String),className:i(String),style:i([String,Object]),id:i(String),onChange:i(Function)});w();v();var Ho=class extends c{setup(){this.state=y({query:""})}get filteredItems(){let e=this.state.query.toLowerCase();return this.props.items.filter(s=>s.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value}select(e){this.props.onSelect?.(e.value)}};r(Ho,"template","baseui.Command"),r(Ho,"props",{items:{type:Array},placeholder:i(String),className:i(String),style:i([String,Object]),onSelect:i(Function)});w();v();var Wo=class extends c{get classNames(){return h("b-chart",this.props.type&&`b-chart-${this.props.type}`,this.props.variant&&`b-chart-${this.props.variant}`,this.props.className)}};r(Wo,"template","baseui.Chart"),r(Wo,"props",{config:i([String,Object]),label:i(String),type:i(String),value:i([String,Number]),variant:i(String),...p});w();v();var Ko=class extends c{setup(){this.state=y({index:this.props.defaultIndex??0}),this.rootRef=A("root"),this.bootstrapCarousel=null,this.onSlid=e=>{this.state.index=e.to,this.props.onChange?.(this.state.index)},L({carousel:this.state,carouselInstance:()=>this.bootstrapCarousel}),T(()=>{this.bootstrapCarousel=new(k()).Carousel(this.rootRef.el,{interval:!1,wrap:!0,touch:!0}),this.rootRef.el.addEventListener("slid.bs.carousel",this.onSlid)}),q(()=>{this.rootRef.el.removeEventListener("slid.bs.carousel",this.onSlid),this.bootstrapCarousel?.dispose()})}};r(Ko,"template","baseui.Carousel"),r(Ko,"props",{slideCount:{type:Number},defaultIndex:i(Number),onChange:i(Function),...p});var Vo=class extends c{setup(){this.rootRef=A("root"),this.initialActive=this.active,P(()=>{if(!this.rootRef.el)return;let e=this.rootRef.el.classList.contains("active");this.active&&!e?this.rootRef.el.classList.add("active"):!this.active&&e&&this.rootRef.el.classList.remove("active")})}get active(){return this.props.state!==void 0?D(this.props.state):this.env.carousel.index===this.props.index}};r(Vo,"template","baseui.CarouselSlide"),r(Vo,"props",{index:{type:Number},state:i(String),...p});var He=class extends c{onClick(){this.env.carouselInstance()?.prev()}};r(He,"template","baseui.CarouselPrevious"),r(He,"components",{Button:x}),r(He,"props",p);var We=class extends c{onClick(){this.env.carouselInstance()?.next()}};r(We,"template","baseui.CarouselNext"),r(We,"components",{Button:x}),r(We,"props",p);w();v();var Zo=class extends c{setup(){this.panelRef=A("panel"),this.state=y({width:null})}get panelStyle(){return this.state.width?`width:${this.state.width}px`:""}onPointerDown(e){let s=e.clientX,o=this.panelRef.el.getBoundingClientRect().width,a=this.props.min||160,n=this.props.max||720,l=b=>{this.state.width=Math.min(n,Math.max(a,o+b.clientX-s))},u=()=>{document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",u),this.props.onChange?.(this.state.width)};document.addEventListener("pointermove",l),document.addEventListener("pointerup",u)}};r(Zo,"template","baseui.Resizable"),r(Zo,"props",{min:i(Number),max:i(Number),onChange:i(Function),...p});w();v();var Go=class extends c{get classNames(){return h("b-scroll-area",this.props.className)}};r(Go,"template","baseui.ScrollArea"),r(Go,"props",p);w();v();var Aa={idle:"b-attachment-idle",uploading:"b-attachment-uploading",processing:"b-attachment-processing",error:"b-attachment-error",done:"b-attachment-done"},Ea={default:"b-attachment-default",sm:"b-attachment-sm",xs:"b-attachment-xs"},Jo=class extends c{get state(){return Aa[this.props.state]?this.props.state:"done"}get size(){return Ea[this.props.size]?this.props.size:"default"}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return h("b-attachment",Aa[this.state],Ea[this.size],`b-attachment-${this.orientation}`,!this.hasContent&&"b-attachment-picker",this.props.className)}get hasContent(){return!!this.props.slots?.default}onChange(e){this.props.onChange?.([...e.target.files])}};r(Jo,"template","baseui.Attachment"),r(Jo,"props",{state:i(String),size:i(String),orientation:i(String),multiple:i(Boolean),...p,onChange:i(Function)});var Xo=class extends c{get variant(){return this.props.variant==="image"?"image":"icon"}get classNames(){return h("b-attachment-media",`b-attachment-media-${this.variant}`,this.props.className)}};r(Xo,"template","baseui.AttachmentMedia"),r(Xo,"props",{variant:i(String),...p});var Yo=class extends c{};r(Yo,"template","baseui.AttachmentContent"),r(Yo,"props",p);var Qo=class extends c{};r(Qo,"template","baseui.AttachmentTitle"),r(Qo,"props",p);var tr=class extends c{};r(tr,"template","baseui.AttachmentDescription"),r(tr,"props",p);var er=class extends c{};r(er,"template","baseui.AttachmentActions"),r(er,"props",p);var Ke=class extends c{get variant(){return this.props.variant||"ghost"}get size(){return this.props.size||"icon-xs"}get className(){return h("b-button-icon","b-attachment-action",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r(Ke,"template","baseui.AttachmentAction"),r(Ke,"components",{Button:x}),r(Ke,"props",{type:i(String),variant:i(String),size:i(String),disabled:i(Boolean),label:i(String),...p,"aria-label":i(String),ariaLabel:i(String),onClick:i(Function)});var Ve=class extends c{get classNames(){return h("b-attachment-trigger",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r(Ve,"template","baseui.AttachmentTrigger"),r(Ve,"components",{Button:x}),r(Ve,"props",{href:i(String),target:i(String),rel:i(String),type:i(String),className:i(String),style:i([String,Object]),"aria-label":i(String),ariaLabel:i(String),onClick:i(Function)});var sr=class extends c{get classNames(){return h("b-attachment-group",this.props.className)}};r(sr,"template","baseui.AttachmentGroup"),r(sr,"props",{...p});var or=class extends c{setup(){this.state=y({dragging:!1}),this.fileInput=A("fileInput")}get hasContent(){return!!this.props.slots?.default}get classNames(){return h("b-attachment-dropzone",this.state.dragging&&"b-attachment-dropzone-dragging",this.props.disabled&&"b-attachment-dropzone-disabled",this.props.className)}openPicker(){this.props.disabled||this.fileInput.el?.click()}onInputChange(e){let s=Array.from(e.target.files??[]);e.target.value="",s.length&&this.props.onFilesSelected?.(s)}onDragOver(e){e.preventDefault(),!this.props.disabled&&(this.state.dragging=!0)}onDragLeave(){this.state.dragging=!1}onDrop(e){if(e.preventDefault(),this.state.dragging=!1,this.props.disabled)return;let s=Array.from(e.dataTransfer?.files??[]);s.length&&this.props.onFilesSelected?.(s)}};r(or,"template","baseui.AttachmentDropzone"),r(or,"props",{multiple:i(Boolean),disabled:i(Boolean),...p,onFilesSelected:i(Function)});w();v();var rr=class extends c{setup(){this.state=y({errored:!1})}get showImage(){return!!this.props.src&&!this.state.errored}onError(){this.state.errored=!0}};r(rr,"template","baseui.Avatar"),r(rr,"props",{src:i(String),alt:i(String),title:i(String),...p});w();v();var ir=class extends c{get classNames(){return h("b-message",this.props.className)}get side(){return this.props.side||"incoming"}};r(ir,"template","baseui.Message"),r(ir,"props",{side:i(String),...p});w();v();var ar=class extends c{setup(){this.rootRef=A("root"),Y(()=>{this.props.autoscroll!==!1&&this.rootRef.el&&(this.rootRef.el.scrollTop=this.rootRef.el.scrollHeight)})}};r(ar,"template","baseui.MessageScroller"),r(ar,"props",{autoscroll:i(Boolean),...p});w();v();var nr=class extends c{setup(){this.state=y({index:0}),L({questionnaire:this.state,questionnaireShow:e=>this.show(e)})}show(e){this.state.index=Math.min(this.props.stepCount-1,Math.max(0,e)),this.props.onChange?.(this.state.index)}};r(nr,"template","baseui.Questionnaire"),r(nr,"props",{stepCount:{type:Number},onChange:i(Function),...p});var cr=class extends c{get active(){return this.props.state!==void 0?D(this.props.state):this.env.questionnaire.index===this.props.index}};r(cr,"template","baseui.QuestionnaireStep"),r(cr,"props",{index:{type:Number},state:i(String),...p});var Ze=class extends c{get disabled(){return this.env.questionnaire.index===0}onClick(){this.env.questionnaireShow(this.env.questionnaire.index-1)}};r(Ze,"template","baseui.QuestionnairePrevious"),r(Ze,"components",{Button:x}),r(Ze,"props",p);var Ge=class extends c{onClick(){this.env.questionnaireShow(this.env.questionnaire.index+1)}};r(Ge,"template","baseui.QuestionnaireNext"),r(Ge,"components",{Button:x}),r(Ge,"props",{...p,stepCount:i(Number)});w();v();var lr=class extends c{get max(){return this.props.max||100}get value(){return Math.min(this.max,Math.max(0,this.props.value||0))}get style(){return H(`--b-progress-value:${this.value/this.max*100}%`,this.props.style)}get classNames(){return h("progress b-progress",this.props.className)}};r(lr,"template","baseui.Progress"),r(lr,"props",{value:i(Number),max:i(Number),className:i(String),style:i([String,Object])});w();v();var pr=class extends c{get classNames(){return h("b-aspect-ratio",this.props.className)}get style(){let e=this.props.ratio||`${this.props.width||16} / ${this.props.height||9}`;return H(`--b-aspect-ratio:${e}`,this.props.style)}};r(pr,"template","baseui.AspectRatio"),r(pr,"props",{ratio:i(String),width:i(Number),height:i(Number),...p});w();v();var ur=class extends c{get classNames(){return h("b-bubble",this.props.className)}get side(){return this.props.side}};r(ur,"template","baseui.Bubble"),r(ur,"props",{side:i(String),...p});w();v();var dr=class extends c{get dir(){return this.props.dir==="rtl"?"rtl":"ltr"}};r(dr,"template","baseui.Direction"),r(dr,"props",{dir:i(String),...p});w();v();var br=class extends c{get classNames(){return h("b-item",this.props.className)}get variant(){return this.props.variant}};r(br,"template","baseui.Item"),r(br,"props",{variant:i(String),...p});w();v();var hr=class extends c{get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return h("b-button-group",this.orientation==="vertical"?"btn-group-vertical":"btn-group",(this.props.size==="sm"||this.props.size==="lg")&&`btn-group-${this.props.size}`,this.props.className)}get ariaLabel(){return this.props["aria-label"]}get ariaLabelledby(){return this.props["aria-labelledby"]}};r(hr,"template","baseui.ButtonGroup"),r(hr,"props",{orientation:i(String),size:i(String),"aria-label":i(String),"aria-labelledby":i(String),...p});var mr=class extends c{get orientation(){return this.props.orientation==="horizontal"?"horizontal":"vertical"}get classNames(){return h("b-button-group-separator",`b-button-group-separator-${this.orientation}`,this.props.className)}};r(mr,"template","baseui.ButtonGroupSeparator"),r(mr,"props",{orientation:i(String),className:i(String),style:i([String,Object])});var fr=class extends c{get classNames(){return h("b-button-group-text",this.props.className)}};r(fr,"template","baseui.ButtonGroupText"),r(fr,"props",{...p});w();v();var gr=class extends c{get classNames(){return h("b-field-set",this.props.className)}};r(gr,"template","baseui.FieldSet"),r(gr,"props",{...p});var vr=class extends c{get variant(){return this.props.variant||"legend"}get classNames(){return h("b-field-legend",this.props.className)}};r(vr,"template","baseui.FieldLegend"),r(vr,"props",{variant:i(String),...p});var te=class extends c{get classNames(){return h("b-field-group",this.props.className)}};r(te,"template","baseui.FieldGroup"),r(te,"props",{...p});var ee=class extends c{setup(){L({fieldProps:()=>this.props})}get orientation(){return this.props.orientation||"vertical"}get classNames(){return h("b-field",`b-field-orientation-${this.orientation}`,this.props.className)}};r(ee,"template","baseui.Field"),r(ee,"props",{orientation:i(String),invalid:i(Boolean),label:i(String),labelBackground:i(String),description:i(String),useTip:i(Number),error:i(String),...p});var yr=class extends c{get classNames(){return h("b-field-content",this.props.className)}};r(yr,"template","baseui.FieldContent"),r(yr,"props",{...p});var se=class extends c{get classNames(){return h("b-field-label",this.props.className)}};r(se,"template","baseui.FieldLabel"),r(se,"props",{for:i(String),...p});var xr=class extends c{get classNames(){return h("b-field-title",this.props.className)}};r(xr,"template","baseui.FieldTitle"),r(xr,"props",{...p});var oe=class extends c{get classNames(){return h("b-field-description",this.props.className)}};r(oe,"template","baseui.FieldDescription"),r(oe,"props",{...p});var wr=class extends c{get hasContent(){return!!this.props.slots?.default}get classNames(){return h("b-field-separator",this.props.className)}};r(wr,"template","baseui.FieldSeparator"),r(wr,"props",{...p});var re=class extends c{get classNames(){return h("b-field-error",this.props.className)}};r(re,"template","baseui.FieldError"),r(re,"props",{message:i(String),...p});function Ca(t){return`Icon${String(t).split("-").filter(Boolean).map(s=>s[0].toUpperCase()+s.slice(1)).join("")}`}w();v();var Sr=class extends c{get classNames(){return h("form-label","b-label","b-label",this.props.className)}get state(){return this.props.state||(this.props.required?"required":void 0)}};r(Sr,"template","baseui.Label"),r(Sr,"props",{for:i(String),required:i(Boolean),state:i(String),...p});w();var Hc="b-theme",Wc="theme",Kc="[b-theme-toggle]",Vc="[b-theme-label]";function Ii(t){return t==="dark"?"dark":"light"}function Zc(t){return typeof globalThis.location>"u"?null:new URLSearchParams(globalThis.location.search).get(t)}function Gc(t,e=document.documentElement){let s=Ii(t);return globalThis.thebase?.theme?.set?globalThis.thebase.theme.set(s):e&&(e.setAttribute("b-theme",s),e.setAttribute("data-bs-theme",s)),s}function ka(t,e,s){try{t.contentWindow?.BaseUI?.theme.set(e),t.contentDocument?.documentElement.setAttribute("b-theme",e),t.contentDocument?.documentElement.setAttribute("data-bs-theme",e)}catch{let o=new URL(t.getAttribute("src"),globalThis.location.href);o.searchParams.set(s,e),t.setAttribute("src",o.pathname+o.search+o.hash)}}function Jc(t){typeof document>"u"||typeof CustomEvent>"u"||document.dispatchEvent(new CustomEvent("baseui:theme-change",{detail:{theme:t}}))}function ie(t={}){let e=t.storageKey||Hc,s=t.queryKey||Wc,o=t.toggleSelector??Kc,a=t.labelSelector??Vc,n=t.root||(typeof document>"u"?null:document.documentElement);function l(){return Zc(s)}function u(){return Ii(l()||globalThis.localStorage?.getItem(e)||n?.getAttribute("b-theme")||"light")}function b(N){typeof document>"u"||!o||document.querySelectorAll(o).forEach(I=>{I.setAttribute("aria-pressed",N==="dark"?"true":"false");let C=a?I.querySelector(a):null;C&&(C.textContent=N==="dark"?"Light theme":"Dark theme")})}function m(N){typeof document>"u"||document.querySelectorAll("iframe").forEach(I=>ka(I,N,s))}function f(N,I={}){let C=Gc(N,n);return!I.skipStorage&&!l()&&globalThis.localStorage?.setItem(e,C),b(C),m(C),Jc(C),C}function g(){return f(n?.getAttribute("b-theme")==="dark"?"light":"dark")}function E(){if(typeof document>"u")return u();let N=u();return f(N,{skipStorage:!!l()}),o&&document.addEventListener("click",I=>{I.target.closest?.(o)&&g()}),document.querySelectorAll("iframe").forEach(I=>{I.addEventListener("load",()=>ka(I,n?.getAttribute("b-theme")||N,s))}),N}return{current:u,set:f,toggle:g,syncFrames:m,init:E}}var La=ie();typeof window<"u"&&(window.BaseUITheme=La);v();v();ns();var Na=["btn","b-theme-button",...Object.values(W),...Object.values(V)];function Ar(t){let e=t==="dark";return{icon:e?"sun":"moon",label:e?"Switch to light theme":"Switch to dark theme",pressed:e?"true":"false"}}function ci({variant:t="outline",size:e,className:s}={}){return h("btn","b-theme-button",W[t]||W.outline,V[e],s)}var vt=class extends c{setup(){this.theme=ie({storageKey:K(this.props,"storage-key","storageKey")}),this.state=y({theme:this.theme.current()}),this.onThemeChange=e=>{this.state.theme=e.detail?.theme||this.theme.current()},T(()=>{this.state.theme=this.theme.set(this.theme.current(),{skipStorage:!0}),document.addEventListener("baseui:theme-change",this.onThemeChange)}),q(()=>document.removeEventListener("baseui:theme-change",this.onThemeChange))}get iconName(){return Ar(this.state.theme).icon}get baseUrl(){return K(this.props,"base-url")}get label(){return Ar(this.state.theme).label}get pressed(){return Ar(this.state.theme).pressed}get classNames(){return ci(this.props)}get attrs(){return{"b-theme-button":""}}onClick(){let e=this.theme.toggle();this.state.theme=e,this.props.onChange?.(e)}};r(vt,"template","baseui.ThemeButton"),r(vt,"components",{Icon:R,Button:x}),r(vt,"props",{variant:i(String),size:i(String),"base-url":i(String),"storage-key":i(String),storageKey:i(String),className:i(String),style:i([String,Object]),onChange:i(Function)});w();v();var Je=class extends c{get classNames(){return h("b-toggle","btn",this.props.variant==="outline"?"btn-outline-secondary":"btn-light",this.props.className)}get pressed(){return this.props.state!==void 0?D(this.props.state):!!this.props.pressed}onClick(){this.props.onChange?.(!this.pressed)}};r(Je,"template","baseui.Toggle"),r(Je,"components",{Button:x}),r(Je,"props",{pressed:i(Boolean),state:i(String),variant:i(String),...p,onChange:i(Function)});w();v();var Er=class extends c{setup(){this.state=y({selected:new Set}),L({toggleGroup:this.state,toggleGroupSelect:e=>this.select(e)})}select(e){this.props.multiple?this.state.selected.has(e)?this.state.selected.delete(e):this.state.selected.add(e):this.state.selected=this.state.selected.has(e)?new Set:new Set([e]);let s=this.props.multiple?[...this.state.selected]:[...this.state.selected][0];this.props.onChange?.(s)}};r(Er,"template","baseui.ToggleGroup"),r(Er,"props",{multiple:i(Boolean),onChange:i(Function),...p});var Xe=class extends c{get pressed(){return this.env.toggleGroup.selected.has(this.props.value)}onClick(){this.env.toggleGroupSelect(this.props.value)}};r(Xe,"template","baseui.ToggleGroupItem"),r(Xe,"components",{Button:x}),r(Xe,"props",{value:{type:String},...p});w();v();w();v();ui();function di(t){let e=String(t??""),s=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e);if(!s)return{data:{},content:e};let o={};for(let a of s[1].split(/\r?\n/)){let n=a.trim();if(!n||n.startsWith("#"))continue;let l=n.indexOf(":");if(l===-1)continue;let u=n.slice(0,l).trim();u&&(o[u]=Rl(n.slice(l+1).trim()))}return{data:o,content:e.slice(s[0].length)}}function Pa(t){return t.length>=2&&(t[0]==='"'&&t.at(-1)==='"'||t[0]==="'"&&t.at(-1)==="'")?t.slice(1,-1):t}function Rl(t){if(t==="")return"";if(t==="true")return!0;if(t==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1).trim();return e?e.split(",").map(s=>Pa(s.trim())):[]}return Pa(t)}var yt=class extends c{setup(){this.rootRef=A("root"),this.editorRef=A("editor"),this.editorHandle=null,this.state=y({html:"",source:"",status:"loading",error:"",frontmatter:{}}),ot(()=>this.load(this.props)),j(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),T(()=>this.afterRender()),P(()=>this.afterRender()),le(()=>{this.destroyEditor(),this.rootRef.el&&Cr(this.rootRef.el)})}get classNames(){return h("b-markdown",this.props.className)}get editorLabel(){return this.props.collaborative?"Collaborative Markdown editor":"Markdown editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src}shouldRestartEditor(e){return e.editable!==this.props.editable||e.collaborative!==this.props.collaborative||e.room!==this.props.room||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=e.content??"";if(e.src)try{let o=await fetch(e.src);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);s=await o.text()}catch(o){this.state.status="error",this.state.error=o.message||String(o);return}try{this.state.source=s;let{data:o,content:a}=di(s);this.state.frontmatter=o,this.state.html=wi(await Fr(a)),this.state.status="ready"}catch(o){this.state.status="error",this.state.error=o.message||String(o)}}get hasFrontmatterMeta(){let e=this.state.frontmatter;return!!(e.tags?.length||e.authors?.length)}enhance(){let e=this.rootRef.el;!e||this.state.status!=="ready"||Hr(e,{mermaid:this.props.mermaid!==!1,baseUi:this.props.baseUi!==!1})}afterRender(){this.props.editable?this.mountEditor():this.enhance()}async mountEditor(){let e=this.editorRef.el;if(!(!e||this.editorHandle||this.state.status!=="ready"))try{this.editorHandle=await Wr({root:e,value:this.state.source,collaborative:!!this.props.collaborative,room:this.props.room||"b-markdown",password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(s,o,a)=>{this.state.source=s,this.props.onChange?.(s,o,a)}})}catch(s){this.state.status="error",this.state.error=s.message||String(s)}}destroyEditor(){this.editorHandle?.destroy?.(),this.editorHandle=null}};r(yt,"template","baseui.Markdown"),r(yt,"components",{Badge:Q}),r(yt,"props",{content:i(String),src:i(String),mermaid:i(Boolean),baseUi:i(Boolean),editable:i(Boolean),collaborative:i(Boolean),room:i(String),password:i(String),signaling:i(Array),user:i(Object),onChange:i(Function),className:i(String),style:i([String,Object])});var Ma={implicit:"Implicit",password:"Resource Owner Password Credentials",application:"Client Credentials",accessCode:"Authorization Code"},$l=["POST","PUT","PATCH"];function Ye(t){try{return sessionStorage.getItem(t)||""}catch{return""}}function Kr(t,e){try{e?sessionStorage.setItem(t,e):sessionStorage.removeItem(t)}catch{}}function _i(){return!!(Ye("apikey")||Ye("oauthkey"))}function Mi(t){return t.example!==void 0?String(t.example):t.default!==void 0?String(t.default):t.enum?.length?String(t.enum[0]):t.type==="integer"||t.type==="number"?t.format==="int64"?"10":"1":t.type==="boolean"?"true":t.required&&t.in==="path"?"string":""}function zi(t,e){let s=Ye("apikey"),o=Ye("oauthkey");for(let a of t.security)a.type==="apiKey"&&a.in==="header"?e.header[a.name]=s:a.type==="apiKey"&&a.in==="query"?e.query[a.name]=s:a.type==="basic"?e.header.Authorization=s?`Basic ${s}`:"":(a.type==="oauth2"||a.type==="bearer")&&(e.header.Authorization=o?`Bearer ${o}`:"")}function _a(t,e){let s={baseUrl:e,path:{},query:{},header:{},bodyText:"",mimeType:t.consumes?.[0]||"application/json"};return t.parameters.path.forEach(o=>{s.path[o.name]=Mi(o)}),t.parameters.query.forEach(o=>{s.query[o.name]=o.required?Mi(o):""}),t.parameters.header.forEach(o=>{s.header[o.name]=o.required?Mi(o):""}),t.produces?.length&&(s.header.Accept=t.produces.includes("application/json")?"application/json":t.produces[0]),t.parameters.body&&(s.mimeType=t.parameters.body.contentType||s.mimeType,s.bodyText=Di(t.parameters.body.example)),zi(t,s),s}function Di(t){return typeof t=="string"?t:JSON.stringify(t,null,2)??""}function ji(t,e){let s=t.path;for(let[a,n]of Object.entries(e.path))s=s.replace(`{${a}}`,encodeURIComponent(n??""));let o=!!t.parameters.body&&$l.includes(t.method);return{method:t.method,url:`${e.baseUrl}${s}`,query:Object.entries(e.query).filter(([,a])=>a!==""),headers:Object.entries(e.header).filter(([,a])=>a!==""),bodyText:o?e.bodyText:"",mimeType:e.mimeType}}function za(t){let e=t.query.length?`${t.url}?${new URLSearchParams(t.query)}`:t.url,s=Object.fromEntries(t.headers);return t.bodyText&&(s["Content-Type"]=s["Content-Type"]||t.mimeType),{url:e,headers:s,headerLines:Object.entries(s).map(([o,a])=>`${o}: ${a}`).join(`
|
|
28
|
+
`)}}async function Da(t,e){let s=performance.now(),o=await fetch(e.url,{method:t.method,headers:e.headers,body:t.bodyText||void 0}),a=Math.round(performance.now()-s),n=await o.text();return{status:o.status,statusText:o.statusText,ms:a,headerLines:[...o.headers.entries()].map(([l,u])=>`${l}: ${u}`).join(`
|
|
29
|
+
`),bodyText:ql(n)}}function ql(t){try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}}function ja(t){let e=parseInt(t,10);return t==="default"||Number.isNaN(e)?"default":e<300?"2xx":e<400?"3xx":e<500?"4xx":"5xx"}function Fa(t,e,s){if(!t)return"";try{let o=new URL(e),a=new URL(s.derivedBaseUrl||s.baseUrl||e),n=new URL(t,`${o.href.replace(/\/$/,"")}/`);return n.host===a.host&&(n.protocol=o.protocol,n.username=o.username,n.password=o.password,n.host=o.host),n.href}catch{return String(t)}}function Ha(){return Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("")}function Wa({def:t,clientId:e,scopes:s,state:o,redirectUri:a,baseUrl:n,doc:l}){let u=new URL(Fa(t.authorizationUrl,n,l));return u.searchParams.set("response_type",t.flow==="implicit"?"token":"code"),e&&u.searchParams.set("client_id",e),u.searchParams.set("redirect_uri",a),s.length&&u.searchParams.set("scope",s.join(" ")),u.searchParams.set("state",o),u.toString()}async function Ka(t,e,s,o){if(!t)throw new Error("No tokenUrl defined for this scheme.");let a=new URLSearchParams;for(let[u,b]of Object.entries(e))b&&a.set(u,b);let n=await fetch(Fa(t,s,o),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:a.toString()}),l=await n.json().catch(()=>({}));if(!n.ok||!l.access_token)throw new Error(l.error_description||l.error||`HTTP ${n.status}`);return l.access_token}function Va(t,e,s){let o={client_id:e.clientId,client_secret:e.clientSecret,scope:s.join(" ")};return t==="password"?{grant_type:"password",username:e.username,password:e.password,...o}:{grant_type:"client_credentials",...o}}var Za;function Ul(){return Za??(Za=import("./runtime/lazy/apidoc.logic.js"))}var Pl=["curl","csharp","go","node","ruby","php"],Ml="(max-width: 1100px)";function Ga(t){return t==="DELETE"?"DEL":t}function _l(){let t=[...document.scripts].find(e=>/\/baseui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(e.src));return t?`${t.src.replace(/[?#].*$/,"").replace(/\/[^/]*$/,"")}/apidoc`:""}var wt=class extends c{get children(){return this.props.groups.filter(e=>e.parent===this.props.group.name)}methodLabel(e){return Ga(e)}};r(wt,"template","baseui.ApiDocGroup"),r(wt,"props",{group:Object,groups:Array,current:String,href:Function,onSelect:Function});wt.components={ApiDocGroup:wt,Icon:R};var xt=class extends c{setup(){this.rootRef=A("root"),this.mainRef=A("main"),this.doc=null,this.pendingOAuth=new Map,this.watchers=new Set,this.rowsCache=new WeakMap,this.overlayQuery=window.matchMedia(Ml),this.state=y({status:"loading",error:"",current:"introduction",lang:this.props.language||"curl",sidebarOpen:!this.overlayQuery.matches,systemTheme:"light",themeOverride:"",drafts:{},snippet:"",result:null,respTab:0,respView:{},authOpen:!1,authed:_i(),stored:{apikey:"",oauthkey:""},inputs:{apikey:"",oauthkey:""},oauth:{},oauthStatus:{}}),this.onHashChange=()=>this.setCurrent(this.routeId()),this.onViewportChange=()=>{this.state.sidebarOpen=!this.overlayQuery.matches},this.onDocumentClick=e=>this.closeSidebarOnOutsideClick(e),this.onOAuthMessage=e=>this.handleOAuthMessage(e),this.onThemeChange=()=>this.readSystemTheme(),ot(()=>this.load(this.props)),j(e=>this.shouldReload(e)?this.load(e):void 0),T(()=>this.addListeners()),le(()=>this.removeListeners())}get classNames(){return h("b-apidoc",this.props.className)}get rootStyle(){return H(this.props.height?`--b-apidoc-height:${this.props.height}`:"",this.props.style)}get theme(){return(this.props.theme==="light"||this.props.theme==="dark"?this.props.theme:"")||this.state.themeOverride||this.state.systemTheme}get title(){return this.props.title||this.doc?.info.title||"API Documentation"}get tryItEnabled(){return this.props.tryIt!==!1}get hasSecurity(){return this.props.authorize!==!1&&Object.keys(this.doc?.securityDefinitions||{}).length>0}get languages(){let e=this.logic?.LANGUAGES||[],s=this.props.languages;return s?.length?e.filter(o=>s.includes(o.id)):e}get currentLanguage(){return this.languages.find(e=>e.id===this.state.lang)||this.languages[0]}get op(){return this.state.current==="introduction"?null:this.doc.findOperation(this.state.current)}get draft(){return this.state.drafts[this.state.current]}get showTryIt(){return this.tryItEnabled&&!!this.op}get sidebarGroups(){let e=this.doc.groups.filter(s=>!s.parent);return this.doc.webhooks.length&&e.push({id:"webhooks",name:"Webhooks",items:this.doc.webhooks,kind:""}),e}get breadcrumb(){let e=this.op;if(!e)return[{label:"Home",id:"introduction",home:!0},{label:"Introduction"}];let s=this.doc.groups.find(o=>o.name===e.tag);return[{label:"Home",id:"introduction",home:!0},{label:this.title,id:"introduction"},{label:e.tag,id:s?s.items[0].id:"introduction"},{label:e.summary}]}get authSchemes(){return Object.entries(this.doc.securityDefinitions).map(([e,s])=>({key:e,def:s,scopes:Object.entries(s.scopes||{})}))}get serverOptions(){return this.doc.servers.length?this.doc.servers:[{url:this.doc.baseUrl,name:"",description:""}]}get tryItParams(){let{path:e,query:s,header:o}=this.op.parameters;return[...e.map(a=>({...a,group:"path"})),...s.map(a=>({...a,group:"query"})),...o.map(a=>({...a,group:"header"}))]}get selectedBaseUrl(){return this.draft?.baseUrl||this.doc.baseUrl}methodLabel(e){return Ga(e)}statusClass(e){return ja(e)}formatExample(e){return Di(e)}serverLabel(e){let s=[e.name,e.description].filter(Boolean).join(" \u2014 ");return s?`${s} (${e.url})`:e.url}languageTone(e){return Pl.includes(e)?e:"default"}encodingEntries(e){return Object.entries(e)}oauthFlowLabel(e){return Ma[e]||e||"unknown"}schemaRows(e){return this.rowsCache.has(e)||this.rowsCache.set(e,this.doc.schemaRows(e)),this.rowsCache.get(e)}depth(e){return(e.match(/\./g)||[]).length}lineNumbers(e){return String(e||"").split(`
|
|
30
|
+
`).map((s,o)=>o+1)}iconUrl(e){let s=this.props.assetBase??this.assetBase??(this.assetBase=_l());return s?`${s.replace(/\/$/,"")}/${e.icon}`:""}href(e){return this.props.hash?`#/${e}`:"#"}shouldReload(e){return e.src!==this.props.src||e.spec!==this.props.spec||e.serverUrl!==this.props.serverUrl}async load(e){this.state.status="loading";try{this.logic=await Ul(),this.doc=e.spec?this.logic.buildOpenApiDoc(e.spec,e.serverUrl):await this.logic.loadOpenApiDoc(e.src,e.serverUrl)}catch(s){this.state.status="error",this.state.error=s.message||String(s),e.onError?.(s);return}this.state.drafts={},this.state.current=this.routeId(e),this.ensureDraft(),this.state.status="ready",this.updateSnippet(),e.onLoad?.(this.doc)}routeId(e=this.props){let s=e.hash?location.hash.replace(/^#\//,""):e.operation;return s&&this.doc.findOperation(s)?s:"introduction"}go(e,s){this.props.hash||(e.preventDefault(),this.setCurrent(s)),this.overlayQuery.matches&&(this.state.sidebarOpen=!1)}setCurrent(e){let s=this.state;s.current=e,s.result=null,s.respTab=0,s.respView={},this.ensureDraft(),this.updateSnippet(),this.mainRef.el&&(this.mainRef.el.scrollTop=0),this.props.onNavigate?.(e)}ensureDraft(){let e=this.op;e&&!this.state.drafts[e.id]&&(this.state.drafts[e.id]=_a(e,this.doc.baseUrl))}toggleSidebar(){this.state.sidebarOpen=!this.state.sidebarOpen}closeSidebarOnOutsideClick(e){!this.overlayQuery.matches||!this.state.sidebarOpen||e.target.closest?.(".sidebar-shell, .sidebar-toggle")||(this.state.sidebarOpen=!1)}selectResponse(e){this.state.respTab=Number(e)}setResponseView(e,s){this.state.respView[e]=s}setLanguage(e){this.state.lang=e,this.updateSnippet()}onBaseUrl(e){this.draft.baseUrl=e,this.updateSnippet()}onParam(e,s,o){this.draft[s][o]=e,this.updateSnippet()}onBody(e){this.draft.bodyText=e,this.updateSnippet()}async updateSnippet(){let e=this.op;if(!e||!this.tryItEnabled)return;let s=this.currentLanguage;try{this.state.snippet=await this.logic.generateSnippet(s.id,ji(e,this.draft))}catch(o){this.state.snippet=`// Could not generate ${s.label} snippet: ${o.message}`}}async send(){let e=this.op,s=ji(e,this.draft),o=za(s),a={method:s.method,url:o.url,headerLines:o.headerLines,bodyText:s.bodyText};this.state.result={phase:"sending",sent:a};let n;try{n={phase:"done",sent:a,res:await Da(s,o)}}catch(l){n={phase:"error",sent:a,message:l.message}}this.state.current===e.id&&(this.state.result=n)}clearResult(){this.state.result=null}collapseRequest(){this.rootRef.el.querySelectorAll(".tryit-card details").forEach((e,s)=>{s<3&&(e.open=!1)})}toggleTheme(){this.state.themeOverride=this.theme==="dark"?"light":"dark"}readSystemTheme(){let e=document.documentElement.getAttribute("data-bs-theme"),s=e?e==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches;this.state.systemTheme=s?"dark":"light"}openAuth(){var s;let e=this.state;e.stored.apikey=Ye("apikey"),e.stored.oauthkey=Ye("oauthkey"),e.inputs.apikey=e.stored.apikey,e.inputs.oauthkey=e.stored.oauthkey;for(let{key:o,def:a}of this.authSchemes)(s=e.oauth)[o]??(s[o]={clientId:"",clientSecret:"",username:"",password:"",scopes:Object.keys(a.scopes||{})});e.authOpen=!0}closeAuth(){this.state.authOpen=!1}setAuthOpen(e){this.state.authOpen=e}setAuthInput(e,s){this.state.inputs[e]=s}setField(e,s,o){e[s]=o}saveAuth(){Kr("apikey",this.state.inputs.apikey.trim()),Kr("oauthkey",this.state.inputs.oauthkey.trim()),this.closeAuth(),this.applyAuthToAll()}clearAuth(e){Kr(e,""),this.state.stored[e]="",this.state.inputs[e]="",this.applyAuthToAll()}applyAuthToAll(){for(let[e,s]of Object.entries(this.state.drafts))zi(this.doc.findOperation(e),s);this.state.authed=_i(),this.updateSnippet()}toggleScope(e,s){let o=this.state.oauth[e].scopes,a=o.indexOf(s);a<0?o.push(s):o.splice(a,1)}setOAuthStatus(e,s,o=!1){this.state.oauthStatus[e]={message:s,isError:o}}applyOAuthToken(e,s,o){Kr("oauthkey",s),this.state.stored.oauthkey=s,this.state.inputs.oauthkey=s,Object.assign(this.state.oauth[e],{clientId:o.clientId,clientSecret:o.clientSecret}),this.applyAuthToAll(),this.setOAuthStatus(e,"Token acquired.")}async fetchToken(e,s,o){try{let a=await Ka(this.doc.securityDefinitions[e].tokenUrl,s,this.selectedBaseUrl,this.doc);this.applyOAuthToken(e,a,o)}catch(a){this.setOAuthStatus(e,`Token request failed: ${a.message}. This is usually a CORS restriction on the auth server.`,!0)}}startOAuth2Flow(e){let s=this.doc.securityDefinitions[e],o=this.state.oauth[e],a=[...o.scopes];if(s.flow==="implicit"||s.flow==="accessCode")return this.openOAuthPopup(e,s,o,a);if(s.flow==="password"||s.flow==="application")return this.setOAuthStatus(e,"Requesting token\u2026"),this.fetchToken(e,Va(s.flow,o,a),o);this.setOAuthStatus(e,`Unsupported OAuth2 flow: ${s.flow}`,!0)}openOAuthPopup(e,s,o,a){if(!s.authorizationUrl)return this.setOAuthStatus(e,"No authorizationUrl defined for this scheme.",!0);let n=Ha(),l=Wa({def:s,clientId:o.clientId,scopes:a,state:n,redirectUri:this.redirectUri,baseUrl:this.selectedBaseUrl,doc:this.doc}),u=window.open(l,`oauth2-authorize-${e}`,"width=560,height=680");if(!u)return this.setOAuthStatus(e,"Popup blocked \u2014 allow popups for this site and try again.",!0);this.pendingOAuth.set(n,{key:e,flow:s.flow,fields:{...o}}),this.setOAuthStatus(e,"Waiting for authorization in the popup\u2026"),this.watchPopup(u,n,e)}watchPopup(e,s,o){let a=setInterval(()=>{e.closed&&(clearInterval(a),this.watchers.delete(a),this.pendingOAuth.delete(s)&&this.setOAuthStatus(o,"Authorization window was closed before completing.",!0))},500);this.watchers.add(a)}get redirectUri(){return this.props.oauthRedirectUri||new URL("oauth2-redirect.html",document.baseURI).href}handleOAuthMessage(e){let s=e.data;if(e.origin!==window.location.origin||s?.source!=="oauth2-redirect")return;let o=this.pendingOAuth.get(s.state);if(!o)return;this.pendingOAuth.delete(s.state);let{key:a,flow:n,fields:l}=o;if(s.error)return this.setOAuthStatus(a,`Authorization failed: ${s.error}${s.errorDescription?" - "+s.errorDescription:""}`,!0);if(n==="implicit")return s.accessToken?this.applyOAuthToken(a,s.accessToken,l):this.setOAuthStatus(a,"Authorization server did not return an access token.",!0);if(!s.code)return this.setOAuthStatus(a,"Authorization server did not return a code.",!0);this.setOAuthStatus(a,"Exchanging code for token\u2026"),this.fetchToken(a,{grant_type:"authorization_code",code:s.code,redirect_uri:this.redirectUri,client_id:l.clientId,client_secret:l.clientSecret},l)}addListeners(){this.readSystemTheme(),this.themeObserver=new MutationObserver(this.onThemeChange),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-bs-theme"]}),window.addEventListener("hashchange",this.onHashChange),window.addEventListener("message",this.onOAuthMessage),document.addEventListener("click",this.onDocumentClick),this.overlayQuery.addEventListener("change",this.onViewportChange)}removeListeners(){this.themeObserver?.disconnect(),window.removeEventListener("hashchange",this.onHashChange),window.removeEventListener("message",this.onOAuthMessage),document.removeEventListener("click",this.onDocumentClick),this.overlayQuery.removeEventListener("change",this.onViewportChange),this.watchers.forEach(clearInterval)}};r(xt,"template","baseui.ApiDoc"),r(xt,"components",{ApiDocGroup:wt,Markdown:yt,Badge:Q,Breadcrumb:Wt,BreadcrumbItem:Vt,BreadcrumbLink:Zt,BreadcrumbList:Kt,BreadcrumbPage:Gt,BreadcrumbSeparator:ht,Button:x,Checkbox:_t,Dialog:It,DialogContent:pt,DialogDescription:qt,DialogFooter:Rt,DialogHeader:Tt,DialogTitle:$t,Icon:R,Input:kt,NativeSelect:Mt,TabContent:Bt,Tabs:Lt,TabsContainer:Nt,TabsList:Ot,TabTrigger:lt,Textarea:Pt}),r(xt,"props",{src:i(String),spec:i(Object),title:i(String),serverUrl:i(String),theme:i(String),themeToggle:i(Boolean),hash:i(Boolean),operation:i(String),tryIt:i(Boolean),authorize:i(Boolean),languages:i(Array),language:i(String),assetBase:i(String),oauthRedirectUri:i(String),height:i(String),onLoad:i(Function),onError:i(Function),onNavigate:i(Function),className:i(String),style:i([String,Object])});w();v();function Fi(t,e){if(!t)return null;if(t.type==="file"&&(t.path===e||t.meta?.slug===e))return t;for(let s of t.children||[]){let o=Fi(s,e);if(o)return o}return null}function zl(t){return t.replace(/\.[^./]+$/,"").replace(/[_-]+/g," ").trim().split(/\s+/).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}var kr=class kr extends c{get label(){let e=this.props.node.meta;return e?.sidebar_label||e?.title||zl(this.props.node.name)}get hasSubfolders(){return(this.props.node.children||[]).some(e=>e.type==="dir")}select(e){this.props.onSelect(e)}};r(kr,"template","baseui.MarkdownTreeNode"),r(kr,"components",{MarkdownTreeNode:kr,Icon:R,SidebarGroupLabel:Yt,SidebarMenu:gt,SidebarMenuItem:Qt,SidebarMenuButton:mt,DropdownMenu:zt,DropdownMenuTrigger:ut,DropdownMenuContent:Dt,DropdownMenuItem:jt,DropdownMenuSub:Ft,DropdownMenuSubTrigger:dt,DropdownMenuSubContent:Ht}),r(kr,"props",{node:{type:Object},activePath:i(String),onSelect:{type:Function},nested:i(Boolean)});var Vr=kr,Qe=class extends c{setup(){this.state=y({tree:null,status:"loading",error:""}),ot(()=>this.load())}async load(){this.state.status="loading",this.state.error="";try{let e=await fetch(this.props.src);if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);this.state.tree=await e.json(),this.state.status="ready"}catch(e){this.state.status="error",this.state.error=e.message||String(e)}}};r(Qe,"template","baseui.MarkdownTree"),r(Qe,"components",{MarkdownTreeNode:Vr,SidebarGroup:Xt,SidebarMenu:gt}),r(Qe,"props",{src:{type:String},activePath:i(String),onSelect:{type:Function},className:i(String),style:i([String,Object])});w();function Ja(t=document.querySelector("[b-block-code-template]")){let o=((t?.tagName==="SCRIPT"?t.textContent:t?.innerHTML)?.replace(/^\n/,"").replace(/\s+$/,"")||"").split(`
|
|
31
|
+
`),a=o.filter(l=>l.trim()).map(l=>l.match(/^\s*/)?.[0].length||0),n=a.length?Math.min(...a):0;return o.map(l=>l.slice(n)).join(`
|
|
32
|
+
`)}function Xa(t,e=0){let s=" ".repeat(e),o=[];for(let a of t.childNodes){if(a.nodeType===Node.TEXT_NODE){let u=a.textContent.trim();u&&o.push(`${s}${u}`);continue}if(a.nodeType!==Node.ELEMENT_NODE)continue;let n=[...a.attributes].map(u=>` ${u.name}="${u.value}"`).join("");if(![...a.childNodes].some(u=>u.nodeType===Node.ELEMENT_NODE||u.nodeType===Node.TEXT_NODE&&u.textContent.trim())){o.push(`${s}<${a.localName}${n}>${a.textContent.trim()}</${a.localName}>`);continue}o.push(`${s}<${a.localName}${n}>`),o.push(...Xa(a,e+1)),o.push(`${s}</${a.localName}>`)}return o}async function Ya(t){if(!t?.trim())return"";let{expandSelfClosingTags:e,extractTagCaseMap:s,normalizeOwlPreviewMarkup:o}=await Promise.resolve().then(()=>(ui(),Ua)),a=document.createElement("div");return a.innerHTML=e(t),o(a,s(t)),Xa(a).join(`
|
|
33
|
+
`)}function Qa(t){t.querySelectorAll('[b-block="dashboard-01"], [b-block^="sidebar-"]').forEach(e=>{let s=e.querySelector("[b-block-sidebar-toggle], button[aria-label='Toggle sidebar']"),o=e.querySelector("[b-block-sidebar]");!s||!o||(e.setAttribute("b-att-sidebar",e.getAttribute("b-att-sidebar")||"open"),s.setAttribute("b-block-sidebar-toggle",""),s.setAttribute("aria-expanded",e.getAttribute("b-att-sidebar")==="open"?"true":"false"),s.addEventListener("click",()=>{let a=e.getAttribute("b-att-sidebar")!=="open";e.setAttribute("b-att-sidebar",a?"open":"collapsed"),s.setAttribute("aria-expanded",a?"true":"false")}))}),t.querySelectorAll('[b-block^="sidebar-"] [b-block-subnav]').forEach(e=>{let s=e.previousElementSibling;s&&(s.setAttribute("b-block-subnav-toggle",""),s.setAttribute("aria-expanded","true"),e.setAttribute("b-att-state","open"),s.addEventListener("click",o=>{o.preventDefault();let a=e.getAttribute("b-att-state")!=="open";e.setAttribute("b-att-state",a?"open":"collapsed"),s.setAttribute("aria-expanded",a?"true":"false")}))})}v();var bi=ie({storageKey:"b-example-theme",toggleSelector:"",labelSelector:""}),Dl=[{key:"docs",label:"Docs",href:"/docs"},{key:"icons",label:"Icons",href:"/docs/icons"},{key:"examples",label:"Examples",href:"/examples/index.html"},{key:"blocks",label:"Blocks",href:"/blocks"}],jl={desktop:"",tablet:"768px",mobile:"390px"},Fl="/dist/icons/lucide";function Hl(){return document.querySelector("[b-block-code-template]")}function Wl(t){return t.match(/<templates[^>]*>([\s\S]*)<\/templates>/)?.[1]||t}function Kl(t){for(let e of t.querySelectorAll?.("[b-block] [b-icon], [b-block] [b-ui='icon']")||[])!e.hasAttribute("b-icon-base-url")&&!e.hasAttribute("b-att-base-url")&&e.setAttribute("b-icon-base-url",Fl)}var ts=class extends c{setup(){this.navItems=this.props.navItems||Dl,this.previewFrame=A("previewFrame"),this.embedRoot=A("embedRoot"),this.code=Ja(),this.state=y({mode:"preview",viewport:"desktop",copyLabel:"Copy code",embed:new URLSearchParams(globalThis.location.search).get("embed")==="1",codeVariant:"owl",staticTemplate:"",staticTemplateStatus:"idle"}),T(()=>this.mountPreview()),P(()=>this.mountStaticBaseUI())}get activeCode(){return this.state.codeVariant==="template"?this.state.staticTemplateStatus==="ready"?this.state.staticTemplate:"Converting to a static template...":this.code}async setCodeVariant(e){if(this.state.codeVariant=e,e==="template"&&this.state.staticTemplateStatus==="idle"){this.state.staticTemplateStatus="loading";let s=await Ya(this.code);this.state.staticTemplate=s,this.state.staticTemplateStatus="ready"}}get title(){return document.body.dataset.blockTitle||document.title||"Block"}get description(){return document.body.dataset.blockDescription||"Preview and copy this BaseUI block."}get previewStyle(){let e=jl[this.state.viewport]||"";return e?`max-width:${e}`:""}setMode(e){this.state.mode=e}setViewport(e){this.state.viewport=e}async copyCode(){await globalThis.navigator?.clipboard?.writeText(this.activeCode),this.state.copyLabel="Copied"}mountPreview(){this.state.embed&&(document.body.className="m-0");let e=this.state.embed?this.embedRoot.el:this.previewFrame.el,s=Hl();if(!(!e||!s)){if(s.tagName==="SCRIPT"){this.mountOwlPreview(e,s);return}e.replaceChildren(s.content.cloneNode(!0)),this.mountStaticBaseUI(e),Qa(e)}}async mountOwlPreview(e,s){e.replaceChildren();class o extends c{setup(){this.state=y({collapsed:!1})}}r(o,"template","examples.SidebarBlock");let a=[await ce("/dist/baseui.templates.xml"),s.textContent].map(Wl).join(`
|
|
34
|
+
`);await is(o,e,{templates:`<templates>${a}</templates>`}),bi.set(bi.current(),{skipStorage:!0})}mountStaticBaseUI(e=document){Kl(e),globalThis.thebase?.mountAll(e),bi.set(bi.current(),{skipStorage:!0})}};r(ts,"template","baseui.BlockViewer"),r(ts,"components",{Button:x,Icon:R,ThemeButton:vt}),r(ts,"props",{navItems:i(Array)});w();v();var Lr=class extends c{setup(){this.pwaState=y({open:M(this.props)}),L({pwa:this.pwaState,setPwaOpen:e=>this.setOpen(e)}),G(this.pwaState)}setOpen(e){J(this.props,this.pwaState,e)}};r(Lr,"template","baseui.Pwa"),r(Lr,"props",{open:i(Boolean),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var es=class extends c{onClick(){this.env.setPwaOpen(!0)}};r(es,"template","baseui.PwaTrigger"),r(es,"components",{Button:x}),r(es,"props",p);var Nr=class extends c{setup(){this.rootRef=A("root"),Y(e=>{if(!e)return;let s=document.activeElement;return qs(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.pwa.open])}get open(){return this.env.pwa.open}onKeyDown(e){e.key==="Escape"&&this.env.setPwaOpen(!1)}onBackdropClick(e){e.target===this.rootRef.el&&this.env.setPwaOpen(!1)}};r(Nr,"template","baseui.PwaContent"),r(Nr,"props",p);var Or=class extends c{};r(Or,"template","baseui.PwaHeader"),r(Or,"props",p);var Br=class extends c{};r(Br,"template","baseui.PwaTitle"),r(Br,"props",p);var Ir=class extends c{};r(Ir,"template","baseui.PwaDescription"),r(Ir,"props",p);var Tr=class extends c{};r(Tr,"template","baseui.PwaBody"),r(Tr,"props",p);var Rr=class extends c{get steps(){return Array.isArray(this.props.steps)?this.props.steps:[]}};r(Rr,"template","baseui.PwaSteps"),r(Rr,"props",{...p,steps:i(Array)});var $r=class extends c{};r($r,"template","baseui.PwaFooter"),r($r,"props",p);var ss=class extends c{onClick(){this.env.setPwaOpen(!1)}};r(ss,"template","baseui.PwaClose"),r(ss,"components",{Button:x}),r(ss,"props",p);w();v();var tn="",en="";function sn(t,e){return typeof t=="string"?t:e}function Vl(t){return{title:t.submitted&&t.title.trim().length>0&&t.title.trim().length<5?"Bug title must be at least 5 characters.":"",description:t.submitted&&t.description.length>0&&t.description.length<20?"Description must be at least 20 characters.":""}}var os=class extends c{setup(){this.state=y({title:sn(this.props.title,tn),description:sn(this.props.description,en),submitted:!1})}get classNames(){return h("b-form",this.props.className)}get titlePlaceholder(){return this.props.titlePlaceholder||"Login button not working on mobile"}get descriptionPlaceholder(){return this.props.descriptionPlaceholder||"I'm having an issue with the login button on mobile."}get maxDescriptionLength(){return this.props.maxDescriptionLength||100}get descriptionLength(){return this.state.description.length}get errors(){return Vl(this.state)}get titleInvalid(){return!!this.errors.title}get descriptionInvalid(){return!!this.errors.description}reset(){this.state.title=tn,this.state.description=en,this.state.submitted=!1}submit(e){e.preventDefault(),this.state.submitted=!0,!this.titleInvalid&&!this.descriptionInvalid&&this.props.onSubmit?.({title:this.state.title.trim(),description:this.state.description})}};r(os,"template","baseui.Form"),r(os,"components",{Button:x,Field:ee,FieldDescription:oe,FieldError:re,FieldGroup:te,FieldLabel:se}),r(os,"props",{title:i(String),description:i(String),titlePlaceholder:i(String),descriptionPlaceholder:i(String),maxDescriptionLength:i(Number),className:i(String),style:i([String,Object]),onSubmit:i(Function)});w();v();var Hi;function Zl(){return Hi??(Hi=import("./runtime/milkdown/milkdown-text-editor.js")),Hi}async function hi(t){return(await Zl()).createMilkdownTextEditor(t)}function mi({collaborative:t,providerType:e,url:s}={}){return!!t||!!(e&&s)}var qr=class extends c{setup(){this.editorRef=A("editor"),this.editorHandle=null,this.mountPromise=null,this.mountToken=0,this.isDestroyed=!1,this.state=y({content:"",status:"loading",error:""}),ot(()=>this.load(this.props)),j(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),T(()=>this.mountEditor()),P(()=>this.mountEditor()),le(()=>{this.isDestroyed=!0,this.destroyEditor()})}get classNames(){return h("b-text-editor",this.props.className)}get isCollaborative(){return mi({collaborative:this.props.collaborative,providerType:this.props.provider,url:this.props.url})}get editorLabel(){return this.isCollaborative?"Collaborative rich text editor":"Rich text editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src}shouldRestartEditor(e){return e.collaborative!==this.props.collaborative||e.provider!==this.props.provider||e.room!==this.props.room||e.url!==this.props.url||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=e.content??"";if(e.src)try{let o=await fetch(e.src);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);s=await o.text()}catch(o){this.state.status="error",this.state.error=o.message||String(o);return}this.state.content=s,this.state.status="ready"}async mountEditor(){let e=this.editorRef.el;if(this.isDestroyed||!e||this.editorHandle||this.mountPromise||this.state.status!=="ready")return;let s=++this.mountToken;return this.mountPromise=(async()=>{try{let o=await hi({root:e,value:this.state.content,placeholder:this.props.placeholder,collaborative:this.isCollaborative,providerType:this.props.provider,room:this.props.room||"b-text-editor",url:this.props.url,password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(a,n,l)=>{this.state.content=a,this.props.onChange?.(a,n,l)}});if(s!==this.mountToken){o.destroy?.();return}this.editorHandle=o}catch(o){s===this.mountToken&&(this.state.status="error",this.state.error=o.message||String(o))}finally{this.mountPromise=null,this.isDestroyed||this.mountEditor()}})(),this.mountPromise}destroyEditor(){this.mountToken++,this.editorHandle?.destroy?.(),this.editorHandle=null}};r(qr,"template","baseui.TextEditor"),r(qr,"props",{content:i(String),src:i(String),placeholder:i(String),collaborative:i(Boolean),provider:i(String),room:i(String),url:i(String),password:i(String),signaling:i(Array),user:i(Object),onChange:i(Function),className:i(String),style:i([String,Object])});S();function Gl(t){let{open:e,close:s,destroy:o}=ai(t,{closeSelector:"[b-alert-dialog-cancel], [b-alert-dialog-action], [b-alert-dialog-close]",trapFocus:!0});return t.setAttribute("role","alertdialog"),t.BaseUIAlertDialog={open:e,close:s},{destroy:()=>{o(),delete t.BaseUIAlertDialog}}}d.register("alert-dialog",{type:"owl",mount:Gl});S();var Ki={default:"b-alert-default",destructive:"b-alert-destructive",info:"b-alert-default",success:"alert-success",warning:"alert-warning",danger:"b-alert-destructive"};function Jl(t){t.classList.add("alert","b-alert",Ki[t.getAttribute("b-att-variant")||"default"]||Ki.default),t.setAttribute("role",t.getAttribute("role")||"alert");let e=null;if(!!t.getAttribute("b-att-dismissible")){if(t.classList.add("alert-dismissible","fade","show"),!t.querySelector('[data-bs-dismiss="alert"]')){let o=document.createElement("button");o.type="button",o.className="btn-close",o.setAttribute("data-bs-dismiss","alert"),o.setAttribute("aria-label","Close"),t.appendChild(o)}e=new(k()).Alert(t)}return{destroy:()=>{e?.dispose(),t.classList.remove("alert","b-alert","alert-dismissible","fade","show",...Object.values(Ki))}}}d.register("alert",{type:"static",mount:Jl});w();S();function on(t,e){return t.getAttribute(e)!=="false"}function Xl(t){let e=t.getAttribute("b-att-templates");if(e)return e;let s=[...document.scripts].find(o=>/\/baseui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(o.src));return s?s.src.replace(/[?#].*$/,"").replace(/[^/]*$/,"baseui.templates.xml"):"/dist/baseui.templates.xml"}function Yl(t){let e=(o,a)=>t.dispatchEvent(new CustomEvent(`baseui:${o}`,{bubbles:!0,detail:a})),s=t.getAttribute("b-att-languages");return{src:t.getAttribute("b-att-src")||void 0,title:t.getAttribute("b-att-title")||void 0,serverUrl:t.getAttribute("b-att-server-url")||void 0,theme:t.getAttribute("b-att-theme")||void 0,themeToggle:t.getAttribute("b-att-theme-toggle")==="true",hash:t.getAttribute("b-att-hash")==="true",operation:t.getAttribute("b-att-operation")||void 0,tryIt:on(t,"b-att-try-it"),authorize:on(t,"b-att-authorize"),languages:s?s.split(",").map(o=>o.trim()).filter(Boolean):void 0,language:t.getAttribute("b-att-language")||void 0,assetBase:t.getAttribute("b-att-asset-base")??void 0,oauthRedirectUri:t.getAttribute("b-att-oauth-redirect-uri")||void 0,height:t.getAttribute("b-att-height")||void 0,onLoad:o=>e("load",{info:o.info,operations:o.groups.flatMap(a=>a.items).length}),onError:o=>e("error",{error:o}),onNavigate:o=>e("navigate",{id:o})}}function Ql(t){let e=Yl(t),s=ce(Xl(t)).then(o=>is(xt,t,{templates:o,props:e}));return{destroy:async()=>{(await s).destroy()}}}d.register("apidoc",{type:"owl",mount:Ql});S();function tp(t){let e=[...t.querySelectorAll("[b-accordion-item]")],s=t.getAttribute("b-att-multiple")==="true",o=new Map,a=new Map,n=new Map,l=(u,b)=>{let m=u.querySelector("[b-accordion-trigger]");u.setAttribute("b-att-state",b?"open":"closed"),m?.setAttribute("aria-expanded",String(b)),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{open:b}}))};return t.setAttribute("role","presentation"),t.classList.add("accordion"),e.forEach((u,b)=>{let m=u.querySelector("[b-accordion-trigger]"),f=u.querySelector("[b-accordion-panel]");if(!f)return;u.classList.add("accordion-item"),m?.classList.add("accordion-button"),f.classList.add("accordion-collapse");let g=f.id||`b-accordion-panel-${b}`;f.id=g;let E=u.getAttribute("b-att-state")==="open";f.classList.add("collapse"),E&&f.classList.add("show");let N=new(k()).Collapse(f,{toggle:!1});n.set(u,N);let I=()=>l(u,!0),C=()=>l(u,!1);f.addEventListener("shown.bs.collapse",I),f.addEventListener("hidden.bs.collapse",C),a.set(u,{onShown:I,onHidden:C}),m?.setAttribute("aria-expanded",String(E)),m?.setAttribute("aria-controls",g);let $=()=>{let z=f.classList.contains("show");!s&&!z&&e.forEach(O=>{if(O===u)return;let F=n.get(O),X=O.querySelector("[b-accordion-panel]");F&&X?.classList.contains("show")&&F.hide()}),z?N.hide():N.show()};o.set(u,$),m?.addEventListener("click",$)}),{destroy:()=>{e.forEach(u=>{let b=u.querySelector("[b-accordion-trigger]"),m=u.querySelector("[b-accordion-panel]");b?.removeEventListener("click",o.get(u));let f=a.get(u);m&&f&&(m.removeEventListener("shown.bs.collapse",f.onShown),m.removeEventListener("hidden.bs.collapse",f.onHidden)),n.get(u)?.dispose()}),o.clear(),a.clear(),n.clear()}}}d.register("accordion",{type:"owl",mount:tp});S();function ep(t){let e=t.getAttribute("b-att-ratio")||`${t.getAttribute("b-att-width")||16} / ${t.getAttribute("b-att-height")||9}`;return t.classList.add("b-aspect-ratio"),t.style.setProperty("--b-aspect-ratio",e),{destroy:()=>t.classList.remove("b-aspect-ratio")}}d.register("aspect-ratio",{type:"static",mount:ep});S();ns();var sp=["idle","uploading","processing","error","done"],op=["default","sm","xs"],rp=["content","title","description","actions"];function rn(t,e){t.classList.add(`b-attachment-${e}`),t.setAttribute("data-slot",`attachment-${e}`)}function ip(t){let e=t.querySelector("input[type='file']"),s=t.querySelector("[b-attachment-list]"),o=sp.includes(t.getAttribute("b-att-state"))?t.getAttribute("b-att-state"):"done",a=op.includes(t.getAttribute("b-att-size"))?t.getAttribute("b-att-size"):"default",n=t.getAttribute("b-att-orientation")==="vertical"?"vertical":"horizontal";t.classList.add("b-attachment"),t.classList.add(`b-attachment-${o}`,`b-attachment-${a}`,`b-attachment-${n}`),t.setAttribute("data-state",o),t.setAttribute("data-size",a),t.setAttribute("data-orientation",n),t.setAttribute("data-slot","attachment"),e&&t.classList.add("b-attachment-picker"),t.querySelectorAll("[b-attachment-media]").forEach(u=>{let b=u.getAttribute("b-att-variant")==="image"?"image":"icon";rn(u,"media"),u.classList.add(`b-attachment-media-${b}`),u.setAttribute("data-variant",b)}),rp.forEach(u=>t.querySelectorAll(`[b-attachment-${u}]`).forEach(b=>rn(b,u))),t.querySelectorAll("[b-attachment-action]").forEach(u=>{let b=W[u.getAttribute("b-att-variant")]||W.ghost,m=V[u.getAttribute("b-att-size")]||V["icon-xs"];u.classList.add("btn","b-button",b,m,"b-button-icon","b-attachment-action"),u.setAttribute("data-slot","attachment-action"),!u.getAttribute("type")&&u.tagName==="BUTTON"&&u.setAttribute("type","button")}),t.querySelectorAll("[b-attachment-trigger]").forEach(u=>{u.classList.add("b-attachment-trigger"),u.setAttribute("data-slot","attachment-trigger"),!u.getAttribute("type")&&u.tagName==="BUTTON"&&u.setAttribute("type","button")}),e?.classList.add("form-control");let l=()=>{s&&(s.innerHTML=[...e.files].map(u=>`<li>${u.name}</li>`).join("")),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{files:[...e.files]}}))};return e?.addEventListener("change",l),{destroy:()=>e?.removeEventListener("change",l)}}function ap(t){return t.classList.add("b-attachment-group"),t.setAttribute("data-slot","attachment-group"),{destroy:()=>t.classList.remove("b-attachment-group")}}function np(t){let e=t.querySelector("input[type='file']");t.classList.add("b-attachment-dropzone"),t.setAttribute("data-slot","attachment-dropzone");let s=()=>e?.click(),o=b=>{b.preventDefault(),t.classList.add("b-attachment-dropzone-dragging")},a=()=>t.classList.remove("b-attachment-dropzone-dragging"),n=b=>{b.length&&t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{files:b}}))},l=b=>{b.preventDefault(),t.classList.remove("b-attachment-dropzone-dragging"),n([...b.dataTransfer?.files??[]])},u=()=>{n([...e?.files??[]]),e&&(e.value="")};return t.addEventListener("click",s),t.addEventListener("dragover",o),t.addEventListener("dragleave",a),t.addEventListener("drop",l),e?.addEventListener("change",u),{destroy:()=>{t.removeEventListener("click",s),t.removeEventListener("dragover",o),t.removeEventListener("dragleave",a),t.removeEventListener("drop",l),e?.removeEventListener("change",u)}}}d.register("attachment",{type:"owl",mount:ip});d.register("attachment-group",{type:"static",mount:ap});d.register("attachment-dropzone",{type:"static",mount:np});S();function cp(t){t.classList.add("b-avatar");let e=t.querySelector("img"),s=t.querySelector("[b-avatar-fallback]");if(e&&s){let o=()=>{e.hidden=!0,s.hidden=!1};return s.hidden=!!e.getAttribute("src"),e.addEventListener("error",o),{destroy:()=>e.removeEventListener("error",o)}}return{}}d.register("avatar",{type:"static",mount:cp});S();function lp(t){let e=pe[t.getAttribute("b-att-variant")||"secondary"]||pe.secondary;return t.classList.add("badge",e),t.getAttribute("b-att-pill")==="true"&&t.classList.add("rounded-pill"),{destroy:()=>t.classList.remove("badge","rounded-pill",...Object.values(pe))}}d.register("badge",{type:"static",mount:lp});S();rt();function an(t){return[...t.children].filter(e=>!e.matches("[b-breadcrumb-separator], .b-breadcrumb-separator"))}function cn(t,e,s){return _(t,e,{size:s}),t}function pp(){let t=document.createElement("li"),e=document.createElement("span");return t.setAttribute("b-breadcrumb-separator",""),t.setAttribute("data-slot","breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),t.className="b-breadcrumb-separator",e.className="b-breadcrumb-separator-icon",t.append(cn(e,"chevron-right","var(--b3_5)")),t}function up(t){t.classList.add("b-breadcrumb-separator"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true")}function dp(t){if(t.classList.add("b-breadcrumb-ellipsis"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-ellipsis"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),!t.querySelector(".b-icon")){let e=document.createElement("span");e.className="b-breadcrumb-ellipsis-icon",t.prepend(cn(e,"ellipsis","var(--b4)"))}if(!t.querySelector(".visually-hidden")){let e=document.createElement("span");e.className="visually-hidden",e.textContent="More",t.append(e)}}function nn(t){t.classList.add("b-breadcrumb-page"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-page"),t.setAttribute("role",t.getAttribute("role")||"link"),t.setAttribute("aria-disabled","true"),t.setAttribute("aria-current","page")}function bp(t){let e=t.querySelector("ol, ul")||t;t.classList.add("b-breadcrumb"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb"),t.setAttribute("aria-label",t.getAttribute("aria-label")||"breadcrumb"),e.classList.add("breadcrumb","b-breadcrumb-list"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"breadcrumb-list");for(let o of e.querySelectorAll("[b-breadcrumb-separator], .b-breadcrumb-separator"))up(o);for(let o of e.querySelectorAll("[b-breadcrumb-ellipsis], .b-breadcrumb-ellipsis"))dp(o);for(let o of e.querySelectorAll("[b-breadcrumb-page], .b-breadcrumb-page"))nn(o);e.querySelector("[b-breadcrumb-separator], .b-breadcrumb-separator")||an(e).slice(0,-1).forEach(a=>a.after(pp()));let s=an(e);return s.forEach((o,a)=>{o.classList.add("b-breadcrumb-item"),o.setAttribute("data-slot",o.getAttribute("data-slot")||"breadcrumb-item");for(let n of o.querySelectorAll("a"))n.classList.add("b-breadcrumb-link"),n.setAttribute("data-slot",n.getAttribute("data-slot")||"breadcrumb-link");if(a===s.length-1){let n=o.querySelector("[b-breadcrumb-page], .b-breadcrumb-page");n?nn(n):(o.classList.add("b-breadcrumb-page"),o.setAttribute("aria-current",o.getAttribute("aria-current")||"page"))}}),{destroy:()=>{t.classList.remove("b-breadcrumb"),e.classList.remove("breadcrumb","b-breadcrumb-list");for(let o of e.querySelectorAll("[b-breadcrumb-separator]"))o.remove()}}}d.register("breadcrumb",{type:"owl",mount:bp});S();function hp(t){return t.classList.add("b-bubble"),t.getAttribute("role")||t.setAttribute("role","listitem"),{destroy:()=>t.classList.remove("b-bubble")}}d.register("bubble",{type:"static",mount:hp});S();rt();ns();function mp(t){return[...t.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE&&e.textContent.trim()).map(e=>{let s=document.createElement("span");return s.textContent=e.textContent.trim(),e.replaceWith(s),s})}function fp(t){let e=t.getAttribute("b-att-icon"),s=t.getAttribute("b-att-icon-position")==="end"?"end":"start",o=!!t.textContent.trim(),a=e&&o?mp(t):[],n=null;return t.classList.add("btn","b-button",W[t.getAttribute("b-att-variant")||"default"]||"btn-primary"),V[t.getAttribute("b-att-size")]&&t.classList.add(V[t.getAttribute("b-att-size")]),t.dataset.slot="button",e&&(n=document.createElement("span"),n.setAttribute("b-icon",e),n.dataset.icon=`inline-${s}`,_(n,e,{label:""}),t.insertBefore(n,s==="end"?null:t.firstChild),t.dataset.icon=`inline-${s}`,o||(t.dataset.iconOnly="true",t.classList.add("b-button-icon"))),{destroy:()=>{n?.remove();for(let l of a)l.replaceWith(document.createTextNode(l.textContent));t.classList.remove("btn","b-button","b-button-icon",...Object.values(W),...Object.values(V)),t.removeAttribute("data-slot"),t.removeAttribute("data-icon"),t.removeAttribute("data-icon-only")}}}d.register("button",{type:"static",mount:fp});S();function gp(t){let e=t.getAttribute("b-att-orientation")==="vertical",s=t.getAttribute("b-att-size"),o=[...t.querySelectorAll("[b-button-group-separator]")],a=[...t.querySelectorAll("[b-button-group-text]")];return t.classList.add("b-button-group",e?"btn-group-vertical":"btn-group"),(s==="sm"||s==="lg")&&t.classList.add(`btn-group-${s}`),t.setAttribute("role",t.getAttribute("role")||"group"),o.forEach(n=>{let l=n.getAttribute("b-att-orientation")==="horizontal"?"horizontal":"vertical";n.classList.add("b-button-group-separator",`b-button-group-separator-${l}`),n.setAttribute("data-orientation",l),n.setAttribute("role","separator")}),a.forEach(n=>{n.classList.add("b-button-group-text")}),{destroy:()=>{t.classList.remove("b-button-group","btn-group","btn-group-vertical","btn-group-sm","btn-group-lg")}}}d.register("button-group",{type:"static",mount:gp});S();var vp=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"});function yp(t){let e=t.getAttribute("b-att-selected")?new Date(`${t.getAttribute("b-att-selected")}T00:00:00`):new Date,s=Number(t.getAttribute("b-att-month")??e.getMonth()+1)-1,o=Number(t.getAttribute("b-att-year")??e.getFullYear()),a=new Date(o,s,1),n=new Date(o,s+1,0).getDate(),l=a.getDay();t.classList.add("b-calendar"),t.querySelector("[b-calendar-grid]")||(t.innerHTML=`
|
|
35
|
+
<div class="b-calendar__header">${vp.format(a)}</div>
|
|
36
|
+
<div class="b-calendar__weekdays">${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(m=>`<span>${m}</span>`).join("")}</div>
|
|
37
|
+
<div b-calendar-grid class="b-calendar__grid"></div>
|
|
38
|
+
`);let u=t.querySelector("[b-calendar-grid]");u.innerHTML="";for(let m=0;m<l;m+=1)u.append(document.createElement("span"));for(let m=1;m<=n;m+=1){let f=document.createElement("button"),g=`${o}-${String(s+1).padStart(2,"0")}-${String(m).padStart(2,"0")}`;f.type="button",f.textContent=String(m),f.setAttribute("b-att-value",g),f.setAttribute("aria-pressed",String(g===t.getAttribute("b-att-selected"))),u.append(f)}let b=m=>{let f=m.target.closest("button[b-att-value]");f&&(t.setAttribute("b-att-selected",f.getAttribute("b-att-value")),u.querySelectorAll("button").forEach(g=>g.setAttribute("aria-pressed",String(g===f))),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:f.getAttribute("b-att-value")}})))};return u.addEventListener("click",b),{destroy:()=>u.removeEventListener("click",b)}}d.register("calendar",{type:"owl",mount:yp});S();function xp(t){return t.classList.add("card","b-card"),t.querySelector("[b-card-header]")?.classList.add("card-header"),t.querySelector("[b-card-body]")?.classList.add("card-body"),t.querySelector("[b-card-footer]")?.classList.add("card-footer"),{destroy:()=>t.classList.remove("card","b-card")}}d.register("card",{type:"static",mount:xp});S();function wp(t){let e=[...t.querySelectorAll("[b-carousel-slide]")],s=t.querySelector("[b-carousel-prev]"),o=t.querySelector("[b-carousel-next]");if(t.classList.add("carousel","slide"),e.length&&!e[0].parentElement.classList.contains("carousel-inner")){let m=document.createElement("div");m.classList.add("carousel-inner"),e[0].before(m),e.forEach(f=>m.appendChild(f))}let a=Math.max(0,e.findIndex(m=>m.getAttribute("b-att-state")==="active"));e.forEach((m,f)=>{m.classList.add("carousel-item"),f===a&&m.classList.add("active"),m.setAttribute("b-att-state",f===a?"active":"inactive")});let n=e.length?new(k()).Carousel(t,{interval:!1,wrap:!0,touch:!0}):null,l=m=>{e.forEach((f,g)=>{f.setAttribute("b-att-state",g===m.to?"active":"inactive")}),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{index:m.to}}))};t.addEventListener("slid.bs.carousel",l);let u=()=>n?.prev(),b=()=>n?.next();return s?.addEventListener("click",u),o?.addEventListener("click",b),{destroy:()=>{s?.removeEventListener("click",u),o?.removeEventListener("click",b),t.removeEventListener("slid.bs.carousel",l),n?.dispose()}}}d.register("carousel",{type:"owl",mount:wp});S();function ln(t,e,s=0){let o=Number(t.getAttribute(e));return Number.isFinite(o)?o:s}function Sp(t){let e=t.getAttribute("b-att-config")||t.querySelector("script[type='application/json']")?.textContent;if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Ap(t,e){let s=globalThis.getComputedStyle(t),o=[1,2,3,4,5].map(l=>s.getPropertyValue(`--b-chart-${l}`).trim()),a=s.getPropertyValue("--b-muted-foreground").trim(),n=s.getPropertyValue("--b-chart-grid").trim()||s.getPropertyValue("--b-border").trim();return e.options={maintainAspectRatio:!1,plugins:{legend:{labels:{boxWidth:8,boxHeight:8,color:a,font:{size:12}}},tooltip:{titleFont:{size:12},bodyFont:{size:12},cornerRadius:10,padding:10},...e.options?.plugins||{}},scales:{x:{border:{display:!1},grid:{display:!1},ticks:{color:a,font:{size:12}}},y:{border:{display:!1},grid:{color:n},ticks:{color:a,font:{size:12}}},...e.options?.scales||{}},...e.options},e.data?.datasets?.forEach((l,u)=>{l.backgroundColor||(l.backgroundColor=o[u%o.length]),l.borderColor||(l.borderColor=o[u%o.length]),l.borderRadius??(l.borderRadius=4)}),e}function Ep(t,e,s){if(t.querySelector("[b-chart-tooltip]"))return;let o=document.createElement("span");o.setAttribute("b-chart-tooltip",""),o.textContent=`${e}: ${s}`,t.append(o)}function Cp(t){t.classList.add("b-chart"),t.setAttribute("role",t.getAttribute("role")||"figure");let e=t.querySelector("canvas"),s=null;if(e&&globalThis.Chart){let n=Sp(t);n&&(s=new globalThis.Chart(e,Ap(t,n)))}let o=[...t.querySelectorAll("[b-att-value]")],a=Math.max(1,...o.map(n=>ln(n,"b-att-value")));return o.forEach((n,l)=>{let u=ln(n,"b-att-value"),b=n.getAttribute("b-att-label")||n.textContent.trim()||`Series ${l+1}`,m=Math.max(0,Math.min(100,u/a*100));n.style.setProperty("--b-chart-value",`${m}%`),n.style.setProperty("--b-chart-index",String(l%5+1)),n.style.setProperty("--b-chart-color",`var(--b-chart-${l%5+1})`),n.setAttribute("role",n.getAttribute("role")||"listitem"),n.setAttribute("aria-label",n.getAttribute("aria-label")||`${b} ${u}`),Ep(n,b,u)}),[...t.querySelectorAll("[b-chart-series], [b-chart-legend] > *")].forEach((n,l)=>{n.style.setProperty("--b-chart-color",n.style.getPropertyValue("--b-chart-color")||`var(--b-chart-${l%5+1})`)}),{destroy:()=>{s?.destroy?.(),t.classList.remove("b-chart")}}}d.register("chart",{type:"static",mount:Cp});S();function fi(t,e){let s=t.matches("input")?t:t.querySelector(`input[type='${e}']`),o=t.matches("input")?t.closest("label, .form-check"):t;return s?.classList.add("form-check-input"),o?.classList.add("form-check","b-check"),{destroy:()=>{s?.classList.remove("form-check-input"),o?.classList.remove("form-check","b-check")}}}d.register("checkbox",{type:"static",mount:t=>fi(t,"checkbox")});S();rt();ti();function kp(t){let e=t.getAttribute("b-att-value");if(e!==null)return e;let s=t.getAttribute("b-att-target");if(s){let o=document.querySelector(s);if(o)return o.textContent??""}return t.textContent??""}function Lp(t){t.classList.remove(...Ci),t.className=`${t.className} ${Qr({variant:t.getAttribute("b-att-variant")||"default",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button";let e=t.querySelector("[b-clipboard-button-icon]");e||(e=document.createElement("span"),e.setAttribute("b-clipboard-button-icon",""),t.prepend(e));let s=t.getAttribute("b-att-icon")||"copy",o=t.getAttribute("b-att-copied-icon")||"check";_(e,s,{label:""});let a=null,n=async()=>{if(t.disabled)return;let l=kp(t);try{await cs(l),_(e,o,{label:""}),t.setAttribute("data-copied","true"),t.dispatchEvent(new CustomEvent("baseui:clipboard-copy",{bubbles:!0,detail:{value:l}})),window.clearTimeout(a),a=window.setTimeout(()=>{_(e,s,{label:""}),t.removeAttribute("data-copied")},Number(t.getAttribute("b-att-reset-delay"))||2e3)}catch(u){t.dispatchEvent(new CustomEvent("baseui:clipboard-copy-error",{bubbles:!0,detail:{error:u}}))}};return t.addEventListener("click",n),{destroy:()=>{t.removeEventListener("click",n),window.clearTimeout(a),e.remove(),t.classList.remove(...Ci),t.removeAttribute("data-copied")}}}d.register("clipboard-button",{type:"static",mount:Lp});S();function Np(t){let e=t.querySelector("[b-collapsible-trigger]"),s=t.querySelector("[b-collapsible-panel]"),o=m=>{t.setAttribute("b-att-state",m?"open":"closed"),e?.setAttribute("aria-expanded",String(m)),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{open:m}}))};if(!s){let m=()=>o(t.getAttribute("b-att-state")!=="open");return e?.setAttribute("aria-expanded",String(t.getAttribute("b-att-state")==="open")),e?.addEventListener("click",m),{destroy:()=>e?.removeEventListener("click",m)}}let a=t.getAttribute("b-att-state")==="open";s.classList.add("collapse"),a&&s.classList.add("show");let n=new(k()).Collapse(s,{toggle:!1}),l=()=>o(!0),u=()=>o(!1);s.addEventListener("shown.bs.collapse",l),s.addEventListener("hidden.bs.collapse",u),e?.setAttribute("aria-expanded",String(a));let b=()=>{s.classList.contains("show")?n.hide():n.show()};return e?.addEventListener("click",b),{destroy:()=>{e?.removeEventListener("click",b),s.removeEventListener("shown.bs.collapse",l),s.removeEventListener("hidden.bs.collapse",u),n.dispose()}}}d.register("collapsible",{type:"owl",mount:Np});S();function Op(t){let e=t.querySelector("input"),s=t.querySelector("[b-combobox-list]"),o=()=>[...s?.querySelectorAll("[b-att-value]")||[]];t.classList.add("b-combobox"),e?.setAttribute("role","combobox"),e?.setAttribute("aria-expanded","false"),s?.setAttribute("role","listbox"),s&&(s.hidden=!0);let a=u=>{s&&(s.hidden=!u),e?.setAttribute("aria-expanded",String(u))},n=()=>{let u=e.value.toLowerCase();o().forEach(b=>{b.hidden=!b.textContent.toLowerCase().includes(u)}),a(!0)},l=u=>{let b=u.target.closest("[b-att-value]");b&&(e.value=b.textContent.trim(),t.setAttribute("b-att-value",b.getAttribute("b-att-value")),a(!1),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:b.getAttribute("b-att-value")}})))};return e?.addEventListener("input",n),e?.addEventListener("focus",()=>a(!0)),s?.addEventListener("click",l),{destroy:()=>{e?.removeEventListener("input",n),s?.removeEventListener("click",l)}}}d.register("combobox",{type:"owl",mount:Op});S();function Bp(t){let e=t.querySelector("input"),s=()=>[...t.querySelectorAll("[b-command-item]")];t.classList.add("b-command"),t.setAttribute("role",t.getAttribute("role")||"dialog"),e?.classList.add("form-control");let o=()=>{let n=(e?.value||"").toLowerCase();s().forEach(l=>{l.hidden=!l.textContent.toLowerCase().includes(n)})},a=n=>{let l=n.target.closest("[b-command-item]");l&&t.dispatchEvent(new CustomEvent("baseui:select",{bubbles:!0,detail:{value:l.getAttribute("b-att-value")||l.textContent.trim()}}))};return e?.addEventListener("input",o),t.addEventListener("click",a),{destroy:()=>{e?.removeEventListener("input",o),t.removeEventListener("click",a)}}}d.register("command",{type:"owl",mount:Bp});S();function Ip(t){let e=t.querySelector("[b-context-menu-content]");if(!e)return{};e.hidden=!0,e.setAttribute("role","menu");let s=n=>{n.preventDefault(),e.hidden=!1,e.style.left=`${n.clientX}px`,e.style.top=`${n.clientY}px`,t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},o=()=>{e.hidden=!0,t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))},a=n=>{n.key==="Escape"&&o()};return t.addEventListener("contextmenu",s),document.addEventListener("click",o),t.addEventListener("keydown",a),{destroy:()=>{t.removeEventListener("contextmenu",s),document.removeEventListener("click",o),t.removeEventListener("keydown",a)}}}d.register("context-menu",{type:"owl",mount:Ip});S();rt();var pn=[["728ed52f","Success","ken99@example.com","$316.00"],["489e1d42","Success","abe45@example.com","$242.00"],["6b0888f6","Processing","monserrat44@example.com","$837.00"],["a1dc8c4e","Success","silas22@example.com","$874.00"],["15b96de0","Failed","carmella@example.com","$721.00"]];function Tp(t){t.querySelector("table")||(t.innerHTML=`
|
|
39
|
+
<div class="b-data-table__toolbar">
|
|
40
|
+
<input b-table-search type="search" class="form-control b-data-table__search" placeholder="Filter emails...">
|
|
41
|
+
<div class="b-data-table__columns"><button type="button" class="btn b-button btn-outline-secondary" data-slot="button" data-icon="inline-end" aria-label="Toggle columns"><span>Columns</span><span b-icon="chevron-down" data-icon="inline-end"></span></button></div>
|
|
45
42
|
</div>
|
|
46
|
-
<div class="
|
|
47
|
-
<table class="table
|
|
48
|
-
<thead><tr><th class="
|
|
49
|
-
<tbody>${
|
|
43
|
+
<div class="b-data-table__viewport">
|
|
44
|
+
<table class="table b-data-table__table">
|
|
45
|
+
<thead><tr><th class="b-data-table__selection-cell"><input type="checkbox" class="form-check-input" aria-label="Select all rows"></th><th>Status</th><th b-att-sortable="true">Email <span class="b-data-table__sort-icon" data-icon="arrow-up-down" aria-hidden="true"></span></th><th class="text-end">Amount</th><th class="b-data-table__actions-cell"><span class="visually-hidden">Actions</span></th></tr></thead>
|
|
46
|
+
<tbody>${pn.map(e=>`<tr data-row-key="${e[0]}"><td class="b-data-table__selection-cell"><input type="checkbox" class="form-check-input" aria-label="Select row"></td><td>${e[1]}</td><td>${e[2]}</td><td class="text-end"><span class="b-data-table__money">${e[3]}</span></td><td class="b-data-table__actions-cell"><button type="button" class="btn b-button btn-ghost b-button-icon" aria-label="Open menu" data-slot="button" data-icon="inline-start" data-icon-only="true"><span b-icon="ellipsis"></span></button></td></tr>`).join("")}</tbody>
|
|
50
47
|
</table>
|
|
51
48
|
</div>
|
|
52
|
-
<div class="
|
|
53
|
-
${
|
|
54
|
-
<div class="
|
|
55
|
-
<div class="
|
|
56
|
-
<div class="
|
|
57
|
-
<div class="
|
|
49
|
+
<div class="b-data-table__cards">
|
|
50
|
+
${pn.map(e=>`<div class="b-data-table__card" data-row-key="${e[0]}">
|
|
51
|
+
<div class="b-data-table__card-header"><input type="checkbox" class="form-check-input" aria-label="Select row"><div class="b-data-table__actions"><button type="button" class="btn b-button btn-ghost b-button-icon" aria-label="Open menu" data-slot="button" data-icon="inline-start" data-icon-only="true"><span b-icon="ellipsis"></span></button></div></div>
|
|
52
|
+
<div class="b-data-table__card-field"><span class="b-data-table__card-label">Status</span><span class="b-data-table__card-value">${e[1]}</span></div>
|
|
53
|
+
<div class="b-data-table__card-field"><span class="b-data-table__card-label">Email</span><span class="b-data-table__card-value">${e[2]}</span></div>
|
|
54
|
+
<div class="b-data-table__card-field"><span class="b-data-table__card-label">Amount</span><span class="b-data-table__card-value b-data-table__money">${e[3]}</span></div>
|
|
58
55
|
</div>`).join("")}
|
|
59
56
|
</div>
|
|
60
|
-
<div class="
|
|
61
|
-
`)}function Vl(t){Wl(t),t.querySelectorAll("[b-icon]").forEach(A=>z(A,A.getAttribute("b-icon"),{label:""}));let e=t.querySelector("table")||t,s=t.querySelector("[b-table-search]"),o=t.querySelector(".bu-data-table__selection-summary"),a=t.getAttribute("b-att-variant");t.classList.add("bu-data-table"),a&&t.classList.add(`bu-data-table-${a}`),e.classList.add("table");let n=t.querySelector(".bu-data-table__cards"),u=()=>[...e.querySelectorAll("tbody tr")],p=A=>n?.querySelector(`[data-row-key="${A.dataset.rowKey}"]`),d=()=>[...e.querySelectorAll("tbody input[type='checkbox']")],h=()=>{o&&(o.textContent=`${d().filter(A=>A.checked).length} of ${u().filter(A=>!A.hidden).length} row(s) selected.`)},f=()=>{let A=(s?.value||"").toLowerCase();u().forEach(T=>{let B=!(T.cells[2]||T.cells[1]||T.cells[0]).textContent.toLowerCase().includes(A);T.hidden=B;let F=p(T);F&&(F.hidden=B)}),h()},g=(A,T)=>{let q=e.tBodies[0];u().sort((B,F)=>B.cells[A].textContent.localeCompare(F.cells[A].textContent)*T).forEach(B=>{q.append(B);let F=p(B);F&&n.append(F)})},C=A=>{let T=A.target.closest("th");if(!T)return;let q=T.getAttribute("b-att-sort")==="asc"?-1:1;e.querySelectorAll("th").forEach(B=>B.removeAttribute("b-att-sort")),T.setAttribute("b-att-sort",q===1?"asc":"desc"),g([...T.parentElement.children].indexOf(T),q)},k=(A,T)=>{let B=p(A)?.querySelector("input[type='checkbox']");B&&B.checked!==T&&(B.checked=T)},v=A=>{let T=A.target;if(T?.matches("input[type='checkbox']")){let q=T.closest("tr"),B=T.closest(".bu-data-table__card");if(q)k(q,T.checked);else if(B){let et=u().find(si=>si.dataset.rowKey===B.dataset.rowKey)?.querySelector("input[type='checkbox']");et&&et.checked!==T.checked&&(et.checked=T.checked)}}h()};return s?.addEventListener("input",f),e.tHead?.addEventListener("click",C),e.addEventListener("change",v),n?.addEventListener("change",v),h(),{destroy:()=>{s?.removeEventListener("input",f),e.tHead?.removeEventListener("click",C),e.removeEventListener("change",v),n?.removeEventListener("change",v)}}}b.register("data-table",{type:"owl",mount:Vl});E();function Kl(t){let e=t.matches("input")?t:t.querySelector("input[type='date'], input");t.classList.add("bu-date-picker"),e?.classList.add("form-control"),e?.setAttribute("type",e.getAttribute("type")||"date");let s=()=>{t.setAttribute("b-att-value",e.value),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:e.value}}))};return e?.addEventListener("input",s),{destroy:()=>e?.removeEventListener("input",s)}}b.register("date-picker",{type:"owl",mount:Kl});E();function Gl(t){let e=t.querySelector("[b-dialog-panel]");if(t.classList.add("modal","fade","bu-dialog-backdrop"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),e){let a=document.createElement("div");a.className="modal-dialog modal-dialog-centered",e.replaceWith(a),a.append(e),e.classList.add("modal-content")}[...t.querySelectorAll("[b-dialog-close]")].forEach(a=>a.setAttribute("data-bs-dismiss","modal"));let o=O().Modal.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,focus:!0});return Hs(t,o,"modal","BaseUIDialog")}b.register("dialog",{type:"owl",mount:Gl});E();function Zl(t){let e=t.getAttribute("b-att-dir")||t.getAttribute("dir")||"ltr";return t.setAttribute("dir",e==="rtl"?"rtl":"ltr"),{}}b.register("direction",{type:"static",mount:Zl});E();function Jl(t){t.classList.add("offcanvas","offcanvas-bottom","bu-drawer-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-drawer-close]")].forEach(o=>o.setAttribute("data-bs-dismiss","offcanvas"));let s=O().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return Hs(t,s,"offcanvas","BaseUIDrawer")}b.register("drawer",{type:"owl",mount:Jl});E();it();var An="a, button, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']";function wn(t,e){t?.classList.add(e)}function Xl(t,e){if(!e||t.querySelector("[b-dropdown-indicator], [data-slot$='indicator']"))return;let s=document.createElement("span");s.setAttribute("b-dropdown-indicator",""),s.append(z(document.createElement("span"),"check")),t.prepend(s)}function Yl(t){t.setAttribute("data-slot",t.getAttribute("data-slot")||"dropdown-menu-content"),t.querySelectorAll("[b-dropdown-group]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-group"),e.setAttribute("role",e.getAttribute("role")||"group")}),t.querySelectorAll("[b-dropdown-label]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-label")}),t.querySelectorAll("[b-dropdown-separator]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-separator"),e.setAttribute("role",e.getAttribute("role")||"separator")}),t.querySelectorAll("[b-dropdown-shortcut]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-shortcut")}),t.querySelectorAll("[b-dropdown-checkbox-item], [b-dropdown-radio-item]").forEach(e=>{let s=e.hasAttribute("b-dropdown-radio-item");e.setAttribute("role",s?"menuitemradio":"menuitemcheckbox"),e.setAttribute("data-slot",s?"dropdown-menu-radio-item":"dropdown-menu-checkbox-item"),e.setAttribute("aria-checked",e.hasAttribute("checked")||e.getAttribute("aria-checked")==="true"?"true":"false"),Xl(e,e.getAttribute("aria-checked")==="true")}),t.querySelectorAll(An).forEach(e=>{e.setAttribute("role",e.getAttribute("role")||"menuitem"),e.setAttribute("tabindex",e.getAttribute("tabindex")||"0"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"dropdown-menu-item")})}function Ql(t){let e=[];return t.querySelectorAll("[b-dropdown-sub]").forEach(s=>{let o=s.querySelector("[b-dropdown-sub-trigger]"),a=s.querySelector("[b-dropdown-sub-content]");if(!o||!a)return;if(wn(o,"bu-dropdown-menu-sub-trigger"),wn(a,"bu-dropdown-menu-sub-content"),o.setAttribute("data-slot","dropdown-menu-sub-trigger"),o.setAttribute("role","menuitem"),o.setAttribute("aria-haspopup","menu"),a.setAttribute("data-slot","dropdown-menu-sub-content"),a.setAttribute("role","menu"),a.hidden=!0,!o.querySelector(".bu-dropdown-menu-sub-trigger-icon")){let h=z(document.createElement("span"),"chevron-right");h.classList.add("bu-dropdown-menu-sub-trigger-icon"),o.append(h)}let n=h=>{a.hidden=!h,o.setAttribute("data-state",h?"open":"closed"),o.setAttribute("aria-expanded",String(h))},u=()=>n(!0),p=()=>n(!1),d=h=>{h.preventDefault(),n(a.hidden)};s.addEventListener("mouseenter",u),s.addEventListener("mouseleave",p),o.addEventListener("focus",u),o.addEventListener("click",d),e.push(()=>{s.removeEventListener("mouseenter",u),s.removeEventListener("mouseleave",p),o.removeEventListener("focus",u),o.removeEventListener("click",d)})}),()=>e.forEach(s=>s())}function tp(t){let e=t.querySelector("[b-dropdown-trigger]"),s=t.querySelector("[b-dropdown-menu]");if(!e||!s)return{destroy:()=>{}};t.classList.add("dropdown"),s.classList.add("dropdown-menu"),e.setAttribute("aria-haspopup","menu"),s.setAttribute("role","menu");let o=O().Dropdown.getOrCreateInstance(e),a=C=>{t.setAttribute("b-att-state",C?"open":"closed"),e.setAttribute("aria-expanded",String(C)),t.dispatchEvent(new CustomEvent(C?"baseui:open":"baseui:close",{bubbles:!0}))},n=()=>a(!0),u=()=>a(!1);e.addEventListener("shown.bs.dropdown",n),e.addEventListener("hidden.bs.dropdown",u);let p=()=>o.toggle();e.addEventListener("click",p);let d=C=>{C.key==="Escape"?(o.hide(),e.focus()):C.key==="ArrowDown"&&!s.classList.contains("show")&&(C.preventDefault(),o.show(),[...s.querySelectorAll("a, button, [tabindex]:not([tabindex='-1'])")][0]?.focus())};t.addEventListener("keydown",d);let h=C=>{t.contains(C.target)||o.hide()};document.addEventListener("click",h),Yl(s);let f=Ql(s),g=C=>{let k=C.target.closest(An);!k||k.closest("[b-dropdown-sub]")||o.hide()};return s.addEventListener("click",g),{destroy:()=>{f(),s.removeEventListener("click",g),document.removeEventListener("click",h),t.removeEventListener("keydown",d),e.removeEventListener("click",p),e.removeEventListener("shown.bs.dropdown",n),e.removeEventListener("hidden.bs.dropdown",u),o.dispose()}}}b.register("dropdown-menu",{type:"owl",mount:tp});E();var pa={default:"bu-empty-default",outline:"bu-empty-outline",background:"bu-empty-background"};function ep(t){let e=t.getAttribute("b-att-variant")||"default",s=[...t.querySelectorAll("[b-empty-media]")];return t.setAttribute("role",t.getAttribute("role")||"status"),t.classList.add("bu-empty",pa[e]||pa.default),t.querySelectorAll("[b-empty-header]").forEach(o=>o.classList.add("bu-empty-header")),t.querySelectorAll("[b-empty-title]").forEach(o=>o.classList.add("bu-empty-title")),t.querySelectorAll("[b-empty-description]").forEach(o=>o.classList.add("bu-empty-description")),t.querySelectorAll("[b-empty-content]").forEach(o=>o.classList.add("bu-empty-content")),s.forEach(o=>{let a=o.getAttribute("b-att-variant")==="icon"?"icon":"default";o.classList.add("bu-empty-media",`bu-empty-media-${a}`),o.setAttribute("data-variant",a)}),{destroy:()=>{t.classList.remove("bu-empty",...Object.values(pa))}}}b.register("empty",{type:"owl",mount:ep});E();function Oi(t,e){t?.classList.add(...e.filter(Boolean))}function oe(t,e,s,o){t.querySelectorAll(e).forEach(a=>{a.setAttribute("data-slot",s),Oi(a,[o])})}function sp(t){return t.querySelector("input, textarea, select, [role='checkbox'], [role='radio'], [role='switch']")}function op(t,e){return e.id?e.id:`${t?.id||"bu-field"}-error`}function rp(t){let e=t.getAttribute("b-att-slot")||t.getAttribute("data-slot")||"field",s=[];if(e==="field-set")t.setAttribute("data-slot","field-set"),Oi(t,["bu-field-set"]),s.push("bu-field-set");else if(e==="field-group")t.setAttribute("data-slot","field-group"),Oi(t,["bu-field-group"]),s.push("bu-field-group");else{let n=t.getAttribute("b-att-orientation")||t.getAttribute("data-orientation")||"vertical";t.setAttribute("role",t.getAttribute("role")||"group"),t.setAttribute("data-slot","field"),t.setAttribute("data-orientation",n),Oi(t,["bu-field",`bu-field-orientation-${n}`]),s.push("bu-field",`bu-field-orientation-${n}`)}oe(t,"legend[b-field-legend], [b-field-legend]","field-legend","bu-field-legend"),oe(t,"[b-field-group]","field-group","bu-field-group"),oe(t,"[b-field-content]","field-content","bu-field-content"),oe(t,"label[b-field-label], [b-field-label], [b-label]","field-label","bu-field-label"),oe(t,"[b-field-title]","field-label","bu-field-title"),oe(t,"[b-field-description]","field-description","bu-field-description"),oe(t,"[b-field-separator]","field-separator","bu-field-separator"),oe(t,"[b-field-error], [b-error]","field-error","bu-field-error"),t.querySelectorAll("[b-field-separator]").forEach(n=>{if(!n.querySelector(".bu-field-separator-line")){let u=document.createElement("span");u.className="bu-field-separator-line",u.setAttribute("aria-hidden","true"),n.prepend(u)}n.textContent.trim()&&n.setAttribute("data-content","true")});let o=sp(t),a=t.querySelector("[b-field-error], [b-error], [data-slot='field-error']");if(o&&a){a.setAttribute("role",a.getAttribute("role")||"alert");let n=op(o,a);a.id=n,o.setAttribute("aria-describedby",n),o.setAttribute("aria-invalid","true"),t.setAttribute("data-invalid","true")}return{destroy:()=>t.classList.remove(...s)}}b.register("field",{type:"static",mount:rp});E();function ip(t){t.classList.add("bu-form"),t.setAttribute("data-slot","form"),t.setAttribute("novalidate","");let e=t.querySelector("[name='title']"),s=t.querySelector("[name='description']"),o=t.querySelector("[b-form-counter], .bu-form-counter-text"),a=Number(s?.getAttribute("maxlength")||100),n=()=>{o&&s&&(o.textContent=`${s.value.length}/${a} characters`)},u=()=>{e&&(e.value=""),s&&(s.value=""),n()},p=t.querySelector("[b-form-reset]");return p?.addEventListener("click",u),s?.addEventListener("input",n),n(),{destroy(){p?.removeEventListener("click",u),s?.removeEventListener("input",n)}}}b.register("form",{type:"static",mount:ip});E();function ap(t){let e=t.querySelector("[b-hover-card-trigger]"),s=t.querySelector("[b-hover-card-content]");if(!e||!s)return{};let o=()=>{s.hidden=!1,e.setAttribute("aria-expanded","true")},a=()=>{s.hidden=!0,e.setAttribute("aria-expanded","false")},n=u=>{u.key==="Escape"&&a()};return e.setAttribute("aria-haspopup","dialog"),s.setAttribute("role","dialog"),a(),t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",a),t.addEventListener("focusin",o),t.addEventListener("focusout",a),t.addEventListener("keydown",n),{destroy:()=>{t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",a),t.removeEventListener("focusin",o),t.removeEventListener("focusout",a),t.removeEventListener("keydown",n)}}}b.register("hover-card",{type:"owl",mount:ap});E();it();function np(t){let e=t.getAttribute("b-icon")||t.getAttribute("b-att-icon")||t.getAttribute("aria-label");return e?(z(t,e,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url"),label:t.getAttribute("b-att-label")??t.getAttribute("aria-label")??"",size:t.getAttribute("b-icon-size")||t.getAttribute("b-att-size")}),{destroy:()=>{t.classList.remove("bu-icon"),t.style.removeProperty("--b-icon-url"),t.style.removeProperty("--b-icon-size"),!t.getAttribute("b-att-label")&&!t.getAttribute("aria-label")&&t.removeAttribute("aria-hidden")}}):{}}b.register("icon",{type:"static",mount:np});E();function cp(t){let e=ui({tag:t.tagName.toLowerCase(),type:t.getAttribute("type")});return t.classList.add(e),{destroy:()=>t.classList.remove(e)}}b.register("input",{type:"static",mount:cp});E();function up(t){t.classList.add("bu-input-group"),t.setAttribute("role",t.getAttribute("role")||"group"),t.setAttribute("data-slot","input-group");let e=[...t.querySelectorAll("[b-input-group-addon], [b-input-group-text], [b-input-group-button]")],s=[...t.querySelectorAll("[b-input-group-button]")],o=[...t.querySelectorAll("input, textarea, [data-slot='input-group-control']")],a=n=>{n.target.closest("button")||di(n.currentTarget)};return e.forEach(n=>{if(n.matches("[b-input-group-addon]")){let u=pe[n.getAttribute("b-att-align")]?n.getAttribute("b-att-align"):"inline-start";n.classList.add("bu-input-group-addon",pe[u]),n.setAttribute("data-align",u),n.setAttribute("data-slot","input-group-addon"),n.setAttribute("role",n.getAttribute("role")||"group"),n.addEventListener("click",a)}n.matches("[b-input-group-text]")&&(n.classList.add("bu-input-group-text"),n.setAttribute("data-slot","input-group-text"))}),s.forEach(n=>{let u=be[n.getAttribute("b-att-size")]?n.getAttribute("b-att-size"):"xs",p=de[n.getAttribute("b-att-variant")]||de.ghost;n.classList.add("btn","bu-button","bu-input-group-button",p,be[u]),n.setAttribute("data-size",u),n.setAttribute("data-slot","input-group-button"),n.getAttribute("type")||n.setAttribute("type","button")}),o.forEach(n=>{n.classList.add("bu-input-group-control"),n.setAttribute("data-slot","input-group-control"),n.matches("input")&&n.classList.add("bu-input-group-input"),n.matches("textarea")&&n.classList.add("bu-input-group-textarea")}),{destroy:()=>{t.classList.remove("bu-input-group"),t.removeAttribute("data-slot"),e.forEach(n=>{n.removeEventListener("click",a),n.classList.remove("bu-input-group-addon","bu-input-group-text",...Object.values(pe)),n.removeAttribute("data-align"),n.removeAttribute("data-slot")}),s.forEach(n=>{n.classList.remove("btn","bu-button","bu-input-group-button",...Object.values(de),...Object.values(be)),n.removeAttribute("data-size"),n.removeAttribute("data-slot")}),o.forEach(n=>{n.classList.remove("bu-input-group-control","bu-input-group-input","bu-input-group-textarea"),n.removeAttribute("data-slot")})}}}b.register("input-group",{type:"static",mount:up});E();function lp(t){let e=[...t.querySelectorAll("input")];t.classList.add("bu-input-otp"),e.forEach(n=>{n.classList.add("form-control"),n.inputMode=n.inputMode||"numeric",n.maxLength=n.maxLength>0?n.maxLength:1});let s=()=>{let n=e.map(u=>u.value).join("");t.setAttribute("b-att-value",n),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:n}}))},o=n=>{let u=e.indexOf(n.target);n.target.value&&e[u+1]&&e[u+1].focus(),s()},a=n=>{let u=n.clipboardData.getData("text").trim();u&&(n.preventDefault(),e.forEach((p,d)=>{p.value=u[d]||""}),s())};return e.forEach(n=>n.addEventListener("input",o)),t.addEventListener("paste",a),{destroy:()=>{e.forEach(n=>n.removeEventListener("input",o)),t.removeEventListener("paste",a)}}}b.register("input-otp",{type:"owl",mount:lp});E();function pp(t){return t.classList.add("bu-item"),{destroy:()=>t.classList.remove("bu-item")}}b.register("item",{type:"static",mount:pp});E();function dp(t){return t.classList.add("bu-kbd"),{destroy:()=>t.classList.remove("bu-kbd")}}b.register("kbd",{type:"static",mount:dp});E();function bp(t){return t.classList.add("form-label","b-label","bu-label"),t.getAttribute("b-att-required")==="true"&&t.setAttribute("b-att-state","required"),{destroy:()=>t.classList.remove("form-label","b-label","bu-label")}}b.register("label",{type:"static",mount:bp});E();function hp(t){return t.classList.add("bu-marker"),{destroy:()=>t.classList.remove("bu-marker")}}b.register("marker",{type:"static",mount:hp});E();vi();function mp(t){let e=t.querySelector("script[type='text/markdown'], template");return e?e.tagName==="TEMPLATE"?e.content.textContent:e.textContent:t.getAttribute("b-att-content")||t.textContent||""}function fp(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function gp(t){t.classList.add("bu-markdown");let e=t.getAttribute("b-att-src"),s=t.getAttribute("b-att-mermaid")!=="false",o=t.getAttribute("b-att-base-ui")!=="false",a=t.getAttribute("b-att-editable")==="true",n=t.getAttribute("b-att-collaborative")==="true",u=t.getAttribute("b-att-room")||"bu-markdown",p=t.getAttribute("b-att-password")||void 0,d=fp(t.getAttribute("b-att-signaling")),h=!1,f=null;function g(k){h||(t.setAttribute("data-status","error"),t.textContent=`Unable to render Markdown: ${k?.message||k}`,t.dispatchEvent(new CustomEvent("baseui:markdown-error",{bubbles:!0,detail:{error:k}})))}async function C(){let k=mp(t);t.setAttribute("data-status","loading");let v=k;if(e)try{let B=await fetch(e);if(!B.ok)throw new Error(`${B.status} ${B.statusText}`);v=await B.text()}catch(B){g(B);return}if(a){t.replaceChildren(),t.classList.add("bu-markdown-editable"),t.setAttribute("data-status","ready");let B=document.createElement("div");B.className="bu-markdown-editor",B.setAttribute("data-slot","markdown-editor"),B.setAttribute("role","group"),B.setAttribute("aria-label",n?"Collaborative Markdown editor":"Markdown editor"),t.append(B);try{if(f=await Xr({root:B,value:v,collaborative:n,room:u,password:p,signaling:d,onChange:(F,et)=>{t.dispatchEvent(new CustomEvent("baseui:markdown-change",{bubbles:!0,detail:{markdown:F,previousMarkdown:et}}))}}),h){f?.destroy?.(),f=null;return}}catch(F){g(F);return}t.dispatchEvent(new CustomEvent("baseui:markdown-editor-ready",{bubbles:!0,detail:{collaborative:n,room:u}}));return}let{data:A,content:T}=yi(v),q;try{q=await Zr(T)}catch(B){g(B);return}h||(t.innerHTML=q,t.setAttribute("data-status","ready"),await Jr(t,{mermaid:s,baseUi:o}),h||t.dispatchEvent(new CustomEvent("baseui:markdown-render",{bubbles:!0,detail:{html:q,frontmatter:A}})))}return C(),{destroy:()=>{h=!0,f?.destroy?.(),f=null,Rr(t),t.classList.remove("bu-markdown"),t.classList.remove("bu-markdown-editable"),t.removeAttribute("data-status")}}}b.register("markdown",{type:"static",mount:gp});E();function vp(t){return t.classList.add("bu-message"),t.setAttribute("b-att-side",t.getAttribute("b-att-side")||"incoming"),t.setAttribute("role",t.getAttribute("role")||"listitem"),{}}b.register("message",{type:"static",mount:vp});E();function yp(t){t.classList.add("bu-message-scroller");let e=()=>{t.getAttribute("b-att-autoscroll")!=="false"&&(t.scrollTop=t.scrollHeight)},s=new window.MutationObserver(e);return s.observe(t,{childList:!0,subtree:!0}),window.requestAnimationFrame(e),{destroy:()=>s.disconnect()}}b.register("message-scroller",{type:"owl",mount:yp});E();function xp(t){t.setAttribute("role","menubar"),t.classList.add("bu-menubar");for(let e of t.querySelectorAll("a, button"))e.setAttribute("role","menuitem");return{destroy:()=>t.classList.remove("bu-menubar")}}b.register("menubar",{type:"static",mount:xp});E();function Sp(t){return t.classList.add("form-select"),(t.getAttribute("b-att-size")==="sm"||t.getAttribute("b-att-size")==="lg")&&t.classList.add(`form-select-${t.getAttribute("b-att-size")}`),{destroy:()=>t.classList.remove("form-select","form-select-sm","form-select-lg")}}b.register("native-select",{type:"static",mount:Sp});E();function wp(t){let e=[...t.querySelectorAll("a, button")].filter(o=>!o.disabled),s=o=>{let a=e.indexOf(o.target),n=o.key==="ArrowRight"?1:o.key==="ArrowLeft"?-1:0;!n||a<0||(o.preventDefault(),e[(a+n+e.length)%e.length]?.focus())};return t.setAttribute("role",t.getAttribute("role")||"menubar"),e.forEach(o=>o.setAttribute("role","menuitem")),t.addEventListener("keydown",s),{destroy:()=>t.removeEventListener("keydown",s)}}b.register("navigation-menu",{type:"owl",mount:wp});E();function Ap(t){let e=t.querySelector("ol, ul")||t,s=[...e.children];return t.classList.add("bu-pagination"),e.classList.add("pagination"),s.forEach(o=>{let a=o.querySelector("a, button");o.classList.add("page-item"),a?.classList.add("page-link"),a?.getAttribute("aria-current")==="page"&&o.classList.add("active"),(a?.hasAttribute("disabled")||a?.getAttribute("aria-disabled")==="true")&&o.classList.add("disabled")}),t.setAttribute("aria-label",t.getAttribute("aria-label")||"Pagination"),{destroy:()=>{t.classList.remove("bu-pagination"),e.classList.remove("pagination")}}}b.register("pagination",{type:"owl",mount:Ap});E();function Ep(t){let e=t.querySelector("[b-popover-trigger]")||t,s=t.querySelector("[b-popover-content]"),o=s?s.innerHTML:"";s?.remove(),e.setAttribute("aria-haspopup","dialog");let a=new(O()).Popover(e,{content:o,html:!0,trigger:"click"}),n=()=>{t.setAttribute("b-att-state","open"),e.setAttribute("aria-expanded","true"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},u=()=>{t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))};return e.addEventListener("shown.bs.popover",n),e.addEventListener("hidden.bs.popover",u),t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),{destroy:()=>{e.removeEventListener("shown.bs.popover",n),e.removeEventListener("hidden.bs.popover",u),a.dispose()}}}b.register("popover",{type:"owl",mount:Ep});E();function Cp(t){let e=Number(t.getAttribute("b-att-max")||t.getAttribute("aria-valuemax")||100),s=Math.min(e,Math.max(0,Number(t.getAttribute("b-att-value")||t.getAttribute("aria-valuenow")||0)));if(t.classList.add("bu-progress"),t.setAttribute("role","progressbar"),t.setAttribute("aria-valuemin","0"),t.setAttribute("aria-valuemax",String(e)),t.setAttribute("aria-valuenow",String(s)),t.style.setProperty("--b-progress-value",`${s/e*100}%`),!t.querySelector("[b-progress-indicator]")){let o=document.createElement("span");o.setAttribute("b-progress-indicator",""),t.append(o)}return{destroy:()=>t.classList.remove("bu-progress")}}b.register("progress",{type:"static",mount:Cp});E();function Lp(t){let{open:e,close:s,destroy:o}=bi(t,{closeSelector:"[b-pwa-close]"});return t.BaseUIPwa={open:e,close:s},{destroy:()=>{o(),delete t.BaseUIPwa}}}b.register("pwa",{type:"owl",mount:Lp});E();function kp(t){let e=[...t.querySelectorAll("[b-question]")],s=t.querySelector("[b-question-prev]"),o=t.querySelector("[b-question-next]"),a=0,n=d=>{a=Math.min(e.length-1,Math.max(0,d)),e.forEach((h,f)=>{h.hidden=f!==a,h.setAttribute("b-att-state",f===a?"active":"inactive")}),s&&(s.disabled=a===0),o&&(o.disabled=a===e.length-1),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{index:a}}))},u=()=>n(a-1),p=()=>n(a+1);return s?.addEventListener("click",u),o?.addEventListener("click",p),e.length&&n(0),{destroy:()=>{s?.removeEventListener("click",u),o?.removeEventListener("click",p)}}}b.register("questionnaire",{type:"owl",mount:kp});E();b.register("radio-group",{type:"static",mount:t=>Ni(t,"radio")});E();function Np(t){let e=t.querySelector("[b-resizable-panel]")||t,s=t.querySelector("[b-resizable-handle]");if(!s)return{};let o=Number(t.getAttribute("b-att-min")||160),a=Number(t.getAttribute("b-att-max")||720),n=u=>{let p=u.clientX,d=e.getBoundingClientRect().width,h=g=>{e.style.width=`${Math.min(a,Math.max(o,d+g.clientX-p))}px`},f=()=>{document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",f),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{width:e.style.width}}))};document.addEventListener("pointermove",h),document.addEventListener("pointerup",f)};return s.addEventListener("pointerdown",n),{destroy:()=>s.removeEventListener("pointerdown",n)}}b.register("resizable",{type:"owl",mount:Np});E();function Op(t){return t.classList.add("bu-scroll-area"),t.tabIndex=t.tabIndex>=0?t.tabIndex:0,t.setAttribute("role",t.getAttribute("role")||"region"),{}}b.register("scroll-area",{type:"static",mount:Op});E();function Tp(t){let e=t.getAttribute("b-att-orientation")==="vertical";return t.classList.add("bu-separator",e?"bu-separator-vertical":"bu-separator-horizontal"),t.setAttribute("role",t.getAttribute("role")||"separator"),t.setAttribute("aria-orientation",e?"vertical":"horizontal"),{destroy:()=>t.classList.remove("bu-separator","bu-separator-vertical","bu-separator-horizontal")}}b.register("separator",{type:"static",mount:Tp});E();function En(t,{triggerSelector:e,panelSelector:s,ariaHaspopup:o,panelRole:a,onKeyDown:n}={}){let u=t.querySelector(e),p=t.querySelector(s),d=C=>{!p||!u||(p.hidden=!C,t.setAttribute("b-att-state",C?"open":"closed"),u.setAttribute("aria-expanded",String(C)),t.dispatchEvent(new CustomEvent(C?"baseui:open":"baseui:close",{bubbles:!0})))},h=()=>d(p?.hidden!==!1),f=C=>{C.key==="Escape"&&(d(!1),u?.focus()),n?.(C,{setOpen:d,panel:p,trigger:u})},g=C=>{t.contains(C.target)||d(!1)};return u?.setAttribute("aria-haspopup",o),p?.setAttribute("role",a),p&&(p.hidden=!0),u?.addEventListener("click",h),t.addEventListener("keydown",f),document.addEventListener("click",g),{trigger:u,panel:p,setOpen:d,destroy:()=>{u?.removeEventListener("click",h),t.removeEventListener("keydown",f),document.removeEventListener("click",g)}}}function Bp(t){let{setOpen:e,destroy:s}=En(t,{triggerSelector:"[b-select-trigger]",panelSelector:"[b-select-content]",ariaHaspopup:"listbox",panelRole:"listbox"}),o=t.querySelector("[b-select-trigger]"),a=t.querySelector("[b-select-value]"),n=u=>{let p=u.target.closest("[b-select-item]");if(!(!p||!t.contains(p))){for(let d of t.querySelectorAll("[b-select-item]"))d.setAttribute("aria-selected",String(d===p));a&&(a.textContent=p.textContent.trim()),t.setAttribute("b-att-value",p.getAttribute("b-att-value")||p.textContent.trim()),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:t.getAttribute("b-att-value")}})),e(!1),o?.focus()}};for(let u of t.querySelectorAll("[b-select-item]"))u.setAttribute("role","option");return t.addEventListener("click",n),{destroy:()=>{t.removeEventListener("click",n),s()}}}b.register("select",{type:"owl",mount:Bp});E();function Ip(t){let e=[...t.querySelectorAll("[b-shell-collapse-trigger]")],s=a=>{t.setAttribute("b-att-collapsed",a?"true":"false"),t.dispatchEvent(new CustomEvent(a?"baseui:collapse":"baseui:expand",{bubbles:!0}))},o=()=>s(t.getAttribute("b-att-collapsed")!=="true");return e.forEach(a=>a.addEventListener("click",o)),s(t.getAttribute("b-att-collapsed")==="true"),t.BaseUIShell={collapse:()=>s(!0),expand:()=>s(!1),toggle:o},{destroy:()=>{e.forEach(a=>a.removeEventListener("click",o)),delete t.BaseUIShell}}}b.register("shell",{type:"owl",mount:Ip});E();function Rp(t){let e=t.getAttribute("b-att-side")==="left"?"offcanvas-start":"offcanvas-end";t.classList.add("offcanvas",e,"bu-sheet-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-sheet-close]")].forEach(a=>a.setAttribute("data-bs-dismiss","offcanvas"));let o=O().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return Hs(t,o,"offcanvas","BaseUISheet")}b.register("sheet",{type:"owl",mount:Rp});E();var $p={"[b-sidebar-header]":["bu-sidebar-header","sidebar-header","header"],"[b-sidebar-content]":["bu-sidebar-content","sidebar-content","content"],"[b-sidebar-footer]":["bu-sidebar-footer","sidebar-footer","footer"],"[b-sidebar-group]":["bu-sidebar-group","sidebar-group","group"],"[b-sidebar-group-label]":["bu-sidebar-group-label","sidebar-group-label","group-label"],"[b-sidebar-group-action]":["bu-sidebar-group-action","sidebar-group-action","group-action"],"[b-sidebar-group-content]":["bu-sidebar-group-content","sidebar-group-content","group-content"],"[b-sidebar-menu]":["bu-sidebar-menu","sidebar-menu","menu"],"[b-sidebar-menu-item]":["bu-sidebar-menu-item","sidebar-menu-item","menu-item"],"[b-sidebar-menu-button]":["bu-sidebar-menu-button","sidebar-menu-button","menu-button"],"[b-sidebar-menu-action]":["bu-sidebar-menu-action","sidebar-menu-action","menu-action"],"[b-sidebar-menu-badge]":["bu-sidebar-menu-badge","sidebar-menu-badge","menu-badge"],"[b-sidebar-menu-sub]":["bu-sidebar-menu-sub","sidebar-menu-sub","menu-sub"],"[b-sidebar-menu-sub-item]":["bu-sidebar-menu-sub-item","sidebar-menu-sub-item","menu-sub-item"],"[b-sidebar-menu-sub-button]":["bu-sidebar-menu-sub-button","sidebar-menu-sub-button","menu-sub-button"],"[b-sidebar-separator]":["bu-sidebar-separator","sidebar-separator","separator"]};function Up(t){let e=[];for(let[s,[o,a,n]]of Object.entries($p))for(let u of t.querySelectorAll(s))u.classList.add(o),u.dataset.slot=a,u.dataset.sidebar=n,(u.hasAttribute("b-att-active")||u.getAttribute("aria-current")==="page")&&(u.classList.add("is-active"),u.dataset.active="true"),e.push([u,o]);return e}function Pp(t){let e=t.getAttribute("b-att-trigger")?document.querySelector(t.getAttribute("b-att-trigger")):null,s=[...t.querySelectorAll("[b-sidebar-close]")],o=Up(t),a=d=>{t.setAttribute("b-att-state",d?"open":"closed"),t.classList.toggle("is-open",d),t.dataset.state=d?"expanded":"collapsed",t.dispatchEvent(new CustomEvent(d?"baseui:open":"baseui:close",{bubbles:!0}))},n=()=>a(!0),u=()=>a(!1),p=d=>{d.key==="Escape"&&u()};return e?.addEventListener("click",n),s.forEach(d=>d.addEventListener("click",u)),t.addEventListener("keydown",p),t.dataset.sidebar="sidebar",t.dataset.slot="sidebar",a(t.getAttribute("b-att-state")==="open"),t.BaseUISidebar={open:n,close:u},{destroy:()=>{e?.removeEventListener("click",n),s.forEach(d=>d.removeEventListener("click",u)),t.removeEventListener("keydown",p);for(let[d,h]of o)d.classList.remove(h,"is-active"),d.removeAttribute("data-slot"),d.removeAttribute("data-sidebar"),d.removeAttribute("data-active");t.removeAttribute("data-sidebar"),t.removeAttribute("data-slot"),t.removeAttribute("data-state"),delete t.BaseUISidebar}}}b.register("sidebar",{type:"owl",mount:Pp});E();function qp(t){t.classList.add("bu-slider");let e=()=>{t.style.setProperty("--b-slider-value",`${t.value}%`),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:t.value}}))};return e(),t.addEventListener("input",e),{destroy:()=>{t.removeEventListener("input",e),t.classList.remove("bu-slider")}}}b.register("slider",{type:"static",mount:qp});E();function Mp(t){let e=t.getAttribute("b-att-shape")==="circle"?"bu-skeleton-circle":"bu-skeleton-block";return t.classList.add("bu-skeleton",e),t.setAttribute("aria-hidden",t.getAttribute("aria-hidden")||"true"),{destroy:()=>t.classList.remove("bu-skeleton","bu-skeleton-circle","bu-skeleton-block")}}b.register("skeleton",{type:"static",mount:Mp});E();function jp(t){let e=t.getAttribute("b-att-type")==="grow",s=t.getAttribute("b-att-label")||"Loading";if(t.classList.add(e?"spinner-grow":"spinner-border"),t.setAttribute("role",t.getAttribute("role")||"status"),!t.querySelector(".visually-hidden")){let o=document.createElement("span");o.className="visually-hidden",o.textContent=s,t.append(o)}return{destroy:()=>t.classList.remove("spinner-border","spinner-grow")}}b.register("spinner",{type:"static",mount:jp});E();function zp(t){let e=t.matches("input")?t:t.querySelector("input[type='checkbox']"),s=t.matches("input")?t.closest("label, .form-check"):t;return e?.classList.add("form-check-input"),e?.setAttribute("role",e.getAttribute("role")||"switch"),s?.classList.add("form-check","form-switch","bu-switch"),{destroy:()=>{e?.classList.remove("form-check-input"),s?.classList.remove("form-check","form-switch","bu-switch")}}}b.register("switch",{type:"static",mount:zp});E();function _p(t){if(t.classList.add("table","bu-table"),t.getAttribute("b-att-striped")!=="false"&&t.classList.add("table-striped"),t.getAttribute("b-att-hover")!=="false"&&t.classList.add("table-hover"),t.getAttribute("b-att-responsive")==="true"&&!t.parentElement?.classList.contains("table-responsive")){let e=document.createElement("div");return e.className="table-responsive",t.before(e),e.append(t),{destroy:()=>{e.before(t),e.remove(),t.classList.remove("table","bu-table","table-striped","table-hover")}}}return{destroy:()=>t.classList.remove("table","bu-table","table-striped","table-hover")}}b.register("table",{type:"static",mount:_p});E();function Dp(t){t.classList.add("bu-tabs-host");let e=[...t.querySelectorAll("[b-tab]")],s=[...t.querySelectorAll("[b-panel]")],o=new Map(s.map(g=>[g.getAttribute("b-panel"),g])),a=new Map,n=new Map,u=new Map,p=new Map,d=e[0]?.parentElement;d&&!d.hasAttribute("role")&&d.setAttribute("role","tablist");let h=t.getAttribute("b-att-value")||e[0]?.getAttribute("b-tab")||"",f=g=>{t.setAttribute("b-att-value",g),e.forEach(C=>{C.tabIndex=C.getAttribute("b-tab")===g?0:-1}),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:g}}))};return e.forEach((g,C)=>{let k=g.getAttribute("b-tab"),v=o.get(k),A=k===h;if(g.setAttribute("role","tab"),g.tabIndex=A?0:-1,A&&g.classList.add("active"),v){let et=v.id||`bu-tabs-panel-${k}`;v.id=et,v.setAttribute("role","tabpanel"),v.classList.add("tab-pane","fade"),A&&v.classList.add("show","active"),g.setAttribute("data-bs-target",`#${et}`)}let T=O().Tab.getOrCreateInstance(g);a.set(g,T);let q=()=>T.show();g.addEventListener("click",q),n.set(g,q);let B=()=>f(k);g.addEventListener("shown.bs.tab",B),p.set(g,B);let F=et=>{let si=li(et.key,C,e.length);if(si===-1)return;et.preventDefault();let da=e[si];da.focus(),a.get(da)?.show()};g.addEventListener("keydown",F),u.set(g,F)}),h&&t.setAttribute("b-att-value",h),{destroy:()=>{e.forEach(g=>{g.removeEventListener("click",n.get(g)),g.removeEventListener("keydown",u.get(g)),g.removeEventListener("shown.bs.tab",p.get(g)),a.get(g)?.dispose()}),n.clear(),u.clear(),p.clear(),a.clear()}}}b.register("tabs",{type:"owl",mount:Dp});E();function Fp(t){return t.classList.add("form-control"),t.getAttribute("b-att-resize")==="none"&&t.classList.add("bu-textarea-no-resize"),{destroy:()=>t.classList.remove("form-control","bu-textarea-no-resize")}}b.register("textarea",{type:"static",mount:Fp});E();function Hp(t){let e=t.querySelector("template, script[type='text/html']");return e?e.tagName==="TEMPLATE"?e.innerHTML:e.textContent:t.getAttribute("b-att-content")||t.innerHTML||""}function Wp(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function Vp(t){t.classList.add("bu-text-editor");let e=t.getAttribute("b-att-src"),s=t.getAttribute("b-att-provider")||void 0,o=t.getAttribute("b-att-room")||"bu-text-editor",a=t.getAttribute("b-att-url")||void 0,n=ki({collaborative:t.getAttribute("b-att-collaborative")==="true",providerType:s,url:a}),u=t.getAttribute("b-att-password")||void 0,p=Wp(t.getAttribute("b-att-signaling")),d=t.getAttribute("b-att-placeholder")||void 0,h=!1,f=null;function g(k){h||(t.setAttribute("data-status","error"),t.textContent=`Unable to mount text editor: ${k?.message||k}`,t.dispatchEvent(new CustomEvent("baseui:text-editor-error",{bubbles:!0,detail:{error:k}})))}async function C(){t.setAttribute("data-status","loading");let k=Hp(t);if(e)try{let A=await fetch(e);if(!A.ok)throw new Error(`${A.status} ${A.statusText}`);k=await A.text()}catch(A){g(A);return}t.replaceChildren();let v=document.createElement("div");v.className="bu-text-editor-shell",v.setAttribute("data-slot","text-editor-shell"),v.setAttribute("role","group"),v.setAttribute("aria-label",n?"Collaborative rich text editor":"Rich text editor"),t.append(v);try{if(f=await Li({root:v,value:k,placeholder:d,collaborative:n,providerType:s,room:o,url:a,password:u,signaling:p,onChange:(A,T)=>{t.dispatchEvent(new CustomEvent("baseui:text-editor-change",{bubbles:!0,detail:{html:A,previousHtml:T}}))}}),h){f?.destroy?.(),f=null;return}}catch(A){g(A);return}t.setAttribute("data-status","ready"),t.dispatchEvent(new CustomEvent("baseui:text-editor-ready",{bubbles:!0,detail:{collaborative:n,room:o}}))}return C(),{destroy:()=>{h=!0,f?.destroy?.(),f=null,t.classList.remove("bu-text-editor"),t.removeAttribute("data-status")}}}b.register("text-editor",{type:"static",mount:Vp});it();E();function Kp(t,e){let s=Br(e);t.classList.remove(...Ua),t.className=`${t.className} ${mi({variant:t.getAttribute("b-att-variant")||"outline",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button",t.setAttribute("aria-label",s.label),t.setAttribute("title",s.label),t.setAttribute("aria-pressed",s.pressed);let o=t.querySelector("[b-theme-button-icon]");o||(o=document.createElement("span"),o.setAttribute("b-theme-button-icon",""),t.prepend(o)),o.setAttribute("b-icon",s.icon),z(o,s.icon,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url")});let a=t.querySelector("[b-theme-button-label]");a||(a=document.createElement("span"),a.className="visually-hidden",a.setAttribute("b-theme-button-label",""),t.append(a)),a.textContent=s.label}function Gp(t){let e=se({storageKey:t.getAttribute("b-att-storage-key")||void 0,toggleSelector:"[b-theme-toggle]",labelSelector:"[b-theme-label]"}),s=(n=e.current())=>Kp(t,n),o=()=>s(e.toggle()),a=n=>s(n.detail?.theme);return s(e.set(e.current(),{skipStorage:!0})),t.addEventListener("click",o),document.addEventListener("baseui:theme-change",a),{destroy:()=>{t.removeEventListener("click",o),document.removeEventListener("baseui:theme-change",a)}}}b.register("theme-button",{type:"static",mount:Gp});E();y();function Zp(t){let e=[...t.querySelectorAll("[b-toast-close]")],s=t.getAttribute("b-att-delay"),o=s===null?3e3:Number(s),a=hi(t.getAttribute("b-att-position"));t.className=m(t.className,"toast","fade",a),t.setAttribute("role",t.getAttribute("b-att-variant")==="danger"?"alert":"status"),e.forEach(f=>f.setAttribute("data-bs-dismiss","toast"));let n=new(O()).Toast(t,{autohide:o>0,delay:o||3e3}),u=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},p=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))};t.addEventListener("shown.bs.toast",u),t.addEventListener("hidden.bs.toast",p);let d=()=>n.show(),h=()=>n.hide();return t.getAttribute("b-att-state")==="open"&&d(),t.BaseUIToast={show:d,hide:h},{destroy:()=>{t.removeEventListener("shown.bs.toast",u),t.removeEventListener("hidden.bs.toast",p),n.dispose(),delete t.BaseUIToast}}}b.register("toast",{type:"owl",mount:Zp});E();function Jp(t){let e=t.querySelector("[b-tooltip-trigger]")||t,s=t.querySelector("[b-tooltip-content]");!s&&t.getAttribute("b-att-content")&&(s=document.createElement("span"),s.setAttribute("b-tooltip-content",""),s.textContent=t.getAttribute("b-att-content"),t.appendChild(s));let o=s?s.innerHTML:"";s?.remove();let a=new(O()).Tooltip(e,{title:o,html:!0,trigger:"hover focus"}),n=()=>t.setAttribute("b-att-state","open"),u=()=>t.setAttribute("b-att-state","closed");return e.addEventListener("shown.bs.tooltip",n),e.addEventListener("hidden.bs.tooltip",u),t.setAttribute("b-att-state","closed"),{destroy:()=>{e.removeEventListener("shown.bs.tooltip",n),e.removeEventListener("hidden.bs.tooltip",u),a.dispose()}}}b.register("tooltip",{type:"owl",mount:Jp});E();function Xp(t){t.classList.add("btn",t.getAttribute("b-att-variant")==="outline"?"btn-outline-secondary":"btn-light"),t.setAttribute("aria-pressed",t.getAttribute("aria-pressed")||"false");let e=()=>{let s=t.getAttribute("aria-pressed")!=="true";t.setAttribute("aria-pressed",String(s)),t.setAttribute("b-att-state",s?"on":"off"),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{pressed:s}}))};return t.addEventListener("click",e),{destroy:()=>t.removeEventListener("click",e)}}b.register("toggle",{type:"owl",mount:Xp});E();function Yp(t){let e=[...t.querySelectorAll("[b-att-value], button")],s=t.getAttribute("b-att-multiple")==="true";t.classList.add("btn-group"),t.setAttribute("role",s?"group":"radiogroup"),e.forEach(a=>{a.classList.add("btn","btn-outline-secondary"),a.setAttribute("aria-pressed",a.getAttribute("aria-pressed")||"false")});let o=a=>{let n=a.target.closest("button, [b-att-value]");if(!n||!t.contains(n))return;s||e.forEach(p=>p.setAttribute("aria-pressed","false")),n.setAttribute("aria-pressed",String(n.getAttribute("aria-pressed")!=="true"));let u=e.filter(p=>p.getAttribute("aria-pressed")==="true").map(p=>p.getAttribute("b-att-value")||p.textContent.trim());t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:s?u:u[0]}}))};return t.addEventListener("click",o),{destroy:()=>t.removeEventListener("click",o)}}b.register("toggle-group",{type:"owl",mount:Yp});E();var Cn={lead:"lead",muted:"text-body-secondary",code:"bu-code",kbd:"bu-kbd"};function Qp(t){let e=Cn[t.getAttribute("b-att-variant")||"body"];return t.classList.add("bu-typography"),e&&t.classList.add(e),{destroy:()=>t.classList.remove("bu-typography",...Object.values(Cn))}}b.register("typography",{type:"static",mount:Qp});S();xa(ua);fa(va);ga();var SC=b;export{Co as Accordion,ko as AccordionContent,Lo as AccordionItem,Le as AccordionTrigger,le as Alert,gs as AlertAction,fs as AlertDescription,Ws as AlertDialog,ve as AlertDialogAction,ge as AlertDialogCancel,Vs as AlertDialogContent,Xs as AlertDialogDescription,Gs as AlertDialogFooter,Ks as AlertDialogHeader,Zs as AlertDialogMedia,Js as AlertDialogTitle,fe as AlertDialogTrigger,ms as AlertTitle,yt as ApiDoc,xt as ApiDocGroup,$n as App,vr as AspectRatio,rr as Attachment,Ve as AttachmentAction,ur as AttachmentActions,ar as AttachmentContent,cr as AttachmentDescription,pr as AttachmentDropzone,lr as AttachmentGroup,ir as AttachmentMedia,nr as AttachmentTitle,Ke as AttachmentTrigger,dr as Avatar,at as Badge,b as BaseUI,ua as BaseUIComponents,$a as BaseUITheme,ts as BlockViewer,Dt as Breadcrumb,Ne as BreadcrumbEllipsis,Ht as BreadcrumbItem,Wt as BreadcrumbLink,Ft as BreadcrumbList,Vt as BreadcrumbPage,bt as BreadcrumbSeparator,yr as Bubble,x as Button,wr as ButtonGroup,Ar as ButtonGroupSeparator,Er as ButtonGroupText,Fe as Calendar,cs as Card,ls as CardBody,bs as CardDescription,ps as CardFooter,us as CardHeader,ds as CardTitle,tr as Carousel,We as CarouselNext,He as CarouselPrevious,er as CarouselSlide,Qo as Chart,Pt as Checkbox,ne as ClipboardButton,No as Collapsible,Oo as CollapsibleContent,ke as CollapsibleTrigger,Xo as Combobox,Yo as Command,c as Component,So as ContextMenu,Ao as ContextMenuContent,Eo as ContextMenuItem,wo as ContextMenuTrigger,De as DataTable,Jo as DatePicker,Nt as Dialog,ue as DialogClose,ut as DialogContent,It as DialogDescription,Tt as DialogFooter,Ot as DialogHeader,Bt as DialogTitle,hs as DialogTrigger,xr as Direction,Ys as Drawer,xe as DrawerClose,Qs as DrawerContent,oo as DrawerDescription,eo as DrawerFooter,to as DrawerHeader,so as DrawerTitle,ye as DrawerTrigger,qt as DropdownMenu,Ee as DropdownMenuCheckboxItem,Mt as DropdownMenuContent,fo as DropdownMenuGroup,jt as DropdownMenuItem,go as DropdownMenuLabel,vo as DropdownMenuRadioGroup,Ce as DropdownMenuRadioItem,yo as DropdownMenuSeparator,xo as DropdownMenuShortcut,zt as DropdownMenuSub,_t as DropdownMenuSubContent,pt as DropdownMenuSubTrigger,lt as DropdownMenuTrigger,vs as Empty,As as EmptyContent,ws as EmptyDescription,ys as EmptyHeader,xs as EmptyMedia,Ss as EmptyTitle,Un as EventBus,Yt as Field,kr as FieldContent,te as FieldDescription,ee as FieldError,Xt as FieldGroup,Qt as FieldLabel,Lr as FieldLegend,Or as FieldSeparator,Cr as FieldSet,Nr as FieldTitle,os as Form,bo as HoverCard,mo as HoverCardContent,ho as HoverCardTrigger,R as Icon,At as Input,Rs as InputGroup,$s as InputGroupAddon,he as InputGroupButton,Ps as InputGroupInput,Us as InputGroupText,qs as InputGroupTextarea,Ms as InputOtp,Sr as Item,ks as Kbd,Tr as Label,vt as Markdown,Qe as MarkdownTree,ei as MarkdownTreeNode,Ns as Marker,$o as Menubar,br as Message,hr as MessageScroller,Ut as NativeSelect,Io as NavigationMenu,Ro as NavigationMenuItem,Pn as OwlError,To as Pagination,Bo as PaginationItem,lo as Popover,po as PopoverContent,Ae as PopoverTrigger,gr as Progress,Pr as Pwa,_r as PwaBody,ss as PwaClose,qr as PwaContent,zr as PwaDescription,Fr as PwaFooter,Mr as PwaHeader,Dr as PwaSteps,jr as PwaTitle,es as PwaTrigger,mr as Questionnaire,Ze as QuestionnaireNext,Ge as QuestionnairePrevious,fr as QuestionnaireStep,Os as RadioGroup,Ts as RadioGroupItem,sr as Resizable,or as ScrollArea,zs as Select,_s as SelectContent,Ds as SelectItem,me as SelectTrigger,Es as Separator,ro as Sheet,we as SheetClose,io as SheetContent,uo as SheetDescription,no as SheetFooter,ao as SheetHeader,co as SheetTitle,Se as SheetTrigger,Pe as Shell,Me as ShellContent,Go as ShellHeader,Ko as ShellMain,Vo as ShellNav,qe as ShellSidebar,Wo as ShellSidebarHeader,je as ShellUserMenu,mt as Sidebar,Be as SidebarClose,Kt as SidebarContent,Po as SidebarFooter,Gt as SidebarGroup,Ie as SidebarGroupAction,Re as SidebarGroupCollapsible,zo as SidebarGroupContent,Zt as SidebarGroupLabel,Uo as SidebarHeader,Mo as SidebarInput,qo as SidebarInset,ft as SidebarMenu,$e as SidebarMenuAction,Do as SidebarMenuBadge,ht as SidebarMenuButton,Jt as SidebarMenuItem,Fo as SidebarMenuSkeleton,_o as SidebarMenuSub,Ue as SidebarMenuSubButton,Ho as SidebarMenuSubItem,Gr as SidebarProvider,Te as SidebarRail,jo as SidebarSeparator,Oe as SidebarTrigger,Rt as Skeleton,Is as Slider,Cs as Spinner,Bs as Switch,kt as TabContent,ct as TabTrigger,Zo as Table,Et as Tabs,Ct as TabsContainer,Lt as TabsList,Hr as TextEditor,$t as Textarea,gt as ThemeButton,dt as Toast,Je as Toggle,Ir as ToggleGroup,Xe as ToggleGroupItem,wt as Tooltip,Ls as Typography,qn as __info__,Mn as batched,jn as blockDom,m as cn,Ea as createNamedIcon,se as createThemeController,SC as default,na as findMarkdownTreeNode,zn as htmlEscape,Ia as iconComponentName,ie as loadFile,cd as loadTemplate,_n as markRaw,Ri as markup,H as mergeStyle,is as mount,_i as normalizeTheme,Dn as onError,U as onMounted,W as onPatched,Fn as onRendered,ae as onWillDestroy,Hn as onWillPatch,Wn as onWillRender,nt as onWillStart,P as onWillUnmount,V as onWillUpdateProps,ad as rawMount,nd as rawXml,Vn as reactive,xa as registerGlobalComponents,Kn as status,Gn as toRaw,N as useChildSubEnv,Zn as useComponent,st as useEffect,Jn as useEnv,rs as useExternalListener,L as useRef,w as useState,Xn as useSubEnv,Yn as validate,Qn as validateType,tc as whenReady,wa as xml};
|
|
57
|
+
<div class="b-data-table__pagination"><div class="b-data-table__selection-summary">0 of 5 row(s) selected.</div><div class="b-data-table__pager"><button type="button" class="btn b-button btn-outline-secondary btn-sm" disabled>Previous</button><button type="button" class="btn b-button btn-outline-secondary btn-sm" disabled>Next</button></div></div>
|
|
58
|
+
`)}function Rp(t){Tp(t),t.querySelectorAll("[b-icon]").forEach(C=>_(C,C.getAttribute("b-icon"),{label:""}));let e=t.querySelector("table")||t,s=t.querySelector("[b-table-search]"),o=t.querySelector(".b-data-table__selection-summary"),a=t.getAttribute("b-att-variant");t.classList.add("b-data-table"),a&&t.classList.add(`b-data-table-${a}`),e.classList.add("table");let n=t.querySelector(".b-data-table__cards"),l=()=>[...e.querySelectorAll("tbody tr")],u=C=>n?.querySelector(`[data-row-key="${C.dataset.rowKey}"]`),b=()=>[...e.querySelectorAll("tbody input[type='checkbox']")],m=()=>{o&&(o.textContent=`${b().filter(C=>C.checked).length} of ${l().filter(C=>!C.hidden).length} row(s) selected.`)},f=()=>{let C=(s?.value||"").toLowerCase();l().forEach($=>{let O=!($.cells[2]||$.cells[1]||$.cells[0]).textContent.toLowerCase().includes(C);$.hidden=O;let F=u($);F&&(F.hidden=O)}),m()},g=(C,$)=>{let z=e.tBodies[0];l().sort((O,F)=>O.cells[C].textContent.localeCompare(F.cells[C].textContent)*$).forEach(O=>{z.append(O);let F=u(O);F&&n.append(F)})},E=C=>{let $=C.target.closest("th");if(!$)return;let z=$.getAttribute("b-att-sort")==="asc"?-1:1;e.querySelectorAll("th").forEach(O=>O.removeAttribute("b-att-sort")),$.setAttribute("b-att-sort",z===1?"asc":"desc"),g([...$.parentElement.children].indexOf($),z)},N=(C,$)=>{let O=u(C)?.querySelector("input[type='checkbox']");O&&O.checked!==$&&(O.checked=$)},I=C=>{let $=C.target;if($?.matches("input[type='checkbox']")){let z=$.closest("tr"),O=$.closest(".b-data-table__card");if(z)N(z,$.checked);else if(O){let X=l().find(Zr=>Zr.dataset.rowKey===O.dataset.rowKey)?.querySelector("input[type='checkbox']");X&&X.checked!==$.checked&&(X.checked=$.checked)}}m()};return s?.addEventListener("input",f),e.tHead?.addEventListener("click",E),e.addEventListener("change",I),n?.addEventListener("change",I),m(),{destroy:()=>{s?.removeEventListener("input",f),e.tHead?.removeEventListener("click",E),e.removeEventListener("change",I),n?.removeEventListener("change",I)}}}d.register("data-table",{type:"owl",mount:Rp});S();function $p(t){let e=t.matches("input")?t:t.querySelector("input[type='date'], input");t.classList.add("b-date-picker"),e?.classList.add("form-control"),e?.setAttribute("type",e.getAttribute("type")||"date");let s=()=>{t.setAttribute("b-att-value",e.value),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:e.value}}))};return e?.addEventListener("input",s),{destroy:()=>e?.removeEventListener("input",s)}}d.register("date-picker",{type:"owl",mount:$p});S();function qp(t){let e=t.querySelector("[b-dialog-panel]");if(t.classList.add("modal","fade","b-dialog-backdrop"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),e){let a=document.createElement("div");a.className="modal-dialog modal-dialog-centered",e.replaceWith(a),a.append(e),e.classList.add("modal-content")}[...t.querySelectorAll("[b-dialog-close]")].forEach(a=>a.setAttribute("data-bs-dismiss","modal"));let o=k().Modal.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,focus:!0});return Us(t,o,"modal","BaseUIDialog")}d.register("dialog",{type:"owl",mount:qp});S();function Up(t){let e=t.getAttribute("b-att-dir")||t.getAttribute("dir")||"ltr";return t.setAttribute("dir",e==="rtl"?"rtl":"ltr"),{}}d.register("direction",{type:"static",mount:Up});S();function Pp(t){t.classList.add("offcanvas","offcanvas-bottom","b-drawer-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-drawer-close]")].forEach(o=>o.setAttribute("data-bs-dismiss","offcanvas"));let s=k().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return Us(t,s,"offcanvas","BaseUIDrawer")}d.register("drawer",{type:"owl",mount:Pp});S();rt();var dn="a, button, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']";function un(t,e){t?.classList.add(e)}function Mp(t,e){if(!e||t.querySelector("[b-dropdown-indicator], [data-slot$='indicator']"))return;let s=document.createElement("span");s.setAttribute("b-dropdown-indicator",""),s.append(_(document.createElement("span"),"check")),t.prepend(s)}function _p(t){t.setAttribute("data-slot",t.getAttribute("data-slot")||"dropdown-menu-content"),t.querySelectorAll("[b-dropdown-group]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-group"),e.setAttribute("role",e.getAttribute("role")||"group")}),t.querySelectorAll("[b-dropdown-label]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-label"),e.classList.add("dropdown-header")}),t.querySelectorAll("[b-dropdown-separator]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-separator"),e.classList.add("dropdown-divider"),e.setAttribute("role",e.getAttribute("role")||"separator")}),t.querySelectorAll("[b-dropdown-shortcut]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-shortcut")}),t.querySelectorAll("[b-dropdown-checkbox-item], [b-dropdown-radio-item]").forEach(e=>{let s=e.hasAttribute("b-dropdown-radio-item");e.setAttribute("role",s?"menuitemradio":"menuitemcheckbox"),e.setAttribute("data-slot",s?"dropdown-menu-radio-item":"dropdown-menu-checkbox-item"),e.classList.add("dropdown-item"),e.setAttribute("aria-checked",e.hasAttribute("checked")||e.getAttribute("aria-checked")==="true"?"true":"false"),Mp(e,e.getAttribute("aria-checked")==="true")}),t.querySelectorAll(dn).forEach(e=>{e.setAttribute("role",e.getAttribute("role")||"menuitem"),e.setAttribute("tabindex",e.getAttribute("tabindex")||"0"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"dropdown-menu-item"),e.classList.add("dropdown-item")})}function zp(t){let e=[];return t.querySelectorAll("[b-dropdown-sub]").forEach(s=>{let o=s.querySelector("[b-dropdown-sub-trigger]"),a=s.querySelector("[b-dropdown-sub-content]");if(!o||!a)return;if(un(o,"b-dropdown-menu-sub-trigger"),un(a,"b-dropdown-menu-sub-content"),o.setAttribute("data-slot","dropdown-menu-sub-trigger"),o.setAttribute("role","menuitem"),o.setAttribute("aria-haspopup","menu"),a.setAttribute("data-slot","dropdown-menu-sub-content"),a.setAttribute("role","menu"),a.hidden=!0,!o.querySelector(".b-dropdown-menu-sub-trigger-icon")){let m=_(document.createElement("span"),"chevron-right");m.classList.add("b-dropdown-menu-sub-trigger-icon"),o.append(m)}let n=m=>{a.hidden=!m,o.setAttribute("data-state",m?"open":"closed"),o.setAttribute("aria-expanded",String(m))},l=()=>n(!0),u=()=>n(!1),b=m=>{m.preventDefault(),n(a.hidden)};s.addEventListener("mouseenter",l),s.addEventListener("mouseleave",u),o.addEventListener("focus",l),o.addEventListener("click",b),e.push(()=>{s.removeEventListener("mouseenter",l),s.removeEventListener("mouseleave",u),o.removeEventListener("focus",l),o.removeEventListener("click",b)})}),()=>e.forEach(s=>s())}function Dp(t){let e=t.querySelector("[b-dropdown-trigger]"),s=t.querySelector("[b-dropdown-menu]");if(!e||!s)return{destroy:()=>{}};t.classList.add("dropdown"),s.classList.add("dropdown-menu"),e.setAttribute("aria-haspopup","menu"),s.setAttribute("role","menu");let o=k().Dropdown.getOrCreateInstance(e),a=E=>{t.setAttribute("b-att-state",E?"open":"closed"),e.setAttribute("aria-expanded",String(E)),t.dispatchEvent(new CustomEvent(E?"baseui:open":"baseui:close",{bubbles:!0}))},n=()=>a(!0),l=()=>a(!1);e.addEventListener("shown.bs.dropdown",n),e.addEventListener("hidden.bs.dropdown",l);let u=()=>o.toggle();e.addEventListener("click",u);let b=E=>{E.key==="Escape"?(o.hide(),e.focus()):E.key==="ArrowDown"&&!s.classList.contains("show")&&(E.preventDefault(),o.show(),[...s.querySelectorAll("a, button, [tabindex]:not([tabindex='-1'])")][0]?.focus())};t.addEventListener("keydown",b);let m=E=>{t.contains(E.target)||o.hide()};document.addEventListener("click",m),_p(s);let f=zp(s),g=E=>{let N=E.target.closest(dn);!N||N.closest("[b-dropdown-sub]")||o.hide()};return s.addEventListener("click",g),{destroy:()=>{f(),s.removeEventListener("click",g),document.removeEventListener("click",m),t.removeEventListener("keydown",b),e.removeEventListener("click",u),e.removeEventListener("shown.bs.dropdown",n),e.removeEventListener("hidden.bs.dropdown",l),o.dispose()}}}d.register("dropdown-menu",{type:"owl",mount:Dp});S();var Vi={default:"b-empty-default",outline:"b-empty-outline",background:"b-empty-background"};function jp(t){let e=t.getAttribute("b-att-variant")||"default",s=[...t.querySelectorAll("[b-empty-media]")];return t.setAttribute("role",t.getAttribute("role")||"status"),t.classList.add("b-empty",Vi[e]||Vi.default),t.querySelectorAll("[b-empty-header]").forEach(o=>o.classList.add("b-empty-header")),t.querySelectorAll("[b-empty-title]").forEach(o=>o.classList.add("b-empty-title")),t.querySelectorAll("[b-empty-description]").forEach(o=>o.classList.add("b-empty-description")),t.querySelectorAll("[b-empty-content]").forEach(o=>o.classList.add("b-empty-content")),s.forEach(o=>{let a=o.getAttribute("b-att-variant")==="icon"?"icon":"default";o.classList.add("b-empty-media",`b-empty-media-${a}`),o.setAttribute("data-variant",a)}),{destroy:()=>{t.classList.remove("b-empty",...Object.values(Vi))}}}d.register("empty",{type:"owl",mount:jp});S();function gi(t,e){t?.classList.add(...e.filter(Boolean))}function ae(t,e,s,o){t.querySelectorAll(e).forEach(a=>{a.setAttribute("data-slot",s),gi(a,[o])})}function Fp(t){return t.querySelector("input, textarea, select, [role='checkbox'], [role='radio'], [role='switch']")}function Hp(t,e){return e.id?e.id:`${t?.id||"b-field"}-error`}function Wp(t){let e=t.getAttribute("b-att-slot")||t.getAttribute("data-slot")||"field",s=[];if(e==="field-set")t.setAttribute("data-slot","field-set"),gi(t,["b-field-set"]),s.push("b-field-set");else if(e==="field-group")t.setAttribute("data-slot","field-group"),gi(t,["b-field-group"]),s.push("b-field-group");else{let n=t.getAttribute("b-att-orientation")||t.getAttribute("data-orientation")||"vertical";t.setAttribute("role",t.getAttribute("role")||"group"),t.setAttribute("data-slot","field"),t.setAttribute("data-orientation",n),gi(t,["b-field",`b-field-orientation-${n}`]),s.push("b-field",`b-field-orientation-${n}`)}ae(t,"legend[b-field-legend], [b-field-legend]","field-legend","b-field-legend"),ae(t,"[b-field-group]","field-group","b-field-group"),ae(t,"[b-field-content]","field-content","b-field-content"),ae(t,"label[b-field-label], [b-field-label], [b-label]","field-label","b-field-label"),ae(t,"[b-field-title]","field-label","b-field-title"),ae(t,"[b-field-description]","field-description","b-field-description"),ae(t,"[b-field-separator]","field-separator","b-field-separator"),ae(t,"[b-field-error], [b-error]","field-error","b-field-error"),t.querySelectorAll("[b-field-separator]").forEach(n=>{if(!n.querySelector(".b-field-separator-line")){let l=document.createElement("span");l.className="b-field-separator-line",l.setAttribute("aria-hidden","true"),n.prepend(l)}n.textContent.trim()&&n.setAttribute("data-content","true")});let o=Fp(t),a=t.querySelector("[b-field-error], [b-error], [data-slot='field-error']");if(o&&a){a.setAttribute("role",a.getAttribute("role")||"alert");let n=Hp(o,a);a.id=n,o.setAttribute("aria-describedby",n),o.setAttribute("aria-invalid","true"),t.setAttribute("data-invalid","true")}return{destroy:()=>t.classList.remove(...s)}}d.register("field",{type:"static",mount:Wp});S();function Kp(t){t.classList.add("b-form"),t.setAttribute("data-slot","form"),t.setAttribute("novalidate","");let e=t.querySelector("[name='title']"),s=t.querySelector("[name='description']"),o=t.querySelector("[b-form-counter], .b-form-counter-text"),a=Number(s?.getAttribute("maxlength")||100),n=()=>{o&&s&&(o.textContent=`${s.value.length}/${a} characters`)},l=()=>{e&&(e.value=""),s&&(s.value=""),n()},u=t.querySelector("[b-form-reset]");return u?.addEventListener("click",l),s?.addEventListener("input",n),n(),{destroy(){u?.removeEventListener("click",l),s?.removeEventListener("input",n)}}}d.register("form",{type:"static",mount:Kp});S();function Vp(t){let e=t.querySelector("[b-hover-card-trigger]"),s=t.querySelector("[b-hover-card-content]");if(!e||!s)return{};let o=()=>{s.hidden=!1,e.setAttribute("aria-expanded","true")},a=()=>{s.hidden=!0,e.setAttribute("aria-expanded","false")},n=l=>{l.key==="Escape"&&a()};return e.setAttribute("aria-haspopup","dialog"),s.setAttribute("role","dialog"),a(),t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",a),t.addEventListener("focusin",o),t.addEventListener("focusout",a),t.addEventListener("keydown",n),{destroy:()=>{t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",a),t.removeEventListener("focusin",o),t.removeEventListener("focusout",a),t.removeEventListener("keydown",n)}}}d.register("hover-card",{type:"owl",mount:Vp});S();rt();function Zp(t){let e=t.getAttribute("b-icon")||t.getAttribute("b-att-icon")||t.getAttribute("aria-label");return e?(_(t,e,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url"),label:t.getAttribute("b-att-label")??t.getAttribute("aria-label")??"",size:t.getAttribute("b-icon-size")||t.getAttribute("b-att-size")}),{destroy:()=>{t.classList.remove("b-icon"),t.style.removeProperty("--b-icon-url"),t.style.removeProperty("--b-icon-size"),!t.getAttribute("b-att-label")&&!t.getAttribute("aria-label")&&t.removeAttribute("aria-hidden")}}):{}}d.register("icon",{type:"static",mount:Zp});S();function Gp(t){let e=oi({tag:t.tagName.toLowerCase(),type:t.getAttribute("type")});return t.classList.add(e),{destroy:()=>t.classList.remove(e)}}d.register("input",{type:"static",mount:Gp});S();function Jp(t){let e=[...t.querySelectorAll("input")];t.classList.add("b-input-otp"),e.forEach(n=>{n.classList.add("form-control"),n.inputMode=n.inputMode||"numeric",n.maxLength=n.maxLength>0?n.maxLength:1});let s=()=>{let n=e.map(l=>l.value).join("");t.setAttribute("b-att-value",n),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:n}}))},o=n=>{let l=e.indexOf(n.target);n.target.value&&e[l+1]&&e[l+1].focus(),s()},a=n=>{let l=n.clipboardData.getData("text").trim();l&&(n.preventDefault(),e.forEach((u,b)=>{u.value=l[b]||""}),s())};return e.forEach(n=>n.addEventListener("input",o)),t.addEventListener("paste",a),{destroy:()=>{e.forEach(n=>n.removeEventListener("input",o)),t.removeEventListener("paste",a)}}}d.register("input-otp",{type:"owl",mount:Jp});S();function Xp(t){return t.classList.add("b-item"),{destroy:()=>t.classList.remove("b-item")}}d.register("item",{type:"static",mount:Xp});S();function Yp(t){return t.classList.add("b-kbd"),{destroy:()=>t.classList.remove("b-kbd")}}d.register("kbd",{type:"static",mount:Yp});S();function Qp(t){return t.classList.add("form-label","b-label","b-label"),t.getAttribute("b-att-required")==="true"&&t.setAttribute("b-att-state","required"),{destroy:()=>t.classList.remove("form-label","b-label","b-label")}}d.register("label",{type:"static",mount:Qp});S();function tu(t){return t.classList.add("b-marker"),{destroy:()=>t.classList.remove("b-marker")}}d.register("marker",{type:"static",mount:tu});S();ui();function eu(t){let e=t.querySelector("script[type='text/markdown'], template");return e?e.tagName==="TEMPLATE"?e.content.textContent:e.textContent:t.getAttribute("b-att-content")||t.textContent||""}function su(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function ou(t){t.classList.add("b-markdown");let e=t.getAttribute("b-att-src"),s=t.getAttribute("b-att-mermaid")!=="false",o=t.getAttribute("b-att-base-ui")!=="false",a=t.getAttribute("b-att-editable")==="true",n=t.getAttribute("b-att-collaborative")==="true",l=t.getAttribute("b-att-room")||"b-markdown",u=t.getAttribute("b-att-password")||void 0,b=su(t.getAttribute("b-att-signaling")),m=!1,f=null;function g(N){m||(t.setAttribute("data-status","error"),t.textContent=`Unable to render Markdown: ${N?.message||N}`,t.dispatchEvent(new CustomEvent("baseui:markdown-error",{bubbles:!0,detail:{error:N}})))}async function E(){let N=eu(t);t.setAttribute("data-status","loading");let I=N;if(e)try{let O=await fetch(e);if(!O.ok)throw new Error(`${O.status} ${O.statusText}`);I=await O.text()}catch(O){g(O);return}if(a){t.replaceChildren(),t.classList.add("b-markdown-editable"),t.setAttribute("data-status","ready");let O=document.createElement("div");O.className="b-markdown-editor",O.setAttribute("data-slot","markdown-editor"),O.setAttribute("role","group"),O.setAttribute("aria-label",n?"Collaborative Markdown editor":"Markdown editor"),t.append(O);try{if(f=await Wr({root:O,value:I,collaborative:n,room:l,password:u,signaling:b,onChange:(F,X)=>{t.dispatchEvent(new CustomEvent("baseui:markdown-change",{bubbles:!0,detail:{markdown:F,previousMarkdown:X}}))}}),m){f?.destroy?.(),f=null;return}}catch(F){g(F);return}t.dispatchEvent(new CustomEvent("baseui:markdown-editor-ready",{bubbles:!0,detail:{collaborative:n,room:l}}));return}let{data:C,content:$}=di(I),z;try{z=await Fr($)}catch(O){g(O);return}m||(t.innerHTML=z,t.setAttribute("data-status","ready"),await Hr(t,{mermaid:s,baseUi:o}),m||t.dispatchEvent(new CustomEvent("baseui:markdown-render",{bubbles:!0,detail:{html:z,frontmatter:C}})))}return E(),{destroy:()=>{m=!0,f?.destroy?.(),f=null,Cr(t),t.classList.remove("b-markdown"),t.classList.remove("b-markdown-editable"),t.removeAttribute("data-status")}}}d.register("markdown",{type:"static",mount:ou});S();function ru(t){return t.classList.add("b-message"),t.setAttribute("b-att-side",t.getAttribute("b-att-side")||"incoming"),t.setAttribute("role",t.getAttribute("role")||"listitem"),{}}d.register("message",{type:"static",mount:ru});S();function iu(t){t.classList.add("b-message-scroller");let e=()=>{t.getAttribute("b-att-autoscroll")!=="false"&&(t.scrollTop=t.scrollHeight)},s=new window.MutationObserver(e);return s.observe(t,{childList:!0,subtree:!0}),window.requestAnimationFrame(e),{destroy:()=>s.disconnect()}}d.register("message-scroller",{type:"owl",mount:iu});S();function au(t){t.setAttribute("role","menubar"),t.classList.add("b-menubar");for(let e of t.querySelectorAll("a, button"))e.setAttribute("role","menuitem");return{destroy:()=>t.classList.remove("b-menubar")}}d.register("menubar",{type:"static",mount:au});S();function nu(t){return t.classList.add("form-select"),(t.getAttribute("b-att-size")==="sm"||t.getAttribute("b-att-size")==="lg")&&t.classList.add(`form-select-${t.getAttribute("b-att-size")}`),{destroy:()=>t.classList.remove("form-select","form-select-sm","form-select-lg")}}d.register("native-select",{type:"static",mount:nu});S();function cu(t){t.classList.add("nav");let e=[...t.querySelectorAll("a, button")].filter(o=>!o.disabled);e.forEach(o=>o.classList.add("nav-link"));let s=o=>{let a=e.indexOf(o.target),n=o.key==="ArrowRight"?1:o.key==="ArrowLeft"?-1:0;!n||a<0||(o.preventDefault(),e[(a+n+e.length)%e.length]?.focus())};return t.setAttribute("role",t.getAttribute("role")||"menubar"),e.forEach(o=>o.setAttribute("role","menuitem")),t.addEventListener("keydown",s),{destroy:()=>t.removeEventListener("keydown",s)}}d.register("navigation-menu",{type:"owl",mount:cu});S();function lu(t){let e=t.querySelector("ol, ul")||t,s=[...e.children];return t.classList.add("b-pagination"),e.classList.add("pagination"),s.forEach(o=>{let a=o.querySelector("a, button");o.classList.add("page-item"),a?.classList.add("page-link"),a?.getAttribute("aria-current")==="page"&&o.classList.add("active"),(a?.hasAttribute("disabled")||a?.getAttribute("aria-disabled")==="true")&&o.classList.add("disabled")}),t.setAttribute("aria-label",t.getAttribute("aria-label")||"Pagination"),{destroy:()=>{t.classList.remove("b-pagination"),e.classList.remove("pagination")}}}d.register("pagination",{type:"owl",mount:lu});S();function pu(t){let e=t.querySelector("[b-popover-trigger]")||t,s=t.querySelector("[b-popover-content]"),o=s?s.innerHTML:"";s?.remove(),e.setAttribute("aria-haspopup","dialog");let a=new(k()).Popover(e,{content:o,html:!0,trigger:"click"}),n=()=>{t.setAttribute("b-att-state","open"),e.setAttribute("aria-expanded","true"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},l=()=>{t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))};return e.addEventListener("shown.bs.popover",n),e.addEventListener("hidden.bs.popover",l),t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),{destroy:()=>{e.removeEventListener("shown.bs.popover",n),e.removeEventListener("hidden.bs.popover",l),a.dispose()}}}d.register("popover",{type:"owl",mount:pu});S();function uu(t){let e=Number(t.getAttribute("b-att-max")||t.getAttribute("aria-valuemax")||100),s=Math.min(e,Math.max(0,Number(t.getAttribute("b-att-value")||t.getAttribute("aria-valuenow")||0)));if(t.classList.add("progress","b-progress"),t.setAttribute("role","progressbar"),t.setAttribute("aria-valuemin","0"),t.setAttribute("aria-valuemax",String(e)),t.setAttribute("aria-valuenow",String(s)),t.style.setProperty("--b-progress-value",`${s/e*100}%`),!t.querySelector("[b-progress-indicator]")){let o=document.createElement("span");o.className="progress-bar",o.setAttribute("b-progress-indicator",""),t.append(o)}return{destroy:()=>t.classList.remove("progress","b-progress")}}d.register("progress",{type:"static",mount:uu});S();function du(t){let{open:e,close:s,destroy:o}=ai(t,{closeSelector:"[b-pwa-close]"});return t.BaseUIPwa={open:e,close:s},{destroy:()=>{o(),delete t.BaseUIPwa}}}d.register("pwa",{type:"owl",mount:du});S();function bu(t){let e=[...t.querySelectorAll("[b-question]")],s=t.querySelector("[b-question-prev]"),o=t.querySelector("[b-question-next]"),a=0,n=b=>{a=Math.min(e.length-1,Math.max(0,b)),e.forEach((m,f)=>{m.hidden=f!==a,m.setAttribute("b-att-state",f===a?"active":"inactive")}),s&&(s.disabled=a===0),o&&(o.disabled=a===e.length-1),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{index:a}}))},l=()=>n(a-1),u=()=>n(a+1);return s?.addEventListener("click",l),o?.addEventListener("click",u),e.length&&n(0),{destroy:()=>{s?.removeEventListener("click",l),o?.removeEventListener("click",u)}}}d.register("questionnaire",{type:"owl",mount:bu});S();d.register("radio-group",{type:"static",mount:t=>fi(t,"radio")});S();function hu(t){let e=t.querySelector("[b-resizable-panel]")||t,s=t.querySelector("[b-resizable-handle]");if(!s)return{};let o=Number(t.getAttribute("b-att-min")||160),a=Number(t.getAttribute("b-att-max")||720),n=l=>{let u=l.clientX,b=e.getBoundingClientRect().width,m=g=>{e.style.width=`${Math.min(a,Math.max(o,b+g.clientX-u))}px`},f=()=>{document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",f),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{width:e.style.width}}))};document.addEventListener("pointermove",m),document.addEventListener("pointerup",f)};return s.addEventListener("pointerdown",n),{destroy:()=>s.removeEventListener("pointerdown",n)}}d.register("resizable",{type:"owl",mount:hu});S();function mu(t){return t.classList.add("b-scroll-area"),t.tabIndex=t.tabIndex>=0?t.tabIndex:0,t.setAttribute("role",t.getAttribute("role")||"region"),{}}d.register("scroll-area",{type:"static",mount:mu});S();function fu(t){let e=t.getAttribute("b-att-orientation")==="vertical";return t.classList.add("b-separator",e?"b-separator-vertical":"b-separator-horizontal"),t.setAttribute("role",t.getAttribute("role")||"separator"),t.setAttribute("aria-orientation",e?"vertical":"horizontal"),{destroy:()=>t.classList.remove("b-separator","b-separator-vertical","b-separator-horizontal")}}d.register("separator",{type:"static",mount:fu});S();function bn(t,{triggerSelector:e,panelSelector:s,ariaHaspopup:o,panelRole:a,onKeyDown:n}={}){let l=t.querySelector(e),u=t.querySelector(s),b=E=>{!u||!l||(u.hidden=!E,t.setAttribute("b-att-state",E?"open":"closed"),l.setAttribute("aria-expanded",String(E)),t.dispatchEvent(new CustomEvent(E?"baseui:open":"baseui:close",{bubbles:!0})))},m=()=>b(u?.hidden!==!1),f=E=>{E.key==="Escape"&&(b(!1),l?.focus()),n?.(E,{setOpen:b,panel:u,trigger:l})},g=E=>{t.contains(E.target)||b(!1)};return l?.setAttribute("aria-haspopup",o),u?.setAttribute("role",a),u&&(u.hidden=!0),l?.addEventListener("click",m),t.addEventListener("keydown",f),document.addEventListener("click",g),{trigger:l,panel:u,setOpen:b,destroy:()=>{l?.removeEventListener("click",m),t.removeEventListener("keydown",f),document.removeEventListener("click",g)}}}function gu(t){let{setOpen:e,destroy:s}=bn(t,{triggerSelector:"[b-select-trigger]",panelSelector:"[b-select-content]",ariaHaspopup:"listbox",panelRole:"listbox"}),o=t.querySelector("[b-select-trigger]"),a=t.querySelector("[b-select-value]"),n=l=>{let u=l.target.closest("[b-select-item]");if(!(!u||!t.contains(u))){for(let b of t.querySelectorAll("[b-select-item]"))b.setAttribute("aria-selected",String(b===u));a&&(a.textContent=u.textContent.trim()),t.setAttribute("b-att-value",u.getAttribute("b-att-value")||u.textContent.trim()),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:t.getAttribute("b-att-value")}})),e(!1),o?.focus()}};for(let l of t.querySelectorAll("[b-select-item]"))l.setAttribute("role","option");return t.addEventListener("click",n),{destroy:()=>{t.removeEventListener("click",n),s()}}}d.register("select",{type:"owl",mount:gu});S();function vu(t){let e=[...t.querySelectorAll("[b-shell-collapse-trigger]")],s=a=>{t.setAttribute("b-att-collapsed",a?"true":"false"),t.dispatchEvent(new CustomEvent(a?"baseui:collapse":"baseui:expand",{bubbles:!0}))},o=()=>s(t.getAttribute("b-att-collapsed")!=="true");return e.forEach(a=>a.addEventListener("click",o)),s(t.getAttribute("b-att-collapsed")==="true"),t.BaseUIShell={collapse:()=>s(!0),expand:()=>s(!1),toggle:o},{destroy:()=>{e.forEach(a=>a.removeEventListener("click",o)),delete t.BaseUIShell}}}d.register("shell",{type:"owl",mount:vu});S();function yu(t){let e=t.getAttribute("b-att-side")==="left"?"offcanvas-start":"offcanvas-end";t.classList.add("offcanvas",e,"b-sheet-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-sheet-close]")].forEach(a=>a.setAttribute("data-bs-dismiss","offcanvas"));let o=k().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return Us(t,o,"offcanvas","BaseUISheet")}d.register("sheet",{type:"owl",mount:yu});S();var xu={"[b-sidebar-header]":["b-sidebar-header","sidebar-header","header"],"[b-sidebar-content]":["b-sidebar-content","sidebar-content","content"],"[b-sidebar-footer]":["b-sidebar-footer","sidebar-footer","footer"],"[b-sidebar-group]":["b-sidebar-group","sidebar-group","group"],"[b-sidebar-group-label]":["b-sidebar-group-label","sidebar-group-label","group-label"],"[b-sidebar-group-action]":["b-sidebar-group-action","sidebar-group-action","group-action"],"[b-sidebar-group-content]":["b-sidebar-group-content","sidebar-group-content","group-content"],"[b-sidebar-menu]":["b-sidebar-menu","sidebar-menu","menu"],"[b-sidebar-menu-item]":["b-sidebar-menu-item","sidebar-menu-item","menu-item"],"[b-sidebar-menu-button]":["b-sidebar-menu-button","sidebar-menu-button","menu-button"],"[b-sidebar-menu-action]":["b-sidebar-menu-action","sidebar-menu-action","menu-action"],"[b-sidebar-menu-badge]":["b-sidebar-menu-badge","sidebar-menu-badge","menu-badge"],"[b-sidebar-menu-sub]":["b-sidebar-menu-sub","sidebar-menu-sub","menu-sub"],"[b-sidebar-menu-sub-item]":["b-sidebar-menu-sub-item","sidebar-menu-sub-item","menu-sub-item"],"[b-sidebar-menu-sub-button]":["b-sidebar-menu-sub-button","sidebar-menu-sub-button","menu-sub-button"],"[b-sidebar-separator]":["b-sidebar-separator","sidebar-separator","separator"]};function wu(t){let e=[];for(let[s,[o,a,n]]of Object.entries(xu))for(let l of t.querySelectorAll(s))l.classList.add(o),l.dataset.slot=a,l.dataset.sidebar=n,(l.hasAttribute("b-att-active")||l.getAttribute("aria-current")==="page")&&(l.classList.add("is-active"),l.dataset.active="true"),e.push([l,o]);return e}function Su(t){let e=t.getAttribute("b-att-trigger")?document.querySelector(t.getAttribute("b-att-trigger")):null,s=[...t.querySelectorAll("[b-sidebar-close]")],o=wu(t),a=b=>{t.setAttribute("b-att-state",b?"open":"closed"),t.classList.toggle("is-open",b),t.dataset.state=b?"expanded":"collapsed",t.dispatchEvent(new CustomEvent(b?"baseui:open":"baseui:close",{bubbles:!0}))},n=()=>a(!0),l=()=>a(!1),u=b=>{b.key==="Escape"&&l()};return e?.addEventListener("click",n),s.forEach(b=>b.addEventListener("click",l)),t.addEventListener("keydown",u),t.dataset.sidebar="sidebar",t.dataset.slot="sidebar",a(t.getAttribute("b-att-state")==="open"),t.BaseUISidebar={open:n,close:l},{destroy:()=>{e?.removeEventListener("click",n),s.forEach(b=>b.removeEventListener("click",l)),t.removeEventListener("keydown",u);for(let[b,m]of o)b.classList.remove(m,"is-active"),b.removeAttribute("data-slot"),b.removeAttribute("data-sidebar"),b.removeAttribute("data-active");t.removeAttribute("data-sidebar"),t.removeAttribute("data-slot"),t.removeAttribute("data-state"),delete t.BaseUISidebar}}}d.register("sidebar",{type:"owl",mount:Su});S();function Au(t){t.classList.add("b-slider");let e=()=>{t.style.setProperty("--b-slider-value",`${t.value}%`),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:t.value}}))};return e(),t.addEventListener("input",e),{destroy:()=>{t.removeEventListener("input",e),t.classList.remove("b-slider")}}}d.register("slider",{type:"static",mount:Au});S();function Eu(t){let e=t.getAttribute("b-att-shape")==="circle"?"b-skeleton-circle":"b-skeleton-block";return t.classList.add("b-skeleton",e),t.setAttribute("aria-hidden",t.getAttribute("aria-hidden")||"true"),{destroy:()=>t.classList.remove("b-skeleton","b-skeleton-circle","b-skeleton-block")}}d.register("skeleton",{type:"static",mount:Eu});S();function Cu(t){let e=t.getAttribute("b-att-type")==="grow",s=t.getAttribute("b-att-label")||"Loading";if(t.classList.add(e?"spinner-grow":"spinner-border"),t.setAttribute("role",t.getAttribute("role")||"status"),!t.querySelector(".visually-hidden")){let o=document.createElement("span");o.className="visually-hidden",o.textContent=s,t.append(o)}return{destroy:()=>t.classList.remove("spinner-border","spinner-grow")}}d.register("spinner",{type:"static",mount:Cu});S();function ku(t){let e=t.matches("input")?t:t.querySelector("input[type='checkbox']"),s=t.matches("input")?t.closest("label, .form-check"):t;return e?.classList.add("form-check-input"),e?.setAttribute("role",e.getAttribute("role")||"switch"),s?.classList.add("form-check","form-switch","b-switch"),{destroy:()=>{e?.classList.remove("form-check-input"),s?.classList.remove("form-check","form-switch","b-switch")}}}d.register("switch",{type:"static",mount:ku});S();function Lu(t){if(t.classList.add("table","b-table"),t.getAttribute("b-att-striped")!=="false"&&t.classList.add("table-striped"),t.getAttribute("b-att-hover")!=="false"&&t.classList.add("table-hover"),t.getAttribute("b-att-responsive")==="true"&&!t.parentElement?.classList.contains("table-responsive")){let e=document.createElement("div");return e.className="table-responsive",t.before(e),e.append(t),{destroy:()=>{e.before(t),e.remove(),t.classList.remove("table","b-table","table-striped","table-hover")}}}return{destroy:()=>t.classList.remove("table","b-table","table-striped","table-hover")}}d.register("table",{type:"static",mount:Lu});S();function Nu(t){t.classList.add("b-tabs-host");let e=[...t.querySelectorAll("[b-tab]")],s=[...t.querySelectorAll("[b-panel]")],o=new Map(s.map(g=>[g.getAttribute("b-panel"),g])),a=new Map,n=new Map,l=new Map,u=new Map,b=e[0]?.parentElement;b&&!b.hasAttribute("role")&&b.setAttribute("role","tablist"),b?.classList.add("nav");let m=t.getAttribute("b-att-value")||e[0]?.getAttribute("b-tab")||"",f=g=>{t.setAttribute("b-att-value",g),e.forEach(E=>{E.tabIndex=E.getAttribute("b-tab")===g?0:-1}),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:g}}))};return e.forEach((g,E)=>{let N=g.getAttribute("b-tab"),I=o.get(N),C=N===m;if(g.setAttribute("role","tab"),g.classList.add("nav-link"),g.tabIndex=C?0:-1,C&&g.classList.add("active"),I){let X=I.id||`b-tabs-panel-${N}`;I.id=X,I.setAttribute("role","tabpanel"),I.classList.add("tab-pane","fade"),C&&I.classList.add("show","active"),g.setAttribute("data-bs-target",`#${X}`)}let $=k().Tab.getOrCreateInstance(g);a.set(g,$);let z=()=>$.show();g.addEventListener("click",z),n.set(g,z);let O=()=>f(N);g.addEventListener("shown.bs.tab",O),u.set(g,O);let F=X=>{let Zr=ri(X.key,E,e.length);if(Zr===-1)return;X.preventDefault();let Zi=e[Zr];Zi.focus(),a.get(Zi)?.show()};g.addEventListener("keydown",F),l.set(g,F)}),m&&t.setAttribute("b-att-value",m),{destroy:()=>{e.forEach(g=>{g.removeEventListener("click",n.get(g)),g.removeEventListener("keydown",l.get(g)),g.removeEventListener("shown.bs.tab",u.get(g)),a.get(g)?.dispose()}),n.clear(),l.clear(),u.clear(),a.clear()}}}d.register("tabs",{type:"owl",mount:Nu});S();function Ou(t){return t.classList.add("form-control"),t.getAttribute("b-att-resize")==="none"&&t.classList.add("b-textarea-no-resize"),{destroy:()=>t.classList.remove("form-control","b-textarea-no-resize")}}d.register("textarea",{type:"static",mount:Ou});S();function Bu(t){let e=t.querySelector("template, script[type='text/html']");return e?e.tagName==="TEMPLATE"?e.innerHTML:e.textContent:t.getAttribute("b-att-content")||t.innerHTML||""}function Iu(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function Tu(t){t.classList.add("b-text-editor");let e=t.getAttribute("b-att-src"),s=t.getAttribute("b-att-provider")||void 0,o=t.getAttribute("b-att-room")||"b-text-editor",a=t.getAttribute("b-att-url")||void 0,n=mi({collaborative:t.getAttribute("b-att-collaborative")==="true",providerType:s,url:a}),l=t.getAttribute("b-att-password")||void 0,u=Iu(t.getAttribute("b-att-signaling")),b=t.getAttribute("b-att-placeholder")||void 0,m=!1,f=null;function g(N){m||(t.setAttribute("data-status","error"),t.textContent=`Unable to mount text editor: ${N?.message||N}`,t.dispatchEvent(new CustomEvent("baseui:text-editor-error",{bubbles:!0,detail:{error:N}})))}async function E(){t.setAttribute("data-status","loading");let N=Bu(t);if(e)try{let C=await fetch(e);if(!C.ok)throw new Error(`${C.status} ${C.statusText}`);N=await C.text()}catch(C){g(C);return}t.replaceChildren();let I=document.createElement("div");I.className="b-text-editor-shell",I.setAttribute("data-slot","text-editor-shell"),I.setAttribute("role","group"),I.setAttribute("aria-label",n?"Collaborative rich text editor":"Rich text editor"),t.append(I);try{if(f=await hi({root:I,value:N,placeholder:b,collaborative:n,providerType:s,room:o,url:a,password:l,signaling:u,onChange:(C,$)=>{t.dispatchEvent(new CustomEvent("baseui:text-editor-change",{bubbles:!0,detail:{html:C,previousHtml:$}}))}}),m){f?.destroy?.(),f=null;return}}catch(C){g(C);return}t.setAttribute("data-status","ready"),t.dispatchEvent(new CustomEvent("baseui:text-editor-ready",{bubbles:!0,detail:{collaborative:n,room:o}}))}return E(),{destroy:()=>{m=!0,f?.destroy?.(),f=null,t.classList.remove("b-text-editor"),t.removeAttribute("data-status")}}}d.register("text-editor",{type:"static",mount:Tu});rt();S();function Ru(t,e){let s=Ar(e);t.classList.remove(...Na),t.className=`${t.className} ${ci({variant:t.getAttribute("b-att-variant")||"outline",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button",t.setAttribute("aria-label",s.label),t.setAttribute("title",s.label),t.setAttribute("aria-pressed",s.pressed);let o=t.querySelector("[b-theme-button-icon]");o||(o=document.createElement("span"),o.setAttribute("b-theme-button-icon",""),t.prepend(o)),o.setAttribute("b-icon",s.icon),_(o,s.icon,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url")});let a=t.querySelector("[b-theme-button-label]");a||(a=document.createElement("span"),a.className="visually-hidden",a.setAttribute("b-theme-button-label",""),t.append(a)),a.textContent=s.label}function $u(t){let e=ie({storageKey:t.getAttribute("b-att-storage-key")||void 0,toggleSelector:"[b-theme-toggle]",labelSelector:"[b-theme-label]"}),s=(n=e.current())=>Ru(t,n),o=()=>s(e.toggle()),a=n=>s(n.detail?.theme);return s(e.set(e.current(),{skipStorage:!0})),t.addEventListener("click",o),document.addEventListener("baseui:theme-change",a),{destroy:()=>{t.removeEventListener("click",o),document.removeEventListener("baseui:theme-change",a)}}}d.register("theme-button",{type:"static",mount:$u});S();v();function qu(t){let e=[...t.querySelectorAll("[b-toast-close]")],s=t.getAttribute("b-att-delay"),o=s===null?3e3:Number(s),a=ni(t.getAttribute("b-att-position"));t.className=h(t.className,"toast","fade",a),t.setAttribute("role",t.getAttribute("b-att-variant")==="danger"?"alert":"status"),e.forEach(f=>f.setAttribute("data-bs-dismiss","toast"));let n=new(k()).Toast(t,{autohide:o>0,delay:o||3e3}),l=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},u=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))};t.addEventListener("shown.bs.toast",l),t.addEventListener("hidden.bs.toast",u);let b=()=>n.show(),m=()=>n.hide();return t.getAttribute("b-att-state")==="open"&&b(),t.BaseUIToast={show:b,hide:m},{destroy:()=>{t.removeEventListener("shown.bs.toast",l),t.removeEventListener("hidden.bs.toast",u),n.dispose(),delete t.BaseUIToast}}}d.register("toast",{type:"owl",mount:qu});S();function Uu(t){let e=t.querySelector("[b-tooltip-trigger]")||t,s=t.querySelector("[b-tooltip-content]");!s&&t.getAttribute("b-att-content")&&(s=document.createElement("span"),s.setAttribute("b-tooltip-content",""),s.textContent=t.getAttribute("b-att-content"),t.appendChild(s));let o=s?s.innerHTML:"";s?.remove();let a=new(k()).Tooltip(e,{title:o,html:!0,trigger:"hover focus"}),n=()=>t.setAttribute("b-att-state","open"),l=()=>t.setAttribute("b-att-state","closed");return e.addEventListener("shown.bs.tooltip",n),e.addEventListener("hidden.bs.tooltip",l),t.setAttribute("b-att-state","closed"),{destroy:()=>{e.removeEventListener("shown.bs.tooltip",n),e.removeEventListener("hidden.bs.tooltip",l),a.dispose()}}}d.register("tooltip",{type:"owl",mount:Uu});S();function Pu(t){t.classList.add("btn",t.getAttribute("b-att-variant")==="outline"?"btn-outline-secondary":"btn-light"),t.setAttribute("aria-pressed",t.getAttribute("aria-pressed")||"false");let e=()=>{let s=t.getAttribute("aria-pressed")!=="true";t.setAttribute("aria-pressed",String(s)),t.setAttribute("b-att-state",s?"on":"off"),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{pressed:s}}))};return t.addEventListener("click",e),{destroy:()=>t.removeEventListener("click",e)}}d.register("toggle",{type:"owl",mount:Pu});S();function Mu(t){let e=[...t.querySelectorAll("[b-att-value], button")],s=t.getAttribute("b-att-multiple")==="true";t.classList.add("btn-group"),t.setAttribute("role",s?"group":"radiogroup"),e.forEach(a=>{a.classList.add("btn","btn-outline-secondary"),a.setAttribute("aria-pressed",a.getAttribute("aria-pressed")||"false")});let o=a=>{let n=a.target.closest("button, [b-att-value]");if(!n||!t.contains(n))return;s||e.forEach(u=>u.setAttribute("aria-pressed","false")),n.setAttribute("aria-pressed",String(n.getAttribute("aria-pressed")!=="true"));let l=e.filter(u=>u.getAttribute("aria-pressed")==="true").map(u=>u.getAttribute("b-att-value")||u.textContent.trim());t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:s?l:l[0]}}))};return t.addEventListener("click",o),{destroy:()=>t.removeEventListener("click",o)}}d.register("toggle-group",{type:"owl",mount:Mu});S();var hn={lead:"lead",muted:"text-body-secondary",code:"b-code",kbd:"b-kbd",h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"b-list"};function _u(t){let e=hn[t.getAttribute("b-att-variant")||"body"];return t.classList.add("b-typography"),e&&t.classList.add(e),{destroy:()=>t.classList.remove("b-typography",...Object.values(hn))}}d.register("typography",{type:"static",mount:_u});w();sa(Wi);Yi(ta);Qi();var pC=d;export{go as Accordion,yo as AccordionContent,vo as AccordionItem,ke as AccordionTrigger,ct as Alert,ps as AlertAction,At as AlertDescription,Ps as AlertDialog,ve as AlertDialogAction,ge as AlertDialogCancel,Ms as AlertDialogContent,Fs as AlertDialogDescription,zs as AlertDialogFooter,_s as AlertDialogHeader,Ds as AlertDialogMedia,js as AlertDialogTitle,fe as AlertDialogTrigger,ls as AlertTitle,xt as ApiDoc,wt as ApiDocGroup,An as App,pr as AspectRatio,Jo as Attachment,Ke as AttachmentAction,er as AttachmentActions,Yo as AttachmentContent,tr as AttachmentDescription,or as AttachmentDropzone,sr as AttachmentGroup,Xo as AttachmentMedia,Qo as AttachmentTitle,Ve as AttachmentTrigger,rr as Avatar,Q as Badge,d as BaseUI,Wi as BaseUIComponents,La as BaseUITheme,ts as BlockViewer,Wt as Breadcrumb,Ne as BreadcrumbEllipsis,Vt as BreadcrumbItem,Zt as BreadcrumbLink,Kt as BreadcrumbList,Gt as BreadcrumbPage,ht as BreadcrumbSeparator,ur as Bubble,x as Button,hr as ButtonGroup,mr as ButtonGroupSeparator,fr as ButtonGroupText,Fe as Calendar,us as Card,bs as CardBody,fs as CardDescription,hs as CardFooter,ds as CardHeader,ms as CardTitle,Ko as Carousel,We as CarouselNext,He as CarouselPrevious,Vo as CarouselSlide,Wo as Chart,_t as Checkbox,nt as ClipboardButton,de as CodeEditor,xo as Collapsible,wo as CollapsibleContent,Le as CollapsibleTrigger,Fo as Combobox,Ho as Command,c as Component,bo as ContextMenu,mo as ContextMenuContent,fo as ContextMenuItem,ho as ContextMenuTrigger,je as DataTable,jo as DatePicker,It as Dialog,be as DialogClose,pt as DialogContent,qt as DialogDescription,Rt as DialogFooter,Tt as DialogHeader,$t as DialogTitle,gs as DialogTrigger,dr as Direction,Hs as Drawer,xe as DrawerClose,Ws as DrawerContent,Gs as DrawerDescription,Vs as DrawerFooter,Ks as DrawerHeader,Zs as DrawerTitle,ye as DrawerTrigger,zt as DropdownMenu,Ee as DropdownMenuCheckboxItem,Dt as DropdownMenuContent,no as DropdownMenuGroup,jt as DropdownMenuItem,co as DropdownMenuLabel,lo as DropdownMenuRadioGroup,Ce as DropdownMenuRadioItem,po as DropdownMenuSeparator,uo as DropdownMenuShortcut,Ft as DropdownMenuSub,Ht as DropdownMenuSubContent,dt as DropdownMenuSubTrigger,ut as DropdownMenuTrigger,vs as Empty,As as EmptyContent,Ss as EmptyDescription,ys as EmptyHeader,xs as EmptyMedia,ws as EmptyTitle,En as EventBus,ee as Field,yr as FieldContent,oe as FieldDescription,re as FieldError,te as FieldGroup,se as FieldLabel,vr as FieldLegend,wr as FieldSeparator,gr as FieldSet,xr as FieldTitle,os as Form,ro as HoverCard,ao as HoverCardContent,io as HoverCardTrigger,R as Icon,kt as Input,Bs as InputOtp,br as Item,Et as Kbd,Sr as Label,yt as Markdown,Qe as MarkdownTree,Vr as MarkdownTreeNode,ks as Marker,ko as Menubar,ir as Message,ar as MessageScroller,Mt as NativeSelect,Eo as NavigationMenu,Co as NavigationMenuItem,Cn as OwlError,So as Pagination,Ao as PaginationItem,so as Popover,oo as PopoverContent,Ae as PopoverTrigger,lr as Progress,Lr as Pwa,Tr as PwaBody,ss as PwaClose,Nr as PwaContent,Ir as PwaDescription,$r as PwaFooter,Or as PwaHeader,Rr as PwaSteps,Br as PwaTitle,es as PwaTrigger,nr as Questionnaire,Ge as QuestionnaireNext,Ze as QuestionnairePrevious,cr as QuestionnaireStep,Ls as RadioGroup,Ns as RadioGroupItem,Zo as Resizable,Go as ScrollArea,Ts as Select,Rs as SelectContent,$s as SelectItem,me as SelectTrigger,Es as Separator,Js as Sheet,Se as SheetClose,Xs as SheetContent,eo as SheetDescription,Qs as SheetFooter,Ys as SheetHeader,to as SheetTitle,we as SheetTrigger,Ue as Shell,Me as ShellContent,zo as ShellHeader,_o as ShellMain,Mo as ShellNav,Pe as ShellSidebar,Po as ShellSidebarHeader,_e as ShellUserMenu,ft as Sidebar,Ie as SidebarClose,Jt as SidebarContent,No as SidebarFooter,Xt as SidebarGroup,Te as SidebarGroupAction,Re as SidebarGroupCollapsible,To as SidebarGroupContent,Yt as SidebarGroupLabel,Lo as SidebarHeader,Bo as SidebarInput,Oo as SidebarInset,gt as SidebarMenu,$e as SidebarMenuAction,$o as SidebarMenuBadge,mt as SidebarMenuButton,Qt as SidebarMenuItem,qo as SidebarMenuSkeleton,Ro as SidebarMenuSub,qe as SidebarMenuSubButton,Uo as SidebarMenuSubItem,jr as SidebarProvider,Be as SidebarRail,Io as SidebarSeparator,Oe as SidebarTrigger,Ut as Skeleton,Os as Slider,Ct as Spinner,he as Switch,Bt as TabContent,lt as TabTrigger,Do as Table,Lt as Tabs,Nt as TabsContainer,Ot as TabsList,qr as TextEditor,Pt as Textarea,vt as ThemeButton,bt as Toast,Je as Toggle,Er as ToggleGroup,Xe as ToggleGroupItem,at as Tooltip,Cs as Typography,kn as __info__,Ln as batched,Nn as blockDom,h as cn,as as createNamedIcon,ie as createThemeController,pC as default,Fi as findMarkdownTreeNode,On as htmlEscape,Ca as iconComponentName,ce as loadFile,Zu as loadTemplate,Bn as markRaw,wi as markup,H as mergeStyle,is as mount,Ii as normalizeTheme,In as onError,T as onMounted,P as onPatched,Tn as onRendered,le as onWillDestroy,Rn as onWillPatch,$n as onWillRender,ot as onWillStart,q as onWillUnmount,j as onWillUpdateProps,Ku as rawMount,Vu as rawXml,qn as reactive,sa as registerGlobalComponents,Un as status,Pn as toRaw,L as useChildSubEnv,Mn as useComponent,Y as useEffect,_n as useEnv,rs as useExternalListener,A as useRef,y as useState,zn as useSubEnv,Dn as validate,jn as validateType,Fn as whenReady,ra as xml};
|