index-legacy.431627b7.js 2.9 KB

1
  1. !function(){function t(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],l=!0,i=!1;try{for(r=r.call(t);!(l=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);l=!0);}catch(c){i=!0,o=c}finally{try{l||null==r.return||r.return()}finally{if(i)throw o}}return a}(t,r)||function(t,r){if(!t)return;if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}System.register(["./ResizeObserver.es-legacy.42c87f31.js"],(function(e){"use strict";var r,n,o,a,l,i,c,u,s,f,d,p,v,y,b,m,g,h,w;return{setters:[function(t){r=t.v,n=t.D,o=t.d,a=t.U,l=t.r,i=t.aV,c=t.aJ,u=t.a2,s=t.Y,f=t.$,d=t.ae,p=t.aA,v=t.c,y=t.a7,b=t.av,m=t.aZ,g=t.aK,h=t.a3,w=t.z}],execute:function(){var S=t(r("notice-bar"),2),A=S[0],x=S[1],I={text:String,mode:String,color:String,delay:n(1),speed:n(60),leftIcon:String,wrapable:Boolean,background:String,scrollable:{type:Boolean,default:null}},k=o({name:A,props:I,emits:["close","replay"],setup:function(t,e){var r,n=e.emit,o=e.slots,w=0,S=0,A=a(),I=a(),k=l({show:!0,offset:0,duration:0}),j=function(e){"closeable"===t.mode&&(k.show=!1,n("close",e))},T=function(){if(o["right-icon"])return o["right-icon"]();var e="closeable"===t.mode?"cross":"link"===t.mode?"arrow":void 0;return e?v(y,{name:e,class:x("right-icon"),onClick:j},null):void 0},O=function(){k.offset=w,k.duration=0,g((function(){m((function(){k.offset=-S,k.duration=(S+w)/+t.speed,n("replay")}))}))},z=function(){var e=t.delay,n=t.speed,o=t.scrollable,a=h(e)?1e3*+e:0;w=0,S=0,k.offset=0,k.duration=0,clearTimeout(r),r=setTimeout((function(){if(A.value&&I.value&&!1!==o){var t=b(A).width,e=b(I).width;(o||e>t)&&m((function(){w=t,S=e,k.offset=-S,k.duration=S/+n}))}}),a)};return i(z),c(z),u("pageshow",z),s({reset:z}),f((function(){return[t.text,t.scrollable]}),z),function(){var e,r,n=t.color,a=t.wrapable,l=t.background;return d(v("div",{role:"alert",class:x({wrapable:a}),style:{color:n,background:l}},[o["left-icon"]?o["left-icon"]():t.leftIcon?v(y,{class:x("left-icon"),name:t.leftIcon},null):void 0,(e=!1===t.scrollable&&!t.wrapable,r={transform:k.offset?"translateX(".concat(k.offset,"px)"):"",transitionDuration:"".concat(k.duration,"s")},v("div",{ref:A,role:"marquee",class:x("wrap")},[v("div",{ref:I,style:r,class:[x("content"),{"van-ellipsis":e}],onTransitionend:O},[o.default?o.default():t.text])])),T()]),[[p,k.show]])}}});e("N",w(k))}}}))}();