Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mb-js-bridge

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mb-js-bridge - npm Package Compare versions

Comparing version 5.0.6 to 5.1.2

lib/providers/web.js

6

dist/js-bridge-umd.min.js
/*!
* mb-js-bridge
*
* @version 5.0.6
* @version 5.1.2
* @copyright MicroBenefits
*/
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Bridge=e():n.Bridge=e()}("undefined"!=typeof self?self:this,function(){return function(n){function e(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var t={};return e.m=n,e.c=t,e.d=function(n,t,i){e.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:i})},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},e.p="",e(e.s=3)}([function(n,e,t){"use strict";function i(){var n=navigator.userAgent;return/MicroBenefitsCIQ/.test(n)?"ciq":/MicroMessenger/.test(n)?"wechat":""}var o=t(8),r=t(9),a={ciq:o.a,wechat:r.a},c="";e.a=function(n,e,t,o){if(console.log(arguments),void 0===t&&(t=!0),void 0===o&&(o=!0),c||(c=i()),!c||void 0===a[c])return null;try{var r=a[c],u=r(t?"JS_BRIDGE_"+n:n,e);return o&&u&&"string"==typeof u?JSON.parse(u):u}catch(n){return console.warn(n),null}}},function(n,e,t){"use strict";e.a=function(){if("file:"===location.protocol)return!0;return!!new RegExp(atob("KFwuaWZ1bGlcLmNufFwuaXdlaWJhbmdcLmNvbXxcLm1lXC5jb218MTkyXC4xNjhcLlxkezEsM31cLlxkezEsM30oOlxkezEsNX0pPykk")).test(location.host)}},function(n,e,t){"use strict";function i(n,e){e=Object.assign({},{type:n||"GET",url:"",headers:{},data:"",withSignature:!1,timeout:1e4,withCredentials:!1,success:u,error:u,complete:u},e);var t=new XMLHttpRequest;t.open(e.type,e.url),t.timeout=e.timeout;var i=Object(r.a)("GET_USER")||{},a=Object.assign({},{appName:i.appName||"ciq3",appVersion:i.appVersion||"",sysType:i.sysType||"",sysVersion:i.sysVersion||"",deviceId:i.deviceId||"",sessionId:i.sessionId||"",lang:i.lang||"zh"},e.headers);e.withSignature&&(a.sign=o(e.data));var c=null;e.data&&("object"==typeof e.data?/json/i.test(a["Content-type"])?c=JSON.stringify(e.data):(a["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8",c=new URLSearchParams(e.data).toString()):c=e.data);for(var s in a)a.hasOwnProperty(s)&&t.setRequestHeader(s,a[s]);t.send(c),t.onreadystatechange=function(){if(4===t.readyState&&t.responseText)try{var n=JSON.parse(t.responseText);e.success(n,t),e.complete(t)}catch(n){e.success(t.responseText,t),e.complete(t)}},t.ontimeout=function(n){e.error(n,t),e.complete(t)},t.onerror=function(n){e.error(n,t),e.complete(t)}}function o(n){var e=Object.keys(n).sort().map(function(e){return e+"="+n[e]}).join("&");return c()("tQbPwzcmERdu",e)}var r=t(0),a=t(12),c=t.n(a),u=function(){};e.a={post:function(n,e,t){"object"!=typeof n||e||t?Object.assign(t,{url:n,data:e}):t=n,i("POST",t)},get:function(n,e){"object"!=typeof n||e?Object.assign(e,{url:n}):e=n,i("GET",e)},ajax:function(n){i("",n)}}},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=t(4),o=(t.n(i),t(6)),r=(t.n(o),t(7)),a=t(0),c=t(2);Object(a.a)("INIT",null,!1);var u={version:"5.0.6",openPage:r.a,ajax:c.a,getSession:function(){return Object(a.a)("GET_USER")},setSession:function(n){return Object(a.a)("SET_USER",n)},getUserInfo:function(){return Object(a.a)("GET_USER_INFO")},sessionInvalid:function(){Object(a.a)("SESSION_INVALID")},setCallbackArgs:function(n){Object(a.a)("CALLBACK_ARGUMENTS",{arguments:n})},closePage:function(){Object(a.a)("CLOSE_WINDOW")},setOperationButton:function(n,e){Object(a.a)("SET_RIGHT_BUTTON",{buttonName:n,callback:e})},log:function(n){Object(a.a)("LOG",n)},uploadImage:function(n){if("function"!=typeof n)throw new Error("UploadImage callback must be a function");Object(a.a)("UPLOAD_PIC",{callback:n})},showImage:function(n,e){Object(a.a)("SHOW_IMAGE",{imageUrl:n,currentPos:e})},takeShortVideo:function(){return Object(a.a)("TAKE_SHORT_VIDEO")},getNetState:function(){return Object(a.a)("NET_STATE")},getLocation:function(){return Object(a.a)("LOCATION")},showLoading:function(){Object(a.a)("OPEN_LOADING")},hideLoading:function(){Object(a.a)("CLOSE_LOADING")},hideTitleBar:function(){Object(a.a)("HIDE_TITLE_BAR")},share:function(n,e,t,i){return Object(a.a)("SHARE",{url:n,title:e,desc:t||"",image:i||""})},eventsStatistic:function(n,e){return Object(a.a)("EVENTS_STATISTIC",{eventName:n,properties:e||{}})},getDecryptValue:function(n,e){return Object(a.a)("DECRYPT_DATA",{key:n,data:e})},onClosePage:function(n){if("function"!=typeof n)return void console.error("onCloseWindow callback must be a function");window._$onCloseWindowEvent=function(){n()},prompt("JS_BRIDGE_INTERCEPT_CLOSE_WINDOW_EVENT",'{"func":"_$onCloseWindowEvent"}')},getContact:function(){return Object(a.a)("SELECT_CONTACT")}};e.default=u},function(n,e,t){(function(n){!function(n){"use strict";function e(n){n=n||"",(n instanceof URLSearchParams||n instanceof e)&&(n=n.toString()),this[l]=r(n)}function t(n){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'\(\)~]|%20|%00/g,function(n){return e[n]})}function i(n){return decodeURIComponent(n.replace(/\+/g," "))}function o(e){var t={next:function(){var n=e.shift();return{done:void 0===n,value:n}}};return I&&(t[n.Symbol.iterator]=function(){return t}),t}function r(n){var e={};if("object"==typeof n){for(var t in n)if(n.hasOwnProperty(t)){var o="string"==typeof n[t]?n[t]:JSON.stringify(n[t]);a(e,t,o)}}else{0===n.indexOf("?")&&(n=n.slice(1));for(var r=n.split("&"),c=0;c<r.length;c++){var u=r[c],s=u.indexOf("=");-1<s?a(e,i(u.slice(0,s)),i(u.slice(s+1))):u&&a(e,i(u),"")}}return e}function a(n,e,t){e in n?n[e].push(""+t):n[e]=[""+t]}var c=n.URLSearchParams?n.URLSearchParams:null,u=c&&"a=1"===new c({a:1}).toString(),s=c&&"+"===new c("s=%2B").get("s"),l="__URLSearchParams__",f=e.prototype,I=!(!n.Symbol||!n.Symbol.iterator);if(!(c&&u&&s)){f.append=function(n,e){a(this[l],n,e)},f.delete=function(n){delete this[l][n]},f.get=function(n){var e=this[l];return n in e?e[n][0]:null},f.getAll=function(n){var e=this[l];return n in e?e[n].slice(0):[]},f.has=function(n){return n in this[l]},f.set=function(n,e){this[l][n]=[""+e]},f.toString=function(){var n,e,i,o,r=this[l],a=[];for(e in r)for(i=t(e),n=0,o=r[e];n<o.length;n++)a.push(i+"="+t(o[n]));return a.join("&")};var d=!s,p=!d&&c&&!u&&n.Proxy;n.URLSearchParams=p?new Proxy(c,{construct:function(n,t){return new n(new e(t[0]).toString())}}):e;var g=n.URLSearchParams.prototype;g.polyfill=!0,g.forEach=g.forEach||function(n,e){var t=r(this.toString());Object.getOwnPropertyNames(t).forEach(function(i){t[i].forEach(function(t){n.call(e,t,i,this)},this)},this)},g.sort=g.sort||function(){var n,e,t,i=r(this.toString()),o=[];for(n in i)o.push(n);for(o.sort(),e=0;e<o.length;e++)this.delete(o[e]);for(e=0;e<o.length;e++){var a=o[e],c=i[a];for(t=0;t<c.length;t++)this.append(a,c[t])}},g.keys=g.keys||function(){var n=[];return this.forEach(function(e,t){n.push([t])}),o(n)},g.values=g.values||function(){var n=[];return this.forEach(function(e){n.push([e])}),o(n)},g.entries=g.entries||function(){var n=[];return this.forEach(function(e,t){n.push([t,e])}),o(n)},I&&(g[n.Symbol.iterator]=g[n.Symbol.iterator]||g.entries)}}(void 0!==n?n:"undefined"!=typeof window?window:this)}).call(e,t(5))},function(n,e){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(n){"object"==typeof window&&(t=window)}n.exports=t},function(n,e){"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(n,e){"use strict";if(null==n)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),i=1;i<arguments.length;i++){var o=arguments[i];if(null!=o)for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(t[r]=o[r])}return t},writable:!0,configurable:!0})},function(n,e,t){"use strict";function i(n,e){Object(o.a)("OPEN_PAGE",{pageName:n,data:e||{}})}var o=t(0);i.webPage=function(n,e,t){i("WEB_PAGE",Object.assign({url:n,title:e},t))},i.scanning=function(){i("SCANING")},i.userCenter=function(n,e,t){i("USERCENTER",{userId:n,avatar:e,realName:t})},i.taskList=function(){i("TASK")},i.task=function(n){i("TASK_DETAIL",n)},i.courseLibrary=function(){i("COURSE")},i.courseSet=function(n,e,t,o){i("COURSE_SET_DETAIL",{id:n,title:e,thumb:t,categoryName:o||""})},i.userCenter=function(n,e,t){i("USERCENTER",{userId:n,avatar:e,realName:t})},i.achievement=function(n){i("ACHIEVEMENT",n)},i.comment=function(n,e,t,i){var o;o="object"!=typeof n||e||t||i?{topicId:n,title:e,isAudit:t,limitTime:i||""}:n,prompt("JS_BRIDGE_OPEN_COMMENT",JSON.stringify(o))},i.chat=function(n,e){i("PERSON_CHAT",{fId:n,fName:e})},i.groupChat=function(n,e){i("GROUP_CHAT",{tId:n,tName:e})},e.a=i},function(n,e,t){"use strict";var i=t(1),o=window.prompt,r=JSON.stringify,a=!0,c={INIT:function(){Object(i.a)()||(a=!1)},JS_BRIDGE_UPLOAD_PIC:function(n){var e=n.callback;window._$uploadPicHandler=function(n){try{var t=JSON.parse(n);e(t.imgUrl)}catch(n){e("")}};var t=o("JS_BRIDGE_UPLOAD_PIC",r({callback:"_$uploadPicHandler"}));t&&window._$uploadPicHandler(t)},JS_BRIDGE_SHOW_IMAGE:function(n){var e=n.imageUrl,t=n.currentPos;return"object"==typeof e&&e.length&&e.length>0?(void 0===t&&(t=0),o("JS_BRIDGE_OPEN_IMAGE_LIST",r({data:e,currImgUrl:"number"==typeof t?e[t]:t}))):o("JS_BRIDGE_OPEN_IMAGE",r({imgUrl:e}))},JS_BRIDGE_SET_RIGHT_BUTTON:function(n){window._$rightButtonHandler=function(){n.callback()},o("JS_BRIDGE_SET_RIGHT_BUTTON",r({buttonName:n.buttonName,buttonClickHandle:"_$rightButtonHandler"}))}};e.a=function(n,e){return a?"function"==typeof c[n]?c[n](e):o(n,r(e)):null}},function(n,e,t){"use strict";function i(n,e){if("function"==typeof h[n]){var t=["INIT","JS_BRIDGE_GET_USER","JS_BRIDGE_SET_USER","JS_BRIDGE_OPEN_PAGE","JS_BRIDGE_OPEN_LOADING","JS_BRIDGE_CLOSE_LOADING"];return m?!g&&t.indexOf(n)<0?(S.push([n,e]),console.info("Wechat invoking is cached"),null):h[n](e):null}return null}function o(){var n=location.host.match(/^(intl-)?[^.]+(\.[a-z.]+)$/i);return n?location.protocol+"//"+(n[1]?"intl-":"")+"ciqapi"+n[2]+"/":""}function r(){return o().replace(/ciqapi/i,"wechat")}function a(){var n=location.host.split(".");return n.shift(),"."+n.join(".")}function c(){var n=document.createElement("style");n.innerHTML="@-webkit-keyframes __jsBridgeLoading {0% {-webkit-transform: rotate3d(0, 0, 1, 0deg);} 100% {-webkit-transform: rotate3d(0, 0, 1, 360deg);}}@keyframes __jsBridgeLoading {0% {transform: rotate3d(0, 0, 1, 0deg);} 100% {transform: rotate3d(0, 0, 1, 360deg);}}.__bridge-mask_transparent {margin: 0; padding: 0; position: fixed; z-index: 1000; top: 0; right: 0; left: 0; bottom: 0}.__bridge-toast {margin: 0; padding: 0; position: fixed; z-index: 5000; width: 100px; height: 100px; top: 180px; left: 50%; margin-left: -3.8em; background: rgba(17, 17, 17, 0.7); text-align: center; border-radius: 5px; color: #FFFFFF;}.__bridge-icon-loading {margin: 30px 0 0; padding: 0; width: 38px; height: 38px; vertical-align: baseline; display: inline-block; -webkit-animation: __jsBridgeLoading 1s steps(12, end) infinite; animation: __jsBridgeLoading 1s steps(12, end) infinite; background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat; background-size: 100%}",document.head.appendChild(n)}function u(n){var e=document.getElementById(n);return e||(e=document.createElement("div"),e.id=n,e.style.display="none",e.innerHTML='<div class="__bridge-mask_transparent"></div><div class="__bridge-toast"><i class="__bridge-icon-loading"></i></div>',document.body.appendChild(e),e)}var s=t(10),l=t.n(s),f=t(11),I=t.n(f),d=t(2),p=t(1),g=!1,m=!0,S=[],h={INIT:function(){Object(p.a)()||(m=!1),l()("//res.wx.qq.com/open/js/jweixin-1.2.0.js",function(){d.a.get({url:r()+"api/wechat/get-js-signature?url="+encodeURIComponent(location.href),success:function(n){wx.config(n),wx.ready(function(){for(g=!0,wx.hideAllNonBaseMenuItem(),wx.hideMenuItems({menuList:["menuItem:share:appMessage","menuItem:share:timeline"]});S.length;){var n=S.shift();i.apply(null,n)}}),wx.error(function(n){console.error(n)})}})}),window.prompt=function(n,e){try{e&&(e=JSON.parse(e))}catch(n){}i(n,e)},c()},JS_BRIDGE_GET_USER:function(){var n=I.a.get(),e={};for(var t in n)n.hasOwnProperty(t)&&"wap_"===t.substr(0,4)&&(e[t.substr(4)]=n[t]);return Object.assign({},{appName:"ciq3",appVersion:"wechat",sysType:"wechat",sysVersion:"0",deviceId:"WECHAT",sessionId:"",lang:"zh",domain:o()},e)},JS_BRIDGE_SET_USER:function(n){for(var e in n)n.hasOwnProperty(e)&&I.a.set("wap_"+e,n[e],{expires:1,path:"/",domain:a()})},JS_BRIDGE_OPEN_PAGE:function(n){var e=n.pageName,t=n.data||{};switch(e){case"WEB_PAGE":location.href=t.url}},JS_BRIDGE_OPEN_LOADING:function(){u("__BRIDGE_LOADING").style.display="block"},JS_BRIDGE_CLOSE_LOADING:function(){u("__BRIDGE_LOADING").style.display="none"},JS_BRIDGE_CLOSE_WINDOW:function(){wx.closeWindow()},JS_BRIDGE_UPLOAD_PIC:function(n){var e=n.callback,t=u("__BRIDGE_UPLOAD_LOADING");wx.chooseImage({count:1,sizeType:["compressed"],success:function(n){var i=n.localIds[0];t.style.display="block",wx.uploadImage({localId:i,success:function(n){var i=n.serverId;console.log(n),d.a.get({url:r()+"api/wechat/upload-image?media_id="+i,success:function(n){t.style.display="none",200===n.status?e(n.data.imgUrl):alert(n.message)},error:function(){t.style.display="none"}})},fail:function(){t.style.display="none"}})}})},JS_BRIDGE_SHOW_IMAGE:function(n){var e=n.imageUrl,t=n.currentPos;"string"==typeof e&&(e=[e]),wx.previewImage({urls:e,current:("number"==typeof t?e[t]:t)||""})},JS_BRIDGE_SHARE:function(n){wx.showMenuItems({menuList:["menuItem:share:appMessage","menuItem:share:timeline"]}),wx.onMenuShareTimeline({title:n.title,link:n.url,imgUrl:n.image,success:function(){}}),wx.onMenuShareAppMessage({title:n.title,desc:n.desc,link:n.url,imgUrl:n.image,type:"link",success:function(){}})}};e.a=i},function(n,e,t){var i,o;/*!
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Bridge=e():n.Bridge=e()}("undefined"!=typeof self?self:this,function(){return function(n){function e(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var t={};return e.m=n,e.c=t,e.d=function(n,t,i){e.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:i})},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},e.p="",e(e.s=5)}([function(n,e,t){"use strict";function i(){var n=navigator.userAgent;return/MicroBenefitsCIQ|StormBenefitsPocket/i.test(n)?"ciq":/MicroMessenger/.test(n)?"wechat":"web"}var o=t(10),r=t(11),a=t(14),c={ciq:o.a,wechat:r.a,web:a.a},u="";e.a=function(n,e,t,o){if(console.log(arguments),void 0===t&&(t=!0),void 0===o&&(o=!0),u||(u=i()),!u||void 0===c[u])return null;try{var r=c[u],a=r(t?"JS_BRIDGE_"+n:n,e);return o&&a&&"string"==typeof a?JSON.parse(a):a}catch(n){return console.warn(n),null}}},function(n,e,t){"use strict";e.a=function(){if("file:"===location.protocol)return!0;return!!new RegExp(atob("KFwuaWZ1bGlcLmNufFwuaXdlaWJhbmdcLmNvbXxcLm1lXC5jb218XC5wb2NrZXRoclwudGVjaHwxOTJcLjE2OFwuXGR7MSwzfVwuXGR7MSwzfSg6XGR7MSw1fSk/KSQ=")).test(location.host)}},function(n,e,t){var i,o;!function(r){var a=!1;if(i=r,void 0!==(o="function"==typeof i?i.call(e,t,e,n):i)&&(n.exports=o),a=!0,n.exports=r(),a=!0,!a){var c=window.Cookies,u=window.Cookies=r();u.noConflict=function(){return window.Cookies=c,u}}}(function(){function n(){for(var n=0,e={};n<arguments.length;n++){var t=arguments[n];for(var i in t)e[i]=t[i]}return e}function e(t){function i(e,o,r){var a;if("undefined"!=typeof document){if(arguments.length>1){if(r=n({path:"/"},i.defaults,r),"number"==typeof r.expires){var c=new Date;c.setMilliseconds(c.getMilliseconds()+864e5*r.expires),r.expires=c}r.expires=r.expires?r.expires.toUTCString():"";try{a=JSON.stringify(o),/^[\{\[]/.test(a)&&(o=a)}catch(n){}o=t.write?t.write(o,e):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),e=e.replace(/[\(\)]/g,escape);var u="";for(var s in r)r[s]&&(u+="; "+s,!0!==r[s]&&(u+="="+r[s]));return document.cookie=e+"="+o+u}e||(a={});for(var l=document.cookie?document.cookie.split("; "):[],f=/(%[0-9A-Z]{2})+/g,I=0;I<l.length;I++){var d=l[I].split("="),p=d.slice(1).join("=");this.json||'"'!==p.charAt(0)||(p=p.slice(1,-1));try{var g=d[0].replace(f,decodeURIComponent);if(p=t.read?t.read(p,g):t(p,g)||p.replace(f,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(n){}if(e===g){a=p;break}e||(a[g]=p)}catch(n){}}return a}}return i.set=i,i.get=function(n){return i.call(i,n)},i.getJSON=function(){return i.apply({json:!0},[].slice.call(arguments))},i.defaults={},i.remove=function(e,t){i(e,"",n(t,{expires:-1}))},i.withConverter=e,i}return e(function(){})})},function(n,e,t){"use strict";function i(n,e){e=Object.assign({},{type:n||"GET",url:"",headers:{},data:"",withSignature:!1,timeout:0,withCredentials:!1,success:u,error:u,complete:u},e);var t=new XMLHttpRequest;t.open(e.type,e.url),e.timeout>0&&(t.timeout=e.timeout);var i=Object(r.a)("GET_USER")||{},a=Object.assign({},{appName:i.appName||"ciq3",appVersion:i.appVersion||"",sysType:i.sysType||"",sysVersion:i.sysVersion||"",deviceId:i.deviceId||"",sessionId:i.sessionId||"",lang:i.lang||"zh"},e.headers);e.withSignature&&(a.sign=o(e.data)),t.withCredentials=e.withCredentials;var c=null;e.data&&("object"==typeof e.data?/json/i.test(a["Content-type"])?c=JSON.stringify(e.data):(a["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8",c=new URLSearchParams(e.data).toString()):c=e.data);for(var s in a)a.hasOwnProperty(s)&&t.setRequestHeader(s,a[s]);t.send(c),t.onreadystatechange=function(){if(4===t.readyState&&t.responseText)try{var n=JSON.parse(t.responseText);e.success(n,t),e.complete(t)}catch(n){e.success(t.responseText,t),e.complete(t)}},t.ontimeout=function(n){e.error(n,t),e.complete(t)},t.onerror=function(n){e.error(n,t),e.complete(t)}}function o(n){var e=Object.keys(n).sort().map(function(e){return e+"="+n[e]}).join("&");return c()("tQbPwzcmERdu",e)}var r=t(0),a=t(13),c=t.n(a),u=function(){};e.a={post:function(n,e,t){"object"!=typeof n||e||t?Object.assign(t,{url:n,data:e}):t=n,i("POST",t)},get:function(n,e){"object"!=typeof n||e?Object.assign(e,{url:n}):e=n,i("GET",e)},ajax:function(n){i("",n)}}},function(n,e,t){"use strict";var i=t(2),o=t.n(i);e.a={getCookieFields:function(){var n=o.a.get(),e={};for(var t in n)n.hasOwnProperty(t)&&"wap_"===t.substr(0,4)&&(e[t.substr(4)]=n[t]);return e},getApiDomain:function(){var n=location.host.match(/^(intl-)?[^.]+(\.[a-z.]+)$/i);return n?location.protocol+"//"+(n[1]?"intl-":"")+"ciqapi"+n[2]+"/":""}}},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=t(6),o=(t.n(i),t(8)),r=(t.n(o),t(9)),a=t(0),c=t(3);Object(a.a)("INIT",null,!1);var u={version:"5.1.2",openPage:r.a,ajax:c.a,getSession:function(){return Object(a.a)("GET_USER")},getUserInfo:function(){return Object(a.a)("GET_USER_INFO")},sessionInvalid:function(){Object(a.a)("SESSION_INVALID")},setCallbackArgs:function(n){Object(a.a)("CALLBACK_ARGUMENTS",{arguments:n})},closePage:function(){Object(a.a)("CLOSE_WINDOW")},setOperationButton:function(n,e){Object(a.a)("SET_RIGHT_BUTTON",{buttonName:n,callback:e})},log:function(n){Object(a.a)("LOG",n)},uploadImage:function(n){if("function"!=typeof n)throw new Error("UploadImage callback must be a function");Object(a.a)("UPLOAD_PIC",{callback:n})},showImage:function(n,e){Object(a.a)("SHOW_IMAGE",{imageUrl:n,currentPos:e})},takeShortVideo:function(){return Object(a.a)("TAKE_SHORT_VIDEO")},getNetState:function(){return Object(a.a)("NET_STATE")},getLocation:function(){return Object(a.a)("LOCATION")},showLoading:function(){Object(a.a)("OPEN_LOADING")},hideLoading:function(){Object(a.a)("CLOSE_LOADING")},hideTitleBar:function(){Object(a.a)("HIDE_TITLE_BAR")},share:function(n,e,t,i){return Object(a.a)("SHARE",{url:n,title:e,desc:t||"",image:i||""})},eventsStatistic:function(n,e){return Object(a.a)("EVENTS_STATISTIC",{eventName:n,properties:e||{}})},getDecryptValue:function(n,e){return Object(a.a)("DECRYPT_DATA",{key:n,data:e})},onClosePage:function(n){if("function"!=typeof n)return void console.error("onCloseWindow callback must be a function");window._$onCloseWindowEvent=function(){n()},prompt("JS_BRIDGE_INTERCEPT_CLOSE_WINDOW_EVENT",'{"func":"_$onCloseWindowEvent"}')},getContact:function(){return Object(a.a)("SELECT_CONTACT")}};e.default=u},function(n,e,t){(function(n){!function(n){"use strict";function e(n){n=n||"",(n instanceof URLSearchParams||n instanceof e)&&(n=n.toString()),this[l]=r(n)}function t(n){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'\(\)~]|%20|%00/g,function(n){return e[n]})}function i(n){return decodeURIComponent(n.replace(/\+/g," "))}function o(e){var t={next:function(){var n=e.shift();return{done:void 0===n,value:n}}};return I&&(t[n.Symbol.iterator]=function(){return t}),t}function r(n){var e={};if("object"==typeof n){for(var t in n)if(n.hasOwnProperty(t)){var o="string"==typeof n[t]?n[t]:JSON.stringify(n[t]);a(e,t,o)}}else{0===n.indexOf("?")&&(n=n.slice(1));for(var r=n.split("&"),c=0;c<r.length;c++){var u=r[c],s=u.indexOf("=");-1<s?a(e,i(u.slice(0,s)),i(u.slice(s+1))):u&&a(e,i(u),"")}}return e}function a(n,e,t){e in n?n[e].push(""+t):n[e]=[""+t]}var c=n.URLSearchParams?n.URLSearchParams:null,u=c&&"a=1"===new c({a:1}).toString(),s=c&&"+"===new c("s=%2B").get("s"),l="__URLSearchParams__",f=e.prototype,I=!(!n.Symbol||!n.Symbol.iterator);if(!(c&&u&&s)){f.append=function(n,e){a(this[l],n,e)},f.delete=function(n){delete this[l][n]},f.get=function(n){var e=this[l];return n in e?e[n][0]:null},f.getAll=function(n){var e=this[l];return n in e?e[n].slice(0):[]},f.has=function(n){return n in this[l]},f.set=function(n,e){this[l][n]=[""+e]},f.toString=function(){var n,e,i,o,r=this[l],a=[];for(e in r)for(i=t(e),n=0,o=r[e];n<o.length;n++)a.push(i+"="+t(o[n]));return a.join("&")};var d=!s,p=!d&&c&&!u&&n.Proxy;n.URLSearchParams=p?new Proxy(c,{construct:function(n,t){return new n(new e(t[0]).toString())}}):e;var g=n.URLSearchParams.prototype;g.polyfill=!0,g.forEach=g.forEach||function(n,e){var t=r(this.toString());Object.getOwnPropertyNames(t).forEach(function(i){t[i].forEach(function(t){n.call(e,t,i,this)},this)},this)},g.sort=g.sort||function(){var n,e,t,i=r(this.toString()),o=[];for(n in i)o.push(n);for(o.sort(),e=0;e<o.length;e++)this.delete(o[e]);for(e=0;e<o.length;e++){var a=o[e],c=i[a];for(t=0;t<c.length;t++)this.append(a,c[t])}},g.keys=g.keys||function(){var n=[];return this.forEach(function(e,t){n.push([t])}),o(n)},g.values=g.values||function(){var n=[];return this.forEach(function(e){n.push([e])}),o(n)},g.entries=g.entries||function(){var n=[];return this.forEach(function(e,t){n.push([t,e])}),o(n)},I&&(g[n.Symbol.iterator]=g[n.Symbol.iterator]||g.entries)}}(void 0!==n?n:"undefined"!=typeof window?window:this)}).call(e,t(7))},function(n,e){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(n){"object"==typeof window&&(t=window)}n.exports=t},function(n,e){"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(n,e){"use strict";if(null==n)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),i=1;i<arguments.length;i++){var o=arguments[i];if(null!=o)for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(t[r]=o[r])}return t},writable:!0,configurable:!0})},function(n,e,t){"use strict";function i(n,e){Object(o.a)("OPEN_PAGE",{pageName:n,data:e||{}})}var o=t(0);i.webPage=function(n,e,t){i("WEB_PAGE",Object.assign({url:n,title:e},t))},i.scanning=function(){i("SCANING")},i.userCenter=function(n,e,t){i("USERCENTER",{userId:n,avatar:e,realName:t})},i.taskList=function(){i("TASK")},i.task=function(n){i("TASK_DETAIL",n)},i.courseLibrary=function(){i("COURSE")},i.courseSet=function(n,e,t,o){i("COURSE_SET_DETAIL",{id:n,title:e,thumb:t,categoryName:o||""})},i.userCenter=function(n,e,t){i("USERCENTER",{userId:n,avatar:e,realName:t})},i.achievement=function(n){i("ACHIEVEMENT",n)},i.comment=function(n,e,t,i){var o;o="object"!=typeof n||e||t||i?{topicId:n,title:e,isAudit:t,limitTime:i||""}:n,prompt("JS_BRIDGE_OPEN_COMMENT",JSON.stringify(o))},i.chat=function(n,e){i("PERSON_CHAT",{fId:n,fName:e})},i.groupChat=function(n,e){i("GROUP_CHAT",{tId:n,tName:e})},e.a=i},function(n,e,t){"use strict";var i=t(1),o=window.prompt,r=JSON.stringify,a=!0,c={INIT:function(){Object(i.a)()||(a=!1)},JS_BRIDGE_UPLOAD_PIC:function(n){var e=n.callback;window._$uploadPicHandler=function(n){try{var t=JSON.parse(n);e(t.imgUrl)}catch(n){e("")}};var t=o("JS_BRIDGE_UPLOAD_PIC",r({callback:"_$uploadPicHandler"}));t&&window._$uploadPicHandler(t)},JS_BRIDGE_SHOW_IMAGE:function(n){var e=n.imageUrl,t=n.currentPos;return"object"==typeof e&&e.length&&e.length>0?(void 0===t&&(t=0),o("JS_BRIDGE_OPEN_IMAGE_LIST",r({data:e,currImgUrl:"number"==typeof t?e[t]:t}))):o("JS_BRIDGE_OPEN_IMAGE",r({imgUrl:e}))},JS_BRIDGE_SET_RIGHT_BUTTON:function(n){window._$rightButtonHandler=function(){n.callback()},o("JS_BRIDGE_SET_RIGHT_BUTTON",r({buttonName:n.buttonName,buttonClickHandle:"_$rightButtonHandler"}))}};e.a=function(n,e){return a?"function"==typeof c[n]?c[n](e):o(n,r(e)):null}},function(n,e,t){"use strict";function i(n,e){if("function"==typeof S[n]){var t=["INIT","JS_BRIDGE_GET_USER","JS_BRIDGE_SET_USER","JS_BRIDGE_OPEN_PAGE","JS_BRIDGE_OPEN_LOADING","JS_BRIDGE_CLOSE_LOADING"];return p?!d&&t.indexOf(n)<0?(g.push([n,e]),console.info("Wechat invoking is cached"),null):S[n](e):null}return null}function o(){return I.a.getApiDomain().replace(/ciqapi/i,"wechat")}function r(){var n=document.createElement("style");n.innerHTML="@-webkit-keyframes __jsBridgeLoading {0% {-webkit-transform: rotate3d(0, 0, 1, 0deg);} 100% {-webkit-transform: rotate3d(0, 0, 1, 360deg);}}@keyframes __jsBridgeLoading {0% {transform: rotate3d(0, 0, 1, 0deg);} 100% {transform: rotate3d(0, 0, 1, 360deg);}}.__bridge-mask_transparent {margin: 0; padding: 0; position: fixed; z-index: 1000; top: 0; right: 0; left: 0; bottom: 0}.__bridge-toast {margin: 0; padding: 0; position: fixed; z-index: 5000; width: 100px; height: 100px; top: 180px; left: 50%; margin-left: -3.8em; background: rgba(17, 17, 17, 0.7); text-align: center; border-radius: 5px; color: #FFFFFF;}.__bridge-icon-loading {margin: 30px 0 0; padding: 0; width: 38px; height: 38px; vertical-align: baseline; display: inline-block; -webkit-animation: __jsBridgeLoading 1s steps(12, end) infinite; animation: __jsBridgeLoading 1s steps(12, end) infinite; background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat; background-size: 100%}",document.head.appendChild(n)}function a(n){var e=document.getElementById(n);return e||(e=document.createElement("div"),e.id=n,e.style.display="none",e.innerHTML='<div class="__bridge-mask_transparent"></div><div class="__bridge-toast"><i class="__bridge-icon-loading"></i></div>',document.body.appendChild(e),e)}var c=t(12),u=t.n(c),s=t(2),l=(t.n(s),t(3)),f=t(1),I=t(4),d=!1,p=!0,g=[],m="-",S={INIT:function(){Object(f.a)()||(p=!1);var n=navigator.userAgent.match(/MicroMessenger\/([\d.]+)\s?/);n&&n[1]&&(m=n[1]),u()("//res.wx.qq.com/open/js/jweixin-1.2.0.js",function(){l.a.get({url:o()+"api/wechat/get-js-signature?url="+encodeURIComponent(location.href),success:function(n){wx.config(n),wx.ready(function(){for(d=!0,wx.hideAllNonBaseMenuItem(),wx.hideMenuItems({menuList:["menuItem:share:appMessage","menuItem:share:timeline"]});g.length;){var n=g.shift();i.apply(null,n)}}),wx.error(function(n){console.error(n)})}})}),window.prompt=function(n,e){try{e&&(e=JSON.parse(e))}catch(n){}i(n,e)},r()},JS_BRIDGE_GET_USER:function(){var n=I.a.getCookieFields();return Object.assign({},{appName:"ciq3",appVersion:"wechat",sysType:"wechat",sysVersion:m,deviceId:"WECHAT",sessionId:"",lang:"zh",domain:I.a.getApiDomain()},n)},JS_BRIDGE_OPEN_PAGE:function(n){var e=n.pageName,t=n.data||{};switch(e){case"WEB_PAGE":location.href=t.url}},JS_BRIDGE_OPEN_LOADING:function(){a("__BRIDGE_LOADING").style.display="block"},JS_BRIDGE_CLOSE_LOADING:function(){a("__BRIDGE_LOADING").style.display="none"},JS_BRIDGE_CLOSE_WINDOW:function(){wx.closeWindow()},JS_BRIDGE_UPLOAD_PIC:function(n){var e=n.callback,t=a("__BRIDGE_UPLOAD_LOADING");wx.chooseImage({count:1,sizeType:["compressed"],success:function(n){var i=n.localIds[0];t.style.display="block",wx.uploadImage({localId:i,success:function(n){var i=n.serverId;console.log(n),l.a.get({url:o()+"api/wechat/upload-image?media_id="+i,success:function(n){t.style.display="none",200===n.status?e(n.data.imgUrl):alert(n.message)},error:function(){t.style.display="none"}})},fail:function(){t.style.display="none"}})}})},JS_BRIDGE_SHOW_IMAGE:function(n){var e=n.imageUrl,t=n.currentPos;"string"==typeof e&&(e=[e]),wx.previewImage({urls:e,current:("number"==typeof t?e[t]:t)||""})},JS_BRIDGE_SHARE:function(n){wx.showMenuItems({menuList:["menuItem:share:appMessage","menuItem:share:timeline"]}),wx.onMenuShareTimeline({title:n.title,link:n.url,imgUrl:n.image,success:function(){}}),wx.onMenuShareAppMessage({title:n.title,desc:n.desc,link:n.url,imgUrl:n.image,type:"link",success:function(){}})}};e.a=i},function(n,e,t){var i,o;/*!
* $script.js JS loader & dependency manager

@@ -12,2 +12,2 @@ * https://github.com/ded/script.js

*/
!function(r,a){void 0!==n&&n.exports?n.exports=a():(i=a,void 0!==(o="function"==typeof i?i.call(e,t,e,n):i)&&(n.exports=o))}(0,function(){function n(n,e){for(var t=0,i=n.length;t<i;++t)if(!e(n[t]))return u;return 1}function e(e,t){n(e,function(n){return!t(n)})}function t(r,a,c){function u(n){return n.call?n():I[n]}function l(){if(!--h){I[S]=1,m&&m();for(var t in p)n(t.split("|"),u)&&!e(p[t],u)&&(p[t]=[])}}r=r[s]?r:[r];var f=a&&a.call,m=f?a:c,S=f?r.join(""):a,h=r.length;return setTimeout(function(){e(r,function n(e,t){return null===e?l():(t||/^https?:\/\//.test(e)||!o||(e=-1===e.indexOf(".js")?o+e+".js":o+e),g[e]?(S&&(d[S]=1),2==g[e]?l():setTimeout(function(){n(e,!0)},0)):(g[e]=1,S&&(d[S]=1),void i(e,l)))})},0),t}function i(n,e){var t,i=a.createElement("script");i.onload=i.onerror=i[f]=function(){i[l]&&!/^c|loade/.test(i[l])||t||(i.onload=i[f]=null,t=1,g[n]=2,e())},i.async=1,i.src=r?n+(-1===n.indexOf("?")?"?":"&")+r:n,c.insertBefore(i,c.lastChild)}var o,r,a=document,c=a.getElementsByTagName("head")[0],u=!1,s="push",l="readyState",f="onreadystatechange",I={},d={},p={},g={};return t.get=i,t.order=function(n,e,i){!function o(r){r=n.shift(),n.length?t(r,o):t(r,e,i)}()},t.path=function(n){o=n},t.urlArgs=function(n){r=n},t.ready=function(i,o,r){i=i[s]?i:[i];var a=[];return!e(i,function(n){I[n]||a[s](n)})&&n(i,function(n){return I[n]})?o():function(n){p[n]=p[n]||[],p[n][s](o),r&&r(a)}(i.join("|")),t},t.done=function(n){t([null],n)},t})},function(n,e,t){var i,o;!function(r){var a=!1;if(i=r,void 0!==(o="function"==typeof i?i.call(e,t,e,n):i)&&(n.exports=o),a=!0,n.exports=r(),a=!0,!a){var c=window.Cookies,u=window.Cookies=r();u.noConflict=function(){return window.Cookies=c,u}}}(function(){function n(){for(var n=0,e={};n<arguments.length;n++){var t=arguments[n];for(var i in t)e[i]=t[i]}return e}function e(t){function i(e,o,r){var a;if("undefined"!=typeof document){if(arguments.length>1){if(r=n({path:"/"},i.defaults,r),"number"==typeof r.expires){var c=new Date;c.setMilliseconds(c.getMilliseconds()+864e5*r.expires),r.expires=c}r.expires=r.expires?r.expires.toUTCString():"";try{a=JSON.stringify(o),/^[\{\[]/.test(a)&&(o=a)}catch(n){}o=t.write?t.write(o,e):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),e=e.replace(/[\(\)]/g,escape);var u="";for(var s in r)r[s]&&(u+="; "+s,!0!==r[s]&&(u+="="+r[s]));return document.cookie=e+"="+o+u}e||(a={});for(var l=document.cookie?document.cookie.split("; "):[],f=/(%[0-9A-Z]{2})+/g,I=0;I<l.length;I++){var d=l[I].split("="),p=d.slice(1).join("=");this.json||'"'!==p.charAt(0)||(p=p.slice(1,-1));try{var g=d[0].replace(f,decodeURIComponent);if(p=t.read?t.read(p,g):t(p,g)||p.replace(f,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(n){}if(e===g){a=p;break}e||(a[g]=p)}catch(n){}}return a}}return i.set=i,i.get=function(n){return i.call(i,n)},i.getJSON=function(){return i.apply({json:!0},[].slice.call(arguments))},i.defaults={},i.remove=function(e,t){i(e,"",n(t,{expires:-1}))},i.withConverter=e,i}return e(function(){})})},function(n,e){function t(n,e,t,i){function o(n,e,t,i){return n<20?e&t|~e&i:n<40?e^t^i:n<60?e&t|e&i|t&i:e^t^i}function r(n){return n<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514}function a(n,e){var t=(65535&n)+(65535&e);return(n>>16)+(e>>16)+(t>>16)<<16|65535&t}function c(n,e){return n<<e|n>>>32-e}function u(n,e){n[e>>5]|=128<<24-e%32,n[15+(e+64>>9<<4)]=e;for(var t=[80],i=1732584193,u=-271733879,s=-1732584194,l=271733878,f=-1009589776,I=0;I<n.length;I+=16){for(var d=i,p=u,g=s,m=l,S=f,h=0;h<80;h++){t[h]=h<16?n[I+h]:c(t[h-3]^t[h-8]^t[h-14]^t[h-16],1);var y=a(a(c(i,5),o(h,u,s,l)),a(a(f,t[h]),r(h)));f=l,l=s,s=c(u,30),u=i,i=y}i=a(i,d),u=a(u,p),s=a(s,g),l=a(l,m),f=a(f,S)}return[i,u,s,l,f]}function s(n){for(var e=[],t=(1<<i)-1,o=0;o<n.length*i;o+=i)e[o>>5]|=(n.charCodeAt(o/8)&t)<<32-i-o%32;return e}function l(n,e){var t=s(n);t.length>16&&(t=u(t,n.length*i));for(var o=[16],r=[16],a=0;a<16;a++)o[a]=909522486^t[a],r[a]=1549556828^t[a];var c=u(o.concat(s(e)),512+e.length*i);return u(r.concat(c),672)}function f(n){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="",o=0;o<4*n.length;o+=3)for(var r=(n[o>>2]>>8*(3-o%4)&255)<<16|(n[o+1>>2]>>8*(3-(o+1)%4)&255)<<8|n[o+2>>2]>>8*(3-(o+2)%4)&255,a=0;a<4;a++)8*o+6*a>32*n.length?i+=t:i+=e.charAt(r>>6*(3-a)&63);return i}return t||(t="="),i||(i=8),function(n,e){return f(l(n,e))}(n,e)}n.exports=t}]).default});
!function(r,a){void 0!==n&&n.exports?n.exports=a():(i=a,void 0!==(o="function"==typeof i?i.call(e,t,e,n):i)&&(n.exports=o))}(0,function(){function n(n,e){for(var t=0,i=n.length;t<i;++t)if(!e(n[t]))return u;return 1}function e(e,t){n(e,function(n){return!t(n)})}function t(r,a,c){function u(n){return n.call?n():I[n]}function l(){if(!--h){I[S]=1,m&&m();for(var t in p)n(t.split("|"),u)&&!e(p[t],u)&&(p[t]=[])}}r=r[s]?r:[r];var f=a&&a.call,m=f?a:c,S=f?r.join(""):a,h=r.length;return setTimeout(function(){e(r,function n(e,t){return null===e?l():(t||/^https?:\/\//.test(e)||!o||(e=-1===e.indexOf(".js")?o+e+".js":o+e),g[e]?(S&&(d[S]=1),2==g[e]?l():setTimeout(function(){n(e,!0)},0)):(g[e]=1,S&&(d[S]=1),void i(e,l)))})},0),t}function i(n,e){var t,i=a.createElement("script");i.onload=i.onerror=i[f]=function(){i[l]&&!/^c|loade/.test(i[l])||t||(i.onload=i[f]=null,t=1,g[n]=2,e())},i.async=1,i.src=r?n+(-1===n.indexOf("?")?"?":"&")+r:n,c.insertBefore(i,c.lastChild)}var o,r,a=document,c=a.getElementsByTagName("head")[0],u=!1,s="push",l="readyState",f="onreadystatechange",I={},d={},p={},g={};return t.get=i,t.order=function(n,e,i){!function o(r){r=n.shift(),n.length?t(r,o):t(r,e,i)}()},t.path=function(n){o=n},t.urlArgs=function(n){r=n},t.ready=function(i,o,r){i=i[s]?i:[i];var a=[];return!e(i,function(n){I[n]||a[s](n)})&&n(i,function(n){return I[n]})?o():function(n){p[n]=p[n]||[],p[n][s](o),r&&r(a)}(i.join("|")),t},t.done=function(n){t([null],n)},t})},function(n,e){function t(n,e,t,i){function o(n,e,t,i){return n<20?e&t|~e&i:n<40?e^t^i:n<60?e&t|e&i|t&i:e^t^i}function r(n){return n<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514}function a(n,e){var t=(65535&n)+(65535&e);return(n>>16)+(e>>16)+(t>>16)<<16|65535&t}function c(n,e){return n<<e|n>>>32-e}function u(n,e){n[e>>5]|=128<<24-e%32,n[15+(e+64>>9<<4)]=e;for(var t=[80],i=1732584193,u=-271733879,s=-1732584194,l=271733878,f=-1009589776,I=0;I<n.length;I+=16){for(var d=i,p=u,g=s,m=l,S=f,h=0;h<80;h++){t[h]=h<16?n[I+h]:c(t[h-3]^t[h-8]^t[h-14]^t[h-16],1);var y=a(a(c(i,5),o(h,u,s,l)),a(a(f,t[h]),r(h)));f=l,l=s,s=c(u,30),u=i,i=y}i=a(i,d),u=a(u,p),s=a(s,g),l=a(l,m),f=a(f,S)}return[i,u,s,l,f]}function s(n){for(var e=[],t=(1<<i)-1,o=0;o<n.length*i;o+=i)e[o>>5]|=(n.charCodeAt(o/8)&t)<<32-i-o%32;return e}function l(n,e){var t=s(n);t.length>16&&(t=u(t,n.length*i));for(var o=[16],r=[16],a=0;a<16;a++)o[a]=909522486^t[a],r[a]=1549556828^t[a];var c=u(o.concat(s(e)),512+e.length*i);return u(r.concat(c),672)}function f(n){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="",o=0;o<4*n.length;o+=3)for(var r=(n[o>>2]>>8*(3-o%4)&255)<<16|(n[o+1>>2]>>8*(3-(o+1)%4)&255)<<8|n[o+2>>2]>>8*(3-(o+2)%4)&255,a=0;a<4;a++)8*o+6*a>32*n.length?i+=t:i+=e.charAt(r>>6*(3-a)&63);return i}return t||(t="="),i||(i=8),function(n,e){return f(l(n,e))}(n,e)}n.exports=t},function(n,e,t){"use strict";function i(n,e){return"function"==typeof c[n]&&a?c[n](e):null}var o=t(1),r=t(4),a=!0,c={INIT:function(){Object(o.a)()||(a=!1)},JS_BRIDGE_GET_USER:function(){var n=r.a.getCookieFields();return Object.assign({},{appName:"ciq3",appVersion:"web",sysType:"web",sysVersion:"unknown",deviceId:"WECHAT",sessionId:"",lang:"zh",domain:r.a.getApiDomain()},n)}};e.a=i}]).default});

@@ -43,12 +43,2 @@ /**

/**
* 设置用户会话数据,目前仅供微信端使用
*
* @since v5.0
* @param params {{sessionId, userId, name, companyId}}
*/
setSession: function (params) {
return callBridge('SET_USER', params);
},
/**
* 获取用户个人信息

@@ -55,0 +45,0 @@ *

@@ -48,3 +48,3 @@ /**

/**
* 设置右上角操作按钮
* 图片预览
*

@@ -73,2 +73,8 @@ * @param data

/**
* 设置右上角操作按钮
*
* @param params
* @constructor
*/
JS_BRIDGE_SET_RIGHT_BUTTON: function(params) {

@@ -75,0 +81,0 @@ window._$rightButtonHandler = function() {

@@ -12,6 +12,8 @@ /**

import checkAccess from '../utils/checkAccess'
import webCommon from '../utils/web-common'
var isWechatReady = false, // 微信环境是否初始化完成
isAccessible = true, // 是否可访问 JS Bridge 资源
callStack = [] // 初始化完成前的调用均缓存至此
callStack = [], // 初始化完成前的调用均缓存至此
wechatVersion = '-' // 微信版本号

@@ -27,2 +29,8 @@ var bridgeMethods = {

// 从 UserAgent 中获取当前微信版本号
var v = navigator.userAgent.match(/MicroMessenger\/([\d.]+)\s?/)
if (v && v[1]) {
wechatVersion = v[1]
}
// 加载微信 JS-sdk 文件

@@ -84,12 +92,4 @@ loadScript('//res.wx.qq.com/open/js/jweixin-1.2.0.js', function() {

JS_BRIDGE_GET_USER: function() {
var cookies = Cookie.get(),
ret = {}
var cookieData = webCommon.getCookieFields()
// 查找所有以 wap_ 开头的内容,并返回
for (var i in cookies) {
if (cookies.hasOwnProperty(i) && i.substr(0, 4) === 'wap_') {
ret[i.substr(4)] = cookies[i]
}
}
return Object.assign({}, {

@@ -99,28 +99,11 @@ appName: 'ciq3',

sysType: 'wechat',
sysVersion: '0',
sysVersion: wechatVersion,
deviceId: 'WECHAT',
sessionId: '',
lang: 'zh',
domain: getApiDomain()
}, ret)
domain: webCommon.getApiDomain()
}, cookieData)
},
/**
* 设置用户数据
*
* @param params {{sessionId, userId, name, companyId}}
*/
JS_BRIDGE_SET_USER: function(params) {
for (var i in params) {
if (params.hasOwnProperty(i)) {
Cookie.set('wap_' + i, params[i], {
expires: 1,
path: '/',
domain: getCookieDomain()
});
}
}
},
/**
* 打开指定页面

@@ -281,22 +264,6 @@ *

function getApiDomain() {
// 生成接口域名
var matches = location.host.match(/^(intl-)?[^.]+(\.[a-z.]+)$/i)
if (!matches) {
return ''
}
return location.protocol + '//' + (matches[1] ? 'intl-' : '') + 'ciqapi' + matches[2] + '/';
}
function getWechatDomain() {
return getApiDomain().replace(/ciqapi/i, 'wechat');
return webCommon.getApiDomain().replace(/ciqapi/i, 'wechat');
}
function getCookieDomain() {
var arr = location.host.split('.')
arr.shift()
return '.' + arr.join('.')
}
function setExtraCSS() {

@@ -303,0 +270,0 @@ var css = '@-webkit-keyframes __jsBridgeLoading {0% {-webkit-transform: rotate3d(0, 0, 1, 0deg);} 100% {-webkit-transform: rotate3d(0, 0, 1, 360deg);}}' +

@@ -51,3 +51,3 @@ /**

withSignature: false, // 接口是否需要签名认证
timeout: 10000,
timeout: 0,
withCredentials: false,

@@ -62,4 +62,8 @@ success: noop,

xhr.open(params.type, params.url);
xhr.timeout = params.timeout;
// 超时时间
if (params.timeout > 0) {
xhr.timeout = params.timeout;
}
// 获取请求基本 header 内容

@@ -82,2 +86,5 @@ var userSession = callBridge('GET_USER') || {},

// 跨域传 Cookie
xhr.withCredentials = params.withCredentials;
// 生成请求正文

@@ -84,0 +91,0 @@ var _data = null;

@@ -9,6 +9,8 @@ /**

import wechat from '../providers/wechat'
import web from '../providers/web'
var providers = {
ciq: ciq,
wechat: wechat
wechat: wechat,
web: web
},

@@ -64,3 +66,3 @@ clientType = '';

if (/MicroBenefitsCIQ/.test(ua)) {
if (/MicroBenefitsCIQ|StormBenefitsPocket/i.test(ua)) {
return 'ciq';

@@ -71,3 +73,3 @@ } else if (/MicroMessenger/.test(ua)) {

return '';
return 'web';
}

@@ -20,4 +20,4 @@ /**

// 为避免被第三方搜索并修改域名验证部分的代码,这里把匹配域名的正则表达式做 Base64 编码处理,在匹配时再去解码
// 完整的原始字符串为: (\.ifuli\.cn|\.iweibang\.com|\.me\.com|192\.168\.\d{1,3}\.\d{1,3}(:\d{1,5})?)$
var reg = 'KFwuaWZ1bGlcLmNufFwuaXdlaWJhbmdcLmNvbXxcLm1lXC5jb218MTkyXC4xNjhcLlxkezEsM31cLlxkezEsM30oOlxkezEsNX0pPykk';
// 完整的原始字符串为: (\.ifuli\.cn|\.iweibang\.com|\.me\.com|\.pockethr\.tech|192\.168\.\d{1,3}\.\d{1,3}(:\d{1,5})?)$
var reg = 'KFwuaWZ1bGlcLmNufFwuaXdlaWJhbmdcLmNvbXxcLm1lXC5jb218XC5wb2NrZXRoclwudGVjaHwxOTJcLjE2OFwuXGR7MSwzfVwuXGR7MSwzfSg6XGR7MSw1fSk/KSQ=';

@@ -24,0 +24,0 @@ if (new RegExp(atob(reg)).test(location.host))

{
"name": "mb-js-bridge",
"version": "5.0.6",
"version": "5.1.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/js-bridge-umd.min.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc