gc_mobile 1.0.7 → 1.0.8

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/libs/main.js CHANGED
@@ -1540,5 +1540,6 @@ async function bt(r) {
1540
1540
  return await t.init(), t;
1541
1541
  }
1542
1542
  export {
1543
+ fe as dd,
1543
1544
  bt as default
1544
1545
  };
package/libs/main.umd.cjs CHANGED
@@ -1,8 +1,8 @@
1
- (function(H,se){typeof exports=="object"&&typeof module<"u"?module.exports=se(require("lodash-es"),require("dingtalk-jsapi"),require("qs"),require("axios")):typeof define=="function"&&define.amd?define(["lodash-es","dingtalk-jsapi","qs","axios"],se):(H=typeof globalThis<"u"?globalThis:H||self,H.Main=se(H._,H.dd$1,H.qs,H.axios))})(this,function(H,se,re,Oe){"use strict";function ze(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const ce=ze(se),le=window.navigator.userAgent.toLowerCase();let pe={code:"",name:"未知"};function Me(){return typeof window<"u"&&typeof document<"u"&&typeof document.querySelector=="function"&&typeof navigator<"u"&&typeof XMLHttpRequest=="function"}const Ne=[{code:"weixin",name:"微信",value:/MicroMessenger/i.test(le)},{code:"wxmp",name:"微信小程序",value:/miniProgram/i.test(le)||window.__wxjs_environment==="miniprogram"},{code:"dd",name:"钉钉",value:/DingTalk/i.test(le)}],Ue=t=>t.value,Be=H.find(Ne,Ue);Be?pe=Be:Me()&&(pe={code:"h5",name:"H5"});const We=pe,ke=t=>t=="dev"?"https://test.ihotel.cn/gw/v1/platform-gcding":t=="prod"?"https://smart.ihotel.cn/guardian/gw/v1/platform-gcding":t||"https://test.ihotel.cn/gw/v1/platform-gcding",Ke=re.parse(location.search,{ignoreQueryPrefix:!0}),de=H.get(Ke,"corpId"),Ge={dd:{login:async({appCode:t,apiPrefix:r})=>{const e=ke(r);return new Promise(async a=>{var p,c,x;if(de){const{code:o}=await ce.getAuthCode({corpId:de}),v=await Oe.post(`${e}/api/auth/queryAuthNoExternalCompatible`,{appCode:t,authCode:o,corpId:de});v.data&&((p=v.data)==null?void 0:p.result)===0?a({userInfo:(c=v==null?void 0:v.data)==null?void 0:c.retVal,res:v}):(ce.alert({title:(x=v==null?void 0:v.data)==null?void 0:x.msg}),a({res:v}))}else ce.alert({title:"未配置参数:corpId"})})},dd:ce},h5:{login:()=>new Promise(async t=>{const{token:r}=re.parse(location.search,{ignoreQueryPrefix:!0});t(r?{userInfo:{ucToken:r}}:{userInfo:null})})},wxmp:{login:()=>new Promise(t=>{const{token:r}=re.parse(location.search,{ignoreQueryPrefix:!0});t(r?{userInfo:{ucToken:r}}:{userInfo:null})})},weixin:{login:()=>new Promise(t=>{const{token:r}=re.parse(location.search,{ignoreQueryPrefix:!0});t(r?{userInfo:{ucToken:r}}:{userInfo:null})})}},Qe=t=>{let r="";return H.mapKeys(t,(e,a)=>{a&&(H.isEmpty(e)?r+="&"+a:r+="&"+a+"="+e)}),r},Xe=(t,r)=>H.isEmpty(r)?t:(H.includes(t,"?")?t:t+"?")+r.substring(1),Ve=(t,r)=>H.isEmpty(r)?t:`${t}?${re.stringify(r)}`;var W=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function he(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ze(t){if(t.__esModule)return t;var r=t.default;if(typeof r=="function"){var e=function a(){return this instanceof a?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};e.prototype=r.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var p=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,p.get?p:{enumerable:!0,get:function(){return t[a]}})}),e}var ve=Object.prototype.hasOwnProperty,ne=Array.isArray,X=function(){for(var t=[],r=0;r<256;++r)t.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return t}(),Ye=function(r){for(;r.length>1;){var e=r.pop(),a=e.obj[e.prop];if(ne(a)){for(var p=[],c=0;c<a.length;++c)typeof a[c]<"u"&&p.push(a[c]);e.obj[e.prop]=p}}},Ae=function(r,e){for(var a=e&&e.plainObjects?Object.create(null):{},p=0;p<r.length;++p)typeof r[p]<"u"&&(a[p]=r[p]);return a},Je=function t(r,e,a){if(!e)return r;if(typeof e!="object"){if(ne(r))r.push(e);else if(r&&typeof r=="object")(a&&(a.plainObjects||a.allowPrototypes)||!ve.call(Object.prototype,e))&&(r[e]=!0);else return[r,e];return r}if(!r||typeof r!="object")return[r].concat(e);var p=r;return ne(r)&&!ne(e)&&(p=Ae(r,a)),ne(r)&&ne(e)?(e.forEach(function(c,x){if(ve.call(r,x)){var o=r[x];o&&typeof o=="object"&&c&&typeof c=="object"?r[x]=t(o,c,a):r.push(c)}else r[x]=c}),r):Object.keys(e).reduce(function(c,x){var o=e[x];return ve.call(c,x)?c[x]=t(c[x],o,a):c[x]=o,c},p)},et=function(r,e){return Object.keys(e).reduce(function(a,p){return a[p]=e[p],a},r)},tt=function(t,r,e){var a=t.replace(/\+/g," ");if(e==="iso-8859-1")return a.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(a)}catch{return a}},rt=function(r,e,a){if(r.length===0)return r;var p=r;if(typeof r=="symbol"?p=Symbol.prototype.toString.call(r):typeof r!="string"&&(p=String(r)),a==="iso-8859-1")return escape(p).replace(/%u[0-9a-f]{4}/gi,function(v){return"%26%23"+parseInt(v.slice(2),16)+"%3B"});for(var c="",x=0;x<p.length;++x){var o=p.charCodeAt(x);if(o===45||o===46||o===95||o===126||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122){c+=p.charAt(x);continue}if(o<128){c=c+X[o];continue}if(o<2048){c=c+(X[192|o>>6]+X[128|o&63]);continue}if(o<55296||o>=57344){c=c+(X[224|o>>12]+X[128|o>>6&63]+X[128|o&63]);continue}x+=1,o=65536+((o&1023)<<10|p.charCodeAt(x)&1023),c+=X[240|o>>18]+X[128|o>>12&63]+X[128|o>>6&63]+X[128|o&63]}return c},nt=function(r){for(var e=[{obj:{o:r},prop:"o"}],a=[],p=0;p<e.length;++p)for(var c=e[p],x=c.obj[c.prop],o=Object.keys(x),v=0;v<o.length;++v){var s=o[v],_=x[s];typeof _=="object"&&_!==null&&a.indexOf(_)===-1&&(e.push({obj:x,prop:s}),a.push(_))}return Ye(e),r},ot=function(r){return Object.prototype.toString.call(r)==="[object RegExp]"},at=function(r){return!r||typeof r!="object"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))},st=function(r,e){return[].concat(r,e)},it={arrayToObject:Ae,assign:et,combine:st,compact:nt,decode:tt,encode:rt,isBuffer:at,isRegExp:ot,merge:Je},ie=it,me=Object.prototype.hasOwnProperty,ft=Array.isArray,I={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ie.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ct=function(t){return t.replace(/&#(\d+);/g,function(r,e){return String.fromCharCode(parseInt(e,10))})},ht="utf8=%26%2310003%3B",ut="utf8=%E2%9C%93",lt=function(r,e){var a={},p=e.ignoreQueryPrefix?r.replace(/^\?/,""):r,c=e.parameterLimit===1/0?void 0:e.parameterLimit,x=p.split(e.delimiter,c),o=-1,v,s=e.charset;if(e.charsetSentinel)for(v=0;v<x.length;++v)x[v].indexOf("utf8=")===0&&(x[v]===ut?s="utf-8":x[v]===ht&&(s="iso-8859-1"),o=v,v=x.length);for(v=0;v<x.length;++v)if(v!==o){var _=x[v],O=_.indexOf("]="),w=O===-1?_.indexOf("="):O+1,m,b;w===-1?(m=e.decoder(_,I.decoder,s,"key"),b=e.strictNullHandling?null:""):(m=e.decoder(_.slice(0,w),I.decoder,s,"key"),b=e.decoder(_.slice(w+1),I.decoder,s,"value")),b&&e.interpretNumericEntities&&s==="iso-8859-1"&&(b=ct(b)),b&&typeof b=="string"&&e.comma&&b.indexOf(",")>-1&&(b=b.split(",")),_.indexOf("[]=")>-1&&(b=ft(b)?[b]:b),me.call(a,m)?a[m]=ie.combine(a[m],b):a[m]=b}return a},pt=function(t,r,e){for(var a=r,p=t.length-1;p>=0;--p){var c,x=t[p];if(x==="[]"&&e.parseArrays)c=[].concat(a);else{c=e.plainObjects?Object.create(null):{};var o=x.charAt(0)==="["&&x.charAt(x.length-1)==="]"?x.slice(1,-1):x,v=parseInt(o,10);!e.parseArrays&&o===""?c={0:a}:!isNaN(v)&&x!==o&&String(v)===o&&v>=0&&e.parseArrays&&v<=e.arrayLimit?(c=[],c[v]=a):c[o]=a}a=c}return a},dt=function(r,e,a){if(r){var p=a.allowDots?r.replace(/\.([^.[]+)/g,"[$1]"):r,c=/(\[[^[\]]*])/,x=/(\[[^[\]]*])/g,o=a.depth>0&&c.exec(p),v=o?p.slice(0,o.index):p,s=[];if(v){if(!a.plainObjects&&me.call(Object.prototype,v)&&!a.allowPrototypes)return;s.push(v)}for(var _=0;a.depth>0&&(o=x.exec(p))!==null&&_<a.depth;){if(_+=1,!a.plainObjects&&me.call(Object.prototype,o[1].slice(1,-1))&&!a.allowPrototypes)return;s.push(o[1])}return o&&s.push("["+p.slice(o.index)+"]"),pt(s,e,a)}},vt=function(r){if(!r)return I;if(r.decoder!==null&&r.decoder!==void 0&&typeof r.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof r.charset<"u"&&r.charset!=="utf-8"&&r.charset!=="iso-8859-1")throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var e=typeof r.charset>"u"?I.charset:r.charset;return{allowDots:typeof r.allowDots>"u"?I.allowDots:!!r.allowDots,allowPrototypes:typeof r.allowPrototypes=="boolean"?r.allowPrototypes:I.allowPrototypes,arrayLimit:typeof r.arrayLimit=="number"?r.arrayLimit:I.arrayLimit,charset:e,charsetSentinel:typeof r.charsetSentinel=="boolean"?r.charsetSentinel:I.charsetSentinel,comma:typeof r.comma=="boolean"?r.comma:I.comma,decoder:typeof r.decoder=="function"?r.decoder:I.decoder,delimiter:typeof r.delimiter=="string"||ie.isRegExp(r.delimiter)?r.delimiter:I.delimiter,depth:typeof r.depth=="number"||r.depth===!1?+r.depth:I.depth,ignoreQueryPrefix:r.ignoreQueryPrefix===!0,interpretNumericEntities:typeof r.interpretNumericEntities=="boolean"?r.interpretNumericEntities:I.interpretNumericEntities,parameterLimit:typeof r.parameterLimit=="number"?r.parameterLimit:I.parameterLimit,parseArrays:r.parseArrays!==!1,plainObjects:typeof r.plainObjects=="boolean"?r.plainObjects:I.plainObjects,strictNullHandling:typeof r.strictNullHandling=="boolean"?r.strictNullHandling:I.strictNullHandling}},mt=function(t,r){var e=vt(r);if(t===""||t===null||typeof t>"u")return e.plainObjects?Object.create(null):{};for(var a=typeof t=="string"?lt(t,e):t,p=e.plainObjects?Object.create(null):{},c=Object.keys(a),x=0;x<c.length;++x){var o=c[x],v=dt(o,a[o],e);p=ie.merge(p,v,e)}return ie.compact(p)};const yt=he(mt);var ue={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */ue.exports,function(t,r){(function(e){var a=r&&!r.nodeType&&r,p=t&&!t.nodeType&&t,c=typeof W=="object"&&W;(c.global===c||c.window===c||c.self===c)&&(e=c);var x,o=2147483647,v=36,s=1,_=26,O=38,w=700,m=72,b=128,d="-",y=/^xn--/,j=/[^\x20-\x7E]/,n=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=v-s,C=Math.floor,B=String.fromCharCode,P;function S(A){throw new RangeError(l[A])}function T(A,i){for(var f=A.length,h=[];f--;)h[f]=i(A[f]);return h}function E(A,i){var f=A.split("@"),h="";f.length>1&&(h=f[0]+"@",A=f[1]),A=A.replace(n,".");var u=A.split("."),L=T(u,i).join(".");return h+L}function F(A){for(var i=[],f=0,h=A.length,u,L;f<h;)u=A.charCodeAt(f++),u>=55296&&u<=56319&&f<h?(L=A.charCodeAt(f++),(L&64512)==56320?i.push(((u&1023)<<10)+(L&1023)+65536):(i.push(u),f--)):i.push(u);return i}function D(A){return T(A,function(i){var f="";return i>65535&&(i-=65536,f+=B(i>>>10&1023|55296),i=56320|i&1023),f+=B(i),f}).join("")}function R(A){return A-48<10?A-22:A-65<26?A-65:A-97<26?A-97:v}function M(A,i){return A+22+75*(A<26)-((i!=0)<<5)}function N(A,i,f){var h=0;for(A=f?C(A/w):A>>1,A+=C(A/i);A>g*_>>1;h+=v)A=C(A/g);return C(h+(g+1)*A/(A+O))}function z(A){var i=[],f=A.length,h,u=0,L=b,q=m,U,G,V,Y,$,K,Q,ee,te;for(U=A.lastIndexOf(d),U<0&&(U=0),G=0;G<U;++G)A.charCodeAt(G)>=128&&S("not-basic"),i.push(A.charCodeAt(G));for(V=U>0?U+1:0;V<f;){for(Y=u,$=1,K=v;V>=f&&S("invalid-input"),Q=R(A.charCodeAt(V++)),(Q>=v||Q>C((o-u)/$))&&S("overflow"),u+=Q*$,ee=K<=q?s:K>=q+_?_:K-q,!(Q<ee);K+=v)te=v-ee,$>C(o/te)&&S("overflow"),$*=te;h=i.length+1,q=N(u-Y,h,Y==0),C(u/h)>o-L&&S("overflow"),L+=C(u/h),u%=h,i.splice(u++,0,L)}return D(i)}function k(A){var i,f,h,u,L,q,U,G,V,Y,$,K=[],Q,ee,te,_e;for(A=F(A),Q=A.length,i=b,f=0,L=m,q=0;q<Q;++q)$=A[q],$<128&&K.push(B($));for(h=u=K.length,u&&K.push(d);h<Q;){for(U=o,q=0;q<Q;++q)$=A[q],$>=i&&$<U&&(U=$);for(ee=h+1,U-i>C((o-f)/ee)&&S("overflow"),f+=(U-i)*ee,i=U,q=0;q<Q;++q)if($=A[q],$<i&&++f>o&&S("overflow"),$==i){for(G=f,V=v;Y=V<=L?s:V>=L+_?_:V-L,!(G<Y);V+=v)_e=G-Y,te=v-Y,K.push(B(M(Y+_e%te,0))),G=C(_e/te);K.push(B(M(G,0))),L=N(f,ee,h==u),f=0,++h}++f,++i}return K.join("")}function J(A){return E(A,function(i){return y.test(i)?z(i.slice(4).toLowerCase()):i})}function ae(A){return E(A,function(i){return j.test(i)?"xn--"+k(i):i})}if(x={version:"1.4.1",ucs2:{decode:F,encode:D},decode:z,encode:k,toASCII:ae,toUnicode:J},a&&p)if(t.exports==a)p.exports=x;else for(P in x)x.hasOwnProperty(P)&&(a[P]=x[P]);else e.punycode=x})(W)}(ue,ue.exports);var gt=ue.exports,xt=gt;function Z(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var wt=/^([a-z0-9.+-]+:)/i,bt=/:[0-9]*$/,Ct=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,_t=["<",">",'"',"`"," ","\r",`
2
- `," "],Ot=["{","}","|","\\","^","`"].concat(_t),ye=["'"].concat(Ot),je=["%","/","?",";","#"].concat(ye),Se=["/","?","#"],Bt=255,Pe=/^[+a-z0-9A-Z_-]{0,63}$/,At=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,jt={javascript:!0,"javascript:":!0},ge={javascript:!0,"javascript:":!0},oe={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},xe=re;function He(t,r,e){if(t&&typeof t=="object"&&t instanceof Z)return t;var a=new Z;return a.parse(t,r,e),a}Z.prototype.parse=function(t,r,e){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var a=t.indexOf("?"),p=a!==-1&&a<t.indexOf("#")?"?":"#",c=t.split(p),x=/\\/g;c[0]=c[0].replace(x,"/"),t=c.join(p);var o=t;if(o=o.trim(),!e&&t.split("#").length===1){var v=Ct.exec(o);if(v)return this.path=o,this.href=o,this.pathname=v[1],v[2]?(this.search=v[2],r?this.query=xe.parse(this.search.substr(1)):this.query=this.search.substr(1)):r&&(this.search="",this.query={}),this}var s=wt.exec(o);if(s){s=s[0];var _=s.toLowerCase();this.protocol=_,o=o.substr(s.length)}if(e||s||o.match(/^\/\/[^@/]+@[^@/]+/)){var O=o.substr(0,2)==="//";O&&!(s&&ge[s])&&(o=o.substr(2),this.slashes=!0)}if(!ge[s]&&(O||s&&!oe[s])){for(var w=-1,m=0;m<Se.length;m++){var b=o.indexOf(Se[m]);b!==-1&&(w===-1||b<w)&&(w=b)}var d,y;w===-1?y=o.lastIndexOf("@"):y=o.lastIndexOf("@",w),y!==-1&&(d=o.slice(0,y),o=o.slice(y+1),this.auth=decodeURIComponent(d)),w=-1;for(var m=0;m<je.length;m++){var b=o.indexOf(je[m]);b!==-1&&(w===-1||b<w)&&(w=b)}w===-1&&(w=o.length),this.host=o.slice(0,w),o=o.slice(w),this.parseHost(),this.hostname=this.hostname||"";var j=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!j)for(var n=this.hostname.split(/\./),m=0,l=n.length;m<l;m++){var g=n[m];if(g&&!g.match(Pe)){for(var C="",B=0,P=g.length;B<P;B++)g.charCodeAt(B)>127?C+="x":C+=g[B];if(!C.match(Pe)){var S=n.slice(0,m),T=n.slice(m+1),E=g.match(At);E&&(S.push(E[1]),T.unshift(E[2])),T.length&&(o="/"+T.join(".")+o),this.hostname=S.join(".");break}}}this.hostname.length>Bt?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=xt.toASCII(this.hostname));var F=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+F,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!jt[_])for(var m=0,l=ye.length;m<l;m++){var R=ye[m];if(o.indexOf(R)!==-1){var M=encodeURIComponent(R);M===R&&(M=escape(R)),o=o.split(R).join(M)}}var N=o.indexOf("#");N!==-1&&(this.hash=o.substr(N),o=o.slice(0,N));var z=o.indexOf("?");if(z!==-1?(this.search=o.substr(z),this.query=o.substr(z+1),r&&(this.query=xe.parse(this.query)),o=o.slice(0,z)):r&&(this.search="",this.query={}),o&&(this.pathname=o),oe[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var F=this.pathname||"",k=this.search||"";this.path=F+k}return this.href=this.format(),this},Z.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var r=this.protocol||"",e=this.pathname||"",a=this.hash||"",p=!1,c="";this.host?p=t+this.host:this.hostname&&(p=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(p+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(c=xe.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var x=this.search||c&&"?"+c||"";return r&&r.substr(-1)!==":"&&(r+=":"),this.slashes||(!r||oe[r])&&p!==!1?(p="//"+(p||""),e&&e.charAt(0)!=="/"&&(e="/"+e)):p||(p=""),a&&a.charAt(0)!=="#"&&(a="#"+a),x&&x.charAt(0)!=="?"&&(x="?"+x),e=e.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),x=x.replace("#","%23"),r+p+e+x+a},Z.prototype.resolve=function(t){return this.resolveObject(He(t,!1,!0)).format()},Z.prototype.resolveObject=function(t){if(typeof t=="string"){var r=new Z;r.parse(t,!1,!0),t=r}for(var e=new Z,a=Object.keys(this),p=0;p<a.length;p++){var c=a[p];e[c]=this[c]}if(e.hash=t.hash,t.href==="")return e.href=e.format(),e;if(t.slashes&&!t.protocol){for(var x=Object.keys(t),o=0;o<x.length;o++){var v=x[o];v!=="protocol"&&(e[v]=t[v])}return oe[e.protocol]&&e.hostname&&!e.pathname&&(e.pathname="/",e.path=e.pathname),e.href=e.format(),e}if(t.protocol&&t.protocol!==e.protocol){if(!oe[t.protocol]){for(var s=Object.keys(t),_=0;_<s.length;_++){var O=s[_];e[O]=t[O]}return e.href=e.format(),e}if(e.protocol=t.protocol,!t.host&&!ge[t.protocol]){for(var l=(t.pathname||"").split("/");l.length&&!(t.host=l.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),l[0]!==""&&l.unshift(""),l.length<2&&l.unshift(""),e.pathname=l.join("/")}else e.pathname=t.pathname;if(e.search=t.search,e.query=t.query,e.host=t.host||"",e.auth=t.auth,e.hostname=t.hostname||t.host,e.port=t.port,e.pathname||e.search){var w=e.pathname||"",m=e.search||"";e.path=w+m}return e.slashes=e.slashes||t.slashes,e.href=e.format(),e}var b=e.pathname&&e.pathname.charAt(0)==="/",d=t.host||t.pathname&&t.pathname.charAt(0)==="/",y=d||b||e.host&&t.pathname,j=y,n=e.pathname&&e.pathname.split("/")||[],l=t.pathname&&t.pathname.split("/")||[],g=e.protocol&&!oe[e.protocol];if(g&&(e.hostname="",e.port=null,e.host&&(n[0]===""?n[0]=e.host:n.unshift(e.host)),e.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(l[0]===""?l[0]=t.host:l.unshift(t.host)),t.host=null),y=y&&(l[0]===""||n[0]==="")),d)e.host=t.host||t.host===""?t.host:e.host,e.hostname=t.hostname||t.hostname===""?t.hostname:e.hostname,e.search=t.search,e.query=t.query,n=l;else if(l.length)n||(n=[]),n.pop(),n=n.concat(l),e.search=t.search,e.query=t.query;else if(t.search!=null){if(g){e.host=n.shift(),e.hostname=e.host;var C=e.host&&e.host.indexOf("@")>0?e.host.split("@"):!1;C&&(e.auth=C.shift(),e.hostname=C.shift(),e.host=e.hostname)}return e.search=t.search,e.query=t.query,(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e}if(!n.length)return e.pathname=null,e.search?e.path="/"+e.search:e.path=null,e.href=e.format(),e;for(var B=n.slice(-1)[0],P=(e.host||t.host||n.length>1)&&(B==="."||B==="..")||B==="",S=0,T=n.length;T>=0;T--)B=n[T],B==="."?n.splice(T,1):B===".."?(n.splice(T,1),S++):S&&(n.splice(T,1),S--);if(!y&&!j)for(;S--;S)n.unshift("..");y&&n[0]!==""&&(!n[0]||n[0].charAt(0)!=="/")&&n.unshift(""),P&&n.join("/").substr(-1)!=="/"&&n.push("");var E=n[0]===""||n[0]&&n[0].charAt(0)==="/";if(g){e.hostname=E?"":n.length?n.shift():"",e.host=e.hostname;var C=e.host&&e.host.indexOf("@")>0?e.host.split("@"):!1;C&&(e.auth=C.shift(),e.hostname=C.shift(),e.host=e.hostname)}return y=y||e.host&&n.length,y&&!E&&n.unshift(""),n.length>0?e.pathname=n.join("/"):(e.pathname=null,e.path=null),(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=t.auth||e.auth,e.slashes=e.slashes||t.slashes,e.href=e.format(),e},Z.prototype.parseHost=function(){var t=this.host,r=bt.exec(t);r&&(r=r[0],r!==":"&&(this.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(this.hostname=t)};var St=He,Te={exports:{}};function Pt(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var we={exports:{}};const Ht=Ze(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ee;function fe(){return Ee||(Ee=1,function(t,r){(function(e,a){t.exports=a()})(W,function(){var e=e||function(a,p){var c;if(typeof window<"u"&&window.crypto&&(c=window.crypto),typeof self<"u"&&self.crypto&&(c=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(c=globalThis.crypto),!c&&typeof window<"u"&&window.msCrypto&&(c=window.msCrypto),!c&&typeof W<"u"&&W.crypto&&(c=W.crypto),!c&&typeof Pt=="function")try{c=Ht}catch{}var x=function(){if(c){if(typeof c.getRandomValues=="function")try{return c.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof c.randomBytes=="function")try{return c.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function n(){}return function(l){var g;return n.prototype=l,g=new n,n.prototype=null,g}}(),v={},s=v.lib={},_=s.Base=function(){return{extend:function(n){var l=o(this);return n&&l.mixIn(n),(!l.hasOwnProperty("init")||this.init===l.init)&&(l.init=function(){l.$super.init.apply(this,arguments)}),l.init.prototype=l,l.$super=this,l},create:function(){var n=this.extend();return n.init.apply(n,arguments),n},init:function(){},mixIn:function(n){for(var l in n)n.hasOwnProperty(l)&&(this[l]=n[l]);n.hasOwnProperty("toString")&&(this.toString=n.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),O=s.WordArray=_.extend({init:function(n,l){n=this.words=n||[],l!=p?this.sigBytes=l:this.sigBytes=n.length*4},toString:function(n){return(n||m).stringify(this)},concat:function(n){var l=this.words,g=n.words,C=this.sigBytes,B=n.sigBytes;if(this.clamp(),C%4)for(var P=0;P<B;P++){var S=g[P>>>2]>>>24-P%4*8&255;l[C+P>>>2]|=S<<24-(C+P)%4*8}else for(var T=0;T<B;T+=4)l[C+T>>>2]=g[T>>>2];return this.sigBytes+=B,this},clamp:function(){var n=this.words,l=this.sigBytes;n[l>>>2]&=4294967295<<32-l%4*8,n.length=a.ceil(l/4)},clone:function(){var n=_.clone.call(this);return n.words=this.words.slice(0),n},random:function(n){for(var l=[],g=0;g<n;g+=4)l.push(x());return new O.init(l,n)}}),w=v.enc={},m=w.Hex={stringify:function(n){for(var l=n.words,g=n.sigBytes,C=[],B=0;B<g;B++){var P=l[B>>>2]>>>24-B%4*8&255;C.push((P>>>4).toString(16)),C.push((P&15).toString(16))}return C.join("")},parse:function(n){for(var l=n.length,g=[],C=0;C<l;C+=2)g[C>>>3]|=parseInt(n.substr(C,2),16)<<24-C%8*4;return new O.init(g,l/2)}},b=w.Latin1={stringify:function(n){for(var l=n.words,g=n.sigBytes,C=[],B=0;B<g;B++){var P=l[B>>>2]>>>24-B%4*8&255;C.push(String.fromCharCode(P))}return C.join("")},parse:function(n){for(var l=n.length,g=[],C=0;C<l;C++)g[C>>>2]|=(n.charCodeAt(C)&255)<<24-C%4*8;return new O.init(g,l)}},d=w.Utf8={stringify:function(n){try{return decodeURIComponent(escape(b.stringify(n)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(n){return b.parse(unescape(encodeURIComponent(n)))}},y=s.BufferedBlockAlgorithm=_.extend({reset:function(){this._data=new O.init,this._nDataBytes=0},_append:function(n){typeof n=="string"&&(n=d.parse(n)),this._data.concat(n),this._nDataBytes+=n.sigBytes},_process:function(n){var l,g=this._data,C=g.words,B=g.sigBytes,P=this.blockSize,S=P*4,T=B/S;n?T=a.ceil(T):T=a.max((T|0)-this._minBufferSize,0);var E=T*P,F=a.min(E*4,B);if(E){for(var D=0;D<E;D+=P)this._doProcessBlock(C,D);l=C.splice(0,E),g.sigBytes-=F}return new O.init(l,F)},clone:function(){var n=_.clone.call(this);return n._data=this._data.clone(),n},_minBufferSize:0});s.Hasher=y.extend({cfg:_.extend(),init:function(n){this.cfg=this.cfg.extend(n),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(n){return this._append(n),this._process(),this},finalize:function(n){n&&this._append(n);var l=this._doFinalize();return l},blockSize:16,_createHelper:function(n){return function(l,g){return new n.init(g).finalize(l)}},_createHmacHelper:function(n){return function(l,g){return new j.HMAC.init(n,g).finalize(l)}}});var j=v.algo={};return v}(Math);return e})}(we)),we.exports}var be={exports:{}},Fe;function Tt(){return Fe||(Fe=1,function(t,r){(function(e,a){t.exports=a(fe())})(W,function(e){return function(a){var p=e,c=p.lib,x=c.WordArray,o=c.Hasher,v=p.algo,s=[],_=[];(function(){function m(j){for(var n=a.sqrt(j),l=2;l<=n;l++)if(!(j%l))return!1;return!0}function b(j){return(j-(j|0))*4294967296|0}for(var d=2,y=0;y<64;)m(d)&&(y<8&&(s[y]=b(a.pow(d,1/2))),_[y]=b(a.pow(d,1/3)),y++),d++})();var O=[],w=v.SHA256=o.extend({_doReset:function(){this._hash=new x.init(s.slice(0))},_doProcessBlock:function(m,b){for(var d=this._hash.words,y=d[0],j=d[1],n=d[2],l=d[3],g=d[4],C=d[5],B=d[6],P=d[7],S=0;S<64;S++){if(S<16)O[S]=m[b+S]|0;else{var T=O[S-15],E=(T<<25|T>>>7)^(T<<14|T>>>18)^T>>>3,F=O[S-2],D=(F<<15|F>>>17)^(F<<13|F>>>19)^F>>>10;O[S]=E+O[S-7]+D+O[S-16]}var R=g&C^~g&B,M=y&j^y&n^j&n,N=(y<<30|y>>>2)^(y<<19|y>>>13)^(y<<10|y>>>22),z=(g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25),k=P+z+R+_[S]+O[S],J=N+M;P=B,B=C,C=g,g=l+k|0,l=n,n=j,j=y,y=k+J|0}d[0]=d[0]+y|0,d[1]=d[1]+j|0,d[2]=d[2]+n|0,d[3]=d[3]+l|0,d[4]=d[4]+g|0,d[5]=d[5]+C|0,d[6]=d[6]+B|0,d[7]=d[7]+P|0},_doFinalize:function(){var m=this._data,b=m.words,d=this._nDataBytes*8,y=m.sigBytes*8;return b[y>>>5]|=128<<24-y%32,b[(y+64>>>9<<4)+14]=a.floor(d/4294967296),b[(y+64>>>9<<4)+15]=d,m.sigBytes=b.length*4,this._process(),this._hash},clone:function(){var m=o.clone.call(this);return m._hash=this._hash.clone(),m}});p.SHA256=o._createHelper(w),p.HmacSHA256=o._createHmacHelper(w)}(Math),e.SHA256})}(be)),be.exports}var Ce={exports:{}},Ie;function Et(){return Ie||(Ie=1,function(t,r){(function(e,a){t.exports=a(fe())})(W,function(e){(function(){var a=e,p=a.lib,c=p.Base,x=a.enc,o=x.Utf8,v=a.algo;v.HMAC=c.extend({init:function(s,_){s=this._hasher=new s.init,typeof _=="string"&&(_=o.parse(_));var O=s.blockSize,w=O*4;_.sigBytes>w&&(_=s.finalize(_)),_.clamp();for(var m=this._oKey=_.clone(),b=this._iKey=_.clone(),d=m.words,y=b.words,j=0;j<O;j++)d[j]^=1549556828,y[j]^=909522486;m.sigBytes=b.sigBytes=w,this.reset()},reset:function(){var s=this._hasher;s.reset(),s.update(this._iKey)},update:function(s){return this._hasher.update(s),this},finalize:function(s){var _=this._hasher,O=_.finalize(s);_.reset();var w=_.finalize(this._oKey.clone().concat(O));return w}})})()})}(Ce)),Ce.exports}(function(t,r){(function(e,a,p){t.exports=a(fe(),Tt(),Et())})(W,function(e){return e.HmacSHA256})})(Te);var Ft=Te.exports;const It=he(Ft);var qe={exports:{}};(function(t,r){(function(e,a){t.exports=a(fe())})(W,function(e){return function(){var a=e,p=a.lib,c=p.WordArray,x=a.enc;x.Base64={stringify:function(v){var s=v.words,_=v.sigBytes,O=this._map;v.clamp();for(var w=[],m=0;m<_;m+=3)for(var b=s[m>>>2]>>>24-m%4*8&255,d=s[m+1>>>2]>>>24-(m+1)%4*8&255,y=s[m+2>>>2]>>>24-(m+2)%4*8&255,j=b<<16|d<<8|y,n=0;n<4&&m+n*.75<_;n++)w.push(O.charAt(j>>>6*(3-n)&63));var l=O.charAt(64);if(l)for(;w.length%4;)w.push(l);return w.join("")},parse:function(v){var s=v.length,_=this._map,O=this._reverseMap;if(!O){O=this._reverseMap=[];for(var w=0;w<_.length;w++)O[_.charCodeAt(w)]=w}var m=_.charAt(64);if(m){var b=v.indexOf(m);b!==-1&&(s=b)}return o(v,s,O)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function o(v,s,_){for(var O=[],w=0,m=0;m<s;m++)if(m%4){var b=_[v.charCodeAt(m-1)]<<m%4*2,d=_[v.charCodeAt(m)]>>>6-m%4*2,y=b|d;O[w>>>2]|=y<<24-w%4*8,w++}return c.create(O,w)}}(),e.enc.Base64})})(qe);var qt=qe.exports;const $e=he(qt);var De={exports:{}};(function(t,r){(function(e,a){t.exports=a(fe())})(W,function(e){return function(a){var p=e,c=p.lib,x=c.WordArray,o=c.Hasher,v=p.algo,s=[];(function(){for(var d=0;d<64;d++)s[d]=a.abs(a.sin(d+1))*4294967296|0})();var _=v.MD5=o.extend({_doReset:function(){this._hash=new x.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(d,y){for(var j=0;j<16;j++){var n=y+j,l=d[n];d[n]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360}var g=this._hash.words,C=d[y+0],B=d[y+1],P=d[y+2],S=d[y+3],T=d[y+4],E=d[y+5],F=d[y+6],D=d[y+7],R=d[y+8],M=d[y+9],N=d[y+10],z=d[y+11],k=d[y+12],J=d[y+13],ae=d[y+14],A=d[y+15],i=g[0],f=g[1],h=g[2],u=g[3];i=O(i,f,h,u,C,7,s[0]),u=O(u,i,f,h,B,12,s[1]),h=O(h,u,i,f,P,17,s[2]),f=O(f,h,u,i,S,22,s[3]),i=O(i,f,h,u,T,7,s[4]),u=O(u,i,f,h,E,12,s[5]),h=O(h,u,i,f,F,17,s[6]),f=O(f,h,u,i,D,22,s[7]),i=O(i,f,h,u,R,7,s[8]),u=O(u,i,f,h,M,12,s[9]),h=O(h,u,i,f,N,17,s[10]),f=O(f,h,u,i,z,22,s[11]),i=O(i,f,h,u,k,7,s[12]),u=O(u,i,f,h,J,12,s[13]),h=O(h,u,i,f,ae,17,s[14]),f=O(f,h,u,i,A,22,s[15]),i=w(i,f,h,u,B,5,s[16]),u=w(u,i,f,h,F,9,s[17]),h=w(h,u,i,f,z,14,s[18]),f=w(f,h,u,i,C,20,s[19]),i=w(i,f,h,u,E,5,s[20]),u=w(u,i,f,h,N,9,s[21]),h=w(h,u,i,f,A,14,s[22]),f=w(f,h,u,i,T,20,s[23]),i=w(i,f,h,u,M,5,s[24]),u=w(u,i,f,h,ae,9,s[25]),h=w(h,u,i,f,S,14,s[26]),f=w(f,h,u,i,R,20,s[27]),i=w(i,f,h,u,J,5,s[28]),u=w(u,i,f,h,P,9,s[29]),h=w(h,u,i,f,D,14,s[30]),f=w(f,h,u,i,k,20,s[31]),i=m(i,f,h,u,E,4,s[32]),u=m(u,i,f,h,R,11,s[33]),h=m(h,u,i,f,z,16,s[34]),f=m(f,h,u,i,ae,23,s[35]),i=m(i,f,h,u,B,4,s[36]),u=m(u,i,f,h,T,11,s[37]),h=m(h,u,i,f,D,16,s[38]),f=m(f,h,u,i,N,23,s[39]),i=m(i,f,h,u,J,4,s[40]),u=m(u,i,f,h,C,11,s[41]),h=m(h,u,i,f,S,16,s[42]),f=m(f,h,u,i,F,23,s[43]),i=m(i,f,h,u,M,4,s[44]),u=m(u,i,f,h,k,11,s[45]),h=m(h,u,i,f,A,16,s[46]),f=m(f,h,u,i,P,23,s[47]),i=b(i,f,h,u,C,6,s[48]),u=b(u,i,f,h,D,10,s[49]),h=b(h,u,i,f,ae,15,s[50]),f=b(f,h,u,i,E,21,s[51]),i=b(i,f,h,u,k,6,s[52]),u=b(u,i,f,h,S,10,s[53]),h=b(h,u,i,f,N,15,s[54]),f=b(f,h,u,i,B,21,s[55]),i=b(i,f,h,u,R,6,s[56]),u=b(u,i,f,h,A,10,s[57]),h=b(h,u,i,f,F,15,s[58]),f=b(f,h,u,i,J,21,s[59]),i=b(i,f,h,u,T,6,s[60]),u=b(u,i,f,h,z,10,s[61]),h=b(h,u,i,f,P,15,s[62]),f=b(f,h,u,i,M,21,s[63]),g[0]=g[0]+i|0,g[1]=g[1]+f|0,g[2]=g[2]+h|0,g[3]=g[3]+u|0},_doFinalize:function(){var d=this._data,y=d.words,j=this._nDataBytes*8,n=d.sigBytes*8;y[n>>>5]|=128<<24-n%32;var l=a.floor(j/4294967296),g=j;y[(n+64>>>9<<4)+15]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,y[(n+64>>>9<<4)+14]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,d.sigBytes=(y.length+1)*4,this._process();for(var C=this._hash,B=C.words,P=0;P<4;P++){var S=B[P];B[P]=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360}return C},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});function O(d,y,j,n,l,g,C){var B=d+(y&j|~y&n)+l+C;return(B<<g|B>>>32-g)+y}function w(d,y,j,n,l,g,C){var B=d+(y&n|j&~n)+l+C;return(B<<g|B>>>32-g)+y}function m(d,y,j,n,l,g,C){var B=d+(y^j^n)+l+C;return(B<<g|B>>>32-g)+y}function b(d,y,j,n,l,g,C){var B=d+(j^(y|~n))+l+C;return(B<<g|B>>>32-g)+y}p.MD5=o._createHelper(_),p.HmacMD5=o._createHmacHelper(_)}(Math),e.MD5})})(De);var $t=De.exports;const Dt=he($t),Le={sign:(t,r)=>$e.stringify(It(t,r)),md5Content:t=>H.isEmpty(t)?"":$e.stringify(Dt(t))},Lt=t=>{const r=H.sortBy(Object.keys(t));let e={};return H.map(r,a=>{H.isEmpty(t[a])?e[a]=null:H.isArray(t[a])?e[a]=t[a][0]:e[a]=t[a]}),e},Rt={map:H.map,keys:H.keys,compact:H.compact,sortBy:H.sortBy,forEach:H.forEach},zt=t=>{let r=t,e=H.mapValues(Rt,p=>(...c)=>(r=p(r,...c),a));const a=Object.assign(e,{value:()=>r});return a},Re=t=>{const r=["X-Gw-Signature","X-Gw-Signature-headers","Accept","Content-MD5","Content-Type","Date"];let e="",a="",p=!0;return zt(t).keys(t).map(c=>!H.includes(r,c)&&{value:t[c],key:H.toLower(c)}).compact().sortBy(c=>c.key).forEach(c=>{e+=`${c.key}:${c.value}
3
- `,p?a+=c.key:a+=","+c.key,p=!1}),{transformHeader:e,transformHeaderKeys:a}},Mt="application/x-www-form-urlencoded",Nt=(t,{appkey:r,appsecret:e,originQuery:a})=>{try{if(r&&e){const{method:p,url:c}=t;let x=a?Ve(c,a):c,o=H.get(t,"headers")||H.get(t,"header");const{Accept:v}=o,s=St(x,!0),_=s.query;let O="",w=_;if(o["Content-Type"]||(o["Content-Type"]="application/json"),o.Accept||(o.Accept="*/*"),t.body&&o["Content-Type"].indexOf(Mt)===-1)O=Le.md5Content(t.body),o["Content-MD5"]=O;else{let y=t.body;if(H.isString(y)){const j=yt(y);H.isEmpty(w)?w=j:w=Object.assign({},w,j)}}const m=Xe(s.pathname,Qe(Lt(w))),b=o["Content-Type"]?o["Content-Type"]:"";o["X-Gw-Key"]=r,o["X-Gw-Timestamp"]=H.toString(H.now()),o["X-Gw-Nonce"]=H.toString(H.random(1e12,9999999999999));const d=`${p}
1
+ (function(G,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("lodash-es"),require("dingtalk-jsapi"),require("qs"),require("axios")):typeof define=="function"&&define.amd?define(["exports","lodash-es","dingtalk-jsapi","qs","axios"],T):(G=typeof globalThis<"u"?globalThis:G||self,T(G.Main={},G._,G.dd$1,G.qs,G.axios))})(this,function(G,T,Me,ne,Oe){"use strict";function ze(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const ie=ze(Me),le=window.navigator.userAgent.toLowerCase();let pe={code:"",name:"未知"};function Ne(){return typeof window<"u"&&typeof document<"u"&&typeof document.querySelector=="function"&&typeof navigator<"u"&&typeof XMLHttpRequest=="function"}const Ue=[{code:"weixin",name:"微信",value:/MicroMessenger/i.test(le)},{code:"wxmp",name:"微信小程序",value:/miniProgram/i.test(le)||window.__wxjs_environment==="miniprogram"},{code:"dd",name:"钉钉",value:/DingTalk/i.test(le)}],We=t=>t.value,Be=T.find(Ue,We);Be?pe=Be:Ne()&&(pe={code:"h5",name:"H5"});const ke=pe,Ke=t=>t=="dev"?"https://test.ihotel.cn/gw/v1/platform-gcding":t=="prod"?"https://smart.ihotel.cn/guardian/gw/v1/platform-gcding":t||"https://test.ihotel.cn/gw/v1/platform-gcding",Ge=ne.parse(location.search,{ignoreQueryPrefix:!0}),de=T.get(Ge,"corpId"),Qe={dd:{login:async({appCode:t,apiPrefix:r})=>{const e=Ke(r);return new Promise(async a=>{var p,c,x;if(de){const{code:o}=await ie.getAuthCode({corpId:de}),v=await Oe.post(`${e}/api/auth/queryAuthNoExternalCompatible`,{appCode:t,authCode:o,corpId:de});v.data&&((p=v.data)==null?void 0:p.result)===0?a({userInfo:(c=v==null?void 0:v.data)==null?void 0:c.retVal,res:v}):(ie.alert({title:(x=v==null?void 0:v.data)==null?void 0:x.msg}),a({res:v}))}else ie.alert({title:"未配置参数:corpId"})})},dd:ie},h5:{login:()=>new Promise(async t=>{const{token:r}=ne.parse(location.search,{ignoreQueryPrefix:!0});t(r?{userInfo:{ucToken:r}}:{userInfo:null})})},wxmp:{login:()=>new Promise(t=>{const{token:r}=ne.parse(location.search,{ignoreQueryPrefix:!0});t(r?{userInfo:{ucToken:r}}:{userInfo:null})})},weixin:{login:()=>new Promise(t=>{const{token:r}=ne.parse(location.search,{ignoreQueryPrefix:!0});t(r?{userInfo:{ucToken:r}}:{userInfo:null})})}},Xe=t=>{let r="";return T.mapKeys(t,(e,a)=>{a&&(T.isEmpty(e)?r+="&"+a:r+="&"+a+"="+e)}),r},Ve=(t,r)=>T.isEmpty(r)?t:(T.includes(t,"?")?t:t+"?")+r.substring(1),Ze=(t,r)=>T.isEmpty(r)?t:`${t}?${ne.stringify(r)}`;var W=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function he(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ye(t){if(t.__esModule)return t;var r=t.default;if(typeof r=="function"){var e=function a(){return this instanceof a?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};e.prototype=r.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var p=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,p.get?p:{enumerable:!0,get:function(){return t[a]}})}),e}var ve=Object.prototype.hasOwnProperty,oe=Array.isArray,V=function(){for(var t=[],r=0;r<256;++r)t.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return t}(),Je=function(r){for(;r.length>1;){var e=r.pop(),a=e.obj[e.prop];if(oe(a)){for(var p=[],c=0;c<a.length;++c)typeof a[c]<"u"&&p.push(a[c]);e.obj[e.prop]=p}}},Ae=function(r,e){for(var a=e&&e.plainObjects?Object.create(null):{},p=0;p<r.length;++p)typeof r[p]<"u"&&(a[p]=r[p]);return a},et=function t(r,e,a){if(!e)return r;if(typeof e!="object"){if(oe(r))r.push(e);else if(r&&typeof r=="object")(a&&(a.plainObjects||a.allowPrototypes)||!ve.call(Object.prototype,e))&&(r[e]=!0);else return[r,e];return r}if(!r||typeof r!="object")return[r].concat(e);var p=r;return oe(r)&&!oe(e)&&(p=Ae(r,a)),oe(r)&&oe(e)?(e.forEach(function(c,x){if(ve.call(r,x)){var o=r[x];o&&typeof o=="object"&&c&&typeof c=="object"?r[x]=t(o,c,a):r.push(c)}else r[x]=c}),r):Object.keys(e).reduce(function(c,x){var o=e[x];return ve.call(c,x)?c[x]=t(c[x],o,a):c[x]=o,c},p)},tt=function(r,e){return Object.keys(e).reduce(function(a,p){return a[p]=e[p],a},r)},rt=function(t,r,e){var a=t.replace(/\+/g," ");if(e==="iso-8859-1")return a.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(a)}catch{return a}},nt=function(r,e,a){if(r.length===0)return r;var p=r;if(typeof r=="symbol"?p=Symbol.prototype.toString.call(r):typeof r!="string"&&(p=String(r)),a==="iso-8859-1")return escape(p).replace(/%u[0-9a-f]{4}/gi,function(v){return"%26%23"+parseInt(v.slice(2),16)+"%3B"});for(var c="",x=0;x<p.length;++x){var o=p.charCodeAt(x);if(o===45||o===46||o===95||o===126||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122){c+=p.charAt(x);continue}if(o<128){c=c+V[o];continue}if(o<2048){c=c+(V[192|o>>6]+V[128|o&63]);continue}if(o<55296||o>=57344){c=c+(V[224|o>>12]+V[128|o>>6&63]+V[128|o&63]);continue}x+=1,o=65536+((o&1023)<<10|p.charCodeAt(x)&1023),c+=V[240|o>>18]+V[128|o>>12&63]+V[128|o>>6&63]+V[128|o&63]}return c},ot=function(r){for(var e=[{obj:{o:r},prop:"o"}],a=[],p=0;p<e.length;++p)for(var c=e[p],x=c.obj[c.prop],o=Object.keys(x),v=0;v<o.length;++v){var s=o[v],C=x[s];typeof C=="object"&&C!==null&&a.indexOf(C)===-1&&(e.push({obj:x,prop:s}),a.push(C))}return Je(e),r},at=function(r){return Object.prototype.toString.call(r)==="[object RegExp]"},st=function(r){return!r||typeof r!="object"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))},it=function(r,e){return[].concat(r,e)},ft={arrayToObject:Ae,assign:tt,combine:it,compact:ot,decode:rt,encode:nt,isBuffer:st,isRegExp:at,merge:et},fe=ft,me=Object.prototype.hasOwnProperty,ct=Array.isArray,I={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:fe.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ht=function(t){return t.replace(/&#(\d+);/g,function(r,e){return String.fromCharCode(parseInt(e,10))})},ut="utf8=%26%2310003%3B",lt="utf8=%E2%9C%93",pt=function(r,e){var a={},p=e.ignoreQueryPrefix?r.replace(/^\?/,""):r,c=e.parameterLimit===1/0?void 0:e.parameterLimit,x=p.split(e.delimiter,c),o=-1,v,s=e.charset;if(e.charsetSentinel)for(v=0;v<x.length;++v)x[v].indexOf("utf8=")===0&&(x[v]===lt?s="utf-8":x[v]===ut&&(s="iso-8859-1"),o=v,v=x.length);for(v=0;v<x.length;++v)if(v!==o){var C=x[v],O=C.indexOf("]="),w=O===-1?C.indexOf("="):O+1,m,b;w===-1?(m=e.decoder(C,I.decoder,s,"key"),b=e.strictNullHandling?null:""):(m=e.decoder(C.slice(0,w),I.decoder,s,"key"),b=e.decoder(C.slice(w+1),I.decoder,s,"value")),b&&e.interpretNumericEntities&&s==="iso-8859-1"&&(b=ht(b)),b&&typeof b=="string"&&e.comma&&b.indexOf(",")>-1&&(b=b.split(",")),C.indexOf("[]=")>-1&&(b=ct(b)?[b]:b),me.call(a,m)?a[m]=fe.combine(a[m],b):a[m]=b}return a},dt=function(t,r,e){for(var a=r,p=t.length-1;p>=0;--p){var c,x=t[p];if(x==="[]"&&e.parseArrays)c=[].concat(a);else{c=e.plainObjects?Object.create(null):{};var o=x.charAt(0)==="["&&x.charAt(x.length-1)==="]"?x.slice(1,-1):x,v=parseInt(o,10);!e.parseArrays&&o===""?c={0:a}:!isNaN(v)&&x!==o&&String(v)===o&&v>=0&&e.parseArrays&&v<=e.arrayLimit?(c=[],c[v]=a):c[o]=a}a=c}return a},vt=function(r,e,a){if(r){var p=a.allowDots?r.replace(/\.([^.[]+)/g,"[$1]"):r,c=/(\[[^[\]]*])/,x=/(\[[^[\]]*])/g,o=a.depth>0&&c.exec(p),v=o?p.slice(0,o.index):p,s=[];if(v){if(!a.plainObjects&&me.call(Object.prototype,v)&&!a.allowPrototypes)return;s.push(v)}for(var C=0;a.depth>0&&(o=x.exec(p))!==null&&C<a.depth;){if(C+=1,!a.plainObjects&&me.call(Object.prototype,o[1].slice(1,-1))&&!a.allowPrototypes)return;s.push(o[1])}return o&&s.push("["+p.slice(o.index)+"]"),dt(s,e,a)}},mt=function(r){if(!r)return I;if(r.decoder!==null&&r.decoder!==void 0&&typeof r.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof r.charset<"u"&&r.charset!=="utf-8"&&r.charset!=="iso-8859-1")throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var e=typeof r.charset>"u"?I.charset:r.charset;return{allowDots:typeof r.allowDots>"u"?I.allowDots:!!r.allowDots,allowPrototypes:typeof r.allowPrototypes=="boolean"?r.allowPrototypes:I.allowPrototypes,arrayLimit:typeof r.arrayLimit=="number"?r.arrayLimit:I.arrayLimit,charset:e,charsetSentinel:typeof r.charsetSentinel=="boolean"?r.charsetSentinel:I.charsetSentinel,comma:typeof r.comma=="boolean"?r.comma:I.comma,decoder:typeof r.decoder=="function"?r.decoder:I.decoder,delimiter:typeof r.delimiter=="string"||fe.isRegExp(r.delimiter)?r.delimiter:I.delimiter,depth:typeof r.depth=="number"||r.depth===!1?+r.depth:I.depth,ignoreQueryPrefix:r.ignoreQueryPrefix===!0,interpretNumericEntities:typeof r.interpretNumericEntities=="boolean"?r.interpretNumericEntities:I.interpretNumericEntities,parameterLimit:typeof r.parameterLimit=="number"?r.parameterLimit:I.parameterLimit,parseArrays:r.parseArrays!==!1,plainObjects:typeof r.plainObjects=="boolean"?r.plainObjects:I.plainObjects,strictNullHandling:typeof r.strictNullHandling=="boolean"?r.strictNullHandling:I.strictNullHandling}},yt=function(t,r){var e=mt(r);if(t===""||t===null||typeof t>"u")return e.plainObjects?Object.create(null):{};for(var a=typeof t=="string"?pt(t,e):t,p=e.plainObjects?Object.create(null):{},c=Object.keys(a),x=0;x<c.length;++x){var o=c[x],v=vt(o,a[o],e);p=fe.merge(p,v,e)}return fe.compact(p)};const gt=he(yt);var ue={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */ue.exports,function(t,r){(function(e){var a=r&&!r.nodeType&&r,p=t&&!t.nodeType&&t,c=typeof W=="object"&&W;(c.global===c||c.window===c||c.self===c)&&(e=c);var x,o=2147483647,v=36,s=1,C=26,O=38,w=700,m=72,b=128,d="-",y=/^xn--/,j=/[^\x20-\x7E]/,n=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=v-s,_=Math.floor,B=String.fromCharCode,P;function S(A){throw new RangeError(l[A])}function H(A,i){for(var f=A.length,h=[];f--;)h[f]=i(A[f]);return h}function E(A,i){var f=A.split("@"),h="";f.length>1&&(h=f[0]+"@",A=f[1]),A=A.replace(n,".");var u=A.split("."),L=H(u,i).join(".");return h+L}function F(A){for(var i=[],f=0,h=A.length,u,L;f<h;)u=A.charCodeAt(f++),u>=55296&&u<=56319&&f<h?(L=A.charCodeAt(f++),(L&64512)==56320?i.push(((u&1023)<<10)+(L&1023)+65536):(i.push(u),f--)):i.push(u);return i}function D(A){return H(A,function(i){var f="";return i>65535&&(i-=65536,f+=B(i>>>10&1023|55296),i=56320|i&1023),f+=B(i),f}).join("")}function R(A){return A-48<10?A-22:A-65<26?A-65:A-97<26?A-97:v}function z(A,i){return A+22+75*(A<26)-((i!=0)<<5)}function N(A,i,f){var h=0;for(A=f?_(A/w):A>>1,A+=_(A/i);A>g*C>>1;h+=v)A=_(A/g);return _(h+(g+1)*A/(A+O))}function M(A){var i=[],f=A.length,h,u=0,L=b,q=m,U,Q,Z,J,$,K,X,te,re;for(U=A.lastIndexOf(d),U<0&&(U=0),Q=0;Q<U;++Q)A.charCodeAt(Q)>=128&&S("not-basic"),i.push(A.charCodeAt(Q));for(Z=U>0?U+1:0;Z<f;){for(J=u,$=1,K=v;Z>=f&&S("invalid-input"),X=R(A.charCodeAt(Z++)),(X>=v||X>_((o-u)/$))&&S("overflow"),u+=X*$,te=K<=q?s:K>=q+C?C:K-q,!(X<te);K+=v)re=v-te,$>_(o/re)&&S("overflow"),$*=re;h=i.length+1,q=N(u-J,h,J==0),_(u/h)>o-L&&S("overflow"),L+=_(u/h),u%=h,i.splice(u++,0,L)}return D(i)}function k(A){var i,f,h,u,L,q,U,Q,Z,J,$,K=[],X,te,re,Ce;for(A=F(A),X=A.length,i=b,f=0,L=m,q=0;q<X;++q)$=A[q],$<128&&K.push(B($));for(h=u=K.length,u&&K.push(d);h<X;){for(U=o,q=0;q<X;++q)$=A[q],$>=i&&$<U&&(U=$);for(te=h+1,U-i>_((o-f)/te)&&S("overflow"),f+=(U-i)*te,i=U,q=0;q<X;++q)if($=A[q],$<i&&++f>o&&S("overflow"),$==i){for(Q=f,Z=v;J=Z<=L?s:Z>=L+C?C:Z-L,!(Q<J);Z+=v)Ce=Q-J,re=v-J,K.push(B(z(J+Ce%re,0))),Q=_(Ce/re);K.push(B(z(Q,0))),L=N(f,te,h==u),f=0,++h}++f,++i}return K.join("")}function ee(A){return E(A,function(i){return y.test(i)?M(i.slice(4).toLowerCase()):i})}function se(A){return E(A,function(i){return j.test(i)?"xn--"+k(i):i})}if(x={version:"1.4.1",ucs2:{decode:F,encode:D},decode:M,encode:k,toASCII:se,toUnicode:ee},a&&p)if(t.exports==a)p.exports=x;else for(P in x)x.hasOwnProperty(P)&&(a[P]=x[P]);else e.punycode=x})(W)}(ue,ue.exports);var xt=ue.exports,wt=xt;function Y(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var bt=/^([a-z0-9.+-]+:)/i,_t=/:[0-9]*$/,Ct=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,Ot=["<",">",'"',"`"," ","\r",`
2
+ `," "],Bt=["{","}","|","\\","^","`"].concat(Ot),ye=["'"].concat(Bt),je=["%","/","?",";","#"].concat(ye),Se=["/","?","#"],At=255,Pe=/^[+a-z0-9A-Z_-]{0,63}$/,jt=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,St={javascript:!0,"javascript:":!0},ge={javascript:!0,"javascript:":!0},ae={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},xe=ne;function He(t,r,e){if(t&&typeof t=="object"&&t instanceof Y)return t;var a=new Y;return a.parse(t,r,e),a}Y.prototype.parse=function(t,r,e){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var a=t.indexOf("?"),p=a!==-1&&a<t.indexOf("#")?"?":"#",c=t.split(p),x=/\\/g;c[0]=c[0].replace(x,"/"),t=c.join(p);var o=t;if(o=o.trim(),!e&&t.split("#").length===1){var v=Ct.exec(o);if(v)return this.path=o,this.href=o,this.pathname=v[1],v[2]?(this.search=v[2],r?this.query=xe.parse(this.search.substr(1)):this.query=this.search.substr(1)):r&&(this.search="",this.query={}),this}var s=bt.exec(o);if(s){s=s[0];var C=s.toLowerCase();this.protocol=C,o=o.substr(s.length)}if(e||s||o.match(/^\/\/[^@/]+@[^@/]+/)){var O=o.substr(0,2)==="//";O&&!(s&&ge[s])&&(o=o.substr(2),this.slashes=!0)}if(!ge[s]&&(O||s&&!ae[s])){for(var w=-1,m=0;m<Se.length;m++){var b=o.indexOf(Se[m]);b!==-1&&(w===-1||b<w)&&(w=b)}var d,y;w===-1?y=o.lastIndexOf("@"):y=o.lastIndexOf("@",w),y!==-1&&(d=o.slice(0,y),o=o.slice(y+1),this.auth=decodeURIComponent(d)),w=-1;for(var m=0;m<je.length;m++){var b=o.indexOf(je[m]);b!==-1&&(w===-1||b<w)&&(w=b)}w===-1&&(w=o.length),this.host=o.slice(0,w),o=o.slice(w),this.parseHost(),this.hostname=this.hostname||"";var j=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!j)for(var n=this.hostname.split(/\./),m=0,l=n.length;m<l;m++){var g=n[m];if(g&&!g.match(Pe)){for(var _="",B=0,P=g.length;B<P;B++)g.charCodeAt(B)>127?_+="x":_+=g[B];if(!_.match(Pe)){var S=n.slice(0,m),H=n.slice(m+1),E=g.match(jt);E&&(S.push(E[1]),H.unshift(E[2])),H.length&&(o="/"+H.join(".")+o),this.hostname=S.join(".");break}}}this.hostname.length>At?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=wt.toASCII(this.hostname));var F=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+F,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!St[C])for(var m=0,l=ye.length;m<l;m++){var R=ye[m];if(o.indexOf(R)!==-1){var z=encodeURIComponent(R);z===R&&(z=escape(R)),o=o.split(R).join(z)}}var N=o.indexOf("#");N!==-1&&(this.hash=o.substr(N),o=o.slice(0,N));var M=o.indexOf("?");if(M!==-1?(this.search=o.substr(M),this.query=o.substr(M+1),r&&(this.query=xe.parse(this.query)),o=o.slice(0,M)):r&&(this.search="",this.query={}),o&&(this.pathname=o),ae[C]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var F=this.pathname||"",k=this.search||"";this.path=F+k}return this.href=this.format(),this},Y.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var r=this.protocol||"",e=this.pathname||"",a=this.hash||"",p=!1,c="";this.host?p=t+this.host:this.hostname&&(p=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(p+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(c=xe.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var x=this.search||c&&"?"+c||"";return r&&r.substr(-1)!==":"&&(r+=":"),this.slashes||(!r||ae[r])&&p!==!1?(p="//"+(p||""),e&&e.charAt(0)!=="/"&&(e="/"+e)):p||(p=""),a&&a.charAt(0)!=="#"&&(a="#"+a),x&&x.charAt(0)!=="?"&&(x="?"+x),e=e.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),x=x.replace("#","%23"),r+p+e+x+a},Y.prototype.resolve=function(t){return this.resolveObject(He(t,!1,!0)).format()},Y.prototype.resolveObject=function(t){if(typeof t=="string"){var r=new Y;r.parse(t,!1,!0),t=r}for(var e=new Y,a=Object.keys(this),p=0;p<a.length;p++){var c=a[p];e[c]=this[c]}if(e.hash=t.hash,t.href==="")return e.href=e.format(),e;if(t.slashes&&!t.protocol){for(var x=Object.keys(t),o=0;o<x.length;o++){var v=x[o];v!=="protocol"&&(e[v]=t[v])}return ae[e.protocol]&&e.hostname&&!e.pathname&&(e.pathname="/",e.path=e.pathname),e.href=e.format(),e}if(t.protocol&&t.protocol!==e.protocol){if(!ae[t.protocol]){for(var s=Object.keys(t),C=0;C<s.length;C++){var O=s[C];e[O]=t[O]}return e.href=e.format(),e}if(e.protocol=t.protocol,!t.host&&!ge[t.protocol]){for(var l=(t.pathname||"").split("/");l.length&&!(t.host=l.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),l[0]!==""&&l.unshift(""),l.length<2&&l.unshift(""),e.pathname=l.join("/")}else e.pathname=t.pathname;if(e.search=t.search,e.query=t.query,e.host=t.host||"",e.auth=t.auth,e.hostname=t.hostname||t.host,e.port=t.port,e.pathname||e.search){var w=e.pathname||"",m=e.search||"";e.path=w+m}return e.slashes=e.slashes||t.slashes,e.href=e.format(),e}var b=e.pathname&&e.pathname.charAt(0)==="/",d=t.host||t.pathname&&t.pathname.charAt(0)==="/",y=d||b||e.host&&t.pathname,j=y,n=e.pathname&&e.pathname.split("/")||[],l=t.pathname&&t.pathname.split("/")||[],g=e.protocol&&!ae[e.protocol];if(g&&(e.hostname="",e.port=null,e.host&&(n[0]===""?n[0]=e.host:n.unshift(e.host)),e.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(l[0]===""?l[0]=t.host:l.unshift(t.host)),t.host=null),y=y&&(l[0]===""||n[0]==="")),d)e.host=t.host||t.host===""?t.host:e.host,e.hostname=t.hostname||t.hostname===""?t.hostname:e.hostname,e.search=t.search,e.query=t.query,n=l;else if(l.length)n||(n=[]),n.pop(),n=n.concat(l),e.search=t.search,e.query=t.query;else if(t.search!=null){if(g){e.host=n.shift(),e.hostname=e.host;var _=e.host&&e.host.indexOf("@")>0?e.host.split("@"):!1;_&&(e.auth=_.shift(),e.hostname=_.shift(),e.host=e.hostname)}return e.search=t.search,e.query=t.query,(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e}if(!n.length)return e.pathname=null,e.search?e.path="/"+e.search:e.path=null,e.href=e.format(),e;for(var B=n.slice(-1)[0],P=(e.host||t.host||n.length>1)&&(B==="."||B==="..")||B==="",S=0,H=n.length;H>=0;H--)B=n[H],B==="."?n.splice(H,1):B===".."?(n.splice(H,1),S++):S&&(n.splice(H,1),S--);if(!y&&!j)for(;S--;S)n.unshift("..");y&&n[0]!==""&&(!n[0]||n[0].charAt(0)!=="/")&&n.unshift(""),P&&n.join("/").substr(-1)!=="/"&&n.push("");var E=n[0]===""||n[0]&&n[0].charAt(0)==="/";if(g){e.hostname=E?"":n.length?n.shift():"",e.host=e.hostname;var _=e.host&&e.host.indexOf("@")>0?e.host.split("@"):!1;_&&(e.auth=_.shift(),e.hostname=_.shift(),e.host=e.hostname)}return y=y||e.host&&n.length,y&&!E&&n.unshift(""),n.length>0?e.pathname=n.join("/"):(e.pathname=null,e.path=null),(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=t.auth||e.auth,e.slashes=e.slashes||t.slashes,e.href=e.format(),e},Y.prototype.parseHost=function(){var t=this.host,r=_t.exec(t);r&&(r=r[0],r!==":"&&(this.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(this.hostname=t)};var Pt=He,Te={exports:{}};function Ht(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var we={exports:{}};const Tt=Ye(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ee;function ce(){return Ee||(Ee=1,function(t,r){(function(e,a){t.exports=a()})(W,function(){var e=e||function(a,p){var c;if(typeof window<"u"&&window.crypto&&(c=window.crypto),typeof self<"u"&&self.crypto&&(c=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(c=globalThis.crypto),!c&&typeof window<"u"&&window.msCrypto&&(c=window.msCrypto),!c&&typeof W<"u"&&W.crypto&&(c=W.crypto),!c&&typeof Ht=="function")try{c=Tt}catch{}var x=function(){if(c){if(typeof c.getRandomValues=="function")try{return c.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof c.randomBytes=="function")try{return c.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function n(){}return function(l){var g;return n.prototype=l,g=new n,n.prototype=null,g}}(),v={},s=v.lib={},C=s.Base=function(){return{extend:function(n){var l=o(this);return n&&l.mixIn(n),(!l.hasOwnProperty("init")||this.init===l.init)&&(l.init=function(){l.$super.init.apply(this,arguments)}),l.init.prototype=l,l.$super=this,l},create:function(){var n=this.extend();return n.init.apply(n,arguments),n},init:function(){},mixIn:function(n){for(var l in n)n.hasOwnProperty(l)&&(this[l]=n[l]);n.hasOwnProperty("toString")&&(this.toString=n.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),O=s.WordArray=C.extend({init:function(n,l){n=this.words=n||[],l!=p?this.sigBytes=l:this.sigBytes=n.length*4},toString:function(n){return(n||m).stringify(this)},concat:function(n){var l=this.words,g=n.words,_=this.sigBytes,B=n.sigBytes;if(this.clamp(),_%4)for(var P=0;P<B;P++){var S=g[P>>>2]>>>24-P%4*8&255;l[_+P>>>2]|=S<<24-(_+P)%4*8}else for(var H=0;H<B;H+=4)l[_+H>>>2]=g[H>>>2];return this.sigBytes+=B,this},clamp:function(){var n=this.words,l=this.sigBytes;n[l>>>2]&=4294967295<<32-l%4*8,n.length=a.ceil(l/4)},clone:function(){var n=C.clone.call(this);return n.words=this.words.slice(0),n},random:function(n){for(var l=[],g=0;g<n;g+=4)l.push(x());return new O.init(l,n)}}),w=v.enc={},m=w.Hex={stringify:function(n){for(var l=n.words,g=n.sigBytes,_=[],B=0;B<g;B++){var P=l[B>>>2]>>>24-B%4*8&255;_.push((P>>>4).toString(16)),_.push((P&15).toString(16))}return _.join("")},parse:function(n){for(var l=n.length,g=[],_=0;_<l;_+=2)g[_>>>3]|=parseInt(n.substr(_,2),16)<<24-_%8*4;return new O.init(g,l/2)}},b=w.Latin1={stringify:function(n){for(var l=n.words,g=n.sigBytes,_=[],B=0;B<g;B++){var P=l[B>>>2]>>>24-B%4*8&255;_.push(String.fromCharCode(P))}return _.join("")},parse:function(n){for(var l=n.length,g=[],_=0;_<l;_++)g[_>>>2]|=(n.charCodeAt(_)&255)<<24-_%4*8;return new O.init(g,l)}},d=w.Utf8={stringify:function(n){try{return decodeURIComponent(escape(b.stringify(n)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(n){return b.parse(unescape(encodeURIComponent(n)))}},y=s.BufferedBlockAlgorithm=C.extend({reset:function(){this._data=new O.init,this._nDataBytes=0},_append:function(n){typeof n=="string"&&(n=d.parse(n)),this._data.concat(n),this._nDataBytes+=n.sigBytes},_process:function(n){var l,g=this._data,_=g.words,B=g.sigBytes,P=this.blockSize,S=P*4,H=B/S;n?H=a.ceil(H):H=a.max((H|0)-this._minBufferSize,0);var E=H*P,F=a.min(E*4,B);if(E){for(var D=0;D<E;D+=P)this._doProcessBlock(_,D);l=_.splice(0,E),g.sigBytes-=F}return new O.init(l,F)},clone:function(){var n=C.clone.call(this);return n._data=this._data.clone(),n},_minBufferSize:0});s.Hasher=y.extend({cfg:C.extend(),init:function(n){this.cfg=this.cfg.extend(n),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(n){return this._append(n),this._process(),this},finalize:function(n){n&&this._append(n);var l=this._doFinalize();return l},blockSize:16,_createHelper:function(n){return function(l,g){return new n.init(g).finalize(l)}},_createHmacHelper:function(n){return function(l,g){return new j.HMAC.init(n,g).finalize(l)}}});var j=v.algo={};return v}(Math);return e})}(we)),we.exports}var be={exports:{}},Fe;function Et(){return Fe||(Fe=1,function(t,r){(function(e,a){t.exports=a(ce())})(W,function(e){return function(a){var p=e,c=p.lib,x=c.WordArray,o=c.Hasher,v=p.algo,s=[],C=[];(function(){function m(j){for(var n=a.sqrt(j),l=2;l<=n;l++)if(!(j%l))return!1;return!0}function b(j){return(j-(j|0))*4294967296|0}for(var d=2,y=0;y<64;)m(d)&&(y<8&&(s[y]=b(a.pow(d,1/2))),C[y]=b(a.pow(d,1/3)),y++),d++})();var O=[],w=v.SHA256=o.extend({_doReset:function(){this._hash=new x.init(s.slice(0))},_doProcessBlock:function(m,b){for(var d=this._hash.words,y=d[0],j=d[1],n=d[2],l=d[3],g=d[4],_=d[5],B=d[6],P=d[7],S=0;S<64;S++){if(S<16)O[S]=m[b+S]|0;else{var H=O[S-15],E=(H<<25|H>>>7)^(H<<14|H>>>18)^H>>>3,F=O[S-2],D=(F<<15|F>>>17)^(F<<13|F>>>19)^F>>>10;O[S]=E+O[S-7]+D+O[S-16]}var R=g&_^~g&B,z=y&j^y&n^j&n,N=(y<<30|y>>>2)^(y<<19|y>>>13)^(y<<10|y>>>22),M=(g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25),k=P+M+R+C[S]+O[S],ee=N+z;P=B,B=_,_=g,g=l+k|0,l=n,n=j,j=y,y=k+ee|0}d[0]=d[0]+y|0,d[1]=d[1]+j|0,d[2]=d[2]+n|0,d[3]=d[3]+l|0,d[4]=d[4]+g|0,d[5]=d[5]+_|0,d[6]=d[6]+B|0,d[7]=d[7]+P|0},_doFinalize:function(){var m=this._data,b=m.words,d=this._nDataBytes*8,y=m.sigBytes*8;return b[y>>>5]|=128<<24-y%32,b[(y+64>>>9<<4)+14]=a.floor(d/4294967296),b[(y+64>>>9<<4)+15]=d,m.sigBytes=b.length*4,this._process(),this._hash},clone:function(){var m=o.clone.call(this);return m._hash=this._hash.clone(),m}});p.SHA256=o._createHelper(w),p.HmacSHA256=o._createHmacHelper(w)}(Math),e.SHA256})}(be)),be.exports}var _e={exports:{}},Ie;function Ft(){return Ie||(Ie=1,function(t,r){(function(e,a){t.exports=a(ce())})(W,function(e){(function(){var a=e,p=a.lib,c=p.Base,x=a.enc,o=x.Utf8,v=a.algo;v.HMAC=c.extend({init:function(s,C){s=this._hasher=new s.init,typeof C=="string"&&(C=o.parse(C));var O=s.blockSize,w=O*4;C.sigBytes>w&&(C=s.finalize(C)),C.clamp();for(var m=this._oKey=C.clone(),b=this._iKey=C.clone(),d=m.words,y=b.words,j=0;j<O;j++)d[j]^=1549556828,y[j]^=909522486;m.sigBytes=b.sigBytes=w,this.reset()},reset:function(){var s=this._hasher;s.reset(),s.update(this._iKey)},update:function(s){return this._hasher.update(s),this},finalize:function(s){var C=this._hasher,O=C.finalize(s);C.reset();var w=C.finalize(this._oKey.clone().concat(O));return w}})})()})}(_e)),_e.exports}(function(t,r){(function(e,a,p){t.exports=a(ce(),Et(),Ft())})(W,function(e){return e.HmacSHA256})})(Te);var It=Te.exports;const qt=he(It);var qe={exports:{}};(function(t,r){(function(e,a){t.exports=a(ce())})(W,function(e){return function(){var a=e,p=a.lib,c=p.WordArray,x=a.enc;x.Base64={stringify:function(v){var s=v.words,C=v.sigBytes,O=this._map;v.clamp();for(var w=[],m=0;m<C;m+=3)for(var b=s[m>>>2]>>>24-m%4*8&255,d=s[m+1>>>2]>>>24-(m+1)%4*8&255,y=s[m+2>>>2]>>>24-(m+2)%4*8&255,j=b<<16|d<<8|y,n=0;n<4&&m+n*.75<C;n++)w.push(O.charAt(j>>>6*(3-n)&63));var l=O.charAt(64);if(l)for(;w.length%4;)w.push(l);return w.join("")},parse:function(v){var s=v.length,C=this._map,O=this._reverseMap;if(!O){O=this._reverseMap=[];for(var w=0;w<C.length;w++)O[C.charCodeAt(w)]=w}var m=C.charAt(64);if(m){var b=v.indexOf(m);b!==-1&&(s=b)}return o(v,s,O)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function o(v,s,C){for(var O=[],w=0,m=0;m<s;m++)if(m%4){var b=C[v.charCodeAt(m-1)]<<m%4*2,d=C[v.charCodeAt(m)]>>>6-m%4*2,y=b|d;O[w>>>2]|=y<<24-w%4*8,w++}return c.create(O,w)}}(),e.enc.Base64})})(qe);var $t=qe.exports;const $e=he($t);var De={exports:{}};(function(t,r){(function(e,a){t.exports=a(ce())})(W,function(e){return function(a){var p=e,c=p.lib,x=c.WordArray,o=c.Hasher,v=p.algo,s=[];(function(){for(var d=0;d<64;d++)s[d]=a.abs(a.sin(d+1))*4294967296|0})();var C=v.MD5=o.extend({_doReset:function(){this._hash=new x.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(d,y){for(var j=0;j<16;j++){var n=y+j,l=d[n];d[n]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360}var g=this._hash.words,_=d[y+0],B=d[y+1],P=d[y+2],S=d[y+3],H=d[y+4],E=d[y+5],F=d[y+6],D=d[y+7],R=d[y+8],z=d[y+9],N=d[y+10],M=d[y+11],k=d[y+12],ee=d[y+13],se=d[y+14],A=d[y+15],i=g[0],f=g[1],h=g[2],u=g[3];i=O(i,f,h,u,_,7,s[0]),u=O(u,i,f,h,B,12,s[1]),h=O(h,u,i,f,P,17,s[2]),f=O(f,h,u,i,S,22,s[3]),i=O(i,f,h,u,H,7,s[4]),u=O(u,i,f,h,E,12,s[5]),h=O(h,u,i,f,F,17,s[6]),f=O(f,h,u,i,D,22,s[7]),i=O(i,f,h,u,R,7,s[8]),u=O(u,i,f,h,z,12,s[9]),h=O(h,u,i,f,N,17,s[10]),f=O(f,h,u,i,M,22,s[11]),i=O(i,f,h,u,k,7,s[12]),u=O(u,i,f,h,ee,12,s[13]),h=O(h,u,i,f,se,17,s[14]),f=O(f,h,u,i,A,22,s[15]),i=w(i,f,h,u,B,5,s[16]),u=w(u,i,f,h,F,9,s[17]),h=w(h,u,i,f,M,14,s[18]),f=w(f,h,u,i,_,20,s[19]),i=w(i,f,h,u,E,5,s[20]),u=w(u,i,f,h,N,9,s[21]),h=w(h,u,i,f,A,14,s[22]),f=w(f,h,u,i,H,20,s[23]),i=w(i,f,h,u,z,5,s[24]),u=w(u,i,f,h,se,9,s[25]),h=w(h,u,i,f,S,14,s[26]),f=w(f,h,u,i,R,20,s[27]),i=w(i,f,h,u,ee,5,s[28]),u=w(u,i,f,h,P,9,s[29]),h=w(h,u,i,f,D,14,s[30]),f=w(f,h,u,i,k,20,s[31]),i=m(i,f,h,u,E,4,s[32]),u=m(u,i,f,h,R,11,s[33]),h=m(h,u,i,f,M,16,s[34]),f=m(f,h,u,i,se,23,s[35]),i=m(i,f,h,u,B,4,s[36]),u=m(u,i,f,h,H,11,s[37]),h=m(h,u,i,f,D,16,s[38]),f=m(f,h,u,i,N,23,s[39]),i=m(i,f,h,u,ee,4,s[40]),u=m(u,i,f,h,_,11,s[41]),h=m(h,u,i,f,S,16,s[42]),f=m(f,h,u,i,F,23,s[43]),i=m(i,f,h,u,z,4,s[44]),u=m(u,i,f,h,k,11,s[45]),h=m(h,u,i,f,A,16,s[46]),f=m(f,h,u,i,P,23,s[47]),i=b(i,f,h,u,_,6,s[48]),u=b(u,i,f,h,D,10,s[49]),h=b(h,u,i,f,se,15,s[50]),f=b(f,h,u,i,E,21,s[51]),i=b(i,f,h,u,k,6,s[52]),u=b(u,i,f,h,S,10,s[53]),h=b(h,u,i,f,N,15,s[54]),f=b(f,h,u,i,B,21,s[55]),i=b(i,f,h,u,R,6,s[56]),u=b(u,i,f,h,A,10,s[57]),h=b(h,u,i,f,F,15,s[58]),f=b(f,h,u,i,ee,21,s[59]),i=b(i,f,h,u,H,6,s[60]),u=b(u,i,f,h,M,10,s[61]),h=b(h,u,i,f,P,15,s[62]),f=b(f,h,u,i,z,21,s[63]),g[0]=g[0]+i|0,g[1]=g[1]+f|0,g[2]=g[2]+h|0,g[3]=g[3]+u|0},_doFinalize:function(){var d=this._data,y=d.words,j=this._nDataBytes*8,n=d.sigBytes*8;y[n>>>5]|=128<<24-n%32;var l=a.floor(j/4294967296),g=j;y[(n+64>>>9<<4)+15]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,y[(n+64>>>9<<4)+14]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,d.sigBytes=(y.length+1)*4,this._process();for(var _=this._hash,B=_.words,P=0;P<4;P++){var S=B[P];B[P]=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360}return _},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});function O(d,y,j,n,l,g,_){var B=d+(y&j|~y&n)+l+_;return(B<<g|B>>>32-g)+y}function w(d,y,j,n,l,g,_){var B=d+(y&n|j&~n)+l+_;return(B<<g|B>>>32-g)+y}function m(d,y,j,n,l,g,_){var B=d+(y^j^n)+l+_;return(B<<g|B>>>32-g)+y}function b(d,y,j,n,l,g,_){var B=d+(j^(y|~n))+l+_;return(B<<g|B>>>32-g)+y}p.MD5=o._createHelper(C),p.HmacMD5=o._createHmacHelper(C)}(Math),e.MD5})})(De);var Dt=De.exports;const Lt=he(Dt),Le={sign:(t,r)=>$e.stringify(qt(t,r)),md5Content:t=>T.isEmpty(t)?"":$e.stringify(Lt(t))},Rt=t=>{const r=T.sortBy(Object.keys(t));let e={};return T.map(r,a=>{T.isEmpty(t[a])?e[a]=null:T.isArray(t[a])?e[a]=t[a][0]:e[a]=t[a]}),e},Mt={map:T.map,keys:T.keys,compact:T.compact,sortBy:T.sortBy,forEach:T.forEach},zt=t=>{let r=t,e=T.mapValues(Mt,p=>(...c)=>(r=p(r,...c),a));const a=Object.assign(e,{value:()=>r});return a},Re=t=>{const r=["X-Gw-Signature","X-Gw-Signature-headers","Accept","Content-MD5","Content-Type","Date"];let e="",a="",p=!0;return zt(t).keys(t).map(c=>!T.includes(r,c)&&{value:t[c],key:T.toLower(c)}).compact().sortBy(c=>c.key).forEach(c=>{e+=`${c.key}:${c.value}
3
+ `,p?a+=c.key:a+=","+c.key,p=!1}),{transformHeader:e,transformHeaderKeys:a}},Nt="application/x-www-form-urlencoded",Ut=(t,{appkey:r,appsecret:e,originQuery:a})=>{try{if(r&&e){const{method:p,url:c}=t;let x=a?Ze(c,a):c,o=T.get(t,"headers")||T.get(t,"header");const{Accept:v}=o,s=Pt(x,!0),C=s.query;let O="",w=C;if(o["Content-Type"]||(o["Content-Type"]="application/json"),o.Accept||(o.Accept="*/*"),t.body&&o["Content-Type"].indexOf(Nt)===-1)O=Le.md5Content(t.body),o["Content-MD5"]=O;else{let y=t.body;if(T.isString(y)){const j=gt(y);T.isEmpty(w)?w=j:w=Object.assign({},w,j)}}const m=Ve(s.pathname,Xe(Rt(w))),b=o["Content-Type"]?o["Content-Type"]:"";o["X-Gw-Key"]=r,o["X-Gw-Timestamp"]=T.toString(T.now()),o["X-Gw-Nonce"]=T.toString(T.random(1e12,9999999999999));const d=`${p}
4
4
  ${v||"*/*"}
5
5
  ${O}
6
6
  ${b}
7
7
 
8
- ${Re(o).transformHeader}${decodeURIComponent(m)}`;return console.log("==============",m,"======================"),console.log(d),console.log("==============",m,"======================"),o["X-Gw-Signature"]=Le.sign(d,e),o["X-Gw-Signature-Headers"]=Re(o).transformHeaderKeys,t}else console.warn("检查appkey和appsecret")}catch(p){console.log("error",p)}},Ut=t=>{Oe.interceptors.request.use(r=>(r.method=r.method.toUpperCase(),Nt(r,t),r),r=>(console.log(r),Promise.reject(r)))};class Wt{constructor(r){this.config=r,this.env=We,this.js=Ge[this.env.code],this.userInfo=null;const{gc_rsa:e}=r;console.log("网关配置:",e),e&&Ut(e)}async init(){try{const r=await this.js.login(this.config),{userInfo:e}=r;this.userInfo=e}catch(r){console.log(r)}}}async function kt(t){const r=new Wt(t);return await r.init(),r}return kt});
8
+ ${Re(o).transformHeader}${decodeURIComponent(m)}`;return console.log("==============",m,"======================"),console.log(d),console.log("==============",m,"======================"),o["X-Gw-Signature"]=Le.sign(d,e),o["X-Gw-Signature-Headers"]=Re(o).transformHeaderKeys,t}else console.warn("检查appkey和appsecret")}catch(p){console.log("error",p)}},Wt=t=>{Oe.interceptors.request.use(r=>(r.method=r.method.toUpperCase(),Ut(r,t),r),r=>(console.log(r),Promise.reject(r)))};class kt{constructor(r){this.config=r,this.env=ke,this.js=Qe[this.env.code],this.userInfo=null;const{gc_rsa:e}=r;console.log("网关配置:",e),e&&Wt(e)}async init(){try{const r=await this.js.login(this.config),{userInfo:e}=r;this.userInfo=e}catch(r){console.log(r)}}}async function Kt(t){const r=new kt(t);return await r.init(),r}G.dd=ie,G.default=Kt,Object.defineProperties(G,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gc_mobile",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "example",
package/src/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import env from "./lib/env";
2
2
  import modules from "./modules";
3
3
  // import signature from "gc_rsa/src/lib/signature";
4
+ import * as dd from "dingtalk-jsapi";
5
+
4
6
  import axiosConfig from "./lib/axiosConfig";
5
7
  class Mobile {
6
8
  constructor(config) {
@@ -25,6 +27,7 @@ class Mobile {
25
27
  }
26
28
  }
27
29
  }
30
+ export { dd };
28
31
  export default async function (config) {
29
32
  const mobile = new Mobile(config);
30
33
  await mobile.init();