????
Current Path : C:/inetpub/vhost/bcvt.kontum.gov.vn/www/arcgis-js-api/core/workers/ |
Current File : C:/inetpub/vhost/bcvt.kontum.gov.vn/www/arcgis-js-api/core/workers/WorkerFallback.js |
// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. define(["require","exports","../tsSupport/generatorHelper","../tsSupport/awaiterHelper","../global","../has","../promiseUtils","./utils","@dojo/framework/shim/Promise"],function(e,r,t,s,n,i,o,a){var c=function(){function e(){var e=this,r=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(function(t){e[t]=function(){for(var e=[],s=0;s<arguments.length;s++)e[s]=arguments[s];return r[t].apply(r,e)}})}return e}(),u=n.MutationObserver||n.WebKitMutationObserver,d=function(){var e;if(n.process&&n.process.nextTick)e=function(e){n.process.nextTick(e)};else if(n.Promise)e=function(e){n.Promise.resolve().then(e)};else if(u){var r=[],t=document.createElement("div"),s=new u(function(){for(;r.length>0;)r.shift()()});s.observe(t,{attributes:!0}),e=function(e){r.push(e),t.setAttribute("queueStatus","1")}}return e}(),p=function(){var e=n.MessageEvent;try{new e("message",{data:null})}catch(e){return function(e,r){void 0===r&&(r={});var t=r.data,s=r.bubbles,n=void 0!==s&&s,i=r.cancelable,o=void 0!==i&&i,a=document.createEvent("Event");return a.initEvent(e,n,o),a.data=t,a}}return function(r,t){return new e(r,t)}}();return function(){function r(){this._dispatcher=new c,this._isInitialized=!1,this._workerPostMessage({type:a.MessageType.HANDSHAKE})}return r.prototype.terminate=function(){},Object.defineProperty(r.prototype,"onmessage",{get:function(){return this._onmessageHandler},set:function(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"onerror",{get:function(){return this._onerrorHandler},set:function(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)},enumerable:!0,configurable:!0}),r.prototype.postMessage=function(e){var r=this;d(function(){r._workerMessageHandler(p("message",{data:e}))})},r.prototype.dispatchEvent=function(e){return this._dispatcher.dispatchEvent(e)},r.prototype.addEventListener=function(e,r,t){this._dispatcher.addEventListener(e,r,t)},r.prototype.removeEventListener=function(e,r,t){this._dispatcher.removeEventListener(e,r,t)},r.prototype._workerPostMessage=function(e){var r=this;d(function(){r.dispatchEvent(p("message",{data:e}))})},r.prototype._workerMessageHandler=function(r){return s(this,void 0,void 0,function(){var s,n,c,u,d,p,l,v,f=this;return t(this,function(t){switch(t.label){case 0:if(!(s=a.receiveMessage(r)))return[2];switch(n=s.type){case a.MessageType.CONFIGURE:return[3,1];case a.MessageType.OPEN:return[3,2]}return[3,27];case 1:return this._isInitialized||this._workerPostMessage({type:a.MessageType.CONFIGURED}),[3,27];case 2:return c=s.modulePath,(u=s.jobId,i("esri-webpack"))?(d=void 0,[4,new Promise(function(r,t){e(["esri/core/workers/RemoteClient"],r,t)})]):[3,25];case 3:switch(p=t.sent(),l=c){case"esri/tasks/operations/PBFWorker":return[3,4];case"esri/views/2d/engine/vectorTiles/WorkerTileHandler":return[3,6];case"esri/views/2d/layers/features/Pipeline":return[3,8];case"esri/views/3d/layers/PointCloudWorker":return[3,10];case"esri/views/3d/layers/SceneLayerWorker":return[3,12];case"esri/layers/graphics/sources/support/CSVSourceWorker":return[3,14];case"esri/layers/support/LercWorker":return[3,16];case"esri/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker":return[3,18];case"esri/geometry/support/meshUtils/ElevationSamplerWorker":return[3,20]}return[3,22];case 4:return[4,new Promise(function(r,t){e(["esri/tasks/operations/PBFWorker"],r,t)})];case 5:return d=t.sent(),[3,24];case 6:return[4,new Promise(function(r,t){e(["esri/views/2d/engine/vectorTiles/WorkerTileHandler"],r,t)})];case 7:return d=t.sent(),[3,24];case 8:return[4,new Promise(function(r,t){e(["esri/views/2d/layers/features/Pipeline"],r,t)})];case 9:return d=t.sent(),[3,24];case 10:return[4,new Promise(function(r,t){e(["esri/views/3d/layers/PointCloudWorker"],r,t)})];case 11:return d=t.sent(),[3,24];case 12:return[4,new Promise(function(r,t){e(["esri/views/3d/layers/SceneLayerWorker"],r,t)})];case 13:return d=t.sent(),[3,24];case 14:return[4,new Promise(function(r,t){e(["esri/layers/graphics/sources/support/CSVSourceWorker"],r,t)})];case 15:return d=t.sent(),[3,24];case 16:return[4,new Promise(function(r,t){e(["esri/layers/support/LercWorker"],r,t)})];case 17:return d=t.sent(),[3,24];case 18:return[4,new Promise(function(r,t){e(["esri/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker"],r,t)})];case 19:return d=t.sent(),[3,24];case 20:return[4,new Promise(function(r,t){e(["esri/geometry/support/meshUtils/ElevationSamplerWorker"],r,t)})];case 21:return d=t.sent(),[3,24];case 22:return[4,o.create(function(r){return e([c],r)})];case 23:d=t.sent(),t.label=24;case 24:return v=p.connect(d),this._workerPostMessage({type:a.MessageType.OPENED,jobId:u,data:v}),[3,26];case 25:e(["esri/core/workers/RemoteClient",c],function(e,r){var t=e.connect(r);f._workerPostMessage({type:a.MessageType.OPENED,jobId:u,data:t})}),t.label=26;case 26:return[3,27];case 27:return[2]}})})},r}()});