isdata-customer-sdk 0.2.82 → 0.2.84
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/dist/cjs/chat.js +1 -1
- package/dist/cjs/dify.js +1 -1
- package/dist/cjs/i18n.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/portal.js +1 -1
- package/dist/cjs/security.js +1 -1
- package/dist/cjs/sms.js +1 -1
- package/dist/cjs/utils.js +1 -1
- package/dist/esm/chat.js +1 -1
- package/dist/esm/dify.js +1 -1
- package/dist/esm/i18n.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/portal.js +1 -1
- package/dist/esm/security.js +1 -1
- package/dist/esm/sms.js +1 -1
- package/dist/esm/utils.js +1 -1
- package/package.json +1 -1
package/dist/cjs/portal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("axios"),e={},a=Object.prototype.hasOwnProperty;function r(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function s(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var r,o,n=[];for(o in"string"!=typeof e&&(e="?"),t)if(a.call(t,o)){if((r=t[o])||null!=r&&!isNaN(r)||(r=""),o=s(o),r=s(r),null===o||null===r)continue;n.push(o+"="+r)}return n.length?e+n.join("&"):""},e.parse=function(t){for(var e,a=/([^=?#&]+)=?([^&]*)/g,s={};e=a.exec(t);){var o=r(e[1]),n=r(e[2]);null===o||null===n||o in s||(s[o]=n)}return s};const o="development"===process.env.NODE_ENV,n="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;var i=((a="")=>{a&&(a.startsWith("/")&&(a=a.slice(1,a.length)),a.endsWith("/")&&(a=a.slice(0,-1)));const r=t.create({baseURL:`/${a?a+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(t){return t>=200&&t<300},headers:window.location.search&&e.parse(window.location.search).token||window.token?{token:e.parse(window.location.search).token||window.token}:{}});let s=r.post;return r.post=(t,e,a)=>{let o=window.VITE_SERVICE_BASE_URL||"";if(o){let n=o+t;return s.call(r,n,e,a)}return s.call(r,t,e,a)},r.interceptors.request.use(t=>{if(!n&&o){let e=window.mockData.PORTAL_SERVER_ADDRESS,a=window.mockData.VITE_SERVICE_BASE_URL;t.url=`${e}${a}${t.url}`}return t},t=>Promise.reject(t)),r.defaults.headers.post["Content-Type"]="application/json",r.interceptors.response.use(t=>{let{data:e}=t;return"string"==typeof e&&(e=JSON.parse(e)),!e||200===e.status||e instanceof Blob?e instanceof Blob?(t.data=e,t):(t.data=e&&e.result,t):Promise.reject(t)},t=>{if(!t.response||401!==t.response.status)return Promise.reject(t.response)}),r})(window.prefixPath||"");const p=()=>{let t=window.sessionStorage.getItem("iportal_app_id");return t||(t=c()),t},c=()=>window.appSdk.getAppId()||window.localStorage.MobileAppId,l=async(t,e)=>{let a={param:{id:t}},r=await i.post("/dataservice/rest/orchestration/getMenuDatasByGroupID",a),s=r.data.resultDatas,o=r.data.menuTypes;r=await i.post("/dataservice/rest/orchestration/getPortalDefaultQuickMenus",{});let n=r.data.resultDatas,p=r.data.menuTypes,c=s.concat(n),l=o.concat(p),u=[],g=[],y={};for(const t of c){let e=t.id,a="1"==t.status;!y[e]&&a&&(u.push(t),y[e]=t)}let I={};for(const t of l){let e=t.id;I[e]||(g.push(t),I[e]=t)}if(e&&e.length>0){r=await d(e,t);let a=r.data.quickMenuMappingDatas||[],s={};for(const t of a){let e=t.menu_mapping_id,a=y[e];s[e]=a}return f(u,g,s)}return f(u,g,[])},d=async(t,e)=>{let a={param:{role_ids:t,group_id:e}};return await i.post("/dataservice/rest/orchestration/getQuckMenuMappingsByRoleIDs",a)},u=async(t,e,a)=>{let r={param:{user_id:t,app_id:e,group_id:a}};return(await i.post("/dataservice/rest/orchestration/getRoleIDsByUserAndGroupID",r)).data.portal_role_ids},g=async(t,e)=>{let a={param:{role_ids:t,app_id:e}};return(await i.post("/dataservice/rest/orchestration/getPlatformMenuMappingsByRoleIDs",a)).data.mappingDatas},f=(t,e,a)=>{let r={},s={},o={};for(let t in a){let e=a[t];if(!e)continue;let r=e.parent_id;r&&(o[r]=!0)}for(const e of t){let t=e.id,s={id:t,index:e.menu_id,name:e.title,sort:e.sort,actionType:e.actionType,url:e.url,iconClass:e.image?e.image:"4"==e.type?"":"el-icon-menu",parent_id:e.parent_id,children:[],app_id:e.app_id,menu_id:e.menu_id,beyond_type:e.menu_type?e.menu_type:"RJVIEW-OTHERS",beyond_type_sort:e.menu_type_sort?e.menu_type_sort:999,type:"MenuItem",typeID:e.type};(a&&a[t]||"4"==e.type||o[t]||"1"==e.is_app_defalut)&&(r[t]=s)}for(const t of e){s[t.id]=t}for(const e of t){if("5"==e.type){let t=r[e.id];if(!t)continue;let a=e.parent_id,o=t.beyond_type,n=r[a];if(!n)continue;let i=n.children,p=i.find(t=>t.id==o);if(p){p.children.push(t),t.typeItem=p}else{let e=s[o],a=e?{id:o,index:o,name:e.title,children:[],sort:e.value,type:"MenuType"}:{id:o,index:o,name:"其他",children:[],sort:999,type:"MenuType"};a.children.push(t),i.push(a),t.typeItem=a}}}const n=[];for(const e of t){if("4"==e.type){let t=r[e.id];if(!t)continue;let s=t.children,o=0;for(const t of s){let e=t.children.length;if(o+=e,e>0)break}if("1"!=e.is_app_defalut&&a&&!a[e.id]&&0==o)continue;n.push(t);let i=t.children;i.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort);for(let t of i){t.children.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort)}}}return n.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort),n},y=(t,e)=>{if(e&&e.length>0)for(let a=0;a<e.length;a++)if(e[a].name==t)return e[a].default_value;return""};exports.addIMMapping=async(t,e,a,r)=>{let s={param:{data:{userID:t,im_type:e,group_id:a,userSig:r}}};return(await i.post("/dataservice/rest/orchestration/addIMMapping",s)).data},exports.addObjTipMapping=(t,e,a)=>{let r={param:{sourceID:t,tipID:e,groupID:a}};return i.post("/dataservice/rest/orchestration/addObjTipMapping",r).data.operatorResult||{}},exports.addObjectUsedTimes=t=>{let e={param:{operateData:t}};return i.post("/dataservice/rest/orchestration/addObjectUsedTimes",e)},exports.addTipObject=t=>{let e={param:{tipInfo:t}};return i.post("/dataservice/rest/orchestration/addTipObject",e).data.operateResult||{}},exports.getAIRobotInfos=async(t,e)=>{let a={param:{userID:t,groupID:e}};return(await i.post("/dataservice/rest/orchestration/getAIRobotInfos",a)).data.robotInfos},exports.getAPPInfosByID=async t=>{let e={param:{id:t}};return(await i.post("/dataservice/rest/orchestration/getAPPInfosByID",e)).data.appInfo},exports.getAllUserInfosByGroupID=async t=>{let e={param:{groupID:t}};return(await i.post("/dataservice/rest/orchestration/getAllUserInfosByGroupID",e)).data.resultDatas},exports.getAppCustomData=async t=>{let e={param:{appID:t}},a=(await i.post("/dataservice/rest/orchestration/getAppCustomData",e)).data.customData;return a=a?JSON.parse(a):{},a},exports.getAppPortalMenuDatas=async(t,e,a,r)=>{let s=p(),o=await u(t,s,e),n=await l(e,o),i=window.appSdk.getAppId();return n.filter(t=>{if(a)return!0;if(t.app_id==s)return!0;{let e=t.children,a=!1;return e&&e.length>0&&e.forEach(t=>{let e=t.children;if(e&&e.length>0){let t=e.filter(t=>t.app_id===i);t&&t.length>0&&(a=!0)}}),a}})},exports.getChildrenOfficeInfosByID=async t=>{let e={param:{officeID:t}};return(await i.post("/dataservice/rest/orchestration/getChildrenOfficeInfosByID",e)).data.resultDatas},exports.getCurrentAppID=c,exports.getCurrentUserPortalMapping=async t=>{let e={param:{userData:t}};return(await i.post("/dataservice/rest/orchestration/getPortalMappingInfo",e)).data.portal_info},exports.getCurrentUserPortalPageID=async t=>{let e={param:{userData:t}};return(await i.post("/dataservice/rest/orchestration/getPortalPageID",e)).data.portal_id},exports.getGourpMappingsByPhoneNumber=async t=>{let e={param:{phone:t}};return(await i.post("/dataservice/rest/orchestration/getGourpMappingsByPhoneNumber",e)).data.resultGroups},exports.getGroupMappingsByAccount=async t=>{let e={param:{account:t}};return(await i.post("/dataservice/rest/orchestration/getGourpMappingsByAccountName",e)).data.resultGroups},exports.getIntegrateAppInfoByID=async t=>{let e={param:{appID:t}};return(await i.post("/dataservice/rest/orchestration/getIntegrateAppInfoByID",e)).data.appInfo},exports.getLoginPageNotices=async t=>{let e={param:{id:"1005",groupID:t}};return(await i.post("/dataservice/rest/orchestration/getNoticeInfosByAppTypeID",e)).data.resultDatas},exports.getMappingAppInfoByID=async(t,e)=>{let a={param:{appID:t,groupID:e}};return(await i.post("/dataservice/rest/orchestration/getPortalMappingAppInfoByID",a)).data.appInfo},exports.getMenuDatasByGroupID=l,exports.getMenuMappingDatasByRoleIDs=d,exports.getObjectUseTimes=t=>{let e={param:{objectInfo:t}};return i.post("/dataservice/rest/orchestration/getObjectUseTimes",e)},exports.getOfficeInfosByIDs=async t=>{let e={param:{ids:t}};return(await i.post("/dataservice/rest/orchestration/getOfficeInfosByIDs",e)).data.officeInfos},exports.getPageIDByComponentID=async t=>{let e={param:{componentID:t}};return(await i.post("/dataservice/rest/orchestration/getPageIDByComponentID",e)).data.page_id},exports.getPhoneNumberByAccountName=async(t,e)=>{let a={param:{accountName:t,groupID:e}};return(await i.post("/dataservice/rest/orchestration/getPhoneNumberByAccountName",a)).data.phone},exports.getPlatformBortherMenusByMenuID=async(t,e,a)=>{let r={param:{menu_id:t}},s=(await i.post("/dataservice/rest/orchestration/getPlatformBortherMenusByMenuID",r)).data.menuDatas||[],o=await g(e,a),n={};for(const t of o){n[t.menu_id]=t}let p={};for(const t of s){let e=t.id;if((1!==t.leaf_flag||n[e])&&!p[e]){let a="el-icon-menu",r={id:t.id,index:t.id,name:t.name,isSys:!0,iconClass:a,actionType:t.action_type||"1",app_id:t.datapp_id,menu_id:t.id,url:t.url||"",children:t.children||[],sort:t.sort||0};p[e]=r}}for(const t of s){let e=t.parent_id;if(!e)continue;let a=p[e];if(a){let e=p[t.id];if(!e)continue;a.children.push(e)}}let c=[];for(const t in p){let e=p[t];if(e.children&&e.children.length>0){c.push(e),e.children.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort)}}if(0==c.length)for(const t in p){let e=p[t];e&&c.push(e)}return c.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort),c},exports.getPlatformMenuMappingsByRoleIDs=g,exports.getPojectDptsByUserAndGroupID=async(t,e)=>{let a={param:{userID:t,groupID:e}},r=await i.post("/dataservice/rest/orchestration/getPojectDptsByUserAndGroupID",a);return{dptDatas:r.data.officeDatas,userMappings:r.data.userMappings}},exports.getPoratlAppID=p,exports.getPortalAccessToken=async(t,e)=>(await i.get(`/appAuth/getAccessToken?appKey=${t}&appSecret=${e}`)).data,exports.getPortalAppCustomConfig=async t=>{let e={param:{groupID:t}};return(await i.post("/dataservice/rest/orchestration/getPortalAppCustomConfig",e)).data.configInfo},exports.getPortalAppCustomConfigs=async t=>{let e={param:{ids:t}};return(await i.post("/dataservice/rest/orchestration/getPortalAppCustomConfigs",e)).data.configInfos},exports.getPortalDocmentInfo=async t=>{let e={param:{kb_doc_id:t}};return(await i.post("/dataservice/rest/orchestration/getPortalDocmentInfoByKBID",e)).data.docInfo},exports.getPortalInfosByID=async t=>{let e={param:{id:t}};return(await i.post("/dataservice/rest/orchestration/getPortalInfosByID",e)).data.portalInfo},exports.getPortalNotices=async t=>{let e={param:{id:t}};return await i.post("/dataservice/rest/orchestration/getNoticesInfosByGroupID",e)},exports.getPortalPageConfig=async t=>{let e={param:{id:t}};return(await i.post("/dataservice/rest/orchestration/getPortalPageConfig",e)).data.portal_page_config||"[]"},exports.getPortalPageMenuID=async(t,e)=>{let a={param:{id:t,appid:e}};return(await i.post("/dataservice/rest/orchestration/getPortalPageMenuID",a)).data.menu_id},exports.getPortalUserInfo=async(t,e)=>(await i.get(`/systhirdapp/user/getUserByCode?code=${t}&access_token=${e}`)).data,exports.getPortalUserMappingInfos=async t=>{let e={param:{operateData:t}};return(await i.post("/dataservice/rest/orchestration/getPortalUserMappingInfos",e)).data.portalMapping},exports.getPortalUserSig=async(t,e,a)=>{let r={param:{userID:t,im_type:e,group_id:a}};return(await i.post("/dataservice/rest/orchestration/getIMUserSigByID",r)).data.userSig},exports.getRoleIDsByUserAndGroupID=u,exports.getTenetInfoByName=async t=>{let e={param:{name:t}};return(await i.post("/dataservice/rest/orchestration/getTenetInfoByName",e)).data.resultDatas},exports.getThirdAppPathByKey=async(t,e,a)=>{let r={param:{appKey:t,appSecret:e,groupID:a}};return(await i.post("/dataservice/rest/orchestration/getThirdAppPathByKey",r)).data.path},exports.getUserAllMappngPortal=t=>{let e={param:{userData:t}};return i.post("/dataservice/rest/orchestration/getUserAllMappngPortal",e)},exports.queryAndStoreAppVariable=(t,e)=>{let a=window.sessionStorage.getItem("isdata_app_variable_"+t);return a||(a=y(t,e),a&&window.sessionStorage.setItem("isdata_app_variable_"+t,a)),a},exports.queryAppVariable=y,exports.queryGroupIDByOfficeId=async t=>{let e={param:{id:t}};return(await i.post("/dataservice/rest/orchestration/getGroupIDByDptID",e)).data.resultDptData.id},exports.queryGroupInfosByOfficeId=async t=>{let e={param:{id:t}};return(await i.post("/dataservice/rest/orchestration/getGroupIDByDptID",e)).data.resultDptData},exports.queryOfficeInfosById=async t=>{let e={param:{id:t}};return(await i.post("/dataservice/rest/orchestration/getOfficeInfosByID",e)).data.officeData},exports.savePortalI18nText=async(t,e,a,r,s)=>{let o={param:{key:t,value:e,appID:p(),lang:a,beyondID:r,i18nType:s}};return(await i.post("/dataservice/rest/orchestration/savePortalI18nText",o)).data.resultData},exports.setPortalPageConfig=t=>{let e={param:t};return i.post("/dataservice/rest/orchestration/setPortalPageConfig",e)},exports.transformPortalQuickMenuDatas=(t,e)=>{e=e||[];let a=(t=t||[]).concat(e),r={},s=[];for(const t of a){let e=t.id;r[e]||(r[e]=t,s.push(t))}let o={};for(const t of s){let e=t.id,a={id:e,label:t.title,sort:t.sort,children:[],parent_id:t.parent_id,type:t.type};o[e]=a}for(const t of s){let e=o[t.id];if("5"==e.type){let t=o[e.parent_id];if(t){t.children.push(e)}}}const n=[];for(const t of s){let e=o[t.id];if("4"==e.type){n.push(e),e.children.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort)}}return n.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort),n},exports.transformPortalSystemMenuDatas=t=>{let e={};for(const a of t){let t=a.id,r={id:t,label:a.name,sort:a.sort,icon:a.icon,children:[],app_id:a.datapp_id,parent_id:a.parent_id,leaf_flag:a.leaf_flag};e[t]=r}for(const a of t){if(1==a.leaf_flag){let t=e[a.id],r=e[a.parent_id];if(r){r.children.push(t)}}}const a=[];for(const r of t){if(0==r.leaf_flag){let t=e[r.id];a.push(t),t.children.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort)}}return a.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort),a},exports.updateIMMapping=async(t,e,a,r)=>{let s={param:{userID:t,im_type:e,groupID:a,userSig:r}};return(await i.post("/dataservice/rest/orchestration/updateIMMapping",s)).data},exports.updateUserSelectPortal=t=>{let e={param:{portalMappingData:t}};return i.post("/dataservice/rest/orchestration/updateUserSelectPortal",e)},exports.validateSSOPageLoaded=async(t,e,a)=>{let r={param:{app_id:t,appSecret:e,returnUrl:a}};return(await i.post("/dataservice/rest/orchestration/validateSSOPageLoaded",r)).data.count};
|
|
1
|
+
"use strict";var t=require("axios"),e={},a=Object.prototype.hasOwnProperty;function r(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function s(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var r,o,n=[];for(o in"string"!=typeof e&&(e="?"),t)if(a.call(t,o)){if((r=t[o])||null!=r&&!isNaN(r)||(r=""),o=s(o),r=s(r),null===o||null===r)continue;n.push(o+"="+r)}return n.length?e+n.join("&"):""},e.parse=function(t){for(var e,a=/([^=?#&]+)=?([^&]*)/g,s={};e=a.exec(t);){var o=r(e[1]),n=r(e[2]);null===o||null===n||o in s||(s[o]=n)}return s};const o="development"===process.env.NODE_ENV,n="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;window.isDevopmentMode=o,window.isOnlineDevelopmentMode=n;var p=((a="")=>{a&&(a.startsWith("/")&&(a=a.slice(1,a.length)),a.endsWith("/")&&(a=a.slice(0,-1)));const r=t.create({baseURL:`/${a?a+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(t){return t>=200&&t<300},headers:window.location.search&&e.parse(window.location.search).token||window.token?{token:e.parse(window.location.search).token||window.token}:{}});let s=r.post;return r.post=(t,e,a)=>{let o=window.VITE_SERVICE_BASE_URL||"";if(o){let n=o+t;return s.call(r,n,e,a)}return s.call(r,t,e,a)},r.interceptors.request.use(t=>{if(!n&&o){let e=window.mockData.PORTAL_SERVER_ADDRESS,a=window.mockData.VITE_SERVICE_BASE_URL;t.url=`${e}${a}${t.url}`}return t},t=>Promise.reject(t)),r.defaults.headers.post["Content-Type"]="application/json",r.interceptors.response.use(t=>{let{data:e}=t;return"string"==typeof e&&(e=JSON.parse(e)),!e||200===e.status||e instanceof Blob?e instanceof Blob?(t.data=e,t):(t.data=e&&e.result,t):Promise.reject(t)},t=>{if(!t.response||401!==t.response.status)return Promise.reject(t.response)}),r})(window.prefixPath||"");const i=()=>{let t=window.sessionStorage.getItem("iportal_app_id");return t||(t=c()),t},c=()=>window.appSdk.getAppId()||window.localStorage.MobileAppId,d=async(t,e)=>{let a={param:{id:t}},r=await p.post("/dataservice/rest/orchestration/getMenuDatasByGroupID",a),s=r.data.resultDatas,o=r.data.menuTypes;r=await p.post("/dataservice/rest/orchestration/getPortalDefaultQuickMenus",{});let n=r.data.resultDatas,i=r.data.menuTypes,c=s.concat(n),d=o.concat(i),u=[],g=[],I={};for(const t of c){let e=t.id,a="1"==t.status;!I[e]&&a&&(u.push(t),I[e]=t)}let m={};for(const t of d){let e=t.id;m[e]||(g.push(t),m[e]=t)}if(e&&e.length>0){r=await l(e,t);let a=r.data.quickMenuMappingDatas||[],s={};for(const t of a){let e=t.menu_mapping_id,a=I[e];s[e]=a}return f(u,g,s)}return f(u,g,[])},l=async(t,e)=>{let a={param:{role_ids:t,group_id:e}};return await p.post("/dataservice/rest/orchestration/getQuckMenuMappingsByRoleIDs",a)},u=async(t,e,a)=>{let r={param:{user_id:t,app_id:e,group_id:a}};return(await p.post("/dataservice/rest/orchestration/getRoleIDsByUserAndGroupID",r)).data.portal_role_ids},g=async(t,e)=>{let a={param:{role_ids:t,app_id:e}};return(await p.post("/dataservice/rest/orchestration/getPlatformMenuMappingsByRoleIDs",a)).data.mappingDatas},f=(t,e,a)=>{let r={},s={},o={};for(let t in a){let e=a[t];if(!e)continue;let r=e.parent_id;r&&(o[r]=!0)}for(const e of t){let t=e.id,s={id:t,index:e.menu_id,name:e.title,sort:e.sort,actionType:e.actionType,url:e.url,iconClass:e.image?e.image:"4"==e.type?"":"el-icon-menu",parent_id:e.parent_id,children:[],app_id:e.app_id,menu_id:e.menu_id,beyond_type:e.menu_type?e.menu_type:"RJVIEW-OTHERS",beyond_type_sort:e.menu_type_sort?e.menu_type_sort:999,type:"MenuItem",typeID:e.type};(a&&a[t]||"4"==e.type||o[t]||"1"==e.is_app_defalut)&&(r[t]=s)}for(const t of e){s[t.id]=t}for(const e of t){if("5"==e.type){let t=r[e.id];if(!t)continue;let a=e.parent_id,o=t.beyond_type,n=r[a];if(!n)continue;let p=n.children,i=p.find(t=>t.id==o);if(i){i.children.push(t),t.typeItem=i}else{let e=s[o],a=e?{id:o,index:o,name:e.title,children:[],sort:e.value,type:"MenuType"}:{id:o,index:o,name:"其他",children:[],sort:999,type:"MenuType"};a.children.push(t),p.push(a),t.typeItem=a}}}const n=[];for(const e of t){if("4"==e.type){let t=r[e.id];if(!t)continue;let s=t.children,o=0;for(const t of s){let e=t.children.length;if(o+=e,e>0)break}if("1"!=e.is_app_defalut&&a&&!a[e.id]&&0==o)continue;n.push(t);let p=t.children;p.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort);for(let t of p){t.children.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort)}}}return n.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort),n},I=(t,e)=>{if(e&&e.length>0)for(let a=0;a<e.length;a++)if(e[a].name==t)return e[a].default_value;return""};exports.addIMMapping=async(t,e,a,r)=>{let s={param:{data:{userID:t,im_type:e,group_id:a,userSig:r}}};return(await p.post("/dataservice/rest/orchestration/addIMMapping",s)).data},exports.addObjTipMapping=(t,e,a,r)=>{let s={param:{sourceID:t,tipID:e,userID:a,groupID:r}};return p.post("/dataservice/rest/orchestration/addObjTipMapping",s).data.operatorResult||{}},exports.addObjectUsedTimes=t=>{let e={param:{operateData:t}};return p.post("/dataservice/rest/orchestration/addObjectUsedTimes",e)},exports.addTips=t=>{let e={param:{tipInfos:t}};return p.post("/dataservice/rest/orchestration/addTips",e).data.operateResult||{}},exports.addTipsAndMapping=(t,e,a)=>{let r={param:{tipInfos:t,objectID:e,userID:a}};return p.post("/dataservice/rest/orchestration/addTipsAndMapping",r)||{}},exports.deleteObjTipMapping=(t,e,a)=>{let r={param:{sourceID:t,tipID:e,userID:a}};return p.post("/dataservice/rest/orchestration/deleteObjTipMapping",r).data.operatorResult||{}},exports.deleteTips=t=>{let e={param:{tipIDs:t}};return p.post("/dataservice/rest/orchestration/deleteTips",e).data.operateResult||{}},exports.deleteTipsAndMapping=(t,e,a)=>{let r={param:{tipIDs:t,userID:e,objectID:a}};return p.post("/dataservice/rest/orchestration/deleteTipsAndMapping",r)||{}},exports.getAIRobotInfos=async(t,e)=>{let a={param:{userID:t,groupID:e}};return(await p.post("/dataservice/rest/orchestration/getAIRobotInfos",a)).data.robotInfos},exports.getAPPInfosByID=async t=>{let e={param:{id:t}};return(await p.post("/dataservice/rest/orchestration/getAPPInfosByID",e)).data.appInfo},exports.getAllUserInfosByGroupID=async t=>{let e={param:{groupID:t}};return(await p.post("/dataservice/rest/orchestration/getAllUserInfosByGroupID",e)).data.resultDatas},exports.getAppCustomData=async t=>{let e={param:{appID:t}},a=(await p.post("/dataservice/rest/orchestration/getAppCustomData",e)).data.customData;return a=a?JSON.parse(a):{},a},exports.getAppPortalMenuDatas=async(t,e,a,r)=>{let s=i(),o=await u(t,s,e),n=await d(e,o),p=window.appSdk.getAppId();return n.filter(t=>{if(a)return!0;if(t.app_id==s)return!0;{let e=t.children,a=!1;return e&&e.length>0&&e.forEach(t=>{let e=t.children;if(e&&e.length>0){let t=e.filter(t=>t.app_id===p);t&&t.length>0&&(a=!0)}}),a}})},exports.getChildrenOfficeInfosByID=async t=>{let e={param:{officeID:t}};return(await p.post("/dataservice/rest/orchestration/getChildrenOfficeInfosByID",e)).data.resultDatas},exports.getCurrentAppID=c,exports.getCurrentUserPortalMapping=async t=>{let e={param:{userData:t}};return(await p.post("/dataservice/rest/orchestration/getPortalMappingInfo",e)).data.portal_info},exports.getCurrentUserPortalPageID=async t=>{let e={param:{userData:t}};return(await p.post("/dataservice/rest/orchestration/getPortalPageID",e)).data.portal_id},exports.getGourpMappingsByPhoneNumber=async t=>{let e={param:{phone:t}};return(await p.post("/dataservice/rest/orchestration/getGourpMappingsByPhoneNumber",e)).data.resultGroups},exports.getGroupMappingsByAccount=async t=>{let e={param:{account:t}};return(await p.post("/dataservice/rest/orchestration/getGourpMappingsByAccountName",e)).data.resultGroups},exports.getIntegrateAppInfoByID=async t=>{let e={param:{appID:t}};return(await p.post("/dataservice/rest/orchestration/getIntegrateAppInfoByID",e)).data.appInfo},exports.getLoginPageNotices=async t=>{let e={param:{id:"1005",groupID:t}};return(await p.post("/dataservice/rest/orchestration/getNoticeInfosByAppTypeID",e)).data.resultDatas},exports.getMappingAppInfoByID=async(t,e)=>{let a={param:{appID:t,groupID:e}};return(await p.post("/dataservice/rest/orchestration/getPortalMappingAppInfoByID",a)).data.appInfo},exports.getMenuDatasByGroupID=d,exports.getMenuMappingDatasByRoleIDs=l,exports.getObjectAllTipsInfos=(t,e)=>{let a={param:{objectID:t,userID:e}};return p.post("/dataservice/rest/orchestration/getObjectAllTipsInfos",a).data.resultDatas||[]},exports.getObjectUseTimes=t=>{let e={param:{objectInfo:t}};return p.post("/dataservice/rest/orchestration/getObjectUseTimes",e)},exports.getOfficeInfosByIDs=async t=>{let e={param:{ids:t}};return(await p.post("/dataservice/rest/orchestration/getOfficeInfosByIDs",e)).data.officeInfos},exports.getPageIDByComponentID=async t=>{let e={param:{componentID:t}};return(await p.post("/dataservice/rest/orchestration/getPageIDByComponentID",e)).data.page_id},exports.getPhoneNumberByAccountName=async(t,e)=>{let a={param:{accountName:t,groupID:e}};return(await p.post("/dataservice/rest/orchestration/getPhoneNumberByAccountName",a)).data.phone},exports.getPlatformBortherMenusByMenuID=async(t,e,a)=>{let r={param:{menu_id:t}},s=(await p.post("/dataservice/rest/orchestration/getPlatformBortherMenusByMenuID",r)).data.menuDatas||[],o=await g(e,a),n={};for(const t of o){n[t.menu_id]=t}let i={};for(const t of s){let e=t.id;if((1!==t.leaf_flag||n[e])&&!i[e]){let a="el-icon-menu",r={id:t.id,index:t.id,name:t.name,isSys:!0,iconClass:a,actionType:t.action_type||"1",app_id:t.datapp_id,menu_id:t.id,url:t.url||"",children:t.children||[],sort:t.sort||0};i[e]=r}}for(const t of s){let e=t.parent_id;if(!e)continue;let a=i[e];if(a){let e=i[t.id];if(!e)continue;a.children.push(e)}}let c=[];for(const t in i){let e=i[t];if(e.children&&e.children.length>0){c.push(e),e.children.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort)}}if(0==c.length)for(const t in i){let e=i[t];e&&c.push(e)}return c.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort),c},exports.getPlatformMenuMappingsByRoleIDs=g,exports.getPojectDptsByUserAndGroupID=async(t,e)=>{let a={param:{userID:t,groupID:e}},r=await p.post("/dataservice/rest/orchestration/getPojectDptsByUserAndGroupID",a);return{dptDatas:r.data.officeDatas,userMappings:r.data.userMappings}},exports.getPoratlAppID=i,exports.getPortalAccessToken=async(t,e)=>(await p.get(`/appAuth/getAccessToken?appKey=${t}&appSecret=${e}`)).data,exports.getPortalAppCustomConfig=async t=>{let e={param:{groupID:t}};return(await p.post("/dataservice/rest/orchestration/getPortalAppCustomConfig",e)).data.configInfo},exports.getPortalAppCustomConfigs=async t=>{let e={param:{ids:t}};return(await p.post("/dataservice/rest/orchestration/getPortalAppCustomConfigs",e)).data.configInfos},exports.getPortalDocmentInfo=async t=>{let e={param:{kb_doc_id:t}};return(await p.post("/dataservice/rest/orchestration/getPortalDocmentInfoByKBID",e)).data.docInfo},exports.getPortalInfosByID=async t=>{let e={param:{id:t}};return(await p.post("/dataservice/rest/orchestration/getPortalInfosByID",e)).data.portalInfo},exports.getPortalNotices=async t=>{let e={param:{id:t}};return await p.post("/dataservice/rest/orchestration/getNoticesInfosByGroupID",e)},exports.getPortalPageConfig=async t=>{let e={param:{id:t}};return(await p.post("/dataservice/rest/orchestration/getPortalPageConfig",e)).data.portal_page_config||"[]"},exports.getPortalPageMenuID=async(t,e)=>{let a={param:{id:t,appid:e}};return(await p.post("/dataservice/rest/orchestration/getPortalPageMenuID",a)).data.menu_id},exports.getPortalUserInfo=async(t,e)=>(await p.get(`/systhirdapp/user/getUserByCode?code=${t}&access_token=${e}`)).data,exports.getPortalUserMappingInfos=async t=>{let e={param:{operateData:t}};return(await p.post("/dataservice/rest/orchestration/getPortalUserMappingInfos",e)).data.portalMapping},exports.getPortalUserSig=async(t,e,a)=>{let r={param:{userID:t,im_type:e,group_id:a}};return(await p.post("/dataservice/rest/orchestration/getIMUserSigByID",r)).data.userSig},exports.getRoleIDsByUserAndGroupID=u,exports.getTenetInfoByName=async t=>{let e={param:{name:t}};return(await p.post("/dataservice/rest/orchestration/getTenetInfoByName",e)).data.resultDatas},exports.getThirdAppPathByKey=async(t,e,a)=>{let r={param:{appKey:t,appSecret:e,groupID:a}};return(await p.post("/dataservice/rest/orchestration/getThirdAppPathByKey",r)).data.path},exports.getUserAllMappngPortal=t=>{let e={param:{userData:t}};return p.post("/dataservice/rest/orchestration/getUserAllMappngPortal",e)},exports.queryAndStoreAppVariable=(t,e)=>{let a=window.sessionStorage.getItem("isdata_app_variable_"+t);return a||(a=I(t,e),a&&window.sessionStorage.setItem("isdata_app_variable_"+t,a)),a},exports.queryAppVariable=I,exports.queryGroupIDByOfficeId=async t=>{let e={param:{id:t}};return(await p.post("/dataservice/rest/orchestration/getGroupIDByDptID",e)).data.resultDptData.id},exports.queryGroupInfosByOfficeId=async t=>{let e={param:{id:t}};return(await p.post("/dataservice/rest/orchestration/getGroupIDByDptID",e)).data.resultDptData},exports.queryOfficeInfosById=async t=>{let e={param:{id:t}};return(await p.post("/dataservice/rest/orchestration/getOfficeInfosByID",e)).data.officeData},exports.savePortalI18nText=async(t,e,a,r,s)=>{let o={param:{key:t,value:e,appID:i(),lang:a,beyondID:r,i18nType:s}};return(await p.post("/dataservice/rest/orchestration/savePortalI18nText",o)).data.resultData},exports.setPortalPageConfig=t=>{let e={param:t};return p.post("/dataservice/rest/orchestration/setPortalPageConfig",e)},exports.transformPortalQuickMenuDatas=(t,e)=>{e=e||[];let a=(t=t||[]).concat(e),r={},s=[];for(const t of a){let e=t.id;r[e]||(r[e]=t,s.push(t))}let o={};for(const t of s){let e=t.id,a={id:e,label:t.title,sort:t.sort,children:[],parent_id:t.parent_id,type:t.type};o[e]=a}for(const t of s){let e=o[t.id];if("5"==e.type){let t=o[e.parent_id];if(t){t.children.push(e)}}}const n=[];for(const t of s){let e=o[t.id];if("4"==e.type){n.push(e),e.children.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort)}}return n.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort),n},exports.transformPortalSystemMenuDatas=t=>{let e={};for(const a of t){let t=a.id,r={id:t,label:a.name,sort:a.sort,icon:a.icon,children:[],app_id:a.datapp_id,parent_id:a.parent_id,leaf_flag:a.leaf_flag};e[t]=r}for(const a of t){if(1==a.leaf_flag){let t=e[a.id],r=e[a.parent_id];if(r){r.children.push(t)}}}const a=[];for(const r of t){if(0==r.leaf_flag){let t=e[r.id];a.push(t),t.children.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort)}}return a.sort((t,e)=>Number.isNaN(t.sort)?1:Number.isNaN(e.sort)?-1:t.sort-e.sort),a},exports.updateIMMapping=async(t,e,a,r)=>{let s={param:{userID:t,im_type:e,groupID:a,userSig:r}};return(await p.post("/dataservice/rest/orchestration/updateIMMapping",s)).data},exports.updateUserSelectPortal=t=>{let e={param:{portalMappingData:t}};return p.post("/dataservice/rest/orchestration/updateUserSelectPortal",e)},exports.validateSSOPageLoaded=async(t,e,a)=>{let r={param:{app_id:t,appSecret:e,returnUrl:a}};return(await p.post("/dataservice/rest/orchestration/validateSSOPageLoaded",r)).data.count};
|
package/dist/cjs/security.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("axios"),i=require("crypto-js"),t={},o=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function a(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,i){i=i||"";var t,r,s=[];for(r in"string"!=typeof i&&(i="?"),e)if(o.call(e,r)){if((t=e[r])||null!=t&&!isNaN(t)||(t=""),r=a(r),t=a(t),null===r||null===t)continue;s.push(r+"="+t)}return s.length?i+s.join("&"):""},t.parse=function(e){for(var i,t=/([^=?#&]+)=?([^&]*)/g,o={};i=t.exec(e);){var a=r(i[1]),s=r(i[2]);null===a||null===s||a in o||(o[a]=s)}return o};const s="development"===process.env.NODE_ENV,n="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;var w,c=((i="")=>{i&&(i.startsWith("/")&&(i=i.slice(1,i.length)),i.endsWith("/")&&(i=i.slice(0,-1)));const o=e.create({baseURL:`/${i?i+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(e){return e>=200&&e<300},headers:window.location.search&&t.parse(window.location.search).token||window.token?{token:t.parse(window.location.search).token||window.token}:{}});let r=o.post;return o.post=(e,i,t)=>{let a=window.VITE_SERVICE_BASE_URL||"";if(a){let s=a+e;return r.call(o,s,i,t)}return r.call(o,e,i,t)},o.interceptors.request.use(e=>{if(!n&&s){let i=window.mockData.PORTAL_SERVER_ADDRESS,t=window.mockData.VITE_SERVICE_BASE_URL;e.url=`${i}${t}${e.url}`}return e},e=>Promise.reject(e)),o.defaults.headers.post["Content-Type"]="application/json",o.interceptors.response.use(e=>{let{data:i}=e;return"string"==typeof i&&(i=JSON.parse(i)),!i||200===i.status||i instanceof Blob?i instanceof Blob?(e.data=i,e):(e.data=i&&i.result,e):Promise.reject(e)},e=>{if(!e.response||401!==e.response.status)return Promise.reject(e.response)}),o})(window.prefixPath||""),d="user-agent",l="",p="function",u="object",b="string",h="undefined",m="browser",g="cpu",f="device",v="engine",y="os",k="result",x="name",_="type",S="vendor",C="version",E="architecture",A="major",O="model",I="console",q="mobile",P="tablet",T="smarttv",N="wearable",V="xr",R="embedded",z="inapp",M="brands",j="formFactors",B="fullVersionList",H="platform",D="platformVersion",L="bitness",U="sec-ch-ua",$=U+"-full-version-list",W=U+"-arch",F=U+"-"+L,G=U+"-form-factors",X=U+"-"+q,J=U+"-"+O,K=U+"-"+H,Y=K+"-version",Z=[M,B,q,O,H,D,E,j,L],Q="Amazon",ee="Apple",ie="ASUS",te="BlackBerry",oe="Google",re="Huawei",ae="Lenovo",se="Honor",ne="LG",we="Microsoft",ce="Motorola",de="Nvidia",le="OnePlus",pe="OPPO",ue="Samsung",be="Sharp",he="Sony",me="Xiaomi",ge="Zebra",fe="Chrome",ve="Chromium",ye="Chromecast",ke="Edge",xe="Firefox",_e="Opera",Se="Facebook",Ce="Sogou",Ee="Mobile ",Ae=" Browser",Oe="Windows",Ie=typeof window!==h&&window.navigator?window.navigator:void 0,qe=Ie&&Ie.userAgentData?Ie.userAgentData:void 0,Pe=function(e){for(var i={},t=0;t<e.length;t++)i[e[t].toUpperCase()]=e[t];return i},Te=function(e,i){if(typeof e===u&&e.length>0){for(var t in e)if(ze(i)==ze(e[t]))return!0;return!1}return!!Ve(e)&&ze(i)==ze(e)},Ne=function(e,i){for(var t in e)return/^(browser|cpu|device|engine|os)$/.test(t)||!!i&&Ne(e[t])},Ve=function(e){return typeof e===b},Re=function(e){if(e){for(var i=[],t=Be(/\\?\"/g,e).split(","),o=0;o<t.length;o++)if(t[o].indexOf(";")>-1){var r=De(t[o]).split(";v=");i[o]={brand:r[0],version:r[1]}}else i[o]=De(t[o]);return i}},ze=function(e){return Ve(e)?e.toLowerCase():e},Me=function(e){return Ve(e)?Be(/[^\d\.]/g,e).split(".")[0]:void 0},je=function(e){for(var i in e)if(e.hasOwnProperty(i)){var t=e[i];typeof t==u&&2==t.length?this[t[0]]=t[1]:this[t]=void 0}return this},Be=function(e,i){return Ve(i)?i.replace(e,l):i},He=function(e){return Be(/\\?\"/g,e)},De=function(e,i){return e=Be(/^\s\s*/,String(e)),typeof i===h?e:e.substring(0,i)},Le=function(e,i){if(e&&i)for(var t,o,r,a,s,n,w=0;w<i.length&&!s;){var c=i[w],d=i[w+1];for(t=o=0;t<c.length&&!s&&c[t];)if(s=c[t++].exec(e))for(r=0;r<d.length;r++)n=s[++o],typeof(a=d[r])===u&&a.length>0?2===a.length?typeof a[1]==p?this[a[0]]=a[1].call(this,n):this[a[0]]=a[1]:a.length>=3&&(typeof a[1]!==p||a[1].exec&&a[1].test?3==a.length?this[a[0]]=n?n.replace(a[1],a[2]):void 0:4==a.length?this[a[0]]=n?a[3].call(this,n.replace(a[1],a[2])):void 0:a.length>4&&(this[a[0]]=n?a[3].apply(this,[n.replace(a[1],a[2])].concat(a.slice(4))):void 0):a.length>3?this[a[0]]=n?a[1].apply(this,a.slice(2)):void 0:this[a[0]]=n?a[1].call(this,n,a[2]):void 0):this[a]=n||void 0;w+=2}},Ue=function(e,i){for(var t in i)if(typeof i[t]===u&&i[t].length>0){for(var o=0;o<i[t].length;o++)if(Te(i[t][o],e))return"?"===t?void 0:t}else if(Te(i[t],e))return"?"===t?void 0:t;return i.hasOwnProperty("*")?i["*"]:e},$e={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2",8.1:"6.3",10:["6.4","10.0"],NT:""},We={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Fe={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Ge={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[C,[x,Ee+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[C,[x,ke+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[C,[x,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[x,C],[/opios[\/ ]+([\w\.]+)/i],[C,[x,_e+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[C,[x,_e+" GX"]],[/\bopr\/([\w\.]+)/i],[C,[x,_e]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[C,[x,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[C,[x,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,/(brave)(?: chrome)?\/([\d\.]+)/i,/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[x,C],[/quark(?:pc)?\/([-\w\.]+)/i],[C,[x,"Quark"]],[/\bddg\/([\w\.]+)/i],[C,[x,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[C,[x,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[C,[x,"WeChat"]],[/konqueror\/([\w\.]+)/i],[C,[x,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[C,[x,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[C,[x,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[C,[x,"Smart "+ae+Ae]],[/(av(?:ast|g|ira))\/([\w\.]+)/i],[[x,/(.+)/,"$1 Secure"+Ae],C],[/norton\/([\w\.]+)/i],[C,[x,"Norton Private"+Ae]],[/\bfocus\/([\w\.]+)/i],[C,[x,xe+" Focus"]],[/ mms\/([\w\.]+)$/i],[C,[x,_e+" Neon"]],[/ opt\/([\w\.]+)$/i],[C,[x,_e+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[C,[x,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[C,[x,"Dolphin"]],[/coast\/([\w\.]+)/i],[C,[x,_e+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[C,[x,"MIUI"+Ae]],[/fxios\/([\w\.-]+)/i],[C,[x,Ee+xe]],[/\bqihoobrowser\/?([\w\.]*)/i],[C,[x,"360"]],[/\b(qq)\/([\w\.]+)/i],[[x,/(.+)/,"$1Browser"],C],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[x,/(.+)/,"$1"+Ae],C],[/samsungbrowser\/([\w\.]+)/i],[C,[x,ue+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[C,[x,Ce+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[x,Ce+" Mobile"],C],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[x,C],[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],[x],[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],[C,x],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[x,Se],C,[_,z]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[x,C,[_,z]],[/\bgsa\/([\w\.]+) .*safari\//i],[C,[x,"GSA"],[_,z]],[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],[C,[x,"TikTok"],[_,z]],[/\[(linkedin)app\]/i],[x,[_,z]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[x,/(.+)/,"Zalo"],C,[_,z]],[/(chromium)[\/ ]([-\w\.]+)/i],[x,C],[/ome-(lighthouse)$/i],[x,[_,"fetcher"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[C,[x,fe+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[C,[x,ke+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[x,fe+" WebView"],C],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[C,[x,"Android"+Ae]],[/chrome\/([\w\.]+) mobile/i],[C,[x,Ee+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[x,C],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[C,[x,Ee+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[x,Ee+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[C,x],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[x,[C,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[x,C],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[x,Ee+xe],C],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[x,"Netscape"],C],[/(wolvic|librewolf)\/([\w\.]+)/i],[x,C],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[C,[x,xe+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[x,[C,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[x,[C,/[^\d\.]+./,l]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[E,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[E,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[E,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[E,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[E,"arm"]],[/ sun4\w[;\)]/i],[[E,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[E,/ower/,l,ze]],[/mc680.0/i],[[E,"68k"]],[/winnt.+\[axp/i],[[E,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[O,[S,ue],[_,P]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[O,[S,ue],[_,q]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[O,[S,ee],[_,q]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[O,[S,ee],[_,P]],[/(macintosh);/i],[O,[S,ee]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[O,[S,be],[_,q]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[O,[S,se],[_,P]],[/honor([-\w ]+)[;\)]/i],[O,[S,se],[_,q]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[O,[S,re],[_,P]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[O,[S,re],[_,q]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[O,/_/g," "],[S,me],[_,P]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[O,/_/g," "],[S,me],[_,q]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[O,[S,le],[_,q]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[O,[S,pe],[_,q]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[O,[S,Ue,{OnePlus:["203","304","403","404","413","415"],"*":pe}],[_,P]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[O,[S,"BLU"],[_,q]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[O,[S,"Vivo"],[_,q]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[O,[S,"Realme"],[_,q]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[O,[S,ae],[_,P]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[O,[S,ae],[_,q]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[O,[S,ce],[_,q]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[O,[S,ce],[_,P]],[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[O,[S,ne],[_,P]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[O,[S,ne],[_,q]],[/(nokia) (t[12][01])/i],[S,O,[_,P]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[O,/_/g," "],[_,q],[S,"Nokia"]],[/(pixel (c|tablet))\b/i],[O,[S,oe],[_,P]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[O,[S,oe],[_,q]],[/(google) (pixelbook( go)?)/i],[S,O],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[O,[S,he],[_,q]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[O,"Xperia Tablet"],[S,he],[_,P]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[O,[S,Q],[_,P]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[O,/(.+)/g,"Fire Phone $1"],[S,Q],[_,q]],[/(playbook);[-\w\),; ]+(rim)/i],[O,S,[_,P]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[O,[S,te],[_,q]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[O,[S,ie],[_,P]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[O,[S,ie],[_,q]],[/(nexus 9)/i],[O,[S,"HTC"],[_,P]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[S,[O,/_/g," "],[_,q]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[O,[S,"TCL"],[_,P]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[O,[S,"TCL"],[_,q]],[/(itel) ((\w+))/i],[[S,ze],O,[_,Ue,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[O,[S,"Acer"],[_,P]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[O,[S,"Meizu"],[_,q]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[O,[S,"Ulefone"],[_,q]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[O,[S,"Energizer"],[_,q]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[O,[S,"Cat"],[_,q]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[O,[S,"Smartfren"],[_,q]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[O,[S,"Nothing"],[_,q]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[O,[S,"Archos"],[_,P]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[O,[S,"Archos"],[_,q]],[/; (n159v)/i],[O,[S,"HMD"],[_,q]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[S,O,[_,P]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[S,O,[_,q]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[S,O,[_,P]],[/(surface duo)/i],[O,[S,we],[_,P]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[O,[S,"Fairphone"],[_,q]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[O,[S,de],[_,P]],[/(sprint) (\w+)/i],[S,O,[_,q]],[/(kin\.[onetw]{3})/i],[[O,/\./g," "],[S,we],[_,q]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[O,[S,ge],[_,P]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[O,[S,ge],[_,q]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[S,[_,T]],[/hbbtv.+maple;(\d+)/i],[[O,/^/,"SmartTV"],[S,ue],[_,T]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[S,O,[_,T]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[S,ne],[_,T]],[/(apple) ?tv/i],[S,[O,ee+" TV"],[_,T]],[/crkey.*devicetype\/chromecast/i],[[O,ye+" Third Generation"],[S,oe],[_,T]],[/crkey.*devicetype\/([^/]*)/i],[[O,/^/,"Chromecast "],[S,oe],[_,T]],[/fuchsia.*crkey/i],[[O,ye+" Nest Hub"],[S,oe],[_,T]],[/crkey/i],[[O,ye],[S,oe],[_,T]],[/(portaltv)/i],[O,[S,Se],[_,T]],[/droid.+aft(\w+)( bui|\))/i],[O,[S,Q],[_,T]],[/(shield \w+ tv)/i],[O,[S,de],[_,T]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[O,[S,be],[_,T]],[/(bravia[\w ]+)( bui|\))/i],[O,[S,he],[_,T]],[/(mi(tv|box)-?\w+) bui/i],[O,[S,me],[_,T]],[/Hbbtv.*(technisat) (.*);/i],[S,O,[_,T]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[S,/.+\/(\w+)/,"$1",Ue,{LG:"lge"}],[O,De],[_,T]],[/(playstation \w+)/i],[O,[S,he],[_,I]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[O,[S,we],[_,I]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[S,Ue,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],O,[_,I]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[O,[S,ue],[_,N]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[S,O,[_,N]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[O,[S,pe],[_,N]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[O,[S,ee],[_,N]],[/(opwwe\d{3})/i],[O,[S,le],[_,N]],[/(moto 360)/i],[O,[S,ce],[_,N]],[/(smartwatch 3)/i],[O,[S,he],[_,N]],[/(g watch r)/i],[O,[S,ne],[_,N]],[/droid.+; (wt63?0{2,3})\)/i],[O,[S,ge],[_,N]],[/droid.+; (glass) \d/i],[O,[S,oe],[_,V]],[/(pico) ([\w ]+) os\d/i],[S,O,[_,V]],[/(quest( \d| pro)?s?).+vr/i],[O,[S,Se],[_,V]],[/mobile vr; rv.+firefox/i],[[_,V]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[S,[_,R]],[/(aeobc)\b/i],[O,[S,Q],[_,R]],[/(homepod).+mac os/i],[O,[S,ee],[_,R]],[/windows iot/i],[[_,R]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[O,[_,T]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[_,T]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[O,[_,Ue,{mobile:"Mobile",xr:"VR","*":P}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[_,P]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[_,q]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[O,[S,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[C,[x,ke+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[x,C],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[x,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[x,C],[/ladybird\//i],[[x,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[C,x]],os:[[/(windows nt) (6\.[23]); arm/i],[[x,/N/,"R"],[C,Ue,$e]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[x,C],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[C,/(;|\))/g,"",Ue,$e],[x,Oe]],[/(windows ce)\/?([\d\.]*)/i],[x,C],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[C,/_/g,"."],[x,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[x,"macOS"],[C,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[C,[x,ye+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[C,[x,ye+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[C,[x,ye+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[C,[x,ye+" Linux"]],[/crkey\/([\d\.]+)/i],[C,[x,ye]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[C,x],[/(ubuntu) ([\w\.]+) like android/i],[[x,/(.+)/,"$1 Touch"],C],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[x,C],[/\(bb(10);/i],[C,[x,te]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[C,[x,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],[C,[x,xe+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[C,[x,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[C,Ue,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[x,"webOS"]],[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],[C,[x,"watchOS"]],[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],[C,[x,"Chrome OS"]],[/kepler ([\w\.]+); (aft|aeo)/i],[C,[x,"Vega OS"]],[/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[x,C],[/(sunos) ?([\d\.]*)/i],[[x,"Solaris"],C],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[x,C]]},Xe=(je.call((w={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}}).init,[[m,[x,C,A,_]],[g,[E]],[f,[_,O,S]],[v,[x,C]],[y,[x,C]]]),je.call(w.isIgnore,[[m,[C,A]],[v,[C]],[y,[C]]]),je.call(w.isIgnoreRgx,[[m,/ ?browser$/i],[y,/ ?os$/i]]),je.call(w.toString,[[m,[x,C]],[g,[E]],[f,[S,O]],[v,[x,C]],[y,[x,C]]]),w),Je=function(e,i){var t=Xe.init[i],o=Xe.isIgnore[i]||0,r=Xe.isIgnoreRgx[i]||0,a=Xe.toString[i]||0;function s(){je.call(this,t)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return qe?qe.getHighEntropyValues(Z).then(function(i){return e.setCH(new Ke(i,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},i!=k&&(s.prototype.is=function(e){var i=!1;for(var t in this)if(this.hasOwnProperty(t)&&!Te(o,t)&&ze(r?Be(r,this[t]):this[t])==ze(r?Be(r,e):e)){if(i=!0,e!=h)break}else if(e==h&&i){i=!i;break}return i},s.prototype.toString=function(){var e=l;for(var i in a)typeof this[a[i]]!==h&&(e+=(e?" ":l)+this[a[i]]);return e||h}),s.prototype.then=function(e){var i=this,t=function(){for(var e in i)i.hasOwnProperty(e)&&(this[e]=i[e])};t.prototype={is:s.prototype.is,toString:s.prototype.toString,withClientHints:s.prototype.withClientHints,withFeatureCheck:s.prototype.withFeatureCheck};var o=new t;return e(o),o},new s};function Ke(e,i){if(e=e||{},je.call(this,Z),i)je.call(this,[[M,Re(e[U])],[B,Re(e[$])],[q,/\?1/.test(e[X])],[O,He(e[J])],[H,He(e[K])],[D,He(e[Y])],[E,He(e[W])],[j,Re(e[G])],[L,He(e[F])]]);else for(var t in e)this.hasOwnProperty(t)&&typeof e[t]!==h&&(this[t]=e[t])}function Ye(e,i,t,o){return je.call(this,[["itemType",e],["ua",i],["uaCH",o],["rgxMap",t],["data",Je(this,e)]]),this}function Ze(e,i,t){if(typeof e===u?(Ne(e,!0)?(typeof i===u&&(t=i),i=e):(t=e,i=void 0),e=void 0):typeof e!==b||Ne(i,!0)||(t=i,i=void 0),t)if(typeof t.append===p){var o={};t.forEach(function(e,i){o[String(i).toLowerCase()]=e}),t=o}else{var r={};for(var a in t)t.hasOwnProperty(a)&&(r[String(a).toLowerCase()]=t[a]);t=r}if(!(this instanceof Ze))return new Ze(e,i,t).getResult();var s=typeof e===b?e:t&&t[d]?t[d]:Ie&&Ie.userAgent?Ie.userAgent:l,n=new Ke(t,!0),w=i?function(e,i){var t={},o=i;if(!Ne(i))for(var r in o={},i)for(var a in i[r])o[a]=i[r][a].concat(o[a]?o[a]:[]);for(var s in e)t[s]=o[s]&&o[s].length%2==0?o[s].concat(e[s]):e[s];return t}(Ge,i):Ge,c=function(e){return e==k?function(){return new Ye(e,s,w,n).set("ua",s).set(m,this.getBrowser()).set(g,this.getCPU()).set(f,this.getDevice()).set(v,this.getEngine()).set(y,this.getOS()).get()}:function(){return new Ye(e,s,w[e],n).parseUA().get()}};return je.call(this,[["getBrowser",c(m)],["getCPU",c(g)],["getDevice",c(f)],["getEngine",c(v)],["getOS",c(y)],["getResult",c(k)],["getUA",function(){return s}],["setUA",function(e){return Ve(e)&&(s=De(e,500)),this}]]).setUA(s),this}Ye.prototype.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},Ye.prototype.set=function(e,i){return this.data[e]=i,this},Ye.prototype.setCH=function(e){return this.uaCH=e,this},Ye.prototype.detectFeature=function(){if(Ie&&Ie.userAgent==this.ua)switch(this.itemType){case m:Ie.brave&&typeof Ie.brave.isBrave==p&&this.set(x,"Brave");break;case f:!this.get(_)&&qe&&qe[q]&&this.set(_,q),"Macintosh"==this.get(O)&&Ie&&typeof Ie.standalone!==h&&Ie.maxTouchPoints&&Ie.maxTouchPoints>2&&this.set(O,"iPad").set(_,P);break;case y:!this.get(x)&&qe&&qe[H]&&this.set(x,qe[H]);break;case k:var e=this.data,i=function(i){return e[i].getItem().detectFeature().get()};this.set(m,i(m)).set(g,i(g)).set(f,i(f)).set(v,i(v)).set(y,i(y))}return this},Ye.prototype.parseUA=function(){switch(this.itemType!=k&&Le.call(this.data,this.ua,this.rgxMap),this.itemType){case m:this.set(A,Me(this.get(C)));break;case y:if("iOS"==this.get(x)&&"18.6"==this.get(C)){var e=/\) Version\/([\d\.]+)/.exec(this.ua);e&&parseInt(e[1].substring(0,2),10)>=26&&this.set(C,e[1])}}return this},Ye.prototype.parseCH=function(){var e=this.uaCH,i=this.rgxMap;switch(this.itemType){case m:case v:var t,o=e[B]||e[M];if(o)for(var r=0;r<o.length;r++){var a=o[r].brand||o[r],s=o[r].version;this.itemType==m&&!/not.a.brand/i.test(a)&&(!t||/Chrom/.test(t)&&a!=ve||t==ke&&/WebView2/.test(a))&&(a=Ue(a,Fe),(t=this.get(x))&&!/Chrom/.test(t)&&/Chrom/.test(a)||this.set(x,a).set(C,s).set(A,Me(s)),t=a),this.itemType==v&&a==ve&&this.set(C,s)}break;case g:var n=e[E];n&&(n&&"64"==e[L]&&(n+="64"),Le.call(this.data,n+";",i));break;case f:if(e[q]&&this.set(_,q),e[O]&&(this.set(O,e[O]),!this.get(_)||!this.get(S))){var w={};Le.call(w,"droid 9; "+e[O]+")",i),!this.get(_)&&w.type&&this.set(_,w.type),!this.get(S)&&w.vendor&&this.set(S,w.vendor)}if(e[j]){var c;if("string"!=typeof e[j])for(var d=0;!c&&d<e[j].length;)c=Ue(e[j][d++],We);else c=Ue(e[j],We);this.set(_,c)}break;case y:var l=e[H];if(l){var p=e[D];l==Oe&&(p=parseInt(Me(p),10)>=13?"11":"10"),this.set(x,l).set(C,p)}this.get(x)==Oe&&"Xbox"==e[O]&&this.set(x,"Xbox").set(C,void 0);break;case k:var u=this.data,b=function(i){return u[i].getItem().setCH(e).parseCH().get()};this.set(m,b(m)).set(g,b(g)).set(f,b(f)).set(v,b(v)).set(y,b(y))}return this},Ze.VERSION="2.0.9",Ze.BROWSER=Pe([x,C,A,_]),Ze.CPU=Pe([E]),Ze.DEVICE=Pe([O,S,_,I,q,T,P,N,R]),Ze.ENGINE=Ze.OS=Pe([x,C]);const Qe=()=>window.appSdk.getAppId()||window.localStorage.MobileAppId;function ei(e){return((e,i,t)=>window.customI18nObject?.get(`${i}-${e}-${t}`)||e)(e,(()=>{let e=window.sessionStorage.getItem("iportal_app_id");return e||(e=Qe()),e})(),window.localStorage.getItem("iportal_localID")||"zh-CN")}const ii=async e=>{let i=await c.get(`/system/authority/logout?isMobileLogout=${e}`),t=JSON.parse(i.request.response),o=t.code;return"10110020"==o?(window.sessionStorage.clear(),{code:o,message:ei(t.message)}):{code:o,message:ei(t.message)}},ti=async e=>{let t=await ai();return i.AES.decrypt(e,t).toString(i.enc.Utf8)},oi=async e=>{let t=await ai();return i.AES.encrypt(e,t).toString()},ri=async(e,i)=>{let t=await oi(e.password),o={param:{account_view:e.account_view,groupid:e.groupid,password:t,account:e.account,appid:i}},r=await c.post("/ext/loginAccount",JSON.stringify(o)),a=r.data.code,s=r.data.key_code,n=r.data.old_code,w=r.data.id,d=r.data.message;if(10110004==a){s=await ti(s),s=window.appSdk.Encrypt(s),o.param.password=s,r=await c.post(`/system/authority/loginAccount4Application?authPicCode=${e.imageCode}&dataappId=${i}&mobileOrWeb=web`,o.param);let t=JSON.parse(r.request.response);if(a=t.code,d=t.message,10110004==a){let t=w;const o=(new Ze).getBrowser();let r=(new Date).getTime(),s=o.name+"_"+o.version+"_"+r;return window.sessionStorage.setItem("iportal_login_user_id",t),window.sessionStorage.setItem("iportal_group_id",e.groupid),window.sessionStorage.setItem("iportal_login_user_key",n),window.sessionStorage.setItem("iportal_client_id",s),window.sessionStorage.setItem("iportal_app_id",i),{code:a,message:ei(d)}}return{code:a,message:ei(d)}}return{code:a,message:ei(d)}},ai=async()=>(await c.post("/dataservice/rest/orchestration/getViewKey",{param:{}})).data.key;exports.createRegistApply=async e=>{let i={param:{registInfo:e}};return(await c.post("/dataservice/rest/orchestration/createRegistApply",i)).data.operateResult},exports.getAccountCountByName=async e=>{let i={param:{accountName:e}};return(await c.post("/dataservice/rest/orchestration/getAccountCountByName",i)).data.count},exports.getAuthPic=()=>c.get("/system/authority/getAuthPic?module=loginPassword",{responseType:"arraybuffer"}),exports.getViewKey=ai,exports.isSecurityAccount=async(e,i)=>{let t={param:{account_name:e,group_id:i}};return(await c.post("/dataservice/rest/orchestration/isSecurityAccount",t)).data.isSecurityAccount},exports.loginAccount=ri,exports.logoutAccount=ii,exports.serverDecrypt=async e=>{let i={param:{decryptStr:e}};return e=(await c.post("/ext/serverDecrypt",JSON.stringify(i))).data.decryptStr},exports.serverEncrypt=async e=>{let i={param:{encryptStr:e}};return e=(await c.post("/ext/serverEncrypt",JSON.stringify(i))).data.encryptStr},exports.switchPortalLogin=async(e,i,t)=>{let o=window.sessionStorage.getItem("iportal_login_user_key");o=await ti(o),e.password=o;let r=await ii(t),a=r.code,s=r.message;if("10110020"==a){return await ri(e,i)}return{code:a,message:ei(s)}},exports.viewDecrypt=ti,exports.viewEncrypt=oi;
|
|
1
|
+
"use strict";var e=require("axios"),i=require("crypto-js"),t={},o=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function a(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,i){i=i||"";var t,r,s=[];for(r in"string"!=typeof i&&(i="?"),e)if(o.call(e,r)){if((t=e[r])||null!=t&&!isNaN(t)||(t=""),r=a(r),t=a(t),null===r||null===t)continue;s.push(r+"="+t)}return s.length?i+s.join("&"):""},t.parse=function(e){for(var i,t=/([^=?#&]+)=?([^&]*)/g,o={};i=t.exec(e);){var a=r(i[1]),s=r(i[2]);null===a||null===s||a in o||(o[a]=s)}return o};const s="development"===process.env.NODE_ENV,n="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;window.isDevopmentMode=s,window.isOnlineDevelopmentMode=n;var w,c=((i="")=>{i&&(i.startsWith("/")&&(i=i.slice(1,i.length)),i.endsWith("/")&&(i=i.slice(0,-1)));const o=e.create({baseURL:`/${i?i+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(e){return e>=200&&e<300},headers:window.location.search&&t.parse(window.location.search).token||window.token?{token:t.parse(window.location.search).token||window.token}:{}});let r=o.post;return o.post=(e,i,t)=>{let a=window.VITE_SERVICE_BASE_URL||"";if(a){let s=a+e;return r.call(o,s,i,t)}return r.call(o,e,i,t)},o.interceptors.request.use(e=>{if(!n&&s){let i=window.mockData.PORTAL_SERVER_ADDRESS,t=window.mockData.VITE_SERVICE_BASE_URL;e.url=`${i}${t}${e.url}`}return e},e=>Promise.reject(e)),o.defaults.headers.post["Content-Type"]="application/json",o.interceptors.response.use(e=>{let{data:i}=e;return"string"==typeof i&&(i=JSON.parse(i)),!i||200===i.status||i instanceof Blob?i instanceof Blob?(e.data=i,e):(e.data=i&&i.result,e):Promise.reject(e)},e=>{if(!e.response||401!==e.response.status)return Promise.reject(e.response)}),o})(window.prefixPath||""),d="user-agent",l="",p="function",u="object",b="string",h="undefined",m="browser",g="cpu",f="device",v="engine",y="os",k="result",x="name",_="type",S="vendor",C="version",E="architecture",O="major",A="model",I="console",q="mobile",P="tablet",T="smarttv",N="wearable",V="xr",M="embedded",R="inapp",z="brands",j="formFactors",B="fullVersionList",D="platform",H="platformVersion",L="bitness",U="sec-ch-ua",$=U+"-full-version-list",W=U+"-arch",F=U+"-"+L,G=U+"-form-factors",X=U+"-"+q,J=U+"-"+A,K=U+"-"+D,Y=K+"-version",Z=[z,B,q,A,D,H,E,j,L],Q="Amazon",ee="Apple",ie="ASUS",te="BlackBerry",oe="Google",re="Huawei",ae="Lenovo",se="Honor",ne="LG",we="Microsoft",ce="Motorola",de="Nvidia",le="OnePlus",pe="OPPO",ue="Samsung",be="Sharp",he="Sony",me="Xiaomi",ge="Zebra",fe="Chrome",ve="Chromium",ye="Chromecast",ke="Edge",xe="Firefox",_e="Opera",Se="Facebook",Ce="Sogou",Ee="Mobile ",Oe=" Browser",Ae="Windows",Ie=typeof window!==h&&window.navigator?window.navigator:void 0,qe=Ie&&Ie.userAgentData?Ie.userAgentData:void 0,Pe=function(e){for(var i={},t=0;t<e.length;t++)i[e[t].toUpperCase()]=e[t];return i},Te=function(e,i){if(typeof e===u&&e.length>0){for(var t in e)if(Re(i)==Re(e[t]))return!0;return!1}return!!Ve(e)&&Re(i)==Re(e)},Ne=function(e,i){for(var t in e)return/^(browser|cpu|device|engine|os)$/.test(t)||!!i&&Ne(e[t])},Ve=function(e){return typeof e===b},Me=function(e){if(e){for(var i=[],t=Be(/\\?\"/g,e).split(","),o=0;o<t.length;o++)if(t[o].indexOf(";")>-1){var r=He(t[o]).split(";v=");i[o]={brand:r[0],version:r[1]}}else i[o]=He(t[o]);return i}},Re=function(e){return Ve(e)?e.toLowerCase():e},ze=function(e){return Ve(e)?Be(/[^\d\.]/g,e).split(".")[0]:void 0},je=function(e){for(var i in e)if(e.hasOwnProperty(i)){var t=e[i];typeof t==u&&2==t.length?this[t[0]]=t[1]:this[t]=void 0}return this},Be=function(e,i){return Ve(i)?i.replace(e,l):i},De=function(e){return Be(/\\?\"/g,e)},He=function(e,i){return e=Be(/^\s\s*/,String(e)),typeof i===h?e:e.substring(0,i)},Le=function(e,i){if(e&&i)for(var t,o,r,a,s,n,w=0;w<i.length&&!s;){var c=i[w],d=i[w+1];for(t=o=0;t<c.length&&!s&&c[t];)if(s=c[t++].exec(e))for(r=0;r<d.length;r++)n=s[++o],typeof(a=d[r])===u&&a.length>0?2===a.length?typeof a[1]==p?this[a[0]]=a[1].call(this,n):this[a[0]]=a[1]:a.length>=3&&(typeof a[1]!==p||a[1].exec&&a[1].test?3==a.length?this[a[0]]=n?n.replace(a[1],a[2]):void 0:4==a.length?this[a[0]]=n?a[3].call(this,n.replace(a[1],a[2])):void 0:a.length>4&&(this[a[0]]=n?a[3].apply(this,[n.replace(a[1],a[2])].concat(a.slice(4))):void 0):a.length>3?this[a[0]]=n?a[1].apply(this,a.slice(2)):void 0:this[a[0]]=n?a[1].call(this,n,a[2]):void 0):this[a]=n||void 0;w+=2}},Ue=function(e,i){for(var t in i)if(typeof i[t]===u&&i[t].length>0){for(var o=0;o<i[t].length;o++)if(Te(i[t][o],e))return"?"===t?void 0:t}else if(Te(i[t],e))return"?"===t?void 0:t;return i.hasOwnProperty("*")?i["*"]:e},$e={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2",8.1:"6.3",10:["6.4","10.0"],NT:""},We={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Fe={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Ge={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[C,[x,Ee+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[C,[x,ke+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[C,[x,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[x,C],[/opios[\/ ]+([\w\.]+)/i],[C,[x,_e+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[C,[x,_e+" GX"]],[/\bopr\/([\w\.]+)/i],[C,[x,_e]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[C,[x,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[C,[x,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,/(brave)(?: chrome)?\/([\d\.]+)/i,/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[x,C],[/quark(?:pc)?\/([-\w\.]+)/i],[C,[x,"Quark"]],[/\bddg\/([\w\.]+)/i],[C,[x,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[C,[x,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[C,[x,"WeChat"]],[/konqueror\/([\w\.]+)/i],[C,[x,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[C,[x,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[C,[x,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[C,[x,"Smart "+ae+Oe]],[/(av(?:ast|g|ira))\/([\w\.]+)/i],[[x,/(.+)/,"$1 Secure"+Oe],C],[/norton\/([\w\.]+)/i],[C,[x,"Norton Private"+Oe]],[/\bfocus\/([\w\.]+)/i],[C,[x,xe+" Focus"]],[/ mms\/([\w\.]+)$/i],[C,[x,_e+" Neon"]],[/ opt\/([\w\.]+)$/i],[C,[x,_e+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[C,[x,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[C,[x,"Dolphin"]],[/coast\/([\w\.]+)/i],[C,[x,_e+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[C,[x,"MIUI"+Oe]],[/fxios\/([\w\.-]+)/i],[C,[x,Ee+xe]],[/\bqihoobrowser\/?([\w\.]*)/i],[C,[x,"360"]],[/\b(qq)\/([\w\.]+)/i],[[x,/(.+)/,"$1Browser"],C],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[x,/(.+)/,"$1"+Oe],C],[/samsungbrowser\/([\w\.]+)/i],[C,[x,ue+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[C,[x,Ce+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[x,Ce+" Mobile"],C],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[x,C],[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],[x],[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],[C,x],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[x,Se],C,[_,R]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[x,C,[_,R]],[/\bgsa\/([\w\.]+) .*safari\//i],[C,[x,"GSA"],[_,R]],[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],[C,[x,"TikTok"],[_,R]],[/\[(linkedin)app\]/i],[x,[_,R]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[x,/(.+)/,"Zalo"],C,[_,R]],[/(chromium)[\/ ]([-\w\.]+)/i],[x,C],[/ome-(lighthouse)$/i],[x,[_,"fetcher"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[C,[x,fe+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[C,[x,ke+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[x,fe+" WebView"],C],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[C,[x,"Android"+Oe]],[/chrome\/([\w\.]+) mobile/i],[C,[x,Ee+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[x,C],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[C,[x,Ee+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[x,Ee+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[C,x],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[x,[C,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[x,C],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[x,Ee+xe],C],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[x,"Netscape"],C],[/(wolvic|librewolf)\/([\w\.]+)/i],[x,C],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[C,[x,xe+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[x,[C,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[x,[C,/[^\d\.]+./,l]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[E,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[E,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[E,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[E,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[E,"arm"]],[/ sun4\w[;\)]/i],[[E,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[E,/ower/,l,Re]],[/mc680.0/i],[[E,"68k"]],[/winnt.+\[axp/i],[[E,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[A,[S,ue],[_,P]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[A,[S,ue],[_,q]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[A,[S,ee],[_,q]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[A,[S,ee],[_,P]],[/(macintosh);/i],[A,[S,ee]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[A,[S,be],[_,q]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[A,[S,se],[_,P]],[/honor([-\w ]+)[;\)]/i],[A,[S,se],[_,q]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[A,[S,re],[_,P]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[A,[S,re],[_,q]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[A,/_/g," "],[S,me],[_,P]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[A,/_/g," "],[S,me],[_,q]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[A,[S,le],[_,q]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[A,[S,pe],[_,q]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[A,[S,Ue,{OnePlus:["203","304","403","404","413","415"],"*":pe}],[_,P]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[A,[S,"BLU"],[_,q]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[A,[S,"Vivo"],[_,q]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[A,[S,"Realme"],[_,q]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[A,[S,ae],[_,P]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[A,[S,ae],[_,q]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[A,[S,ce],[_,q]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[A,[S,ce],[_,P]],[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[A,[S,ne],[_,P]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[A,[S,ne],[_,q]],[/(nokia) (t[12][01])/i],[S,A,[_,P]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[A,/_/g," "],[_,q],[S,"Nokia"]],[/(pixel (c|tablet))\b/i],[A,[S,oe],[_,P]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[A,[S,oe],[_,q]],[/(google) (pixelbook( go)?)/i],[S,A],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[A,[S,he],[_,q]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[A,"Xperia Tablet"],[S,he],[_,P]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[A,[S,Q],[_,P]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[A,/(.+)/g,"Fire Phone $1"],[S,Q],[_,q]],[/(playbook);[-\w\),; ]+(rim)/i],[A,S,[_,P]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[A,[S,te],[_,q]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[A,[S,ie],[_,P]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[A,[S,ie],[_,q]],[/(nexus 9)/i],[A,[S,"HTC"],[_,P]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[S,[A,/_/g," "],[_,q]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[A,[S,"TCL"],[_,P]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[A,[S,"TCL"],[_,q]],[/(itel) ((\w+))/i],[[S,Re],A,[_,Ue,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[A,[S,"Acer"],[_,P]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[A,[S,"Meizu"],[_,q]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[A,[S,"Ulefone"],[_,q]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[A,[S,"Energizer"],[_,q]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[A,[S,"Cat"],[_,q]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[A,[S,"Smartfren"],[_,q]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[A,[S,"Nothing"],[_,q]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[A,[S,"Archos"],[_,P]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[A,[S,"Archos"],[_,q]],[/; (n159v)/i],[A,[S,"HMD"],[_,q]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[S,A,[_,P]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[S,A,[_,q]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[S,A,[_,P]],[/(surface duo)/i],[A,[S,we],[_,P]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[A,[S,"Fairphone"],[_,q]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[A,[S,de],[_,P]],[/(sprint) (\w+)/i],[S,A,[_,q]],[/(kin\.[onetw]{3})/i],[[A,/\./g," "],[S,we],[_,q]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[A,[S,ge],[_,P]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[A,[S,ge],[_,q]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[S,[_,T]],[/hbbtv.+maple;(\d+)/i],[[A,/^/,"SmartTV"],[S,ue],[_,T]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[S,A,[_,T]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[S,ne],[_,T]],[/(apple) ?tv/i],[S,[A,ee+" TV"],[_,T]],[/crkey.*devicetype\/chromecast/i],[[A,ye+" Third Generation"],[S,oe],[_,T]],[/crkey.*devicetype\/([^/]*)/i],[[A,/^/,"Chromecast "],[S,oe],[_,T]],[/fuchsia.*crkey/i],[[A,ye+" Nest Hub"],[S,oe],[_,T]],[/crkey/i],[[A,ye],[S,oe],[_,T]],[/(portaltv)/i],[A,[S,Se],[_,T]],[/droid.+aft(\w+)( bui|\))/i],[A,[S,Q],[_,T]],[/(shield \w+ tv)/i],[A,[S,de],[_,T]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[A,[S,be],[_,T]],[/(bravia[\w ]+)( bui|\))/i],[A,[S,he],[_,T]],[/(mi(tv|box)-?\w+) bui/i],[A,[S,me],[_,T]],[/Hbbtv.*(technisat) (.*);/i],[S,A,[_,T]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[S,/.+\/(\w+)/,"$1",Ue,{LG:"lge"}],[A,He],[_,T]],[/(playstation \w+)/i],[A,[S,he],[_,I]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[A,[S,we],[_,I]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[S,Ue,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],A,[_,I]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[A,[S,ue],[_,N]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[S,A,[_,N]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[A,[S,pe],[_,N]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[A,[S,ee],[_,N]],[/(opwwe\d{3})/i],[A,[S,le],[_,N]],[/(moto 360)/i],[A,[S,ce],[_,N]],[/(smartwatch 3)/i],[A,[S,he],[_,N]],[/(g watch r)/i],[A,[S,ne],[_,N]],[/droid.+; (wt63?0{2,3})\)/i],[A,[S,ge],[_,N]],[/droid.+; (glass) \d/i],[A,[S,oe],[_,V]],[/(pico) ([\w ]+) os\d/i],[S,A,[_,V]],[/(quest( \d| pro)?s?).+vr/i],[A,[S,Se],[_,V]],[/mobile vr; rv.+firefox/i],[[_,V]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[S,[_,M]],[/(aeobc)\b/i],[A,[S,Q],[_,M]],[/(homepod).+mac os/i],[A,[S,ee],[_,M]],[/windows iot/i],[[_,M]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[A,[_,T]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[_,T]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[A,[_,Ue,{mobile:"Mobile",xr:"VR","*":P}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[_,P]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[_,q]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[A,[S,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[C,[x,ke+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[x,C],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[x,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[x,C],[/ladybird\//i],[[x,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[C,x]],os:[[/(windows nt) (6\.[23]); arm/i],[[x,/N/,"R"],[C,Ue,$e]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[x,C],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[C,/(;|\))/g,"",Ue,$e],[x,Ae]],[/(windows ce)\/?([\d\.]*)/i],[x,C],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[C,/_/g,"."],[x,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[x,"macOS"],[C,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[C,[x,ye+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[C,[x,ye+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[C,[x,ye+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[C,[x,ye+" Linux"]],[/crkey\/([\d\.]+)/i],[C,[x,ye]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[C,x],[/(ubuntu) ([\w\.]+) like android/i],[[x,/(.+)/,"$1 Touch"],C],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[x,C],[/\(bb(10);/i],[C,[x,te]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[C,[x,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],[C,[x,xe+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[C,[x,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[C,Ue,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[x,"webOS"]],[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],[C,[x,"watchOS"]],[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],[C,[x,"Chrome OS"]],[/kepler ([\w\.]+); (aft|aeo)/i],[C,[x,"Vega OS"]],[/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[x,C],[/(sunos) ?([\d\.]*)/i],[[x,"Solaris"],C],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[x,C]]},Xe=(je.call((w={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}}).init,[[m,[x,C,O,_]],[g,[E]],[f,[_,A,S]],[v,[x,C]],[y,[x,C]]]),je.call(w.isIgnore,[[m,[C,O]],[v,[C]],[y,[C]]]),je.call(w.isIgnoreRgx,[[m,/ ?browser$/i],[y,/ ?os$/i]]),je.call(w.toString,[[m,[x,C]],[g,[E]],[f,[S,A]],[v,[x,C]],[y,[x,C]]]),w),Je=function(e,i){var t=Xe.init[i],o=Xe.isIgnore[i]||0,r=Xe.isIgnoreRgx[i]||0,a=Xe.toString[i]||0;function s(){je.call(this,t)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return qe?qe.getHighEntropyValues(Z).then(function(i){return e.setCH(new Ke(i,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},i!=k&&(s.prototype.is=function(e){var i=!1;for(var t in this)if(this.hasOwnProperty(t)&&!Te(o,t)&&Re(r?Be(r,this[t]):this[t])==Re(r?Be(r,e):e)){if(i=!0,e!=h)break}else if(e==h&&i){i=!i;break}return i},s.prototype.toString=function(){var e=l;for(var i in a)typeof this[a[i]]!==h&&(e+=(e?" ":l)+this[a[i]]);return e||h}),s.prototype.then=function(e){var i=this,t=function(){for(var e in i)i.hasOwnProperty(e)&&(this[e]=i[e])};t.prototype={is:s.prototype.is,toString:s.prototype.toString,withClientHints:s.prototype.withClientHints,withFeatureCheck:s.prototype.withFeatureCheck};var o=new t;return e(o),o},new s};function Ke(e,i){if(e=e||{},je.call(this,Z),i)je.call(this,[[z,Me(e[U])],[B,Me(e[$])],[q,/\?1/.test(e[X])],[A,De(e[J])],[D,De(e[K])],[H,De(e[Y])],[E,De(e[W])],[j,Me(e[G])],[L,De(e[F])]]);else for(var t in e)this.hasOwnProperty(t)&&typeof e[t]!==h&&(this[t]=e[t])}function Ye(e,i,t,o){return je.call(this,[["itemType",e],["ua",i],["uaCH",o],["rgxMap",t],["data",Je(this,e)]]),this}function Ze(e,i,t){if(typeof e===u?(Ne(e,!0)?(typeof i===u&&(t=i),i=e):(t=e,i=void 0),e=void 0):typeof e!==b||Ne(i,!0)||(t=i,i=void 0),t)if(typeof t.append===p){var o={};t.forEach(function(e,i){o[String(i).toLowerCase()]=e}),t=o}else{var r={};for(var a in t)t.hasOwnProperty(a)&&(r[String(a).toLowerCase()]=t[a]);t=r}if(!(this instanceof Ze))return new Ze(e,i,t).getResult();var s=typeof e===b?e:t&&t[d]?t[d]:Ie&&Ie.userAgent?Ie.userAgent:l,n=new Ke(t,!0),w=i?function(e,i){var t={},o=i;if(!Ne(i))for(var r in o={},i)for(var a in i[r])o[a]=i[r][a].concat(o[a]?o[a]:[]);for(var s in e)t[s]=o[s]&&o[s].length%2==0?o[s].concat(e[s]):e[s];return t}(Ge,i):Ge,c=function(e){return e==k?function(){return new Ye(e,s,w,n).set("ua",s).set(m,this.getBrowser()).set(g,this.getCPU()).set(f,this.getDevice()).set(v,this.getEngine()).set(y,this.getOS()).get()}:function(){return new Ye(e,s,w[e],n).parseUA().get()}};return je.call(this,[["getBrowser",c(m)],["getCPU",c(g)],["getDevice",c(f)],["getEngine",c(v)],["getOS",c(y)],["getResult",c(k)],["getUA",function(){return s}],["setUA",function(e){return Ve(e)&&(s=He(e,500)),this}]]).setUA(s),this}Ye.prototype.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},Ye.prototype.set=function(e,i){return this.data[e]=i,this},Ye.prototype.setCH=function(e){return this.uaCH=e,this},Ye.prototype.detectFeature=function(){if(Ie&&Ie.userAgent==this.ua)switch(this.itemType){case m:Ie.brave&&typeof Ie.brave.isBrave==p&&this.set(x,"Brave");break;case f:!this.get(_)&&qe&&qe[q]&&this.set(_,q),"Macintosh"==this.get(A)&&Ie&&typeof Ie.standalone!==h&&Ie.maxTouchPoints&&Ie.maxTouchPoints>2&&this.set(A,"iPad").set(_,P);break;case y:!this.get(x)&&qe&&qe[D]&&this.set(x,qe[D]);break;case k:var e=this.data,i=function(i){return e[i].getItem().detectFeature().get()};this.set(m,i(m)).set(g,i(g)).set(f,i(f)).set(v,i(v)).set(y,i(y))}return this},Ye.prototype.parseUA=function(){switch(this.itemType!=k&&Le.call(this.data,this.ua,this.rgxMap),this.itemType){case m:this.set(O,ze(this.get(C)));break;case y:if("iOS"==this.get(x)&&"18.6"==this.get(C)){var e=/\) Version\/([\d\.]+)/.exec(this.ua);e&&parseInt(e[1].substring(0,2),10)>=26&&this.set(C,e[1])}}return this},Ye.prototype.parseCH=function(){var e=this.uaCH,i=this.rgxMap;switch(this.itemType){case m:case v:var t,o=e[B]||e[z];if(o)for(var r=0;r<o.length;r++){var a=o[r].brand||o[r],s=o[r].version;this.itemType==m&&!/not.a.brand/i.test(a)&&(!t||/Chrom/.test(t)&&a!=ve||t==ke&&/WebView2/.test(a))&&(a=Ue(a,Fe),(t=this.get(x))&&!/Chrom/.test(t)&&/Chrom/.test(a)||this.set(x,a).set(C,s).set(O,ze(s)),t=a),this.itemType==v&&a==ve&&this.set(C,s)}break;case g:var n=e[E];n&&(n&&"64"==e[L]&&(n+="64"),Le.call(this.data,n+";",i));break;case f:if(e[q]&&this.set(_,q),e[A]&&(this.set(A,e[A]),!this.get(_)||!this.get(S))){var w={};Le.call(w,"droid 9; "+e[A]+")",i),!this.get(_)&&w.type&&this.set(_,w.type),!this.get(S)&&w.vendor&&this.set(S,w.vendor)}if(e[j]){var c;if("string"!=typeof e[j])for(var d=0;!c&&d<e[j].length;)c=Ue(e[j][d++],We);else c=Ue(e[j],We);this.set(_,c)}break;case y:var l=e[D];if(l){var p=e[H];l==Ae&&(p=parseInt(ze(p),10)>=13?"11":"10"),this.set(x,l).set(C,p)}this.get(x)==Ae&&"Xbox"==e[A]&&this.set(x,"Xbox").set(C,void 0);break;case k:var u=this.data,b=function(i){return u[i].getItem().setCH(e).parseCH().get()};this.set(m,b(m)).set(g,b(g)).set(f,b(f)).set(v,b(v)).set(y,b(y))}return this},Ze.VERSION="2.0.9",Ze.BROWSER=Pe([x,C,O,_]),Ze.CPU=Pe([E]),Ze.DEVICE=Pe([A,S,_,I,q,T,P,N,M]),Ze.ENGINE=Ze.OS=Pe([x,C]);const Qe=()=>window.appSdk.getAppId()||window.localStorage.MobileAppId;function ei(e){return((e,i,t)=>window.customI18nObject?.get(`${i}-${e}-${t}`)||e)(e,(()=>{let e=window.sessionStorage.getItem("iportal_app_id");return e||(e=Qe()),e})(),window.localStorage.getItem("iportal_localID")||"zh-CN")}const ii=async e=>{let i=await c.get(`/system/authority/logout?isMobileLogout=${e}`),t=JSON.parse(i.request.response),o=t.code;return"10110020"==o?(window.sessionStorage.clear(),{code:o,message:ei(t.message)}):{code:o,message:ei(t.message)}},ti=async e=>{let t=await ai();return i.AES.decrypt(e,t).toString(i.enc.Utf8)},oi=async e=>{let t=await ai();return i.AES.encrypt(e,t).toString()},ri=async(e,i)=>{let t=await oi(e.password),o={param:{account_view:e.account_view,groupid:e.groupid,password:t,account:e.account,appid:i}},r=await c.post("/ext/loginAccount",JSON.stringify(o)),a=r.data.code,s=r.data.key_code,n=r.data.old_code,w=r.data.id,d=r.data.message;if(10110004==a){s=await ti(s),s=window.appSdk.Encrypt(s),o.param.password=s,r=await c.post(`/system/authority/loginAccount4Application?authPicCode=${e.imageCode}&dataappId=${i}&mobileOrWeb=web`,o.param);let t=JSON.parse(r.request.response);if(a=t.code,d=t.message,10110004==a){let t=w;const o=(new Ze).getBrowser();let r=(new Date).getTime(),s=o.name+"_"+o.version+"_"+r;return window.sessionStorage.setItem("iportal_login_user_id",t),window.sessionStorage.setItem("iportal_group_id",e.groupid),window.sessionStorage.setItem("iportal_login_user_key",n),window.sessionStorage.setItem("iportal_client_id",s),window.sessionStorage.setItem("iportal_app_id",i),{code:a,message:ei(d)}}return{code:a,message:ei(d)}}return{code:a,message:ei(d)}},ai=async()=>(await c.post("/dataservice/rest/orchestration/getViewKey",{param:{}})).data.key;exports.createRegistApply=async e=>{let i={param:{registInfo:e}};return(await c.post("/dataservice/rest/orchestration/createRegistApply",i)).data.operateResult},exports.getAccountCountByName=async e=>{let i={param:{accountName:e}};return(await c.post("/dataservice/rest/orchestration/getAccountCountByName",i)).data.count},exports.getAuthPic=()=>c.get("/system/authority/getAuthPic?module=loginPassword",{responseType:"arraybuffer"}),exports.getViewKey=ai,exports.isSecurityAccount=async(e,i)=>{let t={param:{account_name:e,group_id:i}};return(await c.post("/dataservice/rest/orchestration/isSecurityAccount",t)).data.isSecurityAccount},exports.loginAccount=ri,exports.logoutAccount=ii,exports.serverDecrypt=async e=>{let i={param:{decryptStr:e}};return e=(await c.post("/ext/serverDecrypt",JSON.stringify(i))).data.decryptStr},exports.serverEncrypt=async e=>{let i={param:{encryptStr:e}};return e=(await c.post("/ext/serverEncrypt",JSON.stringify(i))).data.encryptStr},exports.switchPortalLogin=async(e,i,t)=>{let o=window.sessionStorage.getItem("iportal_login_user_key");o=await ti(o),e.password=o;let r=await ii(t),a=r.code,s=r.message;if("10110020"==a){return await ri(e,i)}return{code:a,message:ei(s)}},exports.viewDecrypt=ti,exports.viewEncrypt=oi;
|
package/dist/cjs/sms.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("axios"),t={},n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,s,a=[];for(s in"string"!=typeof t&&(t="?"),e)if(n.call(e,s)){if((r=e[s])||null!=r&&!isNaN(r)||(r=""),s=o(s),r=o(r),null===s||null===r)continue;a.push(s+"="+r)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,o={};t=n.exec(e);){var s=r(t[1]),a=r(t[2]);null===s||null===a||s in o||(o[s]=a)}return o};const s="development"===process.env.NODE_ENV,a="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;var i=((n="")=>{n&&(n.startsWith("/")&&(n=n.slice(1,n.length)),n.endsWith("/")&&(n=n.slice(0,-1)));const r=e.create({baseURL:`/${n?n+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(e){return e>=200&&e<300},headers:window.location.search&&t.parse(window.location.search).token||window.token?{token:t.parse(window.location.search).token||window.token}:{}});let o=r.post;return r.post=(e,t,n)=>{let s=window.VITE_SERVICE_BASE_URL||"";if(s){let a=s+e;return o.call(r,a,t,n)}return o.call(r,e,t,n)},r.interceptors.request.use(e=>{if(!a&&s){let t=window.mockData.PORTAL_SERVER_ADDRESS,n=window.mockData.VITE_SERVICE_BASE_URL;e.url=`${t}${n}${e.url}`}return e},e=>Promise.reject(e)),r.defaults.headers.post["Content-Type"]="application/json",r.interceptors.response.use(e=>{let{data:t}=e;return"string"==typeof t&&(t=JSON.parse(t)),!t||200===t.status||t instanceof Blob?t instanceof Blob?(e.data=t,e):(e.data=t&&t.result,e):Promise.reject(e)},e=>{if(!e.response||401!==e.response.status)return Promise.reject(e.response)}),r})(window.prefixPath||"");exports.isSMSCodeValidate=async(e,t,n,r)=>{let o={param:{smsCode:e,sms_service_name_type:t,beyond_type_id:n,account_id:r}};return(await i.post("/ext/validateSMSCode",JSON.stringify(o))).data},exports.sendSms=async(e,t,n)=>{let r={param:e};i.post("/ext/sendSms",JSON.stringify(r)).then(e=>{console.log("发送消息成功:",e),t&&t(e)}).catch(e=>{console.error("发送消息失败:",e),n&&n(e)})};
|
|
1
|
+
"use strict";var e=require("axios"),t={},n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,s,a=[];for(s in"string"!=typeof t&&(t="?"),e)if(n.call(e,s)){if((r=e[s])||null!=r&&!isNaN(r)||(r=""),s=o(s),r=o(r),null===s||null===r)continue;a.push(s+"="+r)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,o={};t=n.exec(e);){var s=r(t[1]),a=r(t[2]);null===s||null===a||s in o||(o[s]=a)}return o};const s="development"===process.env.NODE_ENV,a="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;window.isDevopmentMode=s,window.isOnlineDevelopmentMode=a;var i=((n="")=>{n&&(n.startsWith("/")&&(n=n.slice(1,n.length)),n.endsWith("/")&&(n=n.slice(0,-1)));const r=e.create({baseURL:`/${n?n+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(e){return e>=200&&e<300},headers:window.location.search&&t.parse(window.location.search).token||window.token?{token:t.parse(window.location.search).token||window.token}:{}});let o=r.post;return r.post=(e,t,n)=>{let s=window.VITE_SERVICE_BASE_URL||"";if(s){let a=s+e;return o.call(r,a,t,n)}return o.call(r,e,t,n)},r.interceptors.request.use(e=>{if(!a&&s){let t=window.mockData.PORTAL_SERVER_ADDRESS,n=window.mockData.VITE_SERVICE_BASE_URL;e.url=`${t}${n}${e.url}`}return e},e=>Promise.reject(e)),r.defaults.headers.post["Content-Type"]="application/json",r.interceptors.response.use(e=>{let{data:t}=e;return"string"==typeof t&&(t=JSON.parse(t)),!t||200===t.status||t instanceof Blob?t instanceof Blob?(e.data=t,e):(e.data=t&&t.result,e):Promise.reject(e)},e=>{if(!e.response||401!==e.response.status)return Promise.reject(e.response)}),r})(window.prefixPath||"");exports.isSMSCodeValidate=async(e,t,n,r)=>{let o={param:{smsCode:e,sms_service_name_type:t,beyond_type_id:n,account_id:r}};return(await i.post("/ext/validateSMSCode",JSON.stringify(o))).data},exports.sendSms=async(e,t,n)=>{let r={param:e};i.post("/ext/sendSms",JSON.stringify(r)).then(e=>{console.log("发送消息成功:",e),t&&t(e)}).catch(e=>{console.error("发送消息失败:",e),n&&n(e)})};
|
package/dist/cjs/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("axios"),t={},r=Object.prototype.hasOwnProperty;function n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function
|
|
1
|
+
"use strict";var e=require("axios"),t={},r=Object.prototype.hasOwnProperty;function n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,s,a=[];for(s in"string"!=typeof t&&(t="?"),e)if(r.call(e,s)){if((n=e[s])||null!=n&&!isNaN(n)||(n=""),s=o(s),n=o(n),null===s||null===n)continue;a.push(s+"="+n)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,o={};t=r.exec(e);){var s=n(t[1]),a=n(t[2]);null===s||null===a||s in o||(o[s]=a)}return o};const s="development"===process.env.NODE_ENV,a="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;window.isDevopmentMode=s,window.isOnlineDevelopmentMode=a;var i=((r="")=>{r&&(r.startsWith("/")&&(r=r.slice(1,r.length)),r.endsWith("/")&&(r=r.slice(0,-1)));const n=e.create({baseURL:`/${r?r+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(e){return e>=200&&e<300},headers:window.location.search&&t.parse(window.location.search).token||window.token?{token:t.parse(window.location.search).token||window.token}:{}});let o=n.post;return n.post=(e,t,r)=>{let s=window.VITE_SERVICE_BASE_URL||"";if(s){let a=s+e;return o.call(n,a,t,r)}return o.call(n,e,t,r)},n.interceptors.request.use(e=>{if(!a&&s){let t=window.mockData.PORTAL_SERVER_ADDRESS,r=window.mockData.VITE_SERVICE_BASE_URL;e.url=`${t}${r}${e.url}`}return e},e=>Promise.reject(e)),n.defaults.headers.post["Content-Type"]="application/json",n.interceptors.response.use(e=>{let{data:t}=e;return"string"==typeof t&&(t=JSON.parse(t)),!t||200===t.status||t instanceof Blob?t instanceof Blob?(e.data=t,e):(e.data=t&&t.result,e):Promise.reject(e)},e=>{if(!e.response||401!==e.response.status)return Promise.reject(e.response)}),n})(window.prefixPath||"");const l=e=>{try{return new URL(e).pathname.split("/").pop()||"downloaded_file"}catch(e){return"downloaded_file"}};exports.createFileFromUrl=async(e,t)=>{try{const r=await fetch(e);if(!r.ok)throw new Error(`网络请求失败: ${r.status} ${r.statusText}`);const n=await r.blob(),o=t||l(e);return new File([n],o,{type:n.type,lastModified:Date.now()})}catch(e){throw console.error("创建 File 失败:",e),e}},exports.doRestPost=async(e,t)=>await i.post(e,t),exports.extractFilenameFromUrl=l,exports.extractNewItems=(e,t)=>e.filter(e=>!t.includes(e)),exports.findClosestAncestorByClass=(e,t)=>{let r=e;for(;r;){if(r.classList&&r.classList.contains(t))return r;r=r.parentElement}return null},exports.getClientIp=async()=>{let e=await i.post("/ext/getClientIp"),t=e?.data?.clientIp;return t},exports.getFileSize=async e=>{try{const t=await fetch(e,{method:"GET",headers:{Range:"bytes=0-0"}});if(206!==t.status)throw new Error("不支持 Range 请求");const r=t.headers.get("Content-Range"),n=r?.match(/\/(\d+)$/)?.[1];return n?parseInt(n,10):-1}catch(e){return console.error("获取文件大小失败:",e),-1}},exports.getI18nKey=e=>{let t=/\$L\{([^}]+)\}/g.exec(e);return t?t[1]:e},exports.getUrlParamValue=(e,t)=>{try{const r=new URL(e).searchParams.get(t);return r&&-1!==r.indexOf("#")?r.split("#")[0]:r}catch(e){return console.error("URL 格式错误:",e),""}},exports.getWebURL=e=>{let t="";if(!window.isOnlineDevelopmentMode&&window.isDevopmentMode){t=window.mockData.PORTAL_SERVER_ADDRESS}return`${t}${e}`},exports.hasUrlParams=e=>{try{return new URL(e,window.location.href).search.length>0}catch(e){return!1}},exports.queryAssetById=(e,t=200)=>i.post(`/asset/getAssetData?asset_id=${e}&count=${t}`,{filters:[]});
|
package/dist/esm/chat.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"axios";var e={},a=Object.prototype.hasOwnProperty;function s(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function i(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var s,n,r=[];for(n in"string"!=typeof e&&(e="?"),t)if(a.call(t,n)){if((s=t[n])||null!=s&&!isNaN(s)||(s=""),n=i(n),s=i(s),null===n||null===s)continue;r.push(n+"="+s)}return r.length?e+r.join("&"):""},e.parse=function(t){for(var e,a=/([^=?#&]+)=?([^&]*)/g,i={};e=a.exec(t);){var n=s(e[1]),r=s(e[2]);null===n||null===r||n in i||(i[n]=r)}return i};const n="development"===process.env.NODE_ENV,r="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;var o=((a="")=>{a&&(a.startsWith("/")&&(a=a.slice(1,a.length)),a.endsWith("/")&&(a=a.slice(0,-1)));const s=t.create({baseURL:`/${a?a+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(t){return t>=200&&t<300},headers:window.location.search&&e.parse(window.location.search).token||window.token?{token:e.parse(window.location.search).token||window.token}:{}});let i=s.post;return s.post=(t,e,a)=>{let n=window.VITE_SERVICE_BASE_URL||"";if(n){let r=n+t;return i.call(s,r,e,a)}return i.call(s,t,e,a)},s.interceptors.request.use(t=>{if(!r&&n){let e=window.mockData.PORTAL_SERVER_ADDRESS,a=window.mockData.VITE_SERVICE_BASE_URL;t.url=`${e}${a}${t.url}`}return t},t=>Promise.reject(t)),s.defaults.headers.post["Content-Type"]="application/json",s.interceptors.response.use(t=>{let{data:e}=t;return"string"==typeof e&&(e=JSON.parse(e)),!e||200===e.status||e instanceof Blob?e instanceof Blob?(t.data=e,t):(t.data=e&&e.result,t):Promise.reject(t)},t=>{if(!t.response||401!==t.response.status)return Promise.reject(t.response)}),s})(window.prefixPath||"");const h=(t,e)=>{window.sdataEventActions||(window.sdataEventActions={}),window.sdataEventActions[t]=e};class c{constructor(t,e){this.handler=e,this.actionKey=t.actionKey,this.appSKID=t.appSKID,this.imType=t.imType,this.groupID=t.groupID,this.userID=t.userID,this.chatType=t.chatType||0,this.singleChatID=t.singleChatID||"",this.customParams=t.customParams||{},this.chartOrigin=t.chartOrigin}makeKey(t){return`${t}-${this.actionKey}`}async init(){this.handler.addChatListener(this.makeKey("sdata_get_access_token"),async t=>await this.handler.getPortalAccessToken(t)),this.handler.addChatListener(this.makeKey("sdata_get_portal_user_info"),async t=>await this.handler.getPortalUserInfo(t)),this.handler.addChatListener(this.makeKey("sdata_get_portal_user_sig"),async t=>{let e=t.userID,a=t.im_type,s=t.group_id;return await this.handler.getPortalUserSig(e,a,s)}),this.handler.addChatListener(this.makeKey("sdata_add_im_mapping"),async t=>{let e=t.userID,a=t.im_type,s=t.userSig;return await this.handler.addIMMapping(e,a,s,this.groupID)}),this.handler.addChatListener(this.makeKey("sdata_update_im_mapping"),async t=>await this.handler.updateIMMapping(t)),this.handler.addChatListener(this.makeKey("sdata_get_users_by_group_id"),async t=>await this.handler.getAllUserInfosByGroupID(t)),this.handler.addChatListener(this.makeKey("sdata_get_dpts_by_group_id"),async t=>await this.handler.getChildrenOfficeInfosByID(t)),this.handler.addChatListener(this.makeKey("sdata_get_project_dpts_by_user_group_id"),async t=>await this.handler.getPojectDptsByUserAndGroupID(t)),this.handler.addChatListener(this.makeKey("sdata_get_ai_robot_infos"),async t=>{let e=t.groupID,a=t.userID;return this.userID==a&&this.groupID==e?this.getAIRobotInfos():[]}),this.handler.addChatListener(this.makeKey("sdata_get_test_user_sig"),async t=>{let e=t.SDKAppID,a=t.userID;return(await this.handler.genTestUserSig({SDKAppID:e,userID:a})).userSig}),this.handler.addChatListener(this.makeKey("sdata_send_message_to_chat_server"),async(t,e)=>{let a=t.message,s=a.from;return await this.sendMessageToChatServer(s,a)}),this.handler.addChatListener(this.makeKey("sdata_close_frame_window"),async(t,e)=>this.handler.closeWindow()),this.handler.addChatListener(this.makeKey("sdata_get_portal_doc_info"),async(t,e)=>this.handler.getPortalDocmentInfo(t)),this.handler.addChatListener(this.makeKey("sdata_chat_aiAgent_event"),async(t,e)=>this.handler.onAIAgentEvent(t,e)),this.handler.addChatListener(this.makeKey("sdata_alllife_event_regist"),async(t,e)=>{console.log("recive chat regist event data:",t),this.appSKID=t.appid,this.imType=t.im_type,await this.initChatAIs();let a={type:this.getChatTypeKey(this.chatType),singleChatID:this.singleChatID,customParams:this.customParams};this.handler.fireEventToChatWindow(e,this.chartOrigin,this.makeKey("sdata_alllife_initChat"),a,t=>{t&&(console.log("chat init finished:",t),this.handler.onChatInitFinished())})})}getChatTypeKey(t){switch(t){case 0:default:return"IM_MULTIPLE_MODE";case 1:return"IM_SINGLE_MODE";case 2:return"IM_EMBED_MODE";case 3:return"IM_MOBILE_MULTIPLE_EMBED_MODE";case 4:return"IM_MOBILE_SINGLE_EMBED_MODE"}}async initChatAIs(){if(window.imClient)this.chatAIClient=window.imClient;else{let t=await this.handler.getChatClientClasses();const{TencentCloudChat:e,TIMUploadPlugin:a}=t;window.imClient=e.create({SDKAppID:this.appSKID,storage:{enable:!0}}),window.imClient.registerPlugin({"tim-upload-plugin":a}),window.imClient.on(e.EVENT.SDK_READY,this.onChatAIReady.bind(this)),window.imClient.charAIs={},this.chatAIClient=window.imClient}this.chatAIClient.charAIs||(this.chatAIClient.charAIs={});let t=await this.handler.getAIRobotInfos(this.userID,this.groupID);t&&t.length>0&&t.forEach(async t=>{let e=t.id;if(!this.chatAIClient.charAIs[e]){t.chatID=e;let a=await this.handler.getPortalUserSig(e,this.imType,this.groupID);a||(a=await this.generateUserSigAndAdd(e)),t.userSig=a,this.chatAIClient.charAIs[e]={robot:t,messageCache:[]}}})}async generateUserSigAndUpdate(t){let e=(await this.handler.genTestUserSig({SDKAppID:this.appSKID,userID:t})).userSig;if(e){await this.chatAIClient.login({userID:t,userSig:e}),await this.chatAIClient.logout();let a={userID:t,userSig:e,im_type:this.imType,group_id:this.groupID};await this.handler.updateIMMapping(a)}return e}async generateUserSigAndAdd(t){let e=(await this.handler.genTestUserSig({SDKAppID:this.appSKID,userID:t})).userSig;return e&&(await this.chatAIClient.login({userID:t,userSig:e}),await this.chatAIClient.logout(),await this.handler.addIMMapping(t,this.imType,e,this.groupID)),e}onChatAIReady(t){let e=this.chatAIClient.lastRobotID,a=this.getAIRobotInfoByID(e);if(console.log(`[AI chat] ${a.name}已经就绪:`,t),this.chatAIClient){let t=this.getAIRobotCacheMessagesByID(e);if(console.log(`[AI chat] ${a.name}就绪后查到的缓存信息:`,t),console.log(`[AI chat] ${a.name}所有信息仓:`,this.chatAIClient.charAIs),t&&t.length>0){const s=[...t];t.splice(0,t.length),s.forEach(t=>{console.log(`[AI chat] ${a.name}发送缓存消息:`,t),this.sendMessageToChatServer(e,t)})}}}getAIRobotInfos(){let t=[];for(let e in this.chatAIClient.charAIs)t.push(this.chatAIClient.charAIs[e].robot);return t}getAIRobotInfoByID(t){return this.chatAIClient.charAIs[t]?this.chatAIClient.charAIs[t].robot:null}getAIRobotCacheMessagesByID(t){return this.chatAIClient.charAIs[t]?this.chatAIClient.charAIs[t].messageCache:[]}async sendMessageToChatServer(t,e){let a=this.getAIRobotInfoByID(t);if(this.chatAIClient.lastRobotID!=t){console.log(`[AI chat]需要新机器人回答,切换到新机器人${a.name}`),this.chatAIClient.lastRobotID&&await this.chatAIClient.logout();try{await this.chatAIClient.login({userID:t,userSig:a.userSig})}catch(s){if(console.log(`[AI chat]${a.name}登录失败`,s),70001==s.code){console.log(`[AI chat]${a.name}UserSig过期,重新生成userSig`);let s=await this.generateUserSigAndUpdate(t);try{return await this.chatAIClient.login({userID:t,userSig:s}),void this.sendMessageToChatServer(t,e)}catch(t){return void console.log(`[AI chat]${a.name}重新登录失败`,t)}}}}if(this.chatAIClient.lastRobotID=t,this.chatAIClient&&this.chatAIClient.isReady()){let t=await this.chatAIClient.createTextMessage(e);this.chatAIClient.sendMessage(t).then(t=>{console.log(`[AI chat]${a.name}发送信息成功`,t)},t=>{console.log(`[AI chat]${a.name}发送失败`,t)})}else{let s=this.getAIRobotCacheMessagesByID(t);s.push(e),console.log(`[AI chat]${a.name}未就绪,缓存后消息:`,s)}}converToAIServerParams(t,e,a){let s="";if("TIMTextElem"===t.type)s=t.payload?.text||"";let i=(t.cloudCustomData||{}).conversation_id||"";return{prompt:s,params:a||{},robotKey:e.password,conversation_id:i||"",userID:t.from||""}}abort(){this.chatAIClient=null}}const l=async(t,e)=>{let a={param:{id:t,groupID:e}};return(await o.post("/dataservice/rest/orchestration/getRobotInfoByID",a)).data.robotInfo},d=t=>{let e={genTestUserSig:async t=>{},getChatClientClasses:async()=>[],getAIRobotInfos:async(t,e)=>(async(t,e)=>{let a={param:{userID:t,groupID:e}};return(await o.post("/dataservice/rest/orchestration/getAIRobotInfos",a)).data.robotInfos})(t,e),getPortalUserSig:async(t,e,a)=>(async(t,e,a)=>{let s={param:{userID:t,im_type:e,group_id:a}};return(await o.post("/dataservice/rest/orchestration/getIMUserSigByID",s)).data.userSig})(t,e,a),addIMMapping:async(t,e,a,s)=>(async(t,e,a,s)=>{let i={param:{data:{userID:t,im_type:e,group_id:a,userSig:s}}};return(await o.post("/dataservice/rest/orchestration/addIMMapping",i)).data})(t,e,s,a),updateIMMapping:async t=>(async(t,e,a,s)=>{let i={param:{userID:t,im_type:e,groupID:a,userSig:s}};return(await o.post("/dataservice/rest/orchestration/updateIMMapping",i)).data})(t.userID,t.im_type,t.group_id,t.userSig),getPortalAccessToken:async t=>(async(t,e)=>(await o.get(`/appAuth/getAccessToken?appKey=${t}&appSecret=${e}`)).data)(t.appKey,t.appSecret),getPortalUserInfo:async t=>(async(t,e)=>(await o.get(`/systhirdapp/user/getUserByCode?code=${t}&access_token=${e}`)).data)(t.code,t.access_token),getAllUserInfosByGroupID:async t=>(async t=>{let e={param:{groupID:t}};return(await o.post("/dataservice/rest/orchestration/getAllUserInfosByGroupID",e)).data.resultDatas})(t.groupID),getChildrenOfficeInfosByID:async t=>(async t=>{let e={param:{officeID:t}};return(await o.post("/dataservice/rest/orchestration/getChildrenOfficeInfosByID",e)).data.resultDatas})(t.groupID),getPojectDptsByUserAndGroupID:async t=>{let e=t.groupID;return(async(t,e)=>{let a={param:{userID:t,groupID:e}},s=await o.post("/dataservice/rest/orchestration/getPojectDptsByUserAndGroupID",a);return{dptDatas:s.data.officeDatas,userMappings:s.data.userMappings}})(t.userID,e)},closeWindow:()=>!0,addChatListener:async(t,e)=>{await h(t,e)},fireEventToChatWindow:async(t,e,a,s,i)=>{await(async(t,e,a,s,i)=>{let n=`${a}_${(new Date).getTime()}_${Math.floor(1e4*Math.random())+1}`;h(n,i);let r={eventOperateKey:n,eventKey:a,data:s};t.postMessage(r,e)})(t.source,e,a,s,i)},onChatInitFinished:async()=>{},onAIAgentEvent:async(t,e)=>{},getPortalDocmentInfo:async t=>{let e=t.kb_doc_id,a=await(async t=>{let e={param:{kb_doc_id:t}};return(await o.post("/dataservice/rest/orchestration/getPortalDocmentInfoByKBID",e)).data.docInfo})(e),s=a?.summary;if(s){let t=JSON.parse(s);if(t){let e=t[0].url,s=`${window.smardaten_api_context_path}/storage_area/public${e}`,i=await(async t=>{try{const e=await fetch(t,{method:"GET",headers:{Range:"bytes=0-0"}});if(206!==e.status)throw new Error("不支持 Range 请求");const a=e.headers.get("Content-Range"),s=a?.match(/\/(\d+)$/)?.[1];return s?parseInt(s,10):-1}catch(t){return console.error("获取文件大小失败:",t),-1}})(s);a.fileSize=i}}return a}};return e={...e,...t},e};export{c as ChatClientMgr,d as getIMHanlder,l as getRobotInfoByID};
|
|
1
|
+
import t from"axios";var e={},a=Object.prototype.hasOwnProperty;function s(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function i(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var s,n,r=[];for(n in"string"!=typeof e&&(e="?"),t)if(a.call(t,n)){if((s=t[n])||null!=s&&!isNaN(s)||(s=""),n=i(n),s=i(s),null===n||null===s)continue;r.push(n+"="+s)}return r.length?e+r.join("&"):""},e.parse=function(t){for(var e,a=/([^=?#&]+)=?([^&]*)/g,i={};e=a.exec(t);){var n=s(e[1]),r=s(e[2]);null===n||null===r||n in i||(i[n]=r)}return i};const n="development"===process.env.NODE_ENV,r="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;window.isDevopmentMode=n,window.isOnlineDevelopmentMode=r;var o=((a="")=>{a&&(a.startsWith("/")&&(a=a.slice(1,a.length)),a.endsWith("/")&&(a=a.slice(0,-1)));const s=t.create({baseURL:`/${a?a+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(t){return t>=200&&t<300},headers:window.location.search&&e.parse(window.location.search).token||window.token?{token:e.parse(window.location.search).token||window.token}:{}});let i=s.post;return s.post=(t,e,a)=>{let n=window.VITE_SERVICE_BASE_URL||"";if(n){let r=n+t;return i.call(s,r,e,a)}return i.call(s,t,e,a)},s.interceptors.request.use(t=>{if(!r&&n){let e=window.mockData.PORTAL_SERVER_ADDRESS,a=window.mockData.VITE_SERVICE_BASE_URL;t.url=`${e}${a}${t.url}`}return t},t=>Promise.reject(t)),s.defaults.headers.post["Content-Type"]="application/json",s.interceptors.response.use(t=>{let{data:e}=t;return"string"==typeof e&&(e=JSON.parse(e)),!e||200===e.status||e instanceof Blob?e instanceof Blob?(t.data=e,t):(t.data=e&&e.result,t):Promise.reject(t)},t=>{if(!t.response||401!==t.response.status)return Promise.reject(t.response)}),s})(window.prefixPath||"");const h=(t,e)=>{window.sdataEventActions||(window.sdataEventActions={}),window.sdataEventActions[t]=e};class c{constructor(t,e){this.handler=e,this.actionKey=t.actionKey,this.appSKID=t.appSKID,this.imType=t.imType,this.groupID=t.groupID,this.userID=t.userID,this.chatType=t.chatType||0,this.singleChatID=t.singleChatID||"",this.customParams=t.customParams||{},this.chartOrigin=t.chartOrigin}makeKey(t){return`${t}-${this.actionKey}`}async init(){this.handler.addChatListener(this.makeKey("sdata_get_access_token"),async t=>await this.handler.getPortalAccessToken(t)),this.handler.addChatListener(this.makeKey("sdata_get_portal_user_info"),async t=>await this.handler.getPortalUserInfo(t)),this.handler.addChatListener(this.makeKey("sdata_get_portal_user_sig"),async t=>{let e=t.userID,a=t.im_type,s=t.group_id;return await this.handler.getPortalUserSig(e,a,s)}),this.handler.addChatListener(this.makeKey("sdata_add_im_mapping"),async t=>{let e=t.userID,a=t.im_type,s=t.userSig;return await this.handler.addIMMapping(e,a,s,this.groupID)}),this.handler.addChatListener(this.makeKey("sdata_update_im_mapping"),async t=>await this.handler.updateIMMapping(t)),this.handler.addChatListener(this.makeKey("sdata_get_users_by_group_id"),async t=>await this.handler.getAllUserInfosByGroupID(t)),this.handler.addChatListener(this.makeKey("sdata_get_dpts_by_group_id"),async t=>await this.handler.getChildrenOfficeInfosByID(t)),this.handler.addChatListener(this.makeKey("sdata_get_project_dpts_by_user_group_id"),async t=>await this.handler.getPojectDptsByUserAndGroupID(t)),this.handler.addChatListener(this.makeKey("sdata_get_ai_robot_infos"),async t=>{let e=t.groupID,a=t.userID;return this.userID==a&&this.groupID==e?this.getAIRobotInfos():[]}),this.handler.addChatListener(this.makeKey("sdata_get_test_user_sig"),async t=>{let e=t.SDKAppID,a=t.userID;return(await this.handler.genTestUserSig({SDKAppID:e,userID:a})).userSig}),this.handler.addChatListener(this.makeKey("sdata_send_message_to_chat_server"),async(t,e)=>{let a=t.message,s=a.from;return await this.sendMessageToChatServer(s,a)}),this.handler.addChatListener(this.makeKey("sdata_close_frame_window"),async(t,e)=>this.handler.closeWindow()),this.handler.addChatListener(this.makeKey("sdata_get_portal_doc_info"),async(t,e)=>this.handler.getPortalDocmentInfo(t)),this.handler.addChatListener(this.makeKey("sdata_chat_aiAgent_event"),async(t,e)=>this.handler.onAIAgentEvent(t,e)),this.handler.addChatListener(this.makeKey("sdata_alllife_event_regist"),async(t,e)=>{console.log("recive chat regist event data:",t),this.appSKID=t.appid,this.imType=t.im_type,await this.initChatAIs();let a={type:this.getChatTypeKey(this.chatType),singleChatID:this.singleChatID,customParams:this.customParams};this.handler.fireEventToChatWindow(e,this.chartOrigin,this.makeKey("sdata_alllife_initChat"),a,t=>{t&&(console.log("chat init finished:",t),this.handler.onChatInitFinished())})})}getChatTypeKey(t){switch(t){case 0:default:return"IM_MULTIPLE_MODE";case 1:return"IM_SINGLE_MODE";case 2:return"IM_EMBED_MODE";case 3:return"IM_MOBILE_MULTIPLE_EMBED_MODE";case 4:return"IM_MOBILE_SINGLE_EMBED_MODE"}}async initChatAIs(){if(window.imClient)this.chatAIClient=window.imClient;else{let t=await this.handler.getChatClientClasses();const{TencentCloudChat:e,TIMUploadPlugin:a}=t;window.imClient=e.create({SDKAppID:this.appSKID,storage:{enable:!0}}),window.imClient.registerPlugin({"tim-upload-plugin":a}),window.imClient.on(e.EVENT.SDK_READY,this.onChatAIReady.bind(this)),window.imClient.charAIs={},this.chatAIClient=window.imClient}this.chatAIClient.charAIs||(this.chatAIClient.charAIs={});let t=await this.handler.getAIRobotInfos(this.userID,this.groupID);t&&t.length>0&&t.forEach(async t=>{let e=t.id;if(!this.chatAIClient.charAIs[e]){t.chatID=e;let a=await this.handler.getPortalUserSig(e,this.imType,this.groupID);a||(a=await this.generateUserSigAndAdd(e)),t.userSig=a,this.chatAIClient.charAIs[e]={robot:t,messageCache:[]}}})}async generateUserSigAndUpdate(t){let e=(await this.handler.genTestUserSig({SDKAppID:this.appSKID,userID:t})).userSig;if(e){await this.chatAIClient.login({userID:t,userSig:e}),await this.chatAIClient.logout();let a={userID:t,userSig:e,im_type:this.imType,group_id:this.groupID};await this.handler.updateIMMapping(a)}return e}async generateUserSigAndAdd(t){let e=(await this.handler.genTestUserSig({SDKAppID:this.appSKID,userID:t})).userSig;return e&&(await this.chatAIClient.login({userID:t,userSig:e}),await this.chatAIClient.logout(),await this.handler.addIMMapping(t,this.imType,e,this.groupID)),e}onChatAIReady(t){let e=this.chatAIClient.lastRobotID,a=this.getAIRobotInfoByID(e);if(console.log(`[AI chat] ${a.name}已经就绪:`,t),this.chatAIClient){let t=this.getAIRobotCacheMessagesByID(e);if(console.log(`[AI chat] ${a.name}就绪后查到的缓存信息:`,t),console.log(`[AI chat] ${a.name}所有信息仓:`,this.chatAIClient.charAIs),t&&t.length>0){const s=[...t];t.splice(0,t.length),s.forEach(t=>{console.log(`[AI chat] ${a.name}发送缓存消息:`,t),this.sendMessageToChatServer(e,t)})}}}getAIRobotInfos(){let t=[];for(let e in this.chatAIClient.charAIs)t.push(this.chatAIClient.charAIs[e].robot);return t}getAIRobotInfoByID(t){return this.chatAIClient.charAIs[t]?this.chatAIClient.charAIs[t].robot:null}getAIRobotCacheMessagesByID(t){return this.chatAIClient.charAIs[t]?this.chatAIClient.charAIs[t].messageCache:[]}async sendMessageToChatServer(t,e){let a=this.getAIRobotInfoByID(t);if(this.chatAIClient.lastRobotID!=t){console.log(`[AI chat]需要新机器人回答,切换到新机器人${a.name}`),this.chatAIClient.lastRobotID&&await this.chatAIClient.logout();try{await this.chatAIClient.login({userID:t,userSig:a.userSig})}catch(s){if(console.log(`[AI chat]${a.name}登录失败`,s),70001==s.code){console.log(`[AI chat]${a.name}UserSig过期,重新生成userSig`);let s=await this.generateUserSigAndUpdate(t);try{return await this.chatAIClient.login({userID:t,userSig:s}),void this.sendMessageToChatServer(t,e)}catch(t){return void console.log(`[AI chat]${a.name}重新登录失败`,t)}}}}if(this.chatAIClient.lastRobotID=t,this.chatAIClient&&this.chatAIClient.isReady()){let t=await this.chatAIClient.createTextMessage(e);this.chatAIClient.sendMessage(t).then(t=>{console.log(`[AI chat]${a.name}发送信息成功`,t)},t=>{console.log(`[AI chat]${a.name}发送失败`,t)})}else{let s=this.getAIRobotCacheMessagesByID(t);s.push(e),console.log(`[AI chat]${a.name}未就绪,缓存后消息:`,s)}}converToAIServerParams(t,e,a){let s="";if("TIMTextElem"===t.type)s=t.payload?.text||"";let i=(t.cloudCustomData||{}).conversation_id||"";return{prompt:s,params:a||{},robotKey:e.password,conversation_id:i||"",userID:t.from||""}}abort(){this.chatAIClient=null}}const l=async(t,e)=>{let a={param:{id:t,groupID:e}};return(await o.post("/dataservice/rest/orchestration/getRobotInfoByID",a)).data.robotInfo},d=t=>{let e={genTestUserSig:async t=>{},getChatClientClasses:async()=>[],getAIRobotInfos:async(t,e)=>(async(t,e)=>{let a={param:{userID:t,groupID:e}};return(await o.post("/dataservice/rest/orchestration/getAIRobotInfos",a)).data.robotInfos})(t,e),getPortalUserSig:async(t,e,a)=>(async(t,e,a)=>{let s={param:{userID:t,im_type:e,group_id:a}};return(await o.post("/dataservice/rest/orchestration/getIMUserSigByID",s)).data.userSig})(t,e,a),addIMMapping:async(t,e,a,s)=>(async(t,e,a,s)=>{let i={param:{data:{userID:t,im_type:e,group_id:a,userSig:s}}};return(await o.post("/dataservice/rest/orchestration/addIMMapping",i)).data})(t,e,s,a),updateIMMapping:async t=>(async(t,e,a,s)=>{let i={param:{userID:t,im_type:e,groupID:a,userSig:s}};return(await o.post("/dataservice/rest/orchestration/updateIMMapping",i)).data})(t.userID,t.im_type,t.group_id,t.userSig),getPortalAccessToken:async t=>(async(t,e)=>(await o.get(`/appAuth/getAccessToken?appKey=${t}&appSecret=${e}`)).data)(t.appKey,t.appSecret),getPortalUserInfo:async t=>(async(t,e)=>(await o.get(`/systhirdapp/user/getUserByCode?code=${t}&access_token=${e}`)).data)(t.code,t.access_token),getAllUserInfosByGroupID:async t=>(async t=>{let e={param:{groupID:t}};return(await o.post("/dataservice/rest/orchestration/getAllUserInfosByGroupID",e)).data.resultDatas})(t.groupID),getChildrenOfficeInfosByID:async t=>(async t=>{let e={param:{officeID:t}};return(await o.post("/dataservice/rest/orchestration/getChildrenOfficeInfosByID",e)).data.resultDatas})(t.groupID),getPojectDptsByUserAndGroupID:async t=>{let e=t.groupID;return(async(t,e)=>{let a={param:{userID:t,groupID:e}},s=await o.post("/dataservice/rest/orchestration/getPojectDptsByUserAndGroupID",a);return{dptDatas:s.data.officeDatas,userMappings:s.data.userMappings}})(t.userID,e)},closeWindow:()=>!0,addChatListener:async(t,e)=>{await h(t,e)},fireEventToChatWindow:async(t,e,a,s,i)=>{await(async(t,e,a,s,i)=>{let n=`${a}_${(new Date).getTime()}_${Math.floor(1e4*Math.random())+1}`;h(n,i);let r={eventOperateKey:n,eventKey:a,data:s};t.postMessage(r,e)})(t.source,e,a,s,i)},onChatInitFinished:async()=>{},onAIAgentEvent:async(t,e)=>{},getPortalDocmentInfo:async t=>{let e=t.kb_doc_id,a=await(async t=>{let e={param:{kb_doc_id:t}};return(await o.post("/dataservice/rest/orchestration/getPortalDocmentInfoByKBID",e)).data.docInfo})(e),s=a?.summary;if(s){let t=JSON.parse(s);if(t){let e=t[0].url,s=`${window.smardaten_api_context_path}/storage_area/public${e}`,i=await(async t=>{try{const e=await fetch(t,{method:"GET",headers:{Range:"bytes=0-0"}});if(206!==e.status)throw new Error("不支持 Range 请求");const a=e.headers.get("Content-Range"),s=a?.match(/\/(\d+)$/)?.[1];return s?parseInt(s,10):-1}catch(t){return console.error("获取文件大小失败:",t),-1}})(s);a.fileSize=i}}return a}};return e={...e,...t},e};export{c as ChatClientMgr,d as getIMHanlder,l as getRobotInfoByID};
|
package/dist/esm/dify.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"axios";var t={},o=Object.prototype.hasOwnProperty;function n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,a,
|
|
1
|
+
import e from"axios";var t={},o=Object.prototype.hasOwnProperty;function n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,a,i=[];for(a in"string"!=typeof t&&(t="?"),e)if(o.call(e,a)){if((n=e[a])||null!=n&&!isNaN(n)||(n=""),a=r(a),n=r(n),null===a||null===n)continue;i.push(a+"="+n)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,o=/([^=?#&]+)=?([^&]*)/g,r={};t=o.exec(e);){var a=n(t[1]),i=n(t[2]);null===a||null===i||a in r||(r[a]=i)}return r};const a="development"===process.env.NODE_ENV,i="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;window.isDevopmentMode=a,window.isOnlineDevelopmentMode=i;var s=((o="")=>{o&&(o.startsWith("/")&&(o=o.slice(1,o.length)),o.endsWith("/")&&(o=o.slice(0,-1)));const n=e.create({baseURL:`/${o?o+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(e){return e>=200&&e<300},headers:window.location.search&&t.parse(window.location.search).token||window.token?{token:t.parse(window.location.search).token||window.token}:{}});let r=n.post;return n.post=(e,t,o)=>{let a=window.VITE_SERVICE_BASE_URL||"";if(a){let i=a+e;return r.call(n,i,t,o)}return r.call(n,e,t,o)},n.interceptors.request.use(e=>{if(!i&&a){let t=window.mockData.PORTAL_SERVER_ADDRESS,o=window.mockData.VITE_SERVICE_BASE_URL;e.url=`${t}${o}${e.url}`}return e},e=>Promise.reject(e)),n.defaults.headers.post["Content-Type"]="application/json",n.interceptors.response.use(e=>{let{data:t}=e;return"string"==typeof t&&(t=JSON.parse(t)),!t||200===t.status||t instanceof Blob?t instanceof Blob?(e.data=t,e):(e.data=t&&t.result,e):Promise.reject(e)},e=>{if(!e.response||401!==e.response.status)return Promise.reject(e.response)}),n})(window.prefixPath||"");const c=()=>window.appSdk.getAppId()||window.localStorage.MobileAppId,u=async(e,t,o)=>{let n=(()=>{let e=window.sessionStorage.getItem("iportal_app_id");return e||(e=c()),e})(),r=await(async e=>{let t={param:{appID:e}},o=(await s.post("/dataservice/rest/orchestration/getAppCustomData",t)).data.customData;return o=o?JSON.parse(o):{},o})(n),a=r?.aiAgentServerIP||"";if(!a)return console.error("没有配置AI Agent服务地址,请联系管理员"),void(o&&o("没有配置AI Agent服务地址,请联系管理员"));let i=`${a}/addAndCleanDocument`;s.post(i,JSON.stringify(e)).then(e=>{console.log("发送消息成功:",e),t&&t(e)}).catch(e=>{console.error("发送消息失败:",e),o&&o(e)})},d=e=>({DOCX:"document",TXT:"document",MD:"document",MARKDOWN:"document",MDX:"document",PDF:"document",HTML:"document",XLSX:"document",XLS:"document",VTT:"document",DOC:"document",CSV:"document",EML:"document",MSG:"document",PPTX:"document",PPT:"document",XML:"document",EPUB:"document",JPG:"image",JPEG:"image",PNG:"image",GIF:"image",WEBP:"image",MP3:"audio",M4A:"audio",WAV:"audio",WEBM:"audio",MPGA:"audio",MP4:"video",MOV:"video",MPEG:"video"}[e.toUpperCase()]||"custom");export{d as getDifyFileType,u as sendPostToAIAgent};
|
package/dist/esm/i18n.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import t from"axios";import{nextTick as n}from"vue";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u={},i=Object.prototype.hasOwnProperty;function o(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function a(t){try{return encodeURIComponent(t)}catch(t){return null}}u.stringify=function(t,n){n=n||"";var e,r,u=[];for(r in"string"!=typeof n&&(n="?"),t)if(i.call(t,r)){if((e=t[r])||null!=e&&!isNaN(e)||(e=""),r=a(r),e=a(e),null===r||null===e)continue;u.push(r+"="+e)}return u.length?n+u.join("&"):""},u.parse=function(t){for(var n,e=/([^=?#&]+)=?([^&]*)/g,r={};n=e.exec(t);){var u=o(n[1]),i=o(n[2]);null===u||null===i||u in r||(r[u]=i)}return r};const c="development"===process.env.NODE_ENV,l="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;var f,s,h=((n="")=>{n&&(n.startsWith("/")&&(n=n.slice(1,n.length)),n.endsWith("/")&&(n=n.slice(0,-1)));const e=t.create({baseURL:`/${n?n+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(t){return t>=200&&t<300},headers:window.location.search&&u.parse(window.location.search).token||window.token?{token:u.parse(window.location.search).token||window.token}:{}});let r=e.post;return e.post=(t,n,u)=>{let i=window.VITE_SERVICE_BASE_URL||"";if(i){let o=i+t;return r.call(e,o,n,u)}return r.call(e,t,n,u)},e.interceptors.request.use(t=>{if(!l&&c){let n=window.mockData.PORTAL_SERVER_ADDRESS,e=window.mockData.VITE_SERVICE_BASE_URL;t.url=`${n}${e}${t.url}`}return t},t=>Promise.reject(t)),e.defaults.headers.post["Content-Type"]="application/json",e.interceptors.response.use(t=>{let{data:n}=t;return"string"==typeof n&&(n=JSON.parse(n)),!n||200===n.status||n instanceof Blob?n instanceof Blob?(t.data=n,t):(t.data=n&&n.result,t):Promise.reject(t)},t=>{if(!t.response||401!==t.response.status)return Promise.reject(t.response)}),e})(window.prefixPath||""),p={exports:{}};
|
|
1
|
+
import t from"axios";import{nextTick as n}from"vue";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u={},i=Object.prototype.hasOwnProperty;function o(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function a(t){try{return encodeURIComponent(t)}catch(t){return null}}u.stringify=function(t,n){n=n||"";var e,r,u=[];for(r in"string"!=typeof n&&(n="?"),t)if(i.call(t,r)){if((e=t[r])||null!=e&&!isNaN(e)||(e=""),r=a(r),e=a(e),null===r||null===e)continue;u.push(r+"="+e)}return u.length?n+u.join("&"):""},u.parse=function(t){for(var n,e=/([^=?#&]+)=?([^&]*)/g,r={};n=e.exec(t);){var u=o(n[1]),i=o(n[2]);null===u||null===i||u in r||(r[u]=i)}return r};const c="development"===process.env.NODE_ENV,l="true"===process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE||"true"===process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE;window.isDevopmentMode=c,window.isOnlineDevelopmentMode=l;var f,s,h=((n="")=>{n&&(n.startsWith("/")&&(n=n.slice(1,n.length)),n.endsWith("/")&&(n=n.slice(0,-1)));const e=t.create({baseURL:`/${n?n+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(t){return t>=200&&t<300},headers:window.location.search&&u.parse(window.location.search).token||window.token?{token:u.parse(window.location.search).token||window.token}:{}});let r=e.post;return e.post=(t,n,u)=>{let i=window.VITE_SERVICE_BASE_URL||"";if(i){let o=i+t;return r.call(e,o,n,u)}return r.call(e,t,n,u)},e.interceptors.request.use(t=>{if(!l&&c){let n=window.mockData.PORTAL_SERVER_ADDRESS,e=window.mockData.VITE_SERVICE_BASE_URL;t.url=`${n}${e}${t.url}`}return t},t=>Promise.reject(t)),e.defaults.headers.post["Content-Type"]="application/json",e.interceptors.response.use(t=>{let{data:n}=t;return"string"==typeof n&&(n=JSON.parse(n)),!n||200===n.status||n instanceof Blob?n instanceof Blob?(t.data=n,t):(t.data=n&&n.result,t):Promise.reject(t)},t=>{if(!t.response||401!==t.response.status)return Promise.reject(t.response)}),e})(window.prefixPath||""),p={exports:{}};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Lodash <https://lodash.com/>
|