function Update(){function m(){y(),b()}function g(e){v=e}function y(){e={checkComplete:!1,needMajor:!1,needMinor:!1,tooNew:!1,tooOld:!1,state:null,percent:null},t=!1}function b(){}function w(t,n){if(t.type.toLowerCase()==="lifestyle 600/650"||t.type.toLowerCase()==="lifestyle"&&t.variant==="bardeen")return;y(),v=n,funcObj.updateCon.checkLisas(),a=t.majorVersion=parseInt(t.scmVersion.split(".")[major_pos+0]),f=t.minorVersion=parseInt(t.scmVersion.split(".")[major_pos+1]),l=t.patchVersion=parseInt(t.scmVersion.split(".")[major_pos+2]),funcObj.devCon.sendMsg(v,"swUpdateQuery","swUpdateQuery",{}),isA4V&&(t.type.toLowerCase()==="soundtouch 600/650"?d=!0:d=!1,e.ignoreUpdate=d)}function E(t,n){var r,i;r=parseInt(gui_version.split(".")[major_pos+0]),i=$(n).find("release").attr("revision"),c=parseInt(i.split(".")[major_pos+0]),h=parseInt(i.split(".")[major_pos+1]),p=parseInt(i.split(".")[major_pos+2]),e.major=a,e.needMajor=c>a||last_supported_major>a,isA4V&&e.needMajor&&d&&funcObj.devCon.getDevice(t).sObj.disconnect(!1,!0),e.needMajor?(e.needMinor=!1,e.tooOld=c>r):e.needMinor=c==a&&(h>f||h==f&&p>l),e.checkComplete=!0,showDebug==2&&(console.log("====== PARSING DEVICE UPDATES ("+t+") ======="),console.log("Available: "+c+"."+h+"."+p),console.log("On Device: "+a+"."+f+"."+l),console.log("Ignore Updates?: "+d),console.log("Status:   "+JSON.stringify(e)),console.log("====================================================")),funcObj.updateCon.oldLisaFound(t,e),funcObj.deviceTray.setDeviceUpdateState(t)}function S(){funcObj.devCon.updateDeviceUpdateStatus(v,!0),funcObj.devCon.sendMsg(v,"swUpdateStart","swUpdateStart",{})}function x(e){funcObj.devCon.sendMsg(v,"swUpdateAbort","swUpdateAbort",{})}function T(t){var n=$(t).find("state").text(),r=$(t).find("percentComplete").text();funcObj.devCon.getDeviceSocketObj(v).getSocketState()||(n="restarting"),n=="IDLE"?(funcObj.devCon.sendMsg(v,"swUpdateCheck","swUpdateCheck",{}),funcObj.devCon.updateDeviceUpdateStatus(v,!1)):funcObj.devCon.updateDeviceUpdateStatus(v,!0);if(e.state==undefined||e.state==null||e.state!=n)e.state=n.toLowerCase();if(e.percent==undefined||e.percent==null||e.percent!=r)e.percent=r;e.state=="completed"&&(e.percent="100"),funcObj.devCon.getDevice(v).updateStatus&&funcObj.play.writeUpdateMsg(),funcObj.updateCon.checkLisas()}function N(){var t=funcObj.devCon.getDevice(v),n=e.needMinor||e.needMajor||t&&t.updateStatus,r=funcObj.groupCon.getGroupByUID(v);r&&(n=r.updateStatus().needsUpdate);var i=n?"&#xE168;":"";$("#"+v+" > h2 > .icon").html(i)}function C(){return e}function k(){return e.needMajor}function L(){return e.needMinor}function A(){var e=null;return typeof a=="number"&&typeof f=="number"&&typeof l=="number"&&typeof c=="number"&&typeof h=="number"&&typeof p=="number"&&(e={scm_major:a,scm_minor:f,scm_patch:l,avail_scm_major:c,avail_scm_minor:h,avail_scm_patch:p}),e}function O(){return e.ignoreUpdate}var e,t,n=!1,r=!1,i=3,s=0,o,u,a,f,l,c,h,p,d,v;this.setup=g,this.checkForUpdate=w,this.startUpdate=S,this.cancelUpdate=x,this.parseUpdates=E,this.handleProgressUpdate=T,this.getNeedMajor=k,this.getNeedMinor=L,this.getIgnoreUpdate=O,this.getStatus=C,this.updateNameIcon=N,this.getVersionNumbers=A,m()};