blue-web 1.36.2 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/701.bundle.js +1 -0
- package/dist/js/776.bundle.js +1 -0
- package/dist/js/actions.js +48 -57
- package/dist/js/color-mode.js +23 -29
- package/dist/js/dialog.js +82 -64
- package/dist/js/edit-view.js +52 -55
- package/dist/js/input-splitted.js +193 -244
- package/dist/js/layout.js +151 -192
- package/dist/js/modal-responsive.js +35 -48
- package/dist/js/odometer.js +132 -131
- package/dist/js/overflow-detector.js +51 -62
- package/dist/js/progress.js +41 -59
- package/dist/js/quick-look.bundle.js +1 -0
- package/dist/js/quick-look.d.ts +15 -0
- package/dist/js/quick-look.js +168 -0
- package/dist/js/read-view.js +125 -91
- package/dist/js/select-list.js +168 -177
- package/dist/js/shared.js +21 -26
- package/dist/js/utils.d.ts +1 -1
- package/dist/js/utils.js +4 -106
- package/dist/merged.scss +87 -9
- package/dist/style.css +75 -7
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +5 -5
- package/dist/style.scss +2 -1
- package/dist/styles/_quick-look.scss +56 -0
- package/package.json +8 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={340(e,t,n){function o(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function r(e){const t="nativeEvent"in e?e.nativeEvent:e;return!0===t.isComposing||229===t.keyCode}n.d(t,{_:()=>r,on:()=>o})},748(e,t,n){n.d(t,{Bd:()=>o,V8:()=>i,un:()=>r});var o="undefined"!=typeof window&&"undefined"!=typeof document;function r(){return o&&(/iP(hone|ad|od)/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)}function i(e){return!!e&&o&&"rtl"===getComputedStyle(e).direction}},393(e,t,n){n.d(t,{NQ:()=>r,Se:()=>c});var o=new WeakMap;function r(e,t){const n=e.ownerDocument.defaultView,r=n?.visualViewport;if(!n||!r)return()=>{};let c=null;const l=r=>{const i=function(e,t){const n=Math.max(0,t.layoutHeight-t.offsetTop-t.height);return Math.abs(t.height-t.layoutHeight)<=1&&o.set(e,t.scale),t.scale>(o.get(e)??1)+.01?0:Math.round(n)}(n,r),s=null!==c&&i!==c;c=i,s&&t?.before(),e.style.setProperty("--keyboard-inset",`${i}px`),e.style.setProperty("--visual-viewport-height",`${Math.round(r.height)}px`),i>0?e.setAttribute("data-keyboard",""):e.removeAttribute("data-keyboard"),s&&t?.after()},u=a.get(n);l(u&&u.layoutHeight-u.offsetTop-u.height<=1?u:i(n,r));const d=function(e,t,n){const{followers:o,stop:r}=s.get(t)??function(e,t){const n=new Set,o=o=>{const r=i(e,t);for(const e of n)e(r,o)};t.addEventListener("resize",o),t.addEventListener("scroll",o);const r={followers:n,stop:()=>{t.removeEventListener("resize",o),t.removeEventListener("scroll",o),s.delete(t)}};return s.set(t,r),r}(e,t);return o.add(n),()=>{o.delete(n)&&!o.size&&r()}}(n,r,l);return()=>{d(),e.style.removeProperty("--keyboard-inset"),e.style.removeProperty("--visual-viewport-height"),e.removeAttribute("data-keyboard")}}function i(e,t){return{width:t.width,layoutHeight:e.innerHeight,height:t.height,offsetTop:t.offsetTop,scale:t.scale}}var s=new WeakMap,a=new WeakMap;function c(e){const t=e?.visualViewport;e&&t&&!a.has(e)&&(a.set(e,i(e,t)),setTimeout(()=>a.delete(e)))}},214(e,t,n){function o(e,t,n){const o=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);e.style.setProperty(t,n);const i=e.style.getPropertyValue(t);return()=>{e.style.getPropertyValue(t)===i&&(o?e.style.setProperty(t,o,r):e.style.removeProperty(t))}}n.d(t,{Uc:()=>d,Vg:()=>a,b1:()=>u,eC:()=>o,ny:()=>p});var r=()=>globalThis[Symbol.for("ui-sdk.styles@1")]??=new WeakMap,i=new WeakMap;function s(e){if(i.has(e))return i.get(e);let t;for(let n=e;n&&!t;n=n.defaultView?.frameElement?.ownerDocument)t=n.head?.querySelector('meta[property="csp-nonce"]');const n=t?t.nonce||t.getAttribute("nonce")||"":null;return i.set(e,n),n}function a(e,t,n){if(!e.head)return;const o=e.defaultView;""===s(e)&&o&&"adoptedStyleSheets"in e?function(e,t,n,o){let i=r().get(e);i||r().set(e,i=new Map);let s=i.get(n);s||i.set(n,s={sheet:new t.CSSStyleSheet,css:""}),s.css!==o&&(s.sheet.replaceSync(o),s.css=o),e.adoptedStyleSheets.includes(s.sheet)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s.sheet])}(e,o,t,n):function(e,t,n){const o=e.getElementById(t);if(o){if(l.get(o)===n)return;return o.textContent!==n&&(o.textContent=n),void l.set(o,n)}const r=e.createElement("style");r.id=t;const i=s(e);i&&(r.nonce=i),r.textContent=n,l.set(r,n);const a=e.head.querySelectorAll(':scope > style[id^="ui-sdk-"]');a.length?a[a.length-1].after(r):e.head.prepend(r)}(e,t,n)}var c,l=new WeakMap;function u(e){a(e,"ui-sdk-hidden",'@layer ui-sdk { :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important } }')}function d(e){"undefined"!=typeof window&&(performance.getEntriesByType("paint").length?c?c.push(e):(c=[e],(window.requestIdleCallback??setTimeout)(()=>{const e=c;c=void 0,e.forEach(e=>e())})):e())}function p(e){let t;const n=requestAnimationFrame(()=>{t=setTimeout(e)});return()=>{cancelAnimationFrame(n),clearTimeout(t)}}}};const t={};function n(o){const r=t[o];if(void 0!==r)return r.exports;const i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.m=e,n.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var r=t[o++],i=t[o++];n.o(e,r)?0===i&&o++:0===i?Object.defineProperty(e,r,{enumerable:!0,value:t[o++]}):Object.defineProperty(e,r,{enumerable:!0,get:i})}else for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((t,o)=>(n.f[o](e,t),t),[])),n.u=e=>e+".bundle.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="blue-web:";n.l=(o,r,i,s)=>{if(e[o])return void e[o].push(r);let a,c;if(void 0!==i){const e=document.getElementsByTagName("script");for(var l=0;l<e.length;l++){const n=e[l];if(n.getAttribute("src")==o||n.getAttribute("data-webpack")==t+i){a=n;break}}}a||(c=!0,a=document.createElement("script"),a.charset="utf-8",n.nc&&a.setAttribute("nonce",n.nc),a.setAttribute("data-webpack",t+i),a.src=o),e[o]=[r];const u=(t,n)=>{a.onerror=a.onload=null,clearTimeout(d);const r=e[o];if(delete e[o],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach(e=>e(n)),t)return t(n)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),c&&document.head.appendChild(a)}})(),n.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;n.g.importScripts&&(e=n.g.location+"");const t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const n=t.getElementsByTagName("script");if(n.length){let t=n.length-1;for(;t>-1&&(!e||!/^http(s?):/.test(e));)e=n[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{const e={320:0};n.f.j=(t,o)=>{let r=n.o(e,t)?e[t]:void 0;if(0!==r)if(r)o.push(r[2]);else{const i=new Promise((n,o)=>r=e[t]=[n,o]);o.push(r[2]=i);const s=n.p+n.u(t),a=new Error,c=o=>{if(n.o(e,t)&&(r=e[t],0!==r&&(e[t]=void 0),r)){const e=o&&("load"===o.type?"missing":o.type),n=o&&o.target&&o.target.src;a.message="Loading chunk "+t+" failed.\n("+e+": "+n+")",a.name="ChunkLoadError",a.type=e,a.request=n,r[1](a)}};n.l(s,c,"chunk-"+t,t)}};const t=(t,o)=>{let[r,i,s]=o;var a,c,l=0;if(r.some(t=>0!==e[t])){for(a in i)n.o(i,a)&&(n.m[a]=i[a]);s&&s(n)}for(t&&t(o);l<r.length;l++)c=r[l],n.o(e,c)&&e[c]&&e[c][0](),e[c]=0},o=self.webpackChunkblue_web=self.webpackChunkblue_web||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var o=["escape-key","outside-press","focus-out","window-blur","back","swipe"];function r(e){return o.includes(e)}var i,s=new Set(["image-load","image-error","imperative","item-removed","unmount","reset","restore","timeout","resize","page-hide"]);function a(e,t){if("agent"===i)return i;if(s.has(e))return"programmatic";if(t){const e=t();return"programmatic"===e&&i?i:e}return i??"programmatic"}function c(e,t){const n=i;i=e;try{return t()}finally{i=n}}function l(e,t={}){const n=()=>!1!==e().dismissible,o=(t,n)=>e().onDismissAttempt?.({reason:t,event:n});return{allows(e,i){const s=t.refusal?.(e)??(r(e)&&!n()?"attempt":void 0);return!s||("attempt"===s&&"focus-out"!==e&&"window-blur"!==e&&(o(e,i),t.refused?.(e)),!1)},sheet:{dismissible:n,onDismissAttempt:e=>o("swipe",e)}}}var u=(e,t)=>!!(4&e.compareDocumentPosition(t)),d=(e,t)=>u(e,t)?-1:1;function p(e){let t=e.length<16?null:e[0].el.parentNode;for(;t&&!e.every(({el:e})=>t.contains(e));)t=t.parentNode;if(t){const n=new Map(e.map(e=>[e.el,e])),o=[],r=e[0].el.ownerDocument.createTreeWalker(t,1);let i=32*e.length;for(let s=t;s&&i--;s=r.nextNode()){const t=n.get(s);if(t&&o.push(t)===e.length)return o}}return e.sort((e,t)=>d(e.el,t.el))}function f(e,t){return p([...e.parts()].filter(e=>e.slot===t&&!!e.el?.isConnected)).map(({el:e,key:t,props:n})=>({el:e,key:t,props:n}))}function h(e,t,n){}var g,m=new WeakMap;function v(e){g&&g.starts.push(e)}function b(e){const t=m.get(e);if(!t||t.stops)return;const n=t.stops=[];for(const e of t.starts){const t=e();t&&n.push(t)}}function y(e){const t=m.get(e),n=t?.stops;n&&(t.stops=void 0,n.forEach(e=>e()))}var w=n(748),k=["a[href]","area[href]","button","input:not([type='hidden'])","select","textarea","iframe","summary","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])","[tabindex]"].join(",");function S(e){return e instanceof HTMLElement&&!(e.tabIndex<0)&&(!e.matches(":disabled")&&!e.closest("[inert]")&&(!(e.checked?[]:A(e)).some(e=>e.checked&&S(e))&&("function"==typeof e.checkVisibility?e.checkVisibility({visibilityProperty:!0}):e.getClientRects().length>0&&"hidden"!==getComputedStyle(e).visibility)))}function A(e){return e instanceof HTMLInputElement&&"radio"===e.type&&e.name?(e.form?Array.from(e.form.elements):Array.from(e.getRootNode().querySelectorAll(`input[name="${CSS.escape(e.name)}"]`))).filter(t=>t instanceof HTMLInputElement&&"radio"===t.type&&t.name===e.name&&t.form===e.form):[]}function O(e){return Array.from(e.querySelectorAll(k)).filter(S)}function E(e){const t=e=>[...e.filter(e=>e.index>0).sort((e,t)=>e.index-t.index),...e.filter(e=>e.index<=0)].flatMap(e=>e.stops),n=(e,o)=>{for(const r of e){const e=r.hasAttribute("tabindex")?r.tabIndex:0;if(r.hasAttribute("inert")||r.shadowRoot&&e<0)continue;const i=r.matches(k)&&!r.shadowRoot?.delegatesFocus&&S(r)?[r]:[],s=r instanceof HTMLSlotElement?r.assignedElements():[];if(r.shadowRoot||s.length){const a=[];n(r.shadowRoot?.children??s,a),o.push({index:e,stops:[...i,...t(a)]})}else o.push({index:e,stops:i}),n(r.children,o)}},o=[];return n(e.children,o),o.flatMap(e=>e.stops)}var C=[["button","button"],["a[href]","link"],["input[type=checkbox][switch]","switch"],["input[type=checkbox]","checkbox"],["input[type=radio]","radio"],["input[type=range]","slider"],["dialog","dialog"],["h1, h2, h3, h4, h5, h6","heading"]],M=new Set(["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","treeitem"]);function P(e){if(e.hasAttribute("hidden")||"true"===e.getAttribute("aria-hidden"))return!0;const t=e.ownerDocument.defaultView?.getComputedStyle(e);return"none"===t?.display||"hidden"===t?.visibility}function T(e){return(e.getAttribute("aria-labelledby")??"").split(/\s+/).map(t=>t&&function(e,t){const n=e.getRootNode();return n.getElementById?.(t)??null}(e,t)).filter(e=>!!e).map(e=>e.getAttribute("aria-label")??D(e,!0)).join(" ")}function x(e){return"img"===e.localName?e.getAttribute("alt")??"":"svg"!==e.localName?"":[...e.children].find(e=>"title"===e.localName)?.textContent??""}function j(e,t,n){if(e.matches("input, select, textarea"))return"";const o=!t&&T(e)||e.getAttribute("aria-label")?.trim()||x(e);if(o)return` ${o} `;if("svg"===e.localName)return"";const r=D(e,t,n),i=e.getAttribute("title");return r||(i?` ${i} `:"")}function D(e,t=!1,n=P(e)){let o="";for(const r of e.childNodes)r.nodeType===Node.TEXT_NODE?o+=r.nodeValue:r.nodeType!==Node.ELEMENT_NODE||!n&&P(r)||(o+=j(r,t,n));return o}var L=e=>e.replace(/\s+/g," ").trim(),W=e=>[...e.labels??[]].map(e=>D(e)).join(" "),$=[T,e=>e.getAttribute("aria-label")??"",W,x,e=>M.has(function(e){const t=e.getAttribute("role")?.trim().split(/\s+/)[0];return t||(C.find(([t])=>e.matches(t))?.[1]??"")}(e))?D(e):"",e=>e.getAttribute("title")??""];function N(e){return{"data-open":e?"":void 0,"data-closed":e?void 0:""}}$.filter(e=>e!==W);var F=new WeakMap;function q(e,t,n){!function(e,t){let n=F.get(e);n||F.set(e,n=[]),n.push(t)}(e.store,{from:"options",keys:t,derive:n})}var V,R=n(340);function B(){return w.Bd&&"function"==typeof HTMLElement.prototype.showPopover}function I(e=document){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function H(e){const t=[e];let n=e;for(;n;){const e=n.assignedSlot??n.parentNode??n.host;e&&e!==n.parentNode&&t.push(e),n=e}return t}function U(e,t){return H(t).some(t=>e.contains(t))}function z(){return V??=w.Bd&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}var K={alt:"Alt",option:"Alt",opt:"Alt",shift:"Shift",ctrl:"Control",control:"Control",cmd:"Meta",command:"Meta",meta:"Meta",backspace:"Backspace",delete:"Delete",del:"Delete",enter:"Enter",return:"Enter",escape:"Escape",esc:"Escape",tab:"Tab",space:"Space",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",arrowup:"ArrowUp",arrowdown:"ArrowDown",arrowleft:"ArrowLeft",arrowright:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"};function X(e,t=z()){return e.split("+").map(e=>{const n=e.toLowerCase();return"mod"===n?t?"Meta":"Control":K[n]?K[n]:1===e.length?e.toUpperCase():e[0].toUpperCase()+e.slice(1)}).join("+")}var Y={Meta:"⌘",Control:"⌃",Alt:"⌥",Shift:"⇧",Backspace:"⌫",Delete:"⌦",Enter:"↩",Escape:"⎋",Tab:"⇥",Space:"␣",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",PageUp:"⇞",PageDown:"⇟",Home:"↖",End:"↘"},_={Control:"Ctrl",Delete:"Del",Escape:"Esc",ArrowUp:"Up",ArrowDown:"Down",ArrowLeft:"Left",ArrowRight:"Right"};function Q(e,t=z()){const n=X(e,t).split("+");return`${t?n.map(e=>Y[e]??e).join(""):n.map(e=>_[e]??e).join("+")}`}var Z=[new Map,new Map];function G(e,t,n=z()){const o=Z[+n];let r=o.get(t);return r||o.set(t,r=X(t,n).split("+")),function(e,t){const n=1===e.key.length?e.key.toLowerCase():e.key;return"Space"===t?" "===n:/^[A-Z0-9]$/.test(t)?n===t.toLowerCase()||!/^[a-z0-9]$/.test(n)&&e.code===(/\d/.test(t)?`Digit${t}`:`Key${t}`):n.toLowerCase()===t.toLowerCase()}(e,r.at(-1))&&e.metaKey===r.includes("Meta")&&e.ctrlKey===r.includes("Control")&&e.altKey===r.includes("Alt")&&e.shiftKey===r.includes("Shift")}function J(e){return/(^|\+)(Meta|Control|Alt)(\+|$)/.test(X(e,!0))}var ee=globalThis[Symbol.for("ui-sdk.layers@2")]??={stack:[],listening:new Map};function te(){return ee.persistent??=new Set}function ne(e){for(const t of te())if(U(t,e))return!0;return!1}function oe(e){return re().some(t=>(t.order??0)>e)}function re(){return ee.stack.filter(e=>e.active())}function ie(){return re()}function se(e,t,n){return ae(e,H(t),n)}function ae(e,t,n){return!!t.some(t=>e.contains(t,n))||re().some(o=>o.parent===e&&ae(o,t,n))}function ce(e,t){let n,o,r=!1;function i(e,t,n){const o=[];let r=!1;if(ne(t))return{dismissed:o,consume:r};for(const i of[...ee.stack].reverse())if(i.active()){if(se(i,t,e))break;if(!1!==i.modal&&(r=!0),o.push(i),i.shield)break}else if(i.exiting?.()){if(se(i,t,e))break;if(!1===i.modal)continue;i.overBackdrop?.(n.x,n.y)&&(r=!0);break}return{dismissed:o,consume:r}}function s(e,t,n){const{dismissed:o,consume:r}=i(e,t,n);for(const t of o)t.onOutsidePress?.(e);return r}const a=(0,R.on)(t,"pointerdown",e=>{r=!1;const t=e.composedPath()[0];if("touch"===e.pointerType)return void(n={x:e.clientX,y:e.clientY,target:t});if(n=void 0,o=void 0,function(e,t){if(!(t instanceof Element))return!1;if(t===t.ownerDocument.documentElement)return e.clientX>=t.clientWidth||e.clientY>=t.clientHeight;if(0===t.clientWidth&&0===t.clientHeight)return!1;const n=t.getBoundingClientRect(),o=getComputedStyle(t);return function(e,t){const{x:n,y:o}=e,{borders:r}=t;return n>=r.left&&n<t.width-r.right&&o>=r.top&&o<t.height-r.bottom&&!(n>=t.clientLeft&&n<t.clientLeft+t.clientWidth&&o>=t.clientTop&&o<t.clientTop+t.clientHeight)}({x:e.clientX-n.left,y:e.clientY-n.top},{width:n.width,height:n.height,clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,borders:{top:parseFloat(o.borderTopWidth)||0,right:parseFloat(o.borderRightWidth)||0,bottom:parseFloat(o.borderBottomWidth)||0,left:parseFloat(o.borderLeftWidth)||0}})}(e,t))return;const s={x:e.clientX,y:e.clientY},{dismissed:a,consume:c}=i(e,t,s);if("click"===a[0]?.outsidePress){if(0!==e.button)return;return o={layer:a[0],target:t,point:s},void(c&&(e.preventDefault(),r=!0))}c&&(e.preventDefault(),r=!0);for(const t of a)t.onOutsidePress?.(e)},{capture:!0}),c=(0,R.on)(t,"pointerup",e=>{const t=o;o=void 0,t&&t.layer.active()&&(se(t.layer,e.composedPath()[0],e)||s(e,t.target,t.point))},{capture:!0}),l=(0,R.on)(t,"click",e=>{if(r&&e.detail)return r=!1,e.preventDefault(),void e.stopPropagation();if(r=!1,!n)return;const t=n;n=void 0,Math.hypot(e.clientX-t.x,e.clientY-t.y)>10||s(e,t.target,{x:t.x,y:t.y})&&(e.preventDefault(),e.stopPropagation())},{capture:!0}),u=(0,R.on)(e,"keydown",t=>fe(e,t)),d=(0,R.on)(t,"blur",e=>{for(const t of re().reverse())t.onBlur?.(e)});return()=>{if(a(),c(),u(),d(),!r)return l();const e=()=>(l(),n(),o()),n=(0,R.on)(t,"pointerdown",e,{capture:!0}),o=(0,R.on)(t,"click",e,{capture:!0})}}function le(e,t){return se(e,t)}function ue(e){const t=H(e);return re().reverse().find(e=>t.some(t=>e.contains(t)))}function de(){return ee.closed}function pe(e){return e.el?.ownerDocument??document}function fe(e,t,n){if("Escape"!==t.key||t.defaultPrevented||(0,R._)(t))return;const o=re().filter(t=>pe(t)===e).at(-1);!o?.onEscape||n&&o!==n||(ee.escapeAt=performance.now(),o.onEscape(t))}var he=n(214),ge=globalThis[Symbol.for("ui-sdk.modal@2")]??={holders:new WeakMap,thaw:new WeakMap,inert:new WeakMap};var me=new WeakMap;function ve(e){const t=e.defaultView??window,n=function(e,t){const{body:n,documentElement:o}=e;return n&&"visible"!==t.getComputedStyle(o).overflowY&&/auto|scroll/.test(t.getComputedStyle(n).overflowY)?n:o}(e,t),o=t.getComputedStyle(n);return{scroller:n,gutter:be(n,e,t,o),padding:parseFloat(o.paddingRight)||0}}function be(e,t,n,o){if(e===t.documentElement)return n.innerWidth-e.clientWidth;const r=(parseFloat(o.borderLeftWidth)||0)+(parseFloat(o.borderRightWidth)||0);return e.offsetWidth-e.clientWidth-r}function ye(e,t){const n=t.getComputedStyle(e),o=/auto|scroll/.test(n.overflowY)&&e.scrollHeight>e.clientHeight,r=/auto|scroll/.test(n.overflowX)&&e.scrollWidth>e.clientWidth;return o||r}function we(e,t){const{body:n,documentElement:o}=e.ownerDocument;for(let r=e;r&&r!==n&&r!==o;r=r.parentElement)if(ye(r,t))return!0;return!1}var ke="@layer ui-sdk { [data-scroll-guard], [data-scroll-guard] * { overscroll-behavior: contain } }";function Se(e){const t=e.parentNode;return t instanceof ShadowRoot?t.host:t}function Ae(e){const t=e[0]?.ownerDocument??document,n=[...e,...Array.from(t.querySelectorAll('[aria-live]:not([aria-live="off"]),[role="status"],[role="alert"],[role="log"],output')),...[...te()].filter(e=>e.isConnected)],o=n.filter(e=>!n.some(t=>t!==e&&t.contains(e))),r=new Set;for(const e of o)for(let t=e;t;t=Se(t))r.add(t);const i=[];for(const e of o)for(let n=e;n&&n!==t.body;n=Se(n))for(const e of Array.from(n.parentNode?.children??[])){if(r.has(e)||!(e instanceof HTMLElement))continue;const t=ge.inert.get(e)??(e.inert?1/0:0);0===t&&(e.inert=!0),t!==1/0&&ge.inert.set(e,t+1),i.push(e)}return()=>{for(const e of i){const t=ge.inert.get(e);void 0!==t&&(t<=1?(e.inert=!1,ge.inert.delete(e)):ge.inert.set(e,t-1))}}}var Oe="pointer",Ee=!1,Ce=!1,Me="mouse",Pe=!1,Te=()=>Pe=!1,xe=null,je=()=>xe=null;function De(e){"Enter"!==e.key&&" "!==e.key||(xe=e.target,setTimeout(je))}function Le(e){De(e);const t=e.metaKey||e.ctrlKey||e.altKey||/^(Meta|Control|Alt|Shift)$/.test(e.key);"Tab"!==e.key&&t||(Oe="keyboard")}function We(e){if(Oe="pointer",!("pointerType"in e))return void(Pe||(Me="touch"));Pe=!0,setTimeout(Te);const t=e.pointerType;Me=Fe(e)?"virtual":"touch"===t||"pen"===t?t:"mouse"}function $e(){Ee||"undefined"==typeof document||(Ee=!0,document.addEventListener("keydown",Le,!0),document.addEventListener("keyup",De,!0),document.addEventListener("pointerdown",We,!0),document.addEventListener("touchstart",We,{capture:!0,passive:!0}),window.addEventListener("blur",e=>{e.target,window}))}function Ne(){Ee||Ce||(Ce=!0,queueMicrotask($e))}function Fe(e){return"pointermove"!==e.type&&(0===e.width&&0===e.height&&0===e.pressure||"mouse"===e.pointerType&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail)}var qe=()=>"keyboard"===Oe?"keyboard":Me;function Ve(e){if($e(),!e)return qe();if(!(e=>e.isTrusted)(e))return"programmatic";if(e.type.startsWith("key"))return"keyboard";if(e.type.startsWith("touch"))return"touch";if("click"===e.type)return function(e){return e.detail>0?Me:xe&&xe.contains(e.target)?"keyboard":"virtual"}(e);const t=e.pointerType;return"mouse"===t||"touch"===t||"pen"===t?Fe(e)?"virtual":t:"button"in e?Me:qe()}var Re={tab:"close",blur:"always",outsidePress:"pointerdown",shield:!1,keepTrigger:!0,focusOnMount:!1,dismissOnFocusLoss:!0,closeWatcher:!1,blocking:!1,movesFocus:!0},Be=e=>e.trapFocus?"trap":"flow",Ie={menu:Re,select:Re,combobox:{...Re,tab:"native"},popover:{...Re,tab:Be,blur:"iframe"},dialog:{...Re,tab:Be,blur:"never",outsidePress:"click",shield:!0,keepTrigger:!1,focusOnMount:!0,dismissOnFocusLoss:!1,closeWatcher:!0,blocking:e=>e.inertAndLock},tooltip:{...Re,tab:"native",movesFocus:!1},hoverCard:{...Re,tab:"flow"},navigationMenu:{...Re,tab:"flow",blur:"never"}},He=()=>globalThis[Symbol.for("ui-sdk.popup-elements@1")]??=new WeakMap;function Ue(e){const t=He();t.set(e,(t.get(e)??0)+1);let n=!1;return()=>{if(n)return;n=!0;const o=(t.get(e)??1)-1;o>0?t.set(e,o):t.delete(e)}}function ze(e){const t=He();for(let n=e;n;n=n.parentNode??n.host??null)if(t.has(n))return!0;return!1}var Ke=new WeakMap;function Xe(e,t){Ke.get(e)?.();const n=e.getAnimations?.({subtree:!0}).filter(Ye),o=n?.every(t=>_e(t)!==e);if(e.setAttribute("data-starting-style",""),n&&o)for(const t of e.getAnimations({subtree:!0}))Ye(t)&&!n.some(e=>Qe(t,e))&&t.finish();let r,i;const s=requestAnimationFrame(()=>i=setTimeout(()=>{e.removeAttribute("data-starting-style"),t&&(r=Je(e,t))}));return()=>{cancelAnimationFrame(s),clearTimeout(i),r?.(),e.removeAttribute("data-starting-style")}}var Ye=e=>"transitionProperty"in e,_e=e=>e.effect?.target,Qe=(e,t)=>_e(e)===_e(t)&&e.transitionProperty===t.transitionProperty;function Ze(e){return e.split(",").map(e=>{const t=parseFloat(e)||0;return e.trim().endsWith("ms")?t/1e3:t})}function Ge(e){const t=(e,t,n="1")=>{const o=Ze(e),r=Ze(t),i=n.split(",").map(e=>"infinite"===e.trim()?1:parseFloat(e)||1);return o.map((e,t)=>1e3*(e*(i[t%i.length]??1)+(r[t%r.length]??0)))};return Math.max(0,...t(e.transitionDuration,e.transitionDelay),...t(e.animationDuration,e.animationDelay,e.animationIterationCount))}function Je(e,t){let n=!1;const o=e.getAnimations({subtree:!0}),r=()=>{n||(n=!0,clearTimeout(i),t())},i=o.length?setTimeout(r,Math.max(function(e){return Math.max(Ge(getComputedStyle(e)),Ge(getComputedStyle(e,"::backdrop")))}(e),function(e){let t=0;for(const n of e){const e=n.effect?.getComputedTiming(),o=Number(e?.endTime);e&&Number.isFinite(o)&&(t=Math.max(t,o-(Number(e.localTime)||0)))}return t}(o))+50):void 0;return o.length?Promise.allSettled(o.map(e=>e.finished)).then(r):r(),()=>{n=!0,clearTimeout(i)}}function et(e,t){e.toggleAttribute("data-open",t),e.toggleAttribute("data-closed",!t)}var tt={mouse:"pointer",pen:"pointer",touch:"touch",keyboard:"keyboard",virtual:"keyboard",programmatic:"imperative",agent:"imperative"};var nt=new Set(["text","search","url","tel","email","password"]);function ot(e,t){for(const n of e){const e=n();if(e&&t(e))return e}}function rt(e,t,n,o=""){const r=null==e.trigger||e.trigger===o,i=e.open&&r;return{id:r?`${t}-trigger`:void 0,"aria-haspopup":n,"aria-expanded":String(i),"aria-controls":r&&e.mounted?`${t}-content`:void 0,...N(i)}}function it(e){const t=e.disabled&&e.focusableWhenDisabled;return{disabled:e.disabled&&!t?"":void 0,"aria-disabled":t?"true":void 0,"data-disabled":e.disabled?"":void 0}}function st(e,t){return{id:`${t}-content`,tabindex:"-1",hidden:e.mounted?void 0:"",...N(e.open)}}function at(e){return e.isConnected&&!e.closest("[inert]")}function ct(e){const t=e.getRangeAt(0).cloneRange();return{range:t,backward:!t.collapsed&&e.anchorNode===t.endContainer&&e.anchorOffset===t.endOffset}}function lt(){const e=I();return!e||e===e.ownerDocument.body||!at(e)||!1===e.checkVisibility?.()}function ut(e,t){return e.x<t.left||e.x>t.right||e.y<t.top||e.y>t.bottom}function dt(e){return e.getRootNode().activeElement}var pt=()=>globalThis[Symbol.for("ui-sdk.popover-reset@2")]??=new WeakMap;function ft(e,t){let n=pt().get(e);n||pt().set(e,n={selectors:new Set,css:""});const o=n.selectors;t.every(e=>o.has(e))||(t.forEach(e=>o.add(e)),n.css=`@layer ui-sdk { :where(${[...o].map(e=>`${e}[popover]`).join(", ")}) { inset: auto; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; color: inherit; background: none } }`),n.css&&(0,he.Vg)(e,"ui-sdk-popover-reset",n.css)}var ht=new WeakSet;var gt=new WeakMap,mt=new WeakSet,vt=new WeakMap;function bt(e,t){for(let n=e;n;n=n.parent)if(n===t||mt.has(n)&&(n.order??0)>(t.order??0))return!0;return!1}function yt(e){const t=function(e,t){const n={...Ie[e]};for(const e of Object.keys(Re)){const o=t[e];void 0!==o&&Object.assign(n,{[e]:o})}return n}(e.preset,e),n=()=>"function"==typeof t.tab?t.tab(e.modal()):t.tab,{store:o}=e;let r,i,s,a,c,l,d,p,f=o.get().open?"initial":"imperative",h=t.focusOnMount&&o.get().open,g=!1,m=!1,v=!1,b=!0,y=o.get().open,k=()=>{},S=[];const C=e.returnTrigger??e.trigger;let M,P,T,x;const j=(t,n)=>e.onOpenChangeComplete?.(t,n),D=e=>e||!!i?.el&&w.Bd;function L(e){d=e;const t=e?.isContentEditable?e.ownerDocument.getSelection():null;p=t?.rangeCount&&e.contains(t.anchorNode)?ct(t):void 0;const n=d&&ue(d),o=n?void 0:de();k=n?.returnTarget??(()=>o)}!function(e){q(e,["mounted"],(e,t)=>{return"open"in e&&e.open!==t.open?(n=!!e.open,D(n)===n?{mounted:n}:void 0):void 0;var n})}({store:o});let W=o.get().open;function $(t,n,o=k,r=!1){const i=()=>o(n,r),s=()=>function(e,t=!1){const n=S[0]?.node;if(n?.isConnected&&!e?.contains(n)){for(const t of[...S.slice(1).map(e=>e.node),n.ownerDocument.body]){const o=O(t).filter(t=>!e?.contains(t)),r=o.find(e=>u(n,e)&&!n.contains(e))??o.filter(e=>u(e,n)).pop();if(r)return r}return}const o=S.findIndex((e,t)=>!e.node.isConnected&&S[t+1]?.node.isConnected);if(-1===o)return;const{next:r,previous:i}=S[o],s=S[o+1].node,a=e=>!!e?.isConnected&&e.parentNode===s,c=a(r)?r.previousElementSibling===i:!r&&(i?a(i)&&!i.nextElementSibling:!s.firstElementChild);if(t&&!c)return;const l=(e,t)=>e.contains(t)||u(e,t),d=a(r)?e=>l(r,e):a(i)?e=>u(i,e)&&!i.contains(e):e=>l(s,e);for(const{node:t}of S.slice(o+1)){const n=O(t).filter(t=>!e?.contains(t)),o=a(i)?n.filter(e=>!l(i,e)||i.contains(e)).pop():void 0,r=n.find(d)??o??n[0];if(r)return r}}(t,r);return y?[()=>d,i,C,s,e.trigger]:[C,()=>d,i,s,e.trigger]}o.subscribe(()=>{const{open:n}=o.get();if(n===W)return;if(W=n,n){if(x?.(!0),e.onOpenChange?.(!0),a?.(),a=void 0,i)for(const e of[i.el,i.backdrop])e&&et(e,!0);h=!0,g=!0,b=!0;const t=w.Bd?I():null;L(t&&t!==t.ownerDocument.body?t:void 0);const n=C();y="imperative"===f||v&&!!d&&!ue(d)&&!de()&&!(n&&U(n,d));const s=!!i;return o.set({mounted:!0}),void(r?(s&&_(),K()):w.Bd||(g=!1,j(!0)))}const u=t.movesFocus&&b;b=!0,h=!1,g=!1,f="imperative",v=!1;const m=x?.(!1),S=i?.el;var A;s&&(A=F(),ee.closed=A,setTimeout(()=>{ee.closed===A&&(ee.closed=void 0)}));const O=k,E=p;if(p=void 0,!S||!w.Bd)return e.onOpenChange?.(!1,m),o.set({mounted:!1}),void j(!1,m);const M=I(),P=e.trigger(),T=!M||M===S.ownerDocument.body||U(S,M)||!!s&&le(s,M)&&!(P&&U(P,M));e.onOpenChange?.(!1,m),r?.config.onClose?.();const D=ee.pushed??0,$=[S,...i?.backdrop?[i.backdrop]:[]];let N=$.length;const q=$.map(e=>(et(e,!1),function(e,t){Ke.get(e)?.(),e.removeAttribute("data-starting-style"),e.setAttribute("data-ending-style","");const n=e.hasAttribute("inert");e.setAttribute("inert","");const o=e.ownerDocument?.defaultView?.MutationObserver;let r=!1;const i=o&&new o(()=>r=!0);i?.observe(e,{attributeFilter:["inert"]});let s=0;const a=()=>{cancelAnimationFrame(s),Ke.delete(e),e.removeAttribute("data-ending-style"),r||=!!i?.takeRecords().length,i?.disconnect(),r||e.toggleAttribute("inert",n)};let c=!1;const l=Je(e,()=>{if(!c)return a(),t();Ke.set(e,a),s=requestAnimationFrame(()=>{s=requestAnimationFrame(a)}),t()});return c=!0,()=>{l(),a()}}(e,()=>{--N>0||(a=void 0,o.set({mounted:!1}),_(),j(!1,m))})));if(N>0&&(a=()=>q.forEach(e=>e())),c?.(),c=void 0,l?.(),l=void 0,!u||!T)return;if(!0===u){V(S,O,!1,E);const e=I();return void setTimeout(()=>{e&&!e.isConnected&<()&&!oe(D)&&V(S,O)})}if("unless-moved"===u)return void queueMicrotask(()=>{const e=I();e&&e!==S.ownerDocument.body&&!U(S,e)||oe(D)||V(S,O,!1,E)});const B=()=>{H(),clearTimeout(z),setTimeout(()=>{const e=I();e&&e!==S.ownerDocument.body||V(S,O,!1,E)})},H=(0,R.on)(window,"pointerup",B,{capture:!0}),z=setTimeout(B,1e3)});let N=!1;function F(e=at,t=!1){if(!N){N=!0;try{return ot($(i?.el,e,k,t),e)}finally{N=!1}}}function V(t,n,o=!1,r,i=e.finalFocus?.()??"trigger"){if("none"===i)return;const s=e=>{if(!at(e)||t.contains(e))return!1;const n=e.ownerDocument.getSelection(),o=r&&e===d?n?.rangeCount&&e.contains(n.anchorNode)?ct(n):r:void 0;if(function(e){$e();try{e.focus({preventScroll:!0})}finally{}}(e),I()!==e)return!1;if(o&&e.contains(o.range.startContainer)){const{startContainer:e,startOffset:t,endContainer:r,endOffset:i}=o.range;o.backward?n?.setBaseAndExtent(r,i,e,t):n?.setBaseAndExtent(e,t,r,i)}return!0},a=$(t,s,n,o);"trigger"!==i&&a.unshift(()=>{return e=i,n=t.ownerDocument,"function"==typeof e?e()??void 0:"string"==typeof e?n.querySelector(e)??void 0:e;var e,n}),ot(a,s)}function H(e){if(!(h&&i&&o.get().open&&t.movesFocus))return;h=!1;const n="initial"===f&&t.focusOnMount?"auto":function(e){return"initial"===e||"hover"===e?"none":"touch"===e?"popup":"auto"}(f);if("none"===n)return;const r=()=>{if(!i||!o.get().open)return;const t="popup"===n?i.el:e?.();var r;t&&(function(e){$e();try{e.focus({preventScroll:!0})}finally{}}(t),"input"===(r=t).localName&&nt.has(r.type)&&r.value&&"true"!==r.getAttribute("aria-expanded")&&r.select())};m?requestAnimationFrame(r):r()}function z(r,a){const u=[],p=e.trigger(),m=a.host?.()??r;if("initial"===f&&!d){const e=I();L(e&&e!==e.ownerDocument.body&&!U(r,e)?e:void 0)}r.removeAttribute("hidden"),m.removeAttribute("hidden");const v=i?.backdrop;if(v){const e=X(v,a.inline);u.push(()=>{e(),Y(v)})}if(!a.inline){m.setAttribute("popover","manual");try{m.showPopover()}catch{}}if(a.position&&e.position){const t=e.position(()=>a.anchor?.()??e.trigger(),r,a.position);M=t.place,P=t.follow,u.push(t,()=>M=P=void 0),a.rendered&&u.push(a.rendered(t.follow))}a.inline||B()||m.style.zIndex||(m.style.zIndex="2147483000"),u.push(Xe(r,g?()=>{g=!1,j(!0)}:void 0)),Ne();let b=e.modal();const y=t.blur,k=e.persistent?.()??[],A=C()??(!p&&d?.isConnected?d:void 0);!A&&p||(S=[]);for(let e=A??null;e&&e!==r.ownerDocument.body;e=e.parentElement)S.push({node:e,next:e.nextElementSibling,previous:e.previousElementSibling});const E={parent:e.parent?.()??(p&&ue(p)),active:()=>o.get().open,exiting:()=>!o.get().open&&o.get().mounted,modal:b.consumeOutsidePress,blocking:"function"==typeof t.blocking?t.blocking(b):t.blocking,outsidePress:t.outsidePress,shield:t.shield,component:e.owner?.component,id:e.owner?.id,el:r,contains:(t,n)=>r.contains(t)&&!((e,t)=>e===r&&!!t&&"clientX"in t&&ut({x:t.clientX,y:t.clientY},r.getBoundingClientRect()))(t,n)||k.some(e=>e.contains(t))||(e.contains?e.contains(t,n):!!e.trigger()?.contains(t)),overBackdrop:(e,t)=>!!i?.backdrop&&!ut({x:e,y:t},i.backdrop.getBoundingClientRect())&&ut({x:e,y:t},r.getBoundingClientRect()),returnTarget:F,onOutsidePress:t=>{const n=t.composedPath()[0];var o;e.close("outside-press",{event:t,focus:(o={type:t.type,focusable:!!n?.closest?.("a[href],button,input,select,textarea,summary,[tabindex],[contenteditable]"),consumed:b.consumeOutsidePress},!(o.focusable&&!o.consumed)&&("pointerdown"!==o.type||"later"))})},onEscape:t=>{t.preventDefault(),e.onEscape?e.onEscape(t):e.close("escape-key",{event:t,focus:!0})},onBlur:"never"===y?void 0:"always"===y?t=>e.close("window-blur",{event:t,focus:!1}):t=>setTimeout(()=>{const n=dt(r)??r.ownerDocument.activeElement;"IFRAME"!==n?.tagName||r.contains(n)||e.close("focus-out",{event:t,focus:!1})})};s=E,gt.set(E,[r,...v?[v]:[]]),u.push(function(e){ee.pushed=(ee.pushed??0)+1,e.order=ee.pushed,ee.stack.push(e);const t=function(e){const t=e.defaultView;if(!t)return()=>{};let n=ee.listening.get(e);n||ee.listening.set(e,n={layers:0,stop:ce(e,t)});const o=n;return o.layers++,()=>{--o.layers>0||(ee.listening.delete(e),o.stop())}}(pe(e));let n=!1;return()=>{if(n)return;n=!0;const o=ee.stack.indexOf(e);-1!==o&&ee.stack.splice(o,1),t()}}(E)),vt.set(E,{inside:e=>e.contains(r)||!!p&&e.contains(p),again:()=>{const e=I();_();for(const e of[m,v])try{e?.hidePopover()}catch{}K(),e&&e!==I()&&e.focus({preventScroll:!0})}}),b.inertAndLock&&mt.add(E);for(const t of[e.onShow,a.onShow]){const e=t?.(E);e&&u.push(e)}let x,D,W;const $=()=>{const e=[r,...i?.backdrop?[i.backdrop]:[],...k];p&&t.keepTrigger&&e.push(p);for(const t of ie())t!==E&&bt(t,E)&&e.push(...gt.get(t)??[]);x=function(e=document,t){const n={};let o=ge.holders.get(e);o||ge.holders.set(e,o=new Set),o.size||ge.thaw.set(e,function(e){const{scroller:t,gutter:n,padding:o}=me.get(e)??ve(e),r=function({scrollbar:e,gutter:t,padding:n}){const o={overflow:"hidden","scroll-behavior":"auto"};return e>0&&(t?o["scrollbar-gutter"]="stable":o["padding-right"]=`${n+e}px`),o}({scrollbar:n,gutter:"undefined"!=typeof CSS&&CSS.supports("scrollbar-gutter","stable"),padding:o}),i=Object.entries(r).map(([e,n])=>(0,he.eC)(t,e,n));return n>0&&i.push((0,he.eC)(e.documentElement,"--scrollbar-width",`${n}px`)),()=>i.forEach(e=>e())}(e)),o.add(n);const r=t&&(0,w.un)()?function(e){const t=e.ownerDocument,n=t.defaultView??window;(0,he.Vg)(t,"ui-sdk-scroll-guard",ke);const o=!e.hasAttribute("data-scroll-guard");o&&e.setAttribute("data-scroll-guard","");let r="browser";const i=(0,R.on)(t,"touchstart",e=>{const o=e.target instanceof Element?e.target:null;var i;i={fingers:e.touches.length,zoomed:1!==(n.visualViewport?.scale??1),scroller:!!o&&we(o,n),slider:!!o?.closest('input[type="range"]'),selecting:"Range"===t.getSelection()?.type},r=i.fingers>1||i.zoomed?"browser":i.scroller||i.slider||i.selecting?"element":"page"},{capture:!0,passive:!0}),s=(0,R.on)(t,"touchmove",e=>{"page"===r&&e.cancelable&&e.preventDefault()},{passive:!1});return()=>{i(),s(),o&&e.removeAttribute("data-scroll-guard")}}(t):void 0;return()=>{o.delete(n)&&(r?.(),o.size||(ge.thaw.get(e)?.(),ge.thaw.delete(e)))}}(r.ownerDocument,r);const n=function(e){let t=e,n=Ae(t),o=!1;const r=e=>{const o=n;t=e,n=Ae(e),o()};return Object.assign(()=>{o||(o=!0,n())},{keep:e=>o?()=>{}:(r([...t,e]),()=>{o||r(t.filter(t=>t!==e))})})}(e);E.keep=n.keep,c=D=n},N=()=>{W?.(),D?.(),x?.(),c===D&&(c=void 0),D=x=E.keep=void 0};b.inertAndLock&&(W=(0,he.ny)(()=>{if(W=void 0,!o.get().open)return;const e=I();$(),"trap"===n()&&e&&!at(e)&&(h=!0,H(a.initialFocus))})),T=()=>{const n=e.modal();E.modal=n.consumeOutsidePress,E.blocking="function"==typeof t.blocking?t.blocking(n):t.blocking,n.inertAndLock?mt.add(E):mt.delete(E),n.inertAndLock&&!b.inertAndLock&&o.get().open?$():!n.inertAndLock&&b.inertAndLock&&N(),b=n},u.push(N,()=>T=void 0);const q=new Set(ie());for(let e=E.parent;e;e=e.parent)q.add(e);q.delete(E);for(const e of q)if(e.keep&&bt(E,e))for(const t of[r,...v?[v]:[]])u.push(e.keep(t));if("flow"===n()&&t.dismissOnFocusLoss){let t;u.push((0,R.on)(r.ownerDocument,"mousedown",e=>{t=e,setTimeout(()=>{t===e&&(t=void 0)})},{capture:!0}),(0,R.on)(r.ownerDocument,"focusin",n=>{const i=dt(r)??n.target;o.get().open&&!le(E,i)&&(t&&E.contains(i,t)||e.close("focus-out",{event:n,focus:!1}))}))}if(u.push(function(e){const t=e.ownerDocument;let o,r=[];const i=()=>{r.forEach(e=>e.remove()),r=[],o=void 0},s=()=>{const e=t.createElement("span");return e.tabIndex=0,e.setAttribute("aria-hidden","true"),e.style.cssText="position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;outline:none",e},a=()=>{const i=t.activeElement;!r.length&&"trap"===n()&&i instanceof HTMLIFrameElement&&e.contains(i)&&(o=i,r=[s(),s()],i.before(r[0]),i.after(r[1]))},c=()=>{a(),setTimeout(a)},l=(0,R.on)(t.defaultView??window,"blur",c),u=(0,R.on)(t,"focusout",c),d=(0,R.on)(t,"focusin",t=>{const n=r.indexOf(t.target),s=o;if(i(),n<0||!s)return;const a=O(e),c=0===n?-1:1;(a.at((a.indexOf(s)+c)%a.length)??e).focus({preventScroll:!0})});return()=>{l(),u(),d(),i()}}(r)),t.closeWatcher){const t=function(e){const t=globalThis.CloseWatcher;if(!t||!/Android/.test(navigator.userAgent))return;let n;try{n=new t}catch{return}return n.addEventListener("close",t=>{performance.now()-(ee.escapeAt??-1/0)<100||e(t)}),()=>n?.destroy()}(t=>e.close("back",{event:t,focus:!0}));t&&(l=t,u.push(()=>{t(),l===t&&(l=void 0)}))}const V=t=>{const n=t.target,o=t.submitter,r=o?.getAttribute("formmethod")??n.getAttribute("method");"dialog"===r?.toLowerCase()&&ue(n)===E&&(t.preventDefault(),e.close("close-press",{event:t,focus:!0,returnValue:o?.value||void 0}))};r.addEventListener("submit",V),u.push(()=>r.removeEventListener("submit",V)),o.get().open&&!h&&"trap"===n()&<()&&(h=!0);for(const e of ie()){const t=vt.get(e);e!==E&&t?.inside(r)&&t.again()}return queueMicrotask(()=>H(a.initialFocus)),()=>{if(u.forEach(e=>e()),s===E&&(s=void 0),!o.get().mounted&&!a.inline)try{m.hidePopover()}catch{}}}function K(){if(!r||i)return;const{el:e,config:t}=r;i={el:e,cleanup:()=>{},backdrop:t.backdrop?.()},i.cleanup=z(e,t)}function X(e,t=!1){if(e.removeAttribute("hidden"),t)return Xe(e);e.setAttribute("popover","manual");try{e.showPopover()}catch{}return B()||e.style.zIndex||(e.style.zIndex="2147483000"),Xe(e)}function Y(e){if(!o.get().mounted)try{e.hidePopover()}catch{}}function _(){if(!i)return;const{cleanup:e}=i;i=void 0,e()}return{bind(n,s={}){let a=!1;const c=Ue(n),l=()=>{r={el:n,config:s},o.get().mounted&&(i&&i.el!==n&&_(),K())};return n.isConnected?l():queueMicrotask(()=>{!a&&n.isConnected&&l()}),()=>{a=!0;const s=e.finalFocus?.()??"trigger";if(c(),r?.el===n&&(r=void 0,i?.el===n)){const e=I(),i=o.get().open&&t.movesFocus&&(!e||e===n.ownerDocument.body||U(n,e)),a=k;if(_(),i){const e=p;p=void 0,queueMicrotask(()=>{r||n.isConnected||!lt()||V(n,a,!0,e,s)})}}}},keydown:function(t){if("Escape"===t.key&&s)return function(e,t){fe(pe(e),t,e)}(s,t);const o=i?.el;if("Tab"!==t.key||!o)return;const r=n();if("native"===r)return;if("close"===r)return e.close("focus-out",{event:t,focus:!1});const a=O(o),c=E(o),l=c[0],d=c.at(-1),p=I(),f=!l||p===l||p===o,h=!d||p===d,g="trap"===r?function(e,t){return e.filter(e=>e.tabIndex>0&&!(e=>{for(let n=e;n&&n!==t;n=n.parentElement)if(n.assignedSlot)return!0;return!1})(e)).sort((e,t)=>e.tabIndex-t.tabIndex)}(a,o):[];if(g.length){const e=[...g,...a.filter(e=>!g.includes(e))],n=e.indexOf(p),r=p===o?e.at(t.shiftKey?-1:0):e.at((n+(t.shiftKey?-1:1))%e.length),i=g.includes(p)||!!r&&g.includes(r),s=p?.shadowRoot,c=!t.shiftKey&&!!s&&O(s).length>0;if(p!==o&&(n<0||!i||c))return;return t.preventDefault(),void r?.focus({preventScroll:!0})}if("trap"===r){if(t.shiftKey?f:h)return t.preventDefault(),void((t.shiftKey?d:l)??o).focus({preventScroll:!0});const e=a.indexOf(p),n=e<0?void 0:a[e+(t.shiftKey?-1:1)],r=n&&!n.checked?A(n):[];return void(r.some(e=>e.checked)&&!r.includes(p)&&(t.preventDefault(),n?.focus({preventScroll:!0})))}const m=e.trigger();var v,b;if(m)if(t.shiftKey&&f)t.preventDefault(),m.focus({preventScroll:!0});else if(!t.shiftKey&&h){const e=(b=o,O(((v=m).ownerDocument??document).body).find(e=>!e.contains(v)&&!b?.contains(e)&&u(v,e)));if(!e)return;t.preventDefault(),e.focus()}},triggerKeydown(e){const t=i?.el;"Tab"===e.key&&!e.shiftKey&&t&&o.get().open&&"flow"===n()&&(e.preventDefault(),(E(t)[0]??t).focus({preventScroll:!0}))},opening(e,t){f=e,m="pointerdown"===t?.type,v="keydown"===t?.type},opener:()=>f,observe(e){x=e},requestClose:(t,n)=>e.close(t,{event:n,focus:!0}),returnFocus(e){b=e},initialFocus:H,place:()=>M?.(),checkPlacement:()=>P?.(),updateModal:()=>T?.(),layer:()=>s,element:()=>i?.el,mountedAs:D,backdrop(e){if(!i||i.backdrop===e)return()=>{};const{el:t}=i,n=r?.config.host?.()??t,o=!!r?.config.inline;i.backdrop=e;const a=X(e,o),c=I();if(!o)try{n.hidePopover(),n.showPopover()}catch{}c&&c!==I()&&c.focus({preventScroll:!0});const l=s?.keep?.(e);return()=>{l?.(),a(),i?.backdrop===e&&(i.backdrop=void 0),Y(e)}}}}function wt(e){const{store:t,preset:n}=e;function o(n,o,r){if(o.disabled)return;const i=(e=>e?tt[Ve(e)]:"imperative")(r);if(!t.get().open)return e.control.show({event:r,by:i,reason:"trigger-press",trigger:n,payload:o.payload});const s=t.get().trigger;return null!==s&&s!==n?e.control.takeOver({trigger:n,payload:o.payload,reason:"trigger-press",event:r}):"hover"===e.popup.opener()?e.control.show({event:r,by:i}):void e.control.hide({reason:"trigger-press",event:r})}return{press:o,keydown:(e,t,n,r)=>"BUTTON"!==t.tagName&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o(n,r,e),!0),contains:(t,n)=>!!n&&f(e,e.triggerSlot).some(({el:e,props:n})=>e.contains(t)&&!n.disabled),initialFocus(e,t="auto",n){if("none"!==t)return"content"===t?e:"auto"===t?n?.()??E(e)[0]??e:"function"==typeof t?t()??e:"string"==typeof t?e.querySelector(t)??e:w.Bd&&t instanceof HTMLElement?t:e},contentAttrs:(e,t,o)=>({"aria-labelledby":o?e.titled?`${t}-title`:`${t}-trigger`:void 0,"aria-describedby":e.described?`${t}-description`:void 0,"aria-modal":"dialog"!==o&&"alertdialog"!==o||!0!==e.modal?void 0:"true","data-presentation":n.presentation&&e.presentation}),triggerAttrs(e,t,n,o,r){const i="menu"===r||"listbox"===r?r:r&&"dialog";return{...rt(e,t,i??"",n),"aria-haspopup":i,type:"button",...it(o)}}}}var kt=e=>e&&function(e){return function(e,t){for(const n of t){const t=L(n(e));if(t)return t}return""}(e,$)}(e)||void 0;function St(e){return{contentAttrs:(t,n)=>({"aria-labelledby":!1!==t.titled?`${n}-title`:void 0,"aria-label":!1===t.titled?kt(e.triggerElement()):void 0,"aria-modal":!0===t.modal?"true":void 0})}}var At,Ot=new Map,Et={prepare(e,t){const n=`${e}-${t}`,o=Ot.get(n)??[`[data-slot="${n}"]`,`[data-slot="${e}-backdrop"]`];Ot.set(n,o),v(()=>{return e=o,void(w.Bd&&!ht.has(e)&&(ht.add(e),(0,he.Uc)(()=>{ft(document,e),(0,he.b1)(document)})));var e})},bind(e){ft(e.ownerDocument,[`[data-slot="${e.getAttribute("data-slot")}"]`])}};function Ct(e,t){return{opening(n,o,r){const i={trigger:e.get().trigger,payload:e.get().payload};return void 0!==n&&e.set({trigger:n}),t(o,r),()=>e.set(i)},handOver(n,o,r){e.set({trigger:n}),t(o,r)},reopening:(e,n)=>"payload"in e&&t(e.payload,n)}}var Mt=()=>At??=n.e(701).then(n.bind(n,701)),Pt=e=>w.Bd&&matchMedia(e).matches;var Tt={payload:Ct,behavior:"dialog",role:"dialog",dismissal:l,modal:!0,presentation:function(e,t){const n="dialog"===e.preset.behavior;return n&&e.store.set({presentation:"dialog"}),function(t,n,o,r,i){const s=()=>{const e=o(),t="auto"===e&&Pt("(max-width: 640px) and (pointer: coarse)");return"sheet"===e||t?"sheet":r},a=()=>t.set({presentation:s()}),c=o();return"sheet"===c&&a(),w.Bd&&!At&&("sheet"===c||"auto"===c&&Pt("(pointer: coarse)"))&&(window.requestIdleCallback??setTimeout)(()=>Mt().then(e=>e.prepareVariables())),{open:a,resolve:s,bind(n,r){const s=e.popup;if("auto"===o()&&"initial"===s.opener()&&t.get().open&&queueMicrotask(a),"sheet"!==t.get().presentation)return s.bind(n,r);let c,l=!1;const u=()=>n.hidden||(n.hidden=!0),d=new MutationObserver(u),p=e=>{d.disconnect(),l||(c=e())};Mt().then(({presentSheet:e})=>p(()=>e(n,s,{...i?.sheet,...r})),()=>p(()=>s.bind(n,r))),u(),d.observe(n,{attributeFilter:["hidden"]});const f=Ue(n);return()=>{l=!0,d.disconnect(),f(),c?.()}}}}(e.store,0,()=>e.rules?.presentation?e.rules.presentation():e.options().presentation,n?"dialog":"popover",t)},press:wt,triggerName:St,resetStyles:Et},xt={payload:Ct,behavior:"dialog",role:"alertdialog",dismissal:l,press:wt,triggerName:St,resetStyles:Et},jt=new WeakMap;function Dt(e,t){const n=jt.get(e);if(n)return void n.push(t);const o=[t];jt.set(e,o),queueMicrotask(()=>{jt.delete(e);const t={};for(const e of o)e(t);e.set(t)})}function Lt(e,t,{now:n=!1}={}){const o=o=>n?e.set({[t]:o}):Dt(e,e=>e[t]=o);return o(!0),()=>o(!1)}var Wt=new WeakSet;function $t(e,t){return!!Object.is(e,t)||!(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)&&!Wt.has(e)&&!Wt.has(t)&&e.every((e,n)=>Object.is(e,t[n]))}var Nt=new WeakMap;function Ft(e,t,n){return function(e,t,n){let o=e.get(t);return o||e.set(t,o=new Set),o.add(n),()=>{o.delete(n),o.size||e.get(t)!==o||e.delete(t)}}(Nt.get(e).skipping,t,n)}var qt=e=>Nt.get(e).state(),Vt=e=>Nt.get(e).renders(),Rt=e=>e.owner,Bt=e=>Rt(e).slots[e.slot],It=(e,t)=>({id:e.id,key:e.key,props:t,api:e.api}),Ht=(e,t=e.props)=>({el:e.el,id:e.id,key:e.key,props:t,store:e.store,api:e.api});function Ut(e){const{parts:t}=e.owner,n=`${e.slot}:${e.key}`;t.has(n)||t.set(n,e),e.leases++;let o=!0;return()=>{if(!o)return;if(o=!1,--e.leases)return;const{owner:t}=e;t.released.length||queueMicrotask(()=>zt(t)),t.released.push(e)}}function zt(e){for(const t of e.released){const n=`${t.slot}:${t.key}`;t.leases||e.parts.get(n)!==t||e.parts.delete(n)}e.released=[]}function Kt(e,t=e.props,n=e.store.get()){const o=Bt(e),r=It(e,t),i=o.attrs?.(n,r),s=o.role,a="function"==typeof s?s(n,r):s,{name:c}=Rt(e),l={"data-slot":"root"===e.slot?c:`${c}-${e.slot}`,...void 0===s?void 0:{role:a},...i};return void 0!==s&&(l.role=a),function(e,t){const{owner:n}=e;if(!n.named?.size||!en.some(e=>t[e]))return t;const o=function(e,t){const n=Vt(t);if(e.aliases?.version===n)return e.aliases.map;const o=new Map;for(const t of e.named){const e=tn(t);void 0!==e&&e!==t.own&&o.set(e,t.own)}return e.aliases={version:n,map:o},o}(n,e.store);if(!o.size)return t;const r={...t};for(const e of en){const t=r[e];t&&(r[e]=t.split(" ").map(e=>o.get(e)??e).join(" "))}return r}(e,l)}var Xt=new Set(["aria-label","aria-labelledby","aria-description","title","autocomplete","autocapitalize","autocorrect","spellcheck","inputmode","enterkeyhint"]),Yt=e=>"string"==typeof e&&e.split(/\s+/).every(e=>e.startsWith("ui-sdk-"));function _t(e,t=e.props,n=e.store.get()){return Bt(e).present?.(n,It(e,t))??!0}var Qt=(e,t=e.props)=>Bt(e).selects?.selection(e,t)??"",Zt={};function Gt(e,t){const n=e.propsListeners??=new Set;return n.add(t),()=>{n.delete(t)}}var Jt=new WeakMap;var en=["aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns","for","headers"],tn=e=>Bt(e).attrs?.(e.store.get(),It(e,{...e.props,id:void 0})).id;function nn(e){const{owner:t}=e;t.unread||(t.unread=new Set,queueMicrotask(()=>function(e,t){const n=e.unread;e.unread=void 0;let o=!0===e.renamed;e.renamed=void 0;for(const e of n)o=rn(e,e.el&&on(e.el))||o;o&&(e=>{Nt.get(e).touch()})(t)}(t,e.store))),t.unread.add(e)}var on=e=>"form"===e.localName?e.getAttribute("id"):e.id;function rn(e,t){const n=tn(e),o=t&&t!==n?t:void 0;if(o===e.own)return!1;const{owner:r}=e;return e.own=o,r.named??=new Set,void 0===o?r.named.delete(e):r.named.add(e),r.aliases=void 0,void 0!==n}function sn(e){return("keydown"===e.type||"keyup"===e.type)&&(0,R._)(e)}function an(e){return e({present:e=>"sheet"===e.presentation})}function cn(e){return e({attrs:(e,{id:t})=>({id:`${t}-title`}),bind:(e,{store:t})=>Lt(t,"titled",{now:!0})})}function ln(e){return e({attrs:(e,{id:t})=>({id:`${t}-description`}),bind:(e,{store:t})=>Lt(t,"described",{now:!0})})}var un=Symbol.for("ui-sdk.controller.attach"),dn=Symbol.for("ui-sdk.controller.detach");function pn(e,t){e?.[un]?.(t)}function fn(e,t){e?.[dn]?.(t)}var hn={},gn=new Set,mn=new WeakMap;function vn(e){const t=e.slots(e=>e),n=e.name,o=e.label??n,r=r=>{let i=r;const s=r.id,a=function(e,t){let n,o,r,i=e,s=0,a=0,c=!1;const l=new Set,u=new Map;let d;const p={get:()=>r??f(),set(e,o=!1){if(n&&!o&&!c){const t=f();if(t!==i){const n={...t};for(const t in e)delete n[t];p.set(n,!0)}}const r=[];for(const t in e)$t(i[t],e[t])||r.push(t);if(!r.length)return;const s=i;i={...i,...e};const a=r.every(e=>t.includes(e));h(r,s,a,o)},subscribe:e=>(l.add(e),()=>{l.delete(e)}),setFanout(e){d=e},follow(e){n=e},view(e,t){const n=r;r=e;try{return t()}finally{r=n}}};function f(){if(!n||c)return i;let e;c=!0;try{e=n(i)}finally{c=!1}if(!e)return i;if(o?.state===i&&o.over===e)return o.result;let t=i;for(const n in e)if(!$t(i[n],e[n])){t={...i,...e};break}return o={state:i,over:e,result:t},t}function h(e,t,n,o){n||s++,o||a++;const r=t=>t(n,o,e);l.forEach(r);for(const[t,n]of u)e.length&&!e.some(e=>!Object.hasOwn(t,e))||n.forEach(r);d?.(e,t,r)}return Nt.set(p,{state:()=>i,renders:()=>s,writes:()=>a,touch:()=>h([],i,!1,!1),skipping:u}),p}({...e.state(i),...e.sync?.(i)},e.live??[]),l=[],u=[],d=Object.create(t),p=new Set,f={name:n,label:o,slots:d,parts:new Map,released:[]},{parts:h}=f;function b(e={}){return e.id??(null==e.value?"":String(e.value))}let w;const k={id:s,label:o,store:a,options:()=>i,onOptions:e=>u.push(e),onDestroy:e=>l.push(e),parts:()=>h.values(),element:function(e,t){if(void 0===t){for(const t of h.values())if(t.slot===e&&t.el?.isConnected)return t.el;return}const n=h.get(`${e}:${t}`)?.el;return n?.isConnected?n:void 0},props:(e,t="")=>{const n=w?.[e];return n&&b(n)===t?n:h.get(`${e}:${t}`)?.props}};let S;function A(){S=e.api(k),function(e,t){let n=e.options().controller,o=!1;v(()=>(o=!0,pn(n,t),()=>{o=!1,fn(n,t)})),e.onOptions(({controller:e})=>{e!==n&&(fn(n,t),n=e,o&&pn(e,t))})}(k,S)}function O(){const{sleeping:e}=f;if(e){f.sleeping=void 0,function(e,t){const n=g,o={starts:[]};g=o;try{t()}finally{g=n}const r=m.get(e);if(r){r.starts.push(...o.starts);for(const e of r.stops?o.starts:[]){const t=e();t&&r.stops.push(t)}}}(T,A);for(const t of[...e.binds])t()}}e.asleep?.(i)?f.sleeping={wake:O,binds:new Set}:A();let E=!1,C=!1,M=!1;const P=(t,n)=>function(e,t,n,o){const r=F.get(e);if(!r)return n;let i=n??{};for(const s of r){if(!n&&"state"===s.from)continue;const r={...o,...i},a="state"===s.from?e.view(r,()=>s.derive(r)):s.derive(i,o,t);i={...i};for(const e of s.keys)a&&e in a?i[e]=a[e]:"state"===s.from&&(i[e]=r[e])}return n||Object.keys(i).length?i:void 0}(a,t,e.sync?.(t),n),T={types:void 0,name:n,id:s,get:a.get,subscribe:a.subscribe,get api(){return O(),S},part:function(e,t={},n=!1){const o=b(t),r=`${e}:${o}`;let i=h.get(r);if(i){if(n)return i}else h.set(r,i={slot:e,key:o,id:s,get api(){return S},store:a,props:t,el:void 0,owner:f,leases:0}),n&&function(e){const{owner:t}=e;t.released.length||queueMicrotask(()=>zt(t)),t.released.push(e)}(i);return i.props=t,c=i,c.propsListeners?.forEach(e=>e()),i;var c},use:function(e){p.has(e)||(p.add(e),Object.assign(d,e.slots),O(),e.extend?.(S))},preview(e){const t=P({...e,id:s},a.get()),n=a.get();for(const e in t)if(!$t(n[e],t[e]))return{...n,...t}},view(e,t,n){const o=w;w=n;try{return a.view(e,t)}finally{w=o}},setOptions(t){const n=qt(a),o=t.id===s?t:{...t,id:s};i=o,f.sleeping&&!e.asleep(i)&&O();const r=P(i,n);let l;E=!0;try{for(const e of u)l=e(i,r)??l;const e=qt(a)===n?r:P(i,qt(a));e&&c(l,()=>a.set(e,!0))}finally{E=!1}},startState:t=>e.state({...t,id:s}),follow(e){let t,n;C=!0;const o=(o=qt(a),r)=>{if(r)return P({...r,id:s},o);if(M)return n;const i=e();return t?.options===i&&t.state===o||(t={options:i,state:o},n=P({...i,id:s},o)),n};return a.follow(o),o},destroy(){M||(M=!0,function(e){y(e),m.delete(e)}(T),function(){try{l.forEach(e=>e())}finally{}}())}};return((e,t)=>{Nt.set(e,Nt.get(t))})(T,a),function(e,t,n){let o,r;const i=()=>{o?.(),o=void 0,r&&gn.delete(r),r=void 0};v(()=>{if(hn.add)o=hn.add(e,t,n);else if("undefined"!=typeof document&&(gn.add(r=new WeakRef(e)),mn.set(e,()=>o=hn.add?.(e,t,n)),gn.size%1e3==0))for(const e of gn)e.deref()||gn.delete(e);return i})}(T,h,e),T},i=e=>function(e){const t=g,n={starts:[]};let o;g=n;try{o=e()}finally{g=t}return m.set(o,n),t?t.starts.push(()=>(b(o),()=>y(o))):"undefined"==typeof document||b(o),o}(()=>r(e));return Object.defineProperty(i,"name",{value:n}),Object.assign(i,{options:e.options,slots:t})}var bn=new WeakMap,yn=e=>Vt(e),wn=new WeakSet,kn=e=>(wn.add(e),e),Sn=Symbol("canceled action");var An=n(393);function On(e,t,n,o){o.source??a(o.reason),o.reason}var En=(e,t)=>a(e,t&&(()=>Ve(t)));function Cn(e,t){return kn(Promise.resolve({reason:e,source:En(e,t)}))}function Mn(e,t){const n=e,{store:o,element:r,options:i}=n,{preset:s}=t,a=t.slot??"content",l=t.trigger??"trigger",u=function(e,t=function(){return Ne(),En}()){return function(e,t){const{store:n,options:o}=e,r=new Map,i=new Map,s=new Map;return e.onOptions((e,t)=>{if(!t)return;let n;for(const[e,o]of r)e in t&&($t(t[e],o.value)&&(n=o.source),r.delete(e));return n}),(a,l,u)=>{if(s.has(a)&&$t(s.get(a),l))return!1;const d=(i.get(a)??0)+1;i.set(a,d);const p=n.get()[a];if($t(p,l))return!1;const{reason:f,event:h}=u,g=function(e,t,n=!0){if(!n)return{...e,source:t};let o=!1;return{...e,source:t,cancel:()=>{o=!0},get canceled(){return o}}}(u,u.source??t(f,h));g.source;const m=o(),v=void 0!==m[a],b=s.has(a),y=s.get(a);s.set(a,l);try{c(g.source,()=>{const e=(e=>`on${(e=>`${e[0].toUpperCase()}${e.slice(1)}`)(e)}Change`)(a),t=m[e];"function"==typeof t&&t(l,g);const o=i.get(a)!==d;g.canceled||v||o||n.set({[a]:l})})}finally{b?s.set(a,y):s.delete(a)}return!g.canceled&&(hn.change?.(e.id,a,l,g,p),v&&r.set(a,{value:l,source:g.source}),!0)}}(e,t)}(n),d=e=>void 0!==e&&n.props(a,e)||f(n,a)[0]?.props||n.props(a)||{},p=()=>{if(b?.trigger)return b.trigger();const e=o.get().trigger;return null!==e&&r(l,e)||r(l)};let h,g=null,m=o.get().open;o.subscribe(()=>{const{open:e,trigger:t}=o.get();e!==m&&(m=e,e&&(g=null===t||r(l,t)?null:t,h=f(n,l).length<=1))});const v={label:n.label,role:t.role??s.role,store:o,options:i,onOptions:n.onOptions,onDestroy:n.onDestroy,element:r,parts:n.parts,preset:s,get popup(){return T},get control(){return x},triggerElement:p,triggerSlot:l,triggerDisabled:e=>!!n.props(l,e)?.disabled,contentProps:d},b=v.rules=t.rules?.(v),y=s.dismissal?.(i,b),w=s.presentation?.(v,y),k=s.press?.(v),S=s.group?.(v),A=s.hover?.(v,S),O=s.focus?.(v),E=s.triggerName?.(v);function C(e,t){if(void 0!==s.modal)return{modal:e.modal??("sheet"===t.presentation||s.modal)}}function M(){const e=C(i(),o.get());e&&o.set(e)}function P(e,t){b?.dismiss?b.dismiss(e,t):x.hide({reason:e,...t})}s.resetStyles?.prepare(n.label,a),s.placement?.prepare();const T=yt({...t.behavior,preset:s.behavior,position:s.placement?.position,owner:{component:n.label,id:n.id},store:o,trigger:p,returnTrigger:()=>{const e=o.get().trigger;if(b?.trigger||null===e||e===g)return p();const t=h??f(n,l).length<=1;return r(l,e)??(t?r(l):void 0)},contains:(e,t)=>b?.contains?b.contains(e,t):!!p()?.contains(e)||!!k?.contains(e,t),close:P,modal:()=>{return b?.modal?.()??{consumeOutsidePress:!0===(e=o.get().modal)||"pointer"===e,trapFocus:!0===e||"trap-focus"===e,inertAndLock:!0===e};var e},parent:()=>b?.parent?.(),persistent:()=>b?.persistent?.()??[],finalFocus:()=>d().finalFocus,onEscape:e=>b?.onEscape?b.onEscape(e):P("escape-key",{event:e,focus:!0}),onShow:e=>b?.onShow?.(e),onOpenChange(e,t){if(b?.onOpenChange?.(e,t),S?.change(e),e)return w?.open(),void M();A?.clear(),O?.clear()},onOpenChangeComplete(e,t){b?.onOpenChangeComplete?.(e,t),i().onOpenChangeComplete?.(e)}}),x=function(e){const{popup:t,store:n,rules:o={}}=e,r="imperative";let i,s,a;function c(e){if(!i){let e;const t=kn(new Promise(t=>e=t));i={promise:t,resolve:e}}if(e&&!e.aborted){const n=()=>t.requestClose("imperative");e.addEventListener("abort",n,{once:!0}),i.promise.then(()=>e.removeEventListener("abort",n))}return i.promise}function l(e={},t){return u(e,t).result}function u(i,s){const{event:l,signal:u}=i;if(u?.aborted)return{opened:!1,result:Cn(r)};const d=i.reason??(l?"trigger-press":r),p=s??d,f={...i,reason:p,payloadReason:d};let h=!1;const g=(n=i.by??"imperative")=>{a=i.anchor;const o=e.payload?.opening(i.trigger,i.payload,{reason:d,event:l});return t.opening(n,l),h=e.change(!0,{reason:p,event:l}),h||o?.(),h};return n.get().open?("hover"===t.opener()&&"hover"!==i.by&&t.opening(i.by??"imperative",l),void 0===i.trigger&&e.payload?.reopening(i,{reason:d})&&i.anchor&&(a=i.anchor),o.reopen?.(f,g),{opened:h,result:c(u)}):(o.open?o.open(f,g):g(),{opened:h,result:h?c(u):Cn(p,l)})}function d(i={}){if(!n.get().open)return!1;const{event:a,returnValue:c}=i,l=i.reason??r;if(e.dismissal&&!e.dismissal.allows(l,a))return!1;let u=!1;const d=()=>{s={reason:l,source:En(l,a),returnValue:c},t.returnFocus(i.focus??e.returnFocus??!0);const n=e.change(!1,{reason:l,event:a,...void 0!==c&&{returnValue:c}});return n||(t.returnFocus(!0),s=void 0),u=n,n};return o.close?o.close({...i,reason:l},d):d(),u}t.observe(e=>{const t=e?void 0:s??{reason:r,source:"programmatic"};if(s=void 0,t)return i?.resolve(t),i=void 0,t}),e.onDestroy(()=>{i?.resolve({reason:"unmount",source:"programmatic"}),i=void 0});const p=(e,t)=>u({reason:r,event:t},e).opened;return{api:{isOpen:()=>n.get().open,setOpen:(e,{reason:t,event:n}={})=>e?p(t,n):d({reason:t,event:n}),open:(e={})=>l({...e,reason:e.reason??r}),close:({reason:e,event:t,returnValue:n}={})=>d({reason:e,event:t,returnValue:n}),toggle:({reason:e,event:t}={})=>n.get().open?d({reason:e,event:t}):p(e,t)},show:l,attempt:u,hide:d,takeOver:function({trigger:t,payload:n,anchor:o,reason:r,event:i}){a=o,e.payload?.handOver(t,n,{reason:r,event:i})},result:c,anchor:()=>a}}({dismissal:y,popup:T,store:o,payload:s.payload?.(o,(e,t)=>u("payload",e,t)),change:(e,t)=>u("open",e,{...t,...b?.details?.()}),onDestroy:n.onDestroy,get returnFocus(){return b?.returnFocus},rules:{open(e,t){A?.clear(),S?.opening(e.event),b?.open?b.open(e,t):t()},reopen(e){if(A?.clear(),b?.reopen)return b.reopen(e);const{trigger:t,payload:n,payloadReason:r,event:i}=e;void 0!==t&&t!==o.get().trigger&&x.takeOver({trigger:t,payload:n,reason:r,event:i})},close:(e,t)=>b?.close?b.close(e,t):t()}});M(),q(n,["modal"],(e,t,n)=>C(n,{...t,...e}));let j=o.get().modal;o.subscribe(()=>{const{modal:e}=o.get();e!==j&&(j=e,T.updateModal())});const D={dismissal:y,presentation:w,press:k,group:S,hover:A,focus:O,triggerName:E,rules:b};return{...{...x.api,getPayload:()=>o.get().payload,focus:()=>p()?.focus()},internal:Object.assign(v,D)}}function Pn(e){if(!e||!e.tagName)return!1;const t=e;if(t.isContentEditable)return!0;if("TEXTAREA"===t.tagName||"SELECT"===t.tagName)return!0;if("INPUT"!==t.tagName)return!1;const n=t.type;return!/^(button|checkbox|radio|submit|reset|range|color|file|image)$/.test(n)}var Tn=e=>("function"==typeof e.keys?e.keys():e.keys)||void 0;var xn=globalThis[Symbol.for("ui-sdk.shortcuts@1")]??=function(){const e=[],t=new Set;let n,o=0;function r(){return ie().filter(e=>e.blocking).at(-1)?.order}function i(e,n){const{scope:o,when:r,layer:i}=e.options;if(void 0!==o&&!t.has(o))return null;if(r&&!r())return null;const s=function(e,t,n=()=>!1,o=()=>!1){if(!e)return 0;const r="function"==typeof e?e():e;if(!r||!r.isConnected)return null;if(n(r))return 1/0;const i=t(r);return i?i.order??0:o(r)?null:0}(i,ue,ne,ze);return function(e,t){return null!==e&&(void 0===t||e>=t)}(s,n)?s:null}function s(t){if(t.defaultPrevented||(0,R._)(t))return;let n,o;const s=z();for(const a of e){const e=Tn(a);if(!e||t.repeat&&!a.options.repeat||!G(t,e,s))continue;if(n??={typing:Pn(t.composedPath()[0]),blocking:r()},n.typing&&!a.options.allowInInput&&!J(e))continue;const c=i(a,n.blocking);null!==c&&(!o||c>o.order||c===o.order&&a.id>o.entry.id)&&(o={entry:a,order:c})}o&&(t.preventDefault(),o.entry.handler(t))}return{register(t,r,i={}){"string"==typeof t&&function(e){X(e,!0).split("+").sort().join("+")}(t);const a={keys:t,handler:r,options:i,id:o++};return e.push(a),!n&&w.Bd&&(n=(0,R.on)(document,"keydown",s)),()=>{const t=e.indexOf(a);-1!==t&&e.splice(t,1),e.length||(n?.(),n=void 0)}},list(){const t=w.Bd?r():void 0,n=z();return e.filter(e=>!!Tn(e)&&null!==i(e,t)).map(e=>({keys:Tn(e),hint:Q(Tn(e),n),ariaKeyshortcuts:X(Tn(e),n),description:e.options.description,scope:e.options.scope}))},setScope(e,n){n?t.add(e):t.delete(e)},isScopeActive:e=>t.has(e),destroy(){e.length=0,t.clear(),n?.(),n=void 0}}}();function jn(e,t){return e?Q(e,t):""}function Dn(e){queueMicrotask(()=>e.get().apple!==z()&&e.set({apple:z()}))}function Ln(e,t){return e({props:{shortcut:"string"},state:(e,{props:n,api:o})=>({text:jn(n.shortcut??t(e,o),e.apple)}),attrs:()=>({"aria-hidden":"true",translate:"no"}),bind(e,{store:n,api:o,props:r}){if(Dn(n),e.childNodes.length)return;const i=()=>{const i=n.get();e.textContent=jn(r.shortcut??t(i,o,e),i.apple)};i();const s=n.subscribe(i);return()=>{s(),e.textContent=""}}})}var Wn=new WeakMap,$n=['[data-slot="dialog-content"]','[data-slot="alert-dialog-content"]','[data-slot="drawer-content"]'].join(","),Nn=["imperative","action","parent-close"],Fn=function(e,t,o={}){const{store:i,element:s}=e,a=e.options;!function(e){const t=()=>{const t=e.options().pendingAnnouncement??"Loading";n.e(776).then(n.bind(n,776)).then(({announce:e})=>r&&e(t),()=>{})};let o,r=!1;const s=e.store.subscribe(()=>{const e=null!==i.get().pending;e!==r&&(r=e,clearTimeout(o),e&&(o=setTimeout(t,1e3)))});e.onDestroy(()=>{r=!1,clearTimeout(o),s()})}(e);const l=()=>i.get().modal;let u,d=0;const p=new Set;function h(){const e=p.size?Math.max(...[...p].map(e=>e.stack()+1)):0;e!==i.get().stack&&(i.set({stack:e}),u?.add(g))}const g={close:e=>v.hide({reason:e}),stack:()=>i.get().stack,add(e){p.add(e),h()},remove(e){p.delete(e),h()}},m=Mn(e,{preset:o.preset??xt,role:t?"alertdialog":"dialog",rules:n=>({persistent:()=>{return(e=a().persistentElements)&&w.Bd?"function"==typeof e?e():e.flatMap(e=>"string"==typeof e?Array.from(document.querySelectorAll(e)):[e]):[];var e},onEscape(e){(!1!==l()||n.popup.element()?.contains(I()))&&n.control.hide({reason:"escape-key",event:e})},onShow(e){Wn.set(e,g),u=void 0;for(let t=e.parent;t&&!u;t=t.parent)u=Wn.get(t);u?.add(g),i.set({nested:!!u});const t=o.onShow?.(e);return()=>{t?.(),Wn.delete(e)}},onOpenChange(e){if(o.onOpenChange?.(e),e){if(w.Bd){const e=n.triggerElement()?.ownerDocument??document;!0===l()&&function(e){me.has(e)||(me.set(e,ve(e)),setTimeout(()=>me.delete(e)))}(e),(0,An.Se)(e.defaultView)}}else{d++,i.set({pending:null});for(const e of[...p])e.close("parent-close");u?.remove(g),u=void 0}},open(e,t){i.set({errors:{}}),t()},refusal:e=>function(e,t){const n=r(e);if(t.pending&&!Nn.includes(e)||n&&(!t.dismissible||"outside-press"===e&&!t.outsidePress))return!n||"outside-press"===e&&t.beside?"silent":"attempt"}(e,{dismissible:!1!==a().dismissible,outsidePress:!t&&(a().closeOnOutsidePress??!1!==l()),pending:null!==i.get().pending,beside:!0!==l()&&!t}),refused:e=>o.onRefuse?.(e),dismiss(e,t){o.intercept?.(e,t.event)||n.control.hide({reason:e,...t})},preferredFocus(){const o=n.popup.element(),r=o?.querySelector("[autofocus], [data-autofocus]");return r&&S(r)?r:t?f(e,"close").find(({el:e})=>S(e))?.el:void 0},bind:o.bind})}),{control:v}=m.internal;return{...m,internal:Object.assign(m.internal,{options:a,show:v.show,hide:v.hide,takeOver:v.takeOver,alert:t,initialFocus:()=>{const{press:e,popup:t,contentProps:n,rules:o}=m.internal;return e.initialFocus(t.element(),n().initialFocus,o?.preferredFocus)},closePress:function(e,t,n){if(!i.get().open||null!==i.get().pending)return;const o=t.action;if(!o)return v.hide({reason:"close-press",event:n,returnValue:t.value});const{[e]:r,...s}=i.get().errors;i.set({errors:s});const a=En("action",n);let l=!1;const u=d;!function(e,t,n){const o=e=>{n.failed(e)},r=()=>c(t,n.done);let i;try{i=e({source:t})}catch(e){return o(e)}if(i!==Sn){if(!(s=i)||"function"!=typeof s.then||wn.has(s))return r();var s;n.pending(!0),i.then(()=>{n.pending(!1),r()},e=>{n.pending(!1),o(e)})}}(e=>o(n,e),a,{pending(t){u===d&&(l=!0,i.set({pending:t?e:null}),On(0,0,0,{reason:"action",source:a}))},done(){u===d&&v.hide({reason:"action",event:l?void 0:n,returnValue:t.value})},failed:t=>{u===d&&(i.set({errors:{...i.get().errors,[e]:t}}),On(0,0,0,{reason:"action",source:a}))}})},shortcutPress:function(t,n){const o=e.props("trigger",t)??{};if(!o.disabled)return i.get().open?v.hide({reason:"shortcut",event:n}):void v.show({event:n,by:"keyboard",reason:"shortcut",trigger:t,payload:o.payload})},shortcutOf:t=>function(e,t,n,{beside:o=!1}={}){const r=f(e,t).find(e=>e.el.contains(n)||o&&!!n.parentElement?.contains(e.el));return r?.props?.shortcut}(e,"trigger",t,{beside:!0}),backdropElement:()=>s("backdrop")})}};function qn(e,{name:t}){const n=function(e){return e({props:{id:"id",disabled:"boolean",focusableWhenDisabled:"boolean",payload:"value"},state:(e,{key:t,props:n})=>({open:e.open&&(null===e.trigger||e.trigger===t),disabled:!!n.disabled}),attrs:(e,{id:t,key:n,props:o,api:r})=>{const{press:i,focus:s,role:a}=r.internal;return(i??s)?.triggerAttrs(e,t,n,o,a)??{}},on:{pointerenter:(e,{api:t,key:n,props:o})=>!o.disabled&&t.internal.hover?.enter(e,n,o.payload),pointerleave:(e,{api:t})=>t.internal.hover?.leave(e),focusin:(e,{api:t,key:n,props:o})=>!o.disabled&&t.internal.focus?.enter(n,o.payload,e),focusout:(e,{api:t})=>t.internal.focus?.leave(e),keydown:(e,{api:t,el:n,key:o,props:r})=>n&&function(e,t,n,o,r){e.press?.keydown(t,n,o,r)||e.focus?.keydown(t)||e.popup.triggerKeydown(t)}(t.internal,e,n,o,r)},press:({api:e,key:t,props:n},o)=>e.internal.press?.press(t,n,o),bind:(e,{api:t,key:n,id:o,store:r})=>function(e,t){return null===e.get().trigger&&e.set({trigger:t}),()=>{e.get().trigger!==t||e.get().open||e.set({trigger:null})}}(r,n)})}(e);return{trigger:e({props:{id:"id",disabled:"boolean",focusableWhenDisabled:"boolean",payload:"value",shortcut:"string"},state:n.state,attrs:(e,t)=>({...n.attrs(e,t),...!0===e.modal&&{"aria-expanded":void 0},"aria-keyshortcuts":t.props.shortcut?X(t.props.shortcut,e.apple):void 0}),on:n.on,press:n.press,bind(e,t){const{key:o,store:r,api:i}=t,s=n.bind(e,t);Dn(r);const a=function(e,n,o,r){let i,s;const a=()=>{const e=t.props.shortcut||void 0;e!==i&&(s?.(),i=e,s=e?xn.register(e,n,o):void 0)};a();const c=r(a);return()=>{c(),s?.()}}(0,e=>i.internal.shortcutPress(o,e),{layer:e},e=>Gt(t,e));return()=>{a(),s?.()}}}),backdrop:e({state:e=>({open:e.open,nested:e.nested,nestedOpen:e.stack>0}),present:(e,{api:t})=>e.mounted||!!t.internal.contentProps().keepMounted,role:"presentation",attrs:e=>({hidden:e.mounted?void 0:"",...N(e.open),"data-nested":e.nested?"":void 0,"data-nested-open":e.stack>0?"":void 0}),bind:(e,{api:t})=>(t.internal.preset.resetStyles?.bind(e),t.internal.popup.backdrop(e))}),content:e({props:{container:"value",initialFocus:"string",finalFocus:"string",keepMounted:"boolean",inline:"boolean"},connect:Ue,role:(e,{api:t})=>t.internal.role,roles:["dialog","alertdialog"],state:e=>({open:e.open,modal:e.modal,nested:e.nested,nestedOpen:e.stack>0,stack:e.stack,payload:e.payload,pending:null!==e.pending,presentation:e.presentation}),present:(e,{props:t})=>e.mounted||!!t.keepMounted,attrs:(e,{id:t,api:n})=>({...st(e,t),...n.internal.triggerName?.contentAttrs(e,t),"aria-describedby":e.described?`${t}-description`:void 0,"data-nested":e.nested?"":void 0,"data-nested-open":e.stack>0?"":void 0,"data-presentation":n.internal.presentation&&e.presentation}),on:{keydown(e,{api:t,el:n}){(function(e,t,n=`[data-slot="${e.getAttribute("data-slot")}"]`){return t.target.closest(n)===e})(n,e,$n)&&t.internal.popup.keydown(e)}},bind(e,{api:t,store:n,id:o,key:r}){const i=()=>e.style.setProperty("--dialog-stack",String(n.get().stack));i();const s=n.subscribe(i),a=function(e,t,n,o){const{preset:r,control:i,contentProps:s,triggerElement:a,element:c,popup:l,press:u,rules:d,presentation:p}=t,{placement:f}=r;r.resetStyles?.bind(e);const h=!!s(n).inline;return(p??l).bind(e,{inline:h,anchor:()=>i.anchor()??f?.anchor(e,s().anchor,a),position:f&&!h?()=>f.options(s(n),{side:r.side,align:"center"},c("arrow")):void 0,rendered:o&&(e=>Gt(o,e)),initialFocus:u&&(()=>u.initialFocus(l.element(),s().initialFocus,d?.preferredFocus)),backdrop:()=>c("backdrop"),...d?.bind?.()})}(e,t.internal,r);!function(e,t){Dt(e,n=>{void 0===n[t]&&null===e.get()[t]&&(n[t]=!1)})}(n,"titled");const c="sheet"===n.get().presentation?void 0:(0,An.NQ)(e);return()=>{s(),c?.(),a(),e.style.removeProperty("--dialog-stack")}}}),title:cn(e),description:ln(e),close:e({props:{id:"id",value:"string",action:"action"},state:(e,{key:t})=>({pending:e.pending===t,error:e.errors[t]}),attrs:(e,{key:t})=>({type:"button","data-pending":e.pending===t?"":void 0,"aria-busy":e.pending===t?"true":void 0,"aria-disabled":e.pending===t?"true":void 0}),press:({api:e,key:t,props:n},o)=>e.internal.closePress(t,n,o)}),shortcut:Ln(e,(e,t,n)=>n&&t.internal.shortcutOf(n))}}function Vn(e,t,n,o){return vn({name:e,options:{container:"value",open:"boolean",defaultOpen:"boolean",onOpenChangeComplete:"callback",dismissible:"boolean",onDismissAttempt:"callback",persistentElements:"list",pendingAnnouncement:"string",...n},state:e=>({open:e.defaultOpen??!1,mounted:e.open??e.defaultOpen??!1,titled:null,described:!1,trigger:null,payload:void 0,modal:!0,nested:!1,stack:0,pending:null,errors:{},apple:!1,presentation:"dialog"}),sync:e=>({...void 0!==e.open&&{open:e.open},modal:!!t||(e.modal??!0)}),api:e=>Fn(e,t,o?.rules(e.store,e.options)),slots:t=>({...qn(t,{name:e}),...o?.slots(t)}),agent:{actions:["setOpen"]}})}var Rn=Vn("dialog",!1,{onOpenChange:"callback",onPayloadChange:"callback",modal:function(e){if(null!==e)return"false"!==e&&("pointer"!==e&&"trap-focus"!==e||e)},closeOnOutsidePress:"boolean",presentation:"string",controller:"value"},{rules(){let e;return{preset:Tt,bind:()=>({onSheet:t=>e=t}),onRefuse:()=>e?.nudge()}},slots:e=>({viewport:an(e)})}),Bn=new WeakMap,In=new WeakMap,Hn=new WeakSet;var Un=new Set;function zn(e){Un.forEach(t=>t(e))}var Kn=new WeakMap,Xn=e=>Kn.get(e)?.(),Yn=0;var _n=new WeakMap,Qn=new WeakMap;function Zn(e,t,...n){"customValidity"===t&&Qn.set(e,n[0]);const o=_n.get(e)?.[t];return o?.(...n),!!o}function Gn(e,t,n){let o="";const r=()=>{const r=n.value();if(r instanceof FormData)t.setFormValue(r,n.state());else if(Array.isArray(r)){const e=new FormData,o=n.name?.();if(o)for(const t of r)e.append(o,t);t.setFormValue(e,n.state())}else t.setFormValue(r,n.state());const i=n.valueMissing(),s=Qn.get(e),a=n.invalid?.();s?t.setValidity({customError:!0},s,n.anchor?.()??e):a?t.setValidity(a.flags,a.message,a.anchor??n.anchor?.()??e):i?t.setValidity({valueMissing:!0},n.message(),n.anchor?.()??e):t.setValidity({}),(a?.message??"")!==o&&(o=a?.message??"",zn(e))};r();const i=n.subscribe(r),s=n.focus?function(e,t){return In.set(e,t),()=>{In.get(e)===t&&In.delete(e)}}(e,n.focus):()=>{};e.matches(":disabled")&&n.disabled(!0),_n.set(e,{reset:()=>{n.reset(),r()},disabled:e=>n.disabled(e),restore:e=>{"string"==typeof e&&n.restore(e)},customValidity:r});const a=function(e,t,n=e){let o;const r=()=>{const n=e.getAttribute("aria-labelledby");if(e.hasAttribute("aria-label")||null!==n&&n!==o)return;const r=t();for(const e of r)e.id||(e.id="ui-sdk-label-"+ ++Yn);const i=r.map(e=>e.id).join(" ");if(!i)return void 0!==o&&e.removeAttribute("aria-labelledby"),void(o=void 0);o=i,n!==i&&e.setAttribute("aria-labelledby",i)};return queueMicrotask(r),n.addEventListener("focusin",r),()=>n.removeEventListener("focusin",r)}(e,()=>function(e){const t=[],n=e.closest("label");return n?.control===e&&t.push(n),e.id&&e.getRootNode().querySelectorAll(`label[for="${CSS.escape(e.id)}"]`).forEach(o=>{o!==n&&o.control===e&&t.push(o)}),t.sort(d)}(e)),c=()=>{n.focus&&function(e,t){const n=t??e.ownerDocument;Hn.has(n)||(Hn.add(n),setTimeout(()=>Hn.delete(n)),function(e){const t=In.get(e);t?t():e.focus()}(e))}(e,t.form)};return e.addEventListener("invalid",c),()=>{e.removeEventListener("invalid",c),i(),a(),_n.delete(e),s()}}var Jn,eo=new WeakMap,to=new WeakMap;function no(e,t){if(e!==Jn){for(const n of Object.values(eo.get(e)??{}))n.delete(t);for(const n of Object.values(to.get(e)??{}))n.delete(t)}}function oo(e,t,n,o){const r=Jn;Jn=e;try{!function(e,t,n,o){const r=eo.get(e)??{},i=r[n]??new Map,s=new Map,a=void 0===t.style?[]:function(e){const t=[];for(const n of e.split(";")){const e=n.indexOf(":");e>0&&t.push([n.slice(0,e).trim(),n.slice(e+1).trim()])}return t}(t.style);for(const[e,t]of a)s.set(`style:${e}`,t);for(const[e,n]of Object.entries(t))void 0!==n&&"style"!==e&&s.set(e,n);const c=s.has("id")||i.has("id")?e.getAttribute("id"):null,l=function(e,t,n){return null!==e&&e!==t[n]?.get("id")&&(!e.startsWith("ui-sdk-")||Object.values(t).some(t=>t.get("id")===e))}(c,r,n);l&&s.delete("id");const u=new Set,d=new Map;for(const t of new Set([...s.keys(),...i.keys()])){if(!Xt.has(t))continue;const n=e.getAttribute(t);d.set(t,n),null===n||n===s.get(t)||"aria-labelledby"===t&&Yt(n)||Object.values(r).some(e=>e.get(t)===n)||u.add(t)}for(const e of u)s.delete(e);for(const t of i.keys()){if(s.has(t)||u.has(t)||"id"===t&&l)continue;if(t.startsWith("style:")){e.style.removeProperty(t.slice(6));continue}if(!o){e.removeAttribute(t),ro(e,n,t,null);continue}const r=e.getAttribute(t);if(r!==i.get(t))continue;const a=to.get(e)?.[n]?.get(t);void 0===a?e.removeAttribute(t):r!==a&&e.setAttribute(t,a)}for(const[t,n]of a)e.style.getPropertyValue(t)!==n&&e.style.setProperty(t,n);for(const[o,r]of Object.entries(t)){if(void 0===r||!s.has(o))continue;const t="id"===o?c:d.has(o)?d.get(o):e.getAttribute(o);t!==(i.get(o)??null)&&ro(e,n,o,t),t!==r&&("value"===o&&so(e)&&e.value!==r&&(e.value=r),e.setAttribute(o,r))}r[n]=s,eo.set(e,r),o&&delete to.get(e)?.[n]}(e,t,n,o)}finally{Jn=r}}function ro(e,t,n,o){const r=null==o||"id"===n?void 0:en.includes(n)?io(o):o;if(void 0===r)return void to.get(e)?.[t]?.delete(n);let i=to.get(e);i||to.set(e,i={}),(i[t]??=new Map).set(n,r)}var io=e=>e.split(/\s+/).filter(e=>e&&!e.startsWith("ui-sdk-")).join(" ")||void 0,so=e=>"textarea"===e.localName||"input"===e.localName&&"file"!==e.type,ao=new Set;var co=new WeakMap,lo=0,uo=new Set;function po(e){return"undefined"!=typeof customElements&&!uo.has(e)&&!customElements.get(e)&&(uo.add(e),!0)}function fo(e){return co.has(e)||co.set(e,"auto-"+ ++lo),co.get(e)}function ho(e){return e.querySelector(":scope > button, :scope > a, :scope > ui-button > button, :scope > ui-button > a")??e.firstElementChild}function go(e,t){return t?t(e):e.hasAttribute("as-child")?e.firstElementChild:e}var mo=(e,t)=>e.id!==t.id||e.value!==t.value,vo=e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),bo=["role","aria-disabled"];function yo(e,t){if(null!==t){if("function"==typeof e)return e(t);if("boolean"===e)return"false"!==t;if("number"===e){const e=Number(t);return""===t.trim()||Number.isNaN(e)?void 0:e}return"list"===e?t.split(",").map(e=>e.trim()).filter(Boolean):t}}var wo=new Set(["disabled","required"]);function ko(e,t,n){const o=e.getAttribute(vo(t));return"boolean"===n&&wo.has(t)?null!==o||void 0:yo(n,o)}function So(e,t){const n={};for(const[o,r]of Object.entries(t)){const t=ko(e,o,r);void 0!==t&&(n[o]=t)}return n}var Ao=(e,t)=>"function"==typeof t?t(e):t;function Oo(e,t,n={}){for(const[o,r]of Object.entries(t)){if(o in e)continue;const t=vo(o);Object.defineProperty(e,o,{configurable:!0,get(){return ko(this,o,r)??Ao(this,n[o])??("boolean"!==r&&void 0)},set(e){const i=!1===e&&"boolean"===r&&!Ao(this,n[o]);null==e||i?this.removeAttribute(t):this.setAttribute(t,!0===e?"":Array.isArray(e)?e.join(","):String(e))}})}}function Eo(e,t){for(const n of t){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const t=e[n];delete e[n],e[n]=t}}var Co=new Set;function Mo(e,t,n){Co.add(e);try{return Zn(e,"restore",t,n)}finally{Co.delete(e)}}var Po=new Map;function To(e){for(const t of Po.keys())t.contains(e)&&Po.delete(t)}function xo(e,t,n){const o={};Po.set(e,o),queueMicrotask(()=>{Po.get(e)===o&&(Po.delete(e),Mo(e,t,n))})}function jo(e,t,n=[],o=[],r={}){return new Proxy(t,{get:(t,i)=>i in t||"string"!=typeof i||!/^on[A-Z]/.test(i)?t[i]:n.includes(i)?void 0:(t,n)=>{if(function(e){const t=Yo.get(e);if(Co.has(e)||t&&Co.has(t))return!0;for(const t of Co)if(e.contains(t))return!0;return!1}(e))return;const s=function(e,t){return void 0===t&&!!e&&"object"==typeof e&&"reason"in e&&!("undefined"!=typeof Event&&e instanceof Event)}(t,n),{cancel:a,canceled:c,...l}=(s?t:n)??{},u=s?l:{...l,value:t},d=o.includes(i)?function(){const e=[];let t=!0;return{waitUntil:n=>{if(!t)throw new DOMException("waitUntil() can only be called while the event dispatches.","InvalidStateError");e.push(n)},done:()=>(t=!1,e)}}():void 0;d&&(u.waitUntil=d.waitUntil);const p=new CustomEvent(r[i]??i.slice(2).toLowerCase(),{detail:u,bubbles:!1,cancelable:"function"==typeof a||"function"==typeof t?.preventDefault,composed:!0}),f=e.dispatchEvent(p),h=d?.done()??[];return f||("function"==typeof a?a():t&&"function"==typeof t.preventDefault&&t.preventDefault()),h.length>1?Promise.all(h).then(e=>e.at(-1)):h[0]}})}var Do,Lo=new WeakMap,Wo=/^(?:get|is|can)[A-Z]|^focus$/,$o=new Map,No=new Set;function Fo(){if(Do)return Do;const e=globalThis,t=Symbol.for("ui-sdk.web-styles@1");return e[t]=(e[t]??0)+1,Do=`ui-sdk-web-${e[t]}`}var qo="",Vo=0,Ro=new WeakMap;function Bo(e,t,n=!1){n&&No.add(e),(t||n)&&(t&&$o.set(e,t),qo=Io(),(0,he.Vg)(document,Fo(),qo),Vo++)}function Io(){return["@layer ui-sdk {",' :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important }',...[...$o].map(([e,t])=>` :where(${e}:not([hidden]), ${e}[hidden="until-found"]) { display: ${t} }`),...[...No].map(e=>` :where(${e}[align]) { text-align: inherit }`)," :where([as-child]) { display: contents }","}"].join("\n")}function Ho(e){const t=e.getRootNode();if(!Uo(t))return n=e.ownerDocument,void(qo&&(0,he.Vg)(n,Fo(),qo));var n;const o=function(e){const t=e.defaultView;if(!t)return;let n=Ro.get(e);return n||Ro.set(e,n={sheet:new t.CSSStyleSheet,version:-1}),n.version!==Vo&&(n.sheet.replaceSync(Io()),n.version=Vo),n.sheet}(t.ownerDocument);o&&!t.adoptedStyleSheets.includes(o)&&(t.adoptedStyleSheets=[o,...t.adoptedStyleSheets])}var Uo=e=>11===e.nodeType&&"host"in e,zo=new Set;function Ko(e){for(const t of zo)t!==e&&e.contains(t)&&t.reconfigure()}var Xo=new WeakMap,Yo=new WeakMap,_o=new WeakMap,Qo=new WeakSet,Zo=new WeakMap,Go=e=>void 0!==e.value&&"string"!=typeof e.value;function Jo(e,t,n){for(let o=e.parentElement;o;o=o.parentElement){const e=_o.get(o);if(e?.slot===t&&Yo.get(o)===n)return e.keyed&&Go(e.props)?{...e.props,value:e.props.id}:e.props}}function er(e,t){const n=e.getAttribute("for");if(n){const o=e.getRootNode(),r="getElementById"in o?o.getElementById(n):null;if(r?.matches(t))return r}for(let n=e.parentElement;n;n=n.parentElement){if(n.matches(t))return n;const e=Yo.get(n);if(e?.matches(t))return e}}function tr(e,t){queueMicrotask(()=>{e.isConnected||t()})}var nr=new WeakMap,or=(e,t,n)=>(nr.set(e,n.state),Gn(e,t,n));function rr(e){return class extends e{static formAssociated=!0;#e;constructor(){super(),this.#e=this.attachInternals(),function(e,t,n){Bn.set(e,{internals:t,bind:n})}(this,this.#e,or)}get form(){return this.#e.form}get labels(){return this.#e.labels}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get validity(){return this.#e.validity}get validationMessage(){return this.#e.validationMessage}get willValidate(){return this.#e.willValidate}checkValidity(){return this.#e.checkValidity()}reportValidity(){return this.#e.reportValidity()}setCustomValidity(e){Zn(this,"customValidity",e)||this.#e.setValidity(e?{customError:!0}:{},e)}formResetCallback(){Po.delete(this),Zn(this,"reset")}formDisabledCallback(e){Zn(this,"disabled",e)}formStateRestoreCallback(e,t){Po.delete(this),Mo(this,e,t)||xo(this,e,t)}}}var ir=e=>`default${e[0].toUpperCase()}${e.slice(1)}`;function sr(e,t,n){if(!po(e))return;Bo(e,n.display);const o={debug:"boolean",...n.attributes},r=n.state??{},i=(e,t,i)=>{const s=So(e,o);for(const e of i)delete s[e];for(const[e,n]of Object.entries(t))void 0!==n&&(s[e]=n);for(const e of Object.keys(r)){if(!(e in s))continue;const t=ir(e);t in s||(s[t]=s[e]),delete s[e]}return{...s,...n.options?.(e)}};customElements.define(e,class s extends(n.formAssociated?rr(HTMLElement):HTMLElement){static observedAttributes=[...Object.keys(o).map(vo),...bo];#t;get#n(){return Lo.get(this)}get api(){if(this.#n)return this.#t??=function(e,t,n){const o={};for(const r of n){const n=t[r];"function"==typeof n&&(o[r]=(...o)=>(Wo.test(r)||To(e),n.apply(t,o)))}return Object.freeze(o)}(this,this.#n.api,n.api??[])}#o=new Set;#r=new Set;#i=!1;#s=!1;#a=new Set;#c=new Set;#l=new Set;#u=!1;#d={};#p={};#f;static{for(const[e,{get:t,set:n}]of Object.entries(r))Object.defineProperty(s.prototype,e,{get(){return e in this.#p?this.#p[e]:this.#n?t(this.#n.api):void 0},set(t){To(this),this.#n&&!this.#u?this.#h(()=>n(this.#n.api,t)):this.#p[e]=t}});for(const e of n.properties??[])Object.defineProperty(s.prototype,e,{get(){return this.#d[e]},set(t){Object.is(this.#d[e],t)||(this.#d[e]=t,this.#i&&(this.#g(),this.#m()))}});Oo(s.prototype,o,n.defaults)}#g(e){this.#n?.setOptions(jo(this,{...i(this,this.#d,this.#a),...e,id:this.#n.id},n.silent,n.actions,n.events))}attributeChangedCallback(e,t,n){if(no(this,e),bo.includes(e))return;const i=e.replace(/-(\w)/g,(e,t)=>t.toUpperCase());if(i in r&&n!==t&&!this.#s&&To(this),this.#s&&null!==n?null===t&&this.#a.add(i):this.#a.delete(i),!this.#i)return;if(this.#g(),Ko(this),!(i in r)||n===t)return;const s=o[i],a="boolean"!==s&&("list"===s?[]:null);this.#h(()=>r[i].set(this.#n.api,null===n?a:yo(s,n)))}#h(e){const t=Co.has(this);Co.add(this);try{!function(e,t){if(ao.has(e))return t();ao.add(e);try{t()}finally{ao.delete(e)}}(this,e)}finally{t||(Co.delete(this),zn(this))}}connectedCallback(){if(Ho(this),this.#i){for(const e of this.#o)Xn(e.el);return void(n.options&&this.#g())}Eo(this,[...Object.keys(r),...n.properties??[],...Object.keys(o)]);for(const[e,t]of Object.entries(n.host??{}))this.hasAttribute(e)||this.setAttribute(e,t);const s=this.#u&&!Object.keys(this.#p).length?this.#f:void 0,a={};if(this.#u&&void 0===s)for(const[e,{get:t}]of Object.entries(r))a[e]=t(this.#n.api);Object.assign(a,this.#p),this.#p={};const c=Object.fromEntries(Object.entries(a).map(([e,t])=>[ir(e),t]));this.#u&&(Lo.delete(this),this.#t=void 0,this.#u=!1,this.#f=void 0);let l=this.#n;if(l?this.#g():(l=t(jo(this,{...i(this,this.#d,this.#a),...c,id:this.id||`ui-sdk-${e.replace(/^ui-/,"")}-${++lo}`},n.silent,n.actions,n.events)),Lo.set(this,l)),n.formAssociated&&Object.keys(a).length){const e=l.startState(i(this,this.#d,this.#a));this.#g(Object.fromEntries(Object.keys(a).map(t=>[ir(t),e[t]])))}if(this.#i=!0,n.options&&zo.add(this),n.self){const e=go(this,n.target);e&&this.#v(e)}for(const[e,t]of Object.entries(n.children??{})){const o=t(this);o?this.#b(e,o):n.optionalChildren?.includes(e)||h()}if((n.children||n.target)&&(this.#y=new MutationObserver(()=>{this.#w(),this.#k()}),this.#y.observe(this,{childList:!0})),this.#m(),this.id){const e=this.getRootNode();for(const t of e.querySelectorAll(`[for="${CSS.escape(this.id)}"]`))Zo.get(t)?.()}void 0!==s&&xo(this,s,"restore")}#S;#m(){this.#S?.(),this.#S=n.render?.(this,this.#n)||void 0}reconfigure(){this.#i&&this.#g()}#A=new Map;#y;#O;#v(e){this.#O={slot:n.self,el:e,props:{}},this.register(this.#O)}#k(){if(!n.self||!n.target)return;const e=go(this,n.target);e!==this.#O?.el&&(this.#O&&this.unregister(this.#O),this.#O=void 0,this.#g(),e&&this.#v(e))}#b(e,t){const o={slot:e,el:t,props:n.childProps?.read?.(t)??{}};n.childProps&&(o.observer=new MutationObserver(()=>{o.props=n.childProps.read?.(t)??{},this.#g(),this.update(o,!1)}),o.observer.observe(t,{attributeFilter:n.childProps.attributes})),this.#A.set(e,o),this.register(o)}#w(){for(const[e,t]of Object.entries(n.children??{})){const n=t(this),o=this.#A.get(e);o?.el!==n&&(o&&(this.unregister(o),this.#A.delete(e)),n&&this.#b(e,n))}}disconnectedCallback(){tr(this,()=>{this.#f=nr.get(this)?.(),this.#S?.(),this.#S=void 0,this.#y?.disconnect(),this.#y=void 0,this.#A.clear(),this.#O=void 0,this.#i=!1,zo.delete(this);for(const e of this.#o)this.unregister(e);this.#n?.destroy(),this.#u=!0})}register(e){this.#o.add(e),Qo.add(e),e.sync=()=>this.#r.has(e)||this.#E(e),this.#r.size||queueMicrotask(()=>this.#C()),this.#r.add(e)}#C(){const e=p([...this.#r]);this.#r.clear();for(const t of e)this.#o.has(t)&&(t.reread&&(t.props=t.reread()),t.feature&&this.#n.use(t.feature),this.#M(t),this.#E(t))}#M(e){const t=this.#n;e.unwatch?.();const n=t.part(e.slot,e.props);e.record=n,e.selected=Qt(n),e.version=yn(t),e.unwatch=function(e,t,n=e.props){const o=Bt(e).selects,r=[Ut(e),o?o.subscribe(e,t,n):Ft(e.store,Zt,t)];return()=>r.forEach(e=>e())}(n,o=>{if(_t(n)!==e.shown)return e.version=yn(t),this.#E(e);if(o)return;const r=yn(t);r!==e.version&&(e.version=r,this.#E(e))})}unregister(e){e.unwatch?.(),e.unwatch=void 0,e.observer?.disconnect(),e.observer=void 0,this.#P(e),oo(e.el,{},this.#T,!0),e.disconnect?.(),e.disconnect=void 0,this.#x(e),this.#o.delete(e),Qo.delete(e),this.#r.delete(e),function(e){e.dataSlot=void 0;const t=[];for(let n=e.el;n;n=n.parentElement){const o=_o.get(n);o&&o!==e&&o.el===e.el&&Qo.has(o)&&t.push(o)}if(t.length){e.el.removeAttribute("data-slot"),no(e.el,"data-slot");for(const e of t)e.sync?.()}}(e)}rebind(){const e=p([...this.#o].filter(e=>!this.#r.has(e)));for(const t of e)this.#P(t);for(const t of e)this.#E(t)}update(e,t){if(!this.#r.has(e)){this.#j(e,t),this.#E(e);for(const t of this.#o)if(t!==e&&!this.#r.has(t)){if(t.reread){const e=t.props;t.props=t.reread(),this.#j(t,mo(e,t.props))}this.#E(t)}Ko(e.el)}}#j(e,t){t&&this.#P(e);const n=this.#n.part(e.slot,e.props);n===e.record&&Qt(n)===e.selected||this.#M(e)}#E(e){if(this.#c.has(e))return void this.#l.add(e);Ho(e.el);const t=this.#n.part(e.slot,e.props);if(e.disconnect??=((e,t)=>Bt(e).connect?.(t)??(()=>{}))(t,e.el),e.shown=_t(t),e.shown){const n=this.#D(e);void 0!==n&&this.#L(e,n)&&(this.#P(e),this.#W(e,n));const o=Kt(t);void 0===o.hidden&&(function(e){return void 0!==Bt(e).present}(t)||"hidden"in o)&&e.el.removeAttribute("hidden"),this.#$(e,o),e.unbind||this.#N(e,t)}else{e.unbind&&(this.#$(e,Kt(t)),this.#P(e)),e.el.hasAttribute("hidden")||e.el.setAttribute("hidden","");const n=Kt(t)["data-slot"];n&&!e.el.hasAttribute("data-slot")&&e.el.setAttribute("data-slot",n),this.#x(e)}}#N(e,t){let n,o=!1;e.unbind=()=>{o=!0,n?.()},n=function(e,t,n={by:"core"}){const o=e,{parts:r}=o.owner,i=`${e.slot}:${e.key}`;e.el||(r.get(i)??o)!==o||(r.delete(i),r.set(i,o));const s={};e.el=t,o.binding=s;const a=[Ut(o)];(function(e){const t=Bt(e);let n=Jt.get(t);return void 0===n&&(n=!!t.attrs&&"hidden"in t.attrs(e.store.get(),It(e,e.props)),Jt.set(t,n)),n})(e)&&(0,he.b1)(t.ownerDocument);for(const[o,r]of Object.entries(function(e){const{on:t,press:n}=Bt(e),o={};for(const n in t){const r=t[n];o[n]=t=>{t.defaultPrevented||sn(t)||(Rt(e).sleeping?.wake(),r(t,Ht(e)))}}return"function"!=typeof n||o.click||(o.click=t=>{t.defaultPrevented||(Rt(e).sleeping?.wake(),n(Ht(e),t))}),o}(e)))("core"===n.by||"all"!==n.attaches&&!n.attaches.includes(o))&&a.push((0,R.on)(t,o,r));const c=Bt(e);c.live&&a.push(c.live.attach(e,t)),"framework"===n.by&&c.direct&&a.push(c.direct.attach(e,t));const l=c.asleep?.(t,e);l&&a.push(l);const u=()=>{const n=c.bind?.(t,e);n&&a.push(n)},{sleeping:d}=o.owner;return d&&c.bind?(d.binds.add(u),a.push(()=>d.binds.delete(u))):u(),c.attrs&&"undefined"!=typeof MutationObserver&&a.push(function(e,t){(t.hasAttribute("id")||void 0!==e.own)&&nn(e);const n=new MutationObserver(()=>nn(e));return n.observe(t,{attributeFilter:["id"]}),()=>n.disconnect()}(o,t)),()=>{a.forEach(e=>e()),o.binding===s&&(e.el=o.binding=void 0,void 0!==o.own&&nn(o))}}(t,e.el),o&&n()}#P(e){const t=e.unbind;e.unbind=void 0,t?.()}#D(e){if(n.portal?.slots.includes(e.slot))return n.portal.container(this,e)||(w.Bd&&!B()?document.body:null)}#L(e,t){return t?e.el.parentNode!==t:!!e.placeholder}#W(t,n){this.#x(t),n&&(t.placeholder=document.createComment(`${e} ${t.slot}`),t.el.replaceWith(t.placeholder),n.appendChild(t.el),Xo.set(t.el,n))}#$(e,t){const n=function(e,t){for(let n=e.el;n&&n!==t;n=n.parentElement){const t=_o.get(n);if(t===e)return;if(t?.el===e.el&&Qo.has(t))return t}}(e,this);n?.dataSlot&&(t={...t,"data-slot":n.dataSlot}),e.dataSlot=t["data-slot"];const o=this.#s;this.#s=e.el===this,this.#c.add(e);try{!function(e,t,n="render"){oo(e,t,n,!1)}(e.el,t,this.#T)}finally{this.#s=o,this.#c.delete(e)}this.#l.delete(e)&&this.#E(e)}get#T(){return`render:${fo(this)}`}#x(e){e.placeholder&&(e.placeholder.replaceWith(e.el),e.placeholder=void 0,Xo.delete(e.el))}})}var ar=new WeakMap;function cr(e,t,n={}){const o={},r=[],i=[],s=[];let a=!1;const c={};for(const[l,u]of Object.entries({...e,...n})){if(!u)continue;if("object"==typeof u){const[e,o=l]=u.from.split(".");if(e in t.slots&&(c[l]={slot:e,prop:o}),!(l in n))continue}const e="object"==typeof u?u.kind:u;"value"===e?r.push(l):"action"===e?s.push(l):"id"===e?i.push(l):"key"===e&&(a=!0),"value"!==e&&"action"!==e&&"callback"!==e&&("id"!==l||l in n)&&(o[l]="id"===e||"key"===e?"string":e)}return{attributes:o,properties:r,ids:i,actions:s,keyed:a,from:Object.keys(c).length?c:void 0}}var lr=e=>"string"==typeof e?{tag:e}:e;function ur(e,t,n,o){const r=function(e){let t=bn.get(e);if(!t){const{options:n,slots:o={}}=e;t={options:{debug:"boolean",...n},slots:Object.fromEntries(Object.entries(o).map(([e,t])=>[e,t.props??{}]))},bn.set(e,t)}return t}(e);if("root"===t){const{tag:o,self:i,kinds:s,properties:a=[],...c}=lr(n);ar.set(e,[...new Set([...ar.get(e)??[],o])]);const{debug:l,...u}=r.options,d=cr(u,r,s);return{kind:"owner",key:t,tagName:o,config:{...c,self:i??("root"in r.slots&&!c.children?.root?"root":void 0),attributes:d.attributes,properties:[...new Set([...d.properties,...a])].filter(e=>!c.state?.[e]),actions:d.actions}}}const{tag:i,slot:s=t,owners:a=[],kinds:c,properties:l=[],...u}=lr(n),d=ar.get(e);if(!d)throw new Error(`<${i}> is a part of ${e.name}: define its root first.`);const p=r.slots[s]??(u.feature?.slots[s]&&(u.feature.slots[s].props??{}));if(!p)throw new Error(`<${i}>: ${e.name} has no ${s} slot.`);const{attributes:f,...h}=cr(p,r,c);return{kind:"part",key:t,tagName:i,config:{...u,slot:s,owner:[...new Set([...o?[o]:[],...d,...a])].join(", "),props:f,...h,properties:[...new Set([...h.properties,...l])]}}}function dr(e,t){"owner"===t.kind?sr(t.tagName,e,t.config):function(e,t){if(!po(e))return;const n=t.props??{};Bo(e,t.display,"align"in n),customElements.define(e,class e extends(t.formAssociated?rr(HTMLElement):HTMLElement){static observedAttributes=[...Object.keys(n).map(vo),"for",...bo];#F;#q;#d={};constructor(){super(),Zo.set(this,()=>{this.isConnected&&this.connectedCallback()})}static{for(const o of t.properties??[])Object.defineProperty(e.prototype,o,{get(){return this.#d[o]??(n[o]&&ko(this,o,n[o]))},set(e){this.#d[o]=e,this.attributeChangedCallback("")}});Oo(e.prototype,n,t.defaults)}#V(){const e={...t.context?.(this),...So(this,n)};for(const n of t.properties??[])void 0!==this.#d[n]&&(e[n]=this.#d[n]);for(const[n,{slot:o,prop:r}]of Object.entries(t.from??{}))e[n]??=Jo(this,o,this.#F)?.[r];for(const n of t.ids??[])e[n]??=fo(this);var o;return void 0===e.value&&void 0===e.id&&(e.id=fo(this)),t.keyed&&Go(e)&&(e.id??=(o=this.#F,o?Lo.get(o):void 0)?.api.internal.keyOf(e.value)),jo(this,e,[],t.actions)}#R;connectedCallback(){Eo(this,[...t.properties??[],...Object.keys(n)]),Ho(this),!t.target&&!this.hasAttribute("as-child")||this.#R||(this.#R=new MutationObserver(()=>this.#B()),this.#R.observe(this,{childList:!0}));const e=er(this,t.owner)??this.#F;if(!e)return queueMicrotask(()=>this.#I());if(!("register"in e))return void customElements.whenDefined(e.localName).then(()=>this.isConnected&&this.connectedCallback());if(e===this.#F&&this.#q&&Qo.has(this.#q))return;this.#F&&this.#q&&this.#F.unregister(this.#q);const o=go(this,t.target);if(!o)return queueMicrotask(()=>{this.isConnected&&!this.#q&&go(this,t.target)});!this.#q&&(t.render?.(this),this.#q)||(this.#F=e,this.#q={slot:t.slot,feature:t.feature,el:o,props:this.#V(),reread:(t.context||t.from)&&(()=>this.#V()),keyed:t.keyed},Yo.set(this,e),_o.set(this,this.#q),e.register(this.#q))}#I(){this.isConnected&&!this.#F&&(er(this,t.owner)?this.connectedCallback():t.alone?t.alone(go(this,t.target)??this,this):this.hasAttribute("for")||t.owner)}#B(){const e=this.#q?.el;if(!this.isConnected||e&&Xo.has(e))return;const n=go(this,t.target);n!==(e??null)&&(this.#F&&this.#q&&this.#F.unregister(this.#q),this.#F=void 0,this.#q=void 0,n&&this.connectedCallback())}disconnectedCallback(){tr(this,()=>{this.#R?.disconnect(),this.#R=void 0,this.#F&&this.#q&&this.#F.unregister(this.#q),Yo.delete(this),_o.delete(this),this.#F=void 0,this.#q=void 0})}attributeChangedCallback(e){if(no(this,e),bo.includes(e))return;if("for"===e){if(!this.isConnected)return;return!er(this,t.owner)&&this.#F&&this.#q&&(this.#F.unregister(this.#q),this.#F=void 0,Yo.delete(this)),void this.connectedCallback()}if(!this.#F||!this.#q)return void(t.alone&&this.isConnected&&!er(this,t.owner)&&t.alone(go(this,t.target)??this,this));const n=this.#q.props;this.#q.props=this.#V();const o=this.#q.props,r=mo(n,o)||!!t.rebind?.some(e=>n[e]!==o[e]);this.#F.update(this.#q,r),t.changed?.(this)}})}(t.tagName,t.config)}var pr=e=>e.replace(/(^|-)(\w)/g,(e,t,n)=>n.toUpperCase());function fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function hr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fr(Object(n),!0).forEach(function(t){gr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gr(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}const vr=new Map,br=new WeakMap;function yr(e,t){return[...e.querySelectorAll(t)].find(t=>t.closest("bl-quick-look")===e)}const wr=function(e,t){const n={};for(const o of function(e,t){const{root:n,...o}=t,r=ur(e,"root",n);return[r,...Object.entries(o).flatMap(([t,n])=>n?[ur(e,t,n,r.tagName)]:[])]}(e,t))dr(e,o),n[pr(o.key)]="undefined"==typeof customElements?void 0:customElements.get(o.tagName);return n}(Rn,{root:{tag:"bl-quick-look",display:"contents",state:{open:{get:e=>e.isOpen(),set:(e,t)=>e.setOpen(t)}},api:["isOpen","setOpen","open","close","toggle","getPayload","focus"],render:(e,t)=>function(e,t){const n=e.ownerDocument,o=new AbortController,r={signal:o.signal};let i,s,a,c,l=!1,u=!1;vr.set(e,t);const d=(e,t)=>void 0!==e&&t.clientX>=e.left&&t.clientX<=e.right&&t.clientY>=e.top&&t.clientY<=e.bottom,p=(t,n)=>{const o=t.target;if(!(o instanceof Element))return;const r=o.closest(n);return(null==r?void 0:r.closest("bl-quick-look"))===e?r:void 0},f=()=>[...vr].some(e=>{let t=(s=2,function(e){if(Array.isArray(e))return e}(i=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,s,a=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(a.push(o.value),a.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw r}}return a}}(i,s)||function(e,t){if(e){if("string"==typeof e)return mr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mr(e,t):void 0}}(i,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=t[0],r=t[1];var i,s;return o.ownerDocument===n&&r.isOpen()}),h=()=>{clearTimeout(i),i=void 0},g=()=>{clearTimeout(s),s=void 0},m=()=>{h(),g(),l=!1},v=()=>{l&&void 0===s&&(s=setTimeout(()=>{s=void 0,l&&t.close()},250))};e.addEventListener("pointerover",n=>{if("mouse"!==n.pointerType||u||f())return;const o=p(n,"bl-quick-look-trigger");if(!o)return;const r=ho(o);if(!r)throw new Error("Quick Look trigger requires a native button or link.");n.relatedTarget instanceof Node&&r.contains(n.relatedTarget)||r.matches(':disabled, [aria-disabled="true"]')||(c=n,h(),a=r.getBoundingClientRect(),i=setTimeout(()=>{if(i=void 0,r.isConnected&&r.closest("bl-quick-look")===e&&!r.matches(':disabled, [aria-disabled="true"]')&&!f()){if(!yr(e,"bl-quick-look-content"))throw new Error("Quick Look requires a bl-quick-look-content part.");a=r.getBoundingClientRect(),br.set(e,r),l=!0,t.setOpen(!0),t.isOpen()||(l=!1)}},500))},r),e.addEventListener("pointerout",e=>{const t=p(e,"bl-quick-look-trigger"),n=t&&ho(t);!n||e.relatedTarget instanceof Node&&n.contains(e.relatedTarget)||h()},r),e.addEventListener("click",t=>{p(t,"bl-quick-look-trigger")&&(br.delete(e),m())},hr(hr({},r),{},{capture:!0}));for(const t of["pointerdown","keydown"])e.addEventListener(t,e=>{p(e,"bl-quick-look-content")&&m()},hr(hr({},r),{},{capture:!0}));return n.addEventListener("pointermove",t=>{if("mouse"!==t.pointerType)return;c=t;const n=d(a,t);if(n||(u=!1),!l)return;const o=yr(e,"bl-quick-look-content");n||d(null==o?void 0:o.getBoundingClientRect(),t)?g():v()},hr(hr({},r),{},{capture:!0})),n.addEventListener("pointerout",e=>{null===e.relatedTarget&&(c=void 0,u=!1,h(),v())},r),e.addEventListener("openchange",()=>{h(),g(),queueMicrotask(()=>{o.signal.aborted||t.isOpen()||(l=!1,u=void 0!==c&&d(a,c))})},r),()=>{o.abort(),m(),vr.delete(e),br.delete(e)}}(e,t.api)},trigger:{tag:"bl-quick-look-trigger",target:ho,display:"contents"},backdrop:"bl-quick-look-backdrop",content:{tag:"bl-quick-look-content",context:e=>{const t=e.closest("bl-quick-look");return{finalFocus:()=>{var e;if(!t)return;const n=yr(t,"bl-quick-look-trigger");return null!==(e=br.get(t))&&void 0!==e?e:n&&ho(n)}}}},title:"bl-quick-look-title",description:"bl-quick-look-description",close:{tag:"bl-quick-look-close",target:ho,display:"contents"}});wr.Root,wr.Trigger,wr.Backdrop,wr.Content,wr.Title,wr.Description,wr.Close})();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type DialogEvents, type UiDialogElement } from "@ui-sdk/web";
|
|
2
|
+
export type QuickLookElement<Payload = unknown> = UiDialogElement<Payload>;
|
|
3
|
+
export type QuickLookEvents<Payload = unknown> = DialogEvents<Payload>;
|
|
4
|
+
export declare const QuickLook: CustomElementConstructor | undefined, QuickLookTrigger: CustomElementConstructor | undefined, QuickLookBackdrop: CustomElementConstructor | undefined, QuickLookContent: CustomElementConstructor | undefined, QuickLookTitle: CustomElementConstructor | undefined, QuickLookDescription: CustomElementConstructor | undefined, QuickLookClose: CustomElementConstructor | undefined;
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
"bl-quick-look": QuickLookElement;
|
|
8
|
+
"bl-quick-look-trigger": HTMLElement;
|
|
9
|
+
"bl-quick-look-backdrop": HTMLElement;
|
|
10
|
+
"bl-quick-look-content": HTMLElement;
|
|
11
|
+
"bl-quick-look-title": HTMLElement;
|
|
12
|
+
"bl-quick-look-description": HTMLElement;
|
|
13
|
+
"bl-quick-look-close": HTMLElement;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { dialog } from "@ui-sdk/core/dialog";
|
|
2
|
+
import { createParts, wrappedButton } from "@ui-sdk/web";
|
|
3
|
+
// src/js/quick-look.ts
|
|
4
|
+
var instances = /* @__PURE__ */ new Map();
|
|
5
|
+
var returnTargets = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
function ownedPart(root, selector) {
|
|
7
|
+
return [...root.querySelectorAll(selector)].find((part) => part.closest("bl-quick-look") === root);
|
|
8
|
+
}
|
|
9
|
+
function bindHover(root, api) {
|
|
10
|
+
const document = root.ownerDocument;
|
|
11
|
+
const listeners = new AbortController();
|
|
12
|
+
const options = { signal: listeners.signal };
|
|
13
|
+
let openTimer;
|
|
14
|
+
let closeTimer;
|
|
15
|
+
let hoverOpen = false;
|
|
16
|
+
let blockedUntilExit = false;
|
|
17
|
+
let triggerBounds;
|
|
18
|
+
let pointer;
|
|
19
|
+
instances.set(root, api);
|
|
20
|
+
const containsPoint = (rect, point) => rect !== void 0 && point.clientX >= rect.left && point.clientX <= rect.right && point.clientY >= rect.top && point.clientY <= rect.bottom;
|
|
21
|
+
const eventPart = (event, selector) => {
|
|
22
|
+
const target = event.target;
|
|
23
|
+
if (!(target instanceof Element)) return;
|
|
24
|
+
const part = target.closest(selector);
|
|
25
|
+
if (part?.closest("bl-quick-look") === root) return part;
|
|
26
|
+
};
|
|
27
|
+
const anyOpen = () => [...instances].some(([element, instance]) => element.ownerDocument === document && instance.isOpen());
|
|
28
|
+
const cancelOpen = () => {
|
|
29
|
+
clearTimeout(openTimer);
|
|
30
|
+
openTimer = void 0;
|
|
31
|
+
};
|
|
32
|
+
const cancelClose = () => {
|
|
33
|
+
clearTimeout(closeTimer);
|
|
34
|
+
closeTimer = void 0;
|
|
35
|
+
};
|
|
36
|
+
const activate = () => {
|
|
37
|
+
cancelOpen();
|
|
38
|
+
cancelClose();
|
|
39
|
+
hoverOpen = false;
|
|
40
|
+
};
|
|
41
|
+
const scheduleClose = () => {
|
|
42
|
+
if (!hoverOpen || closeTimer !== void 0) return;
|
|
43
|
+
closeTimer = setTimeout(() => {
|
|
44
|
+
closeTimer = void 0;
|
|
45
|
+
if (hoverOpen) api.close();
|
|
46
|
+
}, 250);
|
|
47
|
+
};
|
|
48
|
+
root.addEventListener("pointerover", (event) => {
|
|
49
|
+
if (event.pointerType !== "mouse" || blockedUntilExit || anyOpen()) return;
|
|
50
|
+
const trigger = eventPart(event, "bl-quick-look-trigger");
|
|
51
|
+
if (!trigger) return;
|
|
52
|
+
const button = wrappedButton(trigger);
|
|
53
|
+
if (!button) throw new Error("Quick Look trigger requires a native button or link.");
|
|
54
|
+
if (event.relatedTarget instanceof Node && button.contains(event.relatedTarget)) return;
|
|
55
|
+
if (button.matches(":disabled, [aria-disabled=\"true\"]")) return;
|
|
56
|
+
pointer = event;
|
|
57
|
+
cancelOpen();
|
|
58
|
+
triggerBounds = button.getBoundingClientRect();
|
|
59
|
+
openTimer = setTimeout(() => {
|
|
60
|
+
openTimer = void 0;
|
|
61
|
+
if (!button.isConnected || button.closest("bl-quick-look") !== root || button.matches(":disabled, [aria-disabled=\"true\"]") || anyOpen()) return;
|
|
62
|
+
if (!ownedPart(root, "bl-quick-look-content")) throw new Error("Quick Look requires a bl-quick-look-content part.");
|
|
63
|
+
triggerBounds = button.getBoundingClientRect();
|
|
64
|
+
returnTargets.set(root, button);
|
|
65
|
+
hoverOpen = true;
|
|
66
|
+
api.setOpen(true);
|
|
67
|
+
if (!api.isOpen()) hoverOpen = false;
|
|
68
|
+
}, 500);
|
|
69
|
+
}, options);
|
|
70
|
+
root.addEventListener("pointerout", (event) => {
|
|
71
|
+
const trigger = eventPart(event, "bl-quick-look-trigger");
|
|
72
|
+
const button = trigger && wrappedButton(trigger);
|
|
73
|
+
if (button && !(event.relatedTarget instanceof Node && button.contains(event.relatedTarget))) cancelOpen();
|
|
74
|
+
}, options);
|
|
75
|
+
root.addEventListener("click", (event) => {
|
|
76
|
+
if (!eventPart(event, "bl-quick-look-trigger")) return;
|
|
77
|
+
returnTargets.delete(root);
|
|
78
|
+
activate();
|
|
79
|
+
}, {
|
|
80
|
+
...options,
|
|
81
|
+
capture: true
|
|
82
|
+
});
|
|
83
|
+
for (const type of ["pointerdown", "keydown"]) root.addEventListener(type, (event) => {
|
|
84
|
+
if (eventPart(event, "bl-quick-look-content")) activate();
|
|
85
|
+
}, {
|
|
86
|
+
...options,
|
|
87
|
+
capture: true
|
|
88
|
+
});
|
|
89
|
+
document.addEventListener("pointermove", (event) => {
|
|
90
|
+
if (event.pointerType !== "mouse") return;
|
|
91
|
+
pointer = event;
|
|
92
|
+
const overTrigger = containsPoint(triggerBounds, event);
|
|
93
|
+
if (!overTrigger) blockedUntilExit = false;
|
|
94
|
+
if (!hoverOpen) return;
|
|
95
|
+
const content = ownedPart(root, "bl-quick-look-content");
|
|
96
|
+
if (overTrigger || containsPoint(content?.getBoundingClientRect(), event)) cancelClose();
|
|
97
|
+
else scheduleClose();
|
|
98
|
+
}, {
|
|
99
|
+
...options,
|
|
100
|
+
capture: true
|
|
101
|
+
});
|
|
102
|
+
document.addEventListener("pointerout", (event) => {
|
|
103
|
+
if (event.relatedTarget !== null) return;
|
|
104
|
+
pointer = void 0;
|
|
105
|
+
blockedUntilExit = false;
|
|
106
|
+
cancelOpen();
|
|
107
|
+
scheduleClose();
|
|
108
|
+
}, options);
|
|
109
|
+
root.addEventListener("openchange", () => {
|
|
110
|
+
cancelOpen();
|
|
111
|
+
cancelClose();
|
|
112
|
+
queueMicrotask(() => {
|
|
113
|
+
if (listeners.signal.aborted || api.isOpen()) return;
|
|
114
|
+
hoverOpen = false;
|
|
115
|
+
blockedUntilExit = pointer !== void 0 && containsPoint(triggerBounds, pointer);
|
|
116
|
+
});
|
|
117
|
+
}, options);
|
|
118
|
+
return () => {
|
|
119
|
+
listeners.abort();
|
|
120
|
+
activate();
|
|
121
|
+
instances.delete(root);
|
|
122
|
+
returnTargets.delete(root);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
var { Root: QuickLook, Trigger: QuickLookTrigger, Backdrop: QuickLookBackdrop, Content: QuickLookContent, Title: QuickLookTitle, Description: QuickLookDescription, Close: QuickLookClose } = createParts(dialog, {
|
|
126
|
+
root: {
|
|
127
|
+
tag: "bl-quick-look",
|
|
128
|
+
display: "contents",
|
|
129
|
+
state: { open: {
|
|
130
|
+
get: (api) => api.isOpen(),
|
|
131
|
+
set: (api, value) => api.setOpen(value)
|
|
132
|
+
} },
|
|
133
|
+
api: [
|
|
134
|
+
"isOpen",
|
|
135
|
+
"setOpen",
|
|
136
|
+
"open",
|
|
137
|
+
"close",
|
|
138
|
+
"toggle",
|
|
139
|
+
"getPayload",
|
|
140
|
+
"focus"
|
|
141
|
+
],
|
|
142
|
+
render: (root, instance) => bindHover(root, instance.api)
|
|
143
|
+
},
|
|
144
|
+
trigger: {
|
|
145
|
+
tag: "bl-quick-look-trigger",
|
|
146
|
+
target: wrappedButton,
|
|
147
|
+
display: "contents"
|
|
148
|
+
},
|
|
149
|
+
backdrop: "bl-quick-look-backdrop",
|
|
150
|
+
content: {
|
|
151
|
+
tag: "bl-quick-look-content",
|
|
152
|
+
context: (content) => {
|
|
153
|
+
const root = content.closest("bl-quick-look");
|
|
154
|
+
return { finalFocus: () => {
|
|
155
|
+
if (!root) return;
|
|
156
|
+
const trigger = ownedPart(root, "bl-quick-look-trigger");
|
|
157
|
+
return returnTargets.get(root) ?? (trigger && wrappedButton(trigger));
|
|
158
|
+
} };
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
title: "bl-quick-look-title",
|
|
162
|
+
description: "bl-quick-look-description",
|
|
163
|
+
close: {
|
|
164
|
+
tag: "bl-quick-look-close",
|
|
165
|
+
target: wrappedButton,
|
|
166
|
+
display: "contents"
|
|
167
|
+
}
|
|
168
|
+
});
|