@galacean/effects-plugin-downgrade 2.8.0-alpha.5 → 2.8.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/alipay.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@galacean/effects/alipay"),i=require("@galacean/appx-adapter/alipay");function n(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}})),i.default=e,Object.freeze(i)}var t=n(e);function o(e,i,n,t,o,r,h){try{var s=e[r](h),a=s.value}catch(e){return void n(e)}s.done?i(a):Promise.resolve(a).then(t,o)}function r(e,i){return r=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},r(e,i)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function s(e,i,n){return s=h()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&r(o,n.prototype),o},s.apply(null,arguments)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function l(e){var i="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return s(e,arguments,a(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),r(t,e)},l(e)}function d(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=s(0),h.throw=s(1),h.return=s(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function s(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,s[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,t=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=i.call(e,r)}catch(e){s=[6,e],t=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function c(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function u(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return c(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var v,f={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},m={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},p={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},P={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};exports.DeviceLevel=void 0,(v=exports.DeviceLevel||(exports.DeviceLevel={})).High="high",v.Medium="medium",v.Low="low",v.Unknown="unknown";var g=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var n=e.prototype;return n.getDeviceInfo=function(){return this.device},n.isIOS=function(){return"iOS"===this.device.platform},n.isAndroid=function(){return"Android"===this.device.platform},n.isHarmony=function(){return"Harmony"===this.device.platform},n.isWindows=function(){return"Windows"===this.device.platform},n.isMacintosh=function(){return"Macintosh"===this.device.platform},n.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},n.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var s,a=u(t);!(s=a()).done;){var l=s.value,d=l.name,c=l.comment;if(null==d?void 0:d.startsWith("Mozilla/")){c&&this.parseData(c);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},n.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},n.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?exports.DeviceLevel.Low:e<16?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?exports.DeviceLevel.Low:i<12?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}return exports.DeviceLevel.High},n.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.getIPhoneModel=function(){var e,n=i.window.screen.width*i.window.devicePixelRatio,t=i.window.screen.height*i.window.devicePixelRatio,o=f.iPhone.find((function(e){return e.width===n&&e.height===t}));return null!=(e=null==o?void 0:o.model)?e:"iPhone"},n.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=u(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var s,a=t[t.length-1].trim(),l=u(f.vender);!(s=l()).done;){var d=s.value;if(a.startsWith(d))return a.substring(d.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var c=t.length;if("wv"===t[c-1].trim())return t[c-2].trim()}},n.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.testIPhone=function(e){return e.includes("iPhone")},n.testIPad=function(e){return e.includes("iPad")},n.testAndroid=function(e){return e.includes("Android")},n.testMacintosh=function(e){return e.includes("Macintosh")},n.testWindows=function(e){return e.includes("Windows")},e}(),w=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:exports.DeviceLevel.High,medium:exports.DeviceLevel.Medium,middle:exports.DeviceLevel.Medium,low:exports.DeviceLevel.Low}[e]||exports.DeviceLevel.Unknown},e}(),y=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=P.wechat[e.model])?t:e.model,h=u(f.iPhone);!(o=h()).done;){var s=o.value;if(s.name===r){e.model=s.model;break}}if("iOS"===this.device.platform){var a=e.model.match(/^(.*?)<(.*?)>$/);a?(this.device.model=a[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=exports.DeviceLevel.Unknown:e.benchmarkLevel<=10?this.device.level=exports.DeviceLevel.Low:e.benchmarkLevel<=20?this.device.level=exports.DeviceLevel.Medium:this.device.level=exports.DeviceLevel.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function i(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=i.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?m.iPhone:m.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?p.iOS:p.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===exports.DeviceLevel.High)return e.spec.RenderLevel.S;if(this.device.level===exports.DeviceLevel.Medium)return e.spec.RenderLevel.A;if(this.device.level===exports.DeviceLevel.Low)return e.spec.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var i=+RegExp.$1;return i<=9?e.spec.RenderLevel.B:i<10?e.spec.RenderLevel.A:e.spec.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?e.spec.RenderLevel.B:this.device.memoryMB<6e3?e.spec.RenderLevel.A:e.spec.RenderLevel.S:this.isIOS?e.spec.RenderLevel.S:e.spec.RenderLevel.B},i}(),S=Symbol("@@_inter_pause"),b=!1;function M(){return e.isIOS()?e.spec.RenderLevel.S:e.spec.RenderLevel.B}function D(i){i.target===document&&(e.logger.info("Auto pause all players with data offloaded."),e.getActivePlayers().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[S]=!0)})))}function x(i){i.target===document&&(e.logger.info("Auto resume all players."),e.getActivePlayers().forEach((function(e){e[S]&&(e.resume(),e[S]=!1)})))}var O=function(i){function n(){var e;return(e=i.call(this)||this).order=1,e}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&r(e,i)}(n,i),n.prototype.onAssetsLoadStart=function(i,n){return(t=function(){var i,t,o;return d(this,(function(r){if(t=null==(i=(n=n||{}).pluginData)?void 0:i.downgrade){if(t.downgrade)throw new Error("Downgraded, reason: "+t.reason)}else e.logger.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=null!=(o=null==t?void 0:t.level)?o:M()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(n,r){var h=t.apply(e,i);function s(e){o(h,n,r,s,a,"next",e)}function a(e){o(h,n,r,s,a,"throw",e)}s(void 0)}))})();var t},n}(l(e.Plugin)),A="2.8.0-alpha.5";e.registerPlugin("downgrade",O),e.logger.info("Plugin downgrade version: "+A+"."),A!==t.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),exports.AlipayMiniprogramParser=w,exports.UADecoder=g,exports.WechatMiniprogramParser=y,exports.getDefaultRenderLevel=M,exports.getDowngradeResult=function(n){void 0===n&&(n={}),b||(!function(n){var t=n.autoPause;i.window.addEventListener("unload",(function(){e.getActivePlayers().forEach((function(e){return e.dispose()}))})),t&&(document.addEventListener("pause",D),document.addEventListener("resume",x))}(n),b=!0);var t,o=n.mockDowngrade;if(void 0!==o)return{downgrade:o,level:null!=(t=n.level)?t:e.spec.RenderLevel.S,reason:"mock"};var r=function(i){var n=i.queryDeviceInMiniApp,t=i.deviceInfo;if(t)return t;if(n){if(e.isAlipayMiniApp()){if(my.canIUse("getSystemInfo")){var o=my.getSystemInfo();return new w(o).getDeviceInfo()}e.logger.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(e.isWechatMiniApp()){if(wx.canIUse("getDeviceInfo")){var r=wx.getDeviceInfo();return new y(r).getDeviceInfo()}e.logger.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else e.logger.error("Non-mini program environment and try to get device info from user agent.")}return(new g).getDeviceInfo()}(n);return new L(n,r).getDowngradeResult()},exports.version=A;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@galacean/effects/alipay"),i=require("@galacean/appx-adapter/alipay");function n(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}})),i.default=e,Object.freeze(i)}var t=n(e);function o(e,i,n,t,o,r,h){try{var s=e[r](h),a=s.value}catch(e){return void n(e)}s.done?i(a):Promise.resolve(a).then(t,o)}function r(e,i){return r=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},r(e,i)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function s(e,i,n){return s=h()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&r(o,n.prototype),o},s.apply(null,arguments)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function l(e){var i="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return s(e,arguments,a(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),r(t,e)},l(e)}function d(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=s(0),h.throw=s(1),h.return=s(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function s(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,s[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,t=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=i.call(e,r)}catch(e){s=[6,e],t=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function c(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function u(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return c(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var v,f={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},m={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},p={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},P={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};exports.DeviceLevel=void 0,(v=exports.DeviceLevel||(exports.DeviceLevel={})).High="high",v.Medium="medium",v.Low="low",v.Unknown="unknown";var g=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var n=e.prototype;return n.getDeviceInfo=function(){return this.device},n.isIOS=function(){return"iOS"===this.device.platform},n.isAndroid=function(){return"Android"===this.device.platform},n.isHarmony=function(){return"Harmony"===this.device.platform},n.isWindows=function(){return"Windows"===this.device.platform},n.isMacintosh=function(){return"Macintosh"===this.device.platform},n.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},n.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var s,a=u(t);!(s=a()).done;){var l=s.value,d=l.name,c=l.comment;if(null==d?void 0:d.startsWith("Mozilla/")){c&&this.parseData(c);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},n.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},n.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?exports.DeviceLevel.Low:e<16?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?exports.DeviceLevel.Low:i<12?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}return exports.DeviceLevel.High},n.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.getIPhoneModel=function(){var e,n=i.window.screen.width*i.window.devicePixelRatio,t=i.window.screen.height*i.window.devicePixelRatio,o=f.iPhone.find((function(e){return e.width===n&&e.height===t}));return null!=(e=null==o?void 0:o.model)?e:"iPhone"},n.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=u(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var s,a=t[t.length-1].trim(),l=u(f.vender);!(s=l()).done;){var d=s.value;if(a.startsWith(d))return a.substring(d.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var c=t.length;if("wv"===t[c-1].trim())return t[c-2].trim()}},n.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.testIPhone=function(e){return e.includes("iPhone")},n.testIPad=function(e){return e.includes("iPad")},n.testAndroid=function(e){return e.includes("Android")},n.testMacintosh=function(e){return e.includes("Macintosh")},n.testWindows=function(e){return e.includes("Windows")},e}(),w=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:exports.DeviceLevel.High,medium:exports.DeviceLevel.Medium,middle:exports.DeviceLevel.Medium,low:exports.DeviceLevel.Low}[e]||exports.DeviceLevel.Unknown},e}(),y=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=P.wechat[e.model])?t:e.model,h=u(f.iPhone);!(o=h()).done;){var s=o.value;if(s.name===r){e.model=s.model;break}}if("iOS"===this.device.platform){var a=e.model.match(/^(.*?)<(.*?)>$/);a?(this.device.model=a[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=exports.DeviceLevel.Unknown:e.benchmarkLevel<=10?this.device.level=exports.DeviceLevel.Low:e.benchmarkLevel<=20?this.device.level=exports.DeviceLevel.Medium:this.device.level=exports.DeviceLevel.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function i(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=i.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?m.iPhone:m.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?p.iOS:p.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===exports.DeviceLevel.High)return e.spec.RenderLevel.S;if(this.device.level===exports.DeviceLevel.Medium)return e.spec.RenderLevel.A;if(this.device.level===exports.DeviceLevel.Low)return e.spec.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var i=+RegExp.$1;return i<=9?e.spec.RenderLevel.B:i<10?e.spec.RenderLevel.A:e.spec.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?e.spec.RenderLevel.B:this.device.memoryMB<6e3?e.spec.RenderLevel.A:e.spec.RenderLevel.S:this.isIOS?e.spec.RenderLevel.S:e.spec.RenderLevel.B},i}(),S=Symbol("@@_inter_pause"),b=!1;function M(){return e.isIOS()?e.spec.RenderLevel.S:e.spec.RenderLevel.B}function D(i){i.target===document&&(e.logger.info("Auto pause all players with data offloaded."),e.getActivePlayers().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[S]=!0)})))}function x(i){i.target===document&&(e.logger.info("Auto resume all players."),e.getActivePlayers().forEach((function(e){e[S]&&(e.resume(),e[S]=!1)})))}var O=function(i){function n(){var e;return(e=i.call(this)||this).order=1,e}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&r(e,i)}(n,i),n.prototype.onAssetsLoadStart=function(i,n){return(t=function(){var i,t,o;return d(this,(function(r){if(t=null==(i=(n=n||{}).pluginData)?void 0:i.downgrade){if(t.downgrade)throw new Error("Downgraded, reason: "+t.reason)}else e.logger.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=null!=(o=null==t?void 0:t.level)?o:M()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(n,r){var h=t.apply(e,i);function s(e){o(h,n,r,s,a,"next",e)}function a(e){o(h,n,r,s,a,"throw",e)}s(void 0)}))})();var t},n}(l(e.Plugin)),A="2.8.0-alpha.6";e.registerPlugin("downgrade",O),e.logger.info("Plugin downgrade version: "+A+"."),A!==t.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),exports.AlipayMiniprogramParser=w,exports.UADecoder=g,exports.WechatMiniprogramParser=y,exports.getDefaultRenderLevel=M,exports.getDowngradeResult=function(n){void 0===n&&(n={}),b||(!function(n){var t=n.autoPause;i.window.addEventListener("unload",(function(){e.getActivePlayers().forEach((function(e){return e.dispose()}))})),t&&(document.addEventListener("pause",D),document.addEventListener("resume",x))}(n),b=!0);var t,o=n.mockDowngrade;if(void 0!==o)return{downgrade:o,level:null!=(t=n.level)?t:e.spec.RenderLevel.S,reason:"mock"};var r=function(i){var n=i.queryDeviceInMiniApp,t=i.deviceInfo;if(t)return t;if(n){if(e.isAlipayMiniApp()){if(my.canIUse("getSystemInfo")){var o=my.getSystemInfo();return new w(o).getDeviceInfo()}e.logger.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(e.isWechatMiniApp()){if(wx.canIUse("getDeviceInfo")){var r=wx.getDeviceInfo();return new y(r).getDeviceInfo()}e.logger.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else e.logger.error("Non-mini program environment and try to get device info from user agent.")}return(new g).getDeviceInfo()}(n);return new L(n,r).getDowngradeResult()},exports.version=A;
2
2
  //# sourceMappingURL=alipay.js.map
package/dist/alipay.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import*as e from"@galacean/effects/alipay";import{spec as i,getActivePlayers as n,isAlipayMiniApp as t,logger as o,isWechatMiniApp as r,isIOS as h,Plugin as a,registerPlugin as d}from"@galacean/effects/alipay";import{window as s}from"@galacean/appx-adapter/alipay";function l(e,i,n,t,o,r,h){try{var a=e[r](h),d=a.value}catch(e){return void n(e)}a.done?i(d):Promise.resolve(d).then(t,o)}function u(e,i){return u=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},u(e,i)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function v(e,i,n){return v=c()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&u(o,n.prototype),o},v.apply(null,arguments)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(e){var i="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return v(e,arguments,f(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),u(t,e)},m(e)}function P(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=a(0),h.throw=a(1),h.return=a(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function a(a){return function(d){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,a[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,t=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=i.call(e,r)}catch(e){a=[6,e],t=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,d])}}}function p(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function g(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return p(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var w,y={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},S={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},b={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},M={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};!function(e){e.High="high",e.Medium="medium",e.Low="low",e.Unknown="unknown"}(w||(w={}));var O=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.isIOS=function(){return"iOS"===this.device.platform},i.isAndroid=function(){return"Android"===this.device.platform},i.isHarmony=function(){return"Harmony"===this.device.platform},i.isWindows=function(){return"Windows"===this.device.platform},i.isMacintosh=function(){return"Macintosh"===this.device.platform},i.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},i.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var a,d=g(t);!(a=d()).done;){var s=a.value,l=s.name,u=s.comment;if(null==l?void 0:l.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},i.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},i.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?w.Low:e<16?w.Medium:w.High}return w.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?w.Low:i<12?w.Medium:w.High}return w.Low}return w.High},i.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.getIPhoneModel=function(){var e,i=s.screen.width*s.devicePixelRatio,n=s.screen.height*s.devicePixelRatio,t=y.iPhone.find((function(e){return e.width===i&&e.height===n}));return null!=(e=null==t?void 0:t.model)?e:"iPhone"},i.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=g(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var a,d=t[t.length-1].trim(),s=g(y.vender);!(a=s()).done;){var l=a.value;if(d.startsWith(l))return d.substring(l.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var u=t.length;if("wv"===t[u-1].trim())return t[u-2].trim()}},i.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.testIPhone=function(e){return e.includes("iPhone")},i.testIPad=function(e){return e.includes("iPad")},i.testAndroid=function(e){return e.includes("Android")},i.testMacintosh=function(e){return e.includes("Macintosh")},i.testWindows=function(e){return e.includes("Windows")},e}(),I=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:w.High,medium:w.Medium,middle:w.Medium,low:w.Low}[e]||w.Unknown},e}(),A=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=M.wechat[e.model])?t:e.model,h=g(y.iPhone);!(o=h()).done;){var a=o.value;if(a.name===r){e.model=a.model;break}}if("iOS"===this.device.platform){var d=e.model.match(/^(.*?)<(.*?)>$/);d?(this.device.model=d[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=w.Unknown:e.benchmarkLevel<=10?this.device.level=w.Low:e.benchmarkLevel<=20?this.device.level=w.Medium:this.device.level=w.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function e(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=e.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?S.iPhone:S.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?b.iOS:b.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===w.High)return i.RenderLevel.S;if(this.device.level===w.Medium)return i.RenderLevel.A;if(this.device.level===w.Low)return i.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var e=+RegExp.$1;return e<=9?i.RenderLevel.B:e<10?i.RenderLevel.A:i.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?i.RenderLevel.B:this.device.memoryMB<6e3?i.RenderLevel.A:i.RenderLevel.S:this.isIOS?i.RenderLevel.S:i.RenderLevel.B},e}(),D=Symbol("@@_inter_pause"),R=!1;function V(e){void 0===e&&(e={}),R||(!function(e){var i=e.autoPause;s.addEventListener("unload",(function(){n().forEach((function(e){return e.dispose()}))})),i&&(document.addEventListener("pause",E),document.addEventListener("resume",k))}(e),R=!0);var h,a=e.mockDowngrade;if(void 0!==a)return{downgrade:a,level:null!=(h=e.level)?h:i.RenderLevel.S,reason:"mock"};var d=function(e){var i=e.queryDeviceInMiniApp,n=e.deviceInfo;if(n)return n;if(i){if(t()){if(my.canIUse("getSystemInfo")){var h=my.getSystemInfo();return new I(h).getDeviceInfo()}o.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(r()){if(wx.canIUse("getDeviceInfo")){var a=wx.getDeviceInfo();return new A(a).getDeviceInfo()}o.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else o.error("Non-mini program environment and try to get device info from user agent.")}return(new O).getDeviceInfo()}(e);return new L(e,d).getDowngradeResult()}function x(){return h()?i.RenderLevel.S:i.RenderLevel.B}function E(e){e.target===document&&(o.info("Auto pause all players with data offloaded."),n().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[D]=!0)})))}function k(e){e.target===document&&(o.info("Auto resume all players."),n().forEach((function(e){e[D]&&(e.resume(),e[D]=!1)})))}var B=function(e){function i(){var i;return(i=e.call(this)||this).order=1,i}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&u(e,i)}(i,e),i.prototype.onAssetsLoadStart=function(e,i){return(n=function(){var e,n,t;return P(this,(function(r){if(n=null==(e=(i=i||{}).pluginData)?void 0:e.downgrade){if(n.downgrade)throw new Error("Downgraded, reason: "+n.reason)}else o.warn("No downgrade result in pluginData of SceneLoadOptions.");return i.renderLevel||(i.renderLevel=null!=(t=null==n?void 0:n.level)?t:x()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(t,o){var r=n.apply(e,i);function h(e){l(r,t,o,h,a,"next",e)}function a(e){l(r,t,o,h,a,"throw",e)}h(void 0)}))})();var n},i}(m(a)),C="2.8.0-alpha.5";d("downgrade",B),o.info("Plugin downgrade version: "+C+"."),C!==e.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");export{I as AlipayMiniprogramParser,w as DeviceLevel,O as UADecoder,A as WechatMiniprogramParser,x as getDefaultRenderLevel,V as getDowngradeResult,C as version};
1
+ import*as e from"@galacean/effects/alipay";import{spec as i,getActivePlayers as n,isAlipayMiniApp as t,logger as o,isWechatMiniApp as r,isIOS as h,Plugin as a,registerPlugin as d}from"@galacean/effects/alipay";import{window as s}from"@galacean/appx-adapter/alipay";function l(e,i,n,t,o,r,h){try{var a=e[r](h),d=a.value}catch(e){return void n(e)}a.done?i(d):Promise.resolve(d).then(t,o)}function u(e,i){return u=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},u(e,i)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function v(e,i,n){return v=c()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&u(o,n.prototype),o},v.apply(null,arguments)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(e){var i="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return v(e,arguments,f(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),u(t,e)},m(e)}function P(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=a(0),h.throw=a(1),h.return=a(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function a(a){return function(d){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,a[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,t=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=i.call(e,r)}catch(e){a=[6,e],t=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,d])}}}function p(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function g(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return p(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var w,y={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},S={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},b={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},M={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};!function(e){e.High="high",e.Medium="medium",e.Low="low",e.Unknown="unknown"}(w||(w={}));var O=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.isIOS=function(){return"iOS"===this.device.platform},i.isAndroid=function(){return"Android"===this.device.platform},i.isHarmony=function(){return"Harmony"===this.device.platform},i.isWindows=function(){return"Windows"===this.device.platform},i.isMacintosh=function(){return"Macintosh"===this.device.platform},i.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},i.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var a,d=g(t);!(a=d()).done;){var s=a.value,l=s.name,u=s.comment;if(null==l?void 0:l.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},i.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},i.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?w.Low:e<16?w.Medium:w.High}return w.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?w.Low:i<12?w.Medium:w.High}return w.Low}return w.High},i.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.getIPhoneModel=function(){var e,i=s.screen.width*s.devicePixelRatio,n=s.screen.height*s.devicePixelRatio,t=y.iPhone.find((function(e){return e.width===i&&e.height===n}));return null!=(e=null==t?void 0:t.model)?e:"iPhone"},i.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=g(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var a,d=t[t.length-1].trim(),s=g(y.vender);!(a=s()).done;){var l=a.value;if(d.startsWith(l))return d.substring(l.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var u=t.length;if("wv"===t[u-1].trim())return t[u-2].trim()}},i.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.testIPhone=function(e){return e.includes("iPhone")},i.testIPad=function(e){return e.includes("iPad")},i.testAndroid=function(e){return e.includes("Android")},i.testMacintosh=function(e){return e.includes("Macintosh")},i.testWindows=function(e){return e.includes("Windows")},e}(),I=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:w.High,medium:w.Medium,middle:w.Medium,low:w.Low}[e]||w.Unknown},e}(),A=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=M.wechat[e.model])?t:e.model,h=g(y.iPhone);!(o=h()).done;){var a=o.value;if(a.name===r){e.model=a.model;break}}if("iOS"===this.device.platform){var d=e.model.match(/^(.*?)<(.*?)>$/);d?(this.device.model=d[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=w.Unknown:e.benchmarkLevel<=10?this.device.level=w.Low:e.benchmarkLevel<=20?this.device.level=w.Medium:this.device.level=w.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function e(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=e.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?S.iPhone:S.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?b.iOS:b.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===w.High)return i.RenderLevel.S;if(this.device.level===w.Medium)return i.RenderLevel.A;if(this.device.level===w.Low)return i.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var e=+RegExp.$1;return e<=9?i.RenderLevel.B:e<10?i.RenderLevel.A:i.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?i.RenderLevel.B:this.device.memoryMB<6e3?i.RenderLevel.A:i.RenderLevel.S:this.isIOS?i.RenderLevel.S:i.RenderLevel.B},e}(),D=Symbol("@@_inter_pause"),R=!1;function V(e){void 0===e&&(e={}),R||(!function(e){var i=e.autoPause;s.addEventListener("unload",(function(){n().forEach((function(e){return e.dispose()}))})),i&&(document.addEventListener("pause",E),document.addEventListener("resume",k))}(e),R=!0);var h,a=e.mockDowngrade;if(void 0!==a)return{downgrade:a,level:null!=(h=e.level)?h:i.RenderLevel.S,reason:"mock"};var d=function(e){var i=e.queryDeviceInMiniApp,n=e.deviceInfo;if(n)return n;if(i){if(t()){if(my.canIUse("getSystemInfo")){var h=my.getSystemInfo();return new I(h).getDeviceInfo()}o.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(r()){if(wx.canIUse("getDeviceInfo")){var a=wx.getDeviceInfo();return new A(a).getDeviceInfo()}o.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else o.error("Non-mini program environment and try to get device info from user agent.")}return(new O).getDeviceInfo()}(e);return new L(e,d).getDowngradeResult()}function x(){return h()?i.RenderLevel.S:i.RenderLevel.B}function E(e){e.target===document&&(o.info("Auto pause all players with data offloaded."),n().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[D]=!0)})))}function k(e){e.target===document&&(o.info("Auto resume all players."),n().forEach((function(e){e[D]&&(e.resume(),e[D]=!1)})))}var B=function(e){function i(){var i;return(i=e.call(this)||this).order=1,i}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&u(e,i)}(i,e),i.prototype.onAssetsLoadStart=function(e,i){return(n=function(){var e,n,t;return P(this,(function(r){if(n=null==(e=(i=i||{}).pluginData)?void 0:e.downgrade){if(n.downgrade)throw new Error("Downgraded, reason: "+n.reason)}else o.warn("No downgrade result in pluginData of SceneLoadOptions.");return i.renderLevel||(i.renderLevel=null!=(t=null==n?void 0:n.level)?t:x()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(t,o){var r=n.apply(e,i);function h(e){l(r,t,o,h,a,"next",e)}function a(e){l(r,t,o,h,a,"throw",e)}h(void 0)}))})();var n},i}(m(a)),C="2.8.0-alpha.6";d("downgrade",B),o.info("Plugin downgrade version: "+C+"."),C!==e.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");export{I as AlipayMiniprogramParser,w as DeviceLevel,O as UADecoder,A as WechatMiniprogramParser,x as getDefaultRenderLevel,V as getDowngradeResult,C as version};
2
2
  //# sourceMappingURL=alipay.mjs.map
package/dist/douyin.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@galacean/effects/douyin"),i=require("@galacean/appx-adapter/douyin");function n(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}})),i.default=e,Object.freeze(i)}var t=n(e);function o(e,i,n,t,o,r,h){try{var s=e[r](h),a=s.value}catch(e){return void n(e)}s.done?i(a):Promise.resolve(a).then(t,o)}function r(e,i){return r=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},r(e,i)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function s(e,i,n){return s=h()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&r(o,n.prototype),o},s.apply(null,arguments)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function l(e){var i="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return s(e,arguments,a(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),r(t,e)},l(e)}function d(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=s(0),h.throw=s(1),h.return=s(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function s(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,s[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,t=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=i.call(e,r)}catch(e){s=[6,e],t=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function c(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function u(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return c(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var v,f={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},m={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},p={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},P={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};exports.DeviceLevel=void 0,(v=exports.DeviceLevel||(exports.DeviceLevel={})).High="high",v.Medium="medium",v.Low="low",v.Unknown="unknown";var g=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var n=e.prototype;return n.getDeviceInfo=function(){return this.device},n.isIOS=function(){return"iOS"===this.device.platform},n.isAndroid=function(){return"Android"===this.device.platform},n.isHarmony=function(){return"Harmony"===this.device.platform},n.isWindows=function(){return"Windows"===this.device.platform},n.isMacintosh=function(){return"Macintosh"===this.device.platform},n.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},n.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var s,a=u(t);!(s=a()).done;){var l=s.value,d=l.name,c=l.comment;if(null==d?void 0:d.startsWith("Mozilla/")){c&&this.parseData(c);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},n.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},n.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?exports.DeviceLevel.Low:e<16?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?exports.DeviceLevel.Low:i<12?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}return exports.DeviceLevel.High},n.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.getIPhoneModel=function(){var e,n=i.window.screen.width*i.window.devicePixelRatio,t=i.window.screen.height*i.window.devicePixelRatio,o=f.iPhone.find((function(e){return e.width===n&&e.height===t}));return null!=(e=null==o?void 0:o.model)?e:"iPhone"},n.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=u(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var s,a=t[t.length-1].trim(),l=u(f.vender);!(s=l()).done;){var d=s.value;if(a.startsWith(d))return a.substring(d.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var c=t.length;if("wv"===t[c-1].trim())return t[c-2].trim()}},n.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.testIPhone=function(e){return e.includes("iPhone")},n.testIPad=function(e){return e.includes("iPad")},n.testAndroid=function(e){return e.includes("Android")},n.testMacintosh=function(e){return e.includes("Macintosh")},n.testWindows=function(e){return e.includes("Windows")},e}(),w=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:exports.DeviceLevel.High,medium:exports.DeviceLevel.Medium,middle:exports.DeviceLevel.Medium,low:exports.DeviceLevel.Low}[e]||exports.DeviceLevel.Unknown},e}(),y=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=P.wechat[e.model])?t:e.model,h=u(f.iPhone);!(o=h()).done;){var s=o.value;if(s.name===r){e.model=s.model;break}}if("iOS"===this.device.platform){var a=e.model.match(/^(.*?)<(.*?)>$/);a?(this.device.model=a[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=exports.DeviceLevel.Unknown:e.benchmarkLevel<=10?this.device.level=exports.DeviceLevel.Low:e.benchmarkLevel<=20?this.device.level=exports.DeviceLevel.Medium:this.device.level=exports.DeviceLevel.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function i(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=i.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?m.iPhone:m.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?p.iOS:p.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===exports.DeviceLevel.High)return e.spec.RenderLevel.S;if(this.device.level===exports.DeviceLevel.Medium)return e.spec.RenderLevel.A;if(this.device.level===exports.DeviceLevel.Low)return e.spec.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var i=+RegExp.$1;return i<=9?e.spec.RenderLevel.B:i<10?e.spec.RenderLevel.A:e.spec.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?e.spec.RenderLevel.B:this.device.memoryMB<6e3?e.spec.RenderLevel.A:e.spec.RenderLevel.S:this.isIOS?e.spec.RenderLevel.S:e.spec.RenderLevel.B},i}(),S=Symbol("@@_inter_pause"),b=!1;function M(){return e.isIOS()?e.spec.RenderLevel.S:e.spec.RenderLevel.B}function D(i){i.target===document&&(e.logger.info("Auto pause all players with data offloaded."),e.getActivePlayers().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[S]=!0)})))}function x(i){i.target===document&&(e.logger.info("Auto resume all players."),e.getActivePlayers().forEach((function(e){e[S]&&(e.resume(),e[S]=!1)})))}var O=function(i){function n(){var e;return(e=i.call(this)||this).order=1,e}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&r(e,i)}(n,i),n.prototype.onAssetsLoadStart=function(i,n){return(t=function(){var i,t,o;return d(this,(function(r){if(t=null==(i=(n=n||{}).pluginData)?void 0:i.downgrade){if(t.downgrade)throw new Error("Downgraded, reason: "+t.reason)}else e.logger.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=null!=(o=null==t?void 0:t.level)?o:M()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(n,r){var h=t.apply(e,i);function s(e){o(h,n,r,s,a,"next",e)}function a(e){o(h,n,r,s,a,"throw",e)}s(void 0)}))})();var t},n}(l(e.Plugin)),A="2.8.0-alpha.5";e.registerPlugin("downgrade",O),e.logger.info("Plugin downgrade version: "+A+"."),A!==t.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),exports.AlipayMiniprogramParser=w,exports.UADecoder=g,exports.WechatMiniprogramParser=y,exports.getDefaultRenderLevel=M,exports.getDowngradeResult=function(n){void 0===n&&(n={}),b||(!function(n){var t=n.autoPause;i.window.addEventListener("unload",(function(){e.getActivePlayers().forEach((function(e){return e.dispose()}))})),t&&(document.addEventListener("pause",D),document.addEventListener("resume",x))}(n),b=!0);var t,o=n.mockDowngrade;if(void 0!==o)return{downgrade:o,level:null!=(t=n.level)?t:e.spec.RenderLevel.S,reason:"mock"};var r=function(i){var n=i.queryDeviceInMiniApp,t=i.deviceInfo;if(t)return t;if(n){if(e.isAlipayMiniApp()){if(my.canIUse("getSystemInfo")){var o=my.getSystemInfo();return new w(o).getDeviceInfo()}e.logger.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(e.isWechatMiniApp()){if(wx.canIUse("getDeviceInfo")){var r=wx.getDeviceInfo();return new y(r).getDeviceInfo()}e.logger.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else e.logger.error("Non-mini program environment and try to get device info from user agent.")}return(new g).getDeviceInfo()}(n);return new L(n,r).getDowngradeResult()},exports.version=A;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@galacean/effects/douyin"),i=require("@galacean/appx-adapter/douyin");function n(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}})),i.default=e,Object.freeze(i)}var t=n(e);function o(e,i,n,t,o,r,h){try{var s=e[r](h),a=s.value}catch(e){return void n(e)}s.done?i(a):Promise.resolve(a).then(t,o)}function r(e,i){return r=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},r(e,i)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function s(e,i,n){return s=h()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&r(o,n.prototype),o},s.apply(null,arguments)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function l(e){var i="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return s(e,arguments,a(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),r(t,e)},l(e)}function d(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=s(0),h.throw=s(1),h.return=s(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function s(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,s[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,t=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=i.call(e,r)}catch(e){s=[6,e],t=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function c(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function u(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return c(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var v,f={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},m={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},p={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},P={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};exports.DeviceLevel=void 0,(v=exports.DeviceLevel||(exports.DeviceLevel={})).High="high",v.Medium="medium",v.Low="low",v.Unknown="unknown";var g=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var n=e.prototype;return n.getDeviceInfo=function(){return this.device},n.isIOS=function(){return"iOS"===this.device.platform},n.isAndroid=function(){return"Android"===this.device.platform},n.isHarmony=function(){return"Harmony"===this.device.platform},n.isWindows=function(){return"Windows"===this.device.platform},n.isMacintosh=function(){return"Macintosh"===this.device.platform},n.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},n.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var s,a=u(t);!(s=a()).done;){var l=s.value,d=l.name,c=l.comment;if(null==d?void 0:d.startsWith("Mozilla/")){c&&this.parseData(c);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},n.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},n.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?exports.DeviceLevel.Low:e<16?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?exports.DeviceLevel.Low:i<12?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}return exports.DeviceLevel.High},n.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.getIPhoneModel=function(){var e,n=i.window.screen.width*i.window.devicePixelRatio,t=i.window.screen.height*i.window.devicePixelRatio,o=f.iPhone.find((function(e){return e.width===n&&e.height===t}));return null!=(e=null==o?void 0:o.model)?e:"iPhone"},n.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=u(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var s,a=t[t.length-1].trim(),l=u(f.vender);!(s=l()).done;){var d=s.value;if(a.startsWith(d))return a.substring(d.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var c=t.length;if("wv"===t[c-1].trim())return t[c-2].trim()}},n.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.testIPhone=function(e){return e.includes("iPhone")},n.testIPad=function(e){return e.includes("iPad")},n.testAndroid=function(e){return e.includes("Android")},n.testMacintosh=function(e){return e.includes("Macintosh")},n.testWindows=function(e){return e.includes("Windows")},e}(),w=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:exports.DeviceLevel.High,medium:exports.DeviceLevel.Medium,middle:exports.DeviceLevel.Medium,low:exports.DeviceLevel.Low}[e]||exports.DeviceLevel.Unknown},e}(),y=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=P.wechat[e.model])?t:e.model,h=u(f.iPhone);!(o=h()).done;){var s=o.value;if(s.name===r){e.model=s.model;break}}if("iOS"===this.device.platform){var a=e.model.match(/^(.*?)<(.*?)>$/);a?(this.device.model=a[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=exports.DeviceLevel.Unknown:e.benchmarkLevel<=10?this.device.level=exports.DeviceLevel.Low:e.benchmarkLevel<=20?this.device.level=exports.DeviceLevel.Medium:this.device.level=exports.DeviceLevel.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function i(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=i.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?m.iPhone:m.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?p.iOS:p.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===exports.DeviceLevel.High)return e.spec.RenderLevel.S;if(this.device.level===exports.DeviceLevel.Medium)return e.spec.RenderLevel.A;if(this.device.level===exports.DeviceLevel.Low)return e.spec.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var i=+RegExp.$1;return i<=9?e.spec.RenderLevel.B:i<10?e.spec.RenderLevel.A:e.spec.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?e.spec.RenderLevel.B:this.device.memoryMB<6e3?e.spec.RenderLevel.A:e.spec.RenderLevel.S:this.isIOS?e.spec.RenderLevel.S:e.spec.RenderLevel.B},i}(),S=Symbol("@@_inter_pause"),b=!1;function M(){return e.isIOS()?e.spec.RenderLevel.S:e.spec.RenderLevel.B}function D(i){i.target===document&&(e.logger.info("Auto pause all players with data offloaded."),e.getActivePlayers().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[S]=!0)})))}function x(i){i.target===document&&(e.logger.info("Auto resume all players."),e.getActivePlayers().forEach((function(e){e[S]&&(e.resume(),e[S]=!1)})))}var O=function(i){function n(){var e;return(e=i.call(this)||this).order=1,e}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&r(e,i)}(n,i),n.prototype.onAssetsLoadStart=function(i,n){return(t=function(){var i,t,o;return d(this,(function(r){if(t=null==(i=(n=n||{}).pluginData)?void 0:i.downgrade){if(t.downgrade)throw new Error("Downgraded, reason: "+t.reason)}else e.logger.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=null!=(o=null==t?void 0:t.level)?o:M()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(n,r){var h=t.apply(e,i);function s(e){o(h,n,r,s,a,"next",e)}function a(e){o(h,n,r,s,a,"throw",e)}s(void 0)}))})();var t},n}(l(e.Plugin)),A="2.8.0-alpha.6";e.registerPlugin("downgrade",O),e.logger.info("Plugin downgrade version: "+A+"."),A!==t.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),exports.AlipayMiniprogramParser=w,exports.UADecoder=g,exports.WechatMiniprogramParser=y,exports.getDefaultRenderLevel=M,exports.getDowngradeResult=function(n){void 0===n&&(n={}),b||(!function(n){var t=n.autoPause;i.window.addEventListener("unload",(function(){e.getActivePlayers().forEach((function(e){return e.dispose()}))})),t&&(document.addEventListener("pause",D),document.addEventListener("resume",x))}(n),b=!0);var t,o=n.mockDowngrade;if(void 0!==o)return{downgrade:o,level:null!=(t=n.level)?t:e.spec.RenderLevel.S,reason:"mock"};var r=function(i){var n=i.queryDeviceInMiniApp,t=i.deviceInfo;if(t)return t;if(n){if(e.isAlipayMiniApp()){if(my.canIUse("getSystemInfo")){var o=my.getSystemInfo();return new w(o).getDeviceInfo()}e.logger.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(e.isWechatMiniApp()){if(wx.canIUse("getDeviceInfo")){var r=wx.getDeviceInfo();return new y(r).getDeviceInfo()}e.logger.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else e.logger.error("Non-mini program environment and try to get device info from user agent.")}return(new g).getDeviceInfo()}(n);return new L(n,r).getDowngradeResult()},exports.version=A;
2
2
  //# sourceMappingURL=douyin.js.map
package/dist/douyin.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import*as e from"@galacean/effects/douyin";import{spec as i,getActivePlayers as n,isAlipayMiniApp as t,logger as o,isWechatMiniApp as r,isIOS as h,Plugin as a,registerPlugin as d}from"@galacean/effects/douyin";import{window as s}from"@galacean/appx-adapter/douyin";function l(e,i,n,t,o,r,h){try{var a=e[r](h),d=a.value}catch(e){return void n(e)}a.done?i(d):Promise.resolve(d).then(t,o)}function u(e,i){return u=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},u(e,i)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function v(e,i,n){return v=c()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&u(o,n.prototype),o},v.apply(null,arguments)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(e){var i="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return v(e,arguments,f(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),u(t,e)},m(e)}function P(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=a(0),h.throw=a(1),h.return=a(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function a(a){return function(d){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,a[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,t=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=i.call(e,r)}catch(e){a=[6,e],t=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,d])}}}function g(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function p(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return g(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var w,y={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},S={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},b={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},M={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};!function(e){e.High="high",e.Medium="medium",e.Low="low",e.Unknown="unknown"}(w||(w={}));var O=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.isIOS=function(){return"iOS"===this.device.platform},i.isAndroid=function(){return"Android"===this.device.platform},i.isHarmony=function(){return"Harmony"===this.device.platform},i.isWindows=function(){return"Windows"===this.device.platform},i.isMacintosh=function(){return"Macintosh"===this.device.platform},i.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},i.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var a,d=p(t);!(a=d()).done;){var s=a.value,l=s.name,u=s.comment;if(null==l?void 0:l.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},i.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},i.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?w.Low:e<16?w.Medium:w.High}return w.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?w.Low:i<12?w.Medium:w.High}return w.Low}return w.High},i.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.getIPhoneModel=function(){var e,i=s.screen.width*s.devicePixelRatio,n=s.screen.height*s.devicePixelRatio,t=y.iPhone.find((function(e){return e.width===i&&e.height===n}));return null!=(e=null==t?void 0:t.model)?e:"iPhone"},i.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=p(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var a,d=t[t.length-1].trim(),s=p(y.vender);!(a=s()).done;){var l=a.value;if(d.startsWith(l))return d.substring(l.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var u=t.length;if("wv"===t[u-1].trim())return t[u-2].trim()}},i.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.testIPhone=function(e){return e.includes("iPhone")},i.testIPad=function(e){return e.includes("iPad")},i.testAndroid=function(e){return e.includes("Android")},i.testMacintosh=function(e){return e.includes("Macintosh")},i.testWindows=function(e){return e.includes("Windows")},e}(),I=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:w.High,medium:w.Medium,middle:w.Medium,low:w.Low}[e]||w.Unknown},e}(),A=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=M.wechat[e.model])?t:e.model,h=p(y.iPhone);!(o=h()).done;){var a=o.value;if(a.name===r){e.model=a.model;break}}if("iOS"===this.device.platform){var d=e.model.match(/^(.*?)<(.*?)>$/);d?(this.device.model=d[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=w.Unknown:e.benchmarkLevel<=10?this.device.level=w.Low:e.benchmarkLevel<=20?this.device.level=w.Medium:this.device.level=w.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function e(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=e.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?S.iPhone:S.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?b.iOS:b.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===w.High)return i.RenderLevel.S;if(this.device.level===w.Medium)return i.RenderLevel.A;if(this.device.level===w.Low)return i.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var e=+RegExp.$1;return e<=9?i.RenderLevel.B:e<10?i.RenderLevel.A:i.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?i.RenderLevel.B:this.device.memoryMB<6e3?i.RenderLevel.A:i.RenderLevel.S:this.isIOS?i.RenderLevel.S:i.RenderLevel.B},e}(),D=Symbol("@@_inter_pause"),R=!1;function V(e){void 0===e&&(e={}),R||(!function(e){var i=e.autoPause;s.addEventListener("unload",(function(){n().forEach((function(e){return e.dispose()}))})),i&&(document.addEventListener("pause",E),document.addEventListener("resume",k))}(e),R=!0);var h,a=e.mockDowngrade;if(void 0!==a)return{downgrade:a,level:null!=(h=e.level)?h:i.RenderLevel.S,reason:"mock"};var d=function(e){var i=e.queryDeviceInMiniApp,n=e.deviceInfo;if(n)return n;if(i){if(t()){if(my.canIUse("getSystemInfo")){var h=my.getSystemInfo();return new I(h).getDeviceInfo()}o.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(r()){if(wx.canIUse("getDeviceInfo")){var a=wx.getDeviceInfo();return new A(a).getDeviceInfo()}o.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else o.error("Non-mini program environment and try to get device info from user agent.")}return(new O).getDeviceInfo()}(e);return new L(e,d).getDowngradeResult()}function x(){return h()?i.RenderLevel.S:i.RenderLevel.B}function E(e){e.target===document&&(o.info("Auto pause all players with data offloaded."),n().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[D]=!0)})))}function k(e){e.target===document&&(o.info("Auto resume all players."),n().forEach((function(e){e[D]&&(e.resume(),e[D]=!1)})))}var B=function(e){function i(){var i;return(i=e.call(this)||this).order=1,i}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&u(e,i)}(i,e),i.prototype.onAssetsLoadStart=function(e,i){return(n=function(){var e,n,t;return P(this,(function(r){if(n=null==(e=(i=i||{}).pluginData)?void 0:e.downgrade){if(n.downgrade)throw new Error("Downgraded, reason: "+n.reason)}else o.warn("No downgrade result in pluginData of SceneLoadOptions.");return i.renderLevel||(i.renderLevel=null!=(t=null==n?void 0:n.level)?t:x()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(t,o){var r=n.apply(e,i);function h(e){l(r,t,o,h,a,"next",e)}function a(e){l(r,t,o,h,a,"throw",e)}h(void 0)}))})();var n},i}(m(a)),C="2.8.0-alpha.5";d("downgrade",B),o.info("Plugin downgrade version: "+C+"."),C!==e.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");export{I as AlipayMiniprogramParser,w as DeviceLevel,O as UADecoder,A as WechatMiniprogramParser,x as getDefaultRenderLevel,V as getDowngradeResult,C as version};
1
+ import*as e from"@galacean/effects/douyin";import{spec as i,getActivePlayers as n,isAlipayMiniApp as t,logger as o,isWechatMiniApp as r,isIOS as h,Plugin as a,registerPlugin as d}from"@galacean/effects/douyin";import{window as s}from"@galacean/appx-adapter/douyin";function l(e,i,n,t,o,r,h){try{var a=e[r](h),d=a.value}catch(e){return void n(e)}a.done?i(d):Promise.resolve(d).then(t,o)}function u(e,i){return u=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},u(e,i)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function v(e,i,n){return v=c()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&u(o,n.prototype),o},v.apply(null,arguments)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(e){var i="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return v(e,arguments,f(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),u(t,e)},m(e)}function P(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=a(0),h.throw=a(1),h.return=a(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function a(a){return function(d){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,a[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,t=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=i.call(e,r)}catch(e){a=[6,e],t=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,d])}}}function g(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function p(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return g(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var w,y={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},S={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},b={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},M={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};!function(e){e.High="high",e.Medium="medium",e.Low="low",e.Unknown="unknown"}(w||(w={}));var O=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.isIOS=function(){return"iOS"===this.device.platform},i.isAndroid=function(){return"Android"===this.device.platform},i.isHarmony=function(){return"Harmony"===this.device.platform},i.isWindows=function(){return"Windows"===this.device.platform},i.isMacintosh=function(){return"Macintosh"===this.device.platform},i.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},i.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var a,d=p(t);!(a=d()).done;){var s=a.value,l=s.name,u=s.comment;if(null==l?void 0:l.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},i.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},i.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?w.Low:e<16?w.Medium:w.High}return w.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?w.Low:i<12?w.Medium:w.High}return w.Low}return w.High},i.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.getIPhoneModel=function(){var e,i=s.screen.width*s.devicePixelRatio,n=s.screen.height*s.devicePixelRatio,t=y.iPhone.find((function(e){return e.width===i&&e.height===n}));return null!=(e=null==t?void 0:t.model)?e:"iPhone"},i.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=p(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var a,d=t[t.length-1].trim(),s=p(y.vender);!(a=s()).done;){var l=a.value;if(d.startsWith(l))return d.substring(l.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var u=t.length;if("wv"===t[u-1].trim())return t[u-2].trim()}},i.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.testIPhone=function(e){return e.includes("iPhone")},i.testIPad=function(e){return e.includes("iPad")},i.testAndroid=function(e){return e.includes("Android")},i.testMacintosh=function(e){return e.includes("Macintosh")},i.testWindows=function(e){return e.includes("Windows")},e}(),I=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:w.High,medium:w.Medium,middle:w.Medium,low:w.Low}[e]||w.Unknown},e}(),A=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=M.wechat[e.model])?t:e.model,h=p(y.iPhone);!(o=h()).done;){var a=o.value;if(a.name===r){e.model=a.model;break}}if("iOS"===this.device.platform){var d=e.model.match(/^(.*?)<(.*?)>$/);d?(this.device.model=d[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=w.Unknown:e.benchmarkLevel<=10?this.device.level=w.Low:e.benchmarkLevel<=20?this.device.level=w.Medium:this.device.level=w.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function e(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=e.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?S.iPhone:S.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?b.iOS:b.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===w.High)return i.RenderLevel.S;if(this.device.level===w.Medium)return i.RenderLevel.A;if(this.device.level===w.Low)return i.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var e=+RegExp.$1;return e<=9?i.RenderLevel.B:e<10?i.RenderLevel.A:i.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?i.RenderLevel.B:this.device.memoryMB<6e3?i.RenderLevel.A:i.RenderLevel.S:this.isIOS?i.RenderLevel.S:i.RenderLevel.B},e}(),D=Symbol("@@_inter_pause"),R=!1;function V(e){void 0===e&&(e={}),R||(!function(e){var i=e.autoPause;s.addEventListener("unload",(function(){n().forEach((function(e){return e.dispose()}))})),i&&(document.addEventListener("pause",E),document.addEventListener("resume",k))}(e),R=!0);var h,a=e.mockDowngrade;if(void 0!==a)return{downgrade:a,level:null!=(h=e.level)?h:i.RenderLevel.S,reason:"mock"};var d=function(e){var i=e.queryDeviceInMiniApp,n=e.deviceInfo;if(n)return n;if(i){if(t()){if(my.canIUse("getSystemInfo")){var h=my.getSystemInfo();return new I(h).getDeviceInfo()}o.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(r()){if(wx.canIUse("getDeviceInfo")){var a=wx.getDeviceInfo();return new A(a).getDeviceInfo()}o.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else o.error("Non-mini program environment and try to get device info from user agent.")}return(new O).getDeviceInfo()}(e);return new L(e,d).getDowngradeResult()}function x(){return h()?i.RenderLevel.S:i.RenderLevel.B}function E(e){e.target===document&&(o.info("Auto pause all players with data offloaded."),n().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[D]=!0)})))}function k(e){e.target===document&&(o.info("Auto resume all players."),n().forEach((function(e){e[D]&&(e.resume(),e[D]=!1)})))}var B=function(e){function i(){var i;return(i=e.call(this)||this).order=1,i}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&u(e,i)}(i,e),i.prototype.onAssetsLoadStart=function(e,i){return(n=function(){var e,n,t;return P(this,(function(r){if(n=null==(e=(i=i||{}).pluginData)?void 0:e.downgrade){if(n.downgrade)throw new Error("Downgraded, reason: "+n.reason)}else o.warn("No downgrade result in pluginData of SceneLoadOptions.");return i.renderLevel||(i.renderLevel=null!=(t=null==n?void 0:n.level)?t:x()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(t,o){var r=n.apply(e,i);function h(e){l(r,t,o,h,a,"next",e)}function a(e){l(r,t,o,h,a,"throw",e)}h(void 0)}))})();var n},i}(m(a)),C="2.8.0-alpha.6";d("downgrade",B),o.info("Plugin downgrade version: "+C+"."),C!==e.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");export{I as AlipayMiniprogramParser,w as DeviceLevel,O as UADecoder,A as WechatMiniprogramParser,x as getDefaultRenderLevel,V as getDowngradeResult,C as version};
2
2
  //# sourceMappingURL=douyin.mjs.map
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player downgrade plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 飂兮
6
- * Version: v2.8.0-alpha.5
6
+ * Version: v2.8.0-alpha.6
7
7
  */
8
8
 
9
9
  'use strict';
@@ -1216,7 +1216,7 @@ function resumePausedPlayers(e) {
1216
1216
 
1217
1217
  /**
1218
1218
  * 插件版本号
1219
- */ var version = "2.8.0-alpha.5";
1219
+ */ var version = "2.8.0-alpha.6";
1220
1220
  EFFECTS.registerPlugin("downgrade", DowngradePlugin);
1221
1221
  EFFECTS.logger.info("Plugin downgrade version: " + version + ".");
1222
1222
  if (version !== EFFECTS__namespace.version) {
package/dist/index.min.js CHANGED
@@ -3,6 +3,6 @@
3
3
  * Description: Galacean Effects player downgrade plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 飂兮
6
- * Version: v2.8.0-alpha.5
7
- */function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],i):i(((e="undefined"!=typeof globalThis?globalThis:e||self).ge=e.ge||{},e.ge.downgradePlugin={}),e.ge)}(this,function(e,i){"use strict";var n,t=function(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}}),i.default=e,Object.freeze(i)}(i);function o(e,i,n,t,o,r,h){try{var s=e[r](h),d=s.value}catch(e){n(e);return}s.done?i(d):Promise.resolve(d).then(t,o)}function r(e,i){return(r=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e})(e,i)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function s(e,i,n){return(s=h()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&r(o,n.prototype),o}).apply(null,arguments)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e){var i="function"==typeof Map?new Map:void 0;return(l=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,n)}function n(){return s(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r(n,e)})(e)}function a(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=Array(i);n<i;n++)t[n]=e[n];return t}function c(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return a(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,void 0)}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var u={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},v={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},f={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},m={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};e.DeviceLevel=void 0,(n=e.DeviceLevel||(e.DeviceLevel={})).High="high",n.Medium="medium",n.Low="low",n.Unknown="unknown";var g=function(){function i(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var n=i.prototype;return n.getDeviceInfo=function(){return this.device},n.isIOS=function(){return"iOS"===this.device.platform},n.isAndroid=function(){return"Android"===this.device.platform},n.isHarmony=function(){return"Harmony"===this.device.platform},n.isWindows=function(){return"Windows"===this.device.platform},n.isMacintosh=function(){return"Macintosh"===this.device.platform},n.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},n.parse=function(e){for(var i=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,n=[];null!==(t=i.exec(e));){var t,o,r=t[1],h=null==(o=t[2])?void 0:o.trim();n.push({name:r,comment:h})}for(var s,d=c(n);!(s=d()).done;){var l=s.value,a=l.name,u=l.comment;if(null==a?void 0:a.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},n.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},n.estimateDeviceLevel=function(){if(this.isIOS()){if(!this.device.osVersion)return e.DeviceLevel.Low;var i=parseInt(this.device.osVersion.split(".")[0]);return i<12?e.DeviceLevel.Low:i<16?e.DeviceLevel.Medium:e.DeviceLevel.High}if(this.isAndroid()){if(!this.device.osVersion)return e.DeviceLevel.Low;var n=parseInt(this.device.osVersion.split(".")[0]);if(n<10)return e.DeviceLevel.Low;if(n<12)return e.DeviceLevel.Medium}return e.DeviceLevel.High},n.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.getIPhoneModel=function(){var e,i=window.screen.width*window.devicePixelRatio,n=window.screen.height*window.devicePixelRatio,t=u.iPhone.find(function(e){return e.width===i&&e.height===n});return null!=(e=null==t?void 0:t.model)?e:"iPhone"},n.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=c(t);!(n=o()).done;){var r=n.value,h=/(.+?) Build/,s=r.match(h);if(s&&s.length>=2)return s[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var d,l=t[t.length-1].trim(),a=c(u.vender);!(d=a()).done;){var v=d.value;if(l.startsWith(v))return l.substring(v.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var f=t.length;if("wv"===t[f-1].trim())return t[f-2].trim()}},n.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.testIPhone=function(e){return e.includes("iPhone")},n.testIPad=function(e){return e.includes("iPad")},n.testAndroid=function(e){return e.includes("Android")},n.testMacintosh=function(e){return e.includes("Macintosh")},n.testWindows=function(e){return e.includes("Windows")},i}(),P=function(){function i(e){this.device={},this.parse(e)}var n=i.prototype;return n.getDeviceInfo=function(){return this.device},n.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},n.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find(function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())});if(i)return null==e?void 0:e.substring(i.length).trim()}return e},n.getDeviceLevel=function(i){return void 0===i&&(i=""),({high:e.DeviceLevel.High,medium:e.DeviceLevel.Medium,middle:e.DeviceLevel.Medium,low:e.DeviceLevel.Low})[i]||e.DeviceLevel.Unknown},i}(),p=function(){function i(e){this.device={},this.parse(e)}var n=i.prototype;return n.getDeviceInfo=function(){return this.device},n.parse=function(i){var n=i.system.match(/\w+/);n&&(this.device.platform=n[0].trim());var t=i.system.match(/[\d.]+/);if(t&&(this.device.osVersion=t[0].trim()),"devtools"===i.platform)for(var o,r,h=null!=(o=m.wechat[i.model])?o:i.model,s=c(u.iPhone);!(r=s()).done;){var d=r.value;if(d.name===h){i.model=d.model;break}}if("iOS"===this.device.platform){var l=i.model.match(/^(.*?)<(.*?)>$/);l?(this.device.model=l[2].trim(),this.device.originalModel=i.model):this.device.model=i.model}else this.device.model=i.model;i.benchmarkLevel<=0?this.device.level=e.DeviceLevel.Unknown:i.benchmarkLevel<=10?this.device.level=e.DeviceLevel.Low:i.benchmarkLevel<=20?this.device.level=e.DeviceLevel.Medium:this.device.level=e.DeviceLevel.High,this.device.memoryMB=i.memorySize,this.device.sourceData=i},i}(),w=function(){function n(e,i){this.options=e,this.device=i,this.isIOS=!1}var t=n.prototype;return t.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?v.iPhone:v.android).find(function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)}))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?f.iOS:f.android).find(function(i){return i===e.device.osVersion})?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},t.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===e.DeviceLevel.High)return i.spec.RenderLevel.S;if(this.device.level===e.DeviceLevel.Medium)return i.spec.RenderLevel.A;if(this.device.level===e.DeviceLevel.Low)return i.spec.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var n=+RegExp.$1;return n<=9?i.spec.RenderLevel.B:n<10?i.spec.RenderLevel.A:i.spec.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?i.spec.RenderLevel.B:this.device.memoryMB<6e3?i.spec.RenderLevel.A:i.spec.RenderLevel.S:this.isIOS?i.spec.RenderLevel.S:i.spec.RenderLevel.B},n}(),y=Symbol("@@_inter_pause"),b=!1;function L(){return i.isIOS()?i.spec.RenderLevel.S:i.spec.RenderLevel.B}function S(e){e.target===document&&(i.logger.info("Auto pause all players with data offloaded."),i.getActivePlayers().forEach(function(e){e.paused||(e.pause({offloadTexture:!0}),e[y]=!0)}))}function M(e){e.target===document&&(i.logger.info("Auto resume all players."),i.getActivePlayers().forEach(function(e){e[y]&&(e.resume(),e[y]=!1)}))}var D=function(e){function n(){var i;return(i=e.call(this)||this).order=1,i}return!function(e,i){if("function"!=typeof i&&null!==i)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&r(e,i)}(n,e),n.prototype.onAssetsLoadStart=function(e,n){var t;return(t=function(){var e,t,o;return function(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=s(0),h.throw=s(1),h.return=s(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function s(s){return function(d){return function(s){if(n)throw TypeError("Generator is already executing.");for(;h&&(h=0,s[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,t=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=(o=r.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=i.call(e,r)}catch(e){s=[6,e],t=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,d])}}}(this,function(r){if(t=null==(e=(n=n||{}).pluginData)?void 0:e.downgrade){if(t.downgrade)throw Error("Downgraded, reason: "+t.reason)}else i.logger.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=null!=(o=null==t?void 0:t.level)?o:L()),[2]})},function(){var e=this,i=arguments;return new Promise(function(n,r){var h=t.apply(e,i);function s(e){o(h,n,r,s,d,"next",e)}function d(e){o(h,n,r,s,d,"throw",e)}s(void 0)})})()},n}(l(i.Plugin)),O="2.8.0-alpha.5";i.registerPlugin("downgrade",D),i.logger.info("Plugin downgrade version: "+O+"."),O!==t.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),e.AlipayMiniprogramParser=P,e.UADecoder=g,e.WechatMiniprogramParser=p,e.getDefaultRenderLevel=L,e.getDowngradeResult=function(e){void 0===e&&(e={}),b||(n=e.autoPause,window.addEventListener("unload",function(){i.getActivePlayers().forEach(function(e){return e.dispose()})}),n&&(document.addEventListener("pause",S),document.addEventListener("resume",M)),b=!0);var n,t,o=e.mockDowngrade;if(void 0!==o)return{downgrade:o,level:null!=(t=e.level)?t:i.spec.RenderLevel.S,reason:"mock"};var r=function(e){var n=e.queryDeviceInMiniApp,t=e.deviceInfo;if(t)return t;if(n){if(i.isAlipayMiniApp()){if(my.canIUse("getSystemInfo"))return new P(my.getSystemInfo()).getDeviceInfo();i.logger.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(i.isWechatMiniApp()){if(wx.canIUse("getDeviceInfo"))return new p(wx.getDeviceInfo()).getDeviceInfo();i.logger.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else i.logger.error("Non-mini program environment and try to get device info from user agent.")}return new g().getDeviceInfo()}(e);return new w(e,r).getDowngradeResult()},e.version=O,Object.defineProperty(e,"__esModule",{value:!0})});
6
+ * Version: v2.8.0-alpha.6
7
+ */function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],i):i(((e="undefined"!=typeof globalThis?globalThis:e||self).ge=e.ge||{},e.ge.downgradePlugin={}),e.ge)}(this,function(e,i){"use strict";var n,t=function(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}}),i.default=e,Object.freeze(i)}(i);function o(e,i,n,t,o,r,h){try{var s=e[r](h),d=s.value}catch(e){n(e);return}s.done?i(d):Promise.resolve(d).then(t,o)}function r(e,i){return(r=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e})(e,i)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function s(e,i,n){return(s=h()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&r(o,n.prototype),o}).apply(null,arguments)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e){var i="function"==typeof Map?new Map:void 0;return(l=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,n)}function n(){return s(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r(n,e)})(e)}function a(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=Array(i);n<i;n++)t[n]=e[n];return t}function c(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return a(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,void 0)}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var u={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},v={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},f={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},m={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};e.DeviceLevel=void 0,(n=e.DeviceLevel||(e.DeviceLevel={})).High="high",n.Medium="medium",n.Low="low",n.Unknown="unknown";var g=function(){function i(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var n=i.prototype;return n.getDeviceInfo=function(){return this.device},n.isIOS=function(){return"iOS"===this.device.platform},n.isAndroid=function(){return"Android"===this.device.platform},n.isHarmony=function(){return"Harmony"===this.device.platform},n.isWindows=function(){return"Windows"===this.device.platform},n.isMacintosh=function(){return"Macintosh"===this.device.platform},n.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},n.parse=function(e){for(var i=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,n=[];null!==(t=i.exec(e));){var t,o,r=t[1],h=null==(o=t[2])?void 0:o.trim();n.push({name:r,comment:h})}for(var s,d=c(n);!(s=d()).done;){var l=s.value,a=l.name,u=l.comment;if(null==a?void 0:a.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},n.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},n.estimateDeviceLevel=function(){if(this.isIOS()){if(!this.device.osVersion)return e.DeviceLevel.Low;var i=parseInt(this.device.osVersion.split(".")[0]);return i<12?e.DeviceLevel.Low:i<16?e.DeviceLevel.Medium:e.DeviceLevel.High}if(this.isAndroid()){if(!this.device.osVersion)return e.DeviceLevel.Low;var n=parseInt(this.device.osVersion.split(".")[0]);if(n<10)return e.DeviceLevel.Low;if(n<12)return e.DeviceLevel.Medium}return e.DeviceLevel.High},n.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.getIPhoneModel=function(){var e,i=window.screen.width*window.devicePixelRatio,n=window.screen.height*window.devicePixelRatio,t=u.iPhone.find(function(e){return e.width===i&&e.height===n});return null!=(e=null==t?void 0:t.model)?e:"iPhone"},n.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=c(t);!(n=o()).done;){var r=n.value,h=/(.+?) Build/,s=r.match(h);if(s&&s.length>=2)return s[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var d,l=t[t.length-1].trim(),a=c(u.vender);!(d=a()).done;){var v=d.value;if(l.startsWith(v))return l.substring(v.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var f=t.length;if("wv"===t[f-1].trim())return t[f-2].trim()}},n.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.testIPhone=function(e){return e.includes("iPhone")},n.testIPad=function(e){return e.includes("iPad")},n.testAndroid=function(e){return e.includes("Android")},n.testMacintosh=function(e){return e.includes("Macintosh")},n.testWindows=function(e){return e.includes("Windows")},i}(),P=function(){function i(e){this.device={},this.parse(e)}var n=i.prototype;return n.getDeviceInfo=function(){return this.device},n.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},n.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find(function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())});if(i)return null==e?void 0:e.substring(i.length).trim()}return e},n.getDeviceLevel=function(i){return void 0===i&&(i=""),({high:e.DeviceLevel.High,medium:e.DeviceLevel.Medium,middle:e.DeviceLevel.Medium,low:e.DeviceLevel.Low})[i]||e.DeviceLevel.Unknown},i}(),p=function(){function i(e){this.device={},this.parse(e)}var n=i.prototype;return n.getDeviceInfo=function(){return this.device},n.parse=function(i){var n=i.system.match(/\w+/);n&&(this.device.platform=n[0].trim());var t=i.system.match(/[\d.]+/);if(t&&(this.device.osVersion=t[0].trim()),"devtools"===i.platform)for(var o,r,h=null!=(o=m.wechat[i.model])?o:i.model,s=c(u.iPhone);!(r=s()).done;){var d=r.value;if(d.name===h){i.model=d.model;break}}if("iOS"===this.device.platform){var l=i.model.match(/^(.*?)<(.*?)>$/);l?(this.device.model=l[2].trim(),this.device.originalModel=i.model):this.device.model=i.model}else this.device.model=i.model;i.benchmarkLevel<=0?this.device.level=e.DeviceLevel.Unknown:i.benchmarkLevel<=10?this.device.level=e.DeviceLevel.Low:i.benchmarkLevel<=20?this.device.level=e.DeviceLevel.Medium:this.device.level=e.DeviceLevel.High,this.device.memoryMB=i.memorySize,this.device.sourceData=i},i}(),w=function(){function n(e,i){this.options=e,this.device=i,this.isIOS=!1}var t=n.prototype;return t.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?v.iPhone:v.android).find(function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)}))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?f.iOS:f.android).find(function(i){return i===e.device.osVersion})?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},t.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===e.DeviceLevel.High)return i.spec.RenderLevel.S;if(this.device.level===e.DeviceLevel.Medium)return i.spec.RenderLevel.A;if(this.device.level===e.DeviceLevel.Low)return i.spec.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var n=+RegExp.$1;return n<=9?i.spec.RenderLevel.B:n<10?i.spec.RenderLevel.A:i.spec.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?i.spec.RenderLevel.B:this.device.memoryMB<6e3?i.spec.RenderLevel.A:i.spec.RenderLevel.S:this.isIOS?i.spec.RenderLevel.S:i.spec.RenderLevel.B},n}(),y=Symbol("@@_inter_pause"),b=!1;function L(){return i.isIOS()?i.spec.RenderLevel.S:i.spec.RenderLevel.B}function S(e){e.target===document&&(i.logger.info("Auto pause all players with data offloaded."),i.getActivePlayers().forEach(function(e){e.paused||(e.pause({offloadTexture:!0}),e[y]=!0)}))}function M(e){e.target===document&&(i.logger.info("Auto resume all players."),i.getActivePlayers().forEach(function(e){e[y]&&(e.resume(),e[y]=!1)}))}var D=function(e){function n(){var i;return(i=e.call(this)||this).order=1,i}return!function(e,i){if("function"!=typeof i&&null!==i)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&r(e,i)}(n,e),n.prototype.onAssetsLoadStart=function(e,n){var t;return(t=function(){var e,t,o;return function(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=s(0),h.throw=s(1),h.return=s(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function s(s){return function(d){return function(s){if(n)throw TypeError("Generator is already executing.");for(;h&&(h=0,s[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,t=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=(o=r.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=i.call(e,r)}catch(e){s=[6,e],t=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,d])}}}(this,function(r){if(t=null==(e=(n=n||{}).pluginData)?void 0:e.downgrade){if(t.downgrade)throw Error("Downgraded, reason: "+t.reason)}else i.logger.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=null!=(o=null==t?void 0:t.level)?o:L()),[2]})},function(){var e=this,i=arguments;return new Promise(function(n,r){var h=t.apply(e,i);function s(e){o(h,n,r,s,d,"next",e)}function d(e){o(h,n,r,s,d,"throw",e)}s(void 0)})})()},n}(l(i.Plugin)),O="2.8.0-alpha.6";i.registerPlugin("downgrade",D),i.logger.info("Plugin downgrade version: "+O+"."),O!==t.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),e.AlipayMiniprogramParser=P,e.UADecoder=g,e.WechatMiniprogramParser=p,e.getDefaultRenderLevel=L,e.getDowngradeResult=function(e){void 0===e&&(e={}),b||(n=e.autoPause,window.addEventListener("unload",function(){i.getActivePlayers().forEach(function(e){return e.dispose()})}),n&&(document.addEventListener("pause",S),document.addEventListener("resume",M)),b=!0);var n,t,o=e.mockDowngrade;if(void 0!==o)return{downgrade:o,level:null!=(t=e.level)?t:i.spec.RenderLevel.S,reason:"mock"};var r=function(e){var n=e.queryDeviceInMiniApp,t=e.deviceInfo;if(t)return t;if(n){if(i.isAlipayMiniApp()){if(my.canIUse("getSystemInfo"))return new P(my.getSystemInfo()).getDeviceInfo();i.logger.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(i.isWechatMiniApp()){if(wx.canIUse("getDeviceInfo"))return new p(wx.getDeviceInfo()).getDeviceInfo();i.logger.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else i.logger.error("Non-mini program environment and try to get device info from user agent.")}return new g().getDeviceInfo()}(e);return new w(e,r).getDowngradeResult()},e.version=O,Object.defineProperty(e,"__esModule",{value:!0})});
8
8
  //# sourceMappingURL=index.min.js.map
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player downgrade plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 飂兮
6
- * Version: v2.8.0-alpha.5
6
+ * Version: v2.8.0-alpha.6
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -1193,7 +1193,7 @@ function resumePausedPlayers(e) {
1193
1193
 
1194
1194
  /**
1195
1195
  * 插件版本号
1196
- */ var version = "2.8.0-alpha.5";
1196
+ */ var version = "2.8.0-alpha.6";
1197
1197
  registerPlugin("downgrade", DowngradePlugin);
1198
1198
  logger.info("Plugin downgrade version: " + version + ".");
1199
1199
  if (version !== EFFECTS.version) {
package/dist/weapp.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@galacean/effects/weapp"),i=require("@galacean/appx-adapter/weapp");function n(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}})),i.default=e,Object.freeze(i)}var t=n(e);function o(e,i,n,t,o,r,h){try{var s=e[r](h),a=s.value}catch(e){return void n(e)}s.done?i(a):Promise.resolve(a).then(t,o)}function r(e,i){return r=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},r(e,i)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function s(e,i,n){return s=h()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&r(o,n.prototype),o},s.apply(null,arguments)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function l(e){var i="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return s(e,arguments,a(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),r(t,e)},l(e)}function d(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=s(0),h.throw=s(1),h.return=s(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function s(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,s[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,t=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=i.call(e,r)}catch(e){s=[6,e],t=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function c(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function u(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return c(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var v,f={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},m={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},p={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},P={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};exports.DeviceLevel=void 0,(v=exports.DeviceLevel||(exports.DeviceLevel={})).High="high",v.Medium="medium",v.Low="low",v.Unknown="unknown";var g=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var n=e.prototype;return n.getDeviceInfo=function(){return this.device},n.isIOS=function(){return"iOS"===this.device.platform},n.isAndroid=function(){return"Android"===this.device.platform},n.isHarmony=function(){return"Harmony"===this.device.platform},n.isWindows=function(){return"Windows"===this.device.platform},n.isMacintosh=function(){return"Macintosh"===this.device.platform},n.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},n.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var s,a=u(t);!(s=a()).done;){var l=s.value,d=l.name,c=l.comment;if(null==d?void 0:d.startsWith("Mozilla/")){c&&this.parseData(c);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},n.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},n.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?exports.DeviceLevel.Low:e<16?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?exports.DeviceLevel.Low:i<12?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}return exports.DeviceLevel.High},n.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.getIPhoneModel=function(){var e,n=i.window.screen.width*i.window.devicePixelRatio,t=i.window.screen.height*i.window.devicePixelRatio,o=f.iPhone.find((function(e){return e.width===n&&e.height===t}));return null!=(e=null==o?void 0:o.model)?e:"iPhone"},n.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=u(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var s,a=t[t.length-1].trim(),l=u(f.vender);!(s=l()).done;){var d=s.value;if(a.startsWith(d))return a.substring(d.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var c=t.length;if("wv"===t[c-1].trim())return t[c-2].trim()}},n.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.testIPhone=function(e){return e.includes("iPhone")},n.testIPad=function(e){return e.includes("iPad")},n.testAndroid=function(e){return e.includes("Android")},n.testMacintosh=function(e){return e.includes("Macintosh")},n.testWindows=function(e){return e.includes("Windows")},e}(),w=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:exports.DeviceLevel.High,medium:exports.DeviceLevel.Medium,middle:exports.DeviceLevel.Medium,low:exports.DeviceLevel.Low}[e]||exports.DeviceLevel.Unknown},e}(),y=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=P.wechat[e.model])?t:e.model,h=u(f.iPhone);!(o=h()).done;){var s=o.value;if(s.name===r){e.model=s.model;break}}if("iOS"===this.device.platform){var a=e.model.match(/^(.*?)<(.*?)>$/);a?(this.device.model=a[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=exports.DeviceLevel.Unknown:e.benchmarkLevel<=10?this.device.level=exports.DeviceLevel.Low:e.benchmarkLevel<=20?this.device.level=exports.DeviceLevel.Medium:this.device.level=exports.DeviceLevel.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function i(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=i.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?m.iPhone:m.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?p.iOS:p.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===exports.DeviceLevel.High)return e.spec.RenderLevel.S;if(this.device.level===exports.DeviceLevel.Medium)return e.spec.RenderLevel.A;if(this.device.level===exports.DeviceLevel.Low)return e.spec.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var i=+RegExp.$1;return i<=9?e.spec.RenderLevel.B:i<10?e.spec.RenderLevel.A:e.spec.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?e.spec.RenderLevel.B:this.device.memoryMB<6e3?e.spec.RenderLevel.A:e.spec.RenderLevel.S:this.isIOS?e.spec.RenderLevel.S:e.spec.RenderLevel.B},i}(),S=Symbol("@@_inter_pause"),b=!1;function M(){return e.isIOS()?e.spec.RenderLevel.S:e.spec.RenderLevel.B}function D(i){i.target===document&&(e.logger.info("Auto pause all players with data offloaded."),e.getActivePlayers().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[S]=!0)})))}function x(i){i.target===document&&(e.logger.info("Auto resume all players."),e.getActivePlayers().forEach((function(e){e[S]&&(e.resume(),e[S]=!1)})))}var O=function(i){function n(){var e;return(e=i.call(this)||this).order=1,e}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&r(e,i)}(n,i),n.prototype.onAssetsLoadStart=function(i,n){return(t=function(){var i,t,o;return d(this,(function(r){if(t=null==(i=(n=n||{}).pluginData)?void 0:i.downgrade){if(t.downgrade)throw new Error("Downgraded, reason: "+t.reason)}else e.logger.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=null!=(o=null==t?void 0:t.level)?o:M()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(n,r){var h=t.apply(e,i);function s(e){o(h,n,r,s,a,"next",e)}function a(e){o(h,n,r,s,a,"throw",e)}s(void 0)}))})();var t},n}(l(e.Plugin)),A="2.8.0-alpha.5";e.registerPlugin("downgrade",O),e.logger.info("Plugin downgrade version: "+A+"."),A!==t.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),exports.AlipayMiniprogramParser=w,exports.UADecoder=g,exports.WechatMiniprogramParser=y,exports.getDefaultRenderLevel=M,exports.getDowngradeResult=function(n){void 0===n&&(n={}),b||(!function(n){var t=n.autoPause;i.window.addEventListener("unload",(function(){e.getActivePlayers().forEach((function(e){return e.dispose()}))})),t&&(document.addEventListener("pause",D),document.addEventListener("resume",x))}(n),b=!0);var t,o=n.mockDowngrade;if(void 0!==o)return{downgrade:o,level:null!=(t=n.level)?t:e.spec.RenderLevel.S,reason:"mock"};var r=function(i){var n=i.queryDeviceInMiniApp,t=i.deviceInfo;if(t)return t;if(n){if(e.isAlipayMiniApp()){if(my.canIUse("getSystemInfo")){var o=my.getSystemInfo();return new w(o).getDeviceInfo()}e.logger.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(e.isWechatMiniApp()){if(wx.canIUse("getDeviceInfo")){var r=wx.getDeviceInfo();return new y(r).getDeviceInfo()}e.logger.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else e.logger.error("Non-mini program environment and try to get device info from user agent.")}return(new g).getDeviceInfo()}(n);return new L(n,r).getDowngradeResult()},exports.version=A;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@galacean/effects/weapp"),i=require("@galacean/appx-adapter/weapp");function n(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}})),i.default=e,Object.freeze(i)}var t=n(e);function o(e,i,n,t,o,r,h){try{var s=e[r](h),a=s.value}catch(e){return void n(e)}s.done?i(a):Promise.resolve(a).then(t,o)}function r(e,i){return r=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},r(e,i)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function s(e,i,n){return s=h()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&r(o,n.prototype),o},s.apply(null,arguments)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function l(e){var i="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return s(e,arguments,a(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),r(t,e)},l(e)}function d(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=s(0),h.throw=s(1),h.return=s(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function s(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,s[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,t=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=i.call(e,r)}catch(e){s=[6,e],t=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function c(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function u(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return c(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var v,f={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},m={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},p={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},P={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};exports.DeviceLevel=void 0,(v=exports.DeviceLevel||(exports.DeviceLevel={})).High="high",v.Medium="medium",v.Low="low",v.Unknown="unknown";var g=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var n=e.prototype;return n.getDeviceInfo=function(){return this.device},n.isIOS=function(){return"iOS"===this.device.platform},n.isAndroid=function(){return"Android"===this.device.platform},n.isHarmony=function(){return"Harmony"===this.device.platform},n.isWindows=function(){return"Windows"===this.device.platform},n.isMacintosh=function(){return"Macintosh"===this.device.platform},n.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},n.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var s,a=u(t);!(s=a()).done;){var l=s.value,d=l.name,c=l.comment;if(null==d?void 0:d.startsWith("Mozilla/")){c&&this.parseData(c);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},n.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},n.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?exports.DeviceLevel.Low:e<16?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?exports.DeviceLevel.Low:i<12?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}return exports.DeviceLevel.High},n.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.getIPhoneModel=function(){var e,n=i.window.screen.width*i.window.devicePixelRatio,t=i.window.screen.height*i.window.devicePixelRatio,o=f.iPhone.find((function(e){return e.width===n&&e.height===t}));return null!=(e=null==o?void 0:o.model)?e:"iPhone"},n.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=u(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var s,a=t[t.length-1].trim(),l=u(f.vender);!(s=l()).done;){var d=s.value;if(a.startsWith(d))return a.substring(d.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var c=t.length;if("wv"===t[c-1].trim())return t[c-2].trim()}},n.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.testIPhone=function(e){return e.includes("iPhone")},n.testIPad=function(e){return e.includes("iPad")},n.testAndroid=function(e){return e.includes("Android")},n.testMacintosh=function(e){return e.includes("Macintosh")},n.testWindows=function(e){return e.includes("Windows")},e}(),w=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:exports.DeviceLevel.High,medium:exports.DeviceLevel.Medium,middle:exports.DeviceLevel.Medium,low:exports.DeviceLevel.Low}[e]||exports.DeviceLevel.Unknown},e}(),y=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=P.wechat[e.model])?t:e.model,h=u(f.iPhone);!(o=h()).done;){var s=o.value;if(s.name===r){e.model=s.model;break}}if("iOS"===this.device.platform){var a=e.model.match(/^(.*?)<(.*?)>$/);a?(this.device.model=a[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=exports.DeviceLevel.Unknown:e.benchmarkLevel<=10?this.device.level=exports.DeviceLevel.Low:e.benchmarkLevel<=20?this.device.level=exports.DeviceLevel.Medium:this.device.level=exports.DeviceLevel.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function i(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=i.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?m.iPhone:m.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?p.iOS:p.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===exports.DeviceLevel.High)return e.spec.RenderLevel.S;if(this.device.level===exports.DeviceLevel.Medium)return e.spec.RenderLevel.A;if(this.device.level===exports.DeviceLevel.Low)return e.spec.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var i=+RegExp.$1;return i<=9?e.spec.RenderLevel.B:i<10?e.spec.RenderLevel.A:e.spec.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?e.spec.RenderLevel.B:this.device.memoryMB<6e3?e.spec.RenderLevel.A:e.spec.RenderLevel.S:this.isIOS?e.spec.RenderLevel.S:e.spec.RenderLevel.B},i}(),S=Symbol("@@_inter_pause"),b=!1;function M(){return e.isIOS()?e.spec.RenderLevel.S:e.spec.RenderLevel.B}function D(i){i.target===document&&(e.logger.info("Auto pause all players with data offloaded."),e.getActivePlayers().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[S]=!0)})))}function x(i){i.target===document&&(e.logger.info("Auto resume all players."),e.getActivePlayers().forEach((function(e){e[S]&&(e.resume(),e[S]=!1)})))}var O=function(i){function n(){var e;return(e=i.call(this)||this).order=1,e}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&r(e,i)}(n,i),n.prototype.onAssetsLoadStart=function(i,n){return(t=function(){var i,t,o;return d(this,(function(r){if(t=null==(i=(n=n||{}).pluginData)?void 0:i.downgrade){if(t.downgrade)throw new Error("Downgraded, reason: "+t.reason)}else e.logger.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=null!=(o=null==t?void 0:t.level)?o:M()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(n,r){var h=t.apply(e,i);function s(e){o(h,n,r,s,a,"next",e)}function a(e){o(h,n,r,s,a,"throw",e)}s(void 0)}))})();var t},n}(l(e.Plugin)),A="2.8.0-alpha.6";e.registerPlugin("downgrade",O),e.logger.info("Plugin downgrade version: "+A+"."),A!==t.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),exports.AlipayMiniprogramParser=w,exports.UADecoder=g,exports.WechatMiniprogramParser=y,exports.getDefaultRenderLevel=M,exports.getDowngradeResult=function(n){void 0===n&&(n={}),b||(!function(n){var t=n.autoPause;i.window.addEventListener("unload",(function(){e.getActivePlayers().forEach((function(e){return e.dispose()}))})),t&&(document.addEventListener("pause",D),document.addEventListener("resume",x))}(n),b=!0);var t,o=n.mockDowngrade;if(void 0!==o)return{downgrade:o,level:null!=(t=n.level)?t:e.spec.RenderLevel.S,reason:"mock"};var r=function(i){var n=i.queryDeviceInMiniApp,t=i.deviceInfo;if(t)return t;if(n){if(e.isAlipayMiniApp()){if(my.canIUse("getSystemInfo")){var o=my.getSystemInfo();return new w(o).getDeviceInfo()}e.logger.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(e.isWechatMiniApp()){if(wx.canIUse("getDeviceInfo")){var r=wx.getDeviceInfo();return new y(r).getDeviceInfo()}e.logger.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else e.logger.error("Non-mini program environment and try to get device info from user agent.")}return(new g).getDeviceInfo()}(n);return new L(n,r).getDowngradeResult()},exports.version=A;
2
2
  //# sourceMappingURL=weapp.js.map
package/dist/weapp.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import*as e from"@galacean/effects/weapp";import{spec as i,getActivePlayers as n,isAlipayMiniApp as t,logger as o,isWechatMiniApp as r,isIOS as h,Plugin as a,registerPlugin as d}from"@galacean/effects/weapp";import{window as s}from"@galacean/appx-adapter/weapp";function l(e,i,n,t,o,r,h){try{var a=e[r](h),d=a.value}catch(e){return void n(e)}a.done?i(d):Promise.resolve(d).then(t,o)}function u(e,i){return u=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},u(e,i)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function v(e,i,n){return v=c()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&u(o,n.prototype),o},v.apply(null,arguments)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(e){var i="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return v(e,arguments,f(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),u(t,e)},m(e)}function P(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=a(0),h.throw=a(1),h.return=a(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function a(a){return function(d){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,a[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,t=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=i.call(e,r)}catch(e){a=[6,e],t=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,d])}}}function p(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function g(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return p(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var w,y={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},S={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},b={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},M={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};!function(e){e.High="high",e.Medium="medium",e.Low="low",e.Unknown="unknown"}(w||(w={}));var O=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.isIOS=function(){return"iOS"===this.device.platform},i.isAndroid=function(){return"Android"===this.device.platform},i.isHarmony=function(){return"Harmony"===this.device.platform},i.isWindows=function(){return"Windows"===this.device.platform},i.isMacintosh=function(){return"Macintosh"===this.device.platform},i.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},i.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var a,d=g(t);!(a=d()).done;){var s=a.value,l=s.name,u=s.comment;if(null==l?void 0:l.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},i.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},i.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?w.Low:e<16?w.Medium:w.High}return w.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?w.Low:i<12?w.Medium:w.High}return w.Low}return w.High},i.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.getIPhoneModel=function(){var e,i=s.screen.width*s.devicePixelRatio,n=s.screen.height*s.devicePixelRatio,t=y.iPhone.find((function(e){return e.width===i&&e.height===n}));return null!=(e=null==t?void 0:t.model)?e:"iPhone"},i.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=g(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var a,d=t[t.length-1].trim(),s=g(y.vender);!(a=s()).done;){var l=a.value;if(d.startsWith(l))return d.substring(l.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var u=t.length;if("wv"===t[u-1].trim())return t[u-2].trim()}},i.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.testIPhone=function(e){return e.includes("iPhone")},i.testIPad=function(e){return e.includes("iPad")},i.testAndroid=function(e){return e.includes("Android")},i.testMacintosh=function(e){return e.includes("Macintosh")},i.testWindows=function(e){return e.includes("Windows")},e}(),I=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:w.High,medium:w.Medium,middle:w.Medium,low:w.Low}[e]||w.Unknown},e}(),A=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=M.wechat[e.model])?t:e.model,h=g(y.iPhone);!(o=h()).done;){var a=o.value;if(a.name===r){e.model=a.model;break}}if("iOS"===this.device.platform){var d=e.model.match(/^(.*?)<(.*?)>$/);d?(this.device.model=d[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=w.Unknown:e.benchmarkLevel<=10?this.device.level=w.Low:e.benchmarkLevel<=20?this.device.level=w.Medium:this.device.level=w.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function e(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=e.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?S.iPhone:S.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?b.iOS:b.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===w.High)return i.RenderLevel.S;if(this.device.level===w.Medium)return i.RenderLevel.A;if(this.device.level===w.Low)return i.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var e=+RegExp.$1;return e<=9?i.RenderLevel.B:e<10?i.RenderLevel.A:i.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?i.RenderLevel.B:this.device.memoryMB<6e3?i.RenderLevel.A:i.RenderLevel.S:this.isIOS?i.RenderLevel.S:i.RenderLevel.B},e}(),D=Symbol("@@_inter_pause"),R=!1;function V(e){void 0===e&&(e={}),R||(!function(e){var i=e.autoPause;s.addEventListener("unload",(function(){n().forEach((function(e){return e.dispose()}))})),i&&(document.addEventListener("pause",E),document.addEventListener("resume",k))}(e),R=!0);var h,a=e.mockDowngrade;if(void 0!==a)return{downgrade:a,level:null!=(h=e.level)?h:i.RenderLevel.S,reason:"mock"};var d=function(e){var i=e.queryDeviceInMiniApp,n=e.deviceInfo;if(n)return n;if(i){if(t()){if(my.canIUse("getSystemInfo")){var h=my.getSystemInfo();return new I(h).getDeviceInfo()}o.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(r()){if(wx.canIUse("getDeviceInfo")){var a=wx.getDeviceInfo();return new A(a).getDeviceInfo()}o.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else o.error("Non-mini program environment and try to get device info from user agent.")}return(new O).getDeviceInfo()}(e);return new L(e,d).getDowngradeResult()}function x(){return h()?i.RenderLevel.S:i.RenderLevel.B}function E(e){e.target===document&&(o.info("Auto pause all players with data offloaded."),n().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[D]=!0)})))}function k(e){e.target===document&&(o.info("Auto resume all players."),n().forEach((function(e){e[D]&&(e.resume(),e[D]=!1)})))}var B=function(e){function i(){var i;return(i=e.call(this)||this).order=1,i}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&u(e,i)}(i,e),i.prototype.onAssetsLoadStart=function(e,i){return(n=function(){var e,n,t;return P(this,(function(r){if(n=null==(e=(i=i||{}).pluginData)?void 0:e.downgrade){if(n.downgrade)throw new Error("Downgraded, reason: "+n.reason)}else o.warn("No downgrade result in pluginData of SceneLoadOptions.");return i.renderLevel||(i.renderLevel=null!=(t=null==n?void 0:n.level)?t:x()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(t,o){var r=n.apply(e,i);function h(e){l(r,t,o,h,a,"next",e)}function a(e){l(r,t,o,h,a,"throw",e)}h(void 0)}))})();var n},i}(m(a)),C="2.8.0-alpha.5";d("downgrade",B),o.info("Plugin downgrade version: "+C+"."),C!==e.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");export{I as AlipayMiniprogramParser,w as DeviceLevel,O as UADecoder,A as WechatMiniprogramParser,x as getDefaultRenderLevel,V as getDowngradeResult,C as version};
1
+ import*as e from"@galacean/effects/weapp";import{spec as i,getActivePlayers as n,isAlipayMiniApp as t,logger as o,isWechatMiniApp as r,isIOS as h,Plugin as a,registerPlugin as d}from"@galacean/effects/weapp";import{window as s}from"@galacean/appx-adapter/weapp";function l(e,i,n,t,o,r,h){try{var a=e[r](h),d=a.value}catch(e){return void n(e)}a.done?i(d):Promise.resolve(d).then(t,o)}function u(e,i){return u=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},u(e,i)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function v(e,i,n){return v=c()?Reflect.construct:function(e,i,n){var t=[null];t.push.apply(t,i);var o=new(Function.bind.apply(e,t));return n&&u(o,n.prototype),o},v.apply(null,arguments)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(e){var i="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return v(e,arguments,f(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),u(t,e)},m(e)}function P(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=a(0),h.throw=a(1),h.return=a(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function a(a){return function(d){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,a[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,t=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=i.call(e,r)}catch(e){a=[6,e],t=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,d])}}}function p(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function g(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return p(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var w,y={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},S={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},b={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},M={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};!function(e){e.High="high",e.Medium="medium",e.Low="low",e.Unknown="unknown"}(w||(w={}));var O=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.isIOS=function(){return"iOS"===this.device.platform},i.isAndroid=function(){return"Android"===this.device.platform},i.isHarmony=function(){return"Harmony"===this.device.platform},i.isWindows=function(){return"Windows"===this.device.platform},i.isMacintosh=function(){return"Macintosh"===this.device.platform},i.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},i.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var a,d=g(t);!(a=d()).done;){var s=a.value,l=s.name,u=s.comment;if(null==l?void 0:l.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},i.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},i.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?w.Low:e<16?w.Medium:w.High}return w.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?w.Low:i<12?w.Medium:w.High}return w.Low}return w.High},i.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.getIPhoneModel=function(){var e,i=s.screen.width*s.devicePixelRatio,n=s.screen.height*s.devicePixelRatio,t=y.iPhone.find((function(e){return e.width===i&&e.height===n}));return null!=(e=null==t?void 0:t.model)?e:"iPhone"},i.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=g(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var a,d=t[t.length-1].trim(),s=g(y.vender);!(a=s()).done;){var l=a.value;if(d.startsWith(l))return d.substring(l.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var u=t.length;if("wv"===t[u-1].trim())return t[u-2].trim()}},i.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.testIPhone=function(e){return e.includes("iPhone")},i.testIPad=function(e){return e.includes("iPad")},i.testAndroid=function(e){return e.includes("Android")},i.testMacintosh=function(e){return e.includes("Macintosh")},i.testWindows=function(e){return e.includes("Windows")},e}(),I=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:w.High,medium:w.Medium,middle:w.Medium,low:w.Low}[e]||w.Unknown},e}(),A=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=M.wechat[e.model])?t:e.model,h=g(y.iPhone);!(o=h()).done;){var a=o.value;if(a.name===r){e.model=a.model;break}}if("iOS"===this.device.platform){var d=e.model.match(/^(.*?)<(.*?)>$/);d?(this.device.model=d[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=w.Unknown:e.benchmarkLevel<=10?this.device.level=w.Low:e.benchmarkLevel<=20?this.device.level=w.Medium:this.device.level=w.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),L=function(){function e(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=e.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?S.iPhone:S.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?b.iOS:b.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===w.High)return i.RenderLevel.S;if(this.device.level===w.Medium)return i.RenderLevel.A;if(this.device.level===w.Low)return i.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var e=+RegExp.$1;return e<=9?i.RenderLevel.B:e<10?i.RenderLevel.A:i.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?i.RenderLevel.B:this.device.memoryMB<6e3?i.RenderLevel.A:i.RenderLevel.S:this.isIOS?i.RenderLevel.S:i.RenderLevel.B},e}(),D=Symbol("@@_inter_pause"),R=!1;function V(e){void 0===e&&(e={}),R||(!function(e){var i=e.autoPause;s.addEventListener("unload",(function(){n().forEach((function(e){return e.dispose()}))})),i&&(document.addEventListener("pause",E),document.addEventListener("resume",k))}(e),R=!0);var h,a=e.mockDowngrade;if(void 0!==a)return{downgrade:a,level:null!=(h=e.level)?h:i.RenderLevel.S,reason:"mock"};var d=function(e){var i=e.queryDeviceInMiniApp,n=e.deviceInfo;if(n)return n;if(i){if(t()){if(my.canIUse("getSystemInfo")){var h=my.getSystemInfo();return new I(h).getDeviceInfo()}o.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(r()){if(wx.canIUse("getDeviceInfo")){var a=wx.getDeviceInfo();return new A(a).getDeviceInfo()}o.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else o.error("Non-mini program environment and try to get device info from user agent.")}return(new O).getDeviceInfo()}(e);return new L(e,d).getDowngradeResult()}function x(){return h()?i.RenderLevel.S:i.RenderLevel.B}function E(e){e.target===document&&(o.info("Auto pause all players with data offloaded."),n().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[D]=!0)})))}function k(e){e.target===document&&(o.info("Auto resume all players."),n().forEach((function(e){e[D]&&(e.resume(),e[D]=!1)})))}var B=function(e){function i(){var i;return(i=e.call(this)||this).order=1,i}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&u(e,i)}(i,e),i.prototype.onAssetsLoadStart=function(e,i){return(n=function(){var e,n,t;return P(this,(function(r){if(n=null==(e=(i=i||{}).pluginData)?void 0:e.downgrade){if(n.downgrade)throw new Error("Downgraded, reason: "+n.reason)}else o.warn("No downgrade result in pluginData of SceneLoadOptions.");return i.renderLevel||(i.renderLevel=null!=(t=null==n?void 0:n.level)?t:x()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(t,o){var r=n.apply(e,i);function h(e){l(r,t,o,h,a,"next",e)}function a(e){l(r,t,o,h,a,"throw",e)}h(void 0)}))})();var n},i}(m(a)),C="2.8.0-alpha.6";d("downgrade",B),o.info("Plugin downgrade version: "+C+"."),C!==e.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");export{I as AlipayMiniprogramParser,w as DeviceLevel,O as UADecoder,A as WechatMiniprogramParser,x as getDefaultRenderLevel,V as getDowngradeResult,C as version};
2
2
  //# sourceMappingURL=weapp.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-plugin-downgrade",
3
- "version": "2.8.0-alpha.5",
3
+ "version": "2.8.0-alpha.6",
4
4
  "description": "Galacean Effects player downgrade plugin",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -43,7 +43,7 @@
43
43
  "registry": "https://registry.npmjs.org"
44
44
  },
45
45
  "devDependencies": {
46
- "@galacean/effects": "2.8.0-alpha.5"
46
+ "@galacean/effects": "2.8.0-alpha.6"
47
47
  },
48
48
  "scripts": {
49
49
  "dev": "vite",