lituix 0.1.29 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var V0=Object.create;var Da=Object.defineProperty;var Ou=Object.getOwnPropertyDescriptor;var D0=Object.getOwnPropertyNames;var F0=Object.getPrototypeOf,N0=Object.prototype.hasOwnProperty;var Hu=i=>{throw TypeError(i)};var nc=(i,o)=>()=>(i&&(o=i(i=0)),o);var L0=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),Ru=(i,o)=>{for(var e in o)Da(i,e,{get:o[e],enumerable:!0})},Iu=(i,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of D0(o))!N0.call(i,r)&&r!==e&&Da(i,r,{get:()=>o[r],enumerable:!(t=Ou(o,r))||t.enumerable});return i};var xn=(i,o,e)=>(e=i!=null?V0(F0(i)):{},Iu(o||!i||!i.__esModule?Da(e,"default",{value:i,enumerable:!0}):e,i)),B0=i=>Iu(Da({},"__esModule",{value:!0}),i),a=(i,o,e,t)=>{for(var r=t>1?void 0:t?Ou(o,e):o,n=i.length-1,s;n>=0;n--)(s=i[n])&&(r=(t?s(o,e,r):s(r))||r);return t&&r&&Da(o,e,r),r};var Vu=(i,o,e)=>o.has(i)||Hu("Cannot "+e);var ke=(i,o,e)=>(Vu(i,o,"read from private field"),e?e.call(i):o.get(i)),Du=(i,o,e)=>o.has(i)?Hu("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(i):o.set(i,e),Fu=(i,o,e,t)=>(Vu(i,o,"write to private field"),t?t.call(i,e):o.set(i,e),e);var ns,Dh=nc(()=>{ns=class{constructor(o){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,o?.roundAverageSize===!0&&(this._roundAverageSize=!0)}set(o,e){let t=this._map.get(o)||0;this._map.set(o,e),this.totalSize+=e-t}get averageSize(){if(this._map.size>0){let o=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(o):o}return 0}getSize(o){return this._map.get(o)}clear(){this._map.clear(),this.totalSize=0}}});function $c(i){return i==="horizontal"?"width":"height"}var rl,Fh=nc(()=>{rl=class{_getDefaultConfig(){return{direction:"vertical"}}constructor(o,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=o,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(o){Object.assign(this,Object.assign({},this._getDefaultConfig(),o))}get config(){return{direction:this.direction}}get items(){return this._items}set items(o){this._setItems(o)}_setItems(o){o!==this._items&&(this._items=o,this._scheduleReflow())}get direction(){return this._direction}set direction(o){o=o==="horizontal"?o:"vertical",o!==this._direction&&(this._direction=o,this._sizeDim=o==="horizontal"?"width":"height",this._secondarySizeDim=o==="horizontal"?"height":"width",this._positionDim=o==="horizontal"?"left":"top",this._secondaryPositionDim=o==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(o){let{_viewDim1:e,_viewDim2:t}=this;Object.assign(this._viewportSize,o),t!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(o){Object.assign(this._latestCoords,o);let e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(o=!1){(o||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(o){this._pin=o,this._triggerReflow()}get pin(){if(this._pin!==null){let{index:o,block:e}=this._pin;return{index:Math.max(0,Math.min(o,this.items.length-1)),block:e}}return null}_clampScrollPosition(o){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(o,this.totalScrollSize[$c(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){let o=this._scrollPosition,{index:e,block:t}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:t||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=o-this._scrollPosition}}_calculateScrollIntoViewPosition(o){let{block:e}=o,t=Math.min(this.items.length,Math.max(0,o.index)),r=this._getItemPosition(t)[this._positionDim],n=r;if(e!=="start"){let s=this._getItemSize(t)[this._sizeDim];if(e==="center")n=r-.5*this._viewDim1+.5*s;else{let d=r-this._viewDim1+s;if(e==="end")n=d;else{let h=this._scrollPosition;n=Math.abs(h-r)<Math.abs(h-d)?r:d}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}getScrollIntoViewCoordinates(o){return{[this._positionDim]:this._calculateScrollIntoViewPosition(o)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){let o=new Map;if(this._first!==-1&&this._last!==-1)for(let t=this._first;t<=this._last;t++)o.set(t,this._getItemPosition(t));let e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:o};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{let o=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>o||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(o){if(this._first===-1||this._last===-1)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let t=this._last;for(;t>this._first&&Math.round(this._getItemPosition(t)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)t--;(e!==this._firstVisible||t!==this._lastVisible)&&(this._firstVisible=e,this._lastVisible=t,o&&o.emit&&this._sendVisibilityChangedMessage())}}});var Lh={};Ru(Lh,{FlowLayout:()=>ol,flow:()=>km});function Nh(i){return i==="horizontal"?"marginLeft":"marginTop"}function xm(i){return i==="horizontal"?"marginRight":"marginBottom"}function wm(i){return i==="horizontal"?"xOffset":"yOffset"}function _m(i,o){let e=[i,o].sort();return e[1]<=0?Math.min(...e):e[0]>=0?Math.max(...e):e[0]+e[1]}var km,Tc,ol,Bh=nc(()=>{Dh();Fh();km=i=>Object.assign({type:ol},i);Tc=class{constructor(){this._childSizeCache=new ns,this._marginSizeCache=new ns,this._metricsCache=new Map}update(o,e){let t=new Set;Object.keys(o).forEach(r=>{let n=Number(r);this._metricsCache.set(n,o[n]),this._childSizeCache.set(n,o[n][$c(e)]),t.add(n),t.add(n+1)});for(let r of t){let n=this._metricsCache.get(r)?.[Nh(e)]||0,s=this._metricsCache.get(r-1)?.[xm(e)]||0;this._marginSizeCache.set(r,_m(n,s))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(o,e){return this._metricsCache.get(o)?.[Nh(e)]||0}getChildSize(o){return this._childSizeCache.getSize(o)}getMarginSize(o){return this._marginSizeCache.getSize(o)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}},ol=class extends rl{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Tc,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(o){this._metricsCache.update(o,this.direction),this._scheduleReflow()}_getPhysicalItem(o){return this._newPhysicalItems.get(o)??this._physicalItems.get(o)}_getSize(o){return this._getPhysicalItem(o)&&this._metricsCache.getChildSize(o)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(o){let e=this._metricsCache;if(this._first===-1||this._last===-1)return e.averageMarginSize+o*(e.averageMarginSize+this._getAverageSize());if(o<this._first){let t=this._first-o;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(t*e.averageChildSize+(t-1)*e.averageMarginSize)}else{let t=o-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+t*(e.averageChildSize+e.averageMarginSize)}}_getPosition(o){let e=this._getPhysicalItem(o),{averageMarginSize:t}=this._metricsCache;return o===0?this._metricsCache.getMarginSize(0)??t:e?e.pos:this._estimatePosition(o)}_calculateAnchor(o,e){return o<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((o+e)/2/this._delta)))}_getAnchor(o,e){if(this._physicalItems.size===0)return this._calculateAnchor(o,e);if(this._first<0)return this._calculateAnchor(o,e);if(this._last<0)return this._calculateAnchor(o,e);let t=this._getPhysicalItem(this._first),r=this._getPhysicalItem(this._last),n=t.pos;if(r.pos+this._metricsCache.getChildSize(this._last)<o)return this._calculateAnchor(o,e);if(n>e)return this._calculateAnchor(o,e);let h=this._firstVisible-1,p=-1/0;for(;p<o;)p=this._getPhysicalItem(++h).pos+this._metricsCache.getChildSize(h);return h}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;let o=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o,this._stable=!0}_getItems(){let o=this._newPhysicalItems;this._stable=!0;let e,t;if(this.pin!==null){let{index:p}=this.pin;this._anchorIdx=p,this._anchorPos=this._getPosition(p)}if(e=this._scrollPosition-this._overhang,t=this._scrollPosition+this._viewDim1+this._overhang,t<0||e>this._scrollSize){this._clearItems();return}(this._anchorIdx===null||this._anchorPos===null)&&(this._anchorIdx=this._getAnchor(e,t),this._anchorPos=this._getPosition(this._anchorIdx));let r=this._getSize(this._anchorIdx);r===void 0&&(this._stable=!1,r=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,s=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-s-r);let d=0;for(this._anchorPos+r+s<e&&(d=e-(this._anchorPos+r+s)),this._anchorPos-n>t&&(d=t-(this._anchorPos-n)),d&&(this._scrollPosition-=d,e-=d,t-=d,this._scrollError+=d),o.set(this._anchorIdx,{pos:this._anchorPos,size:r}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+r+s;this._physicalMin>e&&this._first>0;){let p=this._getSize(--this._first);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._first);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize),this._physicalMin-=p;let x=this._physicalMin;if(o.set(this._first,{pos:x,size:p}),this._physicalMin-=f,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<t&&this._last<this.items.length-1;){let p=this._getSize(++this._last);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._last);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize);let x=this._physicalMax;if(o.set(this._last,{pos:x,size:p}),this._physicalMax+=p+f,!this._stable&&!this._estimate)break}let h=this._calculateError();h&&(this._physicalMin-=h,this._physicalMax-=h,this._anchorPos-=h,this._scrollPosition-=h,o.forEach(p=>p.pos-=h),this._scrollError+=h),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){let{_first:o,_last:e}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===o&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){let{averageMarginSize:o}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(o+this._getAverageSize())+o)}get _delta(){let{averageMarginSize:o}=this._metricsCache;return this._getAverageSize()+o}_getItemPosition(o){return{[this._positionDim]:this._getPosition(o),[this._secondaryPositionDim]:0,[wm(this.direction)]:-(this._metricsCache.getLeadingMarginValue(o,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(o){return{[this._sizeDim]:this._getSize(o)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});var ia=L0((Vc,Tn)=>{(function(i,o){typeof Vc=="object"&&typeof Tn<"u"?Tn.exports=o():typeof define=="function"&&define.amd?define(o):(i=typeof globalThis<"u"?globalThis:i||self).interact=o()})(Vc,function(){"use strict";function i(c,l){var u=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);l&&(m=m.filter(function(g){return Object.getOwnPropertyDescriptor(c,g).enumerable})),u.push.apply(u,m)}return u}function o(c){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?i(Object(u),!0).forEach(function(m){s(c,m,u[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):i(Object(u)).forEach(function(m){Object.defineProperty(c,m,Object.getOwnPropertyDescriptor(u,m))})}return c}function e(c){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(c)}function t(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function r(c,l){for(var u=0;u<l.length;u++){var m=l[u];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,C(m.key),m)}}function n(c,l,u){return l&&r(c.prototype,l),u&&r(c,u),Object.defineProperty(c,"prototype",{writable:!1}),c}function s(c,l,u){return(l=C(l))in c?Object.defineProperty(c,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[l]=u,c}function d(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),l&&p(c,l)}function h(c){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},h(c)}function p(c,l){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,m){return u.__proto__=m,u},p(c,l)}function f(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function x(c){var l=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var u,m=h(c);if(l){var g=h(this).constructor;u=Reflect.construct(m,arguments,g)}else u=m.apply(this,arguments);return function(v,b){if(b&&(typeof b=="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(v)}(this,u)}}function k(){return k=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(c,l,u){var m=function(v,b){for(;!Object.prototype.hasOwnProperty.call(v,b)&&(v=h(v))!==null;);return v}(c,l);if(m){var g=Object.getOwnPropertyDescriptor(m,l);return g.get?g.get.call(arguments.length<3?c:u):g.value}},k.apply(this,arguments)}function C(c){var l=function(u,m){if(typeof u!="object"||u===null)return u;var g=u[Symbol.toPrimitive];if(g!==void 0){var v=g.call(u,m||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(u)}(c,"string");return typeof l=="symbol"?l:l+""}var S=function(c){return!(!c||!c.Window)&&c instanceof c.Window},z=void 0,T=void 0;function P(c){z=c;var l=c.document.createTextNode("");l.ownerDocument!==c.document&&typeof c.wrap=="function"&&c.wrap(l)===l&&(c=c.wrap(c)),T=c}function H(c){return S(c)?c:(c.ownerDocument||c).defaultView||T.window}typeof window<"u"&&window&&P(window);var I=function(c){return!!c&&e(c)==="object"},B=function(c){return typeof c=="function"},$={window:function(c){return c===T||S(c)},docFrag:function(c){return I(c)&&c.nodeType===11},object:I,func:B,number:function(c){return typeof c=="number"},bool:function(c){return typeof c=="boolean"},string:function(c){return typeof c=="string"},element:function(c){if(!c||e(c)!=="object")return!1;var l=H(c)||T;return/object|function/.test(typeof Element>"u"?"undefined":e(Element))?c instanceof Element||c instanceof l.Element:c.nodeType===1&&typeof c.nodeName=="string"},plainObject:function(c){return I(c)&&!!c.constructor&&/function Object\b/.test(c.constructor.toString())},array:function(c){return I(c)&&c.length!==void 0&&B(c.splice)}};function Q(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.prepared.axis;u==="x"?(l.coords.cur.page.y=l.coords.start.page.y,l.coords.cur.client.y=l.coords.start.client.y,l.coords.velocity.client.y=0,l.coords.velocity.page.y=0):u==="y"&&(l.coords.cur.page.x=l.coords.start.page.x,l.coords.cur.client.x=l.coords.start.client.x,l.coords.velocity.client.x=0,l.coords.velocity.page.x=0)}}function ye(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="drag"){var m=u.prepared.axis;if(m==="x"||m==="y"){var g=m==="x"?"y":"x";l.page[g]=u.coords.start.page[g],l.client[g]=u.coords.start.client[g],l.delta[g]=0}}}var De={id:"actions/drag",install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.draggable=De.draggable,l.map.drag=De,l.methodDict.drag="draggable",m.actions.drag=De.defaults},listeners:{"interactions:before-action-move":Q,"interactions:action-resume":Q,"interactions:action-move":ye,"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.buttons,g=u.options.drag;if(g&&g.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||m&u.options.drag.mouseButtons))return c.action={name:"drag",axis:g.lockAxis==="start"?g.startAxis:g.lockAxis},!1}},draggable:function(c){return $.object(c)?(this.options.drag.enabled=c.enabled!==!1,this.setPerAction("drag",c),this.setOnEvents("drag",c),/^(xy|x|y|start)$/.test(c.lockAxis)&&(this.options.drag.lockAxis=c.lockAxis),/^(xy|x|y)$/.test(c.startAxis)&&(this.options.drag.startAxis=c.startAxis),this):$.bool(c)?(this.options.drag.enabled=c,this):this.options.drag},beforeMove:Q,move:ye,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(c){return c.search("drag")===0}},yt=De,Ee={init:function(c){var l=c;Ee.document=l.document,Ee.DocumentFragment=l.DocumentFragment||ai,Ee.SVGElement=l.SVGElement||ai,Ee.SVGSVGElement=l.SVGSVGElement||ai,Ee.SVGElementInstance=l.SVGElementInstance||ai,Ee.Element=l.Element||ai,Ee.HTMLElement=l.HTMLElement||Ee.Element,Ee.Event=l.Event,Ee.Touch=l.Touch||ai,Ee.PointerEvent=l.PointerEvent||l.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function ai(){}var et=Ee,qr={init:function(c){var l=et.Element,u=c.navigator||{};qr.supportsTouch="ontouchstart"in c||$.func(c.DocumentTouch)&&et.document instanceof c.DocumentTouch,qr.supportsPointerEvent=u.pointerEnabled!==!1&&!!et.PointerEvent,qr.isIOS=/iP(hone|od|ad)/.test(u.platform),qr.isIOS7=/iP(hone|od|ad)/.test(u.platform)&&/OS 7[^\d]/.test(u.appVersion),qr.isIe9=/MSIE 9/.test(u.userAgent),qr.isOperaMobile=u.appName==="Opera"&&qr.supportsTouch&&/Presto/.test(u.userAgent),qr.prefixedMatchesSelector="matches"in l.prototype?"matches":"webkitMatchesSelector"in l.prototype?"webkitMatchesSelector":"mozMatchesSelector"in l.prototype?"mozMatchesSelector":"oMatchesSelector"in l.prototype?"oMatchesSelector":"msMatchesSelector",qr.pEventTypes=qr.supportsPointerEvent?et.PointerEvent===c.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,qr.wheelEvent=et.document&&"onmousewheel"in et.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},io=qr;function si(c,l){if(c.contains)return c.contains(l);for(;l;){if(l===c)return!0;l=l.parentNode}return!1}function Bn(c,l){for(;$.element(c);){if(zi(c,l))return c;c=Uo(c)}return null}function Uo(c){var l=c.parentNode;if($.docFrag(l)){for(;(l=l.host)&&$.docFrag(l););return l}return l}function zi(c,l){return T!==z&&(l=l.replace(/\/deep\//g," ")),c[io.prefixedMatchesSelector](l)}var q=function(c){return c.parentNode||c.host};function ee(c,l){for(var u,m=[],g=c;(u=q(g))&&g!==l&&u!==g.ownerDocument;)m.unshift(g),g=u;return m}function fe(c,l,u){for(;$.element(c);){if(zi(c,l))return!0;if((c=Uo(c))===u)return zi(c,l)}return!1}function Ne(c){return c.correspondingUseElement||c}function Z(c){var l=c instanceof et.SVGElement?c.getBoundingClientRect():c.getClientRects()[0];return l&&{left:l.left,right:l.right,top:l.top,bottom:l.bottom,width:l.width||l.right-l.left,height:l.height||l.bottom-l.top}}function Ae(c){var l,u=Z(c);if(!io.isIOS7&&u){var m={x:(l=(l=H(c))||T).scrollX||l.document.documentElement.scrollLeft,y:l.scrollY||l.document.documentElement.scrollTop};u.left+=m.x,u.right+=m.x,u.top+=m.y,u.bottom+=m.y}return u}function ce(c){for(var l=[];c;)l.push(c),c=Uo(c);return l}function wo(c){return!!$.string(c)&&(et.document.querySelector(c),!0)}function U(c,l){for(var u in l)c[u]=l[u];return c}function en(c,l,u){return c==="parent"?Uo(u):c==="self"?l.getRect(u):Bn(u,c)}function li(c,l,u,m){var g=c;return $.string(g)?g=en(g,l,u):$.func(g)&&(g=g.apply(void 0,m)),$.element(g)&&(g=Ae(g)),g}function Go(c){return c&&{x:"x"in c?c.x:c.left,y:"y"in c?c.y:c.top}}function ci(c){return!c||"x"in c&&"y"in c||((c=U({},c)).x=c.left||0,c.y=c.top||0,c.width=c.width||(c.right||0)-c.x,c.height=c.height||(c.bottom||0)-c.y),c}function tn(c,l,u){c.left&&(l.left+=u.x),c.right&&(l.right+=u.x),c.top&&(l.top+=u.y),c.bottom&&(l.bottom+=u.y),l.width=l.right-l.left,l.height=l.bottom-l.top}function ji(c,l,u){var m=u&&c.options[u];return Go(li(m&&m.origin||c.options.origin,c,l,[c&&l]))||{x:0,y:0}}function di(c,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(w){return!0},m=arguments.length>3?arguments[3]:void 0;if(m=m||{},$.string(c)&&c.search(" ")!==-1&&(c=qn(c)),$.array(c))return c.forEach(function(w){return di(w,l,u,m)}),m;if($.object(c)&&(l=c,c=""),$.func(l)&&u(c))m[c]=m[c]||[],m[c].push(l);else if($.array(l))for(var g=0,v=l;g<v.length;g++){var b=v[g];di(c,b,u,m)}else if($.object(l))for(var y in l)di(qn(y).map(function(w){return"".concat(c).concat(w)}),l[y],u,m);return m}function qn(c){return c.trim().split(/ +/)}var $a=function(c,l){return Math.sqrt(c*c+l*l)},C1=["webkit","moz"];function ws(c,l){c.__set||(c.__set={});var u=function(g){if(C1.some(function(v){return g.indexOf(v)===0}))return 1;typeof c[g]!="function"&&g!=="__set"&&Object.defineProperty(c,g,{get:function(){return g in c.__set?c.__set[g]:c.__set[g]=l[g]},set:function(v){c.__set[g]=v},configurable:!0})};for(var m in l)u(m);return c}function _s(c,l){c.page=c.page||{},c.page.x=l.page.x,c.page.y=l.page.y,c.client=c.client||{},c.client.x=l.client.x,c.client.y=l.client.y,c.timeStamp=l.timeStamp}function Kd(c){c.page.x=0,c.page.y=0,c.client.x=0,c.client.y=0}function Wd(c){return c instanceof et.Event||c instanceof et.Touch}function Ms(c,l,u){return c=c||"page",(u=u||{}).x=l[c+"X"],u.y=l[c+"Y"],u}function Ud(c,l){return l=l||{x:0,y:0},io.isOperaMobile&&Wd(c)?(Ms("screen",c,l),l.x+=window.scrollX,l.y+=window.scrollY):Ms("page",c,l),l}function Ta(c){return $.number(c.pointerId)?c.pointerId:c.identifier}function z1(c,l,u){var m=l.length>1?Gd(l):l[0];Ud(m,c.page),function(g,v){v=v||{},io.isOperaMobile&&Wd(g)?Ms("screen",g,v):Ms("client",g,v)}(m,c.client),c.timeStamp=u}function Il(c){var l=[];return $.array(c)?(l[0]=c[0],l[1]=c[1]):c.type==="touchend"?c.touches.length===1?(l[0]=c.touches[0],l[1]=c.changedTouches[0]):c.touches.length===0&&(l[0]=c.changedTouches[0],l[1]=c.changedTouches[1]):(l[0]=c.touches[0],l[1]=c.touches[1]),l}function Gd(c){for(var l={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},u=0;u<c.length;u++){var m=c[u];for(var g in l)l[g]+=m[g]}for(var v in l)l[v]/=c.length;return l}function Vl(c){if(!c.length)return null;var l=Il(c),u=Math.min(l[0].pageX,l[1].pageX),m=Math.min(l[0].pageY,l[1].pageY),g=Math.max(l[0].pageX,l[1].pageX),v=Math.max(l[0].pageY,l[1].pageY);return{x:u,y:m,left:u,top:m,right:g,bottom:v,width:g-u,height:v-m}}function Dl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[0][u]-g[1][u],b=g[0][m]-g[1][m];return $a(v,b)}function Fl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[1][u]-g[0][u],b=g[1][m]-g[0][m];return 180*Math.atan2(b,v)/Math.PI}function Yd(c){return $.string(c.pointerType)?c.pointerType:$.number(c.pointerType)?[void 0,void 0,"touch","pen","mouse"][c.pointerType]:/touch/.test(c.type||"")||c instanceof et.Touch?"touch":"mouse"}function Xd(c){var l=$.func(c.composedPath)?c.composedPath():c.path;return[Ne(l?l[0]:c.target),Ne(c.currentTarget)]}var Cs=function(){function c(l){t(this,c),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=l}return n(c,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),c}();Object.defineProperty(Cs.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var Zd=function(c,l){for(var u=0;u<l.length;u++){var m=l[u];c.push(m)}return c},Qd=function(c){return Zd([],c)},Aa=function(c,l){for(var u=0;u<c.length;u++)if(l(c[u],u,c))return u;return-1},Pa=function(c,l){return c[Aa(c,l)]},Kn=function(c){d(u,c);var l=x(u);function u(m,g,v){var b;t(this,u),(b=l.call(this,g._interaction)).dropzone=void 0,b.dragEvent=void 0,b.relatedTarget=void 0,b.draggable=void 0,b.propagationStopped=!1,b.immediatePropagationStopped=!1;var y=v==="dragleave"?m.prev:m.cur,w=y.element,M=y.dropzone;return b.type=v,b.target=w,b.currentTarget=w,b.dropzone=M,b.dragEvent=g,b.relatedTarget=g.target,b.draggable=g.interactable,b.timeStamp=g.timeStamp,b}return n(u,[{key:"reject",value:function(){var m=this,g=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&g.cur.dropzone===this.dropzone&&g.cur.element===this.target)if(g.prev.dropzone=this.dropzone,g.prev.element=this.target,g.rejected=!0,g.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var v=g.activeDrops,b=Aa(v,function(w){var M=w.dropzone,_=w.element;return M===m.dropzone&&_===m.target});g.activeDrops.splice(b,1);var y=new u(g,this.dragEvent,"dropdeactivate");y.dropzone=this.dropzone,y.target=this.target,this.dropzone.fire(y)}else this.dropzone.fire(new u(g,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),u}(Cs);function Jd(c,l){for(var u=0,m=c.slice();u<m.length;u++){var g=m[u],v=g.dropzone,b=g.element;l.dropzone=v,l.target=b,v.fire(l),l.propagationStopped=l.immediatePropagationStopped=!1}}function Nl(c,l){for(var u=function(v,b){for(var y=[],w=0,M=v.interactables.list;w<M.length;w++){var _=M[w];if(_.options.drop.enabled){var E=_.options.drop.accept;if(!($.element(E)&&E!==b||$.string(E)&&!zi(b,E)||$.func(E)&&!E({dropzone:_,draggableElement:b})))for(var O=0,D=_.getAllElements();O<D.length;O++){var V=D[O];V!==b&&y.push({dropzone:_,element:V,rect:_.getRect(V)})}}}return y}(c,l),m=0;m<u.length;m++){var g=u[m];g.rect=g.dropzone.getRect(g.element)}return u}function eu(c,l,u){for(var m=c.dropState,g=c.interactable,v=c.element,b=[],y=0,w=m.activeDrops;y<w.length;y++){var M=w[y],_=M.dropzone,E=M.element,O=M.rect,D=_.dropCheck(l,u,g,v,E,O);b.push(D?E:null)}var V=function(N){for(var G,K,X,pe=[],Ce=0;Ce<N.length;Ce++){var re=N[Ce],ve=N[G];if(re&&Ce!==G)if(ve){var ao=q(re),kt=q(ve);if(ao!==re.ownerDocument)if(kt!==re.ownerDocument)if(ao!==kt){pe=pe.length?pe:ee(ve);var Do=void 0;if(ve instanceof et.HTMLElement&&re instanceof et.SVGElement&&!(re instanceof et.SVGSVGElement)){if(re===kt)continue;Do=re.ownerSVGElement}else Do=re;for(var ui=ee(Do,ve.ownerDocument),Ri=0;ui[Ri]&&ui[Ri]===pe[Ri];)Ri++;var Os=[ui[Ri-1],ui[Ri],pe[Ri]];if(Os[0])for(var Va=Os[0].lastChild;Va;){if(Va===Os[1]){G=Ce,pe=ui;break}if(Va===Os[2])break;Va=Va.previousSibling}}else X=ve,(parseInt(H(K=re).getComputedStyle(K).zIndex,10)||0)>=(parseInt(H(X).getComputedStyle(X).zIndex,10)||0)&&(G=Ce);else G=Ce}else G=Ce}return G}(b);return m.activeDrops[V]||null}function Ll(c,l,u){var m=c.dropState,g={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return u.type==="dragstart"&&(g.activate=new Kn(m,u,"dropactivate"),g.activate.target=null,g.activate.dropzone=null),u.type==="dragend"&&(g.deactivate=new Kn(m,u,"dropdeactivate"),g.deactivate.target=null,g.deactivate.dropzone=null),m.rejected||(m.cur.element!==m.prev.element&&(m.prev.dropzone&&(g.leave=new Kn(m,u,"dragleave"),u.dragLeave=g.leave.target=m.prev.element,u.prevDropzone=g.leave.dropzone=m.prev.dropzone),m.cur.dropzone&&(g.enter=new Kn(m,u,"dragenter"),u.dragEnter=m.cur.element,u.dropzone=m.cur.dropzone)),u.type==="dragend"&&m.cur.dropzone&&(g.drop=new Kn(m,u,"drop"),u.dropzone=m.cur.dropzone,u.relatedTarget=m.cur.element),u.type==="dragmove"&&m.cur.dropzone&&(g.move=new Kn(m,u,"dropmove"),u.dropzone=m.cur.dropzone)),g}function Bl(c,l){var u=c.dropState,m=u.activeDrops,g=u.cur,v=u.prev;l.leave&&v.dropzone.fire(l.leave),l.enter&&g.dropzone.fire(l.enter),l.move&&g.dropzone.fire(l.move),l.drop&&g.dropzone.fire(l.drop),l.deactivate&&Jd(m,l.deactivate),u.prev.dropzone=g.dropzone,u.prev.element=g.element}function tu(c,l){var u=c.interaction,m=c.iEvent,g=c.event;if(m.type==="dragmove"||m.type==="dragend"){var v=u.dropState;l.dynamicDrop&&(v.activeDrops=Nl(l,u.element));var b=m,y=eu(u,b,g);v.rejected=v.rejected&&!!y&&y.dropzone===v.cur.dropzone&&y.element===v.cur.element,v.cur.dropzone=y&&y.dropzone,v.cur.element=y&&y.element,v.events=Ll(u,0,b)}}var ru={id:"actions/drop",install:function(c){var l=c.actions,u=c.interactStatic,m=c.Interactable,g=c.defaults;c.usePlugin(yt),m.prototype.dropzone=function(v){return function(b,y){if($.object(y)){if(b.options.drop.enabled=y.enabled!==!1,y.listeners){var w=di(y.listeners),M=Object.keys(w).reduce(function(E,O){return E[/^(enter|leave)/.test(O)?"drag".concat(O):/^(activate|deactivate|move)/.test(O)?"drop".concat(O):O]=w[O],E},{}),_=b.options.drop.listeners;_&&b.off(_),b.on(M),b.options.drop.listeners=M}return $.func(y.ondrop)&&b.on("drop",y.ondrop),$.func(y.ondropactivate)&&b.on("dropactivate",y.ondropactivate),$.func(y.ondropdeactivate)&&b.on("dropdeactivate",y.ondropdeactivate),$.func(y.ondragenter)&&b.on("dragenter",y.ondragenter),$.func(y.ondragleave)&&b.on("dragleave",y.ondragleave),$.func(y.ondropmove)&&b.on("dropmove",y.ondropmove),/^(pointer|center)$/.test(y.overlap)?b.options.drop.overlap=y.overlap:$.number(y.overlap)&&(b.options.drop.overlap=Math.max(Math.min(1,y.overlap),0)),"accept"in y&&(b.options.drop.accept=y.accept),"checker"in y&&(b.options.drop.checker=y.checker),b}return $.bool(y)?(b.options.drop.enabled=y,b):b.options.drop}(this,v)},m.prototype.dropCheck=function(v,b,y,w,M,_){return function(E,O,D,V,N,G,K){var X=!1;if(!(K=K||E.getRect(G)))return!!E.options.drop.checker&&E.options.drop.checker(O,D,X,E,G,V,N);var pe=E.options.drop.overlap;if(pe==="pointer"){var Ce=ji(V,N,"drag"),re=Ud(O);re.x+=Ce.x,re.y+=Ce.y;var ve=re.x>K.left&&re.x<K.right,ao=re.y>K.top&&re.y<K.bottom;X=ve&&ao}var kt=V.getRect(N);if(kt&&pe==="center"){var Do=kt.left+kt.width/2,ui=kt.top+kt.height/2;X=Do>=K.left&&Do<=K.right&&ui>=K.top&&ui<=K.bottom}return kt&&$.number(pe)&&(X=Math.max(0,Math.min(K.right,kt.right)-Math.max(K.left,kt.left))*Math.max(0,Math.min(K.bottom,kt.bottom)-Math.max(K.top,kt.top))/(kt.width*kt.height)>=pe),E.options.drop.checker&&(X=E.options.drop.checker(O,D,X,E,G,V,N)),X}(this,v,b,y,w,M,_)},u.dynamicDrop=function(v){return $.bool(v)?(c.dynamicDrop=v,u):c.dynamicDrop},U(l.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),l.methodDict.drop="dropzone",c.dynamicDrop=!1,g.actions.drop=ru.defaults},listeners:{"interactions:before-action-start":function(c){var l=c.interaction;l.prepared.name==="drag"&&(l.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(c,l){var u=c.interaction,m=(c.event,c.iEvent);if(u.prepared.name==="drag"){var g=u.dropState;g.activeDrops=[],g.events={},g.activeDrops=Nl(l,u.element),g.events=Ll(u,0,m),g.events.activate&&(Jd(g.activeDrops,g.events.activate),l.fire("actions/drop:start",{interaction:u,dragEvent:m}))}},"interactions:action-move":tu,"interactions:after-action-move":function(c,l){var u=c.interaction,m=c.iEvent;if(u.prepared.name==="drag"){var g=u.dropState;Bl(u,g.events),l.fire("actions/drop:move",{interaction:u,dragEvent:m}),g.events={}}},"interactions:action-end":function(c,l){if(c.interaction.prepared.name==="drag"){var u=c.interaction,m=c.iEvent;tu(c,l),Bl(u,u.dropState.events),l.fire("actions/drop:end",{interaction:u,dragEvent:m})}},"interactions:stop":function(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.dropState;u&&(u.activeDrops=null,u.events=null,u.cur.dropzone=null,u.cur.element=null,u.prev.dropzone=null,u.prev.element=null,u.rejected=!1)}}},getActiveDrops:Nl,getDrop:eu,getDropEvents:Ll,fireDropEvents:Bl,filterEventType:function(c){return c.search("drag")===0||c.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},E1=ru;function ql(c){var l=c.interaction,u=c.iEvent,m=c.phase;if(l.prepared.name==="gesture"){var g=l.pointers.map(function(M){return M.pointer}),v=m==="start",b=m==="end",y=l.interactable.options.deltaSource;if(u.touches=[g[0],g[1]],v)u.distance=Dl(g,y),u.box=Vl(g),u.scale=1,u.ds=0,u.angle=Fl(g,y),u.da=0,l.gesture.startDistance=u.distance,l.gesture.startAngle=u.angle;else if(b||l.pointers.length<2){var w=l.prevEvent;u.distance=w.distance,u.box=w.box,u.scale=w.scale,u.ds=0,u.angle=w.angle,u.da=0}else u.distance=Dl(g,y),u.box=Vl(g),u.scale=u.distance/l.gesture.startDistance,u.angle=Fl(g,y),u.ds=u.scale-l.gesture.scale,u.da=u.angle-l.gesture.angle;l.gesture.distance=u.distance,l.gesture.angle=u.angle,$.number(u.scale)&&u.scale!==1/0&&!isNaN(u.scale)&&(l.gesture.scale=u.scale)}}var Kl={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.gesturable=function(g){return $.object(g)?(this.options.gesture.enabled=g.enabled!==!1,this.setPerAction("gesture",g),this.setOnEvents("gesture",g),this):$.bool(g)?(this.options.gesture.enabled=g,this):this.options.gesture},l.map.gesture=Kl,l.methodDict.gesture="gesturable",m.actions.gesture=Kl.defaults},listeners:{"interactions:action-start":ql,"interactions:action-move":ql,"interactions:action-end":ql,"interactions:new":function(c){c.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(c){if(!(c.interaction.pointers.length<2)){var l=c.interactable.options.gesture;if(l&&l.enabled)return c.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(c){return c.search("gesture")===0}},S1=Kl;function $1(c,l,u,m,g,v,b){if(!l)return!1;if(l===!0){var y=$.number(v.width)?v.width:v.right-v.left,w=$.number(v.height)?v.height:v.bottom-v.top;if(b=Math.min(b,Math.abs((c==="left"||c==="right"?y:w)/2)),y<0&&(c==="left"?c="right":c==="right"&&(c="left")),w<0&&(c==="top"?c="bottom":c==="bottom"&&(c="top")),c==="left"){var M=y>=0?v.left:v.right;return u.x<M+b}if(c==="top"){var _=w>=0?v.top:v.bottom;return u.y<_+b}if(c==="right")return u.x>(y>=0?v.right:v.left)-b;if(c==="bottom")return u.y>(w>=0?v.bottom:v.top)-b}return!!$.element(m)&&($.element(l)?l===m:fe(m,l,g))}function ou(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.resizeAxes){var m=l;u.interactable.options.resize.square?(u.resizeAxes==="y"?m.delta.x=m.delta.y:m.delta.y=m.delta.x,m.axes="xy"):(m.axes=u.resizeAxes,u.resizeAxes==="x"?m.delta.y=0:u.resizeAxes==="y"&&(m.delta.x=0))}}var Oi,yn,Hi={id:"actions/resize",before:["actions/drag"],install:function(c){var l=c.actions,u=c.browser,m=c.Interactable,g=c.defaults;Hi.cursors=function(v){return v.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(u),Hi.defaultMargin=u.supportsTouch||u.supportsPointerEvent?20:10,m.prototype.resizable=function(v){return function(b,y,w){return $.object(y)?(b.options.resize.enabled=y.enabled!==!1,b.setPerAction("resize",y),b.setOnEvents("resize",y),$.string(y.axis)&&/^x$|^y$|^xy$/.test(y.axis)?b.options.resize.axis=y.axis:y.axis===null&&(b.options.resize.axis=w.defaults.actions.resize.axis),$.bool(y.preserveAspectRatio)?b.options.resize.preserveAspectRatio=y.preserveAspectRatio:$.bool(y.square)&&(b.options.resize.square=y.square),b):$.bool(y)?(b.options.resize.enabled=y,b):b.options.resize}(this,v,c)},l.map.resize=Hi,l.methodDict.resize="resizable",g.actions.resize=Hi.defaults},listeners:{"interactions:new":function(c){c.interaction.resizeAxes="xy"},"interactions:action-start":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.rect;m._rects={start:U({},v),corrected:U({},v),previous:U({},v),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},g.edges=m.prepared.edges,g.rect=m._rects.corrected,g.deltaRect=m._rects.delta}})(c),ou(c)},"interactions:action-move":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.interactable.options.resize.invert,b=v==="reposition"||v==="negate",y=m.rect,w=m._rects,M=w.start,_=w.corrected,E=w.delta,O=w.previous;if(U(O,_),b){if(U(_,y),v==="reposition"){if(_.top>_.bottom){var D=_.top;_.top=_.bottom,_.bottom=D}if(_.left>_.right){var V=_.left;_.left=_.right,_.right=V}}}else _.top=Math.min(y.top,M.bottom),_.bottom=Math.max(y.bottom,M.top),_.left=Math.min(y.left,M.right),_.right=Math.max(y.right,M.left);for(var N in _.width=_.right-_.left,_.height=_.bottom-_.top,_)E[N]=_[N]-O[N];g.edges=m.prepared.edges,g.rect=_,g.deltaRect=E}})(c),ou(c)},"interactions:action-end":function(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.prepared.edges){var m=l;m.edges=u.prepared.edges,m.rect=u._rects.corrected,m.deltaRect=u._rects.delta}},"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.element,g=c.rect,v=c.buttons;if(g){var b=U({},l.coords.cur.page),y=u.options.resize;if(y&&y.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||v&y.mouseButtons)){if($.object(y.edges)){var w={left:!1,right:!1,top:!1,bottom:!1};for(var M in w)w[M]=$1(M,y.edges[M],b,l._latestPointer.eventTarget,m,g,y.margin||Hi.defaultMargin);w.left=w.left&&!w.right,w.top=w.top&&!w.bottom,(w.left||w.right||w.top||w.bottom)&&(c.action={name:"resize",edges:w})}else{var _=y.axis!=="y"&&b.x>g.right-Hi.defaultMargin,E=y.axis!=="x"&&b.y>g.bottom-Hi.defaultMargin;(_||E)&&(c.action={name:"resize",axes:(_?"x":"")+(E?"y":"")})}return!c.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(c){var l=c.edges,u=c.axis,m=c.name,g=Hi.cursors,v=null;if(u)v=g[m+u];else if(l){for(var b="",y=0,w=["top","bottom","left","right"];y<w.length;y++){var M=w[y];l[M]&&(b+=M)}v=g[b]}return v},filterEventType:function(c){return c.search("resize")===0},defaultMargin:null},T1=Hi,A1={id:"actions",install:function(c){c.usePlugin(S1),c.usePlugin(T1),c.usePlugin(yt),c.usePlugin(E1)}},iu=0,rn={request:function(c){return Oi(c)},cancel:function(c){return yn(c)},init:function(c){if(Oi=c.requestAnimationFrame,yn=c.cancelAnimationFrame,!Oi)for(var l=["ms","moz","webkit","o"],u=0;u<l.length;u++){var m=l[u];Oi=c["".concat(m,"RequestAnimationFrame")],yn=c["".concat(m,"CancelAnimationFrame")]||c["".concat(m,"CancelRequestAnimationFrame")]}Oi=Oi&&Oi.bind(c),yn=yn&&yn.bind(c),Oi||(Oi=function(g){var v=Date.now(),b=Math.max(0,16-(v-iu)),y=c.setTimeout(function(){g(v+b)},b);return iu=v+b,y},yn=function(g){return clearTimeout(g)})}},oe={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(c){oe.isScrolling=!0,rn.cancel(oe.i),c.autoScroll=oe,oe.interaction=c,oe.prevTime=oe.now(),oe.i=rn.request(oe.scroll)},stop:function(){oe.isScrolling=!1,oe.interaction&&(oe.interaction.autoScroll=null),rn.cancel(oe.i)},scroll:function(){var c=oe.interaction,l=c.interactable,u=c.element,m=c.prepared.name,g=l.options[m].autoScroll,v=nu(g.container,l,u),b=oe.now(),y=(b-oe.prevTime)/1e3,w=g.speed*y;if(w>=1){var M={x:oe.x*w,y:oe.y*w};if(M.x||M.y){var _=au(v);$.window(v)?v.scrollBy(M.x,M.y):v&&(v.scrollLeft+=M.x,v.scrollTop+=M.y);var E=au(v),O={x:E.x-_.x,y:E.y-_.y};(O.x||O.y)&&l.fire({type:"autoscroll",target:u,interactable:l,delta:O,interaction:c,container:v})}oe.prevTime=b}oe.isScrolling&&(rn.cancel(oe.i),oe.i=rn.request(oe.scroll))},check:function(c,l){var u;return(u=c.options[l].autoScroll)==null?void 0:u.enabled},onInteractionMove:function(c){var l=c.interaction,u=c.pointer;if(l.interacting()&&oe.check(l.interactable,l.prepared.name))if(l.simulation)oe.x=oe.y=0;else{var m,g,v,b,y=l.interactable,w=l.element,M=l.prepared.name,_=y.options[M].autoScroll,E=nu(_.container,y,w);if($.window(E))b=u.clientX<oe.margin,m=u.clientY<oe.margin,g=u.clientX>E.innerWidth-oe.margin,v=u.clientY>E.innerHeight-oe.margin;else{var O=Z(E);b=u.clientX<O.left+oe.margin,m=u.clientY<O.top+oe.margin,g=u.clientX>O.right-oe.margin,v=u.clientY>O.bottom-oe.margin}oe.x=g?1:b?-1:0,oe.y=v?1:m?-1:0,oe.isScrolling||(oe.margin=_.margin,oe.speed=_.speed,oe.start(l))}}};function nu(c,l,u){return($.string(c)?en(c,l,u):c)||H(u)}function au(c){return $.window(c)&&(c=window.document.body),{x:c.scrollLeft,y:c.scrollTop}}var P1={id:"auto-scroll",install:function(c){var l=c.defaults,u=c.actions;c.autoScroll=oe,oe.now=function(){return c.now()},u.phaselessTypes.autoscroll=!0,l.perAction.autoScroll=oe.defaults},listeners:{"interactions:new":function(c){c.interaction.autoScroll=null},"interactions:destroy":function(c){c.interaction.autoScroll=null,oe.stop(),oe.interaction&&(oe.interaction=null)},"interactions:stop":oe.stop,"interactions:action-move":function(c){return oe.onInteractionMove(c)}}},j1=P1;function ja(c,l){var u=!1;return function(){return u||(T.console.warn(l),u=!0),c.apply(this,arguments)}}function Wl(c,l){return c.name=l.name,c.axis=l.axis,c.edges=l.edges,c}function O1(c){return $.bool(c)?(this.options.styleCursor=c,this):c===null?(delete this.options.styleCursor,this):this.options.styleCursor}function H1(c){return $.func(c)?(this.options.actionChecker=c,this):c===null?(delete this.options.actionChecker,this):this.options.actionChecker}var R1={id:"auto-start/interactableMethods",install:function(c){var l=c.Interactable;l.prototype.getAction=function(u,m,g,v){var b=function(y,w,M,_,E){var O=y.getRect(_),D=w.buttons||{0:1,1:4,3:8,4:16}[w.button],V={action:null,interactable:y,interaction:M,element:_,rect:O,buttons:D};return E.fire("auto-start:check",V),V.action}(this,m,g,v,c);return this.options.actionChecker?this.options.actionChecker(u,m,b,this,v,g):b},l.prototype.ignoreFrom=ja(function(u){return this._backCompatOption("ignoreFrom",u)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),l.prototype.allowFrom=ja(function(u){return this._backCompatOption("allowFrom",u)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),l.prototype.actionChecker=H1,l.prototype.styleCursor=O1}};function su(c,l,u,m,g){return l.testIgnoreAllow(l.options[c.name],u,m)&&l.options[c.name].enabled&&zs(l,u,c,g)?c:null}function I1(c,l,u,m,g,v,b){for(var y=0,w=m.length;y<w;y++){var M=m[y],_=g[y],E=M.getAction(l,u,c,_);if(E){var O=su(E,M,_,v,b);if(O)return{action:O,interactable:M,element:_}}}return{action:null,interactable:null,element:null}}function lu(c,l,u,m,g){var v=[],b=[],y=m;function w(_){v.push(_),b.push(y)}for(;$.element(y);){v=[],b=[],g.interactables.forEachMatch(y,w);var M=I1(c,l,u,v,b,m,g);if(M.action&&!M.interactable.options[M.action.name].manualStart)return M;y=Uo(y)}return{action:null,interactable:null,element:null}}function cu(c,l,u){var m=l.action,g=l.interactable,v=l.element;m=m||{name:null},c.interactable=g,c.element=v,Wl(c.prepared,m),c.rect=g&&m.name?g.getRect(v):null,uu(c,u),u.fire("autoStart:prepared",{interaction:c})}function zs(c,l,u,m){var g=c.options,v=g[u.name].max,b=g[u.name].maxPerElement,y=m.autoStart.maxInteractions,w=0,M=0,_=0;if(!(v&&b&&y))return!1;for(var E=0,O=m.interactions.list;E<O.length;E++){var D=O[E],V=D.prepared.name;if(D.interacting()&&(++w>=y||D.interactable===c&&((M+=V===u.name?1:0)>=v||D.element===l&&(_++,V===u.name&&_>=b))))return!1}return y>0}function du(c,l){return $.number(c)?(l.autoStart.maxInteractions=c,this):l.autoStart.maxInteractions}function Ul(c,l,u){var m=u.autoStart.cursorElement;m&&m!==c&&(m.style.cursor=""),c.ownerDocument.documentElement.style.cursor=l,c.style.cursor=l,u.autoStart.cursorElement=l?c:null}function uu(c,l){var u=c.interactable,m=c.element,g=c.prepared;if(c.pointerType==="mouse"&&u&&u.options.styleCursor){var v="";if(g.name){var b=u.options[g.name].cursorChecker;v=$.func(b)?b(g,u,m,c._interacting):l.actions.map[g.name].getCursor(g)}Ul(c.element,v||"",l)}else l.autoStart.cursorElement&&Ul(l.autoStart.cursorElement,"",l)}var V1={id:"auto-start/base",before:["actions"],install:function(c){var l=c.interactStatic,u=c.defaults;c.usePlugin(R1),u.base.actionChecker=null,u.base.styleCursor=!0,U(u.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),l.maxInteractions=function(m){return du(m,c)},c.autoStart={maxInteractions:1/0,withinInteractionLimit:zs,cursorElement:null}},listeners:{"interactions:down":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;u.interacting()||cu(u,lu(u,m,g,v,l),l)},"interactions:move":function(c,l){(function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerType!=="mouse"||g.pointerIsDown||g.interacting()||cu(g,lu(g,v,b,y,m),m)})(c,l),function(u,m){var g=u.interaction;if(g.pointerIsDown&&!g.interacting()&&g.pointerWasMoved&&g.prepared.name){m.fire("autoStart:before-start",u);var v=g.interactable,b=g.prepared.name;b&&v&&(v.options[b].manualStart||!zs(v,g.element,g.prepared,m)?g.stop():(g.start(g.prepared,v,g.element),uu(g,m)))}}(c,l)},"interactions:stop":function(c,l){var u=c.interaction,m=u.interactable;m&&m.options.styleCursor&&Ul(u.element,"",l)}},maxInteractions:du,withinInteractionLimit:zs,validateAction:su},Gl=V1,D1={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(c,l){var u=c.interaction,m=c.eventTarget,g=c.dx,v=c.dy;if(u.prepared.name==="drag"){var b=Math.abs(g),y=Math.abs(v),w=u.interactable.options.drag,M=w.startAxis,_=b>y?"x":b<y?"y":"xy";if(u.prepared.axis=w.lockAxis==="start"?_[0]:w.lockAxis,_!=="xy"&&M!=="xy"&&M!==_){u.prepared.name=null;for(var E=m,O=function(V){if(V!==u.interactable){var N=u.interactable.options.drag;if(!N.manualStart&&V.testIgnoreAllow(N,E,m)){var G=V.getAction(u.downPointer,u.downEvent,u,E);if(G&&G.name==="drag"&&function(K,X){if(!X)return!1;var pe=X.options.drag.startAxis;return K==="xy"||pe==="xy"||pe===K}(_,V)&&Gl.validateAction(G,V,E,m,l))return V}}};$.element(E);){var D=l.interactables.forEachMatch(E,O);if(D){u.prepared.name="drag",u.interactable=D,u.element=E;break}E=Uo(E)}}}}}};function Yl(c){var l=c.prepared&&c.prepared.name;if(!l)return null;var u=c.interactable.options;return u[l].hold||u[l].delay}var F1={id:"auto-start/hold",install:function(c){var l=c.defaults;c.usePlugin(Gl),l.perAction.hold=0,l.perAction.delay=0},listeners:{"interactions:new":function(c){c.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(c){var l=c.interaction,u=Yl(l);u>0&&(l.autoStartHoldTimer=setTimeout(function(){l.start(l.prepared,l.interactable,l.element)},u))},"interactions:move":function(c){var l=c.interaction,u=c.duplicate;l.autoStartHoldTimer&&l.pointerWasMoved&&!u&&(clearTimeout(l.autoStartHoldTimer),l.autoStartHoldTimer=null)},"autoStart:before-start":function(c){var l=c.interaction;Yl(l)>0&&(l.prepared.name=null)}},getHoldDuration:Yl},N1=F1,L1={id:"auto-start",install:function(c){c.usePlugin(Gl),c.usePlugin(N1),c.usePlugin(D1)}},B1=function(c){return/^(always|never|auto)$/.test(c)?(this.options.preventDefault=c,this):$.bool(c)?(this.options.preventDefault=c?"always":"never",this):this.options.preventDefault};function q1(c){var l=c.interaction,u=c.event;l.interactable&&l.interactable.checkAndPreventDefault(u)}var hu={id:"core/interactablePreventDefault",install:function(c){var l=c.Interactable;l.prototype.preventDefault=B1,l.prototype.checkAndPreventDefault=function(u){return function(m,g,v){var b=m.options.preventDefault;if(b!=="never")if(b!=="always"){if(g.events.supportsPassive&&/^touch(start|move)$/.test(v.type)){var y=H(v.target).document,w=g.getDocOptions(y);if(!w||!w.events||w.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(v.type)||$.element(v.target)&&zi(v.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||v.preventDefault()}else v.preventDefault()}(this,c,u)},c.interactions.docEvents.push({type:"dragstart",listener:function(u){for(var m=0,g=c.interactions.list;m<g.length;m++){var v=g[m];if(v.element&&(v.element===u.target||si(v.element,u.target)))return void v.interactable.checkAndPreventDefault(u)}}})},listeners:["down","move","up","cancel"].reduce(function(c,l){return c["interactions:".concat(l)]=q1,c},{})};function Es(c,l){if(l.phaselessTypes[c])return!0;for(var u in l.map)if(c.indexOf(u)===0&&c.substr(u.length)in l.phases)return!0;return!1}function Wn(c){var l={};for(var u in c){var m=c[u];$.plainObject(m)?l[u]=Wn(m):$.array(m)?l[u]=Qd(m):l[u]=m}return l}var Xl=function(){function c(l){t(this,c),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=l,this.result=Ss(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return n(c,[{key:"start",value:function(l,u){var m,g,v=l.phase,b=this.interaction,y=function(M){var _=M.interactable.options[M.prepared.name],E=_.modifiers;return E&&E.length?E:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(O){var D=_[O];return D&&D.enabled&&{options:D,methods:D._methods}}).filter(function(O){return!!O})}(b);this.prepareStates(y),this.startEdges=U({},b.edges),this.edges=U({},this.startEdges),this.startOffset=(m=b.rect,g=u,m?{left:g.x-m.left,top:g.y-m.top,right:m.right-g.x,bottom:m.bottom-g.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var w=this.fillArg({phase:v,pageCoords:u,preEnd:!1});return this.result=Ss(),this.startAll(w),this.result=this.setAll(w)}},{key:"fillArg",value:function(l){var u=this.interaction;return l.interaction=u,l.interactable=u.interactable,l.element=u.element,l.rect||(l.rect=u.rect),l.edges||(l.edges=this.startEdges),l.startOffset=this.startOffset,l}},{key:"startAll",value:function(l){for(var u=0,m=this.states;u<m.length;u++){var g=m[u];g.methods.start&&(l.state=g,g.methods.start(l))}}},{key:"setAll",value:function(l){var u=l.phase,m=l.preEnd,g=l.skipModifiers,v=l.rect,b=l.edges;l.coords=U({},l.pageCoords),l.rect=U({},v),l.edges=U({},b);for(var y=g?this.states.slice(g):this.states,w=Ss(l.coords,l.rect),M=0;M<y.length;M++){var _,E=y[M],O=E.options,D=U({},l.coords),V=null;(_=E.methods)!=null&&_.set&&this.shouldDo(O,m,u)&&(l.state=E,V=E.methods.set(l),tn(l.edges,l.rect,{x:l.coords.x-D.x,y:l.coords.y-D.y})),w.eventProps.push(V)}U(this.edges,l.edges),w.delta.x=l.coords.x-l.pageCoords.x,w.delta.y=l.coords.y-l.pageCoords.y,w.rectDelta.left=l.rect.left-v.left,w.rectDelta.right=l.rect.right-v.right,w.rectDelta.top=l.rect.top-v.top,w.rectDelta.bottom=l.rect.bottom-v.bottom;var N=this.result.coords,G=this.result.rect;if(N&&G){var K=w.rect.left!==G.left||w.rect.right!==G.right||w.rect.top!==G.top||w.rect.bottom!==G.bottom;w.changed=K||N.x!==w.coords.x||N.y!==w.coords.y}return w}},{key:"applyToInteraction",value:function(l){var u=this.interaction,m=l.phase,g=u.coords.cur,v=u.coords.start,b=this.result,y=this.startDelta,w=b.delta;m==="start"&&U(this.startDelta,b.delta);for(var M=0,_=[[v,y],[g,w]];M<_.length;M++){var E=_[M],O=E[0],D=E[1];O.page.x+=D.x,O.page.y+=D.y,O.client.x+=D.x,O.client.y+=D.y}var V=this.result.rectDelta,N=l.rect||u.rect;N.left+=V.left,N.right+=V.right,N.top+=V.top,N.bottom+=V.bottom,N.width=N.right-N.left,N.height=N.bottom-N.top}},{key:"setAndApply",value:function(l){var u=this.interaction,m=l.phase,g=l.preEnd,v=l.skipModifiers,b=this.setAll(this.fillArg({preEnd:g,phase:m,pageCoords:l.modifiedCoords||u.coords.cur.page}));if(this.result=b,!b.changed&&(!v||v<this.states.length)&&u.interacting())return!1;if(l.modifiedCoords){var y=u.coords.cur.page,w={x:l.modifiedCoords.x-y.x,y:l.modifiedCoords.y-y.y};b.coords.x+=w.x,b.coords.y+=w.y,b.delta.x+=w.x,b.delta.y+=w.y}this.applyToInteraction(l)}},{key:"beforeEnd",value:function(l){var u=l.interaction,m=l.event,g=this.states;if(g&&g.length){for(var v=!1,b=0;b<g.length;b++){var y=g[b];l.state=y;var w=y.options,M=y.methods,_=M.beforeEnd&&M.beforeEnd(l);if(_)return this.endResult=_,!1;v=v||!v&&this.shouldDo(w,!0,l.phase,!0)}v&&u.move({event:m,preEnd:!0})}}},{key:"stop",value:function(l){var u=l.interaction;if(this.states&&this.states.length){var m=U({states:this.states,interactable:u.interactable,element:u.element,rect:null},l);this.fillArg(m);for(var g=0,v=this.states;g<v.length;g++){var b=v[g];m.state=b,b.methods.stop&&b.methods.stop(m)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(l){this.states=[];for(var u=0;u<l.length;u++){var m=l[u],g=m.options,v=m.methods,b=m.name;this.states.push({options:g,methods:v,index:u,name:b})}return this.states}},{key:"restoreInteractionCoords",value:function(l){var u=l.interaction,m=u.coords,g=u.rect,v=u.modification;if(v.result){for(var b=v.startDelta,y=v.result,w=y.delta,M=y.rectDelta,_=0,E=[[m.start,b],[m.cur,w]];_<E.length;_++){var O=E[_],D=O[0],V=O[1];D.page.x-=V.x,D.page.y-=V.y,D.client.x-=V.x,D.client.y-=V.y}g.left-=M.left,g.right-=M.right,g.top-=M.top,g.bottom-=M.bottom}}},{key:"shouldDo",value:function(l,u,m,g){return!(!l||l.enabled===!1||g&&!l.endOnly||l.endOnly&&!u||m==="start"&&!l.setStart)}},{key:"copyFrom",value:function(l){this.startOffset=l.startOffset,this.startDelta=l.startDelta,this.startEdges=l.startEdges,this.edges=l.edges,this.states=l.states.map(function(u){return Wn(u)}),this.result=Ss(U({},l.result.coords),U({},l.result.rect))}},{key:"destroy",value:function(){for(var l in this)this[l]=null}}]),c}();function Ss(c,l){return{rect:l,coords:c,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function on(c,l){var u=c.defaults,m={start:c.start,set:c.set,beforeEnd:c.beforeEnd,stop:c.stop},g=function(v){var b=v||{};for(var y in b.enabled=b.enabled!==!1,u)y in b||(b[y]=u[y]);var w={options:b,methods:m,name:l,enable:function(){return b.enabled=!0,w},disable:function(){return b.enabled=!1,w}};return w};return l&&typeof l=="string"&&(g._defaults=u,g._methods=m),g}function Oa(c){var l=c.iEvent,u=c.interaction.modification.result;u&&(l.modifiers=u.eventProps)}var K1={id:"modifiers/base",before:["actions"],install:function(c){c.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(c){var l=c.interaction;l.modification=new Xl(l)},"interactions:before-action-start":function(c){var l=c.interaction,u=c.interaction.modification;u.start(c,l.coords.start.page),l.edges=u.edges,u.applyToInteraction(c)},"interactions:before-action-move":function(c){var l=c.interaction,u=l.modification,m=u.setAndApply(c);return l.edges=u.edges,m},"interactions:before-action-end":function(c){var l=c.interaction,u=l.modification,m=u.beforeEnd(c);return l.edges=u.startEdges,m},"interactions:action-start":Oa,"interactions:action-move":Oa,"interactions:action-end":Oa,"interactions:after-action-start":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-move":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:stop":function(c){return c.interaction.modification.stop(c)}}},pu=K1,mu={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Zl=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w,M){var _;t(this,u),(_=l.call(this,m)).relatedTarget=null,_.screenX=void 0,_.screenY=void 0,_.button=void 0,_.buttons=void 0,_.ctrlKey=void 0,_.shiftKey=void 0,_.altKey=void 0,_.metaKey=void 0,_.page=void 0,_.client=void 0,_.delta=void 0,_.rect=void 0,_.x0=void 0,_.y0=void 0,_.t0=void 0,_.dt=void 0,_.duration=void 0,_.clientX0=void 0,_.clientY0=void 0,_.velocity=void 0,_.speed=void 0,_.swipe=void 0,_.axes=void 0,_.preEnd=void 0,y=y||m.element;var E=m.interactable,O=(E&&E.options||mu).deltaSource,D=ji(E,y,v),V=b==="start",N=b==="end",G=V?f(_):m.prevEvent,K=V?m.coords.start:N?{page:G.page,client:G.client,timeStamp:m.coords.cur.timeStamp}:m.coords.cur;return _.page=U({},K.page),_.client=U({},K.client),_.rect=U({},m.rect),_.timeStamp=K.timeStamp,N||(_.page.x-=D.x,_.page.y-=D.y,_.client.x-=D.x,_.client.y-=D.y),_.ctrlKey=g.ctrlKey,_.altKey=g.altKey,_.shiftKey=g.shiftKey,_.metaKey=g.metaKey,_.button=g.button,_.buttons=g.buttons,_.target=y,_.currentTarget=y,_.preEnd=w,_.type=M||v+(b||""),_.interactable=E,_.t0=V?m.pointers[m.pointers.length-1].downTime:G.t0,_.x0=m.coords.start.page.x-D.x,_.y0=m.coords.start.page.y-D.y,_.clientX0=m.coords.start.client.x-D.x,_.clientY0=m.coords.start.client.y-D.y,_.delta=V||N?{x:0,y:0}:{x:_[O].x-G[O].x,y:_[O].y-G[O].y},_.dt=m.coords.delta.timeStamp,_.duration=_.timeStamp-_.t0,_.velocity=U({},m.coords.velocity[O]),_.speed=$a(_.velocity.x,_.velocity.y),_.swipe=N||b==="inertiastart"?_.getSwipe():null,_}return n(u,[{key:"getSwipe",value:function(){var m=this._interaction;if(m.prevEvent.speed<600||this.timeStamp-m.prevEvent.timeStamp>150)return null;var g=180*Math.atan2(m.prevEvent.velocityY,m.prevEvent.velocityX)/Math.PI;g<0&&(g+=360);var v=112.5<=g&&g<247.5,b=202.5<=g&&g<337.5;return{up:b,down:!b&&22.5<=g&&g<157.5,left:v,right:!v&&(292.5<=g||g<67.5),angle:g,speed:m.prevEvent.speed,velocity:{x:m.prevEvent.velocityX,y:m.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),u}(Cs);Object.defineProperties(Zl.prototype,{pageX:{get:function(){return this.page.x},set:function(c){this.page.x=c}},pageY:{get:function(){return this.page.y},set:function(c){this.page.y=c}},clientX:{get:function(){return this.client.x},set:function(c){this.client.x=c}},clientY:{get:function(){return this.client.y},set:function(c){this.client.y=c}},dx:{get:function(){return this.delta.x},set:function(c){this.delta.x=c}},dy:{get:function(){return this.delta.y},set:function(c){this.delta.y=c}},velocityX:{get:function(){return this.velocity.x},set:function(c){this.velocity.x=c}},velocityY:{get:function(){return this.velocity.y},set:function(c){this.velocity.y=c}}});var W1=n(function c(l,u,m,g,v){t(this,c),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=l,this.pointer=u,this.event=m,this.downTime=g,this.downTarget=v}),U1=function(c){return c.interactable="",c.element="",c.prepared="",c.pointerIsDown="",c.pointerWasMoved="",c._proxy="",c}({}),gu=function(c){return c.start="",c.move="",c.end="",c.stop="",c.interacting="",c}({}),G1=0,Y1=function(){function c(l){var u=this,m=l.pointerType,g=l.scopeFire;t(this,c),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=ja(function(_){this.move(_)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=G1++,this._scopeFire=g,this.pointerType=m;var v=this;this._proxy={};var b=function(_){Object.defineProperty(u._proxy,_,{get:function(){return v[_]}})};for(var y in U1)b(y);var w=function(_){Object.defineProperty(u._proxy,_,{value:function(){return v[_].apply(v,arguments)}})};for(var M in gu)w(M);this._scopeFire("interactions:new",{interaction:this})}return n(c,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(l,u,m){var g=this.updatePointer(l,u,m,!0),v=this.pointers[g];this._scopeFire("interactions:down",{pointer:l,event:u,eventTarget:m,pointerIndex:g,pointerInfo:v,type:"down",interaction:this})}},{key:"start",value:function(l,u,m){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(l.name==="gesture"?2:1)||!u.options[l.name].enabled)&&(Wl(this.prepared,l),this.interactable=u,this.element=m,this.rect=u.getRect(m),this.edges=this.prepared.edges?U({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(l,u,m){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(l,u,m,!1);var g,v,b=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(g=this.coords.cur.client.x-this.coords.start.client.x,v=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=$a(g,v)>this.pointerMoveTolerance);var y,w,M,_=this.getPointerIndex(l),E={pointer:l,pointerIndex:_,pointerInfo:this.pointers[_],event:u,type:"move",eventTarget:m,dx:g,dy:v,duplicate:b,interaction:this};b||(y=this.coords.velocity,w=this.coords.delta,M=Math.max(w.timeStamp/1e3,.001),y.page.x=w.page.x/M,y.page.y=w.page.y/M,y.client.x=w.client.x/M,y.client.y=w.client.y/M,y.timeStamp=M),this._scopeFire("interactions:move",E),b||this.simulation||(this.interacting()&&(E.type=null,this.move(E)),this.pointerWasMoved&&_s(this.coords.prev,this.coords.cur))}},{key:"move",value:function(l){l&&l.event||Kd(this.coords.delta),(l=U({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},l||{})).phase="move",this._doPhase(l)}},{key:"pointerUp",value:function(l,u,m,g){var v=this.getPointerIndex(l);v===-1&&(v=this.updatePointer(l,u,m,!1));var b=/cancel$/i.test(u.type)?"cancel":"up";this._scopeFire("interactions:".concat(b),{pointer:l,pointerIndex:v,pointerInfo:this.pointers[v],event:u,eventTarget:m,type:b,curEventTarget:g,interaction:this}),this.simulation||this.end(u),this.removePointer(l,u)}},{key:"documentBlur",value:function(l){this.end(l),this._scopeFire("interactions:blur",{event:l,type:"blur",interaction:this})}},{key:"end",value:function(l){var u;this._ending=!0,l=l||this._latestPointer.event,this.interacting()&&(u=this._doPhase({event:l,interaction:this,phase:"end"})),this._ending=!1,u===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(l){var u=Ta(l);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:Aa(this.pointers,function(m){return m.id===u})}},{key:"getPointerInfo",value:function(l){return this.pointers[this.getPointerIndex(l)]}},{key:"updatePointer",value:function(l,u,m,g){var v,b,y,w=Ta(l),M=this.getPointerIndex(l),_=this.pointers[M];return g=g!==!1&&(g||/(down|start)$/i.test(u.type)),_?_.pointer=l:(_=new W1(w,l,u,null,null),M=this.pointers.length,this.pointers.push(_)),z1(this.coords.cur,this.pointers.map(function(E){return E.pointer}),this._now()),v=this.coords.delta,b=this.coords.prev,y=this.coords.cur,v.page.x=y.page.x-b.page.x,v.page.y=y.page.y-b.page.y,v.client.x=y.client.x-b.client.x,v.client.y=y.client.y-b.client.y,v.timeStamp=y.timeStamp-b.timeStamp,g&&(this.pointerIsDown=!0,_.downTime=this.coords.cur.timeStamp,_.downTarget=m,ws(this.downPointer,l),this.interacting()||(_s(this.coords.start,this.coords.cur),_s(this.coords.prev,this.coords.cur),this.downEvent=u,this.pointerWasMoved=!1)),this._updateLatestPointer(l,u,m),this._scopeFire("interactions:update-pointer",{pointer:l,event:u,eventTarget:m,down:g,pointerInfo:_,pointerIndex:M,interaction:this}),M}},{key:"removePointer",value:function(l,u){var m=this.getPointerIndex(l);if(m!==-1){var g=this.pointers[m];this._scopeFire("interactions:remove-pointer",{pointer:l,event:u,eventTarget:null,pointerIndex:m,pointerInfo:g,interaction:this}),this.pointers.splice(m,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(l,u,m){this._latestPointer.pointer=l,this._latestPointer.event=u,this._latestPointer.eventTarget=m}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(l,u,m,g){return new Zl(this,l,this.prepared.name,u,this.element,m,g)}},{key:"_fireEvent",value:function(l){var u;(u=this.interactable)==null||u.fire(l),(!this.prevEvent||l.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=l)}},{key:"_doPhase",value:function(l){var u=l.event,m=l.phase,g=l.preEnd,v=l.type,b=this.rect;if(b&&m==="move"&&(tn(this.edges,b,this.coords.delta[this.interactable.options.deltaSource]),b.width=b.right-b.left,b.height=b.bottom-b.top),this._scopeFire("interactions:before-action-".concat(m),l)===!1)return!1;var y=l.iEvent=this._createPreparedEvent(u,m,g,v);return this._scopeFire("interactions:action-".concat(m),l),m==="start"&&(this.prevEvent=y),this._fireEvent(y),this._scopeFire("interactions:after-action-".concat(m),l),!0}},{key:"_now",value:function(){return Date.now()}}]),c}();function fu(c){vu(c.interaction)}function vu(c){if(!function(u){return!(!u.offset.pending.x&&!u.offset.pending.y)}(c))return!1;var l=c.offset.pending;return Ql(c.coords.cur,l),Ql(c.coords.delta,l),tn(c.edges,c.rect,l),l.x=0,l.y=0,!0}function X1(c){var l=c.x,u=c.y;this.offset.pending.x+=l,this.offset.pending.y+=u,this.offset.total.x+=l,this.offset.total.y+=u}function Ql(c,l){var u=c.page,m=c.client,g=l.x,v=l.y;u.x+=g,u.y+=v,m.x+=g,m.y+=v}gu.offsetBy="";var Z1={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(c){c.Interaction.prototype.offsetBy=X1},listeners:{"interactions:new":function(c){c.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(c){return function(l){l.pointerIsDown&&(Ql(l.coords.cur,l.offset.total),l.offset.pending.x=0,l.offset.pending.y=0)}(c.interaction)},"interactions:before-action-start":fu,"interactions:before-action-move":fu,"interactions:before-action-end":function(c){var l=c.interaction;if(vu(l))return l.move({offset:!0}),l.end(),!1},"interactions:stop":function(c){var l=c.interaction;l.offset.total.x=0,l.offset.total.y=0,l.offset.pending.x=0,l.offset.pending.y=0}}},bu=Z1,Q1=function(){function c(l){t(this,c),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=l}return n(c,[{key:"start",value:function(l){var u=this.interaction,m=$s(u);if(!m||!m.enabled)return!1;var g=u.coords.velocity.client,v=$a(g.x,g.y),b=this.modification||(this.modification=new Xl(u));if(b.copyFrom(u.modification),this.t0=u._now(),this.allowResume=m.allowResume,this.v0=v,this.currentOffset={x:0,y:0},this.startCoords=u.coords.cur.page,this.modifierArg=b.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-u.coords.cur.timeStamp<50&&v>m.minSpeed&&v>m.endSpeed)this.startInertia();else{if(b.result=b.setAll(this.modifierArg),!b.result.changed)return!1;this.startSmoothEnd()}return u.modification.result.rect=null,u.offsetBy(this.targetOffset),u._doPhase({interaction:u,event:l,phase:"inertiastart"}),u.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),u.modification.result.rect=null,this.active=!0,u.simulation=this,!0}},{key:"startInertia",value:function(){var l=this,u=this.interaction.coords.velocity.client,m=$s(this.interaction),g=m.resistance,v=-Math.log(m.endSpeed/this.v0)/g;this.targetOffset={x:(u.x-v)/g,y:(u.y-v)/g},this.te=v,this.lambda_v0=g/this.v0,this.one_ve_v0=1-m.endSpeed/this.v0;var b=this.modification,y=this.modifierArg;y.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},b.result=b.setAll(y),b.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+b.result.delta.x,y:this.targetOffset.y+b.result.delta.y}),this.onNextFrame(function(){return l.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var l=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return l.smoothEndTick()})}},{key:"onNextFrame",value:function(l){var u=this;this.timeout=rn.request(function(){u.active&&l()})}},{key:"inertiaTick",value:function(){var l,u,m,g,v,b,y,w=this,M=this.interaction,_=$s(M).resistance,E=(M._now()-this.t0)/1e3;if(E<this.te){var O,D=1-(Math.exp(-_*E)-this.lambda_v0)/this.one_ve_v0;this.isModified?(l=0,u=0,m=this.targetOffset.x,g=this.targetOffset.y,v=this.modifiedOffset.x,b=this.modifiedOffset.y,O={x:yu(y=D,l,m,v),y:yu(y,u,g,b)}):O={x:this.targetOffset.x*D,y:this.targetOffset.y*D};var V={x:O.x-this.currentOffset.x,y:O.y-this.currentOffset.y};this.currentOffset.x+=V.x,this.currentOffset.y+=V.y,M.offsetBy(V),M.move(),this.onNextFrame(function(){return w.inertiaTick()})}else M.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var l=this,u=this.interaction,m=u._now()-this.t0,g=$s(u).smoothEndDuration;if(m<g){var v={x:ku(m,0,this.targetOffset.x,g),y:ku(m,0,this.targetOffset.y,g)},b={x:v.x-this.currentOffset.x,y:v.y-this.currentOffset.y};this.currentOffset.x+=b.x,this.currentOffset.y+=b.y,u.offsetBy(b),u.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return l.smoothEndTick()})}else u.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(l){var u=l.pointer,m=l.event,g=l.eventTarget,v=this.interaction;v.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),v.updatePointer(u,m,g,!0),v._doPhase({interaction:v,event:m,phase:"resume"}),_s(v.coords.prev,v.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,rn.cancel(this.timeout)}}]),c}();function $s(c){var l=c.interactable,u=c.prepared;return l&&l.options&&u.name&&l.options[u.name].inertia}var J1={id:"inertia",before:["modifiers","actions"],install:function(c){var l=c.defaults;c.usePlugin(bu),c.usePlugin(pu),c.actions.phases.inertiastart=!0,c.actions.phases.resume=!0,l.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(c){var l=c.interaction;l.inertia=new Q1(l)},"interactions:before-action-end":function(c){var l=c.interaction,u=c.event;return(!l._interacting||l.simulation||!l.inertia.start(u))&&null},"interactions:down":function(c){var l=c.interaction,u=c.eventTarget,m=l.inertia;if(m.active)for(var g=u;$.element(g);){if(g===l.element){m.resume(c);break}g=Uo(g)}},"interactions:stop":function(c){var l=c.interaction.inertia;l.active&&l.stop()},"interactions:before-action-resume":function(c){var l=c.interaction.modification;l.stop(c),l.start(c,c.interaction.coords.cur.page),l.applyToInteraction(c)},"interactions:before-action-inertiastart":function(c){return c.interaction.modification.setAndApply(c)},"interactions:action-resume":Oa,"interactions:action-inertiastart":Oa,"interactions:after-action-inertiastart":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-resume":function(c){return c.interaction.modification.restoreInteractionCoords(c)}}};function yu(c,l,u,m){var g=1-c;return g*g*l+2*g*c*u+c*c*m}function ku(c,l,u,m){return-u*(c/=m)*(c-2)+l}var e0=J1;function xu(c,l){for(var u=0;u<l.length;u++){var m=l[u];if(c.immediatePropagationStopped)break;m(c)}}var wu=function(){function c(l){t(this,c),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=U({},l||{})}return n(c,[{key:"fire",value:function(l){var u,m=this.global;(u=this.types[l.type])&&xu(l,u),!l.propagationStopped&&m&&(u=m[l.type])&&xu(l,u)}},{key:"on",value:function(l,u){var m=di(l,u);for(l in m)this.types[l]=Zd(this.types[l]||[],m[l])}},{key:"off",value:function(l,u){var m=di(l,u);for(l in m){var g=this.types[l];if(g&&g.length)for(var v=0,b=m[l];v<b.length;v++){var y=b[v],w=g.indexOf(y);w!==-1&&g.splice(w,1)}}}},{key:"getRect",value:function(l){return null}}]),c}(),t0=function(){function c(l){t(this,c),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=l,ws(this,l)}return n(c,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),c}();function Ha(c){return $.object(c)?{capture:!!c.capture,passive:!!c.passive}:{capture:!!c,passive:!1}}function Ts(c,l){return c===l||(typeof c=="boolean"?!!l.capture===c&&!l.passive:!!c.capture==!!l.capture&&!!c.passive==!!l.passive)}var r0={id:"events",install:function(c){var l,u=[],m={},g=[],v={add:b,remove:y,addDelegate:function(_,E,O,D,V){var N=Ha(V);if(!m[O]){m[O]=[];for(var G=0;G<g.length;G++){var K=g[G];b(K,O,w),b(K,O,M,!0)}}var X=m[O],pe=Pa(X,function(Ce){return Ce.selector===_&&Ce.context===E});pe||(pe={selector:_,context:E,listeners:[]},X.push(pe)),pe.listeners.push({func:D,options:N})},removeDelegate:function(_,E,O,D,V){var N,G=Ha(V),K=m[O],X=!1;if(K)for(N=K.length-1;N>=0;N--){var pe=K[N];if(pe.selector===_&&pe.context===E){for(var Ce=pe.listeners,re=Ce.length-1;re>=0;re--){var ve=Ce[re];if(ve.func===D&&Ts(ve.options,G)){Ce.splice(re,1),Ce.length||(K.splice(N,1),y(E,O,w),y(E,O,M,!0)),X=!0;break}}if(X)break}}},delegateListener:w,delegateUseCapture:M,delegatedEvents:m,documents:g,targets:u,supportsOptions:!1,supportsPassive:!1};function b(_,E,O,D){if(_.addEventListener){var V=Ha(D),N=Pa(u,function(G){return G.eventTarget===_});N||(N={eventTarget:_,events:{}},u.push(N)),N.events[E]||(N.events[E]=[]),Pa(N.events[E],function(G){return G.func===O&&Ts(G.options,V)})||(_.addEventListener(E,O,v.supportsOptions?V:V.capture),N.events[E].push({func:O,options:V}))}}function y(_,E,O,D){if(_.addEventListener&&_.removeEventListener){var V=Aa(u,function(ao){return ao.eventTarget===_}),N=u[V];if(N&&N.events)if(E!=="all"){var G=!1,K=N.events[E];if(K){if(O==="all"){for(var X=K.length-1;X>=0;X--){var pe=K[X];y(_,E,pe.func,pe.options)}return}for(var Ce=Ha(D),re=0;re<K.length;re++){var ve=K[re];if(ve.func===O&&Ts(ve.options,Ce)){_.removeEventListener(E,O,v.supportsOptions?Ce:Ce.capture),K.splice(re,1),K.length===0&&(delete N.events[E],G=!0);break}}}G&&!Object.keys(N.events).length&&u.splice(V,1)}else for(E in N.events)N.events.hasOwnProperty(E)&&y(_,E,"all")}}function w(_,E){for(var O=Ha(E),D=new t0(_),V=m[_.type],N=Xd(_)[0],G=N;$.element(G);){for(var K=0;K<V.length;K++){var X=V[K],pe=X.selector,Ce=X.context;if(zi(G,pe)&&si(Ce,N)&&si(Ce,G)){var re=X.listeners;D.currentTarget=G;for(var ve=0;ve<re.length;ve++){var ao=re[ve];Ts(ao.options,O)&&ao.func(D)}}}G=Uo(G)}}function M(_){return w(_,!0)}return(l=c.document)==null||l.createElement("div").addEventListener("test",null,{get capture(){return v.supportsOptions=!0},get passive(){return v.supportsPassive=!0}}),c.events=v,v}},Jl={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(c){for(var l=0,u=Jl.methodOrder;l<u.length;l++){var m=u[l],g=Jl[m](c);if(g)return g}return null},simulationResume:function(c){var l=c.pointerType,u=c.eventType,m=c.eventTarget,g=c.scope;if(!/down|start/i.test(u))return null;for(var v=0,b=g.interactions.list;v<b.length;v++){var y=b[v],w=m;if(y.simulation&&y.simulation.allowResume&&y.pointerType===l)for(;w;){if(w===y.element)return y;w=Uo(w)}}return null},mouseOrPen:function(c){var l,u=c.pointerId,m=c.pointerType,g=c.eventType,v=c.scope;if(m!=="mouse"&&m!=="pen")return null;for(var b=0,y=v.interactions.list;b<y.length;b++){var w=y[b];if(w.pointerType===m){if(w.simulation&&!_u(w,u))continue;if(w.interacting())return w;l||(l=w)}}if(l)return l;for(var M=0,_=v.interactions.list;M<_.length;M++){var E=_[M];if(!(E.pointerType!==m||/down/i.test(g)&&E.simulation))return E}return null},hasPointer:function(c){for(var l=c.pointerId,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(_u(g,l))return g}return null},idle:function(c){for(var l=c.pointerType,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(g.pointers.length===1){var v=g.interactable;if(v&&(!v.options.gesture||!v.options.gesture.enabled))continue}else if(g.pointers.length>=2)continue;if(!g.interacting()&&l===g.pointerType)return g}return null}};function _u(c,l){return c.pointers.some(function(u){return u.id===l})}var o0=Jl,ec=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Mu(c,l){return function(u){var m=l.interactions.list,g=Yd(u),v=Xd(u),b=v[0],y=v[1],w=[];if(/^touch/.test(u.type)){l.prevTouchTime=l.now();for(var M=0,_=u.changedTouches;M<_.length;M++){var E=_[M],O={pointer:E,pointerId:Ta(E),pointerType:g,eventType:u.type,eventTarget:b,curEventTarget:y,scope:l},D=Cu(O);w.push([O.pointer,O.eventTarget,O.curEventTarget,D])}}else{var V=!1;if(!io.supportsPointerEvent&&/mouse/.test(u.type)){for(var N=0;N<m.length&&!V;N++)V=m[N].pointerType!=="mouse"&&m[N].pointerIsDown;V=V||l.now()-l.prevTouchTime<500||u.timeStamp===0}if(!V){var G={pointer:u,pointerId:Ta(u),pointerType:g,eventType:u.type,curEventTarget:y,eventTarget:b,scope:l},K=Cu(G);w.push([G.pointer,G.eventTarget,G.curEventTarget,K])}}for(var X=0;X<w.length;X++){var pe=w[X],Ce=pe[0],re=pe[1],ve=pe[2];pe[3][c](Ce,u,re,ve)}}}function Cu(c){var l=c.pointerType,u=c.scope,m={interaction:o0.search(c),searchDetails:c};return u.fire("interactions:find",m),m.interaction||u.interactions.new({pointerType:l})}function tc(c,l){var u=c.doc,m=c.scope,g=c.options,v=m.interactions.docEvents,b=m.events,y=b[l];for(var w in m.browser.isIOS&&!g.events&&(g.events={passive:!1}),b.delegatedEvents)y(u,w,b.delegateListener),y(u,w,b.delegateUseCapture,!0);for(var M=g&&g.events,_=0;_<v.length;_++){var E=v[_];y(u,E.type,E.listener,M)}}var i0={id:"core/interactions",install:function(c){for(var l={},u=0;u<ec.length;u++){var m=ec[u];l[m]=Mu(m,c)}var g,v=io.pEventTypes;function b(){for(var y=0,w=c.interactions.list;y<w.length;y++){var M=w[y];if(M.pointerIsDown&&M.pointerType==="touch"&&!M._interacting)for(var _=function(){var D=O[E];c.documents.some(function(V){return si(V.doc,D.downTarget)})||M.removePointer(D.pointer,D.event)},E=0,O=M.pointers;E<O.length;E++)_()}}(g=et.PointerEvent?[{type:v.down,listener:b},{type:v.down,listener:l.pointerDown},{type:v.move,listener:l.pointerMove},{type:v.up,listener:l.pointerUp},{type:v.cancel,listener:l.pointerUp}]:[{type:"mousedown",listener:l.pointerDown},{type:"mousemove",listener:l.pointerMove},{type:"mouseup",listener:l.pointerUp},{type:"touchstart",listener:b},{type:"touchstart",listener:l.pointerDown},{type:"touchmove",listener:l.pointerMove},{type:"touchend",listener:l.pointerUp},{type:"touchcancel",listener:l.pointerUp}]).push({type:"blur",listener:function(y){for(var w=0,M=c.interactions.list;w<M.length;w++)M[w].documentBlur(y)}}),c.prevTouchTime=0,c.Interaction=function(y){d(M,y);var w=x(M);function M(){return t(this,M),w.apply(this,arguments)}return n(M,[{key:"pointerMoveTolerance",get:function(){return c.interactions.pointerMoveTolerance},set:function(_){c.interactions.pointerMoveTolerance=_}},{key:"_now",value:function(){return c.now()}}]),M}(Y1),c.interactions={list:[],new:function(y){y.scopeFire=function(M,_){return c.fire(M,_)};var w=new c.Interaction(y);return c.interactions.list.push(w),w},listeners:l,docEvents:g,pointerMoveTolerance:1},c.usePlugin(hu)},listeners:{"scope:add-document":function(c){return tc(c,"add")},"scope:remove-document":function(c){return tc(c,"remove")},"interactable:unset":function(c,l){for(var u=c.interactable,m=l.interactions.list.length-1;m>=0;m--){var g=l.interactions.list[m];g.interactable===u&&(g.stop(),l.fire("interactions:destroy",{interaction:g}),g.destroy(),l.interactions.list.length>2&&l.interactions.list.splice(m,1))}}},onDocSignal:tc,doOnInteractions:Mu,methodNames:ec},n0=i0,nn=function(c){return c[c.On=0]="On",c[c.Off=1]="Off",c}(nn||{}),a0=function(){function c(l,u,m,g){t(this,c),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new wu,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=u.actions,this.target=l,this._context=u.context||m,this._win=H(wo(l)?this._context:l),this._doc=this._win.document,this._scopeEvents=g,this.set(u)}return n(c,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(l,u){return $.func(u.onstart)&&this.on("".concat(l,"start"),u.onstart),$.func(u.onmove)&&this.on("".concat(l,"move"),u.onmove),$.func(u.onend)&&this.on("".concat(l,"end"),u.onend),$.func(u.oninertiastart)&&this.on("".concat(l,"inertiastart"),u.oninertiastart),this}},{key:"updatePerActionListeners",value:function(l,u,m){var g,v=this,b=(g=this._actions.map[l])==null?void 0:g.filterEventType,y=function(w){return(b==null||b(w))&&Es(w,v._actions)};($.array(u)||$.object(u))&&this._onOff(nn.Off,l,u,void 0,y),($.array(m)||$.object(m))&&this._onOff(nn.On,l,m,void 0,y)}},{key:"setPerAction",value:function(l,u){var m=this._defaults;for(var g in u){var v=g,b=this.options[l],y=u[v];v==="listeners"&&this.updatePerActionListeners(l,b.listeners,y),$.array(y)?b[v]=Qd(y):$.plainObject(y)?(b[v]=U(b[v]||{},Wn(y)),$.object(m.perAction[v])&&"enabled"in m.perAction[v]&&(b[v].enabled=y.enabled!==!1)):$.bool(y)&&$.object(m.perAction[v])?b[v].enabled=y:b[v]=y}}},{key:"getRect",value:function(l){return l=l||($.element(this.target)?this.target:null),$.string(this.target)&&(l=l||this._context.querySelector(this.target)),Ae(l)}},{key:"rectChecker",value:function(l){var u=this;return $.func(l)?(this.getRect=function(m){var g=U({},l.apply(u,m));return"width"in g||(g.width=g.right-g.left,g.height=g.bottom-g.top),g},this):l===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(l,u){if(wo(u)||$.object(u)){for(var m in this.options[l]=u,this._actions.map)this.options[m][l]=u;return this}return this.options[l]}},{key:"origin",value:function(l){return this._backCompatOption("origin",l)}},{key:"deltaSource",value:function(l){return l==="page"||l==="client"?(this.options.deltaSource=l,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var l=this.target;return $.string(l)?Array.from(this._context.querySelectorAll(l)):$.func(l)&&l.getAllElements?l.getAllElements():$.element(l)?[l]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(l){return this._context===l.ownerDocument||si(this._context,l)}},{key:"testIgnoreAllow",value:function(l,u,m){return!this.testIgnore(l.ignoreFrom,u,m)&&this.testAllow(l.allowFrom,u,m)}},{key:"testAllow",value:function(l,u,m){return!l||!!$.element(m)&&($.string(l)?fe(m,l,u):!!$.element(l)&&si(l,m))}},{key:"testIgnore",value:function(l,u,m){return!(!l||!$.element(m))&&($.string(l)?fe(m,l,u):!!$.element(l)&&si(l,m))}},{key:"fire",value:function(l){return this.events.fire(l),this}},{key:"_onOff",value:function(l,u,m,g,v){$.object(u)&&!$.array(u)&&(g=m,m=null);var b=di(u,m,v);for(var y in b){y==="wheel"&&(y=io.wheelEvent);for(var w=0,M=b[y];w<M.length;w++){var _=M[w];Es(y,this._actions)?this.events[l===nn.On?"on":"off"](y,_):$.string(this.target)?this._scopeEvents[l===nn.On?"addDelegate":"removeDelegate"](this.target,this._context,y,_,g):this._scopeEvents[l===nn.On?"add":"remove"](this.target,y,_,g)}}return this}},{key:"on",value:function(l,u,m){return this._onOff(nn.On,l,u,m)}},{key:"off",value:function(l,u,m){return this._onOff(nn.Off,l,u,m)}},{key:"set",value:function(l){var u=this._defaults;for(var m in $.object(l)||(l={}),this.options=Wn(u.base),this._actions.methodDict){var g=m,v=this._actions.methodDict[g];this.options[g]={},this.setPerAction(g,U(U({},u.perAction),u.actions[g])),this[v](l[g])}for(var b in l)b!=="getRect"?$.func(this[b])&&this[b](l[b]):this.rectChecker(l.getRect);return this}},{key:"unset",value:function(){if($.string(this.target))for(var l in this._scopeEvents.delegatedEvents)for(var u=this._scopeEvents.delegatedEvents[l],m=u.length-1;m>=0;m--){var g=u[m],v=g.selector,b=g.context,y=g.listeners;v===this.target&&b===this._context&&u.splice(m,1);for(var w=y.length-1;w>=0;w--)this._scopeEvents.removeDelegate(this.target,this._context,l,y[w][0],y[w][1])}else this._scopeEvents.remove(this.target,"all")}}]),c}(),s0=function(){function c(l){var u=this;t(this,c),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=l,l.addListeners({"interactable:unset":function(m){var g=m.interactable,v=g.target,b=$.string(v)?u.selectorMap[v]:v[u.scope.id],y=Aa(b,function(w){return w===g});b.splice(y,1)}})}return n(c,[{key:"new",value:function(l,u){u=U(u||{},{actions:this.scope.actions});var m=new this.scope.Interactable(l,u,this.scope.document,this.scope.events);return this.scope.addDocument(m._doc),this.list.push(m),$.string(l)?(this.selectorMap[l]||(this.selectorMap[l]=[]),this.selectorMap[l].push(m)):(m.target[this.scope.id]||Object.defineProperty(l,this.scope.id,{value:[],configurable:!0}),l[this.scope.id].push(m)),this.scope.fire("interactable:new",{target:l,options:u,interactable:m,win:this.scope._win}),m}},{key:"getExisting",value:function(l,u){var m=u&&u.context||this.scope.document,g=$.string(l),v=g?this.selectorMap[l]:l[this.scope.id];if(v)return Pa(v,function(b){return b._context===m&&(g||b.inContext(l))})}},{key:"forEachMatch",value:function(l,u){for(var m=0,g=this.list;m<g.length;m++){var v=g[m],b=void 0;if(($.string(v.target)?$.element(l)&&zi(l,v.target):l===v.target)&&v.inContext(l)&&(b=u(v)),b!==void 0)return b}}}]),c}(),l0=function(){function c(){var l=this;t(this,c),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=io,this.defaults=Wn(mu),this.Eventable=wu,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=function(m){var g=function v(b,y){var w=m.interactables.getExisting(b,y);return w||((w=m.interactables.new(b,y)).events.global=v.globalEvents),w};return g.getPointerAverage=Gd,g.getTouchBBox=Vl,g.getTouchDistance=Dl,g.getTouchAngle=Fl,g.getElementRect=Ae,g.getElementClientRect=Z,g.matchesSelector=zi,g.closest=Bn,g.globalEvents={},g.version="1.10.27",g.scope=m,g.use=function(v,b){return this.scope.usePlugin(v,b),this},g.isSet=function(v,b){return!!this.scope.interactables.get(v,b&&b.context)},g.on=ja(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.on(_,b,y)}return this}if($.object(v)){for(var E in v)this.on(E,v[E],b);return this}return Es(v,this.scope.actions)?this.globalEvents[v]?this.globalEvents[v].push(b):this.globalEvents[v]=[b]:this.scope.events.add(this.scope.document,v,b,{options:y}),this},"The interact.on() method is being deprecated"),g.off=ja(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.off(_,b,y)}return this}if($.object(v)){for(var E in v)this.off(E,v[E],b);return this}var O;return Es(v,this.scope.actions)?v in this.globalEvents&&(O=this.globalEvents[v].indexOf(b))!==-1&&this.globalEvents[v].splice(O,1):this.scope.events.remove(this.scope.document,v,b,y),this},"The interact.off() method is being deprecated"),g.debug=function(){return this.scope},g.supportsTouch=function(){return io.supportsTouch},g.supportsPointerEvent=function(){return io.supportsPointerEvent},g.stop=function(){for(var v=0,b=this.scope.interactions.list;v<b.length;v++)b[v].stop();return this},g.pointerMoveTolerance=function(v){return $.number(v)?(this.scope.interactions.pointerMoveTolerance=v,this):this.scope.interactions.pointerMoveTolerance},g.addDocument=function(v,b){this.scope.addDocument(v,b)},g.removeDocument=function(v){this.scope.removeDocument(v)},g}(this),this.InteractEvent=Zl,this.Interactable=void 0,this.interactables=new s0(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(m){return l.removeDocument(m.target)};var u=this;this.Interactable=function(m){d(v,m);var g=x(v);function v(){return t(this,v),g.apply(this,arguments)}return n(v,[{key:"_defaults",get:function(){return u.defaults}},{key:"set",value:function(b){return k(h(v.prototype),"set",this).call(this,b),u.fire("interactable:set",{options:b,interactable:this}),this}},{key:"unset",value:function(){k(h(v.prototype),"unset",this).call(this);var b=u.interactables.list.indexOf(this);b<0||(u.interactables.list.splice(b,1),u.fire("interactable:unset",{interactable:this}))}}]),v}(a0)}return n(c,[{key:"addListeners",value:function(l,u){this.listenerMaps.push({id:u,map:l})}},{key:"fire",value:function(l,u){for(var m=0,g=this.listenerMaps;m<g.length;m++){var v=g[m].map[l];if(v&&v(u,this,l)===!1)return!1}}},{key:"init",value:function(l){return this.isInitialized?this:function(u,m){return u.isInitialized=!0,$.window(m)&&P(m),et.init(m),io.init(m),rn.init(m),u.window=m,u.document=m.document,u.usePlugin(n0),u.usePlugin(r0),u}(this,l)}},{key:"pluginIsInstalled",value:function(l){var u=l.id;return u?!!this._plugins.map[u]:this._plugins.list.indexOf(l)!==-1}},{key:"usePlugin",value:function(l,u){if(!this.isInitialized)return this;if(this.pluginIsInstalled(l))return this;if(l.id&&(this._plugins.map[l.id]=l),this._plugins.list.push(l),l.install&&l.install(this,u),l.listeners&&l.before){for(var m=0,g=this.listenerMaps.length,v=l.before.reduce(function(y,w){return y[w]=!0,y[zu(w)]=!0,y},{});m<g;m++){var b=this.listenerMaps[m].id;if(b&&(v[b]||v[zu(b)]))break}this.listenerMaps.splice(m,0,{id:l.id,map:l.listeners})}else l.listeners&&this.listenerMaps.push({id:l.id,map:l.listeners});return this}},{key:"addDocument",value:function(l,u){if(this.getDocIndex(l)!==-1)return!1;var m=H(l);u=u?U({},u):{},this.documents.push({doc:l,options:u}),this.events.documents.push(l),l!==this.document&&this.events.add(m,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:l,window:m,scope:this,options:u})}},{key:"removeDocument",value:function(l){var u=this.getDocIndex(l),m=H(l),g=this.documents[u].options;this.events.remove(m,"unload",this.onWindowUnload),this.documents.splice(u,1),this.events.documents.splice(u,1),this.fire("scope:remove-document",{doc:l,window:m,scope:this,options:g})}},{key:"getDocIndex",value:function(l){for(var u=0;u<this.documents.length;u++)if(this.documents[u].doc===l)return u;return-1}},{key:"getDocOptions",value:function(l){var u=this.getDocIndex(l);return u===-1?null:this.documents[u].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),c}();function zu(c){return c&&c.replace(/\/.*$/,"")}var Eu=new l0,no=Eu.interactStatic,c0=typeof globalThis<"u"?globalThis:window;Eu.init(c0);var d0=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(c){var l=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(m){var g=m[0],v=m[1];return g in c||v in c}),u=function(m,g){for(var v=c.range,b=c.limits,y=b===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:b,w=c.offset,M=w===void 0?{x:0,y:0}:w,_={range:v,grid:c,x:null,y:null},E=0;E<l.length;E++){var O=l[E],D=O[0],V=O[1],N=Math.round((m-M.x)/c[D]),G=Math.round((g-M.y)/c[V]);_[D]=Math.max(y.left,Math.min(y.right,N*c[D]+M.x)),_[V]=Math.max(y.top,Math.min(y.bottom,G*c[V]+M.y))}return _};return u.grid=c,u.coordFields=l,u}}),u0={id:"snappers",install:function(c){var l=c.interactStatic;l.snappers=U(l.snappers||{},d0),l.createSnapGrid=l.snappers.grid}},h0=u0,p0={start:function(c){var l=c.state,u=c.rect,m=c.edges,g=c.pageCoords,v=l.options,b=v.ratio,y=v.enabled,w=l.options,M=w.equalDelta,_=w.modifiers;b==="preserve"&&(b=u.width/u.height),l.startCoords=U({},g),l.startRect=U({},u),l.ratio=b,l.equalDelta=M;var E=l.linkedEdges={top:m.top||m.left&&!m.bottom,left:m.left||m.top&&!m.right,bottom:m.bottom||m.right&&!m.top,right:m.right||m.bottom&&!m.left};if(l.xIsPrimaryAxis=!(!m.left&&!m.right),l.equalDelta){var O=(E.left?1:-1)*(E.top?1:-1);l.edgeSign={x:O,y:O}}else l.edgeSign={x:E.left?-1:1,y:E.top?-1:1};if(y!==!1&&U(m,E),_!=null&&_.length){var D=new Xl(c.interaction);D.copyFrom(c.interaction.modification),D.prepareStates(_),l.subModification=D,D.startAll(o({},c))}},set:function(c){var l=c.state,u=c.rect,m=c.coords,g=l.linkedEdges,v=U({},m),b=l.equalDelta?m0:g0;if(U(c.edges,g),b(l,l.xIsPrimaryAxis,m,u),!l.subModification)return null;var y=U({},u);tn(g,y,{x:m.x-v.x,y:m.y-v.y});var w=l.subModification.setAll(o(o({},c),{},{rect:y,edges:g,pageCoords:m,prevCoords:m,prevRect:y})),M=w.delta;return w.changed&&(b(l,Math.abs(M.x)>Math.abs(M.y),w.coords,w.rect),U(m,w.coords)),w.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function m0(c,l,u){var m=c.startCoords,g=c.edgeSign;l?u.y=m.y+(u.x-m.x)*g.y:u.x=m.x+(u.y-m.y)*g.x}function g0(c,l,u,m){var g=c.startRect,v=c.startCoords,b=c.ratio,y=c.edgeSign;if(l){var w=m.width/b;u.y=v.y+(w-g.height)*y.y}else{var M=m.height*b;u.x=v.x+(M-g.width)*y.x}}var f0=on(p0,"aspectRatio"),Su=function(){};Su._defaults={};var As=Su;function kn(c,l,u){return $.func(c)?li(c,l.interactable,l.element,[u.x,u.y,l]):li(c,l.interactable,l.element)}var Ps={start:function(c){var l=c.rect,u=c.startOffset,m=c.state,g=c.interaction,v=c.pageCoords,b=m.options,y=b.elementRect,w=U({left:0,top:0,right:0,bottom:0},b.offset||{});if(l&&y){var M=kn(b.restriction,g,v);if(M){var _=M.right-M.left-l.width,E=M.bottom-M.top-l.height;_<0&&(w.left+=_,w.right+=_),E<0&&(w.top+=E,w.bottom+=E)}w.left+=u.left-l.width*y.left,w.top+=u.top-l.height*y.top,w.right+=u.right-l.width*(1-y.right),w.bottom+=u.bottom-l.height*(1-y.bottom)}m.offset=w},set:function(c){var l=c.coords,u=c.interaction,m=c.state,g=m.options,v=m.offset,b=kn(g.restriction,u,l);if(b){var y=function(w){return!w||"left"in w&&"top"in w||((w=U({},w)).left=w.x||0,w.top=w.y||0,w.right=w.right||w.left+w.width,w.bottom=w.bottom||w.top+w.height),w}(b);l.x=Math.max(Math.min(y.right-v.right,l.x),y.left+v.left),l.y=Math.max(Math.min(y.bottom-v.bottom,l.y),y.top+v.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},v0=on(Ps,"restrict"),$u={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Tu={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Au(c,l){for(var u=0,m=["top","left","bottom","right"];u<m.length;u++){var g=m[u];g in c||(c[g]=l[g])}return c}var Ra={noInner:$u,noOuter:Tu,start:function(c){var l,u=c.interaction,m=c.startOffset,g=c.state,v=g.options;v&&(l=Go(kn(v.offset,u,u.coords.start.page))),l=l||{x:0,y:0},g.offset={top:l.y+m.top,left:l.x+m.left,bottom:l.y-m.bottom,right:l.x-m.right}},set:function(c){var l=c.coords,u=c.edges,m=c.interaction,g=c.state,v=g.offset,b=g.options;if(u){var y=U({},l),w=kn(b.inner,m,y)||{},M=kn(b.outer,m,y)||{};Au(w,$u),Au(M,Tu),u.top?l.y=Math.min(Math.max(M.top+v.top,y.y),w.top+v.top):u.bottom&&(l.y=Math.max(Math.min(M.bottom+v.bottom,y.y),w.bottom+v.bottom)),u.left?l.x=Math.min(Math.max(M.left+v.left,y.x),w.left+v.left):u.right&&(l.x=Math.max(Math.min(M.right+v.right,y.x),w.right+v.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},b0=on(Ra,"restrictEdges"),y0=U({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(c){}},Ps.defaults),k0=on({start:Ps.start,set:Ps.set,defaults:y0},"restrictRect"),x0={width:-1/0,height:-1/0},w0={width:1/0,height:1/0},_0=on({start:function(c){return Ra.start(c)},set:function(c){var l=c.interaction,u=c.state,m=c.rect,g=c.edges,v=u.options;if(g){var b=ci(kn(v.min,l,c.coords))||x0,y=ci(kn(v.max,l,c.coords))||w0;u.options={endOnly:v.endOnly,inner:U({},Ra.noInner),outer:U({},Ra.noOuter)},g.top?(u.options.inner.top=m.bottom-b.height,u.options.outer.top=m.bottom-y.height):g.bottom&&(u.options.inner.bottom=m.top+b.height,u.options.outer.bottom=m.top+y.height),g.left?(u.options.inner.left=m.right-b.width,u.options.outer.left=m.right-y.width):g.right&&(u.options.inner.right=m.left+b.width,u.options.outer.right=m.left+y.width),Ra.set(c),u.options=v}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),rc={start:function(c){var l,u=c.interaction,m=c.interactable,g=c.element,v=c.rect,b=c.state,y=c.startOffset,w=b.options,M=w.offsetWithOrigin?function(O){var D=O.interaction.element,V=Go(li(O.state.options.origin,null,null,[D])),N=V||ji(O.interactable,D,O.interaction.prepared.name);return N}(c):{x:0,y:0};if(w.offset==="startCoords")l={x:u.coords.start.page.x,y:u.coords.start.page.y};else{var _=li(w.offset,m,g,[u]);(l=Go(_)||{x:0,y:0}).x+=M.x,l.y+=M.y}var E=w.relativePoints;b.offsets=v&&E&&E.length?E.map(function(O,D){return{index:D,relativePoint:O,x:y.left-v.width*O.x+l.x,y:y.top-v.height*O.y+l.y}}):[{index:0,relativePoint:null,x:l.x,y:l.y}]},set:function(c){var l=c.interaction,u=c.coords,m=c.state,g=m.options,v=m.offsets,b=ji(l.interactable,l.element,l.prepared.name),y=U({},u),w=[];g.offsetWithOrigin||(y.x-=b.x,y.y-=b.y);for(var M=0,_=v;M<_.length;M++)for(var E=_[M],O=y.x-E.x,D=y.y-E.y,V=0,N=g.targets.length;V<N;V++){var G=g.targets[V],K=void 0;(K=$.func(G)?G(O,D,l._proxy,E,V):G)&&w.push({x:($.number(K.x)?K.x:O)+E.x,y:($.number(K.y)?K.y:D)+E.y,range:$.number(K.range)?K.range:g.range,source:G,index:V,offset:E})}for(var X={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},pe=0;pe<w.length;pe++){var Ce=w[pe],re=Ce.range,ve=Ce.x-y.x,ao=Ce.y-y.y,kt=$a(ve,ao),Do=kt<=re;re===1/0&&X.inRange&&X.range!==1/0&&(Do=!1),X.target&&!(Do?X.inRange&&re!==1/0?kt/re<X.distance/X.range:re===1/0&&X.range!==1/0||kt<X.distance:!X.inRange&&kt<X.distance)||(X.target=Ce,X.distance=kt,X.range=re,X.inRange=Do,X.delta.x=ve,X.delta.y=ao)}return X.inRange&&(u.x=X.target.x,u.y=X.target.y),m.closest=X,X},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},M0=on(rc,"snap"),js={start:function(c){var l=c.state,u=c.edges,m=l.options;if(!u)return null;c.state={options:{targets:null,relativePoints:[{x:u.left?0:1,y:u.top?0:1}],offset:m.offset||"self",origin:{x:0,y:0},range:m.range}},l.targetFields=l.targetFields||[["width","height"],["x","y"]],rc.start(c),l.offsets=c.state.offsets,c.state=l},set:function(c){var l=c.interaction,u=c.state,m=c.coords,g=u.options,v=u.offsets,b={x:m.x-v[0].x,y:m.y-v[0].y};u.options=U({},g),u.options.targets=[];for(var y=0,w=g.targets||[];y<w.length;y++){var M=w[y],_=void 0;if(_=$.func(M)?M(b.x,b.y,l):M){for(var E=0,O=u.targetFields;E<O.length;E++){var D=O[E],V=D[0],N=D[1];if(V in _||N in _){_.x=_[V],_.y=_[N];break}}u.options.targets.push(_)}}var G=rc.set(c);return u.options=g,G},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},C0=on(js,"snapSize"),oc={aspectRatio:f0,restrictEdges:b0,restrict:v0,restrictRect:k0,restrictSize:_0,snapEdges:on({start:function(c){var l=c.edges;return l?(c.state.targetFields=c.state.targetFields||[[l.left?"left":"right",l.top?"top":"bottom"]],js.start(c)):null},set:js.set,defaults:U(Wn(js.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:M0,snapSize:C0,spring:As,avoid:As,transform:As,rubberband:As},z0={id:"modifiers",install:function(c){var l=c.interactStatic;for(var u in c.usePlugin(pu),c.usePlugin(h0),l.modifiers=oc,oc){var m=oc[u],g=m._defaults,v=m._methods;g._methods=v,c.defaults.perAction[u]=g}}},E0=z0,Pu=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w){var M;if(t(this,u),ws(f(M=l.call(this,y)),v),v!==g&&ws(f(M),g),M.timeStamp=w,M.originalEvent=v,M.type=m,M.pointerId=Ta(g),M.pointerType=Yd(g),M.target=b,M.currentTarget=null,m==="tap"){var _=y.getPointerIndex(g);M.dt=M.timeStamp-y.pointers[_].downTime;var E=M.timeStamp-y.tapTime;M.double=!!y.prevTap&&y.prevTap.type!=="doubletap"&&y.prevTap.target===M.target&&E<500}else m==="doubletap"&&(M.dt=g.timeStamp-y.tapTime,M.double=!0);return M}return n(u,[{key:"_subtractOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX-=g,this.pageY-=v,this.clientX-=g,this.clientY-=v,this}},{key:"_addOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX+=g,this.pageY+=v,this.clientX+=g,this.clientY+=v,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),u}(Cs),Ia={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(c){c.pointerEvents=Ia,c.defaults.actions.pointerEvents=Ia.defaults,U(c.actions.phaselessTypes,Ia.types)},listeners:{"interactions:new":function(c){var l=c.interaction;l.prevTap=null,l.tapTime=0},"interactions:update-pointer":function(c){var l=c.down,u=c.pointerInfo;!l&&u.hold||(u.hold={duration:1/0,timeout:null})},"interactions:move":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;c.duplicate||u.pointerIsDown&&!u.pointerWasMoved||(u.pointerIsDown&&ic(c),an({interaction:u,pointer:m,event:g,eventTarget:v,type:"move"},l))},"interactions:down":function(c,l){(function(u,m){for(var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget,w=u.pointerIndex,M=g.pointers[w].hold,_=ce(y),E={interaction:g,pointer:v,event:b,eventTarget:y,type:"hold",targets:[],path:_,node:null},O=0;O<_.length;O++){var D=_[O];E.node=D,m.fire("pointerEvents:collect-targets",E)}if(E.targets.length){for(var V=1/0,N=0,G=E.targets;N<G.length;N++){var K=G[N].eventable.options.holdDuration;K<V&&(V=K)}M.duration=V,M.timeout=setTimeout(function(){an({interaction:g,eventTarget:y,pointer:v,event:b,type:"hold"},m)},V)}})(c,l),an(c,l)},"interactions:up":function(c,l){ic(c),an(c,l),function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerWasMoved||an({interaction:g,eventTarget:y,pointer:v,event:b,type:"tap"},m)}(c,l)},"interactions:cancel":function(c,l){ic(c),an(c,l)}},PointerEvent:Pu,fire:an,collectEventTargets:ju,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function an(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=c.targets,w=y===void 0?ju(c,l):y,M=new Pu(b,m,g,v,u,l.now());l.fire("pointerEvents:new",{pointerEvent:M});for(var _={interaction:u,pointer:m,event:g,eventTarget:v,targets:w,type:b,pointerEvent:M},E=0;E<w.length;E++){var O=w[E];for(var D in O.props||{})M[D]=O.props[D];var V=ji(O.eventable,O.node);if(M._subtractOrigin(V),M.eventable=O.eventable,M.currentTarget=O.node,O.eventable.fire(M),M._addOrigin(V),M.immediatePropagationStopped||M.propagationStopped&&E+1<w.length&&w[E+1].node!==M.currentTarget)break}if(l.fire("pointerEvents:fired",_),b==="tap"){var N=M.double?an({interaction:u,pointer:m,event:g,eventTarget:v,type:"doubletap"},l):M;u.prevTap=N,u.tapTime=N.timeStamp}return M}function ju(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=u.getPointerIndex(m),w=u.pointers[y];if(b==="tap"&&(u.pointerWasMoved||!w||w.downTarget!==v))return[];for(var M=ce(v),_={interaction:u,pointer:m,event:g,eventTarget:v,type:b,path:M,targets:[],node:null},E=0;E<M.length;E++){var O=M[E];_.node=O,l.fire("pointerEvents:collect-targets",_)}return b==="hold"&&(_.targets=_.targets.filter(function(D){var V,N;return D.eventable.options.holdDuration===((V=u.pointers[y])==null||(N=V.hold)==null?void 0:N.duration)})),_.targets}function ic(c){var l=c.interaction,u=c.pointerIndex,m=l.pointers[u].hold;m&&m.timeout&&(clearTimeout(m.timeout),m.timeout=null)}var S0=Object.freeze({__proto__:null,default:Ia});function $0(c){var l=c.interaction;l.holdIntervalHandle&&(clearInterval(l.holdIntervalHandle),l.holdIntervalHandle=null)}var T0={id:"pointer-events/holdRepeat",install:function(c){c.usePlugin(Ia);var l=c.pointerEvents;l.defaults.holdRepeatInterval=0,l.types.holdrepeat=c.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(c,l){return c["pointerEvents:".concat(l)]=$0,c},{"pointerEvents:new":function(c){var l=c.pointerEvent;l.type==="hold"&&(l.count=(l.count||0)+1)},"pointerEvents:fired":function(c,l){var u=c.interaction,m=c.pointerEvent,g=c.eventTarget,v=c.targets;if(m.type==="hold"&&v.length){var b=v[0].eventable.options.holdRepeatInterval;b<=0||(u.holdIntervalHandle=setTimeout(function(){l.pointerEvents.fire({interaction:u,eventTarget:g,type:"hold",pointer:m,event:m},l)},b))}}})},A0=T0,P0={id:"pointer-events/interactableTargets",install:function(c){var l=c.Interactable;l.prototype.pointerEvents=function(m){return U(this.events.options,m),this};var u=l.prototype._backCompatOption;l.prototype._backCompatOption=function(m,g){var v=u.call(this,m,g);return v===this&&(this.events.options[m]=g),v}},listeners:{"pointerEvents:collect-targets":function(c,l){var u=c.targets,m=c.node,g=c.type,v=c.eventTarget;l.interactables.forEachMatch(m,function(b){var y=b.events,w=y.options;y.types[g]&&y.types[g].length&&b.testIgnoreAllow(w,m,v)&&u.push({node:m,eventable:y,props:{interactable:b}})})},"interactable:new":function(c){var l=c.interactable;l.events.getRect=function(u){return l.getRect(u)}},"interactable:set":function(c,l){var u=c.interactable,m=c.options;U(u.events.options,l.pointerEvents.defaults),U(u.events.options,m.pointerEvents||{})}}},j0=P0,O0={id:"pointer-events",install:function(c){c.usePlugin(S0),c.usePlugin(A0),c.usePlugin(j0)}},H0=O0,R0={id:"reflow",install:function(c){var l=c.Interactable;c.actions.phases.reflow=!0,l.prototype.reflow=function(u){return function(m,g,v){for(var b=m.getAllElements(),y=v.window.Promise,w=y?[]:null,M=function(){var E=b[_],O=m.getRect(E);if(!O)return 1;var D,V=Pa(v.interactions.list,function(K){return K.interacting()&&K.interactable===m&&K.element===E&&K.prepared.name===g.name});if(V)V.move(),w&&(D=V._reflowPromise||new y(function(K){V._reflowResolve=K}));else{var N=ci(O),G=function(K){return{coords:K,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}}({page:{x:N.x,y:N.y},client:{x:N.x,y:N.y},timeStamp:v.now()});D=function(K,X,pe,Ce,re){var ve=K.interactions.new({pointerType:"reflow"}),ao={interaction:ve,event:re,pointer:re,eventTarget:pe,phase:"reflow"};ve.interactable=X,ve.element=pe,ve.prevEvent=re,ve.updatePointer(re,re,pe,!0),Kd(ve.coords.delta),Wl(ve.prepared,Ce),ve._doPhase(ao);var kt=K.window,Do=kt.Promise,ui=Do?new Do(function(Ri){ve._reflowResolve=Ri}):void 0;return ve._reflowPromise=ui,ve.start(Ce,X,pe),ve._interacting?(ve.move(ao),ve.end(re)):(ve.stop(),ve._reflowResolve()),ve.removePointer(re,re),ui}(v,m,E,g,G)}w&&w.push(D)},_=0;_<b.length&&!M();_++);return w&&y.all(w).then(function(){return m})}(this,u,c)}},listeners:{"interactions:stop":function(c,l){var u=c.interaction;u.pointerType==="reflow"&&(u._reflowResolve&&u._reflowResolve(),function(m,g){m.splice(m.indexOf(g),1)}(l.interactions.list,u))}}},I0=R0;if(no.use(hu),no.use(bu),no.use(H0),no.use(e0),no.use(E0),no.use(L1),no.use(A1),no.use(j1),no.use(I0),no.default=no,(typeof Tn>"u"?"undefined":e(Tn))==="object"&&Tn)try{Tn.exports=no}catch{}return no.default=no,no})});var Yf={};Ru(Yf,{BP:()=>vd,LuiAlert:()=>$r,LuiAutocomplete:()=>mt,LuiAvatar:()=>$t,LuiAvatarGroup:()=>ir,LuiBackground:()=>ct,LuiBadge:()=>rr,LuiBreadcrumb:()=>Xt,LuiBreadcrumbItem:()=>_r,LuiButton:()=>Wt,LuiButtonGroup:()=>Ge,LuiButtonGroupItem:()=>Ut,LuiCalendar:()=>Fr,LuiCard:()=>Rt,LuiCascader:()=>ht,LuiCheckbox:()=>Gt,LuiCheckboxGroup:()=>Cr,LuiCol:()=>po,LuiCollapse:()=>So,LuiCollapseItem:()=>Yr,LuiColorPicker:()=>ot,LuiCommandPalette:()=>lr,LuiConfigProvider:()=>ur,LuiContextMenu:()=>Re,LuiDateRangePicker:()=>Ho,LuiDatepicker:()=>_t,LuiDialog:()=>Me,LuiDivider:()=>Hr,LuiDrawer:()=>it,LuiDropdown:()=>Fi,LuiDropmenu:()=>Se,LuiEmptyState:()=>Fo,LuiFileInput:()=>Po,LuiForm:()=>Lt,LuiFormItem:()=>sr,LuiIcon:()=>Oe,LuiIconPicker:()=>$e,LuiImage:()=>Ie,LuiImageCropper:()=>wt,LuiInput:()=>He,LuiInputNumber:()=>Nt,LuiInputOpt:()=>Ir,LuiMenu:()=>Xo,LuiMenuDivider:()=>En,LuiMenuItem:()=>er,LuiOption:()=>fi,LuiOptionGroup:()=>un,LuiOverlayRoot:()=>Jn,LuiPagination:()=>Ye,LuiPopconfirm:()=>bt,LuiPopover:()=>te,LuiProgress:()=>Qt,LuiQrcode:()=>pr,LuiRadio:()=>zr,LuiRadioGroup:()=>Dr,LuiRow:()=>ri,LuiScrollArea:()=>Ft,LuiSelect:()=>me,LuiSkeleton:()=>jr,LuiSlider:()=>ut,LuiSpinner:()=>_o,LuiSplitter:()=>ro,LuiStatistic:()=>St,LuiSwitch:()=>go,LuiTab:()=>It,LuiTabPanel:()=>Eo,LuiTable:()=>Y,LuiTableColumn:()=>vr,LuiTabs:()=>ca,LuiTag:()=>so,LuiText:()=>Xe,LuiTextarea:()=>dt,LuiToast:()=>cr,LuiTooltip:()=>Gr,LuiTree:()=>le,LuiTreeSelect:()=>pt,baseStyles:()=>j,bringOverlayStackToFront:()=>Et,builtinIconCollection:()=>qs,builtinIconNames:()=>Ya,builtinIconPrefix:()=>wn,builtinTranslations:()=>Oc,commandPalette:()=>u1,contextMenu:()=>y1,createCommandPalette:()=>Sl,createContextMenu:()=>ks,createDialog:()=>Sa,createDialogForm:()=>Rd,createDrawer:()=>Tl,createForm:()=>f1,createPopover:()=>Ol,createTable:()=>qd,createToastHost:()=>Ld,dialog:()=>p1,drawer:()=>h1,encodeQr:()=>zl,ensureOverlayExternalLayer:()=>Ar,ensureOverlayLayer:()=>Js,ensureOverlayRoot:()=>Qs,eventPathContainsOwnedOverlay:()=>Cn,form:()=>v1,formatDate:()=>J2,formatSize:()=>Q2,getLocale:()=>Em,hasRecentOverlayInteraction:()=>es,hideAllContextMenus:()=>Dd,isImageIconSource:()=>Ks,isOverlayTopmost:()=>rs,markOverlayInteraction:()=>Ja,mergeTranslations:()=>ne,normalizeStatus:()=>Nn,onLocaleChange:()=>xe,popover:()=>k1,registerFormField:()=>Wp,registerOverlayStack:()=>Jt,registerTranslations:()=>Ic,resolveBuiltinIcon:()=>Yn,resolveBuiltinTranslations:()=>Zh,resolveOverlayLayerRegistration:()=>zn,setLocale:()=>Rc,setOverlayOwner:()=>Cc,setupBuiltinIcons:()=>Xa,showContextMenu:()=>Vd,statusColorToken:()=>o1,statusColorVar:()=>Wg,statusIcon:()=>Pi,statusOrder:()=>Ug,t:()=>Sm,table:()=>M1,toCssLength:()=>Ot,toast:()=>Ji,tokens:()=>A,translate:()=>ae,unregisterFormField:()=>Up,unregisterOverlayStack:()=>Yo});module.exports=B0(Yf);var Mo=require("lit"),mr=require("lit/decorators.js");var ac=require("lit"),A=ac.css`
1
+ "use strict";var V0=Object.create;var Da=Object.defineProperty;var Ou=Object.getOwnPropertyDescriptor;var D0=Object.getOwnPropertyNames;var F0=Object.getPrototypeOf,N0=Object.prototype.hasOwnProperty;var Hu=i=>{throw TypeError(i)};var nc=(i,o)=>()=>(i&&(o=i(i=0)),o);var L0=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),Ru=(i,o)=>{for(var e in o)Da(i,e,{get:o[e],enumerable:!0})},Iu=(i,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of D0(o))!N0.call(i,r)&&r!==e&&Da(i,r,{get:()=>o[r],enumerable:!(t=Ou(o,r))||t.enumerable});return i};var xn=(i,o,e)=>(e=i!=null?V0(F0(i)):{},Iu(o||!i||!i.__esModule?Da(e,"default",{value:i,enumerable:!0}):e,i)),B0=i=>Iu(Da({},"__esModule",{value:!0}),i),a=(i,o,e,t)=>{for(var r=t>1?void 0:t?Ou(o,e):o,n=i.length-1,s;n>=0;n--)(s=i[n])&&(r=(t?s(o,e,r):s(r))||r);return t&&r&&Da(o,e,r),r};var Vu=(i,o,e)=>o.has(i)||Hu("Cannot "+e);var ke=(i,o,e)=>(Vu(i,o,"read from private field"),e?e.call(i):o.get(i)),Du=(i,o,e)=>o.has(i)?Hu("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(i):o.set(i,e),Fu=(i,o,e,t)=>(Vu(i,o,"write to private field"),t?t.call(i,e):o.set(i,e),e);var ns,Dh=nc(()=>{ns=class{constructor(o){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,o?.roundAverageSize===!0&&(this._roundAverageSize=!0)}set(o,e){let t=this._map.get(o)||0;this._map.set(o,e),this.totalSize+=e-t}get averageSize(){if(this._map.size>0){let o=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(o):o}return 0}getSize(o){return this._map.get(o)}clear(){this._map.clear(),this.totalSize=0}}});function $c(i){return i==="horizontal"?"width":"height"}var rl,Fh=nc(()=>{rl=class{_getDefaultConfig(){return{direction:"vertical"}}constructor(o,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=o,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(o){Object.assign(this,Object.assign({},this._getDefaultConfig(),o))}get config(){return{direction:this.direction}}get items(){return this._items}set items(o){this._setItems(o)}_setItems(o){o!==this._items&&(this._items=o,this._scheduleReflow())}get direction(){return this._direction}set direction(o){o=o==="horizontal"?o:"vertical",o!==this._direction&&(this._direction=o,this._sizeDim=o==="horizontal"?"width":"height",this._secondarySizeDim=o==="horizontal"?"height":"width",this._positionDim=o==="horizontal"?"left":"top",this._secondaryPositionDim=o==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(o){let{_viewDim1:e,_viewDim2:t}=this;Object.assign(this._viewportSize,o),t!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(o){Object.assign(this._latestCoords,o);let e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(o=!1){(o||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(o){this._pin=o,this._triggerReflow()}get pin(){if(this._pin!==null){let{index:o,block:e}=this._pin;return{index:Math.max(0,Math.min(o,this.items.length-1)),block:e}}return null}_clampScrollPosition(o){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(o,this.totalScrollSize[$c(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){let o=this._scrollPosition,{index:e,block:t}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:t||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=o-this._scrollPosition}}_calculateScrollIntoViewPosition(o){let{block:e}=o,t=Math.min(this.items.length,Math.max(0,o.index)),r=this._getItemPosition(t)[this._positionDim],n=r;if(e!=="start"){let s=this._getItemSize(t)[this._sizeDim];if(e==="center")n=r-.5*this._viewDim1+.5*s;else{let d=r-this._viewDim1+s;if(e==="end")n=d;else{let h=this._scrollPosition;n=Math.abs(h-r)<Math.abs(h-d)?r:d}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}getScrollIntoViewCoordinates(o){return{[this._positionDim]:this._calculateScrollIntoViewPosition(o)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){let o=new Map;if(this._first!==-1&&this._last!==-1)for(let t=this._first;t<=this._last;t++)o.set(t,this._getItemPosition(t));let e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:o};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{let o=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>o||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(o){if(this._first===-1||this._last===-1)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let t=this._last;for(;t>this._first&&Math.round(this._getItemPosition(t)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)t--;(e!==this._firstVisible||t!==this._lastVisible)&&(this._firstVisible=e,this._lastVisible=t,o&&o.emit&&this._sendVisibilityChangedMessage())}}});var Lh={};Ru(Lh,{FlowLayout:()=>ol,flow:()=>km});function Nh(i){return i==="horizontal"?"marginLeft":"marginTop"}function xm(i){return i==="horizontal"?"marginRight":"marginBottom"}function wm(i){return i==="horizontal"?"xOffset":"yOffset"}function _m(i,o){let e=[i,o].sort();return e[1]<=0?Math.min(...e):e[0]>=0?Math.max(...e):e[0]+e[1]}var km,Tc,ol,Bh=nc(()=>{Dh();Fh();km=i=>Object.assign({type:ol},i);Tc=class{constructor(){this._childSizeCache=new ns,this._marginSizeCache=new ns,this._metricsCache=new Map}update(o,e){let t=new Set;Object.keys(o).forEach(r=>{let n=Number(r);this._metricsCache.set(n,o[n]),this._childSizeCache.set(n,o[n][$c(e)]),t.add(n),t.add(n+1)});for(let r of t){let n=this._metricsCache.get(r)?.[Nh(e)]||0,s=this._metricsCache.get(r-1)?.[xm(e)]||0;this._marginSizeCache.set(r,_m(n,s))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(o,e){return this._metricsCache.get(o)?.[Nh(e)]||0}getChildSize(o){return this._childSizeCache.getSize(o)}getMarginSize(o){return this._marginSizeCache.getSize(o)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}},ol=class extends rl{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Tc,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(o){this._metricsCache.update(o,this.direction),this._scheduleReflow()}_getPhysicalItem(o){return this._newPhysicalItems.get(o)??this._physicalItems.get(o)}_getSize(o){return this._getPhysicalItem(o)&&this._metricsCache.getChildSize(o)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(o){let e=this._metricsCache;if(this._first===-1||this._last===-1)return e.averageMarginSize+o*(e.averageMarginSize+this._getAverageSize());if(o<this._first){let t=this._first-o;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(t*e.averageChildSize+(t-1)*e.averageMarginSize)}else{let t=o-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+t*(e.averageChildSize+e.averageMarginSize)}}_getPosition(o){let e=this._getPhysicalItem(o),{averageMarginSize:t}=this._metricsCache;return o===0?this._metricsCache.getMarginSize(0)??t:e?e.pos:this._estimatePosition(o)}_calculateAnchor(o,e){return o<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((o+e)/2/this._delta)))}_getAnchor(o,e){if(this._physicalItems.size===0)return this._calculateAnchor(o,e);if(this._first<0)return this._calculateAnchor(o,e);if(this._last<0)return this._calculateAnchor(o,e);let t=this._getPhysicalItem(this._first),r=this._getPhysicalItem(this._last),n=t.pos;if(r.pos+this._metricsCache.getChildSize(this._last)<o)return this._calculateAnchor(o,e);if(n>e)return this._calculateAnchor(o,e);let h=this._firstVisible-1,p=-1/0;for(;p<o;)p=this._getPhysicalItem(++h).pos+this._metricsCache.getChildSize(h);return h}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;let o=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o,this._stable=!0}_getItems(){let o=this._newPhysicalItems;this._stable=!0;let e,t;if(this.pin!==null){let{index:p}=this.pin;this._anchorIdx=p,this._anchorPos=this._getPosition(p)}if(e=this._scrollPosition-this._overhang,t=this._scrollPosition+this._viewDim1+this._overhang,t<0||e>this._scrollSize){this._clearItems();return}(this._anchorIdx===null||this._anchorPos===null)&&(this._anchorIdx=this._getAnchor(e,t),this._anchorPos=this._getPosition(this._anchorIdx));let r=this._getSize(this._anchorIdx);r===void 0&&(this._stable=!1,r=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,s=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-s-r);let d=0;for(this._anchorPos+r+s<e&&(d=e-(this._anchorPos+r+s)),this._anchorPos-n>t&&(d=t-(this._anchorPos-n)),d&&(this._scrollPosition-=d,e-=d,t-=d,this._scrollError+=d),o.set(this._anchorIdx,{pos:this._anchorPos,size:r}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+r+s;this._physicalMin>e&&this._first>0;){let p=this._getSize(--this._first);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._first);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize),this._physicalMin-=p;let x=this._physicalMin;if(o.set(this._first,{pos:x,size:p}),this._physicalMin-=f,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<t&&this._last<this.items.length-1;){let p=this._getSize(++this._last);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._last);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize);let x=this._physicalMax;if(o.set(this._last,{pos:x,size:p}),this._physicalMax+=p+f,!this._stable&&!this._estimate)break}let h=this._calculateError();h&&(this._physicalMin-=h,this._physicalMax-=h,this._anchorPos-=h,this._scrollPosition-=h,o.forEach(p=>p.pos-=h),this._scrollError+=h),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){let{_first:o,_last:e}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===o&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){let{averageMarginSize:o}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(o+this._getAverageSize())+o)}get _delta(){let{averageMarginSize:o}=this._metricsCache;return this._getAverageSize()+o}_getItemPosition(o){return{[this._positionDim]:this._getPosition(o),[this._secondaryPositionDim]:0,[wm(this.direction)]:-(this._metricsCache.getLeadingMarginValue(o,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(o){return{[this._sizeDim]:this._getSize(o)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});var ia=L0((Vc,Tn)=>{(function(i,o){typeof Vc=="object"&&typeof Tn<"u"?Tn.exports=o():typeof define=="function"&&define.amd?define(o):(i=typeof globalThis<"u"?globalThis:i||self).interact=o()})(Vc,function(){"use strict";function i(c,l){var u=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);l&&(m=m.filter(function(g){return Object.getOwnPropertyDescriptor(c,g).enumerable})),u.push.apply(u,m)}return u}function o(c){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?i(Object(u),!0).forEach(function(m){s(c,m,u[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):i(Object(u)).forEach(function(m){Object.defineProperty(c,m,Object.getOwnPropertyDescriptor(u,m))})}return c}function e(c){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(c)}function t(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function r(c,l){for(var u=0;u<l.length;u++){var m=l[u];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,C(m.key),m)}}function n(c,l,u){return l&&r(c.prototype,l),u&&r(c,u),Object.defineProperty(c,"prototype",{writable:!1}),c}function s(c,l,u){return(l=C(l))in c?Object.defineProperty(c,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[l]=u,c}function d(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),l&&p(c,l)}function h(c){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},h(c)}function p(c,l){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,m){return u.__proto__=m,u},p(c,l)}function f(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function x(c){var l=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var u,m=h(c);if(l){var g=h(this).constructor;u=Reflect.construct(m,arguments,g)}else u=m.apply(this,arguments);return function(v,b){if(b&&(typeof b=="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(v)}(this,u)}}function k(){return k=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(c,l,u){var m=function(v,b){for(;!Object.prototype.hasOwnProperty.call(v,b)&&(v=h(v))!==null;);return v}(c,l);if(m){var g=Object.getOwnPropertyDescriptor(m,l);return g.get?g.get.call(arguments.length<3?c:u):g.value}},k.apply(this,arguments)}function C(c){var l=function(u,m){if(typeof u!="object"||u===null)return u;var g=u[Symbol.toPrimitive];if(g!==void 0){var v=g.call(u,m||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(u)}(c,"string");return typeof l=="symbol"?l:l+""}var S=function(c){return!(!c||!c.Window)&&c instanceof c.Window},z=void 0,T=void 0;function P(c){z=c;var l=c.document.createTextNode("");l.ownerDocument!==c.document&&typeof c.wrap=="function"&&c.wrap(l)===l&&(c=c.wrap(c)),T=c}function H(c){return S(c)?c:(c.ownerDocument||c).defaultView||T.window}typeof window<"u"&&window&&P(window);var I=function(c){return!!c&&e(c)==="object"},B=function(c){return typeof c=="function"},$={window:function(c){return c===T||S(c)},docFrag:function(c){return I(c)&&c.nodeType===11},object:I,func:B,number:function(c){return typeof c=="number"},bool:function(c){return typeof c=="boolean"},string:function(c){return typeof c=="string"},element:function(c){if(!c||e(c)!=="object")return!1;var l=H(c)||T;return/object|function/.test(typeof Element>"u"?"undefined":e(Element))?c instanceof Element||c instanceof l.Element:c.nodeType===1&&typeof c.nodeName=="string"},plainObject:function(c){return I(c)&&!!c.constructor&&/function Object\b/.test(c.constructor.toString())},array:function(c){return I(c)&&c.length!==void 0&&B(c.splice)}};function Q(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.prepared.axis;u==="x"?(l.coords.cur.page.y=l.coords.start.page.y,l.coords.cur.client.y=l.coords.start.client.y,l.coords.velocity.client.y=0,l.coords.velocity.page.y=0):u==="y"&&(l.coords.cur.page.x=l.coords.start.page.x,l.coords.cur.client.x=l.coords.start.client.x,l.coords.velocity.client.x=0,l.coords.velocity.page.x=0)}}function ye(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="drag"){var m=u.prepared.axis;if(m==="x"||m==="y"){var g=m==="x"?"y":"x";l.page[g]=u.coords.start.page[g],l.client[g]=u.coords.start.client[g],l.delta[g]=0}}}var De={id:"actions/drag",install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.draggable=De.draggable,l.map.drag=De,l.methodDict.drag="draggable",m.actions.drag=De.defaults},listeners:{"interactions:before-action-move":Q,"interactions:action-resume":Q,"interactions:action-move":ye,"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.buttons,g=u.options.drag;if(g&&g.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||m&u.options.drag.mouseButtons))return c.action={name:"drag",axis:g.lockAxis==="start"?g.startAxis:g.lockAxis},!1}},draggable:function(c){return $.object(c)?(this.options.drag.enabled=c.enabled!==!1,this.setPerAction("drag",c),this.setOnEvents("drag",c),/^(xy|x|y|start)$/.test(c.lockAxis)&&(this.options.drag.lockAxis=c.lockAxis),/^(xy|x|y)$/.test(c.startAxis)&&(this.options.drag.startAxis=c.startAxis),this):$.bool(c)?(this.options.drag.enabled=c,this):this.options.drag},beforeMove:Q,move:ye,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(c){return c.search("drag")===0}},yt=De,Ee={init:function(c){var l=c;Ee.document=l.document,Ee.DocumentFragment=l.DocumentFragment||ai,Ee.SVGElement=l.SVGElement||ai,Ee.SVGSVGElement=l.SVGSVGElement||ai,Ee.SVGElementInstance=l.SVGElementInstance||ai,Ee.Element=l.Element||ai,Ee.HTMLElement=l.HTMLElement||Ee.Element,Ee.Event=l.Event,Ee.Touch=l.Touch||ai,Ee.PointerEvent=l.PointerEvent||l.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function ai(){}var et=Ee,qr={init:function(c){var l=et.Element,u=c.navigator||{};qr.supportsTouch="ontouchstart"in c||$.func(c.DocumentTouch)&&et.document instanceof c.DocumentTouch,qr.supportsPointerEvent=u.pointerEnabled!==!1&&!!et.PointerEvent,qr.isIOS=/iP(hone|od|ad)/.test(u.platform),qr.isIOS7=/iP(hone|od|ad)/.test(u.platform)&&/OS 7[^\d]/.test(u.appVersion),qr.isIe9=/MSIE 9/.test(u.userAgent),qr.isOperaMobile=u.appName==="Opera"&&qr.supportsTouch&&/Presto/.test(u.userAgent),qr.prefixedMatchesSelector="matches"in l.prototype?"matches":"webkitMatchesSelector"in l.prototype?"webkitMatchesSelector":"mozMatchesSelector"in l.prototype?"mozMatchesSelector":"oMatchesSelector"in l.prototype?"oMatchesSelector":"msMatchesSelector",qr.pEventTypes=qr.supportsPointerEvent?et.PointerEvent===c.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,qr.wheelEvent=et.document&&"onmousewheel"in et.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},io=qr;function si(c,l){if(c.contains)return c.contains(l);for(;l;){if(l===c)return!0;l=l.parentNode}return!1}function Bn(c,l){for(;$.element(c);){if(zi(c,l))return c;c=Go(c)}return null}function Go(c){var l=c.parentNode;if($.docFrag(l)){for(;(l=l.host)&&$.docFrag(l););return l}return l}function zi(c,l){return T!==z&&(l=l.replace(/\/deep\//g," ")),c[io.prefixedMatchesSelector](l)}var q=function(c){return c.parentNode||c.host};function ee(c,l){for(var u,m=[],g=c;(u=q(g))&&g!==l&&u!==g.ownerDocument;)m.unshift(g),g=u;return m}function fe(c,l,u){for(;$.element(c);){if(zi(c,l))return!0;if((c=Go(c))===u)return zi(c,l)}return!1}function Ne(c){return c.correspondingUseElement||c}function Z(c){var l=c instanceof et.SVGElement?c.getBoundingClientRect():c.getClientRects()[0];return l&&{left:l.left,right:l.right,top:l.top,bottom:l.bottom,width:l.width||l.right-l.left,height:l.height||l.bottom-l.top}}function Ae(c){var l,u=Z(c);if(!io.isIOS7&&u){var m={x:(l=(l=H(c))||T).scrollX||l.document.documentElement.scrollLeft,y:l.scrollY||l.document.documentElement.scrollTop};u.left+=m.x,u.right+=m.x,u.top+=m.y,u.bottom+=m.y}return u}function ce(c){for(var l=[];c;)l.push(c),c=Go(c);return l}function wo(c){return!!$.string(c)&&(et.document.querySelector(c),!0)}function U(c,l){for(var u in l)c[u]=l[u];return c}function en(c,l,u){return c==="parent"?Go(u):c==="self"?l.getRect(u):Bn(u,c)}function li(c,l,u,m){var g=c;return $.string(g)?g=en(g,l,u):$.func(g)&&(g=g.apply(void 0,m)),$.element(g)&&(g=Ae(g)),g}function Yo(c){return c&&{x:"x"in c?c.x:c.left,y:"y"in c?c.y:c.top}}function ci(c){return!c||"x"in c&&"y"in c||((c=U({},c)).x=c.left||0,c.y=c.top||0,c.width=c.width||(c.right||0)-c.x,c.height=c.height||(c.bottom||0)-c.y),c}function tn(c,l,u){c.left&&(l.left+=u.x),c.right&&(l.right+=u.x),c.top&&(l.top+=u.y),c.bottom&&(l.bottom+=u.y),l.width=l.right-l.left,l.height=l.bottom-l.top}function ji(c,l,u){var m=u&&c.options[u];return Yo(li(m&&m.origin||c.options.origin,c,l,[c&&l]))||{x:0,y:0}}function di(c,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(w){return!0},m=arguments.length>3?arguments[3]:void 0;if(m=m||{},$.string(c)&&c.search(" ")!==-1&&(c=qn(c)),$.array(c))return c.forEach(function(w){return di(w,l,u,m)}),m;if($.object(c)&&(l=c,c=""),$.func(l)&&u(c))m[c]=m[c]||[],m[c].push(l);else if($.array(l))for(var g=0,v=l;g<v.length;g++){var b=v[g];di(c,b,u,m)}else if($.object(l))for(var y in l)di(qn(y).map(function(w){return"".concat(c).concat(w)}),l[y],u,m);return m}function qn(c){return c.trim().split(/ +/)}var $a=function(c,l){return Math.sqrt(c*c+l*l)},C1=["webkit","moz"];function ws(c,l){c.__set||(c.__set={});var u=function(g){if(C1.some(function(v){return g.indexOf(v)===0}))return 1;typeof c[g]!="function"&&g!=="__set"&&Object.defineProperty(c,g,{get:function(){return g in c.__set?c.__set[g]:c.__set[g]=l[g]},set:function(v){c.__set[g]=v},configurable:!0})};for(var m in l)u(m);return c}function _s(c,l){c.page=c.page||{},c.page.x=l.page.x,c.page.y=l.page.y,c.client=c.client||{},c.client.x=l.client.x,c.client.y=l.client.y,c.timeStamp=l.timeStamp}function Kd(c){c.page.x=0,c.page.y=0,c.client.x=0,c.client.y=0}function Wd(c){return c instanceof et.Event||c instanceof et.Touch}function Ms(c,l,u){return c=c||"page",(u=u||{}).x=l[c+"X"],u.y=l[c+"Y"],u}function Ud(c,l){return l=l||{x:0,y:0},io.isOperaMobile&&Wd(c)?(Ms("screen",c,l),l.x+=window.scrollX,l.y+=window.scrollY):Ms("page",c,l),l}function Ta(c){return $.number(c.pointerId)?c.pointerId:c.identifier}function z1(c,l,u){var m=l.length>1?Gd(l):l[0];Ud(m,c.page),function(g,v){v=v||{},io.isOperaMobile&&Wd(g)?Ms("screen",g,v):Ms("client",g,v)}(m,c.client),c.timeStamp=u}function Il(c){var l=[];return $.array(c)?(l[0]=c[0],l[1]=c[1]):c.type==="touchend"?c.touches.length===1?(l[0]=c.touches[0],l[1]=c.changedTouches[0]):c.touches.length===0&&(l[0]=c.changedTouches[0],l[1]=c.changedTouches[1]):(l[0]=c.touches[0],l[1]=c.touches[1]),l}function Gd(c){for(var l={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},u=0;u<c.length;u++){var m=c[u];for(var g in l)l[g]+=m[g]}for(var v in l)l[v]/=c.length;return l}function Vl(c){if(!c.length)return null;var l=Il(c),u=Math.min(l[0].pageX,l[1].pageX),m=Math.min(l[0].pageY,l[1].pageY),g=Math.max(l[0].pageX,l[1].pageX),v=Math.max(l[0].pageY,l[1].pageY);return{x:u,y:m,left:u,top:m,right:g,bottom:v,width:g-u,height:v-m}}function Dl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[0][u]-g[1][u],b=g[0][m]-g[1][m];return $a(v,b)}function Fl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[1][u]-g[0][u],b=g[1][m]-g[0][m];return 180*Math.atan2(b,v)/Math.PI}function Yd(c){return $.string(c.pointerType)?c.pointerType:$.number(c.pointerType)?[void 0,void 0,"touch","pen","mouse"][c.pointerType]:/touch/.test(c.type||"")||c instanceof et.Touch?"touch":"mouse"}function Xd(c){var l=$.func(c.composedPath)?c.composedPath():c.path;return[Ne(l?l[0]:c.target),Ne(c.currentTarget)]}var Cs=function(){function c(l){t(this,c),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=l}return n(c,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),c}();Object.defineProperty(Cs.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var Zd=function(c,l){for(var u=0;u<l.length;u++){var m=l[u];c.push(m)}return c},Qd=function(c){return Zd([],c)},Aa=function(c,l){for(var u=0;u<c.length;u++)if(l(c[u],u,c))return u;return-1},Pa=function(c,l){return c[Aa(c,l)]},Kn=function(c){d(u,c);var l=x(u);function u(m,g,v){var b;t(this,u),(b=l.call(this,g._interaction)).dropzone=void 0,b.dragEvent=void 0,b.relatedTarget=void 0,b.draggable=void 0,b.propagationStopped=!1,b.immediatePropagationStopped=!1;var y=v==="dragleave"?m.prev:m.cur,w=y.element,M=y.dropzone;return b.type=v,b.target=w,b.currentTarget=w,b.dropzone=M,b.dragEvent=g,b.relatedTarget=g.target,b.draggable=g.interactable,b.timeStamp=g.timeStamp,b}return n(u,[{key:"reject",value:function(){var m=this,g=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&g.cur.dropzone===this.dropzone&&g.cur.element===this.target)if(g.prev.dropzone=this.dropzone,g.prev.element=this.target,g.rejected=!0,g.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var v=g.activeDrops,b=Aa(v,function(w){var M=w.dropzone,_=w.element;return M===m.dropzone&&_===m.target});g.activeDrops.splice(b,1);var y=new u(g,this.dragEvent,"dropdeactivate");y.dropzone=this.dropzone,y.target=this.target,this.dropzone.fire(y)}else this.dropzone.fire(new u(g,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),u}(Cs);function Jd(c,l){for(var u=0,m=c.slice();u<m.length;u++){var g=m[u],v=g.dropzone,b=g.element;l.dropzone=v,l.target=b,v.fire(l),l.propagationStopped=l.immediatePropagationStopped=!1}}function Nl(c,l){for(var u=function(v,b){for(var y=[],w=0,M=v.interactables.list;w<M.length;w++){var _=M[w];if(_.options.drop.enabled){var E=_.options.drop.accept;if(!($.element(E)&&E!==b||$.string(E)&&!zi(b,E)||$.func(E)&&!E({dropzone:_,draggableElement:b})))for(var O=0,D=_.getAllElements();O<D.length;O++){var V=D[O];V!==b&&y.push({dropzone:_,element:V,rect:_.getRect(V)})}}}return y}(c,l),m=0;m<u.length;m++){var g=u[m];g.rect=g.dropzone.getRect(g.element)}return u}function eu(c,l,u){for(var m=c.dropState,g=c.interactable,v=c.element,b=[],y=0,w=m.activeDrops;y<w.length;y++){var M=w[y],_=M.dropzone,E=M.element,O=M.rect,D=_.dropCheck(l,u,g,v,E,O);b.push(D?E:null)}var V=function(N){for(var G,K,X,pe=[],Ce=0;Ce<N.length;Ce++){var re=N[Ce],ve=N[G];if(re&&Ce!==G)if(ve){var ao=q(re),kt=q(ve);if(ao!==re.ownerDocument)if(kt!==re.ownerDocument)if(ao!==kt){pe=pe.length?pe:ee(ve);var Fo=void 0;if(ve instanceof et.HTMLElement&&re instanceof et.SVGElement&&!(re instanceof et.SVGSVGElement)){if(re===kt)continue;Fo=re.ownerSVGElement}else Fo=re;for(var ui=ee(Fo,ve.ownerDocument),Ri=0;ui[Ri]&&ui[Ri]===pe[Ri];)Ri++;var Os=[ui[Ri-1],ui[Ri],pe[Ri]];if(Os[0])for(var Va=Os[0].lastChild;Va;){if(Va===Os[1]){G=Ce,pe=ui;break}if(Va===Os[2])break;Va=Va.previousSibling}}else X=ve,(parseInt(H(K=re).getComputedStyle(K).zIndex,10)||0)>=(parseInt(H(X).getComputedStyle(X).zIndex,10)||0)&&(G=Ce);else G=Ce}else G=Ce}return G}(b);return m.activeDrops[V]||null}function Ll(c,l,u){var m=c.dropState,g={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return u.type==="dragstart"&&(g.activate=new Kn(m,u,"dropactivate"),g.activate.target=null,g.activate.dropzone=null),u.type==="dragend"&&(g.deactivate=new Kn(m,u,"dropdeactivate"),g.deactivate.target=null,g.deactivate.dropzone=null),m.rejected||(m.cur.element!==m.prev.element&&(m.prev.dropzone&&(g.leave=new Kn(m,u,"dragleave"),u.dragLeave=g.leave.target=m.prev.element,u.prevDropzone=g.leave.dropzone=m.prev.dropzone),m.cur.dropzone&&(g.enter=new Kn(m,u,"dragenter"),u.dragEnter=m.cur.element,u.dropzone=m.cur.dropzone)),u.type==="dragend"&&m.cur.dropzone&&(g.drop=new Kn(m,u,"drop"),u.dropzone=m.cur.dropzone,u.relatedTarget=m.cur.element),u.type==="dragmove"&&m.cur.dropzone&&(g.move=new Kn(m,u,"dropmove"),u.dropzone=m.cur.dropzone)),g}function Bl(c,l){var u=c.dropState,m=u.activeDrops,g=u.cur,v=u.prev;l.leave&&v.dropzone.fire(l.leave),l.enter&&g.dropzone.fire(l.enter),l.move&&g.dropzone.fire(l.move),l.drop&&g.dropzone.fire(l.drop),l.deactivate&&Jd(m,l.deactivate),u.prev.dropzone=g.dropzone,u.prev.element=g.element}function tu(c,l){var u=c.interaction,m=c.iEvent,g=c.event;if(m.type==="dragmove"||m.type==="dragend"){var v=u.dropState;l.dynamicDrop&&(v.activeDrops=Nl(l,u.element));var b=m,y=eu(u,b,g);v.rejected=v.rejected&&!!y&&y.dropzone===v.cur.dropzone&&y.element===v.cur.element,v.cur.dropzone=y&&y.dropzone,v.cur.element=y&&y.element,v.events=Ll(u,0,b)}}var ru={id:"actions/drop",install:function(c){var l=c.actions,u=c.interactStatic,m=c.Interactable,g=c.defaults;c.usePlugin(yt),m.prototype.dropzone=function(v){return function(b,y){if($.object(y)){if(b.options.drop.enabled=y.enabled!==!1,y.listeners){var w=di(y.listeners),M=Object.keys(w).reduce(function(E,O){return E[/^(enter|leave)/.test(O)?"drag".concat(O):/^(activate|deactivate|move)/.test(O)?"drop".concat(O):O]=w[O],E},{}),_=b.options.drop.listeners;_&&b.off(_),b.on(M),b.options.drop.listeners=M}return $.func(y.ondrop)&&b.on("drop",y.ondrop),$.func(y.ondropactivate)&&b.on("dropactivate",y.ondropactivate),$.func(y.ondropdeactivate)&&b.on("dropdeactivate",y.ondropdeactivate),$.func(y.ondragenter)&&b.on("dragenter",y.ondragenter),$.func(y.ondragleave)&&b.on("dragleave",y.ondragleave),$.func(y.ondropmove)&&b.on("dropmove",y.ondropmove),/^(pointer|center)$/.test(y.overlap)?b.options.drop.overlap=y.overlap:$.number(y.overlap)&&(b.options.drop.overlap=Math.max(Math.min(1,y.overlap),0)),"accept"in y&&(b.options.drop.accept=y.accept),"checker"in y&&(b.options.drop.checker=y.checker),b}return $.bool(y)?(b.options.drop.enabled=y,b):b.options.drop}(this,v)},m.prototype.dropCheck=function(v,b,y,w,M,_){return function(E,O,D,V,N,G,K){var X=!1;if(!(K=K||E.getRect(G)))return!!E.options.drop.checker&&E.options.drop.checker(O,D,X,E,G,V,N);var pe=E.options.drop.overlap;if(pe==="pointer"){var Ce=ji(V,N,"drag"),re=Ud(O);re.x+=Ce.x,re.y+=Ce.y;var ve=re.x>K.left&&re.x<K.right,ao=re.y>K.top&&re.y<K.bottom;X=ve&&ao}var kt=V.getRect(N);if(kt&&pe==="center"){var Fo=kt.left+kt.width/2,ui=kt.top+kt.height/2;X=Fo>=K.left&&Fo<=K.right&&ui>=K.top&&ui<=K.bottom}return kt&&$.number(pe)&&(X=Math.max(0,Math.min(K.right,kt.right)-Math.max(K.left,kt.left))*Math.max(0,Math.min(K.bottom,kt.bottom)-Math.max(K.top,kt.top))/(kt.width*kt.height)>=pe),E.options.drop.checker&&(X=E.options.drop.checker(O,D,X,E,G,V,N)),X}(this,v,b,y,w,M,_)},u.dynamicDrop=function(v){return $.bool(v)?(c.dynamicDrop=v,u):c.dynamicDrop},U(l.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),l.methodDict.drop="dropzone",c.dynamicDrop=!1,g.actions.drop=ru.defaults},listeners:{"interactions:before-action-start":function(c){var l=c.interaction;l.prepared.name==="drag"&&(l.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(c,l){var u=c.interaction,m=(c.event,c.iEvent);if(u.prepared.name==="drag"){var g=u.dropState;g.activeDrops=[],g.events={},g.activeDrops=Nl(l,u.element),g.events=Ll(u,0,m),g.events.activate&&(Jd(g.activeDrops,g.events.activate),l.fire("actions/drop:start",{interaction:u,dragEvent:m}))}},"interactions:action-move":tu,"interactions:after-action-move":function(c,l){var u=c.interaction,m=c.iEvent;if(u.prepared.name==="drag"){var g=u.dropState;Bl(u,g.events),l.fire("actions/drop:move",{interaction:u,dragEvent:m}),g.events={}}},"interactions:action-end":function(c,l){if(c.interaction.prepared.name==="drag"){var u=c.interaction,m=c.iEvent;tu(c,l),Bl(u,u.dropState.events),l.fire("actions/drop:end",{interaction:u,dragEvent:m})}},"interactions:stop":function(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.dropState;u&&(u.activeDrops=null,u.events=null,u.cur.dropzone=null,u.cur.element=null,u.prev.dropzone=null,u.prev.element=null,u.rejected=!1)}}},getActiveDrops:Nl,getDrop:eu,getDropEvents:Ll,fireDropEvents:Bl,filterEventType:function(c){return c.search("drag")===0||c.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},E1=ru;function ql(c){var l=c.interaction,u=c.iEvent,m=c.phase;if(l.prepared.name==="gesture"){var g=l.pointers.map(function(M){return M.pointer}),v=m==="start",b=m==="end",y=l.interactable.options.deltaSource;if(u.touches=[g[0],g[1]],v)u.distance=Dl(g,y),u.box=Vl(g),u.scale=1,u.ds=0,u.angle=Fl(g,y),u.da=0,l.gesture.startDistance=u.distance,l.gesture.startAngle=u.angle;else if(b||l.pointers.length<2){var w=l.prevEvent;u.distance=w.distance,u.box=w.box,u.scale=w.scale,u.ds=0,u.angle=w.angle,u.da=0}else u.distance=Dl(g,y),u.box=Vl(g),u.scale=u.distance/l.gesture.startDistance,u.angle=Fl(g,y),u.ds=u.scale-l.gesture.scale,u.da=u.angle-l.gesture.angle;l.gesture.distance=u.distance,l.gesture.angle=u.angle,$.number(u.scale)&&u.scale!==1/0&&!isNaN(u.scale)&&(l.gesture.scale=u.scale)}}var Kl={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.gesturable=function(g){return $.object(g)?(this.options.gesture.enabled=g.enabled!==!1,this.setPerAction("gesture",g),this.setOnEvents("gesture",g),this):$.bool(g)?(this.options.gesture.enabled=g,this):this.options.gesture},l.map.gesture=Kl,l.methodDict.gesture="gesturable",m.actions.gesture=Kl.defaults},listeners:{"interactions:action-start":ql,"interactions:action-move":ql,"interactions:action-end":ql,"interactions:new":function(c){c.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(c){if(!(c.interaction.pointers.length<2)){var l=c.interactable.options.gesture;if(l&&l.enabled)return c.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(c){return c.search("gesture")===0}},S1=Kl;function $1(c,l,u,m,g,v,b){if(!l)return!1;if(l===!0){var y=$.number(v.width)?v.width:v.right-v.left,w=$.number(v.height)?v.height:v.bottom-v.top;if(b=Math.min(b,Math.abs((c==="left"||c==="right"?y:w)/2)),y<0&&(c==="left"?c="right":c==="right"&&(c="left")),w<0&&(c==="top"?c="bottom":c==="bottom"&&(c="top")),c==="left"){var M=y>=0?v.left:v.right;return u.x<M+b}if(c==="top"){var _=w>=0?v.top:v.bottom;return u.y<_+b}if(c==="right")return u.x>(y>=0?v.right:v.left)-b;if(c==="bottom")return u.y>(w>=0?v.bottom:v.top)-b}return!!$.element(m)&&($.element(l)?l===m:fe(m,l,g))}function ou(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.resizeAxes){var m=l;u.interactable.options.resize.square?(u.resizeAxes==="y"?m.delta.x=m.delta.y:m.delta.y=m.delta.x,m.axes="xy"):(m.axes=u.resizeAxes,u.resizeAxes==="x"?m.delta.y=0:u.resizeAxes==="y"&&(m.delta.x=0))}}var Oi,yn,Hi={id:"actions/resize",before:["actions/drag"],install:function(c){var l=c.actions,u=c.browser,m=c.Interactable,g=c.defaults;Hi.cursors=function(v){return v.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(u),Hi.defaultMargin=u.supportsTouch||u.supportsPointerEvent?20:10,m.prototype.resizable=function(v){return function(b,y,w){return $.object(y)?(b.options.resize.enabled=y.enabled!==!1,b.setPerAction("resize",y),b.setOnEvents("resize",y),$.string(y.axis)&&/^x$|^y$|^xy$/.test(y.axis)?b.options.resize.axis=y.axis:y.axis===null&&(b.options.resize.axis=w.defaults.actions.resize.axis),$.bool(y.preserveAspectRatio)?b.options.resize.preserveAspectRatio=y.preserveAspectRatio:$.bool(y.square)&&(b.options.resize.square=y.square),b):$.bool(y)?(b.options.resize.enabled=y,b):b.options.resize}(this,v,c)},l.map.resize=Hi,l.methodDict.resize="resizable",g.actions.resize=Hi.defaults},listeners:{"interactions:new":function(c){c.interaction.resizeAxes="xy"},"interactions:action-start":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.rect;m._rects={start:U({},v),corrected:U({},v),previous:U({},v),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},g.edges=m.prepared.edges,g.rect=m._rects.corrected,g.deltaRect=m._rects.delta}})(c),ou(c)},"interactions:action-move":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.interactable.options.resize.invert,b=v==="reposition"||v==="negate",y=m.rect,w=m._rects,M=w.start,_=w.corrected,E=w.delta,O=w.previous;if(U(O,_),b){if(U(_,y),v==="reposition"){if(_.top>_.bottom){var D=_.top;_.top=_.bottom,_.bottom=D}if(_.left>_.right){var V=_.left;_.left=_.right,_.right=V}}}else _.top=Math.min(y.top,M.bottom),_.bottom=Math.max(y.bottom,M.top),_.left=Math.min(y.left,M.right),_.right=Math.max(y.right,M.left);for(var N in _.width=_.right-_.left,_.height=_.bottom-_.top,_)E[N]=_[N]-O[N];g.edges=m.prepared.edges,g.rect=_,g.deltaRect=E}})(c),ou(c)},"interactions:action-end":function(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.prepared.edges){var m=l;m.edges=u.prepared.edges,m.rect=u._rects.corrected,m.deltaRect=u._rects.delta}},"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.element,g=c.rect,v=c.buttons;if(g){var b=U({},l.coords.cur.page),y=u.options.resize;if(y&&y.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||v&y.mouseButtons)){if($.object(y.edges)){var w={left:!1,right:!1,top:!1,bottom:!1};for(var M in w)w[M]=$1(M,y.edges[M],b,l._latestPointer.eventTarget,m,g,y.margin||Hi.defaultMargin);w.left=w.left&&!w.right,w.top=w.top&&!w.bottom,(w.left||w.right||w.top||w.bottom)&&(c.action={name:"resize",edges:w})}else{var _=y.axis!=="y"&&b.x>g.right-Hi.defaultMargin,E=y.axis!=="x"&&b.y>g.bottom-Hi.defaultMargin;(_||E)&&(c.action={name:"resize",axes:(_?"x":"")+(E?"y":"")})}return!c.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(c){var l=c.edges,u=c.axis,m=c.name,g=Hi.cursors,v=null;if(u)v=g[m+u];else if(l){for(var b="",y=0,w=["top","bottom","left","right"];y<w.length;y++){var M=w[y];l[M]&&(b+=M)}v=g[b]}return v},filterEventType:function(c){return c.search("resize")===0},defaultMargin:null},T1=Hi,A1={id:"actions",install:function(c){c.usePlugin(S1),c.usePlugin(T1),c.usePlugin(yt),c.usePlugin(E1)}},iu=0,rn={request:function(c){return Oi(c)},cancel:function(c){return yn(c)},init:function(c){if(Oi=c.requestAnimationFrame,yn=c.cancelAnimationFrame,!Oi)for(var l=["ms","moz","webkit","o"],u=0;u<l.length;u++){var m=l[u];Oi=c["".concat(m,"RequestAnimationFrame")],yn=c["".concat(m,"CancelAnimationFrame")]||c["".concat(m,"CancelRequestAnimationFrame")]}Oi=Oi&&Oi.bind(c),yn=yn&&yn.bind(c),Oi||(Oi=function(g){var v=Date.now(),b=Math.max(0,16-(v-iu)),y=c.setTimeout(function(){g(v+b)},b);return iu=v+b,y},yn=function(g){return clearTimeout(g)})}},oe={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(c){oe.isScrolling=!0,rn.cancel(oe.i),c.autoScroll=oe,oe.interaction=c,oe.prevTime=oe.now(),oe.i=rn.request(oe.scroll)},stop:function(){oe.isScrolling=!1,oe.interaction&&(oe.interaction.autoScroll=null),rn.cancel(oe.i)},scroll:function(){var c=oe.interaction,l=c.interactable,u=c.element,m=c.prepared.name,g=l.options[m].autoScroll,v=nu(g.container,l,u),b=oe.now(),y=(b-oe.prevTime)/1e3,w=g.speed*y;if(w>=1){var M={x:oe.x*w,y:oe.y*w};if(M.x||M.y){var _=au(v);$.window(v)?v.scrollBy(M.x,M.y):v&&(v.scrollLeft+=M.x,v.scrollTop+=M.y);var E=au(v),O={x:E.x-_.x,y:E.y-_.y};(O.x||O.y)&&l.fire({type:"autoscroll",target:u,interactable:l,delta:O,interaction:c,container:v})}oe.prevTime=b}oe.isScrolling&&(rn.cancel(oe.i),oe.i=rn.request(oe.scroll))},check:function(c,l){var u;return(u=c.options[l].autoScroll)==null?void 0:u.enabled},onInteractionMove:function(c){var l=c.interaction,u=c.pointer;if(l.interacting()&&oe.check(l.interactable,l.prepared.name))if(l.simulation)oe.x=oe.y=0;else{var m,g,v,b,y=l.interactable,w=l.element,M=l.prepared.name,_=y.options[M].autoScroll,E=nu(_.container,y,w);if($.window(E))b=u.clientX<oe.margin,m=u.clientY<oe.margin,g=u.clientX>E.innerWidth-oe.margin,v=u.clientY>E.innerHeight-oe.margin;else{var O=Z(E);b=u.clientX<O.left+oe.margin,m=u.clientY<O.top+oe.margin,g=u.clientX>O.right-oe.margin,v=u.clientY>O.bottom-oe.margin}oe.x=g?1:b?-1:0,oe.y=v?1:m?-1:0,oe.isScrolling||(oe.margin=_.margin,oe.speed=_.speed,oe.start(l))}}};function nu(c,l,u){return($.string(c)?en(c,l,u):c)||H(u)}function au(c){return $.window(c)&&(c=window.document.body),{x:c.scrollLeft,y:c.scrollTop}}var P1={id:"auto-scroll",install:function(c){var l=c.defaults,u=c.actions;c.autoScroll=oe,oe.now=function(){return c.now()},u.phaselessTypes.autoscroll=!0,l.perAction.autoScroll=oe.defaults},listeners:{"interactions:new":function(c){c.interaction.autoScroll=null},"interactions:destroy":function(c){c.interaction.autoScroll=null,oe.stop(),oe.interaction&&(oe.interaction=null)},"interactions:stop":oe.stop,"interactions:action-move":function(c){return oe.onInteractionMove(c)}}},j1=P1;function ja(c,l){var u=!1;return function(){return u||(T.console.warn(l),u=!0),c.apply(this,arguments)}}function Wl(c,l){return c.name=l.name,c.axis=l.axis,c.edges=l.edges,c}function O1(c){return $.bool(c)?(this.options.styleCursor=c,this):c===null?(delete this.options.styleCursor,this):this.options.styleCursor}function H1(c){return $.func(c)?(this.options.actionChecker=c,this):c===null?(delete this.options.actionChecker,this):this.options.actionChecker}var R1={id:"auto-start/interactableMethods",install:function(c){var l=c.Interactable;l.prototype.getAction=function(u,m,g,v){var b=function(y,w,M,_,E){var O=y.getRect(_),D=w.buttons||{0:1,1:4,3:8,4:16}[w.button],V={action:null,interactable:y,interaction:M,element:_,rect:O,buttons:D};return E.fire("auto-start:check",V),V.action}(this,m,g,v,c);return this.options.actionChecker?this.options.actionChecker(u,m,b,this,v,g):b},l.prototype.ignoreFrom=ja(function(u){return this._backCompatOption("ignoreFrom",u)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),l.prototype.allowFrom=ja(function(u){return this._backCompatOption("allowFrom",u)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),l.prototype.actionChecker=H1,l.prototype.styleCursor=O1}};function su(c,l,u,m,g){return l.testIgnoreAllow(l.options[c.name],u,m)&&l.options[c.name].enabled&&zs(l,u,c,g)?c:null}function I1(c,l,u,m,g,v,b){for(var y=0,w=m.length;y<w;y++){var M=m[y],_=g[y],E=M.getAction(l,u,c,_);if(E){var O=su(E,M,_,v,b);if(O)return{action:O,interactable:M,element:_}}}return{action:null,interactable:null,element:null}}function lu(c,l,u,m,g){var v=[],b=[],y=m;function w(_){v.push(_),b.push(y)}for(;$.element(y);){v=[],b=[],g.interactables.forEachMatch(y,w);var M=I1(c,l,u,v,b,m,g);if(M.action&&!M.interactable.options[M.action.name].manualStart)return M;y=Go(y)}return{action:null,interactable:null,element:null}}function cu(c,l,u){var m=l.action,g=l.interactable,v=l.element;m=m||{name:null},c.interactable=g,c.element=v,Wl(c.prepared,m),c.rect=g&&m.name?g.getRect(v):null,uu(c,u),u.fire("autoStart:prepared",{interaction:c})}function zs(c,l,u,m){var g=c.options,v=g[u.name].max,b=g[u.name].maxPerElement,y=m.autoStart.maxInteractions,w=0,M=0,_=0;if(!(v&&b&&y))return!1;for(var E=0,O=m.interactions.list;E<O.length;E++){var D=O[E],V=D.prepared.name;if(D.interacting()&&(++w>=y||D.interactable===c&&((M+=V===u.name?1:0)>=v||D.element===l&&(_++,V===u.name&&_>=b))))return!1}return y>0}function du(c,l){return $.number(c)?(l.autoStart.maxInteractions=c,this):l.autoStart.maxInteractions}function Ul(c,l,u){var m=u.autoStart.cursorElement;m&&m!==c&&(m.style.cursor=""),c.ownerDocument.documentElement.style.cursor=l,c.style.cursor=l,u.autoStart.cursorElement=l?c:null}function uu(c,l){var u=c.interactable,m=c.element,g=c.prepared;if(c.pointerType==="mouse"&&u&&u.options.styleCursor){var v="";if(g.name){var b=u.options[g.name].cursorChecker;v=$.func(b)?b(g,u,m,c._interacting):l.actions.map[g.name].getCursor(g)}Ul(c.element,v||"",l)}else l.autoStart.cursorElement&&Ul(l.autoStart.cursorElement,"",l)}var V1={id:"auto-start/base",before:["actions"],install:function(c){var l=c.interactStatic,u=c.defaults;c.usePlugin(R1),u.base.actionChecker=null,u.base.styleCursor=!0,U(u.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),l.maxInteractions=function(m){return du(m,c)},c.autoStart={maxInteractions:1/0,withinInteractionLimit:zs,cursorElement:null}},listeners:{"interactions:down":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;u.interacting()||cu(u,lu(u,m,g,v,l),l)},"interactions:move":function(c,l){(function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerType!=="mouse"||g.pointerIsDown||g.interacting()||cu(g,lu(g,v,b,y,m),m)})(c,l),function(u,m){var g=u.interaction;if(g.pointerIsDown&&!g.interacting()&&g.pointerWasMoved&&g.prepared.name){m.fire("autoStart:before-start",u);var v=g.interactable,b=g.prepared.name;b&&v&&(v.options[b].manualStart||!zs(v,g.element,g.prepared,m)?g.stop():(g.start(g.prepared,v,g.element),uu(g,m)))}}(c,l)},"interactions:stop":function(c,l){var u=c.interaction,m=u.interactable;m&&m.options.styleCursor&&Ul(u.element,"",l)}},maxInteractions:du,withinInteractionLimit:zs,validateAction:su},Gl=V1,D1={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(c,l){var u=c.interaction,m=c.eventTarget,g=c.dx,v=c.dy;if(u.prepared.name==="drag"){var b=Math.abs(g),y=Math.abs(v),w=u.interactable.options.drag,M=w.startAxis,_=b>y?"x":b<y?"y":"xy";if(u.prepared.axis=w.lockAxis==="start"?_[0]:w.lockAxis,_!=="xy"&&M!=="xy"&&M!==_){u.prepared.name=null;for(var E=m,O=function(V){if(V!==u.interactable){var N=u.interactable.options.drag;if(!N.manualStart&&V.testIgnoreAllow(N,E,m)){var G=V.getAction(u.downPointer,u.downEvent,u,E);if(G&&G.name==="drag"&&function(K,X){if(!X)return!1;var pe=X.options.drag.startAxis;return K==="xy"||pe==="xy"||pe===K}(_,V)&&Gl.validateAction(G,V,E,m,l))return V}}};$.element(E);){var D=l.interactables.forEachMatch(E,O);if(D){u.prepared.name="drag",u.interactable=D,u.element=E;break}E=Go(E)}}}}}};function Yl(c){var l=c.prepared&&c.prepared.name;if(!l)return null;var u=c.interactable.options;return u[l].hold||u[l].delay}var F1={id:"auto-start/hold",install:function(c){var l=c.defaults;c.usePlugin(Gl),l.perAction.hold=0,l.perAction.delay=0},listeners:{"interactions:new":function(c){c.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(c){var l=c.interaction,u=Yl(l);u>0&&(l.autoStartHoldTimer=setTimeout(function(){l.start(l.prepared,l.interactable,l.element)},u))},"interactions:move":function(c){var l=c.interaction,u=c.duplicate;l.autoStartHoldTimer&&l.pointerWasMoved&&!u&&(clearTimeout(l.autoStartHoldTimer),l.autoStartHoldTimer=null)},"autoStart:before-start":function(c){var l=c.interaction;Yl(l)>0&&(l.prepared.name=null)}},getHoldDuration:Yl},N1=F1,L1={id:"auto-start",install:function(c){c.usePlugin(Gl),c.usePlugin(N1),c.usePlugin(D1)}},B1=function(c){return/^(always|never|auto)$/.test(c)?(this.options.preventDefault=c,this):$.bool(c)?(this.options.preventDefault=c?"always":"never",this):this.options.preventDefault};function q1(c){var l=c.interaction,u=c.event;l.interactable&&l.interactable.checkAndPreventDefault(u)}var hu={id:"core/interactablePreventDefault",install:function(c){var l=c.Interactable;l.prototype.preventDefault=B1,l.prototype.checkAndPreventDefault=function(u){return function(m,g,v){var b=m.options.preventDefault;if(b!=="never")if(b!=="always"){if(g.events.supportsPassive&&/^touch(start|move)$/.test(v.type)){var y=H(v.target).document,w=g.getDocOptions(y);if(!w||!w.events||w.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(v.type)||$.element(v.target)&&zi(v.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||v.preventDefault()}else v.preventDefault()}(this,c,u)},c.interactions.docEvents.push({type:"dragstart",listener:function(u){for(var m=0,g=c.interactions.list;m<g.length;m++){var v=g[m];if(v.element&&(v.element===u.target||si(v.element,u.target)))return void v.interactable.checkAndPreventDefault(u)}}})},listeners:["down","move","up","cancel"].reduce(function(c,l){return c["interactions:".concat(l)]=q1,c},{})};function Es(c,l){if(l.phaselessTypes[c])return!0;for(var u in l.map)if(c.indexOf(u)===0&&c.substr(u.length)in l.phases)return!0;return!1}function Wn(c){var l={};for(var u in c){var m=c[u];$.plainObject(m)?l[u]=Wn(m):$.array(m)?l[u]=Qd(m):l[u]=m}return l}var Xl=function(){function c(l){t(this,c),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=l,this.result=Ss(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return n(c,[{key:"start",value:function(l,u){var m,g,v=l.phase,b=this.interaction,y=function(M){var _=M.interactable.options[M.prepared.name],E=_.modifiers;return E&&E.length?E:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(O){var D=_[O];return D&&D.enabled&&{options:D,methods:D._methods}}).filter(function(O){return!!O})}(b);this.prepareStates(y),this.startEdges=U({},b.edges),this.edges=U({},this.startEdges),this.startOffset=(m=b.rect,g=u,m?{left:g.x-m.left,top:g.y-m.top,right:m.right-g.x,bottom:m.bottom-g.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var w=this.fillArg({phase:v,pageCoords:u,preEnd:!1});return this.result=Ss(),this.startAll(w),this.result=this.setAll(w)}},{key:"fillArg",value:function(l){var u=this.interaction;return l.interaction=u,l.interactable=u.interactable,l.element=u.element,l.rect||(l.rect=u.rect),l.edges||(l.edges=this.startEdges),l.startOffset=this.startOffset,l}},{key:"startAll",value:function(l){for(var u=0,m=this.states;u<m.length;u++){var g=m[u];g.methods.start&&(l.state=g,g.methods.start(l))}}},{key:"setAll",value:function(l){var u=l.phase,m=l.preEnd,g=l.skipModifiers,v=l.rect,b=l.edges;l.coords=U({},l.pageCoords),l.rect=U({},v),l.edges=U({},b);for(var y=g?this.states.slice(g):this.states,w=Ss(l.coords,l.rect),M=0;M<y.length;M++){var _,E=y[M],O=E.options,D=U({},l.coords),V=null;(_=E.methods)!=null&&_.set&&this.shouldDo(O,m,u)&&(l.state=E,V=E.methods.set(l),tn(l.edges,l.rect,{x:l.coords.x-D.x,y:l.coords.y-D.y})),w.eventProps.push(V)}U(this.edges,l.edges),w.delta.x=l.coords.x-l.pageCoords.x,w.delta.y=l.coords.y-l.pageCoords.y,w.rectDelta.left=l.rect.left-v.left,w.rectDelta.right=l.rect.right-v.right,w.rectDelta.top=l.rect.top-v.top,w.rectDelta.bottom=l.rect.bottom-v.bottom;var N=this.result.coords,G=this.result.rect;if(N&&G){var K=w.rect.left!==G.left||w.rect.right!==G.right||w.rect.top!==G.top||w.rect.bottom!==G.bottom;w.changed=K||N.x!==w.coords.x||N.y!==w.coords.y}return w}},{key:"applyToInteraction",value:function(l){var u=this.interaction,m=l.phase,g=u.coords.cur,v=u.coords.start,b=this.result,y=this.startDelta,w=b.delta;m==="start"&&U(this.startDelta,b.delta);for(var M=0,_=[[v,y],[g,w]];M<_.length;M++){var E=_[M],O=E[0],D=E[1];O.page.x+=D.x,O.page.y+=D.y,O.client.x+=D.x,O.client.y+=D.y}var V=this.result.rectDelta,N=l.rect||u.rect;N.left+=V.left,N.right+=V.right,N.top+=V.top,N.bottom+=V.bottom,N.width=N.right-N.left,N.height=N.bottom-N.top}},{key:"setAndApply",value:function(l){var u=this.interaction,m=l.phase,g=l.preEnd,v=l.skipModifiers,b=this.setAll(this.fillArg({preEnd:g,phase:m,pageCoords:l.modifiedCoords||u.coords.cur.page}));if(this.result=b,!b.changed&&(!v||v<this.states.length)&&u.interacting())return!1;if(l.modifiedCoords){var y=u.coords.cur.page,w={x:l.modifiedCoords.x-y.x,y:l.modifiedCoords.y-y.y};b.coords.x+=w.x,b.coords.y+=w.y,b.delta.x+=w.x,b.delta.y+=w.y}this.applyToInteraction(l)}},{key:"beforeEnd",value:function(l){var u=l.interaction,m=l.event,g=this.states;if(g&&g.length){for(var v=!1,b=0;b<g.length;b++){var y=g[b];l.state=y;var w=y.options,M=y.methods,_=M.beforeEnd&&M.beforeEnd(l);if(_)return this.endResult=_,!1;v=v||!v&&this.shouldDo(w,!0,l.phase,!0)}v&&u.move({event:m,preEnd:!0})}}},{key:"stop",value:function(l){var u=l.interaction;if(this.states&&this.states.length){var m=U({states:this.states,interactable:u.interactable,element:u.element,rect:null},l);this.fillArg(m);for(var g=0,v=this.states;g<v.length;g++){var b=v[g];m.state=b,b.methods.stop&&b.methods.stop(m)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(l){this.states=[];for(var u=0;u<l.length;u++){var m=l[u],g=m.options,v=m.methods,b=m.name;this.states.push({options:g,methods:v,index:u,name:b})}return this.states}},{key:"restoreInteractionCoords",value:function(l){var u=l.interaction,m=u.coords,g=u.rect,v=u.modification;if(v.result){for(var b=v.startDelta,y=v.result,w=y.delta,M=y.rectDelta,_=0,E=[[m.start,b],[m.cur,w]];_<E.length;_++){var O=E[_],D=O[0],V=O[1];D.page.x-=V.x,D.page.y-=V.y,D.client.x-=V.x,D.client.y-=V.y}g.left-=M.left,g.right-=M.right,g.top-=M.top,g.bottom-=M.bottom}}},{key:"shouldDo",value:function(l,u,m,g){return!(!l||l.enabled===!1||g&&!l.endOnly||l.endOnly&&!u||m==="start"&&!l.setStart)}},{key:"copyFrom",value:function(l){this.startOffset=l.startOffset,this.startDelta=l.startDelta,this.startEdges=l.startEdges,this.edges=l.edges,this.states=l.states.map(function(u){return Wn(u)}),this.result=Ss(U({},l.result.coords),U({},l.result.rect))}},{key:"destroy",value:function(){for(var l in this)this[l]=null}}]),c}();function Ss(c,l){return{rect:l,coords:c,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function on(c,l){var u=c.defaults,m={start:c.start,set:c.set,beforeEnd:c.beforeEnd,stop:c.stop},g=function(v){var b=v||{};for(var y in b.enabled=b.enabled!==!1,u)y in b||(b[y]=u[y]);var w={options:b,methods:m,name:l,enable:function(){return b.enabled=!0,w},disable:function(){return b.enabled=!1,w}};return w};return l&&typeof l=="string"&&(g._defaults=u,g._methods=m),g}function Oa(c){var l=c.iEvent,u=c.interaction.modification.result;u&&(l.modifiers=u.eventProps)}var K1={id:"modifiers/base",before:["actions"],install:function(c){c.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(c){var l=c.interaction;l.modification=new Xl(l)},"interactions:before-action-start":function(c){var l=c.interaction,u=c.interaction.modification;u.start(c,l.coords.start.page),l.edges=u.edges,u.applyToInteraction(c)},"interactions:before-action-move":function(c){var l=c.interaction,u=l.modification,m=u.setAndApply(c);return l.edges=u.edges,m},"interactions:before-action-end":function(c){var l=c.interaction,u=l.modification,m=u.beforeEnd(c);return l.edges=u.startEdges,m},"interactions:action-start":Oa,"interactions:action-move":Oa,"interactions:action-end":Oa,"interactions:after-action-start":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-move":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:stop":function(c){return c.interaction.modification.stop(c)}}},pu=K1,mu={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Zl=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w,M){var _;t(this,u),(_=l.call(this,m)).relatedTarget=null,_.screenX=void 0,_.screenY=void 0,_.button=void 0,_.buttons=void 0,_.ctrlKey=void 0,_.shiftKey=void 0,_.altKey=void 0,_.metaKey=void 0,_.page=void 0,_.client=void 0,_.delta=void 0,_.rect=void 0,_.x0=void 0,_.y0=void 0,_.t0=void 0,_.dt=void 0,_.duration=void 0,_.clientX0=void 0,_.clientY0=void 0,_.velocity=void 0,_.speed=void 0,_.swipe=void 0,_.axes=void 0,_.preEnd=void 0,y=y||m.element;var E=m.interactable,O=(E&&E.options||mu).deltaSource,D=ji(E,y,v),V=b==="start",N=b==="end",G=V?f(_):m.prevEvent,K=V?m.coords.start:N?{page:G.page,client:G.client,timeStamp:m.coords.cur.timeStamp}:m.coords.cur;return _.page=U({},K.page),_.client=U({},K.client),_.rect=U({},m.rect),_.timeStamp=K.timeStamp,N||(_.page.x-=D.x,_.page.y-=D.y,_.client.x-=D.x,_.client.y-=D.y),_.ctrlKey=g.ctrlKey,_.altKey=g.altKey,_.shiftKey=g.shiftKey,_.metaKey=g.metaKey,_.button=g.button,_.buttons=g.buttons,_.target=y,_.currentTarget=y,_.preEnd=w,_.type=M||v+(b||""),_.interactable=E,_.t0=V?m.pointers[m.pointers.length-1].downTime:G.t0,_.x0=m.coords.start.page.x-D.x,_.y0=m.coords.start.page.y-D.y,_.clientX0=m.coords.start.client.x-D.x,_.clientY0=m.coords.start.client.y-D.y,_.delta=V||N?{x:0,y:0}:{x:_[O].x-G[O].x,y:_[O].y-G[O].y},_.dt=m.coords.delta.timeStamp,_.duration=_.timeStamp-_.t0,_.velocity=U({},m.coords.velocity[O]),_.speed=$a(_.velocity.x,_.velocity.y),_.swipe=N||b==="inertiastart"?_.getSwipe():null,_}return n(u,[{key:"getSwipe",value:function(){var m=this._interaction;if(m.prevEvent.speed<600||this.timeStamp-m.prevEvent.timeStamp>150)return null;var g=180*Math.atan2(m.prevEvent.velocityY,m.prevEvent.velocityX)/Math.PI;g<0&&(g+=360);var v=112.5<=g&&g<247.5,b=202.5<=g&&g<337.5;return{up:b,down:!b&&22.5<=g&&g<157.5,left:v,right:!v&&(292.5<=g||g<67.5),angle:g,speed:m.prevEvent.speed,velocity:{x:m.prevEvent.velocityX,y:m.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),u}(Cs);Object.defineProperties(Zl.prototype,{pageX:{get:function(){return this.page.x},set:function(c){this.page.x=c}},pageY:{get:function(){return this.page.y},set:function(c){this.page.y=c}},clientX:{get:function(){return this.client.x},set:function(c){this.client.x=c}},clientY:{get:function(){return this.client.y},set:function(c){this.client.y=c}},dx:{get:function(){return this.delta.x},set:function(c){this.delta.x=c}},dy:{get:function(){return this.delta.y},set:function(c){this.delta.y=c}},velocityX:{get:function(){return this.velocity.x},set:function(c){this.velocity.x=c}},velocityY:{get:function(){return this.velocity.y},set:function(c){this.velocity.y=c}}});var W1=n(function c(l,u,m,g,v){t(this,c),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=l,this.pointer=u,this.event=m,this.downTime=g,this.downTarget=v}),U1=function(c){return c.interactable="",c.element="",c.prepared="",c.pointerIsDown="",c.pointerWasMoved="",c._proxy="",c}({}),gu=function(c){return c.start="",c.move="",c.end="",c.stop="",c.interacting="",c}({}),G1=0,Y1=function(){function c(l){var u=this,m=l.pointerType,g=l.scopeFire;t(this,c),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=ja(function(_){this.move(_)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=G1++,this._scopeFire=g,this.pointerType=m;var v=this;this._proxy={};var b=function(_){Object.defineProperty(u._proxy,_,{get:function(){return v[_]}})};for(var y in U1)b(y);var w=function(_){Object.defineProperty(u._proxy,_,{value:function(){return v[_].apply(v,arguments)}})};for(var M in gu)w(M);this._scopeFire("interactions:new",{interaction:this})}return n(c,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(l,u,m){var g=this.updatePointer(l,u,m,!0),v=this.pointers[g];this._scopeFire("interactions:down",{pointer:l,event:u,eventTarget:m,pointerIndex:g,pointerInfo:v,type:"down",interaction:this})}},{key:"start",value:function(l,u,m){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(l.name==="gesture"?2:1)||!u.options[l.name].enabled)&&(Wl(this.prepared,l),this.interactable=u,this.element=m,this.rect=u.getRect(m),this.edges=this.prepared.edges?U({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(l,u,m){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(l,u,m,!1);var g,v,b=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(g=this.coords.cur.client.x-this.coords.start.client.x,v=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=$a(g,v)>this.pointerMoveTolerance);var y,w,M,_=this.getPointerIndex(l),E={pointer:l,pointerIndex:_,pointerInfo:this.pointers[_],event:u,type:"move",eventTarget:m,dx:g,dy:v,duplicate:b,interaction:this};b||(y=this.coords.velocity,w=this.coords.delta,M=Math.max(w.timeStamp/1e3,.001),y.page.x=w.page.x/M,y.page.y=w.page.y/M,y.client.x=w.client.x/M,y.client.y=w.client.y/M,y.timeStamp=M),this._scopeFire("interactions:move",E),b||this.simulation||(this.interacting()&&(E.type=null,this.move(E)),this.pointerWasMoved&&_s(this.coords.prev,this.coords.cur))}},{key:"move",value:function(l){l&&l.event||Kd(this.coords.delta),(l=U({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},l||{})).phase="move",this._doPhase(l)}},{key:"pointerUp",value:function(l,u,m,g){var v=this.getPointerIndex(l);v===-1&&(v=this.updatePointer(l,u,m,!1));var b=/cancel$/i.test(u.type)?"cancel":"up";this._scopeFire("interactions:".concat(b),{pointer:l,pointerIndex:v,pointerInfo:this.pointers[v],event:u,eventTarget:m,type:b,curEventTarget:g,interaction:this}),this.simulation||this.end(u),this.removePointer(l,u)}},{key:"documentBlur",value:function(l){this.end(l),this._scopeFire("interactions:blur",{event:l,type:"blur",interaction:this})}},{key:"end",value:function(l){var u;this._ending=!0,l=l||this._latestPointer.event,this.interacting()&&(u=this._doPhase({event:l,interaction:this,phase:"end"})),this._ending=!1,u===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(l){var u=Ta(l);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:Aa(this.pointers,function(m){return m.id===u})}},{key:"getPointerInfo",value:function(l){return this.pointers[this.getPointerIndex(l)]}},{key:"updatePointer",value:function(l,u,m,g){var v,b,y,w=Ta(l),M=this.getPointerIndex(l),_=this.pointers[M];return g=g!==!1&&(g||/(down|start)$/i.test(u.type)),_?_.pointer=l:(_=new W1(w,l,u,null,null),M=this.pointers.length,this.pointers.push(_)),z1(this.coords.cur,this.pointers.map(function(E){return E.pointer}),this._now()),v=this.coords.delta,b=this.coords.prev,y=this.coords.cur,v.page.x=y.page.x-b.page.x,v.page.y=y.page.y-b.page.y,v.client.x=y.client.x-b.client.x,v.client.y=y.client.y-b.client.y,v.timeStamp=y.timeStamp-b.timeStamp,g&&(this.pointerIsDown=!0,_.downTime=this.coords.cur.timeStamp,_.downTarget=m,ws(this.downPointer,l),this.interacting()||(_s(this.coords.start,this.coords.cur),_s(this.coords.prev,this.coords.cur),this.downEvent=u,this.pointerWasMoved=!1)),this._updateLatestPointer(l,u,m),this._scopeFire("interactions:update-pointer",{pointer:l,event:u,eventTarget:m,down:g,pointerInfo:_,pointerIndex:M,interaction:this}),M}},{key:"removePointer",value:function(l,u){var m=this.getPointerIndex(l);if(m!==-1){var g=this.pointers[m];this._scopeFire("interactions:remove-pointer",{pointer:l,event:u,eventTarget:null,pointerIndex:m,pointerInfo:g,interaction:this}),this.pointers.splice(m,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(l,u,m){this._latestPointer.pointer=l,this._latestPointer.event=u,this._latestPointer.eventTarget=m}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(l,u,m,g){return new Zl(this,l,this.prepared.name,u,this.element,m,g)}},{key:"_fireEvent",value:function(l){var u;(u=this.interactable)==null||u.fire(l),(!this.prevEvent||l.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=l)}},{key:"_doPhase",value:function(l){var u=l.event,m=l.phase,g=l.preEnd,v=l.type,b=this.rect;if(b&&m==="move"&&(tn(this.edges,b,this.coords.delta[this.interactable.options.deltaSource]),b.width=b.right-b.left,b.height=b.bottom-b.top),this._scopeFire("interactions:before-action-".concat(m),l)===!1)return!1;var y=l.iEvent=this._createPreparedEvent(u,m,g,v);return this._scopeFire("interactions:action-".concat(m),l),m==="start"&&(this.prevEvent=y),this._fireEvent(y),this._scopeFire("interactions:after-action-".concat(m),l),!0}},{key:"_now",value:function(){return Date.now()}}]),c}();function fu(c){vu(c.interaction)}function vu(c){if(!function(u){return!(!u.offset.pending.x&&!u.offset.pending.y)}(c))return!1;var l=c.offset.pending;return Ql(c.coords.cur,l),Ql(c.coords.delta,l),tn(c.edges,c.rect,l),l.x=0,l.y=0,!0}function X1(c){var l=c.x,u=c.y;this.offset.pending.x+=l,this.offset.pending.y+=u,this.offset.total.x+=l,this.offset.total.y+=u}function Ql(c,l){var u=c.page,m=c.client,g=l.x,v=l.y;u.x+=g,u.y+=v,m.x+=g,m.y+=v}gu.offsetBy="";var Z1={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(c){c.Interaction.prototype.offsetBy=X1},listeners:{"interactions:new":function(c){c.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(c){return function(l){l.pointerIsDown&&(Ql(l.coords.cur,l.offset.total),l.offset.pending.x=0,l.offset.pending.y=0)}(c.interaction)},"interactions:before-action-start":fu,"interactions:before-action-move":fu,"interactions:before-action-end":function(c){var l=c.interaction;if(vu(l))return l.move({offset:!0}),l.end(),!1},"interactions:stop":function(c){var l=c.interaction;l.offset.total.x=0,l.offset.total.y=0,l.offset.pending.x=0,l.offset.pending.y=0}}},bu=Z1,Q1=function(){function c(l){t(this,c),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=l}return n(c,[{key:"start",value:function(l){var u=this.interaction,m=$s(u);if(!m||!m.enabled)return!1;var g=u.coords.velocity.client,v=$a(g.x,g.y),b=this.modification||(this.modification=new Xl(u));if(b.copyFrom(u.modification),this.t0=u._now(),this.allowResume=m.allowResume,this.v0=v,this.currentOffset={x:0,y:0},this.startCoords=u.coords.cur.page,this.modifierArg=b.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-u.coords.cur.timeStamp<50&&v>m.minSpeed&&v>m.endSpeed)this.startInertia();else{if(b.result=b.setAll(this.modifierArg),!b.result.changed)return!1;this.startSmoothEnd()}return u.modification.result.rect=null,u.offsetBy(this.targetOffset),u._doPhase({interaction:u,event:l,phase:"inertiastart"}),u.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),u.modification.result.rect=null,this.active=!0,u.simulation=this,!0}},{key:"startInertia",value:function(){var l=this,u=this.interaction.coords.velocity.client,m=$s(this.interaction),g=m.resistance,v=-Math.log(m.endSpeed/this.v0)/g;this.targetOffset={x:(u.x-v)/g,y:(u.y-v)/g},this.te=v,this.lambda_v0=g/this.v0,this.one_ve_v0=1-m.endSpeed/this.v0;var b=this.modification,y=this.modifierArg;y.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},b.result=b.setAll(y),b.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+b.result.delta.x,y:this.targetOffset.y+b.result.delta.y}),this.onNextFrame(function(){return l.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var l=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return l.smoothEndTick()})}},{key:"onNextFrame",value:function(l){var u=this;this.timeout=rn.request(function(){u.active&&l()})}},{key:"inertiaTick",value:function(){var l,u,m,g,v,b,y,w=this,M=this.interaction,_=$s(M).resistance,E=(M._now()-this.t0)/1e3;if(E<this.te){var O,D=1-(Math.exp(-_*E)-this.lambda_v0)/this.one_ve_v0;this.isModified?(l=0,u=0,m=this.targetOffset.x,g=this.targetOffset.y,v=this.modifiedOffset.x,b=this.modifiedOffset.y,O={x:yu(y=D,l,m,v),y:yu(y,u,g,b)}):O={x:this.targetOffset.x*D,y:this.targetOffset.y*D};var V={x:O.x-this.currentOffset.x,y:O.y-this.currentOffset.y};this.currentOffset.x+=V.x,this.currentOffset.y+=V.y,M.offsetBy(V),M.move(),this.onNextFrame(function(){return w.inertiaTick()})}else M.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var l=this,u=this.interaction,m=u._now()-this.t0,g=$s(u).smoothEndDuration;if(m<g){var v={x:ku(m,0,this.targetOffset.x,g),y:ku(m,0,this.targetOffset.y,g)},b={x:v.x-this.currentOffset.x,y:v.y-this.currentOffset.y};this.currentOffset.x+=b.x,this.currentOffset.y+=b.y,u.offsetBy(b),u.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return l.smoothEndTick()})}else u.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(l){var u=l.pointer,m=l.event,g=l.eventTarget,v=this.interaction;v.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),v.updatePointer(u,m,g,!0),v._doPhase({interaction:v,event:m,phase:"resume"}),_s(v.coords.prev,v.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,rn.cancel(this.timeout)}}]),c}();function $s(c){var l=c.interactable,u=c.prepared;return l&&l.options&&u.name&&l.options[u.name].inertia}var J1={id:"inertia",before:["modifiers","actions"],install:function(c){var l=c.defaults;c.usePlugin(bu),c.usePlugin(pu),c.actions.phases.inertiastart=!0,c.actions.phases.resume=!0,l.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(c){var l=c.interaction;l.inertia=new Q1(l)},"interactions:before-action-end":function(c){var l=c.interaction,u=c.event;return(!l._interacting||l.simulation||!l.inertia.start(u))&&null},"interactions:down":function(c){var l=c.interaction,u=c.eventTarget,m=l.inertia;if(m.active)for(var g=u;$.element(g);){if(g===l.element){m.resume(c);break}g=Go(g)}},"interactions:stop":function(c){var l=c.interaction.inertia;l.active&&l.stop()},"interactions:before-action-resume":function(c){var l=c.interaction.modification;l.stop(c),l.start(c,c.interaction.coords.cur.page),l.applyToInteraction(c)},"interactions:before-action-inertiastart":function(c){return c.interaction.modification.setAndApply(c)},"interactions:action-resume":Oa,"interactions:action-inertiastart":Oa,"interactions:after-action-inertiastart":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-resume":function(c){return c.interaction.modification.restoreInteractionCoords(c)}}};function yu(c,l,u,m){var g=1-c;return g*g*l+2*g*c*u+c*c*m}function ku(c,l,u,m){return-u*(c/=m)*(c-2)+l}var e0=J1;function xu(c,l){for(var u=0;u<l.length;u++){var m=l[u];if(c.immediatePropagationStopped)break;m(c)}}var wu=function(){function c(l){t(this,c),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=U({},l||{})}return n(c,[{key:"fire",value:function(l){var u,m=this.global;(u=this.types[l.type])&&xu(l,u),!l.propagationStopped&&m&&(u=m[l.type])&&xu(l,u)}},{key:"on",value:function(l,u){var m=di(l,u);for(l in m)this.types[l]=Zd(this.types[l]||[],m[l])}},{key:"off",value:function(l,u){var m=di(l,u);for(l in m){var g=this.types[l];if(g&&g.length)for(var v=0,b=m[l];v<b.length;v++){var y=b[v],w=g.indexOf(y);w!==-1&&g.splice(w,1)}}}},{key:"getRect",value:function(l){return null}}]),c}(),t0=function(){function c(l){t(this,c),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=l,ws(this,l)}return n(c,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),c}();function Ha(c){return $.object(c)?{capture:!!c.capture,passive:!!c.passive}:{capture:!!c,passive:!1}}function Ts(c,l){return c===l||(typeof c=="boolean"?!!l.capture===c&&!l.passive:!!c.capture==!!l.capture&&!!c.passive==!!l.passive)}var r0={id:"events",install:function(c){var l,u=[],m={},g=[],v={add:b,remove:y,addDelegate:function(_,E,O,D,V){var N=Ha(V);if(!m[O]){m[O]=[];for(var G=0;G<g.length;G++){var K=g[G];b(K,O,w),b(K,O,M,!0)}}var X=m[O],pe=Pa(X,function(Ce){return Ce.selector===_&&Ce.context===E});pe||(pe={selector:_,context:E,listeners:[]},X.push(pe)),pe.listeners.push({func:D,options:N})},removeDelegate:function(_,E,O,D,V){var N,G=Ha(V),K=m[O],X=!1;if(K)for(N=K.length-1;N>=0;N--){var pe=K[N];if(pe.selector===_&&pe.context===E){for(var Ce=pe.listeners,re=Ce.length-1;re>=0;re--){var ve=Ce[re];if(ve.func===D&&Ts(ve.options,G)){Ce.splice(re,1),Ce.length||(K.splice(N,1),y(E,O,w),y(E,O,M,!0)),X=!0;break}}if(X)break}}},delegateListener:w,delegateUseCapture:M,delegatedEvents:m,documents:g,targets:u,supportsOptions:!1,supportsPassive:!1};function b(_,E,O,D){if(_.addEventListener){var V=Ha(D),N=Pa(u,function(G){return G.eventTarget===_});N||(N={eventTarget:_,events:{}},u.push(N)),N.events[E]||(N.events[E]=[]),Pa(N.events[E],function(G){return G.func===O&&Ts(G.options,V)})||(_.addEventListener(E,O,v.supportsOptions?V:V.capture),N.events[E].push({func:O,options:V}))}}function y(_,E,O,D){if(_.addEventListener&&_.removeEventListener){var V=Aa(u,function(ao){return ao.eventTarget===_}),N=u[V];if(N&&N.events)if(E!=="all"){var G=!1,K=N.events[E];if(K){if(O==="all"){for(var X=K.length-1;X>=0;X--){var pe=K[X];y(_,E,pe.func,pe.options)}return}for(var Ce=Ha(D),re=0;re<K.length;re++){var ve=K[re];if(ve.func===O&&Ts(ve.options,Ce)){_.removeEventListener(E,O,v.supportsOptions?Ce:Ce.capture),K.splice(re,1),K.length===0&&(delete N.events[E],G=!0);break}}}G&&!Object.keys(N.events).length&&u.splice(V,1)}else for(E in N.events)N.events.hasOwnProperty(E)&&y(_,E,"all")}}function w(_,E){for(var O=Ha(E),D=new t0(_),V=m[_.type],N=Xd(_)[0],G=N;$.element(G);){for(var K=0;K<V.length;K++){var X=V[K],pe=X.selector,Ce=X.context;if(zi(G,pe)&&si(Ce,N)&&si(Ce,G)){var re=X.listeners;D.currentTarget=G;for(var ve=0;ve<re.length;ve++){var ao=re[ve];Ts(ao.options,O)&&ao.func(D)}}}G=Go(G)}}function M(_){return w(_,!0)}return(l=c.document)==null||l.createElement("div").addEventListener("test",null,{get capture(){return v.supportsOptions=!0},get passive(){return v.supportsPassive=!0}}),c.events=v,v}},Jl={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(c){for(var l=0,u=Jl.methodOrder;l<u.length;l++){var m=u[l],g=Jl[m](c);if(g)return g}return null},simulationResume:function(c){var l=c.pointerType,u=c.eventType,m=c.eventTarget,g=c.scope;if(!/down|start/i.test(u))return null;for(var v=0,b=g.interactions.list;v<b.length;v++){var y=b[v],w=m;if(y.simulation&&y.simulation.allowResume&&y.pointerType===l)for(;w;){if(w===y.element)return y;w=Go(w)}}return null},mouseOrPen:function(c){var l,u=c.pointerId,m=c.pointerType,g=c.eventType,v=c.scope;if(m!=="mouse"&&m!=="pen")return null;for(var b=0,y=v.interactions.list;b<y.length;b++){var w=y[b];if(w.pointerType===m){if(w.simulation&&!_u(w,u))continue;if(w.interacting())return w;l||(l=w)}}if(l)return l;for(var M=0,_=v.interactions.list;M<_.length;M++){var E=_[M];if(!(E.pointerType!==m||/down/i.test(g)&&E.simulation))return E}return null},hasPointer:function(c){for(var l=c.pointerId,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(_u(g,l))return g}return null},idle:function(c){for(var l=c.pointerType,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(g.pointers.length===1){var v=g.interactable;if(v&&(!v.options.gesture||!v.options.gesture.enabled))continue}else if(g.pointers.length>=2)continue;if(!g.interacting()&&l===g.pointerType)return g}return null}};function _u(c,l){return c.pointers.some(function(u){return u.id===l})}var o0=Jl,ec=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Mu(c,l){return function(u){var m=l.interactions.list,g=Yd(u),v=Xd(u),b=v[0],y=v[1],w=[];if(/^touch/.test(u.type)){l.prevTouchTime=l.now();for(var M=0,_=u.changedTouches;M<_.length;M++){var E=_[M],O={pointer:E,pointerId:Ta(E),pointerType:g,eventType:u.type,eventTarget:b,curEventTarget:y,scope:l},D=Cu(O);w.push([O.pointer,O.eventTarget,O.curEventTarget,D])}}else{var V=!1;if(!io.supportsPointerEvent&&/mouse/.test(u.type)){for(var N=0;N<m.length&&!V;N++)V=m[N].pointerType!=="mouse"&&m[N].pointerIsDown;V=V||l.now()-l.prevTouchTime<500||u.timeStamp===0}if(!V){var G={pointer:u,pointerId:Ta(u),pointerType:g,eventType:u.type,curEventTarget:y,eventTarget:b,scope:l},K=Cu(G);w.push([G.pointer,G.eventTarget,G.curEventTarget,K])}}for(var X=0;X<w.length;X++){var pe=w[X],Ce=pe[0],re=pe[1],ve=pe[2];pe[3][c](Ce,u,re,ve)}}}function Cu(c){var l=c.pointerType,u=c.scope,m={interaction:o0.search(c),searchDetails:c};return u.fire("interactions:find",m),m.interaction||u.interactions.new({pointerType:l})}function tc(c,l){var u=c.doc,m=c.scope,g=c.options,v=m.interactions.docEvents,b=m.events,y=b[l];for(var w in m.browser.isIOS&&!g.events&&(g.events={passive:!1}),b.delegatedEvents)y(u,w,b.delegateListener),y(u,w,b.delegateUseCapture,!0);for(var M=g&&g.events,_=0;_<v.length;_++){var E=v[_];y(u,E.type,E.listener,M)}}var i0={id:"core/interactions",install:function(c){for(var l={},u=0;u<ec.length;u++){var m=ec[u];l[m]=Mu(m,c)}var g,v=io.pEventTypes;function b(){for(var y=0,w=c.interactions.list;y<w.length;y++){var M=w[y];if(M.pointerIsDown&&M.pointerType==="touch"&&!M._interacting)for(var _=function(){var D=O[E];c.documents.some(function(V){return si(V.doc,D.downTarget)})||M.removePointer(D.pointer,D.event)},E=0,O=M.pointers;E<O.length;E++)_()}}(g=et.PointerEvent?[{type:v.down,listener:b},{type:v.down,listener:l.pointerDown},{type:v.move,listener:l.pointerMove},{type:v.up,listener:l.pointerUp},{type:v.cancel,listener:l.pointerUp}]:[{type:"mousedown",listener:l.pointerDown},{type:"mousemove",listener:l.pointerMove},{type:"mouseup",listener:l.pointerUp},{type:"touchstart",listener:b},{type:"touchstart",listener:l.pointerDown},{type:"touchmove",listener:l.pointerMove},{type:"touchend",listener:l.pointerUp},{type:"touchcancel",listener:l.pointerUp}]).push({type:"blur",listener:function(y){for(var w=0,M=c.interactions.list;w<M.length;w++)M[w].documentBlur(y)}}),c.prevTouchTime=0,c.Interaction=function(y){d(M,y);var w=x(M);function M(){return t(this,M),w.apply(this,arguments)}return n(M,[{key:"pointerMoveTolerance",get:function(){return c.interactions.pointerMoveTolerance},set:function(_){c.interactions.pointerMoveTolerance=_}},{key:"_now",value:function(){return c.now()}}]),M}(Y1),c.interactions={list:[],new:function(y){y.scopeFire=function(M,_){return c.fire(M,_)};var w=new c.Interaction(y);return c.interactions.list.push(w),w},listeners:l,docEvents:g,pointerMoveTolerance:1},c.usePlugin(hu)},listeners:{"scope:add-document":function(c){return tc(c,"add")},"scope:remove-document":function(c){return tc(c,"remove")},"interactable:unset":function(c,l){for(var u=c.interactable,m=l.interactions.list.length-1;m>=0;m--){var g=l.interactions.list[m];g.interactable===u&&(g.stop(),l.fire("interactions:destroy",{interaction:g}),g.destroy(),l.interactions.list.length>2&&l.interactions.list.splice(m,1))}}},onDocSignal:tc,doOnInteractions:Mu,methodNames:ec},n0=i0,nn=function(c){return c[c.On=0]="On",c[c.Off=1]="Off",c}(nn||{}),a0=function(){function c(l,u,m,g){t(this,c),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new wu,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=u.actions,this.target=l,this._context=u.context||m,this._win=H(wo(l)?this._context:l),this._doc=this._win.document,this._scopeEvents=g,this.set(u)}return n(c,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(l,u){return $.func(u.onstart)&&this.on("".concat(l,"start"),u.onstart),$.func(u.onmove)&&this.on("".concat(l,"move"),u.onmove),$.func(u.onend)&&this.on("".concat(l,"end"),u.onend),$.func(u.oninertiastart)&&this.on("".concat(l,"inertiastart"),u.oninertiastart),this}},{key:"updatePerActionListeners",value:function(l,u,m){var g,v=this,b=(g=this._actions.map[l])==null?void 0:g.filterEventType,y=function(w){return(b==null||b(w))&&Es(w,v._actions)};($.array(u)||$.object(u))&&this._onOff(nn.Off,l,u,void 0,y),($.array(m)||$.object(m))&&this._onOff(nn.On,l,m,void 0,y)}},{key:"setPerAction",value:function(l,u){var m=this._defaults;for(var g in u){var v=g,b=this.options[l],y=u[v];v==="listeners"&&this.updatePerActionListeners(l,b.listeners,y),$.array(y)?b[v]=Qd(y):$.plainObject(y)?(b[v]=U(b[v]||{},Wn(y)),$.object(m.perAction[v])&&"enabled"in m.perAction[v]&&(b[v].enabled=y.enabled!==!1)):$.bool(y)&&$.object(m.perAction[v])?b[v].enabled=y:b[v]=y}}},{key:"getRect",value:function(l){return l=l||($.element(this.target)?this.target:null),$.string(this.target)&&(l=l||this._context.querySelector(this.target)),Ae(l)}},{key:"rectChecker",value:function(l){var u=this;return $.func(l)?(this.getRect=function(m){var g=U({},l.apply(u,m));return"width"in g||(g.width=g.right-g.left,g.height=g.bottom-g.top),g},this):l===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(l,u){if(wo(u)||$.object(u)){for(var m in this.options[l]=u,this._actions.map)this.options[m][l]=u;return this}return this.options[l]}},{key:"origin",value:function(l){return this._backCompatOption("origin",l)}},{key:"deltaSource",value:function(l){return l==="page"||l==="client"?(this.options.deltaSource=l,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var l=this.target;return $.string(l)?Array.from(this._context.querySelectorAll(l)):$.func(l)&&l.getAllElements?l.getAllElements():$.element(l)?[l]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(l){return this._context===l.ownerDocument||si(this._context,l)}},{key:"testIgnoreAllow",value:function(l,u,m){return!this.testIgnore(l.ignoreFrom,u,m)&&this.testAllow(l.allowFrom,u,m)}},{key:"testAllow",value:function(l,u,m){return!l||!!$.element(m)&&($.string(l)?fe(m,l,u):!!$.element(l)&&si(l,m))}},{key:"testIgnore",value:function(l,u,m){return!(!l||!$.element(m))&&($.string(l)?fe(m,l,u):!!$.element(l)&&si(l,m))}},{key:"fire",value:function(l){return this.events.fire(l),this}},{key:"_onOff",value:function(l,u,m,g,v){$.object(u)&&!$.array(u)&&(g=m,m=null);var b=di(u,m,v);for(var y in b){y==="wheel"&&(y=io.wheelEvent);for(var w=0,M=b[y];w<M.length;w++){var _=M[w];Es(y,this._actions)?this.events[l===nn.On?"on":"off"](y,_):$.string(this.target)?this._scopeEvents[l===nn.On?"addDelegate":"removeDelegate"](this.target,this._context,y,_,g):this._scopeEvents[l===nn.On?"add":"remove"](this.target,y,_,g)}}return this}},{key:"on",value:function(l,u,m){return this._onOff(nn.On,l,u,m)}},{key:"off",value:function(l,u,m){return this._onOff(nn.Off,l,u,m)}},{key:"set",value:function(l){var u=this._defaults;for(var m in $.object(l)||(l={}),this.options=Wn(u.base),this._actions.methodDict){var g=m,v=this._actions.methodDict[g];this.options[g]={},this.setPerAction(g,U(U({},u.perAction),u.actions[g])),this[v](l[g])}for(var b in l)b!=="getRect"?$.func(this[b])&&this[b](l[b]):this.rectChecker(l.getRect);return this}},{key:"unset",value:function(){if($.string(this.target))for(var l in this._scopeEvents.delegatedEvents)for(var u=this._scopeEvents.delegatedEvents[l],m=u.length-1;m>=0;m--){var g=u[m],v=g.selector,b=g.context,y=g.listeners;v===this.target&&b===this._context&&u.splice(m,1);for(var w=y.length-1;w>=0;w--)this._scopeEvents.removeDelegate(this.target,this._context,l,y[w][0],y[w][1])}else this._scopeEvents.remove(this.target,"all")}}]),c}(),s0=function(){function c(l){var u=this;t(this,c),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=l,l.addListeners({"interactable:unset":function(m){var g=m.interactable,v=g.target,b=$.string(v)?u.selectorMap[v]:v[u.scope.id],y=Aa(b,function(w){return w===g});b.splice(y,1)}})}return n(c,[{key:"new",value:function(l,u){u=U(u||{},{actions:this.scope.actions});var m=new this.scope.Interactable(l,u,this.scope.document,this.scope.events);return this.scope.addDocument(m._doc),this.list.push(m),$.string(l)?(this.selectorMap[l]||(this.selectorMap[l]=[]),this.selectorMap[l].push(m)):(m.target[this.scope.id]||Object.defineProperty(l,this.scope.id,{value:[],configurable:!0}),l[this.scope.id].push(m)),this.scope.fire("interactable:new",{target:l,options:u,interactable:m,win:this.scope._win}),m}},{key:"getExisting",value:function(l,u){var m=u&&u.context||this.scope.document,g=$.string(l),v=g?this.selectorMap[l]:l[this.scope.id];if(v)return Pa(v,function(b){return b._context===m&&(g||b.inContext(l))})}},{key:"forEachMatch",value:function(l,u){for(var m=0,g=this.list;m<g.length;m++){var v=g[m],b=void 0;if(($.string(v.target)?$.element(l)&&zi(l,v.target):l===v.target)&&v.inContext(l)&&(b=u(v)),b!==void 0)return b}}}]),c}(),l0=function(){function c(){var l=this;t(this,c),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=io,this.defaults=Wn(mu),this.Eventable=wu,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=function(m){var g=function v(b,y){var w=m.interactables.getExisting(b,y);return w||((w=m.interactables.new(b,y)).events.global=v.globalEvents),w};return g.getPointerAverage=Gd,g.getTouchBBox=Vl,g.getTouchDistance=Dl,g.getTouchAngle=Fl,g.getElementRect=Ae,g.getElementClientRect=Z,g.matchesSelector=zi,g.closest=Bn,g.globalEvents={},g.version="1.10.27",g.scope=m,g.use=function(v,b){return this.scope.usePlugin(v,b),this},g.isSet=function(v,b){return!!this.scope.interactables.get(v,b&&b.context)},g.on=ja(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.on(_,b,y)}return this}if($.object(v)){for(var E in v)this.on(E,v[E],b);return this}return Es(v,this.scope.actions)?this.globalEvents[v]?this.globalEvents[v].push(b):this.globalEvents[v]=[b]:this.scope.events.add(this.scope.document,v,b,{options:y}),this},"The interact.on() method is being deprecated"),g.off=ja(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.off(_,b,y)}return this}if($.object(v)){for(var E in v)this.off(E,v[E],b);return this}var O;return Es(v,this.scope.actions)?v in this.globalEvents&&(O=this.globalEvents[v].indexOf(b))!==-1&&this.globalEvents[v].splice(O,1):this.scope.events.remove(this.scope.document,v,b,y),this},"The interact.off() method is being deprecated"),g.debug=function(){return this.scope},g.supportsTouch=function(){return io.supportsTouch},g.supportsPointerEvent=function(){return io.supportsPointerEvent},g.stop=function(){for(var v=0,b=this.scope.interactions.list;v<b.length;v++)b[v].stop();return this},g.pointerMoveTolerance=function(v){return $.number(v)?(this.scope.interactions.pointerMoveTolerance=v,this):this.scope.interactions.pointerMoveTolerance},g.addDocument=function(v,b){this.scope.addDocument(v,b)},g.removeDocument=function(v){this.scope.removeDocument(v)},g}(this),this.InteractEvent=Zl,this.Interactable=void 0,this.interactables=new s0(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(m){return l.removeDocument(m.target)};var u=this;this.Interactable=function(m){d(v,m);var g=x(v);function v(){return t(this,v),g.apply(this,arguments)}return n(v,[{key:"_defaults",get:function(){return u.defaults}},{key:"set",value:function(b){return k(h(v.prototype),"set",this).call(this,b),u.fire("interactable:set",{options:b,interactable:this}),this}},{key:"unset",value:function(){k(h(v.prototype),"unset",this).call(this);var b=u.interactables.list.indexOf(this);b<0||(u.interactables.list.splice(b,1),u.fire("interactable:unset",{interactable:this}))}}]),v}(a0)}return n(c,[{key:"addListeners",value:function(l,u){this.listenerMaps.push({id:u,map:l})}},{key:"fire",value:function(l,u){for(var m=0,g=this.listenerMaps;m<g.length;m++){var v=g[m].map[l];if(v&&v(u,this,l)===!1)return!1}}},{key:"init",value:function(l){return this.isInitialized?this:function(u,m){return u.isInitialized=!0,$.window(m)&&P(m),et.init(m),io.init(m),rn.init(m),u.window=m,u.document=m.document,u.usePlugin(n0),u.usePlugin(r0),u}(this,l)}},{key:"pluginIsInstalled",value:function(l){var u=l.id;return u?!!this._plugins.map[u]:this._plugins.list.indexOf(l)!==-1}},{key:"usePlugin",value:function(l,u){if(!this.isInitialized)return this;if(this.pluginIsInstalled(l))return this;if(l.id&&(this._plugins.map[l.id]=l),this._plugins.list.push(l),l.install&&l.install(this,u),l.listeners&&l.before){for(var m=0,g=this.listenerMaps.length,v=l.before.reduce(function(y,w){return y[w]=!0,y[zu(w)]=!0,y},{});m<g;m++){var b=this.listenerMaps[m].id;if(b&&(v[b]||v[zu(b)]))break}this.listenerMaps.splice(m,0,{id:l.id,map:l.listeners})}else l.listeners&&this.listenerMaps.push({id:l.id,map:l.listeners});return this}},{key:"addDocument",value:function(l,u){if(this.getDocIndex(l)!==-1)return!1;var m=H(l);u=u?U({},u):{},this.documents.push({doc:l,options:u}),this.events.documents.push(l),l!==this.document&&this.events.add(m,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:l,window:m,scope:this,options:u})}},{key:"removeDocument",value:function(l){var u=this.getDocIndex(l),m=H(l),g=this.documents[u].options;this.events.remove(m,"unload",this.onWindowUnload),this.documents.splice(u,1),this.events.documents.splice(u,1),this.fire("scope:remove-document",{doc:l,window:m,scope:this,options:g})}},{key:"getDocIndex",value:function(l){for(var u=0;u<this.documents.length;u++)if(this.documents[u].doc===l)return u;return-1}},{key:"getDocOptions",value:function(l){var u=this.getDocIndex(l);return u===-1?null:this.documents[u].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),c}();function zu(c){return c&&c.replace(/\/.*$/,"")}var Eu=new l0,no=Eu.interactStatic,c0=typeof globalThis<"u"?globalThis:window;Eu.init(c0);var d0=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(c){var l=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(m){var g=m[0],v=m[1];return g in c||v in c}),u=function(m,g){for(var v=c.range,b=c.limits,y=b===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:b,w=c.offset,M=w===void 0?{x:0,y:0}:w,_={range:v,grid:c,x:null,y:null},E=0;E<l.length;E++){var O=l[E],D=O[0],V=O[1],N=Math.round((m-M.x)/c[D]),G=Math.round((g-M.y)/c[V]);_[D]=Math.max(y.left,Math.min(y.right,N*c[D]+M.x)),_[V]=Math.max(y.top,Math.min(y.bottom,G*c[V]+M.y))}return _};return u.grid=c,u.coordFields=l,u}}),u0={id:"snappers",install:function(c){var l=c.interactStatic;l.snappers=U(l.snappers||{},d0),l.createSnapGrid=l.snappers.grid}},h0=u0,p0={start:function(c){var l=c.state,u=c.rect,m=c.edges,g=c.pageCoords,v=l.options,b=v.ratio,y=v.enabled,w=l.options,M=w.equalDelta,_=w.modifiers;b==="preserve"&&(b=u.width/u.height),l.startCoords=U({},g),l.startRect=U({},u),l.ratio=b,l.equalDelta=M;var E=l.linkedEdges={top:m.top||m.left&&!m.bottom,left:m.left||m.top&&!m.right,bottom:m.bottom||m.right&&!m.top,right:m.right||m.bottom&&!m.left};if(l.xIsPrimaryAxis=!(!m.left&&!m.right),l.equalDelta){var O=(E.left?1:-1)*(E.top?1:-1);l.edgeSign={x:O,y:O}}else l.edgeSign={x:E.left?-1:1,y:E.top?-1:1};if(y!==!1&&U(m,E),_!=null&&_.length){var D=new Xl(c.interaction);D.copyFrom(c.interaction.modification),D.prepareStates(_),l.subModification=D,D.startAll(o({},c))}},set:function(c){var l=c.state,u=c.rect,m=c.coords,g=l.linkedEdges,v=U({},m),b=l.equalDelta?m0:g0;if(U(c.edges,g),b(l,l.xIsPrimaryAxis,m,u),!l.subModification)return null;var y=U({},u);tn(g,y,{x:m.x-v.x,y:m.y-v.y});var w=l.subModification.setAll(o(o({},c),{},{rect:y,edges:g,pageCoords:m,prevCoords:m,prevRect:y})),M=w.delta;return w.changed&&(b(l,Math.abs(M.x)>Math.abs(M.y),w.coords,w.rect),U(m,w.coords)),w.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function m0(c,l,u){var m=c.startCoords,g=c.edgeSign;l?u.y=m.y+(u.x-m.x)*g.y:u.x=m.x+(u.y-m.y)*g.x}function g0(c,l,u,m){var g=c.startRect,v=c.startCoords,b=c.ratio,y=c.edgeSign;if(l){var w=m.width/b;u.y=v.y+(w-g.height)*y.y}else{var M=m.height*b;u.x=v.x+(M-g.width)*y.x}}var f0=on(p0,"aspectRatio"),Su=function(){};Su._defaults={};var As=Su;function kn(c,l,u){return $.func(c)?li(c,l.interactable,l.element,[u.x,u.y,l]):li(c,l.interactable,l.element)}var Ps={start:function(c){var l=c.rect,u=c.startOffset,m=c.state,g=c.interaction,v=c.pageCoords,b=m.options,y=b.elementRect,w=U({left:0,top:0,right:0,bottom:0},b.offset||{});if(l&&y){var M=kn(b.restriction,g,v);if(M){var _=M.right-M.left-l.width,E=M.bottom-M.top-l.height;_<0&&(w.left+=_,w.right+=_),E<0&&(w.top+=E,w.bottom+=E)}w.left+=u.left-l.width*y.left,w.top+=u.top-l.height*y.top,w.right+=u.right-l.width*(1-y.right),w.bottom+=u.bottom-l.height*(1-y.bottom)}m.offset=w},set:function(c){var l=c.coords,u=c.interaction,m=c.state,g=m.options,v=m.offset,b=kn(g.restriction,u,l);if(b){var y=function(w){return!w||"left"in w&&"top"in w||((w=U({},w)).left=w.x||0,w.top=w.y||0,w.right=w.right||w.left+w.width,w.bottom=w.bottom||w.top+w.height),w}(b);l.x=Math.max(Math.min(y.right-v.right,l.x),y.left+v.left),l.y=Math.max(Math.min(y.bottom-v.bottom,l.y),y.top+v.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},v0=on(Ps,"restrict"),$u={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Tu={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Au(c,l){for(var u=0,m=["top","left","bottom","right"];u<m.length;u++){var g=m[u];g in c||(c[g]=l[g])}return c}var Ra={noInner:$u,noOuter:Tu,start:function(c){var l,u=c.interaction,m=c.startOffset,g=c.state,v=g.options;v&&(l=Yo(kn(v.offset,u,u.coords.start.page))),l=l||{x:0,y:0},g.offset={top:l.y+m.top,left:l.x+m.left,bottom:l.y-m.bottom,right:l.x-m.right}},set:function(c){var l=c.coords,u=c.edges,m=c.interaction,g=c.state,v=g.offset,b=g.options;if(u){var y=U({},l),w=kn(b.inner,m,y)||{},M=kn(b.outer,m,y)||{};Au(w,$u),Au(M,Tu),u.top?l.y=Math.min(Math.max(M.top+v.top,y.y),w.top+v.top):u.bottom&&(l.y=Math.max(Math.min(M.bottom+v.bottom,y.y),w.bottom+v.bottom)),u.left?l.x=Math.min(Math.max(M.left+v.left,y.x),w.left+v.left):u.right&&(l.x=Math.max(Math.min(M.right+v.right,y.x),w.right+v.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},b0=on(Ra,"restrictEdges"),y0=U({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(c){}},Ps.defaults),k0=on({start:Ps.start,set:Ps.set,defaults:y0},"restrictRect"),x0={width:-1/0,height:-1/0},w0={width:1/0,height:1/0},_0=on({start:function(c){return Ra.start(c)},set:function(c){var l=c.interaction,u=c.state,m=c.rect,g=c.edges,v=u.options;if(g){var b=ci(kn(v.min,l,c.coords))||x0,y=ci(kn(v.max,l,c.coords))||w0;u.options={endOnly:v.endOnly,inner:U({},Ra.noInner),outer:U({},Ra.noOuter)},g.top?(u.options.inner.top=m.bottom-b.height,u.options.outer.top=m.bottom-y.height):g.bottom&&(u.options.inner.bottom=m.top+b.height,u.options.outer.bottom=m.top+y.height),g.left?(u.options.inner.left=m.right-b.width,u.options.outer.left=m.right-y.width):g.right&&(u.options.inner.right=m.left+b.width,u.options.outer.right=m.left+y.width),Ra.set(c),u.options=v}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),rc={start:function(c){var l,u=c.interaction,m=c.interactable,g=c.element,v=c.rect,b=c.state,y=c.startOffset,w=b.options,M=w.offsetWithOrigin?function(O){var D=O.interaction.element,V=Yo(li(O.state.options.origin,null,null,[D])),N=V||ji(O.interactable,D,O.interaction.prepared.name);return N}(c):{x:0,y:0};if(w.offset==="startCoords")l={x:u.coords.start.page.x,y:u.coords.start.page.y};else{var _=li(w.offset,m,g,[u]);(l=Yo(_)||{x:0,y:0}).x+=M.x,l.y+=M.y}var E=w.relativePoints;b.offsets=v&&E&&E.length?E.map(function(O,D){return{index:D,relativePoint:O,x:y.left-v.width*O.x+l.x,y:y.top-v.height*O.y+l.y}}):[{index:0,relativePoint:null,x:l.x,y:l.y}]},set:function(c){var l=c.interaction,u=c.coords,m=c.state,g=m.options,v=m.offsets,b=ji(l.interactable,l.element,l.prepared.name),y=U({},u),w=[];g.offsetWithOrigin||(y.x-=b.x,y.y-=b.y);for(var M=0,_=v;M<_.length;M++)for(var E=_[M],O=y.x-E.x,D=y.y-E.y,V=0,N=g.targets.length;V<N;V++){var G=g.targets[V],K=void 0;(K=$.func(G)?G(O,D,l._proxy,E,V):G)&&w.push({x:($.number(K.x)?K.x:O)+E.x,y:($.number(K.y)?K.y:D)+E.y,range:$.number(K.range)?K.range:g.range,source:G,index:V,offset:E})}for(var X={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},pe=0;pe<w.length;pe++){var Ce=w[pe],re=Ce.range,ve=Ce.x-y.x,ao=Ce.y-y.y,kt=$a(ve,ao),Fo=kt<=re;re===1/0&&X.inRange&&X.range!==1/0&&(Fo=!1),X.target&&!(Fo?X.inRange&&re!==1/0?kt/re<X.distance/X.range:re===1/0&&X.range!==1/0||kt<X.distance:!X.inRange&&kt<X.distance)||(X.target=Ce,X.distance=kt,X.range=re,X.inRange=Fo,X.delta.x=ve,X.delta.y=ao)}return X.inRange&&(u.x=X.target.x,u.y=X.target.y),m.closest=X,X},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},M0=on(rc,"snap"),js={start:function(c){var l=c.state,u=c.edges,m=l.options;if(!u)return null;c.state={options:{targets:null,relativePoints:[{x:u.left?0:1,y:u.top?0:1}],offset:m.offset||"self",origin:{x:0,y:0},range:m.range}},l.targetFields=l.targetFields||[["width","height"],["x","y"]],rc.start(c),l.offsets=c.state.offsets,c.state=l},set:function(c){var l=c.interaction,u=c.state,m=c.coords,g=u.options,v=u.offsets,b={x:m.x-v[0].x,y:m.y-v[0].y};u.options=U({},g),u.options.targets=[];for(var y=0,w=g.targets||[];y<w.length;y++){var M=w[y],_=void 0;if(_=$.func(M)?M(b.x,b.y,l):M){for(var E=0,O=u.targetFields;E<O.length;E++){var D=O[E],V=D[0],N=D[1];if(V in _||N in _){_.x=_[V],_.y=_[N];break}}u.options.targets.push(_)}}var G=rc.set(c);return u.options=g,G},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},C0=on(js,"snapSize"),oc={aspectRatio:f0,restrictEdges:b0,restrict:v0,restrictRect:k0,restrictSize:_0,snapEdges:on({start:function(c){var l=c.edges;return l?(c.state.targetFields=c.state.targetFields||[[l.left?"left":"right",l.top?"top":"bottom"]],js.start(c)):null},set:js.set,defaults:U(Wn(js.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:M0,snapSize:C0,spring:As,avoid:As,transform:As,rubberband:As},z0={id:"modifiers",install:function(c){var l=c.interactStatic;for(var u in c.usePlugin(pu),c.usePlugin(h0),l.modifiers=oc,oc){var m=oc[u],g=m._defaults,v=m._methods;g._methods=v,c.defaults.perAction[u]=g}}},E0=z0,Pu=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w){var M;if(t(this,u),ws(f(M=l.call(this,y)),v),v!==g&&ws(f(M),g),M.timeStamp=w,M.originalEvent=v,M.type=m,M.pointerId=Ta(g),M.pointerType=Yd(g),M.target=b,M.currentTarget=null,m==="tap"){var _=y.getPointerIndex(g);M.dt=M.timeStamp-y.pointers[_].downTime;var E=M.timeStamp-y.tapTime;M.double=!!y.prevTap&&y.prevTap.type!=="doubletap"&&y.prevTap.target===M.target&&E<500}else m==="doubletap"&&(M.dt=g.timeStamp-y.tapTime,M.double=!0);return M}return n(u,[{key:"_subtractOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX-=g,this.pageY-=v,this.clientX-=g,this.clientY-=v,this}},{key:"_addOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX+=g,this.pageY+=v,this.clientX+=g,this.clientY+=v,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),u}(Cs),Ia={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(c){c.pointerEvents=Ia,c.defaults.actions.pointerEvents=Ia.defaults,U(c.actions.phaselessTypes,Ia.types)},listeners:{"interactions:new":function(c){var l=c.interaction;l.prevTap=null,l.tapTime=0},"interactions:update-pointer":function(c){var l=c.down,u=c.pointerInfo;!l&&u.hold||(u.hold={duration:1/0,timeout:null})},"interactions:move":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;c.duplicate||u.pointerIsDown&&!u.pointerWasMoved||(u.pointerIsDown&&ic(c),an({interaction:u,pointer:m,event:g,eventTarget:v,type:"move"},l))},"interactions:down":function(c,l){(function(u,m){for(var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget,w=u.pointerIndex,M=g.pointers[w].hold,_=ce(y),E={interaction:g,pointer:v,event:b,eventTarget:y,type:"hold",targets:[],path:_,node:null},O=0;O<_.length;O++){var D=_[O];E.node=D,m.fire("pointerEvents:collect-targets",E)}if(E.targets.length){for(var V=1/0,N=0,G=E.targets;N<G.length;N++){var K=G[N].eventable.options.holdDuration;K<V&&(V=K)}M.duration=V,M.timeout=setTimeout(function(){an({interaction:g,eventTarget:y,pointer:v,event:b,type:"hold"},m)},V)}})(c,l),an(c,l)},"interactions:up":function(c,l){ic(c),an(c,l),function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerWasMoved||an({interaction:g,eventTarget:y,pointer:v,event:b,type:"tap"},m)}(c,l)},"interactions:cancel":function(c,l){ic(c),an(c,l)}},PointerEvent:Pu,fire:an,collectEventTargets:ju,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function an(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=c.targets,w=y===void 0?ju(c,l):y,M=new Pu(b,m,g,v,u,l.now());l.fire("pointerEvents:new",{pointerEvent:M});for(var _={interaction:u,pointer:m,event:g,eventTarget:v,targets:w,type:b,pointerEvent:M},E=0;E<w.length;E++){var O=w[E];for(var D in O.props||{})M[D]=O.props[D];var V=ji(O.eventable,O.node);if(M._subtractOrigin(V),M.eventable=O.eventable,M.currentTarget=O.node,O.eventable.fire(M),M._addOrigin(V),M.immediatePropagationStopped||M.propagationStopped&&E+1<w.length&&w[E+1].node!==M.currentTarget)break}if(l.fire("pointerEvents:fired",_),b==="tap"){var N=M.double?an({interaction:u,pointer:m,event:g,eventTarget:v,type:"doubletap"},l):M;u.prevTap=N,u.tapTime=N.timeStamp}return M}function ju(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=u.getPointerIndex(m),w=u.pointers[y];if(b==="tap"&&(u.pointerWasMoved||!w||w.downTarget!==v))return[];for(var M=ce(v),_={interaction:u,pointer:m,event:g,eventTarget:v,type:b,path:M,targets:[],node:null},E=0;E<M.length;E++){var O=M[E];_.node=O,l.fire("pointerEvents:collect-targets",_)}return b==="hold"&&(_.targets=_.targets.filter(function(D){var V,N;return D.eventable.options.holdDuration===((V=u.pointers[y])==null||(N=V.hold)==null?void 0:N.duration)})),_.targets}function ic(c){var l=c.interaction,u=c.pointerIndex,m=l.pointers[u].hold;m&&m.timeout&&(clearTimeout(m.timeout),m.timeout=null)}var S0=Object.freeze({__proto__:null,default:Ia});function $0(c){var l=c.interaction;l.holdIntervalHandle&&(clearInterval(l.holdIntervalHandle),l.holdIntervalHandle=null)}var T0={id:"pointer-events/holdRepeat",install:function(c){c.usePlugin(Ia);var l=c.pointerEvents;l.defaults.holdRepeatInterval=0,l.types.holdrepeat=c.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(c,l){return c["pointerEvents:".concat(l)]=$0,c},{"pointerEvents:new":function(c){var l=c.pointerEvent;l.type==="hold"&&(l.count=(l.count||0)+1)},"pointerEvents:fired":function(c,l){var u=c.interaction,m=c.pointerEvent,g=c.eventTarget,v=c.targets;if(m.type==="hold"&&v.length){var b=v[0].eventable.options.holdRepeatInterval;b<=0||(u.holdIntervalHandle=setTimeout(function(){l.pointerEvents.fire({interaction:u,eventTarget:g,type:"hold",pointer:m,event:m},l)},b))}}})},A0=T0,P0={id:"pointer-events/interactableTargets",install:function(c){var l=c.Interactable;l.prototype.pointerEvents=function(m){return U(this.events.options,m),this};var u=l.prototype._backCompatOption;l.prototype._backCompatOption=function(m,g){var v=u.call(this,m,g);return v===this&&(this.events.options[m]=g),v}},listeners:{"pointerEvents:collect-targets":function(c,l){var u=c.targets,m=c.node,g=c.type,v=c.eventTarget;l.interactables.forEachMatch(m,function(b){var y=b.events,w=y.options;y.types[g]&&y.types[g].length&&b.testIgnoreAllow(w,m,v)&&u.push({node:m,eventable:y,props:{interactable:b}})})},"interactable:new":function(c){var l=c.interactable;l.events.getRect=function(u){return l.getRect(u)}},"interactable:set":function(c,l){var u=c.interactable,m=c.options;U(u.events.options,l.pointerEvents.defaults),U(u.events.options,m.pointerEvents||{})}}},j0=P0,O0={id:"pointer-events",install:function(c){c.usePlugin(S0),c.usePlugin(A0),c.usePlugin(j0)}},H0=O0,R0={id:"reflow",install:function(c){var l=c.Interactable;c.actions.phases.reflow=!0,l.prototype.reflow=function(u){return function(m,g,v){for(var b=m.getAllElements(),y=v.window.Promise,w=y?[]:null,M=function(){var E=b[_],O=m.getRect(E);if(!O)return 1;var D,V=Pa(v.interactions.list,function(K){return K.interacting()&&K.interactable===m&&K.element===E&&K.prepared.name===g.name});if(V)V.move(),w&&(D=V._reflowPromise||new y(function(K){V._reflowResolve=K}));else{var N=ci(O),G=function(K){return{coords:K,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}}({page:{x:N.x,y:N.y},client:{x:N.x,y:N.y},timeStamp:v.now()});D=function(K,X,pe,Ce,re){var ve=K.interactions.new({pointerType:"reflow"}),ao={interaction:ve,event:re,pointer:re,eventTarget:pe,phase:"reflow"};ve.interactable=X,ve.element=pe,ve.prevEvent=re,ve.updatePointer(re,re,pe,!0),Kd(ve.coords.delta),Wl(ve.prepared,Ce),ve._doPhase(ao);var kt=K.window,Fo=kt.Promise,ui=Fo?new Fo(function(Ri){ve._reflowResolve=Ri}):void 0;return ve._reflowPromise=ui,ve.start(Ce,X,pe),ve._interacting?(ve.move(ao),ve.end(re)):(ve.stop(),ve._reflowResolve()),ve.removePointer(re,re),ui}(v,m,E,g,G)}w&&w.push(D)},_=0;_<b.length&&!M();_++);return w&&y.all(w).then(function(){return m})}(this,u,c)}},listeners:{"interactions:stop":function(c,l){var u=c.interaction;u.pointerType==="reflow"&&(u._reflowResolve&&u._reflowResolve(),function(m,g){m.splice(m.indexOf(g),1)}(l.interactions.list,u))}}},I0=R0;if(no.use(hu),no.use(bu),no.use(H0),no.use(e0),no.use(E0),no.use(L1),no.use(A1),no.use(j1),no.use(I0),no.default=no,(typeof Tn>"u"?"undefined":e(Tn))==="object"&&Tn)try{Tn.exports=no}catch{}return no.default=no,no})});var Yf={};Ru(Yf,{BP:()=>vd,LuiAlert:()=>$r,LuiAutocomplete:()=>mt,LuiAvatar:()=>$t,LuiAvatarGroup:()=>ir,LuiBackground:()=>ct,LuiBadge:()=>rr,LuiBreadcrumb:()=>Xt,LuiBreadcrumbItem:()=>_r,LuiButton:()=>Wt,LuiButtonGroup:()=>Ge,LuiButtonGroupItem:()=>Ut,LuiCalendar:()=>Fr,LuiCard:()=>Rt,LuiCascader:()=>ht,LuiCheckbox:()=>Gt,LuiCheckboxGroup:()=>Cr,LuiCol:()=>po,LuiCollapse:()=>$o,LuiCollapseItem:()=>Yr,LuiColorPicker:()=>ot,LuiCommandPalette:()=>lr,LuiConfigProvider:()=>ur,LuiContextMenu:()=>Re,LuiDateRangePicker:()=>Ro,LuiDatepicker:()=>_t,LuiDialog:()=>Me,LuiDivider:()=>Hr,LuiDrawer:()=>it,LuiDropdown:()=>Fi,LuiDropmenu:()=>Se,LuiEmptyState:()=>No,LuiFileInput:()=>jo,LuiForm:()=>Lt,LuiFormItem:()=>sr,LuiIcon:()=>Oe,LuiIconPicker:()=>$e,LuiImage:()=>Ie,LuiImageCropper:()=>wt,LuiInput:()=>He,LuiInputNumber:()=>Nt,LuiInputOpt:()=>Ir,LuiMenu:()=>Zo,LuiMenuDivider:()=>En,LuiMenuItem:()=>er,LuiOption:()=>fi,LuiOptionGroup:()=>un,LuiOverlayRoot:()=>Jn,LuiPagination:()=>Ye,LuiPopconfirm:()=>bt,LuiPopover:()=>te,LuiProgress:()=>Qt,LuiQrcode:()=>pr,LuiRadio:()=>zr,LuiRadioGroup:()=>Dr,LuiRow:()=>ri,LuiScrollArea:()=>Ft,LuiSelect:()=>me,LuiSkeleton:()=>jr,LuiSlider:()=>ut,LuiSpinner:()=>_o,LuiSplitter:()=>ro,LuiStatistic:()=>St,LuiSwitch:()=>go,LuiTab:()=>It,LuiTabPanel:()=>So,LuiTable:()=>Y,LuiTableColumn:()=>vr,LuiTabs:()=>ca,LuiTag:()=>so,LuiText:()=>Xe,LuiTextarea:()=>dt,LuiToast:()=>cr,LuiTooltip:()=>Gr,LuiTree:()=>le,LuiTreeSelect:()=>pt,baseStyles:()=>j,bringOverlayStackToFront:()=>Et,builtinIconCollection:()=>qs,builtinIconNames:()=>Ya,builtinIconPrefix:()=>wn,builtinTranslations:()=>Oc,commandPalette:()=>u1,contextMenu:()=>y1,createCommandPalette:()=>Sl,createContextMenu:()=>ks,createDialog:()=>Sa,createDialogForm:()=>Rd,createDrawer:()=>Tl,createForm:()=>f1,createPopover:()=>Ol,createTable:()=>qd,createToastHost:()=>Ld,dialog:()=>p1,drawer:()=>h1,encodeQr:()=>zl,ensureOverlayExternalLayer:()=>Ar,ensureOverlayLayer:()=>Js,ensureOverlayRoot:()=>Qs,eventPathContainsOwnedOverlay:()=>Cn,form:()=>v1,formatDate:()=>J2,formatSize:()=>Q2,getLocale:()=>Em,hasRecentOverlayInteraction:()=>es,hideAllContextMenus:()=>Dd,isImageIconSource:()=>Ks,isOverlayTopmost:()=>rs,markOverlayInteraction:()=>Ja,mergeTranslations:()=>ne,normalizeStatus:()=>Nn,onLocaleChange:()=>xe,popover:()=>k1,registerFormField:()=>Wp,registerOverlayStack:()=>Jt,registerTranslations:()=>Ic,resolveBuiltinIcon:()=>Yn,resolveBuiltinTranslations:()=>Zh,resolveOverlayLayerRegistration:()=>zn,setLocale:()=>Rc,setOverlayOwner:()=>Cc,setupBuiltinIcons:()=>Xa,showContextMenu:()=>Vd,statusColorToken:()=>o1,statusColorVar:()=>Wg,statusIcon:()=>Pi,statusOrder:()=>Ug,t:()=>Sm,table:()=>M1,toCssLength:()=>Ot,toast:()=>Ji,tokens:()=>A,translate:()=>ae,unregisterFormField:()=>Up,unregisterOverlayStack:()=>Xo});module.exports=B0(Yf);var Mo=require("lit"),mr=require("lit/decorators.js");var ac=require("lit"),A=ac.css`
2
2
  :host {
3
3
  /* Surfaces (refined workbench light) */
4
4
  --lui-color-bg: #ffffff;
@@ -1186,7 +1186,7 @@
1186
1186
  pointer-events: auto;
1187
1187
  z-index: calc(var(--lui-z-popup) + 20);
1188
1188
  }
1189
- `,Rh=new WeakSet,lm=["popup","menu","modal","toast","tooltip"];function cm(i){if(Rh.has(i))return;let o=i.createElement("style");o.setAttribute("data-lui-overlay-external-styles",""),o.textContent=sm,i.head.appendChild(o),Rh.add(i)}function dm(i){return i instanceof HTMLElement||i instanceof ShadowRoot}function um(i){for(let o of Array.from(i.childNodes))if(o instanceof Jn||o instanceof HTMLElement&&o.tagName.toLowerCase()==="lui-overlay-root")return o;return null}function hm(i){if(dm(i))return i;if(typeof document>"u"||!document.body)throw new Error("lui-overlay-root requires a browser document body.");return document.body}var Jn=class extends HTMLElement{constructor(){super();this._layers=new Map;this._externalLayers=new Map;let e=this.attachShadow({mode:"open"});cm(this.ownerDocument);let t=document.createElement("style");t.textContent=am,this._viewport=document.createElement("div"),this._viewport.setAttribute("part","viewport"),this._externalSlot=document.createElement("slot"),this._externalSlot.name="external",this._externalSlot.setAttribute("part","external-slot");for(let r of lm){let n=document.createElement("div");n.setAttribute("part","layer"),n.dataset.layer=r,this._layers.set(r,n),this._viewport.appendChild(n)}e.append(t,this._viewport,this._externalSlot)}getLayer(e="popup"){return this._layers.get(e)??this._layers.get("popup")}getExternalLayer(e="popup"){let t=this._externalLayers.get(e);if(t)return t;let r=this.ownerDocument.createElement("div");return r.className="lui-overlay-external-layer",r.dataset.layer=e,r.slot="external",this.appendChild(r),this._externalLayers.set(e,r),r}};customElements.get("lui-overlay-root")||customElements.define("lui-overlay-root",Jn);function Qs(i){let o=hm(i),e=um(o);return e||(e=(o instanceof ShadowRoot,o.ownerDocument).createElement("lui-overlay-root"),o.appendChild(e)),e}function Js(i="popup",o){return Qs(o).getLayer(i)}function Ar(i="popup",o){return Qs(o).getExternalLayer(i)}var ea=new WeakMap,el=new WeakMap,_c=new WeakMap,Ih=new WeakMap;function Mc(i){if(!i)return null;let o=i.getRootNode?.();return o instanceof ShadowRoot&&o.host&&o!==i?o.host:i.parentNode}function pm(i,o){let e=o;for(;e;){if(e===i)return!0;e=Mc(e)}return!1}function mm(i){let o=i instanceof Node?i:null;for(;o;){if(o instanceof HTMLElement){let e=_c.get(o);if(e)return e}o=Mc(o)}return null}function Cc(i,o){if(o){_c.set(i,o);return}_c.delete(i)}function Cn(i,o){return i.some(e=>{let t=mm(e);return t?pm(o,t):!1})}function Ja(i,o=320){if(!i)return;let e=Date.now()+o,t=i;for(;t;)t instanceof HTMLElement&&Ih.set(t,e),t=Mc(t)}function es(i){return i?(Ih.get(i)??0)>Date.now():!1}function ts(i){let o=el.get(i);if(o)return o;let e=[];return el.set(i,e),e}function gm(i){let o=Number.parseInt(getComputedStyle(i).zIndex,10);return Number.isFinite(o)?o:0}function fm(i){let o=getComputedStyle(i).getPropertyValue("--lui-z-step").trim(),e=Number.parseInt(o,10);return Number.isFinite(e)&&e>0?e:10}function zc(i){let o=ts(i).filter(r=>r.isConnected);if(o.length===0){el.delete(i);return}let e=gm(i),t=fm(i);o.forEach((r,n)=>{let s=String(e+n*t);r.style.setProperty("--lui-overlay-z-index",s),r.style.zIndex=s}),el.set(i,o)}function Jt(i,o,e){let t=ea.get(i);t&&t.layer!==o&&Yo(i);let r=ts(o),n=r.indexOf(i);n>=0&&r.splice(n,1),r.push(i),ea.set(i,{element:i,layer:o,layerName:e}),zc(o)}function Et(i){let o=ea.get(i);if(!o)return!1;let e=ts(o.layer),t=e.indexOf(i);return t===-1?e.push(i):t!==e.length-1&&(e.splice(t,1),e.push(i)),zc(o.layer),!0}function Yo(i){let o=ea.get(i);if(!o)return!1;let e=ts(o.layer),t=e.indexOf(i);return t>=0&&e.splice(t,1),i.style.removeProperty("--lui-overlay-z-index"),i.style.removeProperty("z-index"),ea.delete(i),zc(o.layer),!0}function rs(i){let o=ea.get(i);if(!o)return!1;let e=ts(o.layer).filter(t=>t.isConnected);return e.length>0&&e[e.length-1]===i}function zn(i){let o=i?.parentElement,e=o?.dataset.layer;return!o||!e?null:{layer:o,layerName:e}}var vm=`
1189
+ `,Rh=new WeakSet,lm=["popup","menu","modal","toast","tooltip"];function cm(i){if(Rh.has(i))return;let o=i.createElement("style");o.setAttribute("data-lui-overlay-external-styles",""),o.textContent=sm,i.head.appendChild(o),Rh.add(i)}function dm(i){return i instanceof HTMLElement||i instanceof ShadowRoot}function um(i){for(let o of Array.from(i.childNodes))if(o instanceof Jn||o instanceof HTMLElement&&o.tagName.toLowerCase()==="lui-overlay-root")return o;return null}function hm(i){if(dm(i))return i;if(typeof document>"u"||!document.body)throw new Error("lui-overlay-root requires a browser document body.");return document.body}var Jn=class extends HTMLElement{constructor(){super();this._layers=new Map;this._externalLayers=new Map;let e=this.attachShadow({mode:"open"});cm(this.ownerDocument);let t=document.createElement("style");t.textContent=am,this._viewport=document.createElement("div"),this._viewport.setAttribute("part","viewport"),this._externalSlot=document.createElement("slot"),this._externalSlot.name="external",this._externalSlot.setAttribute("part","external-slot");for(let r of lm){let n=document.createElement("div");n.setAttribute("part","layer"),n.dataset.layer=r,this._layers.set(r,n),this._viewport.appendChild(n)}e.append(t,this._viewport,this._externalSlot)}getLayer(e="popup"){return this._layers.get(e)??this._layers.get("popup")}getExternalLayer(e="popup"){let t=this._externalLayers.get(e);if(t)return t;let r=this.ownerDocument.createElement("div");return r.className="lui-overlay-external-layer",r.dataset.layer=e,r.slot="external",this.appendChild(r),this._externalLayers.set(e,r),r}};customElements.get("lui-overlay-root")||customElements.define("lui-overlay-root",Jn);function Qs(i){let o=hm(i),e=um(o);return e||(e=(o instanceof ShadowRoot,o.ownerDocument).createElement("lui-overlay-root"),o.appendChild(e)),e}function Js(i="popup",o){return Qs(o).getLayer(i)}function Ar(i="popup",o){return Qs(o).getExternalLayer(i)}var ea=new WeakMap,el=new WeakMap,_c=new WeakMap,Ih=new WeakMap;function Mc(i){if(!i)return null;let o=i.getRootNode?.();return o instanceof ShadowRoot&&o.host&&o!==i?o.host:i.parentNode}function pm(i,o){let e=o;for(;e;){if(e===i)return!0;e=Mc(e)}return!1}function mm(i){let o=i instanceof Node?i:null;for(;o;){if(o instanceof HTMLElement){let e=_c.get(o);if(e)return e}o=Mc(o)}return null}function Cc(i,o){if(o){_c.set(i,o);return}_c.delete(i)}function Cn(i,o){return i.some(e=>{let t=mm(e);return t?pm(o,t):!1})}function Ja(i,o=320){if(!i)return;let e=Date.now()+o,t=i;for(;t;)t instanceof HTMLElement&&Ih.set(t,e),t=Mc(t)}function es(i){return i?(Ih.get(i)??0)>Date.now():!1}function ts(i){let o=el.get(i);if(o)return o;let e=[];return el.set(i,e),e}function gm(i){let o=Number.parseInt(getComputedStyle(i).zIndex,10);return Number.isFinite(o)?o:0}function fm(i){let o=getComputedStyle(i).getPropertyValue("--lui-z-step").trim(),e=Number.parseInt(o,10);return Number.isFinite(e)&&e>0?e:10}function zc(i){let o=ts(i).filter(r=>r.isConnected);if(o.length===0){el.delete(i);return}let e=gm(i),t=fm(i);o.forEach((r,n)=>{let s=String(e+n*t);r.style.setProperty("--lui-overlay-z-index",s),r.style.zIndex=s}),el.set(i,o)}function Jt(i,o,e){let t=ea.get(i);t&&t.layer!==o&&Xo(i);let r=ts(o),n=r.indexOf(i);n>=0&&r.splice(n,1),r.push(i),ea.set(i,{element:i,layer:o,layerName:e}),zc(o)}function Et(i){let o=ea.get(i);if(!o)return!1;let e=ts(o.layer),t=e.indexOf(i);return t===-1?e.push(i):t!==e.length-1&&(e.splice(t,1),e.push(i)),zc(o.layer),!0}function Xo(i){let o=ea.get(i);if(!o)return!1;let e=ts(o.layer),t=e.indexOf(i);return t>=0&&e.splice(t,1),i.style.removeProperty("--lui-overlay-z-index"),i.style.removeProperty("z-index"),ea.delete(i),zc(o.layer),!0}function rs(i){let o=ea.get(i);if(!o)return!1;let e=ts(o.layer).filter(t=>t.isConnected);return e.length>0&&e[e.length-1]===i}function zn(i){let o=i?.parentElement,e=o?.dataset.layer;return!o||!e?null:{layer:o,layerName:e}}var vm=`
1190
1190
  :host {
1191
1191
  position: fixed;
1192
1192
  inset: 0;
@@ -1405,7 +1405,7 @@
1405
1405
  transition: none;
1406
1406
  }
1407
1407
  }
1408
- `,te=class extends mi.LitElement{constructor(){super(...arguments);this.open=!1;this.placement="bottom";this.trigger="click";this.disabled=!1;this.interactive=!0;this.showArrow=!0;this.closeOnOutsidePress=!0;this.closeOnEsc=!0;this.openDelay=80;this.closeDelay=100;this.offsetDistance=8;this.autoFlip=!0;this.autoShift=!0;this.sameWidth=!1;this.backdrop="none";this.backdropStyle="";this.portal=!1;this.overlayLayer="popup";this._hasHeader=!1;this._hasFooter=!1;this._cleanupAutoUpdate=null;this._openTimer=null;this._closeTimer=null;this._triggerHovered=!1;this._contentHovered=!1;this._triggerFocused=!1;this._contentFocused=!1;this._portalHost=null;this._portalBackdropEl=null;this._portalContentEl=null;this._portalArrowEl=null;this._portalHeaderEl=null;this._portalBodyEl=null;this._portalFooterEl=null;this._portalLayerEl=null;this._portalDestroyTimer=null;this._portaledNodes=new Map;this._hoverBridgeCleanup=null;this._lastPointer=null;this._lastTriggerPointerDownAt=0;this._suppressTriggerFocusUntilBlur=!1;this._suppressOutsidePressUntil=0;this._onTriggerPointerDown=()=>{this._lastTriggerPointerDownAt=Date.now(),this._hasTrigger("focus")&&(this._suppressTriggerFocusUntilBlur=!0,this._triggerFocused=!1)};this._onTriggerClick=e=>{if(this._hasTrigger("click")){e.stopPropagation(),this.toggle();return}this.open&&this._suppressTriggerFocusUntilBlur&&(this._hasTrigger("hover")||this._hasTrigger("focus"))&&(this._triggerHovered=!1,this._triggerFocused=!1,this._contentHovered=!1,this._contentFocused=!1,this._cleanupHoverBridge(),this.hide())};this._onTriggerMouseEnter=e=>{this._hasTrigger("hover")&&(this._lastPointer={x:e.clientX,y:e.clientY},this._triggerHovered=!0,this._scheduleShow())};this._onTriggerMouseLeave=e=>{if(!this._hasTrigger("hover"))return;let t=e.relatedTarget;this._triggerHovered=!1,this._suppressTriggerFocusUntilBlur&&(this._triggerFocused=!1),!(this.interactive&&this._isInsideFloating(t))&&(this._startHoverBridge(e)||this._scheduleHide())};this._onContentMouseEnter=e=>{this.interactive&&this._hasTrigger("hover")&&(this._lastPointer={x:e.clientX,y:e.clientY},this._contentHovered=!0,this._clearCloseTimer())};this._onContentMouseLeave=e=>{if(!this.interactive||!this._hasTrigger("hover"))return;let t=e.relatedTarget;this._contentHovered=!1,!this._isInsideTrigger(t)&&(this._startHoverBridge(e)||this._scheduleHide())};this._onTriggerFocusIn=()=>{if(this._hasTrigger("focus")){if(this._suppressTriggerFocusUntilBlur){this._triggerFocused=!1;return}if(Date.now()-this._lastTriggerPointerDownAt<500){this._triggerFocused=!1;return}this._triggerFocused=!0,this._scheduleShow()}};this._onTriggerFocusOut=e=>{if(!this._hasTrigger("focus"))return;let t=e.relatedTarget;this._isInsideTrigger(t)||this._isInsideFloating(t)||(this._suppressTriggerFocusUntilBlur=!1,this._triggerFocused=!1,this._scheduleHide())};this._onContentFocusIn=()=>{this.interactive&&(this._contentFocused=!0,this._clearCloseTimer())};this._onContentFocusOut=e=>{if(!this.interactive)return;let t=e.relatedTarget;this._isInsideTrigger(t)||this._isInsideFloating(t)||(this._contentFocused=!1,this._scheduleHide())};this._onDocumentMouseMove=e=>{this._lastPointer={x:e.clientX,y:e.clientY}};this._onBackdropClick=e=>{e.stopPropagation(),!(Date.now()<this._suppressOutsidePressUntil||es(this)||!this._emitOutsidePress(e)||!this.closeOnOutsidePress)&&this.hide()};this._onContentClick=e=>{Ja(this),e.stopPropagation()};this._onDocumentPointerDown=e=>{if(!this.open)return;let t=e.composedPath(),r=this._portalHost?t.includes(this._portalHost):!1;if(Cn(t,this)){this._suppressOutsidePressUntil=Date.now()+320;return}if(!t.includes(this)&&!r){if(!this._emitOutsidePress(e)||!this.closeOnOutsidePress)return;this._cleanupHoverBridge(),this.hide()}};this._onDocumentKeydown=e=>{!this.open||!this.closeOnEsc||e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this.hide())}}connectedCallback(){super.connectedCallback(),document.addEventListener("mousedown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeydown),document.addEventListener("mousemove",this._onDocumentMouseMove,!0)}disconnectedCallback(){super.disconnectedCallback(),this._clearTimers(),this._clearPortalDestroyTimer(),this._cleanupPositioning(),this._destroyPortal(),this._cleanupHoverBridge(),document.removeEventListener("mousedown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeydown),document.removeEventListener("mousemove",this._onDocumentMouseMove,!0)}updated(e){let t=e.has("portal")||e.has("container")||e.has("overlayLayer");e.has("interactive")&&this._portalHost&&this._portalContentEl&&(this._portalContentEl.classList.toggle("interactive",this.interactive),this._portalHost.toggleAttribute("interactive",this.interactive)),(e.has("backdrop")||e.has("backdropStyle"))&&this._portalHost&&this._syncPortalBackdrop(),t&&this._portalHost&&this._destroyPortal(),(t||e.has("open")||e.has("placement")||e.has("offsetDistance")||e.has("showArrow")||e.has("autoFlip")||e.has("autoShift"))&&(this.open?this.updateComplete.then(()=>{this.portal&&(this._ensurePortal(),this._syncPortalNodes()),this._setupPositioning()}):(this._cleanupPositioning(),this._cleanupHoverBridge(),this._contentHovered=!1,this._contentFocused=!1,this.portal&&(this._portalHost?.toggleAttribute("open",!1),this._portalHost?.toggleAttribute("interactive",this.interactive),this._schedulePortalDestroy()))),this.portal&&this.open&&this.updateComplete.then(()=>this._syncPortalNodes())}show(){this.disabled||this.open||(this._clearCloseTimer(),this._clearPortalDestroyTimer(),this.portal&&(this._ensurePortal(),this._syncPortalNodes(),this._portalHost&&Et(this._portalHost),this._portalContentEl?.classList.toggle("interactive",this.interactive),this._portalHost?.toggleAttribute("interactive",this.interactive)),this.open=!0,this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})))}hide(){this.open&&(this._clearOpenTimer(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}toggle(){this.open?this.hide():this.show()}_clearOpenTimer(){this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=null)}_clearCloseTimer(){this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null)}_clearTimers(){this._clearOpenTimer(),this._clearCloseTimer()}_clearPortalDestroyTimer(){this._portalDestroyTimer&&(clearTimeout(this._portalDestroyTimer),this._portalDestroyTimer=null)}_schedulePortalDestroy(){this._clearPortalDestroyTimer(),this._portalDestroyTimer=setTimeout(()=>{this._portalDestroyTimer=null,this.open||this._destroyPortal()},160)}_cleanupHoverBridge(){this._hoverBridgeCleanup&&(this._hoverBridgeCleanup(),this._hoverBridgeCleanup=null)}_hasTrigger(e){return this.trigger.split(/\s+/).map(t=>t.trim()).filter(Boolean).includes(e)}_scheduleShow(){if(this.disabled)return;this._clearCloseTimer(),this._clearOpenTimer();let e=Math.max(0,this.openDelay||0);this._openTimer=setTimeout(()=>{this._openTimer=null,this.show()},e)}_scheduleHide(){this._clearOpenTimer(),this._clearCloseTimer();let e=Math.max(0,this.closeDelay||0);this._closeTimer=setTimeout(()=>{this._closeTimer=null,this._refreshHoverStateFromPointer(),!(this._triggerHovered||this._triggerFocused)&&(this.interactive&&(this._contentHovered||this._contentFocused)||this.hide())},e)}_containsDeep(e,t){if(!e||!t)return!1;let r=t;for(let n=0;r&&n<64;n+=1){if(r===e||r.nodeType===Node.ELEMENT_NODE&&e.contains(r))return!0;let s=r.assignedSlot??null;if(s){r=s;continue}let d=r.parentNode;if(d&&d.nodeType===Node.DOCUMENT_FRAGMENT_NODE){r=d.host??null;continue}r=d}return!1}_isInsideTrigger(e){return this._containsDeep(this._triggerEl,e)}_isInsideFloating(e){return this._containsDeep(this._getFloatingEl(),e)}_pointInRect(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}_createBridgeRect(e,t,r=16){return{left:Math.min(e.left,t.left)-r,top:Math.min(e.top,t.top)-r,right:Math.max(e.right,t.right)+r,bottom:Math.max(e.bottom,t.bottom)+r}}_deepElementFromPoint(e,t){if(typeof document.elementFromPoint!="function")return null;let r=null;try{r=document.elementFromPoint(e,t);for(let n=0;n<32;n+=1){let s=r?.shadowRoot?.elementFromPoint(e,t);if(!s||s===r)break;r=s}}catch{return null}return r}_refreshHoverStateFromPointer(){if(!this._lastPointer)return!1;let{x:e,y:t}=this._lastPointer,n=this._portalHost?.shadowRoot?.elementFromPoint(e,t)??this._deepElementFromPoint(e,t),s=this._isInsideTrigger(n),d=this._isInsideFloating(n);return this._triggerHovered=s,this._contentHovered=this.interactive&&d,s||d}_pointInTriangle(e,t,r,n){let s=(x,k,C)=>(x.x*(k.y-C.y)+k.x*(C.y-x.y)+C.x*(x.y-k.y))/2,d=Math.abs(s(t,r,n)),h=Math.abs(s(e,t,r)),p=Math.abs(s(e,r,n)),f=Math.abs(s(e,n,t));return Math.abs(d-(h+p+f))<.5}_startHoverBridge(e){if(!this.open||!this.interactive||!this._hasTrigger("hover"))return!1;this.portal&&(this._ensurePortal(),this._syncPortalNodes());let t=e.currentTarget,r=this._getFloatingEl(),n=this._triggerEl??null;if(!t||!r||!n)return!1;let s=t===n?r:n,d=r.dataset.side||this.getAttribute("data-placement")?.split("-")[0]||this.placement.split("-")[0],h=t.getBoundingClientRect(),p=s.getBoundingClientRect(),f={x:e.clientX,y:e.clientY},x=this._createBridgeRect(h,p),k=14,C=null;if(d==="right"?C=[f,{x:p.left,y:p.top-k},{x:p.left,y:p.bottom+k}]:d==="left"?C=[f,{x:p.right,y:p.top-k},{x:p.right,y:p.bottom+k}]:d==="bottom"?C=[f,{x:p.left-k,y:p.top},{x:p.right+k,y:p.top}]:d==="top"&&(C=[f,{x:p.left-k,y:p.bottom},{x:p.right+k,y:p.bottom}]),!C)return!1;this._cleanupHoverBridge(),this._clearCloseTimer();let S=0,z=()=>{S&&clearTimeout(S),S=window.setTimeout(P,900)},T=H=>{this._lastPointer={x:H.clientX,y:H.clientY};let I=H.composedPath?.()[0]??H.target;if(this._isInsideTrigger(I)||this._isInsideFloating(I)){this._refreshHoverStateFromPointer(),this._cleanupHoverBridge();return}let B=this._lastPointer;if(B&&(this._pointInRect(B,x)||this._pointInTriangle(B,C[0],C[1],C[2]))){z();return}this._cleanupHoverBridge(),this._scheduleHide()},P=()=>{if(this._cleanupHoverBridge(),this._refreshHoverStateFromPointer()){this._clearCloseTimer();return}this._scheduleHide()};return z(),document.addEventListener("mousemove",T,!0),this._hoverBridgeCleanup=()=>{clearTimeout(S),document.removeEventListener("mousemove",T,!0),this._hoverBridgeCleanup=null},!0}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_syncNamedSlot(e,t){let n=e.target.assignedNodes({flatten:!0}).some(s=>s.nodeType!==Node.TEXT_NODE||s.textContent?.trim());t==="header"?this._hasHeader=n:this._hasFooter=n}_cleanupPositioning(){this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=null)}get portalHostElement(){return this._portalHost}get portalFloatingElement(){return this._portalContentEl}refreshFloatingPosition(){this._setupPositioning()}_getFloatingEl(){return this.portal?this._portalContentEl:this._contentEl??null}_getArrowEl(){return this.portal?this._portalArrowEl:this._arrowEl??null}_resolvePortalMountTarget(){return Js(this.overlayLayer,this.container??sn(this)??ln(this))}_adoptPortalStyles(e){if(!("adoptedStyleSheets"in e))return;let t=[...this.renderRoot.adoptedStyleSheets??[],...this.portalStyleSources??[]];if(t.length===0)return;let r=[...e.adoptedStyleSheets??[]];for(let n of t)r.includes(n)||r.push(n);e.adoptedStyleSheets=r}_ensurePortal(){if(this._clearPortalDestroyTimer(),this._portalHost)return;let e=this._resolvePortalMountTarget(),t=document.createElement("div"),r=t.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=vm,this._adoptPortalStyles(r);let s=document.createElement("div");s.setAttribute("part","content"),this.interactive&&s.classList.add("interactive");let d=document.createElement("div");d.setAttribute("part","surface");let h=document.createElement("div");h.setAttribute("part","header"),h.hidden=!this._hasHeader;let p=document.createElement("div");p.setAttribute("part","backdrop"),p.addEventListener("click",this._onBackdropClick);let f=document.createElement("div");f.setAttribute("part","body"),this._syncBodyDensity(f,this._hasHeader,this._hasFooter);let x=document.createElement("div");x.setAttribute("part","footer"),x.hidden=!this._hasFooter,d.append(h,f,x),s.appendChild(d);let k=null;if(this.showArrow){k=document.createElement("div"),k.setAttribute("part","arrow");let C=document.createElement("div");C.setAttribute("part","arrow-fill"),k.appendChild(C),s.appendChild(k)}s.addEventListener("mouseenter",this._onContentMouseEnter),s.addEventListener("mouseleave",this._onContentMouseLeave),s.addEventListener("focusin",this._onContentFocusIn),s.addEventListener("focusout",this._onContentFocusOut),s.addEventListener("click",this._onContentClick),r.append(n,p,s),e.appendChild(t),Cc(t,this),Jt(t,e,this.overlayLayer),this._portalHost=t,this._portalBackdropEl=p,this._portalContentEl=s,this._portalArrowEl=k,this._portalHeaderEl=h,this._portalBodyEl=f,this._portalFooterEl=x,this._portalLayerEl=e,this._syncPortalBackdrop(),this._syncPortalCssVars()}_moveSlotElements(e,t){if(!e||!t)return;let r=e.assignedElements({flatten:!0});for(let n of r){if(!this._portaledNodes.has(n)){let s=document.createComment("lui-popover-portal");n.parentNode?.insertBefore(s,n),this._portaledNodes.set(n,{node:n,placeholder:s})}n.parentNode!==t&&t.appendChild(n)}}_syncPortalCssVars(){if(!this._portalHost)return;let e=getComputedStyle(this),t=this._portalHost.style;for(let r of[...Nu,...te.PORTAL_OWN_VARS]){let n=e.getPropertyValue(r).trim();n?t.setProperty(r,n):t.removeProperty(r)}}_syncPortalBackdrop(){!this._portalHost||!this._portalBackdropEl||(this._portalHost.setAttribute("backdrop",this.backdrop),this._portalBackdropEl.hidden=this.backdrop==="none",this._portalBackdropEl.style.cssText=this.backdropStyle||"")}_syncPortalNodes(){if(!this.portal||!this._portalHost)return;this._syncPortalBackdrop(),this._syncPortalCssVars(),this._moveSlotElements(this._backdropSlot,this._portalBackdropEl);let e=!!this._headerSlot?.assignedElements({flatten:!0}).length,t=!!this._footerSlot?.assignedElements({flatten:!0}).length;this._portalHeaderEl.hidden=!e,this._portalFooterEl.hidden=!t,this._syncBodyDensity(this._portalBodyEl,e,t),this._moveSlotElements(this._headerSlot,this._portalHeaderEl),this._moveSlotElements(this._bodySlot,this._portalBodyEl),this._moveSlotElements(this._footerSlot,this._portalFooterEl)}_syncBodyDensity(e,t,r){if(!e)return;let n=!t&&!r;e.toggleAttribute("data-compact",n)}_restorePortaledNodes(){for(let{node:e,placeholder:t}of this._portaledNodes.values())t.parentNode?.insertBefore(e,t),t.remove();this._portaledNodes.clear()}_destroyPortal(){this._clearPortalDestroyTimer(),this._portalHost&&(this._cleanupPositioning(),this._restorePortaledNodes(),this._portalBackdropEl?.removeEventListener("click",this._onBackdropClick),this._portalContentEl?.removeEventListener("click",this._onContentClick),this._portalContentEl?.removeEventListener("mouseenter",this._onContentMouseEnter),this._portalContentEl?.removeEventListener("mouseleave",this._onContentMouseLeave),this._portalContentEl?.removeEventListener("focusin",this._onContentFocusIn),this._portalContentEl?.removeEventListener("focusout",this._onContentFocusOut),Yo(this._portalHost),this._portalHost.remove(),this._portalHost=null,this._portalBackdropEl=null,this._portalContentEl=null,this._portalArrowEl=null,this._portalHeaderEl=null,this._portalBodyEl=null,this._portalFooterEl=null,this._portalLayerEl=null)}_setupPositioning(){let e=this._getFloatingEl();if(!this._triggerEl||!e)return;this._cleanupPositioning();let t={top:"bottom",right:"left",bottom:"top",left:"right"},r=async()=>{let n=this._getFloatingEl(),s=this._getArrowEl();if(!this._triggerEl||!n)return;let{x:d,y:h,placement:p,middlewareData:f}=await(0,Co.computePosition)(this._triggerEl,n,{strategy:"fixed",placement:this.placement,middleware:[(0,Co.offset)(this.offsetDistance),...this.autoFlip?[(0,Co.flip)({padding:8})]:[],...this.autoShift?[(0,Co.shift)({padding:8})]:[],(0,Co.size)({padding:8,apply:({rects:C,availableWidth:S,availableHeight:z,elements:T})=>{let P=Math.max(160,Math.min(S,Number.isFinite(this.maxWidth)?Number(this.maxWidth):S)),H=Math.max(120,Math.min(z,Number.isFinite(this.maxHeight)?Number(this.maxHeight):z));Object.assign(T.floating.style,{maxWidth:`${P}px`,maxHeight:`${H}px`,minWidth:this.sameWidth?`${C.reference.width}px`:""})}}),...this.showArrow&&s?[(0,Co.arrow)({element:s,padding:10})]:[]]}),x=this._getFloatingEl();if(!x)return;Object.assign(x.style,{left:`${d}px`,top:`${h}px`});let k=p.split("-")[0];if(x.dataset.side=k,this.setAttribute("data-placement",p),this.portal&&this._portalHost&&(this._portalHost.toggleAttribute("open",this.open),this._portalHost.toggleAttribute("interactive",this.interactive),this._portalHost.setAttribute("data-side",k)),this.showArrow&&s){let{x:C,y:S}=f.arrow??{};s.style.left="",s.style.top="",s.style.right="",s.style.bottom="",C!=null&&(s.style.left=`${C}px`),S!=null&&(s.style.top=`${S}px`),s.style.setProperty(t[k]??"top","-6px")}};this._cleanupAutoUpdate=(0,Co.autoUpdate)(this._triggerEl,e,r),r()}render(){return this.portal?mi.html`
1408
+ `,te=class extends mi.LitElement{constructor(){super(...arguments);this.open=!1;this.placement="bottom";this.trigger="click";this.disabled=!1;this.interactive=!0;this.showArrow=!0;this.closeOnOutsidePress=!0;this.closeOnEsc=!0;this.openDelay=80;this.closeDelay=100;this.offsetDistance=8;this.autoFlip=!0;this.autoShift=!0;this.sameWidth=!1;this.backdrop="none";this.backdropStyle="";this.portal=!1;this.overlayLayer="popup";this._hasHeader=!1;this._hasFooter=!1;this._cleanupAutoUpdate=null;this._openTimer=null;this._closeTimer=null;this._triggerHovered=!1;this._contentHovered=!1;this._triggerFocused=!1;this._contentFocused=!1;this._portalHost=null;this._portalBackdropEl=null;this._portalContentEl=null;this._portalArrowEl=null;this._portalHeaderEl=null;this._portalBodyEl=null;this._portalFooterEl=null;this._portalLayerEl=null;this._portalDestroyTimer=null;this._portaledNodes=new Map;this._hoverBridgeCleanup=null;this._lastPointer=null;this._lastTriggerPointerDownAt=0;this._suppressTriggerFocusUntilBlur=!1;this._suppressOutsidePressUntil=0;this._onTriggerPointerDown=()=>{this._lastTriggerPointerDownAt=Date.now(),this._hasTrigger("focus")&&(this._suppressTriggerFocusUntilBlur=!0,this._triggerFocused=!1)};this._onTriggerClick=e=>{if(this._hasTrigger("click")){e.stopPropagation(),this.toggle();return}this.open&&this._suppressTriggerFocusUntilBlur&&(this._hasTrigger("hover")||this._hasTrigger("focus"))&&(this._triggerHovered=!1,this._triggerFocused=!1,this._contentHovered=!1,this._contentFocused=!1,this._cleanupHoverBridge(),this.hide())};this._onTriggerMouseEnter=e=>{this._hasTrigger("hover")&&(this._lastPointer={x:e.clientX,y:e.clientY},this._triggerHovered=!0,this._scheduleShow())};this._onTriggerMouseLeave=e=>{if(!this._hasTrigger("hover"))return;let t=e.relatedTarget;this._triggerHovered=!1,this._suppressTriggerFocusUntilBlur&&(this._triggerFocused=!1),!(this.interactive&&this._isInsideFloating(t))&&(this._startHoverBridge(e)||this._scheduleHide())};this._onContentMouseEnter=e=>{this.interactive&&this._hasTrigger("hover")&&(this._lastPointer={x:e.clientX,y:e.clientY},this._contentHovered=!0,this._clearCloseTimer())};this._onContentMouseLeave=e=>{if(!this.interactive||!this._hasTrigger("hover"))return;let t=e.relatedTarget;this._contentHovered=!1,!this._isInsideTrigger(t)&&(this._startHoverBridge(e)||this._scheduleHide())};this._onTriggerFocusIn=()=>{if(this._hasTrigger("focus")){if(this._suppressTriggerFocusUntilBlur){this._triggerFocused=!1;return}if(Date.now()-this._lastTriggerPointerDownAt<500){this._triggerFocused=!1;return}this._triggerFocused=!0,this._scheduleShow()}};this._onTriggerFocusOut=e=>{if(!this._hasTrigger("focus"))return;let t=e.relatedTarget;this._isInsideTrigger(t)||this._isInsideFloating(t)||(this._suppressTriggerFocusUntilBlur=!1,this._triggerFocused=!1,this._scheduleHide())};this._onContentFocusIn=()=>{this.interactive&&(this._contentFocused=!0,this._clearCloseTimer())};this._onContentFocusOut=e=>{if(!this.interactive)return;let t=e.relatedTarget;this._isInsideTrigger(t)||this._isInsideFloating(t)||(this._contentFocused=!1,this._scheduleHide())};this._onDocumentMouseMove=e=>{this._lastPointer={x:e.clientX,y:e.clientY}};this._onBackdropClick=e=>{e.stopPropagation(),!(Date.now()<this._suppressOutsidePressUntil||es(this)||!this._emitOutsidePress(e)||!this.closeOnOutsidePress)&&this.hide()};this._onContentClick=e=>{Ja(this),e.stopPropagation()};this._onDocumentPointerDown=e=>{if(!this.open)return;let t=e.composedPath(),r=this._portalHost?t.includes(this._portalHost):!1;if(Cn(t,this)){this._suppressOutsidePressUntil=Date.now()+320;return}if(!t.includes(this)&&!r){if(!this._emitOutsidePress(e)||!this.closeOnOutsidePress)return;this._cleanupHoverBridge(),this.hide()}};this._onDocumentKeydown=e=>{!this.open||!this.closeOnEsc||e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this.hide())}}connectedCallback(){super.connectedCallback(),document.addEventListener("mousedown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeydown),document.addEventListener("mousemove",this._onDocumentMouseMove,!0)}disconnectedCallback(){super.disconnectedCallback(),this._clearTimers(),this._clearPortalDestroyTimer(),this._cleanupPositioning(),this._destroyPortal(),this._cleanupHoverBridge(),document.removeEventListener("mousedown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeydown),document.removeEventListener("mousemove",this._onDocumentMouseMove,!0)}updated(e){let t=e.has("portal")||e.has("container")||e.has("overlayLayer");e.has("interactive")&&this._portalHost&&this._portalContentEl&&(this._portalContentEl.classList.toggle("interactive",this.interactive),this._portalHost.toggleAttribute("interactive",this.interactive)),(e.has("backdrop")||e.has("backdropStyle"))&&this._portalHost&&this._syncPortalBackdrop(),t&&this._portalHost&&this._destroyPortal(),(t||e.has("open")||e.has("placement")||e.has("offsetDistance")||e.has("showArrow")||e.has("autoFlip")||e.has("autoShift"))&&(this.open?this.updateComplete.then(()=>{this.portal&&(this._ensurePortal(),this._syncPortalNodes()),this._setupPositioning()}):(this._cleanupPositioning(),this._cleanupHoverBridge(),this._contentHovered=!1,this._contentFocused=!1,this.portal&&(this._portalHost?.toggleAttribute("open",!1),this._portalHost?.toggleAttribute("interactive",this.interactive),this._schedulePortalDestroy()))),this.portal&&this.open&&this.updateComplete.then(()=>this._syncPortalNodes())}show(){this.disabled||this.open||(this._clearCloseTimer(),this._clearPortalDestroyTimer(),this.portal&&(this._ensurePortal(),this._syncPortalNodes(),this._portalHost&&Et(this._portalHost),this._portalContentEl?.classList.toggle("interactive",this.interactive),this._portalHost?.toggleAttribute("interactive",this.interactive)),this.open=!0,this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})))}hide(){this.open&&(this._clearOpenTimer(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}toggle(){this.open?this.hide():this.show()}_clearOpenTimer(){this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=null)}_clearCloseTimer(){this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null)}_clearTimers(){this._clearOpenTimer(),this._clearCloseTimer()}_clearPortalDestroyTimer(){this._portalDestroyTimer&&(clearTimeout(this._portalDestroyTimer),this._portalDestroyTimer=null)}_schedulePortalDestroy(){this._clearPortalDestroyTimer(),this._portalDestroyTimer=setTimeout(()=>{this._portalDestroyTimer=null,this.open||this._destroyPortal()},160)}_cleanupHoverBridge(){this._hoverBridgeCleanup&&(this._hoverBridgeCleanup(),this._hoverBridgeCleanup=null)}_hasTrigger(e){return this.trigger.split(/\s+/).map(t=>t.trim()).filter(Boolean).includes(e)}_scheduleShow(){if(this.disabled)return;this._clearCloseTimer(),this._clearOpenTimer();let e=Math.max(0,this.openDelay||0);this._openTimer=setTimeout(()=>{this._openTimer=null,this.show()},e)}_scheduleHide(){this._clearOpenTimer(),this._clearCloseTimer();let e=Math.max(0,this.closeDelay||0);this._closeTimer=setTimeout(()=>{this._closeTimer=null,this._refreshHoverStateFromPointer(),!(this._triggerHovered||this._triggerFocused)&&(this.interactive&&(this._contentHovered||this._contentFocused)||this.hide())},e)}_containsDeep(e,t){if(!e||!t)return!1;let r=t;for(let n=0;r&&n<64;n+=1){if(r===e||r.nodeType===Node.ELEMENT_NODE&&e.contains(r))return!0;let s=r.assignedSlot??null;if(s){r=s;continue}let d=r.parentNode;if(d&&d.nodeType===Node.DOCUMENT_FRAGMENT_NODE){r=d.host??null;continue}r=d}return!1}_isInsideTrigger(e){return this._containsDeep(this._triggerEl,e)}_isInsideFloating(e){return this._containsDeep(this._getFloatingEl(),e)}_pointInRect(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}_createBridgeRect(e,t,r=16){return{left:Math.min(e.left,t.left)-r,top:Math.min(e.top,t.top)-r,right:Math.max(e.right,t.right)+r,bottom:Math.max(e.bottom,t.bottom)+r}}_deepElementFromPoint(e,t){if(typeof document.elementFromPoint!="function")return null;let r=null;try{r=document.elementFromPoint(e,t);for(let n=0;n<32;n+=1){let s=r?.shadowRoot?.elementFromPoint(e,t);if(!s||s===r)break;r=s}}catch{return null}return r}_refreshHoverStateFromPointer(){if(!this._lastPointer)return!1;let{x:e,y:t}=this._lastPointer,n=this._portalHost?.shadowRoot?.elementFromPoint(e,t)??this._deepElementFromPoint(e,t),s=this._isInsideTrigger(n),d=this._isInsideFloating(n);return this._triggerHovered=s,this._contentHovered=this.interactive&&d,s||d}_pointInTriangle(e,t,r,n){let s=(x,k,C)=>(x.x*(k.y-C.y)+k.x*(C.y-x.y)+C.x*(x.y-k.y))/2,d=Math.abs(s(t,r,n)),h=Math.abs(s(e,t,r)),p=Math.abs(s(e,r,n)),f=Math.abs(s(e,n,t));return Math.abs(d-(h+p+f))<.5}_startHoverBridge(e){if(!this.open||!this.interactive||!this._hasTrigger("hover"))return!1;this.portal&&(this._ensurePortal(),this._syncPortalNodes());let t=e.currentTarget,r=this._getFloatingEl(),n=this._triggerEl??null;if(!t||!r||!n)return!1;let s=t===n?r:n,d=r.dataset.side||this.getAttribute("data-placement")?.split("-")[0]||this.placement.split("-")[0],h=t.getBoundingClientRect(),p=s.getBoundingClientRect(),f={x:e.clientX,y:e.clientY},x=this._createBridgeRect(h,p),k=14,C=null;if(d==="right"?C=[f,{x:p.left,y:p.top-k},{x:p.left,y:p.bottom+k}]:d==="left"?C=[f,{x:p.right,y:p.top-k},{x:p.right,y:p.bottom+k}]:d==="bottom"?C=[f,{x:p.left-k,y:p.top},{x:p.right+k,y:p.top}]:d==="top"&&(C=[f,{x:p.left-k,y:p.bottom},{x:p.right+k,y:p.bottom}]),!C)return!1;this._cleanupHoverBridge(),this._clearCloseTimer();let S=0,z=()=>{S&&clearTimeout(S),S=window.setTimeout(P,900)},T=H=>{this._lastPointer={x:H.clientX,y:H.clientY};let I=H.composedPath?.()[0]??H.target;if(this._isInsideTrigger(I)||this._isInsideFloating(I)){this._refreshHoverStateFromPointer(),this._cleanupHoverBridge();return}let B=this._lastPointer;if(B&&(this._pointInRect(B,x)||this._pointInTriangle(B,C[0],C[1],C[2]))){z();return}this._cleanupHoverBridge(),this._scheduleHide()},P=()=>{if(this._cleanupHoverBridge(),this._refreshHoverStateFromPointer()){this._clearCloseTimer();return}this._scheduleHide()};return z(),document.addEventListener("mousemove",T,!0),this._hoverBridgeCleanup=()=>{clearTimeout(S),document.removeEventListener("mousemove",T,!0),this._hoverBridgeCleanup=null},!0}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_syncNamedSlot(e,t){let n=e.target.assignedNodes({flatten:!0}).some(s=>s.nodeType!==Node.TEXT_NODE||s.textContent?.trim());t==="header"?this._hasHeader=n:this._hasFooter=n}_cleanupPositioning(){this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=null)}get portalHostElement(){return this._portalHost}get portalFloatingElement(){return this._portalContentEl}refreshFloatingPosition(){this._setupPositioning()}_getFloatingEl(){return this.portal?this._portalContentEl:this._contentEl??null}_getArrowEl(){return this.portal?this._portalArrowEl:this._arrowEl??null}_resolvePortalMountTarget(){return Js(this.overlayLayer,this.container??sn(this)??ln(this))}_adoptPortalStyles(e){if(!("adoptedStyleSheets"in e))return;let t=[...this.renderRoot.adoptedStyleSheets??[],...this.portalStyleSources??[]];if(t.length===0)return;let r=[...e.adoptedStyleSheets??[]];for(let n of t)r.includes(n)||r.push(n);e.adoptedStyleSheets=r}_ensurePortal(){if(this._clearPortalDestroyTimer(),this._portalHost)return;let e=this._resolvePortalMountTarget(),t=document.createElement("div"),r=t.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=vm,this._adoptPortalStyles(r);let s=document.createElement("div");s.setAttribute("part","content"),this.interactive&&s.classList.add("interactive");let d=document.createElement("div");d.setAttribute("part","surface");let h=document.createElement("div");h.setAttribute("part","header"),h.hidden=!this._hasHeader;let p=document.createElement("div");p.setAttribute("part","backdrop"),p.addEventListener("click",this._onBackdropClick);let f=document.createElement("div");f.setAttribute("part","body"),this._syncBodyDensity(f,this._hasHeader,this._hasFooter);let x=document.createElement("div");x.setAttribute("part","footer"),x.hidden=!this._hasFooter,d.append(h,f,x),s.appendChild(d);let k=null;if(this.showArrow){k=document.createElement("div"),k.setAttribute("part","arrow");let C=document.createElement("div");C.setAttribute("part","arrow-fill"),k.appendChild(C),s.appendChild(k)}s.addEventListener("mouseenter",this._onContentMouseEnter),s.addEventListener("mouseleave",this._onContentMouseLeave),s.addEventListener("focusin",this._onContentFocusIn),s.addEventListener("focusout",this._onContentFocusOut),s.addEventListener("click",this._onContentClick),r.append(n,p,s),e.appendChild(t),Cc(t,this),Jt(t,e,this.overlayLayer),this._portalHost=t,this._portalBackdropEl=p,this._portalContentEl=s,this._portalArrowEl=k,this._portalHeaderEl=h,this._portalBodyEl=f,this._portalFooterEl=x,this._portalLayerEl=e,this._syncPortalBackdrop(),this._syncPortalCssVars()}_moveSlotElements(e,t){if(!e||!t)return;let r=e.assignedElements({flatten:!0});for(let n of r){if(!this._portaledNodes.has(n)){let s=document.createComment("lui-popover-portal");n.parentNode?.insertBefore(s,n),this._portaledNodes.set(n,{node:n,placeholder:s})}n.parentNode!==t&&t.appendChild(n)}}_syncPortalCssVars(){if(!this._portalHost)return;let e=getComputedStyle(this),t=this._portalHost.style;for(let r of[...Nu,...te.PORTAL_OWN_VARS]){let n=e.getPropertyValue(r).trim();n?t.setProperty(r,n):t.removeProperty(r)}}_syncPortalBackdrop(){!this._portalHost||!this._portalBackdropEl||(this._portalHost.setAttribute("backdrop",this.backdrop),this._portalBackdropEl.hidden=this.backdrop==="none",this._portalBackdropEl.style.cssText=this.backdropStyle||"")}_syncPortalNodes(){if(!this.portal||!this._portalHost)return;this._syncPortalBackdrop(),this._syncPortalCssVars(),this._moveSlotElements(this._backdropSlot,this._portalBackdropEl);let e=!!this._headerSlot?.assignedElements({flatten:!0}).length,t=!!this._footerSlot?.assignedElements({flatten:!0}).length;this._portalHeaderEl.hidden=!e,this._portalFooterEl.hidden=!t,this._syncBodyDensity(this._portalBodyEl,e,t),this._moveSlotElements(this._headerSlot,this._portalHeaderEl),this._moveSlotElements(this._bodySlot,this._portalBodyEl),this._moveSlotElements(this._footerSlot,this._portalFooterEl)}_syncBodyDensity(e,t,r){if(!e)return;let n=!t&&!r;e.toggleAttribute("data-compact",n)}_restorePortaledNodes(){for(let{node:e,placeholder:t}of this._portaledNodes.values())t.parentNode?.insertBefore(e,t),t.remove();this._portaledNodes.clear()}_destroyPortal(){this._clearPortalDestroyTimer(),this._portalHost&&(this._cleanupPositioning(),this._restorePortaledNodes(),this._portalBackdropEl?.removeEventListener("click",this._onBackdropClick),this._portalContentEl?.removeEventListener("click",this._onContentClick),this._portalContentEl?.removeEventListener("mouseenter",this._onContentMouseEnter),this._portalContentEl?.removeEventListener("mouseleave",this._onContentMouseLeave),this._portalContentEl?.removeEventListener("focusin",this._onContentFocusIn),this._portalContentEl?.removeEventListener("focusout",this._onContentFocusOut),Xo(this._portalHost),this._portalHost.remove(),this._portalHost=null,this._portalBackdropEl=null,this._portalContentEl=null,this._portalArrowEl=null,this._portalHeaderEl=null,this._portalBodyEl=null,this._portalFooterEl=null,this._portalLayerEl=null)}_setupPositioning(){let e=this._getFloatingEl();if(!this._triggerEl||!e)return;this._cleanupPositioning();let t={top:"bottom",right:"left",bottom:"top",left:"right"},r=async()=>{let n=this._getFloatingEl(),s=this._getArrowEl();if(!this._triggerEl||!n)return;let{x:d,y:h,placement:p,middlewareData:f}=await(0,Co.computePosition)(this._triggerEl,n,{strategy:"fixed",placement:this.placement,middleware:[(0,Co.offset)(this.offsetDistance),...this.autoFlip?[(0,Co.flip)({padding:8})]:[],...this.autoShift?[(0,Co.shift)({padding:8})]:[],(0,Co.size)({padding:8,apply:({rects:C,availableWidth:S,availableHeight:z,elements:T})=>{let P=Math.max(160,Math.min(S,Number.isFinite(this.maxWidth)?Number(this.maxWidth):S)),H=Math.max(120,Math.min(z,Number.isFinite(this.maxHeight)?Number(this.maxHeight):z));Object.assign(T.floating.style,{maxWidth:`${P}px`,maxHeight:`${H}px`,minWidth:this.sameWidth?`${C.reference.width}px`:""})}}),...this.showArrow&&s?[(0,Co.arrow)({element:s,padding:10})]:[]]}),x=this._getFloatingEl();if(!x)return;Object.assign(x.style,{left:`${d}px`,top:`${h}px`});let k=p.split("-")[0];if(x.dataset.side=k,this.setAttribute("data-placement",p),this.portal&&this._portalHost&&(this._portalHost.toggleAttribute("open",this.open),this._portalHost.toggleAttribute("interactive",this.interactive),this._portalHost.setAttribute("data-side",k)),this.showArrow&&s){let{x:C,y:S}=f.arrow??{};s.style.left="",s.style.top="",s.style.right="",s.style.bottom="",C!=null&&(s.style.left=`${C}px`),S!=null&&(s.style.top=`${S}px`),s.style.setProperty(t[k]??"top","-6px")}};this._cleanupAutoUpdate=(0,Co.autoUpdate)(this._triggerEl,e,r),r()}render(){return this.portal?mi.html`
1409
1409
  <span
1410
1410
  part="trigger"
1411
1411
  @pointerdown=${this._onTriggerPointerDown}
@@ -1760,7 +1760,7 @@
1760
1760
  min-width: var(--lui-menu-min-width, 200px);
1761
1761
  max-width: var(--lui-menu-max-width, 320px);
1762
1762
  }
1763
- `],a([(0,os.property)({reflect:!0})],Fi.prototype,"placement",2),a([(0,os.property)({type:Boolean,attribute:"close-on-select"})],Fi.prototype,"closeOnSelect",2),Fi=a([(0,os.customElement)("lui-dropdown")],Fi);var Zo=require("lit"),Li=require("lit/decorators.js");var gr=require("lit"),Kr=require("lit/decorators.js");var er=class extends gr.LitElement{constructor(){super(...arguments);this.disabled=!1;this.danger=!1;this.checked=!1;this.active=!1;this.label="";this.icon="";this.shortcut="";this.shortcutIcon="";this.suffix="";this.selectable=!0;this.hasChildren=!1;this._onHostClick=e=>{if(this.disabled){e.stopPropagation();return}this.selectable&&this._emitSelect(e)};this._onKey=e=>{this.disabled||!this.selectable||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),this._emitSelect(e))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onHostClick),this.addEventListener("keydown",this._onKey),this._syncA11y()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onHostClick),this.removeEventListener("keydown",this._onKey)}updated(e){this._syncA11y()}_syncA11y(){if(this.setAttribute("role",this.checked?"menuitemcheckbox":"menuitem"),this.checked?this.setAttribute("aria-checked","true"):this.removeAttribute("aria-checked"),this.active?this.setAttribute("aria-current","true"):this.removeAttribute("aria-current"),this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.disabled){this.tabIndex=-1;return}!this.closest("lui-menu")&&this.tabIndex<0&&(this.tabIndex=0)}_emitSelect(e){this.dispatchEvent(new CustomEvent("select",{detail:{value:this.value,label:this.label,originalEvent:e,item:this},bubbles:!0,composed:!0}))}_renderLabel(){return this.label?this.label:gr.html`<slot></slot>`}_hasNamedSlot(e){return Array.from(this.children).some(t=>t.getAttribute("slot")===e)}_renderResolvedIcon(){return this.checked?gr.html`<lui-icon name="check"></lui-icon>`:this.icon?gr.html`<lui-icon name=${this.icon}></lui-icon>`:gr.nothing}_renderIcon(){let e=this._hasNamedSlot("icon")||this._hasNamedSlot("prefix");return gr.html`
1763
+ `],a([(0,os.property)({reflect:!0})],Fi.prototype,"placement",2),a([(0,os.property)({type:Boolean,attribute:"close-on-select"})],Fi.prototype,"closeOnSelect",2),Fi=a([(0,os.customElement)("lui-dropdown")],Fi);var Qo=require("lit"),Li=require("lit/decorators.js");var gr=require("lit"),Kr=require("lit/decorators.js");var er=class extends gr.LitElement{constructor(){super(...arguments);this.disabled=!1;this.danger=!1;this.checked=!1;this.active=!1;this.label="";this.icon="";this.shortcut="";this.shortcutIcon="";this.suffix="";this.selectable=!0;this.hasChildren=!1;this._onHostClick=e=>{if(this.disabled){e.stopPropagation();return}this.selectable&&this._emitSelect(e)};this._onKey=e=>{this.disabled||!this.selectable||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),this._emitSelect(e))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onHostClick),this.addEventListener("keydown",this._onKey),this._syncA11y()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onHostClick),this.removeEventListener("keydown",this._onKey)}updated(e){this._syncA11y()}_syncA11y(){if(this.setAttribute("role",this.checked?"menuitemcheckbox":"menuitem"),this.checked?this.setAttribute("aria-checked","true"):this.removeAttribute("aria-checked"),this.active?this.setAttribute("aria-current","true"):this.removeAttribute("aria-current"),this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.disabled){this.tabIndex=-1;return}!this.closest("lui-menu")&&this.tabIndex<0&&(this.tabIndex=0)}_emitSelect(e){this.dispatchEvent(new CustomEvent("select",{detail:{value:this.value,label:this.label,originalEvent:e,item:this},bubbles:!0,composed:!0}))}_renderLabel(){return this.label?this.label:gr.html`<slot></slot>`}_hasNamedSlot(e){return Array.from(this.children).some(t=>t.getAttribute("slot")===e)}_renderResolvedIcon(){return this.checked?gr.html`<lui-icon name="check"></lui-icon>`:this.icon?gr.html`<lui-icon name=${this.icon}></lui-icon>`:gr.nothing}_renderIcon(){let e=this._hasNamedSlot("icon")||this._hasNamedSlot("prefix");return gr.html`
1764
1764
  <span part="icon">
1765
1765
  <slot name="icon"></slot>
1766
1766
  <slot name="prefix"></slot>
@@ -1883,7 +1883,7 @@
1883
1883
  margin: var(--lui-menu-divider-margin, 4px 0);
1884
1884
  background: var(--lui-menu-divider-color, var(--lui-color-border));
1885
1885
  }
1886
- `],En=a([(0,Vh.customElement)("lui-menu-divider")],En);var Xo=class extends Zo.LitElement{constructor(){super(...arguments);this.items=[];this.multiple=!1;this.selectable=!1;this._activeIndex=0;this._onFocusIn=e=>{let t=this._collectNavigableItems(),r=this._findItemFromPath(e.composedPath(),t);r&&this._syncTabStops(r)};this._onKey=e=>{let t=this._collectNavigableItems();if(!t.length)return;let r=this._findItemFromPath(e.composedPath(),t),n=r?t.indexOf(r):-1;e.key==="ArrowDown"?(e.preventDefault(),this._focusItem(n<0?0:n+1)):e.key==="ArrowUp"?(e.preventDefault(),this._focusItem(n<0?t.length-1:n-1)):e.key==="Home"?(e.preventDefault(),this._focusItem(0)):e.key==="End"&&(e.preventDefault(),this._focusItem(t.length-1))};this._onDataSelect=e=>{if(!this._isDataDriven)return;e.stopPropagation();let t=this._resolveDataPath(e.target),r=Qn(this._normalizedItems,t);!r||!Qa(r)||this._emitDataSelect(r,t,e.detail?.originalEvent??e)}}get _normalizedItems(){return Za(this.items)}get _isDataDriven(){return this.items.length>0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu"),this.setAttribute("aria-orientation","vertical"),this.addEventListener("keydown",this._onKey),this.addEventListener("focusin",this._onFocusIn),queueMicrotask(()=>this._syncTabStops())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._onKey),this.removeEventListener("focusin",this._onFocusIn)}_getItems(){let e=this._slotEl?.assignedElements({flatten:!1})??[],t=[];for(let r of e)if(r instanceof HTMLElement){if(r.matches("lui-menu-item")&&!r.hasAttribute("disabled")){t.push(r);continue}if(r.matches("lui-dropdown")||r.matches("lui-context-menu")){let n=r.querySelector('[data-menu-submenu-trigger]:not([aria-disabled="true"])');n&&t.push(n)}}return t}_getDataItems(){return Array.from(this.renderRoot.querySelectorAll("[data-menu-item]")).filter(e=>e.getAttribute("aria-disabled")!=="true")}_collectNavigableItems(){return this._isDataDriven?this._getDataItems():this._getItems()}_findItemFromPath(e,t){return e.find(n=>n instanceof HTMLElement&&t.includes(n))??null}_syncTabStops(e){let t=this._collectNavigableItems();if(!t.length){this._activeIndex=0;return}let r=-1;if(e&&(r=t.indexOf(e)),r<0){let n=t[this._activeIndex];r=n?t.indexOf(n):-1}r<0&&(r=0),this._activeIndex=r,t.forEach((n,s)=>{n.tabIndex=s===r?0:-1})}openSubmenu(e=[]){this.dispatchEvent(new CustomEvent("open-submenu",{detail:{path:e},bubbles:!0,composed:!0}))}closeSubmenu(e=[]){this.dispatchEvent(new CustomEvent("close-submenu",{detail:{path:e},bubbles:!0,composed:!0}))}focusFirst(){this._focusItem(0)}focusLast(){let e=this._collectNavigableItems();this._focusItem(e.length-1)}focusNext(){this._focusItem(this._activeIndex+1)}focusPrev(){this._focusItem(this._activeIndex-1)}_focusItem(e){let t=this._collectNavigableItems();if(!t.length)return;let r=Math.max(0,Math.min(t.length-1,e)),n=t[r];this._syncTabStops(n),n?.focus()}_emitDataSelect(e,t,r){let n={key:e.key,value:e.value??e.key,item:e.raw??e,path:t,source:"api",triggerEvent:r};this.dispatchEvent(new CustomEvent("select",{detail:n,bubbles:!0,composed:!0})),e.onSelect?.(n)}_resolveDataPath(e){return e instanceof HTMLElement?(e.getAttribute("data-menu-path")??"").split(".").filter(Boolean).map(t=>Number(t)).filter(t=>Number.isInteger(t)&&t>=0):[]}_renderMenuDivider(){return Zo.html`<lui-menu-divider></lui-menu-divider>`}_renderMenuGroup(e){return Zo.html`<div part="group">${e.label??""}</div>`}_renderMenuItem(e,t){let r=!e.children?.length;return Zo.html`
1886
+ `],En=a([(0,Vh.customElement)("lui-menu-divider")],En);var Zo=class extends Qo.LitElement{constructor(){super(...arguments);this.items=[];this.multiple=!1;this.selectable=!1;this._activeIndex=0;this._onFocusIn=e=>{let t=this._collectNavigableItems(),r=this._findItemFromPath(e.composedPath(),t);r&&this._syncTabStops(r)};this._onKey=e=>{let t=this._collectNavigableItems();if(!t.length)return;let r=this._findItemFromPath(e.composedPath(),t),n=r?t.indexOf(r):-1;e.key==="ArrowDown"?(e.preventDefault(),this._focusItem(n<0?0:n+1)):e.key==="ArrowUp"?(e.preventDefault(),this._focusItem(n<0?t.length-1:n-1)):e.key==="Home"?(e.preventDefault(),this._focusItem(0)):e.key==="End"&&(e.preventDefault(),this._focusItem(t.length-1))};this._onDataSelect=e=>{if(!this._isDataDriven)return;e.stopPropagation();let t=this._resolveDataPath(e.target),r=Qn(this._normalizedItems,t);!r||!Qa(r)||this._emitDataSelect(r,t,e.detail?.originalEvent??e)}}get _normalizedItems(){return Za(this.items)}get _isDataDriven(){return this.items.length>0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu"),this.setAttribute("aria-orientation","vertical"),this.addEventListener("keydown",this._onKey),this.addEventListener("focusin",this._onFocusIn),queueMicrotask(()=>this._syncTabStops())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._onKey),this.removeEventListener("focusin",this._onFocusIn)}_getItems(){let e=this._slotEl?.assignedElements({flatten:!1})??[],t=[];for(let r of e)if(r instanceof HTMLElement){if(r.matches("lui-menu-item")&&!r.hasAttribute("disabled")){t.push(r);continue}if(r.matches("lui-dropdown")||r.matches("lui-context-menu")){let n=r.querySelector('[data-menu-submenu-trigger]:not([aria-disabled="true"])');n&&t.push(n)}}return t}_getDataItems(){return Array.from(this.renderRoot.querySelectorAll("[data-menu-item]")).filter(e=>e.getAttribute("aria-disabled")!=="true")}_collectNavigableItems(){return this._isDataDriven?this._getDataItems():this._getItems()}_findItemFromPath(e,t){return e.find(n=>n instanceof HTMLElement&&t.includes(n))??null}_syncTabStops(e){let t=this._collectNavigableItems();if(!t.length){this._activeIndex=0;return}let r=-1;if(e&&(r=t.indexOf(e)),r<0){let n=t[this._activeIndex];r=n?t.indexOf(n):-1}r<0&&(r=0),this._activeIndex=r,t.forEach((n,s)=>{n.tabIndex=s===r?0:-1})}openSubmenu(e=[]){this.dispatchEvent(new CustomEvent("open-submenu",{detail:{path:e},bubbles:!0,composed:!0}))}closeSubmenu(e=[]){this.dispatchEvent(new CustomEvent("close-submenu",{detail:{path:e},bubbles:!0,composed:!0}))}focusFirst(){this._focusItem(0)}focusLast(){let e=this._collectNavigableItems();this._focusItem(e.length-1)}focusNext(){this._focusItem(this._activeIndex+1)}focusPrev(){this._focusItem(this._activeIndex-1)}_focusItem(e){let t=this._collectNavigableItems();if(!t.length)return;let r=Math.max(0,Math.min(t.length-1,e)),n=t[r];this._syncTabStops(n),n?.focus()}_emitDataSelect(e,t,r){let n={key:e.key,value:e.value??e.key,item:e.raw??e,path:t,source:"api",triggerEvent:r};this.dispatchEvent(new CustomEvent("select",{detail:n,bubbles:!0,composed:!0})),e.onSelect?.(n)}_resolveDataPath(e){return e instanceof HTMLElement?(e.getAttribute("data-menu-path")??"").split(".").filter(Boolean).map(t=>Number(t)).filter(t=>Number.isInteger(t)&&t>=0):[]}_renderMenuDivider(){return Qo.html`<lui-menu-divider></lui-menu-divider>`}_renderMenuGroup(e){return Qo.html`<div part="group">${e.label??""}</div>`}_renderMenuItem(e,t){let r=!e.children?.length;return Qo.html`
1887
1887
  <lui-menu-item
1888
1888
  data-menu-item
1889
1889
  data-menu-path=${t.join(".")}
@@ -1899,13 +1899,13 @@
1899
1899
  ?checked=${e.checked??!1}
1900
1900
  ?active=${e.active??!1}
1901
1901
  .selectable=${e.selectable??r}
1902
- @click=${r?Zo.nothing:n=>this._onDataTriggerClick(e,t,n)}
1902
+ @click=${r?Qo.nothing:n=>this._onDataTriggerClick(e,t,n)}
1903
1903
  ></lui-menu-item>
1904
- `}_renderDataNode(e,t){return e.type==="divider"?this._renderMenuDivider():e.type==="group"?this._renderMenuGroup(e):this._renderMenuItem(e,t)}_onDataTriggerClick(e,t,r){e.children?.length&&this.dispatchEvent(new CustomEvent("open-submenu",{detail:{path:t,item:e.raw??e,triggerEvent:r},bubbles:!0,composed:!0}))}render(){return Zo.html`
1904
+ `}_renderDataNode(e,t){return e.type==="divider"?this._renderMenuDivider():e.type==="group"?this._renderMenuGroup(e):this._renderMenuItem(e,t)}_onDataTriggerClick(e,t,r){e.children?.length&&this.dispatchEvent(new CustomEvent("open-submenu",{detail:{path:t,item:e.raw??e,triggerEvent:r},bubbles:!0,composed:!0}))}render(){return Qo.html`
1905
1905
  <div part="menu" @select=${this._onDataSelect}>
1906
- ${this._isDataDriven?this._normalizedItems.map((e,t)=>this._renderDataNode(e,[t])):Zo.html`<slot @slotchange=${()=>this._syncTabStops()}></slot>`}
1906
+ ${this._isDataDriven?this._normalizedItems.map((e,t)=>this._renderDataNode(e,[t])):Qo.html`<slot @slotchange=${()=>this._syncTabStops()}></slot>`}
1907
1907
  </div>
1908
- `}};Xo.styles=[A,j,Zo.css`
1908
+ `}};Zo.styles=[A,j,Qo.css`
1909
1909
  :host {
1910
1910
  display: block;
1911
1911
  width: var(--lui-menu-width, auto);
@@ -1928,7 +1928,7 @@
1928
1928
  text-transform: uppercase;
1929
1929
  user-select: none;
1930
1930
  }
1931
- `],a([(0,Li.property)({attribute:!1})],Xo.prototype,"items",2),a([(0,Li.property)()],Xo.prototype,"value",2),a([(0,Li.property)({type:Boolean})],Xo.prototype,"multiple",2),a([(0,Li.property)({type:Boolean})],Xo.prototype,"selectable",2),a([(0,Li.query)("slot")],Xo.prototype,"_slotEl",2),Xo=a([(0,Li.customElement)("lui-menu")],Xo);var bm=0;function Ec(i){return i.join(".")}function ym(i){return i?i.split(".").map(o=>Number(o)).filter(o=>Number.isInteger(o)&&o>=0):[]}var Se=class extends Wr.LitElement{constructor(){super(...arguments);this.items=[];this.placement="bottom-start";this.trigger="click";this.disabled=!1;this.heading="";this.headingIcon="";this.showArrow=!1;this.closeOnOutsidePress=!0;this.closeOnEsc=!0;this.open=!1;this.openDelay=0;this.closeDelay=120;this.offsetDistance=6;this.backdrop="none";this.backdropStyle="";this.portal=!1;this.sameWidth=!1;this.dropdownProps={};this.menuProps={};this.submenuTrigger="hover";this._submenuPlacements={};this._uid=++bm;this._onMenuEscape=e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this._closeAllMenus(!0))};this._onSubmenuTriggerKeydown=e=>{let t=e.currentTarget;if(e.key==="Escape"){this._onMenuEscape(e);return}if(t.getAttribute("aria-disabled")!=="true"){if(e.key==="ArrowRight"||e.key==="Enter"||e.key===" "){e.preventDefault(),this._openSubmenuFromTrigger(t);return}e.key==="ArrowLeft"&&(e.preventDefault(),this._closeSubmenuFromElement(t))}};this._onSubmenuMenuKeydown=e=>{if(e.key==="Escape"){this._onMenuEscape(e);return}if(e.key!=="ArrowLeft")return;let t=e.currentTarget;e.preventDefault(),this._closeSubmenuFromElement(t)};this._onSelect=e=>{e.stopPropagation();let t=this._readPathFromEvent(e),r=Qn(this._normalizedItems,t);if(!r)return;let n=this._createActionDetail(r,t,e.detail?.originalEvent);r.onSelect?.(n),this._resolvedCloseOnSelect&&this._closeAllMenus(),this.dispatchEvent(new CustomEvent("select",{detail:n,bubbles:!0,composed:!0}))}}get _normalizedItems(){return Eh(this.items)}updated(){this._syncComposedProps()}get _resolvedCloseOnSelect(){return this.closeOnSelect??!0}show(){this._dropdown?.show()}hide(){this._hideAllSubmenus(),this._dropdown?.hide()}toggle(){this._dropdown?.toggle()}_syncComposedProps(){let e=L(this,"dropmenu");this._dropdown&&se(this._dropdown,{...e.dropdownProps??{},...this.dropdownProps??{}});for(let t of this._menus??[])se(t,{...e.menuProps??{},...this.menuProps??{}})}_emitOpenChange(e){this.open=e,this.dispatchEvent(new CustomEvent("open-change",{detail:{open:e},bubbles:!0,composed:!0}))}_rootMenuId(){return`lui-dropmenu-menu-${this._uid}-root`}_submenuMenuId(e){return`lui-dropmenu-menu-${this._uid}-${e}`}_submenuTriggerId(e){return`lui-dropmenu-trigger-${this._uid}-${e}`}_rootHeadingId(){return`lui-dropmenu-heading-${this._uid}`}_submenuPlacement(e){return this._submenuPlacements[e]??"right-start"}_setSubmenuPlacement(e,t){this._submenuPlacements[e]!==t&&(this._submenuPlacements={...this._submenuPlacements,[e]:t})}_measureSubmenuPlacement(e){let t=e.getBoundingClientRect(),r=this.maxWidth??248,n=window.innerWidth-t.right-8,s=t.left-8;return n>=r||n>=s?"right-start":"left-start"}_prepareSubmenuPlacement(e,t){t&&this._setSubmenuPlacement(e,this._measureSubmenuPlacement(t))}_getRootTriggerElement(){return(this._triggerSlot?.assignedElements({flatten:!0})??[]).find(t=>t instanceof HTMLElement)??null}_isPathAncestor(e,t){return!!e&&t.startsWith(`${e}.`)}_closeSubmenusOutsidePath(e){this.renderRoot.querySelectorAll("lui-dropdown.submenu[open]").forEach(r=>{let n=r.getAttribute("data-submenu-path")??"";n===e||this._isPathAncestor(n,e)||r.hide()})}_hideAllSubmenus(){this.renderRoot.querySelectorAll("lui-dropdown.submenu[open]").forEach(t=>t.hide())}_closeAllMenus(e=!1){this.hide(),e&&queueMicrotask(()=>this._getRootTriggerElement()?.focus())}_syncSubmenuExpandedState(e,t){let n=e.currentTarget.querySelector("[data-menu-submenu-trigger]");n&&n.setAttribute("aria-expanded",t?"true":"false")}_focusFirstSubmenuItem(e){e.querySelector('lui-menu-item:not([disabled]), [data-menu-submenu-trigger]:not([aria-disabled="true"])')?.focus()}_openSubmenuFromTrigger(e){let t=e.closest("lui-dropdown");if(!t)return;this._prepareSubmenuPlacement(t.getAttribute("data-submenu-path")??"",e),t.show(),(t.updateComplete??Promise.resolve()).then(()=>this._focusFirstSubmenuItem(t))}_closeSubmenuFromElement(e){let t=e.closest("lui-dropdown.submenu");t&&(t.hide(),t.querySelector("[data-menu-submenu-trigger]")?.focus())}_createActionDetail(e,t,r){let n=r instanceof MouseEvent?r:null;return{key:e.key,value:e.value??e.key,item:e.raw??e,path:t,source:"dropmenu",triggerEvent:r,x:n?.clientX,y:n?.clientY}}_readPathFromEvent(e){let t=e.target;if(!t)return[];let r=t.getAttribute("data-menu-path")??t.dataset.menuPath;return ym(r)}_renderLeafItem(e,t){return Wr.html`
1931
+ `],a([(0,Li.property)({attribute:!1})],Zo.prototype,"items",2),a([(0,Li.property)()],Zo.prototype,"value",2),a([(0,Li.property)({type:Boolean})],Zo.prototype,"multiple",2),a([(0,Li.property)({type:Boolean})],Zo.prototype,"selectable",2),a([(0,Li.query)("slot")],Zo.prototype,"_slotEl",2),Zo=a([(0,Li.customElement)("lui-menu")],Zo);var bm=0;function Ec(i){return i.join(".")}function ym(i){return i?i.split(".").map(o=>Number(o)).filter(o=>Number.isInteger(o)&&o>=0):[]}var Se=class extends Wr.LitElement{constructor(){super(...arguments);this.items=[];this.placement="bottom-start";this.trigger="click";this.disabled=!1;this.heading="";this.headingIcon="";this.showArrow=!1;this.closeOnOutsidePress=!0;this.closeOnEsc=!0;this.open=!1;this.openDelay=0;this.closeDelay=120;this.offsetDistance=6;this.backdrop="none";this.backdropStyle="";this.portal=!1;this.sameWidth=!1;this.dropdownProps={};this.menuProps={};this.submenuTrigger="hover";this._submenuPlacements={};this._uid=++bm;this._onMenuEscape=e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this._closeAllMenus(!0))};this._onSubmenuTriggerKeydown=e=>{let t=e.currentTarget;if(e.key==="Escape"){this._onMenuEscape(e);return}if(t.getAttribute("aria-disabled")!=="true"){if(e.key==="ArrowRight"||e.key==="Enter"||e.key===" "){e.preventDefault(),this._openSubmenuFromTrigger(t);return}e.key==="ArrowLeft"&&(e.preventDefault(),this._closeSubmenuFromElement(t))}};this._onSubmenuMenuKeydown=e=>{if(e.key==="Escape"){this._onMenuEscape(e);return}if(e.key!=="ArrowLeft")return;let t=e.currentTarget;e.preventDefault(),this._closeSubmenuFromElement(t)};this._onSelect=e=>{e.stopPropagation();let t=this._readPathFromEvent(e),r=Qn(this._normalizedItems,t);if(!r)return;let n=this._createActionDetail(r,t,e.detail?.originalEvent);r.onSelect?.(n),this._resolvedCloseOnSelect&&this._closeAllMenus(),this.dispatchEvent(new CustomEvent("select",{detail:n,bubbles:!0,composed:!0}))}}get _normalizedItems(){return Eh(this.items)}updated(){this._syncComposedProps()}get _resolvedCloseOnSelect(){return this.closeOnSelect??!0}show(){this._dropdown?.show()}hide(){this._hideAllSubmenus(),this._dropdown?.hide()}toggle(){this._dropdown?.toggle()}_syncComposedProps(){let e=L(this,"dropmenu");this._dropdown&&se(this._dropdown,{...e.dropdownProps??{},...this.dropdownProps??{}});for(let t of this._menus??[])se(t,{...e.menuProps??{},...this.menuProps??{}})}_emitOpenChange(e){this.open=e,this.dispatchEvent(new CustomEvent("open-change",{detail:{open:e},bubbles:!0,composed:!0}))}_rootMenuId(){return`lui-dropmenu-menu-${this._uid}-root`}_submenuMenuId(e){return`lui-dropmenu-menu-${this._uid}-${e}`}_submenuTriggerId(e){return`lui-dropmenu-trigger-${this._uid}-${e}`}_rootHeadingId(){return`lui-dropmenu-heading-${this._uid}`}_submenuPlacement(e){return this._submenuPlacements[e]??"right-start"}_setSubmenuPlacement(e,t){this._submenuPlacements[e]!==t&&(this._submenuPlacements={...this._submenuPlacements,[e]:t})}_measureSubmenuPlacement(e){let t=e.getBoundingClientRect(),r=this.maxWidth??248,n=window.innerWidth-t.right-8,s=t.left-8;return n>=r||n>=s?"right-start":"left-start"}_prepareSubmenuPlacement(e,t){t&&this._setSubmenuPlacement(e,this._measureSubmenuPlacement(t))}_getRootTriggerElement(){return(this._triggerSlot?.assignedElements({flatten:!0})??[]).find(t=>t instanceof HTMLElement)??null}_isPathAncestor(e,t){return!!e&&t.startsWith(`${e}.`)}_closeSubmenusOutsidePath(e){this.renderRoot.querySelectorAll("lui-dropdown.submenu[open]").forEach(r=>{let n=r.getAttribute("data-submenu-path")??"";n===e||this._isPathAncestor(n,e)||r.hide()})}_hideAllSubmenus(){this.renderRoot.querySelectorAll("lui-dropdown.submenu[open]").forEach(t=>t.hide())}_closeAllMenus(e=!1){this.hide(),e&&queueMicrotask(()=>this._getRootTriggerElement()?.focus())}_syncSubmenuExpandedState(e,t){let n=e.currentTarget.querySelector("[data-menu-submenu-trigger]");n&&n.setAttribute("aria-expanded",t?"true":"false")}_focusFirstSubmenuItem(e){e.querySelector('lui-menu-item:not([disabled]), [data-menu-submenu-trigger]:not([aria-disabled="true"])')?.focus()}_openSubmenuFromTrigger(e){let t=e.closest("lui-dropdown");if(!t)return;this._prepareSubmenuPlacement(t.getAttribute("data-submenu-path")??"",e),t.show(),(t.updateComplete??Promise.resolve()).then(()=>this._focusFirstSubmenuItem(t))}_closeSubmenuFromElement(e){let t=e.closest("lui-dropdown.submenu");t&&(t.hide(),t.querySelector("[data-menu-submenu-trigger]")?.focus())}_createActionDetail(e,t,r){let n=r instanceof MouseEvent?r:null;return{key:e.key,value:e.value??e.key,item:e.raw??e,path:t,source:"dropmenu",triggerEvent:r,x:n?.clientX,y:n?.clientY}}_readPathFromEvent(e){let t=e.target;if(!t)return[];let r=t.getAttribute("data-menu-path")??t.dataset.menuPath;return ym(r)}_renderLeafItem(e,t){return Wr.html`
1932
1932
  <lui-menu-item
1933
1933
  data-menu-path=${Ec(t)}
1934
1934
  value=${e.value??e.key??""}
@@ -4262,7 +4262,7 @@
4262
4262
  animation: none;
4263
4263
  }
4264
4264
  }
4265
- `],a([(0,fr.property)({type:Boolean,reflect:!0})],Gt.prototype,"checked",2),a([(0,fr.property)({type:Boolean,reflect:!0})],Gt.prototype,"disabled",2),a([(0,fr.property)({type:Boolean,reflect:!0})],Gt.prototype,"indeterminate",2),a([(0,fr.property)({reflect:!0})],Gt.prototype,"radius",2),a([(0,fr.property)({reflect:!0})],Gt.prototype,"size",2),a([(0,fr.property)()],Gt.prototype,"name",2),a([(0,fr.property)()],Gt.prototype,"value",2),a([(0,fr.property)()],Gt.prototype,"label",2),a([(0,fr.property)()],Gt.prototype,"description",2),a([(0,fr.property)({attribute:"checked-icon"})],Gt.prototype,"checkedIcon",2),a([(0,fr.property)({attribute:"indeterminate-icon"})],Gt.prototype,"indeterminateIcon",2),a([(0,fr.property)()],Gt.prototype,"locale",2),a([(0,fr.property)({attribute:!1})],Gt.prototype,"translations",2),a([(0,fr.query)("input")],Gt.prototype,"_input",2),Gt=a([(0,fr.customElement)("lui-checkbox")],Gt);var vi=require("lit"),Si=require("lit/decorators.js");var Fo=class extends vi.LitElement{constructor(){super(...arguments);this.icon="folder";this.title="";this.heading="";this.description="";this.iconProps={}}updated(){let e=L(this,"emptyState");se(this._iconEl,{...e.iconProps??{},...this.iconProps??{}})}render(){let e=this.title||this.heading;return vi.html`
4265
+ `],a([(0,fr.property)({type:Boolean,reflect:!0})],Gt.prototype,"checked",2),a([(0,fr.property)({type:Boolean,reflect:!0})],Gt.prototype,"disabled",2),a([(0,fr.property)({type:Boolean,reflect:!0})],Gt.prototype,"indeterminate",2),a([(0,fr.property)({reflect:!0})],Gt.prototype,"radius",2),a([(0,fr.property)({reflect:!0})],Gt.prototype,"size",2),a([(0,fr.property)()],Gt.prototype,"name",2),a([(0,fr.property)()],Gt.prototype,"value",2),a([(0,fr.property)()],Gt.prototype,"label",2),a([(0,fr.property)()],Gt.prototype,"description",2),a([(0,fr.property)({attribute:"checked-icon"})],Gt.prototype,"checkedIcon",2),a([(0,fr.property)({attribute:"indeterminate-icon"})],Gt.prototype,"indeterminateIcon",2),a([(0,fr.property)()],Gt.prototype,"locale",2),a([(0,fr.property)({attribute:!1})],Gt.prototype,"translations",2),a([(0,fr.query)("input")],Gt.prototype,"_input",2),Gt=a([(0,fr.customElement)("lui-checkbox")],Gt);var vi=require("lit"),Si=require("lit/decorators.js");var No=class extends vi.LitElement{constructor(){super(...arguments);this.icon="folder";this.title="";this.heading="";this.description="";this.iconProps={}}updated(){let e=L(this,"emptyState");se(this._iconEl,{...e.iconProps??{},...this.iconProps??{}})}render(){let e=this.title||this.heading;return vi.html`
4266
4266
  <div class="state" part="state">
4267
4267
  <div class="icon-shell" part="icon-shell">
4268
4268
  <slot name="icon">
@@ -4278,7 +4278,7 @@
4278
4278
  <slot name="actions"></slot>
4279
4279
  </div>
4280
4280
  </div>
4281
- `}};Fo.styles=[A,j,vi.css`
4281
+ `}};No.styles=[A,j,vi.css`
4282
4282
  :host {
4283
4283
  display: block;
4284
4284
  --lui-empty-state-radius: var(--lui-radius-lg);
@@ -4377,7 +4377,7 @@
4377
4377
  --lui-button-hover-border: var(--lui-color-border-strong);
4378
4378
  --lui-button-hover-fg: var(--lui-color-fg);
4379
4379
  }
4380
- `],a([(0,Si.property)()],Fo.prototype,"icon",2),a([(0,Si.property)()],Fo.prototype,"title",2),a([(0,Si.property)()],Fo.prototype,"heading",2),a([(0,Si.property)()],Fo.prototype,"description",2),a([(0,Si.property)({attribute:!1})],Fo.prototype,"iconProps",2),a([(0,Si.query)(".icon-shell lui-icon")],Fo.prototype,"_iconEl",2),Fo=a([(0,Si.customElement)("lui-empty-state")],Fo);var la={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1600};function Qo(i){return i==null||i===""?"":Ot(i)}function Dc(i){if(i==null||i==="")return;if(typeof i=="number")return Number.isFinite(i)?i:void 0;let o=Number.parseFloat(i);return Number.isFinite(o)?o:void 0}function sa(i,o){if(o)return o.split(".").reduce((e,t)=>{if(!(e==null||typeof e!="object"))return e[t]},i)}function Am(i,o){return i==null&&o==null?0:i==null?-1:o==null?1:typeof i=="number"&&typeof o=="number"?i-o:String(i).localeCompare(String(o),void 0,{numeric:!0,sensitivity:"base"})}function Pm(i){if(i==null)return"";if(i instanceof Date)return i.toLocaleString();if(typeof i=="object")try{return JSON.stringify(i)}catch{return String(i)}return i}function ep(i){let e=(Array.isArray(i)?i:typeof i=="string"?i.split(/[\s,|]+/).filter(Boolean):[]).map(t=>String(t).trim().toLowerCase()).filter(t=>t in la);return e.length?Array.from(new Set(e)):void 0}function jm(i){return i>=la.xxl?"xxl":i>=la.xl?"xl":i>=la.lg?"lg":i>=la.md?"md":i>=la.sm?"sm":"xs"}var vr=class extends R.LitElement{constructor(){super(...arguments);this.key="";this.dataIndex="";this.title="";this.width="";this.minWidth="";this.responsive="";this.align="left";this.fixed="";this.sortable=!1;this.resizable=!1;this.reorderable=!1}toColumn(){return{key:this.key||this.dataIndex||this.title,dataIndex:this.dataIndex||this.key,title:this.title,width:this.width,minWidth:this.minWidth,responsive:ep(this.responsive),align:this.align,fixed:this.hasAttribute("fixed")?this.fixed==="right"?"right":"left":void 0,sortable:this.sortable,resizable:this.hasAttribute("resizable")?this.resizable:void 0,reorderable:this.hasAttribute("reorderable")?this.reorderable:void 0}}render(){return R.nothing}};vr.styles=R.css`:host{display:none;}`,a([(0,W.property)()],vr.prototype,"key",2),a([(0,W.property)({attribute:"data-index"})],vr.prototype,"dataIndex",2),a([(0,W.property)()],vr.prototype,"title",2),a([(0,W.property)()],vr.prototype,"width",2),a([(0,W.property)({attribute:"min-width"})],vr.prototype,"minWidth",2),a([(0,W.property)()],vr.prototype,"responsive",2),a([(0,W.property)({reflect:!0})],vr.prototype,"align",2),a([(0,W.property)()],vr.prototype,"fixed",2),a([(0,W.property)({type:Boolean,reflect:!0})],vr.prototype,"sortable",2),a([(0,W.property)({type:Boolean,reflect:!0})],vr.prototype,"resizable",2),a([(0,W.property)({type:Boolean,reflect:!0})],vr.prototype,"reorderable",2),vr=a([(0,W.customElement)("lui-table-column")],vr);var Y=class extends R.LitElement{constructor(){super(...arguments);this.rowKey="key";this.size="md";this.selection="none";this.selectedRowKeys=[];this.bordered=!1;this.border=!1;this.noBorder=!1;this.striped=!1;this.hoverable=!0;this.stickyHeader=!1;this.showHeader=!0;this.columnResizable=!1;this.resizeMode="adaptive";this.columnReorderable=!1;this.loading=!1;this.virtual=!1;this.virtualHeight=360;this.overscan=6;this.pagination=!1;this.remotePagination=!1;this.current=1;this.pageSize=10;this.showSizeChanger=!1;this.showSeq=!1;this.seqLabel="\u5E8F\u53F7";this.showOverflow=!1;this.showHeaderOverflow=!1;this.emptyText="\u6682\u65E0\u6570\u636E";this.sortKey="";this.sortOrder="none";this.rowClickable=!1;this.selectOnClick=!1;this.rowAnimation="auto";this._responsiveWidth=0;this._internalSelectedRowKeys=[];this._columnWidthOverrides={};this._columnOrderKeys=[];this._virtualStart=0;this._scrollTop=0;this._scrollRaf=0;this._gutterRaf=0;this._resizeRaf=0;this._columnInteractRaf=0;this._columnInteractDisposers=[];this._columnDragGhost=null;this._leavingRows=[];this._enteringRowKeys=new Set;this._rowAnimationTimers=[];this._lastRangeKey="";this._activeRows=[];this._activeColumns=[];this._activeFixedMeta=[];this._columnResizeState=null;this._lastResizedColumnKey="";this._columnDraggedAt=0;this._activeEffectiveWidths=null;this._columnDragState=null;this._explicitAttrs=new Set;this._onScroll=e=>{let t=e.currentTarget;if(this._syncHorizontalScrollVars(t),!this.virtual)return;let r=t.scrollTop;this._scrollTop=r,!this._scrollRaf&&(this._scrollRaf=requestAnimationFrame(()=>{this._scrollRaf=0;let n=this._calculateVirtualStart(this._scrollTop);n!==this._virtualStart&&(this._virtualStart=n)}))};this._onCellMouseOver=e=>{if(!this.showOverflow&&!this.showHeaderOverflow)return;let t=e.target;if(!(t instanceof HTMLElement))return;let r=t.closest(".cell");if(!r)return;if(!(!!t.closest("th, .vhead-cell")?this.showHeaderOverflow:this.showOverflow)){r.title="";return}let d=(r.textContent??"").trim();r.title=d&&r.scrollWidth>r.clientWidth+1?d:""};this._onPageChange=e=>{let t=Number(e.detail?.current),r=Number(e.detail?.pageSize);!Number.isFinite(t)||!Number.isFinite(r)||(this.current=Math.max(1,Math.floor(t)),this.pageSize=Math.max(1,Math.floor(r)),this.dispatchEvent(new CustomEvent("page-change",{detail:{current:this.current,pageSize:this.pageSize,total:this._totalRows()},bubbles:!0,composed:!0})))};this._renderLitVirtualRow=e=>{let{row:t,index:r}=e,n=this._activeColumns.length?this._activeColumns:this._responsiveColumns(this._orderedColumns(this._columns())),s=this._activeFixedMeta.length?this._activeFixedMeta:this._fixedMeta(n),d=this._getRowKey(t,r),h=this._selectedKeys().some(p=>String(p)===String(d));return R.html`
4380
+ `],a([(0,Si.property)()],No.prototype,"icon",2),a([(0,Si.property)()],No.prototype,"title",2),a([(0,Si.property)()],No.prototype,"heading",2),a([(0,Si.property)()],No.prototype,"description",2),a([(0,Si.property)({attribute:!1})],No.prototype,"iconProps",2),a([(0,Si.query)(".icon-shell lui-icon")],No.prototype,"_iconEl",2),No=a([(0,Si.customElement)("lui-empty-state")],No);var la={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1600};function Eo(i){return i==null||i===""?"":Ot(i)}function Dc(i){if(i==null||i==="")return;if(typeof i=="number")return Number.isFinite(i)?i:void 0;let o=Number.parseFloat(i);return Number.isFinite(o)?o:void 0}function sa(i,o){if(o)return o.split(".").reduce((e,t)=>{if(!(e==null||typeof e!="object"))return e[t]},i)}function Am(i,o){return i==null&&o==null?0:i==null?-1:o==null?1:typeof i=="number"&&typeof o=="number"?i-o:String(i).localeCompare(String(o),void 0,{numeric:!0,sensitivity:"base"})}function Pm(i){if(i==null)return"";if(i instanceof Date)return i.toLocaleString();if(typeof i=="object")try{return JSON.stringify(i)}catch{return String(i)}return i}function ep(i){let e=(Array.isArray(i)?i:typeof i=="string"?i.split(/[\s,|]+/).filter(Boolean):[]).map(t=>String(t).trim().toLowerCase()).filter(t=>t in la);return e.length?Array.from(new Set(e)):void 0}function jm(i){return i>=la.xxl?"xxl":i>=la.xl?"xl":i>=la.lg?"lg":i>=la.md?"md":i>=la.sm?"sm":"xs"}var vr=class extends R.LitElement{constructor(){super(...arguments);this.key="";this.dataIndex="";this.title="";this.width="";this.minWidth="";this.responsive="";this.align="left";this.fixed="";this.sortable=!1;this.resizable=!1;this.reorderable=!1}toColumn(){return{key:this.key||this.dataIndex||this.title,dataIndex:this.dataIndex||this.key,title:this.title,width:this.width,minWidth:this.minWidth,responsive:ep(this.responsive),align:this.align,fixed:this.hasAttribute("fixed")?this.fixed==="right"?"right":"left":void 0,sortable:this.sortable,resizable:this.hasAttribute("resizable")?this.resizable:void 0,reorderable:this.hasAttribute("reorderable")?this.reorderable:void 0}}render(){return R.nothing}};vr.styles=R.css`:host{display:none;}`,a([(0,W.property)()],vr.prototype,"key",2),a([(0,W.property)({attribute:"data-index"})],vr.prototype,"dataIndex",2),a([(0,W.property)()],vr.prototype,"title",2),a([(0,W.property)()],vr.prototype,"width",2),a([(0,W.property)({attribute:"min-width"})],vr.prototype,"minWidth",2),a([(0,W.property)()],vr.prototype,"responsive",2),a([(0,W.property)({reflect:!0})],vr.prototype,"align",2),a([(0,W.property)()],vr.prototype,"fixed",2),a([(0,W.property)({type:Boolean,reflect:!0})],vr.prototype,"sortable",2),a([(0,W.property)({type:Boolean,reflect:!0})],vr.prototype,"resizable",2),a([(0,W.property)({type:Boolean,reflect:!0})],vr.prototype,"reorderable",2),vr=a([(0,W.customElement)("lui-table-column")],vr);var Y=class extends R.LitElement{constructor(){super(...arguments);this.rowKey="key";this.size="md";this.selection="none";this.selectedRowKeys=[];this.bordered=!1;this.border=!1;this.noBorder=!1;this.striped=!1;this.hoverable=!0;this.stickyHeader=!1;this.showHeader=!0;this.columnResizable=!1;this.resizeMode="adaptive";this.columnReorderable=!1;this.loading=!1;this.virtual=!1;this.virtualHeight=360;this.overscan=6;this.pagination=!1;this.remotePagination=!1;this.current=1;this.pageSize=10;this.showSizeChanger=!1;this.showSeq=!1;this.seqLabel="\u5E8F\u53F7";this.showOverflow=!1;this.showHeaderOverflow=!1;this.emptyText="\u6682\u65E0\u6570\u636E";this.sortKey="";this.sortOrder="none";this.rowClickable=!1;this.selectOnClick=!1;this.rowAnimation="auto";this._responsiveWidth=0;this._internalSelectedRowKeys=[];this._columnWidthOverrides={};this._columnOrderKeys=[];this._virtualStart=0;this._scrollTop=0;this._scrollRaf=0;this._gutterRaf=0;this._resizeRaf=0;this._columnInteractRaf=0;this._columnInteractDisposers=[];this._columnDragGhost=null;this._leavingRows=[];this._enteringRowKeys=new Set;this._rowAnimationTimers=[];this._lastRangeKey="";this._activeRows=[];this._activeColumns=[];this._activeFixedMeta=[];this._columnResizeState=null;this._lastResizedColumnKey="";this._columnDraggedAt=0;this._activeEffectiveWidths=null;this._columnDragState=null;this._explicitAttrs=new Set;this._onScroll=e=>{let t=e.currentTarget;if(this._syncHorizontalScrollVars(t),!this.virtual)return;let r=t.scrollTop;this._scrollTop=r,!this._scrollRaf&&(this._scrollRaf=requestAnimationFrame(()=>{this._scrollRaf=0;let n=this._calculateVirtualStart(this._scrollTop);n!==this._virtualStart&&(this._virtualStart=n)}))};this._onCellMouseOver=e=>{if(!this.showOverflow&&!this.showHeaderOverflow)return;let t=e.target;if(!(t instanceof HTMLElement))return;let r=t.closest(".cell");if(!r)return;if(!(!!t.closest("th, .vhead-cell")?this.showHeaderOverflow:this.showOverflow)){r.title="";return}let d=(r.textContent??"").trim();r.title=d&&r.scrollWidth>r.clientWidth+1?d:""};this._onPageChange=e=>{let t=Number(e.detail?.current),r=Number(e.detail?.pageSize);!Number.isFinite(t)||!Number.isFinite(r)||(this.current=Math.max(1,Math.floor(t)),this.pageSize=Math.max(1,Math.floor(r)),this.dispatchEvent(new CustomEvent("page-change",{detail:{current:this.current,pageSize:this.pageSize,total:this._totalRows()},bubbles:!0,composed:!0})))};this._renderLitVirtualRow=e=>{let{row:t,index:r}=e,n=this._activeColumns.length?this._activeColumns:this._responsiveColumns(this._orderedColumns(this._columns())),s=this._activeFixedMeta.length?this._activeFixedMeta:this._fixedMeta(n),d=this._getRowKey(t,r),h=this._selectedKeys().some(p=>String(p)===String(d));return R.html`
4381
4381
  <div
4382
4382
  class=${`lvrow ${r%2===1?"even":""} ${h?"selected":""} ${this.rowClickable||this.selectOnClick?"clickable":""}`}
4383
4383
  role="row"
@@ -4416,7 +4416,7 @@
4416
4416
  </div>
4417
4417
  `})}
4418
4418
  </div>
4419
- `};this._virtualKey=e=>this._getRowKey(e.row,e.index);this._skeletonWidths=["62%","78%","45%","70%","55%","82%"]}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._applyVirtualStyles();let e=typeof window<"u"?window.innerWidth:0;this._responsiveWidth=Math.round(this.getBoundingClientRect().width||e||0),this._responsiveResizeObserver=new ResizeObserver(t=>{let r=t[0],n=typeof window<"u"?window.innerWidth:0,s=Math.round(r?.contentRect.width||this.getBoundingClientRect().width||n||0);s>0&&s!==this._responsiveWidth&&(this._responsiveWidth=s)}),this._responsiveResizeObserver.observe(this)}disconnectedCallback(){this._endColumnResize(),this._endColumnReorder(),this._removeColumnDragGhost(),this._teardownColumnInteractions(),this._clearRowAnimationTimers(),this._scrollRaf&&cancelAnimationFrame(this._scrollRaf),this._gutterRaf&&cancelAnimationFrame(this._gutterRaf),this._resizeRaf&&cancelAnimationFrame(this._resizeRaf),this._columnInteractRaf&&cancelAnimationFrame(this._columnInteractRaf),this._responsiveResizeObserver?.disconnect(),this._responsiveResizeObserver=void 0,this._scrollRaf=0,this._gutterRaf=0,this._resizeRaf=0,this._columnInteractRaf=0,super.disconnectedCallback()}willUpdate(e){e.has("selectedRowKeys")&&(this._internalSelectedRowKeys=[...this.selectedRowKeys??[]]),e.has("columnWidths")&&this.columnWidths&&this._applyColumnWidthOverrides({...this.columnWidths}),(e.has("data")||e.has("dataSource")||e.has("source"))&&this._prepareRowAnimations();let t=L(this,"table");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("bordered")&&typeof t.bordered=="boolean"&&this.bordered!==t.bordered&&(this.bordered=t.bordered),!this._explicitAttrs.has("border")&&typeof t.border=="boolean"&&this.border!==t.border&&(this.border=t.border),!this._explicitAttrs.has("noborder")&&typeof t.noBorder=="boolean"&&this.noBorder!==t.noBorder&&(this.noBorder=t.noBorder),!this._explicitAttrs.has("striped")&&typeof t.striped=="boolean"&&this.striped!==t.striped&&(this.striped=t.striped),!this._explicitAttrs.has("hoverable")&&typeof t.hoverable=="boolean"&&this.hoverable!==t.hoverable&&(this.hoverable=t.hoverable),!this._explicitAttrs.has("column-resizable")&&typeof t.columnResizable=="boolean"&&this.columnResizable!==t.columnResizable&&(this.columnResizable=t.columnResizable),!this._explicitAttrs.has("column-reorderable")&&typeof t.columnReorderable=="boolean"&&this.columnReorderable!==t.columnReorderable&&(this.columnReorderable=t.columnReorderable),!this._explicitAttrs.has("selection")&&typeof t.selection=="string"&&this.selection!==t.selection&&(this.selection=t.selection),!this._explicitAttrs.has("select-on-click")&&typeof t.selectOnClick=="boolean"&&this.selectOnClick!==t.selectOnClick&&(this.selectOnClick=t.selectOnClick),!this._explicitAttrs.has("pagination")&&typeof t.pagination=="boolean"&&this.pagination!==t.pagination&&(this.pagination=t.pagination),!this._explicitAttrs.has("virtual")&&typeof t.virtual=="boolean"&&this.virtual!==t.virtual&&(this.virtual=t.virtual),!this._explicitAttrs.has("row-animation")&&typeof t.rowAnimation=="string"&&this.rowAnimation!==t.rowAnimation&&(this.rowAnimation=t.rowAnimation),!this._explicitAttrs.has("virtual-height")&&(typeof t.virtualHeight=="number"||typeof t.virtualHeight=="string")&&this.virtualHeight!==t.virtualHeight&&(this.virtualHeight=t.virtualHeight),!this._explicitAttrs.has("row-height")&&typeof t.rowHeight=="number"&&this.rowHeight!==t.rowHeight&&(this.rowHeight=t.rowHeight)}updated(e){(e.has("virtual")||e.has("virtualHeight")||e.has("rowHeight"))&&this._applyVirtualStyles(),this.virtual?(this._scheduleVirtualScrollbarGutter(),this._syncHorizontalScrollVars()):(this.style.setProperty("--lui-table-scrollbar-width","0px"),this.style.setProperty("--lui-table-scroll-left","0px"),this.style.setProperty("--lui-table-scroll-overflow","0px")),(e.has("data")||e.has("dataSource")||e.has("source")||e.has("pagination")||e.has("current")||e.has("pageSize"))&&(this._scrollTop=0,this._virtualStart=0,this._lastRangeKey="",this._scrollEl&&(this._scrollEl.scrollTop=0)),this._scheduleColumnInteractions()}_applyVirtualStyles(){let e=this._resolvedVirtualHeight(),t=this.showHeader?this._resolvedRowHeight():0;this.style.setProperty("--lui-table-virtual-height",Qo(this.virtualHeight)||"360px"),this.style.setProperty("--lui-table-virtual-body-height",`${Math.max(80,e-t)}px`),typeof this.rowHeight=="number"&&Number.isFinite(this.rowHeight)&&this.style.setProperty("--lui-table-row-height",`${Math.max(24,this.rowHeight)}px`)}_scheduleVirtualScrollbarGutter(){this._gutterRaf||(this._gutterRaf=requestAnimationFrame(()=>{this._gutterRaf=0;let e=this._virtualizerEl,t=e?Math.max(0,e.offsetWidth-e.clientWidth):0;this.style.setProperty("--lui-table-scrollbar-width",`${t}px`)}))}_syncHorizontalScrollVars(e=this._scrollEl){if(!e)return;let t=Math.max(0,e.scrollLeft||0),r=Math.max(0,e.scrollWidth-e.clientWidth);this.style.setProperty("--lui-table-scroll-left",`${t}px`),this.style.setProperty("--lui-table-scroll-overflow",`${r}px`)}_rows(){return this.dataSource??this.source??this.data??[]}_columns(){return this.columns?.length?this.columns:(this._slottedColumns??[]).map(e=>e.toColumn())}_orderedColumns(e){if(!this._columnOrderKeys.length)return e;let t=e.map((d,h)=>({column:d,key:this._columnKey(d,h)})),r=new Map(t.map(d=>[d.key,d.column])),n=new Set,s=[];for(let d of this._columnOrderKeys){let h=r.get(d);!h||n.has(d)||(s.push(h),n.add(d))}for(let d of t)n.has(d.key)||s.push(d.column);return s}_currentBreakpoint(){let e=typeof window<"u"?window.innerWidth:0;return jm(this._responsiveWidth||Math.round(this.getBoundingClientRect().width||e||0))}_responsiveColumns(e){let t=this._currentBreakpoint();return e.filter(r=>{let n=ep(r.responsive);return!n?.length||n.includes(t)})}_getRowKey(e,t){return typeof this.rowKey=="function"?this.rowKey(e,t):sa(e,this.rowKey)??t}_columnKey(e,t){return String(e.key??e.dataIndex??t)}_columnFixed(e){if(e.fixed===!0||e.fixed==="left")return"left";if(e.fixed==="right")return"right"}_columnKeyForWidth(e,t){return this._columnKey(e,t)}_columnOverrideWidth(e,t){return this._columnWidthOverrides[this._columnKeyForWidth(e,t)]}_columnPixelWidth(e,t){return Math.max(this._columnMinWidth(e),this._columnOverrideWidth(e,t)??Dc(e.width)??Dc(e.minWidth)??120)}_leadingColumnWidth(){return(this.showSeq?60:0)+(this.selection!=="none"?44:0)}_seqBase(){return this.pagination?(Math.max(1,this.current)-1)*Math.max(1,this.pageSize||10):0}_resizedTableWidth(e){return this._leadingColumnWidth()+e.reduce((t,r,n)=>t+this._columnPixelWidth(r,n),0)}_effectiveColumnWidths(e){if(this.resizeMode!=="adaptive"||Object.keys(this._columnWidthOverrides).length===0)return null;let t=[];for(let k=0;k<e.length;k+=1){let C=e[k];if(!this._columnOverrideWidth(C,k)&&!Qo(C.width))return null;t.push(this._columnPixelWidth(C,k))}let r=this._columnResizeState?.key??this._lastResizedColumnKey,n=r?e.findIndex((k,C)=>this._columnKeyForWidth(k,C)===r):-1,s=-1;for(let k=e.length-1;k>=0;k-=1)if(k!==n){s=k;break}if(s<0)return null;let d=Math.floor(this._scrollEl?.clientWidth||this.getBoundingClientRect().width),h=this._leadingColumnWidth(),p=h+t.reduce((k,C)=>k+C,0),f=d-p;if(!Number.isFinite(d)||d<=h||f<=0)return null;let x=[...t];return x[s]=Math.max(this._columnMinWidth(e[s]),Math.floor(t[s]+f)),x}_findHeaderCellByColumnKey(e){return this.renderRoot.querySelector(`[data-column-key="${CSS.escape(e)}"]`)}_applyColumnWidthOverrides(e){this._columnWidthOverrides=e,this.toggleAttribute("column-resized",Object.keys(e).length>0)}_fixedColumnSize(e,t){let r=this._activeEffectiveWidths?.[t];if(r)return`${r}px`;let n=this._columnOverrideWidth(e,t);return n?`${n}px`:Qo(e.width??e.minWidth)||"120px"}_sumCss(e){return e.length?e.length===1?e[0]:`calc(${e.join(" + ")})`:"0px"}_updateHasEllipsisColumn(e){this.toggleAttribute("has-ellipsis-column",e.some(t=>!!t.ellipsis)),this.toggleAttribute("has-fixed-column",e.some(t=>!!t.ellipsis||!!this._columnFixed(t)||!!Qo(t.width)||!!Qo(t.minWidth)))}_fixedMeta(e){let t=e.map(h=>({fixed:this._columnFixed(h),offset:"0px",edge:!1})),r=t.map((h,p)=>h.fixed==="left"?p:-1).filter(h=>h>=0),n=t.map((h,p)=>h.fixed==="right"?p:-1).filter(h=>h>=0),s=this.selection!=="none"&&r.length>0?["44px"]:[];for(let h of r)t[h].offset=this._sumCss(s),s.push(this._fixedColumnSize(e[h],h));let d=[];for(let h=n.length-1;h>=0;h-=1){let p=n[h];t[p].offset=this._sumCss(d),d.push(this._fixedColumnSize(e[p],p))}return r.length&&(t[r[r.length-1]].edge=!0),n.length&&(t[n[0]].edge=!0),t}_hasLeftFixed(e){return e.some(t=>this._columnFixed(t)==="left")}_fixedClass(e,t=""){return e?.fixed?`${t} fixed-${e.fixed} ${e.edge?`fixed-${e.fixed}-edge`:""}`.trim():t}_fixedStyle(e,t=""){let r=t?[t]:[];return e?.fixed&&r.push(`--lui-table-sticky-${e.fixed}:${e.offset}`),r.filter(Boolean).join(";")}_selectionFixedClass(e,t=""){return this.selection==="none"||!this._hasLeftFixed(e)?t:`${t} fixed-left fixed-selection`.trim()}_selectionFixedStyle(e){return this.selection!=="none"&&this._hasLeftFixed(e)?"--lui-table-sticky-left:0px":""}_selectedKeys(){return this._internalSelectedRowKeys}_sortedRows(e,t){if(!this.sortKey||this.sortOrder==="none")return e;let r=t.find((s,d)=>this._columnKey(s,d)===this.sortKey);if(!r)return e;if(this.sorter)return this.sorter(e,{key:this.sortKey,order:this.sortOrder,column:r});let n=this.sortOrder==="asc"?1:-1;return[...e].sort((s,d)=>(r.sorter?r.sorter(s,d,r):Am(sa(s,r.dataIndex??r.key),sa(d,r.dataIndex??r.key)))*n)}_pagedRows(e){if(!this.pagination||this.remotePagination)return e;let t=Math.max(1,this.pageSize||10),r=Math.max(1,this.current||1);return e.slice((r-1)*t,r*t)}_rowKeyString(e,t){return String(this._getRowKey(e,t))}_rowAnimationsEnabled(e=this._activeRows.length){return this.rowAnimation!=="none"&&!this.virtual&&e<=500}_clearRowAnimationTimers(){for(let e of this._rowAnimationTimers)clearTimeout(e);this._rowAnimationTimers=[]}_prepareRowAnimations(){let e=this._activeRows??[],t=this._orderedColumns(this._columns()),r=this._pagedRows(this._sortedRows(this._rows(),t));if(!this._rowAnimationsEnabled(Math.max(e.length,r.length))||e.length===0){this._leavingRows=[],this._enteringRowKeys.clear();return}let n=e.map((k,C)=>this._rowKeyString(k,C)),s=r.map((k,C)=>this._rowKeyString(k,C)),d=new Set(n),h=new Set(s),p=[];e.forEach((k,C)=>{let S=n[C];h.has(S)||p.push({row:k,index:C,key:this._getRowKey(k,C)})});let f=new Set;if(s.forEach(k=>{d.has(k)||f.add(k)}),!p.length&&!f.size)return;this._clearRowAnimationTimers(),this._leavingRows=p,this._enteringRowKeys=f,this._rowAnimationTimers.push(setTimeout(()=>{this._leavingRows=[],this._enteringRowKeys.clear(),this.requestUpdate()},220))}_bodyDisplayRows(e,t,r,n){let s=e.map((h,p)=>{let f=t+p,x=this._getRowKey(h,f);return{row:h,rowIndex:f,key:x,leaving:!1,entering:this._enteringRowKeys.has(String(x))}});if(!this._rowAnimationsEnabled(s.length)||r>0||n>0||!this._leavingRows.length)return s;let d=new Set(s.map(h=>String(h.key)));for(let h of this._leavingRows)d.has(String(h.key))||s.splice(Math.min(h.index,s.length),0,{row:h.row,rowIndex:h.index,key:h.key,leaving:!0,entering:!1});return s}_resolvedRowHeight(){return typeof this.rowHeight=="number"&&Number.isFinite(this.rowHeight)?Math.max(24,this.rowHeight):this.size==="sm"?36:this.size==="lg"?52:44}_resolvedVirtualHeight(){if(typeof this.virtualHeight=="number"&&Number.isFinite(this.virtualHeight))return Math.max(80,this.virtualHeight);let e=Number.parseFloat(String(this.virtualHeight));return Number.isFinite(e)?Math.max(80,e):360}_calculateVirtualStart(e,t=this._resolvedRowHeight()){let r=Math.max(0,Math.floor(this.overscan||0));return Math.max(0,Math.floor(e/t)-r)}_virtualRange(e){if(!this.virtual||e.length===0)return{start:0,end:e.length,before:0,after:0,visibleRows:e};let t=this._resolvedRowHeight(),r=this._resolvedVirtualHeight(),n=Math.max(0,Math.floor(this.overscan||0)),s=Math.max(0,e.length-1),d=Math.min(s,this._virtualStart),h=Math.ceil(r/t)+n*2,p=Math.min(e.length,d+h),f=`${d}:${p}:${e.length}`;return f!==this._lastRangeKey&&(this._lastRangeKey=f,queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("visible-range-change",{detail:{start:d,end:p,total:e.length},bubbles:!0,composed:!0}))})),{start:d,end:p,before:d*t,after:Math.max(0,(e.length-p)*t),visibleRows:e.slice(d,p)}}scrollToIndex(e,t="start"){if(this.virtual&&this._virtualizerEl){this._virtualizerEl.scrollToIndex(e,t);return}let r=this._scrollEl;if(!r)return;let n=this._resolvedRowHeight(),s=this._resolvedVirtualHeight(),d=Math.max(0,e)*n;t==="center"&&(d-=(s-n)/2),t==="end"&&(d-=s-n),r.scrollTop=Math.max(0,d),this._scrollTop=r.scrollTop,this._virtualStart=this._calculateVirtualStart(this._scrollTop)}getColumnWidths(){return{...this._columnWidthOverrides}}_selectedRowsForKeys(e,t){if(!e.length)return[];let r=new Set(e.map(String)),n=[];for(let s=0;s<t.length;s+=1){let d=t[s];if(r.has(String(this._getRowKey(d,s)))&&n.push(d),n.length>=e.length)break}return n}_emitSelection(e,t){this._internalSelectedRowKeys=e,this.dispatchEvent(new CustomEvent("selection-change",{detail:{selectedRowKeys:e,selectedRows:this._selectedRowsForKeys(e,t)},bubbles:!0,composed:!0}))}_setCheckboxState(e,t,r=!1){e&&Object.assign(e,{checked:t,indeterminate:r})}_syncRenderedSelection(){let e=new Set(this._selectedKeys().map(String));this.renderRoot.querySelectorAll("[data-row-key]").forEach(r=>{let n=e.has(r.dataset.rowKey??"");r.classList.toggle("selected",n),this._setCheckboxState(r.querySelector("lui-checkbox"),n)}),this._syncHeaderCheckbox()}_syncHeaderCheckbox(){let e=this.renderRoot.querySelector('[data-table-select-all="true"]');if(!e)return;let t=Array.from(this.renderRoot.querySelectorAll("[data-row-key]")),r=new Set(this._selectedKeys().map(String)),n=t.filter(s=>r.has(s.dataset.rowKey??"")).length;this._setCheckboxState(e,t.length>0&&n===t.length,n>0&&n<t.length)}_toggleRow(e,t,r,n,s){let d=this._getRowKey(e,t);if(this.selection==="single"){this._emitSelection(r?[d]:[],n),this._syncRenderedSelection();return}let h=this._selectedKeys().filter(p=>String(p)!==String(d));r&&h.push(d),this._emitSelection(h,n),this._syncRenderedSelection()}_toggleAll(e,t,r){let n=this._selectedKeys(),s=t.map((f,x)=>this._getRowKey(f,x)),d=new Set(s.map(String)),h=n.filter(f=>!d.has(String(f))),p=e?[...h,...s]:h;this._emitSelection(p,r),this._syncRenderedSelection()}_toggleSort(e,t){if(!e.sortable&&!e.sorter)return;let r=this._columnKey(e,t),n="asc";this.sortKey===r&&(n=this.sortOrder==="asc"?"desc":this.sortOrder==="desc"?"none":"asc"),this.sortKey=n==="none"?"":r,this.sortOrder=n,this.dispatchEvent(new CustomEvent("sort",{detail:{key:r,order:n,column:e},bubbles:!0,composed:!0}))}_totalRows(){return typeof this.total=="number"?this.total:this._rows().length}_isInteractiveTarget(e){return e instanceof HTMLElement&&!!e.closest?.("lui-checkbox,lui-button,button,a,input,select,textarea,[data-table-ignore-row-click]")}_onRowClick(e,t,r,n){if(!this._isInteractiveTarget(e.target)){if(this.selectOnClick&&this.selection!=="none"){let s=this._selectedKeys().some(d=>String(d)===String(r));this._toggleRow(t,n,this.selection==="single"?!0:!s,this._activeRows,e)}this.onRow?.(t,n)?.onClick?.(e),this.dispatchEvent(new CustomEvent("row-click",{detail:{row:t,rowKey:r,index:n,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0}))}}_onRowDblClick(e,t,r,n){this._isInteractiveTarget(e.target)||(this.onRow?.(t,n)?.onDoubleClick?.(e),this.dispatchEvent(new CustomEvent("row-dblclick",{detail:{row:t,rowKey:r,index:n,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0})))}_onRowContextMenu(e,t,r){this._isInteractiveTarget(e.target)||this.onRow?.(t,r)?.onContextMenu?.(e)}_onRowMouseEnter(e,t,r){this.onRow?.(t,r)?.onMouseEnter?.(e)}_onRowMouseLeave(e,t,r){this.onRow?.(t,r)?.onMouseLeave?.(e)}_cellContext(e,t,r,n){let s=this._getRowKey(e,t),d=this._columnKey(r,n),h=sa(e,r.dataIndex??r.key);return{row:e,rowKey:s,rowIndex:t,column:r,columnKey:d,columnIndex:n,value:h}}_onCellClick(e,t,r,n,s){if(this._isInteractiveTarget(e.target))return;let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onClick?.(e),this.onCell?.(d)?.onClick?.(e),n.onClick?.(e,d),this.dispatchEvent(new CustomEvent("cell-click",{detail:{...d,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellDblClick(e,t,r,n,s){if(this._isInteractiveTarget(e.target))return;let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onDoubleClick?.(e),this.onCell?.(d)?.onDoubleClick?.(e),n.onDblClick?.(e,d),this.dispatchEvent(new CustomEvent("cell-dblclick",{detail:{...d,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellContextMenu(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onContextMenu?.(e),this.onCell?.(d)?.onContextMenu?.(e),n.onContextMenu?.(e,d),this.dispatchEvent(new CustomEvent("cell-contextmenu",{detail:{...d,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellMouseEnter(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onMouseEnter?.(e),this.onCell?.(d)?.onMouseEnter?.(e)}_onCellMouseLeave(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onMouseLeave?.(e),this.onCell?.(d)?.onMouseLeave?.(e)}_headerCellContext(e,t){return{column:e,columnKey:this._columnKey(e,t),columnIndex:t}}_callHeaderRowHandler(e,t,r){this.onHeaderRow?.(r,0)?.[t]?.(e)}_callHeaderCellHandler(e,t,r,n){this.onHeaderCell?.(this._headerCellContext(r,n))?.[t]?.(e)}_onHeaderCellClick(e,t,r,n){performance.now()-this._columnDraggedAt<200||(this._callHeaderCellHandler(e,"onClick",t,r),n&&this._toggleSort(t,r))}_isColumnResizable(e){return e.resizable??this.columnResizable}_isColumnReorderable(e){return e.reorderable??this.columnReorderable}_columnMinWidth(e){return Math.max(48,Dc(e.minWidth)??48)}_columnInfoByKey(e){if(!e)return null;let t=this._responsiveColumns(this._orderedColumns(this._columns())),r=t.findIndex((n,s)=>this._columnKeyForWidth(n,s)===e);return r>=0?{column:t[r],index:r}:null}_teardownColumnInteractions(){for(let e of this._columnInteractDisposers)e();this._columnInteractDisposers=[]}_scheduleColumnInteractions(){this._columnInteractRaf||(this._columnInteractRaf=requestAnimationFrame(()=>{this._columnInteractRaf=0,this._syncColumnInteractions()}))}_syncColumnInteractions(){if(!this.isConnected||this._columnResizeState||this._columnDragState||(this._teardownColumnInteractions(),!this.showHeader))return;let e=Array.from(this.renderRoot.querySelectorAll(".column-resizer"));for(let n of e){let s=(0,hl.default)(n).draggable({listeners:{start:d=>{let h=this._columnInfoByKey(n.dataset.columnKey);!h||!this._isColumnResizable(h.column)||this._startColumnResizeDrag(n,h.column,h.index,d.clientX??0)},move:d=>{this._moveColumnResize(d.clientX??0)},end:()=>{this._endColumnResize(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}let t=Array.from(this.renderRoot.querySelectorAll(".column-drag-handle"));for(let n of t){let s=(0,hl.default)(n).draggable({listeners:{start:d=>{let h=this._columnInfoByKey(n.dataset.columnKey);!h||!this._isColumnReorderable(h.column)||this._startColumnReorderDrag(n,h.column,h.index,d.clientX??0,d.clientY??0)},move:d=>{this._moveColumnReorder(d.clientX??0,d.clientY??0)},end:()=>{this._endColumnReorder(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}let r=Array.from(this.renderRoot.querySelectorAll("th[data-reorderable='true'], .vhead-cell[data-reorderable='true']"));for(let n of r){let s=(0,hl.default)(n).draggable({listeners:{start:d=>{if(this._columnResizeState||this._columnDragState)return;let h=this.renderRoot,p=d.clientX0??d.clientX??0,f=d.clientY0??d.clientY??0;if(h.elementFromPoint?.(p,f)?.closest?.(".column-resizer, .column-drag-handle"))return;let k=this._columnInfoByKey(n.dataset.columnKey);!k||!this._isColumnReorderable(k.column)||this._startColumnReorderDrag(n,k.column,k.index,d.clientX??0,d.clientY??0)},move:d=>{this._moveColumnReorder(d.clientX??0,d.clientY??0)},end:()=>{this._endColumnReorder(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}}_startColumnResizeDrag(e,t,r,n){if(!this._isColumnResizable(t))return;let s=this._columnKeyForWidth(t,r),d=this._findHeaderCellByColumnKey(s),h=Math.max(this._columnMinWidth(t),Math.floor(d?.getBoundingClientRect().width||this._columnPixelWidth(t,r))),p={};this._responsiveColumns(this._orderedColumns(this._columns())).forEach((x,k)=>{let C=this._columnKeyForWidth(x,k),S=this._columnWidthOverrides[C];if(S!=null){p[C]=S;return}let z=C===s?d:this._findHeaderCellByColumnKey(C),T=C===s?h:Math.max(this._columnMinWidth(x),Math.floor(z?.getBoundingClientRect().width||this._columnPixelWidth(x,k)));p[C]=T}),this._applyColumnWidthOverrides(p),this._columnResizeState={key:s,column:t,columnIndex:r,startX:n,startWidth:h,minWidth:this._columnMinWidth(t),nextWidth:h},e.classList.add("active"),this.toggleAttribute("resizing-column",!0)}_moveColumnResize(e){if(!this._columnResizeState)return;let t=Math.max(this._columnResizeState.minWidth,Math.round(this._columnResizeState.startWidth+e-this._columnResizeState.startX));this._columnResizeState.nextWidth=t;let r=this._columnResizeState;this._applyColumnWidthOverrides({...this._columnWidthOverrides,[r.key]:r.nextWidth}),this.dispatchEvent(new CustomEvent("column-resize",{detail:{key:r.key,width:r.nextWidth,column:r.column,columnIndex:r.columnIndex},bubbles:!0,composed:!0}))}_endColumnResize(){this._columnResizeState&&(this._lastResizedColumnKey=this._columnResizeState.key,this._columnResizeState=null,this._resizeRaf&&(cancelAnimationFrame(this._resizeRaf),this._resizeRaf=0),this.toggleAttribute("resizing-column",!1),this.renderRoot.querySelectorAll(".column-resizer.active").forEach(e=>e.classList.remove("active")),this.dispatchEvent(new CustomEvent("column-widths-change",{detail:{widths:{...this._columnWidthOverrides}},bubbles:!0,composed:!0})))}_headerCellsByKey(e){return Array.from(this.renderRoot.querySelectorAll(`[data-column-key="${CSS.escape(e)}"]`))}_clearColumnDropMarkers(){this.renderRoot.querySelectorAll(".column-drop-before,.column-drop-after").forEach(e=>e.classList.remove("column-drop-before","column-drop-after"))}_clearColumnDragClasses(){this._clearColumnDropMarkers(),this.renderRoot.querySelectorAll(".column-drag-source,.column-drag-handle.active").forEach(e=>e.classList.remove("column-drag-source","active"))}_setColumnDropTarget(e,t="after"){let r=this._columnDragState;if(r&&!(r.overKey===e&&r.dropPosition===t)&&(this._clearColumnDropMarkers(),r.overKey=e,r.dropPosition=t,!!e))for(let n of this._headerCellsByKey(e))n.classList.add(t==="before"?"column-drop-before":"column-drop-after")}_applyColumnReorder(){let e=this._columnDragState;if(!e?.overKey)return;let r=this._responsiveColumns(this._orderedColumns(this._columns())).map((f,x)=>this._columnKey(f,x)),n=r.indexOf(e.key);if(n<0)return;let s=[...r],[d]=s.splice(n,1),h=s.indexOf(e.overKey);if(h<0||(s.splice(h+(e.dropPosition==="after"?1:0),0,d),s.join("\0")===r.join("\0")))return;this._columnOrderKeys=s;let p=this._responsiveColumns(this._orderedColumns(this._columns()));this._activeColumns=p,this._activeFixedMeta=this._fixedMeta(p),this.dispatchEvent(new CustomEvent("column-reorder",{detail:{fromKey:e.key,toKey:e.overKey,fromIndex:n,toIndex:s.indexOf(e.key),columns:p},bubbles:!0,composed:!0}))}_createColumnDragGhost(e,t,r){this._removeColumnDragGhost();let n=getComputedStyle(this),s=document.createElement("div");s.textContent=String(e.title??e.key??e.dataIndex??"Column"),s.style.cssText=["position:fixed","left:0","top:0","z-index:2147483000","pointer-events:none","display:inline-flex","align-items:center","max-width:220px","height:30px","padding:0 10px","border-radius:10px",`border:1px solid ${n.getPropertyValue("--lui-table-border").trim()||"rgb(0 0 0 / 0.12)"}`,`background:${n.getPropertyValue("--lui-color-bg-elevated").trim()||n.getPropertyValue("--lui-color-bg").trim()||"Canvas"}`,`color:${n.getPropertyValue("--lui-color-fg").trim()||"currentColor"}`,"box-shadow:0 12px 32px rgb(0 0 0 / 0.18)","font:600 13px/1 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif","white-space:nowrap","overflow:hidden","text-overflow:ellipsis","opacity:.96","will-change:transform"].join(";"),document.body.appendChild(s),this._columnDragGhost=s,this._moveColumnDragGhost(t,r)}_moveColumnDragGhost(e,t){this._columnDragGhost&&(this._columnDragGhost.style.transform=`translate3d(${Math.round(e+12)}px, ${Math.round(t+12)}px, 0)`)}_removeColumnDragGhost(){this._columnDragGhost?.remove(),this._columnDragGhost=null}_startColumnReorderDrag(e,t,r,n,s){if(!this._isColumnReorderable(t))return;let d=this._columnKeyForWidth(t,r);this._columnDragState={key:d,column:t,columnIndex:r,overKey:null,dropPosition:"after"},this._clearColumnDragClasses(),e.classList.add("active");for(let h of this._headerCellsByKey(d))h.classList.add("column-drag-source");this._createColumnDragGhost(t,n,s),this.toggleAttribute("dragging-column",!0)}_moveColumnReorder(e,t){let r=this._columnDragState;if(!r)return;this._moveColumnDragGhost(e,t);let d=[...this.renderRoot.elementsFromPoint?.(e,t)??[],...document.elementsFromPoint(e,t)].map(x=>x.closest?.("[data-column-key]")).find(x=>!!x),h=d?.dataset.columnKey;if(!d||!h||h===r.key){this._setColumnDropTarget(null);return}let p=d.getBoundingClientRect(),f=e<p.left+p.width/2?"before":"after";this._setColumnDropTarget(h,f)}_endColumnReorder(){this._columnDragState&&(this._columnDraggedAt=performance.now(),this._applyColumnReorder(),this._columnDragState=null,this.toggleAttribute("dragging-column",!1),this._clearColumnDragClasses(),this._removeColumnDragGhost())}_renderColumnDragHandle(e,t){return this._isColumnReorderable(e)?R.html`
4419
+ `};this._virtualKey=e=>this._getRowKey(e.row,e.index);this._skeletonWidths=["62%","78%","45%","70%","55%","82%"]}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._applyVirtualStyles();let e=typeof window<"u"?window.innerWidth:0;this._responsiveWidth=Math.round(this.getBoundingClientRect().width||e||0),this._responsiveResizeObserver=new ResizeObserver(t=>{let r=t[0],n=typeof window<"u"?window.innerWidth:0,s=Math.round(r?.contentRect.width||this.getBoundingClientRect().width||n||0);s>0&&s!==this._responsiveWidth&&(this._responsiveWidth=s)}),this._responsiveResizeObserver.observe(this)}disconnectedCallback(){this._endColumnResize(),this._endColumnReorder(),this._removeColumnDragGhost(),this._teardownColumnInteractions(),this._clearRowAnimationTimers(),this._scrollRaf&&cancelAnimationFrame(this._scrollRaf),this._gutterRaf&&cancelAnimationFrame(this._gutterRaf),this._resizeRaf&&cancelAnimationFrame(this._resizeRaf),this._columnInteractRaf&&cancelAnimationFrame(this._columnInteractRaf),this._responsiveResizeObserver?.disconnect(),this._responsiveResizeObserver=void 0,this._scrollRaf=0,this._gutterRaf=0,this._resizeRaf=0,this._columnInteractRaf=0,super.disconnectedCallback()}willUpdate(e){e.has("selectedRowKeys")&&(this._internalSelectedRowKeys=[...this.selectedRowKeys??[]]),e.has("columnWidths")&&this.columnWidths&&this._applyColumnWidthOverrides({...this.columnWidths}),(e.has("data")||e.has("dataSource")||e.has("source"))&&this._prepareRowAnimations();let t=L(this,"table");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("bordered")&&typeof t.bordered=="boolean"&&this.bordered!==t.bordered&&(this.bordered=t.bordered),!this._explicitAttrs.has("border")&&typeof t.border=="boolean"&&this.border!==t.border&&(this.border=t.border),!this._explicitAttrs.has("noborder")&&typeof t.noBorder=="boolean"&&this.noBorder!==t.noBorder&&(this.noBorder=t.noBorder),!this._explicitAttrs.has("striped")&&typeof t.striped=="boolean"&&this.striped!==t.striped&&(this.striped=t.striped),!this._explicitAttrs.has("hoverable")&&typeof t.hoverable=="boolean"&&this.hoverable!==t.hoverable&&(this.hoverable=t.hoverable),!this._explicitAttrs.has("column-resizable")&&typeof t.columnResizable=="boolean"&&this.columnResizable!==t.columnResizable&&(this.columnResizable=t.columnResizable),!this._explicitAttrs.has("column-reorderable")&&typeof t.columnReorderable=="boolean"&&this.columnReorderable!==t.columnReorderable&&(this.columnReorderable=t.columnReorderable),!this._explicitAttrs.has("selection")&&typeof t.selection=="string"&&this.selection!==t.selection&&(this.selection=t.selection),!this._explicitAttrs.has("select-on-click")&&typeof t.selectOnClick=="boolean"&&this.selectOnClick!==t.selectOnClick&&(this.selectOnClick=t.selectOnClick),!this._explicitAttrs.has("pagination")&&typeof t.pagination=="boolean"&&this.pagination!==t.pagination&&(this.pagination=t.pagination),!this._explicitAttrs.has("virtual")&&typeof t.virtual=="boolean"&&this.virtual!==t.virtual&&(this.virtual=t.virtual),!this._explicitAttrs.has("row-animation")&&typeof t.rowAnimation=="string"&&this.rowAnimation!==t.rowAnimation&&(this.rowAnimation=t.rowAnimation),!this._explicitAttrs.has("virtual-height")&&(typeof t.virtualHeight=="number"||typeof t.virtualHeight=="string")&&this.virtualHeight!==t.virtualHeight&&(this.virtualHeight=t.virtualHeight),!this._explicitAttrs.has("row-height")&&typeof t.rowHeight=="number"&&this.rowHeight!==t.rowHeight&&(this.rowHeight=t.rowHeight)}updated(e){(e.has("virtual")||e.has("virtualHeight")||e.has("rowHeight"))&&this._applyVirtualStyles(),this.virtual?(this._scheduleVirtualScrollbarGutter(),this._syncHorizontalScrollVars()):(this.style.setProperty("--lui-table-scrollbar-width","0px"),this.style.setProperty("--lui-table-scroll-left","0px"),this.style.setProperty("--lui-table-scroll-overflow","0px")),(e.has("data")||e.has("dataSource")||e.has("source")||e.has("pagination")||e.has("current")||e.has("pageSize"))&&(this._scrollTop=0,this._virtualStart=0,this._lastRangeKey="",this._scrollEl&&(this._scrollEl.scrollTop=0)),this._scheduleColumnInteractions()}_applyVirtualStyles(){let e=this._resolvedVirtualHeight(),t=this.showHeader?this._resolvedRowHeight():0;this.style.setProperty("--lui-table-virtual-height",Eo(this.virtualHeight)||"360px"),this.style.setProperty("--lui-table-virtual-body-height",`${Math.max(80,e-t)}px`),typeof this.rowHeight=="number"&&Number.isFinite(this.rowHeight)&&this.style.setProperty("--lui-table-row-height",`${Math.max(24,this.rowHeight)}px`)}_scheduleVirtualScrollbarGutter(){this._gutterRaf||(this._gutterRaf=requestAnimationFrame(()=>{this._gutterRaf=0;let e=this._virtualizerEl,t=e?Math.max(0,e.offsetWidth-e.clientWidth):0;this.style.setProperty("--lui-table-scrollbar-width",`${t}px`)}))}_syncHorizontalScrollVars(e=this._scrollEl){if(!e)return;let t=Math.max(0,e.scrollLeft||0),r=Math.max(0,e.scrollWidth-e.clientWidth);this.style.setProperty("--lui-table-scroll-left",`${t}px`),this.style.setProperty("--lui-table-scroll-overflow",`${r}px`)}_rows(){return this.dataSource??this.source??this.data??[]}_columns(){return this.columns?.length?this.columns:(this._slottedColumns??[]).map(e=>e.toColumn())}_orderedColumns(e){if(!this._columnOrderKeys.length)return e;let t=e.map((d,h)=>({column:d,key:this._columnKey(d,h)})),r=new Map(t.map(d=>[d.key,d.column])),n=new Set,s=[];for(let d of this._columnOrderKeys){let h=r.get(d);!h||n.has(d)||(s.push(h),n.add(d))}for(let d of t)n.has(d.key)||s.push(d.column);return s}_currentBreakpoint(){let e=typeof window<"u"?window.innerWidth:0;return jm(this._responsiveWidth||Math.round(this.getBoundingClientRect().width||e||0))}_responsiveColumns(e){let t=this._currentBreakpoint();return e.filter(r=>{let n=ep(r.responsive);return!n?.length||n.includes(t)})}_getRowKey(e,t){return typeof this.rowKey=="function"?this.rowKey(e,t):sa(e,this.rowKey)??t}_columnKey(e,t){return String(e.key??e.dataIndex??t)}_columnFixed(e){if(e.fixed===!0||e.fixed==="left")return"left";if(e.fixed==="right")return"right"}_columnKeyForWidth(e,t){return this._columnKey(e,t)}_columnOverrideWidth(e,t){return this._columnWidthOverrides[this._columnKeyForWidth(e,t)]}_columnPixelWidth(e,t){return Math.max(this._columnMinWidth(e),this._columnOverrideWidth(e,t)??Dc(e.width)??Dc(e.minWidth)??120)}_leadingColumnWidth(){return(this.showSeq?60:0)+(this.selection!=="none"?44:0)}_seqBase(){return this.pagination?(Math.max(1,this.current)-1)*Math.max(1,this.pageSize||10):0}_resizedTableWidth(e){return this._leadingColumnWidth()+e.reduce((t,r,n)=>t+this._columnPixelWidth(r,n),0)}_effectiveColumnWidths(e){if(this.resizeMode!=="adaptive"||Object.keys(this._columnWidthOverrides).length===0)return null;let t=[];for(let k=0;k<e.length;k+=1){let C=e[k];if(!this._columnOverrideWidth(C,k)&&!Eo(C.width))return null;t.push(this._columnPixelWidth(C,k))}let r=this._columnResizeState?.key??this._lastResizedColumnKey,n=r?e.findIndex((k,C)=>this._columnKeyForWidth(k,C)===r):-1,s=-1;for(let k=e.length-1;k>=0;k-=1)if(k!==n){s=k;break}if(s<0)return null;let d=Math.floor(this._scrollEl?.clientWidth||this.getBoundingClientRect().width),h=this._leadingColumnWidth(),p=h+t.reduce((k,C)=>k+C,0),f=d-p;if(!Number.isFinite(d)||d<=h||f<=0)return null;let x=[...t];return x[s]=Math.max(this._columnMinWidth(e[s]),Math.floor(t[s]+f)),x}_findHeaderCellByColumnKey(e){return this.renderRoot.querySelector(`[data-column-key="${CSS.escape(e)}"]`)}_applyColumnWidthOverrides(e){this._columnWidthOverrides=e,this.toggleAttribute("column-resized",Object.keys(e).length>0)}_fixedColumnSize(e,t){let r=this._activeEffectiveWidths?.[t];if(r)return`${r}px`;let n=this._columnOverrideWidth(e,t);return n?`${n}px`:Eo(e.width??e.minWidth)||"120px"}_sumCss(e){return e.length?e.length===1?e[0]:`calc(${e.join(" + ")})`:"0px"}_updateHasEllipsisColumn(e){this.toggleAttribute("has-ellipsis-column",e.some(t=>!!t.ellipsis)),this.toggleAttribute("has-fixed-column",e.some(t=>!!t.ellipsis||!!this._columnFixed(t)||!!Eo(t.width)||!!Eo(t.minWidth)))}_fixedMeta(e){let t=e.map(h=>({fixed:this._columnFixed(h),offset:"0px",edge:!1})),r=t.map((h,p)=>h.fixed==="left"?p:-1).filter(h=>h>=0),n=t.map((h,p)=>h.fixed==="right"?p:-1).filter(h=>h>=0),s=this.selection!=="none"&&r.length>0?["44px"]:[];for(let h of r)t[h].offset=this._sumCss(s),s.push(this._fixedColumnSize(e[h],h));let d=[];for(let h=n.length-1;h>=0;h-=1){let p=n[h];t[p].offset=this._sumCss(d),d.push(this._fixedColumnSize(e[p],p))}return r.length&&(t[r[r.length-1]].edge=!0),n.length&&(t[n[0]].edge=!0),t}_hasLeftFixed(e){return e.some(t=>this._columnFixed(t)==="left")}_fixedClass(e,t=""){return e?.fixed?`${t} fixed-${e.fixed} ${e.edge?`fixed-${e.fixed}-edge`:""}`.trim():t}_fixedStyle(e,t=""){let r=t?[t]:[];return e?.fixed&&r.push(`--lui-table-sticky-${e.fixed}:${e.offset}`),r.filter(Boolean).join(";")}_selectionFixedClass(e,t=""){return this.selection==="none"||!this._hasLeftFixed(e)?t:`${t} fixed-left fixed-selection`.trim()}_selectionFixedStyle(e){return this.selection!=="none"&&this._hasLeftFixed(e)?"--lui-table-sticky-left:0px":""}_selectedKeys(){return this._internalSelectedRowKeys}_sortedRows(e,t){if(!this.sortKey||this.sortOrder==="none")return e;let r=t.find((s,d)=>this._columnKey(s,d)===this.sortKey);if(!r)return e;if(this.sorter)return this.sorter(e,{key:this.sortKey,order:this.sortOrder,column:r});let n=this.sortOrder==="asc"?1:-1;return[...e].sort((s,d)=>(r.sorter?r.sorter(s,d,r):Am(sa(s,r.dataIndex??r.key),sa(d,r.dataIndex??r.key)))*n)}_pagedRows(e){if(!this.pagination||this.remotePagination)return e;let t=Math.max(1,this.pageSize||10),r=Math.max(1,this.current||1);return e.slice((r-1)*t,r*t)}_rowKeyString(e,t){return String(this._getRowKey(e,t))}_rowAnimationsEnabled(e=this._activeRows.length){return this.rowAnimation!=="none"&&!this.virtual&&e<=500}_clearRowAnimationTimers(){for(let e of this._rowAnimationTimers)clearTimeout(e);this._rowAnimationTimers=[]}_prepareRowAnimations(){let e=this._activeRows??[],t=this._orderedColumns(this._columns()),r=this._pagedRows(this._sortedRows(this._rows(),t));if(!this._rowAnimationsEnabled(Math.max(e.length,r.length))||e.length===0){this._leavingRows=[],this._enteringRowKeys.clear();return}let n=e.map((k,C)=>this._rowKeyString(k,C)),s=r.map((k,C)=>this._rowKeyString(k,C)),d=new Set(n),h=new Set(s),p=[];e.forEach((k,C)=>{let S=n[C];h.has(S)||p.push({row:k,index:C,key:this._getRowKey(k,C)})});let f=new Set;if(s.forEach(k=>{d.has(k)||f.add(k)}),!p.length&&!f.size)return;this._clearRowAnimationTimers(),this._leavingRows=p,this._enteringRowKeys=f,this._rowAnimationTimers.push(setTimeout(()=>{this._leavingRows=[],this._enteringRowKeys.clear(),this.requestUpdate()},220))}_bodyDisplayRows(e,t,r,n){let s=e.map((h,p)=>{let f=t+p,x=this._getRowKey(h,f);return{row:h,rowIndex:f,key:x,leaving:!1,entering:this._enteringRowKeys.has(String(x))}});if(!this._rowAnimationsEnabled(s.length)||r>0||n>0||!this._leavingRows.length)return s;let d=new Set(s.map(h=>String(h.key)));for(let h of this._leavingRows)d.has(String(h.key))||s.splice(Math.min(h.index,s.length),0,{row:h.row,rowIndex:h.index,key:h.key,leaving:!0,entering:!1});return s}_resolvedRowHeight(){return typeof this.rowHeight=="number"&&Number.isFinite(this.rowHeight)?Math.max(24,this.rowHeight):this.size==="sm"?36:this.size==="lg"?52:44}_resolvedVirtualHeight(){if(typeof this.virtualHeight=="number"&&Number.isFinite(this.virtualHeight))return Math.max(80,this.virtualHeight);let e=Number.parseFloat(String(this.virtualHeight));return Number.isFinite(e)?Math.max(80,e):360}_calculateVirtualStart(e,t=this._resolvedRowHeight()){let r=Math.max(0,Math.floor(this.overscan||0));return Math.max(0,Math.floor(e/t)-r)}_virtualRange(e){if(!this.virtual||e.length===0)return{start:0,end:e.length,before:0,after:0,visibleRows:e};let t=this._resolvedRowHeight(),r=this._resolvedVirtualHeight(),n=Math.max(0,Math.floor(this.overscan||0)),s=Math.max(0,e.length-1),d=Math.min(s,this._virtualStart),h=Math.ceil(r/t)+n*2,p=Math.min(e.length,d+h),f=`${d}:${p}:${e.length}`;return f!==this._lastRangeKey&&(this._lastRangeKey=f,queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("visible-range-change",{detail:{start:d,end:p,total:e.length},bubbles:!0,composed:!0}))})),{start:d,end:p,before:d*t,after:Math.max(0,(e.length-p)*t),visibleRows:e.slice(d,p)}}scrollToIndex(e,t="start"){if(this.virtual&&this._virtualizerEl){this._virtualizerEl.scrollToIndex(e,t);return}let r=this._scrollEl;if(!r)return;let n=this._resolvedRowHeight(),s=this._resolvedVirtualHeight(),d=Math.max(0,e)*n;t==="center"&&(d-=(s-n)/2),t==="end"&&(d-=s-n),r.scrollTop=Math.max(0,d),this._scrollTop=r.scrollTop,this._virtualStart=this._calculateVirtualStart(this._scrollTop)}getColumnWidths(){return{...this._columnWidthOverrides}}_selectedRowsForKeys(e,t){if(!e.length)return[];let r=new Set(e.map(String)),n=[];for(let s=0;s<t.length;s+=1){let d=t[s];if(r.has(String(this._getRowKey(d,s)))&&n.push(d),n.length>=e.length)break}return n}_emitSelection(e,t){this._internalSelectedRowKeys=e,this.dispatchEvent(new CustomEvent("selection-change",{detail:{selectedRowKeys:e,selectedRows:this._selectedRowsForKeys(e,t)},bubbles:!0,composed:!0}))}_setCheckboxState(e,t,r=!1){e&&Object.assign(e,{checked:t,indeterminate:r})}_syncRenderedSelection(){let e=new Set(this._selectedKeys().map(String));this.renderRoot.querySelectorAll("[data-row-key]").forEach(r=>{let n=e.has(r.dataset.rowKey??"");r.classList.toggle("selected",n),this._setCheckboxState(r.querySelector("lui-checkbox"),n)}),this._syncHeaderCheckbox()}_syncHeaderCheckbox(){let e=this.renderRoot.querySelector('[data-table-select-all="true"]');if(!e)return;let t=Array.from(this.renderRoot.querySelectorAll("[data-row-key]")),r=new Set(this._selectedKeys().map(String)),n=t.filter(s=>r.has(s.dataset.rowKey??"")).length;this._setCheckboxState(e,t.length>0&&n===t.length,n>0&&n<t.length)}_toggleRow(e,t,r,n,s){let d=this._getRowKey(e,t);if(this.selection==="single"){this._emitSelection(r?[d]:[],n),this._syncRenderedSelection();return}let h=this._selectedKeys().filter(p=>String(p)!==String(d));r&&h.push(d),this._emitSelection(h,n),this._syncRenderedSelection()}_toggleAll(e,t,r){let n=this._selectedKeys(),s=t.map((f,x)=>this._getRowKey(f,x)),d=new Set(s.map(String)),h=n.filter(f=>!d.has(String(f))),p=e?[...h,...s]:h;this._emitSelection(p,r),this._syncRenderedSelection()}_toggleSort(e,t){if(!e.sortable&&!e.sorter)return;let r=this._columnKey(e,t),n="asc";this.sortKey===r&&(n=this.sortOrder==="asc"?"desc":this.sortOrder==="desc"?"none":"asc"),this.sortKey=n==="none"?"":r,this.sortOrder=n,this.dispatchEvent(new CustomEvent("sort",{detail:{key:r,order:n,column:e},bubbles:!0,composed:!0}))}_totalRows(){return typeof this.total=="number"?this.total:this._rows().length}_isInteractiveTarget(e){return e instanceof HTMLElement&&!!e.closest?.("lui-checkbox,lui-button,button,a,input,select,textarea,[data-table-ignore-row-click]")}_onRowClick(e,t,r,n){if(!this._isInteractiveTarget(e.target)){if(this.selectOnClick&&this.selection!=="none"){let s=this._selectedKeys().some(d=>String(d)===String(r));this._toggleRow(t,n,this.selection==="single"?!0:!s,this._activeRows,e)}this.onRow?.(t,n)?.onClick?.(e),this.dispatchEvent(new CustomEvent("row-click",{detail:{row:t,rowKey:r,index:n,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0}))}}_onRowDblClick(e,t,r,n){this._isInteractiveTarget(e.target)||(this.onRow?.(t,n)?.onDoubleClick?.(e),this.dispatchEvent(new CustomEvent("row-dblclick",{detail:{row:t,rowKey:r,index:n,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0})))}_onRowContextMenu(e,t,r){this._isInteractiveTarget(e.target)||this.onRow?.(t,r)?.onContextMenu?.(e)}_onRowMouseEnter(e,t,r){this.onRow?.(t,r)?.onMouseEnter?.(e)}_onRowMouseLeave(e,t,r){this.onRow?.(t,r)?.onMouseLeave?.(e)}_cellContext(e,t,r,n){let s=this._getRowKey(e,t),d=this._columnKey(r,n),h=sa(e,r.dataIndex??r.key);return{row:e,rowKey:s,rowIndex:t,column:r,columnKey:d,columnIndex:n,value:h}}_onCellClick(e,t,r,n,s){if(this._isInteractiveTarget(e.target))return;let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onClick?.(e),this.onCell?.(d)?.onClick?.(e),n.onClick?.(e,d),this.dispatchEvent(new CustomEvent("cell-click",{detail:{...d,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellDblClick(e,t,r,n,s){if(this._isInteractiveTarget(e.target))return;let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onDoubleClick?.(e),this.onCell?.(d)?.onDoubleClick?.(e),n.onDblClick?.(e,d),this.dispatchEvent(new CustomEvent("cell-dblclick",{detail:{...d,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellContextMenu(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onContextMenu?.(e),this.onCell?.(d)?.onContextMenu?.(e),n.onContextMenu?.(e,d),this.dispatchEvent(new CustomEvent("cell-contextmenu",{detail:{...d,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellMouseEnter(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onMouseEnter?.(e),this.onCell?.(d)?.onMouseEnter?.(e)}_onCellMouseLeave(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onMouseLeave?.(e),this.onCell?.(d)?.onMouseLeave?.(e)}_headerCellContext(e,t){return{column:e,columnKey:this._columnKey(e,t),columnIndex:t}}_callHeaderRowHandler(e,t,r){this.onHeaderRow?.(r,0)?.[t]?.(e)}_callHeaderCellHandler(e,t,r,n){this.onHeaderCell?.(this._headerCellContext(r,n))?.[t]?.(e)}_onHeaderCellClick(e,t,r,n){performance.now()-this._columnDraggedAt<200||(this._callHeaderCellHandler(e,"onClick",t,r),n&&this._toggleSort(t,r))}_isColumnResizable(e){return e.resizable??this.columnResizable}_isColumnReorderable(e){return e.reorderable??this.columnReorderable}_columnMinWidth(e){return Math.max(48,Dc(e.minWidth)??48)}_columnInfoByKey(e){if(!e)return null;let t=this._responsiveColumns(this._orderedColumns(this._columns())),r=t.findIndex((n,s)=>this._columnKeyForWidth(n,s)===e);return r>=0?{column:t[r],index:r}:null}_teardownColumnInteractions(){for(let e of this._columnInteractDisposers)e();this._columnInteractDisposers=[]}_scheduleColumnInteractions(){this._columnInteractRaf||(this._columnInteractRaf=requestAnimationFrame(()=>{this._columnInteractRaf=0,this._syncColumnInteractions()}))}_syncColumnInteractions(){if(!this.isConnected||this._columnResizeState||this._columnDragState||(this._teardownColumnInteractions(),!this.showHeader))return;let e=Array.from(this.renderRoot.querySelectorAll(".column-resizer"));for(let n of e){let s=(0,hl.default)(n).draggable({listeners:{start:d=>{let h=this._columnInfoByKey(n.dataset.columnKey);!h||!this._isColumnResizable(h.column)||this._startColumnResizeDrag(n,h.column,h.index,d.clientX??0)},move:d=>{this._moveColumnResize(d.clientX??0)},end:()=>{this._endColumnResize(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}let t=Array.from(this.renderRoot.querySelectorAll(".column-drag-handle"));for(let n of t){let s=(0,hl.default)(n).draggable({listeners:{start:d=>{let h=this._columnInfoByKey(n.dataset.columnKey);!h||!this._isColumnReorderable(h.column)||this._startColumnReorderDrag(n,h.column,h.index,d.clientX??0,d.clientY??0)},move:d=>{this._moveColumnReorder(d.clientX??0,d.clientY??0)},end:()=>{this._endColumnReorder(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}let r=Array.from(this.renderRoot.querySelectorAll("th[data-reorderable='true'], .vhead-cell[data-reorderable='true']"));for(let n of r){let s=(0,hl.default)(n).draggable({listeners:{start:d=>{if(this._columnResizeState||this._columnDragState)return;let h=this.renderRoot,p=d.clientX0??d.clientX??0,f=d.clientY0??d.clientY??0;if(h.elementFromPoint?.(p,f)?.closest?.(".column-resizer, .column-drag-handle"))return;let k=this._columnInfoByKey(n.dataset.columnKey);!k||!this._isColumnReorderable(k.column)||this._startColumnReorderDrag(n,k.column,k.index,d.clientX??0,d.clientY??0)},move:d=>{this._moveColumnReorder(d.clientX??0,d.clientY??0)},end:()=>{this._endColumnReorder(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}}_startColumnResizeDrag(e,t,r,n){if(!this._isColumnResizable(t))return;let s=this._columnKeyForWidth(t,r),d=this._findHeaderCellByColumnKey(s),h=Math.max(this._columnMinWidth(t),Math.floor(d?.getBoundingClientRect().width||this._columnPixelWidth(t,r))),p={};this._responsiveColumns(this._orderedColumns(this._columns())).forEach((x,k)=>{let C=this._columnKeyForWidth(x,k),S=this._columnWidthOverrides[C];if(S!=null){p[C]=S;return}let z=C===s?d:this._findHeaderCellByColumnKey(C),T=C===s?h:Math.max(this._columnMinWidth(x),Math.floor(z?.getBoundingClientRect().width||this._columnPixelWidth(x,k)));p[C]=T}),this._applyColumnWidthOverrides(p),this._columnResizeState={key:s,column:t,columnIndex:r,startX:n,startWidth:h,minWidth:this._columnMinWidth(t),nextWidth:h},e.classList.add("active"),this.toggleAttribute("resizing-column",!0)}_moveColumnResize(e){if(!this._columnResizeState)return;let t=Math.max(this._columnResizeState.minWidth,Math.round(this._columnResizeState.startWidth+e-this._columnResizeState.startX));this._columnResizeState.nextWidth=t;let r=this._columnResizeState;this._applyColumnWidthOverrides({...this._columnWidthOverrides,[r.key]:r.nextWidth}),this.dispatchEvent(new CustomEvent("column-resize",{detail:{key:r.key,width:r.nextWidth,column:r.column,columnIndex:r.columnIndex},bubbles:!0,composed:!0}))}_endColumnResize(){this._columnResizeState&&(this._lastResizedColumnKey=this._columnResizeState.key,this._columnResizeState=null,this._resizeRaf&&(cancelAnimationFrame(this._resizeRaf),this._resizeRaf=0),this.toggleAttribute("resizing-column",!1),this.renderRoot.querySelectorAll(".column-resizer.active").forEach(e=>e.classList.remove("active")),this.dispatchEvent(new CustomEvent("column-widths-change",{detail:{widths:{...this._columnWidthOverrides}},bubbles:!0,composed:!0})))}_headerCellsByKey(e){return Array.from(this.renderRoot.querySelectorAll(`[data-column-key="${CSS.escape(e)}"]`))}_clearColumnDropMarkers(){this.renderRoot.querySelectorAll(".column-drop-before,.column-drop-after").forEach(e=>e.classList.remove("column-drop-before","column-drop-after"))}_clearColumnDragClasses(){this._clearColumnDropMarkers(),this.renderRoot.querySelectorAll(".column-drag-source,.column-drag-handle.active").forEach(e=>e.classList.remove("column-drag-source","active"))}_setColumnDropTarget(e,t="after"){let r=this._columnDragState;if(r&&!(r.overKey===e&&r.dropPosition===t)&&(this._clearColumnDropMarkers(),r.overKey=e,r.dropPosition=t,!!e))for(let n of this._headerCellsByKey(e))n.classList.add(t==="before"?"column-drop-before":"column-drop-after")}_applyColumnReorder(){let e=this._columnDragState;if(!e?.overKey)return;let r=this._responsiveColumns(this._orderedColumns(this._columns())).map((f,x)=>this._columnKey(f,x)),n=r.indexOf(e.key);if(n<0)return;let s=[...r],[d]=s.splice(n,1),h=s.indexOf(e.overKey);if(h<0||(s.splice(h+(e.dropPosition==="after"?1:0),0,d),s.join("\0")===r.join("\0")))return;this._columnOrderKeys=s;let p=this._responsiveColumns(this._orderedColumns(this._columns()));this._activeColumns=p,this._activeFixedMeta=this._fixedMeta(p),this.dispatchEvent(new CustomEvent("column-reorder",{detail:{fromKey:e.key,toKey:e.overKey,fromIndex:n,toIndex:s.indexOf(e.key),columns:p},bubbles:!0,composed:!0}))}_createColumnDragGhost(e,t,r){this._removeColumnDragGhost();let n=getComputedStyle(this),s=document.createElement("div");s.textContent=String(e.title??e.key??e.dataIndex??"Column"),s.style.cssText=["position:fixed","left:0","top:0","z-index:2147483000","pointer-events:none","display:inline-flex","align-items:center","max-width:220px","height:30px","padding:0 10px","border-radius:10px",`border:1px solid ${n.getPropertyValue("--lui-table-border").trim()||"rgb(0 0 0 / 0.12)"}`,`background:${n.getPropertyValue("--lui-color-bg-elevated").trim()||n.getPropertyValue("--lui-color-bg").trim()||"Canvas"}`,`color:${n.getPropertyValue("--lui-color-fg").trim()||"currentColor"}`,"box-shadow:0 12px 32px rgb(0 0 0 / 0.18)","font:600 13px/1 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif","white-space:nowrap","overflow:hidden","text-overflow:ellipsis","opacity:.96","will-change:transform"].join(";"),document.body.appendChild(s),this._columnDragGhost=s,this._moveColumnDragGhost(t,r)}_moveColumnDragGhost(e,t){this._columnDragGhost&&(this._columnDragGhost.style.transform=`translate3d(${Math.round(e+12)}px, ${Math.round(t+12)}px, 0)`)}_removeColumnDragGhost(){this._columnDragGhost?.remove(),this._columnDragGhost=null}_startColumnReorderDrag(e,t,r,n,s){if(!this._isColumnReorderable(t))return;let d=this._columnKeyForWidth(t,r);this._columnDragState={key:d,column:t,columnIndex:r,overKey:null,dropPosition:"after"},this._clearColumnDragClasses(),e.classList.add("active");for(let h of this._headerCellsByKey(d))h.classList.add("column-drag-source");this._createColumnDragGhost(t,n,s),this.toggleAttribute("dragging-column",!0)}_moveColumnReorder(e,t){let r=this._columnDragState;if(!r)return;this._moveColumnDragGhost(e,t);let d=[...this.renderRoot.elementsFromPoint?.(e,t)??[],...document.elementsFromPoint(e,t)].map(x=>x.closest?.("[data-column-key]")).find(x=>!!x),h=d?.dataset.columnKey;if(!d||!h||h===r.key){this._setColumnDropTarget(null);return}let p=d.getBoundingClientRect(),f=e<p.left+p.width/2?"before":"after";this._setColumnDropTarget(h,f)}_endColumnReorder(){this._columnDragState&&(this._columnDraggedAt=performance.now(),this._applyColumnReorder(),this._columnDragState=null,this.toggleAttribute("dragging-column",!1),this._clearColumnDragClasses(),this._removeColumnDragGhost())}_renderColumnDragHandle(e,t){return this._isColumnReorderable(e)?R.html`
4420
4420
  <span
4421
4421
  class="column-drag-handle"
4422
4422
  part="column-drag-handle"
@@ -4441,9 +4441,9 @@
4441
4441
  <colgroup>
4442
4442
  ${this.showSeq?R.html`<col style="width:60px;min-width:60px;" />`:R.nothing}
4443
4443
  ${this.selection!=="none"?R.html`<col style="width:44px;min-width:44px;" />`:R.nothing}
4444
- ${e.map((t,r)=>{let n=this._columnOverrideWidth(t,r),s=this._activeEffectiveWidths?.[r],d=s?`${s}px`:n?`${n}px`:Qo(t.width),h=Qo(t.minWidth);return R.html`<col style=${[d?`width:${d}`:"",h?`min-width:${h}`:""].filter(Boolean).join(";")} />`})}
4444
+ ${e.map((t,r)=>{let n=this._columnOverrideWidth(t,r),s=this._activeEffectiveWidths?.[r],d=s?`${s}px`:n?`${n}px`:Eo(t.width),h=Eo(t.minWidth);return R.html`<col style=${[d?`width:${d}`:"",h?`min-width:${h}`:""].filter(Boolean).join(";")} />`})}
4445
4445
  </colgroup>
4446
- `}_gridTemplateColumns(e){let t=[];this.showSeq&&t.push("60px"),this.selection!=="none"&&t.push("44px");for(let r=0;r<e.length;r+=1){let n=e[r],s=this._columnOverrideWidth(n,r),d=this._activeEffectiveWidths?.[r];if(d)t.push(`${d}px`);else if(s)t.push(`${s}px`);else if(n.width){let h=Qo(n.width);t.push(this._columnFixed(n)?h:`minmax(${h}, 1fr)`)}else this._columnFixed(n)?t.push(this._fixedColumnSize(n,r)):n.minWidth?t.push(`minmax(${Qo(n.minWidth)}, 1fr)`):t.push("minmax(120px, 1fr)")}return t.join(" ")}_tableStyle(e,t=0){let r=[`--lui-table-grid-columns:${this._gridTemplateColumns(e)}`];if(Object.keys(this._columnWidthOverrides).length>0){let n=this._resizedTableWidth(e);r.push(`--lui-table-min-width:${n}px`),!e.some((d,h)=>!this._columnOverrideWidth(d,h)&&!Qo(d.width))&&!this._activeEffectiveWidths&&r.push(`--lui-table-resized-width:${n}px`)}return this.virtual&&r.push(`--lui-table-total-height:${Math.max(1,t)*this._resolvedRowHeight()}px`),r.join(";")}_renderVirtualHeader(e,t,r){if(!this.showHeader)return R.nothing;let n=this._selectedKeys(),s=this._fixedMeta(e),h=t.map((p,f)=>this._getRowKey(p,f)).filter(p=>n.some(f=>String(f)===String(p))).length;return R.html`
4446
+ `}_gridTemplateColumns(e){let t=[];this.showSeq&&t.push("60px"),this.selection!=="none"&&t.push("44px");for(let r=0;r<e.length;r+=1){let n=e[r],s=this._columnOverrideWidth(n,r),d=this._activeEffectiveWidths?.[r];if(d)t.push(`${d}px`);else if(s)t.push(`${s}px`);else if(n.width){let h=Eo(n.width);t.push(this._columnFixed(n)?h:`minmax(${h}, 1fr)`)}else this._columnFixed(n)?t.push(this._fixedColumnSize(n,r)):n.minWidth?t.push(`minmax(${Eo(n.minWidth)}, 1fr)`):t.push("minmax(120px, 1fr)")}return t.join(" ")}_tableStyle(e,t=0){let r=[`--lui-table-grid-columns:${this._gridTemplateColumns(e)}`],n=e.some(s=>!!s.ellipsis||!!this._columnFixed(s)||!!Eo(s.width)||!!Eo(s.minWidth));if(Object.keys(this._columnWidthOverrides).length>0){let s=this._resizedTableWidth(e);r.push(`--lui-table-min-width:${s}px`),!e.some((h,p)=>!this._columnOverrideWidth(h,p)&&!Eo(h.width))&&!this._activeEffectiveWidths&&r.push(`--lui-table-resized-width:${s}px`)}else n&&r.push(`--lui-table-min-width:${this._resizedTableWidth(e)}px`);return this.virtual&&r.push(`--lui-table-total-height:${Math.max(1,t)*this._resolvedRowHeight()}px`),r.join(";")}_renderVirtualHeader(e,t,r){if(!this.showHeader)return R.nothing;let n=this._selectedKeys(),s=this._fixedMeta(e),h=t.map((p,f)=>this._getRowKey(p,f)).filter(p=>n.some(f=>String(f)===String(p))).length;return R.html`
4447
4447
  <div
4448
4448
  class="virtual-head"
4449
4449
  part="virtual-head"
@@ -4607,7 +4607,7 @@
4607
4607
  `:R.nothing}
4608
4608
  </th>
4609
4609
  `:R.nothing}
4610
- ${e.map((p,f)=>{let x=p.align??"left",k=this._columnOverrideWidth(p,f),C=[k?`width:${k}px`:p.width?`width:${Qo(p.width)}`:"",p.minWidth?`min-width:${Qo(p.minWidth)}`:""].filter(Boolean).join(";"),S=!!(p.sortable||p.sorter),z=this.sortKey===this._columnKey(p,f)?this.sortOrder:"none",T=s[f];return R.html`
4610
+ ${e.map((p,f)=>{let x=p.align??"left",k=this._columnOverrideWidth(p,f),C=[k?`width:${k}px`:p.width?`width:${Eo(p.width)}`:"",p.minWidth?`min-width:${Eo(p.minWidth)}`:""].filter(Boolean).join(";"),S=!!(p.sortable||p.sorter),z=this.sortKey===this._columnKey(p,f)?this.sortOrder:"none",T=s[f];return R.html`
4611
4611
  <th
4612
4612
  class=${this._fixedClass(T,`align-${x} ${p.className??""}`)}
4613
4613
  style=${this._fixedStyle(T,C)}
@@ -5298,9 +5298,11 @@
5298
5298
  .vhead-cell[data-reorderable="true"] {
5299
5299
  position: relative;
5300
5300
  /* Safari/老 Firefox 对 display:table-cell 的 position:relative 会忽略,
5301
- 把手回落到 .table-wrap 全部堆在表右缘;translateZ(0) 把 th 提升为
5302
- transform containing block,等效定位且全平台一致 */
5303
- transform: translateZ(0);
5301
+ 把手回落到 .table-wrap 全部堆在表右缘。不能用 transform:translateZ(0):
5302
+ 变换把 th 提升成合成层,fixed 列表头自身的 sticky 会失效(表头不吸、
5303
+ 表体却正常)。contain:paint 同样让元素成为后代定位的 containing
5304
+ block,但不影响自身 sticky */
5305
+ contain: paint;
5304
5306
  }
5305
5307
  .column-drag-handle {
5306
5308
  display: inline-flex;
@@ -5423,7 +5425,7 @@
5423
5425
  justify-content: flex-end;
5424
5426
  margin-top: 12px;
5425
5427
  }
5426
- `],a([(0,W.property)({attribute:!1})],Y.prototype,"columns",2),a([(0,W.property)({attribute:!1})],Y.prototype,"data",2),a([(0,W.property)({attribute:!1})],Y.prototype,"dataSource",2),a([(0,W.property)({attribute:!1})],Y.prototype,"source",2),a([(0,W.property)({attribute:"row-key"})],Y.prototype,"rowKey",2),a([(0,W.property)({reflect:!0})],Y.prototype,"size",2),a([(0,W.property)({reflect:!0})],Y.prototype,"selection",2),a([(0,W.property)({attribute:!1,hasChanged:(e,t)=>{if(e===t)return!1;if(!e||!t||e.length!==t.length)return!0;let r=new Set(t.map(String));return e.some(n=>!r.has(String(n)))}})],Y.prototype,"selectedRowKeys",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"bordered",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"border",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"noborder"})],Y.prototype,"noBorder",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"striped",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"hoverable",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"sticky-header"})],Y.prototype,"stickyHeader",2),a([(0,W.property)({type:Boolean,attribute:"show-header"})],Y.prototype,"showHeader",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"column-resizable"})],Y.prototype,"columnResizable",2),a([(0,W.property)({reflect:!0,attribute:"resize-mode"})],Y.prototype,"resizeMode",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"column-reorderable"})],Y.prototype,"columnReorderable",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"loading",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"virtual",2),a([(0,W.property)({attribute:"virtual-height"})],Y.prototype,"virtualHeight",2),a([(0,W.property)({type:Number,attribute:"row-height"})],Y.prototype,"rowHeight",2),a([(0,W.property)({type:Number})],Y.prototype,"overscan",2),a([(0,W.property)({type:Boolean})],Y.prototype,"pagination",2),a([(0,W.property)({type:Boolean,attribute:"remote-pagination"})],Y.prototype,"remotePagination",2),a([(0,W.property)({type:Number})],Y.prototype,"current",2),a([(0,W.property)({type:Number,attribute:"page-size"})],Y.prototype,"pageSize",2),a([(0,W.property)({type:Number})],Y.prototype,"total",2),a([(0,W.property)({type:Boolean,attribute:"show-size-changer"})],Y.prototype,"showSizeChanger",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"show-seq"})],Y.prototype,"showSeq",2),a([(0,W.property)({attribute:"seq-label"})],Y.prototype,"seqLabel",2),a([(0,W.property)({attribute:!1})],Y.prototype,"footerData",2),a([(0,W.property)({type:Boolean,attribute:"show-overflow"})],Y.prototype,"showOverflow",2),a([(0,W.property)({type:Boolean,attribute:"show-header-overflow"})],Y.prototype,"showHeaderOverflow",2),a([(0,W.property)({attribute:"column-widths",converter:{fromAttribute(e){if(!(e==null||e===""))try{let t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t))return Object.fromEntries(Object.entries(t).filter(([,r])=>Number.isFinite(Number(r))).map(([r,n])=>[r,Math.round(Number(n))]))}catch{}},toAttribute(e){return e==null?null:JSON.stringify(e)}}})],Y.prototype,"columnWidths",2),a([(0,W.property)()],Y.prototype,"emptyText",2),a([(0,W.property)({attribute:"sort-key"})],Y.prototype,"sortKey",2),a([(0,W.property)({attribute:"sort-order"})],Y.prototype,"sortOrder",2),a([(0,W.property)({attribute:!1})],Y.prototype,"sorter",2),a([(0,W.property)({type:Boolean,attribute:"row-clickable"})],Y.prototype,"rowClickable",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"select-on-click"})],Y.prototype,"selectOnClick",2),a([(0,W.property)({reflect:!0,attribute:"row-animation"})],Y.prototype,"rowAnimation",2),a([(0,W.property)({attribute:!1})],Y.prototype,"onRow",2),a([(0,W.property)({attribute:!1})],Y.prototype,"onCell",2),a([(0,W.property)({attribute:!1})],Y.prototype,"onHeaderRow",2),a([(0,W.property)({attribute:!1})],Y.prototype,"onHeaderCell",2),a([(0,W.query)(".scroll")],Y.prototype,"_scrollEl",2),a([(0,W.query)("lit-virtualizer.table-virtualizer")],Y.prototype,"_virtualizerEl",2),a([(0,W.queryAssignedElements)({flatten:!0,selector:"lui-table-column"})],Y.prototype,"_slottedColumns",2),a([(0,W.state)()],Y.prototype,"_responsiveWidth",2),a([(0,W.state)()],Y.prototype,"_columnWidthOverrides",2),a([(0,W.state)()],Y.prototype,"_columnOrderKeys",2),a([(0,W.state)()],Y.prototype,"_virtualStart",2),Y=a([(0,W.customElement)("lui-table")],Y);var Lo=require("lit"),rt=require("lit/decorators.js");var hn=require("lit"),No=require("lit/decorators.js");var Gr=class extends hn.LitElement{constructor(){super(...arguments);this.content="";this.placement="top";this.disabled=!1;this.showArrow=!0;this.openDelay=120;this.closeDelay=80;this.offsetDistance=8;this.popoverProps={}}updated(){if(this._popover){let e=L(this,"tooltip");se(this._popover,{...e.popoverProps??{},...this.popoverProps??{}})}}render(){let e=this.content.trim().length>0;return hn.html`
5428
+ `],a([(0,W.property)({attribute:!1})],Y.prototype,"columns",2),a([(0,W.property)({attribute:!1})],Y.prototype,"data",2),a([(0,W.property)({attribute:!1})],Y.prototype,"dataSource",2),a([(0,W.property)({attribute:!1})],Y.prototype,"source",2),a([(0,W.property)({attribute:"row-key"})],Y.prototype,"rowKey",2),a([(0,W.property)({reflect:!0})],Y.prototype,"size",2),a([(0,W.property)({reflect:!0})],Y.prototype,"selection",2),a([(0,W.property)({attribute:!1,hasChanged:(e,t)=>{if(e===t)return!1;if(!e||!t||e.length!==t.length)return!0;let r=new Set(t.map(String));return e.some(n=>!r.has(String(n)))}})],Y.prototype,"selectedRowKeys",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"bordered",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"border",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"noborder"})],Y.prototype,"noBorder",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"striped",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"hoverable",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"sticky-header"})],Y.prototype,"stickyHeader",2),a([(0,W.property)({type:Boolean,attribute:"show-header"})],Y.prototype,"showHeader",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"column-resizable"})],Y.prototype,"columnResizable",2),a([(0,W.property)({reflect:!0,attribute:"resize-mode"})],Y.prototype,"resizeMode",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"column-reorderable"})],Y.prototype,"columnReorderable",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"loading",2),a([(0,W.property)({type:Boolean,reflect:!0})],Y.prototype,"virtual",2),a([(0,W.property)({attribute:"virtual-height"})],Y.prototype,"virtualHeight",2),a([(0,W.property)({type:Number,attribute:"row-height"})],Y.prototype,"rowHeight",2),a([(0,W.property)({type:Number})],Y.prototype,"overscan",2),a([(0,W.property)({type:Boolean})],Y.prototype,"pagination",2),a([(0,W.property)({type:Boolean,attribute:"remote-pagination"})],Y.prototype,"remotePagination",2),a([(0,W.property)({type:Number})],Y.prototype,"current",2),a([(0,W.property)({type:Number,attribute:"page-size"})],Y.prototype,"pageSize",2),a([(0,W.property)({type:Number})],Y.prototype,"total",2),a([(0,W.property)({type:Boolean,attribute:"show-size-changer"})],Y.prototype,"showSizeChanger",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"show-seq"})],Y.prototype,"showSeq",2),a([(0,W.property)({attribute:"seq-label"})],Y.prototype,"seqLabel",2),a([(0,W.property)({attribute:!1})],Y.prototype,"footerData",2),a([(0,W.property)({type:Boolean,attribute:"show-overflow"})],Y.prototype,"showOverflow",2),a([(0,W.property)({type:Boolean,attribute:"show-header-overflow"})],Y.prototype,"showHeaderOverflow",2),a([(0,W.property)({attribute:"column-widths",converter:{fromAttribute(e){if(!(e==null||e===""))try{let t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t))return Object.fromEntries(Object.entries(t).filter(([,r])=>Number.isFinite(Number(r))).map(([r,n])=>[r,Math.round(Number(n))]))}catch{}},toAttribute(e){return e==null?null:JSON.stringify(e)}}})],Y.prototype,"columnWidths",2),a([(0,W.property)()],Y.prototype,"emptyText",2),a([(0,W.property)({attribute:"sort-key"})],Y.prototype,"sortKey",2),a([(0,W.property)({attribute:"sort-order"})],Y.prototype,"sortOrder",2),a([(0,W.property)({attribute:!1})],Y.prototype,"sorter",2),a([(0,W.property)({type:Boolean,attribute:"row-clickable"})],Y.prototype,"rowClickable",2),a([(0,W.property)({type:Boolean,reflect:!0,attribute:"select-on-click"})],Y.prototype,"selectOnClick",2),a([(0,W.property)({reflect:!0,attribute:"row-animation"})],Y.prototype,"rowAnimation",2),a([(0,W.property)({attribute:!1})],Y.prototype,"onRow",2),a([(0,W.property)({attribute:!1})],Y.prototype,"onCell",2),a([(0,W.property)({attribute:!1})],Y.prototype,"onHeaderRow",2),a([(0,W.property)({attribute:!1})],Y.prototype,"onHeaderCell",2),a([(0,W.query)(".scroll")],Y.prototype,"_scrollEl",2),a([(0,W.query)("lit-virtualizer.table-virtualizer")],Y.prototype,"_virtualizerEl",2),a([(0,W.queryAssignedElements)({flatten:!0,selector:"lui-table-column"})],Y.prototype,"_slottedColumns",2),a([(0,W.state)()],Y.prototype,"_responsiveWidth",2),a([(0,W.state)()],Y.prototype,"_columnWidthOverrides",2),a([(0,W.state)()],Y.prototype,"_columnOrderKeys",2),a([(0,W.state)()],Y.prototype,"_virtualStart",2),Y=a([(0,W.customElement)("lui-table")],Y);var Bo=require("lit"),rt=require("lit/decorators.js");var hn=require("lit"),Lo=require("lit/decorators.js");var Gr=class extends hn.LitElement{constructor(){super(...arguments);this.content="";this.placement="top";this.disabled=!1;this.showArrow=!0;this.openDelay=120;this.closeDelay=80;this.offsetDistance=8;this.popoverProps={}}updated(){if(this._popover){let e=L(this,"tooltip");se(this._popover,{...e.popoverProps??{},...this.popoverProps??{}})}}render(){let e=this.content.trim().length>0;return hn.html`
5427
5429
  <lui-popover
5428
5430
  trigger="hover focus"
5429
5431
  .portal=${!0}
@@ -5487,25 +5489,25 @@
5487
5489
  .tooltip-body {
5488
5490
  color: inherit;
5489
5491
  }
5490
- `],a([(0,No.property)()],Gr.prototype,"content",2),a([(0,No.property)({reflect:!0})],Gr.prototype,"placement",2),a([(0,No.property)({type:Boolean,reflect:!0})],Gr.prototype,"disabled",2),a([(0,No.property)({type:Boolean,attribute:"show-arrow"})],Gr.prototype,"showArrow",2),a([(0,No.property)({type:Number,attribute:"open-delay"})],Gr.prototype,"openDelay",2),a([(0,No.property)({type:Number,attribute:"close-delay"})],Gr.prototype,"closeDelay",2),a([(0,No.property)({type:Number,attribute:"offset"})],Gr.prototype,"offsetDistance",2),a([(0,No.property)({attribute:!1})],Gr.prototype,"popoverProps",2),a([(0,No.query)("lui-popover")],Gr.prototype,"_popover",2),Gr=a([(0,No.customElement)("lui-tooltip")],Gr);var Xe=class extends Lo.LitElement{constructor(){super(...arguments);this.text="";this.type="default";this.size="md";this.weight="normal";this.block=!1;this.copyable=!1;this.truncate=!1;this.nowrap=!1;this.selectable=!1;this.strikethrough=!1;this.underline=!1;this.italic=!1;this.monospace=!1;this.surface=!1;this.popoverOnHover=!1;this.tooltipProps={};this.tag="span";this._copied=!1;this._overflowing=!1;this._resizeObserver=null;this._observedTextEl=null;this._copy=()=>{navigator.clipboard.writeText(this.text).then(()=>{this._copied=!0,setTimeout(()=>{this._copied=!1},1500)})}}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this._teardownOverflowObserver(),this._resizeObserver=null,super.disconnectedCallback()}firstUpdated(){this._syncOverflowObserver(),this._syncOverflow()}updated(){let e=L(this,"text");se(this._tooltipEl,{...e.tooltipProps??{},...this.tooltipProps??{}}),this._syncOverflowObserver(),this._syncOverflow()}_needsOverflowObserver(){return this.popoverOnHover&&(this.truncate||this.nowrap)}_ensureOverflowObserver(){this._resizeObserver||(this._resizeObserver=new ResizeObserver(()=>this._syncOverflow()))}_teardownOverflowObserver(){this._resizeObserver?.disconnect(),this._observedTextEl=null}_syncOverflowObserver(){if(!this._needsOverflowObserver()||!this._textEl){this._teardownOverflowObserver();return}this._ensureOverflowObserver(),this._observedTextEl!==this._textEl&&(this._teardownOverflowObserver(),this._ensureOverflowObserver(),this._resizeObserver?.observe(this._textEl),this._observedTextEl=this._textEl)}_syncOverflow(){let e=this._textEl;if(!e)return;if(!(this.truncate||this.nowrap)){this._overflowing&&(this._overflowing=!1);return}let r=e.scrollWidth-e.clientWidth>1||e.scrollHeight-e.clientHeight>1;r!==this._overflowing&&(this._overflowing=r)}render(){if(!this.text)return Lo.nothing;let e=["text",`type-${this.type}`,`size-${this.size}`,`weight-${this.weight}`];this.truncate&&e.push("truncated"),this.maxLines&&e.push("clamped"),this.nowrap&&e.push("nowrap"),this.selectable?e.push("selectable"):e.push("unselectable"),this.strikethrough&&e.push("strikethrough"),this.underline&&e.push("underline"),this.italic&&e.push("italic"),this.monospace&&e.push("monospace");let t=this.maxLines?`-webkit-line-clamp:${this.maxLines}`:"",r=Lo.html`<span
5492
+ `],a([(0,Lo.property)()],Gr.prototype,"content",2),a([(0,Lo.property)({reflect:!0})],Gr.prototype,"placement",2),a([(0,Lo.property)({type:Boolean,reflect:!0})],Gr.prototype,"disabled",2),a([(0,Lo.property)({type:Boolean,attribute:"show-arrow"})],Gr.prototype,"showArrow",2),a([(0,Lo.property)({type:Number,attribute:"open-delay"})],Gr.prototype,"openDelay",2),a([(0,Lo.property)({type:Number,attribute:"close-delay"})],Gr.prototype,"closeDelay",2),a([(0,Lo.property)({type:Number,attribute:"offset"})],Gr.prototype,"offsetDistance",2),a([(0,Lo.property)({attribute:!1})],Gr.prototype,"popoverProps",2),a([(0,Lo.query)("lui-popover")],Gr.prototype,"_popover",2),Gr=a([(0,Lo.customElement)("lui-tooltip")],Gr);var Xe=class extends Bo.LitElement{constructor(){super(...arguments);this.text="";this.type="default";this.size="md";this.weight="normal";this.block=!1;this.copyable=!1;this.truncate=!1;this.nowrap=!1;this.selectable=!1;this.strikethrough=!1;this.underline=!1;this.italic=!1;this.monospace=!1;this.surface=!1;this.popoverOnHover=!1;this.tooltipProps={};this.tag="span";this._copied=!1;this._overflowing=!1;this._resizeObserver=null;this._observedTextEl=null;this._copy=()=>{navigator.clipboard.writeText(this.text).then(()=>{this._copied=!0,setTimeout(()=>{this._copied=!1},1500)})}}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this._teardownOverflowObserver(),this._resizeObserver=null,super.disconnectedCallback()}firstUpdated(){this._syncOverflowObserver(),this._syncOverflow()}updated(){let e=L(this,"text");se(this._tooltipEl,{...e.tooltipProps??{},...this.tooltipProps??{}}),this._syncOverflowObserver(),this._syncOverflow()}_needsOverflowObserver(){return this.popoverOnHover&&(this.truncate||this.nowrap)}_ensureOverflowObserver(){this._resizeObserver||(this._resizeObserver=new ResizeObserver(()=>this._syncOverflow()))}_teardownOverflowObserver(){this._resizeObserver?.disconnect(),this._observedTextEl=null}_syncOverflowObserver(){if(!this._needsOverflowObserver()||!this._textEl){this._teardownOverflowObserver();return}this._ensureOverflowObserver(),this._observedTextEl!==this._textEl&&(this._teardownOverflowObserver(),this._ensureOverflowObserver(),this._resizeObserver?.observe(this._textEl),this._observedTextEl=this._textEl)}_syncOverflow(){let e=this._textEl;if(!e)return;if(!(this.truncate||this.nowrap)){this._overflowing&&(this._overflowing=!1);return}let r=e.scrollWidth-e.clientWidth>1||e.scrollHeight-e.clientHeight>1;r!==this._overflowing&&(this._overflowing=r)}render(){if(!this.text)return Bo.nothing;let e=["text",`type-${this.type}`,`size-${this.size}`,`weight-${this.weight}`];this.truncate&&e.push("truncated"),this.maxLines&&e.push("clamped"),this.nowrap&&e.push("nowrap"),this.selectable?e.push("selectable"):e.push("unselectable"),this.strikethrough&&e.push("strikethrough"),this.underline&&e.push("underline"),this.italic&&e.push("italic"),this.monospace&&e.push("monospace");let t=this.maxLines?`-webkit-line-clamp:${this.maxLines}`:"",r=Bo.html`<span
5491
5493
  class=${e.join(" ")}
5492
5494
  style=${t}
5493
- >${this.text}</span>`,n=r;if(this.copyable||this.surface){let d=this._copied?"check":"copy";n=Lo.html`
5495
+ >${this.text}</span>`,n=r;if(this.copyable||this.surface){let d=this._copied?"check":"copy";n=Bo.html`
5494
5496
  <span class=${["text-wrap",this.block?"block":"",this.surface?"surface":""].filter(Boolean).join(" ")}>
5495
5497
  ${r}
5496
- ${this.copyable?Lo.html`<button
5498
+ ${this.copyable?Bo.html`<button
5497
5499
  class=${`copy-btn${this._copied?" copied":""}`}
5498
5500
  @click=${this._copy}
5499
5501
  title=${this._copied?"\u5DF2\u590D\u5236":"\u590D\u5236"}
5500
5502
  >
5501
5503
  <lui-icon name=${d}></lui-icon>
5502
- </button>`:Lo.nothing}
5504
+ </button>`:Bo.nothing}
5503
5505
  </span>
5504
- `}return this.popoverOnHover&&(!!this.maxLines||!this.truncate&&!this.nowrap&&!this.maxLines||this._overflowing)?Lo.html`
5506
+ `}return this.popoverOnHover&&(!!this.maxLines||!this.truncate&&!this.nowrap&&!this.maxLines||this._overflowing)?Bo.html`
5505
5507
  <lui-tooltip .content=${this.text}>
5506
5508
  ${n}
5507
5509
  </lui-tooltip>
5508
- `:n}};Xe.styles=[A,j,Lo.css`
5510
+ `:n}};Xe.styles=[A,j,Bo.css`
5509
5511
  :host {
5510
5512
  display: inline;
5511
5513
  line-height: 1.6;
@@ -5609,7 +5611,7 @@
5609
5611
  --lui-icon-size: 14px;
5610
5612
  }
5611
5613
 
5612
- `],a([(0,rt.property)()],Xe.prototype,"text",2),a([(0,rt.property)({reflect:!0})],Xe.prototype,"type",2),a([(0,rt.property)({reflect:!0})],Xe.prototype,"size",2),a([(0,rt.property)()],Xe.prototype,"weight",2),a([(0,rt.property)({type:Boolean,reflect:!0})],Xe.prototype,"block",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"copyable",2),a([(0,rt.property)({type:Number,attribute:"max-lines"})],Xe.prototype,"maxLines",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"truncate",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"nowrap",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"selectable",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"strikethrough",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"underline",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"italic",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"monospace",2),a([(0,rt.property)({type:Boolean,reflect:!0})],Xe.prototype,"surface",2),a([(0,rt.property)({type:Boolean,attribute:"popover-on-hover"})],Xe.prototype,"popoverOnHover",2),a([(0,rt.property)({attribute:!1})],Xe.prototype,"tooltipProps",2),a([(0,rt.property)()],Xe.prototype,"tag",2),a([(0,rt.state)()],Xe.prototype,"_copied",2),a([(0,rt.state)()],Xe.prototype,"_overflowing",2),a([(0,rt.query)(".text")],Xe.prototype,"_textEl",2),a([(0,rt.query)("lui-tooltip")],Xe.prototype,"_tooltipEl",2),Xe=a([(0,rt.customElement)("lui-text")],Xe);var we=require("lit"),he=require("lit/decorators.js"),rp=require("lit/directives/repeat.js"),op=xn(ia(),1);var lo=require("lit"),Fe=require("lit/decorators.js");var Re=class extends lo.LitElement{constructor(){super(...arguments);this._overlayStackRegistered=!1;this.x=0;this.y=0;this.open=!1;this.items=[];this.heading="";this.headingIcon="";this.trigger="manual";this.placement="bottom-start";this.closeOnSelect=!0;this.closeOnOutsidePress=!0;this.closeOnEscape=!0;this.backdrop="none";this.backdropStyle="";this.submenuTrigger="hover";this.triggerProps={};this.overlayProps={};this.menuProps={};this._context=null;this._activePath=[];this._openPath=[];this._layoutFrame=0;this._anchorMode="point";this._anchorRect=null;this._source="context-menu";this._explicitAttrs=new Set;this._onTriggerClick=e=>{if(this._hasTrigger("click")){if(e.preventDefault(),e.stopPropagation(),this.open&&this._anchorMode==="element"){this.hide();return}this.showFromTrigger(e.currentTarget,{triggerEvent:e,source:"context-menu"})}};this._onTriggerContextMenu=e=>{this._hasTrigger("contextmenu")&&(e.preventDefault(),e.stopPropagation(),this.showAt(e.clientX,e.clientY,{triggerEvent:e,source:"context-menu"}))};this._onBackdropPointerDown=e=>{if(e.preventDefault(),e.stopPropagation(),!this.open)return;this._emitOutsidePress(e)&&this.closeOnOutsidePress&&this.hide()};this._onOutside=e=>{if(!this.open||this._isEventInsideMenu(e)||this._hasTrigger("click")&&this._isEventOnTrigger(e))return;this._emitOutsidePress(e)&&this.closeOnOutsidePress&&this.hide()};this._onKey=e=>{if(this.open){if(e.key==="Escape"&&this.closeOnEscape){e.preventDefault(),this.hide(),this._getTriggerElement()?.focus();return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){if(e.preventDefault(),!this._activePath.length){this._focusFirstItem([]);return}this._moveInMenu(Zs(this._activePath),e.key==="ArrowDown"?1:-1);return}if(e.key==="Home"){e.preventDefault(),this._moveToBoundary(Zs(this._activePath),0,1);return}if(e.key==="End"){e.preventDefault();let t=Zs(this._activePath),r=this._menuItemsAt(t);this._moveToBoundary(t,r.length-1,-1);return}if(e.key==="ArrowRight"){e.preventDefault(),this._openActiveSubmenu();return}if(e.key==="ArrowLeft"){if(this._activePath.length>1){e.preventDefault();let t=this._activePath.slice(0,-1);this._activePath=t,this._openPath=t.slice(0,-1)}return}if(e.key==="Enter"||e.key===" "){let t=this._itemAt(this._activePath);t&&Qa(t)?(e.preventDefault(),this._select(t)):t?.children?.length&&(e.preventDefault(),this._setActivePath(this._activePath,"click"),this._openActiveSubmenu())}}};this._onBlur=()=>this.hide();this._onResize=()=>this.hide();this._onScroll=()=>{if(this.open&&this._anchorMode==="element"){let e=this._getTriggerElement();e&&(this._anchorRect=e.getBoundingClientRect(),this._scheduleLayout())}}}_registerOverlayStack(){let e=zn(this);e&&(Jt(this,e.layer,e.layerName),this._overlayStackRegistered=!0)}_releaseOverlayStack(){this._overlayStackRegistered&&(Yo(this),this._overlayStackRegistered=!1)}_emitOpenChange(e){this.dispatchEvent(new CustomEvent("open-change",{detail:{open:e},bubbles:!0,composed:!0}))}get _normalizedItems(){return Sh(this.items)}show(e,t,r,n){if(typeof e=="object"){this.showAt(e.x,e.y,e);return}this.showAt(e,t??0,r,n)}showAt(e,t,r,n){Array.isArray(r)||r==null?(r!==void 0&&(this.items=r),n!==void 0&&(this._context=n),this._triggerEvent=void 0,this._source="context-menu"):(r.items!==void 0&&(this.items=r.items),r.context!==void 0&&(this._context=r.context),this._triggerEvent=r.triggerEvent,this._source=r.source??"context-menu"),this._anchorMode="point",this._anchorRect=null,this.x=e,this.y=t,this._activePath=[],this._openPath=[],this.open=!0,this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this._emitOpenChange(!0),this._scheduleLayout()}showFromTrigger(e,t,r){let n=e??this._getTriggerElement();n&&(Array.isArray(t)||t==null?(t!==void 0&&(this.items=t),r!==void 0&&(this._context=r),this._triggerEvent=void 0,this._source="context-menu"):(t.items!==void 0&&(this.items=t.items),t.context!==void 0&&(this._context=t.context),this._triggerEvent=t.triggerEvent,this._source=t.source??"context-menu"),this._anchorMode="element",this._anchorRect=n.getBoundingClientRect(),this._activePath=[],this._openPath=[],this.open=!0,this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this._emitOpenChange(!0),this._scheduleLayout())}hide(){this.open&&(this.open=!1,this._activePath=[],this._openPath=[],this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})),this._emitOpenChange(!1))}close(){this.hide()}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),document.addEventListener("mousedown",this._onOutside,!0),document.addEventListener("keydown",this._onKey),window.addEventListener("blur",this._onBlur),window.addEventListener("resize",this._onResize),window.addEventListener("scroll",this._onScroll,!0)}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),document.removeEventListener("mousedown",this._onOutside,!0),document.removeEventListener("keydown",this._onKey),window.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),window.removeEventListener("scroll",this._onScroll,!0)}updated(e){e.has("open")&&(this.open?(this._registerOverlayStack(),Et(this)):this._releaseOverlayStack()),(e.has("open")||e.has("items")||e.has("_openPath")||e.has("_activePath")||e.has("x")||e.has("y")||e.has("placement"))&&this._scheduleLayout(),this._syncElementProps()}willUpdate(){let e=L(this,"contextMenu");!this._explicitAttrs.has("placement")&&typeof e.placement=="string"&&this.placement!==e.placement&&(this.placement=e.placement),!this._explicitAttrs.has("close-on-select")&&typeof e.closeOnSelect=="boolean"&&this.closeOnSelect!==e.closeOnSelect&&(this.closeOnSelect=e.closeOnSelect),!this._explicitAttrs.has("close-on-outside-press")&&typeof e.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==e.closeOnOutsidePress&&(this.closeOnOutsidePress=e.closeOnOutsidePress),!this._explicitAttrs.has("close-on-escape")&&typeof e.closeOnEscape=="boolean"&&this.closeOnEscape!==e.closeOnEscape&&(this.closeOnEscape=e.closeOnEscape),!this._explicitAttrs.has("backdrop")&&typeof e.backdrop=="string"&&this.backdrop!==e.backdrop&&(this.backdrop=e.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof e.backdropStyle=="string"&&this.backdropStyle!==e.backdropStyle&&(this.backdropStyle=e.backdropStyle),!this._explicitAttrs.has("submenu-trigger")&&typeof e.submenuTrigger=="string"&&this.submenuTrigger!==e.submenuTrigger&&(this.submenuTrigger=e.submenuTrigger)}_syncElementProps(){let e=L(this,"contextMenu");se(this._triggerWrapper,{...e.triggerProps??{},...this.triggerProps??{}}),se(this._overlayEl,{...e.overlayProps??{},...this.overlayProps??{}});for(let t of this._menuEls??[])se(t,{...e.menuProps??{},...this.menuProps??{}})}_getTriggerElement(){return(this._triggerSlot?.assignedElements({flatten:!0})??[]).find(t=>t instanceof HTMLElement)??null}_hasTrigger(e){return this.trigger.split(/\s+/).map(t=>t.trim()).filter(Boolean).includes(e)}_isEventInsideMenu(e){return e.composedPath().some(r=>r instanceof HTMLElement&&r.getAttribute("part")?.split(/\s+/).includes("menu"))}_isEventOnTrigger(e){let t=e.composedPath(),r=this.renderRoot.querySelector('[part="trigger"]'),n=this._triggerSlot?.assignedElements({flatten:!0})??[];return t.some(s=>s===r||s instanceof HTMLElement&&n.includes(s))}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_scheduleLayout(){this.open&&(this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._adjust()}))}_itemAt(e){return Qn(this._normalizedItems,e)}_menuItemsAt(e){return $h(this._normalizedItems,e)}_setActivePath(e,t="keyboard"){if(this._activePath=e.slice(),!this._itemAt(e)?.children?.length){this._openPath=e.slice(0,-1);return}if(t==="click"){this._openPath=e.slice();return}if(t==="hover"&&this.submenuTrigger==="hover"){this._openPath=e.slice();return}this._openPath=e.slice(0,-1)}_focusFirstItem(e){let t=this._menuItemsAt(e),r=wc(t);r>=0&&this._setActivePath([...e,r],"keyboard")}_moveInMenu(e,t){let r=this._menuItemsAt(e);if(!r.length)return;let n=this._activePath.length===e.length+1&&e.every((d,h)=>this._activePath[h]===d)?this._activePath[this._activePath.length-1]:-1,s=jh(r,n,t);s>=0&&this._setActivePath([...e,s],"keyboard")}_moveToBoundary(e,t,r){let n=this._menuItemsAt(e);if(!n.length)return;let s=Oh(n,t,r);s>=0&&this._setActivePath([...e,s],"keyboard")}_openActiveSubmenu(){let e=this._itemAt(this._activePath);if(!e?.children?.length)return;let t=wc(e.children);this._openPath=this._activePath.slice(),t>=0&&(this._activePath=[...this._activePath,t])}_getOverlayRect(){return this._overlayEl?.getBoundingClientRect()??new DOMRect(0,0,window.innerWidth,window.innerHeight)}_getRootPosition(e,t){if(this._anchorMode==="element"&&this._anchorRect){let r=this._anchorRect;switch(this.placement){case"bottom":return{x:r.left-t.left+r.width/2-e.width/2,y:r.bottom-t.top+6,originX:"left",originY:"top"};case"bottom-end":return{x:r.right-t.left-e.width,y:r.bottom-t.top+6,originX:"right",originY:"top"};case"top-start":return{x:r.left-t.left,y:r.top-t.top-e.height-6,originX:"left",originY:"bottom"};case"top":return{x:r.left-t.left+r.width/2-e.width/2,y:r.top-t.top-e.height-6,originX:"left",originY:"bottom"};case"top-end":return{x:r.right-t.left-e.width,y:r.top-t.top-e.height-6,originX:"right",originY:"bottom"};case"right-start":return{x:r.right-t.left+6,y:r.top-t.top,originX:"left",originY:"top"};case"right":return{x:r.right-t.left+6,y:r.top-t.top+r.height/2-e.height/2,originX:"left",originY:"top"};case"right-end":return{x:r.right-t.left+6,y:r.bottom-t.top-e.height,originX:"left",originY:"bottom"};case"left-start":return{x:r.left-t.left-e.width-6,y:r.top-t.top,originX:"right",originY:"top"};case"left":return{x:r.left-t.left-e.width-6,y:r.top-t.top+r.height/2-e.height/2,originX:"right",originY:"top"};case"left-end":return{x:r.left-t.left-e.width-6,y:r.bottom-t.top-e.height,originX:"right",originY:"bottom"};case"bottom-start":default:return{x:r.left-t.left,y:r.bottom-t.top+6,originX:"left",originY:"top"}}}return{x:this.x-t.left,y:this.y-t.top,originX:"left",originY:"top"}}_adjust(){let e=this.renderRoot.querySelector(`[data-menu-path="${Mn([])}"]`);if(!e)return;let t=this._getOverlayRect(),r=t.width||window.innerWidth,n=t.height||window.innerHeight,s=e.getBoundingClientRect(),d=this._getRootPosition(s,t),h=d.x,p=d.y,f=d.originX,x=d.originY;h+s.width>r-4&&(h=Math.max(4,r-s.width-4),f="right"),p+s.height>n-4&&(p=Math.max(4,n-s.height-4),x="bottom"),p<4&&(p=4),h<4&&(h=4),e.style.left=`${h}px`,e.style.top=`${p}px`,e.style.setProperty("--lui-menu-origin-x",f),e.style.setProperty("--lui-menu-origin-y",x),xc(this._openPath).slice(1).forEach(k=>{let C=this.renderRoot.querySelector(`[data-menu-path="${Mn(k)}"]`),S=this.renderRoot.querySelector(`[data-item-path="${Mn(k)}"]`);if(!C||!S)return;let z=S.getBoundingClientRect(),T=C.getBoundingClientRect(),P=z.right-t.left-3,H=z.top-t.top-8,I="left",B="top";P+T.width>r-4&&(P=z.left-t.left-T.width+3,I="right"),H+T.height>n-4&&(H=Math.max(4,n-T.height-4),B="bottom"),H<4&&(H=4),C.style.left=`${P}px`,C.style.top=`${H}px`,C.style.setProperty("--lui-menu-origin-x",I),C.style.setProperty("--lui-menu-origin-y",B)})}_createActionDetail(e,t){let r=this._triggerEvent instanceof MouseEvent?this._triggerEvent:null;return{key:e.key,value:e.value??e.key,item:e.raw??e,path:t,source:this._source,triggerEvent:this._triggerEvent,x:r?.clientX??this.x,y:r?.clientY??this.y,context:this._context}}async _select(e,t=this._activePath.slice()){if(!Qa(e))return;let r=this._createActionDetail(e,t);this.dispatchEvent(new CustomEvent("select",{detail:r,bubbles:!0,composed:!0})),e.onSelect?.(r),e.action?.(this._context),this.closeOnSelect&&this.hide()}_renderMenu(e){let t=Mn(e),r=e.length?this._menuItemsAt(e):this._normalizedItems,n=e.length===0&&!!this.heading;return lo.html`
5614
+ `],a([(0,rt.property)()],Xe.prototype,"text",2),a([(0,rt.property)({reflect:!0})],Xe.prototype,"type",2),a([(0,rt.property)({reflect:!0})],Xe.prototype,"size",2),a([(0,rt.property)()],Xe.prototype,"weight",2),a([(0,rt.property)({type:Boolean,reflect:!0})],Xe.prototype,"block",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"copyable",2),a([(0,rt.property)({type:Number,attribute:"max-lines"})],Xe.prototype,"maxLines",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"truncate",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"nowrap",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"selectable",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"strikethrough",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"underline",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"italic",2),a([(0,rt.property)({type:Boolean})],Xe.prototype,"monospace",2),a([(0,rt.property)({type:Boolean,reflect:!0})],Xe.prototype,"surface",2),a([(0,rt.property)({type:Boolean,attribute:"popover-on-hover"})],Xe.prototype,"popoverOnHover",2),a([(0,rt.property)({attribute:!1})],Xe.prototype,"tooltipProps",2),a([(0,rt.property)()],Xe.prototype,"tag",2),a([(0,rt.state)()],Xe.prototype,"_copied",2),a([(0,rt.state)()],Xe.prototype,"_overflowing",2),a([(0,rt.query)(".text")],Xe.prototype,"_textEl",2),a([(0,rt.query)("lui-tooltip")],Xe.prototype,"_tooltipEl",2),Xe=a([(0,rt.customElement)("lui-text")],Xe);var we=require("lit"),he=require("lit/decorators.js"),rp=require("lit/directives/repeat.js"),op=xn(ia(),1);var lo=require("lit"),Fe=require("lit/decorators.js");var Re=class extends lo.LitElement{constructor(){super(...arguments);this._overlayStackRegistered=!1;this.x=0;this.y=0;this.open=!1;this.items=[];this.heading="";this.headingIcon="";this.trigger="manual";this.placement="bottom-start";this.closeOnSelect=!0;this.closeOnOutsidePress=!0;this.closeOnEscape=!0;this.backdrop="none";this.backdropStyle="";this.submenuTrigger="hover";this.triggerProps={};this.overlayProps={};this.menuProps={};this._context=null;this._activePath=[];this._openPath=[];this._layoutFrame=0;this._anchorMode="point";this._anchorRect=null;this._source="context-menu";this._explicitAttrs=new Set;this._onTriggerClick=e=>{if(this._hasTrigger("click")){if(e.preventDefault(),e.stopPropagation(),this.open&&this._anchorMode==="element"){this.hide();return}this.showFromTrigger(e.currentTarget,{triggerEvent:e,source:"context-menu"})}};this._onTriggerContextMenu=e=>{this._hasTrigger("contextmenu")&&(e.preventDefault(),e.stopPropagation(),this.showAt(e.clientX,e.clientY,{triggerEvent:e,source:"context-menu"}))};this._onBackdropPointerDown=e=>{if(e.preventDefault(),e.stopPropagation(),!this.open)return;this._emitOutsidePress(e)&&this.closeOnOutsidePress&&this.hide()};this._onOutside=e=>{if(!this.open||this._isEventInsideMenu(e)||this._hasTrigger("click")&&this._isEventOnTrigger(e))return;this._emitOutsidePress(e)&&this.closeOnOutsidePress&&this.hide()};this._onKey=e=>{if(this.open){if(e.key==="Escape"&&this.closeOnEscape){e.preventDefault(),this.hide(),this._getTriggerElement()?.focus();return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){if(e.preventDefault(),!this._activePath.length){this._focusFirstItem([]);return}this._moveInMenu(Zs(this._activePath),e.key==="ArrowDown"?1:-1);return}if(e.key==="Home"){e.preventDefault(),this._moveToBoundary(Zs(this._activePath),0,1);return}if(e.key==="End"){e.preventDefault();let t=Zs(this._activePath),r=this._menuItemsAt(t);this._moveToBoundary(t,r.length-1,-1);return}if(e.key==="ArrowRight"){e.preventDefault(),this._openActiveSubmenu();return}if(e.key==="ArrowLeft"){if(this._activePath.length>1){e.preventDefault();let t=this._activePath.slice(0,-1);this._activePath=t,this._openPath=t.slice(0,-1)}return}if(e.key==="Enter"||e.key===" "){let t=this._itemAt(this._activePath);t&&Qa(t)?(e.preventDefault(),this._select(t)):t?.children?.length&&(e.preventDefault(),this._setActivePath(this._activePath,"click"),this._openActiveSubmenu())}}};this._onBlur=()=>this.hide();this._onResize=()=>this.hide();this._onScroll=()=>{if(this.open&&this._anchorMode==="element"){let e=this._getTriggerElement();e&&(this._anchorRect=e.getBoundingClientRect(),this._scheduleLayout())}}}_registerOverlayStack(){let e=zn(this);e&&(Jt(this,e.layer,e.layerName),this._overlayStackRegistered=!0)}_releaseOverlayStack(){this._overlayStackRegistered&&(Xo(this),this._overlayStackRegistered=!1)}_emitOpenChange(e){this.dispatchEvent(new CustomEvent("open-change",{detail:{open:e},bubbles:!0,composed:!0}))}get _normalizedItems(){return Sh(this.items)}show(e,t,r,n){if(typeof e=="object"){this.showAt(e.x,e.y,e);return}this.showAt(e,t??0,r,n)}showAt(e,t,r,n){Array.isArray(r)||r==null?(r!==void 0&&(this.items=r),n!==void 0&&(this._context=n),this._triggerEvent=void 0,this._source="context-menu"):(r.items!==void 0&&(this.items=r.items),r.context!==void 0&&(this._context=r.context),this._triggerEvent=r.triggerEvent,this._source=r.source??"context-menu"),this._anchorMode="point",this._anchorRect=null,this.x=e,this.y=t,this._activePath=[],this._openPath=[],this.open=!0,this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this._emitOpenChange(!0),this._scheduleLayout()}showFromTrigger(e,t,r){let n=e??this._getTriggerElement();n&&(Array.isArray(t)||t==null?(t!==void 0&&(this.items=t),r!==void 0&&(this._context=r),this._triggerEvent=void 0,this._source="context-menu"):(t.items!==void 0&&(this.items=t.items),t.context!==void 0&&(this._context=t.context),this._triggerEvent=t.triggerEvent,this._source=t.source??"context-menu"),this._anchorMode="element",this._anchorRect=n.getBoundingClientRect(),this._activePath=[],this._openPath=[],this.open=!0,this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this._emitOpenChange(!0),this._scheduleLayout())}hide(){this.open&&(this.open=!1,this._activePath=[],this._openPath=[],this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})),this._emitOpenChange(!1))}close(){this.hide()}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),document.addEventListener("mousedown",this._onOutside,!0),document.addEventListener("keydown",this._onKey),window.addEventListener("blur",this._onBlur),window.addEventListener("resize",this._onResize),window.addEventListener("scroll",this._onScroll,!0)}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),document.removeEventListener("mousedown",this._onOutside,!0),document.removeEventListener("keydown",this._onKey),window.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),window.removeEventListener("scroll",this._onScroll,!0)}updated(e){e.has("open")&&(this.open?(this._registerOverlayStack(),Et(this)):this._releaseOverlayStack()),(e.has("open")||e.has("items")||e.has("_openPath")||e.has("_activePath")||e.has("x")||e.has("y")||e.has("placement"))&&this._scheduleLayout(),this._syncElementProps()}willUpdate(){let e=L(this,"contextMenu");!this._explicitAttrs.has("placement")&&typeof e.placement=="string"&&this.placement!==e.placement&&(this.placement=e.placement),!this._explicitAttrs.has("close-on-select")&&typeof e.closeOnSelect=="boolean"&&this.closeOnSelect!==e.closeOnSelect&&(this.closeOnSelect=e.closeOnSelect),!this._explicitAttrs.has("close-on-outside-press")&&typeof e.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==e.closeOnOutsidePress&&(this.closeOnOutsidePress=e.closeOnOutsidePress),!this._explicitAttrs.has("close-on-escape")&&typeof e.closeOnEscape=="boolean"&&this.closeOnEscape!==e.closeOnEscape&&(this.closeOnEscape=e.closeOnEscape),!this._explicitAttrs.has("backdrop")&&typeof e.backdrop=="string"&&this.backdrop!==e.backdrop&&(this.backdrop=e.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof e.backdropStyle=="string"&&this.backdropStyle!==e.backdropStyle&&(this.backdropStyle=e.backdropStyle),!this._explicitAttrs.has("submenu-trigger")&&typeof e.submenuTrigger=="string"&&this.submenuTrigger!==e.submenuTrigger&&(this.submenuTrigger=e.submenuTrigger)}_syncElementProps(){let e=L(this,"contextMenu");se(this._triggerWrapper,{...e.triggerProps??{},...this.triggerProps??{}}),se(this._overlayEl,{...e.overlayProps??{},...this.overlayProps??{}});for(let t of this._menuEls??[])se(t,{...e.menuProps??{},...this.menuProps??{}})}_getTriggerElement(){return(this._triggerSlot?.assignedElements({flatten:!0})??[]).find(t=>t instanceof HTMLElement)??null}_hasTrigger(e){return this.trigger.split(/\s+/).map(t=>t.trim()).filter(Boolean).includes(e)}_isEventInsideMenu(e){return e.composedPath().some(r=>r instanceof HTMLElement&&r.getAttribute("part")?.split(/\s+/).includes("menu"))}_isEventOnTrigger(e){let t=e.composedPath(),r=this.renderRoot.querySelector('[part="trigger"]'),n=this._triggerSlot?.assignedElements({flatten:!0})??[];return t.some(s=>s===r||s instanceof HTMLElement&&n.includes(s))}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_scheduleLayout(){this.open&&(this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._adjust()}))}_itemAt(e){return Qn(this._normalizedItems,e)}_menuItemsAt(e){return $h(this._normalizedItems,e)}_setActivePath(e,t="keyboard"){if(this._activePath=e.slice(),!this._itemAt(e)?.children?.length){this._openPath=e.slice(0,-1);return}if(t==="click"){this._openPath=e.slice();return}if(t==="hover"&&this.submenuTrigger==="hover"){this._openPath=e.slice();return}this._openPath=e.slice(0,-1)}_focusFirstItem(e){let t=this._menuItemsAt(e),r=wc(t);r>=0&&this._setActivePath([...e,r],"keyboard")}_moveInMenu(e,t){let r=this._menuItemsAt(e);if(!r.length)return;let n=this._activePath.length===e.length+1&&e.every((d,h)=>this._activePath[h]===d)?this._activePath[this._activePath.length-1]:-1,s=jh(r,n,t);s>=0&&this._setActivePath([...e,s],"keyboard")}_moveToBoundary(e,t,r){let n=this._menuItemsAt(e);if(!n.length)return;let s=Oh(n,t,r);s>=0&&this._setActivePath([...e,s],"keyboard")}_openActiveSubmenu(){let e=this._itemAt(this._activePath);if(!e?.children?.length)return;let t=wc(e.children);this._openPath=this._activePath.slice(),t>=0&&(this._activePath=[...this._activePath,t])}_getOverlayRect(){return this._overlayEl?.getBoundingClientRect()??new DOMRect(0,0,window.innerWidth,window.innerHeight)}_getRootPosition(e,t){if(this._anchorMode==="element"&&this._anchorRect){let r=this._anchorRect;switch(this.placement){case"bottom":return{x:r.left-t.left+r.width/2-e.width/2,y:r.bottom-t.top+6,originX:"left",originY:"top"};case"bottom-end":return{x:r.right-t.left-e.width,y:r.bottom-t.top+6,originX:"right",originY:"top"};case"top-start":return{x:r.left-t.left,y:r.top-t.top-e.height-6,originX:"left",originY:"bottom"};case"top":return{x:r.left-t.left+r.width/2-e.width/2,y:r.top-t.top-e.height-6,originX:"left",originY:"bottom"};case"top-end":return{x:r.right-t.left-e.width,y:r.top-t.top-e.height-6,originX:"right",originY:"bottom"};case"right-start":return{x:r.right-t.left+6,y:r.top-t.top,originX:"left",originY:"top"};case"right":return{x:r.right-t.left+6,y:r.top-t.top+r.height/2-e.height/2,originX:"left",originY:"top"};case"right-end":return{x:r.right-t.left+6,y:r.bottom-t.top-e.height,originX:"left",originY:"bottom"};case"left-start":return{x:r.left-t.left-e.width-6,y:r.top-t.top,originX:"right",originY:"top"};case"left":return{x:r.left-t.left-e.width-6,y:r.top-t.top+r.height/2-e.height/2,originX:"right",originY:"top"};case"left-end":return{x:r.left-t.left-e.width-6,y:r.bottom-t.top-e.height,originX:"right",originY:"bottom"};case"bottom-start":default:return{x:r.left-t.left,y:r.bottom-t.top+6,originX:"left",originY:"top"}}}return{x:this.x-t.left,y:this.y-t.top,originX:"left",originY:"top"}}_adjust(){let e=this.renderRoot.querySelector(`[data-menu-path="${Mn([])}"]`);if(!e)return;let t=this._getOverlayRect(),r=t.width||window.innerWidth,n=t.height||window.innerHeight,s=e.getBoundingClientRect(),d=this._getRootPosition(s,t),h=d.x,p=d.y,f=d.originX,x=d.originY;h+s.width>r-4&&(h=Math.max(4,r-s.width-4),f="right"),p+s.height>n-4&&(p=Math.max(4,n-s.height-4),x="bottom"),p<4&&(p=4),h<4&&(h=4),e.style.left=`${h}px`,e.style.top=`${p}px`,e.style.setProperty("--lui-menu-origin-x",f),e.style.setProperty("--lui-menu-origin-y",x),xc(this._openPath).slice(1).forEach(k=>{let C=this.renderRoot.querySelector(`[data-menu-path="${Mn(k)}"]`),S=this.renderRoot.querySelector(`[data-item-path="${Mn(k)}"]`);if(!C||!S)return;let z=S.getBoundingClientRect(),T=C.getBoundingClientRect(),P=z.right-t.left-3,H=z.top-t.top-8,I="left",B="top";P+T.width>r-4&&(P=z.left-t.left-T.width+3,I="right"),H+T.height>n-4&&(H=Math.max(4,n-T.height-4),B="bottom"),H<4&&(H=4),C.style.left=`${P}px`,C.style.top=`${H}px`,C.style.setProperty("--lui-menu-origin-x",I),C.style.setProperty("--lui-menu-origin-y",B)})}_createActionDetail(e,t){let r=this._triggerEvent instanceof MouseEvent?this._triggerEvent:null;return{key:e.key,value:e.value??e.key,item:e.raw??e,path:t,source:this._source,triggerEvent:this._triggerEvent,x:r?.clientX??this.x,y:r?.clientY??this.y,context:this._context}}async _select(e,t=this._activePath.slice()){if(!Qa(e))return;let r=this._createActionDetail(e,t);this.dispatchEvent(new CustomEvent("select",{detail:r,bubbles:!0,composed:!0})),e.onSelect?.(r),e.action?.(this._context),this.closeOnSelect&&this.hide()}_renderMenu(e){let t=Mn(e),r=e.length?this._menuItemsAt(e):this._normalizedItems,n=e.length===0&&!!this.heading;return lo.html`
5613
5615
  <div
5614
5616
  part="menu"
5615
5617
  data-menu-path=${t}
@@ -6579,24 +6581,24 @@
6579
6581
  --lui-spinner-color: var(--lui-color-primary);
6580
6582
  --lui-spinner-track: color-mix(in srgb, var(--lui-color-primary) 22%, transparent);
6581
6583
  }
6582
- `],a([(0,yr.property)()],Rt.prototype,"title",2),a([(0,yr.property)()],Rt.prototype,"subtitle",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"hoverable",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"compact",2),a([(0,yr.property)({reflect:!0})],Rt.prototype,"size",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"borderless",2),a([(0,yr.property)({reflect:!0})],Rt.prototype,"shadow",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"clickable",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"ripple",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"selected",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"loading",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"dividerless",2),a([(0,yr.property)({reflect:!0,attribute:"cover-ratio"})],Rt.prototype,"coverRatio",2),a([(0,yr.property)()],Rt.prototype,"locale",2),a([(0,yr.property)({attribute:!1})],Rt.prototype,"translations",2),Rt=a([(0,yr.customElement)("lui-card")],Rt);var Bo=require("lit"),dr=require("lit/decorators.js");var St=class extends Bo.LitElement{constructor(){super(...arguments);this.title="";this.value=0;this.prefix="";this.suffix="";this.description="";this.groupSeparator=",";this.decimalSeparator=".";this.size="md";this.align="start";this.trend="none";this.trendValue="";this.status="default";this.valueColor="";this.loading=!1;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){let t=L(this,"statistic");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("align")&&typeof t.align=="string"&&this.align!==t.align&&(this.align=t.align),!this._explicitAttrs.has("status")&&typeof t.status=="string"&&this.status!==t.status&&(this.status=t.status),!this._explicitAttrs.has("loading")&&typeof t.loading=="boolean"&&this.loading!==t.loading&&(this.loading=t.loading),!this._explicitAttrs.has("group-separator")&&typeof t.groupSeparator=="string"&&this.groupSeparator!==t.groupSeparator&&(this.groupSeparator=t.groupSeparator),!this._explicitAttrs.has("decimal-separator")&&typeof t.decimalSeparator=="string"&&this.decimalSeparator!==t.decimalSeparator&&(this.decimalSeparator=t.decimalSeparator)}_formatNumber(e){let t=typeof this.precision=="number"&&Number.isFinite(this.precision)?e.toFixed(Math.max(0,this.precision)):String(e),[r,n]=t.split("."),s=r.replace(/\B(?=(\d{3})+(?!\d))/g,this.groupSeparator);return n!=null?`${s}${this.decimalSeparator}${n}`:s}_formattedValue(){if(typeof this.value=="number")return this._formatNumber(this.value);let e=String(this.value??""),t=Number(e);return e.trim()!==""&&Number.isFinite(t)?this._formatNumber(t):e}_trendIcon(){return this.trend==="up"?"trending-up":this.trend==="down"?"trending-down":this.trend==="neutral"?"minus":""}_renderValue(){let e=this._formattedValue();return this.formatter?this.formatter(this.value,{formatted:e,statistic:this}):e}render(){let e=this._trendIcon(),t=this.valueColor?`--lui-statistic-value-color:${this.valueColor}`:Bo.nothing;return this.loading?Bo.html`
6584
+ `],a([(0,yr.property)()],Rt.prototype,"title",2),a([(0,yr.property)()],Rt.prototype,"subtitle",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"hoverable",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"compact",2),a([(0,yr.property)({reflect:!0})],Rt.prototype,"size",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"borderless",2),a([(0,yr.property)({reflect:!0})],Rt.prototype,"shadow",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"clickable",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"ripple",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"selected",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"loading",2),a([(0,yr.property)({type:Boolean,reflect:!0})],Rt.prototype,"dividerless",2),a([(0,yr.property)({reflect:!0,attribute:"cover-ratio"})],Rt.prototype,"coverRatio",2),a([(0,yr.property)()],Rt.prototype,"locale",2),a([(0,yr.property)({attribute:!1})],Rt.prototype,"translations",2),Rt=a([(0,yr.customElement)("lui-card")],Rt);var qo=require("lit"),dr=require("lit/decorators.js");var St=class extends qo.LitElement{constructor(){super(...arguments);this.title="";this.value=0;this.prefix="";this.suffix="";this.description="";this.groupSeparator=",";this.decimalSeparator=".";this.size="md";this.align="start";this.trend="none";this.trendValue="";this.status="default";this.valueColor="";this.loading=!1;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){let t=L(this,"statistic");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("align")&&typeof t.align=="string"&&this.align!==t.align&&(this.align=t.align),!this._explicitAttrs.has("status")&&typeof t.status=="string"&&this.status!==t.status&&(this.status=t.status),!this._explicitAttrs.has("loading")&&typeof t.loading=="boolean"&&this.loading!==t.loading&&(this.loading=t.loading),!this._explicitAttrs.has("group-separator")&&typeof t.groupSeparator=="string"&&this.groupSeparator!==t.groupSeparator&&(this.groupSeparator=t.groupSeparator),!this._explicitAttrs.has("decimal-separator")&&typeof t.decimalSeparator=="string"&&this.decimalSeparator!==t.decimalSeparator&&(this.decimalSeparator=t.decimalSeparator)}_formatNumber(e){let t=typeof this.precision=="number"&&Number.isFinite(this.precision)?e.toFixed(Math.max(0,this.precision)):String(e),[r,n]=t.split("."),s=r.replace(/\B(?=(\d{3})+(?!\d))/g,this.groupSeparator);return n!=null?`${s}${this.decimalSeparator}${n}`:s}_formattedValue(){if(typeof this.value=="number")return this._formatNumber(this.value);let e=String(this.value??""),t=Number(e);return e.trim()!==""&&Number.isFinite(t)?this._formatNumber(t):e}_trendIcon(){return this.trend==="up"?"trending-up":this.trend==="down"?"trending-down":this.trend==="neutral"?"minus":""}_renderValue(){let e=this._formattedValue();return this.formatter?this.formatter(this.value,{formatted:e,statistic:this}):e}render(){let e=this._trendIcon(),t=this.valueColor?`--lui-statistic-value-color:${this.valueColor}`:qo.nothing;return this.loading?qo.html`
6583
6585
  <div class="statistic" part="statistic" style=${t} aria-busy="true">
6584
6586
  <div class="skeleton title-skeleton" part="title-skeleton"></div>
6585
6587
  <div class="skeleton value-skeleton" part="value-skeleton"></div>
6586
6588
  <div class="skeleton desc-skeleton" part="description-skeleton"></div>
6587
6589
  </div>
6588
- `:Bo.html`
6590
+ `:qo.html`
6589
6591
  <div class="statistic" part="statistic" style=${t}>
6590
6592
  <div class="title" part="title"><slot name="title">${this.title}</slot></div>
6591
6593
  <div class="value-row" part="value-row">
6592
6594
  <span class="prefix" part="prefix"><slot name="prefix">${this.prefix}</slot></span>
6593
6595
  <span class="value" part="value">${this._renderValue()}</span>
6594
6596
  <span class="suffix" part="suffix"><slot name="suffix">${this.suffix}</slot></span>
6595
- ${e||this.trendValue?Bo.html`<span class="trend" part="trend">${e?Bo.html`<lui-icon name=${e}></lui-icon>`:Bo.nothing}<span>${this.trendValue}</span></span>`:Bo.nothing}
6597
+ ${e||this.trendValue?qo.html`<span class="trend" part="trend">${e?qo.html`<lui-icon name=${e}></lui-icon>`:qo.nothing}<span>${this.trendValue}</span></span>`:qo.nothing}
6596
6598
  </div>
6597
6599
  <div class="description" part="description"><slot name="description">${this.description}</slot></div>
6598
6600
  </div>
6599
- `}};St.styles=[A,j,Bo.css`
6601
+ `}};St.styles=[A,j,qo.css`
6600
6602
  :host {
6601
6603
  display: block;
6602
6604
  min-width: 0;
@@ -6877,7 +6879,7 @@
6877
6879
  transform: scale(2.4);
6878
6880
  }
6879
6881
  }
6880
- `],a([(0,Pr.property)({reflect:!0})],rr.prototype,"variant",2),a([(0,Pr.property)({reflect:!0})],rr.prototype,"size",2),a([(0,Pr.property)({reflect:!0})],rr.prototype,"radius",2),a([(0,Pr.property)({reflect:!0})],rr.prototype,"placement",2),a([(0,Pr.property)()],rr.prototype,"count",2),a([(0,Pr.property)({type:Number})],rr.prototype,"max",2),a([(0,Pr.property)({type:Boolean,attribute:"show-zero"})],rr.prototype,"showZero",2),a([(0,Pr.property)({type:Boolean,reflect:!0})],rr.prototype,"dot",2),a([(0,Pr.property)({type:Boolean,reflect:!0})],rr.prototype,"processing",2),a([(0,Pr.property)()],rr.prototype,"text",2),a([(0,Pr.property)()],rr.prototype,"color",2),a([(0,Pr.property)()],rr.prototype,"offset",2),a([(0,Pr.queryAssignedElements)({flatten:!0})],rr.prototype,"_assignedElements",2),rr=a([(0,Pr.customElement)("lui-badge")],rr);function Ki(i,o){return String(i.key??i.value??o)}function Rm(i,o){return i.length===o.length&&i.every((e,t)=>e===o[t])}var Eo=class extends st.LitElement{constructor(){super(...arguments);this.key="";this.value="";this.label="";this.icon="";this.badge="";this.disabled=!1;this.closable=!1}get tabKey(){return this.key||this.value}render(){return st.html`<slot></slot>`}};Eo.styles=[A,j,st.css`
6882
+ `],a([(0,Pr.property)({reflect:!0})],rr.prototype,"variant",2),a([(0,Pr.property)({reflect:!0})],rr.prototype,"size",2),a([(0,Pr.property)({reflect:!0})],rr.prototype,"radius",2),a([(0,Pr.property)({reflect:!0})],rr.prototype,"placement",2),a([(0,Pr.property)()],rr.prototype,"count",2),a([(0,Pr.property)({type:Number})],rr.prototype,"max",2),a([(0,Pr.property)({type:Boolean,attribute:"show-zero"})],rr.prototype,"showZero",2),a([(0,Pr.property)({type:Boolean,reflect:!0})],rr.prototype,"dot",2),a([(0,Pr.property)({type:Boolean,reflect:!0})],rr.prototype,"processing",2),a([(0,Pr.property)()],rr.prototype,"text",2),a([(0,Pr.property)()],rr.prototype,"color",2),a([(0,Pr.property)()],rr.prototype,"offset",2),a([(0,Pr.queryAssignedElements)({flatten:!0})],rr.prototype,"_assignedElements",2),rr=a([(0,Pr.customElement)("lui-badge")],rr);function Ki(i,o){return String(i.key??i.value??o)}function Rm(i,o){return i.length===o.length&&i.every((e,t)=>e===o[t])}var So=class extends st.LitElement{constructor(){super(...arguments);this.key="";this.value="";this.label="";this.icon="";this.badge="";this.disabled=!1;this.closable=!1}get tabKey(){return this.key||this.value}render(){return st.html`<slot></slot>`}};So.styles=[A,j,st.css`
6881
6883
  :host {
6882
6884
  display: block;
6883
6885
  min-width: 0;
@@ -6885,7 +6887,7 @@
6885
6887
  :host([hidden]) {
6886
6888
  display: none !important;
6887
6889
  }
6888
- `],a([(0,Ze.property)()],Eo.prototype,"key",2),a([(0,Ze.property)()],Eo.prototype,"value",2),a([(0,Ze.property)()],Eo.prototype,"label",2),a([(0,Ze.property)()],Eo.prototype,"icon",2),a([(0,Ze.property)()],Eo.prototype,"badge",2),a([(0,Ze.property)({type:Boolean,reflect:!0})],Eo.prototype,"disabled",2),a([(0,Ze.property)({type:Boolean,reflect:!0})],Eo.prototype,"closable",2),Eo=a([(0,Ze.customElement)("lui-tab-panel")],Eo);var It=class extends st.LitElement{constructor(){super(...arguments);this.activeKey="";this.size="md";this.variant="line";this.placement="top";this.closable=!1;this.disabled=!1;this.collapse="none";this.overflowLabel="\u66F4\u591A";this.overflowIcon="more-horizontal";this._overflowIndexes=[];this._explicitAttrs=new Set;this._observedTabButtons=new Set;this._layoutFrame=0;this._indicatorFrame=0;this._onExtraSlotChange=e=>{let r=e.currentTarget.assignedNodes({flatten:!0}).some(n=>n.nodeType===Node.ELEMENT_NODE?!0:!!n.textContent?.trim());this.toggleAttribute("has-extra",r)};this._onKeyDown=e=>{let t=this._tabs(),r=t.map((k,C)=>({item:k,index:C})).filter(({item:k})=>!k.disabled);if(!r.length)return;let n=this._resolvedActiveKey(t),s=Math.max(0,r.findIndex(({item:k,index:C})=>Ki(k,C)===n)),d=this.placement==="top"||this.placement==="bottom",h=d?"ArrowLeft":"ArrowUp",p=d?"ArrowRight":"ArrowDown",f=s;if(e.key===p)f=(s+1)%r.length;else if(e.key===h)f=(s-1+r.length)%r.length;else if(e.key==="Home")f=0;else if(e.key==="End")f=r.length-1;else return;e.preventDefault();let x=r[f];this._select(x.item,x.index),this.updateComplete.then(()=>{this.renderRoot.querySelector(`button[data-key="${CSS.escape(Ki(x.item,x.index))}"]`)?.focus()})}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._resizeObserver=new ResizeObserver(()=>this._scheduleLayout())}firstUpdated(){this._resizeObserver?.observe(this),this._navEl&&this._resizeObserver?.observe(this._navEl),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._syncObservedTabButtons(),this._scheduleLayout()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}willUpdate(e){let t=L(this,"tab");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&this.placement!==t.placement&&(this.placement=t.placement),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("closable")&&typeof t.closable=="boolean"&&this.closable!==t.closable&&(this.closable=t.closable)}updated(e){this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement));let t=this._resolvedActiveKey();t&&this.getAttribute("active-key")!==t&&this.setAttribute("active-key",t),this._syncPanels(),this._syncObservedTabButtons(),(e.has("items")||e.has("size")||e.has("variant")||e.has("placement")||e.has("closable")||e.has("disabled")||e.has("collapse")||e.has("activeKey"))&&this._scheduleLayout(),this._scheduleActiveIndicatorLayout()}_syncObservedTabButtons(){if(!this._resizeObserver)return;let e=new Set(Array.from(this.renderRoot.querySelectorAll(".tab-button, .overflow-trigger")));for(let t of this._observedTabButtons)e.has(t)||this._resizeObserver.unobserve(t);for(let t of e)this._observedTabButtons.has(t)||this._resizeObserver.observe(t);this._observedTabButtons=e}_panelElements(){return(this._defaultSlot?.assignedElements({flatten:!0})??this._assignedElements??[]).filter(t=>t.tagName.toLowerCase()==="lui-tab-panel")}_itemsFromPanels(){return this._panelElements().map((e,t)=>({key:e.tabKey||String(t),label:e.label||e.getAttribute("label")||e.tabKey||`Tab ${t+1}`,icon:e.icon,badge:e.badge,disabled:e.disabled,closable:e.closable}))}_tabs(){return this.items?.length?this.items:this._itemsFromPanels()}_resolvedActiveKey(e=this._tabs()){let t=e.filter(r=>!r.disabled);return t.length?this.activeKey&&t.some((r,n)=>Ki(r,e.indexOf(r)>=0?e.indexOf(r):n)===this.activeKey)?this.activeKey:Ki(t[0],e.indexOf(t[0])):""}_syncPanels(){if(this.items?.length)return;let e=this._panelElements(),t=this._itemsFromPanels(),r=this._resolvedActiveKey(t);r&&this.activeKey!==r&&(this.activeKey=r),r&&this.getAttribute("active-key")!==r&&this.setAttribute("active-key",r),e.forEach((n,s)=>{let d=n.tabKey||String(s);n.hidden=d!==r})}_select(e,t){if(this.disabled||e.disabled)return;let r=Ki(e,t),n=this._resolvedActiveKey();r===n&&this.activeKey||(this.activeKey=r,this.dispatchEvent(new CustomEvent("change",{detail:{key:r,previousKey:n,item:e,index:t},bubbles:!0,composed:!0})))}_close(e,t,r){e.preventDefault(),e.stopPropagation();let n=Ki(t,r);this.dispatchEvent(new CustomEvent("close",{detail:{key:n,item:t,index:r,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._recomputeOverflow(),this._scheduleActiveIndicatorLayout()})}_scheduleActiveIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updateActiveIndicator()})}_updateActiveIndicator(){let e=this._navEl;if(!e)return;let t=this._resolvedActiveKey(),r=t?e.querySelector(`button.tab-button[data-key="${CSS.escape(t)}"]`):null;if(!r){e.style.setProperty("--lui-tab-indicator-opacity","0");return}let n=e.getBoundingClientRect(),s=r.getBoundingClientRect(),d=r.offsetWidth||s.width,h=r.offsetHeight||s.height;e.style.setProperty("--lui-tab-indicator-x",`${s.left-n.left+e.scrollLeft}px`),e.style.setProperty("--lui-tab-indicator-y",`${s.top-n.top+e.scrollTop}px`),e.style.setProperty("--lui-tab-indicator-width",`${d}px`),e.style.setProperty("--lui-tab-indicator-height",`${h}px`),e.style.setProperty("--lui-tab-indicator-opacity","1")}_isHorizontal(){return this.placement==="top"||this.placement==="bottom"}_tabWidthBudget(){return Math.floor(this._navEl?.clientWidth??0)}_visibleIndexesForAuto(e){if(this.collapse!=="auto"||!this._isHorizontal()||e.length<=1)return e.map((k,C)=>C);let t=this._tabWidthBudget(),r=Array.from(this.renderRoot.querySelectorAll("[data-measure-tab-index]")),n=this.renderRoot.querySelector("[data-measure-overflow-trigger]");if(!t||r.length!==e.length||!n)return e.map((k,C)=>C);let s=Number.parseFloat(getComputedStyle(this._navEl).columnGap||"0")||0,d=r.map(k=>Math.ceil(k.getBoundingClientRect().width)),h=Math.ceil(n.getBoundingClientRect().width);if(d.reduce((k,C)=>k+C,0)+Math.max(0,e.length-1)*s<=t)return e.map((k,C)=>C);let f=[],x=h;for(let k=0;k<e.length;k+=1){let C=d[k]??0,S=x+(f.length>0?s:0)+C;S<=t&&(f.push(k),x=S)}return f}_recomputeOverflow(){let e=this._tabs(),t=new Set(this._visibleIndexesForAuto(e)),r=e.map((n,s)=>s).filter(n=>!t.has(n));Rm(r,this._overflowIndexes)||(this._overflowIndexes=r)}_overflowMenuItems(e,t){return this._overflowIndexes.flatMap(r=>{let n=e[r];if(!n)return[];let s=Ki(n,r);return[{key:s,value:String(r),label:n.label??s,icon:n.icon,disabled:this.disabled||n.disabled,active:s===t}]})}_onOverflowSelect(e,t){let r=Number(e.detail?.value),n=t[r];n&&this._select(n,r)}_renderTab(e,t,r){let n=Ki(e,t),s=n===r,d=e.closable??this.closable;return st.html`
6890
+ `],a([(0,Ze.property)()],So.prototype,"key",2),a([(0,Ze.property)()],So.prototype,"value",2),a([(0,Ze.property)()],So.prototype,"label",2),a([(0,Ze.property)()],So.prototype,"icon",2),a([(0,Ze.property)()],So.prototype,"badge",2),a([(0,Ze.property)({type:Boolean,reflect:!0})],So.prototype,"disabled",2),a([(0,Ze.property)({type:Boolean,reflect:!0})],So.prototype,"closable",2),So=a([(0,Ze.customElement)("lui-tab-panel")],So);var It=class extends st.LitElement{constructor(){super(...arguments);this.activeKey="";this.size="md";this.variant="line";this.placement="top";this.closable=!1;this.disabled=!1;this.collapse="none";this.overflowLabel="\u66F4\u591A";this.overflowIcon="more-horizontal";this._overflowIndexes=[];this._explicitAttrs=new Set;this._observedTabButtons=new Set;this._layoutFrame=0;this._indicatorFrame=0;this._onExtraSlotChange=e=>{let r=e.currentTarget.assignedNodes({flatten:!0}).some(n=>n.nodeType===Node.ELEMENT_NODE?!0:!!n.textContent?.trim());this.toggleAttribute("has-extra",r)};this._onKeyDown=e=>{let t=this._tabs(),r=t.map((k,C)=>({item:k,index:C})).filter(({item:k})=>!k.disabled);if(!r.length)return;let n=this._resolvedActiveKey(t),s=Math.max(0,r.findIndex(({item:k,index:C})=>Ki(k,C)===n)),d=this.placement==="top"||this.placement==="bottom",h=d?"ArrowLeft":"ArrowUp",p=d?"ArrowRight":"ArrowDown",f=s;if(e.key===p)f=(s+1)%r.length;else if(e.key===h)f=(s-1+r.length)%r.length;else if(e.key==="Home")f=0;else if(e.key==="End")f=r.length-1;else return;e.preventDefault();let x=r[f];this._select(x.item,x.index),this.updateComplete.then(()=>{this.renderRoot.querySelector(`button[data-key="${CSS.escape(Ki(x.item,x.index))}"]`)?.focus()})}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._resizeObserver=new ResizeObserver(()=>this._scheduleLayout())}firstUpdated(){this._resizeObserver?.observe(this),this._navEl&&this._resizeObserver?.observe(this._navEl),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._syncObservedTabButtons(),this._scheduleLayout()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}willUpdate(e){let t=L(this,"tab");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&this.placement!==t.placement&&(this.placement=t.placement),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("closable")&&typeof t.closable=="boolean"&&this.closable!==t.closable&&(this.closable=t.closable)}updated(e){this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement));let t=this._resolvedActiveKey();t&&this.getAttribute("active-key")!==t&&this.setAttribute("active-key",t),this._syncPanels(),this._syncObservedTabButtons(),(e.has("items")||e.has("size")||e.has("variant")||e.has("placement")||e.has("closable")||e.has("disabled")||e.has("collapse")||e.has("activeKey"))&&this._scheduleLayout(),this._scheduleActiveIndicatorLayout()}_syncObservedTabButtons(){if(!this._resizeObserver)return;let e=new Set(Array.from(this.renderRoot.querySelectorAll(".tab-button, .overflow-trigger")));for(let t of this._observedTabButtons)e.has(t)||this._resizeObserver.unobserve(t);for(let t of e)this._observedTabButtons.has(t)||this._resizeObserver.observe(t);this._observedTabButtons=e}_panelElements(){return(this._defaultSlot?.assignedElements({flatten:!0})??this._assignedElements??[]).filter(t=>t.tagName.toLowerCase()==="lui-tab-panel")}_itemsFromPanels(){return this._panelElements().map((e,t)=>({key:e.tabKey||String(t),label:e.label||e.getAttribute("label")||e.tabKey||`Tab ${t+1}`,icon:e.icon,badge:e.badge,disabled:e.disabled,closable:e.closable}))}_tabs(){return this.items?.length?this.items:this._itemsFromPanels()}_resolvedActiveKey(e=this._tabs()){let t=e.filter(r=>!r.disabled);return t.length?this.activeKey&&t.some((r,n)=>Ki(r,e.indexOf(r)>=0?e.indexOf(r):n)===this.activeKey)?this.activeKey:Ki(t[0],e.indexOf(t[0])):""}_syncPanels(){if(this.items?.length)return;let e=this._panelElements(),t=this._itemsFromPanels(),r=this._resolvedActiveKey(t);r&&this.activeKey!==r&&(this.activeKey=r),r&&this.getAttribute("active-key")!==r&&this.setAttribute("active-key",r),e.forEach((n,s)=>{let d=n.tabKey||String(s);n.hidden=d!==r})}_select(e,t){if(this.disabled||e.disabled)return;let r=Ki(e,t),n=this._resolvedActiveKey();r===n&&this.activeKey||(this.activeKey=r,this.dispatchEvent(new CustomEvent("change",{detail:{key:r,previousKey:n,item:e,index:t},bubbles:!0,composed:!0})))}_close(e,t,r){e.preventDefault(),e.stopPropagation();let n=Ki(t,r);this.dispatchEvent(new CustomEvent("close",{detail:{key:n,item:t,index:r,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._recomputeOverflow(),this._scheduleActiveIndicatorLayout()})}_scheduleActiveIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updateActiveIndicator()})}_updateActiveIndicator(){let e=this._navEl;if(!e)return;let t=this._resolvedActiveKey(),r=t?e.querySelector(`button.tab-button[data-key="${CSS.escape(t)}"]`):null;if(!r){e.style.setProperty("--lui-tab-indicator-opacity","0");return}let n=e.getBoundingClientRect(),s=r.getBoundingClientRect(),d=r.offsetWidth||s.width,h=r.offsetHeight||s.height;e.style.setProperty("--lui-tab-indicator-x",`${s.left-n.left+e.scrollLeft}px`),e.style.setProperty("--lui-tab-indicator-y",`${s.top-n.top+e.scrollTop}px`),e.style.setProperty("--lui-tab-indicator-width",`${d}px`),e.style.setProperty("--lui-tab-indicator-height",`${h}px`),e.style.setProperty("--lui-tab-indicator-opacity","1")}_isHorizontal(){return this.placement==="top"||this.placement==="bottom"}_tabWidthBudget(){return Math.floor(this._navEl?.clientWidth??0)}_visibleIndexesForAuto(e){if(this.collapse!=="auto"||!this._isHorizontal()||e.length<=1)return e.map((k,C)=>C);let t=this._tabWidthBudget(),r=Array.from(this.renderRoot.querySelectorAll("[data-measure-tab-index]")),n=this.renderRoot.querySelector("[data-measure-overflow-trigger]");if(!t||r.length!==e.length||!n)return e.map((k,C)=>C);let s=Number.parseFloat(getComputedStyle(this._navEl).columnGap||"0")||0,d=r.map(k=>Math.ceil(k.getBoundingClientRect().width)),h=Math.ceil(n.getBoundingClientRect().width);if(d.reduce((k,C)=>k+C,0)+Math.max(0,e.length-1)*s<=t)return e.map((k,C)=>C);let f=[],x=h;for(let k=0;k<e.length;k+=1){let C=d[k]??0,S=x+(f.length>0?s:0)+C;S<=t&&(f.push(k),x=S)}return f}_recomputeOverflow(){let e=this._tabs(),t=new Set(this._visibleIndexesForAuto(e)),r=e.map((n,s)=>s).filter(n=>!t.has(n));Rm(r,this._overflowIndexes)||(this._overflowIndexes=r)}_overflowMenuItems(e,t){return this._overflowIndexes.flatMap(r=>{let n=e[r];if(!n)return[];let s=Ki(n,r);return[{key:s,value:String(r),label:n.label??s,icon:n.icon,disabled:this.disabled||n.disabled,active:s===t}]})}_onOverflowSelect(e,t){let r=Number(e.detail?.value),n=t[r];n&&this._select(n,r)}_renderTab(e,t,r){let n=Ki(e,t),s=n===r,d=e.closable??this.closable;return st.html`
6889
6891
  <button
6890
6892
  class=${`tab-button ${s?"active":""}`}
6891
6893
  part="tab"
@@ -7498,11 +7500,11 @@
7498
7500
  transition-duration: 0.01ms;
7499
7501
  }
7500
7502
  }
7501
- `],a([(0,Yt.property)()],Yr.prototype,"key",2),a([(0,Yt.property)()],Yr.prototype,"value",2),a([(0,Yt.property)()],Yr.prototype,"label",2),a([(0,Yt.property)()],Yr.prototype,"description",2),a([(0,Yt.property)()],Yr.prototype,"icon",2),a([(0,Yt.property)()],Yr.prototype,"extra",2),a([(0,Yt.property)({type:Boolean,reflect:!0})],Yr.prototype,"disabled",2),a([(0,Yt.property)({type:Boolean,reflect:!0})],Yr.prototype,"open",2),a([(0,Yt.property)({reflect:!0,attribute:"icon-placement"})],Yr.prototype,"iconPlacement",2),Yr=a([(0,Yt.customElement)("lui-collapse-item")],Yr);var So=class extends Xr.LitElement{constructor(){super(...arguments);this.variant="bordered";this.size="md";this.iconPlacement="end";this.accordion=!1;this.defaultOpenKeys="";this._internalOpen=null;this._items=[];this._onItemRequest=e=>{let t=e.target?.closest?.("lui-collapse-item");if(!t||t.disabled)return;e.stopPropagation();let r=this._items.indexOf(t);r<0||this._toggle(this._keyFor(t,r))};this._onSlotChange=()=>{this._items=Array.from(this.querySelectorAll("lui-collapse-item")),this._syncItems()}}connectedCallback(){super.connectedCallback(),this.addEventListener("item-toggle-request",this._onItemRequest)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("item-toggle-request",this._onItemRequest)}get _openList(){return this.openKeys!==void 0?this.openKeys:this._internalOpen!==null?this._internalOpen:this.defaultOpenKeys.split(",").map(e=>e.trim()).filter(Boolean)}_keyFor(e,t){return e.itemKey||String(t)}_toggle(e){let t=new Set(this._openList),r=!t.has(e),n;this.accordion?n=r?[e]:[]:(r?t.add(e):t.delete(e),n=[...t]);let s={key:e,open:r,openKeys:n},d=new CustomEvent("toggle",{detail:s,bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(d)&&(this.openKeys===void 0&&(this._internalOpen=n,this._syncItems(n)),this.dispatchEvent(new CustomEvent("change",{detail:s,bubbles:!0,composed:!0})))}_syncItems(e=this._openList){let t=new Set(e);this._items.forEach((r,n)=>{r.open=t.has(this._keyFor(r,n)),r.iconPlacement=this.iconPlacement})}openAll(){if(this.accordion)return;let e=this._items.map((t,r)=>({item:t,key:this._keyFor(t,r)})).filter(({item:t})=>!t.disabled).map(({key:t})=>t);this._applyExternal(e,!0)}closeAll(){this._applyExternal([],!1)}_applyExternal(e,t){this.openKeys===void 0&&(this._internalOpen=e,this._syncItems(e)),this.dispatchEvent(new CustomEvent("change",{detail:{key:"",open:t,openKeys:e},bubbles:!0,composed:!0}))}updated(){this._syncItems()}render(){let t=L(this,"collapse").variant??this.variant;return Xr.html`
7503
+ `],a([(0,Yt.property)()],Yr.prototype,"key",2),a([(0,Yt.property)()],Yr.prototype,"value",2),a([(0,Yt.property)()],Yr.prototype,"label",2),a([(0,Yt.property)()],Yr.prototype,"description",2),a([(0,Yt.property)()],Yr.prototype,"icon",2),a([(0,Yt.property)()],Yr.prototype,"extra",2),a([(0,Yt.property)({type:Boolean,reflect:!0})],Yr.prototype,"disabled",2),a([(0,Yt.property)({type:Boolean,reflect:!0})],Yr.prototype,"open",2),a([(0,Yt.property)({reflect:!0,attribute:"icon-placement"})],Yr.prototype,"iconPlacement",2),Yr=a([(0,Yt.customElement)("lui-collapse-item")],Yr);var $o=class extends Xr.LitElement{constructor(){super(...arguments);this.variant="bordered";this.size="md";this.iconPlacement="end";this.accordion=!1;this.defaultOpenKeys="";this._internalOpen=null;this._items=[];this._onItemRequest=e=>{let t=e.target?.closest?.("lui-collapse-item");if(!t||t.disabled)return;e.stopPropagation();let r=this._items.indexOf(t);r<0||this._toggle(this._keyFor(t,r))};this._onSlotChange=()=>{this._items=Array.from(this.querySelectorAll("lui-collapse-item")),this._syncItems()}}connectedCallback(){super.connectedCallback(),this.addEventListener("item-toggle-request",this._onItemRequest)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("item-toggle-request",this._onItemRequest)}get _openList(){return this.openKeys!==void 0?this.openKeys:this._internalOpen!==null?this._internalOpen:this.defaultOpenKeys.split(",").map(e=>e.trim()).filter(Boolean)}_keyFor(e,t){return e.itemKey||String(t)}_toggle(e){let t=new Set(this._openList),r=!t.has(e),n;this.accordion?n=r?[e]:[]:(r?t.add(e):t.delete(e),n=[...t]);let s={key:e,open:r,openKeys:n},d=new CustomEvent("toggle",{detail:s,bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(d)&&(this.openKeys===void 0&&(this._internalOpen=n,this._syncItems(n)),this.dispatchEvent(new CustomEvent("change",{detail:s,bubbles:!0,composed:!0})))}_syncItems(e=this._openList){let t=new Set(e);this._items.forEach((r,n)=>{r.open=t.has(this._keyFor(r,n)),r.iconPlacement=this.iconPlacement})}openAll(){if(this.accordion)return;let e=this._items.map((t,r)=>({item:t,key:this._keyFor(t,r)})).filter(({item:t})=>!t.disabled).map(({key:t})=>t);this._applyExternal(e,!0)}closeAll(){this._applyExternal([],!1)}_applyExternal(e,t){this.openKeys===void 0&&(this._internalOpen=e,this._syncItems(e)),this.dispatchEvent(new CustomEvent("change",{detail:{key:"",open:t,openKeys:e},bubbles:!0,composed:!0}))}updated(){this._syncItems()}render(){let t=L(this,"collapse").variant??this.variant;return Xr.html`
7502
7504
  <div class="root" part="base" data-variant=${t}>
7503
7505
  <slot @slotchange=${this._onSlotChange}></slot>
7504
7506
  </div>
7505
- `}};So.styles=[A,j,Xr.css`
7507
+ `}};$o.styles=[A,j,Xr.css`
7506
7508
  :host {
7507
7509
  display: block;
7508
7510
  --lui-collapse-radius: var(--lui-radius);
@@ -7544,7 +7546,7 @@
7544
7546
  :host([variant="plain"]) ::slotted(lui-collapse-item + lui-collapse-item) {
7545
7547
  border-top: 1px solid color-mix(in srgb, var(--lui-color-border) 72%, transparent);
7546
7548
  }
7547
- `],a([(0,Yt.property)({reflect:!0})],So.prototype,"variant",2),a([(0,Yt.property)({reflect:!0})],So.prototype,"size",2),a([(0,Yt.property)({reflect:!0,attribute:"icon-placement"})],So.prototype,"iconPlacement",2),a([(0,Yt.property)({type:Boolean,reflect:!0})],So.prototype,"accordion",2),a([(0,Yt.property)({attribute:!1})],So.prototype,"openKeys",2),a([(0,Yt.property)({attribute:"default-open-keys"})],So.prototype,"defaultOpenKeys",2),a([(0,Yt.state)()],So.prototype,"_internalOpen",2),So=a([(0,Yt.customElement)("lui-collapse")],So);var Zr=require("lit"),or=require("lit/decorators.js");var ap=[{color:"var(--lui-color-info)",bgMix:18,fgMix:92},{color:"oklch(64% 0.22 295)",bgMix:18,fgMix:88},{color:"var(--lui-color-success)",bgMix:16,fgMix:90},{color:"var(--lui-color-warning)",bgMix:18,fgMix:94},{color:"var(--lui-color-danger)",bgMix:16,fgMix:92},{color:"oklch(70% 0.16 185)",bgMix:16,fgMix:88},{color:"oklch(66% 0.24 310)",bgMix:18,fgMix:90},{color:"var(--lui-color-fg-muted)",bgMix:16,fgMix:88}],$t=class extends Zr.LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.name="";this.text="";this.icon="user";this.size="md";this.radius="full";this.color="auto";this.status="none";this.statusColor="";this.statusPosition="top-right";this.clickable=!1;this.disabled=!1;this.tooltip="";this.tooltipPlacement="top";this._imageError=!1;this._explicitAttrs=new Set;this._onImageError=()=>{this._imageError=!0};this._onClick=e=>{this.disabled&&(e.preventDefault(),e.stopPropagation())};this._onKeyDown=e=>{!this.clickable||this.disabled||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this._emitKeyboardClick())}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){e.has("src")&&(this._imageError=!1);let t=L(this,"avatar");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("color")&&typeof t.color=="string"&&this.color!==t.color&&(this.color=t.color),!this._explicitAttrs.has("status")&&typeof t.status=="string"&&this.status!==t.status&&(this.status=t.status),!this._explicitAttrs.has("status-position")&&typeof t.statusPosition=="string"&&this.statusPosition!==t.statusPosition&&(this.statusPosition=t.statusPosition),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("clickable")&&typeof t.clickable=="boolean"&&this.clickable!==t.clickable&&(this.clickable=t.clickable)}_getSeed(){return this.text||this.name||this.alt||this.icon||"avatar"}_getInitials(){let e=(this.text||this.name||this.alt||"").trim();if(!e)return"";let t=e.split(/[\s\-_]+/).map(r=>r.trim()).filter(Boolean);return t.length>=2?`${t[0][0]??""}${t[t.length-1][0]??""}`.toUpperCase():e.length<=2?e.toUpperCase():e.slice(0,2).toUpperCase()}_getAutoPaletteStyle(){if(this.color!=="auto"||this.src&&!this._imageError)return"";let e=this._getSeed(),t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;let r=ap[t%ap.length];return`--lui-avatar-bg:color-mix(in srgb, ${r.color} ${r.bgMix}%, var(--lui-color-bg));--lui-avatar-fg:color-mix(in srgb, ${r.color} ${r.fgMix}%, var(--lui-color-fg));--lui-avatar-border:color-mix(in srgb, ${r.color} 24%, transparent);`}_getAvatarStyle(){return[this._getAutoPaletteStyle(),this.statusColor?`--lui-avatar-status-bg:${this.statusColor};`:""].filter(Boolean).join("")||Zr.nothing}_emitKeyboardClick(){this.disabled||!this.clickable||this.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0}))}_renderAvatar(){let e=!!this.src&&!this._imageError,t=this._getInitials(),r=this.alt||this.name||this.text||"avatar",n=this.status!=="none"||!!this.statusColor;return Zr.html`
7549
+ `],a([(0,Yt.property)({reflect:!0})],$o.prototype,"variant",2),a([(0,Yt.property)({reflect:!0})],$o.prototype,"size",2),a([(0,Yt.property)({reflect:!0,attribute:"icon-placement"})],$o.prototype,"iconPlacement",2),a([(0,Yt.property)({type:Boolean,reflect:!0})],$o.prototype,"accordion",2),a([(0,Yt.property)({attribute:!1})],$o.prototype,"openKeys",2),a([(0,Yt.property)({attribute:"default-open-keys"})],$o.prototype,"defaultOpenKeys",2),a([(0,Yt.state)()],$o.prototype,"_internalOpen",2),$o=a([(0,Yt.customElement)("lui-collapse")],$o);var Zr=require("lit"),or=require("lit/decorators.js");var ap=[{color:"var(--lui-color-info)",bgMix:18,fgMix:92},{color:"oklch(64% 0.22 295)",bgMix:18,fgMix:88},{color:"var(--lui-color-success)",bgMix:16,fgMix:90},{color:"var(--lui-color-warning)",bgMix:18,fgMix:94},{color:"var(--lui-color-danger)",bgMix:16,fgMix:92},{color:"oklch(70% 0.16 185)",bgMix:16,fgMix:88},{color:"oklch(66% 0.24 310)",bgMix:18,fgMix:90},{color:"var(--lui-color-fg-muted)",bgMix:16,fgMix:88}],$t=class extends Zr.LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.name="";this.text="";this.icon="user";this.size="md";this.radius="full";this.color="auto";this.status="none";this.statusColor="";this.statusPosition="top-right";this.clickable=!1;this.disabled=!1;this.tooltip="";this.tooltipPlacement="top";this._imageError=!1;this._explicitAttrs=new Set;this._onImageError=()=>{this._imageError=!0};this._onClick=e=>{this.disabled&&(e.preventDefault(),e.stopPropagation())};this._onKeyDown=e=>{!this.clickable||this.disabled||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this._emitKeyboardClick())}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){e.has("src")&&(this._imageError=!1);let t=L(this,"avatar");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("color")&&typeof t.color=="string"&&this.color!==t.color&&(this.color=t.color),!this._explicitAttrs.has("status")&&typeof t.status=="string"&&this.status!==t.status&&(this.status=t.status),!this._explicitAttrs.has("status-position")&&typeof t.statusPosition=="string"&&this.statusPosition!==t.statusPosition&&(this.statusPosition=t.statusPosition),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("clickable")&&typeof t.clickable=="boolean"&&this.clickable!==t.clickable&&(this.clickable=t.clickable)}_getSeed(){return this.text||this.name||this.alt||this.icon||"avatar"}_getInitials(){let e=(this.text||this.name||this.alt||"").trim();if(!e)return"";let t=e.split(/[\s\-_]+/).map(r=>r.trim()).filter(Boolean);return t.length>=2?`${t[0][0]??""}${t[t.length-1][0]??""}`.toUpperCase():e.length<=2?e.toUpperCase():e.slice(0,2).toUpperCase()}_getAutoPaletteStyle(){if(this.color!=="auto"||this.src&&!this._imageError)return"";let e=this._getSeed(),t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;let r=ap[t%ap.length];return`--lui-avatar-bg:color-mix(in srgb, ${r.color} ${r.bgMix}%, var(--lui-color-bg));--lui-avatar-fg:color-mix(in srgb, ${r.color} ${r.fgMix}%, var(--lui-color-fg));--lui-avatar-border:color-mix(in srgb, ${r.color} 24%, transparent);`}_getAvatarStyle(){return[this._getAutoPaletteStyle(),this.statusColor?`--lui-avatar-status-bg:${this.statusColor};`:""].filter(Boolean).join("")||Zr.nothing}_emitKeyboardClick(){this.disabled||!this.clickable||this.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0}))}_renderAvatar(){let e=!!this.src&&!this._imageError,t=this._getInitials(),r=this.alt||this.name||this.text||"avatar",n=this.status!=="none"||!!this.statusColor;return Zr.html`
7548
7550
  <span
7549
7551
  class="avatar"
7550
7552
  part="base"
@@ -7871,7 +7873,7 @@
7871
7873
  font-size: var(--lui-font-size-xs);
7872
7874
  color: var(--lui-color-muted);
7873
7875
  }
7874
- `],a([(0,kr.property)({reflect:!0})],ir.prototype,"size",2),a([(0,kr.property)({reflect:!0})],ir.prototype,"radius",2),a([(0,kr.property)({type:Number})],ir.prototype,"max",2),a([(0,kr.property)({type:Number})],ir.prototype,"overlap",2),a([(0,kr.property)({type:Number})],ir.prototype,"total",2),a([(0,kr.property)({attribute:!1})],ir.prototype,"items",2),a([(0,kr.property)({type:Boolean})],ir.prototype,"bordered",2),a([(0,kr.property)({reflect:!0})],ir.prototype,"summaryColor",2),a([(0,kr.property)({reflect:!0,attribute:"expand-trigger"})],ir.prototype,"expandTrigger",2),a([(0,kr.property)({attribute:"summary-text"})],ir.prototype,"summaryText",2),a([(0,kr.property)({reflect:!0,attribute:"status-position"})],ir.prototype,"statusPosition",2),a([(0,kr.queryAssignedElements)({flatten:!0})],ir.prototype,"_assignedElements",2),a([(0,kr.state)()],ir.prototype,"_slotHiddenCount",2),ir=a([(0,kr.customElement)("lui-avatar-group")],ir);var wr=require("lit");typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(o,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var t=document.createEvent("CustomEvent");return t.initCustomEvent(o,e.bubbles,e.cancelable,e.detail),t}));var Im=typeof document<"u"&&!!document.documentMode,Nc;function Vm(){return Nc||(Nc=document.createElement("div").style)}var sp=["webkit","moz","ms"],pl={};function Uc(i){if(pl[i])return pl[i];let o=Vm();if(i in o)return pl[i]=i;let e=i[0].toUpperCase()+i.slice(1),t=sp.length;for(;t--;){let r=`${sp[t]}${e}`;if(r in o)return pl[i]=r}}function ml(i,o){return parseFloat(o[Uc(i)])||0}function gl(i,o,e=window.getComputedStyle(i)){let t=o==="border"?"Width":"";return{left:ml(`${o}Left${t}`,e),right:ml(`${o}Right${t}`,e),top:ml(`${o}Top${t}`,e),bottom:ml(`${o}Bottom${t}`,e)}}function da(i,o,e){i.style[Uc(o)]=e}function Dm(i,o){let e=Uc("transform");da(i,"transition",`${e} ${o.duration}ms ${o.easing}`)}function Fm(i,{x:o,y:e,scale:t,isSVG:r},n){if(da(i,"transform",`scale(${t}) translate(${o}px, ${e}px)`),r&&Im){let s=window.getComputedStyle(i).getPropertyValue("transform");i.setAttribute("transform",s)}}function Lc(i){let o=i.parentNode;(!o||o.nodeType!==1)&&(o=document.documentElement);let e=window.getComputedStyle(i),t=window.getComputedStyle(o),r=i.getBoundingClientRect(),n=o.getBoundingClientRect();return{elem:{style:e,width:r.width,height:r.height,top:r.top,bottom:r.bottom,left:r.left,right:r.right,margin:gl(i,"margin",e),border:gl(i,"border",e)},parent:{style:t,width:n.width,height:n.height,top:n.top,bottom:n.bottom,left:n.left,right:n.right,padding:gl(o,"padding",t),border:gl(o,"border",t)}}}var ls={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?ls={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(ls={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function Bc(i,o,e,t){ls[i].split(" ").forEach(r=>{o.addEventListener(r,e,t)})}function qc(i,o,e){ls[i].split(" ").forEach(t=>{o.removeEventListener(t,e)})}function cp(i,o){let e=i.length;for(;e--;)if(i[e].pointerId===o.pointerId)return e;return-1}function Wc(i,o){let e;if(o.touches){e=0;for(let t of o.touches)t.pointerId=e++,Wc(i,t);return}e=cp(i,o),e>-1&&i.splice(e,1),i.push(o)}function Nm(i,o){if(o.touches){for(;i.length;)i.pop();return}let e=cp(i,o);e>-1&&i.splice(e,1)}function lp(i){i=i.slice(0);let o=i.pop(),e;for(;e=i.pop();)o={clientX:(e.clientX-o.clientX)/2+o.clientX,clientY:(e.clientY-o.clientY)/2+o.clientY};return o}function Kc(i){if(i.length<2)return 0;let o=i[0],e=i[1];return Math.sqrt(Math.pow(Math.abs(e.clientX-o.clientX),2)+Math.pow(Math.abs(e.clientY-o.clientY),2))}function Lm(i){let o=i;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1}function Bm(i){return(i.getAttribute("class")||"").trim()}function qm(i,o){return i.nodeType===1&&` ${Bm(i)} `.indexOf(` ${o} `)>-1}function Km(i,o){for(let e=i;e!=null;e=e.parentNode)if(qm(e,o.excludeClass)||o.exclude.indexOf(e)>-1)return!0;return!1}var Wm=/^http:[\w\.\/]+svg$/;function Um(i){return Wm.test(i.namespaceURI)&&i.nodeName.toLowerCase()!=="svg"}function Gm(i){let o={};for(let e in i)i.hasOwnProperty(e)&&(o[e]=i[e]);return o}var dp={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:i=>{i.preventDefault(),i.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:Fm,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function Gc(i,o){if(!i)throw new Error("Panzoom requires an element as an argument");if(i.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!Lm(i))throw new Error("Panzoom should be called on elements that have been attached to the DOM");o={...dp,...o};let e=Um(i),t=i.parentNode;t.style.overflow=o.overflow,t.style.userSelect="none",t.style.touchAction=o.touchAction,(o.canvas?t:i).style.cursor=o.cursor,i.style.userSelect="none",i.style.touchAction=o.touchAction,da(i,"transformOrigin",typeof o.origin=="string"?o.origin:e?"0 0":"50% 50%");function r(){t.style.overflow="",t.style.userSelect="",t.style.touchAction="",t.style.cursor="",i.style.cursor="",i.style.userSelect="",i.style.touchAction="",da(i,"transformOrigin","")}function n(q={}){for(let ee in q)q.hasOwnProperty(ee)&&(o[ee]=q[ee]);(q.hasOwnProperty("cursor")||q.hasOwnProperty("canvas"))&&(t.style.cursor=i.style.cursor="",(o.canvas?t:i).style.cursor=o.cursor),q.hasOwnProperty("overflow")&&(t.style.overflow=q.overflow),q.hasOwnProperty("touchAction")&&(t.style.touchAction=q.touchAction,i.style.touchAction=q.touchAction)}let s=0,d=0,h=1,p=!1;z(o.startScale,{animate:!1,force:!0}),setTimeout(()=>{S(o.startX,o.startY,{animate:!1,force:!0})});function f(q,ee,fe){if(fe.silent)return;let Ne=new CustomEvent(q,{detail:ee});i.dispatchEvent(Ne)}function x(q,ee,fe){let Ne={x:s,y:d,scale:h,isSVG:e,originalEvent:fe};return requestAnimationFrame(()=>{typeof ee.animate=="boolean"&&(ee.animate?Dm(i,ee):da(i,"transition","none")),ee.setTransform(i,Ne,ee),f(q,Ne,ee),f("panzoomchange",Ne,ee)}),Ne}function k(q,ee,fe,Ne){let Z={...o,...Ne},Ae={x:s,y:d,opts:Z};if(!Ne?.force&&(Z.disablePan||Z.panOnlyWhenZoomed&&h===Z.startScale))return Ae;if(q=parseFloat(q),ee=parseFloat(ee),Z.disableXAxis||(Ae.x=(Z.relative?s:0)+q),Z.disableYAxis||(Ae.y=(Z.relative?d:0)+ee),Z.contain){let ce=Lc(i),wo=ce.elem.width/h,U=ce.elem.height/h,en=wo*fe,li=U*fe,Go=(en-wo)/2,ci=(li-U)/2;if(Z.contain==="inside"){let tn=(-ce.elem.margin.left-ce.parent.padding.left+Go)/fe,ji=(ce.parent.width-en-ce.parent.padding.left-ce.elem.margin.left-ce.parent.border.left-ce.parent.border.right+Go)/fe;Ae.x=Math.max(Math.min(Ae.x,ji),tn);let di=(-ce.elem.margin.top-ce.parent.padding.top+ci)/fe,qn=(ce.parent.height-li-ce.parent.padding.top-ce.elem.margin.top-ce.parent.border.top-ce.parent.border.bottom+ci)/fe;Ae.y=Math.max(Math.min(Ae.y,qn),di)}else if(Z.contain==="outside"){let tn=(-(en-ce.parent.width)-ce.parent.padding.left-ce.parent.border.left-ce.parent.border.right+Go)/fe,ji=(Go-ce.parent.padding.left)/fe;Ae.x=Math.max(Math.min(Ae.x,ji),tn);let di=(-(li-ce.parent.height)-ce.parent.padding.top-ce.parent.border.top-ce.parent.border.bottom+ci)/fe,qn=(ci-ce.parent.padding.top)/fe;Ae.y=Math.max(Math.min(Ae.y,qn),di)}}return Z.roundPixels&&(Ae.x=Math.round(Ae.x),Ae.y=Math.round(Ae.y)),Ae}function C(q,ee){let fe={...o,...ee},Ne={scale:h,opts:fe};if(!ee?.force&&fe.disableZoom)return Ne;let Z=o.minScale,Ae=o.maxScale;if(fe.contain){let ce=Lc(i),wo=ce.elem.width/h,U=ce.elem.height/h;if(wo>1&&U>1){let en=ce.parent.width-ce.parent.border.left-ce.parent.border.right,li=ce.parent.height-ce.parent.border.top-ce.parent.border.bottom,Go=en/wo,ci=li/U;o.contain==="inside"?Ae=Math.min(Ae,Go,ci):o.contain==="outside"&&(Z=Math.max(Z,Go,ci))}}return Ne.scale=Math.min(Math.max(q,Z),Ae),Ne}function S(q,ee,fe,Ne){let Z=k(q,ee,h,fe);return s!==Z.x||d!==Z.y?(s=Z.x,d=Z.y,x("panzoompan",Z.opts,Ne)):{x:s,y:d,scale:h,isSVG:e,originalEvent:Ne}}function z(q,ee,fe){let Ne=C(q,ee),Z=Ne.opts;if(!ee?.force&&Z.disableZoom)return;q=Ne.scale;let Ae=s,ce=d;if(Z.focal){let U=Z.focal;Ae=(U.x/q-U.x/h+s*q)/q,ce=(U.y/q-U.y/h+d*q)/q}let wo=k(Ae,ce,q,{relative:!1,force:!0});return s=wo.x,d=wo.y,h=q,x("panzoomzoom",Z,fe)}function T(q,ee){let fe={...o,animate:!0,...ee};return z(h*Math.exp((q?1:-1)*fe.step),fe)}function P(q){return T(!0,q)}function H(q){return T(!1,q)}function I(q,ee,fe,Ne){let Z=Lc(i),Ae={width:Z.parent.width-Z.parent.padding.left-Z.parent.padding.right-Z.parent.border.left-Z.parent.border.right,height:Z.parent.height-Z.parent.padding.top-Z.parent.padding.bottom-Z.parent.border.top-Z.parent.border.bottom},ce=ee.clientX-Z.parent.left-Z.parent.padding.left-Z.parent.border.left-Z.elem.margin.left,wo=ee.clientY-Z.parent.top-Z.parent.padding.top-Z.parent.border.top-Z.elem.margin.top;e||(ce-=Z.elem.width/h/2,wo-=Z.elem.height/h/2);let U={x:ce/Ae.width*(Ae.width*q),y:wo/Ae.height*(Ae.height*q)};return z(q,{...fe,animate:!1,focal:U},Ne)}function B(q,ee){q.preventDefault();let fe={...o,...ee,animate:!1},Z=(q.deltaY===0&&q.deltaX?q.deltaX:q.deltaY)<0?1:-1,Ae=C(h*Math.exp(Z*fe.step/3),fe).scale;return I(Ae,q,fe,q)}function $(q){let ee={...o,animate:!0,force:!0,...q};h=C(ee.startScale,ee).scale;let fe=k(ee.startX,ee.startY,h,ee);return s=fe.x,d=fe.y,x("panzoomreset",ee)}let Q,ye,De,yt,Ee,ai,et=[];function qr(q){if(Km(q.target,o))return;Wc(et,q),p=!0,o.handleStartEvent(q),Q=s,ye=d,f("panzoomstart",{x:s,y:d,scale:h,isSVG:e,originalEvent:q},o);let ee=lp(et);De=ee.clientX,yt=ee.clientY,Ee=h,ai=Kc(et)}function io(q){if(!p||Q===void 0||ye===void 0||De===void 0||yt===void 0)return;Wc(et,q);let ee=lp(et),fe=et.length>1,Ne=h;if(fe){ai===0&&(ai=Kc(et));let Z=Kc(et)-ai;Ne=C(Z*o.step/80+Ee).scale,I(Ne,ee,{animate:!1},q)}(!fe||o.pinchAndPan)&&S(Q+(ee.clientX-De)/Ne,ye+(ee.clientY-yt)/Ne,{animate:!1},q)}function si(q){et.length===1&&f("panzoomend",{x:s,y:d,scale:h,isSVG:e,originalEvent:q},o),Nm(et,q),p&&(p=!1,Q=ye=De=yt=void 0)}let Bn=!1;function Uo(){Bn||(Bn=!0,Bc("down",o.canvas?t:i,qr),Bc("move",document,io,{passive:!0}),Bc("up",document,si,{passive:!0}))}function zi(){Bn=!1,qc("down",o.canvas?t:i,qr),qc("move",document,io),qc("up",document,si)}return o.noBind||Uo(),{bind:Uo,destroy:zi,eventNames:ls,getPan:()=>({x:s,y:d}),getScale:()=>h,getOptions:()=>Gm(o),handleDown:qr,handleMove:io,handleUp:si,pan:S,reset:$,resetStyle:r,setOptions:n,setStyle:(q,ee)=>da(i,q,ee),zoom:z,zoomIn:P,zoomOut:H,zoomToPoint:I,zoomWithWheel:B}}Gc.defaultOptions=dp;var Be=require("lit/decorators.js");var co=require("lit"),qo=require("lit/decorators.js");var up={fromAttribute(i){return i==null?!0:i!=="false"&&i!=="0"},toAttribute(i){return i?"":"false"}};function fl(i){return i==null||i===""?"":Ot(i)}var jr=class extends co.LitElement{constructor(){super(...arguments);this.loading=!0;this.active=!0;this.variant="text";this.size="md";this.radius="md";this.rows=3;this.pauseWhenHidden=!0;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._setupIntersectionObserver()}disconnectedCallback(){super.disconnectedCallback(),this._intersectionObserver?.disconnect()}_setupIntersectionObserver(){this._intersectionObserver?.disconnect(),this.dataset.inView="true",!(!this.pauseWhenHidden||typeof IntersectionObserver>"u")&&(this._intersectionObserver=new IntersectionObserver(e=>{let t=e[0];this.dataset.inView=t?.isIntersecting?"true":"false"}),this._intersectionObserver.observe(this))}willUpdate(e){e.has("pauseWhenHidden")&&this._setupIntersectionObserver();let t=L(this,"skeleton");!this._explicitAttrs.has("active")&&typeof t.active=="boolean"&&this.active!==t.active&&(this.active=t.active),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("rows")&&typeof t.rows=="number"&&this.rows!==t.rows&&(this.rows=t.rows)}_hostStyle(){let e=[this.width!=null&&this.variant!=="text"?`--lui-skeleton-width:${fl(this.width)}`:"",this.height!=null?`--lui-skeleton-height:${fl(this.height)}`:""].filter(Boolean);return e.length?e.join(";"):co.nothing}_lineWidth(e,t){let r=this.widths?.[e];return r!=null?fl(r):this.width!=null&&t===1?fl(this.width):e===t-1&&t>1?"68%":e===0&&t>2?"92%":"100%"}_renderText(e=this.rows){let t=Math.max(1,Math.floor(e||1));return co.html`
7876
+ `],a([(0,kr.property)({reflect:!0})],ir.prototype,"size",2),a([(0,kr.property)({reflect:!0})],ir.prototype,"radius",2),a([(0,kr.property)({type:Number})],ir.prototype,"max",2),a([(0,kr.property)({type:Number})],ir.prototype,"overlap",2),a([(0,kr.property)({type:Number})],ir.prototype,"total",2),a([(0,kr.property)({attribute:!1})],ir.prototype,"items",2),a([(0,kr.property)({type:Boolean})],ir.prototype,"bordered",2),a([(0,kr.property)({reflect:!0})],ir.prototype,"summaryColor",2),a([(0,kr.property)({reflect:!0,attribute:"expand-trigger"})],ir.prototype,"expandTrigger",2),a([(0,kr.property)({attribute:"summary-text"})],ir.prototype,"summaryText",2),a([(0,kr.property)({reflect:!0,attribute:"status-position"})],ir.prototype,"statusPosition",2),a([(0,kr.queryAssignedElements)({flatten:!0})],ir.prototype,"_assignedElements",2),a([(0,kr.state)()],ir.prototype,"_slotHiddenCount",2),ir=a([(0,kr.customElement)("lui-avatar-group")],ir);var wr=require("lit");typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(o,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var t=document.createEvent("CustomEvent");return t.initCustomEvent(o,e.bubbles,e.cancelable,e.detail),t}));var Im=typeof document<"u"&&!!document.documentMode,Nc;function Vm(){return Nc||(Nc=document.createElement("div").style)}var sp=["webkit","moz","ms"],pl={};function Uc(i){if(pl[i])return pl[i];let o=Vm();if(i in o)return pl[i]=i;let e=i[0].toUpperCase()+i.slice(1),t=sp.length;for(;t--;){let r=`${sp[t]}${e}`;if(r in o)return pl[i]=r}}function ml(i,o){return parseFloat(o[Uc(i)])||0}function gl(i,o,e=window.getComputedStyle(i)){let t=o==="border"?"Width":"";return{left:ml(`${o}Left${t}`,e),right:ml(`${o}Right${t}`,e),top:ml(`${o}Top${t}`,e),bottom:ml(`${o}Bottom${t}`,e)}}function da(i,o,e){i.style[Uc(o)]=e}function Dm(i,o){let e=Uc("transform");da(i,"transition",`${e} ${o.duration}ms ${o.easing}`)}function Fm(i,{x:o,y:e,scale:t,isSVG:r},n){if(da(i,"transform",`scale(${t}) translate(${o}px, ${e}px)`),r&&Im){let s=window.getComputedStyle(i).getPropertyValue("transform");i.setAttribute("transform",s)}}function Lc(i){let o=i.parentNode;(!o||o.nodeType!==1)&&(o=document.documentElement);let e=window.getComputedStyle(i),t=window.getComputedStyle(o),r=i.getBoundingClientRect(),n=o.getBoundingClientRect();return{elem:{style:e,width:r.width,height:r.height,top:r.top,bottom:r.bottom,left:r.left,right:r.right,margin:gl(i,"margin",e),border:gl(i,"border",e)},parent:{style:t,width:n.width,height:n.height,top:n.top,bottom:n.bottom,left:n.left,right:n.right,padding:gl(o,"padding",t),border:gl(o,"border",t)}}}var ls={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?ls={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(ls={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function Bc(i,o,e,t){ls[i].split(" ").forEach(r=>{o.addEventListener(r,e,t)})}function qc(i,o,e){ls[i].split(" ").forEach(t=>{o.removeEventListener(t,e)})}function cp(i,o){let e=i.length;for(;e--;)if(i[e].pointerId===o.pointerId)return e;return-1}function Wc(i,o){let e;if(o.touches){e=0;for(let t of o.touches)t.pointerId=e++,Wc(i,t);return}e=cp(i,o),e>-1&&i.splice(e,1),i.push(o)}function Nm(i,o){if(o.touches){for(;i.length;)i.pop();return}let e=cp(i,o);e>-1&&i.splice(e,1)}function lp(i){i=i.slice(0);let o=i.pop(),e;for(;e=i.pop();)o={clientX:(e.clientX-o.clientX)/2+o.clientX,clientY:(e.clientY-o.clientY)/2+o.clientY};return o}function Kc(i){if(i.length<2)return 0;let o=i[0],e=i[1];return Math.sqrt(Math.pow(Math.abs(e.clientX-o.clientX),2)+Math.pow(Math.abs(e.clientY-o.clientY),2))}function Lm(i){let o=i;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1}function Bm(i){return(i.getAttribute("class")||"").trim()}function qm(i,o){return i.nodeType===1&&` ${Bm(i)} `.indexOf(` ${o} `)>-1}function Km(i,o){for(let e=i;e!=null;e=e.parentNode)if(qm(e,o.excludeClass)||o.exclude.indexOf(e)>-1)return!0;return!1}var Wm=/^http:[\w\.\/]+svg$/;function Um(i){return Wm.test(i.namespaceURI)&&i.nodeName.toLowerCase()!=="svg"}function Gm(i){let o={};for(let e in i)i.hasOwnProperty(e)&&(o[e]=i[e]);return o}var dp={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:i=>{i.preventDefault(),i.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:Fm,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function Gc(i,o){if(!i)throw new Error("Panzoom requires an element as an argument");if(i.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!Lm(i))throw new Error("Panzoom should be called on elements that have been attached to the DOM");o={...dp,...o};let e=Um(i),t=i.parentNode;t.style.overflow=o.overflow,t.style.userSelect="none",t.style.touchAction=o.touchAction,(o.canvas?t:i).style.cursor=o.cursor,i.style.userSelect="none",i.style.touchAction=o.touchAction,da(i,"transformOrigin",typeof o.origin=="string"?o.origin:e?"0 0":"50% 50%");function r(){t.style.overflow="",t.style.userSelect="",t.style.touchAction="",t.style.cursor="",i.style.cursor="",i.style.userSelect="",i.style.touchAction="",da(i,"transformOrigin","")}function n(q={}){for(let ee in q)q.hasOwnProperty(ee)&&(o[ee]=q[ee]);(q.hasOwnProperty("cursor")||q.hasOwnProperty("canvas"))&&(t.style.cursor=i.style.cursor="",(o.canvas?t:i).style.cursor=o.cursor),q.hasOwnProperty("overflow")&&(t.style.overflow=q.overflow),q.hasOwnProperty("touchAction")&&(t.style.touchAction=q.touchAction,i.style.touchAction=q.touchAction)}let s=0,d=0,h=1,p=!1;z(o.startScale,{animate:!1,force:!0}),setTimeout(()=>{S(o.startX,o.startY,{animate:!1,force:!0})});function f(q,ee,fe){if(fe.silent)return;let Ne=new CustomEvent(q,{detail:ee});i.dispatchEvent(Ne)}function x(q,ee,fe){let Ne={x:s,y:d,scale:h,isSVG:e,originalEvent:fe};return requestAnimationFrame(()=>{typeof ee.animate=="boolean"&&(ee.animate?Dm(i,ee):da(i,"transition","none")),ee.setTransform(i,Ne,ee),f(q,Ne,ee),f("panzoomchange",Ne,ee)}),Ne}function k(q,ee,fe,Ne){let Z={...o,...Ne},Ae={x:s,y:d,opts:Z};if(!Ne?.force&&(Z.disablePan||Z.panOnlyWhenZoomed&&h===Z.startScale))return Ae;if(q=parseFloat(q),ee=parseFloat(ee),Z.disableXAxis||(Ae.x=(Z.relative?s:0)+q),Z.disableYAxis||(Ae.y=(Z.relative?d:0)+ee),Z.contain){let ce=Lc(i),wo=ce.elem.width/h,U=ce.elem.height/h,en=wo*fe,li=U*fe,Yo=(en-wo)/2,ci=(li-U)/2;if(Z.contain==="inside"){let tn=(-ce.elem.margin.left-ce.parent.padding.left+Yo)/fe,ji=(ce.parent.width-en-ce.parent.padding.left-ce.elem.margin.left-ce.parent.border.left-ce.parent.border.right+Yo)/fe;Ae.x=Math.max(Math.min(Ae.x,ji),tn);let di=(-ce.elem.margin.top-ce.parent.padding.top+ci)/fe,qn=(ce.parent.height-li-ce.parent.padding.top-ce.elem.margin.top-ce.parent.border.top-ce.parent.border.bottom+ci)/fe;Ae.y=Math.max(Math.min(Ae.y,qn),di)}else if(Z.contain==="outside"){let tn=(-(en-ce.parent.width)-ce.parent.padding.left-ce.parent.border.left-ce.parent.border.right+Yo)/fe,ji=(Yo-ce.parent.padding.left)/fe;Ae.x=Math.max(Math.min(Ae.x,ji),tn);let di=(-(li-ce.parent.height)-ce.parent.padding.top-ce.parent.border.top-ce.parent.border.bottom+ci)/fe,qn=(ci-ce.parent.padding.top)/fe;Ae.y=Math.max(Math.min(Ae.y,qn),di)}}return Z.roundPixels&&(Ae.x=Math.round(Ae.x),Ae.y=Math.round(Ae.y)),Ae}function C(q,ee){let fe={...o,...ee},Ne={scale:h,opts:fe};if(!ee?.force&&fe.disableZoom)return Ne;let Z=o.minScale,Ae=o.maxScale;if(fe.contain){let ce=Lc(i),wo=ce.elem.width/h,U=ce.elem.height/h;if(wo>1&&U>1){let en=ce.parent.width-ce.parent.border.left-ce.parent.border.right,li=ce.parent.height-ce.parent.border.top-ce.parent.border.bottom,Yo=en/wo,ci=li/U;o.contain==="inside"?Ae=Math.min(Ae,Yo,ci):o.contain==="outside"&&(Z=Math.max(Z,Yo,ci))}}return Ne.scale=Math.min(Math.max(q,Z),Ae),Ne}function S(q,ee,fe,Ne){let Z=k(q,ee,h,fe);return s!==Z.x||d!==Z.y?(s=Z.x,d=Z.y,x("panzoompan",Z.opts,Ne)):{x:s,y:d,scale:h,isSVG:e,originalEvent:Ne}}function z(q,ee,fe){let Ne=C(q,ee),Z=Ne.opts;if(!ee?.force&&Z.disableZoom)return;q=Ne.scale;let Ae=s,ce=d;if(Z.focal){let U=Z.focal;Ae=(U.x/q-U.x/h+s*q)/q,ce=(U.y/q-U.y/h+d*q)/q}let wo=k(Ae,ce,q,{relative:!1,force:!0});return s=wo.x,d=wo.y,h=q,x("panzoomzoom",Z,fe)}function T(q,ee){let fe={...o,animate:!0,...ee};return z(h*Math.exp((q?1:-1)*fe.step),fe)}function P(q){return T(!0,q)}function H(q){return T(!1,q)}function I(q,ee,fe,Ne){let Z=Lc(i),Ae={width:Z.parent.width-Z.parent.padding.left-Z.parent.padding.right-Z.parent.border.left-Z.parent.border.right,height:Z.parent.height-Z.parent.padding.top-Z.parent.padding.bottom-Z.parent.border.top-Z.parent.border.bottom},ce=ee.clientX-Z.parent.left-Z.parent.padding.left-Z.parent.border.left-Z.elem.margin.left,wo=ee.clientY-Z.parent.top-Z.parent.padding.top-Z.parent.border.top-Z.elem.margin.top;e||(ce-=Z.elem.width/h/2,wo-=Z.elem.height/h/2);let U={x:ce/Ae.width*(Ae.width*q),y:wo/Ae.height*(Ae.height*q)};return z(q,{...fe,animate:!1,focal:U},Ne)}function B(q,ee){q.preventDefault();let fe={...o,...ee,animate:!1},Z=(q.deltaY===0&&q.deltaX?q.deltaX:q.deltaY)<0?1:-1,Ae=C(h*Math.exp(Z*fe.step/3),fe).scale;return I(Ae,q,fe,q)}function $(q){let ee={...o,animate:!0,force:!0,...q};h=C(ee.startScale,ee).scale;let fe=k(ee.startX,ee.startY,h,ee);return s=fe.x,d=fe.y,x("panzoomreset",ee)}let Q,ye,De,yt,Ee,ai,et=[];function qr(q){if(Km(q.target,o))return;Wc(et,q),p=!0,o.handleStartEvent(q),Q=s,ye=d,f("panzoomstart",{x:s,y:d,scale:h,isSVG:e,originalEvent:q},o);let ee=lp(et);De=ee.clientX,yt=ee.clientY,Ee=h,ai=Kc(et)}function io(q){if(!p||Q===void 0||ye===void 0||De===void 0||yt===void 0)return;Wc(et,q);let ee=lp(et),fe=et.length>1,Ne=h;if(fe){ai===0&&(ai=Kc(et));let Z=Kc(et)-ai;Ne=C(Z*o.step/80+Ee).scale,I(Ne,ee,{animate:!1},q)}(!fe||o.pinchAndPan)&&S(Q+(ee.clientX-De)/Ne,ye+(ee.clientY-yt)/Ne,{animate:!1},q)}function si(q){et.length===1&&f("panzoomend",{x:s,y:d,scale:h,isSVG:e,originalEvent:q},o),Nm(et,q),p&&(p=!1,Q=ye=De=yt=void 0)}let Bn=!1;function Go(){Bn||(Bn=!0,Bc("down",o.canvas?t:i,qr),Bc("move",document,io,{passive:!0}),Bc("up",document,si,{passive:!0}))}function zi(){Bn=!1,qc("down",o.canvas?t:i,qr),qc("move",document,io),qc("up",document,si)}return o.noBind||Go(),{bind:Go,destroy:zi,eventNames:ls,getPan:()=>({x:s,y:d}),getScale:()=>h,getOptions:()=>Gm(o),handleDown:qr,handleMove:io,handleUp:si,pan:S,reset:$,resetStyle:r,setOptions:n,setStyle:(q,ee)=>da(i,q,ee),zoom:z,zoomIn:P,zoomOut:H,zoomToPoint:I,zoomWithWheel:B}}Gc.defaultOptions=dp;var Be=require("lit/decorators.js");var co=require("lit"),Ko=require("lit/decorators.js");var up={fromAttribute(i){return i==null?!0:i!=="false"&&i!=="0"},toAttribute(i){return i?"":"false"}};function fl(i){return i==null||i===""?"":Ot(i)}var jr=class extends co.LitElement{constructor(){super(...arguments);this.loading=!0;this.active=!0;this.variant="text";this.size="md";this.radius="md";this.rows=3;this.pauseWhenHidden=!0;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._setupIntersectionObserver()}disconnectedCallback(){super.disconnectedCallback(),this._intersectionObserver?.disconnect()}_setupIntersectionObserver(){this._intersectionObserver?.disconnect(),this.dataset.inView="true",!(!this.pauseWhenHidden||typeof IntersectionObserver>"u")&&(this._intersectionObserver=new IntersectionObserver(e=>{let t=e[0];this.dataset.inView=t?.isIntersecting?"true":"false"}),this._intersectionObserver.observe(this))}willUpdate(e){e.has("pauseWhenHidden")&&this._setupIntersectionObserver();let t=L(this,"skeleton");!this._explicitAttrs.has("active")&&typeof t.active=="boolean"&&this.active!==t.active&&(this.active=t.active),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("rows")&&typeof t.rows=="number"&&this.rows!==t.rows&&(this.rows=t.rows)}_hostStyle(){let e=[this.width!=null&&this.variant!=="text"?`--lui-skeleton-width:${fl(this.width)}`:"",this.height!=null?`--lui-skeleton-height:${fl(this.height)}`:""].filter(Boolean);return e.length?e.join(";"):co.nothing}_lineWidth(e,t){let r=this.widths?.[e];return r!=null?fl(r):this.width!=null&&t===1?fl(this.width):e===t-1&&t>1?"68%":e===0&&t>2?"92%":"100%"}_renderText(e=this.rows){let t=Math.max(1,Math.floor(e||1));return co.html`
7875
7877
  <div class="text" part="text">
7876
7878
  ${Array.from({length:t},(r,n)=>co.html`
7877
7879
  <div class="piece line" part="line" style=${`width:${this._lineWidth(n,t)}`}></div>
@@ -8023,7 +8025,7 @@
8023
8025
  transform: translateX(100%);
8024
8026
  }
8025
8027
  }
8026
- `],a([(0,qo.property)({attribute:"loading",converter:up})],jr.prototype,"loading",2),a([(0,qo.property)({reflect:!0,converter:up})],jr.prototype,"active",2),a([(0,qo.property)({reflect:!0})],jr.prototype,"variant",2),a([(0,qo.property)({reflect:!0})],jr.prototype,"size",2),a([(0,qo.property)({reflect:!0})],jr.prototype,"radius",2),a([(0,qo.property)({type:Number})],jr.prototype,"rows",2),a([(0,qo.property)()],jr.prototype,"width",2),a([(0,qo.property)()],jr.prototype,"height",2),a([(0,qo.property)({attribute:!1})],jr.prototype,"widths",2),a([(0,qo.property)({type:Boolean,attribute:"pause-when-hidden"})],jr.prototype,"pauseWhenHidden",2),jr=a([(0,qo.customElement)("lui-skeleton")],jr);var Ie=class extends wr.LitElement{constructor(){super(...arguments);this.src="";this.previewSrc="";this.alt="";this.fallbackSrc="";this.fallback="\u56FE\u7247\u52A0\u8F7D\u5931\u8D25";this.fit="cover";this.radius="md";this.aspectRatio="";this.position="center";this.loading="lazy";this.skeleton=!0;this.preview=!0;this.showPreviewIcon=!0;this.draggablePreview=!0;this._loaded=!1;this._errored=!1;this._previewOpen=!1;this._zoom=1;this._rotate=0;this._panning=!1;this._explicitAttrs=new Set;this._stageMoved=!1;this._onLoad=()=>{this._loaded=!0,this._errored=!1,this.dispatchEvent(new CustomEvent("load",{bubbles:!0,composed:!0}))};this._onError=()=>{if(this.fallbackSrc&&this.src!==this.fallbackSrc){this.src=this.fallbackSrc;return}this._errored=!0,this._loaded=!1,this.dispatchEvent(new CustomEvent("error",{bubbles:!0,composed:!0}))};this._onFrameClick=()=>this.showPreview();this._onPanzoomStart=()=>{this._panning=!0};this._onPanzoomChange=e=>{let t=e.detail;this._syncZoom(t?.scale,!0)};this._onPanzoomEnd=()=>{this._panning=!1,this._syncZoom(this._panzoom?.getScale(),!0)};this._onKeyDown=e=>{this._previewOpen&&(e.key==="Escape"&&this.closePreview(),(e.key==="+"||e.key==="=")&&!e.metaKey&&!e.ctrlKey&&this.zoomIn(),e.key==="-"&&!e.metaKey&&!e.ctrlKey&&this.zoomOut(),e.key==="0"&&!e.metaKey&&!e.ctrlKey&&this.resetPreview())};this._onStagePointerDown=e=>{e.target===e.currentTarget&&(this._stageMoved=!1,this._stagePointerStart={x:e.clientX,y:e.clientY})};this._onStagePointerMove=e=>{if(!this._stagePointerStart)return;let t=e.clientX-this._stagePointerStart.x,r=e.clientY-this._stagePointerStart.y;(Math.abs(t)>3||Math.abs(r)>3)&&(this._stageMoved=!0)};this._onStagePointerUp=()=>{this._stagePointerStart=void 0};this._onStageClick=e=>{if(e.stopPropagation(),this._stageMoved){this._stageMoved=!1;return}e.target===e.currentTarget&&this.closePreview()}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}disconnectedCallback(){this._destroyPanzoom(),this._removeGlobalListeners(),super.disconnectedCallback()}willUpdate(){let e=L(this,"image");!this._explicitAttrs.has("fit")&&typeof e.fit=="string"&&this.fit!==e.fit&&(this.fit=e.fit),!this._explicitAttrs.has("radius")&&typeof e.radius=="string"&&this.radius!==e.radius&&(this.radius=e.radius),!this._explicitAttrs.has("skeleton")&&typeof e.skeleton=="boolean"&&this.skeleton!==e.skeleton&&(this.skeleton=e.skeleton),!this._explicitAttrs.has("preview")&&typeof e.preview=="boolean"&&this.preview!==e.preview&&(this.preview=e.preview)}updated(e){e.has("src")&&(this._loaded=!1,this._errored=!1,this._resetPreviewTransform())}showPreview(){if(!this.preview||this._errored||!this._resolvedPreviewSrc||this._previewOpen)return;this._previewOpen=!0,this._resetPreviewTransform(),this._addGlobalListeners(),this._setupPanzoom();let e=this._detail();this.dispatchEvent(new CustomEvent("open",{detail:e,bubbles:!0,composed:!0}))}closePreview(){if(!this._previewOpen)return;let e=this._detail();this._previewOpen=!1,this._panning=!1,this._stagePointerStart=void 0,this._stageMoved=!1,this._destroyPanzoom(),this._removeGlobalListeners(),this.dispatchEvent(new CustomEvent("close",{detail:e,bubbles:!0,composed:!0}))}zoomIn(){let e=this._panzoom?.zoomIn({animate:!0});this._syncZoom(e?.scale)}zoomOut(){let e=this._panzoom?.zoomOut({animate:!0});this._syncZoom(e?.scale)}resetPreview(){this._panzoom?.reset({animate:!0}),this._rotate=0,this._syncZoom(this._panzoom?.getScale()??1,!0)}rotatePreview(){this._rotate=(this._rotate+90)%360,this._emitPreviewChange()}get _resolvedPreviewSrc(){return this.previewSrc||this.src}_detail(){return{src:this._resolvedPreviewSrc,zoom:this._zoom,rotate:this._rotate,source:"preview"}}_style(){let e=Ot(this.width),t=Ot(this.height),r=[e?`--lui-image-width:${e}`:"",t?`--lui-image-height:${t}`:"",this.aspectRatio?`--lui-image-aspect-ratio:${this.aspectRatio}`:"",this.fit?`--lui-image-fit:${this.fit}`:"",this.position?`--lui-image-position:${this.position}`:""].filter(Boolean);return r.length?r.join(";"):wr.nothing}_frameClass(){let e=["frame"];return this.aspectRatio&&e.push("has-aspect"),this.preview&&this._loaded&&!this._errored&&e.push("clickable"),e.join(" ")}_imageClass(){return["image",!!(this.height||this.aspectRatio)?"fixed":"natural",this._loaded&&!this._errored?"loaded":""].filter(Boolean).join(" ")}_resetPreviewTransform(){this._zoom=1,this._rotate=0}async _setupPanzoom(){await this.updateComplete;let e=this._previewImageEl,t=this._previewPanzoomEl,r=this._previewStageEl;if(!this._previewOpen||!e||!t||!r||!e.complete||e.naturalWidth===0)return;this._destroyPanzoom();let n=Gc(t,{maxScale:6,minScale:.2,step:.25,startScale:1,cursor:"grab",animate:!0,duration:160,easing:"cubic-bezier(.2,.8,.2,1)",disablePan:!this.draggablePreview,handleStartEvent:s=>{s.preventDefault(),this._panning=!0}});this._panzoom=n,this._wheelHandler=s=>{s.preventDefault(),n.zoomWithWheel(s)},r.addEventListener("wheel",this._wheelHandler,{passive:!1}),t.addEventListener("panzoomstart",this._onPanzoomStart),t.addEventListener("panzoomchange",this._onPanzoomChange),t.addEventListener("panzoomend",this._onPanzoomEnd),n.reset({animate:!1,force:!0}),this._syncZoom(1)}_destroyPanzoom(){let e=this._previewStageEl,t=this._previewPanzoomEl;this._wheelHandler&&e&&e.removeEventListener("wheel",this._wheelHandler),t&&(t.removeEventListener("panzoomstart",this._onPanzoomStart),t.removeEventListener("panzoomchange",this._onPanzoomChange),t.removeEventListener("panzoomend",this._onPanzoomEnd)),this._wheelHandler=void 0,this._panzoom?.destroy(),this._panzoom=void 0}_syncZoom(e,t=!1){let r=Math.max(.2,Math.min(6,Math.round((e??this._panzoom?.getScale()??1)*100)/100));r!==this._zoom&&(this._zoom=r,t=!0),t&&this._emitPreviewChange()}_emitPreviewChange(){let e=this._detail();this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))}_addGlobalListeners(){window.addEventListener("keydown",this._onKeyDown)}_removeGlobalListeners(){window.removeEventListener("keydown",this._onKeyDown)}_download(){let e=this._resolvedPreviewSrc;if(!e)return;let t=document.createElement("a");t.href=e,t.download=this.alt||e.split("/").pop()||"image",t.rel="noopener",t.click()}_renderPreview(){if(!this._previewOpen)return wr.nothing;let e=`--lui-preview-rotate:${this._rotate}deg;`;return wr.html`
8028
+ `],a([(0,Ko.property)({attribute:"loading",converter:up})],jr.prototype,"loading",2),a([(0,Ko.property)({reflect:!0,converter:up})],jr.prototype,"active",2),a([(0,Ko.property)({reflect:!0})],jr.prototype,"variant",2),a([(0,Ko.property)({reflect:!0})],jr.prototype,"size",2),a([(0,Ko.property)({reflect:!0})],jr.prototype,"radius",2),a([(0,Ko.property)({type:Number})],jr.prototype,"rows",2),a([(0,Ko.property)()],jr.prototype,"width",2),a([(0,Ko.property)()],jr.prototype,"height",2),a([(0,Ko.property)({attribute:!1})],jr.prototype,"widths",2),a([(0,Ko.property)({type:Boolean,attribute:"pause-when-hidden"})],jr.prototype,"pauseWhenHidden",2),jr=a([(0,Ko.customElement)("lui-skeleton")],jr);var Ie=class extends wr.LitElement{constructor(){super(...arguments);this.src="";this.previewSrc="";this.alt="";this.fallbackSrc="";this.fallback="\u56FE\u7247\u52A0\u8F7D\u5931\u8D25";this.fit="cover";this.radius="md";this.aspectRatio="";this.position="center";this.loading="lazy";this.skeleton=!0;this.preview=!0;this.showPreviewIcon=!0;this.draggablePreview=!0;this._loaded=!1;this._errored=!1;this._previewOpen=!1;this._zoom=1;this._rotate=0;this._panning=!1;this._explicitAttrs=new Set;this._stageMoved=!1;this._onLoad=()=>{this._loaded=!0,this._errored=!1,this.dispatchEvent(new CustomEvent("load",{bubbles:!0,composed:!0}))};this._onError=()=>{if(this.fallbackSrc&&this.src!==this.fallbackSrc){this.src=this.fallbackSrc;return}this._errored=!0,this._loaded=!1,this.dispatchEvent(new CustomEvent("error",{bubbles:!0,composed:!0}))};this._onFrameClick=()=>this.showPreview();this._onPanzoomStart=()=>{this._panning=!0};this._onPanzoomChange=e=>{let t=e.detail;this._syncZoom(t?.scale,!0)};this._onPanzoomEnd=()=>{this._panning=!1,this._syncZoom(this._panzoom?.getScale(),!0)};this._onKeyDown=e=>{this._previewOpen&&(e.key==="Escape"&&this.closePreview(),(e.key==="+"||e.key==="=")&&!e.metaKey&&!e.ctrlKey&&this.zoomIn(),e.key==="-"&&!e.metaKey&&!e.ctrlKey&&this.zoomOut(),e.key==="0"&&!e.metaKey&&!e.ctrlKey&&this.resetPreview())};this._onStagePointerDown=e=>{e.target===e.currentTarget&&(this._stageMoved=!1,this._stagePointerStart={x:e.clientX,y:e.clientY})};this._onStagePointerMove=e=>{if(!this._stagePointerStart)return;let t=e.clientX-this._stagePointerStart.x,r=e.clientY-this._stagePointerStart.y;(Math.abs(t)>3||Math.abs(r)>3)&&(this._stageMoved=!0)};this._onStagePointerUp=()=>{this._stagePointerStart=void 0};this._onStageClick=e=>{if(e.stopPropagation(),this._stageMoved){this._stageMoved=!1;return}e.target===e.currentTarget&&this.closePreview()}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}disconnectedCallback(){this._destroyPanzoom(),this._removeGlobalListeners(),super.disconnectedCallback()}willUpdate(){let e=L(this,"image");!this._explicitAttrs.has("fit")&&typeof e.fit=="string"&&this.fit!==e.fit&&(this.fit=e.fit),!this._explicitAttrs.has("radius")&&typeof e.radius=="string"&&this.radius!==e.radius&&(this.radius=e.radius),!this._explicitAttrs.has("skeleton")&&typeof e.skeleton=="boolean"&&this.skeleton!==e.skeleton&&(this.skeleton=e.skeleton),!this._explicitAttrs.has("preview")&&typeof e.preview=="boolean"&&this.preview!==e.preview&&(this.preview=e.preview)}updated(e){e.has("src")&&(this._loaded=!1,this._errored=!1,this._resetPreviewTransform())}showPreview(){if(!this.preview||this._errored||!this._resolvedPreviewSrc||this._previewOpen)return;this._previewOpen=!0,this._resetPreviewTransform(),this._addGlobalListeners(),this._setupPanzoom();let e=this._detail();this.dispatchEvent(new CustomEvent("open",{detail:e,bubbles:!0,composed:!0}))}closePreview(){if(!this._previewOpen)return;let e=this._detail();this._previewOpen=!1,this._panning=!1,this._stagePointerStart=void 0,this._stageMoved=!1,this._destroyPanzoom(),this._removeGlobalListeners(),this.dispatchEvent(new CustomEvent("close",{detail:e,bubbles:!0,composed:!0}))}zoomIn(){let e=this._panzoom?.zoomIn({animate:!0});this._syncZoom(e?.scale)}zoomOut(){let e=this._panzoom?.zoomOut({animate:!0});this._syncZoom(e?.scale)}resetPreview(){this._panzoom?.reset({animate:!0}),this._rotate=0,this._syncZoom(this._panzoom?.getScale()??1,!0)}rotatePreview(){this._rotate=(this._rotate+90)%360,this._emitPreviewChange()}get _resolvedPreviewSrc(){return this.previewSrc||this.src}_detail(){return{src:this._resolvedPreviewSrc,zoom:this._zoom,rotate:this._rotate,source:"preview"}}_style(){let e=Ot(this.width),t=Ot(this.height),r=[e?`--lui-image-width:${e}`:"",t?`--lui-image-height:${t}`:"",this.aspectRatio?`--lui-image-aspect-ratio:${this.aspectRatio}`:"",this.fit?`--lui-image-fit:${this.fit}`:"",this.position?`--lui-image-position:${this.position}`:""].filter(Boolean);return r.length?r.join(";"):wr.nothing}_frameClass(){let e=["frame"];return this.aspectRatio&&e.push("has-aspect"),this.preview&&this._loaded&&!this._errored&&e.push("clickable"),e.join(" ")}_imageClass(){return["image",!!(this.height||this.aspectRatio)?"fixed":"natural",this._loaded&&!this._errored?"loaded":""].filter(Boolean).join(" ")}_resetPreviewTransform(){this._zoom=1,this._rotate=0}async _setupPanzoom(){await this.updateComplete;let e=this._previewImageEl,t=this._previewPanzoomEl,r=this._previewStageEl;if(!this._previewOpen||!e||!t||!r||!e.complete||e.naturalWidth===0)return;this._destroyPanzoom();let n=Gc(t,{maxScale:6,minScale:.2,step:.25,startScale:1,cursor:"grab",animate:!0,duration:160,easing:"cubic-bezier(.2,.8,.2,1)",disablePan:!this.draggablePreview,handleStartEvent:s=>{s.preventDefault(),this._panning=!0}});this._panzoom=n,this._wheelHandler=s=>{s.preventDefault(),n.zoomWithWheel(s)},r.addEventListener("wheel",this._wheelHandler,{passive:!1}),t.addEventListener("panzoomstart",this._onPanzoomStart),t.addEventListener("panzoomchange",this._onPanzoomChange),t.addEventListener("panzoomend",this._onPanzoomEnd),n.reset({animate:!1,force:!0}),this._syncZoom(1)}_destroyPanzoom(){let e=this._previewStageEl,t=this._previewPanzoomEl;this._wheelHandler&&e&&e.removeEventListener("wheel",this._wheelHandler),t&&(t.removeEventListener("panzoomstart",this._onPanzoomStart),t.removeEventListener("panzoomchange",this._onPanzoomChange),t.removeEventListener("panzoomend",this._onPanzoomEnd)),this._wheelHandler=void 0,this._panzoom?.destroy(),this._panzoom=void 0}_syncZoom(e,t=!1){let r=Math.max(.2,Math.min(6,Math.round((e??this._panzoom?.getScale()??1)*100)/100));r!==this._zoom&&(this._zoom=r,t=!0),t&&this._emitPreviewChange()}_emitPreviewChange(){let e=this._detail();this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))}_addGlobalListeners(){window.addEventListener("keydown",this._onKeyDown)}_removeGlobalListeners(){window.removeEventListener("keydown",this._onKeyDown)}_download(){let e=this._resolvedPreviewSrc;if(!e)return;let t=document.createElement("a");t.href=e,t.download=this.alt||e.split("/").pop()||"image",t.rel="noopener",t.click()}_renderPreview(){if(!this._previewOpen)return wr.nothing;let e=`--lui-preview-rotate:${this._rotate}deg;`;return wr.html`
8027
8029
  <div class="preview-layer" part="preview">
8028
8030
  <div class="preview-toolbar" part="preview-toolbar" @click=${t=>t.stopPropagation()}>
8029
8031
  <div class="preview-title" title=${this.alt||this._resolvedPreviewSrc}>${this.alt||this._resolvedPreviewSrc}</div>
@@ -8325,7 +8327,7 @@
8325
8327
  border-radius: var(--lui-radius-lg);
8326
8328
  }
8327
8329
  }
8328
- `],a([(0,Be.property)()],Ie.prototype,"src",2),a([(0,Be.property)({attribute:"preview-src"})],Ie.prototype,"previewSrc",2),a([(0,Be.property)()],Ie.prototype,"alt",2),a([(0,Be.property)({attribute:"fallback-src"})],Ie.prototype,"fallbackSrc",2),a([(0,Be.property)()],Ie.prototype,"fallback",2),a([(0,Be.property)({reflect:!0})],Ie.prototype,"fit",2),a([(0,Be.property)({reflect:!0})],Ie.prototype,"radius",2),a([(0,Be.property)()],Ie.prototype,"width",2),a([(0,Be.property)()],Ie.prototype,"height",2),a([(0,Be.property)({attribute:"aspect-ratio"})],Ie.prototype,"aspectRatio",2),a([(0,Be.property)()],Ie.prototype,"position",2),a([(0,Be.property)({reflect:!0})],Ie.prototype,"loading",2),a([(0,Be.property)({type:Boolean,reflect:!0})],Ie.prototype,"skeleton",2),a([(0,Be.property)({type:Boolean,reflect:!0})],Ie.prototype,"preview",2),a([(0,Be.property)({type:Boolean,attribute:"show-preview-icon"})],Ie.prototype,"showPreviewIcon",2),a([(0,Be.property)({type:Boolean})],Ie.prototype,"draggablePreview",2),a([(0,Be.state)()],Ie.prototype,"_loaded",2),a([(0,Be.state)()],Ie.prototype,"_errored",2),a([(0,Be.state)()],Ie.prototype,"_previewOpen",2),a([(0,Be.state)()],Ie.prototype,"_zoom",2),a([(0,Be.state)()],Ie.prototype,"_rotate",2),a([(0,Be.state)()],Ie.prototype,"_panning",2),a([(0,Be.query)(".preview-image")],Ie.prototype,"_previewImageEl",2),a([(0,Be.query)(".preview-panzoom")],Ie.prototype,"_previewPanzoomEl",2),a([(0,Be.query)(".preview-stage")],Ie.prototype,"_previewStageEl",2),Ie=a([(0,Be.customElement)("lui-image")],Ie);var Or=require("lit"),Vt=require("lit/decorators.js");var cs=typeof window<"u"&&typeof window.document<"u",$o=cs?window:{},Yc=cs?"ontouchstart"in $o.document.documentElement:!1,Xc=cs?"PointerEvent"in $o:!1,pn="cropper",ei=`${pn}-canvas`,mp=`${pn}-crosshair`,gp=`${pn}-grid`,fp=`${pn}-handle`,bi=`${pn}-image`,uo=`${pn}-selection`,vp=`${pn}-shade`,bp=`${pn}-viewer`,ua="select",vl="move",Wi="scale",ds="rotate",ha="transform",yi="none",Zc="n-resize",Qc="e-resize",Jc="s-resize",ed="w-resize",pa="ne-resize",ma="nw-resize",ga="se-resize",fa="sw-resize",yp="action",Ym=Yc?"touchend touchcancel":"mouseup",Xm=Yc?"touchmove":"mousemove",Zm=Yc?"touchstart":"mousedown",td=Xc?"pointerdown":Zm,rd=Xc?"pointermove":Xm,od=Xc?"pointerup pointercancel":Ym,id="error",nd="keydown",mn="load",ad="resize",sd="wheel",Ui="action",ki="actionend",kp="actionmove",xi="actionstart",wi="change",us="transform";function va(i){return typeof i=="string"}var ld=Number.isNaN||$o.isNaN;function be(i){return typeof i=="number"&&!ld(i)}function Qr(i){return be(i)&&i>0&&i<1/0}function xp(i){return typeof i>"u"}function cd(i){return typeof i=="object"&&i!==null}var{hasOwnProperty:Qm}=Object.prototype;function ba(i){if(!cd(i))return!1;try{let{constructor:o}=i,{prototype:e}=o;return o&&e&&Qm.call(e,"isPrototypeOf")}catch{return!1}}function ya(i){return typeof i=="function"}function Gi(i){return typeof i=="object"&&i!==null&&i.nodeType===1}var Jm=/([a-z\d])([A-Z])/g;function dd(i){return String(i).replace(Jm,"$1-$2").toLowerCase()}var eg=/-[A-z\d]/g;function ud(i){return i.replace(eg,o=>o.slice(1).toUpperCase())}var wp=/\s\s*/;function lt(i,o,e,t){o.trim().split(wp).forEach(r=>{i.removeEventListener(r,e,t)})}function gt(i,o,e,t){o.trim().split(wp).forEach(r=>{i.addEventListener(r,e,t)})}function hd(i,o,e,t){gt(i,o,e,Object.assign(Object.assign({},t),{once:!0}))}var tg={bubbles:!0,cancelable:!0,composed:!0};function _p(i,o,e,t){return i.dispatchEvent(new CustomEvent(o,Object.assign(Object.assign(Object.assign({},tg),{detail:e}),t)))}function Mp(i){return typeof i.composedPath=="function"&&i.composedPath().find(Gi)||i.target}var hp=Promise.resolve();function Cp(i,o){return o?hp.then(i?o.bind(i):o):hp}function bl(i){let o=i.getRootNode();switch(o.nodeType){case 1:return o.ownerDocument;case 9:return o;case 11:return o}return null}function pd(i){let{documentElement:o}=i.ownerDocument,e=i.getBoundingClientRect();return{left:e.left+($o.pageXOffset-o.clientLeft),top:e.top+($o.pageYOffset-o.clientTop)}}var rg=/deg|g?rad|turn$/i;function yl(i){let o=parseFloat(i)||0;if(o!==0){let[e="rad"]=String(i).match(rg)||[];switch(e.toLowerCase()){case"deg":return o/360*(Math.PI*2);case"grad":return o/400*(Math.PI*2);case"turn":return o*(Math.PI*2)}}return o}var pp="contain",og="cover";function ka(i,o=pp){let{aspectRatio:e}=i,{width:t,height:r}=i,n=Qr(t),s=Qr(r);if(n&&s){let d=r*e;o===pp&&d>t||o===og&&d<t?r=t/e:t=r*e}else n?r=t/e:s&&(t=r*e);return{width:t,height:r}}function md(i,...o){if(o.length===0)return i;let[e,t,r,n,s,d]=i,[h,p,f,x,k,C]=o[0];return i=[e*h+r*p,t*h+n*p,e*f+r*x,t*f+n*x,e*k+r*C+s,t*k+n*C+d],md(i,...o.slice(1))}var ig=":host([hidden]){display:none!important}",ng=/left|top|width|height/i,zp="open",kl=new WeakMap,xl=new WeakMap,Ep=new Map,Sp=$o.document&&Array.isArray($o.document.adoptedStyleSheets)&&"replaceSync"in $o.CSSStyleSheet.prototype,nr=class extends HTMLElement{get $sharedStyle(){return`${this.themeColor?`:host{--theme-color: ${this.themeColor};}`:""}${ig}`}constructor(){var o,e;super(),this.shadowRootMode=zp,this.slottable=!0;let t=(e=(o=Object.getPrototypeOf(this))===null||o===void 0?void 0:o.constructor)===null||e===void 0?void 0:e.$name;t&&Ep.set(t,this.tagName.toLowerCase())}static get observedAttributes(){return["shadow-root-mode","slottable","theme-color"]}attributeChangedCallback(o,e,t){if(Object.is(t,e))return;let r=ud(o),n=this[r],s=t;switch(typeof n){case"boolean":s=t!==null&&t!=="false";break;case"number":s=Number(t);break}switch(this[r]=s,o){case"theme-color":{let d=xl.get(this),h=this.$sharedStyle;d&&h&&(Sp?d.replaceSync(h):d.textContent=h);break}}}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(o=dd(o),typeof t){case"boolean":t===!0?this.hasAttribute(o)||this.setAttribute(o,""):this.removeAttribute(o);break;case"number":ld(t)?t="":t=String(t);default:t?this.getAttribute(o)!==t&&this.setAttribute(o,t):this.removeAttribute(o)}}connectedCallback(){Object.getPrototypeOf(this).constructor.observedAttributes.forEach(e=>{let t=ud(e),r=this[t];xp(r)||this.$propertyChangedCallback(t,void 0,r),Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return r},set(n){let s=r;r=n,this.$propertyChangedCallback(t,s,n)}})});let o=this.shadowRoot||this.attachShadow({mode:this.shadowRootMode||zp});if(kl.set(this,o),xl.set(this,this.$addStyles(this.$sharedStyle)),this.$style&&this.$addStyles(this.$style),this.$template){let e=document.createElement("template");e.innerHTML=this.$template,o.appendChild(e.content)}if(this.slottable){let e=document.createElement("slot");o.appendChild(e)}}disconnectedCallback(){xl.has(this)&&xl.delete(this),kl.has(this)&&kl.delete(this)}$getTagNameOf(o){var e;return(e=Ep.get(o))!==null&&e!==void 0?e:o}$setStyles(o){return Object.keys(o).forEach(e=>{let t=o[e];be(t)&&(t!==0&&ng.test(e)?t=`${t}px`:t=String(t)),this.style[e]=t}),this}$getShadowRoot(){return this.shadowRoot||kl.get(this)}$addStyles(o){let e,t=this.$getShadowRoot();return Sp?(e=new CSSStyleSheet,e.replaceSync(o),t.adoptedStyleSheets=t.adoptedStyleSheets.concat(e)):(e=document.createElement("style"),e.textContent=o,t.appendChild(e)),e}$emit(o,e,t){return _p(this,o,e,t)}$nextTick(o){return Cp(this,o)}static $define(o,e){cd(o)&&(e=o,o=""),o||(o=this.$name||this.name),o=dd(o),cs&&$o.customElements&&!$o.customElements.get(o)&&customElements.define(o,this,e)}};nr.$version="2.1.1";var ag=':host{display:block;min-height:100px;min-width:200px;overflow:hidden;position:relative;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([background]){background-color:#fff;background-image:repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);background-image:repeating-conic-gradient(#ccc 0 25%,#fff 0 50%);background-position:0 0,.5rem .5rem;background-size:1rem 1rem}:host([disabled]){pointer-events:none}:host([disabled]):after{bottom:0;content:"";cursor:not-allowed;display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}',An=class extends nr{constructor(){super(...arguments),this.$onPointerDown=null,this.$onPointerMove=null,this.$onPointerUp=null,this.$onWheel=null,this.$wheeling=!1,this.$pointers=new Map,this.$style=ag,this.$action=yi,this.background=!1,this.disabled=!1,this.scaleStep=.1,this.themeColor="#39f"}static get observedAttributes(){return super.observedAttributes.concat(["background","disabled","scale-step"])}connectedCallback(){super.connectedCallback(),this.disabled||this.$bind()}disconnectedCallback(){this.disabled||this.$unbind(),super.disconnectedCallback()}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"disabled":t?this.$unbind():this.$bind();break}}$bind(){this.$onPointerDown||(this.$onPointerDown=this.$handlePointerDown.bind(this),gt(this,td,this.$onPointerDown)),this.$onPointerMove||(this.$onPointerMove=this.$handlePointerMove.bind(this),gt(this.ownerDocument,rd,this.$onPointerMove)),this.$onPointerUp||(this.$onPointerUp=this.$handlePointerUp.bind(this),gt(this.ownerDocument,od,this.$onPointerUp)),this.$onWheel||(this.$onWheel=this.$handleWheel.bind(this),gt(this,sd,this.$onWheel,{passive:!1,capture:!0}))}$unbind(){this.$onPointerDown&&(lt(this,td,this.$onPointerDown),this.$onPointerDown=null),this.$onPointerMove&&(lt(this.ownerDocument,rd,this.$onPointerMove),this.$onPointerMove=null),this.$onPointerUp&&(lt(this.ownerDocument,od,this.$onPointerUp),this.$onPointerUp=null),this.$onWheel&&(lt(this,sd,this.$onWheel,{capture:!0}),this.$onWheel=null)}$handlePointerDown(o){let{buttons:e,button:t,type:r}=o;if(this.disabled||(r==="pointerdown"&&o.pointerType==="mouse"||r==="mousedown")&&(be(e)&&e!==1||be(t)&&t!==0||o.ctrlKey))return;let{$pointers:n}=this,s="";if(o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:d,pageX:h,pageY:p})=>{n.set(d,{startX:h,startY:p,endX:h,endY:p})});else{let{pointerId:d=0,pageX:h,pageY:p}=o;n.set(d,{startX:h,startY:p,endX:h,endY:p})}n.size>1?s=ha:Gi(o.target)&&(s=o.target.action||o.target.getAttribute(yp)||""),this.$emit(xi,{action:s,relatedEvent:o})!==!1&&(o.preventDefault(),this.$action=s,this.style.willChange="transform")}$handlePointerMove(o){let{$action:e,$pointers:t}=this;if(this.disabled||e===yi||t.size===0||this.$emit(kp,{action:e,relatedEvent:o})===!1)return;if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:n,pageX:s,pageY:d})=>{let h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})});else{let{pointerId:n=0,pageX:s,pageY:d}=o,h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})}let r={action:e,relatedEvent:o};if(e===ha){let n=new Map(t),s=0,d=0,h=0,p=0,f=o.pageX,x=o.pageY;t.forEach((S,z)=>{n.delete(z),n.forEach(T=>{let P=T.startX-S.startX,H=T.startY-S.startY,I=T.endX-S.endX,B=T.endY-S.endY,$=0,Q=0,ye=0,De=0;if(P===0?H<0?ye=Math.PI*2:H>0&&(ye=Math.PI):P>0?ye=Math.PI/2+Math.atan(H/P):P<0&&(ye=Math.PI*1.5+Math.atan(H/P)),I===0?B<0?De=Math.PI*2:B>0&&(De=Math.PI):I>0?De=Math.PI/2+Math.atan(B/I):I<0&&(De=Math.PI*1.5+Math.atan(B/I)),De>0||ye>0){let yt=De-ye,Ee=Math.abs(yt);Ee>s&&(s=Ee,h=yt,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}if(P=Math.abs(P),H=Math.abs(H),I=Math.abs(I),B=Math.abs(B),P>0&&H>0?$=Math.sqrt(P*P+H*H):P>0?$=P:H>0&&($=H),I>0&&B>0?Q=Math.sqrt(I*I+B*B):I>0?Q=I:B>0&&(Q=B),$>0&&Q>0){let yt=(Q-$)/$,Ee=Math.abs(yt);Ee>d&&(d=Ee,p=yt,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}})});let k=s>0,C=d>0;k&&C?(r.rotate=h,r.scale=p,r.centerX=f,r.centerY=x):k?(r.action=ds,r.rotate=h,r.centerX=f,r.centerY=x):C?(r.action=Wi,r.scale=p,r.centerX=f,r.centerY=x):r.action=yi}else{let[n]=Array.from(t.values());Object.assign(r,n)}t.forEach(n=>{n.startX=n.endX,n.startY=n.endY}),r.action!==yi&&this.$emit(Ui,r,{cancelable:!1})}$handlePointerUp(o){let{$action:e,$pointers:t}=this;if(!(this.disabled||e===yi)&&this.$emit(ki,{action:e,relatedEvent:o})!==!1){if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:r})=>{t.delete(r)});else{let{pointerId:r=0}=o;t.delete(r)}t.size===0&&(this.style.willChange="",this.$action=yi)}}$handleWheel(o){if(this.disabled||(o.preventDefault(),this.$wheeling))return;this.$wheeling=!0,setTimeout(()=>{this.$wheeling=!1},50);let t=(o.deltaY>0?-1:1)*this.scaleStep;this.$emit(Ui,{action:Wi,scale:t,relatedEvent:o},{cancelable:!1})}$setAction(o){return va(o)&&(this.$action=o),this}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),n=this.offsetWidth,s=this.offsetHeight,d=1;ba(o)&&(Qr(o.width)||Qr(o.height))&&({width:n,height:s}=ka({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.offsetWidth),r.width=n,r.height=s;let h=this.querySelector(this.$getTagNameOf(bi));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=z,H=T,I=p.naturalWidth,B=p.naturalHeight;d!==1&&(P*=d,H*=d,I*=d,B*=d);let $=I/2,Q=B/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),ba(o)&&ya(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate($,Q),f.transform(x,k,C,S,P,H),f.translate(-$,-Q),f.drawImage(p,0,0,I,B),f.restore()}e(r)}).catch(t)})}};An.$name=ei;An.$version="2.1.1";var sg=":host{display:inline-block}img{display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}",$p=new WeakMap,Tp=["alt","crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","src","srcset"],Pn=class extends nr{constructor(){super(...arguments),this.$isReady=!1,this.$matrix=[1,0,0,1,0,0],this.$onLoad=null,this.$onCanvasAction=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$actionStartTarget=null,this.$style=sg,this.$image=new Image,this.initialCenterSize="contain",this.rotatable=!1,this.scalable=!1,this.skewable=!1,this.slottable=!1,this.translatable=!1,this.alt="",this.crossorigin="",this.decoding="",this.elementtiming="",this.fetchpriority="",this.loading="",this.referrerpolicy="",this.sizes="",this.src="",this.srcset=""}set $canvas(o){$p.set(this,o)}get $canvas(){return $p.get(this)}static get observedAttributes(){return super.observedAttributes.concat(Tp,["initial-center-size","rotatable","scalable","skewable","translatable"])}attributeChangedCallback(o,e,t){Object.is(t,e)||(super.attributeChangedCallback(o,e,t),Tp.includes(o)&&this.$image.setAttribute(o,t))}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"initialCenterSize":this.$nextTick(()=>{this.$center(t)});break;case"src":this.$isReady=!1;break}}connectedCallback(){super.connectedCallback();let{$image:o}=this,e=this.closest(this.$getTagNameOf(ei));e&&(this.$canvas=e,this.$setStyles({display:"block",position:"absolute"}),this.$onCanvasActionStart=t=>{var r,n;this.$actionStartTarget=(n=(r=t.detail)===null||r===void 0?void 0:r.relatedEvent)===null||n===void 0?void 0:n.target},this.$onCanvasActionEnd=()=>{this.$actionStartTarget=null},this.$onCanvasAction=this.$handleAction.bind(this),gt(e,xi,this.$onCanvasActionStart),gt(e,ki,this.$onCanvasActionEnd),gt(e,Ui,this.$onCanvasAction)),this.$onLoad=this.$handleLoad.bind(this),gt(o,mn,this.$onLoad),this.$getShadowRoot().appendChild(o)}disconnectedCallback(){let{$image:o,$canvas:e}=this;e&&(this.$onCanvasActionStart&&(lt(e,xi,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(lt(e,ki,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(lt(e,Ui,this.$onCanvasAction),this.$onCanvasAction=null)),o&&this.$onLoad&&(lt(o,mn,this.$onLoad),this.$onLoad=null),this.$getShadowRoot().removeChild(o),super.disconnectedCallback()}$handleLoad(){let{$image:o}=this;this.$setStyles({width:o.naturalWidth,height:o.naturalHeight}),this.$canvas&&this.$center(this.initialCenterSize),this.$isReady=!0}$handleAction(o){if(this.hidden||!(this.rotatable||this.scalable||this.translatable))return;let{$canvas:e}=this,{detail:t}=o;if(t){let{relatedEvent:r}=t,{action:n}=t;switch(n===ha&&(!this.rotatable||!this.scalable)&&(this.rotatable?n=ds:this.scalable?n=Wi:n=yi),n){case vl:if(this.translatable){let s=null;r&&(s=r.target.closest(this.$getTagNameOf(uo))),s||(s=e.querySelector(this.$getTagNameOf(uo))),s&&s.multiple&&!s.active&&(s=e.querySelector(`${this.$getTagNameOf(uo)}[active]`)),(!s||s.hidden||!s.movable||s.dynamic||!(this.$actionStartTarget&&s.contains(this.$actionStartTarget)))&&this.$move(t.endX-t.startX,t.endY-t.startY)}break;case ds:if(this.rotatable)if(r){let{x:s,y:d}=this.getBoundingClientRect();this.$rotate(t.rotate,r.clientX-s,r.clientY-d)}else this.$rotate(t.rotate);break;case Wi:if(this.scalable)if(r){let s=r.target.closest(this.$getTagNameOf(uo));if(!s||!s.zoomable||s.zoomable&&s.dynamic){let{x:d,y:h}=this.getBoundingClientRect();this.$zoom(t.scale,r.clientX-d,r.clientY-h)}}else this.$zoom(t.scale);break;case ha:if(this.rotatable&&this.scalable){let{rotate:s}=t,{scale:d}=t;d<0?d=1/(1-d):d+=1;let h=Math.cos(s),p=Math.sin(s),[f,x,k,C]=[h*d,p*d,-p*d,h*d];if(r){let S=this.getBoundingClientRect(),z=r.clientX-S.x,T=r.clientY-S.y,[P,H,I,B]=this.$matrix,$=S.width/2,Q=S.height/2,ye=z-$,De=T-Q,yt=(ye*B-I*De)/(P*B-I*H),Ee=(De*P-H*ye)/(P*B-I*H);this.$transform(f,x,k,C,yt*(1-f)+Ee*k,Ee*(1-C)+yt*x)}else this.$transform(f,x,k,C,0,0)}break}}}$ready(o){let{$image:e}=this,t=new Promise((r,n)=>{let s=new Error("Failed to load the image source");if(e.complete)e.naturalWidth>0&&e.naturalHeight>0?r(e):n(s);else{let d=()=>{lt(e,id,h),setTimeout(()=>{r(e)})},h=()=>{lt(e,mn,d),n(s)};hd(e,mn,d),hd(e,id,h)}});return ya(o)&&t.then(r=>(o(r),r)),t}$center(o){let{parentElement:e}=this;if(!e)return this;let t=e.getBoundingClientRect(),r=t.width,n=t.height,{x:s,y:d,width:h,height:p}=this.getBoundingClientRect(),f=s+h/2,x=d+p/2,k=t.x+r/2,C=t.y+n/2,{translatable:S}=this;if(!S&&!this.$isReady&&(this.translatable=!0,this.$nextTick(()=>{this.translatable=S})),this.$move(k-f,C-x),o&&(h!==r||p!==n)){let z=r/h,T=n/p,{scalable:P}=this;switch(o&&!P&&!this.$isReady&&(this.scalable=!0,this.$nextTick(()=>{this.scalable=P})),o){case"cover":this.$scale(Math.max(z,T));break;case"contain":this.$scale(Math.min(z,T));break}}return this}$move(o,e=o){if(this.translatable&&be(o)&&be(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$translate(d,h)}return this}$moveTo(o,e=o){if(this.translatable&&be(o)&&be(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$setTransform(t,r,n,s,d,h)}return this}$rotate(o,e,t){if(this.rotatable){let r=yl(o),n=Math.cos(r),s=Math.sin(r),[d,h,p,f]=[n,s,-s,n];if(be(e)&&be(t)){let[x,k,C,S]=this.$matrix,{width:z,height:T}=this.getBoundingClientRect(),P=z/2,H=T/2,I=e-P,B=t-H,$=(I*S-C*B)/(x*S-C*k),Q=(B*x-k*I)/(x*S-C*k);this.$transform(d,h,p,f,$*(1-d)-Q*p,Q*(1-f)-$*h)}else this.$transform(d,h,p,f,0,0)}return this}$zoom(o,e,t){if(!this.scalable||o===0)return this;if(o<0?o=1/(1-o):o+=1,be(e)&&be(t)){let[r,n,s,d]=this.$matrix,{width:h,height:p}=this.getBoundingClientRect(),f=h/2,x=p/2,k=e-f,C=t-x,S=(k*d-s*C)/(r*d-s*n),z=(C*r-n*k)/(r*d-s*n);this.$transform(o,0,0,o,S*(1-o),z*(1-o))}else this.$scale(o);return this}$scale(o,e=o){return this.scalable&&this.$transform(o,0,0,e,0,0),this}$skew(o,e=0){if(this.skewable){let t=yl(o),r=yl(e);this.$transform(1,Math.tan(r),Math.tan(t),1,0,0)}return this}$translate(o,e=o){return this.translatable&&be(o)&&be(e)&&this.$transform(1,0,0,1,o,e),this}$transform(o,e,t,r,n,s){return be(o)&&be(e)&&be(t)&&be(r)&&be(n)&&be(s)?this.$setTransform(md(this.$matrix,[o,e,t,r,n,s])):this}$setTransform(o,e,t,r,n,s){if((this.rotatable||this.scalable||this.skewable||this.translatable)&&(Array.isArray(o)&&([o,e,t,r,n,s]=o),be(o)&&be(e)&&be(t)&&be(r)&&be(n)&&be(s))){let d=[...this.$matrix],h=[o,e,t,r,n,s];if(this.$emit(us,{matrix:h,oldMatrix:d})===!1)return this;this.$matrix=h,this.style.transform=`matrix(${h.join(", ")})`}return this}$getTransform(){return this.$matrix.slice()}$resetTransform(){return this.$setTransform([1,0,0,1,0,0])}};Pn.$name=bi;Pn.$version="2.1.1";var lg=":host{display:block;height:0;left:0;outline:var(--theme-color) solid 1px;position:relative;top:0;width:0}:host([transparent]){outline-color:transparent}",Ap=new WeakMap,jn=class extends nr{constructor(){super(...arguments),this.$onWindowResize=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$onSelectionChange=null,this.$style=lg,this.x=0,this.y=0,this.width=0,this.height=0,this.slottable=!1,this.themeColor="rgba(0, 0, 0, 0.65)"}set $canvas(o){Ap.set(this,o)}get $canvas(){return Ap.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["height","width","x","y"])}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(ei));if(o){this.$canvas=o,this.style.position="absolute";let e=o.querySelector(this.$getTagNameOf(uo));e&&(this.$onWindowResize=this.$render.bind(this),this.$onCanvasActionStart=t=>{e.hidden&&t.detail.action===ua&&(this.hidden=!1)},this.$onCanvasActionEnd=t=>{e.hidden&&t.detail.action===ua&&(this.hidden=!0)},this.$onSelectionChange=t=>{let{x:r,y:n,width:s,height:d}=t.defaultPrevented?e:t.detail;this.$change(r,n,s,d),(e.hidden||r===0&&n===0&&s===0&&d===0)&&(this.hidden=!0)},gt(window,ad,this.$onWindowResize),gt(o,xi,this.$onCanvasActionStart),gt(o,ki,this.$onCanvasActionEnd),gt(o,wi,this.$onSelectionChange))}this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onWindowResize&&(lt(window,ad,this.$onWindowResize),this.$onWindowResize=null),this.$onCanvasActionStart&&(lt(o,xi,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(lt(o,ki,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onSelectionChange&&(lt(o,wi,this.$onSelectionChange),this.$onSelectionChange=null)),super.disconnectedCallback()}$change(o,e,t=this.width,r=this.height){return!be(o)||!be(e)||!be(t)||!be(r)||o===this.x&&e===this.y&&t===this.width&&r===this.height?this:(this.hidden&&(this.hidden=!1),this.x=o,this.y=e,this.width=t,this.height=r,this.$render())}$reset(){return this.$change(0,0,0,0)}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height,outlineWidth:$o.innerWidth*$o.devicePixelRatio})}};jn.$name=vp;jn.$version="2.1.1";var cg=':host{background-color:var(--theme-color);display:block}:host([action=move]),:host([action=select]){height:100%;left:0;position:absolute;top:0;width:100%}:host([action=move]){cursor:move}:host([action=select]){cursor:crosshair}:host([action$=-resize]){background-color:transparent;height:15px;position:absolute;width:15px}:host([action$=-resize]):after{background-color:var(--theme-color);content:"";display:block;height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:5px}:host([action=n-resize]),:host([action=s-resize]){cursor:ns-resize;left:50%;transform:translateX(-50%);width:100%}:host([action=n-resize]){top:-8px}:host([action=s-resize]){bottom:-8px}:host([action=e-resize]),:host([action=w-resize]){cursor:ew-resize;height:100%;top:50%;transform:translateY(-50%)}:host([action=e-resize]){right:-8px}:host([action=w-resize]){left:-8px}:host([action=ne-resize]){cursor:nesw-resize;right:-8px;top:-8px}:host([action=nw-resize]){cursor:nwse-resize;left:-8px;top:-8px}:host([action=se-resize]){bottom:-8px;cursor:nwse-resize;right:-8px}:host([action=se-resize]):after{height:15px;width:15px}@media (pointer:coarse){:host([action=se-resize]):after{height:10px;width:10px}}@media (pointer:fine){:host([action=se-resize]):after{height:5px;width:5px}}:host([action=sw-resize]){bottom:-8px;cursor:nesw-resize;left:-8px}:host([plain]){background-color:transparent}',On=class extends nr{constructor(){super(...arguments),this.$onCanvasCropEnd=null,this.$onCanvasCropStart=null,this.$style=cg,this.action=yi,this.plain=!1,this.slottable=!1,this.themeColor="rgba(51, 153, 255, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["action","plain"])}};On.$name=fp;On.$version="2.1.1";var dg=':host{display:block;left:0;position:relative;right:0}:host([outlined]){outline:1px solid var(--theme-color)}:host([multiple]){outline:1px dashed hsla(0,0%,100%,.5)}:host([multiple]):after{bottom:0;content:"";cursor:pointer;display:block;left:0;position:absolute;right:0;top:0}:host([multiple][active]){outline-color:var(--theme-color);z-index:1}:host([multiple])>*{visibility:hidden}:host([multiple][active])>*{visibility:visible}:host([multiple][active]):after{display:none}',Pp=new WeakMap,Hn=class extends nr{constructor(){super(...arguments),this.$onCanvasAction=null,this.$onCanvasActionStart=null,this.$onCanvasActionEnd=null,this.$onDocumentKeyDown=null,this.$action="",this.$actionStartTarget=null,this.$changing=!1,this.$style=dg,this.$initialSelection={x:0,y:0,width:0,height:0},this.x=0,this.y=0,this.width=0,this.height=0,this.aspectRatio=NaN,this.initialAspectRatio=NaN,this.initialCoverage=NaN,this.active=!1,this.linked=!1,this.dynamic=!1,this.movable=!1,this.resizable=!1,this.zoomable=!1,this.multiple=!1,this.keyboard=!1,this.outlined=!1,this.precise=!1}set $canvas(o){Pp.set(this,o)}get $canvas(){return Pp.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["active","aspect-ratio","dynamic","height","initial-aspect-ratio","initial-coverage","keyboard","linked","movable","multiple","outlined","precise","resizable","width","x","y","zoomable"])}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"x":case"y":case"width":case"height":this.$changing||this.$nextTick(()=>{this.$change(this.x,this.y,this.width,this.height,this.aspectRatio,!0)});break;case"aspectRatio":case"initialAspectRatio":this.$nextTick(()=>{this.$initSelection()});break;case"initialCoverage":this.$nextTick(()=>{Qr(t)&&t<=1&&this.$initSelection(!0,!0)});break;case"keyboard":this.$nextTick(()=>{this.$canvas&&(t?this.$onDocumentKeyDown||(this.$onDocumentKeyDown=this.$handleKeyDown.bind(this),gt(this.ownerDocument,nd,this.$onDocumentKeyDown)):this.$onDocumentKeyDown&&(lt(this.ownerDocument,nd,this.$onDocumentKeyDown),this.$onDocumentKeyDown=null))});break;case"multiple":this.$nextTick(()=>{if(this.$canvas){let r=this.$getSelections();t?(r.forEach(n=>{n.active=!1}),this.active=!0,this.$emit(wi,{x:this.x,y:this.y,width:this.width,height:this.height})):(this.active=!1,r.slice(1).forEach(n=>{this.$removeSelection(n)}))}});break;case"precise":this.$nextTick(()=>{this.$change(this.x,this.y)});break;case"linked":t&&(this.dynamic=!0);break}}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(ei));o?(this.$canvas=o,this.$setStyles({position:"absolute",transform:`translate(${this.x}px, ${this.y}px)`}),this.hidden||this.$render(),this.$initSelection(!0),this.$onCanvasActionStart=this.$handleActionStart.bind(this),this.$onCanvasActionEnd=this.$handleActionEnd.bind(this),this.$onCanvasAction=this.$handleAction.bind(this),gt(o,xi,this.$onCanvasActionStart),gt(o,ki,this.$onCanvasActionEnd),gt(o,Ui,this.$onCanvasAction)):this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onCanvasActionStart&&(lt(o,xi,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(lt(o,ki,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(lt(o,Ui,this.$onCanvasAction),this.$onCanvasAction=null)),super.disconnectedCallback()}$getSelections(){let o=[];return this.parentElement&&(o=Array.from(this.parentElement.querySelectorAll(this.$getTagNameOf(uo)))),o}$initSelection(o=!1,e=!1){let{initialCoverage:t,parentElement:r}=this;if(Qr(t)&&r){let n=this.aspectRatio||this.initialAspectRatio,s=(e?0:this.width)||r.offsetWidth*t,d=(e?0:this.height)||r.offsetHeight*t;Qr(n)&&({width:s,height:d}=ka({aspectRatio:n,width:s,height:d})),this.$change(this.x,this.y,s,d),o&&this.$center(),this.$initialSelection={x:this.x,y:this.y,width:this.width,height:this.height}}}$createSelection(){let o=this.cloneNode(!0);return this.hasAttribute("id")&&o.removeAttribute("id"),o.initialCoverage=NaN,this.active=!1,this.parentElement&&this.parentElement.insertBefore(o,this.nextSibling),o}$removeSelection(o=this){if(this.parentElement){let e=this.$getSelections();if(e.length>1){let t=e.indexOf(o),r=e[t+1]||e[t-1];r&&(o.active=!1,this.parentElement.removeChild(o),r.active=!0,r.$emit(wi,{x:r.x,y:r.y,width:r.width,height:r.height}))}else this.$clear()}}$handleActionStart(o){var e,t;let r=(t=(e=o.detail)===null||e===void 0?void 0:e.relatedEvent)===null||t===void 0?void 0:t.target;this.$action="",this.$actionStartTarget=r,!this.hidden&&this.multiple&&!this.active&&r===this&&this.parentElement&&(this.$getSelections().forEach(n=>{n.active=!1}),this.active=!0,this.$emit(wi,{x:this.x,y:this.y,width:this.width,height:this.height}))}$handleAction(o){let{currentTarget:e,detail:t}=o;if(!e||!t)return;let{relatedEvent:r}=t,{action:n}=t,s=r?Mp(r):null;if(!n&&this.multiple&&(n=this.$action||s?.action,this.$action=n),!n||this.hidden&&n!==ua||this.multiple&&!this.active&&n!==Wi)return;let{width:d,height:h}=this,p=t.endX-t.startX,f=t.endY-t.startY,{aspectRatio:x}=this;switch(!Qr(x)&&r.shiftKey&&(x=Qr(d)&&Qr(h)?d/h:1),n){case ua:if(p!==0||f!==0){p===0?p=f:f===0&&(f=p);let{$canvas:k}=this,C=pd(e);(this.multiple&&!this.hidden?this.$createSelection():this).$change(t.startX-C.left,t.startY-C.top,Math.abs(p),Math.abs(f),x),p<0?f<0?n=ma:f>0&&(n=fa):p>0&&(f<0?n=pa:f>0&&(n=ga)),k&&(k.$action=n)}break;case vl:this.movable&&(this.dynamic||this.$actionStartTarget&&this.contains(this.$actionStartTarget))&&this.$move(p,f);break;case Wi:if(r&&this.zoomable&&(this.dynamic||this.contains(r.target))){let k=pd(e);this.$zoom(t.scale,r.pageX-k.left,r.pageY-k.top)}break;default:this.$resize(n,p,f,x)}}$handleActionEnd(){this.$action="",this.$actionStartTarget=null}$handleKeyDown(o){if(this.hidden||!this.keyboard||this.multiple&&!this.active||o.defaultPrevented)return;let{activeElement:e}=document;if(!(e&&(["INPUT","TEXTAREA"].includes(e.tagName)||["true","plaintext-only"].includes(e.contentEditable))))switch(o.key){case"Backspace":o.metaKey&&(o.preventDefault(),this.$removeSelection());break;case"Delete":o.preventDefault(),this.$removeSelection();break;case"ArrowLeft":o.preventDefault(),this.$move(-1,0);break;case"ArrowRight":o.preventDefault(),this.$move(1,0);break;case"ArrowUp":o.preventDefault(),this.$move(0,-1);break;case"ArrowDown":o.preventDefault(),this.$move(0,1);break;case"+":o.preventDefault(),this.$zoom(.1);break;case"-":o.preventDefault(),this.$zoom(-.1);break}}$center(){let{parentElement:o}=this;if(!o)return this;let e=(o.offsetWidth-this.width)/2,t=(o.offsetHeight-this.height)/2;return this.$change(e,t)}$move(o,e=o){return this.$moveTo(this.x+o,this.y+e)}$moveTo(o,e=o){return this.movable?this.$change(o,e):this}$resize(o,e=0,t=0,r=this.aspectRatio){if(!this.resizable)return this;let n=Qr(r),{$canvas:s}=this,{x:d,y:h,width:p,height:f}=this;switch(o){case Zc:h+=t,f-=t,f<0&&(o=Jc,f=-f,h-=f),n&&(e=t*r,d+=e/2,p-=e,p<0&&(p=-p,d-=p));break;case Qc:p+=e,p<0&&(o=ed,p=-p,d-=p),n&&(t=e/r,h-=t/2,f+=t,f<0&&(f=-f,h-=f));break;case Jc:f+=t,f<0&&(o=Zc,f=-f,h-=f),n&&(e=t*r,d-=e/2,p+=e,p<0&&(p=-p,d-=p));break;case ed:d+=e,p-=e,p<0&&(o=Qc,p=-p,d-=p),n&&(t=e/r,h+=t/2,f-=t,f<0&&(f=-f,h-=f));break;case pa:n&&(t=-e/r),h+=t,f-=t,p+=e,p<0&&f<0?(o=fa,p=-p,f=-f,d-=p,h-=f):p<0?(o=ma,p=-p,d-=p):f<0&&(o=ga,f=-f,h-=f);break;case ma:n&&(t=e/r),d+=e,h+=t,p-=e,f-=t,p<0&&f<0?(o=ga,p=-p,f=-f,d-=p,h-=f):p<0?(o=pa,p=-p,d-=p):f<0&&(o=fa,f=-f,h-=f);break;case ga:n&&(t=e/r),p+=e,f+=t,p<0&&f<0?(o=ma,p=-p,f=-f,d-=p,h-=f):p<0?(o=fa,p=-p,d-=p):f<0&&(o=pa,f=-f,h-=f);break;case fa:n&&(t=-e/r),d+=e,p-=e,f+=t,p<0&&f<0?(o=pa,p=-p,f=-f,d-=p,h-=f):p<0?(o=ga,p=-p,d-=p):f<0&&(o=ma,f=-f,h-=f);break}return s&&s.$setAction(o),this.$change(d,h,p,f)}$zoom(o,e,t){if(!this.zoomable||o===0)return this;o<0?o=1/(1-o):o+=1;let{width:r,height:n}=this,s=r*o,d=n*o,h=this.x,p=this.y;return be(e)&&be(t)?(h-=(s-r)*((e-this.x)/r),p-=(d-n)*((t-this.y)/n)):(h-=(s-r)/2,p-=(d-n)/2),this.$change(h,p,s,d)}$change(o,e,t=this.width,r=this.height,n=this.aspectRatio,s=!1){return this.$changing||!be(o)||!be(e)||!be(t)||!be(r)||t<0||r<0?this:(Qr(n)&&({width:t,height:r}=ka({aspectRatio:n,width:t,height:r},"cover")),this.precise||(o=Math.round(o),e=Math.round(e),t=Math.round(t),r=Math.round(r)),o===this.x&&e===this.y&&t===this.width&&r===this.height&&Object.is(n,this.aspectRatio)&&!s?this:(this.hidden&&(this.hidden=!1),this.$emit(wi,{x:o,y:e,width:t,height:r})===!1?this:(this.$changing=!0,this.x=o,this.y=e,this.width=t,this.height=r,this.$changing=!1,this.$render())))}$reset(){let{x:o,y:e,width:t,height:r}=this.$initialSelection;return this.$change(o,e,t,r)}$clear(){return this.$change(0,0,0,0,NaN,!0),this.hidden=!0,this}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height})}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),{width:n,height:s}=this,d=1;if(ba(o)&&(Qr(o.width)||Qr(o.height))&&({width:n,height:s}=ka({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.width),r.width=n,r.height=s,!this.$canvas){e(r);return}let h=this.$canvas.querySelector(this.$getTagNameOf(bi));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=-this.x,H=-this.y,I=(P*S-C*H)/(x*S-C*k),B=(H*x-k*P)/(x*S-C*k),$=x*I+C*B+z,Q=k*I+S*B+T,ye=p.naturalWidth,De=p.naturalHeight;d!==1&&($*=d,Q*=d,ye*=d,De*=d);let yt=ye/2,Ee=De/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),ba(o)&&ya(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate(yt,Ee),f.transform(x,k,C,S,$,Q),f.translate(-yt,-Ee),f.drawImage(p,0,0,ye,De),f.restore()}e(r)}).catch(t)})}};Hn.$name=uo;Hn.$version="2.1.1";var ug=":host{display:flex;flex-direction:column;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([bordered]){border:1px dashed var(--theme-color)}:host([covered]){bottom:0;left:0;position:absolute;right:0;top:0}:host>span{display:flex;flex:1}:host>span+span{border-top:1px dashed var(--theme-color)}:host>span>span{flex:1}:host>span>span+span{border-left:1px dashed var(--theme-color)}",Rn=class extends nr{constructor(){super(...arguments),this.$style=ug,this.bordered=!1,this.columns=3,this.covered=!1,this.rows=3,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["bordered","columns","covered","rows"])}$propertyChangedCallback(o,e,t){Object.is(t,e)||(super.$propertyChangedCallback(o,e,t),(o==="rows"||o==="columns")&&this.$nextTick(()=>{this.$render()}))}connectedCallback(){super.connectedCallback(),this.$render()}$render(){let o=this.$getShadowRoot(),e=document.createDocumentFragment();for(let t=0;t<this.rows;t+=1){let r=document.createElement("span");r.setAttribute("role","row");for(let n=0;n<this.columns;n+=1){let s=document.createElement("span");s.setAttribute("role","gridcell"),r.appendChild(s)}e.appendChild(r)}o&&(o.innerHTML="",o.appendChild(e))}};Rn.$name=gp;Rn.$version="2.1.1";var hg=':host{display:inline-block;height:1em;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1em}:host:after,:host:before{background-color:var(--theme-color);content:"";display:block;position:absolute}:host:before{height:1px;left:0;top:50%;transform:translateY(-50%);width:100%}:host:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:1px}:host([centered]){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}',In=class extends nr{constructor(){super(...arguments),this.$style=hg,this.centered=!1,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["centered"])}};In.$name=mp;In.$version="2.1.1";var pg=":host{display:block;height:100%;overflow:hidden;position:relative;width:100%}",jp=new WeakMap,Op=new WeakMap,Hp=new WeakMap,Rp=new WeakMap,mg="both",gg="horizontal",Ip="vertical",fg="none",Vn=class extends nr{constructor(){super(...arguments),this.$onSelectionChange=null,this.$onSourceImageLoad=null,this.$onSourceImageTransform=null,this.$scale=1,this.$style=pg,this.resize=Ip,this.selection="",this.slottable=!1}set $image(o){Op.set(this,o)}get $image(){return Op.get(this)}set $sourceImage(o){Rp.set(this,o)}get $sourceImage(){return Rp.get(this)}set $canvas(o){jp.set(this,o)}get $canvas(){return jp.get(this)}set $selection(o){Hp.set(this,o)}get $selection(){return Hp.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["resize","selection"])}connectedCallback(){var o,e;super.connectedCallback();let t=null;if(this.selection?t=(e=(o=bl(this))===null||o===void 0?void 0:o.querySelector(this.selection))!==null&&e!==void 0?e:null:t=this.closest(this.$getTagNameOf(uo)),Gi(t)){this.$selection=t,this.$onSelectionChange=this.$handleSelectionChange.bind(this),gt(t,wi,this.$onSelectionChange);let r=t.closest(this.$getTagNameOf(ei));if(r){this.$canvas=r;let n=r.querySelector(this.$getTagNameOf(bi));n&&(this.$sourceImage=n,this.$image=n.cloneNode(!0),this.$getShadowRoot().appendChild(this.$image),this.$onSourceImageLoad=this.$handleSourceImageLoad.bind(this),this.$onSourceImageTransform=this.$handleSourceImageTransform.bind(this),gt(n.$image,mn,this.$onSourceImageLoad),gt(n,us,this.$onSourceImageTransform))}this.$render()}}disconnectedCallback(){let{$selection:o,$sourceImage:e}=this;o&&this.$onSelectionChange&&(lt(o,wi,this.$onSelectionChange),this.$onSelectionChange=null),e&&this.$onSourceImageLoad&&(lt(e.$image,mn,this.$onSourceImageLoad),this.$onSourceImageLoad=null),e&&this.$onSourceImageTransform&&(lt(e,us,this.$onSourceImageTransform),this.$onSourceImageTransform=null),super.disconnectedCallback()}$handleSelectionChange(o){this.$render(o.defaultPrevented?this.$selection:o.detail)}$handleSourceImageLoad(){let{$image:o,$sourceImage:e}=this,t=o.getAttribute("src"),r=e.getAttribute("src");r&&r!==t&&(o.setAttribute("src",r),o.$ready(()=>{this.$render()}))}$handleSourceImageTransform(o){this.$render(void 0,o.detail.matrix)}$render(o,e){let{$canvas:t,$selection:r}=this;!o&&!r.hidden&&(o=r),(!o||o.x===0&&o.y===0&&o.width===0&&o.height===0)&&(o={x:0,y:0,width:t.offsetWidth,height:t.offsetHeight});let{x:n,y:s,width:d,height:h}=o,p={},{clientWidth:f,clientHeight:x}=this,k=f,C=x,S=NaN;switch(this.resize){case mg:S=1,k=d,C=h,p.width=d,p.height=h;break;case gg:S=h>0?x/h:0,k=d*S,p.width=k;break;case Ip:S=d>0?f/d:0,C=h*S,p.height=C;break;case fg:default:f>0?S=d>0?f/d:0:x>0&&(S=h>0?x/h:0)}this.$scale=S,this.$setStyles(p),this.$sourceImage&&setTimeout(()=>{this.$transformImageByOffset(e??this.$sourceImage.$getTransform(),-n,-s)})}$transformImageByOffset(o,e,t){let{$image:r,$scale:n,$sourceImage:s}=this;if(s&&r&&n>=0){let[d,h,p,f,x,k]=o,C=(e*f-p*t)/(d*f-p*h),S=(t*d-h*e)/(d*f-p*h),z=d*C+p*S+x,T=h*C+f*S+k;s.$ready(P=>{this.$setStyles.call(r,{width:P.naturalWidth*n,height:P.naturalHeight*n})}),r.$setTransform(d,h,p,f,z*n,T*n)}}};Vn.$name=bp;Vn.$version="2.1.1";var vg='<cropper-canvas background><cropper-image rotatable scalable skewable translatable></cropper-image><cropper-shade hidden></cropper-shade><cropper-handle action="select" plain></cropper-handle><cropper-selection initial-coverage="0.5" movable resizable><cropper-grid role="grid" bordered covered></cropper-grid><cropper-crosshair centered></cropper-crosshair><cropper-handle action="move" theme-color="rgba(255, 255, 255, 0.35)"></cropper-handle><cropper-handle action="n-resize"></cropper-handle><cropper-handle action="e-resize"></cropper-handle><cropper-handle action="s-resize"></cropper-handle><cropper-handle action="w-resize"></cropper-handle><cropper-handle action="ne-resize"></cropper-handle><cropper-handle action="nw-resize"></cropper-handle><cropper-handle action="se-resize"></cropper-handle><cropper-handle action="sw-resize"></cropper-handle></cropper-selection></cropper-canvas>',bg=/^img|canvas$/,yg=/<(\/?(?:script|style)[^>]*)>/gi,Vp={template:vg};An.$define();In.$define();Rn.$define();On.$define();Pn.$define();Hn.$define();jn.$define();Vn.$define();var hs=class{constructor(o,e){var t;if(this.options=Vp,va(o)&&(o=document.querySelector(o)),!Gi(o)||!bg.test(o.localName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=o,e=Object.assign(Object.assign({},Vp),e),this.options=e;let{container:r}=e;if(r&&(va(r)&&(r=(t=bl(o))===null||t===void 0?void 0:t.querySelector(r)),!Gi(r)))throw new Error("The `container` option must be an element or a valid selector.");Gi(r)||(o.parentElement?r=o.parentElement:r=o.ownerDocument.body),this.container=r;let n=o.localName,s="";n==="img"?{src:s}=o:n==="canvas"&&window.HTMLCanvasElement&&(s=o.toDataURL());let{template:d}=e;if(d&&va(d)){let h=document.createElement("template"),p=document.createDocumentFragment();h.innerHTML=d.replace(yg,"&lt;$1&gt;"),p.appendChild(h.content),Array.from(p.querySelectorAll(bi)).forEach(f=>{f.setAttribute("src",s),f.setAttribute("alt",o.alt||"The image to crop"),n==="img"&&["crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","srcset"].forEach(x=>{o.hasAttribute(x)&&f.setAttribute(x,o.getAttribute(x)||"")})}),o.parentElement?(o.style.display="none",r.insertBefore(p,o.nextSibling)):r.appendChild(p)}}getCropperCanvas(){return this.container.querySelector(ei)}getCropperImage(){return this.container.querySelector(bi)}getCropperSelection(){return this.container.querySelector(uo)}getCropperSelections(){return this.container.querySelectorAll(uo)}destroy(){var o;let e=this.getCropperCanvas();e&&((o=e.parentElement)===null||o===void 0||o.removeChild(e)),this.element&&(this.element.style.display="")}};hs.version="2.1.1";function kg(i){if(typeof i=="number")return Number.isFinite(i)&&i>0?i:null;let o=String(i??"").trim();if(!o||o==="free")return null;if(o.includes("/")){let[t,r]=o.split("/").map(n=>Number(n.trim()));return Number.isFinite(t)&&Number.isFinite(r)&&t>0&&r>0?t/r:null}let e=Number(o);return Number.isFinite(e)&&e>0?e:null}function xg(i,o,e){return new Promise(t=>i.toBlob(t,o,e))}var wt=class extends Or.LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.aspectRatio="1";this.mimeType="image/png";this.quality=.92;this.height=420;this.crossOrigin="anonymous";this.disabled=!1;this.showResult=!0;this._loaded=!1;this._errored=!1;this._result="";this._onSelectionChange=e=>{let t=e.detail;this._selection={x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height),aspectRatio:this._ratio},this.dispatchEvent(new CustomEvent("change",{detail:this._selection,bubbles:!0,composed:!0}))};this._onLoad=()=>{this._loaded=!0,this._errored=!1,this._setupCropper(),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,composed:!0}))};this._onError=()=>{this._loaded=!1,this._errored=!0,this._destroyCropper(),this.dispatchEvent(new CustomEvent("error",{bubbles:!0,composed:!0}))}}disconnectedCallback(){this._destroyCropper(),super.disconnectedCallback()}updated(e){e.has("src")&&(this._loaded=!1,this._errored=!1,this._result="",this._selection=void 0,this._destroyCropper()),e.has("height")&&this.style.setProperty("--lui-image-cropper-height",`${this.height}px`),(e.has("aspectRatio")||e.has("src"))&&this._loaded&&this._setupCropper()}reset(){this._selectionEl?.$reset(),this._cropper?.getCropperImage()?.$resetTransform(),this._emitSelectionChange()}clear(){this._selectionEl?.$clear(),this._result="",this._selection=void 0}zoomIn(){this._cropper?.getCropperImage()?.$zoom(.1)}zoomOut(){this._cropper?.getCropperImage()?.$zoom(-.1)}rotateLeft(){this._cropper?.getCropperImage()?.$rotate("-90deg")}rotateRight(){this._cropper?.getCropperImage()?.$rotate("90deg")}async crop(){let e=this._cropper?.getCropperSelection();if(!e||e.hidden||!e.width||!e.height)return null;let t=await e.$toCanvas({width:this.outputWidth,height:this.outputHeight}),r=this.mimeType||"image/png",n=Math.max(0,Math.min(1,this.quality)),s=t.toDataURL(r,n),d=await xg(t,r,n),h={...this._readSelection(e),dataUrl:s,blob:d,canvas:t};return this._result=s,this._selection=h,this.dispatchEvent(new CustomEvent("crop",{detail:h,bubbles:!0,composed:!0})),h}get _ratio(){return kg(this.aspectRatio)}_template(){let e=this._ratio;return`
8330
+ `],a([(0,Be.property)()],Ie.prototype,"src",2),a([(0,Be.property)({attribute:"preview-src"})],Ie.prototype,"previewSrc",2),a([(0,Be.property)()],Ie.prototype,"alt",2),a([(0,Be.property)({attribute:"fallback-src"})],Ie.prototype,"fallbackSrc",2),a([(0,Be.property)()],Ie.prototype,"fallback",2),a([(0,Be.property)({reflect:!0})],Ie.prototype,"fit",2),a([(0,Be.property)({reflect:!0})],Ie.prototype,"radius",2),a([(0,Be.property)()],Ie.prototype,"width",2),a([(0,Be.property)()],Ie.prototype,"height",2),a([(0,Be.property)({attribute:"aspect-ratio"})],Ie.prototype,"aspectRatio",2),a([(0,Be.property)()],Ie.prototype,"position",2),a([(0,Be.property)({reflect:!0})],Ie.prototype,"loading",2),a([(0,Be.property)({type:Boolean,reflect:!0})],Ie.prototype,"skeleton",2),a([(0,Be.property)({type:Boolean,reflect:!0})],Ie.prototype,"preview",2),a([(0,Be.property)({type:Boolean,attribute:"show-preview-icon"})],Ie.prototype,"showPreviewIcon",2),a([(0,Be.property)({type:Boolean})],Ie.prototype,"draggablePreview",2),a([(0,Be.state)()],Ie.prototype,"_loaded",2),a([(0,Be.state)()],Ie.prototype,"_errored",2),a([(0,Be.state)()],Ie.prototype,"_previewOpen",2),a([(0,Be.state)()],Ie.prototype,"_zoom",2),a([(0,Be.state)()],Ie.prototype,"_rotate",2),a([(0,Be.state)()],Ie.prototype,"_panning",2),a([(0,Be.query)(".preview-image")],Ie.prototype,"_previewImageEl",2),a([(0,Be.query)(".preview-panzoom")],Ie.prototype,"_previewPanzoomEl",2),a([(0,Be.query)(".preview-stage")],Ie.prototype,"_previewStageEl",2),Ie=a([(0,Be.customElement)("lui-image")],Ie);var Or=require("lit"),Vt=require("lit/decorators.js");var cs=typeof window<"u"&&typeof window.document<"u",To=cs?window:{},Yc=cs?"ontouchstart"in To.document.documentElement:!1,Xc=cs?"PointerEvent"in To:!1,pn="cropper",ei=`${pn}-canvas`,mp=`${pn}-crosshair`,gp=`${pn}-grid`,fp=`${pn}-handle`,bi=`${pn}-image`,uo=`${pn}-selection`,vp=`${pn}-shade`,bp=`${pn}-viewer`,ua="select",vl="move",Wi="scale",ds="rotate",ha="transform",yi="none",Zc="n-resize",Qc="e-resize",Jc="s-resize",ed="w-resize",pa="ne-resize",ma="nw-resize",ga="se-resize",fa="sw-resize",yp="action",Ym=Yc?"touchend touchcancel":"mouseup",Xm=Yc?"touchmove":"mousemove",Zm=Yc?"touchstart":"mousedown",td=Xc?"pointerdown":Zm,rd=Xc?"pointermove":Xm,od=Xc?"pointerup pointercancel":Ym,id="error",nd="keydown",mn="load",ad="resize",sd="wheel",Ui="action",ki="actionend",kp="actionmove",xi="actionstart",wi="change",us="transform";function va(i){return typeof i=="string"}var ld=Number.isNaN||To.isNaN;function be(i){return typeof i=="number"&&!ld(i)}function Qr(i){return be(i)&&i>0&&i<1/0}function xp(i){return typeof i>"u"}function cd(i){return typeof i=="object"&&i!==null}var{hasOwnProperty:Qm}=Object.prototype;function ba(i){if(!cd(i))return!1;try{let{constructor:o}=i,{prototype:e}=o;return o&&e&&Qm.call(e,"isPrototypeOf")}catch{return!1}}function ya(i){return typeof i=="function"}function Gi(i){return typeof i=="object"&&i!==null&&i.nodeType===1}var Jm=/([a-z\d])([A-Z])/g;function dd(i){return String(i).replace(Jm,"$1-$2").toLowerCase()}var eg=/-[A-z\d]/g;function ud(i){return i.replace(eg,o=>o.slice(1).toUpperCase())}var wp=/\s\s*/;function lt(i,o,e,t){o.trim().split(wp).forEach(r=>{i.removeEventListener(r,e,t)})}function gt(i,o,e,t){o.trim().split(wp).forEach(r=>{i.addEventListener(r,e,t)})}function hd(i,o,e,t){gt(i,o,e,Object.assign(Object.assign({},t),{once:!0}))}var tg={bubbles:!0,cancelable:!0,composed:!0};function _p(i,o,e,t){return i.dispatchEvent(new CustomEvent(o,Object.assign(Object.assign(Object.assign({},tg),{detail:e}),t)))}function Mp(i){return typeof i.composedPath=="function"&&i.composedPath().find(Gi)||i.target}var hp=Promise.resolve();function Cp(i,o){return o?hp.then(i?o.bind(i):o):hp}function bl(i){let o=i.getRootNode();switch(o.nodeType){case 1:return o.ownerDocument;case 9:return o;case 11:return o}return null}function pd(i){let{documentElement:o}=i.ownerDocument,e=i.getBoundingClientRect();return{left:e.left+(To.pageXOffset-o.clientLeft),top:e.top+(To.pageYOffset-o.clientTop)}}var rg=/deg|g?rad|turn$/i;function yl(i){let o=parseFloat(i)||0;if(o!==0){let[e="rad"]=String(i).match(rg)||[];switch(e.toLowerCase()){case"deg":return o/360*(Math.PI*2);case"grad":return o/400*(Math.PI*2);case"turn":return o*(Math.PI*2)}}return o}var pp="contain",og="cover";function ka(i,o=pp){let{aspectRatio:e}=i,{width:t,height:r}=i,n=Qr(t),s=Qr(r);if(n&&s){let d=r*e;o===pp&&d>t||o===og&&d<t?r=t/e:t=r*e}else n?r=t/e:s&&(t=r*e);return{width:t,height:r}}function md(i,...o){if(o.length===0)return i;let[e,t,r,n,s,d]=i,[h,p,f,x,k,C]=o[0];return i=[e*h+r*p,t*h+n*p,e*f+r*x,t*f+n*x,e*k+r*C+s,t*k+n*C+d],md(i,...o.slice(1))}var ig=":host([hidden]){display:none!important}",ng=/left|top|width|height/i,zp="open",kl=new WeakMap,xl=new WeakMap,Ep=new Map,Sp=To.document&&Array.isArray(To.document.adoptedStyleSheets)&&"replaceSync"in To.CSSStyleSheet.prototype,nr=class extends HTMLElement{get $sharedStyle(){return`${this.themeColor?`:host{--theme-color: ${this.themeColor};}`:""}${ig}`}constructor(){var o,e;super(),this.shadowRootMode=zp,this.slottable=!0;let t=(e=(o=Object.getPrototypeOf(this))===null||o===void 0?void 0:o.constructor)===null||e===void 0?void 0:e.$name;t&&Ep.set(t,this.tagName.toLowerCase())}static get observedAttributes(){return["shadow-root-mode","slottable","theme-color"]}attributeChangedCallback(o,e,t){if(Object.is(t,e))return;let r=ud(o),n=this[r],s=t;switch(typeof n){case"boolean":s=t!==null&&t!=="false";break;case"number":s=Number(t);break}switch(this[r]=s,o){case"theme-color":{let d=xl.get(this),h=this.$sharedStyle;d&&h&&(Sp?d.replaceSync(h):d.textContent=h);break}}}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(o=dd(o),typeof t){case"boolean":t===!0?this.hasAttribute(o)||this.setAttribute(o,""):this.removeAttribute(o);break;case"number":ld(t)?t="":t=String(t);default:t?this.getAttribute(o)!==t&&this.setAttribute(o,t):this.removeAttribute(o)}}connectedCallback(){Object.getPrototypeOf(this).constructor.observedAttributes.forEach(e=>{let t=ud(e),r=this[t];xp(r)||this.$propertyChangedCallback(t,void 0,r),Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return r},set(n){let s=r;r=n,this.$propertyChangedCallback(t,s,n)}})});let o=this.shadowRoot||this.attachShadow({mode:this.shadowRootMode||zp});if(kl.set(this,o),xl.set(this,this.$addStyles(this.$sharedStyle)),this.$style&&this.$addStyles(this.$style),this.$template){let e=document.createElement("template");e.innerHTML=this.$template,o.appendChild(e.content)}if(this.slottable){let e=document.createElement("slot");o.appendChild(e)}}disconnectedCallback(){xl.has(this)&&xl.delete(this),kl.has(this)&&kl.delete(this)}$getTagNameOf(o){var e;return(e=Ep.get(o))!==null&&e!==void 0?e:o}$setStyles(o){return Object.keys(o).forEach(e=>{let t=o[e];be(t)&&(t!==0&&ng.test(e)?t=`${t}px`:t=String(t)),this.style[e]=t}),this}$getShadowRoot(){return this.shadowRoot||kl.get(this)}$addStyles(o){let e,t=this.$getShadowRoot();return Sp?(e=new CSSStyleSheet,e.replaceSync(o),t.adoptedStyleSheets=t.adoptedStyleSheets.concat(e)):(e=document.createElement("style"),e.textContent=o,t.appendChild(e)),e}$emit(o,e,t){return _p(this,o,e,t)}$nextTick(o){return Cp(this,o)}static $define(o,e){cd(o)&&(e=o,o=""),o||(o=this.$name||this.name),o=dd(o),cs&&To.customElements&&!To.customElements.get(o)&&customElements.define(o,this,e)}};nr.$version="2.1.1";var ag=':host{display:block;min-height:100px;min-width:200px;overflow:hidden;position:relative;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([background]){background-color:#fff;background-image:repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);background-image:repeating-conic-gradient(#ccc 0 25%,#fff 0 50%);background-position:0 0,.5rem .5rem;background-size:1rem 1rem}:host([disabled]){pointer-events:none}:host([disabled]):after{bottom:0;content:"";cursor:not-allowed;display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}',An=class extends nr{constructor(){super(...arguments),this.$onPointerDown=null,this.$onPointerMove=null,this.$onPointerUp=null,this.$onWheel=null,this.$wheeling=!1,this.$pointers=new Map,this.$style=ag,this.$action=yi,this.background=!1,this.disabled=!1,this.scaleStep=.1,this.themeColor="#39f"}static get observedAttributes(){return super.observedAttributes.concat(["background","disabled","scale-step"])}connectedCallback(){super.connectedCallback(),this.disabled||this.$bind()}disconnectedCallback(){this.disabled||this.$unbind(),super.disconnectedCallback()}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"disabled":t?this.$unbind():this.$bind();break}}$bind(){this.$onPointerDown||(this.$onPointerDown=this.$handlePointerDown.bind(this),gt(this,td,this.$onPointerDown)),this.$onPointerMove||(this.$onPointerMove=this.$handlePointerMove.bind(this),gt(this.ownerDocument,rd,this.$onPointerMove)),this.$onPointerUp||(this.$onPointerUp=this.$handlePointerUp.bind(this),gt(this.ownerDocument,od,this.$onPointerUp)),this.$onWheel||(this.$onWheel=this.$handleWheel.bind(this),gt(this,sd,this.$onWheel,{passive:!1,capture:!0}))}$unbind(){this.$onPointerDown&&(lt(this,td,this.$onPointerDown),this.$onPointerDown=null),this.$onPointerMove&&(lt(this.ownerDocument,rd,this.$onPointerMove),this.$onPointerMove=null),this.$onPointerUp&&(lt(this.ownerDocument,od,this.$onPointerUp),this.$onPointerUp=null),this.$onWheel&&(lt(this,sd,this.$onWheel,{capture:!0}),this.$onWheel=null)}$handlePointerDown(o){let{buttons:e,button:t,type:r}=o;if(this.disabled||(r==="pointerdown"&&o.pointerType==="mouse"||r==="mousedown")&&(be(e)&&e!==1||be(t)&&t!==0||o.ctrlKey))return;let{$pointers:n}=this,s="";if(o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:d,pageX:h,pageY:p})=>{n.set(d,{startX:h,startY:p,endX:h,endY:p})});else{let{pointerId:d=0,pageX:h,pageY:p}=o;n.set(d,{startX:h,startY:p,endX:h,endY:p})}n.size>1?s=ha:Gi(o.target)&&(s=o.target.action||o.target.getAttribute(yp)||""),this.$emit(xi,{action:s,relatedEvent:o})!==!1&&(o.preventDefault(),this.$action=s,this.style.willChange="transform")}$handlePointerMove(o){let{$action:e,$pointers:t}=this;if(this.disabled||e===yi||t.size===0||this.$emit(kp,{action:e,relatedEvent:o})===!1)return;if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:n,pageX:s,pageY:d})=>{let h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})});else{let{pointerId:n=0,pageX:s,pageY:d}=o,h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})}let r={action:e,relatedEvent:o};if(e===ha){let n=new Map(t),s=0,d=0,h=0,p=0,f=o.pageX,x=o.pageY;t.forEach((S,z)=>{n.delete(z),n.forEach(T=>{let P=T.startX-S.startX,H=T.startY-S.startY,I=T.endX-S.endX,B=T.endY-S.endY,$=0,Q=0,ye=0,De=0;if(P===0?H<0?ye=Math.PI*2:H>0&&(ye=Math.PI):P>0?ye=Math.PI/2+Math.atan(H/P):P<0&&(ye=Math.PI*1.5+Math.atan(H/P)),I===0?B<0?De=Math.PI*2:B>0&&(De=Math.PI):I>0?De=Math.PI/2+Math.atan(B/I):I<0&&(De=Math.PI*1.5+Math.atan(B/I)),De>0||ye>0){let yt=De-ye,Ee=Math.abs(yt);Ee>s&&(s=Ee,h=yt,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}if(P=Math.abs(P),H=Math.abs(H),I=Math.abs(I),B=Math.abs(B),P>0&&H>0?$=Math.sqrt(P*P+H*H):P>0?$=P:H>0&&($=H),I>0&&B>0?Q=Math.sqrt(I*I+B*B):I>0?Q=I:B>0&&(Q=B),$>0&&Q>0){let yt=(Q-$)/$,Ee=Math.abs(yt);Ee>d&&(d=Ee,p=yt,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}})});let k=s>0,C=d>0;k&&C?(r.rotate=h,r.scale=p,r.centerX=f,r.centerY=x):k?(r.action=ds,r.rotate=h,r.centerX=f,r.centerY=x):C?(r.action=Wi,r.scale=p,r.centerX=f,r.centerY=x):r.action=yi}else{let[n]=Array.from(t.values());Object.assign(r,n)}t.forEach(n=>{n.startX=n.endX,n.startY=n.endY}),r.action!==yi&&this.$emit(Ui,r,{cancelable:!1})}$handlePointerUp(o){let{$action:e,$pointers:t}=this;if(!(this.disabled||e===yi)&&this.$emit(ki,{action:e,relatedEvent:o})!==!1){if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:r})=>{t.delete(r)});else{let{pointerId:r=0}=o;t.delete(r)}t.size===0&&(this.style.willChange="",this.$action=yi)}}$handleWheel(o){if(this.disabled||(o.preventDefault(),this.$wheeling))return;this.$wheeling=!0,setTimeout(()=>{this.$wheeling=!1},50);let t=(o.deltaY>0?-1:1)*this.scaleStep;this.$emit(Ui,{action:Wi,scale:t,relatedEvent:o},{cancelable:!1})}$setAction(o){return va(o)&&(this.$action=o),this}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),n=this.offsetWidth,s=this.offsetHeight,d=1;ba(o)&&(Qr(o.width)||Qr(o.height))&&({width:n,height:s}=ka({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.offsetWidth),r.width=n,r.height=s;let h=this.querySelector(this.$getTagNameOf(bi));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=z,H=T,I=p.naturalWidth,B=p.naturalHeight;d!==1&&(P*=d,H*=d,I*=d,B*=d);let $=I/2,Q=B/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),ba(o)&&ya(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate($,Q),f.transform(x,k,C,S,P,H),f.translate(-$,-Q),f.drawImage(p,0,0,I,B),f.restore()}e(r)}).catch(t)})}};An.$name=ei;An.$version="2.1.1";var sg=":host{display:inline-block}img{display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}",$p=new WeakMap,Tp=["alt","crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","src","srcset"],Pn=class extends nr{constructor(){super(...arguments),this.$isReady=!1,this.$matrix=[1,0,0,1,0,0],this.$onLoad=null,this.$onCanvasAction=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$actionStartTarget=null,this.$style=sg,this.$image=new Image,this.initialCenterSize="contain",this.rotatable=!1,this.scalable=!1,this.skewable=!1,this.slottable=!1,this.translatable=!1,this.alt="",this.crossorigin="",this.decoding="",this.elementtiming="",this.fetchpriority="",this.loading="",this.referrerpolicy="",this.sizes="",this.src="",this.srcset=""}set $canvas(o){$p.set(this,o)}get $canvas(){return $p.get(this)}static get observedAttributes(){return super.observedAttributes.concat(Tp,["initial-center-size","rotatable","scalable","skewable","translatable"])}attributeChangedCallback(o,e,t){Object.is(t,e)||(super.attributeChangedCallback(o,e,t),Tp.includes(o)&&this.$image.setAttribute(o,t))}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"initialCenterSize":this.$nextTick(()=>{this.$center(t)});break;case"src":this.$isReady=!1;break}}connectedCallback(){super.connectedCallback();let{$image:o}=this,e=this.closest(this.$getTagNameOf(ei));e&&(this.$canvas=e,this.$setStyles({display:"block",position:"absolute"}),this.$onCanvasActionStart=t=>{var r,n;this.$actionStartTarget=(n=(r=t.detail)===null||r===void 0?void 0:r.relatedEvent)===null||n===void 0?void 0:n.target},this.$onCanvasActionEnd=()=>{this.$actionStartTarget=null},this.$onCanvasAction=this.$handleAction.bind(this),gt(e,xi,this.$onCanvasActionStart),gt(e,ki,this.$onCanvasActionEnd),gt(e,Ui,this.$onCanvasAction)),this.$onLoad=this.$handleLoad.bind(this),gt(o,mn,this.$onLoad),this.$getShadowRoot().appendChild(o)}disconnectedCallback(){let{$image:o,$canvas:e}=this;e&&(this.$onCanvasActionStart&&(lt(e,xi,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(lt(e,ki,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(lt(e,Ui,this.$onCanvasAction),this.$onCanvasAction=null)),o&&this.$onLoad&&(lt(o,mn,this.$onLoad),this.$onLoad=null),this.$getShadowRoot().removeChild(o),super.disconnectedCallback()}$handleLoad(){let{$image:o}=this;this.$setStyles({width:o.naturalWidth,height:o.naturalHeight}),this.$canvas&&this.$center(this.initialCenterSize),this.$isReady=!0}$handleAction(o){if(this.hidden||!(this.rotatable||this.scalable||this.translatable))return;let{$canvas:e}=this,{detail:t}=o;if(t){let{relatedEvent:r}=t,{action:n}=t;switch(n===ha&&(!this.rotatable||!this.scalable)&&(this.rotatable?n=ds:this.scalable?n=Wi:n=yi),n){case vl:if(this.translatable){let s=null;r&&(s=r.target.closest(this.$getTagNameOf(uo))),s||(s=e.querySelector(this.$getTagNameOf(uo))),s&&s.multiple&&!s.active&&(s=e.querySelector(`${this.$getTagNameOf(uo)}[active]`)),(!s||s.hidden||!s.movable||s.dynamic||!(this.$actionStartTarget&&s.contains(this.$actionStartTarget)))&&this.$move(t.endX-t.startX,t.endY-t.startY)}break;case ds:if(this.rotatable)if(r){let{x:s,y:d}=this.getBoundingClientRect();this.$rotate(t.rotate,r.clientX-s,r.clientY-d)}else this.$rotate(t.rotate);break;case Wi:if(this.scalable)if(r){let s=r.target.closest(this.$getTagNameOf(uo));if(!s||!s.zoomable||s.zoomable&&s.dynamic){let{x:d,y:h}=this.getBoundingClientRect();this.$zoom(t.scale,r.clientX-d,r.clientY-h)}}else this.$zoom(t.scale);break;case ha:if(this.rotatable&&this.scalable){let{rotate:s}=t,{scale:d}=t;d<0?d=1/(1-d):d+=1;let h=Math.cos(s),p=Math.sin(s),[f,x,k,C]=[h*d,p*d,-p*d,h*d];if(r){let S=this.getBoundingClientRect(),z=r.clientX-S.x,T=r.clientY-S.y,[P,H,I,B]=this.$matrix,$=S.width/2,Q=S.height/2,ye=z-$,De=T-Q,yt=(ye*B-I*De)/(P*B-I*H),Ee=(De*P-H*ye)/(P*B-I*H);this.$transform(f,x,k,C,yt*(1-f)+Ee*k,Ee*(1-C)+yt*x)}else this.$transform(f,x,k,C,0,0)}break}}}$ready(o){let{$image:e}=this,t=new Promise((r,n)=>{let s=new Error("Failed to load the image source");if(e.complete)e.naturalWidth>0&&e.naturalHeight>0?r(e):n(s);else{let d=()=>{lt(e,id,h),setTimeout(()=>{r(e)})},h=()=>{lt(e,mn,d),n(s)};hd(e,mn,d),hd(e,id,h)}});return ya(o)&&t.then(r=>(o(r),r)),t}$center(o){let{parentElement:e}=this;if(!e)return this;let t=e.getBoundingClientRect(),r=t.width,n=t.height,{x:s,y:d,width:h,height:p}=this.getBoundingClientRect(),f=s+h/2,x=d+p/2,k=t.x+r/2,C=t.y+n/2,{translatable:S}=this;if(!S&&!this.$isReady&&(this.translatable=!0,this.$nextTick(()=>{this.translatable=S})),this.$move(k-f,C-x),o&&(h!==r||p!==n)){let z=r/h,T=n/p,{scalable:P}=this;switch(o&&!P&&!this.$isReady&&(this.scalable=!0,this.$nextTick(()=>{this.scalable=P})),o){case"cover":this.$scale(Math.max(z,T));break;case"contain":this.$scale(Math.min(z,T));break}}return this}$move(o,e=o){if(this.translatable&&be(o)&&be(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$translate(d,h)}return this}$moveTo(o,e=o){if(this.translatable&&be(o)&&be(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$setTransform(t,r,n,s,d,h)}return this}$rotate(o,e,t){if(this.rotatable){let r=yl(o),n=Math.cos(r),s=Math.sin(r),[d,h,p,f]=[n,s,-s,n];if(be(e)&&be(t)){let[x,k,C,S]=this.$matrix,{width:z,height:T}=this.getBoundingClientRect(),P=z/2,H=T/2,I=e-P,B=t-H,$=(I*S-C*B)/(x*S-C*k),Q=(B*x-k*I)/(x*S-C*k);this.$transform(d,h,p,f,$*(1-d)-Q*p,Q*(1-f)-$*h)}else this.$transform(d,h,p,f,0,0)}return this}$zoom(o,e,t){if(!this.scalable||o===0)return this;if(o<0?o=1/(1-o):o+=1,be(e)&&be(t)){let[r,n,s,d]=this.$matrix,{width:h,height:p}=this.getBoundingClientRect(),f=h/2,x=p/2,k=e-f,C=t-x,S=(k*d-s*C)/(r*d-s*n),z=(C*r-n*k)/(r*d-s*n);this.$transform(o,0,0,o,S*(1-o),z*(1-o))}else this.$scale(o);return this}$scale(o,e=o){return this.scalable&&this.$transform(o,0,0,e,0,0),this}$skew(o,e=0){if(this.skewable){let t=yl(o),r=yl(e);this.$transform(1,Math.tan(r),Math.tan(t),1,0,0)}return this}$translate(o,e=o){return this.translatable&&be(o)&&be(e)&&this.$transform(1,0,0,1,o,e),this}$transform(o,e,t,r,n,s){return be(o)&&be(e)&&be(t)&&be(r)&&be(n)&&be(s)?this.$setTransform(md(this.$matrix,[o,e,t,r,n,s])):this}$setTransform(o,e,t,r,n,s){if((this.rotatable||this.scalable||this.skewable||this.translatable)&&(Array.isArray(o)&&([o,e,t,r,n,s]=o),be(o)&&be(e)&&be(t)&&be(r)&&be(n)&&be(s))){let d=[...this.$matrix],h=[o,e,t,r,n,s];if(this.$emit(us,{matrix:h,oldMatrix:d})===!1)return this;this.$matrix=h,this.style.transform=`matrix(${h.join(", ")})`}return this}$getTransform(){return this.$matrix.slice()}$resetTransform(){return this.$setTransform([1,0,0,1,0,0])}};Pn.$name=bi;Pn.$version="2.1.1";var lg=":host{display:block;height:0;left:0;outline:var(--theme-color) solid 1px;position:relative;top:0;width:0}:host([transparent]){outline-color:transparent}",Ap=new WeakMap,jn=class extends nr{constructor(){super(...arguments),this.$onWindowResize=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$onSelectionChange=null,this.$style=lg,this.x=0,this.y=0,this.width=0,this.height=0,this.slottable=!1,this.themeColor="rgba(0, 0, 0, 0.65)"}set $canvas(o){Ap.set(this,o)}get $canvas(){return Ap.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["height","width","x","y"])}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(ei));if(o){this.$canvas=o,this.style.position="absolute";let e=o.querySelector(this.$getTagNameOf(uo));e&&(this.$onWindowResize=this.$render.bind(this),this.$onCanvasActionStart=t=>{e.hidden&&t.detail.action===ua&&(this.hidden=!1)},this.$onCanvasActionEnd=t=>{e.hidden&&t.detail.action===ua&&(this.hidden=!0)},this.$onSelectionChange=t=>{let{x:r,y:n,width:s,height:d}=t.defaultPrevented?e:t.detail;this.$change(r,n,s,d),(e.hidden||r===0&&n===0&&s===0&&d===0)&&(this.hidden=!0)},gt(window,ad,this.$onWindowResize),gt(o,xi,this.$onCanvasActionStart),gt(o,ki,this.$onCanvasActionEnd),gt(o,wi,this.$onSelectionChange))}this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onWindowResize&&(lt(window,ad,this.$onWindowResize),this.$onWindowResize=null),this.$onCanvasActionStart&&(lt(o,xi,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(lt(o,ki,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onSelectionChange&&(lt(o,wi,this.$onSelectionChange),this.$onSelectionChange=null)),super.disconnectedCallback()}$change(o,e,t=this.width,r=this.height){return!be(o)||!be(e)||!be(t)||!be(r)||o===this.x&&e===this.y&&t===this.width&&r===this.height?this:(this.hidden&&(this.hidden=!1),this.x=o,this.y=e,this.width=t,this.height=r,this.$render())}$reset(){return this.$change(0,0,0,0)}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height,outlineWidth:To.innerWidth*To.devicePixelRatio})}};jn.$name=vp;jn.$version="2.1.1";var cg=':host{background-color:var(--theme-color);display:block}:host([action=move]),:host([action=select]){height:100%;left:0;position:absolute;top:0;width:100%}:host([action=move]){cursor:move}:host([action=select]){cursor:crosshair}:host([action$=-resize]){background-color:transparent;height:15px;position:absolute;width:15px}:host([action$=-resize]):after{background-color:var(--theme-color);content:"";display:block;height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:5px}:host([action=n-resize]),:host([action=s-resize]){cursor:ns-resize;left:50%;transform:translateX(-50%);width:100%}:host([action=n-resize]){top:-8px}:host([action=s-resize]){bottom:-8px}:host([action=e-resize]),:host([action=w-resize]){cursor:ew-resize;height:100%;top:50%;transform:translateY(-50%)}:host([action=e-resize]){right:-8px}:host([action=w-resize]){left:-8px}:host([action=ne-resize]){cursor:nesw-resize;right:-8px;top:-8px}:host([action=nw-resize]){cursor:nwse-resize;left:-8px;top:-8px}:host([action=se-resize]){bottom:-8px;cursor:nwse-resize;right:-8px}:host([action=se-resize]):after{height:15px;width:15px}@media (pointer:coarse){:host([action=se-resize]):after{height:10px;width:10px}}@media (pointer:fine){:host([action=se-resize]):after{height:5px;width:5px}}:host([action=sw-resize]){bottom:-8px;cursor:nesw-resize;left:-8px}:host([plain]){background-color:transparent}',On=class extends nr{constructor(){super(...arguments),this.$onCanvasCropEnd=null,this.$onCanvasCropStart=null,this.$style=cg,this.action=yi,this.plain=!1,this.slottable=!1,this.themeColor="rgba(51, 153, 255, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["action","plain"])}};On.$name=fp;On.$version="2.1.1";var dg=':host{display:block;left:0;position:relative;right:0}:host([outlined]){outline:1px solid var(--theme-color)}:host([multiple]){outline:1px dashed hsla(0,0%,100%,.5)}:host([multiple]):after{bottom:0;content:"";cursor:pointer;display:block;left:0;position:absolute;right:0;top:0}:host([multiple][active]){outline-color:var(--theme-color);z-index:1}:host([multiple])>*{visibility:hidden}:host([multiple][active])>*{visibility:visible}:host([multiple][active]):after{display:none}',Pp=new WeakMap,Hn=class extends nr{constructor(){super(...arguments),this.$onCanvasAction=null,this.$onCanvasActionStart=null,this.$onCanvasActionEnd=null,this.$onDocumentKeyDown=null,this.$action="",this.$actionStartTarget=null,this.$changing=!1,this.$style=dg,this.$initialSelection={x:0,y:0,width:0,height:0},this.x=0,this.y=0,this.width=0,this.height=0,this.aspectRatio=NaN,this.initialAspectRatio=NaN,this.initialCoverage=NaN,this.active=!1,this.linked=!1,this.dynamic=!1,this.movable=!1,this.resizable=!1,this.zoomable=!1,this.multiple=!1,this.keyboard=!1,this.outlined=!1,this.precise=!1}set $canvas(o){Pp.set(this,o)}get $canvas(){return Pp.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["active","aspect-ratio","dynamic","height","initial-aspect-ratio","initial-coverage","keyboard","linked","movable","multiple","outlined","precise","resizable","width","x","y","zoomable"])}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"x":case"y":case"width":case"height":this.$changing||this.$nextTick(()=>{this.$change(this.x,this.y,this.width,this.height,this.aspectRatio,!0)});break;case"aspectRatio":case"initialAspectRatio":this.$nextTick(()=>{this.$initSelection()});break;case"initialCoverage":this.$nextTick(()=>{Qr(t)&&t<=1&&this.$initSelection(!0,!0)});break;case"keyboard":this.$nextTick(()=>{this.$canvas&&(t?this.$onDocumentKeyDown||(this.$onDocumentKeyDown=this.$handleKeyDown.bind(this),gt(this.ownerDocument,nd,this.$onDocumentKeyDown)):this.$onDocumentKeyDown&&(lt(this.ownerDocument,nd,this.$onDocumentKeyDown),this.$onDocumentKeyDown=null))});break;case"multiple":this.$nextTick(()=>{if(this.$canvas){let r=this.$getSelections();t?(r.forEach(n=>{n.active=!1}),this.active=!0,this.$emit(wi,{x:this.x,y:this.y,width:this.width,height:this.height})):(this.active=!1,r.slice(1).forEach(n=>{this.$removeSelection(n)}))}});break;case"precise":this.$nextTick(()=>{this.$change(this.x,this.y)});break;case"linked":t&&(this.dynamic=!0);break}}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(ei));o?(this.$canvas=o,this.$setStyles({position:"absolute",transform:`translate(${this.x}px, ${this.y}px)`}),this.hidden||this.$render(),this.$initSelection(!0),this.$onCanvasActionStart=this.$handleActionStart.bind(this),this.$onCanvasActionEnd=this.$handleActionEnd.bind(this),this.$onCanvasAction=this.$handleAction.bind(this),gt(o,xi,this.$onCanvasActionStart),gt(o,ki,this.$onCanvasActionEnd),gt(o,Ui,this.$onCanvasAction)):this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onCanvasActionStart&&(lt(o,xi,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(lt(o,ki,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(lt(o,Ui,this.$onCanvasAction),this.$onCanvasAction=null)),super.disconnectedCallback()}$getSelections(){let o=[];return this.parentElement&&(o=Array.from(this.parentElement.querySelectorAll(this.$getTagNameOf(uo)))),o}$initSelection(o=!1,e=!1){let{initialCoverage:t,parentElement:r}=this;if(Qr(t)&&r){let n=this.aspectRatio||this.initialAspectRatio,s=(e?0:this.width)||r.offsetWidth*t,d=(e?0:this.height)||r.offsetHeight*t;Qr(n)&&({width:s,height:d}=ka({aspectRatio:n,width:s,height:d})),this.$change(this.x,this.y,s,d),o&&this.$center(),this.$initialSelection={x:this.x,y:this.y,width:this.width,height:this.height}}}$createSelection(){let o=this.cloneNode(!0);return this.hasAttribute("id")&&o.removeAttribute("id"),o.initialCoverage=NaN,this.active=!1,this.parentElement&&this.parentElement.insertBefore(o,this.nextSibling),o}$removeSelection(o=this){if(this.parentElement){let e=this.$getSelections();if(e.length>1){let t=e.indexOf(o),r=e[t+1]||e[t-1];r&&(o.active=!1,this.parentElement.removeChild(o),r.active=!0,r.$emit(wi,{x:r.x,y:r.y,width:r.width,height:r.height}))}else this.$clear()}}$handleActionStart(o){var e,t;let r=(t=(e=o.detail)===null||e===void 0?void 0:e.relatedEvent)===null||t===void 0?void 0:t.target;this.$action="",this.$actionStartTarget=r,!this.hidden&&this.multiple&&!this.active&&r===this&&this.parentElement&&(this.$getSelections().forEach(n=>{n.active=!1}),this.active=!0,this.$emit(wi,{x:this.x,y:this.y,width:this.width,height:this.height}))}$handleAction(o){let{currentTarget:e,detail:t}=o;if(!e||!t)return;let{relatedEvent:r}=t,{action:n}=t,s=r?Mp(r):null;if(!n&&this.multiple&&(n=this.$action||s?.action,this.$action=n),!n||this.hidden&&n!==ua||this.multiple&&!this.active&&n!==Wi)return;let{width:d,height:h}=this,p=t.endX-t.startX,f=t.endY-t.startY,{aspectRatio:x}=this;switch(!Qr(x)&&r.shiftKey&&(x=Qr(d)&&Qr(h)?d/h:1),n){case ua:if(p!==0||f!==0){p===0?p=f:f===0&&(f=p);let{$canvas:k}=this,C=pd(e);(this.multiple&&!this.hidden?this.$createSelection():this).$change(t.startX-C.left,t.startY-C.top,Math.abs(p),Math.abs(f),x),p<0?f<0?n=ma:f>0&&(n=fa):p>0&&(f<0?n=pa:f>0&&(n=ga)),k&&(k.$action=n)}break;case vl:this.movable&&(this.dynamic||this.$actionStartTarget&&this.contains(this.$actionStartTarget))&&this.$move(p,f);break;case Wi:if(r&&this.zoomable&&(this.dynamic||this.contains(r.target))){let k=pd(e);this.$zoom(t.scale,r.pageX-k.left,r.pageY-k.top)}break;default:this.$resize(n,p,f,x)}}$handleActionEnd(){this.$action="",this.$actionStartTarget=null}$handleKeyDown(o){if(this.hidden||!this.keyboard||this.multiple&&!this.active||o.defaultPrevented)return;let{activeElement:e}=document;if(!(e&&(["INPUT","TEXTAREA"].includes(e.tagName)||["true","plaintext-only"].includes(e.contentEditable))))switch(o.key){case"Backspace":o.metaKey&&(o.preventDefault(),this.$removeSelection());break;case"Delete":o.preventDefault(),this.$removeSelection();break;case"ArrowLeft":o.preventDefault(),this.$move(-1,0);break;case"ArrowRight":o.preventDefault(),this.$move(1,0);break;case"ArrowUp":o.preventDefault(),this.$move(0,-1);break;case"ArrowDown":o.preventDefault(),this.$move(0,1);break;case"+":o.preventDefault(),this.$zoom(.1);break;case"-":o.preventDefault(),this.$zoom(-.1);break}}$center(){let{parentElement:o}=this;if(!o)return this;let e=(o.offsetWidth-this.width)/2,t=(o.offsetHeight-this.height)/2;return this.$change(e,t)}$move(o,e=o){return this.$moveTo(this.x+o,this.y+e)}$moveTo(o,e=o){return this.movable?this.$change(o,e):this}$resize(o,e=0,t=0,r=this.aspectRatio){if(!this.resizable)return this;let n=Qr(r),{$canvas:s}=this,{x:d,y:h,width:p,height:f}=this;switch(o){case Zc:h+=t,f-=t,f<0&&(o=Jc,f=-f,h-=f),n&&(e=t*r,d+=e/2,p-=e,p<0&&(p=-p,d-=p));break;case Qc:p+=e,p<0&&(o=ed,p=-p,d-=p),n&&(t=e/r,h-=t/2,f+=t,f<0&&(f=-f,h-=f));break;case Jc:f+=t,f<0&&(o=Zc,f=-f,h-=f),n&&(e=t*r,d-=e/2,p+=e,p<0&&(p=-p,d-=p));break;case ed:d+=e,p-=e,p<0&&(o=Qc,p=-p,d-=p),n&&(t=e/r,h+=t/2,f-=t,f<0&&(f=-f,h-=f));break;case pa:n&&(t=-e/r),h+=t,f-=t,p+=e,p<0&&f<0?(o=fa,p=-p,f=-f,d-=p,h-=f):p<0?(o=ma,p=-p,d-=p):f<0&&(o=ga,f=-f,h-=f);break;case ma:n&&(t=e/r),d+=e,h+=t,p-=e,f-=t,p<0&&f<0?(o=ga,p=-p,f=-f,d-=p,h-=f):p<0?(o=pa,p=-p,d-=p):f<0&&(o=fa,f=-f,h-=f);break;case ga:n&&(t=e/r),p+=e,f+=t,p<0&&f<0?(o=ma,p=-p,f=-f,d-=p,h-=f):p<0?(o=fa,p=-p,d-=p):f<0&&(o=pa,f=-f,h-=f);break;case fa:n&&(t=-e/r),d+=e,p-=e,f+=t,p<0&&f<0?(o=pa,p=-p,f=-f,d-=p,h-=f):p<0?(o=ga,p=-p,d-=p):f<0&&(o=ma,f=-f,h-=f);break}return s&&s.$setAction(o),this.$change(d,h,p,f)}$zoom(o,e,t){if(!this.zoomable||o===0)return this;o<0?o=1/(1-o):o+=1;let{width:r,height:n}=this,s=r*o,d=n*o,h=this.x,p=this.y;return be(e)&&be(t)?(h-=(s-r)*((e-this.x)/r),p-=(d-n)*((t-this.y)/n)):(h-=(s-r)/2,p-=(d-n)/2),this.$change(h,p,s,d)}$change(o,e,t=this.width,r=this.height,n=this.aspectRatio,s=!1){return this.$changing||!be(o)||!be(e)||!be(t)||!be(r)||t<0||r<0?this:(Qr(n)&&({width:t,height:r}=ka({aspectRatio:n,width:t,height:r},"cover")),this.precise||(o=Math.round(o),e=Math.round(e),t=Math.round(t),r=Math.round(r)),o===this.x&&e===this.y&&t===this.width&&r===this.height&&Object.is(n,this.aspectRatio)&&!s?this:(this.hidden&&(this.hidden=!1),this.$emit(wi,{x:o,y:e,width:t,height:r})===!1?this:(this.$changing=!0,this.x=o,this.y=e,this.width=t,this.height=r,this.$changing=!1,this.$render())))}$reset(){let{x:o,y:e,width:t,height:r}=this.$initialSelection;return this.$change(o,e,t,r)}$clear(){return this.$change(0,0,0,0,NaN,!0),this.hidden=!0,this}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height})}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),{width:n,height:s}=this,d=1;if(ba(o)&&(Qr(o.width)||Qr(o.height))&&({width:n,height:s}=ka({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.width),r.width=n,r.height=s,!this.$canvas){e(r);return}let h=this.$canvas.querySelector(this.$getTagNameOf(bi));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=-this.x,H=-this.y,I=(P*S-C*H)/(x*S-C*k),B=(H*x-k*P)/(x*S-C*k),$=x*I+C*B+z,Q=k*I+S*B+T,ye=p.naturalWidth,De=p.naturalHeight;d!==1&&($*=d,Q*=d,ye*=d,De*=d);let yt=ye/2,Ee=De/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),ba(o)&&ya(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate(yt,Ee),f.transform(x,k,C,S,$,Q),f.translate(-yt,-Ee),f.drawImage(p,0,0,ye,De),f.restore()}e(r)}).catch(t)})}};Hn.$name=uo;Hn.$version="2.1.1";var ug=":host{display:flex;flex-direction:column;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([bordered]){border:1px dashed var(--theme-color)}:host([covered]){bottom:0;left:0;position:absolute;right:0;top:0}:host>span{display:flex;flex:1}:host>span+span{border-top:1px dashed var(--theme-color)}:host>span>span{flex:1}:host>span>span+span{border-left:1px dashed var(--theme-color)}",Rn=class extends nr{constructor(){super(...arguments),this.$style=ug,this.bordered=!1,this.columns=3,this.covered=!1,this.rows=3,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["bordered","columns","covered","rows"])}$propertyChangedCallback(o,e,t){Object.is(t,e)||(super.$propertyChangedCallback(o,e,t),(o==="rows"||o==="columns")&&this.$nextTick(()=>{this.$render()}))}connectedCallback(){super.connectedCallback(),this.$render()}$render(){let o=this.$getShadowRoot(),e=document.createDocumentFragment();for(let t=0;t<this.rows;t+=1){let r=document.createElement("span");r.setAttribute("role","row");for(let n=0;n<this.columns;n+=1){let s=document.createElement("span");s.setAttribute("role","gridcell"),r.appendChild(s)}e.appendChild(r)}o&&(o.innerHTML="",o.appendChild(e))}};Rn.$name=gp;Rn.$version="2.1.1";var hg=':host{display:inline-block;height:1em;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1em}:host:after,:host:before{background-color:var(--theme-color);content:"";display:block;position:absolute}:host:before{height:1px;left:0;top:50%;transform:translateY(-50%);width:100%}:host:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:1px}:host([centered]){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}',In=class extends nr{constructor(){super(...arguments),this.$style=hg,this.centered=!1,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["centered"])}};In.$name=mp;In.$version="2.1.1";var pg=":host{display:block;height:100%;overflow:hidden;position:relative;width:100%}",jp=new WeakMap,Op=new WeakMap,Hp=new WeakMap,Rp=new WeakMap,mg="both",gg="horizontal",Ip="vertical",fg="none",Vn=class extends nr{constructor(){super(...arguments),this.$onSelectionChange=null,this.$onSourceImageLoad=null,this.$onSourceImageTransform=null,this.$scale=1,this.$style=pg,this.resize=Ip,this.selection="",this.slottable=!1}set $image(o){Op.set(this,o)}get $image(){return Op.get(this)}set $sourceImage(o){Rp.set(this,o)}get $sourceImage(){return Rp.get(this)}set $canvas(o){jp.set(this,o)}get $canvas(){return jp.get(this)}set $selection(o){Hp.set(this,o)}get $selection(){return Hp.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["resize","selection"])}connectedCallback(){var o,e;super.connectedCallback();let t=null;if(this.selection?t=(e=(o=bl(this))===null||o===void 0?void 0:o.querySelector(this.selection))!==null&&e!==void 0?e:null:t=this.closest(this.$getTagNameOf(uo)),Gi(t)){this.$selection=t,this.$onSelectionChange=this.$handleSelectionChange.bind(this),gt(t,wi,this.$onSelectionChange);let r=t.closest(this.$getTagNameOf(ei));if(r){this.$canvas=r;let n=r.querySelector(this.$getTagNameOf(bi));n&&(this.$sourceImage=n,this.$image=n.cloneNode(!0),this.$getShadowRoot().appendChild(this.$image),this.$onSourceImageLoad=this.$handleSourceImageLoad.bind(this),this.$onSourceImageTransform=this.$handleSourceImageTransform.bind(this),gt(n.$image,mn,this.$onSourceImageLoad),gt(n,us,this.$onSourceImageTransform))}this.$render()}}disconnectedCallback(){let{$selection:o,$sourceImage:e}=this;o&&this.$onSelectionChange&&(lt(o,wi,this.$onSelectionChange),this.$onSelectionChange=null),e&&this.$onSourceImageLoad&&(lt(e.$image,mn,this.$onSourceImageLoad),this.$onSourceImageLoad=null),e&&this.$onSourceImageTransform&&(lt(e,us,this.$onSourceImageTransform),this.$onSourceImageTransform=null),super.disconnectedCallback()}$handleSelectionChange(o){this.$render(o.defaultPrevented?this.$selection:o.detail)}$handleSourceImageLoad(){let{$image:o,$sourceImage:e}=this,t=o.getAttribute("src"),r=e.getAttribute("src");r&&r!==t&&(o.setAttribute("src",r),o.$ready(()=>{this.$render()}))}$handleSourceImageTransform(o){this.$render(void 0,o.detail.matrix)}$render(o,e){let{$canvas:t,$selection:r}=this;!o&&!r.hidden&&(o=r),(!o||o.x===0&&o.y===0&&o.width===0&&o.height===0)&&(o={x:0,y:0,width:t.offsetWidth,height:t.offsetHeight});let{x:n,y:s,width:d,height:h}=o,p={},{clientWidth:f,clientHeight:x}=this,k=f,C=x,S=NaN;switch(this.resize){case mg:S=1,k=d,C=h,p.width=d,p.height=h;break;case gg:S=h>0?x/h:0,k=d*S,p.width=k;break;case Ip:S=d>0?f/d:0,C=h*S,p.height=C;break;case fg:default:f>0?S=d>0?f/d:0:x>0&&(S=h>0?x/h:0)}this.$scale=S,this.$setStyles(p),this.$sourceImage&&setTimeout(()=>{this.$transformImageByOffset(e??this.$sourceImage.$getTransform(),-n,-s)})}$transformImageByOffset(o,e,t){let{$image:r,$scale:n,$sourceImage:s}=this;if(s&&r&&n>=0){let[d,h,p,f,x,k]=o,C=(e*f-p*t)/(d*f-p*h),S=(t*d-h*e)/(d*f-p*h),z=d*C+p*S+x,T=h*C+f*S+k;s.$ready(P=>{this.$setStyles.call(r,{width:P.naturalWidth*n,height:P.naturalHeight*n})}),r.$setTransform(d,h,p,f,z*n,T*n)}}};Vn.$name=bp;Vn.$version="2.1.1";var vg='<cropper-canvas background><cropper-image rotatable scalable skewable translatable></cropper-image><cropper-shade hidden></cropper-shade><cropper-handle action="select" plain></cropper-handle><cropper-selection initial-coverage="0.5" movable resizable><cropper-grid role="grid" bordered covered></cropper-grid><cropper-crosshair centered></cropper-crosshair><cropper-handle action="move" theme-color="rgba(255, 255, 255, 0.35)"></cropper-handle><cropper-handle action="n-resize"></cropper-handle><cropper-handle action="e-resize"></cropper-handle><cropper-handle action="s-resize"></cropper-handle><cropper-handle action="w-resize"></cropper-handle><cropper-handle action="ne-resize"></cropper-handle><cropper-handle action="nw-resize"></cropper-handle><cropper-handle action="se-resize"></cropper-handle><cropper-handle action="sw-resize"></cropper-handle></cropper-selection></cropper-canvas>',bg=/^img|canvas$/,yg=/<(\/?(?:script|style)[^>]*)>/gi,Vp={template:vg};An.$define();In.$define();Rn.$define();On.$define();Pn.$define();Hn.$define();jn.$define();Vn.$define();var hs=class{constructor(o,e){var t;if(this.options=Vp,va(o)&&(o=document.querySelector(o)),!Gi(o)||!bg.test(o.localName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=o,e=Object.assign(Object.assign({},Vp),e),this.options=e;let{container:r}=e;if(r&&(va(r)&&(r=(t=bl(o))===null||t===void 0?void 0:t.querySelector(r)),!Gi(r)))throw new Error("The `container` option must be an element or a valid selector.");Gi(r)||(o.parentElement?r=o.parentElement:r=o.ownerDocument.body),this.container=r;let n=o.localName,s="";n==="img"?{src:s}=o:n==="canvas"&&window.HTMLCanvasElement&&(s=o.toDataURL());let{template:d}=e;if(d&&va(d)){let h=document.createElement("template"),p=document.createDocumentFragment();h.innerHTML=d.replace(yg,"&lt;$1&gt;"),p.appendChild(h.content),Array.from(p.querySelectorAll(bi)).forEach(f=>{f.setAttribute("src",s),f.setAttribute("alt",o.alt||"The image to crop"),n==="img"&&["crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","srcset"].forEach(x=>{o.hasAttribute(x)&&f.setAttribute(x,o.getAttribute(x)||"")})}),o.parentElement?(o.style.display="none",r.insertBefore(p,o.nextSibling)):r.appendChild(p)}}getCropperCanvas(){return this.container.querySelector(ei)}getCropperImage(){return this.container.querySelector(bi)}getCropperSelection(){return this.container.querySelector(uo)}getCropperSelections(){return this.container.querySelectorAll(uo)}destroy(){var o;let e=this.getCropperCanvas();e&&((o=e.parentElement)===null||o===void 0||o.removeChild(e)),this.element&&(this.element.style.display="")}};hs.version="2.1.1";function kg(i){if(typeof i=="number")return Number.isFinite(i)&&i>0?i:null;let o=String(i??"").trim();if(!o||o==="free")return null;if(o.includes("/")){let[t,r]=o.split("/").map(n=>Number(n.trim()));return Number.isFinite(t)&&Number.isFinite(r)&&t>0&&r>0?t/r:null}let e=Number(o);return Number.isFinite(e)&&e>0?e:null}function xg(i,o,e){return new Promise(t=>i.toBlob(t,o,e))}var wt=class extends Or.LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.aspectRatio="1";this.mimeType="image/png";this.quality=.92;this.height=420;this.crossOrigin="anonymous";this.disabled=!1;this.showResult=!0;this._loaded=!1;this._errored=!1;this._result="";this._onSelectionChange=e=>{let t=e.detail;this._selection={x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height),aspectRatio:this._ratio},this.dispatchEvent(new CustomEvent("change",{detail:this._selection,bubbles:!0,composed:!0}))};this._onLoad=()=>{this._loaded=!0,this._errored=!1,this._setupCropper(),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,composed:!0}))};this._onError=()=>{this._loaded=!1,this._errored=!0,this._destroyCropper(),this.dispatchEvent(new CustomEvent("error",{bubbles:!0,composed:!0}))}}disconnectedCallback(){this._destroyCropper(),super.disconnectedCallback()}updated(e){e.has("src")&&(this._loaded=!1,this._errored=!1,this._result="",this._selection=void 0,this._destroyCropper()),e.has("height")&&this.style.setProperty("--lui-image-cropper-height",`${this.height}px`),(e.has("aspectRatio")||e.has("src"))&&this._loaded&&this._setupCropper()}reset(){this._selectionEl?.$reset(),this._cropper?.getCropperImage()?.$resetTransform(),this._emitSelectionChange()}clear(){this._selectionEl?.$clear(),this._result="",this._selection=void 0}zoomIn(){this._cropper?.getCropperImage()?.$zoom(.1)}zoomOut(){this._cropper?.getCropperImage()?.$zoom(-.1)}rotateLeft(){this._cropper?.getCropperImage()?.$rotate("-90deg")}rotateRight(){this._cropper?.getCropperImage()?.$rotate("90deg")}async crop(){let e=this._cropper?.getCropperSelection();if(!e||e.hidden||!e.width||!e.height)return null;let t=await e.$toCanvas({width:this.outputWidth,height:this.outputHeight}),r=this.mimeType||"image/png",n=Math.max(0,Math.min(1,this.quality)),s=t.toDataURL(r,n),d=await xg(t,r,n),h={...this._readSelection(e),dataUrl:s,blob:d,canvas:t};return this._result=s,this._selection=h,this.dispatchEvent(new CustomEvent("crop",{detail:h,bubbles:!0,composed:!0})),h}get _ratio(){return kg(this.aspectRatio)}_template(){let e=this._ratio;return`
8329
8331
  <cropper-canvas background>
8330
8332
  <cropper-image rotatable scalable translatable></cropper-image>
8331
8333
  <cropper-shade hidden></cropper-shade>
@@ -8835,7 +8837,7 @@
8835
8837
  :host(:not([fade]):not([shadow])) .edge {
8836
8838
  display: none;
8837
8839
  }
8838
- `],a([(0,ar.property)({reflect:!0})],Ft.prototype,"orientation",2),a([(0,ar.property)({reflect:!0})],Ft.prototype,"scrollbar",2),a([(0,ar.property)({attribute:"max-height"})],Ft.prototype,"maxHeight",2),a([(0,ar.property)({attribute:"max-width"})],Ft.prototype,"maxWidth",2),a([(0,ar.property)({type:Boolean,reflect:!0})],Ft.prototype,"fade",2),a([(0,ar.property)({type:Boolean,reflect:!0})],Ft.prototype,"shadow",2),a([(0,ar.property)({type:Boolean,reflect:!0})],Ft.prototype,"thin",2),a([(0,ar.property)({type:Boolean,reflect:!0,attribute:"hide-scrollbar"})],Ft.prototype,"hideScrollbar",2),a([(0,ar.property)({type:Boolean,reflect:!0,attribute:"auto-hide"})],Ft.prototype,"autoHide",2),a([(0,ar.property)({type:Number,attribute:"reach-threshold"})],Ft.prototype,"reachThreshold",2),a([(0,ar.query)(".viewport")],Ft.prototype,"_viewport",2),a([(0,ar.state)()],Ft.prototype,"_atTop",2),a([(0,ar.state)()],Ft.prototype,"_atBottom",2),a([(0,ar.state)()],Ft.prototype,"_atLeft",2),a([(0,ar.state)()],Ft.prototype,"_atRight",2),Ft=a([(0,ar.customElement)("lui-scroll-area")],Ft);var fn=require("lit"),To=require("lit/decorators.js");var Hr=class extends fn.LitElement{constructor(){super(...arguments);this.orientation="horizontal";this.variant="solid";this.size="md";this.spacing="md";this.labelPlacement="center";this.inset=!1;this.subtle=!1;this.color="";this.thickness="";this._hasLabel=!1;this._explicitAttrs=new Set;this._onSlotChange=e=>{let r=e.currentTarget.assignedNodes({flatten:!0}).some(n=>n.nodeType===Node.TEXT_NODE?!!n.textContent?.trim():n.nodeType===Node.ELEMENT_NODE);this._hasLabel!==r&&(this._hasLabel=r)}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){let t=L(this,"divider");!this._explicitAttrs.has("orientation")&&typeof t.orientation=="string"&&this.orientation!==t.orientation&&(this.orientation=t.orientation),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("spacing")&&typeof t.spacing=="string"&&this.spacing!==t.spacing&&(this.spacing=t.spacing),!this._explicitAttrs.has("label-placement")&&typeof t.labelPlacement=="string"&&this.labelPlacement!==t.labelPlacement&&(this.labelPlacement=t.labelPlacement),!this._explicitAttrs.has("inset")&&typeof t.inset=="boolean"&&this.inset!==t.inset&&(this.inset=t.inset),!this._explicitAttrs.has("subtle")&&typeof t.subtle=="boolean"&&this.subtle!==t.subtle&&(this.subtle=t.subtle),!this._explicitAttrs.has("color")&&typeof t.color=="string"&&this.color!==t.color&&(this.color=t.color),!this._explicitAttrs.has("thickness")&&typeof t.thickness=="string"&&this.thickness!==t.thickness&&(this.thickness=t.thickness)}_style(){let e=[this.color?`--lui-divider-color:${this.color}`:"",this.thickness?`--lui-divider-thickness:${this.thickness}`:""].filter(Boolean);return e.length?e.join(";"):fn.nothing}render(){let e=this.orientation==="vertical";return fn.html`
8840
+ `],a([(0,ar.property)({reflect:!0})],Ft.prototype,"orientation",2),a([(0,ar.property)({reflect:!0})],Ft.prototype,"scrollbar",2),a([(0,ar.property)({attribute:"max-height"})],Ft.prototype,"maxHeight",2),a([(0,ar.property)({attribute:"max-width"})],Ft.prototype,"maxWidth",2),a([(0,ar.property)({type:Boolean,reflect:!0})],Ft.prototype,"fade",2),a([(0,ar.property)({type:Boolean,reflect:!0})],Ft.prototype,"shadow",2),a([(0,ar.property)({type:Boolean,reflect:!0})],Ft.prototype,"thin",2),a([(0,ar.property)({type:Boolean,reflect:!0,attribute:"hide-scrollbar"})],Ft.prototype,"hideScrollbar",2),a([(0,ar.property)({type:Boolean,reflect:!0,attribute:"auto-hide"})],Ft.prototype,"autoHide",2),a([(0,ar.property)({type:Number,attribute:"reach-threshold"})],Ft.prototype,"reachThreshold",2),a([(0,ar.query)(".viewport")],Ft.prototype,"_viewport",2),a([(0,ar.state)()],Ft.prototype,"_atTop",2),a([(0,ar.state)()],Ft.prototype,"_atBottom",2),a([(0,ar.state)()],Ft.prototype,"_atLeft",2),a([(0,ar.state)()],Ft.prototype,"_atRight",2),Ft=a([(0,ar.customElement)("lui-scroll-area")],Ft);var fn=require("lit"),Ao=require("lit/decorators.js");var Hr=class extends fn.LitElement{constructor(){super(...arguments);this.orientation="horizontal";this.variant="solid";this.size="md";this.spacing="md";this.labelPlacement="center";this.inset=!1;this.subtle=!1;this.color="";this.thickness="";this._hasLabel=!1;this._explicitAttrs=new Set;this._onSlotChange=e=>{let r=e.currentTarget.assignedNodes({flatten:!0}).some(n=>n.nodeType===Node.TEXT_NODE?!!n.textContent?.trim():n.nodeType===Node.ELEMENT_NODE);this._hasLabel!==r&&(this._hasLabel=r)}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){let t=L(this,"divider");!this._explicitAttrs.has("orientation")&&typeof t.orientation=="string"&&this.orientation!==t.orientation&&(this.orientation=t.orientation),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("spacing")&&typeof t.spacing=="string"&&this.spacing!==t.spacing&&(this.spacing=t.spacing),!this._explicitAttrs.has("label-placement")&&typeof t.labelPlacement=="string"&&this.labelPlacement!==t.labelPlacement&&(this.labelPlacement=t.labelPlacement),!this._explicitAttrs.has("inset")&&typeof t.inset=="boolean"&&this.inset!==t.inset&&(this.inset=t.inset),!this._explicitAttrs.has("subtle")&&typeof t.subtle=="boolean"&&this.subtle!==t.subtle&&(this.subtle=t.subtle),!this._explicitAttrs.has("color")&&typeof t.color=="string"&&this.color!==t.color&&(this.color=t.color),!this._explicitAttrs.has("thickness")&&typeof t.thickness=="string"&&this.thickness!==t.thickness&&(this.thickness=t.thickness)}_style(){let e=[this.color?`--lui-divider-color:${this.color}`:"",this.thickness?`--lui-divider-thickness:${this.thickness}`:""].filter(Boolean);return e.length?e.join(";"):fn.nothing}render(){let e=this.orientation==="vertical";return fn.html`
8839
8841
  <div
8840
8842
  class=${`divider ${this._hasLabel&&!e?"has-label":"no-label"}`}
8841
8843
  part="divider"
@@ -9006,7 +9008,7 @@
9006
9008
  :host([orientation="vertical"]) .label {
9007
9009
  display: none;
9008
9010
  }
9009
- `],a([(0,To.property)({reflect:!0})],Hr.prototype,"orientation",2),a([(0,To.property)({reflect:!0})],Hr.prototype,"variant",2),a([(0,To.property)({reflect:!0})],Hr.prototype,"size",2),a([(0,To.property)({reflect:!0})],Hr.prototype,"spacing",2),a([(0,To.property)({attribute:"label-placement",reflect:!0})],Hr.prototype,"labelPlacement",2),a([(0,To.property)({type:Boolean,reflect:!0})],Hr.prototype,"inset",2),a([(0,To.property)({type:Boolean,reflect:!0})],Hr.prototype,"subtle",2),a([(0,To.property)()],Hr.prototype,"color",2),a([(0,To.property)()],Hr.prototype,"thickness",2),a([(0,To.state)()],Hr.prototype,"_hasLabel",2),Hr=a([(0,To.customElement)("lui-divider")],Hr);var xa=require("lit"),ho=require("lit/decorators.js");var ur=class extends xa.LitElement{connectedCallback(){super.connectedCallback(),this._applyRootConfig(),this._notifyDescendants()}updated(){this._applyRootConfig(),this._notifyDescendants()}getConfig(){return{locale:this.locale,translations:this.translations,theme:this.theme,size:this.size,disabled:this.disabled,variant:this.variant,direction:this.direction,popupContainer:this.popupContainer,overlayContainer:this.overlayContainer,zIndexBase:this.zIndexBase,renderEmpty:this.renderEmpty,componentConfig:this.componentConfig}}_notifyDescendants(){queueMicrotask(()=>{let o=this.querySelectorAll("*");for(let e of o){let t=e;typeof t.requestUpdate=="function"&&t.requestUpdate()}})}_applyRootConfig(){this.locale?(Rc(this.locale),this.translations&&Ic(this.locale,this.translations),this.setAttribute("lang",this.locale)):this.removeAttribute("lang"),this.theme?this.setAttribute("theme",this.theme):this.removeAttribute("theme"),this.direction?this.setAttribute("dir",this.direction):this.removeAttribute("dir"),typeof this.zIndexBase=="number"?this.style.setProperty("--lui-z-base",String(this.zIndexBase)):this.style.removeProperty("--lui-z-base")}render(){return xa.html`<slot></slot>`}};ur.styles=xa.css`
9011
+ `],a([(0,Ao.property)({reflect:!0})],Hr.prototype,"orientation",2),a([(0,Ao.property)({reflect:!0})],Hr.prototype,"variant",2),a([(0,Ao.property)({reflect:!0})],Hr.prototype,"size",2),a([(0,Ao.property)({reflect:!0})],Hr.prototype,"spacing",2),a([(0,Ao.property)({attribute:"label-placement",reflect:!0})],Hr.prototype,"labelPlacement",2),a([(0,Ao.property)({type:Boolean,reflect:!0})],Hr.prototype,"inset",2),a([(0,Ao.property)({type:Boolean,reflect:!0})],Hr.prototype,"subtle",2),a([(0,Ao.property)()],Hr.prototype,"color",2),a([(0,Ao.property)()],Hr.prototype,"thickness",2),a([(0,Ao.state)()],Hr.prototype,"_hasLabel",2),Hr=a([(0,Ao.customElement)("lui-divider")],Hr);var xa=require("lit"),ho=require("lit/decorators.js");var ur=class extends xa.LitElement{connectedCallback(){super.connectedCallback(),this._applyRootConfig(),this._notifyDescendants()}updated(){this._applyRootConfig(),this._notifyDescendants()}getConfig(){return{locale:this.locale,translations:this.translations,theme:this.theme,size:this.size,disabled:this.disabled,variant:this.variant,direction:this.direction,popupContainer:this.popupContainer,overlayContainer:this.overlayContainer,zIndexBase:this.zIndexBase,renderEmpty:this.renderEmpty,componentConfig:this.componentConfig}}_notifyDescendants(){queueMicrotask(()=>{let o=this.querySelectorAll("*");for(let e of o){let t=e;typeof t.requestUpdate=="function"&&t.requestUpdate()}})}_applyRootConfig(){this.locale?(Rc(this.locale),this.translations&&Ic(this.locale,this.translations),this.setAttribute("lang",this.locale)):this.removeAttribute("lang"),this.theme?this.setAttribute("theme",this.theme):this.removeAttribute("theme"),this.direction?this.setAttribute("dir",this.direction):this.removeAttribute("dir"),typeof this.zIndexBase=="number"?this.style.setProperty("--lui-z-base",String(this.zIndexBase)):this.style.removeProperty("--lui-z-base")}render(){return xa.html`<slot></slot>`}};ur.styles=xa.css`
9010
9012
  :host {
9011
9013
  display: contents;
9012
9014
  }
@@ -9330,7 +9332,7 @@
9330
9332
  slot {
9331
9333
  display: contents;
9332
9334
  }
9333
- `],a([(0,Mr.property)({type:Number})],po.prototype,"span",2),a([(0,Mr.property)({type:Number})],po.prototype,"xs",2),a([(0,Mr.property)({type:Number})],po.prototype,"sm",2),a([(0,Mr.property)({type:Number})],po.prototype,"md",2),a([(0,Mr.property)({type:Number})],po.prototype,"lg",2),a([(0,Mr.property)({type:Number})],po.prototype,"xl",2),a([(0,Mr.property)({type:Number})],po.prototype,"offset",2),a([(0,Mr.property)({type:Number,attribute:"order"})],po.prototype,"colOrder",2),po=a([(0,Mr.customElement)("lui-col")],po);var F=require("lit"),Ko=require("lit/decorators.js"),qp=require("lit/directives/keyed.js"),fs=require("lit/directives/ref.js"),Kp=require("lit/directives/repeat.js"),Ca=require("@tanstack/lit-form");var vn=require("lit"),Ke=require("lit/decorators.js");var He=class extends vn.LitElement{constructor(){super(...arguments);this.value="";this.placeholder="";this.type="text";this.size="md";this.disabled=!1;this.readonly=!1;this.autofocus=!1;this.clearable=!1;this.revealable=!1;this.invalid=!1;this.noborder=!1;this.spellcheck=!1;this.autocapitalize="";this._focused=!1;this._revealed=!1;this._explicitAttrs=new Set;this._keepFocus=e=>{e.preventDefault()};this._clearValue=()=>{this.disabled||this.readonly||(this.value="",this._revealed=!1,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("clear",{detail:{value:this.value},bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.focus()))};this._toggleReveal=()=>{this.disabled||this.type!=="password"||(this._revealed=!this._revealed,this.requestUpdate(),this.updateComplete.then(()=>this.focus()))};this._onInput=e=>{e.stopPropagation(),this.value=e.target.value,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))};this._onChange=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))};this._onKeyDown=e=>{if(e.key==="Enter"){let t=e.composedPath().find(r=>r.localName==="form");if(t){if(!t.reportValidity())return;t.requestSubmit()}}}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=xe(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.()}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}willUpdate(){let e=L(this,"input");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("clearable")&&typeof e.clearable=="boolean"&&this.clearable!==e.clearable&&(this.clearable=e.clearable),!this._explicitAttrs.has("revealable")&&typeof e.revealable=="boolean"&&this.revealable!==e.revealable&&(this.revealable=e.revealable),!this._explicitAttrs.has("noborder")&&typeof e.noborder=="boolean"&&this.noborder!==e.noborder&&(this.noborder=e.noborder),!this._explicitAttrs.has("placeholder")&&typeof e.placeholder=="string"&&!this.placeholder&&(this.placeholder=e.placeholder)}focus(){this._input?.focus()}blur(){this._input?.blur()}insertText(e){let t=this._input;if(!t){this.value=`${this.value}${e}`;return}let r=t.selectionStart??t.value.length,n=t.selectionEnd??r;t.setRangeText(e,r,n,"end"),this.value=t.value,t.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),t.focus()}render(){let e=["wrapper"];this._focused&&e.push("focused"),this.disabled&&e.push("disabled"),this.invalid&&e.push("invalid");let t=this.clearable&&!this.disabled&&!this.readonly&&this.value.length>0,r=this.revealable&&this.type==="password"&&!this.disabled;return vn.html`
9335
+ `],a([(0,Mr.property)({type:Number})],po.prototype,"span",2),a([(0,Mr.property)({type:Number})],po.prototype,"xs",2),a([(0,Mr.property)({type:Number})],po.prototype,"sm",2),a([(0,Mr.property)({type:Number})],po.prototype,"md",2),a([(0,Mr.property)({type:Number})],po.prototype,"lg",2),a([(0,Mr.property)({type:Number})],po.prototype,"xl",2),a([(0,Mr.property)({type:Number})],po.prototype,"offset",2),a([(0,Mr.property)({type:Number,attribute:"order"})],po.prototype,"colOrder",2),po=a([(0,Mr.customElement)("lui-col")],po);var F=require("lit"),Wo=require("lit/decorators.js"),qp=require("lit/directives/keyed.js"),fs=require("lit/directives/ref.js"),Kp=require("lit/directives/repeat.js"),Ca=require("@tanstack/lit-form");var vn=require("lit"),Ke=require("lit/decorators.js");var He=class extends vn.LitElement{constructor(){super(...arguments);this.value="";this.placeholder="";this.type="text";this.size="md";this.disabled=!1;this.readonly=!1;this.autofocus=!1;this.clearable=!1;this.revealable=!1;this.invalid=!1;this.noborder=!1;this.spellcheck=!1;this.autocapitalize="";this._focused=!1;this._revealed=!1;this._explicitAttrs=new Set;this._keepFocus=e=>{e.preventDefault()};this._clearValue=()=>{this.disabled||this.readonly||(this.value="",this._revealed=!1,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("clear",{detail:{value:this.value},bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.focus()))};this._toggleReveal=()=>{this.disabled||this.type!=="password"||(this._revealed=!this._revealed,this.requestUpdate(),this.updateComplete.then(()=>this.focus()))};this._onInput=e=>{e.stopPropagation(),this.value=e.target.value,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))};this._onChange=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))};this._onKeyDown=e=>{if(e.key==="Enter"){let t=e.composedPath().find(r=>r.localName==="form");if(t){if(!t.reportValidity())return;t.requestSubmit()}}}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=xe(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.()}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}willUpdate(){let e=L(this,"input");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("clearable")&&typeof e.clearable=="boolean"&&this.clearable!==e.clearable&&(this.clearable=e.clearable),!this._explicitAttrs.has("revealable")&&typeof e.revealable=="boolean"&&this.revealable!==e.revealable&&(this.revealable=e.revealable),!this._explicitAttrs.has("noborder")&&typeof e.noborder=="boolean"&&this.noborder!==e.noborder&&(this.noborder=e.noborder),!this._explicitAttrs.has("placeholder")&&typeof e.placeholder=="string"&&!this.placeholder&&(this.placeholder=e.placeholder)}focus(){this._input?.focus()}blur(){this._input?.blur()}insertText(e){let t=this._input;if(!t){this.value=`${this.value}${e}`;return}let r=t.selectionStart??t.value.length,n=t.selectionEnd??r;t.setRangeText(e,r,n,"end"),this.value=t.value,t.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),t.focus()}render(){let e=["wrapper"];this._focused&&e.push("focused"),this.disabled&&e.push("disabled"),this.invalid&&e.push("invalid");let t=this.clearable&&!this.disabled&&!this.readonly&&this.value.length>0,r=this.revealable&&this.type==="password"&&!this.disabled;return vn.html`
9334
9336
  <div class=${e.join(" ")} part="wrapper">
9335
9337
  <slot name="prefix"></slot>
9336
9338
  <input
@@ -9769,7 +9771,7 @@
9769
9771
  transition: none;
9770
9772
  }
9771
9773
  }
9772
- `],a([(0,oi.property)({type:Boolean,reflect:!0})],go.prototype,"checked",2),a([(0,oi.property)({type:Boolean,reflect:!0})],go.prototype,"disabled",2),a([(0,oi.property)({reflect:!0})],go.prototype,"size",2),a([(0,oi.property)()],go.prototype,"name",2),a([(0,oi.property)()],go.prototype,"label",2),a([(0,oi.property)()],go.prototype,"locale",2),a([(0,oi.property)({attribute:!1})],go.prototype,"translations",2),a([(0,oi.query)("input")],go.prototype,"_input",2),go=a([(0,oi.customElement)("lui-switch")],go);var Ao=require("lit"),Jr=require("lit/decorators.js");var Cr=class extends Ao.LitElement{constructor(){super(...arguments);this.source=[];this.value=[];this.direction="horizontal";this.radius="md";this.size="md";this.disabled=!1;this.checkboxProps={};this._explicitAttrs=new Set;this._syncFrame=0;this._onSlottedChange=e=>{if(this.source.length>0)return;let t=e.target;!t||t.tagName.toLowerCase()!=="lui-checkbox"||this._toggle(t.value??"")}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._lightDomObserver=new MutationObserver(()=>this._scheduleSync()),this._lightDomObserver.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","disabled","checked","indeterminate","label","description","slot"]})}disconnectedCallback(){super.disconnectedCallback(),this._lightDomObserver?.disconnect(),this._syncFrame&&cancelAnimationFrame(this._syncFrame)}_isChecked(e){return this.value?.includes(e)??!1}_toggle(e){let t=this.value??[],r=t.includes(e)?t.filter(n=>n!==e):[...t,e];this.value=r,this.dispatchEvent(new CustomEvent("change",{detail:{value:r},bubbles:!0,composed:!0}))}firstUpdated(){this._scheduleSync()}willUpdate(){let e=L(this,"checkboxGroup");!this._explicitAttrs.has("direction")&&typeof e.direction=="string"&&this.direction!==e.direction&&(this.direction=e.direction),!this._explicitAttrs.has("radius")&&typeof e.radius=="string"&&this.radius!==e.radius&&(this.radius=e.radius),!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled)}updated(e){(e.has("value")||e.has("disabled")||e.has("radius")||e.has("size")||e.has("name")||e.has("source")||e.has("checkboxProps"))&&this._scheduleSync()}_scheduleSync(){this._syncFrame&&cancelAnimationFrame(this._syncFrame),this._syncFrame=requestAnimationFrame(()=>{this._syncFrame=0,this._syncSlottedCheckboxes(),this._syncRenderedCheckboxes()})}_getSlottedCheckboxes(){return this._slotEl?this._slotEl.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()==="lui-checkbox"):[]}_mergedCheckboxProps(){return{...L(this,"checkboxGroup").checkboxProps??{},...this.checkboxProps??{}}}_syncRenderedCheckboxes(){if(!this.source.length)return;let e=this._mergedCheckboxProps();for(let t of this._renderedCheckboxes??[])se(t,e)}_syncSlottedCheckboxes(){if(this.source.length>0)return;let e=this._getSlottedCheckboxes();for(let t of e){let r=t.value??"";t.checked=this._isChecked(r),this.disabled?(t.disabled||t.setAttribute("data-lui-checkbox-group-disabled",""),t.disabled=!0):t.hasAttribute("data-lui-checkbox-group-disabled")&&(t.removeAttribute("data-lui-checkbox-group-disabled"),t.disabled=!1),t.radius=this._effectiveRadius(),t.size=this.size,this.name&&(t.name=this.name)}}_effectiveRadius(e){return e||this.radius}_renderOption(e){let t={...this._mergedCheckboxProps(),checked:this._isChecked(e.value),indeterminate:!!(e.indeterminate&&!this._isChecked(e.value)),value:e.value,label:e.label,description:e.description??"",name:this.name??"",radius:this._effectiveRadius(e.radius),size:e.size??this.size,checkedIcon:e.checkedIcon??this.checkboxProps.checkedIcon??"check",indeterminateIcon:e.indeterminateIcon??this.checkboxProps.indeterminateIcon??"minus",disabled:this.disabled||(e.disabled??!1)};return Ao.html`
9774
+ `],a([(0,oi.property)({type:Boolean,reflect:!0})],go.prototype,"checked",2),a([(0,oi.property)({type:Boolean,reflect:!0})],go.prototype,"disabled",2),a([(0,oi.property)({reflect:!0})],go.prototype,"size",2),a([(0,oi.property)()],go.prototype,"name",2),a([(0,oi.property)()],go.prototype,"label",2),a([(0,oi.property)()],go.prototype,"locale",2),a([(0,oi.property)({attribute:!1})],go.prototype,"translations",2),a([(0,oi.query)("input")],go.prototype,"_input",2),go=a([(0,oi.customElement)("lui-switch")],go);var Po=require("lit"),Jr=require("lit/decorators.js");var Cr=class extends Po.LitElement{constructor(){super(...arguments);this.source=[];this.value=[];this.direction="horizontal";this.radius="md";this.size="md";this.disabled=!1;this.checkboxProps={};this._explicitAttrs=new Set;this._syncFrame=0;this._onSlottedChange=e=>{if(this.source.length>0)return;let t=e.target;!t||t.tagName.toLowerCase()!=="lui-checkbox"||this._toggle(t.value??"")}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._lightDomObserver=new MutationObserver(()=>this._scheduleSync()),this._lightDomObserver.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","disabled","checked","indeterminate","label","description","slot"]})}disconnectedCallback(){super.disconnectedCallback(),this._lightDomObserver?.disconnect(),this._syncFrame&&cancelAnimationFrame(this._syncFrame)}_isChecked(e){return this.value?.includes(e)??!1}_toggle(e){let t=this.value??[],r=t.includes(e)?t.filter(n=>n!==e):[...t,e];this.value=r,this.dispatchEvent(new CustomEvent("change",{detail:{value:r},bubbles:!0,composed:!0}))}firstUpdated(){this._scheduleSync()}willUpdate(){let e=L(this,"checkboxGroup");!this._explicitAttrs.has("direction")&&typeof e.direction=="string"&&this.direction!==e.direction&&(this.direction=e.direction),!this._explicitAttrs.has("radius")&&typeof e.radius=="string"&&this.radius!==e.radius&&(this.radius=e.radius),!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled)}updated(e){(e.has("value")||e.has("disabled")||e.has("radius")||e.has("size")||e.has("name")||e.has("source")||e.has("checkboxProps"))&&this._scheduleSync()}_scheduleSync(){this._syncFrame&&cancelAnimationFrame(this._syncFrame),this._syncFrame=requestAnimationFrame(()=>{this._syncFrame=0,this._syncSlottedCheckboxes(),this._syncRenderedCheckboxes()})}_getSlottedCheckboxes(){return this._slotEl?this._slotEl.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()==="lui-checkbox"):[]}_mergedCheckboxProps(){return{...L(this,"checkboxGroup").checkboxProps??{},...this.checkboxProps??{}}}_syncRenderedCheckboxes(){if(!this.source.length)return;let e=this._mergedCheckboxProps();for(let t of this._renderedCheckboxes??[])se(t,e)}_syncSlottedCheckboxes(){if(this.source.length>0)return;let e=this._getSlottedCheckboxes();for(let t of e){let r=t.value??"";t.checked=this._isChecked(r),this.disabled?(t.disabled||t.setAttribute("data-lui-checkbox-group-disabled",""),t.disabled=!0):t.hasAttribute("data-lui-checkbox-group-disabled")&&(t.removeAttribute("data-lui-checkbox-group-disabled"),t.disabled=!1),t.radius=this._effectiveRadius(),t.size=this.size,this.name&&(t.name=this.name)}}_effectiveRadius(e){return e||this.radius}_renderOption(e){let t={...this._mergedCheckboxProps(),checked:this._isChecked(e.value),indeterminate:!!(e.indeterminate&&!this._isChecked(e.value)),value:e.value,label:e.label,description:e.description??"",name:this.name??"",radius:this._effectiveRadius(e.radius),size:e.size??this.size,checkedIcon:e.checkedIcon??this.checkboxProps.checkedIcon??"check",indeterminateIcon:e.indeterminateIcon??this.checkboxProps.indeterminateIcon??"minus",disabled:this.disabled||(e.disabled??!1)};return Po.html`
9773
9775
  <lui-checkbox
9774
9776
  .checked=${t.checked}
9775
9777
  .indeterminate=${t.indeterminate}
@@ -9784,18 +9786,18 @@
9784
9786
  .disabled=${t.disabled}
9785
9787
  @change=${()=>this._toggle(e.value)}
9786
9788
  >
9787
- ${e.icon?Ao.html`<lui-icon slot="icon" name=${e.icon}></lui-icon>`:Ao.nothing}
9789
+ ${e.icon?Po.html`<lui-icon slot="icon" name=${e.icon}></lui-icon>`:Po.nothing}
9788
9790
  </lui-checkbox>
9789
- `}render(){let e=this.source.length>0;return Ao.html`
9790
- ${this.label?Ao.html`<div class="group-label">${this.label}</div>`:Ao.nothing}
9791
+ `}render(){let e=this.source.length>0;return Po.html`
9792
+ ${this.label?Po.html`<div class="group-label">${this.label}</div>`:Po.nothing}
9791
9793
  <div
9792
9794
  class="group ${this.direction==="vertical"?"vertical":""}"
9793
9795
  part="group"
9794
- @change=${e?Ao.nothing:this._onSlottedChange}
9796
+ @change=${e?Po.nothing:this._onSlottedChange}
9795
9797
  >
9796
- ${e?this.source.map(t=>this._renderOption(t)):Ao.html`<slot @slotchange=${this._scheduleSync}></slot>`}
9798
+ ${e?this.source.map(t=>this._renderOption(t)):Po.html`<slot @slotchange=${this._scheduleSync}></slot>`}
9797
9799
  </div>
9798
- `}};Cr.styles=[A,j,Ao.css`
9800
+ `}};Cr.styles=[A,j,Po.css`
9799
9801
  :host {
9800
9802
  display: block;
9801
9803
  }
@@ -10289,7 +10291,7 @@
10289
10291
  }
10290
10292
  :host([size="sm"]) .value { font-size: var(--lui-font-size-xs); }
10291
10293
  :host([size="lg"]) .value { font-size: var(--lui-font-size); }
10292
- `],a([(0,At.property)({attribute:!1})],ut.prototype,"value",2),a([(0,At.property)({type:Number})],ut.prototype,"min",2),a([(0,At.property)({type:Number})],ut.prototype,"max",2),a([(0,At.property)({type:Number})],ut.prototype,"step",2),a([(0,At.property)({type:Boolean,reflect:!0})],ut.prototype,"disabled",2),a([(0,At.property)({reflect:!0})],ut.prototype,"size",2),a([(0,At.property)()],ut.prototype,"name",2),a([(0,At.property)({type:Boolean})],ut.prototype,"showValue",2),a([(0,At.property)()],ut.prototype,"track",2),a([(0,At.property)({attribute:!1})],ut.prototype,"marks",2),a([(0,At.property)({type:Boolean,attribute:"snap-to-marks"})],ut.prototype,"snapToMarks",2),a([(0,At.property)({type:Boolean,reflect:!0})],ut.prototype,"range",2),a([(0,At.property)({attribute:!1})],ut.prototype,"rangeValue",2),a([(0,At.property)({attribute:"value-label-display"})],ut.prototype,"valueLabelDisplay",2),a([(0,At.property)()],ut.prototype,"valuePrefix",2),a([(0,At.property)()],ut.prototype,"valueSuffix",2),a([(0,At.state)()],ut.prototype,"_hovered",2),a([(0,At.state)()],ut.prototype,"_focusedThumb",2),a([(0,At.state)()],ut.prototype,"_draggingThumb",2),ut=a([(0,At.customElement)("lui-slider")],ut);var _i=require("lit"),Ti=require("lit/decorators.js");var Po=class extends _i.LitElement{constructor(){super(...arguments);this.disabled=!1;this.size="md";this.multiple=!1;this.files=[];this.placeholder="\u70B9\u51FB\u6216\u62D6\u62FD\u4E0A\u4F20"}render(){let e=this.files.length>0,t=["dropzone"];return this.disabled&&t.push("disabled"),e&&t.push("has-files"),_i.html`
10294
+ `],a([(0,At.property)({attribute:!1})],ut.prototype,"value",2),a([(0,At.property)({type:Number})],ut.prototype,"min",2),a([(0,At.property)({type:Number})],ut.prototype,"max",2),a([(0,At.property)({type:Number})],ut.prototype,"step",2),a([(0,At.property)({type:Boolean,reflect:!0})],ut.prototype,"disabled",2),a([(0,At.property)({reflect:!0})],ut.prototype,"size",2),a([(0,At.property)()],ut.prototype,"name",2),a([(0,At.property)({type:Boolean})],ut.prototype,"showValue",2),a([(0,At.property)()],ut.prototype,"track",2),a([(0,At.property)({attribute:!1})],ut.prototype,"marks",2),a([(0,At.property)({type:Boolean,attribute:"snap-to-marks"})],ut.prototype,"snapToMarks",2),a([(0,At.property)({type:Boolean,reflect:!0})],ut.prototype,"range",2),a([(0,At.property)({attribute:!1})],ut.prototype,"rangeValue",2),a([(0,At.property)({attribute:"value-label-display"})],ut.prototype,"valueLabelDisplay",2),a([(0,At.property)()],ut.prototype,"valuePrefix",2),a([(0,At.property)()],ut.prototype,"valueSuffix",2),a([(0,At.state)()],ut.prototype,"_hovered",2),a([(0,At.state)()],ut.prototype,"_focusedThumb",2),a([(0,At.state)()],ut.prototype,"_draggingThumb",2),ut=a([(0,At.customElement)("lui-slider")],ut);var _i=require("lit"),Ti=require("lit/decorators.js");var jo=class extends _i.LitElement{constructor(){super(...arguments);this.disabled=!1;this.size="md";this.multiple=!1;this.files=[];this.placeholder="\u70B9\u51FB\u6216\u62D6\u62FD\u4E0A\u4F20"}render(){let e=this.files.length>0,t=["dropzone"];return this.disabled&&t.push("disabled"),e&&t.push("has-files"),_i.html`
10293
10295
  <div
10294
10296
  class=${t.join(" ")}
10295
10297
  @click=${()=>!this.disabled&&this._inputEl?.click()}
@@ -10318,7 +10320,7 @@
10318
10320
  ?disabled=${this.disabled}
10319
10321
  @change=${this._onFileChange}
10320
10322
  />
10321
- `}get _inputEl(){return this.renderRoot?.querySelector('input[type="file"]')}_onFileChange(e){e.stopPropagation();let t=e.target;this.files=Array.from(t.files??[]),this.dispatchEvent(new CustomEvent("change",{detail:{files:this.files},bubbles:!0,composed:!0}))}_onDrop(e){e.preventDefault(),!this.disabled&&(this.files=Array.from(e.dataTransfer?.files??[]),this.dispatchEvent(new CustomEvent("change",{detail:{files:this.files},bubbles:!0,composed:!0})))}_formatSize(e){return e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/(1024*1024)).toFixed(1)+" MB"}};Po.styles=[A,j,_i.css`
10323
+ `}get _inputEl(){return this.renderRoot?.querySelector('input[type="file"]')}_onFileChange(e){e.stopPropagation();let t=e.target;this.files=Array.from(t.files??[]),this.dispatchEvent(new CustomEvent("change",{detail:{files:this.files},bubbles:!0,composed:!0}))}_onDrop(e){e.preventDefault(),!this.disabled&&(this.files=Array.from(e.dataTransfer?.files??[]),this.dispatchEvent(new CustomEvent("change",{detail:{files:this.files},bubbles:!0,composed:!0})))}_formatSize(e){return e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/(1024*1024)).toFixed(1)+" MB"}};jo.styles=[A,j,_i.css`
10322
10324
  :host {
10323
10325
  display: block;
10324
10326
  width: 100%;
@@ -10406,7 +10408,7 @@
10406
10408
  input[type="file"] {
10407
10409
  display: none;
10408
10410
  }
10409
- `],a([(0,Ti.property)({type:Boolean,reflect:!0})],Po.prototype,"disabled",2),a([(0,Ti.property)({reflect:!0})],Po.prototype,"size",2),a([(0,Ti.property)()],Po.prototype,"accept",2),a([(0,Ti.property)({type:Boolean})],Po.prototype,"multiple",2),a([(0,Ti.property)()],Po.prototype,"name",2),a([(0,Ti.property)({attribute:!1})],Po.prototype,"files",2),a([(0,Ti.property)()],Po.prototype,"placeholder",2),Po=a([(0,Ti.customElement)("lui-file-input")],Po);var Ai=require("lit"),jo=require("lit/decorators.js");var Ir=class extends Ai.LitElement{constructor(){super(...arguments);this.value="";this.length=6;this.size="md";this.disabled=!1;this.readonly=!1;this.invalid=!1;this.type="number";this.format=""}focus(){this._cells?.[0]?.focus()}blur(){this._cells?.forEach(e=>e.blur())}_charCount(){return this.format?(this.format.match(/#/g)||[]).length:this.length}_chars(){let e=this._charCount(),t=this.value||"",r=[];for(let n=0;n<e;n++)r.push(n<t.length?t[n]:"");return r}_emit(){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}));let e=this._charCount();this.value.length===e&&this.dispatchEvent(new CustomEvent("complete",{detail:{value:this.value},bubbles:!0,composed:!0}))}_onInput(e,t){e.stopPropagation();let r=e.target,n=r.value;if(this.type==="number"&&n&&!/^\d$/.test(n)){r.value="";return}let s=this._chars();if(n.length>1){let d=n[n.length-1];s[t]=d,r.value=d}else s[t]=n;this.value=s.join(""),n&&t<this._charCount()-1&&this._cells[t+1]?.focus(),this._emit()}_onKeyDown(e,t){if(this.readonly)return;let r=e.target,n=this._charCount();if(e.key==="Backspace"&&!r.value&&t>0){let s=this._cells[t-1];s.focus(),s.value="";let d=this._chars();d[t-1]="",this.value=d.join(""),this._emit()}else if(e.key==="ArrowLeft"&&t>0)this._cells[t-1]?.focus();else if(e.key==="ArrowRight"&&t<n-1)this._cells[t+1]?.focus();else if(e.key==="Delete"){let s=this._chars();s[t]="",this.value=s.join(""),this._emit()}}_onFocus(e){if(this.readonly)return;e.target.select()}_onPaste(e,t){if(e.preventDefault(),this.disabled||this.readonly)return;let r=e.clipboardData?.getData("text")?.trim()??"";if(!r)return;let n=this.type==="number"?r.replace(/\D/g,""):r;if(!n)return;let s=this._chars(),d=this._charCount();for(let p=0;p<n.length&&t+p<d;p++)s[t+p]=n[p];this.value=s.join("");let h=Math.min(t+n.length,d-1);this._cells[h]?.focus(),this._emit()}render(){let e=this._chars();if(this.format){let t=0,r=[];for(let n=0;n<this.format.length;n++)if(this.format[n]==="#"){let s=t,d=e[s];r.push(Ai.html`
10411
+ `],a([(0,Ti.property)({type:Boolean,reflect:!0})],jo.prototype,"disabled",2),a([(0,Ti.property)({reflect:!0})],jo.prototype,"size",2),a([(0,Ti.property)()],jo.prototype,"accept",2),a([(0,Ti.property)({type:Boolean})],jo.prototype,"multiple",2),a([(0,Ti.property)()],jo.prototype,"name",2),a([(0,Ti.property)({attribute:!1})],jo.prototype,"files",2),a([(0,Ti.property)()],jo.prototype,"placeholder",2),jo=a([(0,Ti.customElement)("lui-file-input")],jo);var Ai=require("lit"),Oo=require("lit/decorators.js");var Ir=class extends Ai.LitElement{constructor(){super(...arguments);this.value="";this.length=6;this.size="md";this.disabled=!1;this.readonly=!1;this.invalid=!1;this.type="number";this.format=""}focus(){this._cells?.[0]?.focus()}blur(){this._cells?.forEach(e=>e.blur())}_charCount(){return this.format?(this.format.match(/#/g)||[]).length:this.length}_chars(){let e=this._charCount(),t=this.value||"",r=[];for(let n=0;n<e;n++)r.push(n<t.length?t[n]:"");return r}_emit(){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}));let e=this._charCount();this.value.length===e&&this.dispatchEvent(new CustomEvent("complete",{detail:{value:this.value},bubbles:!0,composed:!0}))}_onInput(e,t){e.stopPropagation();let r=e.target,n=r.value;if(this.type==="number"&&n&&!/^\d$/.test(n)){r.value="";return}let s=this._chars();if(n.length>1){let d=n[n.length-1];s[t]=d,r.value=d}else s[t]=n;this.value=s.join(""),n&&t<this._charCount()-1&&this._cells[t+1]?.focus(),this._emit()}_onKeyDown(e,t){if(this.readonly)return;let r=e.target,n=this._charCount();if(e.key==="Backspace"&&!r.value&&t>0){let s=this._cells[t-1];s.focus(),s.value="";let d=this._chars();d[t-1]="",this.value=d.join(""),this._emit()}else if(e.key==="ArrowLeft"&&t>0)this._cells[t-1]?.focus();else if(e.key==="ArrowRight"&&t<n-1)this._cells[t+1]?.focus();else if(e.key==="Delete"){let s=this._chars();s[t]="",this.value=s.join(""),this._emit()}}_onFocus(e){if(this.readonly)return;e.target.select()}_onPaste(e,t){if(e.preventDefault(),this.disabled||this.readonly)return;let r=e.clipboardData?.getData("text")?.trim()??"";if(!r)return;let n=this.type==="number"?r.replace(/\D/g,""):r;if(!n)return;let s=this._chars(),d=this._charCount();for(let p=0;p<n.length&&t+p<d;p++)s[t+p]=n[p];this.value=s.join("");let h=Math.min(t+n.length,d-1);this._cells[h]?.focus(),this._emit()}render(){let e=this._chars();if(this.format){let t=0,r=[];for(let n=0;n<this.format.length;n++)if(this.format[n]==="#"){let s=t,d=e[s];r.push(Ai.html`
10410
10412
  <input
10411
10413
  class=${`otp-cell${d?" filled":""}${this.invalid?" invalid":""}`}
10412
10414
  .value=${d}
@@ -10518,7 +10520,7 @@
10518
10520
  :host([size="lg"]) .separator {
10519
10521
  font-size: var(--lui-font-size-xl);
10520
10522
  }
10521
- `],a([(0,jo.property)()],Ir.prototype,"value",2),a([(0,jo.property)({type:Number})],Ir.prototype,"length",2),a([(0,jo.property)({reflect:!0})],Ir.prototype,"size",2),a([(0,jo.property)({type:Boolean})],Ir.prototype,"disabled",2),a([(0,jo.property)({type:Boolean})],Ir.prototype,"readonly",2),a([(0,jo.property)({type:Boolean,reflect:!0})],Ir.prototype,"invalid",2),a([(0,jo.property)()],Ir.prototype,"type",2),a([(0,jo.property)()],Ir.prototype,"name",2),a([(0,jo.property)()],Ir.prototype,"format",2),a([(0,jo.queryAll)(".otp-cell")],Ir.prototype,"_cells",2),Ir=a([(0,jo.customElement)("lui-input-opt")],Ir);var vo=require("lit"),Er=require("lit/decorators.js");var Nt=class extends vo.LitElement{constructor(){super(...arguments);this.placeholder="";this.size="md";this.controls="split";this.disabled=!1;this.readonly=!1;this.invalid=!1;this.noborder=!1;this.step=1;this.prefix="";this.suffix="";this._focused=!1;this._explicitAttrs=new Set;this._draftValue=null;this._onWheel=e=>{!this._focused||this.disabled||this.readonly||e.deltaY!==0&&(e.preventDefault(),this._stepBy(e.deltaY<0?this.step:-this.step))}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(){let e=L(this,"inputNumber");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("controls")&&typeof e.controls=="string"&&this.controls!==e.controls&&(this.controls=e.controls),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("noborder")&&typeof e.noborder=="boolean"&&this.noborder!==e.noborder&&(this.noborder=e.noborder),!this._explicitAttrs.has("placeholder")&&typeof e.placeholder=="string"&&!this.placeholder&&(this.placeholder=e.placeholder)}focus(){this.shadowRoot?.querySelector("input")?.focus()}_clamp(e){if(this.precision!=null){let t=Math.pow(10,this.precision);e=Math.round(e*t)/t}return this.min!=null&&e<this.min&&(e=this.min),this.max!=null&&e>this.max&&(e=this.max),e}_canDec(){return this.disabled||this.readonly?!1:this.min==null?!0:(this.value??0)-this.step>=this.min}_canInc(){return this.disabled||this.readonly?!1:this.max==null?!0:(this.value??0)+this.step<=this.max}_emit(e){this.value=e,this._focused&&(this._draftValue=e!=null?String(e):""),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}_stepBy(e){let t=this.value??0;this._emit(this._clamp(t+e))}_onInput(e){e.stopPropagation();let r=e.target.value.trim();if(this._draftValue=r,r===""||r==="-"||r==="."||r==="-."){this._emit(void 0);return}let n=Number(r);isNaN(n)||(this.value=this._clamp(n),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))),this.requestUpdate()}_onBlur(e){this._focused=!1;let t=e.target,r=t.value.trim();if(r===""||r==="-"||r==="."||r==="-.")this.value=void 0;else{let n=Number(r);isNaN(n)||(this.value=this._clamp(n))}this._draftValue=null,this.value!=null?t.value=String(this.value):t.value="",this.requestUpdate()}render(){let e=["wrapper"];this._focused&&e.push("focused"),this.disabled&&e.push("disabled"),this.invalid&&e.push("invalid");let t=this._focused&&this._draftValue!=null?this._draftValue:this.value!=null?String(this.value):"",r=vo.html`
10523
+ `],a([(0,Oo.property)()],Ir.prototype,"value",2),a([(0,Oo.property)({type:Number})],Ir.prototype,"length",2),a([(0,Oo.property)({reflect:!0})],Ir.prototype,"size",2),a([(0,Oo.property)({type:Boolean})],Ir.prototype,"disabled",2),a([(0,Oo.property)({type:Boolean})],Ir.prototype,"readonly",2),a([(0,Oo.property)({type:Boolean,reflect:!0})],Ir.prototype,"invalid",2),a([(0,Oo.property)()],Ir.prototype,"type",2),a([(0,Oo.property)()],Ir.prototype,"name",2),a([(0,Oo.property)()],Ir.prototype,"format",2),a([(0,Oo.queryAll)(".otp-cell")],Ir.prototype,"_cells",2),Ir=a([(0,Oo.customElement)("lui-input-opt")],Ir);var vo=require("lit"),Er=require("lit/decorators.js");var Nt=class extends vo.LitElement{constructor(){super(...arguments);this.placeholder="";this.size="md";this.controls="split";this.disabled=!1;this.readonly=!1;this.invalid=!1;this.noborder=!1;this.step=1;this.prefix="";this.suffix="";this._focused=!1;this._explicitAttrs=new Set;this._draftValue=null;this._onWheel=e=>{!this._focused||this.disabled||this.readonly||e.deltaY!==0&&(e.preventDefault(),this._stepBy(e.deltaY<0?this.step:-this.step))}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(){let e=L(this,"inputNumber");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("controls")&&typeof e.controls=="string"&&this.controls!==e.controls&&(this.controls=e.controls),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("noborder")&&typeof e.noborder=="boolean"&&this.noborder!==e.noborder&&(this.noborder=e.noborder),!this._explicitAttrs.has("placeholder")&&typeof e.placeholder=="string"&&!this.placeholder&&(this.placeholder=e.placeholder)}focus(){this.shadowRoot?.querySelector("input")?.focus()}_clamp(e){if(this.precision!=null){let t=Math.pow(10,this.precision);e=Math.round(e*t)/t}return this.min!=null&&e<this.min&&(e=this.min),this.max!=null&&e>this.max&&(e=this.max),e}_canDec(){return this.disabled||this.readonly?!1:this.min==null?!0:(this.value??0)-this.step>=this.min}_canInc(){return this.disabled||this.readonly?!1:this.max==null?!0:(this.value??0)+this.step<=this.max}_emit(e){this.value=e,this._focused&&(this._draftValue=e!=null?String(e):""),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}_stepBy(e){let t=this.value??0;this._emit(this._clamp(t+e))}_onInput(e){e.stopPropagation();let r=e.target.value.trim();if(this._draftValue=r,r===""||r==="-"||r==="."||r==="-."){this._emit(void 0);return}let n=Number(r);isNaN(n)||(this.value=this._clamp(n),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))),this.requestUpdate()}_onBlur(e){this._focused=!1;let t=e.target,r=t.value.trim();if(r===""||r==="-"||r==="."||r==="-.")this.value=void 0;else{let n=Number(r);isNaN(n)||(this.value=this._clamp(n))}this._draftValue=null,this.value!=null?t.value=String(this.value):t.value="",this.requestUpdate()}render(){let e=["wrapper"];this._focused&&e.push("focused"),this.disabled&&e.push("disabled"),this.invalid&&e.push("invalid");let t=this._focused&&this._draftValue!=null?this._draftValue:this.value!=null?String(this.value):"",r=vo.html`
10522
10524
  <input
10523
10525
  part="input"
10524
10526
  .value=${t}
@@ -10857,7 +10859,7 @@
10857
10859
  :is(${de}) ${ue} .numInputWrapper span.arrowDown::after {
10858
10860
  border-top-color: var(--lui-color-fg-muted, #9da2a6);
10859
10861
  }
10860
- `,Dp=new WeakSet;function Fp(i){if(Dp.has(i))return;let o=i.createElement("style");o.setAttribute("data-lui-datepicker-dark-styles",""),o.textContent=Eg,i.head.appendChild(o),Dp.add(i)}var _t=class extends bn.LitElement{constructor(){super(...arguments);this.value="";this.selectionMode="single";this.placeholder="";this.size="md";this.mode="date";this.disabled=!1;this.readonly=!1;this.invalid=!1;this.clearable=!0;this._fp=null;this._focused=!1;this._closing=!1;this._overlayLayerEl=null}connectedCallback(){super.connectedCallback(),this._disposeLocaleChange=xe(()=>this.requestUpdate())}disconnectedCallback(){this._destroy(),this._disposeLocaleChange?.(),super.disconnectedCallback()}_t(e,t){return ae(ne(this.locale,this.translations),e,t)}updated(e){if(e.has("value")&&this._fp){let t=this.value||"",r=this._fp.input.value;t!==r&&this._fp.setDate(t,!1)}}focus(){this._inputEl?.focus()}_destroy(){let e=this._fp?.calendarContainer;e&&Yo(e),this._fp?.destroy(),this._fp=null,this._overlayLayerEl=null,this._closing=!1}get _resolvedMode(){return this.type||this.mode||"date"}get _isRange(){return this.selectionMode==="range"}_openPicker(){if(this.disabled||this.readonly||this._fp)return;let e=Ar("popup",sn(this)??ln(this));this._overlayLayerEl=e;let t={locale:Lp.Mandarin,dateFormat:this._getFormat(),allowInput:!0,clickOpens:!1,time_24hr:!0,mode:this._isRange?"range":"single",conjunction:" ~ ",appendTo:e,positionElement:this._wrapperEl,minDate:this.min||void 0,maxDate:this.max||void 0,defaultDate:this.value||void 0,onChange:(r,n)=>{this.value=n,this._emitChange()},onOpen:()=>{let r=this._fp?.calendarContainer;r?.classList.add("lui-datepicker-calendar"),r&&this._overlayLayerEl&&(Jt(r,this._overlayLayerEl,"popup"),Et(r)),this._focused=!0,this.requestUpdate()},onClose:()=>{this._focused=!1,this._closing=!0,this.requestUpdate(),requestAnimationFrame(()=>this._destroy())}};this._resolvedMode==="time"?(t.enableTime=!0,t.noCalendar=!0):this._resolvedMode==="datetime"&&(t.enableTime=!0),Fp(this.ownerDocument),this._fp=(0,Np.default)(this._inputEl,t),this._fp.open()}_getFormat(){return this._resolvedMode==="time"?"H:i":this._resolvedMode==="datetime"?"Y-m-d H:i":"Y-m-d"}_getIcon(){return this._resolvedMode==="time"?"clock":"calendar"}_emitChange(){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,values:this._isRange?this.value.split(" ~ ").map(e=>e.trim()).filter(Boolean):this.value?[this.value]:[]},bubbles:!0,composed:!0}))}_clear(e){e.stopPropagation(),this.value="",this._emitChange()}render(){let e=["control-shell","wrapper"];this._focused&&e.push("focused"),this.disabled&&e.push("disabled"),this.invalid&&e.push("invalid");let t=this.clearable&&this.value&&!this.disabled&&!this.readonly;return bn.html`
10862
+ `,Dp=new WeakSet;function Fp(i){if(Dp.has(i))return;let o=i.createElement("style");o.setAttribute("data-lui-datepicker-dark-styles",""),o.textContent=Eg,i.head.appendChild(o),Dp.add(i)}var _t=class extends bn.LitElement{constructor(){super(...arguments);this.value="";this.selectionMode="single";this.placeholder="";this.size="md";this.mode="date";this.disabled=!1;this.readonly=!1;this.invalid=!1;this.clearable=!0;this._fp=null;this._focused=!1;this._closing=!1;this._overlayLayerEl=null}connectedCallback(){super.connectedCallback(),this._disposeLocaleChange=xe(()=>this.requestUpdate())}disconnectedCallback(){this._destroy(),this._disposeLocaleChange?.(),super.disconnectedCallback()}_t(e,t){return ae(ne(this.locale,this.translations),e,t)}updated(e){if(e.has("value")&&this._fp){let t=this.value||"",r=this._fp.input.value;t!==r&&this._fp.setDate(t,!1)}}focus(){this._inputEl?.focus()}_destroy(){let e=this._fp?.calendarContainer;e&&Xo(e),this._fp?.destroy(),this._fp=null,this._overlayLayerEl=null,this._closing=!1}get _resolvedMode(){return this.type||this.mode||"date"}get _isRange(){return this.selectionMode==="range"}_openPicker(){if(this.disabled||this.readonly||this._fp)return;let e=Ar("popup",sn(this)??ln(this));this._overlayLayerEl=e;let t={locale:Lp.Mandarin,dateFormat:this._getFormat(),allowInput:!0,clickOpens:!1,time_24hr:!0,mode:this._isRange?"range":"single",conjunction:" ~ ",appendTo:e,positionElement:this._wrapperEl,minDate:this.min||void 0,maxDate:this.max||void 0,defaultDate:this.value||void 0,onChange:(r,n)=>{this.value=n,this._emitChange()},onOpen:()=>{let r=this._fp?.calendarContainer;r?.classList.add("lui-datepicker-calendar"),r&&this._overlayLayerEl&&(Jt(r,this._overlayLayerEl,"popup"),Et(r)),this._focused=!0,this.requestUpdate()},onClose:()=>{this._focused=!1,this._closing=!0,this.requestUpdate(),requestAnimationFrame(()=>this._destroy())}};this._resolvedMode==="time"?(t.enableTime=!0,t.noCalendar=!0):this._resolvedMode==="datetime"&&(t.enableTime=!0),Fp(this.ownerDocument),this._fp=(0,Np.default)(this._inputEl,t),this._fp.open()}_getFormat(){return this._resolvedMode==="time"?"H:i":this._resolvedMode==="datetime"?"Y-m-d H:i":"Y-m-d"}_getIcon(){return this._resolvedMode==="time"?"clock":"calendar"}_emitChange(){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,values:this._isRange?this.value.split(" ~ ").map(e=>e.trim()).filter(Boolean):this.value?[this.value]:[]},bubbles:!0,composed:!0}))}_clear(e){e.stopPropagation(),this.value="",this._emitChange()}render(){let e=["control-shell","wrapper"];this._focused&&e.push("focused"),this.disabled&&e.push("disabled"),this.invalid&&e.push("invalid");let t=this.clearable&&this.value&&!this.disabled&&!this.readonly;return bn.html`
10861
10863
  <div class=${e.join(" ")}>
10862
10864
  <lui-icon name=${this._getIcon()} style="--lui-icon-size:16px;color:var(--lui-color-fg-muted);flex-shrink:0"></lui-icon>
10863
10865
  <input
@@ -12160,7 +12162,7 @@
12160
12162
  color: var(--lui-color-fg-muted);
12161
12163
  margin-top: 2px;
12162
12164
  }
12163
- `],Lt.FORM_KEYS=new Set(["name","type","label","required","disabled","readonly","hidden","condition","span","xs","sm","md","lg","xl","offset","order","validators","fields","size","labelPlacement","labelWidth","defaultValue","description","min","max","step","length","source","renderControl","renderField","props","addLabel","removeLabel","itemLabel","minItems","maxItems","collapsible","defaultCollapsed","draggable","hiddenLabel","help","tooltip","extra","validateTrigger","onClick"]),Lt._elEvents=new WeakMap,a([(0,Ko.property)({attribute:!1})],Lt.prototype,"schema",2),a([(0,Ko.property)({type:Boolean,attribute:"show-actions"})],Lt.prototype,"showActions",2),a([(0,Ko.property)({reflect:!0})],Lt.prototype,"size",2),a([(0,Ko.property)({reflect:!0,attribute:"label-placement"})],Lt.prototype,"labelPlacement",2),a([(0,Ko.property)({attribute:"label-width"})],Lt.prototype,"labelWidth",2),a([(0,Ko.state)()],Lt.prototype,"_currentStep",2),a([(0,Ko.state)()],Lt.prototype,"_isStepPending",2),a([(0,Ko.state)()],Lt.prototype,"_submitErrorMessages",2),a([(0,Ko.state)()],Lt.prototype,"_submitSuccessMessage",2),Lt=a([(0,Ko.customElement)("lui-form")],Lt);var Oo=require("lit"),bo=require("lit/decorators.js");var Dr=class extends Oo.LitElement{constructor(){super(...arguments);this.source=[];this.direction="horizontal";this.size="md";this.disabled=!1;this.radioProps={};this._explicitAttrs=new Set;this._syncFrame=0;this._onSlottedChange=e=>{if(this.source.length>0)return;let t=e.target;!t||t.tagName.toLowerCase()!=="lui-radio"||this._select(t.value??"")}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._lightDomObserver=new MutationObserver(()=>this._scheduleSync()),this._lightDomObserver.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","disabled","checked","label","description","slot"]})}disconnectedCallback(){super.disconnectedCallback(),this._lightDomObserver?.disconnect(),this._syncFrame&&cancelAnimationFrame(this._syncFrame)}firstUpdated(){this._scheduleSync()}willUpdate(){let e=L(this,"radioGroup");!this._explicitAttrs.has("direction")&&typeof e.direction=="string"&&this.direction!==e.direction&&(this.direction=e.direction),!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled)}updated(e){(e.has("value")||e.has("disabled")||e.has("size")||e.has("name")||e.has("source")||e.has("radioProps"))&&this._scheduleSync()}_scheduleSync(){this._syncFrame&&cancelAnimationFrame(this._syncFrame),this._syncFrame=requestAnimationFrame(()=>{this._syncFrame=0,this._syncSlottedRadios(),this._syncRenderedRadios()})}_getSlottedRadios(){return this._slotEl?this._slotEl.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()==="lui-radio"):[]}_mergedRadioProps(){return{...L(this,"radioGroup").radioProps??{},...this.radioProps??{}}}_syncRenderedRadios(){if(!this.source.length)return;let e=this._mergedRadioProps();for(let t of this._renderedRadios??[])se(t,e)}_syncSlottedRadios(){if(this.source.length>0)return;let e=this._getSlottedRadios();for(let t of e){let r=t.value??"";t.checked=r===(this.value??""),this.disabled?(t.disabled||t.setAttribute("data-lui-radio-group-disabled",""),t.disabled=!0):t.hasAttribute("data-lui-radio-group-disabled")&&(t.removeAttribute("data-lui-radio-group-disabled"),t.disabled=!1),t.size=this.size,this.name&&(t.name=this.name)}}_select(e){this.value!==e&&(this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0})))}_renderOption(e){let t={...this._mergedRadioProps(),checked:e.value===(this.value??""),value:e.value,label:e.label,description:e.description??"",name:this.name??"",size:e.size??this.size,checkedIcon:e.checkedIcon??this.radioProps.checkedIcon??"",disabled:this.disabled||(e.disabled??!1)};return Oo.html`
12165
+ `],Lt.FORM_KEYS=new Set(["name","type","label","required","disabled","readonly","hidden","condition","span","xs","sm","md","lg","xl","offset","order","validators","fields","size","labelPlacement","labelWidth","defaultValue","description","min","max","step","length","source","renderControl","renderField","props","addLabel","removeLabel","itemLabel","minItems","maxItems","collapsible","defaultCollapsed","draggable","hiddenLabel","help","tooltip","extra","validateTrigger","onClick"]),Lt._elEvents=new WeakMap,a([(0,Wo.property)({attribute:!1})],Lt.prototype,"schema",2),a([(0,Wo.property)({type:Boolean,attribute:"show-actions"})],Lt.prototype,"showActions",2),a([(0,Wo.property)({reflect:!0})],Lt.prototype,"size",2),a([(0,Wo.property)({reflect:!0,attribute:"label-placement"})],Lt.prototype,"labelPlacement",2),a([(0,Wo.property)({attribute:"label-width"})],Lt.prototype,"labelWidth",2),a([(0,Wo.state)()],Lt.prototype,"_currentStep",2),a([(0,Wo.state)()],Lt.prototype,"_isStepPending",2),a([(0,Wo.state)()],Lt.prototype,"_submitErrorMessages",2),a([(0,Wo.state)()],Lt.prototype,"_submitSuccessMessage",2),Lt=a([(0,Wo.customElement)("lui-form")],Lt);var Ho=require("lit"),bo=require("lit/decorators.js");var Dr=class extends Ho.LitElement{constructor(){super(...arguments);this.source=[];this.direction="horizontal";this.size="md";this.disabled=!1;this.radioProps={};this._explicitAttrs=new Set;this._syncFrame=0;this._onSlottedChange=e=>{if(this.source.length>0)return;let t=e.target;!t||t.tagName.toLowerCase()!=="lui-radio"||this._select(t.value??"")}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._lightDomObserver=new MutationObserver(()=>this._scheduleSync()),this._lightDomObserver.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","disabled","checked","label","description","slot"]})}disconnectedCallback(){super.disconnectedCallback(),this._lightDomObserver?.disconnect(),this._syncFrame&&cancelAnimationFrame(this._syncFrame)}firstUpdated(){this._scheduleSync()}willUpdate(){let e=L(this,"radioGroup");!this._explicitAttrs.has("direction")&&typeof e.direction=="string"&&this.direction!==e.direction&&(this.direction=e.direction),!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled)}updated(e){(e.has("value")||e.has("disabled")||e.has("size")||e.has("name")||e.has("source")||e.has("radioProps"))&&this._scheduleSync()}_scheduleSync(){this._syncFrame&&cancelAnimationFrame(this._syncFrame),this._syncFrame=requestAnimationFrame(()=>{this._syncFrame=0,this._syncSlottedRadios(),this._syncRenderedRadios()})}_getSlottedRadios(){return this._slotEl?this._slotEl.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()==="lui-radio"):[]}_mergedRadioProps(){return{...L(this,"radioGroup").radioProps??{},...this.radioProps??{}}}_syncRenderedRadios(){if(!this.source.length)return;let e=this._mergedRadioProps();for(let t of this._renderedRadios??[])se(t,e)}_syncSlottedRadios(){if(this.source.length>0)return;let e=this._getSlottedRadios();for(let t of e){let r=t.value??"";t.checked=r===(this.value??""),this.disabled?(t.disabled||t.setAttribute("data-lui-radio-group-disabled",""),t.disabled=!0):t.hasAttribute("data-lui-radio-group-disabled")&&(t.removeAttribute("data-lui-radio-group-disabled"),t.disabled=!1),t.size=this.size,this.name&&(t.name=this.name)}}_select(e){this.value!==e&&(this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0})))}_renderOption(e){let t={...this._mergedRadioProps(),checked:e.value===(this.value??""),value:e.value,label:e.label,description:e.description??"",name:this.name??"",size:e.size??this.size,checkedIcon:e.checkedIcon??this.radioProps.checkedIcon??"",disabled:this.disabled||(e.disabled??!1)};return Ho.html`
12164
12166
  <lui-radio
12165
12167
  .checked=${t.checked}
12166
12168
  .value=${t.value}
@@ -12172,18 +12174,18 @@
12172
12174
  .disabled=${t.disabled}
12173
12175
  @change=${()=>this._select(e.value)}
12174
12176
  >
12175
- ${e.icon?Oo.html`<lui-icon slot="icon" name=${e.icon}></lui-icon>`:Oo.nothing}
12177
+ ${e.icon?Ho.html`<lui-icon slot="icon" name=${e.icon}></lui-icon>`:Ho.nothing}
12176
12178
  </lui-radio>
12177
- `}render(){let e=this.source.length>0;return Oo.html`
12178
- ${this.label?Oo.html`<div class="group-label">${this.label}</div>`:Oo.nothing}
12179
+ `}render(){let e=this.source.length>0;return Ho.html`
12180
+ ${this.label?Ho.html`<div class="group-label">${this.label}</div>`:Ho.nothing}
12179
12181
  <div
12180
12182
  class="group ${this.direction==="vertical"?"vertical":""}"
12181
12183
  part="group"
12182
- @change=${e?Oo.nothing:this._onSlottedChange}
12184
+ @change=${e?Ho.nothing:this._onSlottedChange}
12183
12185
  >
12184
- ${e?this.source.map(t=>this._renderOption(t)):Oo.html`<slot @slotchange=${this._scheduleSync}></slot>`}
12186
+ ${e?this.source.map(t=>this._renderOption(t)):Ho.html`<slot @slotchange=${this._scheduleSync}></slot>`}
12185
12187
  </div>
12186
- `}};Dr.styles=[A,j,Oo.css`
12188
+ `}};Dr.styles=[A,j,Ho.css`
12187
12189
  :host {
12188
12190
  display: block;
12189
12191
  }
@@ -12508,7 +12510,7 @@
12508
12510
  .host .numInputWrapper span.arrowDown:after {
12509
12511
  border-top-color: var(--lui-color-fg-muted);
12510
12512
  }
12511
- `],a([(0,Bt.property)()],Fr.prototype,"value",2),a([(0,Bt.property)({attribute:"selection-mode",reflect:!0})],Fr.prototype,"selectionMode",2),a([(0,Bt.property)({reflect:!0})],Fr.prototype,"size",2),a([(0,Bt.property)()],Fr.prototype,"min",2),a([(0,Bt.property)()],Fr.prototype,"max",2),a([(0,Bt.property)({type:Boolean})],Fr.prototype,"disabled",2),a([(0,Bt.property)({type:Number,attribute:"show-months"})],Fr.prototype,"showMonths",2),a([(0,Bt.property)({attribute:"default-date"})],Fr.prototype,"defaultDate",2),a([(0,Bt.query)(".input")],Fr.prototype,"_inputEl",2),a([(0,Bt.query)(".host")],Fr.prototype,"_hostEl",2),Fr=a([(0,Bt.customElement)("lui-calendar")],Fr);var Ho=class extends Xi.LitElement{constructor(){super(...arguments);this.value="";this.placeholder="\u9009\u62E9\u65E5\u671F\u8303\u56F4";this.size="md";this.disabled=!1;this.clearable=!0;this._onChange=e=>{let t=e.detail;this.value=t.value,this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))}}render(){return Xi.html`
12513
+ `],a([(0,Bt.property)()],Fr.prototype,"value",2),a([(0,Bt.property)({attribute:"selection-mode",reflect:!0})],Fr.prototype,"selectionMode",2),a([(0,Bt.property)({reflect:!0})],Fr.prototype,"size",2),a([(0,Bt.property)()],Fr.prototype,"min",2),a([(0,Bt.property)()],Fr.prototype,"max",2),a([(0,Bt.property)({type:Boolean})],Fr.prototype,"disabled",2),a([(0,Bt.property)({type:Number,attribute:"show-months"})],Fr.prototype,"showMonths",2),a([(0,Bt.property)({attribute:"default-date"})],Fr.prototype,"defaultDate",2),a([(0,Bt.query)(".input")],Fr.prototype,"_inputEl",2),a([(0,Bt.query)(".host")],Fr.prototype,"_hostEl",2),Fr=a([(0,Bt.customElement)("lui-calendar")],Fr);var Ro=class extends Xi.LitElement{constructor(){super(...arguments);this.value="";this.placeholder="\u9009\u62E9\u65E5\u671F\u8303\u56F4";this.size="md";this.disabled=!1;this.clearable=!0;this._onChange=e=>{let t=e.detail;this.value=t.value,this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))}}render(){return Xi.html`
12512
12514
  <lui-datepicker
12513
12515
  type="date"
12514
12516
  selection-mode="range"
@@ -12521,7 +12523,7 @@
12521
12523
  .clearable=${this.clearable}
12522
12524
  @change=${this._onChange}
12523
12525
  ></lui-datepicker>
12524
- `}};Ho.styles=[A,j,Xi.css`:host{display:block;width:100%;}`],a([(0,Bt.property)()],Ho.prototype,"value",2),a([(0,Bt.property)()],Ho.prototype,"placeholder",2),a([(0,Bt.property)({reflect:!0})],Ho.prototype,"size",2),a([(0,Bt.property)()],Ho.prototype,"min",2),a([(0,Bt.property)()],Ho.prototype,"max",2),a([(0,Bt.property)({type:Boolean})],Ho.prototype,"disabled",2),a([(0,Bt.property)({type:Boolean})],Ho.prototype,"clearable",2),Ho=a([(0,Bt.customElement)("lui-date-range-picker")],Ho);var hr=require("lit"),Te=require("lit/decorators.js");var Xp=xn(ia(),1);function kd(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px")}function Zp(i){let{target:o,handle:e,visibleMarginX:t=72,visibleMarginY:r=48,ignoreFrom:n="button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle]",initialState:s,onStart:d,onMove:h}=i,p={left:s?.left??o.getBoundingClientRect().left,top:s?.top??o.getBoundingClientRect().top},f=(0,Xp.default)(e).draggable({ignoreFrom:n,listeners:{start(){d?.()},move(x){let k=o.getBoundingClientRect(),C=t-k.width,S=window.innerWidth-t,z=r-k.height,T=window.innerHeight-r,P=Math.min(S,Math.max(C,p.left+x.dx)),H=Math.min(T,Math.max(z,p.top+x.dy));p={left:P,top:H},kd(o,p),h?.(p)}}});return{dispose(){f.unset()},reset(){p={left:0,top:0},kd(o,p),h?.(p)},getState(){return{...p}},setState(x,k){p={left:x.left??p.left,top:x.top??p.top},k?.apply!==!1&&kd(o,p),k?.notify!==!1&&h?.(p)}}}var xd=xn(ia(),1);function Ml(i){let o=Number.parseFloat(i);return Number.isFinite(o)?o:void 0}function za(i,o,e){return Math.min(e,Math.max(o,i))}function Hg(i){return i.top&&i.left?"nw":i.top&&i.right?"ne":i.bottom&&i.left?"sw":i.bottom&&i.right?"se":i.top?"n":i.right?"e":i.bottom?"s":"w"}function Rg(i,o,e){let r=window.getComputedStyle(i),n=Ml(r.minWidth)??o,s=Ml(r.minHeight)??e,d=Math.max(n,window.innerWidth-16*2),h=Math.max(s,window.innerHeight-16*2),p=Math.min(Ml(r.maxWidth)??d,d),f=Math.min(Ml(r.maxHeight)??h,h);return{minWidth:n,minHeight:s,maxWidth:p,maxHeight:f,viewportMargin:16}}function Qp(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px"),i.style.setProperty("--lui-dialog-width",`${o.width}px`),i.style.setProperty("--lui-dialog-height",`${o.height}px`)}function Jp(i){let{target:o,left:e,top:t,width:r,height:n,minWidth:s=320,minHeight:d=220,onStart:h,onEnd:p,onMove:f}=i,x=o.getBoundingClientRect(),k={left:e??x.left,top:t??x.top,width:r??x.width,height:n??x.height},C=(0,xd.default)(o).resizable({edges:{top:'[data-resize-handle="n"], [data-resize-handle="nw"], [data-resize-handle="ne"]',right:'[data-resize-handle="e"], [data-resize-handle="ne"], [data-resize-handle="se"]',bottom:'[data-resize-handle="s"], [data-resize-handle="sw"], [data-resize-handle="se"]',left:'[data-resize-handle="w"], [data-resize-handle="nw"], [data-resize-handle="sw"]'},invert:"reposition",modifiers:[xd.default.modifiers.restrictSize({min:{width:s,height:d}})],listeners:{start(S){h?.(Hg(S.edges))},move(S){let z=Rg(o,s,d),T=k.left,P=k.top,H=k.width,I=k.height;if(S.edges?.left){let B=k.left+k.width,$=B-z.minWidth;T=za(k.left+S.deltaRect.left,z.viewportMargin,$),H=za(B-T,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-T)),T=B-H}else S.edges?.right&&(H=za(S.rect.width,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-k.left)));if(S.edges?.top){let B=k.top+k.height,$=B-z.minHeight;P=za(k.top+S.deltaRect.top,z.viewportMargin,$),I=za(B-P,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-P)),P=B-I}else S.edges?.bottom&&(I=za(S.rect.height,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-k.top)));k={left:T,top:P,width:H,height:I},Qp(o,k),f?.({...k})},end(){p?.()}}});return{dispose(){C.unset()},getState(){return{...k}},setState(S,z){k={left:S.left??k.left,top:S.top??k.top,width:S.width??k.width,height:S.height??k.height},z?.apply!==!1&&Qp(o,k),z?.notify!==!1&&f?.({...k})}}}var Ig=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "),Vg=new Set(["lui-input","lui-select","lui-textarea","lui-switch","lui-checkbox","lui-radio","lui-input-number","lui-datepicker","lui-color-picker","lui-input-opt","lui-file-input"]),bs=0,e1={fromAttribute(i){return i==null?!1:i!=="false"&&i!=="0"},toAttribute(i){return i?"":null}};function Cl(i,o){let e=o;for(;e;){if(e===i)return!0;let t=e.getRootNode?.();if(t instanceof ShadowRoot&&t.host){e=t.host;continue}e=e.parentNode}return!1}function Dg(i){let o=i.activeElement;for(;o&&o.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o instanceof HTMLElement?o:null}function Fg(i){return i.hasAttribute("disabled")||i.getAttribute("aria-hidden")||i.tabIndex===-1||i.hidden?!1:i.matches(Ig)?!0:Vg.has(i.tagName.toLowerCase())}function Ng(i,o){if(!(i instanceof HTMLElement)||i===o||!Cl(o,i)||!i.hasAttribute("open"))return!1;let e=i.tagName.toLowerCase();return e==="lui-popover"||e==="lui-select"||e==="lui-dropdown"||e==="lui-datepicker"||e==="lui-context-menu"}var Me=class extends hr.LitElement{constructor(){super(...arguments);this.open=!1;this.title="";this.noClose=!1;this.closeOnOutsidePress=!0;this.shakeOnOutsideClick=!0;this.noHeader=!1;this.noFooter=!1;this.draggable=!1;this.resizable=!1;this.destroyOnClose=!1;this.fullscreen=!1;this.placement="center";this.offset="";this.backdrop="opaque";this.backdropStyle="";this.portal=!1;this.overlayLayer="modal";this._shaking=!1;this._opening=!1;this._resizing=!1;this._activeResizeHandle=null;this._shakeTimer=0;this._openingTimer=0;this._draggableHandle=null;this._resizableHandle=null;this._explicitAttrs=new Set;this._overlayStackRegistered=!1;this._portalPlaceholder=null;this._portalLayerEl=null;this._isPortalMoving=!1;this._suppressBackdropClickUntil=0;this._previousActiveElement=null;this._bodyScrollLocked=!1;this._bodyUserSelect="";this._bodyWebkitUserSelect="";this._interactiveRect=null;this._destroyOnCloseTemplate=[];this._isSyncingDestroyOnCloseContent=!1;this._onDocumentKeyDown=e=>{if(!this.open||!this._isTopmostDialog())return;if(e.key==="Escape"){let h=e.composedPath();if(Cn(h,this)||h.some(p=>Ng(p,this)))return;e.preventDefault(),this.close();return}if(e.key!=="Tab"||!this._dialog)return;let t=this._getFocusableElements();if(t.length===0){e.preventDefault(),this._dialog.focus({preventScroll:!0});return}let r=Dg(this.ownerDocument),n=t.findIndex(h=>h===r||Cl(h,r)),s=t[0],d=t[t.length-1];if(e.shiftKey){n<=0&&(e.preventDefault(),d.focus({preventScroll:!0}));return}(n===-1||n===t.length-1)&&(e.preventDefault(),s.focus({preventScroll:!0}))};this._onDialogClick=e=>{if(e.target!==this._dialog||!this._isTopmostDialog())return;let t=e.composedPath();if(t.some(s=>s instanceof Node&&s!==this._dialog&&Cl(this,s))||Cn(t,this)||Date.now()<this._suppressBackdropClickUntil||es(this))return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onBackdropClick=e=>{if(e.stopPropagation(),!this._isTopmostDialog())return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onNativeClose=e=>{e.target===this._dialog&&this.open&&(this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))};this._onDocumentPointerDown=e=>{if(!this.open||!this._dialog){this._suppressBackdropClickUntil=0;return}let t=e.composedPath(),r=t[0]===this._dialog,n=t.some(d=>d instanceof Node&&d!==this._dialog&&Cl(this,d)),s=Cn(t,this);this._suppressBackdropClickUntil=!r&&(n||s)?Date.now()+320:0}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=xe(()=>this.requestUpdate()),this._captureDestroyOnCloseTemplate(),this._lightDomObserver=new MutationObserver(()=>{!this._isSyncingDestroyOnCloseContent&&!(this.destroyOnClose&&!this.open&&this.childNodes.length===0)&&this._captureDestroyOnCloseTemplate(),this.requestUpdate()}),this._lightDomObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["slot"]}),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown,!0)}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._disposeLocaleChange?.(),this._lightDomObserver?.disconnect(),this._lightDomObserver=void 0,document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown,!0),this._unlockBodyScroll(),this._setResizing(!1),this._teardownDraggable(),this._teardownResizable(),window.clearTimeout(this._shakeTimer),window.clearTimeout(this._openingTimer),this._isPortalMoving||(this._portalPlaceholder?.remove(),this._portalPlaceholder=null,this._portalLayerEl=null)}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}willUpdate(e){(e.has("open")||e.has("destroyOnClose"))&&this._syncDestroyOnCloseContent(),this._dialog&&this.open&&!this._dialog.open&&(this._opening=!0,window.clearTimeout(this._openingTimer),this._openingTimer=window.setTimeout(()=>{this._opening=!1},300)),e.has("open")&&!this.open&&(this._opening=!1,this._shaking=!1);let t=L(this,"dialog");!this._explicitAttrs.has("no-close")&&typeof t.noClose=="boolean"&&this.noClose!==t.noClose&&(this.noClose=t.noClose),!this._explicitAttrs.has("close-on-outside-press")&&typeof t.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==t.closeOnOutsidePress&&(this.closeOnOutsidePress=t.closeOnOutsidePress),!this._explicitAttrs.has("shake-on-outside-click")&&typeof t.shakeOnOutsideClick=="boolean"&&this.shakeOnOutsideClick!==t.shakeOnOutsideClick&&(this.shakeOnOutsideClick=t.shakeOnOutsideClick),!this._explicitAttrs.has("no-header")&&typeof t.noHeader=="boolean"&&this.noHeader!==t.noHeader&&(this.noHeader=t.noHeader),!this._explicitAttrs.has("no-footer")&&typeof t.noFooter=="boolean"&&this.noFooter!==t.noFooter&&(this.noFooter=t.noFooter),!this._explicitAttrs.has("draggable")&&typeof t.draggable=="boolean"&&this.draggable!==t.draggable&&(this.draggable=t.draggable),!this._explicitAttrs.has("resizable")&&typeof t.resizable=="boolean"&&this.resizable!==t.resizable&&(this.resizable=t.resizable),!this._explicitAttrs.has("destroy-on-close")&&typeof t.destroyOnClose=="boolean"&&this.destroyOnClose!==t.destroyOnClose&&(this.destroyOnClose=t.destroyOnClose),!this._explicitAttrs.has("fullscreen")&&typeof t.fullscreen=="boolean"&&this.fullscreen!==t.fullscreen&&(this.fullscreen=t.fullscreen),!this._explicitAttrs.has("width")&&(typeof t.width=="string"||typeof t.width=="number")&&this.width!==t.width&&(this.width=t.width),!this._explicitAttrs.has("drag-visible-margin-x")&&typeof t.dragVisibleMarginX=="number"&&this.dragVisibleMarginX!==t.dragVisibleMarginX&&(this.dragVisibleMarginX=t.dragVisibleMarginX),!this._explicitAttrs.has("drag-visible-margin-y")&&typeof t.dragVisibleMarginY=="number"&&this.dragVisibleMarginY!==t.dragVisibleMarginY&&(this.dragVisibleMarginY=t.dragVisibleMarginY),!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&this.placement!==t.placement&&(this.placement=t.placement),!this._explicitAttrs.has("offset")&&typeof t.offset=="string"&&this.offset!==t.offset&&(this.offset=t.offset),!this._explicitAttrs.has("backdrop")&&typeof t.backdrop=="string"&&this.backdrop!==t.backdrop&&(this.backdrop=t.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof t.backdropStyle=="string"&&this.backdropStyle!==t.backdropStyle&&(this.backdropStyle=t.backdropStyle),!this._explicitAttrs.has("portal")&&typeof t.portal=="boolean"&&this.portal!==t.portal&&(this.portal=t.portal),!this._explicitAttrs.has("overlay-layer")&&typeof t.overlayLayer=="string"&&this.overlayLayer!==t.overlayLayer&&(this.overlayLayer=t.overlayLayer),this.container==null&&t.container!=null&&(this.container=t.container)}updated(e){let t=e.has("portal")||e.has("container")||e.has("overlayLayer");if(this.open&&(e.has("open")||t)&&(this.portal?this._moveToPortalLayer():t&&this._restorePortalPlacement(),this._registerOverlayStack(),Et(this)),e.has("open")&&this._dialog)if(this.open&&!this._dialog.open){try{this._dialog.show()}catch{this._dialog.setAttribute("open","")}this._previousActiveElement=this.ownerDocument.activeElement instanceof HTMLElement?this.ownerDocument.activeElement:null,this._lockBodyScroll(),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>{this._focusInitialElement()})}else!this.open&&this._dialog.open&&(this._unlockBodyScroll(),this._dialog.close(),this._restoreFocus());e.has("open")&&!this.open&&(this._releaseOverlayStack(),this._restorePortalPlacement(),this._resetInteractiveLayout()),e.has("width")&&this._interactiveRect&&!this._resizing&&(this._interactiveRect.width=void 0),(e.has("draggable")||e.has("fullscreen")||e.has("noHeader")||e.has("open")||e.has("dragHandle"))&&queueMicrotask(()=>this._syncDraggable()),(e.has("resizable")||e.has("fullscreen")||e.has("open")||e.has("width")||e.has("placement"))&&queueMicrotask(()=>this._syncResizable())}show(){this.portal&&this._moveToPortalLayer(),this.open=!0}close(e=!0){if(this.open){if(e){let t=new CustomEvent("close",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(t),t.defaultPrevented)return}this.open=!1}}_getFocusableElements(){if(!this._dialog)return[];let e=this.ownerDocument.createTreeWalker(this._dialog,NodeFilter.SHOW_ELEMENT),t=[],r=e.currentNode;for(;r;)r!==this._dialog&&Fg(r)&&!t.includes(r)&&t.push(r),r=e.nextNode();return t}_focusInitialElement(){if(!this.open||!this._dialog)return;let t=this._getFocusableElements()[0]??this._dialog;t===this._dialog&&(this._dialog.tabIndex=-1),t.focus({preventScroll:!0})}_restoreFocus(){let e=this._previousActiveElement;this._previousActiveElement=null,e&&e.isConnected&&e.focus({preventScroll:!0})}_lockBodyScroll(){this._bodyScrollLocked||!this.ownerDocument?.body||(bs===0&&(this.ownerDocument.body.style.overflow="hidden"),bs+=1,this._bodyScrollLocked=!0)}_unlockBodyScroll(){!this._bodyScrollLocked||!this.ownerDocument?.body||(bs=Math.max(0,bs-1),bs===0&&(this.ownerDocument.body.style.overflow=""),this._bodyScrollLocked=!1)}_shake(){!this.shakeOnOutsideClick||!this.open||(window.clearTimeout(this._shakeTimer),this._shaking=!1,this.updateComplete.then(()=>{this._dialog?.offsetWidth,this._shaking=!0,this._shakeTimer=window.setTimeout(()=>{this._shaking=!1},380)}))}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_hasFooterContent(){return this.noFooter?!1:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="footer")}_shouldRenderHeader(){return this.noHeader?!1:this.title||!this.noClose?!0:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="title")}_isTopmostDialog(){return!this._overlayStackRegistered||rs(this)}_registerOverlayStack(){let e=zn(this);if(!e){this._releaseOverlayStack();return}Jt(this,e.layer,e.layerName),this._overlayStackRegistered=!0}_releaseOverlayStack(){this._overlayStackRegistered&&(Yo(this),this._overlayStackRegistered=!1)}_resolvePortalMountTarget(){return Ar(this.overlayLayer||"modal",this.container??ln(this)??sn(this))}_moveToPortalLayer(){let e=this._resolvePortalMountTarget();if(this.parentNode===e){this._portalLayerEl=e;return}!this._portalPlaceholder&&this.parentNode&&(this._portalPlaceholder=this.ownerDocument.createComment("lui-dialog-portal"),this.parentNode.insertBefore(this._portalPlaceholder,this.nextSibling)),this._isPortalMoving=!0;try{e.appendChild(this),this._portalLayerEl=e}finally{this._isPortalMoving=!1}}_restorePortalPlacement(){if(!this._portalPlaceholder){this._portalLayerEl=null;return}let e=this._portalPlaceholder,t=e.parentNode;this._isPortalMoving=!0;try{t&&t.insertBefore(this,e),e.remove(),this._portalPlaceholder=null,this._portalLayerEl=null}finally{this._isPortalMoving=!1}}_teardownDraggable(){this._draggableHandle?.dispose(),this._draggableHandle=null}_syncDestroyOnCloseContent(){if(!this.destroyOnClose){this._restoreDestroyOnCloseContent();return}if(this.open){this._restoreDestroyOnCloseContent();return}this._stashDestroyOnCloseContent()}_captureDestroyOnCloseTemplate(){this._isSyncingDestroyOnCloseContent||(this._destroyOnCloseTemplate=Array.from(this.childNodes).map(e=>e.cloneNode(!0)))}_restoreDestroyOnCloseContent(){if(!(this.childNodes.length>0||this._destroyOnCloseTemplate.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren(...this._destroyOnCloseTemplate.map(e=>e.cloneNode(!0)))}finally{this._isSyncingDestroyOnCloseContent=!1}}}_stashDestroyOnCloseContent(){if(!(!this.destroyOnClose||this.childNodes.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren()}finally{this._isSyncingDestroyOnCloseContent=!1}}}_teardownResizable(){this._resizableHandle?.dispose(),this._resizableHandle=null,this._activeResizeHandle=null,this._setResizing(!1)}_setResizing(e){if(this._resizing===e)return;this._resizing=e;let t=this.ownerDocument?.body;if(t){if(e){this._bodyUserSelect=t.style.userSelect,this._bodyWebkitUserSelect=t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none";return}t.style.userSelect=this._bodyUserSelect,t.style.webkitUserSelect=this._bodyWebkitUserSelect}}_resetInteractiveLayout(){this._interactiveRect=null}_materializeInteractiveRect(){if(!this.open||!this._dialog)return null;let e=this._dialog.getBoundingClientRect();return this._interactiveRect={left:Math.round(e.left),top:Math.round(e.top),width:Math.round(e.width),height:Math.round(e.height)},this.requestUpdate(),this._interactiveRect}_syncDraggable(){if(this._teardownDraggable(),this.fullscreen||!this.open||!this.draggable||!this._dialog)return;let e=null;this.dragHandle?e=this._dialog.querySelector(this.dragHandle)||this.querySelector(this.dragHandle):!this.noHeader&&this._headerEl&&(e=this._headerEl),e&&(this._draggableHandle=Zp({target:this._dialog,handle:e,initialState:this._interactiveRect?{left:this._interactiveRect.left,top:this._interactiveRect.top}:void 0,visibleMarginX:typeof this.dragVisibleMarginX=="number"&&Number.isFinite(this.dragVisibleMarginX)?this.dragVisibleMarginX:void 0,visibleMarginY:typeof this.dragVisibleMarginY=="number"&&Number.isFinite(this.dragVisibleMarginY)?this.dragVisibleMarginY:void 0,ignoreFrom:'[part="close"], button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle], .resize-handle',onStart:()=>{let t=this._materializeInteractiveRect();t&&(this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1}),this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}))},onMove:t=>{let r=this._interactiveRect??this._materializeInteractiveRect();r&&(this._interactiveRect={...r,left:t.left,top:t.top},this._resizableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1}),this.requestUpdate())}}))}syncDraggable(){this._syncDraggable()}_syncResizable(){this._teardownResizable(),!(this.fullscreen||!this.open||!this.resizable||!this._dialog)&&(this._resizableHandle=Jp({target:this._dialog,left:this._interactiveRect?.left,top:this._interactiveRect?.top,width:this._interactiveRect?.width,height:this._interactiveRect?.height,minWidth:320,minHeight:220,onStart:e=>{let t=this._materializeInteractiveRect();t&&(this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}),this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1})),this._activeResizeHandle=e,this._setResizing(!0)},onEnd:()=>{this._activeResizeHandle=null,this._setResizing(!1)},onMove:e=>{this._interactiveRect={left:e.left,top:e.top,width:e.width,height:e.height},this._draggableHandle?.setState({left:e.left,top:e.top},{notify:!1,apply:!1}),this.requestUpdate()}}))}_dialogStyle(){let e=this._interactiveRect?.width!=null?`${this._interactiveRect.width}px`:Ot(this.width),t=this._interactiveRect?.height!=null?`${this._interactiveRect.height}px`:"",r=[this._interactiveRect?`--lui-dialog-left:${this._interactiveRect.left}px`:"",this._interactiveRect?`--lui-dialog-top:${this._interactiveRect.top}px`:"",this._interactiveRect?"--lui-dialog-right:auto":"",this._interactiveRect?"--lui-dialog-bottom:auto":"",this._interactiveRect?"--lui-dialog-base-translate-x:0px":"",this._interactiveRect?"--lui-dialog-base-translate-y:0px":"",this.offset?`--lui-dialog-offset:${this.offset}`:"",e?`--lui-dialog-width:${e}`:"",t?`--lui-dialog-height:${t}`:""].filter(Boolean);return r.length?r.join(";"):hr.nothing}render(){let e=this.open||!this.destroyOnClose,t=this._hasFooterContent();return hr.html`
12526
+ `}};Ro.styles=[A,j,Xi.css`:host{display:block;width:100%;}`],a([(0,Bt.property)()],Ro.prototype,"value",2),a([(0,Bt.property)()],Ro.prototype,"placeholder",2),a([(0,Bt.property)({reflect:!0})],Ro.prototype,"size",2),a([(0,Bt.property)()],Ro.prototype,"min",2),a([(0,Bt.property)()],Ro.prototype,"max",2),a([(0,Bt.property)({type:Boolean})],Ro.prototype,"disabled",2),a([(0,Bt.property)({type:Boolean})],Ro.prototype,"clearable",2),Ro=a([(0,Bt.customElement)("lui-date-range-picker")],Ro);var hr=require("lit"),Te=require("lit/decorators.js");var Xp=xn(ia(),1);function kd(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px")}function Zp(i){let{target:o,handle:e,visibleMarginX:t=72,visibleMarginY:r=48,ignoreFrom:n="button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle]",initialState:s,onStart:d,onMove:h}=i,p={left:s?.left??o.getBoundingClientRect().left,top:s?.top??o.getBoundingClientRect().top},f=(0,Xp.default)(e).draggable({ignoreFrom:n,listeners:{start(){d?.()},move(x){let k=o.getBoundingClientRect(),C=t-k.width,S=window.innerWidth-t,z=r-k.height,T=window.innerHeight-r,P=Math.min(S,Math.max(C,p.left+x.dx)),H=Math.min(T,Math.max(z,p.top+x.dy));p={left:P,top:H},kd(o,p),h?.(p)}}});return{dispose(){f.unset()},reset(){p={left:0,top:0},kd(o,p),h?.(p)},getState(){return{...p}},setState(x,k){p={left:x.left??p.left,top:x.top??p.top},k?.apply!==!1&&kd(o,p),k?.notify!==!1&&h?.(p)}}}var xd=xn(ia(),1);function Ml(i){let o=Number.parseFloat(i);return Number.isFinite(o)?o:void 0}function za(i,o,e){return Math.min(e,Math.max(o,i))}function Hg(i){return i.top&&i.left?"nw":i.top&&i.right?"ne":i.bottom&&i.left?"sw":i.bottom&&i.right?"se":i.top?"n":i.right?"e":i.bottom?"s":"w"}function Rg(i,o,e){let r=window.getComputedStyle(i),n=Ml(r.minWidth)??o,s=Ml(r.minHeight)??e,d=Math.max(n,window.innerWidth-16*2),h=Math.max(s,window.innerHeight-16*2),p=Math.min(Ml(r.maxWidth)??d,d),f=Math.min(Ml(r.maxHeight)??h,h);return{minWidth:n,minHeight:s,maxWidth:p,maxHeight:f,viewportMargin:16}}function Qp(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px"),i.style.setProperty("--lui-dialog-width",`${o.width}px`),i.style.setProperty("--lui-dialog-height",`${o.height}px`)}function Jp(i){let{target:o,left:e,top:t,width:r,height:n,minWidth:s=320,minHeight:d=220,onStart:h,onEnd:p,onMove:f}=i,x=o.getBoundingClientRect(),k={left:e??x.left,top:t??x.top,width:r??x.width,height:n??x.height},C=(0,xd.default)(o).resizable({edges:{top:'[data-resize-handle="n"], [data-resize-handle="nw"], [data-resize-handle="ne"]',right:'[data-resize-handle="e"], [data-resize-handle="ne"], [data-resize-handle="se"]',bottom:'[data-resize-handle="s"], [data-resize-handle="sw"], [data-resize-handle="se"]',left:'[data-resize-handle="w"], [data-resize-handle="nw"], [data-resize-handle="sw"]'},invert:"reposition",modifiers:[xd.default.modifiers.restrictSize({min:{width:s,height:d}})],listeners:{start(S){h?.(Hg(S.edges))},move(S){let z=Rg(o,s,d),T=k.left,P=k.top,H=k.width,I=k.height;if(S.edges?.left){let B=k.left+k.width,$=B-z.minWidth;T=za(k.left+S.deltaRect.left,z.viewportMargin,$),H=za(B-T,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-T)),T=B-H}else S.edges?.right&&(H=za(S.rect.width,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-k.left)));if(S.edges?.top){let B=k.top+k.height,$=B-z.minHeight;P=za(k.top+S.deltaRect.top,z.viewportMargin,$),I=za(B-P,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-P)),P=B-I}else S.edges?.bottom&&(I=za(S.rect.height,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-k.top)));k={left:T,top:P,width:H,height:I},Qp(o,k),f?.({...k})},end(){p?.()}}});return{dispose(){C.unset()},getState(){return{...k}},setState(S,z){k={left:S.left??k.left,top:S.top??k.top,width:S.width??k.width,height:S.height??k.height},z?.apply!==!1&&Qp(o,k),z?.notify!==!1&&f?.({...k})}}}var Ig=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "),Vg=new Set(["lui-input","lui-select","lui-textarea","lui-switch","lui-checkbox","lui-radio","lui-input-number","lui-datepicker","lui-color-picker","lui-input-opt","lui-file-input"]),bs=0,e1={fromAttribute(i){return i==null?!1:i!=="false"&&i!=="0"},toAttribute(i){return i?"":null}};function Cl(i,o){let e=o;for(;e;){if(e===i)return!0;let t=e.getRootNode?.();if(t instanceof ShadowRoot&&t.host){e=t.host;continue}e=e.parentNode}return!1}function Dg(i){let o=i.activeElement;for(;o&&o.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o instanceof HTMLElement?o:null}function Fg(i){return i.hasAttribute("disabled")||i.getAttribute("aria-hidden")||i.tabIndex===-1||i.hidden?!1:i.matches(Ig)?!0:Vg.has(i.tagName.toLowerCase())}function Ng(i,o){if(!(i instanceof HTMLElement)||i===o||!Cl(o,i)||!i.hasAttribute("open"))return!1;let e=i.tagName.toLowerCase();return e==="lui-popover"||e==="lui-select"||e==="lui-dropdown"||e==="lui-datepicker"||e==="lui-context-menu"}var Me=class extends hr.LitElement{constructor(){super(...arguments);this.open=!1;this.title="";this.noClose=!1;this.closeOnOutsidePress=!0;this.shakeOnOutsideClick=!0;this.noHeader=!1;this.noFooter=!1;this.draggable=!1;this.resizable=!1;this.destroyOnClose=!1;this.fullscreen=!1;this.placement="center";this.offset="";this.backdrop="opaque";this.backdropStyle="";this.portal=!1;this.overlayLayer="modal";this._shaking=!1;this._opening=!1;this._resizing=!1;this._activeResizeHandle=null;this._shakeTimer=0;this._openingTimer=0;this._draggableHandle=null;this._resizableHandle=null;this._explicitAttrs=new Set;this._overlayStackRegistered=!1;this._portalPlaceholder=null;this._portalLayerEl=null;this._isPortalMoving=!1;this._suppressBackdropClickUntil=0;this._previousActiveElement=null;this._bodyScrollLocked=!1;this._bodyUserSelect="";this._bodyWebkitUserSelect="";this._interactiveRect=null;this._destroyOnCloseTemplate=[];this._isSyncingDestroyOnCloseContent=!1;this._onDocumentKeyDown=e=>{if(!this.open||!this._isTopmostDialog())return;if(e.key==="Escape"){let h=e.composedPath();if(Cn(h,this)||h.some(p=>Ng(p,this)))return;e.preventDefault(),this.close();return}if(e.key!=="Tab"||!this._dialog)return;let t=this._getFocusableElements();if(t.length===0){e.preventDefault(),this._dialog.focus({preventScroll:!0});return}let r=Dg(this.ownerDocument),n=t.findIndex(h=>h===r||Cl(h,r)),s=t[0],d=t[t.length-1];if(e.shiftKey){n<=0&&(e.preventDefault(),d.focus({preventScroll:!0}));return}(n===-1||n===t.length-1)&&(e.preventDefault(),s.focus({preventScroll:!0}))};this._onDialogClick=e=>{if(e.target!==this._dialog||!this._isTopmostDialog())return;let t=e.composedPath();if(t.some(s=>s instanceof Node&&s!==this._dialog&&Cl(this,s))||Cn(t,this)||Date.now()<this._suppressBackdropClickUntil||es(this))return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onBackdropClick=e=>{if(e.stopPropagation(),!this._isTopmostDialog())return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onNativeClose=e=>{e.target===this._dialog&&this.open&&(this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))};this._onDocumentPointerDown=e=>{if(!this.open||!this._dialog){this._suppressBackdropClickUntil=0;return}let t=e.composedPath(),r=t[0]===this._dialog,n=t.some(d=>d instanceof Node&&d!==this._dialog&&Cl(this,d)),s=Cn(t,this);this._suppressBackdropClickUntil=!r&&(n||s)?Date.now()+320:0}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=xe(()=>this.requestUpdate()),this._captureDestroyOnCloseTemplate(),this._lightDomObserver=new MutationObserver(()=>{!this._isSyncingDestroyOnCloseContent&&!(this.destroyOnClose&&!this.open&&this.childNodes.length===0)&&this._captureDestroyOnCloseTemplate(),this.requestUpdate()}),this._lightDomObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["slot"]}),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown,!0)}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._disposeLocaleChange?.(),this._lightDomObserver?.disconnect(),this._lightDomObserver=void 0,document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown,!0),this._unlockBodyScroll(),this._setResizing(!1),this._teardownDraggable(),this._teardownResizable(),window.clearTimeout(this._shakeTimer),window.clearTimeout(this._openingTimer),this._isPortalMoving||(this._portalPlaceholder?.remove(),this._portalPlaceholder=null,this._portalLayerEl=null)}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}willUpdate(e){(e.has("open")||e.has("destroyOnClose"))&&this._syncDestroyOnCloseContent(),this._dialog&&this.open&&!this._dialog.open&&(this._opening=!0,window.clearTimeout(this._openingTimer),this._openingTimer=window.setTimeout(()=>{this._opening=!1},300)),e.has("open")&&!this.open&&(this._opening=!1,this._shaking=!1);let t=L(this,"dialog");!this._explicitAttrs.has("no-close")&&typeof t.noClose=="boolean"&&this.noClose!==t.noClose&&(this.noClose=t.noClose),!this._explicitAttrs.has("close-on-outside-press")&&typeof t.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==t.closeOnOutsidePress&&(this.closeOnOutsidePress=t.closeOnOutsidePress),!this._explicitAttrs.has("shake-on-outside-click")&&typeof t.shakeOnOutsideClick=="boolean"&&this.shakeOnOutsideClick!==t.shakeOnOutsideClick&&(this.shakeOnOutsideClick=t.shakeOnOutsideClick),!this._explicitAttrs.has("no-header")&&typeof t.noHeader=="boolean"&&this.noHeader!==t.noHeader&&(this.noHeader=t.noHeader),!this._explicitAttrs.has("no-footer")&&typeof t.noFooter=="boolean"&&this.noFooter!==t.noFooter&&(this.noFooter=t.noFooter),!this._explicitAttrs.has("draggable")&&typeof t.draggable=="boolean"&&this.draggable!==t.draggable&&(this.draggable=t.draggable),!this._explicitAttrs.has("resizable")&&typeof t.resizable=="boolean"&&this.resizable!==t.resizable&&(this.resizable=t.resizable),!this._explicitAttrs.has("destroy-on-close")&&typeof t.destroyOnClose=="boolean"&&this.destroyOnClose!==t.destroyOnClose&&(this.destroyOnClose=t.destroyOnClose),!this._explicitAttrs.has("fullscreen")&&typeof t.fullscreen=="boolean"&&this.fullscreen!==t.fullscreen&&(this.fullscreen=t.fullscreen),!this._explicitAttrs.has("width")&&(typeof t.width=="string"||typeof t.width=="number")&&this.width!==t.width&&(this.width=t.width),!this._explicitAttrs.has("drag-visible-margin-x")&&typeof t.dragVisibleMarginX=="number"&&this.dragVisibleMarginX!==t.dragVisibleMarginX&&(this.dragVisibleMarginX=t.dragVisibleMarginX),!this._explicitAttrs.has("drag-visible-margin-y")&&typeof t.dragVisibleMarginY=="number"&&this.dragVisibleMarginY!==t.dragVisibleMarginY&&(this.dragVisibleMarginY=t.dragVisibleMarginY),!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&this.placement!==t.placement&&(this.placement=t.placement),!this._explicitAttrs.has("offset")&&typeof t.offset=="string"&&this.offset!==t.offset&&(this.offset=t.offset),!this._explicitAttrs.has("backdrop")&&typeof t.backdrop=="string"&&this.backdrop!==t.backdrop&&(this.backdrop=t.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof t.backdropStyle=="string"&&this.backdropStyle!==t.backdropStyle&&(this.backdropStyle=t.backdropStyle),!this._explicitAttrs.has("portal")&&typeof t.portal=="boolean"&&this.portal!==t.portal&&(this.portal=t.portal),!this._explicitAttrs.has("overlay-layer")&&typeof t.overlayLayer=="string"&&this.overlayLayer!==t.overlayLayer&&(this.overlayLayer=t.overlayLayer),this.container==null&&t.container!=null&&(this.container=t.container)}updated(e){let t=e.has("portal")||e.has("container")||e.has("overlayLayer");if(this.open&&(e.has("open")||t)&&(this.portal?this._moveToPortalLayer():t&&this._restorePortalPlacement(),this._registerOverlayStack(),Et(this)),e.has("open")&&this._dialog)if(this.open&&!this._dialog.open){try{this._dialog.show()}catch{this._dialog.setAttribute("open","")}this._previousActiveElement=this.ownerDocument.activeElement instanceof HTMLElement?this.ownerDocument.activeElement:null,this._lockBodyScroll(),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>{this._focusInitialElement()})}else!this.open&&this._dialog.open&&(this._unlockBodyScroll(),this._dialog.close(),this._restoreFocus());e.has("open")&&!this.open&&(this._releaseOverlayStack(),this._restorePortalPlacement(),this._resetInteractiveLayout()),e.has("width")&&this._interactiveRect&&!this._resizing&&(this._interactiveRect.width=void 0),(e.has("draggable")||e.has("fullscreen")||e.has("noHeader")||e.has("open")||e.has("dragHandle"))&&queueMicrotask(()=>this._syncDraggable()),(e.has("resizable")||e.has("fullscreen")||e.has("open")||e.has("width")||e.has("placement"))&&queueMicrotask(()=>this._syncResizable())}show(){this.portal&&this._moveToPortalLayer(),this.open=!0}close(e=!0){if(this.open){if(e){let t=new CustomEvent("close",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(t),t.defaultPrevented)return}this.open=!1}}_getFocusableElements(){if(!this._dialog)return[];let e=this.ownerDocument.createTreeWalker(this._dialog,NodeFilter.SHOW_ELEMENT),t=[],r=e.currentNode;for(;r;)r!==this._dialog&&Fg(r)&&!t.includes(r)&&t.push(r),r=e.nextNode();return t}_focusInitialElement(){if(!this.open||!this._dialog)return;let t=this._getFocusableElements()[0]??this._dialog;t===this._dialog&&(this._dialog.tabIndex=-1),t.focus({preventScroll:!0})}_restoreFocus(){let e=this._previousActiveElement;this._previousActiveElement=null,e&&e.isConnected&&e.focus({preventScroll:!0})}_lockBodyScroll(){this._bodyScrollLocked||!this.ownerDocument?.body||(bs===0&&(this.ownerDocument.body.style.overflow="hidden"),bs+=1,this._bodyScrollLocked=!0)}_unlockBodyScroll(){!this._bodyScrollLocked||!this.ownerDocument?.body||(bs=Math.max(0,bs-1),bs===0&&(this.ownerDocument.body.style.overflow=""),this._bodyScrollLocked=!1)}_shake(){!this.shakeOnOutsideClick||!this.open||(window.clearTimeout(this._shakeTimer),this._shaking=!1,this.updateComplete.then(()=>{this._dialog?.offsetWidth,this._shaking=!0,this._shakeTimer=window.setTimeout(()=>{this._shaking=!1},380)}))}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_hasFooterContent(){return this.noFooter?!1:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="footer")}_shouldRenderHeader(){return this.noHeader?!1:this.title||!this.noClose?!0:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="title")}_isTopmostDialog(){return!this._overlayStackRegistered||rs(this)}_registerOverlayStack(){let e=zn(this);if(!e){this._releaseOverlayStack();return}Jt(this,e.layer,e.layerName),this._overlayStackRegistered=!0}_releaseOverlayStack(){this._overlayStackRegistered&&(Xo(this),this._overlayStackRegistered=!1)}_resolvePortalMountTarget(){return Ar(this.overlayLayer||"modal",this.container??ln(this)??sn(this))}_moveToPortalLayer(){let e=this._resolvePortalMountTarget();if(this.parentNode===e){this._portalLayerEl=e;return}!this._portalPlaceholder&&this.parentNode&&(this._portalPlaceholder=this.ownerDocument.createComment("lui-dialog-portal"),this.parentNode.insertBefore(this._portalPlaceholder,this.nextSibling)),this._isPortalMoving=!0;try{e.appendChild(this),this._portalLayerEl=e}finally{this._isPortalMoving=!1}}_restorePortalPlacement(){if(!this._portalPlaceholder){this._portalLayerEl=null;return}let e=this._portalPlaceholder,t=e.parentNode;this._isPortalMoving=!0;try{t&&t.insertBefore(this,e),e.remove(),this._portalPlaceholder=null,this._portalLayerEl=null}finally{this._isPortalMoving=!1}}_teardownDraggable(){this._draggableHandle?.dispose(),this._draggableHandle=null}_syncDestroyOnCloseContent(){if(!this.destroyOnClose){this._restoreDestroyOnCloseContent();return}if(this.open){this._restoreDestroyOnCloseContent();return}this._stashDestroyOnCloseContent()}_captureDestroyOnCloseTemplate(){this._isSyncingDestroyOnCloseContent||(this._destroyOnCloseTemplate=Array.from(this.childNodes).map(e=>e.cloneNode(!0)))}_restoreDestroyOnCloseContent(){if(!(this.childNodes.length>0||this._destroyOnCloseTemplate.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren(...this._destroyOnCloseTemplate.map(e=>e.cloneNode(!0)))}finally{this._isSyncingDestroyOnCloseContent=!1}}}_stashDestroyOnCloseContent(){if(!(!this.destroyOnClose||this.childNodes.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren()}finally{this._isSyncingDestroyOnCloseContent=!1}}}_teardownResizable(){this._resizableHandle?.dispose(),this._resizableHandle=null,this._activeResizeHandle=null,this._setResizing(!1)}_setResizing(e){if(this._resizing===e)return;this._resizing=e;let t=this.ownerDocument?.body;if(t){if(e){this._bodyUserSelect=t.style.userSelect,this._bodyWebkitUserSelect=t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none";return}t.style.userSelect=this._bodyUserSelect,t.style.webkitUserSelect=this._bodyWebkitUserSelect}}_resetInteractiveLayout(){this._interactiveRect=null}_materializeInteractiveRect(){if(!this.open||!this._dialog)return null;let e=this._dialog.getBoundingClientRect();return this._interactiveRect={left:Math.round(e.left),top:Math.round(e.top),width:Math.round(e.width),height:Math.round(e.height)},this.requestUpdate(),this._interactiveRect}_syncDraggable(){if(this._teardownDraggable(),this.fullscreen||!this.open||!this.draggable||!this._dialog)return;let e=null;this.dragHandle?e=this._dialog.querySelector(this.dragHandle)||this.querySelector(this.dragHandle):!this.noHeader&&this._headerEl&&(e=this._headerEl),e&&(this._draggableHandle=Zp({target:this._dialog,handle:e,initialState:this._interactiveRect?{left:this._interactiveRect.left,top:this._interactiveRect.top}:void 0,visibleMarginX:typeof this.dragVisibleMarginX=="number"&&Number.isFinite(this.dragVisibleMarginX)?this.dragVisibleMarginX:void 0,visibleMarginY:typeof this.dragVisibleMarginY=="number"&&Number.isFinite(this.dragVisibleMarginY)?this.dragVisibleMarginY:void 0,ignoreFrom:'[part="close"], button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle], .resize-handle',onStart:()=>{let t=this._materializeInteractiveRect();t&&(this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1}),this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}))},onMove:t=>{let r=this._interactiveRect??this._materializeInteractiveRect();r&&(this._interactiveRect={...r,left:t.left,top:t.top},this._resizableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1}),this.requestUpdate())}}))}syncDraggable(){this._syncDraggable()}_syncResizable(){this._teardownResizable(),!(this.fullscreen||!this.open||!this.resizable||!this._dialog)&&(this._resizableHandle=Jp({target:this._dialog,left:this._interactiveRect?.left,top:this._interactiveRect?.top,width:this._interactiveRect?.width,height:this._interactiveRect?.height,minWidth:320,minHeight:220,onStart:e=>{let t=this._materializeInteractiveRect();t&&(this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}),this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1})),this._activeResizeHandle=e,this._setResizing(!0)},onEnd:()=>{this._activeResizeHandle=null,this._setResizing(!1)},onMove:e=>{this._interactiveRect={left:e.left,top:e.top,width:e.width,height:e.height},this._draggableHandle?.setState({left:e.left,top:e.top},{notify:!1,apply:!1}),this.requestUpdate()}}))}_dialogStyle(){let e=this._interactiveRect?.width!=null?`${this._interactiveRect.width}px`:Ot(this.width),t=this._interactiveRect?.height!=null?`${this._interactiveRect.height}px`:"",r=[this._interactiveRect?`--lui-dialog-left:${this._interactiveRect.left}px`:"",this._interactiveRect?`--lui-dialog-top:${this._interactiveRect.top}px`:"",this._interactiveRect?"--lui-dialog-right:auto":"",this._interactiveRect?"--lui-dialog-bottom:auto":"",this._interactiveRect?"--lui-dialog-base-translate-x:0px":"",this._interactiveRect?"--lui-dialog-base-translate-y:0px":"",this.offset?`--lui-dialog-offset:${this.offset}`:"",e?`--lui-dialog-width:${e}`:"",t?`--lui-dialog-height:${t}`:""].filter(Boolean);return r.length?r.join(";"):hr.nothing}render(){let e=this.open||!this.destroyOnClose,t=this._hasFooterContent();return hr.html`
12525
12527
  <div
12526
12528
  part="custom-backdrop"
12527
12529
  style=${this.backdropStyle||hr.nothing}
@@ -13060,20 +13062,20 @@
13060
13062
  0 0 0 2px color-mix(in srgb, var(--lui-color-primary) 24%, transparent);
13061
13063
  }
13062
13064
  }
13063
- `],a([(0,Te.property)({type:Boolean,reflect:!0})],Me.prototype,"open",2),a([(0,Te.property)()],Me.prototype,"title",2),a([(0,Te.property)({type:Boolean,attribute:"no-close"})],Me.prototype,"noClose",2),a([(0,Te.property)({attribute:"close-on-outside-press",reflect:!0,converter:e1})],Me.prototype,"closeOnOutsidePress",2),a([(0,Te.property)({attribute:"shake-on-outside-click",reflect:!0,converter:e1})],Me.prototype,"shakeOnOutsideClick",2),a([(0,Te.property)({type:Boolean,reflect:!0,attribute:"no-header"})],Me.prototype,"noHeader",2),a([(0,Te.property)({type:Boolean,reflect:!0,attribute:"no-footer"})],Me.prototype,"noFooter",2),a([(0,Te.property)({type:Boolean,reflect:!0})],Me.prototype,"draggable",2),a([(0,Te.property)({attribute:"drag-handle"})],Me.prototype,"dragHandle",2),a([(0,Te.property)({type:Boolean,reflect:!0})],Me.prototype,"resizable",2),a([(0,Te.property)({type:Boolean,reflect:!0,attribute:"destroy-on-close"})],Me.prototype,"destroyOnClose",2),a([(0,Te.property)({type:Boolean,reflect:!0})],Me.prototype,"fullscreen",2),a([(0,Te.property)()],Me.prototype,"width",2),a([(0,Te.property)({type:Number,attribute:"drag-visible-margin-x"})],Me.prototype,"dragVisibleMarginX",2),a([(0,Te.property)({type:Number,attribute:"drag-visible-margin-y"})],Me.prototype,"dragVisibleMarginY",2),a([(0,Te.property)({reflect:!0})],Me.prototype,"placement",2),a([(0,Te.property)()],Me.prototype,"offset",2),a([(0,Te.property)({reflect:!0})],Me.prototype,"backdrop",2),a([(0,Te.property)({attribute:"backdrop-style"})],Me.prototype,"backdropStyle",2),a([(0,Te.property)({type:Boolean,reflect:!0})],Me.prototype,"portal",2),a([(0,Te.property)({attribute:"overlay-layer"})],Me.prototype,"overlayLayer",2),a([(0,Te.property)({attribute:!1})],Me.prototype,"container",2),a([(0,Te.property)()],Me.prototype,"locale",2),a([(0,Te.property)({attribute:!1})],Me.prototype,"translations",2),a([(0,Te.query)("dialog")],Me.prototype,"_dialog",2),a([(0,Te.query)('[part="header"]')],Me.prototype,"_headerEl",2),a([(0,Te.state)()],Me.prototype,"_shaking",2),a([(0,Te.state)()],Me.prototype,"_opening",2),a([(0,Te.state)()],Me.prototype,"_resizing",2),a([(0,Te.state)()],Me.prototype,"_activeResizeHandle",2),Me=a([(0,Te.customElement)("lui-dialog")],Me);var Ro=require("lit"),vt=require("lit/decorators.js");var t1={fromAttribute(i){return i==null?!1:i!=="false"&&i!=="0"},toAttribute(i){return i?"":null}},it=class extends Ro.LitElement{constructor(){super(...arguments);this.open=!1;this.title="";this.placement="right";this.radius="lg";this.backdrop="opaque";this.backdropStyle="";this.noClose=!1;this.noHeader=!1;this.noFooter=!1;this.closeOnOutsidePress=!0;this.shakeOnOutsideClick=!0;this.portal=!1;this.overlayLayer="modal";this._present=!1;this._opening=!1;this._shaking=!1;this._explicitAttrs=new Set;this._overlayStackRegistered=!1;this._portalPlaceholder=null;this._portalLayerEl=null;this._isPortalMoving=!1;this._shakeTimer=0;this._shakeAnimation=null;this._openingTimer=0;this._closeTimer=0;this._onBackdropPointerDown=e=>{if(e.preventDefault(),e.stopPropagation(),!this._isTopmost())return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=xe(()=>this.requestUpdate()),this._lightDomObserver=new MutationObserver(()=>this.requestUpdate()),this._lightDomObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._disposeLocaleChange?.(),this._lightDomObserver?.disconnect(),window.clearTimeout(this._shakeTimer),this._shakeAnimation?.cancel(),this._shakeAnimation=null,window.clearTimeout(this._openingTimer),window.clearTimeout(this._closeTimer),this._isPortalMoving||(this._portalPlaceholder?.remove(),this._portalPlaceholder=null,this._portalLayerEl=null)}willUpdate(e){e.has("open")&&(window.clearTimeout(this._closeTimer),this.open&&(this._present=!0,this._opening=!0,window.clearTimeout(this._openingTimer),this._openingTimer=window.setTimeout(()=>{this._opening=!1},280)));let t=L(this,"drawer");!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&(this.placement=t.placement),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&(this.radius=t.radius),!this._explicitAttrs.has("backdrop")&&typeof t.backdrop=="string"&&(this.backdrop=t.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof t.backdropStyle=="string"&&(this.backdropStyle=t.backdropStyle),!this._explicitAttrs.has("no-close")&&typeof t.noClose=="boolean"&&(this.noClose=t.noClose),!this._explicitAttrs.has("no-header")&&typeof t.noHeader=="boolean"&&(this.noHeader=t.noHeader),!this._explicitAttrs.has("no-footer")&&typeof t.noFooter=="boolean"&&(this.noFooter=t.noFooter),!this._explicitAttrs.has("close-on-outside-press")&&typeof t.closeOnOutsidePress=="boolean"&&(this.closeOnOutsidePress=t.closeOnOutsidePress),!this._explicitAttrs.has("shake-on-outside-click")&&typeof t.shakeOnOutsideClick=="boolean"&&(this.shakeOnOutsideClick=t.shakeOnOutsideClick),!this._explicitAttrs.has("portal")&&typeof t.portal=="boolean"&&(this.portal=t.portal),!this._explicitAttrs.has("overlay-layer")&&typeof t.overlayLayer=="string"&&(this.overlayLayer=t.overlayLayer),this.container==null&&t.container!=null&&(this.container=t.container)}updated(e){let t=e.has("portal")||e.has("container")||e.has("overlayLayer");this.open&&(e.has("open")||t)&&(this.portal?this._moveToPortalLayer():t&&this._restorePortalPlacement(),this._registerOverlayStack(),Et(this),e.has("open")&&this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))),e.has("open")&&!this.open&&(this._opening=!1,this._shaking=!1,window.clearTimeout(this._closeTimer),this._closeTimer=window.setTimeout(()=>{this.open||(this._present=!1,this._releaseOverlayStack(),this._restorePortalPlacement())},280))}show(){this.open||(this.portal&&this._moveToPortalLayer(),this._present=!0,this.open=!0)}close(e=!0){if(this.open){if(e){let t=new CustomEvent("close",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(t),t.defaultPrevented)return}this.open=!1}}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}_isTopmost(){return!this._overlayStackRegistered||rs(this)}_registerOverlayStack(){let e=zn(this);if(!e){this._releaseOverlayStack();return}Jt(this,e.layer,e.layerName),this._overlayStackRegistered=!0}_releaseOverlayStack(){this._overlayStackRegistered&&(Yo(this),this._overlayStackRegistered=!1)}_resolvePortalMountTarget(){return Ar(this.overlayLayer||"modal",this.container??ln(this)??sn(this))}_moveToPortalLayer(){let e=this._resolvePortalMountTarget();if(this.parentNode===e){this._portalLayerEl=e;return}!this._portalPlaceholder&&this.parentNode&&(this._portalPlaceholder=this.ownerDocument.createComment("lui-drawer-portal"),this.parentNode.insertBefore(this._portalPlaceholder,this.nextSibling)),this._isPortalMoving=!0;try{e.appendChild(this),this._portalLayerEl=e}finally{this._isPortalMoving=!1}}_restorePortalPlacement(){if(!this._portalPlaceholder){this._portalLayerEl=null;return}let e=this._portalPlaceholder.parentNode;this._isPortalMoving=!0;try{e&&e.insertBefore(this,this._portalPlaceholder),this._portalPlaceholder.remove(),this._portalPlaceholder=null,this._portalLayerEl=null}finally{this._isPortalMoving=!1}}async _shake(){if(!this.shakeOnOutsideClick||!this.open||(window.clearTimeout(this._shakeTimer),window.clearTimeout(this._openingTimer),this._opening=!1,this._shaking=!1,await this.updateComplete,!this.open))return;let e=this._panelEl;if(!e)return;this._shakeAnimation?.cancel();let r=this.placement==="left"||this.placement==="right"?[{transform:"translate3d(0, 0, 0)",offset:0},{transform:"translate3d(-10px, 0, 0)",offset:.18},{transform:"translate3d(10px, 0, 0)",offset:.36},{transform:"translate3d(-6px, 0, 0)",offset:.54},{transform:"translate3d(6px, 0, 0)",offset:.72},{transform:"translate3d(0, 0, 0)",offset:1}]:[{transform:"translate3d(0, 0, 0)",offset:0},{transform:"translate3d(0, -10px, 0)",offset:.18},{transform:"translate3d(0, 10px, 0)",offset:.36},{transform:"translate3d(0, -6px, 0)",offset:.54},{transform:"translate3d(0, 6px, 0)",offset:.72},{transform:"translate3d(0, 0, 0)",offset:1}];if(typeof e.animate=="function"){this._shakeAnimation=e.animate(r,{duration:380,easing:"cubic-bezier(0.36, 0.07, 0.19, 0.97)"}),this._shakeAnimation.onfinish=()=>{this._shakeAnimation=null},this._shakeAnimation.oncancel=()=>{this._shakeAnimation=null};return}e.offsetWidth,this._shaking=!0,this._shakeTimer=window.setTimeout(()=>{this._shaking=!1},380)}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}render(){if(!this.open&&!this._present)return Ro.nothing;let e=Array.from(this.childNodes).some(t=>t.nodeType===Node.ELEMENT_NODE&&t.slot==="footer");return Ro.html`
13065
+ `],a([(0,Te.property)({type:Boolean,reflect:!0})],Me.prototype,"open",2),a([(0,Te.property)()],Me.prototype,"title",2),a([(0,Te.property)({type:Boolean,attribute:"no-close"})],Me.prototype,"noClose",2),a([(0,Te.property)({attribute:"close-on-outside-press",reflect:!0,converter:e1})],Me.prototype,"closeOnOutsidePress",2),a([(0,Te.property)({attribute:"shake-on-outside-click",reflect:!0,converter:e1})],Me.prototype,"shakeOnOutsideClick",2),a([(0,Te.property)({type:Boolean,reflect:!0,attribute:"no-header"})],Me.prototype,"noHeader",2),a([(0,Te.property)({type:Boolean,reflect:!0,attribute:"no-footer"})],Me.prototype,"noFooter",2),a([(0,Te.property)({type:Boolean,reflect:!0})],Me.prototype,"draggable",2),a([(0,Te.property)({attribute:"drag-handle"})],Me.prototype,"dragHandle",2),a([(0,Te.property)({type:Boolean,reflect:!0})],Me.prototype,"resizable",2),a([(0,Te.property)({type:Boolean,reflect:!0,attribute:"destroy-on-close"})],Me.prototype,"destroyOnClose",2),a([(0,Te.property)({type:Boolean,reflect:!0})],Me.prototype,"fullscreen",2),a([(0,Te.property)()],Me.prototype,"width",2),a([(0,Te.property)({type:Number,attribute:"drag-visible-margin-x"})],Me.prototype,"dragVisibleMarginX",2),a([(0,Te.property)({type:Number,attribute:"drag-visible-margin-y"})],Me.prototype,"dragVisibleMarginY",2),a([(0,Te.property)({reflect:!0})],Me.prototype,"placement",2),a([(0,Te.property)()],Me.prototype,"offset",2),a([(0,Te.property)({reflect:!0})],Me.prototype,"backdrop",2),a([(0,Te.property)({attribute:"backdrop-style"})],Me.prototype,"backdropStyle",2),a([(0,Te.property)({type:Boolean,reflect:!0})],Me.prototype,"portal",2),a([(0,Te.property)({attribute:"overlay-layer"})],Me.prototype,"overlayLayer",2),a([(0,Te.property)({attribute:!1})],Me.prototype,"container",2),a([(0,Te.property)()],Me.prototype,"locale",2),a([(0,Te.property)({attribute:!1})],Me.prototype,"translations",2),a([(0,Te.query)("dialog")],Me.prototype,"_dialog",2),a([(0,Te.query)('[part="header"]')],Me.prototype,"_headerEl",2),a([(0,Te.state)()],Me.prototype,"_shaking",2),a([(0,Te.state)()],Me.prototype,"_opening",2),a([(0,Te.state)()],Me.prototype,"_resizing",2),a([(0,Te.state)()],Me.prototype,"_activeResizeHandle",2),Me=a([(0,Te.customElement)("lui-dialog")],Me);var Io=require("lit"),vt=require("lit/decorators.js");var t1={fromAttribute(i){return i==null?!1:i!=="false"&&i!=="0"},toAttribute(i){return i?"":null}},it=class extends Io.LitElement{constructor(){super(...arguments);this.open=!1;this.title="";this.placement="right";this.radius="lg";this.backdrop="opaque";this.backdropStyle="";this.noClose=!1;this.noHeader=!1;this.noFooter=!1;this.closeOnOutsidePress=!0;this.shakeOnOutsideClick=!0;this.portal=!1;this.overlayLayer="modal";this._present=!1;this._opening=!1;this._shaking=!1;this._explicitAttrs=new Set;this._overlayStackRegistered=!1;this._portalPlaceholder=null;this._portalLayerEl=null;this._isPortalMoving=!1;this._shakeTimer=0;this._shakeAnimation=null;this._openingTimer=0;this._closeTimer=0;this._onBackdropPointerDown=e=>{if(e.preventDefault(),e.stopPropagation(),!this._isTopmost())return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=xe(()=>this.requestUpdate()),this._lightDomObserver=new MutationObserver(()=>this.requestUpdate()),this._lightDomObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._disposeLocaleChange?.(),this._lightDomObserver?.disconnect(),window.clearTimeout(this._shakeTimer),this._shakeAnimation?.cancel(),this._shakeAnimation=null,window.clearTimeout(this._openingTimer),window.clearTimeout(this._closeTimer),this._isPortalMoving||(this._portalPlaceholder?.remove(),this._portalPlaceholder=null,this._portalLayerEl=null)}willUpdate(e){e.has("open")&&(window.clearTimeout(this._closeTimer),this.open&&(this._present=!0,this._opening=!0,window.clearTimeout(this._openingTimer),this._openingTimer=window.setTimeout(()=>{this._opening=!1},280)));let t=L(this,"drawer");!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&(this.placement=t.placement),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&(this.radius=t.radius),!this._explicitAttrs.has("backdrop")&&typeof t.backdrop=="string"&&(this.backdrop=t.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof t.backdropStyle=="string"&&(this.backdropStyle=t.backdropStyle),!this._explicitAttrs.has("no-close")&&typeof t.noClose=="boolean"&&(this.noClose=t.noClose),!this._explicitAttrs.has("no-header")&&typeof t.noHeader=="boolean"&&(this.noHeader=t.noHeader),!this._explicitAttrs.has("no-footer")&&typeof t.noFooter=="boolean"&&(this.noFooter=t.noFooter),!this._explicitAttrs.has("close-on-outside-press")&&typeof t.closeOnOutsidePress=="boolean"&&(this.closeOnOutsidePress=t.closeOnOutsidePress),!this._explicitAttrs.has("shake-on-outside-click")&&typeof t.shakeOnOutsideClick=="boolean"&&(this.shakeOnOutsideClick=t.shakeOnOutsideClick),!this._explicitAttrs.has("portal")&&typeof t.portal=="boolean"&&(this.portal=t.portal),!this._explicitAttrs.has("overlay-layer")&&typeof t.overlayLayer=="string"&&(this.overlayLayer=t.overlayLayer),this.container==null&&t.container!=null&&(this.container=t.container)}updated(e){let t=e.has("portal")||e.has("container")||e.has("overlayLayer");this.open&&(e.has("open")||t)&&(this.portal?this._moveToPortalLayer():t&&this._restorePortalPlacement(),this._registerOverlayStack(),Et(this),e.has("open")&&this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))),e.has("open")&&!this.open&&(this._opening=!1,this._shaking=!1,window.clearTimeout(this._closeTimer),this._closeTimer=window.setTimeout(()=>{this.open||(this._present=!1,this._releaseOverlayStack(),this._restorePortalPlacement())},280))}show(){this.open||(this.portal&&this._moveToPortalLayer(),this._present=!0,this.open=!0)}close(e=!0){if(this.open){if(e){let t=new CustomEvent("close",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(t),t.defaultPrevented)return}this.open=!1}}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}_isTopmost(){return!this._overlayStackRegistered||rs(this)}_registerOverlayStack(){let e=zn(this);if(!e){this._releaseOverlayStack();return}Jt(this,e.layer,e.layerName),this._overlayStackRegistered=!0}_releaseOverlayStack(){this._overlayStackRegistered&&(Xo(this),this._overlayStackRegistered=!1)}_resolvePortalMountTarget(){return Ar(this.overlayLayer||"modal",this.container??ln(this)??sn(this))}_moveToPortalLayer(){let e=this._resolvePortalMountTarget();if(this.parentNode===e){this._portalLayerEl=e;return}!this._portalPlaceholder&&this.parentNode&&(this._portalPlaceholder=this.ownerDocument.createComment("lui-drawer-portal"),this.parentNode.insertBefore(this._portalPlaceholder,this.nextSibling)),this._isPortalMoving=!0;try{e.appendChild(this),this._portalLayerEl=e}finally{this._isPortalMoving=!1}}_restorePortalPlacement(){if(!this._portalPlaceholder){this._portalLayerEl=null;return}let e=this._portalPlaceholder.parentNode;this._isPortalMoving=!0;try{e&&e.insertBefore(this,this._portalPlaceholder),this._portalPlaceholder.remove(),this._portalPlaceholder=null,this._portalLayerEl=null}finally{this._isPortalMoving=!1}}async _shake(){if(!this.shakeOnOutsideClick||!this.open||(window.clearTimeout(this._shakeTimer),window.clearTimeout(this._openingTimer),this._opening=!1,this._shaking=!1,await this.updateComplete,!this.open))return;let e=this._panelEl;if(!e)return;this._shakeAnimation?.cancel();let r=this.placement==="left"||this.placement==="right"?[{transform:"translate3d(0, 0, 0)",offset:0},{transform:"translate3d(-10px, 0, 0)",offset:.18},{transform:"translate3d(10px, 0, 0)",offset:.36},{transform:"translate3d(-6px, 0, 0)",offset:.54},{transform:"translate3d(6px, 0, 0)",offset:.72},{transform:"translate3d(0, 0, 0)",offset:1}]:[{transform:"translate3d(0, 0, 0)",offset:0},{transform:"translate3d(0, -10px, 0)",offset:.18},{transform:"translate3d(0, 10px, 0)",offset:.36},{transform:"translate3d(0, -6px, 0)",offset:.54},{transform:"translate3d(0, 6px, 0)",offset:.72},{transform:"translate3d(0, 0, 0)",offset:1}];if(typeof e.animate=="function"){this._shakeAnimation=e.animate(r,{duration:380,easing:"cubic-bezier(0.36, 0.07, 0.19, 0.97)"}),this._shakeAnimation.onfinish=()=>{this._shakeAnimation=null},this._shakeAnimation.oncancel=()=>{this._shakeAnimation=null};return}e.offsetWidth,this._shaking=!0,this._shakeTimer=window.setTimeout(()=>{this._shaking=!1},380)}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}render(){if(!this.open&&!this._present)return Io.nothing;let e=Array.from(this.childNodes).some(t=>t.nodeType===Node.ELEMENT_NODE&&t.slot==="footer");return Io.html`
13064
13066
  <div class="backdrop" part="backdrop" @pointerdown=${this._onBackdropPointerDown}></div>
13065
- <div class="custom-backdrop" part="custom-backdrop" style=${this.backdropStyle||Ro.nothing} ?hidden=${this.backdrop!=="custom"} @pointerdown=${this._onBackdropPointerDown}>
13067
+ <div class="custom-backdrop" part="custom-backdrop" style=${this.backdropStyle||Io.nothing} ?hidden=${this.backdrop!=="custom"} @pointerdown=${this._onBackdropPointerDown}>
13066
13068
  <slot name="backdrop"></slot>
13067
13069
  </div>
13068
- <section class=${`panel ${this._opening?"opening":""} ${this._shaking?"shaking":""}`.trim()} part="panel" role="dialog" aria-modal="true" aria-label=${this.title||Ro.nothing}>
13070
+ <section class=${`panel ${this._opening?"opening":""} ${this._shaking?"shaking":""}`.trim()} part="panel" role="dialog" aria-modal="true" aria-label=${this.title||Io.nothing}>
13069
13071
  <header part="header">
13070
13072
  <slot name="title"><h3 part="title">${this.title}</h3></slot>
13071
- ${this.noClose?Ro.nothing:Ro.html`<lui-button class="close" part="close" variant="ghost" icon="x" icon-only aria-label=${this._t("dialog.close_aria","\u5173\u95ED")} @click=${()=>this.close()}></lui-button>`}
13073
+ ${this.noClose?Io.nothing:Io.html`<lui-button class="close" part="close" variant="ghost" icon="x" icon-only aria-label=${this._t("dialog.close_aria","\u5173\u95ED")} @click=${()=>this.close()}></lui-button>`}
13072
13074
  </header>
13073
13075
  <main part="body"><slot></slot></main>
13074
- ${e&&!this.noFooter?Ro.html`<footer part="footer"><slot name="footer"></slot></footer>`:Ro.nothing}
13076
+ ${e&&!this.noFooter?Io.html`<footer part="footer"><slot name="footer"></slot></footer>`:Io.nothing}
13075
13077
  </section>
13076
- `}};it.styles=[A,j,Ro.css`
13078
+ `}};it.styles=[A,j,Io.css`
13077
13079
  :host {
13078
13080
  position: fixed;
13079
13081
  inset: 0;
@@ -13713,7 +13715,7 @@
13713
13715
  --lui-color-fg: #fff;
13714
13716
  --lui-color-bg-hover: color-mix(in srgb, #fff 18%, transparent);
13715
13717
  }
13716
- `],a([(0,yo.property)({reflect:!0})],$r.prototype,"status",2),a([(0,yo.property)({reflect:!0})],$r.prototype,"variant",2),a([(0,yo.property)({reflect:!0})],$r.prototype,"radius",2),a([(0,yo.property)()],$r.prototype,"title",2),a([(0,yo.property)()],$r.prototype,"description",2),a([(0,yo.property)()],$r.prototype,"icon",2),a([(0,yo.property)({type:Boolean,attribute:"no-icon",reflect:!0})],$r.prototype,"noIcon",2),a([(0,yo.property)({type:Boolean,reflect:!0})],$r.prototype,"closable",2),a([(0,yo.property)({reflect:!0})],$r.prototype,"locale",2),a([(0,yo.property)({attribute:!1})],$r.prototype,"translations",2),a([(0,yo.state)()],$r.prototype,"_hasActions",2),$r=a([(0,yo.customElement)("lui-alert")],$r);var Wo=require("lit"),jt=require("lit/decorators.js");var bt=class extends Wo.LitElement{constructor(){super(...arguments);this.title="";this.description="";this.status="warning";this.icon="";this.noIcon=!1;this.placement="top";this.confirmText="";this.cancelText="";this.disabled=!1;this.portal=!0;this.offsetDistance=8;this._loading=!1;this._onCancel=()=>{this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0})),this.hide()};this._onConfirmClick=async()=>{if(this._loading)return;let e=new CustomEvent("confirm",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(e)){if(!this.onConfirm){this.hide();return}this._loading=!0;try{await this.onConfirm(),this.hide()}catch(t){this.dispatchEvent(new CustomEvent("confirm-error",{bubbles:!0,composed:!0,detail:{error:t}}))}finally{this._loading=!1}}}}connectedCallback(){super.connectedCallback(),this._localeCleanup=xe(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}show(){this._popover?.show()}hide(){this._popover?.hide()}render(){let e=L(this,"popconfirm"),t=Nn(this.status)??"warning",r=this.icon||Pi(t),n=!this.noIcon&&r!=="",s=this.confirmVariant??e.confirmVariant??(t==="danger"?"danger":"primary"),d=this.cancelVariant??e.cancelVariant??"ghost";return Wo.html`
13718
+ `],a([(0,yo.property)({reflect:!0})],$r.prototype,"status",2),a([(0,yo.property)({reflect:!0})],$r.prototype,"variant",2),a([(0,yo.property)({reflect:!0})],$r.prototype,"radius",2),a([(0,yo.property)()],$r.prototype,"title",2),a([(0,yo.property)()],$r.prototype,"description",2),a([(0,yo.property)()],$r.prototype,"icon",2),a([(0,yo.property)({type:Boolean,attribute:"no-icon",reflect:!0})],$r.prototype,"noIcon",2),a([(0,yo.property)({type:Boolean,reflect:!0})],$r.prototype,"closable",2),a([(0,yo.property)({reflect:!0})],$r.prototype,"locale",2),a([(0,yo.property)({attribute:!1})],$r.prototype,"translations",2),a([(0,yo.state)()],$r.prototype,"_hasActions",2),$r=a([(0,yo.customElement)("lui-alert")],$r);var Uo=require("lit"),jt=require("lit/decorators.js");var bt=class extends Uo.LitElement{constructor(){super(...arguments);this.title="";this.description="";this.status="warning";this.icon="";this.noIcon=!1;this.placement="top";this.confirmText="";this.cancelText="";this.disabled=!1;this.portal=!0;this.offsetDistance=8;this._loading=!1;this._onCancel=()=>{this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0})),this.hide()};this._onConfirmClick=async()=>{if(this._loading)return;let e=new CustomEvent("confirm",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(e)){if(!this.onConfirm){this.hide();return}this._loading=!0;try{await this.onConfirm(),this.hide()}catch(t){this.dispatchEvent(new CustomEvent("confirm-error",{bubbles:!0,composed:!0,detail:{error:t}}))}finally{this._loading=!1}}}}connectedCallback(){super.connectedCallback(),this._localeCleanup=xe(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}show(){this._popover?.show()}hide(){this._popover?.hide()}render(){let e=L(this,"popconfirm"),t=Nn(this.status)??"warning",r=this.icon||Pi(t),n=!this.noIcon&&r!=="",s=this.confirmVariant??e.confirmVariant??(t==="danger"?"danger":"primary"),d=this.cancelVariant??e.cancelVariant??"ghost";return Uo.html`
13717
13719
  <lui-popover
13718
13720
  trigger="click"
13719
13721
  .placement=${this.placement}
@@ -13727,17 +13729,17 @@
13727
13729
  <slot></slot>
13728
13730
  <div slot="content" role="alertdialog" aria-label=${this.title||this.description}>
13729
13731
  <div class="body">
13730
- ${n?Wo.html`
13732
+ ${n?Uo.html`
13731
13733
  <span
13732
13734
  class="glyph"
13733
13735
  style=${`color:var(--lui-color-${t});`}
13734
13736
  >
13735
13737
  <lui-icon name=${r}></lui-icon>
13736
13738
  </span>
13737
- `:Wo.nothing}
13739
+ `:Uo.nothing}
13738
13740
  <div class="text" ?data-titleless=${!this.title}>
13739
- ${this.title?Wo.html`<div class="title">${this.title}</div>`:Wo.nothing}
13740
- ${this.description?Wo.html`<div class="description">${this.description}</div>`:Wo.nothing}
13741
+ ${this.title?Uo.html`<div class="title">${this.title}</div>`:Uo.nothing}
13742
+ ${this.description?Uo.html`<div class="description">${this.description}</div>`:Uo.nothing}
13741
13743
  <slot name="content"></slot>
13742
13744
  </div>
13743
13745
  </div>
@@ -13761,7 +13763,7 @@
13761
13763
  </div>
13762
13764
  </div>
13763
13765
  </lui-popover>
13764
- `}};bt.styles=[A,j,Wo.css`
13766
+ `}};bt.styles=[A,j,Uo.css`
13765
13767
  :host {
13766
13768
  display: inline-flex;
13767
13769
  --lui-popconfirm-width: 260px;
@@ -14359,9 +14361,9 @@
14359
14361
  overscroll-behavior: contain;
14360
14362
  scrollbar-width: thin;
14361
14363
  }
14362
- `],a([(0,Ct.property)({attribute:!1})],pt.prototype,"nodes",2),a([(0,Ct.property)({attribute:!1})],pt.prototype,"value",2),a([(0,Ct.property)({reflect:!0})],pt.prototype,"mode",2),a([(0,Ct.property)({reflect:!0})],pt.prototype,"size",2),a([(0,Ct.property)()],pt.prototype,"placeholder",2),a([(0,Ct.property)({type:Boolean,reflect:!0})],pt.prototype,"disabled",2),a([(0,Ct.property)({type:Boolean,reflect:!0})],pt.prototype,"clearable",2),a([(0,Ct.property)({type:Boolean,reflect:!0})],pt.prototype,"invalid",2),a([(0,Ct.property)({type:Boolean,reflect:!0})],pt.prototype,"filterable",2),a([(0,Ct.property)({type:Boolean,attribute:"check-strictly"})],pt.prototype,"checkStrictly",2),a([(0,Ct.property)({attribute:!1})],pt.prototype,"childrenLoader",2),a([(0,Ct.property)({type:Boolean,attribute:"close-on-select"})],pt.prototype,"closeOnSelect",2),a([(0,Ct.property)({type:Boolean})],pt.prototype,"portal",2),a([(0,Ct.property)({type:Boolean,reflect:!0,attribute:"open"})],pt.prototype,"open",2),a([(0,Ct.property)({reflect:!0})],pt.prototype,"locale",2),a([(0,Ct.property)({attribute:!1})],pt.prototype,"translations",2),a([(0,Ct.state)()],pt.prototype,"_keys",2),a([(0,Ct.query)("lui-popover")],pt.prototype,"_popover",2),a([(0,Ct.query)("lui-tree")],pt.prototype,"_tree",2),pt=a([(0,Ct.customElement)("lui-tree-select")],pt);var Io=require("lit"),zt=require("lit/decorators.js");function Yg(i){return typeof i=="string"?{label:i,value:i}:i}var mt=class extends Io.LitElement{constructor(){super(...arguments);this.options=[];this.value="";this.placeholder="";this.size="md";this.disabled=!1;this.readonly=!1;this.clearable=!1;this.invalid=!1;this.minChars=1;this.maxItems=0;this.portal=!0;this._matches=[];this._activeIndex=-1;this._open=!1;this._queryToken=0;this._onInput=async e=>{e.stopPropagation();let t=e.target.value??"";this.value=t,this.dispatchEvent(new CustomEvent("input",{detail:{value:t},bubbles:!0,composed:!0})),await this._recompute(t),this._setOpen(this._shouldOpen(t)&&this._matches.length>0)};this._onFocus=async()=>{this.minChars>0&&!this.value||(await this._recompute(this.value),this._setOpen(this._shouldOpen(this.value)&&this._matches.length>0))};this._onKeyDown=e=>{if(e.key==="ArrowDown"||e.key==="ArrowUp"){if(!this._open){this._onFocus();return}e.preventDefault();let t=this._matches.length;if(!t)return;let r=e.key==="ArrowDown"?1:-1,n=this._activeIndex;for(let s=0;s<t&&(n=(n+r+t)%t,!!this._matches[n]?.disabled);s+=1);this._activeIndex=n;return}if(e.key==="Enter"){let t=this._matches[this._activeIndex];this._open&&t&&(e.preventDefault(),this._commit(t));return}if(e.key==="Escape"){this._open&&(e.stopPropagation(),this._setOpen(!1));return}e.key==="Tab"&&this._setOpen(!1)};this._onClear=()=>{this.value="",this._matches=[],this._setOpen(!1)}}connectedCallback(){super.connectedCallback(),this._localeCleanup=xe(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}get _pool(){return this.options.map(Yg)}_defaultFilter(e,t){if(!e)return t;let r=e.toLowerCase();return t.filter(n=>n.label.toLowerCase().includes(r))}async _recompute(e){let t=++this._queryToken,r=this._pool,n=this.filter?await this.filter(e,r):this._defaultFilter(e,r);if(t!==this._queryToken)return;let s=this.maxItems>0?n.slice(0,this.maxItems):n;this._matches=s,this._activeIndex=s.length?0:-1}_shouldOpen(e){return this.disabled||this.readonly?!1:e.length>=this.minChars}_setOpen(e){this._open!==e&&(this._open=e,e?this._popover?.show():this._popover?.hide())}_commit(e){e.disabled||(this.value=e.value,this._setOpen(!1),this.dispatchEvent(new CustomEvent("select",{detail:{value:e.value,option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0})))}_renderLabel(e){let t=this.value.trim();if(!t)return e;let r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:Io.html`${e.slice(0,r)}<span class="match"
14364
+ `],a([(0,Ct.property)({attribute:!1})],pt.prototype,"nodes",2),a([(0,Ct.property)({attribute:!1})],pt.prototype,"value",2),a([(0,Ct.property)({reflect:!0})],pt.prototype,"mode",2),a([(0,Ct.property)({reflect:!0})],pt.prototype,"size",2),a([(0,Ct.property)()],pt.prototype,"placeholder",2),a([(0,Ct.property)({type:Boolean,reflect:!0})],pt.prototype,"disabled",2),a([(0,Ct.property)({type:Boolean,reflect:!0})],pt.prototype,"clearable",2),a([(0,Ct.property)({type:Boolean,reflect:!0})],pt.prototype,"invalid",2),a([(0,Ct.property)({type:Boolean,reflect:!0})],pt.prototype,"filterable",2),a([(0,Ct.property)({type:Boolean,attribute:"check-strictly"})],pt.prototype,"checkStrictly",2),a([(0,Ct.property)({attribute:!1})],pt.prototype,"childrenLoader",2),a([(0,Ct.property)({type:Boolean,attribute:"close-on-select"})],pt.prototype,"closeOnSelect",2),a([(0,Ct.property)({type:Boolean})],pt.prototype,"portal",2),a([(0,Ct.property)({type:Boolean,reflect:!0,attribute:"open"})],pt.prototype,"open",2),a([(0,Ct.property)({reflect:!0})],pt.prototype,"locale",2),a([(0,Ct.property)({attribute:!1})],pt.prototype,"translations",2),a([(0,Ct.state)()],pt.prototype,"_keys",2),a([(0,Ct.query)("lui-popover")],pt.prototype,"_popover",2),a([(0,Ct.query)("lui-tree")],pt.prototype,"_tree",2),pt=a([(0,Ct.customElement)("lui-tree-select")],pt);var Vo=require("lit"),zt=require("lit/decorators.js");function Yg(i){return typeof i=="string"?{label:i,value:i}:i}var mt=class extends Vo.LitElement{constructor(){super(...arguments);this.options=[];this.value="";this.placeholder="";this.size="md";this.disabled=!1;this.readonly=!1;this.clearable=!1;this.invalid=!1;this.minChars=1;this.maxItems=0;this.portal=!0;this._matches=[];this._activeIndex=-1;this._open=!1;this._queryToken=0;this._onInput=async e=>{e.stopPropagation();let t=e.target.value??"";this.value=t,this.dispatchEvent(new CustomEvent("input",{detail:{value:t},bubbles:!0,composed:!0})),await this._recompute(t),this._setOpen(this._shouldOpen(t)&&this._matches.length>0)};this._onFocus=async()=>{this.minChars>0&&!this.value||(await this._recompute(this.value),this._setOpen(this._shouldOpen(this.value)&&this._matches.length>0))};this._onKeyDown=e=>{if(e.key==="ArrowDown"||e.key==="ArrowUp"){if(!this._open){this._onFocus();return}e.preventDefault();let t=this._matches.length;if(!t)return;let r=e.key==="ArrowDown"?1:-1,n=this._activeIndex;for(let s=0;s<t&&(n=(n+r+t)%t,!!this._matches[n]?.disabled);s+=1);this._activeIndex=n;return}if(e.key==="Enter"){let t=this._matches[this._activeIndex];this._open&&t&&(e.preventDefault(),this._commit(t));return}if(e.key==="Escape"){this._open&&(e.stopPropagation(),this._setOpen(!1));return}e.key==="Tab"&&this._setOpen(!1)};this._onClear=()=>{this.value="",this._matches=[],this._setOpen(!1)}}connectedCallback(){super.connectedCallback(),this._localeCleanup=xe(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}get _pool(){return this.options.map(Yg)}_defaultFilter(e,t){if(!e)return t;let r=e.toLowerCase();return t.filter(n=>n.label.toLowerCase().includes(r))}async _recompute(e){let t=++this._queryToken,r=this._pool,n=this.filter?await this.filter(e,r):this._defaultFilter(e,r);if(t!==this._queryToken)return;let s=this.maxItems>0?n.slice(0,this.maxItems):n;this._matches=s,this._activeIndex=s.length?0:-1}_shouldOpen(e){return this.disabled||this.readonly?!1:e.length>=this.minChars}_setOpen(e){this._open!==e&&(this._open=e,e?this._popover?.show():this._popover?.hide())}_commit(e){e.disabled||(this.value=e.value,this._setOpen(!1),this.dispatchEvent(new CustomEvent("select",{detail:{value:e.value,option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0})))}_renderLabel(e){let t=this.value.trim();if(!t)return e;let r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:Vo.html`${e.slice(0,r)}<span class="match"
14363
14365
  >${e.slice(r,r+t.length)}</span
14364
- >${e.slice(r+t.length)}`}render(){let t=L(this,"autocomplete").size??this.size;return Io.html`
14366
+ >${e.slice(r+t.length)}`}render(){let t=L(this,"autocomplete").size??this.size;return Vo.html`
14365
14367
  <lui-popover
14366
14368
  trigger="manual"
14367
14369
  placement="bottom-start"
@@ -14392,7 +14394,7 @@
14392
14394
  @clear=${this._onClear}
14393
14395
  ></lui-input>
14394
14396
  <div slot="content" class="panel" role="listbox">
14395
- ${this._matches.length?this._matches.map((r,n)=>Io.html`
14397
+ ${this._matches.length?this._matches.map((r,n)=>Vo.html`
14396
14398
  <div
14397
14399
  class="option option-row"
14398
14400
  role="option"
@@ -14402,16 +14404,16 @@
14402
14404
  @mouseenter=${()=>{r.disabled||(this._activeIndex=n)}}
14403
14405
  @click=${()=>this._commit(r)}
14404
14406
  >
14405
- ${r.icon?Io.html`<lui-icon name=${r.icon}></lui-icon>`:Io.nothing}
14407
+ ${r.icon?Vo.html`<lui-icon name=${r.icon}></lui-icon>`:Vo.nothing}
14406
14408
  <span class="option-text">
14407
14409
  <span class="option-label">${this._renderLabel(r.label)}</span>
14408
- ${r.description?Io.html`<span class="option-description">${r.description}</span>`:Io.nothing}
14410
+ ${r.description?Vo.html`<span class="option-description">${r.description}</span>`:Vo.nothing}
14409
14411
  </span>
14410
14412
  </div>
14411
- `):Io.html`<div class="empty">${this._t("select.empty","\u65E0\u5339\u914D\u9879")}</div>`}
14413
+ `):Vo.html`<div class="empty">${this._t("select.empty","\u65E0\u5339\u914D\u9879")}</div>`}
14412
14414
  </div>
14413
14415
  </lui-popover>
14414
- `}};mt.styles=[A,j,$n,Io.css`
14416
+ `}};mt.styles=[A,j,$n,Vo.css`
14415
14417
  :host {
14416
14418
  display: inline-block;
14417
14419
  width: 100%;
@@ -14467,7 +14469,7 @@
14467
14469
  font-size: var(--lui-font-size-sm);
14468
14470
  text-align: center;
14469
14471
  }
14470
- `],a([(0,zt.property)({attribute:!1})],mt.prototype,"options",2),a([(0,zt.property)()],mt.prototype,"value",2),a([(0,zt.property)()],mt.prototype,"placeholder",2),a([(0,zt.property)({reflect:!0})],mt.prototype,"size",2),a([(0,zt.property)({type:Boolean,reflect:!0})],mt.prototype,"disabled",2),a([(0,zt.property)({type:Boolean,reflect:!0})],mt.prototype,"readonly",2),a([(0,zt.property)({type:Boolean,reflect:!0})],mt.prototype,"clearable",2),a([(0,zt.property)({type:Boolean,reflect:!0})],mt.prototype,"invalid",2),a([(0,zt.property)({type:Number,attribute:"min-chars"})],mt.prototype,"minChars",2),a([(0,zt.property)({type:Number,attribute:"max-items"})],mt.prototype,"maxItems",2),a([(0,zt.property)({attribute:!1})],mt.prototype,"filter",2),a([(0,zt.property)({type:Boolean})],mt.prototype,"portal",2),a([(0,zt.property)({reflect:!0})],mt.prototype,"locale",2),a([(0,zt.property)({attribute:!1})],mt.prototype,"translations",2),a([(0,zt.state)()],mt.prototype,"_matches",2),a([(0,zt.state)()],mt.prototype,"_activeIndex",2),a([(0,zt.state)()],mt.prototype,"_open",2),a([(0,zt.query)("lui-popover")],mt.prototype,"_popover",2),a([(0,zt.query)("lui-input")],mt.prototype,"_input",2),mt=a([(0,zt.customElement)("lui-autocomplete")],mt);var _d=xn(ia(),1),Zi=require("lit"),Vo=require("lit/decorators.js");var ro=class extends Zi.LitElement{constructor(){super(...arguments);this.orientation="horizontal";this.percent=50;this.minFirst=80;this.minSecond=80;this.disabled=!1;this.noGrip=!1;this._dragging=!1;this._interact=null;this._origin={total:0,percent:50};this._onKeyDown=e=>{if(this.disabled)return;let t=this._isHorizontal?"ArrowLeft":"ArrowUp",r=this._isHorizontal?"ArrowRight":"ArrowDown",n=null;if(e.key===t?n=this.percent-(e.shiftKey?10:2):e.key===r?n=this.percent+(e.shiftKey?10:2):e.key==="Home"?n=0:e.key==="End"&&(n=100),n===null)return;e.preventDefault();let s=this._root?.getBoundingClientRect(),d=(this._isHorizontal?s?.width:s?.height)??0,h=this._clampPercent(n,d);h!==this.percent&&(this.percent=h,this._emit("resize"),this._emit("change"))}}disconnectedCallback(){super.disconnectedCallback(),this._teardown()}firstUpdated(){this._setup()}updated(e){(e.has("disabled")||e.has("orientation"))&&(this._teardown(),this._setup())}get _isHorizontal(){return this.orientation!=="vertical"}_pxMin(e,t){let r=Ot(e);if(r.endsWith("%")){let s=Number.parseFloat(r)/100;return Number.isFinite(s)?t*s:0}let n=Number.parseFloat(r);return Number.isFinite(n)?n:0}_clampPercent(e,t){if(t<=0)return Math.min(100,Math.max(0,e));let r=this._gutter?.getBoundingClientRect(),n=(this._isHorizontal?r?.width:r?.height)??0,s=Math.max(0,t-n),d=this._pxMin(this.minFirst,s),h=this._pxMin(this.minSecond,s);if(d+h>=s)return 50;let p=d/s*100,f=100-h/s*100;return Math.min(f,Math.max(p,e))}_setup(){let e=this._gutter;!e||this.disabled||(this._interact=(0,_d.default)(e).draggable({inertia:!1,modifiers:[_d.default.modifiers.restrict({restriction:"parent"})],listeners:{start:()=>{let t=this._root?.getBoundingClientRect();this._origin={total:(this._isHorizontal?t?.width:t?.height)??0,percent:this.percent},this._dragging=!0,this.toggleAttribute("data-dragging",!0)},move:t=>{let{total:r}=this._origin;if(r<=0)return;let n=this._isHorizontal?t.dx:t.dy,s=this._clampPercent(this.percent+n/r*100,r);s!==this.percent&&(this.percent=s,this._emit("resize"))},end:()=>{this._dragging=!1,this.toggleAttribute("data-dragging",!1),this._emit("change")}}}))}_teardown(){this._interact?.unset(),this._interact=null,this.toggleAttribute("data-dragging",!1)}_emit(e){let t=this._root?.getBoundingClientRect(),r=(this._isHorizontal?t?.width:t?.height)??0;this.dispatchEvent(new CustomEvent(e,{detail:{percent:this.percent,size:r*this.percent/100},bubbles:!0,composed:!0}))}render(){let t=L(this,"splitter").orientation??this.orientation;return Zi.html`
14472
+ `],a([(0,zt.property)({attribute:!1})],mt.prototype,"options",2),a([(0,zt.property)()],mt.prototype,"value",2),a([(0,zt.property)()],mt.prototype,"placeholder",2),a([(0,zt.property)({reflect:!0})],mt.prototype,"size",2),a([(0,zt.property)({type:Boolean,reflect:!0})],mt.prototype,"disabled",2),a([(0,zt.property)({type:Boolean,reflect:!0})],mt.prototype,"readonly",2),a([(0,zt.property)({type:Boolean,reflect:!0})],mt.prototype,"clearable",2),a([(0,zt.property)({type:Boolean,reflect:!0})],mt.prototype,"invalid",2),a([(0,zt.property)({type:Number,attribute:"min-chars"})],mt.prototype,"minChars",2),a([(0,zt.property)({type:Number,attribute:"max-items"})],mt.prototype,"maxItems",2),a([(0,zt.property)({attribute:!1})],mt.prototype,"filter",2),a([(0,zt.property)({type:Boolean})],mt.prototype,"portal",2),a([(0,zt.property)({reflect:!0})],mt.prototype,"locale",2),a([(0,zt.property)({attribute:!1})],mt.prototype,"translations",2),a([(0,zt.state)()],mt.prototype,"_matches",2),a([(0,zt.state)()],mt.prototype,"_activeIndex",2),a([(0,zt.state)()],mt.prototype,"_open",2),a([(0,zt.query)("lui-popover")],mt.prototype,"_popover",2),a([(0,zt.query)("lui-input")],mt.prototype,"_input",2),mt=a([(0,zt.customElement)("lui-autocomplete")],mt);var _d=xn(ia(),1),Zi=require("lit"),Do=require("lit/decorators.js");var ro=class extends Zi.LitElement{constructor(){super(...arguments);this.orientation="horizontal";this.percent=50;this.minFirst=80;this.minSecond=80;this.disabled=!1;this.noGrip=!1;this._dragging=!1;this._interact=null;this._origin={total:0,percent:50};this._onKeyDown=e=>{if(this.disabled)return;let t=this._isHorizontal?"ArrowLeft":"ArrowUp",r=this._isHorizontal?"ArrowRight":"ArrowDown",n=null;if(e.key===t?n=this.percent-(e.shiftKey?10:2):e.key===r?n=this.percent+(e.shiftKey?10:2):e.key==="Home"?n=0:e.key==="End"&&(n=100),n===null)return;e.preventDefault();let s=this._root?.getBoundingClientRect(),d=(this._isHorizontal?s?.width:s?.height)??0,h=this._clampPercent(n,d);h!==this.percent&&(this.percent=h,this._emit("resize"),this._emit("change"))}}disconnectedCallback(){super.disconnectedCallback(),this._teardown()}firstUpdated(){this._setup()}updated(e){(e.has("disabled")||e.has("orientation"))&&(this._teardown(),this._setup())}get _isHorizontal(){return this.orientation!=="vertical"}_pxMin(e,t){let r=Ot(e);if(r.endsWith("%")){let s=Number.parseFloat(r)/100;return Number.isFinite(s)?t*s:0}let n=Number.parseFloat(r);return Number.isFinite(n)?n:0}_clampPercent(e,t){if(t<=0)return Math.min(100,Math.max(0,e));let r=this._gutter?.getBoundingClientRect(),n=(this._isHorizontal?r?.width:r?.height)??0,s=Math.max(0,t-n),d=this._pxMin(this.minFirst,s),h=this._pxMin(this.minSecond,s);if(d+h>=s)return 50;let p=d/s*100,f=100-h/s*100;return Math.min(f,Math.max(p,e))}_setup(){let e=this._gutter;!e||this.disabled||(this._interact=(0,_d.default)(e).draggable({inertia:!1,modifiers:[_d.default.modifiers.restrict({restriction:"parent"})],listeners:{start:()=>{let t=this._root?.getBoundingClientRect();this._origin={total:(this._isHorizontal?t?.width:t?.height)??0,percent:this.percent},this._dragging=!0,this.toggleAttribute("data-dragging",!0)},move:t=>{let{total:r}=this._origin;if(r<=0)return;let n=this._isHorizontal?t.dx:t.dy,s=this._clampPercent(this.percent+n/r*100,r);s!==this.percent&&(this.percent=s,this._emit("resize"))},end:()=>{this._dragging=!1,this.toggleAttribute("data-dragging",!1),this._emit("change")}}}))}_teardown(){this._interact?.unset(),this._interact=null,this.toggleAttribute("data-dragging",!1)}_emit(e){let t=this._root?.getBoundingClientRect(),r=(this._isHorizontal?t?.width:t?.height)??0;this.dispatchEvent(new CustomEvent(e,{detail:{percent:this.percent,size:r*this.percent/100},bubbles:!0,composed:!0}))}render(){let t=L(this,"splitter").orientation??this.orientation;return Zi.html`
14471
14473
  <div class="root" style=${`--lui-splitter-first:${this.percent}%;`}>
14472
14474
  <div part="pane first"><slot name="first"></slot></div>
14473
14475
  <div
@@ -14570,7 +14572,7 @@
14570
14572
  user-select: none;
14571
14573
  pointer-events: none;
14572
14574
  }
14573
- `],a([(0,Vo.property)({reflect:!0})],ro.prototype,"orientation",2),a([(0,Vo.property)({type:Number})],ro.prototype,"percent",2),a([(0,Vo.property)({attribute:"min-first"})],ro.prototype,"minFirst",2),a([(0,Vo.property)({attribute:"min-second"})],ro.prototype,"minSecond",2),a([(0,Vo.property)({type:Boolean,reflect:!0})],ro.prototype,"disabled",2),a([(0,Vo.property)({type:Boolean,attribute:"no-grip",reflect:!0})],ro.prototype,"noGrip",2),a([(0,Vo.state)()],ro.prototype,"_dragging",2),a([(0,Vo.query)('[part="gutter"]')],ro.prototype,"_gutter",2),a([(0,Vo.query)(".root")],ro.prototype,"_root",2),ro=a([(0,Vo.customElement)("lui-splitter")],ro);var xo=require("lit"),oo=require("lit/decorators.js");var i1=["L","M","Q","H"],n1=[[[7,1,19,0,0],[10,1,16,0,0],[13,1,13,0,0],[17,1,9,0,0]],[[10,1,34,0,0],[16,1,28,0,0],[22,1,22,0,0],[28,1,16,0,0]],[[15,1,55,0,0],[26,1,44,0,0],[18,2,17,0,0],[22,2,13,0,0]],[[20,1,80,0,0],[18,2,32,0,0],[26,2,24,0,0],[16,4,9,0,0]],[[26,1,108,0,0],[24,2,43,0,0],[18,2,15,2,16],[22,2,11,2,12]],[[18,2,68,0,0],[16,4,27,0,0],[24,4,19,0,0],[28,4,15,0,0]],[[20,2,78,0,0],[18,4,31,0,0],[18,2,14,4,15],[26,4,13,1,14]],[[24,2,97,0,0],[22,2,38,2,39],[22,4,18,2,19],[26,4,14,2,15]],[[30,2,116,0,0],[22,3,36,2,37],[20,4,16,4,17],[24,4,12,4,13]],[[18,2,68,2,69],[26,4,43,1,44],[24,6,19,2,20],[28,6,15,2,16]],[[20,4,81,0,0],[30,1,50,4,51],[28,4,22,4,23],[24,3,12,8,13]],[[24,2,92,2,93],[22,6,36,2,37],[26,4,20,6,21],[28,7,14,4,15]],[[26,4,107,0,0],[22,8,37,1,38],[24,8,20,4,21],[22,12,11,4,12]],[[30,3,115,1,116],[24,4,40,5,41],[20,11,16,5,17],[24,11,12,5,13]],[[22,5,87,1,88],[24,5,41,5,42],[30,5,24,7,25],[24,11,12,7,13]],[[24,5,98,1,99],[28,7,45,3,46],[24,15,19,2,20],[30,3,15,13,16]],[[28,1,107,5,108],[28,10,46,1,47],[28,1,22,15,23],[28,2,14,17,15]],[[30,5,120,1,121],[26,9,43,4,44],[28,17,22,1,23],[28,2,14,19,15]],[[28,3,113,4,114],[26,3,44,11,45],[26,17,21,4,22],[26,9,13,16,14]],[[28,3,107,5,108],[26,3,41,13,42],[30,15,24,5,25],[28,15,15,10,16]],[[28,4,116,4,117],[26,17,42,0,0],[28,17,22,6,23],[30,19,16,6,17]],[[28,2,111,7,112],[28,17,46,0,0],[30,7,24,16,25],[24,34,13,0,0]],[[30,4,121,5,122],[28,4,47,14,48],[30,11,24,14,25],[30,16,15,14,16]],[[30,6,117,4,118],[28,6,45,14,46],[30,11,24,16,25],[30,30,16,2,17]],[[26,8,106,4,107],[28,8,47,13,48],[30,7,24,22,25],[30,22,15,13,16]],[[28,10,114,2,115],[28,19,46,4,47],[28,28,22,6,23],[30,33,16,4,17]],[[30,8,122,4,123],[28,22,45,3,46],[30,8,23,26,24],[30,12,15,28,16]],[[30,3,117,10,118],[28,3,45,23,46],[30,4,24,31,25],[30,11,15,31,16]],[[30,7,116,7,117],[28,21,45,7,46],[30,1,23,37,24],[30,19,15,26,16]],[[30,5,115,10,116],[28,19,47,10,48],[30,15,24,25,25],[30,23,15,25,16]],[[30,13,115,3,116],[28,2,46,29,47],[30,42,24,1,25],[30,23,15,28,16]],[[30,17,115,0,0],[28,10,46,23,47],[30,10,24,35,25],[30,19,15,35,16]],[[30,17,115,1,116],[28,14,46,21,47],[30,29,24,19,25],[30,11,15,46,16]],[[30,13,115,6,116],[28,14,46,23,47],[30,44,24,7,25],[30,59,16,1,17]],[[30,12,121,7,122],[28,12,47,26,48],[30,39,24,14,25],[30,22,15,41,16]],[[30,6,121,14,122],[28,6,47,34,48],[30,46,24,10,25],[30,2,15,64,16]],[[30,17,122,4,123],[28,29,46,14,47],[30,49,24,10,25],[30,24,15,46,16]],[[30,4,122,18,123],[28,13,46,32,47],[30,48,24,14,25],[30,42,15,32,16]],[[30,20,117,4,118],[28,40,47,7,48],[30,43,24,22,25],[30,10,15,67,16]],[[30,19,118,6,119],[28,18,47,31,48],[30,34,24,34,25],[30,20,15,61,16]]],Xg=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],Zg=[31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017],Qg=21522,Jg={L:1,M:0,Q:3,H:2},ys=new Uint8Array(512),Cd=new Uint8Array(256);{let i=1;for(let o=0;o<255;o+=1)ys[o]=i,Cd[i]=o,i<<=1,i&256&&(i^=285);for(let o=255;o<512;o+=1)ys[o]=ys[o-255]}function a1(i,o){return i===0||o===0?0:ys[Cd[i]+Cd[o]]}function ef(i){let o=new Uint8Array([1]);for(let e=0;e<i;e+=1){let t=new Uint8Array(o.length+1);for(let r=0;r<o.length;r+=1)t[r]^=o[r],t[r+1]^=a1(o[r],ys[e]);o=t}return o}function tf(i,o){let e=ef(o),t=new Uint8Array(o);for(let r of i){let n=r^t[0];t.copyWithin(0,1),t[o-1]=0;for(let s=0;s<o;s+=1)t[s]^=a1(e[s+1],n)}return t}var zd=class{constructor(){this._bits=[]}get length(){return this._bits.length}push(o,e){for(let t=e-1;t>=0;t-=1)this._bits.push(o>>>t&1)}toBytes(){let o=new Uint8Array(Math.ceil(this._bits.length/8));return this._bits.forEach((e,t)=>{e&&(o[t>>>3]|=128>>>(t&7))}),o}};function Ed(i,o){let[,e,t,r,n]=n1[i-1][i1.indexOf(o)];return e*t+r*n}function Sd(i){return i<10?8:16}function rf(i,o){for(let e=1;e<=40;e+=1)if(4+Sd(e)+i*8<=Ed(e,o)*8)return e;throw new Error(`qrcode: ${i} bytes exceeds the capacity of a version 40 symbol at error correction level ${o}`)}function of(i,o,e){let t=Ed(o,e)*8,r=new zd;r.push(4,4),r.push(i.length,Sd(o));for(let z of i)r.push(z,8);r.push(0,Math.min(4,t-r.length)),r.length%8!==0&&r.push(0,8-r.length%8);let n=Array.from(r.toBytes());for(let z=0;n.length<t/8;z+=1)n.push(z%2===0?236:17);let[s,d,h,p,f]=n1[o-1][i1.indexOf(e)],x=[],k=0;for(let[z,T]of[[d,h],[p,f]])for(let P=0;P<z;P+=1){let H=new Uint8Array(n.slice(k,k+T));k+=T,x.push({data:H,ec:tf(H,s)})}let C=[],S=Math.max(...x.map(z=>z.data.length));for(let z=0;z<S;z+=1)for(let T of x)z<T.data.length&&C.push(T.data[z]);for(let z=0;z<s;z+=1)for(let T of x)C.push(T.ec[z]);return new Uint8Array(C)}function nf(i){let o=i*4+17;return{size:o,modules:Array.from({length:o},()=>Array(o).fill(null)),reserved:Array.from({length:o},()=>Array(o).fill(!1))}}function Ci(i,o,e,t){i.modules[e][o]=t,i.reserved[e][o]=!0}function Md(i,o,e){for(let t=-1;t<=7;t+=1)for(let r=-1;r<=7;r+=1){let n=o+r,s=e+t;if(n<0||s<0||n>=i.size||s>=i.size)continue;let d=r>=0&&r<=6&&t>=0&&t<=6,h=Math.max(Math.abs(r-3),Math.abs(t-3));Ci(i,n,s,d&&h!==2)}}function af(i,o){Md(i,0,0),Md(i,i.size-7,0),Md(i,0,i.size-7);for(let t=8;t<i.size-8;t+=1){let r=t%2===0;Ci(i,t,6,r),Ci(i,6,t,r)}let e=Xg[o-1];for(let t of e)for(let r of e)if(!(r===6&&t===6||r===6&&t===i.size-7||r===i.size-7&&t===6))for(let s=-2;s<=2;s+=1)for(let d=-2;d<=2;d+=1){let h=Math.max(Math.abs(d),Math.abs(s));Ci(i,r+d,t+s,h!==1)}for(let t=0;t<9;t+=1)t!==6&&(Ci(i,t,8,!1),Ci(i,8,t,!1));for(let t=0;t<8;t+=1)Ci(i,i.size-1-t,8,!1);for(let t=0;t<7;t+=1)Ci(i,8,i.size-1-t,!1);if(Ci(i,8,i.size-8,!0),o>=7){let t=Zg[o-7];for(let r=0;r<18;r+=1){let n=(t>>>r&1)===1,s=Math.floor(r/3),d=r%3+i.size-11;Ci(i,s,d,n),Ci(i,d,s,n)}}}function sf(i,o){let e=0,t=!0;for(let r=i.size-1;r>=1;r-=2){let n=r===6?5:r;for(let s=0;s<i.size;s+=1){let d=t?i.size-1-s:s;for(let h of[n,n-1]){if(i.reserved[d][h])continue;let p=o[e>>>3]??0;i.modules[d][h]=(p>>>7-(e&7)&1)===1,e+=1}}t=!t}}function lf(i,o,e){switch(i){case 0:return(o+e)%2===0;case 1:return e%2===0;case 2:return o%3===0;case 3:return(o+e)%3===0;case 4:return(Math.floor(e/2)+Math.floor(o/3))%2===0;case 5:return o*e%2+o*e%3===0;case 6:return(o*e%2+o*e%3)%2===0;default:return((o+e)%2+o*e%3)%2===0}}function cf(i,o,e){let t=Jg[o]<<3|e,r=t;for(let s=0;s<10;s+=1)r=r<<1^(r>>>9)*1335;let n=(t<<10|r)^Qg;for(let s=0;s<=5;s+=1)i.modules[8][s]=(n>>>s&1)===1;i.modules[8][7]=(n>>>6&1)===1,i.modules[8][8]=(n>>>7&1)===1,i.modules[7][8]=(n>>>8&1)===1;for(let s=9;s<15;s+=1)i.modules[14-s][8]=(n>>>s&1)===1;for(let s=0;s<7;s+=1)i.modules[i.size-1-s][8]=(n>>>s&1)===1;for(let s=8;s<15;s+=1)i.modules[8][i.size-15+s]=(n>>>s&1)===1}function df(i){let o=i.length,e=0,t=h=>{let p=0,f=1;for(let x=1;x<o;x+=1)h[x]===h[x-1]?(f+=1,f===5?p+=3:f>5&&(p+=1)):f=1;return p};for(let h=0;h<o;h+=1)e+=t(i[h]),e+=t(i.map(p=>p[h]));for(let h=0;h<o-1;h+=1)for(let p=0;p<o-1;p+=1){let f=i[h][p];f===i[h][p+1]&&f===i[h+1][p]&&f===i[h+1][p+1]&&(e+=3)}let r=[!0,!1,!0,!0,!0,!1,!0],n=(h,p)=>r.every((f,x)=>h[p+x]===f);for(let h=0;h<o;h+=1){let p=i[h],f=i.map(x=>x[h]);for(let x=0;x+7<=o;x+=1)n(p,x)&&(e+=40),n(f,x)&&(e+=40)}let d=i.flat().filter(Boolean).length*100/(o*o);return e+=Math.floor(Math.abs(d-50)/5)*10,e}function zl(i,o={}){let e=o.errorCorrection??"M",t=new TextEncoder().encode(i),r=o.version??rf(t.length,e);if(r<1||r>40||!Number.isInteger(r))throw new Error(`qrcode: version must be an integer from 1 to 40, received ${r}`);if(4+Sd(r)+t.length*8>Ed(r,e)*8)throw new Error(`qrcode: ${t.length} bytes does not fit a version ${r} symbol at error correction level ${e}`);let s=of(t,r,e),d=nf(r);af(d,r),sf(d,s);let h=null;for(let p=0;p<8;p+=1){let f=d.modules.map((S,z)=>S.map((T,P)=>d.reserved[z][P]?!!T:!!T!==lf(p,P,z))),x={...d,modules:f};cf(x,e,p);let k=x.modules.map(S=>S.map(Boolean)),C=df(k);(!h||C<h.score)&&(h={matrix:k,score:C})}return{matrix:h.matrix,size:d.size,version:r,errorCorrection:e}}var pr=class extends xo.LitElement{constructor(){super(...arguments);this.value="";this.errorCorrection="M";this.margin=4;this.logo="";this.logoRatio=.2;this._error=""}connectedCallback(){super.connectedCallback(),this._localeCleanup=xe(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}get _effectiveErrorCorrection(){if(!this.logo)return this.errorCorrection;let e=this._cappedLogoRatio>.22?"H":"Q",t=["L","M","Q","H"];return t.indexOf(this.errorCorrection)>=t.indexOf(e)?this.errorCorrection:e}get _cappedLogoRatio(){return Math.min(Math.max(this.logoRatio,0),.3)}get _cssSize(){return this.size===void 0||this.size===""?"":Ot(this.size)}toDataUrl(){let e=this._svgMarkup();return e?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`:""}_svgMarkup(){try{let{matrix:e,size:t}=zl(this.value,{errorCorrection:this._effectiveErrorCorrection,version:this.version}),r=Math.max(0,Math.floor(this.margin)),n=t+r*2,s=this.color||"currentColor",d=this.background||"transparent",h="";return e.forEach((p,f)=>{p.forEach((x,k)=>{x&&(h+=`M${k+r} ${f+r}h1v1h-1z`)})}),[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${n} ${n}"`,' shape-rendering="crispEdges">',`<rect width="${n}" height="${n}" fill="${d}"/>`,`<path d="${h}" fill="${s}"/>`,"</svg>"].join("")}catch{return""}}render(){let e=L(this,"qrcode"),t=Math.max(0,Math.floor(this.margin)),r=this._cssSize||e.size||"",n=null,s="";if(!this.value)s=this._t("qrcode.empty","\u65E0\u5185\u5BB9");else try{n=zl(this.value,{errorCorrection:this._effectiveErrorCorrection,version:this.version})}catch(p){s=p instanceof Error?p.message:String(p)}s!==this._error&&(this._error=s,s&&this.value&&this.dispatchEvent(new CustomEvent("error",{detail:{message:s},bubbles:!0,composed:!0})));let d=[r?`--lui-qrcode-size:${r}`:"",this.background?`--lui-qrcode-bg:${this.background}`:"",this.color?`--lui-qrcode-fg:${this.color}`:"",this.logo?`--lui-qrcode-logo-size:${this._cappedLogoRatio*100}%`:""].filter(Boolean).join(";");if(!n)return xo.html`
14575
+ `],a([(0,Do.property)({reflect:!0})],ro.prototype,"orientation",2),a([(0,Do.property)({type:Number})],ro.prototype,"percent",2),a([(0,Do.property)({attribute:"min-first"})],ro.prototype,"minFirst",2),a([(0,Do.property)({attribute:"min-second"})],ro.prototype,"minSecond",2),a([(0,Do.property)({type:Boolean,reflect:!0})],ro.prototype,"disabled",2),a([(0,Do.property)({type:Boolean,attribute:"no-grip",reflect:!0})],ro.prototype,"noGrip",2),a([(0,Do.state)()],ro.prototype,"_dragging",2),a([(0,Do.query)('[part="gutter"]')],ro.prototype,"_gutter",2),a([(0,Do.query)(".root")],ro.prototype,"_root",2),ro=a([(0,Do.customElement)("lui-splitter")],ro);var xo=require("lit"),oo=require("lit/decorators.js");var i1=["L","M","Q","H"],n1=[[[7,1,19,0,0],[10,1,16,0,0],[13,1,13,0,0],[17,1,9,0,0]],[[10,1,34,0,0],[16,1,28,0,0],[22,1,22,0,0],[28,1,16,0,0]],[[15,1,55,0,0],[26,1,44,0,0],[18,2,17,0,0],[22,2,13,0,0]],[[20,1,80,0,0],[18,2,32,0,0],[26,2,24,0,0],[16,4,9,0,0]],[[26,1,108,0,0],[24,2,43,0,0],[18,2,15,2,16],[22,2,11,2,12]],[[18,2,68,0,0],[16,4,27,0,0],[24,4,19,0,0],[28,4,15,0,0]],[[20,2,78,0,0],[18,4,31,0,0],[18,2,14,4,15],[26,4,13,1,14]],[[24,2,97,0,0],[22,2,38,2,39],[22,4,18,2,19],[26,4,14,2,15]],[[30,2,116,0,0],[22,3,36,2,37],[20,4,16,4,17],[24,4,12,4,13]],[[18,2,68,2,69],[26,4,43,1,44],[24,6,19,2,20],[28,6,15,2,16]],[[20,4,81,0,0],[30,1,50,4,51],[28,4,22,4,23],[24,3,12,8,13]],[[24,2,92,2,93],[22,6,36,2,37],[26,4,20,6,21],[28,7,14,4,15]],[[26,4,107,0,0],[22,8,37,1,38],[24,8,20,4,21],[22,12,11,4,12]],[[30,3,115,1,116],[24,4,40,5,41],[20,11,16,5,17],[24,11,12,5,13]],[[22,5,87,1,88],[24,5,41,5,42],[30,5,24,7,25],[24,11,12,7,13]],[[24,5,98,1,99],[28,7,45,3,46],[24,15,19,2,20],[30,3,15,13,16]],[[28,1,107,5,108],[28,10,46,1,47],[28,1,22,15,23],[28,2,14,17,15]],[[30,5,120,1,121],[26,9,43,4,44],[28,17,22,1,23],[28,2,14,19,15]],[[28,3,113,4,114],[26,3,44,11,45],[26,17,21,4,22],[26,9,13,16,14]],[[28,3,107,5,108],[26,3,41,13,42],[30,15,24,5,25],[28,15,15,10,16]],[[28,4,116,4,117],[26,17,42,0,0],[28,17,22,6,23],[30,19,16,6,17]],[[28,2,111,7,112],[28,17,46,0,0],[30,7,24,16,25],[24,34,13,0,0]],[[30,4,121,5,122],[28,4,47,14,48],[30,11,24,14,25],[30,16,15,14,16]],[[30,6,117,4,118],[28,6,45,14,46],[30,11,24,16,25],[30,30,16,2,17]],[[26,8,106,4,107],[28,8,47,13,48],[30,7,24,22,25],[30,22,15,13,16]],[[28,10,114,2,115],[28,19,46,4,47],[28,28,22,6,23],[30,33,16,4,17]],[[30,8,122,4,123],[28,22,45,3,46],[30,8,23,26,24],[30,12,15,28,16]],[[30,3,117,10,118],[28,3,45,23,46],[30,4,24,31,25],[30,11,15,31,16]],[[30,7,116,7,117],[28,21,45,7,46],[30,1,23,37,24],[30,19,15,26,16]],[[30,5,115,10,116],[28,19,47,10,48],[30,15,24,25,25],[30,23,15,25,16]],[[30,13,115,3,116],[28,2,46,29,47],[30,42,24,1,25],[30,23,15,28,16]],[[30,17,115,0,0],[28,10,46,23,47],[30,10,24,35,25],[30,19,15,35,16]],[[30,17,115,1,116],[28,14,46,21,47],[30,29,24,19,25],[30,11,15,46,16]],[[30,13,115,6,116],[28,14,46,23,47],[30,44,24,7,25],[30,59,16,1,17]],[[30,12,121,7,122],[28,12,47,26,48],[30,39,24,14,25],[30,22,15,41,16]],[[30,6,121,14,122],[28,6,47,34,48],[30,46,24,10,25],[30,2,15,64,16]],[[30,17,122,4,123],[28,29,46,14,47],[30,49,24,10,25],[30,24,15,46,16]],[[30,4,122,18,123],[28,13,46,32,47],[30,48,24,14,25],[30,42,15,32,16]],[[30,20,117,4,118],[28,40,47,7,48],[30,43,24,22,25],[30,10,15,67,16]],[[30,19,118,6,119],[28,18,47,31,48],[30,34,24,34,25],[30,20,15,61,16]]],Xg=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],Zg=[31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017],Qg=21522,Jg={L:1,M:0,Q:3,H:2},ys=new Uint8Array(512),Cd=new Uint8Array(256);{let i=1;for(let o=0;o<255;o+=1)ys[o]=i,Cd[i]=o,i<<=1,i&256&&(i^=285);for(let o=255;o<512;o+=1)ys[o]=ys[o-255]}function a1(i,o){return i===0||o===0?0:ys[Cd[i]+Cd[o]]}function ef(i){let o=new Uint8Array([1]);for(let e=0;e<i;e+=1){let t=new Uint8Array(o.length+1);for(let r=0;r<o.length;r+=1)t[r]^=o[r],t[r+1]^=a1(o[r],ys[e]);o=t}return o}function tf(i,o){let e=ef(o),t=new Uint8Array(o);for(let r of i){let n=r^t[0];t.copyWithin(0,1),t[o-1]=0;for(let s=0;s<o;s+=1)t[s]^=a1(e[s+1],n)}return t}var zd=class{constructor(){this._bits=[]}get length(){return this._bits.length}push(o,e){for(let t=e-1;t>=0;t-=1)this._bits.push(o>>>t&1)}toBytes(){let o=new Uint8Array(Math.ceil(this._bits.length/8));return this._bits.forEach((e,t)=>{e&&(o[t>>>3]|=128>>>(t&7))}),o}};function Ed(i,o){let[,e,t,r,n]=n1[i-1][i1.indexOf(o)];return e*t+r*n}function Sd(i){return i<10?8:16}function rf(i,o){for(let e=1;e<=40;e+=1)if(4+Sd(e)+i*8<=Ed(e,o)*8)return e;throw new Error(`qrcode: ${i} bytes exceeds the capacity of a version 40 symbol at error correction level ${o}`)}function of(i,o,e){let t=Ed(o,e)*8,r=new zd;r.push(4,4),r.push(i.length,Sd(o));for(let z of i)r.push(z,8);r.push(0,Math.min(4,t-r.length)),r.length%8!==0&&r.push(0,8-r.length%8);let n=Array.from(r.toBytes());for(let z=0;n.length<t/8;z+=1)n.push(z%2===0?236:17);let[s,d,h,p,f]=n1[o-1][i1.indexOf(e)],x=[],k=0;for(let[z,T]of[[d,h],[p,f]])for(let P=0;P<z;P+=1){let H=new Uint8Array(n.slice(k,k+T));k+=T,x.push({data:H,ec:tf(H,s)})}let C=[],S=Math.max(...x.map(z=>z.data.length));for(let z=0;z<S;z+=1)for(let T of x)z<T.data.length&&C.push(T.data[z]);for(let z=0;z<s;z+=1)for(let T of x)C.push(T.ec[z]);return new Uint8Array(C)}function nf(i){let o=i*4+17;return{size:o,modules:Array.from({length:o},()=>Array(o).fill(null)),reserved:Array.from({length:o},()=>Array(o).fill(!1))}}function Ci(i,o,e,t){i.modules[e][o]=t,i.reserved[e][o]=!0}function Md(i,o,e){for(let t=-1;t<=7;t+=1)for(let r=-1;r<=7;r+=1){let n=o+r,s=e+t;if(n<0||s<0||n>=i.size||s>=i.size)continue;let d=r>=0&&r<=6&&t>=0&&t<=6,h=Math.max(Math.abs(r-3),Math.abs(t-3));Ci(i,n,s,d&&h!==2)}}function af(i,o){Md(i,0,0),Md(i,i.size-7,0),Md(i,0,i.size-7);for(let t=8;t<i.size-8;t+=1){let r=t%2===0;Ci(i,t,6,r),Ci(i,6,t,r)}let e=Xg[o-1];for(let t of e)for(let r of e)if(!(r===6&&t===6||r===6&&t===i.size-7||r===i.size-7&&t===6))for(let s=-2;s<=2;s+=1)for(let d=-2;d<=2;d+=1){let h=Math.max(Math.abs(d),Math.abs(s));Ci(i,r+d,t+s,h!==1)}for(let t=0;t<9;t+=1)t!==6&&(Ci(i,t,8,!1),Ci(i,8,t,!1));for(let t=0;t<8;t+=1)Ci(i,i.size-1-t,8,!1);for(let t=0;t<7;t+=1)Ci(i,8,i.size-1-t,!1);if(Ci(i,8,i.size-8,!0),o>=7){let t=Zg[o-7];for(let r=0;r<18;r+=1){let n=(t>>>r&1)===1,s=Math.floor(r/3),d=r%3+i.size-11;Ci(i,s,d,n),Ci(i,d,s,n)}}}function sf(i,o){let e=0,t=!0;for(let r=i.size-1;r>=1;r-=2){let n=r===6?5:r;for(let s=0;s<i.size;s+=1){let d=t?i.size-1-s:s;for(let h of[n,n-1]){if(i.reserved[d][h])continue;let p=o[e>>>3]??0;i.modules[d][h]=(p>>>7-(e&7)&1)===1,e+=1}}t=!t}}function lf(i,o,e){switch(i){case 0:return(o+e)%2===0;case 1:return e%2===0;case 2:return o%3===0;case 3:return(o+e)%3===0;case 4:return(Math.floor(e/2)+Math.floor(o/3))%2===0;case 5:return o*e%2+o*e%3===0;case 6:return(o*e%2+o*e%3)%2===0;default:return((o+e)%2+o*e%3)%2===0}}function cf(i,o,e){let t=Jg[o]<<3|e,r=t;for(let s=0;s<10;s+=1)r=r<<1^(r>>>9)*1335;let n=(t<<10|r)^Qg;for(let s=0;s<=5;s+=1)i.modules[8][s]=(n>>>s&1)===1;i.modules[8][7]=(n>>>6&1)===1,i.modules[8][8]=(n>>>7&1)===1,i.modules[7][8]=(n>>>8&1)===1;for(let s=9;s<15;s+=1)i.modules[14-s][8]=(n>>>s&1)===1;for(let s=0;s<7;s+=1)i.modules[i.size-1-s][8]=(n>>>s&1)===1;for(let s=8;s<15;s+=1)i.modules[8][i.size-15+s]=(n>>>s&1)===1}function df(i){let o=i.length,e=0,t=h=>{let p=0,f=1;for(let x=1;x<o;x+=1)h[x]===h[x-1]?(f+=1,f===5?p+=3:f>5&&(p+=1)):f=1;return p};for(let h=0;h<o;h+=1)e+=t(i[h]),e+=t(i.map(p=>p[h]));for(let h=0;h<o-1;h+=1)for(let p=0;p<o-1;p+=1){let f=i[h][p];f===i[h][p+1]&&f===i[h+1][p]&&f===i[h+1][p+1]&&(e+=3)}let r=[!0,!1,!0,!0,!0,!1,!0],n=(h,p)=>r.every((f,x)=>h[p+x]===f);for(let h=0;h<o;h+=1){let p=i[h],f=i.map(x=>x[h]);for(let x=0;x+7<=o;x+=1)n(p,x)&&(e+=40),n(f,x)&&(e+=40)}let d=i.flat().filter(Boolean).length*100/(o*o);return e+=Math.floor(Math.abs(d-50)/5)*10,e}function zl(i,o={}){let e=o.errorCorrection??"M",t=new TextEncoder().encode(i),r=o.version??rf(t.length,e);if(r<1||r>40||!Number.isInteger(r))throw new Error(`qrcode: version must be an integer from 1 to 40, received ${r}`);if(4+Sd(r)+t.length*8>Ed(r,e)*8)throw new Error(`qrcode: ${t.length} bytes does not fit a version ${r} symbol at error correction level ${e}`);let s=of(t,r,e),d=nf(r);af(d,r),sf(d,s);let h=null;for(let p=0;p<8;p+=1){let f=d.modules.map((S,z)=>S.map((T,P)=>d.reserved[z][P]?!!T:!!T!==lf(p,P,z))),x={...d,modules:f};cf(x,e,p);let k=x.modules.map(S=>S.map(Boolean)),C=df(k);(!h||C<h.score)&&(h={matrix:k,score:C})}return{matrix:h.matrix,size:d.size,version:r,errorCorrection:e}}var pr=class extends xo.LitElement{constructor(){super(...arguments);this.value="";this.errorCorrection="M";this.margin=4;this.logo="";this.logoRatio=.2;this._error=""}connectedCallback(){super.connectedCallback(),this._localeCleanup=xe(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}_t(e,t){let r=nt(this,this.locale,this.translations);return ae(ne(r.locale,r.translations),e,t)}get _effectiveErrorCorrection(){if(!this.logo)return this.errorCorrection;let e=this._cappedLogoRatio>.22?"H":"Q",t=["L","M","Q","H"];return t.indexOf(this.errorCorrection)>=t.indexOf(e)?this.errorCorrection:e}get _cappedLogoRatio(){return Math.min(Math.max(this.logoRatio,0),.3)}get _cssSize(){return this.size===void 0||this.size===""?"":Ot(this.size)}toDataUrl(){let e=this._svgMarkup();return e?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`:""}_svgMarkup(){try{let{matrix:e,size:t}=zl(this.value,{errorCorrection:this._effectiveErrorCorrection,version:this.version}),r=Math.max(0,Math.floor(this.margin)),n=t+r*2,s=this.color||"currentColor",d=this.background||"transparent",h="";return e.forEach((p,f)=>{p.forEach((x,k)=>{x&&(h+=`M${k+r} ${f+r}h1v1h-1z`)})}),[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${n} ${n}"`,' shape-rendering="crispEdges">',`<rect width="${n}" height="${n}" fill="${d}"/>`,`<path d="${h}" fill="${s}"/>`,"</svg>"].join("")}catch{return""}}render(){let e=L(this,"qrcode"),t=Math.max(0,Math.floor(this.margin)),r=this._cssSize||e.size||"",n=null,s="";if(!this.value)s=this._t("qrcode.empty","\u65E0\u5185\u5BB9");else try{n=zl(this.value,{errorCorrection:this._effectiveErrorCorrection,version:this.version})}catch(p){s=p instanceof Error?p.message:String(p)}s!==this._error&&(this._error=s,s&&this.value&&this.dispatchEvent(new CustomEvent("error",{detail:{message:s},bubbles:!0,composed:!0})));let d=[r?`--lui-qrcode-size:${r}`:"",this.background?`--lui-qrcode-bg:${this.background}`:"",this.color?`--lui-qrcode-fg:${this.color}`:"",this.logo?`--lui-qrcode-logo-size:${this._cappedLogoRatio*100}%`:""].filter(Boolean).join(";");if(!n)return xo.html`
14574
14576
  <div class="frame" part="base" style=${d||xo.nothing}>
14575
14577
  <div part="error" role="img" aria-label=${s}>
14576
14578
  <lui-icon name="circle-x"></lui-icon>