yxuse 3.0.22 → 3.0.23
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/README.md +5 -0
- package/lib/index.cjs2.js +1 -1
- package/lib/index.cjs2.js.gz +0 -0
- package/lib/index.es2.js +1 -1
- package/lib/index.es2.js.gz +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/index.cjs2.js
CHANGED
|
@@ -35,6 +35,6 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
35
35
|
`:`;
|
|
36
36
|
`)+P+`return __p
|
|
37
37
|
}`;var pe=af(function(){return xe(d,te+"return "+P).apply(r,v)});if(pe.source=P,_u(pe))throw pe;return pe}function gm(e){return Te(e).toLowerCase()}function vm(e){return Te(e).toUpperCase()}function mm(e,t,n){if(e=Te(e),e&&(n||t===r))return ps(e);if(!e||!(t=St(t)))return e;var o=$t(e),s=$t(t),d=gs(o,s),v=vs(o,s)+1;return Rn(o,d,v).join("")}function _m(e,t,n){if(e=Te(e),e&&(n||t===r))return e.slice(0,_s(e)+1);if(!e||!(t=St(t)))return e;var o=$t(e),s=vs(o,$t(t))+1;return Rn(o,0,s).join("")}function ym(e,t,n){if(e=Te(e),e&&(n||t===r))return e.replace($r,"");if(!e||!(t=St(t)))return e;var o=$t(e),s=gs(o,$t(t));return Rn(o,s).join("")}function wm(e,t){var n=Ae,o=Ne;if(We(t)){var s="separator"in t?t.separator:s;n="length"in t?de(t.length):n,o="omission"in t?St(t.omission):o}e=Te(e);var d=e.length;if(vr(e)){var v=$t(e);d=v.length}if(n>=d)return e;var _=n-mr(o);if(_<1)return o;var S=v?Rn(v,0,_).join(""):e.slice(0,_);if(s===r)return S+o;if(v&&(_+=S.length-_),yu(s)){if(e.slice(_).search(s)){var O,L=S;for(s.global||(s=Pa(s.source,Te(Ni.exec(s))+"g")),s.lastIndex=0;O=s.exec(L);)var P=O.index;S=S.slice(0,P===r?_:P)}}else if(e.indexOf(St(s),_)!=_){var J=S.lastIndexOf(s);J>-1&&(S=S.slice(0,J))}return S+o}function bm(e){return e=Te(e),e&&Ii.test(e)?e.replace(Ti,Zc):e}var Em=Sr(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Eu=al("toUpperCase");function of(e,t,n){return e=Te(e),t=n?r:t,t===r?zc(e)?jc(e):Fc(e):e.match(t)||[]}var af=ge(function(e,t){try{return Et(e,r,t)}catch(n){return _u(n)?n:new le(n)}}),xm=sn(function(e,t){return Ot(t,function(n){n=Jt(n),an(e,n,vu(e[n],e))}),e});function Sm(e){var t=e==null?0:e.length,n=re();return e=t?Fe(e,function(o){if(typeof o[1]!="function")throw new Lt(y);return[n(o[0]),o[1]]}):[],ge(function(o){for(var s=-1;++s<t;){var d=e[s];if(Et(d[0],this,o))return Et(d[1],this,o)}})}function Tm(e){return Zd(Ft(e,I))}function xu(e){return function(){return e}}function Cm(e,t){return e==null||e!==e?t:e}var Im=sl(),Am=sl(!0);function yt(e){return e}function Su(e){return Ms(typeof e=="function"?e:Ft(e,I))}function Dm(e){return Us(Ft(e,I))}function Nm(e,t){return Vs(e,Ft(t,I))}var Rm=ge(function(e,t){return function(n){return jr(n,e,t)}}),Bm=ge(function(e,t){return function(n){return jr(e,n,t)}});function Tu(e,t,n){var o=je(t),s=no(t,o);n==null&&!(We(t)&&(s.length||!o.length))&&(n=t,t=e,e=this,s=no(t,je(t)));var d=!(We(n)&&"chain"in n)||!!n.chain,v=fn(e);return Ot(s,function(_){var S=t[_];e[_]=S,v&&(e.prototype[_]=function(){var O=this.__chain__;if(d||O){var L=e(this.__wrapped__),P=L.__actions__=vt(this.__actions__);return P.push({func:S,args:arguments,thisArg:e}),L.__chain__=O,L}return S.apply(e,Tn([this.value()],arguments))})}),e}function Om(){return rt._===this&&(rt._=od),this}function Cu(){}function Lm(e){return e=de(e),ge(function(t){return $s(t,e)})}var Pm=ru(Fe),Fm=ru(ls),km=ru(Aa);function uf(e){return fu(e)?Da(Jt(e)):hh(e)}function Mm(e){return function(t){return e==null?r:qn(e,t)}}var Wm=fl(),Um=fl(!0);function Iu(){return[]}function Au(){return!1}function Vm(){return{}}function $m(){return""}function Hm(){return!0}function Ym(e,t){if(e=de(e),e<1||e>nt)return[];var n=Me,o=at(e,Me);t=re(t),e-=Me;for(var s=Ba(o,t);++n<e;)t(n);return s}function zm(e){return fe(e)?Fe(e,Jt):Tt(e)?[e]:vt(Cl(Te(e)))}function Gm(e){var t=++rd;return Te(e)+t}var Xm=so(function(e,t){return e+t},0),Km=iu("ceil"),qm=so(function(e,t){return e/t},1),Zm=iu("floor");function Jm(e){return e&&e.length?to(e,yt,Ha):r}function Qm(e,t){return e&&e.length?to(e,re(t,2),Ha):r}function jm(e){return ds(e,yt)}function e_(e,t){return ds(e,re(t,2))}function t_(e){return e&&e.length?to(e,yt,Xa):r}function n_(e,t){return e&&e.length?to(e,re(t,2),Xa):r}var r_=so(function(e,t){return e*t},1),i_=iu("round"),o_=so(function(e,t){return e-t},0);function a_(e){return e&&e.length?Ra(e,yt):0}function u_(e,t){return e&&e.length?Ra(e,re(t,2)):0}return l.after=Dg,l.ary=kl,l.assign=vv,l.assignIn=Jl,l.assignInWith=Eo,l.assignWith=mv,l.at=_v,l.before=Ml,l.bind=vu,l.bindAll=xm,l.bindKey=Wl,l.castArray=Vg,l.chain=Ll,l.chunk=Zh,l.compact=Jh,l.concat=Qh,l.cond=Sm,l.conforms=Tm,l.constant=xu,l.countBy=ag,l.create=yv,l.curry=Ul,l.curryRight=Vl,l.debounce=$l,l.defaults=wv,l.defaultsDeep=bv,l.defer=Ng,l.delay=Rg,l.difference=jh,l.differenceBy=ep,l.differenceWith=tp,l.drop=np,l.dropRight=rp,l.dropRightWhile=ip,l.dropWhile=op,l.fill=ap,l.filter=sg,l.flatMap=cg,l.flatMapDeep=dg,l.flatMapDepth=hg,l.flatten=Nl,l.flattenDeep=up,l.flattenDepth=sp,l.flip=Bg,l.flow=Im,l.flowRight=Am,l.fromPairs=lp,l.functions=Av,l.functionsIn=Dv,l.groupBy=pg,l.initial=cp,l.intersection=dp,l.intersectionBy=hp,l.intersectionWith=pp,l.invert=Rv,l.invertBy=Bv,l.invokeMap=vg,l.iteratee=Su,l.keyBy=mg,l.keys=je,l.keysIn=_t,l.map=vo,l.mapKeys=Lv,l.mapValues=Pv,l.matches=Dm,l.matchesProperty=Nm,l.memoize=_o,l.merge=Fv,l.mergeWith=Ql,l.method=Rm,l.methodOf=Bm,l.mixin=Tu,l.negate=yo,l.nthArg=Lm,l.omit=kv,l.omitBy=Mv,l.once=Og,l.orderBy=_g,l.over=Pm,l.overArgs=Lg,l.overEvery=Fm,l.overSome=km,l.partial=mu,l.partialRight=Hl,l.partition=yg,l.pick=Wv,l.pickBy=jl,l.property=uf,l.propertyOf=Mm,l.pull=_p,l.pullAll=Bl,l.pullAllBy=yp,l.pullAllWith=wp,l.pullAt=bp,l.range=Wm,l.rangeRight=Um,l.rearg=Pg,l.reject=Eg,l.remove=Ep,l.rest=Fg,l.reverse=pu,l.sampleSize=Sg,l.set=Vv,l.setWith=$v,l.shuffle=Tg,l.slice=xp,l.sortBy=Ag,l.sortedUniq=Np,l.sortedUniqBy=Rp,l.split=cm,l.spread=kg,l.tail=Bp,l.take=Op,l.takeRight=Lp,l.takeRightWhile=Pp,l.takeWhile=Fp,l.tap=Jp,l.throttle=Mg,l.thru=go,l.toArray=Kl,l.toPairs=ef,l.toPairsIn=tf,l.toPath=zm,l.toPlainObject=Zl,l.transform=Hv,l.unary=Wg,l.union=kp,l.unionBy=Mp,l.unionWith=Wp,l.uniq=Up,l.uniqBy=Vp,l.uniqWith=$p,l.unset=Yv,l.unzip=gu,l.unzipWith=Ol,l.update=zv,l.updateWith=Gv,l.values=Ir,l.valuesIn=Xv,l.without=Hp,l.words=of,l.wrap=Ug,l.xor=Yp,l.xorBy=zp,l.xorWith=Gp,l.zip=Xp,l.zipObject=Kp,l.zipObjectDeep=qp,l.zipWith=Zp,l.entries=ef,l.entriesIn=tf,l.extend=Jl,l.extendWith=Eo,Tu(l,l),l.add=Xm,l.attempt=af,l.camelCase=Jv,l.capitalize=nf,l.ceil=Km,l.clamp=Kv,l.clone=$g,l.cloneDeep=Yg,l.cloneDeepWith=zg,l.cloneWith=Hg,l.conformsTo=Gg,l.deburr=rf,l.defaultTo=Cm,l.divide=qm,l.endsWith=Qv,l.eq=Yt,l.escape=jv,l.escapeRegExp=em,l.every=ug,l.find=lg,l.findIndex=Al,l.findKey=Ev,l.findLast=fg,l.findLastIndex=Dl,l.findLastKey=xv,l.floor=Zm,l.forEach=Pl,l.forEachRight=Fl,l.forIn=Sv,l.forInRight=Tv,l.forOwn=Cv,l.forOwnRight=Iv,l.get=wu,l.gt=Xg,l.gte=Kg,l.has=Nv,l.hasIn=bu,l.head=Rl,l.identity=yt,l.includes=gg,l.indexOf=fp,l.inRange=qv,l.invoke=Ov,l.isArguments=Qn,l.isArray=fe,l.isArrayBuffer=qg,l.isArrayLike=mt,l.isArrayLikeObject=Ye,l.isBoolean=Zg,l.isBuffer=Bn,l.isDate=Jg,l.isElement=Qg,l.isEmpty=jg,l.isEqual=ev,l.isEqualWith=tv,l.isError=_u,l.isFinite=nv,l.isFunction=fn,l.isInteger=Yl,l.isLength=wo,l.isMap=zl,l.isMatch=rv,l.isMatchWith=iv,l.isNaN=ov,l.isNative=av,l.isNil=sv,l.isNull=uv,l.isNumber=Gl,l.isObject=We,l.isObjectLike=Ve,l.isPlainObject=oi,l.isRegExp=yu,l.isSafeInteger=lv,l.isSet=Xl,l.isString=bo,l.isSymbol=Tt,l.isTypedArray=Cr,l.isUndefined=fv,l.isWeakMap=cv,l.isWeakSet=dv,l.join=gp,l.kebabCase=tm,l.last=Mt,l.lastIndexOf=vp,l.lowerCase=nm,l.lowerFirst=rm,l.lt=hv,l.lte=pv,l.max=Jm,l.maxBy=Qm,l.mean=jm,l.meanBy=e_,l.min=t_,l.minBy=n_,l.stubArray=Iu,l.stubFalse=Au,l.stubObject=Vm,l.stubString=$m,l.stubTrue=Hm,l.multiply=r_,l.nth=mp,l.noConflict=Om,l.noop=Cu,l.now=mo,l.pad=im,l.padEnd=om,l.padStart=am,l.parseInt=um,l.random=Zv,l.reduce=wg,l.reduceRight=bg,l.repeat=sm,l.replace=lm,l.result=Uv,l.round=i_,l.runInContext=x,l.sample=xg,l.size=Cg,l.snakeCase=fm,l.some=Ig,l.sortedIndex=Sp,l.sortedIndexBy=Tp,l.sortedIndexOf=Cp,l.sortedLastIndex=Ip,l.sortedLastIndexBy=Ap,l.sortedLastIndexOf=Dp,l.startCase=dm,l.startsWith=hm,l.subtract=o_,l.sum=a_,l.sumBy=u_,l.template=pm,l.times=Ym,l.toFinite=cn,l.toInteger=de,l.toLength=ql,l.toLower=gm,l.toNumber=Wt,l.toSafeInteger=gv,l.toString=Te,l.toUpper=vm,l.trim=mm,l.trimEnd=_m,l.trimStart=ym,l.truncate=wm,l.unescape=bm,l.uniqueId=Gm,l.upperCase=Em,l.upperFirst=Eu,l.each=Pl,l.eachRight=Fl,l.first=Rl,Tu(l,function(){var e={};return qt(l,function(t,n){Ce.call(l.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),l.VERSION=u,Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),Ot(["drop","take"],function(e,t){_e.prototype[e]=function(n){n=n===r?1:Ze(de(n),0);var o=this.__filtered__&&!t?new _e(this):this.clone();return o.__filtered__?o.__takeCount__=at(n,o.__takeCount__):o.__views__.push({size:at(n,Me),type:e+(o.__dir__<0?"Right":"")}),o},_e.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),Ot(["filter","map","takeWhile"],function(e,t){var n=t+1,o=n==He||n==Xe;_e.prototype[e]=function(s){var d=this.clone();return d.__iteratees__.push({iteratee:re(s,3),type:n}),d.__filtered__=d.__filtered__||o,d}}),Ot(["head","last"],function(e,t){var n="take"+(t?"Right":"");_e.prototype[e]=function(){return this[n](1).value()[0]}}),Ot(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");_e.prototype[e]=function(){return this.__filtered__?new _e(this):this[n](1)}}),_e.prototype.compact=function(){return this.filter(yt)},_e.prototype.find=function(e){return this.filter(e).head()},_e.prototype.findLast=function(e){return this.reverse().find(e)},_e.prototype.invokeMap=ge(function(e,t){return typeof e=="function"?new _e(this):this.map(function(n){return jr(n,e,t)})}),_e.prototype.reject=function(e){return this.filter(yo(re(e)))},_e.prototype.slice=function(e,t){e=de(e);var n=this;return n.__filtered__&&(e>0||t<0)?new _e(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(t=de(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},_e.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},_e.prototype.toArray=function(){return this.take(Me)},qt(_e.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),s=l[o?"take"+(t=="last"?"Right":""):t],d=o||/^find/.test(t);s&&(l.prototype[t]=function(){var v=this.__wrapped__,_=o?[1]:arguments,S=v instanceof _e,O=_[0],L=S||fe(v),P=function(me){var ye=s.apply(l,Tn([me],_));return o&&J?ye[0]:ye};L&&n&&typeof O=="function"&&O.length!=1&&(S=L=!1);var J=this.__chain__,te=!!this.__actions__.length,ie=d&&!J,pe=S&&!te;if(!d&&L){v=pe?v:new _e(this);var oe=e.apply(v,_);return oe.__actions__.push({func:go,args:[P],thisArg:r}),new Pt(oe,J)}return ie&&pe?e.apply(this,_):(oe=this.thru(P),ie?o?oe.value()[0]:oe.value():oe)})}),Ot(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ui[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var s=arguments;if(o&&!this.__chain__){var d=this.value();return t.apply(fe(d)?d:[],s)}return this[n](function(v){return t.apply(fe(v)?v:[],s)})}}),qt(_e.prototype,function(e,t){var n=l[t];if(n){var o=n.name+"";Ce.call(br,o)||(br[o]=[]),br[o].push({name:t,func:n})}}),br[uo(r,q).name]=[{name:"wrapper",func:r}],_e.prototype.clone=bd,_e.prototype.reverse=Ed,_e.prototype.value=xd,l.prototype.at=Qp,l.prototype.chain=jp,l.prototype.commit=eg,l.prototype.next=tg,l.prototype.plant=rg,l.prototype.reverse=ig,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=og,l.prototype.first=l.prototype.head,Gr&&(l.prototype[Gr]=ng),l},_r=ed();Yn?((Yn.exports=_r)._=_r,Sa._=_r):rt._=_r}).call(Vt.commonjsGlobal)})(Vo,Vo.exports);var z0=Vo.exports;const xf=Vt.getDefaultExportFromCjs(z0),pn=/[\u4e00-\u9fa5]+/;let Uu;const G0=["svg","g","path","polyline","circle"];class X0{constructor(){hn(this,"from");hn(this,"to");hn(this,"yxI18nThesaurus");hn(this,"systemKey");hn(this,"dbKey");hn(this,"unknownWords");hn(this,"unknownWordsNode");hn(this,"rootDocument");this.from="zh",this.to="en",this.yxI18nThesaurus={},this.systemKey="station-control",this.dbKey="",this.initTranslate=this.initTranslate.bind(this),this.unknownWords=[],this.unknownWordsNode=new Map,this.rootDocument=null}initTranslate(u){return et(this,arguments,function*({to:i,systemKey:r}){if(i!=="zh"){if(i==="cht")return this.handleTraditionalChinese();yield this.initConfig({to:i,systemKey:r}),this.observerRouteChange()}})}handleTraditionalChinese(){document.body.style.fontFamily="PingFang SC",document.body.style["font-variant-east-asian"]="traditional",document.documentElement.lang="zh-tw"}observerRouteChange(){let i=new MutationObserver(h=>{h.length>0&&h.forEach(g=>{switch(g.type){case"characterData":if(pn.test(g.target.data)){const y=g.target.nodeValue.replace(/\s/g,"");this.unknownWords.includes(y)||(this.replaceTextByNode(g.target),this.startMicroTaskQueue())}break;case"childList":this.handleChildListMutation(g);break;case"attributes":g.attributeName==="placeholder"&&pn.test(g.target.placeholder)?this.replaceTextByNode(g.target):g.attributeName==="readonly"?this.replaceTextByNode(g.target):g.attributeName;break}})}),r={childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["readonly"]};i.observe(this.rootDocument,r);const u=i.takeRecords();u.length>0&&u.forEach(h=>{})}handleChildListMutation(i){if(i.addedNodes.length>0&&i.removedNodes.length>0)return this.addedNode(i);i.removedNodes.length>0&&i.removedNodes[0].id!=="nprogress"||this.addedNode(i)}addedNode(i){var r;if(i.addedNodes.length>0){const u=i.target.tagName.toLowerCase();if(G0.includes(u))return;const h=(r=i.addedNodes[0])==null?void 0:r.className;if(h)h.includes("v-modal")?(this.throttleTraversingNode(i.previousSibling),this.startMicroTaskQueue()):h.includes("tooltip")?i.addedNodes[0].innerText=this.replaceValue(i.addedNodes[0].innerText,i.addedNodes[0]):h.includes("message")?(this.throttleTraversingNode(i.addedNodes[0]),this.startMicroTaskQueue()):h.includes("loading")?(this.throttleTraversingNode(i.addedNodes[0]),this.startMicroTaskQueue()):h.includes("suffix")?(this.throttleTraversingNode(i.target),this.startMicroTaskQueue()):(this.throttleTraversingNode(i.target),this.startMicroTaskQueue());else{const g=i.addedNodes[0];g&&g.nodeType===Node.TEXT_NODE&&pn.test(g.nodeValue)&&(g.nodeValue=this.replaceValue(g.nodeValue,g),this.startMicroTaskQueue())}}else this.throttleTraversingNode(i.target),this.replaceDocumentTitle(),this.startMicroTaskQueue()}startMicroTaskQueue(){Uu&&clearTimeout(Uu),Uu=setTimeout(()=>{this.unknownWords.length>0&&xf.throttle(()=>this.translateUnknownWords(this.unknownWords),1e3,{leading:!0})()},0)}throttleTraversingNode(i){xf.throttle(()=>this.traversingNode(i),500,{leading:!0})()}traversingNode(i){if(!i)return;const r=g=>this.replaceTextByNode(g),u=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode(g){return g.tagName&&g.tagName.toLowerCase()==="svg"?NodeFilter.FILTER_REJECT:(r(g),NodeFilter.FILTER_SKIP)}});let h;for(;h=u.nextNode();)r(h)}replaceTextByNode(i){i.title&&pn.test(i.title)&&(i.title=this.replaceValue(i.title,i)),i.nodeType===Node.ELEMENT_NODE?["textarea","input"].includes(i.tagName.toLowerCase())&&(pn.test(i.value)&&(i.value=this.replaceValue(i.value,i)),pn.test(i.placeholder)&&(i.placeholder=this.replaceValue(i.placeholder,i)),i.readOnly&&pn.test(i.value)&&(i.value=this.replaceValue(i.value,i))):i.nodeType===Node.TEXT_NODE&&pn.test(i.nodeValue)&&(i.nodeValue=this.replaceValue(i.nodeValue,i))}replaceDocumentTitle(){const i=document.title;pn.test(i)&&this.yxI18nThesaurus[i]&&(document.title=this.yxI18nThesaurus[i])}replaceValue(i,r){if(i==="")return;const u=i.replace(/\s/g,"");if(this.yxI18nThesaurus[u])return this.yxI18nThesaurus[u];if(this.unknownWords.includes(u)||this.unknownWords.push(u),r!=null&&r.getBoundingClientRect){const{x:h,y:g}=r.getBoundingClientRect(),y=`${h}_${g}`;this.unknownWordsNode.has(y)||this.unknownWordsNode.set(y,r)}else if(r.parentNode){const{x:h,y:g}=r.parentNode.getBoundingClientRect(),y=`${h}_${g}`;this.unknownWordsNode.has(y)||this.unknownWordsNode.set(y,r)}else this.unknownWordsNode.set(i,r);return i}translateUnknownWords(i){return et(this,null,function*(){const r=i.filter(g=>g.trim()!=="");if(r.length===0)return;const u=Array.from(new Set(r)),h=yield Ef({words:u,toSource:this.to,systemFlag:this.systemKey});this.unknownWords=[],this.yxI18nThesaurus=Je(Je({},this.yxI18nThesaurus),h),yield li(this.dbKey,this.yxI18nThesaurus),this.unknownWords=[];for(const g of this.unknownWordsNode.values())this.replaceTextByNode(g);this.unknownWordsNode.clear()})}initConfig(u){return et(this,arguments,function*({to:i,systemKey:r}){this.to=i||this.to,this.systemKey=r||this.systemKey,this.dbKey=`${this.systemKey}_${this.to}`,document.querySelector("html").classList.add(i),this.rootDocument=document.querySelector("body"),(yield Uo("lang"))!==i&&(yield li("lang",i));const g=yield Uo(this.dbKey);if(!g)yield li(this.dbKey,{});else try{const y=yield Ef({words:[],toSource:this.to,systemFlag:this.systemKey});this.yxI18nThesaurus=y,yield li(this.dbKey,this.yxI18nThesaurus)}catch(y){this.yxI18nThesaurus=g}})}getYxI18nThesaurus(){return this.yxI18nThesaurus}}const jf=new X0,ec=jf.initTranslate,tc=a=>et(exports,null,function*(){(yield Uo("lang"))!==a&&(yield li("lang",a),wi.postMessage(JSON.stringify({type:"lang"})),location.reload())}),nc=()=>et(exports,null,function*(){return(yield Uo("lang"))||""}),rc=a=>jf.getYxI18nThesaurus()[a]||a,ic=Object.freeze(Object.defineProperty({__proto__:null,changeLang:tc,getLang:nc,getWordByYxI18nThesaurus:rc,initTranslate:ec},Symbol.toStringTag,{value:"Module"})),K0={props:{value:{typeof:Number}}},q0={class:"badge-container"};function Z0(a,i,r,u,h,g){return f.withDirectives((f.openBlock(),f.createElementBlock("div",q0,[f.createElementVNode("sup",null,f.toDisplayString(r.value),1)],512)),[[f.vShow,r.value>0]])}const oc=nr(K0,[["render",Z0],["__scopeId","data-v-588a1297"]]),J0={components:{theme:B0,issue:k0,Badge:oc,lang:$0},props:{showTool:{typeof:Boolean,default:!1},badgeValue:{typeof:Number}},data(){return{columns:"repeat(2, 1fr)",rows:window.isRenderLang?"repeat(2, 1fr)":"lfr",config:[{name:"theme",label:"主题切换",icon:"theme",icon_active:"https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/toolbar-theme-back.svg",position:[50,0],desc:"跳转到问题反馈页面",action:"hiddenTool",component:"Theme",data:window.theme,"grid-area":window.isRenderLang?"1 / 1 / 2 / 3":"1 / 1 / 2 / 2",show:window.theme.length>0},{name:"lang",label:"语言切换",icon:"lang",position:[100,0],desc:"语言切换",component:"Lang",isShowBadge:!0,"grid-area":"2 / 1 / 3 / 2",show:window.isRenderLang?window.isRenderLang:!1},{name:"issue",label:"问题反馈",icon:"issue",position:[100,0],desc:"跳转到问题反馈页面",component:"Issue",isShowBadge:!0,"grid-area":window.isRenderLang?"2 / 2 / 3 / 3":"1 / 2 / 2 / 3",show:window.isRenderIssue?window.isRenderIssue:!1}],curComponent:{},curTheme:vi(),langList:[{name:"中文-Chinese",lang:"zh"},{name:"中文(香港)-Chinese(Hong Kong)",lang:"cht"},{name:"英语-English",lang:"en"}]}},computed:{configList(){return this.config.filter(a=>a.show)}},watch:{showTool(a){a?this.curTheme=this.getCurTheme():this.curComponent={}}},mounted(){this.curTheme=this.getCurTheme()},methods:{changeLang:tc,getCurTheme(){return vi()},configHandle(a){if(a.name==="issue"){const i=window.location.pathname.split("/")[1];window.open(`/${i}/integrated/#/workOrderManagement`),this.$emit("zero")}else this.curComponent=a},chooseTheme(a){Qu(a),this.curTheme=a.id},getPosition(a){return{0:{"grid-row":2,"grid-column":1},1:{"grid-row":1,"grid-column":2},2:{"grid-row":2,"grid-column":3},3:{"grid-row":3,"grid-column":2}}[a]}}},Q0=["onClick"],j0=["title"],e1={class:"tool-icon relative flex justify-center items-center"},t1={class:"yx-icon",style:{color:"var(--color-main-100)"},color:`var(--color-main-100)
|
|
38
|
-
`,size:"24"},n1={class:"mt-10 text-center"},r1={key:1,class:"w-full h-full"},i1={key:0,class:"toolbar-wrap-component"},o1={class:"yx-icon",style:{color:"var(--color-main-100)"},color:"var(--color-main-100)",size:"30"},a1=["title","onClick"],u1={key:1,class:"box-border w-full h-full py-10 overflow-y-auto"},s1=["onClick","title"];function l1(a,i,r,u,h,g){const y=f.resolveComponent("Badge");return f.openBlock(),f.createBlock(f.Transition,{name:"zoom",mode:"out-in"},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("div",{class:f.normalizeClass(["toolbar-container",r.showTool?"zoom-in":"zoom-out "])},[h.curComponent.name?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",{key:0,style:f.normalizeStyle({"grid-template-columns":h.columns,"grid-template-rows":h.rows}),class:"toolbar-wrap"},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(g.configList,b=>(f.openBlock(),f.createElementBlock("div",{class:"flex justify-center items-center",onClick:A=>g.configHandle(b),style:f.normalizeStyle({"grid-area":b["grid-area"]})},[f.createElementVNode("div",{title:b.label,class:"flex flex-col justify-center items-center"},[f.createElementVNode("div",e1,[f.createElementVNode("i",t1,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(b.icon)))]),b.isShowBadge?(f.openBlock(),f.createBlock(y,{key:0,value:r.badgeValue},null,8,["value"])):f.createCommentVNode("",!0)]),f.createElementVNode("span",n1,f.toDisplayString(b.label),1)],8,j0)],12,Q0))),256))],4)),h.curComponent.name?(f.openBlock(),f.createElementBlock("div",r1,[h.curComponent.name==="theme"?(f.openBlock(),f.createElementBlock("div",i1,[f.createElementVNode("div",{class:"flex flex-col toolbar-center items-center",onClick:i[0]||(i[0]=b=>h.curComponent={}),title:"返回"},[f.createElementVNode("i",o1,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(h.curComponent.icon)))])]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(h.curComponent.data,(b,A)=>(f.openBlock(),f.createElementBlock("div",{style:f.normalizeStyle([{background:b.themeColor,boxShadow:`0px 4px 7px 0px ${b.themeColor}`},g.getPosition(A)]),title:b.name,class:f.normalizeClass(["theme",h.curTheme===b.id?"select":""]),onClick:D=>g.chooseTheme(b)},null,14,a1))),256))])):h.curComponent.name==="lang"?(f.openBlock(),f.createElementBlock("div",u1,[f.createElementVNode("div",{onClick:i[1]||(i[1]=b=>h.curComponent={}),class:"px-10 cursor-pointer"},"返回"),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(h.langList,b=>(f.openBlock(),f.createElementBlock("div",{onClick:A=>g.changeLang(b.lang),title:b.name,class:"px-10 cursor-pointer mt-10 whitespace-nowrap truncate"},f.toDisplayString(b.name),9,s1))),256))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],2),[[f.vShow,r.showTool]])]),_:1})}const f1=nr(J0,[["render",l1],["__scopeId","data-v-b8083f17"]]),c1={xmlns:"http://www.w3.org/2000/svg",width:"50",height:"50",fill:"none",viewBox:"0 0 25 25"},d1=f.createElementVNode("g",{stroke:"currentColor","stroke-linejoin":"round","stroke-width":"2"},[f.createElementVNode("path",{d:"M9 3H4a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1ZM9 14H4a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1ZM20 3h-5a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1ZM20 14h-5a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1Z"})],-1),h1=[d1];function p1(a,i){return f.openBlock(),f.createElementBlock("svg",c1,h1)}const g1={render:p1},Ju={name:"YxToolbar",components:{ToolbarContainer:f1,menuIcon:g1,Badge:oc},mixins:[I0],data(){return{showTool:!1,position:{top:0,left:0},badgeValue:0,showBadge:window.isRenderIssue}},computed:{showClass(){return this.status?"expanded":"folded"}},mounted(){this.showBadge&&this.getCount(),this.initToolPosition()},methods:{initToolPosition(){const a=document.querySelector(".toolbar-wrap"),i=window.innerWidth-60-100+"px",r=window.innerHeight-60-100+"px";a.style.setProperty("--tool-left",i),a.style.setProperty("--tool-top",r)},getCount(){return et(this,null,function*(){const{data:a}=yield Gu.getCommentUntreatedCount();this.badgeValue=a.count})},handlerClickTool(a){this.mousePoint.x===a.screenX&&this.mousePoint.y===a.screenY&&(this.switchStatus(),this.getAllPosition(),this.setPanel(),this.showTool=!0)},switchStatus(){this.status=!this.status},getAllPosition(){this.toolPos=this.getDomPosition(this.toolDom),this.panelPos=this.getDomPosition(this.panelDom)},getDomPosition(a){return a.getBoundingClientRect()},setPanel(){const r=window.innerWidth-this.panelWidth,u=window.innerHeight-this.panelHeight;let h=this.toolPos.left+this.toolPos.width/2-this.panelWidth/2,g=this.toolPos.top+this.toolPos.height/2-this.panelHeight/2;h<0&&(h=0),g<0&&(g=0),h>r&&(h=r-40),g>u&&(g=u-40),this.setPanelPosition(h,g)},setPanelPosition(a,i){this.panelDom.style.left=a+"px",this.panelDom.style.top=i+"px"},mousedownTool(a){this.mousePoint.x=a.screenX,this.mousePoint.y=a.screenY},close(){this.status=!1,this.showTool=!1}}},Sf=()=>{f.useCssVars(a=>({"7d9b552a":a.panelWidthPX,"53d65213":a.panelHeightPX}))},Tf=Ju.setup;Ju.setup=Tf?(a,i)=>(Sf(),Tf(a,i)):Sf;const v1={id:"toolbar-wrap",class:"toolbar-wrap"},m1={class:"yx-icon"};function _1(a,i,r,u,h,g){const y=f.resolveComponent("Badge"),b=f.resolveComponent("ToolbarContainer");return f.openBlock(),f.createElementBlock("div",v1,[f.createElementVNode("div",{class:f.normalizeClass(["tool",`${g.showClass}`]),onClick:i[0]||(i[0]=(...A)=>g.handlerClickTool&&g.handlerClickTool(...A)),onMousedown:i[1]||(i[1]=(...A)=>g.mousedownTool&&g.mousedownTool(...A)),onMouseup:i[2]||(i[2]=(...A)=>a.mouseupTool&&a.mouseupTool(...A))},[f.createElementVNode("i",m1,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent("menuIcon")))]),h.showBadge?(f.openBlock(),f.createBlock(y,{key:0,value:h.badgeValue},null,8,["value"])):f.createCommentVNode("",!0)],34),f.createElementVNode("div",{class:f.normalizeClass(["mask",`${g.showClass}`]),onClick:i[3]||(i[3]=(...A)=>g.close&&g.close(...A))},null,2),f.createVNode(b,{onZero:i[4]||(i[4]=A=>h.badgeValue=0),badgeValue:h.badgeValue,class:"panel",showTool:h.showTool},null,8,["badgeValue","showTool"])])}const Cf=nr(Ju,[["render",_1],["__scopeId","data-v-1d4b1d0f"]]);var Pr;const Or=class Or{constructor(i){cf(this,Pr,"yxToolbarV2");const{theme:r,isRenderIssue:u,isRenderLang:h}=i;return Or.instance||(window.theme=r,window.isRenderIssue=u,window.isRenderLang=h,this.init(),Or.instance=this),Or.instance}get vueVersion(){return f.version[0]}init(){this.mount()}mount(){const i=document.createElement("div");if(i.id=So(this,Pr),document.body.appendChild(i),this.vueVersion==="3")return f.createApp(Cf).mount(`#${So(this,Pr)}`);{const r=require("vue");return new r({render:u=>u(Cf)}).$mount(`#${So(this,Pr)}`)}}};Pr=new WeakMap,Or.instance=null;let gi=Or;const ac=Object.freeze(Object.defineProperty({__proto__:null,Toolbar:gi,Update:Kf,YxDialog:Af,YxForm:zf,YxFormV2:Jf,YxIcon:qf,YxSearchForm:Yf,YxTable:Hf,YxUpload:Zf},Symbol.toStringTag,{value:"Module"})),uc=a=>et(exports,null,function*(){var r;a=Je(Je({},m_),a);let i=vi();try{yield y1(a);const{data:u}=yield Ho.http.get(a.themeApiUrl);if(a.isRenderLang&&a.systemKey){const y=yield nc();yield ec({to:y||a.lang,systemKey:
|
|
38
|
+
`,size:"24"},n1={class:"mt-10 text-center"},r1={key:1,class:"w-full h-full"},i1={key:0,class:"toolbar-wrap-component"},o1={class:"yx-icon",style:{color:"var(--color-main-100)"},color:"var(--color-main-100)",size:"30"},a1=["title","onClick"],u1={key:1,class:"box-border w-full h-full py-10 overflow-y-auto"},s1=["onClick","title"];function l1(a,i,r,u,h,g){const y=f.resolveComponent("Badge");return f.openBlock(),f.createBlock(f.Transition,{name:"zoom",mode:"out-in"},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("div",{class:f.normalizeClass(["toolbar-container",r.showTool?"zoom-in":"zoom-out "])},[h.curComponent.name?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",{key:0,style:f.normalizeStyle({"grid-template-columns":h.columns,"grid-template-rows":h.rows}),class:"toolbar-wrap"},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(g.configList,b=>(f.openBlock(),f.createElementBlock("div",{class:"flex justify-center items-center",onClick:A=>g.configHandle(b),style:f.normalizeStyle({"grid-area":b["grid-area"]})},[f.createElementVNode("div",{title:b.label,class:"flex flex-col justify-center items-center"},[f.createElementVNode("div",e1,[f.createElementVNode("i",t1,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(b.icon)))]),b.isShowBadge?(f.openBlock(),f.createBlock(y,{key:0,value:r.badgeValue},null,8,["value"])):f.createCommentVNode("",!0)]),f.createElementVNode("span",n1,f.toDisplayString(b.label),1)],8,j0)],12,Q0))),256))],4)),h.curComponent.name?(f.openBlock(),f.createElementBlock("div",r1,[h.curComponent.name==="theme"?(f.openBlock(),f.createElementBlock("div",i1,[f.createElementVNode("div",{class:"flex flex-col toolbar-center items-center",onClick:i[0]||(i[0]=b=>h.curComponent={}),title:"返回"},[f.createElementVNode("i",o1,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(h.curComponent.icon)))])]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(h.curComponent.data,(b,A)=>(f.openBlock(),f.createElementBlock("div",{style:f.normalizeStyle([{background:b.themeColor,boxShadow:`0px 4px 7px 0px ${b.themeColor}`},g.getPosition(A)]),title:b.name,class:f.normalizeClass(["theme",h.curTheme===b.id?"select":""]),onClick:D=>g.chooseTheme(b)},null,14,a1))),256))])):h.curComponent.name==="lang"?(f.openBlock(),f.createElementBlock("div",u1,[f.createElementVNode("div",{onClick:i[1]||(i[1]=b=>h.curComponent={}),class:"px-10 cursor-pointer"},"返回"),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(h.langList,b=>(f.openBlock(),f.createElementBlock("div",{onClick:A=>g.changeLang(b.lang),title:b.name,class:"px-10 cursor-pointer mt-10 whitespace-nowrap truncate"},f.toDisplayString(b.name),9,s1))),256))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],2),[[f.vShow,r.showTool]])]),_:1})}const f1=nr(J0,[["render",l1],["__scopeId","data-v-b8083f17"]]),c1={xmlns:"http://www.w3.org/2000/svg",width:"50",height:"50",fill:"none",viewBox:"0 0 25 25"},d1=f.createElementVNode("g",{stroke:"currentColor","stroke-linejoin":"round","stroke-width":"2"},[f.createElementVNode("path",{d:"M9 3H4a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1ZM9 14H4a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1ZM20 3h-5a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1ZM20 14h-5a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1Z"})],-1),h1=[d1];function p1(a,i){return f.openBlock(),f.createElementBlock("svg",c1,h1)}const g1={render:p1},Ju={name:"YxToolbar",components:{ToolbarContainer:f1,menuIcon:g1,Badge:oc},mixins:[I0],data(){return{showTool:!1,position:{top:0,left:0},badgeValue:0,showBadge:window.isRenderIssue}},computed:{showClass(){return this.status?"expanded":"folded"}},mounted(){this.showBadge&&this.getCount(),this.initToolPosition()},methods:{initToolPosition(){const a=document.querySelector(".toolbar-wrap"),i=window.innerWidth-60-100+"px",r=window.innerHeight-60-100+"px";a.style.setProperty("--tool-left",i),a.style.setProperty("--tool-top",r)},getCount(){return et(this,null,function*(){const{data:a}=yield Gu.getCommentUntreatedCount();this.badgeValue=a.count})},handlerClickTool(a){this.mousePoint.x===a.screenX&&this.mousePoint.y===a.screenY&&(this.switchStatus(),this.getAllPosition(),this.setPanel(),this.showTool=!0)},switchStatus(){this.status=!this.status},getAllPosition(){this.toolPos=this.getDomPosition(this.toolDom),this.panelPos=this.getDomPosition(this.panelDom)},getDomPosition(a){return a.getBoundingClientRect()},setPanel(){const r=window.innerWidth-this.panelWidth,u=window.innerHeight-this.panelHeight;let h=this.toolPos.left+this.toolPos.width/2-this.panelWidth/2,g=this.toolPos.top+this.toolPos.height/2-this.panelHeight/2;h<0&&(h=0),g<0&&(g=0),h>r&&(h=r-40),g>u&&(g=u-40),this.setPanelPosition(h,g)},setPanelPosition(a,i){this.panelDom.style.left=a+"px",this.panelDom.style.top=i+"px"},mousedownTool(a){this.mousePoint.x=a.screenX,this.mousePoint.y=a.screenY},close(){this.status=!1,this.showTool=!1}}},Sf=()=>{f.useCssVars(a=>({"7d9b552a":a.panelWidthPX,"53d65213":a.panelHeightPX}))},Tf=Ju.setup;Ju.setup=Tf?(a,i)=>(Sf(),Tf(a,i)):Sf;const v1={id:"toolbar-wrap",class:"toolbar-wrap"},m1={class:"yx-icon"};function _1(a,i,r,u,h,g){const y=f.resolveComponent("Badge"),b=f.resolveComponent("ToolbarContainer");return f.openBlock(),f.createElementBlock("div",v1,[f.createElementVNode("div",{class:f.normalizeClass(["tool",`${g.showClass}`]),onClick:i[0]||(i[0]=(...A)=>g.handlerClickTool&&g.handlerClickTool(...A)),onMousedown:i[1]||(i[1]=(...A)=>g.mousedownTool&&g.mousedownTool(...A)),onMouseup:i[2]||(i[2]=(...A)=>a.mouseupTool&&a.mouseupTool(...A))},[f.createElementVNode("i",m1,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent("menuIcon")))]),h.showBadge?(f.openBlock(),f.createBlock(y,{key:0,value:h.badgeValue},null,8,["value"])):f.createCommentVNode("",!0)],34),f.createElementVNode("div",{class:f.normalizeClass(["mask",`${g.showClass}`]),onClick:i[3]||(i[3]=(...A)=>g.close&&g.close(...A))},null,2),f.createVNode(b,{onZero:i[4]||(i[4]=A=>h.badgeValue=0),badgeValue:h.badgeValue,class:"panel",showTool:h.showTool},null,8,["badgeValue","showTool"])])}const Cf=nr(Ju,[["render",_1],["__scopeId","data-v-1d4b1d0f"]]);var Pr;const Or=class Or{constructor(i){cf(this,Pr,"yxToolbarV2");const{theme:r,isRenderIssue:u,isRenderLang:h}=i;return Or.instance||(window.theme=r,window.isRenderIssue=u,window.isRenderLang=h,this.init(),Or.instance=this),Or.instance}get vueVersion(){return f.version[0]}init(){this.mount()}mount(){const i=document.createElement("div");if(i.id=So(this,Pr),document.body.appendChild(i),this.vueVersion==="3")return f.createApp(Cf).mount(`#${So(this,Pr)}`);{const r=require("vue");return new r({render:u=>u(Cf)}).$mount(`#${So(this,Pr)}`)}}};Pr=new WeakMap,Or.instance=null;let gi=Or;const ac=Object.freeze(Object.defineProperty({__proto__:null,Toolbar:gi,Update:Kf,YxDialog:Af,YxForm:zf,YxFormV2:Jf,YxIcon:qf,YxSearchForm:Yf,YxTable:Hf,YxUpload:Zf},Symbol.toStringTag,{value:"Module"})),uc=a=>et(exports,null,function*(){var r;a=Je(Je({},m_),a);let i=vi();try{yield y1(a);const{data:u}=yield Ho.http.get(a.themeApiUrl);if(a.isRenderLang&&a.systemKey){const y=yield nc();yield ec({to:y||a.lang,systemKey:a.systemKey})}a.isRenderToolbar&&new gi({theme:u,isRenderIssue:a.isRenderIssue,isRenderLang:a.isRenderLang});let h=i?(r=u.find(y=>y.id===i))==null?void 0:r.themeUrl:"";if(!i||!h){const b=u.find(A=>A.defaultTheme===1)||u[0];h=b.themeUrl,i=b.id}const g=yield zu(h);sc({themeCssVar:g,themeId:i}),If(),wi.onmessage=y=>{const b=JSON.parse(y.data);b.type==="theme"&&(zu(b.data.themeUrl),$o.yxSubscribe.publish({type:"theme",data:null})),b.type==="lang"&&location.reload()}}catch(u){If(),ju()}}),y1=a=>et(exports,null,function*(){Ho.setSystemConfig(Je({},a))}),If=()=>{const a=document.createElement("style");a.innerHTML=v_,document.head.appendChild(a)},sc=({themeCssVar:a,themeId:i})=>{const r=localStorage.getItem("ttcGlobalState")||"{}",u=JSON.parse(r);u.theme={themeCssVar:a,id:i},localStorage.setItem("ttcGlobalState",JSON.stringify(u))},Qu=a=>et(exports,null,function*(){const i=yield zu(a.themeUrl);sc({themeCssVar:i,themeId:a==null?void 0:a.id}),wi.postMessage(JSON.stringify({type:"theme",data:a})),$o.yxSubscribe.publish({type:"theme",data:a})}),ju=()=>{const a=yi(),i=document.documentElement;Object.keys(a).forEach(r=>{r!=="exclude"&&Object.keys(a[r]).forEach(u=>{const h=`--${r}-${u}`;i.style.setProperty(h,a[r][u])})})},zu=a=>et(exports,null,function*(){const r=yield(yield fetch(a)).json(),u=document.createElement("style");let h=`:root {
|
|
39
39
|
`;return Object.keys(r).forEach(g=>{g!=="exclude"&&Object.keys(r[g]).forEach(y=>{const b=`--${g}-${y}`,A=r[g][y];h+=` ${b}: ${A};
|
|
40
40
|
`})}),h+="}",u.appendChild(document.createTextNode(h)),document.head.appendChild(u),r}),lc=()=>et(exports,null,function*(){const{data:a}=yield Gu.getUserThemeList(),i=a.find(u=>u.defaultTheme===1);return i?i.themeUrl:a[0].themeUrl}),vi=()=>{var r;const a=localStorage.getItem("ttcGlobalState"),i=a&&((r=JSON.parse(a))==null?void 0:r.theme);return(i==null?void 0:i.id)||null},yi=()=>{var r;const a=localStorage.getItem("ttcGlobalState"),i=a&&((r=JSON.parse(a))==null?void 0:r.theme);return(i==null?void 0:i.themeCssVar)||{}},fc=a=>{const i=yi();return(i==null?void 0:i[a])||{}},cc=(a,i)=>{const r=yi();if(!r.exclude)return null;for(let u in r.exclude){const h=r.exclude[u];for(let g of Object.keys(h))for(let y of Object.keys(h[g]))if(`--${g}-${y}`===a&&$o.isColorEqual(h[g][y],i))return i}return null},dc=Object.freeze(Object.defineProperty({__proto__:null,changeTheme:Qu,findColorByTheme:cc,getCurTheme:vi,getCurThemeCssVar:yi,getDefaultThemeUrl:lc,getGroupColor:fc,install:uc,updateTheme:ju},Symbol.toStringTag,{value:"Module"})),w1={install:a=>{a.config.globalProperties.$yx18n=i=>rc(i)}},hc=Object.freeze(Object.defineProperty({__proto__:null,default:w1},Symbol.toStringTag,{value:"Module"})),wi=new BroadcastChannel("YXUSE_BC"),b1={utils:$o.utils2,api:Gu.api2,theme:dc,components:ac,directives:c_.directives,BC:wi,translate:ic,yxi18n:hc,yxHooks:Vt.yxHooks};exports.BC=wi;exports.Toolbar=gi;exports.Update=Kf;exports._sfc_main=Af;exports._sfc_main$1=Hf;exports._sfc_main$2=Zf;exports._sfc_main$3=Jf;exports.changeTheme=Qu;exports.components2=ac;exports.findColorByTheme=cc;exports.form=zf;exports.getCurTheme=vi;exports.getCurThemeCssVar=yi;exports.getDefaultThemeUrl=lc;exports.getGroupColor=fc;exports.index=Yf;exports.index$1=qf;exports.index$2=b1;exports.install=uc;exports.theme2=dc;exports.translate2=ic;exports.updateTheme=ju;exports.yxi18n2=hc;
|
package/lib/index.cjs2.js.gz
CHANGED
|
Binary file
|
package/lib/index.es2.js
CHANGED
|
@@ -7979,7 +7979,7 @@ const ay = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7979
7979
|
const { data: u } = yield Zf.get(a.themeApiUrl);
|
|
7980
7980
|
if (a.isRenderLang && a.systemKey) {
|
|
7981
7981
|
const _ = yield mc();
|
|
7982
|
-
yield gc({ to: _ || a.lang, systemKey:
|
|
7982
|
+
yield gc({ to: _ || a.lang, systemKey: a.systemKey });
|
|
7983
7983
|
}
|
|
7984
7984
|
a.isRenderToolbar && new na({ theme: u, isRenderIssue: a.isRenderIssue, isRenderLang: a.isRenderLang });
|
|
7985
7985
|
let h = i ? (r = u.find((_) => _.id === i)) == null ? void 0 : r.themeUrl : "";
|
package/lib/index.es2.js.gz
CHANGED
|
Binary file
|