2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{d as B,t as I,i as k,bc as q,v as V,h as N,cL as U,I as A,l as b,aK as K,q as Y,ao as J,cn as Q,_ as X}from"./index-260f63b0.js";var C=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var s=o[i];n.call(r,s[1],s[0])}},t}()}(),R=typeof window<"u"&&typeof document<"u"&&window.document===document,g=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Z=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(g):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),ee=2;function te(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){Z(o)}function a(){var c=Date.now();if(n){if(c-i<ee)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=c}return a}var ne=20,re=["top","right","bottom","left","width","height","size","weight"],ie=typeof MutationObserver<"u",oe=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=te(this.refresh.bind(this),ne)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!R||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ie?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!R||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=re.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),P=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},l=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||g},W=_(0,0,0,0);function m(e){return parseFloat(e)||0}function z(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var o=e["border-"+i+"-width"];return r+m(o)},0)}function se(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var o=i[r],s=e["padding-"+o];n[o]=m(s)}return n}function ae(e){var t=e.getBBox();return _(0,0,t.width,t.height)}function ce(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return W;var r=l(e).getComputedStyle(e),i=se(r),o=i.left+i.right,s=i.top+i.bottom,a=m(r.width),c=m(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=z(r,"left","right")+o),Math.round(c+s)!==n&&(c-=z(r,"top","bottom")+s)),!fe(e)){var p=Math.round(a+o)-t,f=Math.round(c+s)-n;Math.abs(p)!==1&&(a-=p),Math.abs(f)!==1&&(c-=f)}return _(i.left,i.top,a,c)}var ue=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof l(e).SVGGraphicsElement}:function(e){return e instanceof l(e).SVGElement&&typeof e.getBBox=="function"}}();function fe(e){return e===l(e).document.documentElement}function he(e){return R?ue(e)?ae(e):ce(e):W}function de(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return P(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function _(e,t,n,r){return{x:e,y:t,width:n,height:r}}var le=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=_(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=he(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),ve=function(){function e(t,n){var r=de(n);P(this,{target:t,contentRect:r})}return e}(),pe=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new C,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof l(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new le(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof l(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new ve(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),$=typeof WeakMap<"u"?new WeakMap:new C,D=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=oe.getInstance(),r=new pe(t,n,this);$.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){D.prototype[e]=function(){var t;return(t=$.get(this))[e].apply(t,arguments)}});var be=function(){return typeof g.ResizeObserver<"u"?g.ResizeObserver:D}(),ge=typeof global=="object"&&global&&global.Object===Object&&global;const me=ge;var ye=typeof self=="object"&&self&&self.Object===Object&&self,_e=me||ye||Function("return this")();const Oe=_e;var we=Oe.Symbol;const y=we;var H=Object.prototype,Ee=H.hasOwnProperty,Re=H.toString,v=y?y.toStringTag:void 0;function je(e){var t=Ee.call(e,v),n=e[v];try{e[v]=void 0;var r=!0}catch{}var i=Re.call(e);return r&&(t?e[v]=n:delete e[v]),i}var Te=Object.prototype,Se=Te.toString;function Me(e){return Se.call(e)}var ze="[object Null]",xe="[object Undefined]",x=y?y.toStringTag:void 0;function Ae(e){return e==null?e===void 0?xe:ze:x&&x in Object(e)?je(e):Me(e)}function Ce(e,t){return function(n){return e(t(n))}}var Pe=Ce(Object.getPrototypeOf,Object);const We=Pe;function $e(e){return e!=null&&typeof e=="object"}var De="[object Object]",He=Function.prototype,Ge=Object.prototype,G=He.toString,Le=Ge.hasOwnProperty,Fe=G.call(Object);function Ie(e){if(!$e(e)||Ae(e)!=De)return!1;var t=We(e);if(t===null)return!0;var n=Le.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&G.call(n)==Fe}const ke=B({compatConfig:{MODE:3},name:"ResizeObserver",props:{disabled:Boolean,onResize:Function},emits:["resize"],setup:function(t,n){var r=n.slots,i=I({width:0,height:0,offsetHeight:0,offsetWidth:0}),o=null,s=null,a=function(){s&&(s.disconnect(),s=null)},c=function(O){var u=t.onResize,d=O[0].target,j=d.getBoundingClientRect(),L=j.width,F=j.height,w=d.offsetWidth,E=d.offsetHeight,T=Math.floor(L),S=Math.floor(F);if(i.width!==T||i.height!==S||i.offsetWidth!==w||i.offsetHeight!==E){var M={width:T,height:S,offsetWidth:w,offsetHeight:E};A(i,M),u&&Promise.resolve().then(function(){u(b(b({},M),{},{offsetWidth:w,offsetHeight:E}),d)})}},p=K(),f=function(){var O=t.disabled;if(O){a();return}var u=U(p),d=u!==o;d&&(a(),o=u),!s&&u&&(s=new be(c),s.observe(u))};return k(function(){f()}),q(function(){f()}),V(function(){a()}),N(function(){return t.disabled},function(){f()},{flush:"post"}),function(){var h;return(h=r.default)===null||h===void 0?void 0:h.call(r)[0]}}});function qe(e,t){for(var n=A({},e),r=0;r<t.length;r+=1){var i=t[r];delete n[i]}return n}function Ve(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=e;if(Array.isArray(e)&&(i=Y(e)[0]),!i)return null;var o=J(i,t,r);return o.props=n?b(b({},o.props),t):o.props,Q(X(o.props.class)!=="object","class must be string"),o}export{ke as R,y as S,Ie as a,be as b,Ve as c,Ae as d,Ce as e,me as f,We as g,$e as i,qe as o,Oe as r};
|