index-legacy-a4f7eb5c.js 15 KB

1
  1. System.register(["./index-legacy-406504c4.js"],(function(e,t){"use strict";var a,l,i,n,o,r,s,u,c,d,v,f,h,p,g,b,m,w,x,y,C,I,k,S,B,$,T,z,R,M,A,H,O,L,W,D,E,X,F,N,Y,Z,j,P,V,G,J,q,K,Q,U,_,ee,te,ae,le,ie,ne,oe,re,se,ue,ce,de;return{setters:[e=>{a=e.ak,l=e.N,i=e.al,n=e.am,o=e.x,r=e.an,s=e.ao,u=e.ap,c=e.aq,d=e.ar,v=e.z,f=e.I,h=e.a2,p=e.V,g=e.d,b=e.as,m=e.r,w=e.b,x=e.at,y=e.H,C=e.au,I=e.w,k=e.k,S=e.av,B=e.M,$=e.a6,T=e.aw,z=e.ax,R=e.c,M=e.G,A=e.E,H=e.a3,O=e.A,L=e.C,W=e.ab,D=e.o,E=e.ay,X=e.az,F=e.L,N=e.a7,Y=e.aa,Z=e.aA,j=e.aB,P=e.W,V=e.aC,G=e.D,J=e.aD,q=e.aE,K=e.aF,Q=e.aG,U=e.$,_=e.J,ee=e.Y,te=e.aH,ae=e.aI,le=e.aJ,ie=e.S,ne=e.aK,oe=e.aL,re=e.aM,se=e.R,ue=e.Q,ce=e.y,de=e.U}],execute:function(){function t(e,t){if(!s||!window.IntersectionObserver)return;const a=new IntersectionObserver((e=>{t(e[0].intersectionRatio>0)}),{root:document.body}),l=()=>{e.value&&a.unobserve(e.value)};u(l),c(l),d((()=>{e.value&&a.observe(e.value)}))}const[ve,fe]=v("sticky"),he={zIndex:f,position:h("top"),container:Object,offsetTop:p(0),offsetBottom:p(0)};var pe=g({name:ve,props:he,emits:["scroll","change"],setup(e,{emit:a,slots:l}){const n=o(),r=b(n),s=m({fixed:!1,width:0,height:0,transform:0}),u=o(!1),c=w((()=>x("top"===e.position?e.offsetTop:e.offsetBottom))),d=w((()=>{if(u.value)return;const{fixed:e,height:t,width:a}=s;return e?{width:`${a}px`,height:`${t}px`}:void 0})),v=w((()=>{if(!s.fixed||u.value)return;const t=y(C(e.zIndex),{width:`${s.width}px`,height:`${s.height}px`,[e.position]:`${c.value}px`});return s.transform&&(t.transform=`translate3d(0, ${s.transform}px, 0)`),t})),f=()=>{if(!n.value||S(n))return;const{container:t,position:l}=e,o=$(n),r=i(window);if(s.width=o.width,s.height=o.height,"top"===l)if(t){const e=$(t),a=e.bottom-c.value-s.height;s.fixed=c.value>o.top&&e.bottom>0,s.transform=a<0?a:0}else s.fixed=c.value>o.top;else{const{clientHeight:e}=document.documentElement;if(t){const a=$(t),l=e-a.top-c.value-s.height;s.fixed=e-c.value<o.bottom&&e>a.top,s.transform=l<0?-l:0}else s.fixed=e-c.value<o.bottom}(e=>{a("scroll",{scrollTop:e,isFixed:s.fixed})})(r)};return I((()=>s.fixed),(e=>a("change",e))),k("scroll",f,{target:r,passive:!0}),t(n,f),I([T,z],(()=>{n.value&&!S(n)&&s.fixed&&(u.value=!0,B((()=>{const e=$(n);s.width=e.width,s.height=e.height,u.value=!1})))})),()=>{var e;return R("div",{ref:n,style:d.value},[R("div",{"class":fe({fixed:s.fixed&&!u.value}),style:v.value},[null==(e=l["default"])?void 0:e.call(l)])])}}});const ge=M(pe),[be,me]=v("swipe"),we={loop:A,width:f,height:f,vertical:Boolean,autoplay:p(0),duration:p(500),touchable:A,lazyRender:Boolean,initialSwipe:p(0),indicatorColor:String,showIndicators:A,stopPropagation:A},xe=Symbol(be);var ye=g({name:be,props:we,emits:["change","dragStart","dragEnd"],setup(e,{emit:t,slots:a}){const l=o(),i=o(),n=m({rect:null,width:0,height:0,offset:0,active:0,swiping:!1});let r=!1;const s=H(),{children:d,linkChildren:v}=O(xe),f=w((()=>d.length)),h=w((()=>n[e.vertical?"height":"width"])),p=w((()=>e.vertical?s.deltaY.value:s.deltaX.value)),g=w((()=>n.rect?(e.vertical?n.rect.height:n.rect.width)-h.value*f.value:0)),b=w((()=>h.value?Math.ceil(Math.abs(g.value)/h.value):f.value)),x=w((()=>f.value*h.value)),y=w((()=>(n.active+f.value)%f.value)),C=w((()=>{const t=e.vertical?"vertical":"horizontal";return s.direction.value===t})),$=w((()=>{const t={transitionDuration:`${n.swiping?0:e.duration}ms`,transform:`translate${e.vertical?"Y":"X"}(${+n.offset.toFixed(2)}px)`};if(h.value){const a=e.vertical?"height":"width",l=e.vertical?"width":"height";t[a]=`${x.value}px`,t[l]=e[l]?`${e[l]}px`:""}return t})),M=(t,a=0)=>{let l=t*h.value;e.loop||(l=Math.min(l,-g.value));let i=a-l;return e.loop||(i=Y(i,g.value,0)),i},A=({pace:a=0,offset:l=0,emitChange:i})=>{if(f.value<=1)return;const{active:o}=n,r=(t=>{const{active:a}=n;return t?e.loop?Y(a+t,-1,f.value):Y(a+t,0,b.value):a})(a),s=M(r,l);if(e.loop){if(d[0]&&s!==g.value){const e=s<g.value;d[0].setOffset(e?x.value:0)}if(d[f.value-1]&&0!==s){const e=s>0;d[f.value-1].setOffset(e?-x.value:0)}}n.active=r,n.offset=s,i&&r!==o&&t("change",y.value)},Z=()=>{n.swiping=!0,n.active<=-1?A({pace:f.value}):n.active>=f.value&&A({pace:-f.value})},j=()=>{Z(),s.reset(),F((()=>{n.swiping=!1,A({pace:1,emitChange:!0})}))};let P;const V=()=>clearTimeout(P),G=()=>{V(),+e.autoplay>0&&f.value>1&&(P=setTimeout((()=>{j(),G()}),+e.autoplay))},J=(t=+e.initialSwipe)=>{if(!l.value)return;const a=()=>{var a,i;if(!S(l)){const t={width:l.value.offsetWidth,height:l.value.offsetHeight};n.rect=t,n.width=+(null!=(a=e.width)?a:t.width),n.height=+(null!=(i=e.height)?i:t.height)}f.value&&-1===(t=Math.min(f.value-1,t))&&(t=f.value-1),n.active=t,n.swiping=!0,n.offset=M(t),d.forEach((e=>{e.setOffset(0)})),G()};S(l)?B().then(a):a()},q=()=>J(n.active);let K;const Q=t=>{!e.touchable||t.touches.length>1||(s.start(t),r=!1,K=Date.now(),V(),Z())},U=()=>{if(!e.touchable||!n.swiping)return;const a=Date.now()-K,l=p.value/a;if((Math.abs(l)>.25||Math.abs(p.value)>h.value/2)&&C.value){const t=e.vertical?s.offsetY.value:s.offsetX.value;let a=0;a=e.loop?t>0?p.value>0?-1:1:0:-Math[p.value>0?"ceil":"floor"](p.value/h.value),A({pace:a,emitChange:!0})}else p.value&&A({pace:0});r=!1,n.swiping=!1,t("dragEnd",{index:y.value}),G()},_=(t,a)=>{const l=a===y.value,i=l?{backgroundColor:e.indicatorColor}:void 0;return R("i",{style:i,"class":me("indicator",{active:l})},null)};return L({prev:()=>{Z(),s.reset(),F((()=>{n.swiping=!1,A({pace:-1,emitChange:!0})}))},next:j,state:n,resize:q,swipeTo:(t,a={})=>{Z(),s.reset(),F((()=>{let l;l=e.loop&&t===f.value?0===n.active?0:t:t%f.value,a.immediate?F((()=>{n.swiping=!1})):n.swiping=!1,A({pace:l-n.active,emitChange:!0})}))}}),v({size:h,props:e,count:f,activeIndicator:y}),I((()=>e.initialSwipe),(e=>J(+e))),I(f,(()=>J(n.active))),I((()=>e.autoplay),G),I([T,z,()=>e.width,()=>e.height],q),I(W(),(e=>{"visible"===e?G():V()})),D(J),E((()=>J(n.active))),X((()=>J(n.active))),u(V),c(V),k("touchmove",(a=>{e.touchable&&n.swiping&&(s.move(a),C.value)&&(!e.loop&&(0===n.active&&p.value>0||n.active===f.value-1&&p.value<0)||(N(a,e.stopPropagation),A({offset:p.value}),r||(t("dragStart",{index:y.value}),r=!0)))}),{target:i}),()=>{var t;return R("div",{ref:l,"class":me()},[R("div",{ref:i,style:$.value,"class":me("track",{vertical:e.vertical}),onTouchstartPassive:Q,onTouchend:U,onTouchcancel:U},[null==(t=a["default"])?void 0:t.call(a)]),a.indicator?a.indicator({active:y.value,total:f.value}):e.showIndicators&&f.value>1?R("div",{"class":me("indicators",{vertical:e.vertical})},[Array(f.value).fill("").map(_)]):void 0])}}});const Ce=M(ye),[Ie,ke]=v("tabs");var Se=g({name:Ie,props:{count:Z(Number),inited:Boolean,animated:Boolean,duration:Z(f),swipeable:Boolean,lazyRender:Boolean,currentIndex:Z(Number)},emits:["change"],setup(e,{emit:t,slots:a}){const l=o(),i=e=>t("change",e),n=()=>{var t;const n=null==(t=a["default"])?void 0:t.call(a);return e.animated||e.swipeable?R(Ce,{ref:l,loop:!1,"class":ke("track"),duration:1e3*+e.duration,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:i},{"default":()=>[n]}):n},r=t=>{const a=l.value;a&&a.state.active!==t&&a.swipeTo(t,{immediate:!e.inited})};return I((()=>e.currentIndex),r),D((()=>{r(e.currentIndex)})),L({swipeRef:l}),()=>R("div",{"class":ke("content",{animated:e.animated||e.swipeable})},[n()])}});const[Be,$e]=v("tabs"),Te={type:h("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:p(0),duration:p(.3),animated:Boolean,ellipsis:A,swipeable:Boolean,scrollspy:Boolean,offsetTop:p(0),background:String,lazyRender:A,showHeader:A,lineWidth:f,lineHeight:f,beforeChange:Function,swipeThreshold:p(5),titleActiveColor:String,titleInactiveColor:String},ze=Symbol(Be);var Re=g({name:Be,props:Te,emits:["change","scroll","rendered","clickTab","update:active"],setup(e,{emit:s,slots:u}){let c,v,f,h,p;const g=o(),y=o(),C=o(),z=o(),M=j(),A=b(g),[H,W]=function(){const e=o([]),t=[];return r((()=>{e.value=[]})),[e,a=>(t[a]||(t[a]=t=>{e.value[a]=t}),t[a])]}(),{children:D,linkChildren:F}=O(ze),N=m({inited:!1,position:"",lineStyle:{},currentIndex:-1}),Y=w((()=>D.length>+e.swipeThreshold||!e.ellipsis||e.shrink)),Z=w((()=>({borderColor:e.color,background:e.background}))),U=(e,t)=>{var a;return null!=(a=e.name)?a:t},_=w((()=>{const e=D[N.currentIndex];if(e)return U(e,N.currentIndex)})),ee=w((()=>x(e.offsetTop))),te=w((()=>e.sticky?ee.value+c:0)),ae=t=>{const i=y.value,n=H.value;if(!(Y.value&&i&&n&&n[N.currentIndex]))return;const o=n[N.currentIndex].$el,r=o.offsetLeft-(i.offsetWidth-o.offsetWidth)/2;h&&h(),h=function(e,t,i){let n,o=0;const r=e.scrollLeft,s=0===i?1:Math.round(1e3*i/16);return function u(){e.scrollLeft+=(t-r)/s,++o<s&&(n=l(u))}(),function(){a(n)}}(i,r,t?0:+e.duration)},le=()=>{const t=N.inited;B((()=>{const a=H.value;if(!a||!a[N.currentIndex]||"line"!==e.type||S(g.value))return;const l=a[N.currentIndex].$el,{lineWidth:i,lineHeight:n}=e,o=l.offsetLeft+l.offsetWidth/2,r={width:P(i),backgroundColor:e.color,transform:`translateX(${o}px) translateX(-50%)`};if(t&&(r.transitionDuration=`${e.duration}s`),V(n)){const e=P(n);r.height=e,r.borderRadius=e}N.lineStyle=r}))},ie=(t,a)=>{const l=(e=>{const t=e<N.currentIndex?-1:1;for(;e>=0&&e<D.length;){if(!D[e].disabled)return e;e+=t}})(t);if(!V(l))return;const i=D[l],n=U(i,l),o=null!==N.currentIndex;N.currentIndex!==l&&(N.currentIndex=l,a||ae(),le()),n!==e.active&&(s("update:active",n),o&&s("change",n,i.title)),f&&!e.scrollspy&&J(Math.ceil(q(g.value)-ee.value))},ne=(e,t)=>{const a=D.find(((t,a)=>U(t,a)===e)),l=a?D.indexOf(a):0;ie(l,t)},oe=(t=!1)=>{if(e.scrollspy){const o=D[N.currentIndex].$el;if(o&&A.value){const r=q(o,A.value)-te.value;v=!0,p&&p(),p=function(e,t,o,r){let s,u=i(e);const c=u<t,d=0===o?1:Math.round(1e3*o/16),v=(t-u)/d;return function f(){u+=v,(c&&u>t||!c&&u<t)&&(u=t),n(e,u),c&&u<t||!c&&u>t?s=l(f):r&&(s=l(r))}(),function(){a(s)}}(A.value,r,t?0:+e.duration,(()=>{v=!1}))}}},re=(t,a,l)=>{const{title:i,disabled:n}=D[a],o=U(D[a],a);n||(K(e.beforeChange,{args:[o],done:()=>{ie(a),oe()}}),Q(t)),s("clickTab",{name:o,title:i,event:l,disabled:n})},se=e=>{f=e.isFixed,s("scroll",e)},ue=()=>{if("line"===e.type&&D.length)return R("div",{"class":$e("line"),style:N.lineStyle},null)},ce=()=>{var t,a,l;const{type:i,border:n,sticky:o}=e,r=[R("div",{ref:o?void 0:C,"class":[$e("wrap"),{[G]:"line"===i&&n}]},[R("div",{ref:y,role:"tablist","class":$e("nav",[i,{shrink:e.shrink,complete:Y.value}]),style:Z.value,"aria-orientation":"horizontal"},[null==(t=u["nav-left"])?void 0:t.call(u),D.map((e=>e.renderTitle(re))),ue(),null==(a=u["nav-right"])?void 0:a.call(u)])]),null==(l=u["nav-bottom"])?void 0:l.call(u)];return o?R("div",{ref:C},[r]):r},de=()=>{le(),B((()=>{var e,t;ae(!0),null==(t=null==(e=z.value)?void 0:e.swipeRef.value)||t.resize()}))};return I((()=>[e.color,e.duration,e.lineWidth,e.lineHeight]),le),I(T,de),I((()=>e.active),(e=>{e!==_.value&&ne(e)})),I((()=>D.length),(()=>{N.inited&&(ne(e.active),le(),B((()=>{ae(!0)})))})),L({resize:de,scrollTo:e=>{B((()=>{ne(e),oe(!0)}))}}),E(le),X(le),d((()=>{ne(e.active,!0),B((()=>{N.inited=!0,C.value&&(c=$(C.value).height),ae(!0)}))})),t(g,le),k("scroll",(()=>{if(e.scrollspy&&!v){const e=(()=>{for(let e=0;e<D.length;e++){const{top:t}=$(D[e].$el);if(t>te.value)return 0===e?0:e-1}return D.length-1})();ie(e)}}),{target:A,passive:!0}),F({id:M,props:e,setLine:le,scrollable:Y,onRendered:(e,t)=>s("rendered",e,t),currentName:_,setTitleRefs:W,scrollIntoView:ae}),()=>R("div",{ref:g,"class":$e([e.type])},[e.showHeader?e.sticky?R(ge,{container:g.value,offsetTop:ee.value,onScroll:se},{"default":()=>[ce()]}):ce():null,R(Se,{ref:z,count:D.length,inited:N.inited,animated:e.animated,duration:e.duration,swipeable:e.swipeable,lazyRender:e.lazyRender,currentIndex:N.currentIndex,onChange:ie},{"default":()=>{var e;return[null==(e=u["default"])?void 0:e.call(u)]}})])}});const Me=Symbol(),[Ae,He]=v("tab"),Oe=g({name:Ae,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:f,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:A},setup(e,{slots:t}){const a=w((()=>{const t={},{type:a,color:l,disabled:i,isActive:n,activeColor:o,inactiveColor:r}=e;l&&"card"===a&&(t.borderColor=l,i||(n?t.backgroundColor=l:t.color=l));const s=n?o:r;return s&&(t.color=s),t})),l=()=>{const a=R("span",{"class":He("text",{ellipsis:!e.scrollable})},[t.title?t.title():e.title]);return e.dot||V(e.badge)&&""!==e.badge?R(U,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{"default":()=>[a]}):a};return()=>R("div",{id:e.id,role:"tab","class":[He([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:a.value,tabindex:e.disabled?void 0:e.isActive?0:-1,"aria-selected":e.isActive,"aria-disabled":e.disabled||void 0,"aria-controls":e.controls},[l()])}}),[Le,We]=v("swipe-item");var De=g({name:Le,setup(e,{slots:t}){let a;const l=m({offset:0,inited:!1,mounted:!1}),{parent:i,index:n}=_(xe);if(!i)return;const o=w((()=>{const e={},{vertical:t}=i.props;return i.size.value&&(e[t?"height":"width"]=`${i.size.value}px`),l.offset&&(e.transform=`translate${t?"Y":"X"}(${l.offset}px)`),e})),r=w((()=>{const{loop:e,lazyRender:t}=i.props;if(!t||a)return!0;if(!l.mounted)return!1;const o=i.activeIndicator.value,r=i.count.value-1,s=0===o&&e?r:o-1,u=o===r&&e?0:o+1;return a=n.value===o||n.value===s||n.value===u,a}));return D((()=>{B((()=>{l.mounted=!0}))})),L({setOffset:e=>{l.offset=e}}),()=>{var e;return R("div",{"class":We(),style:o.value},[r.value?null==(e=t["default"])?void 0:e.call(t):null])}}});const Ee=M(De),[Xe,Fe]=v("tab"),Ne=y({},ee,{dot:Boolean,name:f,badge:f,title:String,disabled:Boolean,titleClass:te,titleStyle:[String,Object],showZeroBadge:A});var Ye=g({name:Xe,props:Ne,setup(e,{slots:t}){const a=j(),l=o(!1),i=ce(),{parent:n,index:r}=_(ze);if(!n)return;const s=()=>{var t;return null!=(t=e.name)?t:r.value},u=w((()=>{const t=s()===n.currentName.value;return t&&!l.value&&(l.value=!0,n.props.lazyRender&&B((()=>{n.onRendered(s(),e.title)}))),t})),c=o(""),d=o("");ae((()=>{const{titleClass:t,titleStyle:a}=e;c.value=t?ne(t):"",d.value=a&&"string"!=typeof a?oe(re(a)):a}));const v=o(!u.value);return I(u,(e=>{e?v.value=!1:F((()=>{v.value=!0}))})),I((()=>e.title),(()=>{n.setLine(),n.scrollIntoView()})),le(Me,u),L({id:a,renderTitle:l=>R(Oe,se({key:a,id:`${n.id}-${r.value}`,ref:n.setTitleRefs(r.value),style:d.value,"class":c.value,isActive:u.value,controls:a,scrollable:n.scrollable.value,activeColor:n.props.titleActiveColor,inactiveColor:n.props.titleInactiveColor,onClick:e=>l(i.proxy,r.value,e)},ue(n.props,["type","color","shrink"]),ue(e,["dot","badge","title","disabled","showZeroBadge"])),{title:t.title})}),()=>{var e;const i=`${n.id}-${r.value}`,{animated:o,swipeable:s,scrollspy:c,lazyRender:d}=n.props;if(!t["default"]&&!o)return;const f=c||u.value;if(o||s)return R(Ee,{id:a,role:"tabpanel","class":Fe("panel-wrapper",{inactive:v.value}),tabindex:u.value?0:-1,"aria-hidden":!u.value,"aria-labelledby":i},{"default":()=>{var e;return[R("div",{"class":Fe("panel")},[null==(e=t["default"])?void 0:e.call(t)])]}});const h=l.value||c||!d?null==(e=t["default"])?void 0:e.call(t):null;return ie(R("div",{id:a,role:"tabpanel","class":Fe("panel"),tabindex:f?0:-1,"aria-labelledby":i},[h]),[[de,f]])}}});e("a",M(Ye)),e("T",M(Re))}}}));