@vmm/html
Advanced tools
Comparing version 1.0.119 to 1.0.122
@@ -1,2 +0,2 @@ | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("VueRouter"),require("Vue")):"function"===typeof define&&define.amd?define(["VueRouter","Vue"],t):"object"===typeof exports?exports["main"]=t(require("VueRouter"),require("Vue")):e["main"]=t(e["VueRouter"],e["Vue"])})("undefined"!==typeof self?self:this,function(__WEBPACK_EXTERNAL_MODULE__6389__,__WEBPACK_EXTERNAL_MODULE__8bbf__){return function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s="c267")}({"27ae":function(module,exports,__webpack_require__){(function(global){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(e,t){module.exports=t(e)})("undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof global?global:this,function(global){"use strict";global=global||{};var _Base64=global.Base64,version="2.5.1",buffer;if(module.exports)try{buffer=eval("require('buffer').Buffer")}catch(err){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(e){for(var t={},o=0,r=e.length;o<r;o++)t[e.charAt(o)]=o;return t}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(e){if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?fromCharCode(192|t>>>6)+fromCharCode(128|63&t):fromCharCode(224|t>>>12&15)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t)}t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fromCharCode(240|t>>>18&7)+fromCharCode(128|t>>>12&63)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(e){return e.replace(re_utob,cb_utob)},cb_encode=function(e){var t=[0,2,1][e.length%3],o=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0),r=[b64chars.charAt(o>>>18),b64chars.charAt(o>>>12&63),t>=2?"=":b64chars.charAt(o>>>6&63),t>=1?"=":b64chars.charAt(63&o)];return r.join("")},btoa=global.btoa?function(e){return global.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e)).toString("base64")}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e)).toString("base64")}:function(e){return btoa(utob(e))},encode=function(e,t){return t?_encode(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):_encode(String(e))},encodeURI=function(e){return encode(e,!0)},re_btou=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g"),cb_btou=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),o=t-65536;return fromCharCode(55296+(o>>>10))+fromCharCode(56320+(1023&o));case 3:return fromCharCode((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return fromCharCode((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=function(e){return e.replace(re_btou,cb_btou)},cb_decode=function(e){var t=e.length,o=t%4,r=(t>0?b64tab[e.charAt(0)]<<18:0)|(t>1?b64tab[e.charAt(1)]<<12:0)|(t>2?b64tab[e.charAt(2)]<<6:0)|(t>3?b64tab[e.charAt(3)]:0),n=[fromCharCode(r>>>16),fromCharCode(r>>>8&255),fromCharCode(255&r)];return n.length-=[0,0,2,1][o],n.join("")},_atob=global.atob?function(e){return global.atob(e)}:function(e){return e.replace(/\S{1,4}/g,cb_decode)},atob=function(e){return _atob(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e,"base64")).toString()}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e,"base64")).toString()}:function(e){return btou(_atob(e))},decode=function(e){return _decode(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var e=global.Base64;return global.Base64=_Base64,e};if(global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,__buffer__:buffer},"function"===typeof Object.defineProperty){var noEnum=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(e){return encode(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}}return global["Meteor"]&&(Base64=global.Base64),module.exports?module.exports.Base64=global.Base64:(__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return global.Base64}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)),{Base64:global.Base64}})}).call(this,__webpack_require__("ac5c"))},3385:function(e,t,o){(function(t){var o=1/0,r="[object Symbol]",n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",c="\\u20d0-\\u20f0",u="\\u2700-\\u27bf",l="a-z\\xdf-\\xf6\\xf8-\\xff",d="\\xac\\xb1\\xd7\\xf7",f="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",p="\\u2000-\\u206f",h=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",g="A-Z\\xc0-\\xd6\\xd8-\\xde",b="\\ufe0e\\ufe0f",v=d+f+p+h,m="['’]",y="["+v+"]",_="["+i+c+"]",w="\\d+",j="["+u+"]",E="["+l+"]",C="[^"+s+v+w+u+l+g+"]",S="\\ud83c[\\udffb-\\udfff]",x="(?:"+_+"|"+S+")",k="[^"+s+"]",A="(?:\\ud83c[\\udde6-\\uddff]){2}",D="[\\ud800-\\udbff][\\udc00-\\udfff]",O="["+g+"]",R="\\u200d",$="(?:"+E+"|"+C+")",L="(?:"+O+"|"+C+")",P="(?:"+m+"(?:d|ll|m|re|s|t|ve))?",I="(?:"+m+"(?:D|LL|M|RE|S|T|VE))?",M=x+"?",U="["+b+"]?",B="(?:"+R+"(?:"+[k,A,D].join("|")+")"+U+M+")*",N=U+M+B,F="(?:"+[j,A,D].join("|")+")"+N,T=RegExp(m,"g"),V=RegExp(_,"g"),W=RegExp([O+"?"+E+"+"+P+"(?="+[y,O,"$"].join("|")+")",L+"+"+I+"(?="+[y,O+$,"$"].join("|")+")",O+"?"+$+"+"+P,O+"+"+I,w,F].join("|"),"g"),K=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,z={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},Z="object"==typeof t&&t&&t.Object===Object&&t,G="object"==typeof self&&self&&self.Object===Object&&self,q=Z||G||Function("return this")();function Y(e,t,o,r){var n=-1,a=e?e.length:0;r&&a&&(o=e[++n]);while(++n<a)o=t(o,e[n],n,e);return o}function J(e){return e.match(n)||[]}function H(e){return function(t){return null==e?void 0:e[t]}}var X=H(z);function Q(e){return K.test(e)}function ee(e){return e.match(W)||[]}var te=Object.prototype,oe=te.toString,re=q.Symbol,ne=re?re.prototype:void 0,ae=ne?ne.toString:void 0;function se(e){if("string"==typeof e)return e;if(ue(e))return ae?ae.call(e):"";var t=e+"";return"0"==t&&1/e==-o?"-0":t}function ie(e){return function(t){return Y(pe(de(t).replace(T,"")),e,"")}}function ce(e){return!!e&&"object"==typeof e}function ue(e){return"symbol"==typeof e||ce(e)&&oe.call(e)==r}function le(e){return null==e?"":se(e)}function de(e){return e=le(e),e&&e.replace(a,X).replace(V,"")}var fe=ie(function(e,t,o){return e+(o?"-":"")+t.toLowerCase()});function pe(e,t,o){return e=le(e),t=o?void 0:t,void 0===t?Q(e)?ee(e):J(e):e.match(t)||[]}e.exports=fe}).call(this,o("ac5c"))},"4c0f":function(e,t){(function(e){var t="currentScript",o=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(r){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(e in o)if(o[e].src==t||"interactive"==o[e].readyState)return o[e];return null}}})})(document)},"5c7d":function(e,t,o){var r,n;(function(a,s){"use strict";r=s,n="function"===typeof r?r.call(t,o,t,e):r,void 0===n||(e.exports=n)})(0,function(){"use strict";var e=function(){},t="undefined",o=["trace","debug","info","warn","error"];function r(e,t){var o=e[t];if("function"===typeof o.bind)return o.bind(e);try{return Function.prototype.bind.call(o,e)}catch(r){return function(){return Function.prototype.apply.apply(o,[e,arguments])}}}function n(o){return"debug"===o&&(o="log"),typeof console!==t&&(void 0!==console[o]?r(console,o):void 0!==console.log?r(console,"log"):e)}function a(t,r){for(var n=0;n<o.length;n++){var a=o[n];this[a]=n<t?e:this.methodFactory(a,t,r)}this.log=this.debug}function s(e,o,r){return function(){typeof console!==t&&(a.call(this,o,r),this[e].apply(this,arguments))}}function i(e,t,o){return n(e)||s.apply(this,arguments)}function c(e,r,n){var s,c=this,u="loglevel";function l(e){var r=(o[e]||"silent").toUpperCase();if(typeof window!==t){try{return void(window.localStorage[u]=r)}catch(n){}try{window.document.cookie=encodeURIComponent(u)+"="+r+";"}catch(n){}}}function d(){var e;if(typeof window!==t){try{e=window.localStorage[u]}catch(n){}if(typeof e===t)try{var o=window.document.cookie,r=o.indexOf(encodeURIComponent(u)+"=");-1!==r&&(e=/^([^;]+)/.exec(o.slice(r))[1])}catch(n){}return void 0===c.levels[e]&&(e=void 0),e}}e&&(u+=":"+e),c.name=e,c.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},c.methodFactory=n||i,c.getLevel=function(){return s},c.setLevel=function(o,r){if("string"===typeof o&&void 0!==c.levels[o.toUpperCase()]&&(o=c.levels[o.toUpperCase()]),!("number"===typeof o&&o>=0&&o<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+o;if(s=o,!1!==r&&l(o),a.call(c,o,e),typeof console===t&&o<c.levels.SILENT)return"No console available for logging"},c.setDefaultLevel=function(e){d()||c.setLevel(e,!1)},c.enableAll=function(e){c.setLevel(c.levels.TRACE,e)},c.disableAll=function(e){c.setLevel(c.levels.SILENT,e)};var f=d();null==f&&(f=null==r?"WARN":r),c.setLevel(f,!1)}var u=new c,l={};u.getLogger=function(e){if("string"!==typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=l[e];return t||(t=l[e]=new c(e,u.getLevel(),u.methodFactory)),t};var d=typeof window!==t?window.log:void 0;return u.noConflict=function(){return typeof window!==t&&window.log===u&&(window.log=d),u},u.getLoggers=function(){return l},u})},6389:function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE__6389__},"8bbf":function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE__8bbf__},9224:function(e){e.exports={name:"@vmm/html",version:"1.0.119",description:" 全局库",icon:"ios-people",moduleType:"html",jslib:"@vmm/jslib",distFiles:["index.js"],debugFiles:["js/app.js","js/chunk-vendors.js"],types:"./types/src/main.d.ts",exports:{},scripts:{serve:"vue-cli-service serve --host 0.0.0.0",build:"./build.sh"},dependencies:{vue:"^2.6.10","vue-router":"^3.1.3"},devDependencies:{"@types/js-base64":"^2.3.1","@types/lodash.kebabcase":"^4.1.6","@vmm/jslib":"^1.0.62","@vue/cli-plugin-typescript":"^4.0.4","@vue/cli-service":"^4.0.4","declaration-bundler-webpack-plugin":"^1.0.3","js-base64":"^2.5.1","lodash.kebabcase":"^4.1.1",loglevel:"^1.6.4","tsconfig-paths-webpack-plugin":"^3.2.0",typescript:"^3.4.3","typescript-declaration-webpack-plugin":"^0.1.1","vue-template-compiler":"^2.6.10"},license:"MIT"}},ac5c:function(e,t){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(r){"object"===typeof window&&(o=window)}e.exports=o},c267:function(e,t,o){"use strict";var r;(o.r(t),"undefined"!==typeof window)&&(o("4c0f"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(o.p=r[1]));var n=o("9224"),a=o("5c7d"),s=o.n(a);const i=s.a.methodFactory,c=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#cddc39","#ffeb3b","#ffc107","#ff9800","#ff5722","#795548","#607d8b"];var u=e=>{const t=s.a.getLogger(e);return t.methodFactory=function(e,o,r){const n=i(e,o,r),a=c[Math.floor(Math.random()*c.length)];return n.bind(t,"%c"+r,`color:${a};font-style:italic;border-right:2px solid;padding-right:4px`)},localStorage.developer&&localStorage.developer.length>0?t.setLevel(0):t.setLevel(3),t}; | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("VueRouter"),require("Vue")):"function"===typeof define&&define.amd?define(["VueRouter","Vue"],t):"object"===typeof exports?exports["main"]=t(require("VueRouter"),require("Vue")):e["main"]=t(e["VueRouter"],e["Vue"])})("undefined"!==typeof self?self:this,function(__WEBPACK_EXTERNAL_MODULE__6389__,__WEBPACK_EXTERNAL_MODULE__8bbf__){return function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s="c267")}({"27ae":function(module,exports,__webpack_require__){(function(global){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(e,t){module.exports=t(e)})("undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof global?global:this,function(global){"use strict";global=global||{};var _Base64=global.Base64,version="2.5.1",buffer;if(module.exports)try{buffer=eval("require('buffer').Buffer")}catch(err){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(e){for(var t={},o=0,r=e.length;o<r;o++)t[e.charAt(o)]=o;return t}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(e){if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?fromCharCode(192|t>>>6)+fromCharCode(128|63&t):fromCharCode(224|t>>>12&15)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t)}t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fromCharCode(240|t>>>18&7)+fromCharCode(128|t>>>12&63)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(e){return e.replace(re_utob,cb_utob)},cb_encode=function(e){var t=[0,2,1][e.length%3],o=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0),r=[b64chars.charAt(o>>>18),b64chars.charAt(o>>>12&63),t>=2?"=":b64chars.charAt(o>>>6&63),t>=1?"=":b64chars.charAt(63&o)];return r.join("")},btoa=global.btoa?function(e){return global.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e)).toString("base64")}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e)).toString("base64")}:function(e){return btoa(utob(e))},encode=function(e,t){return t?_encode(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):_encode(String(e))},encodeURI=function(e){return encode(e,!0)},re_btou=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g"),cb_btou=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),o=t-65536;return fromCharCode(55296+(o>>>10))+fromCharCode(56320+(1023&o));case 3:return fromCharCode((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return fromCharCode((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=function(e){return e.replace(re_btou,cb_btou)},cb_decode=function(e){var t=e.length,o=t%4,r=(t>0?b64tab[e.charAt(0)]<<18:0)|(t>1?b64tab[e.charAt(1)]<<12:0)|(t>2?b64tab[e.charAt(2)]<<6:0)|(t>3?b64tab[e.charAt(3)]:0),n=[fromCharCode(r>>>16),fromCharCode(r>>>8&255),fromCharCode(255&r)];return n.length-=[0,0,2,1][o],n.join("")},_atob=global.atob?function(e){return global.atob(e)}:function(e){return e.replace(/\S{1,4}/g,cb_decode)},atob=function(e){return _atob(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e,"base64")).toString()}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e,"base64")).toString()}:function(e){return btou(_atob(e))},decode=function(e){return _decode(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var e=global.Base64;return global.Base64=_Base64,e};if(global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,__buffer__:buffer},"function"===typeof Object.defineProperty){var noEnum=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(e){return encode(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}}return global["Meteor"]&&(Base64=global.Base64),module.exports?module.exports.Base64=global.Base64:(__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return global.Base64}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)),{Base64:global.Base64}})}).call(this,__webpack_require__("ac5c"))},3385:function(e,t,o){(function(t){var o=1/0,r="[object Symbol]",n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",c="\\u20d0-\\u20f0",u="\\u2700-\\u27bf",l="a-z\\xdf-\\xf6\\xf8-\\xff",d="\\xac\\xb1\\xd7\\xf7",f="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",p="\\u2000-\\u206f",h=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",g="A-Z\\xc0-\\xd6\\xd8-\\xde",b="\\ufe0e\\ufe0f",v=d+f+p+h,m="['’]",y="["+v+"]",_="["+i+c+"]",w="\\d+",j="["+u+"]",E="["+l+"]",C="[^"+s+v+w+u+l+g+"]",S="\\ud83c[\\udffb-\\udfff]",x="(?:"+_+"|"+S+")",k="[^"+s+"]",A="(?:\\ud83c[\\udde6-\\uddff]){2}",D="[\\ud800-\\udbff][\\udc00-\\udfff]",O="["+g+"]",R="\\u200d",$="(?:"+E+"|"+C+")",L="(?:"+O+"|"+C+")",P="(?:"+m+"(?:d|ll|m|re|s|t|ve))?",I="(?:"+m+"(?:D|LL|M|RE|S|T|VE))?",M=x+"?",U="["+b+"]?",B="(?:"+R+"(?:"+[k,A,D].join("|")+")"+U+M+")*",N=U+M+B,F="(?:"+[j,A,D].join("|")+")"+N,T=RegExp(m,"g"),V=RegExp(_,"g"),W=RegExp([O+"?"+E+"+"+P+"(?="+[y,O,"$"].join("|")+")",L+"+"+I+"(?="+[y,O+$,"$"].join("|")+")",O+"?"+$+"+"+P,O+"+"+I,w,F].join("|"),"g"),K=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,z={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},Z="object"==typeof t&&t&&t.Object===Object&&t,G="object"==typeof self&&self&&self.Object===Object&&self,q=Z||G||Function("return this")();function Y(e,t,o,r){var n=-1,a=e?e.length:0;r&&a&&(o=e[++n]);while(++n<a)o=t(o,e[n],n,e);return o}function J(e){return e.match(n)||[]}function H(e){return function(t){return null==e?void 0:e[t]}}var X=H(z);function Q(e){return K.test(e)}function ee(e){return e.match(W)||[]}var te=Object.prototype,oe=te.toString,re=q.Symbol,ne=re?re.prototype:void 0,ae=ne?ne.toString:void 0;function se(e){if("string"==typeof e)return e;if(ue(e))return ae?ae.call(e):"";var t=e+"";return"0"==t&&1/e==-o?"-0":t}function ie(e){return function(t){return Y(pe(de(t).replace(T,"")),e,"")}}function ce(e){return!!e&&"object"==typeof e}function ue(e){return"symbol"==typeof e||ce(e)&&oe.call(e)==r}function le(e){return null==e?"":se(e)}function de(e){return e=le(e),e&&e.replace(a,X).replace(V,"")}var fe=ie(function(e,t,o){return e+(o?"-":"")+t.toLowerCase()});function pe(e,t,o){return e=le(e),t=o?void 0:t,void 0===t?Q(e)?ee(e):J(e):e.match(t)||[]}e.exports=fe}).call(this,o("ac5c"))},"4c0f":function(e,t){(function(e){var t="currentScript",o=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(r){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(e in o)if(o[e].src==t||"interactive"==o[e].readyState)return o[e];return null}}})})(document)},"5c7d":function(e,t,o){var r,n;(function(a,s){"use strict";r=s,n="function"===typeof r?r.call(t,o,t,e):r,void 0===n||(e.exports=n)})(0,function(){"use strict";var e=function(){},t="undefined",o=["trace","debug","info","warn","error"];function r(e,t){var o=e[t];if("function"===typeof o.bind)return o.bind(e);try{return Function.prototype.bind.call(o,e)}catch(r){return function(){return Function.prototype.apply.apply(o,[e,arguments])}}}function n(o){return"debug"===o&&(o="log"),typeof console!==t&&(void 0!==console[o]?r(console,o):void 0!==console.log?r(console,"log"):e)}function a(t,r){for(var n=0;n<o.length;n++){var a=o[n];this[a]=n<t?e:this.methodFactory(a,t,r)}this.log=this.debug}function s(e,o,r){return function(){typeof console!==t&&(a.call(this,o,r),this[e].apply(this,arguments))}}function i(e,t,o){return n(e)||s.apply(this,arguments)}function c(e,r,n){var s,c=this,u="loglevel";function l(e){var r=(o[e]||"silent").toUpperCase();if(typeof window!==t){try{return void(window.localStorage[u]=r)}catch(n){}try{window.document.cookie=encodeURIComponent(u)+"="+r+";"}catch(n){}}}function d(){var e;if(typeof window!==t){try{e=window.localStorage[u]}catch(n){}if(typeof e===t)try{var o=window.document.cookie,r=o.indexOf(encodeURIComponent(u)+"=");-1!==r&&(e=/^([^;]+)/.exec(o.slice(r))[1])}catch(n){}return void 0===c.levels[e]&&(e=void 0),e}}e&&(u+=":"+e),c.name=e,c.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},c.methodFactory=n||i,c.getLevel=function(){return s},c.setLevel=function(o,r){if("string"===typeof o&&void 0!==c.levels[o.toUpperCase()]&&(o=c.levels[o.toUpperCase()]),!("number"===typeof o&&o>=0&&o<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+o;if(s=o,!1!==r&&l(o),a.call(c,o,e),typeof console===t&&o<c.levels.SILENT)return"No console available for logging"},c.setDefaultLevel=function(e){d()||c.setLevel(e,!1)},c.enableAll=function(e){c.setLevel(c.levels.TRACE,e)},c.disableAll=function(e){c.setLevel(c.levels.SILENT,e)};var f=d();null==f&&(f=null==r?"WARN":r),c.setLevel(f,!1)}var u=new c,l={};u.getLogger=function(e){if("string"!==typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=l[e];return t||(t=l[e]=new c(e,u.getLevel(),u.methodFactory)),t};var d=typeof window!==t?window.log:void 0;return u.noConflict=function(){return typeof window!==t&&window.log===u&&(window.log=d),u},u.getLoggers=function(){return l},u})},6389:function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE__6389__},"8bbf":function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE__8bbf__},9224:function(e){e.exports={name:"@vmm/html",version:"1.0.122",description:" 全局库",icon:"ios-people",moduleType:"html",jslib:"@vmm/jslib",distFiles:["index.js"],debugFiles:["js/app.js","js/chunk-vendors.js"],types:"./types/src/main.d.ts",exports:{},scripts:{serve:"vue-cli-service serve --host 0.0.0.0",build:"./build.sh"},dependencies:{vue:"^2.6.10","vue-router":"^3.1.3"},devDependencies:{"@types/js-base64":"^2.3.1","@types/lodash.kebabcase":"^4.1.6","@vmm/jslib":"^1.0.62","@vue/cli-plugin-typescript":"^4.0.4","@vue/cli-service":"^4.0.4","declaration-bundler-webpack-plugin":"^1.0.3","js-base64":"^2.5.1","lodash.kebabcase":"^4.1.1",loglevel:"^1.6.4","tsconfig-paths-webpack-plugin":"^3.2.0",typescript:"^3.4.3","typescript-declaration-webpack-plugin":"^0.1.1","vue-template-compiler":"^2.6.10"},license:"MIT"}},ac5c:function(e,t){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(r){"object"===typeof window&&(o=window)}e.exports=o},c267:function(e,t,o){"use strict";var r;(o.r(t),"undefined"!==typeof window)&&(o("4c0f"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(o.p=r[1]));var n=o("9224"),a=o("5c7d"),s=o.n(a);const i=s.a.methodFactory,c=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#cddc39","#ffeb3b","#ffc107","#ff9800","#ff5722","#795548","#607d8b"];var u=e=>{const t=s.a.getLogger(e);return t.methodFactory=function(e,o,r){const n=i(e,o,r),a=c[Math.floor(Math.random()*c.length)];return n.bind(t,"%c"+r,`color:${a};font-style:italic;border-right:2px solid;padding-right:4px`)},localStorage.developer&&localStorage.developer.length>0?t.setLevel(0):t.setLevel(3),t}; | ||
/*! ***************************************************************************** | ||
@@ -15,2 +15,2 @@ Copyright (c) Microsoft Corporation. All rights reserved. | ||
and limitations under the License. | ||
***************************************************************************** */function l(e,t,o,r){return new(o||(o=Promise))(function(n,a){function s(e){try{c(r.next(e))}catch(t){a(t)}}function i(e){try{c(r["throw"](e))}catch(t){a(t)}}function c(e){e.done?n(e.value):new o(function(t){t(e.value)}).then(s,i)}c((r=r.apply(e,t||[])).next())})}var d=o("8bbf"),f=o.n(d),p=o("27ae"),h=o("3385"),g=o.n(h);const b=u(`${n["name"]}:project`),v="-cs-";function m(e){return b.debug("_loadJs:",e),new Promise((t,o)=>{var r=document.createElement("script");r.src=e,r.type="text/javascript",r.async=!1,r.onload=()=>{b.debug("load external js successed:",e),t(!0)},r.onerror=t=>{b.debug("load external js failed:",e,t),o(!1)},document.getElementsByTagName("head")[0].appendChild(r)})}function y(e){return b.debug("_loadCss:",e),new Promise((t,o)=>{var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onload=o=>{b.debug("load external css successed:",e),t(!0)},r.onerror=t=>{b.debug("load external css failed:",e),o(!1)},document.getElementsByTagName("head")[0].appendChild(r)})}const _=new f.a({data(){return{routeInfo:{pkgName:"",componentName:""},projectData:{},sessions:{},api:{},services:{},serverStatus:{},serviceRouter:{}}},computed:{homepagePackage(){for(const e of Object.keys(this.projectData.homepage)){const t=this.projectData.homepage[e];if(e===location.pathname)return t}return""}},methods:{_apiUrl(e,t,o){return`${location.protocol}//${location.host}/api/${g()(t)}/${g()(o)}`},_loadServerPayloads(){return l(this,void 0,void 0,function*(){const e={};for(const o of Object.keys(this.projectData.publish.servers)){if("localhost"===o)continue;const r=this.projectData.publish.servers[o],n=`${location.protocol}//${o}${r.port?":"+r.port:""}/_payload`;try{const r=yield fetch(n);if(200!==r.status)throw new Error("invalid http status:"+r.status+"\n"+n);const a=yield r.json();let s=0;a.server.payloads&&Object.keys(a.server.payloads).forEach(e=>{s+=a.server.payloads[e]}),e[o]={ready:!0,payload:s,servicePayload:a.server.payloads,servicePing:a.service.status}}catch(t){e[o]={ready:!1,payload:-1,info:{}},b.error("detectServer Error:",o,t.message)}}this.serverStatus=e})},detectServer(){return l(this,void 0,void 0,function*(){if("localhost"===location.hostname){const e={};for(const t of Object.keys(this.projectData.packages.service))e[t.replace(/-service$/,"")]={url:`${location.protocol}//${location.host}/api/${g()(t)}/`,validServers:[]};return void(this.serviceRouter=e)}yield this._loadServerPayloads();const e={};for(const t of Object.keys(this.serverStatus)){const o=this.serverStatus[t];if(o.ready)for(const r of Object.keys(o.servicePing)){const n=o.servicePing[r];200===n.code&&(e[r]||(e[r]={validServers:[]}),e[r].validServers.push({name:t,payload:o.payload,port:this.projectData.publish.servers[t].port||80}))}}for(const t of Object.keys(e)){const o=e[t];o.validServers.sort((e,t)=>{return e.payload-t.payload});const r=o.validServers[0];o.url=`${location.protocol}//${r.name}:${r.port}/api/${g()(t)}/`}b.warn("using serviceRouter",this.serviceRouter),this.serviceRouter=e})},updateRouteInfo(e,t){this.routeInfo.pkgName=e,this.routeInfo.componentName=t},_parseSessionString(e,t){const o=t.split(".");if(3!==o.length)throw new Error(" Format Parse Error");const r=JSON.parse(p["Base64"].decode(o[1]));if(r.exp<(new Date).getTime()/1e3){const t=new Date(1e3*r.exp);return f.a.delete(this.sessions,e),void b.warn("session expire:",r.iss,t.toLocaleString())}if(r.iss!==e.replace(/-cs-/,""))return f.a.delete(this.sessions,e),void b.warn("session name unmatched:",e,r);b.debug("parse session successed:",e,r.client),f.a.set(this.sessions,r.iss,Object.assign(Object.assign({},r.client),{_head:{iat:r.iat,iss:r.iss,exp:r.exp},_sessString:t}))},_parseUrlSessions(){const e=/[\?&]?(-cs-[\w-]+)=([\w.-]+)&?/g,t=t=>{let o;while(null!=(o=e.exec(t)))3===o.length&&(b.debug("parse session from url:",o[1],o),this._parseSessionString(o[1],o[2]))};t(location.hash),t(location.search)},_parseLocalStorageSession(){for(let e=0;e<localStorage.length;e++){const t=localStorage.key(e);t.startsWith(v)&&this._parseSessionString(t,localStorage.getItem(t))}},loadSessions(){this._parseLocalStorageSession(),this._parseUrlSessions()},loadApi(e){if(this.api[e.pkg.name])return this.api[e.pkg.name];const t=(e,t,o,r)=>{const n=g()(e).replace(/-api$/,""),a={"content-type":"application/json"};return e=>l(this,void 0,void 0,function*(){const s="localhost"===location.hostname?`${location.protocol}//${location.host}/api/${n}/`:this.serviceRouter[n]?this.serviceRouter[n].url:null;if(!s)throw new Error(n+": not found valid server for service");const i=r?`${s}db/${g()(r)}/${g()(t)}`:`${s}${g()(t)}`;for(let e of o){const t=`${v}${g()(e)}`;a[t]=this.sessions[e]?this.sessions[e]._sessString:""}let c={};const u=yield fetch(i,{body:JSON.stringify(e),cache:"no-cache",credentials:"include",headers:a,method:"POST",mode:"cors",redirect:"follow"});if(401===u.status&&this.$emit("401"),!u.ok){const e=yield u.text();throw new Error(`fetch: ${u.status},${e}`)}return u.headers.forEach((e,t)=>{t.startsWith(v)&&(this._parseSessionString(t,e),localStorage.setItem(t,e))}),c=yield u.json(),c})};for(const o of Object.keys(e.api))e.api[o]=t(e.pkg.name,o,e.api[o]._sessions);if(e.db)for(const o of Object.keys(e.db)){const r=e.db[o];for(const n of Object.keys(r))r[n]=t(e.pkg.name,n,r[n]._sessions,o)}return e.session=this.sessions,f.a.set(this.api,e.pkg.name,e),this.api[e.pkg.name]},_checkLoadDevModule(e){return l(this,void 0,void 0,function*(){const t=window.__dev;if(!t||!t[e])return;const o=t[e],r=yield(yield fetch(`${o}/package.json`)).json();switch(r.devUrl=o,r.moduleType){case"html":f.a.set(this.projectData.packages.html,r.name,r);break;case"service":f.a.set(this.projectData.packages.service,r.name,r);break}b.debug("load dev module to project:",e)})},getModule(e){return this.projectData.packages.html[e]||this.projectData.packages.html[this.projectData.jslib].packages[e]},getModuleGlobalVar(e){const t=this.getModule(e),o=t.globalVar||g()(e);return window[o]},getModuleDependencies(e){const t=this.getModule(e);if(t.dependencies)return t.dependencies instanceof Array?t.dependencies:Object.keys(t.dependencies)},getModuleFiles(e){const t=this.getModule(e);if(t.devUrl)return t.debugFiles.map(e=>`${t.devUrl}/${e}`);if(this.projectData.packages.html[e])return t.distFiles.map(t=>`/modules/${e}/${t}`);if(this.projectData.packages.html[this.projectData.jslib].packages[e])return t.distFiles.map(t=>`/jslib/${e}/${t}`);throw new Error(`Error: ${e} distFiles invalid`)},loadExternalModule(e){return l(this,void 0,void 0,function*(){if(e instanceof Array){const t=[];for(const o of e)t.push(yield this.loadExternalModule(o));return t}const t=this.getModule(e);if(!t)throw new Error("Error: Invalid modInfo "+e);switch(t._loadStatus){case"successed":break;case"wait":throw new Error("ERROR!!!,Module Circular Dependency:"+e);case"loading":return t._loadPromise;case"init":default:if(this.getModuleGlobalVar(e))return f.a.set(t,"_loadStatus","successed"),this.getModuleGlobalVar(e);b.debug("start load external module",e);const o=this.getModuleDependencies(e);if(o){f.a.set(t,"_loadStatus","wait");for(const e of o)yield this.loadExternalModule(e)}f.a.set(t,"_loadStatus","loading");for(const t of this.getModuleFiles(e))t.match(/\.js$/)?yield m(t):t.match(/\.css$/)?yield y(t):b.info("no load file:",e,t);f.a.set(t,"_loadStatus","successed"),b.debug("successed load external module",e)}return this.getModuleGlobalVar(e)})},vueComponent(e,t){return(()=>l(this,void 0,void 0,function*(){if(yield this.loadExternalModule(e),!this.projectData.packages.html[e])throw new Error("vueComponent:invalid pkgName ,"+e);if(!this.projectData.packages.html[e].components)throw new Error("vueComponent:invalid components object,"+e+", "+t);if(!this.projectData.packages.html[e].components[t])throw new Error("vueComponent:invalid vue Component");return this.projectData.packages.html[e].components[t]}))()},loadVueDir(e,t){if(!this.projectData.packages.html[e])throw new Error("loadVueDir invalid package:"+e);const o={};for(const r of t.keys()){const n=r.match(/.*\/(.+?)\.vue$/),a=n&&2===n.length?n[1]:void 0;if(!a){b.warn("loadVueDir: match file name fail: ",r,n);continue}const s=t(r);if(!s.default)throw new Error("Must Use Vue.extend() create Vue Components");b.info("load vue Component",e,s),this.projectData.packages.html[e].components||f.a.set(this.projectData.packages.html[e],"components",{}),f.a.set(this.projectData.packages.html[e].components,a,s.default),o[a]=s.default}return b.debug("loadVue:",Object.keys(o)),o},_loadProject(){const e=Object.assign({},window.__project);this.projectData=e;const t={html:{},service:{}};for(const o of e.packages)switch(o.moduleType){case"html":t.html[o.name]=o;break;case"service":t.service[o.name]=o;break}f.a.set(this.projectData,"packages",t)},_loadDeveloperConfig(){return l(this,void 0,void 0,function*(){if(!(localStorage.developer&&localStorage.developer.length>0))return;let e=[];try{e=JSON.parse(localStorage.__dev)}catch(r){}if(e instanceof Array)for(const n of e){let e;b.debug("load develop module from:",n);try{e=yield(yield fetch(`${n}/package.json`)).json()}catch(r){b.error("load dev module error:",r.message);continue}switch(e.devUrl=n,e.moduleType){case"html":f.a.set(this.projectData.packages.html,e.name,e);break;case"service":f.a.set(this.projectData.packages.service,e.name,e);break}b.info("debugPkg info:",e.name,e.version)}let t=null;const o=e=>l(this,void 0,void 0,function*(){if(e.metaKey&&"Escape"===e.key&&!t){b.info("switch develop mode"),t=yield this.vueComponent("@vmm/html-dev-debugger","Developer");const e=document.createElement("div");document.body.appendChild(e),new t({}).$mount(e),window.removeEventListener("keydown",o)}});window.addEventListener("keydown",o)})}},created(){return l(this,void 0,void 0,function*(){this._loadProject(),yield this._loadDeveloperConfig(),this.projectData.packages.html[n.name]._loadStatus="successed",this.loadSessions(),yield this.detectServer(),yield this.loadExternalModule(this.homepagePackage),b.debug("project init successed ",this.projectData)})}});var w=_,j=o("6389"),E=o.n(j);const C=u(`${n["name"]}:router`);function S(e){for(const t of Object.keys(w.projectData.packages.html))if(g()(t)===e)return w.projectData.packages.html[t]}function x(e,t){if(e.components)for(const o of Object.keys(e.components))if(g()(o)===t)return{name:o,vueComponent:e.components[o]}}C.debug("homepage:",w.homepagePackage);const k=[{path:"/",component:()=>w.vueComponent(w.homepagePackage,"Home"),beforeEnter:(e,t,o)=>l(void 0,void 0,void 0,function*(){C.debug("router will enter:",e),w.updateRouteInfo(w.homepagePackage,"Home"),o()})},{path:"*",beforeEnter:(e,t,o)=>l(void 0,void 0,void 0,function*(){C.debug("router will enter:",e);const t=e.path.match(/^\/(.*)\/(.*)/);if(!t||t.length<3)return void C.error("Invalid Path:",e.fullPath);const o=t[1],r=t[2],n=S(o);if(!n)return void C.error("route pkg name Invalid:",o);"successed"!==n._loadStatus&&(yield w.loadExternalModule(n.name));const a=x(n,r);a?(A.addRoutes([{path:e.path,component:a.vueComponent,beforeEnter:(e,t,o)=>l(void 0,void 0,void 0,function*(){C.debug("router will enter:",e),w.updateRouteInfo(n.name,a.name),o()})}]),setTimeout(()=>{A.replace(e.fullPath,()=>{C.info("successes create route:",e.path)})})):C.error("router cmpt name Invalid:",o,r)})}],A=new E.a({routes:k});var D=A;const O={router:D,project:w,logger:u};window[n["name"].replace(/[@\/-]/g,"_")]=O;var R=O;t["default"]=R}})}); | ||
***************************************************************************** */function l(e,t,o,r){return new(o||(o=Promise))(function(n,a){function s(e){try{c(r.next(e))}catch(t){a(t)}}function i(e){try{c(r["throw"](e))}catch(t){a(t)}}function c(e){e.done?n(e.value):new o(function(t){t(e.value)}).then(s,i)}c((r=r.apply(e,t||[])).next())})}var d=o("8bbf"),f=o.n(d),p=o("27ae"),h=o("3385"),g=o.n(h);const b=u(`${n["name"]}:project`),v="-cs-";function m(e){return b.debug("_loadJs:",e),new Promise((t,o)=>{var r=document.createElement("script");r.src=e,r.type="text/javascript",r.async=!1,r.onload=()=>{b.debug("load external js successed:",e),t(!0)},r.onerror=t=>{b.debug("load external js failed:",e,t),o(!1)},document.getElementsByTagName("head")[0].appendChild(r)})}function y(e){return b.debug("_loadCss:",e),new Promise((t,o)=>{var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onload=o=>{b.debug("load external css successed:",e),t(!0)},r.onerror=t=>{b.debug("load external css failed:",e),o(!1)},document.getElementsByTagName("head")[0].appendChild(r)})}const _=new f.a({data(){return{routeInfo:{pkgName:"",componentName:""},projectData:{},sessions:{},api:{},services:{},serverStatus:{},serviceRouter:{}}},computed:{homepagePackage(){for(const e of Object.keys(this.projectData.homepage)){const t=this.projectData.homepage[e];if(e===location.pathname)return t}return""}},methods:{_apiUrl(e,t,o){return`${location.protocol}//${location.host}/api/${g()(t)}/${g()(o)}`},_loadServerPayloads(){return l(this,void 0,void 0,function*(){const e={};for(const o of Object.keys(this.projectData.publish.servers)){if("localhost"===o)continue;const r=this.projectData.publish.servers[o],n=`${location.protocol}//${o}${r.port?":"+r.port:""}/_payload`;try{const r=yield fetch(n);if(200!==r.status)throw new Error("invalid http status:"+r.status+"\n"+n);const a=yield r.json();let s=0;a.server.payloads&&Object.keys(a.server.payloads).forEach(e=>{s+=a.server.payloads[e]}),e[o]={ready:!0,payload:s,servicePayload:a.server.payloads,servicePing:a.service.status}}catch(t){e[o]={ready:!1,payload:-1,info:{}},b.error("detectServer Error:",o,t.message)}}this.serverStatus=e})},detectServer(){return l(this,void 0,void 0,function*(){if("localhost"===location.hostname){const e={};for(const t of Object.keys(this.projectData.packages.service).map(e=>e.replace(/-(service|api)$/,"")))e[t]={url:`${location.protocol}//${location.host}/api/${g()(t)}/`,validServers:[]};return void(this.serviceRouter=e)}yield this._loadServerPayloads();const e={};for(const t of Object.keys(this.serverStatus)){const o=this.serverStatus[t];if(o.ready)for(const r of Object.keys(o.servicePing).map(e=>e.replace(/-(service|api)$/,""))){const n=o.servicePing[r];200===n.code&&(e[r]||(e[r]={validServers:[]}),e[r].validServers.push({name:t,payload:o.payload,port:this.projectData.publish.servers[t].port||80}))}}for(const t of Object.keys(e)){const o=e[t];o.validServers.sort((e,t)=>{return e.payload-t.payload});const r=o.validServers[0];o.url=`${location.protocol}//${r.name}:${r.port}/api/${g()(t)}/`}b.warn("using serviceRouter",this.serviceRouter),this.serviceRouter=e})},updateRouteInfo(e,t){this.routeInfo.pkgName=e,this.routeInfo.componentName=t},_parseSessionString(e,t){const o=t.split(".");if(3!==o.length)throw new Error(" Format Parse Error");const r=JSON.parse(p["Base64"].decode(o[1]));if(r.exp<(new Date).getTime()/1e3){const t=new Date(1e3*r.exp);return f.a.delete(this.sessions,e),void b.warn("session expire:",r.iss,t.toLocaleString())}if(r.iss!==e.replace(/-cs-/,""))return f.a.delete(this.sessions,e),void b.warn("session name unmatched:",e,r);b.debug("parse session successed:",e,r.client),f.a.set(this.sessions,r.iss,Object.assign(Object.assign({},r.client),{_head:{iat:r.iat,iss:r.iss,exp:r.exp},_sessString:t}))},_parseUrlSessions(){const e=/[\?&]?(-cs-[\w-]+)=([\w.-]+)&?/g,t=t=>{let o;while(null!=(o=e.exec(t)))3===o.length&&(b.debug("parse session from url:",o[1],o),this._parseSessionString(o[1],o[2]))};t(location.hash),t(location.search)},_parseLocalStorageSession(){for(let e=0;e<localStorage.length;e++){const t=localStorage.key(e);t.startsWith(v)&&this._parseSessionString(t,localStorage.getItem(t))}},loadSessions(){this._parseLocalStorageSession(),this._parseUrlSessions()},loadApi(e){if(this.api[e.pkg.name])return this.api[e.pkg.name];const t=(e,t,o,r)=>{const n=g()(e).replace(/-api$/,""),a={"content-type":"application/json"};return e=>l(this,void 0,void 0,function*(){const s="localhost"===location.hostname?`${location.protocol}//${location.host}/api/${n}/`:this.serviceRouter[n]?this.serviceRouter[n].url:null;if(!s)throw new Error(n+": not found valid server for service");const i=r?`${s}db/${g()(r)}/${g()(t)}`:`${s}${g()(t)}`;for(let e of o){const t=`${v}${g()(e)}`;a[t]=this.sessions[e]?this.sessions[e]._sessString:""}let c={};const u=yield fetch(i,{body:JSON.stringify(e),cache:"no-cache",credentials:"include",headers:a,method:"POST",mode:"cors",redirect:"follow"});if(401===u.status&&this.$emit("401"),!u.ok){const e=yield u.text();throw new Error(`fetch: ${u.status},${e}`)}return u.headers.forEach((e,t)=>{t.startsWith(v)&&(this._parseSessionString(t,e),localStorage.setItem(t,e))}),c=yield u.json(),c})};for(const o of Object.keys(e.api))e.api[o]=t(e.pkg.name,o,e.api[o]._sessions);if(e.db)for(const o of Object.keys(e.db)){const r=e.db[o];for(const n of Object.keys(r))r[n]=t(e.pkg.name,n,r[n]._sessions,o)}return e.session=this.sessions,f.a.set(this.api,e.pkg.name,e),this.api[e.pkg.name]},_checkLoadDevModule(e){return l(this,void 0,void 0,function*(){const t=window.__dev;if(!t||!t[e])return;const o=t[e],r=yield(yield fetch(`${o}/package.json`)).json();switch(r.devUrl=o,r.moduleType){case"html":f.a.set(this.projectData.packages.html,r.name,r);break;case"service":f.a.set(this.projectData.packages.service,r.name,r);break}b.debug("load dev module to project:",e)})},getModule(e){return this.projectData.packages.html[e]||this.projectData.packages.html[this.projectData.jslib].packages[e]},getModuleGlobalVar(e){const t=this.getModule(e),o=t.globalVar||g()(e);return window[o]},getModuleDependencies(e){const t=this.getModule(e);if(t.dependencies)return t.dependencies instanceof Array?t.dependencies:Object.keys(t.dependencies)},getModuleFiles(e){const t=this.getModule(e);if(t.devUrl)return t.debugFiles.map(e=>`${t.devUrl}/${e}`);if(this.projectData.packages.html[e])return t.distFiles.map(t=>`/modules/${e}/${t}`);if(this.projectData.packages.html[this.projectData.jslib].packages[e])return t.distFiles.map(t=>`/jslib/${e}/${t}`);throw new Error(`Error: ${e} distFiles invalid`)},loadExternalModule(e){return l(this,void 0,void 0,function*(){if(e instanceof Array){const t=[];for(const o of e)t.push(yield this.loadExternalModule(o));return t}const t=this.getModule(e);if(!t)throw new Error("Error: Invalid modInfo "+e);switch(t._loadStatus){case"successed":break;case"wait":throw new Error("ERROR!!!,Module Circular Dependency:"+e);case"loading":return t._loadPromise;case"init":default:if(this.getModuleGlobalVar(e))return f.a.set(t,"_loadStatus","successed"),this.getModuleGlobalVar(e);b.debug("start load external module",e);const o=this.getModuleDependencies(e);if(o){f.a.set(t,"_loadStatus","wait");for(const e of o)yield this.loadExternalModule(e)}f.a.set(t,"_loadStatus","loading");for(const t of this.getModuleFiles(e))t.match(/\.js$/)?yield m(t):t.match(/\.css$/)?yield y(t):b.info("no load file:",e,t);f.a.set(t,"_loadStatus","successed"),b.debug("successed load external module",e)}return this.getModuleGlobalVar(e)})},vueComponent(e,t){return(()=>l(this,void 0,void 0,function*(){if(yield this.loadExternalModule(e),!this.projectData.packages.html[e])throw new Error("vueComponent:invalid pkgName ,"+e);if(!this.projectData.packages.html[e].components)throw new Error("vueComponent:invalid components object,"+e+", "+t);if(!this.projectData.packages.html[e].components[t])throw new Error("vueComponent:invalid vue Component");return this.projectData.packages.html[e].components[t]}))()},loadVueDir(e,t){if(!this.projectData.packages.html[e])throw new Error("loadVueDir invalid package:"+e);const o={};for(const r of t.keys()){const n=r.match(/.*\/(.+?)\.vue$/),a=n&&2===n.length?n[1]:void 0;if(!a){b.warn("loadVueDir: match file name fail: ",r,n);continue}const s=t(r);if(!s.default)throw new Error("Must Use Vue.extend() create Vue Components");b.info("load vue Component",e,s),this.projectData.packages.html[e].components||f.a.set(this.projectData.packages.html[e],"components",{}),f.a.set(this.projectData.packages.html[e].components,a,s.default),o[a]=s.default}return b.debug("loadVue:",Object.keys(o)),o},_loadProject(){const e=Object.assign({},window.__project);this.projectData=e;const t={html:{},service:{}};for(const o of e.packages)switch(o.moduleType){case"html":t.html[o.name]=o;break;case"service":t.service[o.name]=o;break}f.a.set(this.projectData,"packages",t)},_loadDeveloperConfig(){return l(this,void 0,void 0,function*(){if(!(localStorage.developer&&localStorage.developer.length>0))return;let e=[];try{e=JSON.parse(localStorage.__dev)}catch(r){}if(e instanceof Array)for(const n of e){let e;b.debug("load develop module from:",n);try{e=yield(yield fetch(`${n}/package.json`)).json()}catch(r){b.error("load dev module error:",r.message);continue}switch(e.devUrl=n,e.moduleType){case"html":f.a.set(this.projectData.packages.html,e.name,e);break;case"service":f.a.set(this.projectData.packages.service,e.name,e);break}b.info("debugPkg info:",e.name,e.version)}let t=null;const o=e=>l(this,void 0,void 0,function*(){if(e.metaKey&&"Escape"===e.key&&!t){b.info("switch develop mode"),t=yield this.vueComponent("@vmm/html-dev-debugger","Developer");const e=document.createElement("div");document.body.appendChild(e),new t({}).$mount(e),window.removeEventListener("keydown",o)}});window.addEventListener("keydown",o)})}},created(){return l(this,void 0,void 0,function*(){this._loadProject(),yield this._loadDeveloperConfig(),this.projectData.packages.html[n.name]._loadStatus="successed",this.loadSessions(),yield this.detectServer(),yield this.loadExternalModule(this.homepagePackage),b.debug("project init successed ",this.projectData)})}});var w=_,j=o("6389"),E=o.n(j);const C=u(`${n["name"]}:router`);function S(e){for(const t of Object.keys(w.projectData.packages.html))if(g()(t)===e)return w.projectData.packages.html[t]}function x(e,t){if(e.components)for(const o of Object.keys(e.components))if(g()(o)===t)return{name:o,vueComponent:e.components[o]}}C.debug("homepage:",w.homepagePackage);const k=[{path:"/",component:()=>w.vueComponent(w.homepagePackage,"Home"),beforeEnter:(e,t,o)=>l(void 0,void 0,void 0,function*(){C.debug("router will enter:",e),w.updateRouteInfo(w.homepagePackage,"Home"),o()})},{path:"*",beforeEnter:(e,t,o)=>l(void 0,void 0,void 0,function*(){C.debug("router will enter:",e);const t=e.path.match(/^\/(.*)\/(.*)/);if(!t||t.length<3)return void C.error("Invalid Path:",e.fullPath);const o=t[1],r=t[2],n=S(o);if(!n)return void C.error("route pkg name Invalid:",o);"successed"!==n._loadStatus&&(yield w.loadExternalModule(n.name));const a=x(n,r);a?(A.addRoutes([{path:e.path,component:a.vueComponent,beforeEnter:(e,t,o)=>l(void 0,void 0,void 0,function*(){C.debug("router will enter:",e),w.updateRouteInfo(n.name,a.name),o()})}]),setTimeout(()=>{A.replace(e.fullPath,()=>{C.info("successes create route:",e.path)})})):C.error("router cmpt name Invalid:",o,r)})}],A=new E.a({routes:k});var D=A;const O={router:D,project:w,logger:u};window[n["name"].replace(/[@\/-]/g,"_")]=O;var R=O;t["default"]=R}})}); |
{ | ||
"name": "@vmm/html", | ||
"version": "1.0.119", | ||
"version": "1.0.122", | ||
"description": " 全局库", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
287642