define(["Ti/_","Ti/_/browser","Ti/_/Evented","Ti/_/lang","Ti/Locale","Ti/_/dom","Ti/UI"],function(e,t,o,i,n,r,a){function c(){d||(d=1,s.cookie=l+"="+encodeURIComponent(T)+"; expires="+new Date(Date.now()+63072e7).toUTCString(),localStorage.setItem(l,T))}var d,s=document,l="ti:mid",u=s.cookie.match(new RegExp("(?:^|; )"+l+"=([^;]*)")),T=u?decodeURIComponent(u[1]):void 0,m=require.on,b=r.create("iframe",{id:"urlOpener",style:{display:"none"}},s.body);T||(T=localStorage.getItem(l)),T||localStorage.setItem(l,T=e.uuid()),m(window,"beforeunload",c),m(window,"unload",c);var g=navigator,v=g.battery||g.webkitBattery||g.mozBattery,_=i.setObject("Ti.Platform",o,{canOpenURL:function(e){return!!e},createUUID:e.uuid,is24HourTimeFormat:function(){return!1},openURL:function(e){if(/^([tel|sms|mailto])/.test(e))b.contentWindow.location.href=e;else{var t=a.createWindow({layout:a._LAYOUT_CONSTRAINING_VERTICAL,backgroundColor:"#888"}),o=a.createButton({top:2,bottom:2,title:"Close"}),i=a.createWebView({width:a.FILL,height:a.FILL});o.addEventListener("singletap",function(){t.close()}),t.add(o),t.add(i),t.open(),setTimeout(function(){i.url=e},1)}},properties:{batteryMonitoring:!1},constants:{BATTERY_STATE_CHARGING:1,BATTERY_STATE_FULL:2,BATTERY_STATE_UNKNOWN:-1,BATTERY_STATE_UNPLUGGED:0,address:void 0,architecture:void 0,availableMemory:void 0,batteryLevel:function(){return this.batteryMonitoring&&v?100*v.level:-1},batteryState:function(){return this.batteryMonitoring&&v&&v.charging?this.BATTERY_STATE_CHARGING:this.BATTERY_STATE_UNKNOWN},isBrowser:!0,id:T,locale:n,macaddress:void 0,model:g.userAgent,name:"mobileweb",netmask:void 0,osname:"mobileweb",ostype:g.platform,runtime:t.runtime,processorCount:void 0,username:void 0,version:require.config.ti.version}});return v&&require.on(v,"chargingchange",function(){_.batteryMonitoring&&_.fireEvent("battery",{level:_.batteryLevel,state:_.batteryState})}),_});