{"size": 20209, "ext": "js", "max_stars_repo_path": "assets/arcgis_js_api/library/4.10/esri/tasks/PrintTask.js", "max_stars_repo_name": "MalonzaElkanah/e-cafe", "max_stars_repo_stars_event_min_datetime": "2019-05-06T08:23:55.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-04T12:58:11.000Z", "max_issues_repo_path": "assets/arcgis_js_api/library/4.10/esri/tasks/PrintTask.js", "max_issues_repo_name": "MalonzaElkanah/e-cafe", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "assets/arcgis_js_api/library/4.10/esri/tasks/PrintTask.js", "max_forks_repo_name": "MalonzaElkanah/e-cafe", "max_forks_repo_forks_event_min_datetime": "2021-12-05T18:59:25.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-05T18:59:25.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 481.1666666667, "max_line_length": 561, "alphanum_fraction": 0.7566430798}
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.10/esri/copyright.txt for details.
//>>built
define("require exports ../core/tsSupport/assignHelper ../core/tsSupport/awaiterHelper ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/tsSupport/generatorHelper dojo/dom-construct dojox/gfx/canvas ../kernel ../request ../core/kebabDictionary ../core/lang ../core/promiseUtils ../core/screenUtils ../core/urlUtils ../core/accessorSupport/decorators ../geometry/Polygon ./Geoprocessor ./Task ./support/fileFormat ./support/layoutTemplate ./support/printTaskUtils ./support/PrintTemplate ./support/Query".split(" "),
function(V,W,H,r,I,u,x,J,C,y,K,z,D,L,E,v,w,M,N,O,P,Q,m,R,S){function B(m){return m&&(m.path||"image/svg+xml"===m.contentType)}var F={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},G=z({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),T=z({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),U=new S({returnGeometry:!0});return function(z){function e(a){a=z.call(this,a)||this;a._ssExtent=null;a._legendLayers=[];a._legendLayerNameMap={};a._gpServerUrl=
null;a._cimVersion=null;a._is11xService=!1;a._gpMetadata=null;a.updateDelay=1E3;return a}I(e,z);Object.defineProperty(e.prototype,"_geoprocessor",{get:function(){return new N(this.url,{updateDelay:this.updateDelay})},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"mode",{get:function(){return this._gpMetadata&&this._gpMetadata.executionType?T.fromJSON(this._gpMetadata.executionType):"sync"},enumerable:!0,configurable:!0});e.prototype.execute=function(a,b){var c=this,d=this.url,
n=d.lastIndexOf("/GPServer/");0<n&&(d=d.slice(0,n+9));return L.resolve().then(function(){if(c._gpServerUrl===d)return{data:c._gpMetadata};c._gpServerUrl=d;return K(d,{query:{f:"json"}})}).then(function(b){c._gpMetadata=b.data;c._cimVersion=c._gpMetadata.cimVersion;c._is11xService=!!c._cimVersion;return c._getGpPrintParams(a)}).then(function(a){return c._geoprocessor["async"===c.mode?"submitJob":"execute"](a,b).then(function(a){return"sync"===c.mode?a.results&&a.results[0]&&a.results[0].value:c._geoprocessor.getResultData(a.jobId,
"Output_File",b).then(function(a){return a.value})})})};e.prototype._createOperationalLayers=function(a,b){return r(this,void 0,void 0,function(){var c,d,n,q,l,e,p,g,f;return x(this,function(k){switch(k.label){case 0:c=[],d={layerView:null,printTemplate:b,view:a},n=0,b.preserveScale&&(n=b.outScale||a.scale),q=m.getVisibleLayerViews(a,n),l=0,e=q,k.label=1;case 1:if(!(l<e.length))return[3,24];p=e[l];g=p.layer;if(!g.loaded||m.isGroupLayer(g))return[3,23];f=void 0;d.layerView=p;if(!m.isBingMapsLayer(g))return[3,
2];f=this._createBingMapsLayerJSON(g,d);return[3,22];case 2:return m.isCSVLayer(g)?[4,this._createCSVLayerJSON(g,d)]:[3,4];case 3:return f=k.sent(),[3,22];case 4:return m.isFeatureLayer(g)?[4,this._createFeatureLayerJSON(g,d)]:[3,6];case 5:return f=k.sent(),[3,22];case 6:if(!m.isGraphicsLayer(g))return[3,7];f=this._createGraphicsLayerJSON(g,d);return[3,22];case 7:if(!m.isImageryLayer(g))return[3,8];f=this._createImageryLayerJSON(g,d);return[3,22];case 8:if(!m.isKMLLayer(g))return[3,9];f=this._createKMLLayerJSON(g,
d);return[3,22];case 9:if(!m.isMapImageLayer(g))return[3,10];f=this._createMapImageLayerJSON(g,d);return[3,22];case 10:if(!m.isMapNotesLayer(g))return[3,11];f=this._createMapNotesLayerJSON(g,d);return[3,22];case 11:if(!m.isOpenStreetMapLayer(g))return[3,12];f=this._createOpenStreetMapLayerJSON(g,d);return[3,22];case 12:return m.isStreamLayer(g)?[4,this._createStreamLayerJSON(g,d)]:[3,14];case 13:return f=k.sent(),[3,22];case 14:if(!m.isTileLayer(g))return[3,15];f=this._createTileLayerJSON(g,d);return[3,
22];case 15:return m.isVectorTileLayer(g)?[4,this._createVectorTileLayerJSON(g,d)]:[3,17];case 16:return f=k.sent(),[3,22];case 17:if(!m.isWebTileLayer(g))return[3,18];f=this._createWebTileLayerJSON(g,d);return[3,22];case 18:if(!m.isWMSLayer(g))return[3,19];f=this._createWMSLayerJSON(g,d);return[3,22];case 19:if(!m.isWMTSLayer(g))return[3,20];f=this._createWMTSLayerJSON(g,d);return[3,22];case 20:return[4,this._createScreenshotJSON(g,d)];case 21:f=k.sent(),k.label=22;case 22:f&&(Array.isArray(f)?c.push.apply(c,
f):(f.id=g.id,f.title=this._legendLayerNameMap[g.id]||g.title,f.opacity=g.opacity,f.minScale=g.minScale||0,f.maxScale=g.maxScale||0,c.push(f))),k.label=23;case 23:return l++,[3,1];case 24:return n&&c.forEach(function(a){a.minScale=0;a.maxScale=0}),a.graphics&&a.graphics.length&&(f=this._createFeatureCollectionJSON(null,a.graphics,b))&&c.push(f),[2,c]}})})};e.prototype._createBingMapsLayerJSON=function(a,b){return{culture:a.culture,key:a.key,type:"BingMaps"+("aerial"===a.style?"Aerial":"hybrid"===
a.style?"Hybrid":"Road")}};e.prototype._createCSVLayerJSON=function(a,b){var c=b.layerView,d=b.printTemplate;return r(this,void 0,void 0,function(){var b,q;return x(this,function(n){switch(n.label){case 0:this._legendLayers&&this._legendLayers.push({id:a.id});if(!this._is11xService)return[3,1];b={type:"CSV"};a.write(b,{origin:"web-map"});delete b.popupInfo;delete b.layerType;b.showLabels=d.showLabels&&a.labelsVisible;return[3,3];case 1:return[4,this._getGraphics(c)];case 2:return q=n.sent(),[2,this._createFeatureCollectionJSON(a,
q,d)];case 3:return[2,b]}})})};e.prototype._createFeatureCollectionJSON=function(a,b,c){var d=this,n=m.createPolygonLayer(),q=m.createPolylineLayer(),l=m.createPointLayer(),e=m.createMultipointLayer(),p=m.createPointLayer();p.layerDefinition.name="textLayer";delete p.layerDefinition.drawingInfo;a&&("esri.layers.FeatureLayer"===a.declaredClass||"esri.layers.StreamLayer"===a.declaredClass?n.layerDefinition.name=q.layerDefinition.name=l.layerDefinition.name=e.layerDefinition.name=this._legendLayerNameMap[a.id]||
a.get("arcgisProps.title")||a.title:"esri.layers.GraphicsLayer"===a.declaredClass&&(b=a.graphics.items));var g=a&&a.renderer&&"esri.renderer.SimpleRenderer"===a.renderer.declaredClass;if(a&&a.renderer&&"function"!==typeof a.get("renderer.field")){var f=a.renderer.toJSON();n.layerDefinition.drawingInfo.renderer=f;q.layerDefinition.drawingInfo.renderer=f;l.layerDefinition.drawingInfo.renderer=f;e.layerDefinition.drawingInfo.renderer=f}else delete n.layerDefinition.drawingInfo,delete q.layerDefinition.drawingInfo,
delete l.layerDefinition.drawingInfo,delete e.layerDefinition.drawingInfo;var f=a&&a.fields,k=a&&a.renderer,t=[];k&&"function"!==typeof a.get("renderer.field")&&("class-breaks"===k.type?(f||(f=[{name:k.field,type:"esriFieldTypeDouble"}],k.normalizationField&&f.push({name:k.normalizationField,type:"esriFieldTypeDouble"})),k.field&&t.push(k.field),k.normalizationField&&t.push(k.normalizationField)):"unique-value"===k.type&&(f||(f=[{name:k.field,type:"esriFieldTypeString"}],k.field2&&f.push({name:k.field2,
type:"esriFieldTypeString"}),k.field3&&f.push({name:k.field3,type:"esriFieldTypeString"})),k.field&&t.push(k.field),k.field2&&t.push(k.field2),k.field3&&t.push(k.field3)));f&&(n.layerDefinition.fields=f,q.layerDefinition.fields=f,l.layerDefinition.fields=f,e.layerDefinition.fields=f);for(var f=b&&b.length,h,k=function(d){d=b[d]||b.getItemAt(d);if(!1===d.visible||!d.geometry)return"continue";h=d.toJSON();h.hasOwnProperty("popupTemplate")&&delete h.popupTemplate;h.geometry&&h.geometry.z&&delete h.geometry.z;
if(h.symbol&&h.symbol.outline&&"esriCLS"===h.symbol.outline.type&&!A._is11xService)return"continue";h.symbol&&h.symbol.outline&&h.symbol.outline.color&&h.symbol.outline.color[3]&&!A._is11xService&&(h.symbol.outline.color[3]=255);if(a&&a.renderer&&!h.symbol&&("function"===typeof a.renderer.field||a.renderer.compiledFunc||a.renderer.hasVisualVariables())){var f=a.renderer,g=f.getSymbol(d);if(!g)return"continue";h.symbol=g.toJSON();f.hasVisualVariables()&&m.applyVisualVariables(h.symbol,{renderer:f,
graphic:d,symbol:g})}h.symbol&&(h.symbol.angle||delete h.symbol.angle,B(h.symbol)?h.symbol=A._convertSvgToPictureMarkerSymbolJson(h.symbol):h.symbol.text&&delete h.attributes);if(!c||!c.forceFeatureAttributes)if(a&&a.renderer&&"simple"===a.renderer.type)delete h.attributes;else if(t.length){var k={};t.forEach(function(a){h.attributes&&h.attributes.hasOwnProperty(a)&&(k[a]=h.attributes[a])});h.attributes=k}"polygon"===d.geometry.type?n.featureSet.features.push(h):"polyline"===d.geometry.type?q.featureSet.features.push(h):
"point"===d.geometry.type?h.symbol&&h.symbol.text?p.featureSet.features.push(h):l.featureSet.features.push(h):"multipoint"===d.geometry.type?e.featureSet.features.push(h):"extent"===d.geometry.type&&(h.geometry=M.fromExtent(d.geometry).toJSON(),n.featureSet.features.push(h))},A=this,r=0;r<f;r++)k(r);f=[n,q,e,l,p].filter(function(a){return 0<a.featureSet.features.length});f.forEach(function(a){var b=a.featureSet.features.every(function(a){return a.symbol});!b&&!g||c&&c.forceFeatureAttributes||a.featureSet.features.forEach(function(a){delete a.attributes});
b&&delete a.layerDefinition.drawingInfo;a.layerDefinition.drawingInfo&&a.layerDefinition.drawingInfo.renderer&&d._convertSvgRenderer(a.layerDefinition.drawingInfo.renderer)});return f.length?{featureCollection:{layers:f}}:null};e.prototype._createFeatureLayerJSON=function(a,b){var c=b.layerView,d=b.printTemplate,n=b.view;return r(this,void 0,void 0,function(){var b,l,e,p,g,f,k;return x(this,function(q){switch(q.label){case 0:this._legendLayers&&this._legendLayers.push({id:a.id});e=(l=a.renderer)&&
("valueExpression"in l&&l.valueExpression||"hasVisualVariables"in l&&l.hasVisualVariables());p=a.source&&"feature-layer"!==a.source.type;if(!this._is11xService&&e||a.featureReduction||p||!l||"field"in l&&!(null==l.field||"string"===typeof l.field&&a.getField(l.field)))return[3,1];b={};this._setURLandToken(b,a);a.write(b,{origin:"web-map"});delete b.layerType;delete b.popupInfo;delete b.visibility;b.showLabels=d.showLabels&&a.labelsVisible;b.layerDefinition&&b.layerDefinition.drawingInfo&&b.layerDefinition.drawingInfo.renderer&&
(this._convertSvgRenderer(b.layerDefinition.drawingInfo.renderer),"visualVariables"in l&&l.visualVariables&&l.visualVariables[0]&&(g=l.visualVariables[0],"size"===g.type&&g.maxSize&&"number"!==typeof g.maxSize&&g.minSize&&"number"!==typeof g.minSize&&(f=l.getSizeRangeAtScale(g,n.scale),b.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=f.minSize,b.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=f.maxSize)));return[3,3];case 1:return[4,this._getGraphics(c)];case 2:k=
q.sent(),b=this._createFeatureCollectionJSON(a,k,d),q.label=3;case 3:return[2,b]}})})};e.prototype._createGraphicsLayerJSON=function(a,b){b=b.printTemplate;this._legendLayers&&this._legendLayers.push({id:a.id});return this._createFeatureCollectionJSON(a,null,b)};e.prototype._createImageryLayerJSON=function(a,b){this._legendLayers&&this._legendLayers.push({id:a.id});b={bandIds:a.bandIds,compressionQuality:a.compressionQuality,format:a.format,interpolation:a.interpolation};a.mosaicRule&&(b.mosaicRule=
a.mosaicRule.toJSON());a.renderingRule&&(b.renderingRule=a.renderingRule.toJSON());this._setURLandToken(b,a);return b};e.prototype._createKMLLayerJSON=function(a,b){var c=b.printTemplate;if(this._is11xService)return b={type:"kml"},a.write(b,{origin:"web-map"}),delete b.layerType,b.url=v.normalize(a.url),b.showLabels=c.showLabels&&a.labelsVisible,b;var d=[];b=b.layerView;b.allVisibleMapImages.forEach(function(b,c){c={id:a.id+"_image"+c,type:"image",title:a.id,minScale:a.minScale||0,maxScale:a.maxScale||
0,opacity:a.opacity,extent:b.extent};"data:image/png;base64,"===b.href.substr(0,22)?c.imageData=b.href.substr(22):c.url=b.href;d.push(c)});b=b.allVisiblePoints.items.concat(b.allVisiblePolylines.items,b.allVisiblePolygons.items);c=H({id:a.id},this._createFeatureCollectionJSON(null,b,c));d.push(c);return d};e.prototype._createMapImageLayerJSON=function(a,b){var c,d={id:a.id,subLayerIds:[]},n=[],q=b.view.scale,e=function(a){var b=0===q,c=0===a.minScale||q<=a.minScale,f=0===a.maxScale||q>=a.maxScale;
a.visible&&(b||c&&f)&&(a.sublayers?a.sublayers.forEach(e):(b=a.toExportImageJSON().drawingInfo,c=a.toJSON(),c.layerDefinition.drawingInfo=b,n.unshift(c),d.subLayerIds.push(a.id)))};a.sublayers&&a.sublayers.forEach(e);n.length&&(c={layers:n,visibleLayers:d.subLayerIds},this._setURLandToken(c,a),this._legendLayers.push(d));return c};e.prototype._createMapNotesLayerJSON=function(a,b){var c=this,d=b.printTemplate,n=[];b.layerView.graphicsViews.forEach(function(a){(a=c._createFeatureCollectionJSON(a,a.graphics,
d))&&n.push.apply(n,a.featureCollection.layers)});return{featureCollection:{layers:n}}};e.prototype._createOpenStreetMapLayerJSON=function(a,b){return{type:"OpenStreetMap"}};e.prototype._createScreenshotJSON=function(a,b){var c=b.printTemplate,d=b.view;return r(this,void 0,void 0,function(){var b,e,l,m,p,g,f,k,t,h;return x(this,function(n){switch(n.label){case 0:return b={type:"image"},e={format:"png",layers:[a],rotation:0},l=this._ssExtent||d.extent.clone(),m=96,g=p=!0,c.exportOptions&&(f=c.exportOptions,
0<f.dpi&&(m=f.dpi),0<f.width&&(p=f.width%2===d.width%2),0<f.height&&(g=f.height%2===d.height%2)),"map-only"!==c.layout||!c.preserveScale||c.outScale&&c.outScale!==d.scale||96!==m||p&&g||(e.area={x:0,y:0,width:d.width,height:d.height},p||--e.area.width,g||--e.area.height,this._ssExtent||(k=d.toMap({x:e.area.width,y:e.area.height}),l.ymin=k.y,l.xmax=k.x,this._ssExtent=l)),b.extent=l.clone()._normalize(!0).toJSON(),[4,d.takeScreenshot(e)];case 1:return t=n.sent(),h=v.dataComponents(t.dataUrl),b.imageData=
h.data,[2,b]}})})};e.prototype._createStreamLayerJSON=function(a,b){var c=b.layerView,d=b.printTemplate;return r(this,void 0,void 0,function(){var b;return x(this,function(e){switch(e.label){case 0:return this._legendLayers&&this._legendLayers.push({id:a.id}),[4,this._getGraphics(c)];case 1:return b=e.sent(),[2,this._createFeatureCollectionJSON(a,b,d)]}})})};e.prototype._createTileLayerJSON=function(a,b){b={};this._setURLandToken(b,a);return b};e.prototype._createVectorTileLayerJSON=function(a,b){return r(this,
void 0,void 0,function(){var c,d,e;return x(this,function(n){return this._is11xService&&a.serviceUrl&&a.styleUrl&&(c=y.id&&y.id.findCredential(a.styleUrl),d=y.id&&y.id.findCredential(a.serviceUrl),!c&&!d||"2.1.0"!==this._cimVersion)?(e={type:"VectorTileLayer"},e.styleUrl=v.normalize(a.styleUrl),c&&(e.token=c.token),d&&d.token!==e.token&&(e.additionalTokens=[{url:a.serviceUrl,token:d.token}]),[2,e]):[2,this._createScreenshotJSON(a,b)]})})};e.prototype._createWebTileLayerJSON=function(a,b){b={type:"WebTiledLayer",
urlTemplate:a.urlTemplate.replace(/\${/g,"{"),credits:a.copyright};a.subDomains&&0<a.subDomains.length&&(b.subDomains=a.subDomains);return b};e.prototype._createWMSLayerJSON=function(a,b){var c,d=[],e=function(a){a.visible&&(a.sublayers?a.sublayers.forEach(e):a.name&&d.unshift(a.name))};a.sublayers&&a.sublayers.forEach(e);d.length&&(c={type:"wms",transparentBackground:a.imageTransparency,visibleLayers:d,url:v.normalize(a.url),version:a.version});return c};e.prototype._createWMTSLayerJSON=function(a,
b){b=a.activeLayer;return{type:"wmts",format:b.imageFormat,layer:b.id,style:b.styleId,tileMatrixSet:b.tileMatrixSetId,url:v.normalize(a.url)}};e.prototype._setURLandToken=function(a,b){b.url&&(a.url=v.normalize(b.url));b.token&&(a.token=b.token)};e.prototype._convertSvgToPictureMarkerSymbolJson=function(a){this._canvasParent?(this._canvasSurface.clear(),this._canvasSurface.setDimensions(1024,1024)):(this._canvasParent=J.create("div"),this._canvasSurface=C.createSurface(this._canvasParent,1024,1024));
var b;b="image/svg+xml"===a.contentType?this._canvasSurface.createObject(C.Image,{src:"data:image/svg+xml;base64,"+a.imageData,width:E.pt2px(a.width),height:E.pt2px(a.height),x:0,y:0}):this._canvasSurface.createObject(C.Path,a.path).setFill(a.color).setStroke(a.outline);"pendingRender"in this._canvasSurface&&this._canvasSurface._render(!0);var c=this._canvasSurface.rawNode.getContext("2d");b=b.getBoundingBox();var d=Math.ceil(b.width+b.x),e=Math.ceil(b.height+b.y),m=c.getImageData(b.x,b.y,d,e);c.canvas.width=
d;c.canvas.height=e;c.putImageData(m,0,0);return{type:"esriPMS",imageData:c.canvas.toDataURL("image/png").substr(22),angle:a.angle,contentType:"image/png",height:a.size?a.size:e-b.y,width:a.size?a.size:d-b.x,xoffset:a.xoffset,yoffset:a.yoffset}};e.prototype._convertSvgRenderer=function(a){var b=this,c=a.type;if("simple"===c&&B(a.symbol))a.symbol=this._convertSvgToPictureMarkerSymbolJson(a.symbol);else if("unique-value"===c||"class-breaks"===c)B(a.defaultSymbol)&&(a.defaultSymbol=this._convertSvgToPictureMarkerSymbolJson(a.defaultSymbol)),
(a=a["unique-value"===c?"uniqueValueInfos":"classBreakInfos"])&&a.forEach(function(a){B(a.symbol)&&(a.symbol=b._convertSvgToPictureMarkerSymbolJson(a.symbol))})};e.prototype._getGraphics=function(a){return a.queryFeatures(U).then(function(a){return a.features})};e.prototype._getPrintDefinition=function(a,b){return r(this,void 0,void 0,function(){var c,d,e,m,l;return x(this,function(n){switch(n.label){case 0:return c=a.view,d=c.spatialReference,m={},[4,this._createOperationalLayers(c,b)];case 1:return e=
(m.operationalLayers=n.sent(),m),l=this._ssExtent||a.extent||c.extent,d&&d.isWrappable&&(l=l.clone()._normalize(!0),d=l.spatialReference),e.mapOptions={extent:l&&l.toJSON(),spatialReference:d&&d.toJSON(),showAttribution:b.attributionVisible},this._ssExtent=null,c.rotation&&(e.mapOptions.rotation=-c.rotation),b.preserveScale&&(e.mapOptions.scale=b.outScale||c.scale),[2,e]}})})};e.prototype._getGpPrintParams=function(a){return r(this,void 0,void 0,function(){var b,c,d,e,m,l,r,p,g,f,k,t,h,A,v,w,u,z,
y,B=this;return x(this,function(n){switch(n.label){case 0:b=a.template||new R;null==b.showLabels&&(b.showLabels=!0);c=b.exportOptions;e=Q.toJSON(b.layout);c&&(m=c.dpi,d={dpi:m},"map_only"===e.toLowerCase()||""===e)&&(l=c.width,r=c.height,d.outputSize=[l,r]);if(p=b.layoutOptions){k=f=void 0;if("Miles"===p.scalebarUnit||"Kilometers"===p.scalebarUnit)f="Kilometers",k="Miles";else if("Meters"===p.scalebarUnit||"Feet"===p.scalebarUnit)f="Meters",k="Feet";g={titleText:p.titleText,authorText:p.authorText,
copyrightText:p.copyrightText,customTextElements:p.customTextElements,scaleBarOptions:{metricUnit:G.toJSON(f),metricLabel:F[f],nonMetricUnit:G.toJSON(k),nonMetricLabel:F[k]}}}t=null;p&&p.legendLayers&&(t=p.legendLayers.map(function(a){B._legendLayerNameMap[a.layerId]=a.title;var b={id:a.layerId};a.subLayerIds&&(b.subLayerIds=a.subLayerIds);return b}));return[4,this._getPrintDefinition(a,b)];case 1:return h=n.sent(),h.operationalLayers&&(v=/[\u4E00-\u9FFF\u0E00-\u0E7F\u0900-\u097F\u3040-\u309F\u30A0-\u30FF\u31F0-\u31FF]/,
w=/[\u0600-\u06FF]/,u=function(a){var b=a.text,c=(a=a.font)&&a.family&&a.family.toLowerCase();b&&a&&("arial"===c||"arial unicode ms"===c)&&(a.family=v.test(b)?"Arial Unicode MS":"Arial","normal"!==a.style&&w.test(b)&&(a.family="Arial Unicode MS"))},h.operationalLayers.forEach(function(a){a.featureCollection&&a.featureCollection.layers&&a.featureCollection.layers.forEach(function(a){a.layerDefinition&&a.layerDefinition.drawingInfo&&a.layerDefinition.drawingInfo.renderer&&a.layerDefinition.drawingInfo.renderer.symbol&&
(A=a.layerDefinition.drawingInfo.renderer,"esriTS"===A.symbol.type&&u(A.symbol));a.featureSet&&a.featureSet.features&&a.featureSet.features.forEach(function(a){a.symbol&&"esriTS"===a.symbol.type&&u(a.symbol)})})})),a.outSpatialReference&&(h.mapOptions.spatialReference=a.outSpatialReference.toJSON()),D.mixin(h,{exportOptions:d,layoutOptions:g}),D.mixin(h.layoutOptions,{legendOptions:{operationalLayers:null!=t?t:this._legendLayers.slice()}}),this._legendLayers.length=0,z=JSON.stringify(h),y={Web_Map_as_JSON:z,
Format:P.toJSON(b.format),Layout_Template:e},a.extraParameters&&D.mixin(y,a.extraParameters),[2,y]}})})};u([w.property({dependsOn:["url","updateDelay"]})],e.prototype,"_geoprocessor",null);u([w.property()],e.prototype,"_gpMetadata",void 0);u([w.property({dependsOn:["_gpMetadata"],readOnly:!0})],e.prototype,"mode",null);u([w.property()],e.prototype,"updateDelay",void 0);return e=u([w.subclass("esri.tasks.PrintTask")],e)}(w.declared(O))});