openx-js-sdk 0.0.15 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/app.js +2 -2
- package/app.js.gz +0 -0
- package/package.json +1 -1
- package/tracker/index.d.ts +2 -2
package/README.md
CHANGED
package/app.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openxAxios",[],t):"object"==typeof exports?exports.openxAxios=t():e.openxAxios=t()}(this,(()=>(()=>{var e={65:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new(function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t="queue"),this.key=t,this.maxSize=e;var n=localStorage.getItem(this.key);this.queue=n?new Map(this.parseQueue(n)):new Map}return e.prototype.setValue=function(e,t){if(this.size()>=this.maxSize){var n=this.queue.keys().next().value;this.queue.delete(n)}this.queue.set(e,t),this.saveToLocalStorage()},e.prototype.isEmpty=function(){return 0===this.queue.size},e.prototype.size=function(){return this.queue.size},e.prototype.clear=function(){this.queue.clear(),this.saveToLocalStorage()},e.prototype.getValue=function(e){return this.queue.get(e)},e.prototype.saveToLocalStorage=function(){var e=Array.from(this.queue);localStorage.setItem(this.key,JSON.stringify(e))},e.prototype.parseQueue=function(e){try{var t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return console.error("Failed to parse queue from localStorage:",e),[]}},e}());t.default=n},365:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={"/proxy-sdk-jwt":{open:!1,ws:!1,target:"https://gateway.cnki.net/coreapi/api",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-jwt":"/"}},"/proxy-sdk-ip":{open:!1,ws:!1,target:"https://x.cnki.net/ip",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-ip":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}}}},384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeCookie=t.setCookie=t.getCookie=void 0;t.getCookie=function(e){var t=new RegExp("(^| )"+e+"=([^;]*)(;|$)"),n=document.cookie.match(t);return n?decodeURIComponent(n[2]):null};var n=function(e,t,n,r){var o="";if(n&&0!==n){var i=new Date;i.setTime(i.getTime()+1e3*n),o="; expires=".concat(i.toUTCString())}document.cookie="".concat(e,"=").concat(t).concat(o,"; path=/; domain=").concat(r||"")};t.setCookie=n;t.removeCookie=function(e){n(e,"",-1),n(e,"",-1,"cnki.net")}},471:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRefreshToken=t.postAction=t.getAction=void 0;var l=u(n(637)),f=n(537),d=s(n(935));Object.defineProperty(t,"getRefreshToken",{enumerable:!0,get:function(){return d.getRefreshToken}});var p=n(776),h=s(n(489)),y=n(747),m=!1,g=!1,b=l.default.create({timeout:5e3,withCredentials:h.default.getOptions().withCredentials});b.interceptors.request.use((function(e){var t=(0,f.getJwt)((0,h.getJwtKey)());return t&&e.headers&&(e.headers.Authorization="Bearer ".concat(t)),e}),(function(e){return console.error("请求错误:",e),Promise.reject(e)})),b.interceptors.response.use((function(e){return a(void 0,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,l,p,w,v;return c(this,(function(c){switch(c.label){case 0:return t=h.default.getOptions(),n=(0,y.getEnv)(),m?[2,Promise.resolve({data:{message:"请求已被全局阻断!"}})]:"function"!=typeof(r=null==t?void 0:t.response)?[3,2]:[4,r(e)];case 1:if(void 0!==(o=c.sent()))return[2,o];c.label=2;case 2:if(i=(null===(p=e.data)||void 0===p?void 0:p.code)||(null===(w=e.data)||void 0===w?void 0:w.Code)||(null===(v=e.data)||void 0===v?void 0:v.errcode)||200,[5014,5007].includes(i))return[2,Promise.resolve(e)];if(![5013,5016].includes(i))return[3,6];(0,f.removeJwt)((0,h.getJwtKey)()),c.label=3;case 3:return c.trys.push([3,5,,6]),[4,(0,d.default)(b,e)];case 4:return c.sent(),[3,6];case 5:return s=c.sent(),[2,Promise.resolve({data:s})];case 6:return 429001===i&&(null==t?void 0:t.verifyRealName)&&"development"!==n&&(g||(g=!0,m=!0,a=encodeURIComponent(window.location.href),u=encodeURIComponent("platform=yxpt&returnUrl=".concat(a)),l=["test","development"].includes(n)?"https://xfat.cnki.net":"https://ix.cnki.net",["test","production"].includes(n)&&(window.location.href="".concat(l,"/psmc/user/returnUrl?code=").concat(i,"¶s=").concat(u,"&buries=true")))),[2,Promise.resolve(e)]}}))}))}),(function(e){return a(void 0,void 0,void 0,(function(){var t,n,r;return c(this,(function(o){switch(o.label){case 0:return 401!==e.status?[3,2]:(n=(t=Promise).resolve,[4,(0,d.default)(b,e)]);case 1:return[2,n.apply(t,[o.sent()])];case 2:return(null===(r=e.message)||void 0===r?void 0:r.includes("timeout"))&&console.error("请求超时,请检查网络连接"),[2,Promise.reject(e)]}}))}))}));var w=function(e,t,n,r){void 0===n&&(n={});var o=r||{};if(o.method=e,o.url=(0,p.getBaseUrl)(t),"get"===e.toLowerCase())o.params=n;else o.data=n;return b(o).then((function(e){return e.data}))};t.getAction=function(e,t,n){return w("get",e,t,n)};t.postAction=function(e,t,n){return w("post",e,t,n)}},489:function(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getJwtKey=t.store=void 0;var r=function(){function e(){this.options={appId:"",env:"development",proxy:"",timeout:5e3,verifyRealName:!0,withCredentials:!0,tracker:!1,overrideTrackerAppId:!1,response:function(){}}}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.config=function(e){this.options=n(n({},this.options),e)},e.prototype.getOptions=function(){return n({},this.options)},e.prototype.getJwtKey=function(){return this.options.appId},e.prototype.setResponseHandler=function(e){this.options.response=e},e}();t.store=r.getInstance();t.getJwtKey=function(){return t.store.getJwtKey()},t.default=t.store},537:e=>{var t;self,t=()=>(()=>{"use strict";var e={};return{60:function(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.removeAllJwt=t.removeJwt=t.getJwt=t.addJwt=t.initJwtManager=t.getURLParams=void 0;var s=function(e){var t=new RegExp("(^| )"+e+"=([^;]*)(;|$)"),n=document.cookie.match(t);return n?decodeURIComponent(n[2]):null};t.getURLParams=function(e){var t,n,i=new URLSearchParams(window.location.search),s={};try{for(var a=r(i.entries()),c=a.next();!c.done;c=a.next()){var u=o(c.value,2),l=u[0],f=u[1];s[l]=f}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return e?s[e]:s};var a=function(){function e(e){this.STORAGE_KEY=(null==e?void 0:e.storageKey)||"X_JWT_LIST",this.MAX_COUNT=(null==e?void 0:e.maxCount)||20,this.POP_DELETE_COUNT=(null==e?void 0:e.popDeleteCount)||5}return e.prototype.addJwt=function(e,r,o){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");if(!r||""===r.trim())throw new Error("JWT token cannot be empty");if(!o||isNaN(o)||o<=0)throw new Error("expiresIn must be a valid positive number");var i=Date.now(),a=this.getJwtList(),c=a.findIndex((function(t){return t.name===e})),u={name:e,expireIn:i+1e3*(o-300),createdAt:i,jwtToken:r,source:s("LID")||(0,t.getURLParams)("LID")||""};c>=0?a[c]=n(n({},a[c]),u):(a.length>=this.MAX_COUNT&&a.splice(0,this.POP_DELETE_COUNT),a.push(u)),this.saveJWTList(a)},e.prototype.getJwt=function(e){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");var n=this.getJwtList().find((function(t){return t.name===e})),r=s("LID")||(0,t.getURLParams)("LID")||"";if(n&&n.source){if(!r)return this.removeAllJwt(),null;if(n.source!==r)return null}return n?n.jwtToken:null},e.prototype.removeJwt=function(e){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");var t=this.getJwtList().filter((function(t){return t.name!==e}));this.saveJWTList(t)},e.prototype.removeAllJwt=function(){localStorage.removeItem(this.STORAGE_KEY)},e.prototype.saveJWTList=function(e){localStorage.setItem(this.STORAGE_KEY,JSON.stringify(e))},e.prototype.removeExpired=function(e){var t=Date.now(),n=e.filter((function(e){return e.expireIn>t}));return this.saveJWTList(n),n},e.prototype.getJwtList=function(){var e=localStorage.getItem(this.STORAGE_KEY);if(!e)return[];try{var t=JSON.parse(e);return this.removeExpired(Array.isArray(t)?t:[])}catch(e){return console.warn("[XJwtManager] getJwtList JSON parse error:",e),[]}},e}(),c=new a;t.initJwtManager=function(e){c=new a(e)},t.addJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.addJwt.apply(c,i([],o(e),!1))},t.getJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.getJwt.apply(c,i([],o(e),!1))},t.removeJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.removeJwt.apply(c,i([],o(e),!1))},t.removeAllJwt=function(){return c.removeAllJwt()},t.default={addJwt:t.addJwt,getJwt:t.getJwt,removeJwt:t.removeJwt,removeAllJwt:t.removeAllJwt,initJwtManager:t.initJwtManager}}}[60].call(e,0,e),e.default})(),e.exports=t()},551:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tracker=function(){var e=a.default.getOptions();if(window.OPENX__STA_INIT__)return;if(window.OPENX__STA_INIT__=!0,"development"===e.env)return void(window.sta_api={toTrack:function(){}});h=function(t){return o(this,void 0,void 0,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:if(d.length>=p&&(d.shift(),console.warn("[STA] track queue overflow, dropping oldest event.")),d.push(t),u&&y)return g(e),[2];if(l)return[3,5];l=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,m()];case 2:return i.sent(),(n=window.sta_api)&&"function"==typeof n.toTrack&&n.toTrack!==h?(y=n.toTrack,n.toTrack=function(t){var n=r(r({},t),{app_id:e.overrideTrackerAppId?e.appId:t.app_id});return y(n)}):console.warn("[STA] real tracker not found after script load, events may be dropped."),g(e),[3,5];case 3:return o=i.sent(),console.error("[STA] failed to load STA script:",o),[3,5];case 4:return l=!1,[7];case 5:return[2]}}))}))},window.sta_api={toTrack:function(e){if(h)return h(e);console.warn("[STA] proxyToTrack is not ready, event ignored.")}}};var a=s(n(489)),c="https://piccachex.cnki.net/sta_api/v1/scripts/sensors.min.js?v=20220425",u=!1,l=!1,f=null,d=[],p=1e3,h=null,y=null;function m(){return u?Promise.resolve():f||(f=new Promise((function(e,t){if(document.querySelector('script[src="'.concat(c,'"]')))u=!0,e();else{var n=document.createElement("script");n.src=c,n.async=!1,n.onload=function(){u=!0,e()},n.onerror=function(e){console.error("[STA] script load failed:",e),f=null,l=!1,t(e)},document.head.appendChild(n)}})))}function g(e){if(y)for(;d.length;){var t=d.shift();y(r(r({},t),{app_id:e.appId}))}else d.length&&(console.warn("[STA] flushQueue: real tracker not ready, dropping events:",d.length),d.length=0)}},598:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={"/proxy-sdk-jwt":{open:!1,ws:!1,target:"https://xtest.cnki.net/coreapi/api",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-jwt":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}},"/proxy-sdk-ip":{open:!1,ws:!1,target:"https://xtest.cnki.net/ip",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-ip":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}}}},637:(e,t,n)=>{"use strict";
|
|
2
|
-
/*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors */function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:s,toStringTag:a}=Symbol,c=(u=Object.create(null),e=>{const t=o.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const l=e=>(e=e.toLowerCase(),t=>c(t)===e),f=e=>t=>typeof t===e,{isArray:d}=Array,p=f("undefined");function h(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y=l("ArrayBuffer");const m=f("string"),g=f("function"),b=f("number"),w=e=>null!==e&&"object"==typeof e,v=e=>{if("object"!==c(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||a in e||s in e)},O=l("Date"),E=l("File"),_=l("Blob"),S=l("FileList"),T=l("URLSearchParams"),[R,x,k,j]=["ReadableStream","Request","Response","Headers"].map(l);function A(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(h(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function P(e,t){if(h(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,U=e=>!p(e)&&e!==C;const N=(L="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>L&&e instanceof L);var L;const I=l("HTMLFormElement"),J=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),D=l("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)};const B=l("AsyncFunction"),M=(q="function"==typeof setImmediate,z=g(C.postMessage),q?setImmediate:z?(K=`axios@${Math.random()}`,W=[],C.addEventListener("message",(({source:e,data:t})=>{e===C&&t===K&&W.length&&W.shift()()}),!1),e=>{W.push(e),C.postMessage(K,"*")}):e=>setTimeout(e));var q,z,K,W;const H="undefined"!=typeof queueMicrotask?queueMicrotask.bind(C):"undefined"!=typeof process&&process.nextTick||M;var V={isArray:d,isArrayBuffer:y,isBuffer:h,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=c(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:m,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:v,isEmptyObject:e=>{if(!w(e)||h(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:R,isRequest:x,isResponse:k,isHeaders:j,isUndefined:p,isDate:O,isFile:E,isBlob:_,isRegExp:D,isFunction:g,isStream:e=>w(e)&&g(e.pipe),isURLSearchParams:T,isTypedArray:N,isFileList:S,forEach:A,merge:function e(){const{caseless:t,skipUndefined:n}=U(this)&&this||{},r={},o=(o,i)=>{const s=t&&P(r,i)||i;v(r[s])&&v(o)?r[s]=e(r[s],o):v(o)?r[s]=e({},o):d(o)?r[s]=o.slice():n&&p(o)||(r[s]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&A(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:o}={})=>(A(t,((t,o)=>{n&&g(t)?e[o]=r(t,n):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!b(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[s]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:I,hasOwnProperty:J,hasOwnProp:J,reduceDescriptors:F,freezeMethods:e=>{F(e,((t,n)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];g(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:P,global:C,isContextDefined:U,isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[a]&&e[s])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(h(e))return e;if(!("toJSON"in e)){t[r]=e;const o=d(e)?[]:{};return A(e,((e,t)=>{const i=n(e,r+1);!p(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:B,isThenable:e=>e&&(w(e)||g(e))&&g(e.then)&&g(e.catch),setImmediate:M,asap:H,isIterable:e=>null!=e&&g(e[s])};function G(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}V.inherits(G,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:V.toJSONObject(this.config),code:this.code,status:this.status}}});const X=G.prototype,$={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{$[e]={value:e}})),Object.defineProperties(G,$),Object.defineProperty(X,"isAxiosError",{value:!0}),G.from=(e,t,n,r,o,i)=>{const s=Object.create(X);V.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e));const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return G.call(s,a,c,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};function Q(e){return V.isPlainObject(e)||V.isArray(e)}function Y(e){return V.endsWith(e,"[]")?e.slice(0,-2):e}function Z(e,t,n){return e?e.concat(t).map((function(e,t){return e=Y(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ee=V.toFlatObject(V,{},null,(function(e){return/^is[A-Z]/.test(e)}));function te(e,t,n){if(!V.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=V.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!V.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&V.isSpecCompliantForm(t);if(!V.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(V.isDate(e))return e.toISOString();if(V.isBoolean(e))return e.toString();if(!a&&V.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(e)||V.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(V.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(V.isArray(e)&&function(e){return V.isArray(e)&&!e.some(Q)}(e)||(V.isFileList(e)||V.endsWith(n,"[]"))&&(a=V.toArray(e)))return n=Y(n),a.forEach((function(e,r){!V.isUndefined(e)&&null!==e&&t.append(!0===s?Z([n],r,i):null===s?n:n+"[]",c(e))})),!1;return!!Q(e)||(t.append(Z(o,n,i),c(e)),!1)}const l=[],f=Object.assign(ee,{defaultVisitor:u,convertValue:c,isVisitable:Q});if(!V.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!V.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),V.forEach(n,(function(n,i){!0===(!(V.isUndefined(n)||null===n)&&o.call(t,n,V.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])})),l.pop()}}(e),t}function ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function re(e,t){this._pairs=[],e&&te(e,this,t)}const oe=re.prototype;function ie(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function se(e,t,n){if(!t)return e;const r=n&&n.encode||ie;V.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):V.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,ne)}:ne;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ae=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){V.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ue={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:re,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const le="undefined"!=typeof window&&"undefined"!=typeof document,fe="object"==typeof navigator&&navigator||void 0,de=le&&(!fe||["ReactNative","NativeScript","NS"].indexOf(fe.product)<0),pe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,he=le&&window.location.href||"http://localhost";var ye={...Object.freeze({__proto__:null,hasBrowserEnv:le,hasStandardBrowserWebWorkerEnv:pe,hasStandardBrowserEnv:de,navigator:fe,origin:he}),...ue};function me(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&V.isArray(r)?r.length:i,a)return V.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&V.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&V.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s}if(V.isFormData(e)&&V.isFunction(e.entries)){const n={};return V.forEachEntry(e,((e,r)=>{t(function(e){return V.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ge={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=V.isObject(e);o&&V.isHTMLForm(e)&&(e=new FormData(e));if(V.isFormData(e))return r?JSON.stringify(me(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new ye.classes.URLSearchParams,{visitor:function(e,t,n,r){return ye.isNode&&V.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=V.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(V.isString(e))try{return(t||JSON.parse)(e),V.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ge.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw G.from(e,G.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],(e=>{ge.headers[e]={}}));var be=ge;const we=V.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ve=Symbol("internals");function Oe(e){return e&&String(e).trim().toLowerCase()}function Ee(e){return!1===e||null==e?e:V.isArray(e)?e.map(Ee):String(e)}function _e(e,t,n,r,o){return V.isFunction(r)?r.call(this,t,n):(o&&(t=n),V.isString(t)?V.isString(r)?-1!==t.indexOf(r):V.isRegExp(r)?r.test(t):void 0:void 0)}class Se{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Oe(t);if(!o)throw new Error("header name must be a non-empty string");const i=V.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ee(e))}const i=(e,t)=>V.forEach(e,((e,n)=>o(e,n,t)));if(V.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(V.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&we[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(V.isObject(e)&&V.isIterable(e)){let n,r,o={};for(const t of e){if(!V.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?V.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Oe(e)){const n=V.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(V.isFunction(t))return t.call(this,e,n);if(V.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Oe(e)){const n=V.findKey(this,e);return!(!n||void 0===this[n]||t&&!_e(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Oe(e)){const o=V.findKey(n,e);!o||t&&!_e(0,n[o],o,t)||(delete n[o],r=!0)}}return V.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!_e(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return V.forEach(this,((r,o)=>{const i=V.findKey(n,o);if(i)return t[i]=Ee(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=Ee(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return V.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&V.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ve]=this[ve]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Oe(e);t[r]||(!function(e,t){const n=V.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return V.isArray(e)?e.forEach(r):r(e),this}}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(Se.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),V.freezeMethods(Se);var Te=Se;function Re(e,t){const n=this||be,r=t||n,o=Te.from(r.headers);let i=r.data;return V.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function xe(e){return!(!e||!e.__CANCEL__)}function ke(e,t,n){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,n),this.name="CanceledError"}function je(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new G("Request failed with status code "+n.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}V.inherits(ke,G,{__CANCEL__:!0});const Ae=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout((()=>{r=null,s(n)}),i-a)))},()=>n&&s(n)]}((n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),n)},Pe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ce=e=>(...t)=>V.asap((()=>e(...t)));var Ue=ye.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,Ne=ye.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];V.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),V.isString(r)&&s.push("path="+r),V.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Le(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ie=e=>e instanceof Te?{...e}:e;function Je(e,t){t=t||{};const n={};function r(e,t,n,r){return V.isPlainObject(e)&&V.isPlainObject(t)?V.merge.call({caseless:r},e,t):V.isPlainObject(t)?V.merge({},t):V.isArray(t)?t.slice():t}function o(e,t,n,o){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!V.isUndefined(t))return r(void 0,t)}function s(e,t){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(Ie(e),Ie(t),0,!0)};return V.forEach(Object.keys({...e,...t}),(function(r){const i=c[r]||o,s=i(e[r],t[r],r);V.isUndefined(s)&&i!==a||(n[r]=s)})),n}var De=e=>{const t=Je({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=Te.from(s),t.url=se(Le(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),V.isFormData(n))if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(V.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)}))}if(ye.hasStandardBrowserEnv&&(r&&V.isFunction(r)&&(r=r(t)),r||!1!==r&&Ue(t.url))){const e=o&&i&&Ne.read(i);e&&s.set(o,e)}return t};var Fe="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=De(e);let o=r.data;const i=Te.from(r.headers).normalize();let s,a,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let y=new XMLHttpRequest;function m(){if(!y)return;const r=Te.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());je((function(e){t(e),h()}),(function(e){n(e),h()}),{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(n(new G("Request aborted",G.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const r=new G(t&&t.message?t.message:"Network Error",G.ERR_NETWORK,e,y);r.event=t||null,n(r),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ce;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new G(t,o.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&V.forEach(i.toJSON(),(function(e,t){y.setRequestHeader(t,e)})),V.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),f&&"json"!==f&&(y.responseType=r.responseType),p&&([c,l]=Ae(p,!0),y.addEventListener("progress",c)),d&&y.upload&&([a,u]=Ae(d),y.upload.addEventListener("progress",a),y.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(s=t=>{y&&(n(!t||t.type?new ke(null,e,y):t),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===ye.protocols.indexOf(g)?n(new G("Unsupported protocol "+g+":",G.ERR_BAD_REQUEST,e)):y.send(o||null)}))};var Be=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof G?t:new ke(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new G(`timeout ${t} of ms exceeded`,G.ETIMEDOUT))}),t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>V.asap(s),a}};const Me=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},qe=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ze=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of qe(e))yield*Me(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Ke}=V,We=(({Request:e,Response:t})=>({Request:e,Response:t}))(V.global),{ReadableStream:He,TextEncoder:Ve}=V.global,Ge=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Xe=e=>{e=V.merge.call({skipUndefined:!0},We,e);const{fetch:t,Request:n,Response:r}=e,o=t?Ke(t):"function"==typeof fetch,i=Ke(n),s=Ke(r);if(!o)return!1;const a=o&&Ke(He),c=o&&("function"==typeof Ve?(u=new Ve,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&a&&Ge((()=>{let e=!1;const t=new n(ye.origin,{body:new He,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),f=s&&a&&Ge((()=>V.isReadableStream(new r("").body))),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new G(`Response type '${e}' is not supported`,G.ERR_NOT_SUPPORT,n)})}));const p=async(e,t)=>{const r=V.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(V.isBlob(e))return e.size;if(V.isSpecCompliantForm(e)){const t=new n(ye.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return V.isArrayBufferView(e)||V.isArrayBuffer(e)?e.byteLength:(V.isURLSearchParams(e)&&(e+=""),V.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:a,signal:c,cancelToken:u,timeout:h,onDownloadProgress:y,onUploadProgress:m,responseType:g,headers:b,withCredentials:w="same-origin",fetchOptions:v}=De(e),O=t||fetch;g=g?(g+"").toLowerCase():"text";let E=Be([c,u&&u.toAbortSignal()],h),_=null;const S=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let T;try{if(m&&l&&"get"!==s&&"head"!==s&&0!==(T=await p(b,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(V.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=Pe(T,Ae(Ce(m)));a=ze(t.body,65536,e,n)}}V.isString(w)||(w=w?"include":"omit");const t=i&&"credentials"in n.prototype,c={...v,signal:E,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};_=i&&new n(o,c);let u=await(i?O(_,v):O(o,c));const h=f&&("stream"===g||"response"===g);if(f&&(y||h&&S)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=u[t]}));const t=V.toFiniteNumber(u.headers.get("content-length")),[n,o]=y&&Pe(t,Ae(Ce(y),!0))||[];u=new r(ze(u.body,65536,n,(()=>{o&&o(),S&&S()})),e)}g=g||"text";let R=await d[V.findKey(d,g)||"text"](u,e);return!h&&S&&S(),await new Promise(((t,n)=>{je(t,n,{data:R,headers:Te.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:_})}))}catch(t){if(S&&S(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new G("Network Error",G.ERR_NETWORK,e,_),{cause:t.cause||t});throw G.from(t,t&&t.code,e,_)}}},$e=new Map,Qe=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,a,c=i.length,u=$e;for(;c--;)s=i[c],a=u.get(s),void 0===a&&u.set(s,a=c?new Map:Xe(t)),u=a;return a};Qe();const Ye={http:null,xhr:Fe,fetch:{get:Qe}};V.forEach(Ye,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ze=e=>`- ${e}`,et=e=>V.isFunction(e)||null===e||!1===e;var tt=(e,t)=>{e=V.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!et(r)&&(o=Ye[(n=String(r)).toLowerCase()],void 0===o))throw new G(`Unknown adapter '${n}'`);if(o&&(V.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new G("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Ze).join("\n"):" "+Ze(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ke(null,e)}function rt(e){nt(e),e.headers=Te.from(e.headers),e.data=Re.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return tt(e.adapter||be.adapter,e)(e).then((function(t){return nt(e),t.data=Re.call(e,e.transformResponse,t),t.headers=Te.from(t.headers),t}),(function(t){return xe(t)||(nt(e),t&&t.response&&(t.response.data=Re.call(e,e.transformResponse,t.response),t.response.headers=Te.from(t.response.headers))),Promise.reject(t)}))}const ot="1.12.2",it={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{it[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const st={};it.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ot+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new G(r(o," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!st[o]&&(st[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},it.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var at={assertOptions:function(e,t,n){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new G("option "+i+" must be "+n,G.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new G("Unknown option "+i,G.ERR_BAD_OPTION)}},validators:it};const ct=at.validators;class ut{constructor(e){this.defaults=e||{},this.interceptors={request:new ae,response:new ae}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Je(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&at.assertOptions(n,{silentJSONParsing:ct.transitional(ct.boolean),forcedJSONParsing:ct.transitional(ct.boolean),clarifyTimeoutError:ct.transitional(ct.boolean)},!1),null!=r&&(V.isFunction(r)?t.paramsSerializer={serialize:r}:at.assertOptions(r,{encode:ct.function,serialize:ct.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),at.assertOptions(t,{baseUrl:ct.spelling("baseURL"),withXsrfToken:ct.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&V.merge(o.common,o[t.method]);o&&V.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Te.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[rt.bind(this),void 0];for(e.unshift(...s),e.push(...c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=s.length;let d=t;for(;f<l;){const e=s[f++],t=s[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=rt.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return se(Le((e=Je(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}V.forEach(["delete","get","head","options"],(function(e){ut.prototype[e]=function(t,n){return this.request(Je(n||{},{method:e,url:t,data:(n||{}).data}))}})),V.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Je(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ut.prototype[e]=t(),ut.prototype[e+"Form"]=t(!0)}));var lt=ut;class ft{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new ke(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ft((function(t){e=t})),cancel:e}}}var dt=ft;const pt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pt).forEach((([e,t])=>{pt[t]=e}));var ht=pt;const yt=function e(t){const n=new lt(t),o=r(lt.prototype.request,n);return V.extend(o,lt.prototype,n,{allOwnKeys:!0}),V.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Je(t,n))},o}(be);yt.Axios=lt,yt.CanceledError=ke,yt.CancelToken=dt,yt.isCancel=xe,yt.VERSION=ot,yt.toFormData=te,yt.AxiosError=G,yt.Cancel=yt.CanceledError,yt.all=function(e){return Promise.all(e)},yt.spread=function(e){return function(t){return e.apply(null,t)}},yt.isAxiosError=function(e){return V.isObject(e)&&!0===e.isAxiosError},yt.mergeConfig=Je,yt.AxiosHeaders=Te,yt.formToJSON=e=>me(V.isHTMLForm(e)?new FormData(e):e),yt.getAdapter=tt,yt.HttpStatusCode=ht,yt.default=yt,e.exports=yt},747:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getEnv=void 0;var o=r(n(489));t.getEnv=function(){return o.default.getOptions().env}},767:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getUserIp=void 0;var i=n(384),s=n(747),a={getUserIp:{test:"https://xtest.cnki.net/ip/client",development:"/proxy-sdk-ip/client",production:"https://x.cnki.net/ip/client"}};t.getUserIp=function(){return r(void 0,void 0,void 0,(function(){var e,t,n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),(e=(0,i.getCookie)("yxIP"))&&"undefined"!==e&&"null"!==e?[3,3]:[4,fetch(a.getUserIp[(0,s.getEnv)()],{method:"GET",headers:{source:"x.cnki.net"}})];case 1:return[4,r.sent().json()];case 2:return t=r.sent().content,n=(0,s.getEnv)(),(0,i.setCookie)("yxIP","development"===n?"124.193.98.142":t,432e3,"development"===n?"":".cnki.net"),[2,Promise.resolve(t)];case 3:return[2,Promise.resolve(e)];case 4:return r.sent(),[2,Promise.resolve("")];case 5:return[2]}}))}))}},776:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getBaseUrl=void 0;var i=o(n(598)),s=o(n(598)),a=o(n(365)),c=o(n(489)),u=n(747),l={development:i.default,test:s.default,production:a.default};t.getBaseUrl=function(e){var t,n,o=c.default.getOptions(),i=(0,u.getEnv)(),a=o.proxy?r(r({},o.proxy),l[i]):"development"===i?s.default:l[i],f=e;if("development"!==i){var d=null!==(n=null===(t=e.match(/^\/[^/]+/))||void 0===t?void 0:t[0])&&void 0!==n?n:"";Object.keys(a).forEach((function(t){(d===t||e.includes(t))&&(f=f.replace(t,a[t].target))}))}return f}},811:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.localQueueStore=t.removeCookie=t.setCookie=t.getCookie=void 0;var l=s(n(489)),f=n(471),d=n(537),p=u(n(65));t.localQueueStore=p.default;var h=n(767),y=n(551),m=function(){function e(){this.getAction=f.getAction,this.postAction=f.postAction,this.getJwt=function(){return(0,d.getJwt)((0,l.getJwtKey)())},this.removeJwt=function(){return(0,d.removeJwt)((0,l.getJwtKey)())},this.getUserIp=function(){return(0,h.getUserIp)()},this.toTrack=function(){return(0,h.getUserIp)()}}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.config=function(e){return l.default.config(e),this},e.prototype.ready=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,(0,h.getUserIp)()];case 1:return e.sent(),l.default.getOptions().tracker&&(0,y.tracker)(),[4,(0,f.getRefreshToken)()];case 2:return[2,e.sent()]}}))}))},e.instance=null,e}();t.default=m.getInstance();var g=n(384);Object.defineProperty(t,"getCookie",{enumerable:!0,get:function(){return g.getCookie}}),Object.defineProperty(t,"setCookie",{enumerable:!0,get:function(){return g.setCookie}}),Object.defineProperty(t,"removeCookie",{enumerable:!0,get:function(){return g.removeCookie}})},935:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRefreshToken=void 0;var u=n(384),l=n(471),f=n(537),d=s(n(489));t.getRefreshToken=function(){return a(void 0,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,p;return c(this,(function(c){switch(c.label){case 0:if(e=d.default.getOptions(),t=(0,d.getJwtKey)(),!(n=(0,u.getCookie)("LID")))return[2,{code:5014,message:"无法获取 LID,请重新登录"}];if(r=(0,f.getJwt)(t))return[2,{code:0,content:r,message:"JWT 已缓存,无需刷新"}];c.label=1;case 1:return c.trys.push([1,3,,4]),o={AppId:e.appId,ClientId:(0,u.getCookie)("Ecp_ClientId")||"9240617191000011664",ClientIp:(0,u.getCookie)("yxIP"),EcpToken:n},[4,(0,l.postAction)("/proxy-sdk-jwt/JwtToken/ecptoken",o,{withCredentials:!1})];case 2:return(i=c.sent()).Success&&i.Content?(s=i.Content,a=s.JwtToken,p=s.ExpireIn,(0,f.addJwt)(t,a,p),[2,{code:0,content:a,message:"JWT 刷新成功"}]):5014===i.Code?[2,{code:5014,message:i.Message||"Token 刷新失败"}]:[2,{code:-1,message:i.Message||"Token 刷新失败"}];case 3:return[2,{code:500,message:c.sent().message||"Token 刷新异常,请稍后重试"}];case 4:return[2]}}))}))};var p=0,h=!1,y=[];t.default=function(e,n){return a(void 0,void 0,void 0,(function(){var r,o;return c(this,(function(i){switch(i.label){case 0:if(h)return[3,6];if(h=!0,p>=2)return h=!1,[2,Promise.reject("Token 刷新异常,请稍后重试,超出最大重发次数。")];p+=1,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,(0,t.getRefreshToken)()];case 2:if(0!==(r=i.sent()).code)throw r;return y.forEach((function(e){return e()})),y=[],[2,e(n.config)];case 3:return o=i.sent(),[2,Promise.reject(o)];case 4:return h=!1,[7];case 5:return[3,7];case 6:return[2,new Promise((function(t){y.push((function(){t(e(n.config))}))}))];case 7:return[2]}}))}))}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(811)})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openxAxios",[],t):"object"==typeof exports?exports.openxAxios=t():e.openxAxios=t()}(this,(()=>(()=>{var e={65:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new(function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t="queue"),this.key=t,this.maxSize=e;var n=localStorage.getItem(this.key);this.queue=n?new Map(this.parseQueue(n)):new Map}return e.prototype.setValue=function(e,t){if(this.size()>=this.maxSize){var n=this.queue.keys().next().value;this.queue.delete(n)}this.queue.set(e,t),this.saveToLocalStorage()},e.prototype.isEmpty=function(){return 0===this.queue.size},e.prototype.size=function(){return this.queue.size},e.prototype.clear=function(){this.queue.clear(),this.saveToLocalStorage()},e.prototype.getValue=function(e){return this.queue.get(e)},e.prototype.saveToLocalStorage=function(){var e=Array.from(this.queue);localStorage.setItem(this.key,JSON.stringify(e))},e.prototype.parseQueue=function(e){try{var t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return console.error("Failed to parse queue from localStorage:",e),[]}},e}());t.default=n},365:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={"/proxy-sdk-jwt":{open:!1,ws:!1,target:"https://gateway.cnki.net/coreapi/api",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-jwt":"/"}},"/proxy-sdk-ip":{open:!1,ws:!1,target:"https://x.cnki.net/ip",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-ip":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}}}},384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeCookie=t.setCookie=t.getCookie=void 0;t.getCookie=function(e){var t=new RegExp("(^| )"+e+"=([^;]*)(;|$)"),n=document.cookie.match(t);return n?decodeURIComponent(n[2]):null};var n=function(e,t,n,r){var o="";if(n&&0!==n){var i=new Date;i.setTime(i.getTime()+1e3*n),o="; expires=".concat(i.toUTCString())}document.cookie="".concat(e,"=").concat(t).concat(o,"; path=/; domain=").concat(r||"")};t.setCookie=n;t.removeCookie=function(e){n(e,"",-1),n(e,"",-1,"cnki.net")}},471:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRefreshToken=t.postAction=t.getAction=void 0;var l=u(n(637)),f=n(537),p=s(n(935));Object.defineProperty(t,"getRefreshToken",{enumerable:!0,get:function(){return p.getRefreshToken}});var d=n(776),h=s(n(489)),y=n(747),m=!1,g=!1,b=l.default.create({timeout:5e3,withCredentials:h.default.getOptions().withCredentials});b.interceptors.request.use((function(e){var t=(0,f.getJwt)((0,h.getJwtKey)());return t&&e.headers&&(e.headers.Authorization="Bearer ".concat(t)),e}),(function(e){return console.error("请求错误:",e),Promise.reject(e)})),b.interceptors.response.use((function(e){return a(void 0,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,l,d,w,v;return c(this,(function(c){switch(c.label){case 0:return t=h.default.getOptions(),n=(0,y.getEnv)(),m?[2,Promise.resolve({data:{message:"请求已被全局阻断!"}})]:"function"!=typeof(r=null==t?void 0:t.response)?[3,2]:[4,r(e)];case 1:if(void 0!==(o=c.sent()))return[2,o];c.label=2;case 2:if(i=(null===(d=e.data)||void 0===d?void 0:d.code)||(null===(w=e.data)||void 0===w?void 0:w.Code)||(null===(v=e.data)||void 0===v?void 0:v.errcode)||200,[5014,5007].includes(i))return[2,Promise.resolve(e)];if(![5013,5016].includes(i))return[3,6];(0,f.removeJwt)((0,h.getJwtKey)()),c.label=3;case 3:return c.trys.push([3,5,,6]),[4,(0,p.default)(b,e)];case 4:return[2,c.sent()];case 5:return s=c.sent(),[2,Promise.resolve({data:s})];case 6:return 429001===i&&(null==t?void 0:t.verifyRealName)&&"development"!==n&&(g||(g=!0,m=!0,a=encodeURIComponent(window.location.href),u=encodeURIComponent("platform=yxpt&returnUrl=".concat(a)),l=["test","development"].includes(n)?"https://xfat.cnki.net":"https://ix.cnki.net",["test","production"].includes(n)&&(window.location.href="".concat(l,"/psmc/user/returnUrl?code=").concat(i,"¶s=").concat(u,"&buries=true")))),[2,Promise.resolve(e)]}}))}))}),(function(e){return a(void 0,void 0,void 0,(function(){var t,n,r;return c(this,(function(o){switch(o.label){case 0:return 401!==e.status?[3,2]:(n=(t=Promise).resolve,[4,(0,p.default)(b,e)]);case 1:return[2,n.apply(t,[o.sent()])];case 2:return(null===(r=e.message)||void 0===r?void 0:r.includes("timeout"))&&console.error("请求超时,请检查网络连接"),[2,Promise.reject(e)]}}))}))}));var w=function(e,t,n,r){void 0===n&&(n={});var o=r||{};if(o.method=e,o.url=(0,d.getBaseUrl)(t),"get"===e.toLowerCase())o.params=n;else o.data=n;return b(o).then((function(e){return e.data}))};t.getAction=function(e,t,n){return w("get",e,t,n)};t.postAction=function(e,t,n){return w("post",e,t,n)}},489:function(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getJwtKey=t.store=void 0;var r=function(){function e(){this.options={appId:"",env:"development",proxy:"",timeout:5e3,verifyRealName:!0,withCredentials:!0,tracker:!1,overrideTrackerAppId:!1,response:function(){}}}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.config=function(e){this.options=n(n({},this.options),e)},e.prototype.getOptions=function(){return n({},this.options)},e.prototype.getJwtKey=function(){return this.options.appId},e.prototype.setResponseHandler=function(e){this.options.response=e},e}();t.store=r.getInstance();t.getJwtKey=function(){return t.store.getJwtKey()},t.default=t.store},537:e=>{var t;self,t=()=>(()=>{"use strict";var e={};return{60:function(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.removeAllJwt=t.removeJwt=t.getJwt=t.addJwt=t.initJwtManager=t.getURLParams=void 0;var s=function(e){var t=new RegExp("(^| )"+e+"=([^;]*)(;|$)"),n=document.cookie.match(t);return n?decodeURIComponent(n[2]):null};t.getURLParams=function(e){var t,n,i=new URLSearchParams(window.location.search),s={};try{for(var a=r(i.entries()),c=a.next();!c.done;c=a.next()){var u=o(c.value,2),l=u[0],f=u[1];s[l]=f}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return e?s[e]:s};var a=function(){function e(e){this.STORAGE_KEY=(null==e?void 0:e.storageKey)||"X_JWT_LIST",this.MAX_COUNT=(null==e?void 0:e.maxCount)||20,this.POP_DELETE_COUNT=(null==e?void 0:e.popDeleteCount)||5}return e.prototype.addJwt=function(e,r,o){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");if(!r||""===r.trim())throw new Error("JWT token cannot be empty");if(!o||isNaN(o)||o<=0)throw new Error("expiresIn must be a valid positive number");var i=Date.now(),a=this.getJwtList(),c=a.findIndex((function(t){return t.name===e})),u={name:e,expireIn:i+1e3*(o-300),createdAt:i,jwtToken:r,source:s("LID")||(0,t.getURLParams)("LID")||""};c>=0?a[c]=n(n({},a[c]),u):(a.length>=this.MAX_COUNT&&a.splice(0,this.POP_DELETE_COUNT),a.push(u)),this.saveJWTList(a)},e.prototype.getJwt=function(e){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");var n=this.getJwtList().find((function(t){return t.name===e})),r=s("LID")||(0,t.getURLParams)("LID")||"";if(n&&n.source){if(!r)return this.removeAllJwt(),null;if(n.source!==r)return null}return n?n.jwtToken:null},e.prototype.removeJwt=function(e){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");var t=this.getJwtList().filter((function(t){return t.name!==e}));this.saveJWTList(t)},e.prototype.removeAllJwt=function(){localStorage.removeItem(this.STORAGE_KEY)},e.prototype.saveJWTList=function(e){localStorage.setItem(this.STORAGE_KEY,JSON.stringify(e))},e.prototype.removeExpired=function(e){var t=Date.now(),n=e.filter((function(e){return e.expireIn>t}));return this.saveJWTList(n),n},e.prototype.getJwtList=function(){var e=localStorage.getItem(this.STORAGE_KEY);if(!e)return[];try{var t=JSON.parse(e);return this.removeExpired(Array.isArray(t)?t:[])}catch(e){return console.warn("[XJwtManager] getJwtList JSON parse error:",e),[]}},e}(),c=new a;t.initJwtManager=function(e){c=new a(e)},t.addJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.addJwt.apply(c,i([],o(e),!1))},t.getJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.getJwt.apply(c,i([],o(e),!1))},t.removeJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.removeJwt.apply(c,i([],o(e),!1))},t.removeAllJwt=function(){return c.removeAllJwt()},t.default={addJwt:t.addJwt,getJwt:t.getJwt,removeJwt:t.removeJwt,removeAllJwt:t.removeAllJwt,initJwtManager:t.initJwtManager}}}[60].call(e,0,e),e.default})(),e.exports=t()},551:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tracker=function(){var e=a.default.getOptions();if(b(e))return;p=function(t){return o(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:if(u.length>=l&&(u.shift(),console.warn("[STA] trackQueue overflow: oldest dropped.")),u.push(t),f)return g(e),[2];if(y)return[3,5];y=!0,r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,m()];case 2:return r.sent(),b(e),g(e),[3,5];case 3:return n=r.sent(),console.error("[STA] STA load failed:",n),[3,5];case 4:return y=!1,[7];case 5:return[2]}}))}))},window.sta_api={toTrack:function(e){if(p)return p(e);console.warn("[STA] proxyToTrack not ready.")}}};var a=s(n(489)),c="https://piccachex.cnki.net/sta_api/v1/scripts/sensors.min.js?v=20220425",u=[],l=1e3,f=null,p=null,d=null,h=!1,y=!1;function m(){return h?Promise.resolve():d||(d=new Promise((function(e,t){if(!!document.querySelector('script[src="'.concat(c,'"]')))h=!0,e();else{var n=document.createElement("script");n.src=c,n.async=!1,n.onload=function(){h=!0,e()},n.onerror=function(e){console.error("[STA] script load failed:",e),d=null,t(e)},document.head.appendChild(n)}})))}function g(e){if(f)for(;u.length;){var t=u.shift();f(r(r({},t),{app_id:e.overrideTrackerAppId?e.appId:t.app_id}))}}function b(e){var t=window.sta_api;return!(!t||"function"!=typeof t.toTrack)&&(t.__OPENX_PATCHED__?(f=t.toTrack,!0):(f=t.toTrack,t.toTrack=function(t){var n=r(r({},t),{app_id:e.overrideTrackerAppId?e.appId:t.app_id});return f(n)},t.__OPENX_PATCHED__=!0,!0))}},598:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={"/proxy-sdk-jwt":{open:!1,ws:!1,target:"https://xtest.cnki.net/coreapi/api",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-jwt":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}},"/proxy-sdk-ip":{open:!1,ws:!1,target:"https://xtest.cnki.net/ip",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-ip":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}}}},637:(e,t,n)=>{"use strict";
|
|
2
|
+
/*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors */function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:s,toStringTag:a}=Symbol,c=(u=Object.create(null),e=>{const t=o.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const l=e=>(e=e.toLowerCase(),t=>c(t)===e),f=e=>t=>typeof t===e,{isArray:p}=Array,d=f("undefined");function h(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y=l("ArrayBuffer");const m=f("string"),g=f("function"),b=f("number"),w=e=>null!==e&&"object"==typeof e,v=e=>{if("object"!==c(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||a in e||s in e)},O=l("Date"),E=l("File"),_=l("Blob"),S=l("FileList"),T=l("URLSearchParams"),[R,x,k,j]=["ReadableStream","Request","Response","Headers"].map(l);function A(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),p(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(h(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function P(e,t){if(h(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,U=e=>!d(e)&&e!==C;const N=(L="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>L&&e instanceof L);var L;const J=l("HTMLFormElement"),I=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),D=l("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)};const B=l("AsyncFunction"),M=(q="function"==typeof setImmediate,z=g(C.postMessage),q?setImmediate:z?(K=`axios@${Math.random()}`,W=[],C.addEventListener("message",(({source:e,data:t})=>{e===C&&t===K&&W.length&&W.shift()()}),!1),e=>{W.push(e),C.postMessage(K,"*")}):e=>setTimeout(e));var q,z,K,W;const H="undefined"!=typeof queueMicrotask?queueMicrotask.bind(C):"undefined"!=typeof process&&process.nextTick||M;var V={isArray:p,isArrayBuffer:y,isBuffer:h,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=c(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:m,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:v,isEmptyObject:e=>{if(!w(e)||h(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:R,isRequest:x,isResponse:k,isHeaders:j,isUndefined:d,isDate:O,isFile:E,isBlob:_,isRegExp:D,isFunction:g,isStream:e=>w(e)&&g(e.pipe),isURLSearchParams:T,isTypedArray:N,isFileList:S,forEach:A,merge:function e(){const{caseless:t,skipUndefined:n}=U(this)&&this||{},r={},o=(o,i)=>{const s=t&&P(r,i)||i;v(r[s])&&v(o)?r[s]=e(r[s],o):v(o)?r[s]=e({},o):p(o)?r[s]=o.slice():n&&d(o)||(r[s]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&A(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:o}={})=>(A(t,((t,o)=>{n&&g(t)?e[o]=r(t,n):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!b(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[s]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:J,hasOwnProperty:I,hasOwnProp:I,reduceDescriptors:F,freezeMethods:e=>{F(e,((t,n)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];g(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return p(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:P,global:C,isContextDefined:U,isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[a]&&e[s])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(h(e))return e;if(!("toJSON"in e)){t[r]=e;const o=p(e)?[]:{};return A(e,((e,t)=>{const i=n(e,r+1);!d(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:B,isThenable:e=>e&&(w(e)||g(e))&&g(e.then)&&g(e.catch),setImmediate:M,asap:H,isIterable:e=>null!=e&&g(e[s])};function G(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}V.inherits(G,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:V.toJSONObject(this.config),code:this.code,status:this.status}}});const X=G.prototype,$={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{$[e]={value:e}})),Object.defineProperties(G,$),Object.defineProperty(X,"isAxiosError",{value:!0}),G.from=(e,t,n,r,o,i)=>{const s=Object.create(X);V.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e));const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return G.call(s,a,c,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};function Q(e){return V.isPlainObject(e)||V.isArray(e)}function Y(e){return V.endsWith(e,"[]")?e.slice(0,-2):e}function Z(e,t,n){return e?e.concat(t).map((function(e,t){return e=Y(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ee=V.toFlatObject(V,{},null,(function(e){return/^is[A-Z]/.test(e)}));function te(e,t,n){if(!V.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=V.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!V.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&V.isSpecCompliantForm(t);if(!V.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(V.isDate(e))return e.toISOString();if(V.isBoolean(e))return e.toString();if(!a&&V.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(e)||V.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(V.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(V.isArray(e)&&function(e){return V.isArray(e)&&!e.some(Q)}(e)||(V.isFileList(e)||V.endsWith(n,"[]"))&&(a=V.toArray(e)))return n=Y(n),a.forEach((function(e,r){!V.isUndefined(e)&&null!==e&&t.append(!0===s?Z([n],r,i):null===s?n:n+"[]",c(e))})),!1;return!!Q(e)||(t.append(Z(o,n,i),c(e)),!1)}const l=[],f=Object.assign(ee,{defaultVisitor:u,convertValue:c,isVisitable:Q});if(!V.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!V.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),V.forEach(n,(function(n,i){!0===(!(V.isUndefined(n)||null===n)&&o.call(t,n,V.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])})),l.pop()}}(e),t}function ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function re(e,t){this._pairs=[],e&&te(e,this,t)}const oe=re.prototype;function ie(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function se(e,t,n){if(!t)return e;const r=n&&n.encode||ie;V.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):V.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,ne)}:ne;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ae=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){V.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ue={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:re,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const le="undefined"!=typeof window&&"undefined"!=typeof document,fe="object"==typeof navigator&&navigator||void 0,pe=le&&(!fe||["ReactNative","NativeScript","NS"].indexOf(fe.product)<0),de="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,he=le&&window.location.href||"http://localhost";var ye={...Object.freeze({__proto__:null,hasBrowserEnv:le,hasStandardBrowserWebWorkerEnv:de,hasStandardBrowserEnv:pe,navigator:fe,origin:he}),...ue};function me(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&V.isArray(r)?r.length:i,a)return V.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&V.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&V.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s}if(V.isFormData(e)&&V.isFunction(e.entries)){const n={};return V.forEachEntry(e,((e,r)=>{t(function(e){return V.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ge={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=V.isObject(e);o&&V.isHTMLForm(e)&&(e=new FormData(e));if(V.isFormData(e))return r?JSON.stringify(me(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new ye.classes.URLSearchParams,{visitor:function(e,t,n,r){return ye.isNode&&V.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=V.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(V.isString(e))try{return(t||JSON.parse)(e),V.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ge.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw G.from(e,G.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],(e=>{ge.headers[e]={}}));var be=ge;const we=V.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ve=Symbol("internals");function Oe(e){return e&&String(e).trim().toLowerCase()}function Ee(e){return!1===e||null==e?e:V.isArray(e)?e.map(Ee):String(e)}function _e(e,t,n,r,o){return V.isFunction(r)?r.call(this,t,n):(o&&(t=n),V.isString(t)?V.isString(r)?-1!==t.indexOf(r):V.isRegExp(r)?r.test(t):void 0:void 0)}class Se{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Oe(t);if(!o)throw new Error("header name must be a non-empty string");const i=V.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ee(e))}const i=(e,t)=>V.forEach(e,((e,n)=>o(e,n,t)));if(V.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(V.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&we[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(V.isObject(e)&&V.isIterable(e)){let n,r,o={};for(const t of e){if(!V.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?V.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Oe(e)){const n=V.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(V.isFunction(t))return t.call(this,e,n);if(V.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Oe(e)){const n=V.findKey(this,e);return!(!n||void 0===this[n]||t&&!_e(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Oe(e)){const o=V.findKey(n,e);!o||t&&!_e(0,n[o],o,t)||(delete n[o],r=!0)}}return V.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!_e(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return V.forEach(this,((r,o)=>{const i=V.findKey(n,o);if(i)return t[i]=Ee(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=Ee(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return V.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&V.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ve]=this[ve]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Oe(e);t[r]||(!function(e,t){const n=V.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return V.isArray(e)?e.forEach(r):r(e),this}}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(Se.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),V.freezeMethods(Se);var Te=Se;function Re(e,t){const n=this||be,r=t||n,o=Te.from(r.headers);let i=r.data;return V.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function xe(e){return!(!e||!e.__CANCEL__)}function ke(e,t,n){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,n),this.name="CanceledError"}function je(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new G("Request failed with status code "+n.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}V.inherits(ke,G,{__CANCEL__:!0});const Ae=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const p=u&&c-u;return p?Math.round(1e3*f/p):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout((()=>{r=null,s(n)}),i-a)))},()=>n&&s(n)]}((n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),n)},Pe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ce=e=>(...t)=>V.asap((()=>e(...t)));var Ue=ye.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,Ne=ye.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];V.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),V.isString(r)&&s.push("path="+r),V.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Le(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Je=e=>e instanceof Te?{...e}:e;function Ie(e,t){t=t||{};const n={};function r(e,t,n,r){return V.isPlainObject(e)&&V.isPlainObject(t)?V.merge.call({caseless:r},e,t):V.isPlainObject(t)?V.merge({},t):V.isArray(t)?t.slice():t}function o(e,t,n,o){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!V.isUndefined(t))return r(void 0,t)}function s(e,t){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(Je(e),Je(t),0,!0)};return V.forEach(Object.keys({...e,...t}),(function(r){const i=c[r]||o,s=i(e[r],t[r],r);V.isUndefined(s)&&i!==a||(n[r]=s)})),n}var De=e=>{const t=Ie({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=Te.from(s),t.url=se(Le(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),V.isFormData(n))if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(V.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)}))}if(ye.hasStandardBrowserEnv&&(r&&V.isFunction(r)&&(r=r(t)),r||!1!==r&&Ue(t.url))){const e=o&&i&&Ne.read(i);e&&s.set(o,e)}return t};var Fe="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=De(e);let o=r.data;const i=Te.from(r.headers).normalize();let s,a,c,u,l,{responseType:f,onUploadProgress:p,onDownloadProgress:d}=r;function h(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let y=new XMLHttpRequest;function m(){if(!y)return;const r=Te.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());je((function(e){t(e),h()}),(function(e){n(e),h()}),{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(n(new G("Request aborted",G.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const r=new G(t&&t.message?t.message:"Network Error",G.ERR_NETWORK,e,y);r.event=t||null,n(r),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ce;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new G(t,o.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&V.forEach(i.toJSON(),(function(e,t){y.setRequestHeader(t,e)})),V.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),f&&"json"!==f&&(y.responseType=r.responseType),d&&([c,l]=Ae(d,!0),y.addEventListener("progress",c)),p&&y.upload&&([a,u]=Ae(p),y.upload.addEventListener("progress",a),y.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(s=t=>{y&&(n(!t||t.type?new ke(null,e,y):t),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===ye.protocols.indexOf(g)?n(new G("Unsupported protocol "+g+":",G.ERR_BAD_REQUEST,e)):y.send(o||null)}))};var Be=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof G?t:new ke(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new G(`timeout ${t} of ms exceeded`,G.ETIMEDOUT))}),t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>V.asap(s),a}};const Me=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},qe=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ze=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of qe(e))yield*Me(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Ke}=V,We=(({Request:e,Response:t})=>({Request:e,Response:t}))(V.global),{ReadableStream:He,TextEncoder:Ve}=V.global,Ge=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Xe=e=>{e=V.merge.call({skipUndefined:!0},We,e);const{fetch:t,Request:n,Response:r}=e,o=t?Ke(t):"function"==typeof fetch,i=Ke(n),s=Ke(r);if(!o)return!1;const a=o&&Ke(He),c=o&&("function"==typeof Ve?(u=new Ve,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&a&&Ge((()=>{let e=!1;const t=new n(ye.origin,{body:new He,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),f=s&&a&&Ge((()=>V.isReadableStream(new r("").body))),p={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!p[e]&&(p[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new G(`Response type '${e}' is not supported`,G.ERR_NOT_SUPPORT,n)})}));const d=async(e,t)=>{const r=V.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(V.isBlob(e))return e.size;if(V.isSpecCompliantForm(e)){const t=new n(ye.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return V.isArrayBufferView(e)||V.isArrayBuffer(e)?e.byteLength:(V.isURLSearchParams(e)&&(e+=""),V.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:a,signal:c,cancelToken:u,timeout:h,onDownloadProgress:y,onUploadProgress:m,responseType:g,headers:b,withCredentials:w="same-origin",fetchOptions:v}=De(e),O=t||fetch;g=g?(g+"").toLowerCase():"text";let E=Be([c,u&&u.toAbortSignal()],h),_=null;const S=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let T;try{if(m&&l&&"get"!==s&&"head"!==s&&0!==(T=await d(b,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(V.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=Pe(T,Ae(Ce(m)));a=ze(t.body,65536,e,n)}}V.isString(w)||(w=w?"include":"omit");const t=i&&"credentials"in n.prototype,c={...v,signal:E,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};_=i&&new n(o,c);let u=await(i?O(_,v):O(o,c));const h=f&&("stream"===g||"response"===g);if(f&&(y||h&&S)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=u[t]}));const t=V.toFiniteNumber(u.headers.get("content-length")),[n,o]=y&&Pe(t,Ae(Ce(y),!0))||[];u=new r(ze(u.body,65536,n,(()=>{o&&o(),S&&S()})),e)}g=g||"text";let R=await p[V.findKey(p,g)||"text"](u,e);return!h&&S&&S(),await new Promise(((t,n)=>{je(t,n,{data:R,headers:Te.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:_})}))}catch(t){if(S&&S(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new G("Network Error",G.ERR_NETWORK,e,_),{cause:t.cause||t});throw G.from(t,t&&t.code,e,_)}}},$e=new Map,Qe=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,a,c=i.length,u=$e;for(;c--;)s=i[c],a=u.get(s),void 0===a&&u.set(s,a=c?new Map:Xe(t)),u=a;return a};Qe();const Ye={http:null,xhr:Fe,fetch:{get:Qe}};V.forEach(Ye,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ze=e=>`- ${e}`,et=e=>V.isFunction(e)||null===e||!1===e;var tt=(e,t)=>{e=V.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!et(r)&&(o=Ye[(n=String(r)).toLowerCase()],void 0===o))throw new G(`Unknown adapter '${n}'`);if(o&&(V.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new G("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Ze).join("\n"):" "+Ze(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ke(null,e)}function rt(e){nt(e),e.headers=Te.from(e.headers),e.data=Re.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return tt(e.adapter||be.adapter,e)(e).then((function(t){return nt(e),t.data=Re.call(e,e.transformResponse,t),t.headers=Te.from(t.headers),t}),(function(t){return xe(t)||(nt(e),t&&t.response&&(t.response.data=Re.call(e,e.transformResponse,t.response),t.response.headers=Te.from(t.response.headers))),Promise.reject(t)}))}const ot="1.12.2",it={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{it[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const st={};it.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ot+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new G(r(o," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!st[o]&&(st[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},it.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var at={assertOptions:function(e,t,n){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new G("option "+i+" must be "+n,G.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new G("Unknown option "+i,G.ERR_BAD_OPTION)}},validators:it};const ct=at.validators;class ut{constructor(e){this.defaults=e||{},this.interceptors={request:new ae,response:new ae}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ie(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&at.assertOptions(n,{silentJSONParsing:ct.transitional(ct.boolean),forcedJSONParsing:ct.transitional(ct.boolean),clarifyTimeoutError:ct.transitional(ct.boolean)},!1),null!=r&&(V.isFunction(r)?t.paramsSerializer={serialize:r}:at.assertOptions(r,{encode:ct.function,serialize:ct.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),at.assertOptions(t,{baseUrl:ct.spelling("baseURL"),withXsrfToken:ct.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&V.merge(o.common,o[t.method]);o&&V.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Te.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[rt.bind(this),void 0];for(e.unshift(...s),e.push(...c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=s.length;let p=t;for(;f<l;){const e=s[f++],t=s[f++];try{p=e(p)}catch(e){t.call(this,e);break}}try{u=rt.call(this,p)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return se(Le((e=Ie(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}V.forEach(["delete","get","head","options"],(function(e){ut.prototype[e]=function(t,n){return this.request(Ie(n||{},{method:e,url:t,data:(n||{}).data}))}})),V.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Ie(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ut.prototype[e]=t(),ut.prototype[e+"Form"]=t(!0)}));var lt=ut;class ft{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new ke(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ft((function(t){e=t})),cancel:e}}}var pt=ft;const dt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(dt).forEach((([e,t])=>{dt[t]=e}));var ht=dt;const yt=function e(t){const n=new lt(t),o=r(lt.prototype.request,n);return V.extend(o,lt.prototype,n,{allOwnKeys:!0}),V.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Ie(t,n))},o}(be);yt.Axios=lt,yt.CanceledError=ke,yt.CancelToken=pt,yt.isCancel=xe,yt.VERSION=ot,yt.toFormData=te,yt.AxiosError=G,yt.Cancel=yt.CanceledError,yt.all=function(e){return Promise.all(e)},yt.spread=function(e){return function(t){return e.apply(null,t)}},yt.isAxiosError=function(e){return V.isObject(e)&&!0===e.isAxiosError},yt.mergeConfig=Ie,yt.AxiosHeaders=Te,yt.formToJSON=e=>me(V.isHTMLForm(e)?new FormData(e):e),yt.getAdapter=tt,yt.HttpStatusCode=ht,yt.default=yt,e.exports=yt},747:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getEnv=void 0;var o=r(n(489));t.getEnv=function(){return o.default.getOptions().env}},767:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getUserIp=void 0;var i=n(384),s=n(747),a={getUserIp:{test:"https://xtest.cnki.net/ip/client",development:"/proxy-sdk-ip/client",production:"https://x.cnki.net/ip/client"}};t.getUserIp=function(){return r(void 0,void 0,void 0,(function(){var e,t,n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),(e=(0,i.getCookie)("yxIP"))&&"undefined"!==e&&"null"!==e?[3,3]:[4,fetch(a.getUserIp[(0,s.getEnv)()],{method:"GET",headers:{source:"x.cnki.net"}})];case 1:return[4,r.sent().json()];case 2:return t=r.sent().content,n=(0,s.getEnv)(),(0,i.setCookie)("yxIP","development"===n?"124.193.98.142":t,432e3,"development"===n?"":".cnki.net"),[2,Promise.resolve(t)];case 3:return[2,Promise.resolve(e)];case 4:return r.sent(),[2,Promise.resolve("")];case 5:return[2]}}))}))}},776:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getBaseUrl=void 0;var i=o(n(598)),s=o(n(598)),a=o(n(365)),c=o(n(489)),u=n(747),l={development:i.default,test:s.default,production:a.default};t.getBaseUrl=function(e){var t,n,o=c.default.getOptions(),i=(0,u.getEnv)(),a=o.proxy?r(r({},o.proxy),l[i]):"development"===i?s.default:l[i],f=e;if("development"!==i){var p=null!==(n=null===(t=e.match(/^\/[^/]+/))||void 0===t?void 0:t[0])&&void 0!==n?n:"";Object.keys(a).forEach((function(t){(p===t||e.includes(t))&&(f=f.replace(t,a[t].target))}))}return f}},811:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.localQueueStore=t.removeCookie=t.setCookie=t.getCookie=void 0;var l=s(n(489)),f=n(471),p=n(537),d=u(n(65));t.localQueueStore=d.default;var h=n(767),y=n(551),m=function(){function e(){this.getAction=f.getAction,this.postAction=f.postAction,this.getJwt=function(){return(0,p.getJwt)((0,l.getJwtKey)())},this.removeJwt=function(){return(0,p.removeJwt)((0,l.getJwtKey)())},this.getUserIp=function(){return(0,h.getUserIp)()},this.toTrack=function(){return(0,h.getUserIp)()}}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.config=function(e){return l.default.config(e),this},e.prototype.ready=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,(0,h.getUserIp)()];case 1:return e.sent(),l.default.getOptions().tracker&&(0,y.tracker)(),[4,(0,f.getRefreshToken)()];case 2:return[2,e.sent()]}}))}))},e.instance=null,e}();t.default=m.getInstance();var g=n(384);Object.defineProperty(t,"getCookie",{enumerable:!0,get:function(){return g.getCookie}}),Object.defineProperty(t,"setCookie",{enumerable:!0,get:function(){return g.setCookie}}),Object.defineProperty(t,"removeCookie",{enumerable:!0,get:function(){return g.removeCookie}})},935:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRefreshToken=void 0;var u=n(384),l=n(471),f=n(537),p=s(n(489));t.getRefreshToken=function(){return a(void 0,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,d;return c(this,(function(c){switch(c.label){case 0:if(e=p.default.getOptions(),t=(0,p.getJwtKey)(),!(n=(0,u.getCookie)("LID")))return[2,{code:5014,message:"无法获取 LID,请重新登录"}];if(r=(0,f.getJwt)(t))return[2,{code:0,content:r,message:"JWT 已缓存,无需刷新"}];c.label=1;case 1:return c.trys.push([1,3,,4]),o={AppId:e.appId,ClientId:(0,u.getCookie)("Ecp_ClientId")||"9240617191000011664",ClientIp:(0,u.getCookie)("yxIP"),EcpToken:n},[4,(0,l.postAction)("/proxy-sdk-jwt/JwtToken/ecptoken",o,{withCredentials:!1})];case 2:return(i=c.sent()).Success&&i.Content?(s=i.Content,a=s.JwtToken,d=s.ExpireIn,(0,f.addJwt)(t,a,d),[2,{code:0,content:a,message:"JWT 刷新成功"}]):5014===i.Code?[2,{code:5014,message:i.Message||"Token 刷新失败"}]:[2,{code:-1,message:i.Message||"Token 刷新失败"}];case 3:return[2,{code:500,message:c.sent().message||"Token 刷新异常,请稍后重试"}];case 4:return[2]}}))}))};var d=0,h=!1,y=[];t.default=function(e,n){return a(void 0,void 0,void 0,(function(){var r,o;return c(this,(function(i){switch(i.label){case 0:if(h)return[3,6];if(h=!0,d>=2)return h=!1,[2,Promise.reject("Token 刷新异常,请稍后重试,超出最大重发次数。")];d+=1,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,(0,t.getRefreshToken)()];case 2:if(0!==(r=i.sent()).code)throw r;return y.forEach((function(e){return e()})),y=[],[2,e(n.config)];case 3:return o=i.sent(),[2,Promise.reject(o)];case 4:return h=!1,[7];case 5:return[3,7];case 6:return[2,new Promise((function(t){y.push((function(){t(e(n.config))}))}))];case 7:return[2]}}))}))}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(811)})()));
|
package/app.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/tracker/index.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ declare global {
|
|
|
4
4
|
interface Window {
|
|
5
5
|
sta_api?: {
|
|
6
6
|
toTrack: StaFn;
|
|
7
|
+
__OPENX_PATCHED__?: boolean;
|
|
7
8
|
[key: string]: any;
|
|
8
9
|
};
|
|
9
|
-
OPENX__STA_INIT__?: boolean;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/** tracker 主逻辑 */
|
|
13
13
|
export declare function tracker(): void;
|
|
14
14
|
export {};
|