//>>built
define("dojox/mobile/dh/JsonContentHandler","dojo/_base/kernel,dojo/_base/array,dojo/_base/declare,dojo/_base/lang,dojo/_base/Deferred,dojo/json,dojo/dom-construct".split(","),function(m,j,q,l,o,p,r){return q("dojox.mobile.dh.JsonContentHandler",null,{parse:function(b,g,d){var a,e=r.create("DIV");g.insertBefore(e,d);this._ws=[];this._req=[];var c=p.parse(b);return o.when(this._loadPrereqs(c),l.hitch(this,function(){a=this._instantiate(c,e);a.style.visibility="hidden";j.forEach(this._ws,function(a){!a._started&&
a.startup&&a.startup()});this._ws=null;return a.id}))},_loadPrereqs:function(b){var g=new o,b=this._collectRequires(b);if(0===b.length)return!0;if(m.require)return j.forEach(b,function(b){m.require(b)}),!0;b=j.map(b,function(b){return b.replace(/\./g,"/")});require(b,function(){g.resolve(!0)});return g},_collectRequires:function(b){var g=b["class"],d;for(d in b)if(!("@"==d.charAt(0)||"children"===d)){var a=g||d.replace(/:.*/,"");this._req.push(a);if(a)for(var a=g?[b]:l.isArray(b[d])?b[d]:[b[d]],e=
0;e<a.length;e++)if(g){if(a[e].children)for(var c=0;c<a[e].children.length;c++)this._collectRequires(a[e].children[c])}else this._collectRequires(a[e])}return this._req},_instantiate:function(b,g,d){var a,e=b["class"],c;for(c in b)if(!("@"==c.charAt(0)||"children"===c)){var j=l.getObject(e||c.replace(/:.*/,""));if(j)for(var m=j.prototype,k=e?[b]:l.isArray(b[c])?b[c]:[b[c]],i=0;i<k.length;i++){a={};for(var f in k[i])if("@"==f.charAt(0)){var h=k[i][f];f=f.substring(1);var n=typeof m[f];l.isArray(m[f])?
a[f]=h.split(/\s*,\s*/):"string"===n?a[f]=h:"number"===n?a[f]=h-0:"boolean"===n?a[f]="false"!==h:"object"===n?a[f]=p.parse(h):"function"===n&&(a[f]=l.getObject(h,!1)||new Function(h))}a=new j(a,g);g&&this._ws.push(a);d&&a.placeAt(d.containerNode||d.domNode);if(e){if(k[i].children)for(h=0;h<k[i].children.length;h++)this._instantiate(k[i].children[h],null,a)}else this._instantiate(k[i],null,a)}}return a&&a.domNode}})});