/** * Cesium - https://github.com/CesiumGS/cesium * * Copyright 2011-2020 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details. */ define(["exports"],function(n){function t(n,t){return null!=n?n:t}var e,r,a;function m(n,t,e,r){return h(n).then(t,e,r)}function h(n){var t,e;return n instanceof l?n:u(n)?(t=b(),n.then(function(n){t.resolve(n)},function(n){t.reject(n)},function(n){t.progress(n)}),t.promise):(e=n,new l(function(n){try{return h(n?n(e):e)}catch(n){return p(n)}}))}function l(n){this.then=n}function p(e){return new l(function(n,t){try{return t?h(t(e)):p(e)}catch(n){return p(n)}})}function b(){var n,i,c,r,t,e;return n=new l(u),i=[],c=[],r=function(t,e,r){var u,o;return u=b(),o="function"==typeof r?function(n){try{u.progress(r(n))}catch(n){u.progress(n)}}:function(n){u.progress(n)},i.push(function(n){n.then(t,e).then(u.resolve,u.reject,o)}),c.push(o),u.promise},t=function(n){return v(c,n),n},e=function(n){return n=h(n),r=n.then,e=h,t=k,v(i,n),c=i=a,n},{then:u,resolve:o,reject:f,progress:s,promise:n,resolver:{resolve:o,reject:f,progress:s}};function u(n,t,e){return r(n,t,e)}function o(n){return e(n)}function f(n){return e(p(n))}function s(n){return t(n)}}function u(n){return n&&"function"==typeof n.then}function o(n,p,v,g,y){return f(2,arguments),m(n,function(n){var t,e,r,u,o,i,c,f,s,a;if(s=n.length>>>0,t=Math.max(0,Math.min(p,s)),r=[],e=s-t+1,u=[],o=b(),t)for(f=o.progress,c=function(n){u.push(n),--e||(i=c=k,o.reject(u))},i=function(n){r.push(n),--t||(i=c=k,o.resolve(r))},a=0;a>>0,e=[],i=b(),r)for(u=function(n,t){m(n,c).then(function(n){e[t]=n,--r||i.resolve(e)},i.reject)},o=0;o>>0,f=n.length>>>0,e=[],t=[],i=(r=b()).progress,o=function(n){t.push(n),--f||(u=o=k,r.resolve(e))},u=function(n,t){e[t]=n,--f||(u=o=k,r.resolve(e))},s=0;s>>0,(e=arguments).length<=1)for(;;){if(o in t){r=t[o++];break}if(++o>=u)throw new TypeError}else r=e[1];for(;o