UNPKG

mobileoa-common-modules

Version:

移动办公平台前端公共功能模块

2 lines 283 kB
var mobileoaCommonModules=function(t,e,n,i,o,s,a,r){"use strict";function c(t){return t&&"object"==typeof t&&"default"in t?t["default"]:t}function l(t,e){return e={exports:{}},t(e,e.exports),e.exports}var u=l(function(e){var n=c(t);n.module("appconfig.init",["mobileoa-core"]),n.module("appconfig.routes",["ui.router"]),n.module("appconfig.services.appflowinit",["mobileoa-core"]),n.module("appconfig.services",["mobileoa-core","appconfig.services.appflowinit"]),n.module("appconfig.controller",["appconfig.services"]),n.module("appconfig",["appconfig.init","appconfig.routes","appconfig.controller"])});c(u);var d=l(function(e){var n=c(t),e=n.module("appconfig.routes");e.config(["$stateProvider",function(t){t.state("appconfig",{url:"/appconfig",template:'<ion-view cache-view="false"><ion-nav-view></ion-nav-view></ion-view>'}).state("appconfig.serverManagement",{url:"/serverManagement",templateUrl:"views/appconfig/serverConfig.tpl.html",controller:"appConfigCtrl"})}])});c(d);var f=l(function(e){function n(t){}n.$inject=["$scope"];var i=c(t);i.module("appconfig.controller").controller("appConfigCtrl",n)});c(f);var p=l(function(e){function n(t,e,n){function i(){return t.get(s,!0)}function o(e){return t.put(s,e)}var s="appconfig_need_gesture_password",a={needGesturePassword:i,setNeedGesturePassword:o};return a}n.$inject=["CacheService","LinkerService","$state"];var i=c(t);i.module("appconfig.services").factory("appFlowConfigService",n)});c(p);var g=l(function(e){var n=c(t);n.module("appInitFlow.services",[]),n.module("appInitFlow",["appInitFlow.services"])});c(g);var v=l(function(e){var n=c(t),e=n.module("appInitFlow.services");e.factory("appInitFlowService",["$rootScope","$q","$state","$window",function(t,e,n,i){function o(t){return function(){return a.nextAction(t)}}var s=i.location.search&&i.location.search.indexOf("develop")>0,a={},r={},c=[];a.MESSAGE_INIT="messageInit",a.INTRO_PAGE="introPage",a.SET_URL="setUrl",a.APP_VERSION_UPDATE="appVersionUpdate",a.LOAD_APP_CONFIG="loadAppConfig",a.LOCK="lock",a.AUTHENTICATE="authenticate",a.JUDGE_BIND="judgeBind",a.CHECK_DEVICE_SAFE="checkDeviceSafe",a.initing=!1,a.inited=!1,r[a.MESSAGE_INIT]=function(){return e.all(c.map(function(t){return t()})).then(function(){a.nextAction(a.MESSAGE_INIT)},function(){})};var l=[];return a.setActionFn=function(t,e){var n=!!window.cordova;n||l.indexOf(t)===-1?r[t]=e:r[t]=o(t)},a.start=function(){return!a.initing&&!a.inited&&(a.initing=!0,r[a.MESSAGE_INIT](),!0)},a.addMessageGetter=function(t){c.push(t)},a.goToApp=function(){n.go("core-notice")},a.nextAction=function(e,n){function i(){a.initing=!1,a.inited=!0,a.goToApp()}var o=null;switch(a.initing=!0,t.$broadcast("actionSuccess",e),e){case a.MESSAGE_INIT:o=a.INTRO_PAGE;break;case a.INTRO_PAGE:o=a.SET_URL;break;case a.SET_URL:o=a.APP_VERSION_UPDATE;break;case a.APP_VERSION_UPDATE:o=a.LOAD_APP_CONFIG;break;case a.LOAD_APP_CONFIG:o=a.LOCK;break;case a.LOCK:o=a.AUTHENTICATE;break;case a.AUTHENTICATE:s?i():o=a.JUDGE_BIND;break;case a.JUDGE_BIND:o=a.CHECK_DEVICE_SAFE;break;case a.CHECK_DEVICE_SAFE:return void i()}o&&(r[o]?r[o](function(t){a.nextAction(o,t)},n):a.nextAction(o))},a}])});c(v);var m=l(function(e){var n=c(t);n.module("login.directives",["login.services","ionic"]),n.module("login.routes",["ui.router"]),n.module("login.services",["mobileoa-core","ui.router","appInitFlow.services","appconfig.services"]),n.module("login",["login.services","ionic","ui.router","login.routes","login.directives"])});c(m);var h=l(function(e){var n=c(t);n.module("intro.services",["mobileoa-core"]),n.module("intro.directives",["intro.services"]),e.exports=n.module("intro",["intro.services","intro.directives"])});c(h);var b=l(function(e){var n=c(t);n.module("notice.routes",["ui.router"]),n.module("notice.services",["mobileoa-core","appInitFlow.services"]),n.module("notice.directives",["mobileoa-core"]),n.module("notice",["notice.services","notice.directives","mobileoa-core","ionic","notice.routes","intro"])});c(b);var w=l(function(e){var n=c(t);n.module("gesturepassword.services",["mobileoa-core","ui.router","appconfig.services"]),n.module("gesturepassword.controller",["gesturepassword.services","mobileoa-core","login.services"]),n.module("gesturepassword.directives.screen",["ionic"]),n.module("gesturepassword.routes",["ui.router"]),n.module("gesturepassword",["gesturepassword.services","gesturepassword.controller","gesturepassword.directives.screen","gesturepassword.routes"]),e.exports=n.module("gesturepassword")});c(w);var S=l(function(e){var n=c(t);n.module("devicemanager.init",[]),n.module("devicemanager.services",["ui.router","mobileoa-core","notice.services","gesturepassword.services"]),n.module("devicemanager.controller",["mobileoa-core","login.services"]),n.module("devicemanager.routes",["ui.router"]),n.module("devicemanager",["devicemanager.services","devicemanager.controller","devicemanager.routes","devicemanager.init"])});c(S);var k=l(function(e){var n=c(t),e=n.module("devicemanager.services");e.run(["$rootScope","DeviceManager",function(t,e){e.syncRemote(),t.$on("server.online",function(){e.syncRemote()}),t.$on("resume",function(){e.syncRemote()})}]),e.factory("DeviceStatusCache",function(){return{get:function(){var t=localStorage.getItem("deviceStatus");return t?JSON.parse(t):{}},set:function(t){t?localStorage.setItem("deviceStatus",JSON.stringify(t)):localStorage.removeItem("deviceStatus")}}}).factory("DeviceStatusService",["$http","LinkerService",function(t,e){return{fetchDeviceStatus:function(){var n=e.currentUserId||"",i="/device/status/"+window.device.uuid+"?userId="+n;return t.get(i).then(function(t){return t.data})},submitApply:function(e,n){var i={};return i.applyUserId=e,i.devSn=n,t({url:"/device/binding/",method:"POST",data:i}).then(function(t){return t.data})},bind:function(e,n){n=n===-1?window.device.uuid:n;var i="/device/binding/passedBySelf/"+e+"/"+n;return t.put(i).then(function(t){return t.data})}}}]),e.factory("DeviceManager",["$state","LinkerService","$toast","DeviceStatusCache","DeviceStatusService","$timeout",function(t,e,n,i,o,s){function a(t){v._deviceStatus=i.get(),v.nextAction=t?t:v.nextAction,v.nextAction&&v.nextAction()}function r(t){var e=t||{};v._deviceStatus=e,i.set(e)}function c(e,n){var i=e.lockStatus||"UNLOCK",o=n.lockStatus||"UNLOCK",s="UNLOCK"===i&&"devicemanager.lockPage"===t.$current.name,a="LOCK"===i&&"devicemanager.lockPage"!==t.$current.name;return i!==o||s||a}function l(t){return"[object Array]"===Object.prototype.toString.call(t)}function u(t,e){if(!t)return-1;for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1}function d(t,e){if(!t&&!e)return!0;if(t&&!l(t)&&(t=[t]),e&&!l(e)&&(e=[e]),t=t||[],e=e||[],t.length!==e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(u(e,t[0])===-1)return!1;for(var n=0,i=e.length;n<i;n++)if(u(t,t[0])===-1)return!1;return!0}function f(t){return t.bindUsers?t.bindUsers:t.bindUserId?[t.bindUserId]:[]}function p(t,e){var n=f(t),i=f(e),o=t.bindStatus||"1",s=e.bindStatus||"1";return!d(n,i)||o!==s}function g(){return o.fetchDeviceStatus().then(function(t){v.changeDeviceInfo(t,!0)})}var v={sync:a,syncRemote:g,_deviceStatus:i.get(),applyDeviceStateData:r,getDevSn:function(){return window.device.uuid},isBindedDevice:function(){var t=i.get();return null!==t&&t.bind},isLocked:function(){var t=i.get();return null!==t&&"LOCK"===t.lockStatus},isBinded:function(){var t=i.get(),e=f(t);return null!==t&&e.length>0},isBindedTo:function(t){var e=i.get(),n=f(e);return null!==e&&u(n,t)>=0},getBindApplyStatus:function(){var t=i.get();return null!==t&&t.bindingStatus||-1},execLockJudge:function(){v.isLocked()?t.go("devicemanager.lockPage"):v.lockNextAction?v.lockNextAction():t.go("login")},judgeLocked:function(t){v.lockNextAction=t,v.execLockJudge()},setLockStatus:function(t){var e=i.get();e.lockStatus=t,v.changeDeviceInfo(e)},execBindJudge:function(){v.isBindedTo(e.currentUserId)&&v.bindNextAction&&v.bindNextAction(),v.isBinded()?e.currentUserId&&!v.isBindedTo(e.currentUserId)&&t.go("devicemanager.bindedToOtherUser"):t.go("devicemanager.unBinded")},judgeDeviceBind:function(t){v.bindNextAction=t,v.execBindJudge()},changeDeviceInfo:function(t,o){var s=e.currentUserId,a=i.get(),l=c(t,a),u=p(t,a),d=s&&s===t.applyBindingUserId;o||d||(a.lockStatus=t.lockStatus,a.bindUserId=t.bindUserId,a.bindUsers=t.bindUsers,t=a),r(t),l?v.execLockJudge():u&&d&&("3"===t.bindingStatus&&n.showShortCenter("设备绑定未通过,请重新绑定!"),v.execBindJudge())},bind:function(t,e){return o.bind(t,e)},submitApply:function(t,e){return o.submitApply(t,e).then(function(){return v.syncRemote()})},viewApprovalStatus:function(){return o.fetchDeviceStatus().then(function(t){var e=t.bindingStatus;"1"===e?n.showShortBottom("设备绑定申请仍处于审核阶段,请稍后..."):"2"===e?(v.applyDeviceStateData(t),v.bindNextAction()):"3"===e?v.changeDeviceInfo(t):n.showShortCenter("设备绑定申请审核遭遇未知错误,请您联系管理员!")})},getPageInfoStatus:function(){var t=i.get(),n=4;return this.isBinded()?this.isBindedTo(e.currentUserId)||(n="1"===this.getBindApplyStatus()?1:null!==t&&"3"===t.bindingStatus?3:2):this.isBindedDevice()?"1"===this.getBindApplyStatus()?n=1:"1"!==this.getBindApplyStatus()&&"2"!==this.getBindApplyStatus()?n=2:null!==t&&"3"===t.bindingStatus&&(n=3):n=0,n}};return v}])});c(k);var y=l(function(e){var n=c(t),i=c(o),e=n.module("login.services");e.factory("LoginService",["$http","$q","$rootScope","localforage","$state","LinkerService","AppConfig","sinoNetwork","appFlowConfigService",function(t,e,n,o,s,a,r,c,l){function u(e,n){return n=n||k,e.devSn=window.device.uuid,e.device=m(),t({method:"POST",url:"/login",data:e,timeout:15e3}).then(function(t){return h(t,n),t.data})}function d(){var t={status:!0},i=a.currentUserId;return localStorage.removeItem("userToken"),localStorage.removeItem("validDate"),a.logout(),n.$broadcast("logout",i),e.when(t)}function f(){return c.getCACert().then(function(t){return _.isEmpty(t)||_.isEmpty(t.cert)?{success:!1,message:"登录失败,证书不存在!"}:u({cert:t.cert})})}function p(){var t=localStorage.getItem("userId"),n=localStorage.getItem("userToken"),i=localStorage.getItem("validDate");return e.when(t&&n&&i&&parseInt(i)>=(new Date).getTime())}function g(t){C=t,p().then(function(t){return t&&l.needGesturePassword()?(C(),t):v()})}function v(){return c.getCACert().then(function(t){_.isEmpty(t.cert)?s.go("login"):s.go("calogin")})}function m(){var t={},e=window.device;return t.devSn=e.uuid,t.devModel=e.model,t.devName=e.model,t.osType=e.platform,t.osVersion=e.version,t.browserVersion="",t.appVersion=r.version,t.terminalType=i.Platform.isWebView()?"app":"browser",t}function h(t,e){var n=t.data;n.success&&!n.mask&&(b(t),w(t),S(t),e(t))}function b(t){var e=t.headers("userToken")?t.headers("userToken"):t.data&&t.data.userToken;localStorage.setItem("userToken",e)}function w(t){var e=t.data&&t.data.userId;a.setCurrentUser(e),localStorage.setItem("userId",e)}function S(t){var e=t.data&&t.data.validDate;e&&(e=_.parseDate(e,"Y-m-d h:i:s").getTime()),localStorage.setItem("validDate",e)}function k(t){n.$broadcast("login",t.data),n.$broadcast("login.buildWebsocket"),jsUtil.isObjectExist("cordova.plugins.Keyboard")&&window.cordova.plugins.Keyboard.isVisible&&window.cordova.plugins.Keyboard.close(),C&&C()}function y(){var t=localStorage.getItem("lastLoginUser");return t?JSON.parse(t):null}var C=function(){};return{login:u,logout:d,calogin:f,onLoginAction:g,getLastLoginUser:y,defaultLoginSuccess:k}}])});c(y);var C=l(function(e){var n=c(t),e=n.module("gesturepassword.services");e.factory("GesturePasswordService",["LinkerService","$state","appFlowConfigService","CacheService",function(t,e,n,i){function o(){i.put("app_config_set_need_gesture_password",!0),c.completed=!0,c.nextAction&&c.nextAction()}function s(t){c.completed||(c.nextAction=t?t:c.nextAction,c.transferGesturePassword().then(function(t){n.needGesturePassword()&&t?e.go("gesturepassword.validateGesturePwd"):n.needGesturePassword()&&!i.get("app_config_set_need_gesture_password")?e.go("gesturepassword.setGesturePwd2Ignore"):n.needGesturePassword()&&!t?e.go("gesturepassword.setGesturePwd2"):o()}))}function a(){return t.getCurrentUser().then(function(t){var e,n;return t&&t.userNamePinyin&&(n=t.userId+"_"+t.userNamePinyin[0]),e=localStorage.getItem(n),e&&(localStorage.removeItem(n),localStorage.setItem("gesturepassword_"+t.userId,e)),localStorage.getItem("gesturepassword_"+t.userId)})}function r(){return t.getCurrentUser().then(function(t){return localStorage.removeItem("gesturepassword_"+t.userId)})}var c={nextAction:function(){},completed:!1,doComplete:o,judgeGesturePassword:s,transferGesturePassword:a,clear:r};return c}])});c(C);var I=l(function(e){var n=c(t);n.module("initializeset.directives",["ionic"]),n.module("initializeset.routes",["ui.router"]),n.module("initializeset.services",["login.services","mobileoa-core"]),n.module("initializeset",["initializeset.services","ionic","initializeset.routes","mobileoa-core","initializeset.directives"])});c(I);var T=l(function(e){var n=c(t),e=n.module("initializeset.services");e.factory("IntroPageService",["$state","localforage",function(t,e){var n,i={guidePage:function(e,i){n=e,"true"===window.localStorage.passIntroPage?e():(t.go("initializeset-intro"),window.localStorage.passIntroPage="true")},firstIntoAppWhenClick:function(){n()}};return i}])});c(T);var $=l(function(e){var n=c(t),e=n.module("initializeset.services");e.factory("SetUrlService",["$state","$q","configService","$rootScope","AppConfig",function(t,e,n,i,o){var s,a={setLoginUrl:function(e){s=e,"true"===window.localStorage.passSetUrl?a.goNext():n.getConfig().then(function(e){1===e.length?(a.saveConfig(e[0]),a.goNext()):t.go("initializeset-setUrl")})},saveConfig:function(t){return e.all([o.saveLocalStorage(t),n.saveAppConfig(t)])},goNext:function(){window.SinoNetwork||i.$broadcast("server.online"),window.localStorage.passSetUrl="true",s()}};return a}])});c($);var x=l(function(e){function n(t,e,n,i,o,s,a,r,c){return{registerDefaultActions:function(){t.addMessageGetter(function(){var t=ionic.Platform.isIOS(),e="0.9.22"==localStorage.appVersion||"0.9.23"==localStorage.appVersion,n=localStorage["updateChange-v0.9.23"];return t&&!n&&e&&(localStorage["notices.version"]="-1",localStorage["updateChange-v0.9.23"]="true"),c.setAppConfig()}),t.setActionFn(t.INTRO_PAGE,a.guidePage),t.setActionFn(t.SET_URL,r.setLoginUrl),t.setActionFn(t.APP_VERSION_UPDATE,s.versionUpdate),t.setActionFn(t.LOAD_APP_CONFIG,e.sync),t.setActionFn(t.LOCK,e.judgeLocked),t.setActionFn(t.AUTHENTICATE,n.onLoginAction),t.setActionFn(t.JUDGE_BIND,e.judgeDeviceBind),t.setActionFn(t.CHECK_DEVICE_SAFE,i.judgeGesturePassword)},start:function(){t.start()}}}n.$inject=["appInitFlowService","DeviceManager","LoginService","GesturePasswordService","$q","appVersionUpdate","IntroPageService","SetUrlService","AppConfig"];var i=c(t);i.module("appconfig.services.appflowinit",["appInitFlow.services","devicemanager.services","login.services","initializeset.services","appVersionUpdate"]).factory("DefaultAppFlowInitService",n)});c(x);var D=l(function(e){var n=c(t);e.exports=n.module("appconfig")});c(D);var N=l(function(e){var n=c(t);e.exports=n.module("appInitFlow")});c(N);var L=l(function(e){var n=c(t);n.module("archivesincept.services",["mobileoa-core"]);n.module("archivesincept.routes",["ui.router"]),n.module("archivesincept",["archivesincept.services","archivesincept.routes","tree"])});c(L);var M=l(function(e){var n=c(t),e=n.module("archivesincept.services");e.factory("ArchivesInceptService",["BaseDataServiceFactory","LinkerService","$http",function(t,e,n){var i=t.generate({name:"archivesincept",baseUrl:"/archives/incept",idPropertyName:"id",subflagPropertyName:"xiugai",flowType:"xiugai"});return i.signin=function(t){var i=e.currentUserId;return n.put("/archives/incept/"+i+"/"+t.id,{timeout:15e3}).then(function(t){return t})},i.returnback=function(t){var i=e.currentUserId;return n.post("/archives/incept/returnback",{userId:i,id:t.id,reasonDocbackCal:t.reasonDocbackCal})},i.wanbi=function(t){return n.post("/archives/incept/update/"+t.id,{timeout:15e3}).then(function(t){return t})},i.insertSW=function(t){var i=e.currentUserId;return n.post("/archives/incept/insertSW/"+i+"/"+t.id,{timeout:15e3})},i}])});c(M);var P=l(function(e){var n=c(t),e=n.module("archivesincept");e.controller("ArchivesInceptGroupCtrl",["$state","$toast","$sinoGoBackDelegate","ArchivesInceptService",function(t,e,n,i){function o(e){t.go("archivesincept-archivesinceptDetail",{id:e.id})}function s(t,n){return i.remove(n.id).then(function(){e.showLongCenter("收文单删除成功。"),t.remove(n)},function(){e.showLongCenter("收文单删除失败,请检查网络连接。")})}var a=this;a.todos=i.todos,a.relatedList=i.relatedList,a.toDetail=o,a.remove=s}])});c(P);var U=l(function(e){var n=c(t),e=n.module("archivesincept.services");e.factory("ArchivesInceptAuthService",function(){function t(t){this.archivesincept=t.archivesincept}return t.prototype={signin:function(){return"1"===this.archivesincept.flag},returnback:function(){return"2"===this.archivesincept.flag||"1"===this.archivesincept.flag},wanbi:function(){return"2"===this.archivesincept.flag}},t})});c(U);var E=l(function(e){var n=c(t),e=n.module("archivesincept");e.controller("ArchivesInceptDetailCtrl",["$scope","$q","$stateParams","$toast","$ionicPopup","$sinoGoBackDelegate","ArchivesInceptService","ArchivesInceptAuthService",function(t,e,n,i,o,s,a,r){function c(){var t=n.id?n.id:null;return m.loadingState=1,a.get(t).then(function(t){m.ArchivesInceptData=t,m.archivesincept=t.archivesincept,l(m.archivesincept),m.auth=new r(m.ArchivesInceptData)}).then(function(){m.loadingState=2},function(){m.loadingState=3})}function l(t){var e=t.deptflag;"0"==e||"部门发文"===e?e="部门发文":"1"!=e&&"部门发文"!==e||(e="局发文"),m.biaozhi=e}function u(){var t=a.getWorkflowInfo(m.archivesincept.id,m.archivesincept.xiugai),n=a.getNotionList(m.archivesincept.xiugai,m.archivesincept.id);return e.all([t,n]).then(function(t){m.ArchivesInceptData.workflow=t[0],m.ArchivesInceptData.notionList=t[1]}).then(function(){m.auth=new r(m.ArchivesInceptData)})}function d(){return a.save(m.archivesincept).then(function(t){m.ArchivesInceptData.archivesincept=t,m.archivesincept=t,m.auth=new r(m.ArchivesInceptData)})}function f(){a.signin(m.archivesincept).then(function(){i.showLongCenter("签收成功!"),s.back()}),function(){i.showLongCenter("签收失败,请检查网络连接。")}}function p(){return m.archivesincept.reasonDocbackCal?void a.returnback(m.archivesincept).then(function(){i.showLongCenter("退文成功!"),s.back()}):(i.showLongCenter("请填写退文原因!"),!1)}function g(){a.wanbi(m.archivesincept).then(function(){i.showLongCenter("办毕完成!"),s.back()}),function(){i.showLongCenter("办毕失败,请检查网络连接。")}}function v(){a.insertSW(m.archivesincept).then(function(){i.showLongCenter("生成收文单完成!"),s.back()}),function(){i.showLongCenter("生成收文单失败,请检查网络连接。")}}var m=this;m.init=c,m.save=d,m.refreshWorkFlowInfo=u,m.signin=f,m.returnback=p,m.insertSW=v,m.wanbi=g,t.$on("$ionicView.enter",function(){m.init()})}])});c(E);var O=l(function(e){var n=c(t),e=n.module("archivesincept.routes");e.config(["$stateProvider",function(t){t.state("archivesincept-archivesinceptGroup",{url:"/archivesincept/archivesinceptgroup",templateUrl:"views/archivesincept/archivesInceptGroup.tpl.html",controller:"ArchivesInceptGroupCtrl as groupCtrl",data:{title:"收文库",url:"archivesincept-archivesinceptGroup"},resolve:{type:function(){return"xiugai"}}}).state("archivesincept-archivesinceptDetail",{url:"/archivesincept/:id/archivesinceptDetail",templateUrl:"views/archivesincept/archivesInceptDetail.tpl.html",controller:"ArchivesInceptDetailCtrl as detailCtrl",data:{title:"详情",url:"archivesincept-archivesinceptDetail"},resolve:{id:["$stateParams",function(t){return t.id}],type:function(){return"xiugai"}}})}])});c(O);var A=l(function(e){var n=c(t),e=n.module("archivesincept");e.run(["AppConfig","WorkflowConfig",function(t,e){t.addModule({moduleName:"ARCHIVES_INCEPT",state:"archivesincept-archivesinceptGroup",text:"收文库",detailState:{state:"archivesincept-archivesinceptDetail",params:{id:"${id}"}},moduleClass:"ion-ios-paper-outline",flowType:"xiugai",order:10})}])});c(A);var R=l(function(e){var n=c(t);e.exports=n.module("archivesincept")});c(R);var B=l(function(e){var n=c(t);n.module("webmail.routes",["ui.router"]),n.module("webmail.services",["mobileoa-core"]);var e=n.module("webmail",["webmail.routes","webmail.services"]);e.exports=e});c(B);var G=l(function(e){var n=c(t),e=n.module("cmamail",["webmail.services"]);e.exports=e});c(G);var F=l(function(e){var n=c(t);n.module("webmail.routes",["ui.router"]),n.module("webmail.services",["mobileoa-core"]);var e=n.module("webmail",["webmail.routes","webmail.services"]);e.exports=e});c(F);var j=l(function(e){var n=c(t),e=n.module("webmail.services");e.factory("webmailService",["$http","LinkerService","$q","AppConfig",function(t,e,n,i){function o(t){var e=n.defer();return window.SinoNetwork&&window.SinoNetwork.toCoreMail?window.SinoNetwork.toCoreMail(t,"邮件",e.resolve,e.resolve):(window.open(t,"_self","location=no,closebuttoncaption=Close,enableViewportScale=yes"),e.resolve()),e.promise}function s(){return c}function a(n){return t.get("/webmail?userId="+e.currentUserId+"&type="+n,{timeout:15e3}).then(function(t){return t.data})}var r={},c=null,l=!1,u=null,d=null;return r.setCoreMailBaseUrl=function(t){_.isEmpty(t)||(c=t)},r.setMailTypeCma=function(t){d=t},r.setMailTypeWeb=function(t){u=t},r.openWebMail=function(t){var e=i.serverUrl+s();if(!l)return l=!0,a(t).then(function(n){var i=n.sid,o=e+"?coremail_type="+t;return("web"===t&&i&&n.isEmailName||"web"!==t&&i)&&(o=e+"main.jsp?coremail_type="+t+"&sid="+i),o}).then(function(t){return o(t)})["finally"](function(){l=!1})},r}])});c(j);var W=l(function(e){var n=c(t),e=n.module("cmamail");e.run(["AppConfig","webmailService",function(t,e){t.addModule({moduleName:"cmamail",state:function(){e.openWebMail("cma")},text:"CMA邮箱",moduleClass:"ion-email",direction:"none",order:2e3})}]),e.exports=e});c(W);var H=l(function(e){var n=c(t);e.exports=n.module("cmamail")});c(H);var V=l(function(e){var n=c(t);n.module("core.routes",["ui.router"]),n.module("core.directives",["ionic"]),n.module("core.services",["mobileoa-core","ionic"]);var e=n.module("core",["core.directives","core.services","core.routes"]);e.config(["$ionicConfigProvider",function(t){t.navBar.alignTitle("center"),t.views.forwardCache(!0)}])});c(V);var z=l(function(e){var n=c(t),e=n.module("core");e.controller("CoreCtrl",function(){})});c(z);var q=l(function(e){var n=c(t),e=n.module("core.services");e.run(["$rootScope",function(t){document.addEventListener("offline",function(){t.$broadcast("offline")},!1),document.addEventListener("online",function(){t.$broadcast("online")},!1),document.addEventListener("server.beginTryConnecting",function(e){t.$evalAsync(function(){t.inTryConnecting=!0,t.$broadcast("server.beginTryConnecting",e.netStatus)})},!1),document.addEventListener("server.endTryConnecting",function(e){t.$evalAsync(function(){t.inTryConnecting=!1,t.$broadcast("server.endTryConnecting",e.netStatus)})},!1),document.addEventListener("resume",function(){t.$broadcast("resume")}),document.addEventListener("active",function(){t.$broadcast("active")}),t.$on("server.online",function(){t.netWorkStatus="online",t.inTryConnecting=!1}),t.$on("server.offline",function(){t.netWorkStatus="offline"}),t.$on("server.beginTryConnecting",function(){t.inTryConnecting=!0}),t.$on("server.endTryConnecting",function(){t.inTryConnecting=!1})}])});c(q);var J=l(function(e){var n=c(t),e=n.module("core.routes");e.config(["$stateProvider",function(t){t.state("core-notice",{url:"/message",templateUrl:"views/notice/notice.tpl.html",controller:"NoticeListCtrl",data:{title:"通知",url:"^.notice",level:0}}).state("core-linker",{url:"/linker",templateUrl:"views/linker/linkerList.tpl.html",controller:"LinkerCtrl",data:{title:"联系人",url:"^.linker",level:0}}).state("core-find",{url:"/find",templateUrl:"views/find/find.tpl.html",controller:"FindCtrl",data:{title:"工作",url:"^.find",level:0}}).state("core-setting",{url:"/setting",templateUrl:"views/setting/setting.tpl.html",controller:"SettingCtrl",data:{title:"设置",url:"^.setting",level:0}})}])});c(J);var K=l(function(e){var n=c(t);e.exports=n.module("core")});c(K);var Y=l(function(e){var n=c(t);n.module("dbsy.services",["mobileoa-core"]),n.module("dbsy.routes",["ui.router"]);n.module("dbsy",["dbsy.services","dbsy.routes"])});c(Y);var X=l(function(e){var n=c(t),e=n.module("dbsy.services");e.factory("dbsyService",["BaseDataServiceFactory",function(t){var e=t.generate({name:"dbsy",baseUrl:"/dbsy",idPropertyName:"id"});return e.getItemId=function(t){return t.dbsy?t.dbsy.id:t.id},e}])});c(X);var Z=l(function(e){var n=c(t),i=c(s),e=n.module("dbsy");e.controller("DbsyGroupCtrl",["$state","$toast","dbsyService","AppConfig",function(t,e,n,o){function s(n){var s=o.getModuleConfigByFlowType(n.type);if(s){var a=s.detailState,r=i.clone(a.params);for(var c in r)r.hasOwnProperty(c)&&(r[c]=r[c].replace(/\$\{(.+?)\}/g,function(t,e){return n[e]}));t.go(a.state,r)}else e.showLongCenter(n.typeName+"请在pc端办理!")}var a=this;a.todos=n.todos,a.relatedList=n.relatedList,a.toDetail=s}])});c(Z);var Q=l(function(e){var n=c(t),e=n.module("dbsy.routes");e.config(["$stateProvider",function(t){t.state("dbsyGroup",{url:"/dbsy/dbsygroup",templateUrl:"views/dbsy/dbsyGroup.tpl.html",controller:"DbsyGroupCtrl as dbsyGroupCtrl",data:{title:"待办事宜"}})}])});c(Q);var tt=l(function(e){var n=c(t),e=n.module("dbsy");e.run(["AppConfig",function(t){t.addModule({moduleName:"dbsy",state:"dbsyGroup",text:"待办事宜",moduleClass:"icon ion-android-list icon-dbsy",isPublic:!0,showInNotice:!1,showInFind:!0,order:30})}])});c(tt);var et=l(function(e){c(t)});c(et);var nt=l(function(e){var n=c(t),e=n.module("devicemanager.routes");e.config(["$stateProvider",function(t){t.state("devicemanager",{url:"/devicemanager",template:'<ion-view cache-view="false" view-direction="none"><ion-nav-view></ion-nav-view></ion-view>'}).state("devicemanager.devicerecord",{url:"/deviceRecordShow",templateUrl:"views/devicemanager/deviceManager.tpl.html",controller:"DeviceListCtrl"}).state("devicemanager.showLoginHistory",{url:"/showLoginHistory",templateUrl:"views/devicemanager/showLoginHistory.tpl.html",controller:"DeviceManagerCtrl",data:{pageType:"showLoginHistory"}}).state("devicemanager.accountProtect",{url:"/accountProtect",templateUrl:"views/devicemanager/accountProtect.tpl.html",controller:"DeviceManagerCtrl"}).state("devicemanager.lockPage",{url:"/lockPage",templateUrl:"views/devicemanager/lockPage.tpl.html",controller:"DeviceLockCtrl"}).state("devicemanager.bindedToOtherUser",{url:"/bindedToOtherUser",controller:"DeviceBindCtrl",templateUrl:"views/devicemanager/bindedToOtherUser.tpl.html"}).state("devicemanager.unBinded",{url:"/unBinded",controller:"DeviceBindCtrl",templateUrl:"views/devicemanager/unBinded.tpl.html"}).state("devicemanager.deviceError",{url:"/devcieError",templateUrl:"views/devicemanager/deviceError.tpl.html",controller:"DeviceError"})}])});c(nt);var it=l(function(e){var n=c(t),e=n.module("devicemanager.services");e.factory("DeviceLoginRecordsService",["$http","AppConfig",function(t,e){var n={saveUserLoginOnDeviceInfo:function(t,n){var i=window.device,o={};return o.devId="",o.userId=t,o.userName=n,o.loginType="pwd",o.terminalType="app",o.loginTime="",o.devSn=i.uuid,o.devModel=i.model,o.devName=i.model,o.osType=i.platform,o.osVersion=i.version,o.browserVersion="",o.appVersion=e.version,this.saveRecordOnDeviceWhenRead(o)},saveRecordOnDeviceWhenRead:function(e){return t({method:"POST",url:"/device",data:e}).then(function(t){return t.data})},saveLoginRecordsOnBrowser:function(t){var n={};return n.devId="",n.userId=t,n.loginType="pwd",n.terminalType="browser",n.loginTime="",n.devSn="cdfd024dd60bcbc1",n.devModel="",n.devName="",n.osType=this.getOs(),n.osVersion=this.getOs(),n.browserVersion="",n.appVersion=e.version,this.saveRecordOnDeviceWhenRead(n)},getOs:function(){var t="Win32"===window.navigator.platform||"Windows"===window.navigator.platform,e="Mac68K"===window.navigator.platform||"MacPPC"===window.navigator.platform||"Macintosh"===window.navigator.platform||"MacIntel"===window.navigator.platform;if(e)return"Mac";var n="X11"===window.navigator.platform&&!t&&!e;if(n)return"Unix";var i=String(window.navigator.platform).indexOf("Linux")>-1;return i?"Linux":t?"Windows":"otherOS"},getCurrentDevice:function(){var t=window.device;return t},getUserLoginRecordsOnDevice:function(e){var n="/device/"+e;return t.get(n).then(function(t){return t.data.content})},getLoginHistory:function(e){var n="/loginLog/"+e;return t.get(n).then(function(t){return t.data.content})},lockDevice:function(e,n,i){return t({method:"PUT",url:"/device/",data:{userId:e,lockStatus:n,devSn:i}}).then(function(t){return t.data})},serchDeviceInfo:function(e){var n="/device/find/"+e;return t.get(n).then(function(t){return t.data})},searchDeviceIsAuthorized:function(e){var n="/device/authorization/isAuthorized/"+e;return t.get(n).then(function(t){return t.data})},applyAuthorization:function(e,n,i){return t({url:"/device/authorization/apply",method:"POST",data:{devSn:e,userId:n,userName:i}}).then(function(t){return t.data})},toDeviceAuthorize:function(e,n){return t({method:"PUT",url:"/device/authorization/",data:{userId:e,devSn:n}}).then(function(t){return t.data})},applyBind:function(e){var n="/device/binding/"+e;return t({method:"PUT",url:n}).then(function(t){return t.data})},rejectBind:function(e){var n="/device/binding/notPermit/"+e;return t({method:"PUT",url:n}).then(function(t){return t.data})},unBind:function(e){var n="/device/binding/"+e;return t({method:"DELETE",url:n}).then(function(t){return t.data})},getRelatedDevices:function(e){var n="/device/related/"+e;return t.get(n).then(function(t){return t.data})},getPersonalDevices:function(e){var n="/device/binding/personalDeviceInfos/"+e;return t.get(n).then(function(t){return t.data})}};return n}])});c(it);var ot=l(function(e){var n=c(t),e=n.module("devicemanager.controller");e.filter("normalTime",function(){var t=function(t){var e=t||"";return e.slice(0,e.length-5).replace("T"," ")};return t}),e.controller("DeviceManagerCtrl",["$rootScope","$scope","DeviceLoginRecordsService","LinkerService","LoginService","$state",function(t,e,n,i,o,s){function a(){var t=i.currentUserId;return n.getLoginHistory(t).then(function(t){return e.loginHistorys=t,e.loadingState=t.length>0?2:4,e.loginHistorys},function(){e.loadingState=3})}e.refreshState={begin:!1,done:!1},e.device=window.device,e.goBack=function(){s.go("devicemanager.accountProtect")},e.showUserLoginRecordsOnDevice=function(){s.go("devicemanager.devicerecord")},e.goBackSetting=function(){s.go("core-setting")},e.getLoginHistory=function(){s.go("devicemanager.showLoginHistory")},e.onRefresh=function(){e.refreshState.begin=!0,e.refreshState.done=!1,e.showLoginHistory().then(function(){e.$broadcast("scroll.refreshComplete")})["finally"](function(){e.refreshState.done=!0})},e.loadingState=1,a(),e.showLoginHistory=a,e._deviceStatus=JSON.parse(localStorage.getItem("deviceStatus"))}])});c(ot);var st=l(function(e){var n=c(t),e=n.module("devicemanager.controller");e.controller("DeviceLockCtrl",["$scope",function(t){t._deviceStatus=JSON.parse(localStorage.getItem("deviceStatus"))}])});c(st);var at=l(function(e){var n=c(t),e=n.module("devicemanager.controller");e.controller("DeviceBindCtrl",["$scope","DeviceManager","LinkerService","Timer","$q","$ionicActionSheet","LoginService","$state",function(t,e,n,i,o,s,a,r){t.viewStatus=!1,t.bindStatus=null,t.bindSucess=!0,t.devSn=e.getDevSn()||"";var c,l=i.interval(function(){t.bindStatus=e.getPageInfoStatus(),1===t.bindStatus?(c&&i.clear(c),c=i.delay(function(){t.viewStatus=!0},500)):t.viewStatus=!1},500);t.$on("$destroy",function(){i.clear(l)}),t.bind=function(){return e.bind(n.currentUserId,t.devSn).then(function(){return e.viewApprovalStatus(n.currentUserId,t.devSn)})},t.applyBind=function(){return e.submitApply(n.currentUserId,t.devSn)},t.viewApprovalStatus=function(){return e.viewApprovalStatus(n.currentUserId,t.devSn); },t.toLogin=function(){a.logout(),r.go("login")}}])});c(at);var rt=l(function(e){var n=c(t),e=n.module("devicemanager");e.controller("DeviceError",["$scope","DeviceManager","$q","$ionicActionSheet","LoginService","$state",function(t,e,n,i,o,s){function a(){var e=n.defer();return t.needLogout=!0,i.show({buttons:[{text:'<i class="icon ion-log-out sino-logout-icon"></i>退出登录'}],cancelText:"取消",cancel:function(){return e.reject("取消登录"),!0},buttonClicked:function(){return e.resolve(!0),!0}}),e.promise}t.syncRemote=function(){return e.syncRemote()},t.toLogin=function(){return a().then(function(t){return!t||o.logout()}).then(function(){return s.go("login")})}}])});c(rt);var ct=l(function(e){var n=c(t),e=n.module("devicemanager.services");e.factory("PasswordVerifyService",["$http",function(t){var e={isTurePassword:function(e,n){var i="/password/verify?userId="+e+"&passWord="+n;return t.get(i,{noContainUserToken:!0}).then(function(t){return t.data})}};return e}])});c(ct);var lt=l(function(e){var n=c(t),e=n.module("devicemanager.controller");e.controller("DeviceListCtrl",["$rootScope","$scope","DeviceLoginRecordsService","LinkerService","$state","$location","$ionicPopup","$toast","$ionicLoading","PasswordVerifyService",function(t,e,n,i,o,s,a,r,c,l){function u(){var t=i.currentUserId;return n.getRelatedDevices(t).then(function(n){n=n||[],n=n.filter(function(e){return e.applyUserId===t||e.userId===t}),e.loginDeviceRecords=n})}function d(t,e,i){return function(o){p(function(){c.show({template:e}),n[t](o.devBindingId).then(function(){i(o)},function(){r.showShortBottom("操作失败")})["finally"](function(){c.hide()})})}}function f(t,o){var s=i.currentUserId;return n.lockDevice(s,o,t).then(function(n){if(n){for(var i=0;i<e.loginDeviceRecords.length;i++)if(e.loginDeviceRecords[i].devSn===t)return void(e.loginDeviceRecords[i].lockStatus=o)}else r.showShortCenter("解锁失败,请重新操作")})}function p(t){var n=e.$new();n.data={},a.show({template:'<input type="password" ng-model="data.password">',title:"安全性操作",subTitle:"请输入登录密码",scope:n,buttons:[{text:"取消",onTap:function(){n.data.password=""}},{text:"<b>登录</b>",type:"button-positive",onTap:function(){var e=i.currentUser.userName,o={userName:e,password:n.data.password};l.isTurePassword(i.currentUserId,o.password).then(function(e){e?(n.data.password="",t()):r.showShortCenter("密码错误,请重新输入。")})}}]})}e.refreshState={begin:!1,done:!1},e.device=window.device,e.$on("$ionicView.loaded",function(){e.onRefresh()}),e.goBack=function(){o.go("devicemanager.accountProtect")},e.lock=function(t){p(function(){f(t.devSn,"LOCK")})},e.unlock=function(t){p(function(){f(t.devSn,"UNLOCK")})},e.applyBind=d("applyBind","正在绑定",function(t){t.bindingUserID=i.currentUser.userId,t.userId=i.currentUser.userId,t.bindingStatus="2"}),e.rejectBind=d("rejectBind","正在退回绑定申请",function(t){var n=e.loginDeviceRecords.indexOf(t);n>=0&&e.loginDeviceRecords.splice(n,1)}),e.unBind=d("unBind","正在解除绑定",function(t){var n=e.loginDeviceRecords.indexOf(t);n>=0&&e.loginDeviceRecords.splice(n,1)}),e.getLoginHistory=function(){o.go("devicemanager.showLoginHistory")},e.onRefresh=function(){e.refreshState.begin=!0,e.refreshState.done=!1,u().then(function(){e.$broadcast("scroll.refreshComplete")})["finally"](function(){e.refreshState.done=!0})}}])});c(lt);var ut=l(function(e){var n=c(t),e=(c(s),n.module("notice.services"));e.run(["$rootScope","WebSocketService","AppConfig","appInitFlowService",function(t,e,n,i){t.$watch("connected",function(t){(n.socketServerUrl||n.serverUrl)&&(t?e.buildWebsocket(window.device.uuid).then(function(){e.bindCurrentUser()}):e.closeWebsocket())}),t.$on("login.buildWebsocket",function(){e.bindCurrentUser()}),t.$on("serverUrl.changed",function(){t.connected&&e.buildWebsocket(window.device.uuid).then(function(){e.bindCurrentUser()})}),t.$on("actionSuccess",function(n,o){o===i.SET_URL&&t.connected&&e.buildWebsocket(window.device.uuid).then(function(){e.bindCurrentUser()})})}]),e.factory("WebSocketConfig",function(){function t(t,e){n[t]=e}function e(t){return n[t]}var n={};return{registerHandler:t,getHandler:e}}),e.factory("WebSocketService",["$rootScope","AppConfig","ContinuousWebSocket","WebSocketConfig","LinkerService","$q",function(t,e,n,i,o,s){function a(t){var n;if(e.socketServerUrl)n=e.socketServerUrl+"/"+t;else{var i=/(?:https?\:\/\/)([\d\w\.]+)(?:\:\d+)?/,o=e.serverUrl.match(i)[1];n="ws://"+o+":8887/"+t}return n}function r(){return p}function c(e){var n=JSON.parse(e.data),o=i.getHandler(n.type);o?o(n.data):t.$broadcast("websocket.notice",n)}function l(t,e){p&&p.webSocket&&(p.url=a(t)+"?userId="+e,p.webSocket.send(JSON.stringify({type:"user",data:{deviceId:t,userId:e}})))}function u(){var t=o.currentUserId;t&&l(window.device.uuid,t)}function d(t){var e=s.defer();return p&&p.wsUrl===a(t)?p.open():p&&p.wsUrl!==a(t)?p.changeUrl(a(t)):(p=new n(a(t)),p.onmessage=function(t){c(t)},p.onopen=function(){console.log("socket连接已建立。"),e.resolve(!0)},p.onerror=function(){console.log("socket连接有问题。"),e.reject(!1)}),p.wsUrl=a(t),e.promise}function f(){p&&p.close()}var p;return{buildWebsocket:d,getWebsocket:r,bindUser:l,closeWebsocket:f,bindCurrentUser:u}}])});c(ut);var dt=l(function(e){var n=c(t),e=n.module("devicemanager");e.run(["AppConfig","$rootScope","DeviceManager","WebSocketConfig","$state","LinkerService","$stateParams","GesturePasswordService",function(t,e,n,i,o,s,a,r){e.$on("login",function(t,e){n.applyDeviceStateData(e.deviceInfo)}),t.addSetItem({text:"设备管理",state:"devicemanager.accountProtect",order:3}),i.registerHandler("DEVICE_BIND",function(t){var e=JSON.parse(localStorage.getItem("deviceStatus"))||{};t.inWhiteList=e.inWhiteList,n.changeDeviceInfo(t)}),i.registerHandler("DEVICE_INFO",function(t){n.setLockStatus(t.lockStatus)}),e.$on("$stateChangeStart",function(t,e,i,s,a){"devicemanager.lockPage"!==e.name&&n.isLocked()&&(t.preventDefault(),o.go("devicemanager.lockPage"))}),e.$on("$stateChangeStart",function(t,e,n,i,o){"devicemanager.lockPage"!==e.name&&"devicemanager.unBinded"!==e.name&&"devicemanager.bindedToOtherUser"!==e.name&&"login"!==e.name&&"calogin"!==e.name||(r.completed=!1)})}])});c(dt);var ft=l(function(e){var n=c(t);e.exports=n.module("devicemanager")});c(ft);var pt=l(function(e){var n=c(t);n.module("find",["mobileoa-core","intro"])});c(pt);var gt=l(function(e){function n(t){function e(e){var n=e?"/notice?version="+e:"/notice";return t.get(n).then(function(t){return t.data})}return{getNotice:e}}n.$inject=["$http"];var i=c(t),e=i.module("notice.services");e.factory("NoticeRemoteService",n)});c(gt);var vt=l(function(e){var n=c(t),i=c(s),e=n.module("notice.services");e.factory("NoticeCache",function(){function t(){var t="notice_userIds";localStorage.removeItem(t)}function e(t){var e=n()||[];if(e.indexOf(t)==-1){e.push(t);var i,o="notice_userIds";i=JSON.stringify(e),localStorage.setItem(o,i)}}function n(){var t="notice_userIds";return JSON.parse(localStorage.getItem(t))}function o(t,e){var n=[];i.each(e,function(e){c(t,e.id,e),n.push(e.id)}),u(t,n)}function s(){for(var t,e=f.getUserIds()||[],n=0,i=e.length;n<i;n++)t=e[n],a(t)}function a(t){var e=d(t);i.each(e,function(e){localStorage.removeItem("Notice:"+e+"_"+t)}),localStorage.removeItem("NoticeIdListst:"+t)}function r(t){var e=d(t),n=[];return i.each(e,function(e){n.push(l(t,e))}),n}function c(t,e,n){var i=JSON.stringify(n),o="Notice:"+e+"_"+t;localStorage.setItem(o,i)}function l(t,e){var n="Notice:"+e+"_"+t;return JSON.parse(localStorage.getItem(n))}function u(t,e){var n=JSON.stringify(e),i="NoticeIdListst:"+t;localStorage.setItem(i,n)}function d(t){var e="NoticeIdListst:"+t;return JSON.parse(localStorage.getItem(e))}var f={updateNotices:o,getNotices:r,clearNotices:s,getNotice:l,getNoticeIds:d,updateUserIdsHistory:e,getUserIds:n,clearUserIds:t};return f})});c(vt);var mt=l(function(e){function n(){this.notices=[],this.unreadNum=0,this.orderNotices=i,this.order,this.unreadNumChangeListeners={}}function i(t){this.order=t,t?this.sortNoticesByModule(t):this.sortNoticesByTime()}function o(t){this.unreadNum=0,this.update(t),this.id=this.moduleName}var a=c(t),r=c(s),e=a.module("notice.services");e.constant("AppNotices",n).constant("Notice",o),n.prototype={push:function(t){var e=[];if(r.isArray(t))e=this._pushArray(t);else{var n=this._pushOne(t);n&&(e=[n])}return this.fireUnreadNumChange(e),e},_pushArray:function(t){for(var e,n=[],i=0,o=t.length;i<o;i++)e=this._pushOne(t[i]),e&&n.push(e);return n},_pushOne:function(t){if(t.moduleName){var e=this.get(t.moduleName);return e?e.update(t):(e=new o(t),this.notices.push(e)),this.unreadNum=this.calUnreadNum(),this.orderNotices(this.order),e}},clear:function(){for(var t=this.notices,e=0,n=t.length;e<n;e++)t[e].unreadNum=0;this.fireUnreadNumChange(t),this.notices=[],this.unreadNum=0},getMaxVersion:function(){for(var t,e=-1,n=0,i=this.notices.length;n<i;n++)t=this.notices[n],e=t.version>e?t.version:e;return e},calUnreadNum:function(){for(var t,e=0,n=0,i=this.notices.length;n<i;n++)t=this.notices[n],t.content&&(e+=t.unreadNum);return e},isMessage:function(t){return"message"===t.moduleName},sortNoticesByTime:function(){this.notices&&this.notices.sort(function(t,e){return t.sendTime<e.sendTime?1:t.sendTime==e.sendTime?0:-1})},sortNoticesByModule:function(t){if(t){var e,n=[],i=[];r.apply(n,this.notices),r.each(t,function(t){for(var o=0;o<n.length;o++)e=n[o],e.id&&0===e.id.indexOf(t)&&(i.push(e),r.remove(n,e))}),n&&n.length>0&&(i=i.concat(n)),this.notices=i}},get:function(t){for(var e,n=0,i=this.notices.length;n<i;n++)if(e=this.notices[n],e.moduleName===t)return e;return null},registerUnreadNumberChange:function(t,e){var n=this.unreadNumChangeListeners[t],i=this.get(t);n||(n=this.unreadNumChangeListeners[t]=[]),n.push(e),i&&e(i.unreadNum)},fireUnreadNumChange:function(t){for(var e,n,i=0,o=t.length;i<o;i++)if(n=t[i].moduleName,e=this.unreadNumChangeListeners[n])for(var s=0,a=e.length;s<a;s++)e[s](this.get(n).unreadNum)}},o.prototype={update:function(t){r.apply(this,t),this.id=this.moduleName}}});c(mt);var ht=l(function(e){function n(t,e,n,i,o,s,a){function r(){var t=n.currentUserId;if(t)return v.loadFromCache(t),l().then(u)}function c(t){var n=e.getNotices(t);g.push(n)}function l(){var t=g.getMaxVersion();return i.getNotice(t)}function u(t){var i=n.currentUserId;g.push(t),v.updateUserIds(i),e.updateNotices(i,g.notices)}function d(){g.clear(),e.clearNotices(),e.clearUserIds()}function f(){g.clear()}function p(t){e.updateUserIdsHistory(t)}var g=new t,v={appNotices:g,refresh:r,insert:u,clear:d,changeUser:f,updateUserIds:p,loadFromCache:c};return s.$on("websocket.notice",function(t,e){var n=e?e.data:[];v.insert(n)}),v}n.$inject=["AppNotices","NoticeCache","LinkerService","NoticeRemoteService","AppConfig","$rootScope","$timeout"];var i=c(t),e=(c(s),i.module("notice.services"));e.factory("NoticeService",n)});c(ht);var bt=l(function(e){var n=c(t),e=n.module("find");e.controller("FindCtrl",["$scope","AppConfig","$state","$q","NoticeService","$rootScope",function(t,e,n,i,o,s){function a(){o.refresh()}function r(){var t=o.appNotices.notices,n=0;t&&_.each(t,function(t){e.showInNotice(t.moduleName)&&(n+=t.unreadNum)}),o.appNotices.unreadNum=n,s.appNotices=o.appNotices}t.modules=e.modules,t.loading={},t.$on("$ionicView.beforeEnter",function(){e.refreshModulesAuth(),a(),r()}),t.getUnreadNum=function(t){var e=0;return _.each(o.appNotices.notices,function(n){n.moduleName===t.moduleName&&(e=n.unreadNum)}),e},t.toModule=function(e){if(e._level_top&&e._children.length>0)return void(e._open?e.close():e.open());if(e||!t.loading[e.moduleName])if(e.state instanceof Function){t.loading[e.moduleName]=!0;var o=e.state();i.when(o).then(function(){t.loading[e.moduleName]=!1})}else n.go(e.state)}}])});c(bt);var wt=l(function(e){var n=c(t);e.exports=n.module("find")});c(wt);var St=l(function(e){function n(t,e){this.height=e,this.width=t,this.topContentHeight=n.DEFAULT_TOP_CONTENT_HEIGHT,this.bottomContentHeight=n.DEFAULT_BOTTOM_CONTENT_HEIGHT}function i(t){return t+.5|0}var o=c(t),e=o.module("gesturepassword.services");n.DEFAULT_TOP_CONTENT_HEIGHT=80,n.DEFAULT_BOTTOM_CONTENT_HEIGHT=30,n.MIN_RADIUS=30,n.MAX_RADIUS=60,n.MAX_TOP_WHITE=30,n.MAX_BOTTOM_WHITE=30,n.MIN_WHITE=10,n.DEFAULT_INDICATOR_WIDTH=10,n.DEFAULT_INNER_RADIUS=10,n.prototype={calcWhite:function(){var t=this.calcContent().height,e=(this.height-t-this.topContentHeight-this.bottomContentHeight)/2;return e+.5|0},calc:function(){var t=this.calcWhite(),e=this.topContentHeight,n=this.calcContent(),o=n.height,s=t,a=t+this.topContentHeight,r=a+o+t/2,c=this.bottomContentHeight,l=n.radius,u=n.white,d=n.topWhite,f=n.leftWhite,p=this.height-r-c;return{top:{white:{startY:0,topHeight:i(s)},content:{startY:i(s),height:i(e)}},content:{startY:i(a),startX:i(f),height:i(o),width:i(this.width-2*f),radius:i(l),gap:i(u),topWhite:i(d),scale:30/l},bottom:{whiteTop:{startY:i(a+o),height:i(t/2)},content:{startY:i(r),height:i(c)},whiteBottom:{startY:i(p),height:i(t/2)}}}},calcContent:function(){var t,e,i,o,s,a,r,c=this.height-this.topContentHeight-this.bottomContentHeight,l=Math.min(this.width,c),u=l/10,d=l;return u<n.MIN_RADIUS?(t=n.MIN_RADIUS,e=(d-6*t)/4,i=Math.max(e,n.MIN_WHITE),t=(d-4*i)/6-4):u>n.MAX_RADIUS?(t=n.MAX_RADIUS-4,e=(d-6*t)/4,i=Math.max(e,n.MIN_WHITE)):(t=u-4,i=t),o=Math.min(i,n.MAX_TOP_WHITE),s=Math.min(i,n.MAX_BOTTOM_WHITE),d=l-2*(i-o),a=this.width-4*i-6*t,r=a/2,{height:d,radius:Math.round(t),white:i,topWhite:o,bottomWhite:s,leftWhite:r}}},e.factory("GestureScreenLayout",function(){return n}),e.exports=n});c(St);var kt=l(function(e){var n=c(t),e=n.module("gesturepassword.services");e.factory("GestureScreenContext",["GestureScreenLayout","$rootScope",function(t,e){function n(e,i,o,s,a){this.setpassword=s,this.ctx=a,this.firstpassword="",this.width=e,this.height=i,this.validator=o||function(){return!0},this.layout=new t(e,i).calc(),this.contentWidth=this.layout.content.width,this.contentHeight=this.layout.content.height,this.pointers=n.generatePoints(this.layout.content),this.selectors=[],this.sceneState=n.STATE_PRIMITIVE,this.addedSelectors=[]}return n.POINTER_NUMBER=9,n.STATE_PRIMITIVE=0,n.STATE_MOVING=1,n.STATE_OK=2,n.STATE_NO=3,n.POINTER_STATE_PRIMITIVE=0,n.POINTER_STATE_SELECTED=1,n.POINTER_STATE_OK=2,n.POINTER_STATE_NO=3,n.generatePoints=function(t){for(var e=t.gap,i=t.topWhite,o=t.radius,s=t.gap,a=[],r=0;r<n.POINTER_NUMBER;r++){var c=r%3,l=Math.floor(r/3);a.push({y:i+(2*l+1)*o+l*s+.5|0,x:e+(2*c+1)*o+c*s+.5|0,radius:o,state:n.STATE_PRIMITIVE})}return a},n.pointerInCircle=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(t.radius,2)},n.makeLineCorrect=function(t,e){if(!(t.length<=0)){var n,i=["0,8,4","8,0,4","2,6,4","6,2,4","0,6,3","6,0,3","1,7,4","7,1,4","2,8,5","8,2,5","0,2,1","2,0,1","3,5,4","5,3,4","6,8,7","8,6,7"],o=t[t.length-1]+","+e;for(n=0;n<i.length;n++){var s=i[n];if(s.substring(0,3)===o)return parseInt(s.charAt(s.length-1))}}},n.prototype={startMove:function(){this.sceneState===n.STATE_PRIMITIVE?this.setState(n.STATE_MOVING):this.sceneState===n.STATE_NO&&(this.setState(n.STATE_PRIMITIVE),this.setState(n.STATE_MOVING))},move:function(t,e){this.sceneState===n.STATE_MOVING&&(this.movingPointer={x:t-this.layout.content.startX+.5|0,y:e-this.layout.content.startY+.5|0},this.checkSelectors())},endMove:function(){var t=this.validate(),e=t?n.STATE_OK:n.STATE_NO;return delete this.movingPointer,this.setState(e),t},setState:function(t){var i=this.sceneState!==t;switch(this.sceneState=t,t){case n.STATE_PRIMITIVE:this.reset();break;case n.STATE_MOVING:break;case n.STATE_OK:this.changeSelectorPointersState(n.POINTER_STATE_OK);break;case n.STATE_NO:this.changeSelectorPointersState(n.POINTER_STATE_NO)}i&&(e.$broadcast("gesturepassword.statechange",this,t),e.$emit("gesturepassword.statechange",this,t))},changeSelectorPointersState:function(t){var e,n,i;for(e=this.selectors.length;e--;)n=this.selectors[e],i=this.pointers[n],i.state=t},reset:function(){this.selectors=[],_.forEach(this.pointers,function(t){t.state=n.POINTER_STATE_PRIMITIVE}),delete this.movingPointer},checkSelectors:function(){var t,e,i;for(t=this.pointers.length;t--;)if(e=this.pointers[t],n.pointerInCircle(e,this.movingPointer)){if(e.state!==n.POINTER_STATE_SELECTED){e.state=n.POINTER_STATE_SELECTED;var o=n.makeLineCorrect(this.selectors,t);o>=0&&(i=this.pointers[o],i.state!==n.POINTER_STATE_SELECTED&&(i.state=n.POINTER_STATE_SELECTED,this.selectors.push(o),this.addedSelectors.push(o))),this.selectors.push(t),this.addedSelectors.push(t)}return}},validate:function(){return this.validator(this.selectors)},setFirspassword:function(t){this.firstpassword=t},destroy:function(){delete this.layout,delete this.ctx,delete this.validator,delete this.pointers}},n}])});c(kt);var yt=l(function(e){var n=c(t),e=n.module("gesturepassword.services");e.factory("GraphicsStateContext",function(){function t(e){this.screenContext=e,this.circles=e.pointers,this.width=e.width,this.height=e.height,this.selectCircles=_.map(e.selectors,function(t){return e.pointers[t]}),this.lines=t.generateLines(this.selectCircles,this.screenContext.movingPointer),this.directionIndicators=t.generateDirectionIndicators(this.selectCircles)}return t.generateDirectionIndicators=function(e){var n,i,o,s=[];for(i=0;i<=e.length-2;i++)n=e[i],o=t.computerDegree(n,e[i+1]),s.push({x:n.x,y:n.y,rotate:o,scale:n.scale||1});return s},t.computerDegree=function(e,n){var i={x:n.x-e.x,y:n.y-e.y},o=t.getQuadrant(i);if(0===i.x)return i.y>0?90:270;if(0===i.y)return i.x>0?0:180;var s=180*Math.atan(Math.abs(i.y/i.x))/Math.PI;return 1!==o&&3!==o||(s=90-s),90*o+s},t.getQuadrant=function(t){var e=t.x>0,n=t.y>0;return e&&n?0:!e&&n?1:e||n?3:2},t.generateLines=function(e,n){var i,o,s=[],a=n?e.concat(n):e;for(o=1;o<a.length;o++)i={start:{x:a[o-1].x,y:a[o-1].y},end:{x:a[o].x,y:a[o].y}},i.rotate=t.computerDegree(i.start,i.end),s.push(i);return s},t})});c(yt);var Ct=l(function(e){var n=c(t),e=n.module("gesturepassword.services");e.factory("GraphicsDrawContext",["GestureScreenLayout","GestureScreenContext","GraphicsStateContext",function(t,e,n){func