@thebase/ui 1.2.0 → 1.2.1

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 CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [v1.2.1] - 2026-10-30
6
+
7
+ ### Added
8
+ - Optional standalone i18n service (`@thebase/ui/i18n`, `dist/baseui.i18n.esm.js` / `.min.js`, `window.thebase.i18n`), extracted from `emvhub/i18n.js` and configurable through `init({ languages, defaultLanguage, storageKey, queryParam, catalogDir })`. See `docs/i18n.md`. `emvhub/i18n.js` is now a thin adapter that calls `init()` and re-exports it.
9
+ - `docs/i18n.md` (install, quick start, `.po` catalogs, language detection order, API) and the runnable example in `examples/i18n/`; `test/i18n.test.js` covers the service. The `./i18n` export and `dist/baseui.i18n.*` files are listed in `package.json` `files`/`exports`.
10
+
11
+ ### Changed
12
+ - Version pins in README, docs, emvhub, qr-page, momo_demo and the skill references moved to `@1.2.1`. No breaking changes; existing `emvhub/i18n.js` imports keep working.
13
+
5
14
  ## [v1.2.0] - 2026-10-29
6
15
 
7
16
  ### Breaking
package/README.md CHANGED
@@ -4,7 +4,7 @@ The Base UI is a CDN-installable UI kit built with Bootstrap 5 styling and Owl f
4
4
 
5
5
  Its strong points: **no build step** — every component runs straight from a CDN `<script>`/import map, nothing to compile; **modular component design** — each component is a self-contained unit you import or mark up individually, not a monolith; **vanilla JavaScript/TypeScript** — no framework lock-in, no JSX, no compiler-specific syntax to learn; and this combination makes it well suited to building **WYSIWYG website builders**, where components must mount, unmount, and re-render dynamically from user-driven markup or drag-and-drop edits rather than a fixed build-time component tree.
6
6
 
7
- Both APIs load straight from a CDN — jsDelivr or unpkg — no build step, no self-hosting required. The snippets below use the `@latest` tag for readability; pin an exact version instead (e.g. `@1.2.0`, or `@1` to take only non-breaking updates) for any production page, since `@latest` can change what your page loads the moment a new version ships. Pure Base usage:
7
+ Both APIs load straight from a CDN — jsDelivr or unpkg — no build step, no self-hosting required. The snippets below use the `@latest` tag for readability; pin an exact version instead (e.g. `@1.2.1`, or `@1` to take only non-breaking updates) for any production page, since `@latest` can change what your page loads the moment a new version ships. Pure Base usage:
8
8
 
9
9
  ```html
10
10
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.min.css">
@@ -89,13 +89,26 @@ New in 1.1.5 (1.1.6 adds `useTip` to show helper text in an info-icon tooltip):
89
89
 
90
90
  New in 1.1.3: `ApiDoc` (`b-ui="apidoc"`) renders an OpenAPI 3 JSON file as browsable API docs — grouped sidebar, parameters, request bodies, responses, a Try It panel with code samples in 17 languages, and an Authorize dialog. See [ApiDoc](docs/components/apidoc.md), the `apidoc-01` block, and the live demo in [`examples/apidoc/`](examples/apidoc/).
91
91
 
92
+ ## Internationalization
93
+
94
+ New in 1.2.1: an optional, standalone i18n service (gettext-style `.po` catalogs, no Owl or Bootstrap). It is not part of the main bundles.
95
+
96
+ ```js
97
+ import { init, t, loadCatalog } from "https://cdn.jsdelivr.net/npm/@thebase/ui@1.2.1/dist/baseui.i18n.esm.js";
98
+ init({ languages: [{ code: "en", label: "English" }, { code: "vi", label: "Tiếng Việt" }] });
99
+ await loadCatalog(import.meta.url); // fetches ./i18n/vi.po when Vietnamese is picked
100
+ console.log(t("Hello {name}", { name: "An" }));
101
+ ```
102
+
103
+ From npm use `@thebase/ui/i18n`; for a `<script>` tag, `dist/baseui.i18n.min.js` sets `window.thebase.i18n`. See [i18n](docs/i18n.md) and the runnable example in [`examples/i18n/`](examples/i18n/).
104
+
92
105
  ## Theming
93
106
 
94
107
  New in 1.2.0: colour tokens, `--base-radius` and `--b-overlay` live only in the downloadable `baseui-light.css` / `baseui-dark.css` themes (new `--b-success|warning|info` status tokens), and the **Theme** tab of the examples app (`examples/index.html#/theme`) builds a custom pair for you. **Breaking in 1.2.0:** the `bu-` class and `--bu-*` variable prefix is now `b-` (`bu-button` -> `b-button`); see the CHANGELOG migration note. See [Theming](docs/theming.md).
95
108
 
96
109
  ## Release notes
97
110
 
98
- See [CHANGELOG.md](CHANGELOG.md) for the full version history. Current version: **1.2.0**.
111
+ See [CHANGELOG.md](CHANGELOG.md) for the full version history. Current version: **1.2.1**.
99
112
 
100
113
  ## Versioning policy
101
114
 
@@ -114,7 +127,7 @@ What each release type means:
114
127
 
115
128
  Anything prefixed `_`, undocumented internals, and the `docs/`/`examples/` sources are not part of the public API. Neither are the source-level authoring helpers described in [Component Authoring](docs/component-authoring.md) (`optional()`, `slotProps`, the `open-state.js` hooks, `bindBootstrapOverlay()`): they aren't exported from the package and may change in any release. Deprecated APIs keep working until the next major and are flagged in the CHANGELOG first.
116
129
 
117
- Pinning: use an exact version (`@1.2.0`) when you need byte-identical output, or the major range (`@1` on jsDelivr/unpkg, `^1.0.0` in npm) to receive fixes and features without breaking changes. Avoid `@latest` in production — it will move to the next major.
130
+ Pinning: use an exact version (`@1.2.1`) when you need byte-identical output, or the major range (`@1` on jsDelivr/unpkg, `^1.0.0` in npm) to receive fixes and features without breaking changes. Avoid `@latest` in production — it will move to the next major.
118
131
 
119
132
  ## Project Documents
120
133
 
@@ -123,6 +136,7 @@ Use these documents as the canonical project map:
123
136
  - [Usage Guide](docs/usage-guide.md) is the single entry point for integrating the Base UI into a consumer project — start here, then follow its links into the reference docs below.
124
137
  - [Installation](docs/installation.md) covers CDN, npm, self-hosted usage, icon assets, pinned versions, and release guardrails.
125
138
  - [Analytics](docs/analytics.md) documents the optional, standalone cookieless analytics service (`@thebase/ui/analytics`).
139
+ - [i18n](docs/i18n.md) documents the optional, standalone translation service (`@thebase/ui/i18n`): `.po` catalogs, language detection, and the `init`/`t`/`loadCatalog` API.
126
140
  - [Runtime API](docs/runtime-api.md) documents the `window.thebase` global, mounting lifecycle, theming API, and destroy behavior.
127
141
  - [Registry](docs/registry.md) explains `dist/baseui.registry.json`, build files, block metadata, component metadata, and integrity hashes.
128
142
  - [Theming](docs/theming.md) describes `b-theme`, runtime theme overrides, shadcn-aligned tokens, Bootstrap variable mapping, and shared example theme persistence.
@@ -8,7 +8,7 @@
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)):([["&","&amp;"],["<","&lt;"],[">","&gt;"],["'","&#x27;"],['"',"&quot;"],["`","&#x60;"]].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
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(`
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.1";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
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
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
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(`
@@ -0,0 +1,2 @@
1
+ var n={languages:[{code:"en",label:"English"}],defaultLanguage:"en",storageKey:"thebase-lang",queryParam:"lang",catalogDir:"i18n",headDescription:'meta[name="description"]'},g=Object.create(null),i=new Map,r="en",u=!1;function y(e={}){if(u)throw Error("thebase.i18n.init() must be called before the first loadCatalog()");Object.assign(n,e),n.defaultLanguage=e.defaultLanguage||n.languages[0].code}var L=()=>n.languages;function l(e,t){let a=g[e]||e;return t?a.replace(/\{(\w+)\}/g,(s,o)=>t[o]??s):a}function f(e){let t={id:"",str:"",fuzzy:!1},a="";for(let s of e.split(`
2
+ `)){let o=s.trim();if(o.startsWith("#")){t.fuzzy||(t.fuzzy=o.startsWith("#,")&&o.includes("fuzzy"));continue}let c=/^(msgid|msgstr)\s+(".*")$/.exec(o);c?(a=c[1]==="msgid"?"id":"str",t[a]=JSON.parse(c[2])):a&&o.startsWith('"')&&(t[a]+=JSON.parse(o))}return t}function d(e){let t=new Map;for(let a of e.split(/\n\s*\n/)){let s=f(a);s.id&&t.set(s.id,s)}return t}function p(){try{return localStorage.getItem(n.storageKey)}catch{return null}}function m(){let e=new Set(n.languages.map(a=>a.code));return[new URLSearchParams(location.search).get(n.queryParam),p(),...navigator.languages.map(a=>a.slice(0,2))].find(a=>e.has(a))??n.defaultLanguage}async function h(e){let t=await fetch(e).catch(()=>null),a=t?.ok?await t.text():"";for(let s of d(a).values())s.str&&!s.fuzzy&&(g[s.id]=s.str)}function w(e){if(u||(u=!0,r=m(),document.documentElement.lang=r),r===n.defaultLanguage)return Promise.resolve();let t=new URL(`${n.catalogDir}/${r}.po`,e).href;return i.has(t)||i.set(t,h(t)),i.get(t)}var D=()=>r;function E(){document.title=l(document.title);let e=document.querySelector(n.headDescription);e?.setAttribute("content",l(e.getAttribute("content")))}function b(e){try{localStorage.setItem(n.storageKey,e)}catch{}let t=new URL(location.href);t.searchParams.set(n.queryParam,e),location.assign(t)}export{D as currentLanguage,y as init,L as languages,w as loadCatalog,d as parsePo,b as setLanguage,l as t,E as translateHead};
@@ -0,0 +1,2 @@
1
+ (()=>{var p=Object.defineProperty;var m=(t,e)=>{for(var a in e)p(t,a,{get:e[a],enumerable:!0})};var g={};m(g,{currentLanguage:()=>x,init:()=>h,languages:()=>w,loadCatalog:()=>E,parsePo:()=>d,setLanguage:()=>z,t:()=>l,translateHead:()=>k});var n={languages:[{code:"en",label:"English"}],defaultLanguage:"en",storageKey:"thebase-lang",queryParam:"lang",catalogDir:"i18n",headDescription:'meta[name="description"]'},f=Object.create(null),i=new Map,r="en",u=!1;function h(t={}){if(u)throw Error("thebase.i18n.init() must be called before the first loadCatalog()");Object.assign(n,t),n.defaultLanguage=t.defaultLanguage||n.languages[0].code}var w=()=>n.languages;function l(t,e){let a=f[t]||t;return e?a.replace(/\{(\w+)\}/g,(s,o)=>e[o]??s):a}function y(t){let e={id:"",str:"",fuzzy:!1},a="";for(let s of t.split(`
2
+ `)){let o=s.trim();if(o.startsWith("#")){e.fuzzy||(e.fuzzy=o.startsWith("#,")&&o.includes("fuzzy"));continue}let c=/^(msgid|msgstr)\s+(".*")$/.exec(o);c?(a=c[1]==="msgid"?"id":"str",e[a]=JSON.parse(c[2])):a&&o.startsWith('"')&&(e[a]+=JSON.parse(o))}return e}function d(t){let e=new Map;for(let a of t.split(/\n\s*\n/)){let s=y(a);s.id&&e.set(s.id,s)}return e}function L(){try{return localStorage.getItem(n.storageKey)}catch{return null}}function b(){let t=new Set(n.languages.map(a=>a.code));return[new URLSearchParams(location.search).get(n.queryParam),L(),...navigator.languages.map(a=>a.slice(0,2))].find(a=>t.has(a))??n.defaultLanguage}async function D(t){let e=await fetch(t).catch(()=>null),a=e?.ok?await e.text():"";for(let s of d(a).values())s.str&&!s.fuzzy&&(f[s.id]=s.str)}function E(t){if(u||(u=!0,r=b(),document.documentElement.lang=r),r===n.defaultLanguage)return Promise.resolve();let e=new URL(`${n.catalogDir}/${r}.po`,t).href;return i.has(e)||i.set(e,D(e)),i.get(e)}var x=()=>r;function k(){document.title=l(document.title);let t=document.querySelector(n.headDescription);t?.setAttribute("content",l(t.getAttribute("content")))}function z(t){try{localStorage.setItem(n.storageKey,t)}catch{}let e=new URL(location.href);e.searchParams.set(n.queryParam,t),location.assign(e)}window.thebase??(window.thebase={});window.thebase.i18n=g;})();