function mockNetwork(){if(!global["__minium_%(interface)s_network_mocked"]){function e(i,s){if(typeof i!=typeof s)return!1;switch(typeof i){case"string":return!!new RegExp(i).exec(s);case"number":return i===s;case"object":if(i instanceof Array){if(i.length!=s.length)return!1;for(var c=0;c<i.length;c++)if(!e(i[c],s[c]))return!1;return!0}for(var t in i)if("success"!=t&&"fail"!=t&&"complete"!=t&&"_miniMockType"!=t){if(void 0===s[t])return!1;if(!e(i[t],s[t]))return!1}return!0}return!1}Object.defineProperty(global,"__minium_%(interface)s_network_mocked",{value:!0,writable:!1}),global["__minium_%(interface)s_network_mock_rule"]||(global["__minium_%(interface)s_network_mock_rule"]=[]),global["__minium_%(interface)sTask"]=class{constructor(e,i,s){this.success=e,this.fail=i,this.callback=s,this.chunkCallback=[],this.headersReceivedCallback=[],this.progressUpdateCallback=[],this.fd=setTimeout((()=>{this.headersReceivedCallback.forEach((e=>{this.success&&e({header:this.success.header})})),this.chunkCallback.forEach((e=>{this.success&&e(this.success.data)})),this.progressUpdateCallback.forEach((e=>{this.success&&e({progress:100,totalBytesWritten:100,totalBytesExpectedToWrite:100})})),s(this.success||this.fail)}))}abort(){clearTimeout(this.fd)}offChunkReceived(e){var i=this.chunkCallback.indexOf(e);-1!==i&&this.chunkCallback.splice(i,1)}offHeadersReceived(e){var i=this.headersReceivedCallback.indexOf(e);-1!==i&&this.headersReceivedCallback.splice(i,1)}onChunkReceived(e){this.chunkCallback.push(e)}onHeadersReceived(e){this.headersReceivedCallback.push(e)}onProgressUpdate(e){this.progressUpdateCallback.push(e)}};var i=wx["%(interface)s"];Object.defineProperty(wx,"%(interface)s",{configurable:!0,get:()=>function(s){for(var c=0;c<global["__minium_%(interface)s_network_mock_rule"].length;c++){var t=global["__minium_%(interface)s_network_mock_rule"][c];if(e(t,s)){if(1===t._miniMockType&&([t]=global["__minium_%(interface)s_network_mock_rule"].splice(c,1)),console.log("@@@@rule match",t),s.__miniumMocked=!0,t.success)return new global["__minium_%(interface)sTask"](t.success,void 0,(e=>{s.success&&s.success(e),s.complete&&s.complete(e)}));if(t.fail)return new global["__minium_%(interface)sTask"](void 0,t.fail,(e=>{s.fail&&s.fail(e),s.complete&&s.complete(e)}));if(1===t._miniMockType)return}}return i(s)}})}}
