@zappar/zappar-cv 0.4.0-beta.8 → 2.0.0-beta.2

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.
Files changed (79) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +2 -2
  3. package/lib/additional.d.ts +3 -1
  4. package/lib/additional.js +1 -2
  5. package/lib/camera-source-map.js +16 -24
  6. package/lib/camera-source.js +17 -21
  7. package/lib/cameramodel.js +18 -23
  8. package/lib/compatibility.js +1 -3
  9. package/lib/deserializer.js +1 -5
  10. package/lib/direct.js +12 -16
  11. package/lib/drawcamera.js +26 -31
  12. package/lib/drawface.js +5 -9
  13. package/lib/drawfaceproject.js +5 -9
  14. package/lib/drawplane.js +6 -11
  15. package/lib/event.js +5 -13
  16. package/lib/facelandmark.d.ts +1 -2
  17. package/lib/facelandmark.js +11 -18
  18. package/lib/facelandmarkdata.js +1 -4
  19. package/lib/facelandmarkinterface.js +1 -2
  20. package/lib/facemesh.js +10 -17
  21. package/lib/gen/zappar-client.js +5 -24
  22. package/lib/gen/zappar-cwrap.js +1 -12
  23. package/lib/gen/zappar-native.d.ts +0 -1
  24. package/lib/gen/zappar-native.js +10 -13
  25. package/lib/gen/zappar-server.js +5 -13
  26. package/lib/gen/zappar.d.ts +7 -2
  27. package/lib/gen/zappar.js +5 -13
  28. package/lib/gfx.js +1 -4
  29. package/lib/gl-state-manager.d.ts +9 -0
  30. package/lib/gl-state-manager.js +31 -0
  31. package/lib/html-element-source.js +23 -27
  32. package/lib/image-process-gl.js +73 -32
  33. package/lib/imagebitmap-camera-source.js +30 -34
  34. package/lib/imagetracker.d.ts +28 -0
  35. package/lib/imagetracker.js +115 -0
  36. package/lib/index-standalone.d.ts +3 -0
  37. package/lib/index-standalone.js +5 -0
  38. package/lib/index.d.ts +2 -1
  39. package/lib/index.js +6 -27
  40. package/lib/landmarkdatagenerate.js +25 -30
  41. package/lib/loglevel.js +9 -16
  42. package/lib/messages.js +4 -8
  43. package/lib/mstp-camera-source.js +22 -26
  44. package/lib/native.d.ts +2 -1
  45. package/lib/native.js +194 -132
  46. package/lib/options.d.ts +3 -0
  47. package/lib/options.js +1 -0
  48. package/lib/permission.js +13 -27
  49. package/lib/pipeline.d.ts +1 -2
  50. package/lib/pipeline.js +34 -39
  51. package/lib/profile.js +40 -45
  52. package/lib/riff-reader.d.ts +18 -0
  53. package/lib/riff-reader.js +52 -0
  54. package/lib/sequencerecorder.js +7 -12
  55. package/lib/sequencesource.d.ts +2 -0
  56. package/lib/sequencesource.js +28 -25
  57. package/lib/serializer.js +1 -5
  58. package/lib/shader.js +2 -7
  59. package/lib/source.js +1 -5
  60. package/lib/version.d.ts +1 -1
  61. package/lib/version.js +1 -4
  62. package/lib/worker-client.d.ts +1 -1
  63. package/lib/worker-client.js +9 -21
  64. package/lib/worker-imagebitmap.js +9 -13
  65. package/lib/worker-server.js +33 -37
  66. package/lib/worker.js +6 -10
  67. package/lib/workerinterface.js +1 -2
  68. package/lib/zcv.js +125 -115
  69. package/lib/zcv.wasm +0 -0
  70. package/package.json +14 -16
  71. package/umd/169.zappar-cv.js +1 -0
  72. package/umd/{482727c0e7dd40d73f5aae47f238ad61.zbin → 482727c0e7dd40d73f5a.zbin} +0 -0
  73. package/umd/557cf735d27efb96e262.wasm +0 -0
  74. package/umd/752.zappar-cv.js +1 -0
  75. package/umd/{b4f46e148a3b3b5aef90717d8d60e3fc.zbin → b4f46e148a3b3b5aef90.zbin} +0 -0
  76. package/umd/{f7b62a3a53b5c9b3222ba8dc53cb8b11.zbin → f7b62a3a53b5c9b3222b.zbin} +0 -0
  77. package/umd/zappar-cv.js +1 -1
  78. package/umd/zappar-cv.worker.js +1 -1
  79. package/umd/fbf9061bc2d2826ecf97c8ba2b51e7a5.wasm +0 -0
package/lib/zcv.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zappar/zappar-cv",
3
- "version": "0.4.0-beta.8",
3
+ "version": "2.0.0-beta.2",
4
4
  "description": "Zappar's core computer vision library, supporting image, face and world tracking.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -25,39 +25,37 @@
25
25
  "upkg": "umd/zappar-cv.js",
26
26
  "license": "Proprietary",
27
27
  "devDependencies": {
28
- "@types/dom-mediacapture-transform": "^0.1.1",
29
- "@types/dom-webcodecs": "^0.1.2",
28
+ "@types/dom-mediacapture-transform": "0.1.1",
29
+ "@types/dom-webcodecs": "0.1.2",
30
30
  "@types/expect-puppeteer": "4.4.5",
31
31
  "@types/jest-environment-puppeteer": "4.4.1",
32
32
  "@types/node": "14.14.7",
33
- "@types/offscreencanvas": "^2019.6.4",
33
+ "@types/offscreencanvas": "2019.6.4",
34
34
  "@types/pixelmatch": "5.2.2",
35
35
  "@types/pngjs": "6.0.0",
36
36
  "@types/puppeteer": "5.4.3",
37
+ "@types/ua-parser-js": "0.7.33",
37
38
  "@zappar/zapworks-cli": "0.6.17",
38
39
  "concurrently": "5.3.0",
39
40
  "dat.gui": "0.7.7",
40
- "html-webpack-plugin": "4.5.0",
41
+ "html-webpack-plugin": "5.5.0",
41
42
  "jest": "26.6.3",
42
- "jest-puppeteer": "4.4.0",
43
+ "jest-puppeteer": "6.0.2",
43
44
  "jsdoc": "3.6.7",
44
45
  "pixelmatch": "5.2.1",
45
46
  "pngjs": "6.0.0",
46
47
  "puppeteer": "7.1.0",
47
48
  "ts-jest": "26.5.1",
48
- "ts-loader": "8.0.11",
49
+ "ts-loader": "9.2.6",
49
50
  "ts-node": "9.1.1",
50
51
  "typescript": "4.0.5",
51
- "webpack": "4.46.0",
52
- "webpack-cli": "4.9.1",
53
- "webpack-dev-server": "3.11.2"
52
+ "webpack": "5.68.0",
53
+ "webpack-cli": "4.9.2",
54
+ "webpack-dev-server": "^4.7.3",
55
+ "worker-loader": "^3.0.8"
54
56
  },
55
57
  "dependencies": {
56
- "@types/gl-matrix": "2.4.5",
57
- "@types/ua-parser-js": "0.7.33",
58
- "file-loader": "6.2.0",
59
- "gl-matrix": "3.1.0",
60
- "ua-parser-js": "0.7.30",
61
- "worker-loader": "3.0.5"
58
+ "gl-matrix": "3.4.3",
59
+ "ua-parser-js": "0.7.30"
62
60
  }
63
61
  }
@@ -0,0 +1 @@
1
+ (self.webpackChunkZCV=self.webpackChunkZCV||[]).push([[169],{685:(i,e,o)=>{"use strict";o.d(e,{WT:()=>r});var r="undefined"!=typeof Float32Array?Float32Array:Array;Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var i=0,e=arguments.length;e--;)i+=arguments[e]*arguments[e];return Math.sqrt(i)})},975:(i,e,o)=>{"use strict";o.d(e,{Ue:()=>a,yR:()=>n,xJ:()=>t});var r=o(685);function a(){var i=new r.WT(16);return r.WT!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i}function n(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function t(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},238:function(i,e,o){var r;!function(a,n){"use strict";var t="function",s="undefined",b="object",w="string",l="model",d="name",u="type",c="vendor",p="version",m="architecture",f="console",h="mobile",v="tablet",g="smarttv",x="wearable",k="embedded",y="Amazon",_="Apple",T="ASUS",S="BlackBerry",q="Google",A="Huawei",C="LG",z="Microsoft",N="Motorola",O="Samsung",E="Sony",M="Xiaomi",U="Zebra",j="Facebook",B=function(i){var e={};for(var o in i)e[i[o].toUpperCase()]=i[o];return e},R=function(i,e){return typeof i===w&&-1!==V(e).indexOf(V(i))},V=function(i){return i.toLowerCase()},F=function(i,e){if(typeof i===w)return i=i.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof e===s?i:i.substring(0,255)},P=function(i,e){for(var o,r,a,s,w,l,d=0;d<e.length&&!w;){var u=e[d],c=e[d+1];for(o=r=0;o<u.length&&!w;)if(w=u[o++].exec(i))for(a=0;a<c.length;a++)l=w[++r],typeof(s=c[a])===b&&s.length>0?2==s.length?typeof s[1]==t?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==t||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):n:this[s[0]]=l?s[1].call(this,l,s[2]):n:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):n):this[s]=l||n;d+=2}},W=function(i,e){for(var o in e)if(typeof e[o]===b&&e[o].length>0){for(var r=0;r<e[o].length;r++)if(R(e[o][r],i))return"?"===o?n:o}else if(R(e[o],i))return"?"===o?n:o;return i},I={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},D={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,p],[/opios[\/ ]+([\w\.]+)/i],[p,[d,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[p,[d,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[d,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[d,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[p,[d,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[d,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[d,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure Browser"],p],[/\bfocus\/([\w\.]+)/i],[p,[d,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[p,[d,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[d,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[d,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[p,[d,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[d,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1 Browser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[d,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[d,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,j],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[d,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[d,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[d,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,"Chrome WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[d,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,p],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[p,[d,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[p,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[p,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[d,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[d,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[d,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,V]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[c,O],[u,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[c,O],[u,h]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[c,_],[u,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[c,_],[u,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[c,A],[u,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[l,[c,A],[u,h]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[c,M],[u,h]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[c,M],[u,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[l,[c,"OPPO"],[u,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[c,"Vivo"],[u,h]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[c,"Realme"],[u,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[c,N],[u,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[c,N],[u,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[c,C],[u,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[c,C],[u,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[c,"Lenovo"],[u,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[c,"Nokia"],[u,h]],[/(pixel c)\b/i],[l,[c,q],[u,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[c,q],[u,h]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[c,E],[u,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[c,E],[u,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[c,"OnePlus"],[u,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[c,y],[u,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[c,y],[u,h]],[/(playbook);[-\w\),; ]+(rim)/i],[l,c,[u,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[c,S],[u,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[c,T],[u,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[c,T],[u,h]],[/(nexus 9)/i],[l,[c,"HTC"],[u,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[c,[l,/_/g," "],[u,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[c,"Acer"],[u,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[c,"Meizu"],[u,h]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[c,"Sharp"],[u,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[c,l,[u,h]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[c,l,[u,v]],[/(surface duo)/i],[l,[c,z],[u,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[c,"Fairphone"],[u,h]],[/(u304aa)/i],[l,[c,"AT&T"],[u,h]],[/\bsie-(\w*)/i],[l,[c,"Siemens"],[u,h]],[/\b(rct\w+) b/i],[l,[c,"RCA"],[u,v]],[/\b(venue[\d ]{2,7}) b/i],[l,[c,"Dell"],[u,v]],[/\b(q(?:mv|ta)\w+) b/i],[l,[c,"Verizon"],[u,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[c,"Barnes & Noble"],[u,v]],[/\b(tm\d{3}\w+) b/i],[l,[c,"NuVision"],[u,v]],[/\b(k88) b/i],[l,[c,"ZTE"],[u,v]],[/\b(nx\d{3}j) b/i],[l,[c,"ZTE"],[u,h]],[/\b(gen\d{3}) b.+49h/i],[l,[c,"Swiss"],[u,h]],[/\b(zur\d{3}) b/i],[l,[c,"Swiss"],[u,v]],[/\b((zeki)?tb.*\b) b/i],[l,[c,"Zeki"],[u,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],l,[u,v]],[/\b(ns-?\w{0,9}) b/i],[l,[c,"Insignia"],[u,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[c,"NextBook"],[u,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],l,[u,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],l,[u,h]],[/\b(ph-1) /i],[l,[c,"Essential"],[u,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[c,"Envizen"],[u,v]],[/\b(trio[-\w\. ]+) b/i],[l,[c,"MachSpeed"],[u,v]],[/\btu_(1491) b/i],[l,[c,"Rotor"],[u,v]],[/(shield[\w ]+) b/i],[l,[c,"Nvidia"],[u,v]],[/(sprint) (\w+)/i],[c,l,[u,h]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[c,z],[u,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[c,U],[u,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[c,U],[u,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,l,[u,f]],[/droid.+; (shield) bui/i],[l,[c,"Nvidia"],[u,f]],[/(playstation [345portablevi]+)/i],[l,[c,E],[u,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[c,z],[u,f]],[/smart-tv.+(samsung)/i],[c,[u,g]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[c,O],[u,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,C],[u,g]],[/(apple) ?tv/i],[c,[l,"Apple TV"],[u,g]],[/crkey/i],[[l,"Chromecast"],[c,q],[u,g]],[/droid.+aft(\w)( bui|\))/i],[l,[c,y],[u,g]],[/\(dtv[\);].+(aquos)/i],[l,[c,"Sharp"],[u,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[c,F],[l,F],[u,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,g]],[/((pebble))app/i],[c,l,[u,x]],[/droid.+; (glass) \d/i],[l,[c,q],[u,x]],[/droid.+; (wt63?0{2,3})\)/i],[l,[c,U],[u,x]],[/(quest( 2)?)/i],[l,[c,j],[u,x]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[u,k]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[u,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[u,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,v]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[u,h]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[d,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[d,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[d,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[d,[p,W,I]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[d,"Windows"],[p,W,I]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[p,d],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[d,p],[/\(bb(10);/i],[p,[d,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[d,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[d,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[d,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[d,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,p],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[d,p]]},Z=function(i,e){if(typeof i===b&&(e=i,i=n),!(this instanceof Z))return new Z(i,e).getResult();var o=i||(typeof a!==s&&a.navigator&&a.navigator.userAgent?a.navigator.userAgent:""),r=e?function(i,e){var o={};for(var r in i)e[r]&&e[r].length%2==0?o[r]=e[r].concat(i[r]):o[r]=i[r];return o}(D,e):D;return this.getBrowser=function(){var i,e={};return e.name=n,e.version=n,P.call(e,o,r.browser),e.major=typeof(i=e.version)===w?i.replace(/[^\d\.]/g,"").split(".")[0]:n,e},this.getCPU=function(){var i={};return i.architecture=n,P.call(i,o,r.cpu),i},this.getDevice=function(){var i={};return i.vendor=n,i.model=n,i.type=n,P.call(i,o,r.device),i},this.getEngine=function(){var i={};return i.name=n,i.version=n,P.call(i,o,r.engine),i},this.getOS=function(){var i={};return i.name=n,i.version=n,P.call(i,o,r.os),i},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return o},this.setUA=function(i){return o=typeof i===w&&i.length>255?F(i,255):i,this},this.setUA(o),this};Z.VERSION="0.7.30",Z.BROWSER=B([d,p,"major"]),Z.CPU=B([m]),Z.DEVICE=B([l,c,u,f,h,g,v,x,k]),Z.ENGINE=Z.OS=B([d,p]),typeof e!==s?(i.exports&&(e=i.exports=Z),e.UAParser=Z):o.amdO?(r=function(){return Z}.call(e,o,e,i))===n||(i.exports=r):typeof a!==s&&(a.UAParser=Z);var G=typeof a!==s&&(a.jQuery||a.Zepto);if(G&&!G.ua){var L=new Z;G.ua=L.getResult(),G.ua.get=function(){return L.getUA()},G.ua.set=function(i){L.setUA(i);var e=L.getResult();for(var o in e)G.ua[o]=e[o]}}}("object"==typeof window?window:this)}}]);
Binary file
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ZCV=t():e.ZCV=t()}(self,(function(){return(()=>{"use strict";var e,t,r={752:(e,t,r)=>{var a,n=(a="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var t,r,n;e=e||{},t||(t=void 0!==e?e:{}),t.ready=new Promise((function(e,t){r=e,n=t}));var i,o={};for(i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);var s="./this.program";function _(e,t){throw t}var c,f="";f=self.location.href,a&&(f=a),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",c=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)};var u,l,p=t.print||console.log.bind(console),d=t.printErr||console.warn.bind(console);for(i in o)o.hasOwnProperty(i)&&(t[i]=o[i]);o=null,t.thisProgram&&(s=t.thisProgram),t.quit&&(_=t.quit),t.wasmBinary&&(l=t.wasmBinary);var h=t.noExitRuntime||!0;"object"!=typeof WebAssembly&&K("no native wasm support detected");var m,b,g=!1;function w(e,t){e||K("Assertion failed: "+t)}function y(e){var r=t["_"+e];return w(r,"Cannot call unknown function "+e+", make sure it is exported"),r}function v(e,t,r,a){var n,i={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);t=wr(r),P(e,T,t,r)}return t},array:function(e){var t=wr(e.length);return A.set(e,t),t}},o=y(e),s=[];if(e=0,a)for(var _=0;_<a.length;_++){var c=i[r[_]];c?(0===e&&(e=br()),s[_]=c(a[_])):s[_]=a[_]}return n=r=o.apply(null,s),r="string"===t?I(n):"boolean"===t?!!n:n,0!==e&&gr(e),r}var E,A,T,R,k,x,F,M,L,z="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(e,t,r){var a=t+r;for(r=t;e[r]&&!(r>=a);)++r;if(16<r-t&&e.subarray&&z)return z.decode(e.subarray(t,r));for(a="";t<r;){var n=e[t++];if(128&n){var i=63&e[t++];if(192==(224&n))a+=String.fromCharCode((31&n)<<6|i);else{var o=63&e[t++];65536>(n=224==(240&n)?(15&n)<<12|i<<6|o:(7&n)<<18|i<<12|o<<6|63&e[t++])?a+=String.fromCharCode(n):(n-=65536,a+=String.fromCharCode(55296|n>>10,56320|1023&n))}}else a+=String.fromCharCode(n)}return a}function I(e,t){return e?O(T,e,t):""}function P(e,t,r,a){if(!(0<a))return 0;var n=r;a=r+a-1;for(var i=0;i<e.length;++i){var o=e.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),127>=o){if(r>=a)break;t[r++]=o}else{if(2047>=o){if(r+1>=a)break;t[r++]=192|o>>6}else{if(65535>=o){if(r+2>=a)break;t[r++]=224|o>>12}else{if(r+3>=a)break;t[r++]=240|o>>18,t[r++]=128|o>>12&63}t[r++]=128|o>>6&63}t[r++]=128|63&o}}return t[r]=0,r-n}function S(e){for(var t=0,r=0;r<e.length;++r){var a=e.charCodeAt(r);55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++r)),127>=a?++t:t=2047>=a?t+2:65535>=a?t+3:t+4}return t}function B(e){var t=S(e)+1,r=ur(t);return r&&P(e,A,r,t),r}function D(e,t){for(var r=0;r<e.length;++r)A[t++>>0]=e.charCodeAt(r);A[t>>0]=0}function U(){var e=m.buffer;E=e,t.HEAP8=A=new Int8Array(e),t.HEAP16=R=new Int16Array(e),t.HEAP32=x=new Int32Array(e),t.HEAPU8=T=new Uint8Array(e),t.HEAPU16=k=new Uint16Array(e),t.HEAPU32=F=new Uint32Array(e),t.HEAPF32=M=new Float32Array(e),t.HEAPF64=L=new Float64Array(e)}var C,V=[],N=[],H=[],W=[];function G(){var e=t.preRun.shift();V.unshift(e)}var Y=0,X=null,j=null;function q(){Y++,t.monitorRunDependencies&&t.monitorRunDependencies(Y)}function Z(){if(Y--,t.monitorRunDependencies&&t.monitorRunDependencies(Y),0==Y&&(null!==X&&(clearInterval(X),X=null),j)){var e=j;j=null,e()}}function K(e){throw t.onAbort&&t.onAbort(e),d(e),g=!0,b=1,e=new WebAssembly.RuntimeError("abort("+e+"). Build with -s ASSERTIONS=1 for more info."),n(e),e}t.preloadedImages={},t.preloadedAudios={};var J="zcv.wasm";if(String.prototype.startsWith?!J.startsWith("data:application/octet-stream;base64,"):0!==J.indexOf("data:application/octet-stream;base64,")){var $=J;J=t.locateFile?t.locateFile($,f):f+$}var Q,ee,te,re={490460:function(){if(self.crypto&&self.crypto.getRandomValues){var e=new Uint32Array(1);return self.crypto.getRandomValues(e),e[0]}return 9007199254740991*Math.random()}};function ae(e){for(;0<e.length;){var r=e.shift();if("function"==typeof r)r(t);else{var a=r.md;"number"==typeof a?void 0===r.Fc?C.get(a)():C.get(a)(r.Fc):a(void 0===r.Fc?null:r.Fc)}}}function ne(e,t){if(0===e)e=Date.now();else{if(1!==e&&4!==e)return x[pr()>>2]=28,-1;e=te()}return x[t>>2]=e/1e3|0,x[t+4>>2]=e%1e3*1e6|0,0}function ie(e){this.yc=e-16,this.Dd=function(e){x[this.yc+8>>2]=e},this.Ad=function(e){x[this.yc+0>>2]=e},this.Bd=function(){x[this.yc+4>>2]=0},this.zd=function(){A[this.yc+12>>0]=0},this.Cd=function(){A[this.yc+13>>0]=0},this.pd=function(e,t){this.Dd(e),this.Ad(t),this.Bd(),this.zd(),this.Cd()}}function oe(e,t){for(var r=0,a=e.length-1;0<=a;a--){var n=e[a];"."===n?e.splice(a,1):".."===n?(e.splice(a,1),r++):r&&(e.splice(a,1),r--)}if(t)for(;r;r--)e.unshift("..");return e}function se(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=oe(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function _e(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function ce(e){if("/"===e)return"/";var t=(e=(e=se(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)}function fe(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=oe(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."}te=function(){return performance.now()};var ue=[];function le(e,t){ue[e]={input:[],nc:[],xc:t},De(e,pe)}var pe={open:function(e){var t=ue[e.node.Cc];if(!t)throw new Te(43);e.lc=t,e.seekable=!1},close:function(e){e.lc.xc.flush(e.lc)},flush:function(e){e.lc.xc.flush(e.lc)},read:function(e,t,r,a){if(!e.lc||!e.lc.xc.Zc)throw new Te(60);for(var n=0,i=0;i<a;i++){try{var o=e.lc.xc.Zc(e.lc)}catch(e){throw new Te(29)}if(void 0===o&&0===n)throw new Te(6);if(null==o)break;n++,t[r+i]=o}return n&&(e.node.timestamp=Date.now()),n},write:function(e,t,r,a){if(!e.lc||!e.lc.xc.Rc)throw new Te(60);try{for(var n=0;n<a;n++)e.lc.xc.Rc(e.lc,t[r+n])}catch(e){throw new Te(29)}return a&&(e.node.timestamp=Date.now()),n}},de={Zc:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=sr(t,!0)}return e.input.shift()},Rc:function(e,t){null===t||10===t?(p(O(e.nc,0)),e.nc=[]):0!=t&&e.nc.push(t)},flush:function(e){e.nc&&0<e.nc.length&&(p(O(e.nc,0)),e.nc=[])}},he={Rc:function(e,t){null===t||10===t?(d(O(e.nc,0)),e.nc=[]):0!=t&&e.nc.push(t)},flush:function(e){e.nc&&0<e.nc.length&&(d(O(e.nc,0)),e.nc=[])}},me={qc:null,sc:function(){return me.createNode(null,"/",16895,0)},createNode:function(e,t,r,a){if(24576==(61440&r)||4096==(61440&r))throw new Te(63);return me.qc||(me.qc={dir:{node:{pc:me.hc.pc,rc:me.hc.rc,Ac:me.hc.Ac,Hc:me.hc.Hc,dd:me.hc.dd,Nc:me.hc.Nc,ed:me.hc.ed,Ic:me.hc.Ic,Jc:me.hc.Jc},stream:{vc:me.jc.vc}},file:{node:{pc:me.hc.pc,rc:me.hc.rc},stream:{vc:me.jc.vc,read:me.jc.read,write:me.jc.write,Uc:me.jc.Uc,$c:me.jc.$c,bd:me.jc.bd}},link:{node:{pc:me.hc.pc,rc:me.hc.rc,Dc:me.hc.Dc},stream:{}},Vc:{node:{pc:me.hc.pc,rc:me.hc.rc},stream:Be}}),16384==(61440&(r=Le(e,t,r,a)).mode)?(r.hc=me.qc.dir.node,r.jc=me.qc.dir.stream,r.ic={}):32768==(61440&r.mode)?(r.hc=me.qc.file.node,r.jc=me.qc.file.stream,r.kc=0,r.ic=null):40960==(61440&r.mode)?(r.hc=me.qc.link.node,r.jc=me.qc.link.stream):8192==(61440&r.mode)&&(r.hc=me.qc.Vc.node,r.jc=me.qc.Vc.stream),r.timestamp=Date.now(),e&&(e.ic[t]=r,e.timestamp=r.timestamp),r},Pd:function(e){return e.ic?e.ic.subarray?e.ic.subarray(0,e.kc):new Uint8Array(e.ic):new Uint8Array(0)},Wc:function(e,t){var r=e.ic?e.ic.length:0;r>=t||(t=Math.max(t,r*(1048576>r?2:1.125)>>>0),0!=r&&(t=Math.max(t,256)),r=e.ic,e.ic=new Uint8Array(t),0<e.kc&&e.ic.set(r.subarray(0,e.kc),0))},xd:function(e,t){if(e.kc!=t)if(0==t)e.ic=null,e.kc=0;else{var r=e.ic;e.ic=new Uint8Array(t),r&&e.ic.set(r.subarray(0,Math.min(t,e.kc))),e.kc=t}},hc:{pc:function(e){var t={};return t.kd=8192==(61440&e.mode)?e.id:1,t.Qc=e.id,t.mode=e.mode,t.vd=1,t.uid=0,t.nd=0,t.Cc=e.Cc,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.kc:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.fd=new Date(e.timestamp),t.ud=new Date(e.timestamp),t.jd=new Date(e.timestamp),t.gd=4096,t.hd=Math.ceil(t.size/t.gd),t},rc:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&me.xd(e,t.size)},Ac:function(){throw Re[44]},Hc:function(e,t,r,a){return me.createNode(e,t,r,a)},dd:function(e,t,r){if(16384==(61440&e.mode)){try{var a=Me(t,r)}catch(e){}if(a)for(var n in a.ic)throw new Te(55)}delete e.parent.ic[e.name],e.parent.timestamp=Date.now(),e.name=r,t.ic[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},Nc:function(e,t){delete e.ic[t],e.timestamp=Date.now()},ed:function(e,t){var r,a=Me(e,t);for(r in a.ic)throw new Te(55);delete e.ic[t],e.timestamp=Date.now()},Ic:function(e){var t,r=[".",".."];for(t in e.ic)e.ic.hasOwnProperty(t)&&r.push(t);return r},Jc:function(e,t,r){return(e=me.createNode(e,t,41471,0)).link=r,e},Dc:function(e){if(40960!=(61440&e.mode))throw new Te(28);return e.link}},jc:{read:function(e,t,r,a,n){var i=e.node.ic;if(n>=e.node.kc)return 0;if(8<(e=Math.min(e.node.kc-n,a))&&i.subarray)t.set(i.subarray(n,n+e),r);else for(a=0;a<e;a++)t[r+a]=i[n+a];return e},write:function(e,t,r,a,n,i){if(t.buffer===A.buffer&&(i=!1),!a)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.ic||e.ic.subarray)){if(i)return e.ic=t.subarray(r,r+a),e.kc=a;if(0===e.kc&&0===n)return e.ic=t.slice(r,r+a),e.kc=a;if(n+a<=e.kc)return e.ic.set(t.subarray(r,r+a),n),a}if(me.Wc(e,n+a),e.ic.subarray&&t.subarray)e.ic.set(t.subarray(r,r+a),n);else for(i=0;i<a;i++)e.ic[n+i]=t[r+i];return e.kc=Math.max(e.kc,n+a),a},vc:function(e,t,r){if(1===r?t+=e.position:2===r&&32768==(61440&e.node.mode)&&(t+=e.node.kc),0>t)throw new Te(28);return t},Uc:function(e,t,r){me.Wc(e.node,t+r),e.node.kc=Math.max(e.node.kc,t+r)},$c:function(e,t,r,a,n,i){if(0!==t)throw new Te(28);if(32768!=(61440&e.node.mode))throw new Te(43);if(e=e.node.ic,2&i||e.buffer!==E){for((0<a||a+r<e.length)&&(e=e.subarray?e.subarray(a,a+r):Array.prototype.slice.call(e,a,a+r)),a=!0,i=16384*Math.ceil(r/16384),t=ur(i);r<i;)A[t+r++]=0;if(!(r=t))throw new Te(48);A.set(e,r)}else a=!1,r=e.byteOffset;return{yc:r,Ld:a}},bd:function(e,t,r,a,n){if(32768!=(61440&e.node.mode))throw new Te(43);return 2&n||me.jc.write(e,t,0,a,r,!1),0}}},be=null,ge={},we=[],ye=1,ve=null,Ee=!0,Ae={},Te=null,Re={};function ke(e,t){if(t=t||{},!(e=fe("/",e)))return{path:"",node:null};var r,a={Xc:!0,Sc:0};for(r in a)void 0===t[r]&&(t[r]=a[r]);if(8<t.Sc)throw new Te(32);e=oe(e.split("/").filter((function(e){return!!e})),!1);var n=be;for(a="/",r=0;r<e.length;r++){var i=r===e.length-1;if(i&&t.parent)break;if(n=Me(n,e[r]),a=se(a+"/"+e[r]),n.Bc&&(!i||i&&t.Xc)&&(n=n.Bc.root),!i||t.Gc)for(i=0;40960==(61440&n.mode);)if(n=We(a),n=ke(a=fe(_e(a),n),{Sc:t.Sc}).node,40<i++)throw new Te(32)}return{path:a,node:n}}function xe(e){for(var t;;){if(e===e.parent)return e=e.sc.ad,t?"/"!==e[e.length-1]?e+"/"+t:e+t:e;t=t?e.name+"/"+t:e.name,e=e.parent}}function Fe(e,t){for(var r=0,a=0;a<t.length;a++)r=(r<<5)-r+t.charCodeAt(a)|0;return(e+r>>>0)%ve.length}function Me(e,t){var r;if(r=(r=Ie(e,"x"))?r:e.hc.Ac?0:2)throw new Te(r,e);for(r=ve[Fe(e.id,t)];r;r=r.wc){var a=r.name;if(r.parent.id===e.id&&a===t)return r}return e.hc.Ac(e,t)}function Le(e,t,r,a){return t=Fe((e=new or(e,t,r,a)).parent.id,e.name),e.wc=ve[t],ve[t]=e}var ze={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function Oe(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Ie(e,t){return Ee||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2}function Pe(e,t){try{return Me(e,t),20}catch(e){}return Ie(e,"wx")}var Se,Be={open:function(e){e.jc=ge[e.node.Cc].jc,e.jc.open&&e.jc.open(e)},vc:function(){throw new Te(70)}};function De(e,t){ge[e]={jc:t}}function Ue(e,t){var r="/"===t,a=!t;if(r&&be)throw new Te(10);if(!r&&!a){var n=ke(t,{Xc:!1});if(t=n.path,(n=n.node).Bc)throw new Te(10);if(16384!=(61440&n.mode))throw new Te(54)}t={type:e,Ud:{},ad:t,td:[]},(e=e.sc(t)).sc=t,t.root=e,r?be=e:n&&(n.Bc=t,n.sc&&n.sc.td.push(t))}function Ce(e,t,r){var a=ke(e,{parent:!0}).node;if(!(e=ce(e))||"."===e||".."===e)throw new Te(28);var n=Pe(a,e);if(n)throw new Te(n);if(!a.hc.Hc)throw new Te(63);return a.hc.Hc(a,e,t,r)}function Ve(e){return Ce(e,16895,0)}function Ne(e,t,r){void 0===r&&(r=t,t=438),Ce(e,8192|t,r)}function He(e,t){if(!fe(e))throw new Te(44);var r=ke(t,{parent:!0}).node;if(!r)throw new Te(44);var a=Pe(r,t=ce(t));if(a)throw new Te(a);if(!r.hc.Jc)throw new Te(63);r.hc.Jc(r,t,e)}function We(e){if(!(e=ke(e).node))throw new Te(44);if(!e.hc.Dc)throw new Te(28);return fe(xe(e.parent),e.hc.Dc(e))}function Ge(e,t){if(!(e=ke(e,{Gc:!t}).node))throw new Te(44);if(!e.hc.pc)throw new Te(63);return e.hc.pc(e)}function Ye(e){return Ge(e,!0)}function Xe(e,r,a,n){if(""===e)throw new Te(44);if("string"==typeof r){var i=ze[r];if(void 0===i)throw Error("Unknown file open mode: "+r);r=i}if(a=64&r?4095&(void 0===a?438:a)|32768:0,"object"==typeof e)var o=e;else{e=se(e);try{o=ke(e,{Gc:!(131072&r)}).node}catch(e){}}if(i=!1,64&r)if(o){if(128&r)throw new Te(20)}else o=Ce(e,a,0),i=!0;if(!o)throw new Te(44);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&16384!=(61440&o.mode))throw new Te(54);if(!i&&(a=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==Oe(r)||512&r)?31:Ie(o,Oe(r)):44))throw new Te(a);if(512&r){if(!(a="string"==typeof(a=o)?ke(a,{Gc:!0}).node:a).hc.rc)throw new Te(63);if(16384==(61440&a.mode))throw new Te(31);if(32768!=(61440&a.mode))throw new Te(28);if(i=Ie(a,"w"))throw new Te(i);a.hc.rc(a,{size:0,timestamp:Date.now()})}r&=-131713,(n=function(e,t){Je||((Je=function(){}).prototype={});var r,a=new Je;for(r in e)a[r]=e[r];return e=a,t=function(e){for(e=e||0;e<=4096;e++)if(!we[e])return e;throw new Te(33)}(t),e.tc=t,we[t]=e}({node:o,path:xe(o),flags:r,seekable:!0,position:0,jc:o.jc,Id:[],error:!1},n)).jc.open&&n.jc.open(n),!t.logReadFiles||1&r||($e||($e={}),e in $e||($e[e]=1,d("FS.trackingDelegate error on read file: "+e)));try{Ae.onOpenFile&&(o=0,1!=(2097155&r)&&(o|=1),0!=(2097155&r)&&(o|=2),Ae.onOpenFile(e,o))}catch(t){d("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return n}function je(e,t,r){if(null===e.tc)throw new Te(8);if(!e.seekable||!e.jc.vc)throw new Te(70);if(0!=r&&1!=r&&2!=r)throw new Te(28);return e.position=e.jc.vc(e,t,r),e.Id=[],e.position}function qe(){Te||((Te=function(e,t){this.node=t,this.yd=function(e){this.mc=e},this.yd(e),this.message="FS error"}).prototype=Error(),Te.prototype.constructor=Te,[44].forEach((function(e){Re[e]=new Te(e),Re[e].stack="<generic error, no stack>"})))}function Ze(e,t,r){e=se("/dev/"+e);var a=function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}(!!t,!!r);Ke||(Ke=64);var n=Ke++<<8|0;De(n,{open:function(e){e.seekable=!1},close:function(){r&&r.buffer&&r.buffer.length&&r(10)},read:function(e,r,a,n){for(var i=0,o=0;o<n;o++){try{var s=t()}catch(e){throw new Te(29)}if(void 0===s&&0===i)throw new Te(6);if(null==s)break;i++,r[a+o]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,a,n){for(var i=0;i<n;i++)try{r(t[a+i])}catch(e){throw new Te(29)}return n&&(e.node.timestamp=Date.now()),i}}),Ne(e,a,n)}var Ke,Je,$e,Qe={};function et(e,t,r){try{var a=e(t)}catch(e){if(e&&e.node&&se(t)!==se(xe(e.node)))return-54;throw e}return x[r>>2]=a.kd,x[r+4>>2]=0,x[r+8>>2]=a.Qc,x[r+12>>2]=a.mode,x[r+16>>2]=a.vd,x[r+20>>2]=a.uid,x[r+24>>2]=a.nd,x[r+28>>2]=a.Cc,x[r+32>>2]=0,ee=[a.size>>>0,(Q=a.size,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],x[r+40>>2]=ee[0],x[r+44>>2]=ee[1],x[r+48>>2]=4096,x[r+52>>2]=a.hd,x[r+56>>2]=a.fd.getTime()/1e3|0,x[r+60>>2]=0,x[r+64>>2]=a.ud.getTime()/1e3|0,x[r+68>>2]=0,x[r+72>>2]=a.jd.getTime()/1e3|0,x[r+76>>2]=0,ee=[a.Qc>>>0,(Q=a.Qc,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],x[r+80>>2]=ee[0],x[r+84>>2]=ee[1],0}var tt=void 0;function rt(){return x[(tt+=4)-4>>2]}function at(e){if(!(e=we[e]))throw new Te(8);return e}function nt(e){try{e()}catch(e){if(!(e instanceof yr)&&"unwind"!==e)throw e&&"object"==typeof e&&e.stack&&d("exception thrown: "+[e,e.stack]),e}}var it,ot,st,_t=!1,ct=null,ft=0,ut=null,lt=0,pt=0,dt=0,ht=[],mt={},bt=!1,gt=!1,wt=[];function yt(e,r,a,n){if(r&&t.Pc&&e==t.canvas)return t.Pc;var i;if(r){var o={antialias:!1,alpha:!1,sd:1};if(n)for(var s in n)o[s]=n[s];if(void 0!==$t&&(i=function(e,t){e.Yc||(e.Yc=e.getContext,e.getContext=function(t,r){return"webgl"==t==(r=e.Yc(t,r))instanceof WebGLRenderingContext?r:null});var r=e.getContext("webgl",t);return r?function(e,t){var r=qt(jt),a={Qd:r,attributes:t,version:t.sd,Oc:e};return e.canvas&&(e.canvas.Kd=a),jt[r]=a,(void 0===t.ld||t.ld)&&function(e){if(e||(e=Kt),!e.qd){e.qd=!0;var t=e.Oc;!function(e){var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,a,n){t.drawArraysInstancedANGLE(e,r,a,n)},e.drawElementsInstanced=function(e,r,a,n,i){t.drawElementsInstancedANGLE(e,r,a,n,i)})}(t),function(e){var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)})}(t),function(e){var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)})}(t),t.Nd=t.getExtension("EXT_disjoint_timer_query"),t.Sd=t.getExtension("WEBGL_multi_draw"),(t.getSupportedExtensions()||[]).forEach((function(e){0>e.indexOf("lose_context")&&0>e.indexOf("debug")&&t.getExtension(e)}))}}(a),r}(r,t):0}(e,o)))var _=jt[i].Oc}else _=e.getContext("2d");return _?(a&&(r||w(void 0===nr,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),t.Pc=_,r&&(Kt=jt[i],t.Pc=nr=Kt&&Kt.Oc),t.Wd=r,wt.forEach((function(e){e()})),function(){function e(){gt=document.pointerLockElement===t.canvas||document.mozPointerLockElement===t.canvas||document.webkitPointerLockElement===t.canvas||document.msPointerLockElement===t.canvas}if(t.preloadPlugins||(t.preloadPlugins=[]),!Mt){Mt=!0;try{Lt=!0}catch(e){Lt=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}zt="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Lt?null:console.log("warning: no BlobBuilder"),Ot="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,t.cd||void 0!==Ot||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),t.cd=!0),t.preloadPlugins.push({canHandle:function(e){return!t.cd&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,r,a,n){var i=null;if(Lt)try{(i=new Blob([e],{type:Ft(r)})).size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:Ft(r)}))}catch(e){!function(e){u||(u={}),u[e]||(u[e]=1,d(e))}("Blob constructor present but fails: "+e+"; falling back to blob builder")}i||((i=new zt).append(new Uint8Array(e).buffer),i=i.getBlob());var o=Ot.createObjectURL(i),s=new Image;s.onload=function(){w(s.complete,"Image "+r+" could not be decoded");var n=document.createElement("canvas");n.width=s.width,n.height=s.height,n.getContext("2d").drawImage(s,0,0),t.preloadedImages[r]=n,Ot.revokeObjectURL(o),a&&a(e)},s.onerror=function(){console.log("Image "+o+" could not be decoded"),n&&n()},s.src=o}}),t.preloadPlugins.push({canHandle:function(e){return!t.Td&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,r,a,n){function i(n){s||(s=!0,t.preloadedAudios[r]=n,a&&a(e))}function o(){s||(s=!0,t.preloadedAudios[r]=new Audio,n&&n())}var s=!1;if(!Lt)return o();try{var _=new Blob([e],{type:Ft(r)})}catch(e){return o()}_=Ot.createObjectURL(_);var c=new Audio;c.addEventListener("canplaythrough",(function(){i(c)}),!1),c.onerror=function(){if(!s){console.log("warning: browser could not fully decode audio "+r+", trying slower base64 approach");for(var t="",a=0,n=0,o=0;o<e.length;o++)for(a=a<<8|e[o],n+=8;6<=n;){var _=a>>n-6&63;n-=6,t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_]}2==n?(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&a)<<4],t+="=="):4==n&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&a)<<2],t+="="),c.src="data:audio/x-"+r.substr(-3)+";base64,"+t,i(c)}},c.src=_,xt((function(){i(c)}),1e4)}});var r=t.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),t.elementPointerLock&&r.addEventListener("click",(function(e){!gt&&t.canvas.requestPointerLock&&(t.canvas.requestPointerLock(),e.preventDefault())}),!1))}}()),_):null}var vt=!1,Et=void 0,At=void 0;function Tt(){return!!bt&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)}var Rt=0;function kt(e){if("function"==typeof requestAnimationFrame)requestAnimationFrame(e);else{var t=Date.now();if(0===Rt)Rt=t+1e3/60;else for(;t+2>=Rt;)Rt+=1e3/60;setTimeout(e,Math.max(Rt-t,0))}}function xt(e,t){setTimeout((function(){nt(e)}),t)}function Ft(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}var Mt,Lt,zt,Ot,It=[];function Pt(){var e=t.canvas;It.forEach((function(t){t(e.width,e.height)}))}function St(e,r,a){r&&a?(e.Jd=r,e.od=a):(r=e.Jd,a=e.od);var n=r,i=a;if(t.forcedAspectRatio&&0<t.forcedAspectRatio&&(n/i<t.forcedAspectRatio?n=Math.round(i*t.forcedAspectRatio):i=Math.round(n/t.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/n,screen.height/i);n=Math.round(n*o),i=Math.round(i*o)}At?(e.width!=n&&(e.width=n),e.height!=i&&(e.height=i),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=r&&(e.width=r),e.height!=a&&(e.height=a),void 0!==e.style&&(n!=r||i!=a?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",i+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}function Bt(){return!1}t._emscripten_is_main_browser_thread=Bt;var Dt,Ut=[];function Ct(e,t){F[e>>2]=t,F[e+4>>2]=t/4294967296|0}function Vt(e,t,r,a,n){function i(t){var r=0,a=0;t&&(a=y.response?y.response.byteLength:0,r=ur(a),T.set(new Uint8Array(y.response),r)),F[e+12>>2]=r,Ct(e+16,a)}var o=F[e+8>>2];if(o){var s=I(o),_=e+112,c=I(_);c||(c="GET");var f=F[_+52>>2],u=F[_+56>>2],l=!!F[_+60>>2],p=F[_+68>>2],d=F[_+72>>2];o=F[_+76>>2];var h=F[_+80>>2],m=F[_+84>>2];_=F[_+88>>2];var b=!!(1&f),g=!!(2&f);f=!!(64&f),p=p?I(p):void 0,d=d?I(d):void 0;var w=h?I(h):void 0,y=new XMLHttpRequest;if(y.withCredentials=l,y.open(c,s,!f,p,d),f||(y.timeout=u),y.Rd=s,y.responseType="arraybuffer",h&&y.overrideMimeType(w),o)for(;(c=F[o>>2])&&(s=F[o+4>>2]);)o+=8,c=I(c),s=I(s),y.setRequestHeader(c,s);Ut.push(y),F[e+0>>2]=Ut.length,o=m&&_?T.slice(m,m+_):null,y.onload=function(a){i(b&&!g);var n=y.response?y.response.byteLength:0;Ct(e+24,0),n&&Ct(e+32,n),k[e+40>>1]=y.readyState,k[e+42>>1]=y.status,y.statusText&&P(y.statusText,T,e+44,64),200<=y.status&&300>y.status?t&&t(e,y,a):r&&r(e,y,a)},y.onerror=function(t){i(b);var a=y.status;Ct(e+24,0),Ct(e+32,y.response?y.response.byteLength:0),k[e+40>>1]=y.readyState,k[e+42>>1]=a,r&&r(e,y,t)},y.ontimeout=function(t){r&&r(e,y,t)},y.onprogress=function(t){var r=b&&g&&y.response?y.response.byteLength:0,n=0;b&&g&&(n=ur(r),T.set(new Uint8Array(y.response),n)),F[e+12>>2]=n,Ct(e+16,r),Ct(e+24,t.loaded-r),Ct(e+32,t.total),k[e+40>>1]=y.readyState,3<=y.readyState&&0===y.status&&0<t.loaded&&(y.status=200),k[e+42>>1]=y.status,y.statusText&&P(y.statusText,T,e+44,64),a&&a(e,y,t),n&&fr(n)},y.onreadystatechange=function(t){k[e+40>>1]=y.readyState,2<=y.readyState&&(k[e+42>>1]=y.status),n&&n(e,y,t)};try{y.send(o)}catch(t){r&&r(e,y,t)}}else r(e,0,"no url specified!")}function Nt(e,t,r,a){var n=Dt;if(n){var i=F[e+112+64>>2];i||(i=F[e+8>>2]);var o=I(i);try{var s=n.transaction(["FILES"],"readwrite").objectStore("FILES").put(t,o);s.onsuccess=function(){k[e+40>>1]=4,k[e+42>>1]=200,P("OK",T,e+44,64),r(e,0,o)},s.onerror=function(t){k[e+40>>1]=4,k[e+42>>1]=413,P("Payload Too Large",T,e+44,64),a(e,0,t)}}catch(t){a(e,0,t)}}else a(e,0,"IndexedDB not available!")}var Ht,Wt={};function Gt(){if(!Ht){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:s||"./this.program"};for(e in Wt)t[e]=Wt[e];var r=[];for(e in t)r.push(e+"="+t[e]);Ht=r}return Ht}var Yt=1,Xt=[],jt=[];function qt(e){for(var t=Yt++,r=e.length;r<t;r++)e[r]=null;return t}var Zt,Kt,Jt,$t={};function Qt(e){return 0==e%4&&(0!=e%100||0==e%400)}function er(e,t){for(var r=0,a=0;a<=t;r+=e[a++]);return r}var tr=[31,29,31,30,31,30,31,31,30,31,30,31],rr=[31,28,31,30,31,30,31,31,30,31,30,31];function ar(e,t){for(e=new Date(e.getTime());0<t;){var r=e.getMonth(),a=(Qt(e.getFullYear())?tr:rr)[r];if(!(t>a-e.getDate())){e.setDate(e.getDate()+t);break}t-=a-e.getDate()+1,e.setDate(1),11>r?e.setMonth(r+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}var nr,ir=[];function or(e,t,r,a){e||(e=this),this.parent=e,this.sc=e.sc,this.Bc=null,this.id=ye++,this.name=t,this.mode=r,this.hc={},this.jc={},this.Cc=a}function sr(e,t){var r=Array(S(e)+1);return e=P(e,r,0,r.length),t&&(r.length=e),r}Object.defineProperties(or.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}}}),qe(),ve=Array(4096),Ue(me,"/"),Ve("/tmp"),Ve("/home"),Ve("/home/web_user"),function(){Ve("/dev"),De(259,{read:function(){return 0},write:function(e,t,r,a){return a}}),Ne("/dev/null",259),le(1280,de),le(1536,he),Ne("/dev/tty",1280),Ne("/dev/tty1",1536);var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}return function(){K("randomDevice")}}();Ze("random",e),Ze("urandom",e),Ve("/dev/shm"),Ve("/dev/shm/tmp")}(),function(){Ve("/proc");var e=Ve("/proc/self");Ve("/proc/self/fd"),Ue({sc:function(){var t=Le(e,"fd",16895,73);return t.hc={Ac:function(e,t){var r=we[+t];if(!r)throw new Te(8);return(e={parent:null,sc:{ad:"fake"},hc:{Dc:function(){return r.path}}}).parent=e}},t}},"/proc/self/fd")}(),t.requestFullscreen=function(e,r){!function(e,r){function a(){bt=!1;var e=n.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.exitFullscreen=Tt,Et&&n.requestPointerLock(),bt=!0,At?("undefined"!=typeof SDL&&(x[SDL.screen>>2]=8388608|F[SDL.screen>>2]),St(t.canvas),Pt()):St(n)):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),At?("undefined"!=typeof SDL&&(x[SDL.screen>>2]=-8388609&F[SDL.screen>>2]),St(t.canvas),Pt()):St(n)),t.onFullScreen&&t.onFullScreen(bt),t.onFullscreen&&t.onFullscreen(bt)}void 0===(Et=e)&&(Et=!0),void 0===(At=r)&&(At=!1);var n=t.canvas;vt||(vt=!0,document.addEventListener("fullscreenchange",a,!1),document.addEventListener("mozfullscreenchange",a,!1),document.addEventListener("webkitfullscreenchange",a,!1),document.addEventListener("MSFullscreenChange",a,!1));var i=document.createElement("div");n.parentNode.insertBefore(i,n),i.appendChild(n),i.requestFullscreen=i.requestFullscreen||i.mozRequestFullScreen||i.msRequestFullscreen||(i.webkitRequestFullscreen?function(){i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(i.webkitRequestFullScreen?function(){i.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i.requestFullscreen()}(e,r)},t.requestAnimationFrame=function(e){kt(e)},t.setCanvasSize=function(e,r,a){St(t.canvas,e,r),a||Pt()},t.pauseMainLoop=function(){ct=null,ft++},t.resumeMainLoop=function(){ft++;var e=lt,r=pt,a=ut;ut=null,function(e){function r(){if(a<ft){if(!h)try{Er(b)}catch(e){if(!(e instanceof yr))throw e}return!1}return!0}w(!ut,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),ut=e;var a=ft;_t=!1,ot=function(){if(!g)if(0<ht.length){var a=Date.now(),n=ht.shift();if(n.md(n.Fc),st){var i=st,o=0==i%1?i-1:Math.floor(i);st=n.Md?o:(8*i+(o+.5))/9}console.log('main loop blocker "'+n.name+'" took '+(Date.now()-a)+" ms"),t.setStatus&&(a=t.statusMessage||"Please wait...",i=mt.Od,(n=st)?n<i?t.setStatus(a+" ("+(i-n)+"/"+i+")"):t.setStatus(a):t.setStatus("")),r()&&setTimeout(ot,0)}else r()&&(dt=dt+1|0,1==lt&&1<pt&&0!=dt%pt?ct():(0==lt&&(it=te()),g||t.preMainLoop&&!1===t.preMainLoop()||(nt(e),t.postMainLoop&&t.postMainLoop()),r()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.wd&&SDL.audio.wd(),ct())))}}(a),function(e,r){if(lt=e,pt=r,ut)if(_t||(_t=!0),0==e)ct=function(){var e=0|Math.max(0,it+r-te());setTimeout(ot,e)};else if(1==e)ct=function(){kt(ot)};else if(2==e){if("undefined"==typeof setImmediate){var a=[];addEventListener("message",(function(e){"setimmediate"!==e.data&&"setimmediate"!==e.data.target||(e.stopPropagation(),a.shift()())}),!0),setImmediate=function(e){a.push(e),void 0===t.setImmediates&&(t.setImmediates=[]),t.setImmediates.push(e),postMessage({target:"setimmediate"})}}ct=function(){setImmediate(ot)}}}(e,r),ct()},t.getUserMedia=function(){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(void 0)},t.createContext=function(e,t,r,a){return yt(e,t,r,a)},function(e,t){try{var r=indexedDB.open("emscripten_filesystem",1)}catch(e){return void t()}r.onupgradeneeded=function(e){(e=e.target.result).objectStoreNames.contains("FILES")&&e.deleteObjectStore("FILES"),e.createObjectStore("FILES")},r.onsuccess=function(e){!function(e){Dt=e,Z()}(e.target.result)},r.onerror=function(e){t()}}(0,(function(){Dt=!1,Z()})),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER||q();var _r={H:function(e,t){return ne(e,t)},a:function(e){return ur(e+16)+16},b:function(e,t,r){throw new ie(e).pd(t,r),e},e:function(e,t,r){tt=r;try{var a=at(e);switch(t){case 0:var n=rt();return 0>n?-28:Xe(a.path,a.flags,0,n).tc;case 1:case 2:case 13:case 14:return 0;case 3:return a.flags;case 4:return n=rt(),a.flags|=n,0;case 12:return n=rt(),R[n+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return x[pr()>>2]=28,-1}}catch(e){return void 0!==Qe&&e instanceof Te||K(e),-e.mc}},G:function(e,t,r){try{var a=at(e);if(!a.uc){var n=ke(a.path,{Gc:!0}).node;if(!n.hc.Ic)throw new Te(54);var i=n.hc.Ic(n);a.uc=i}e=0;for(var o=je(a,0,1),s=Math.floor(o/280);s<a.uc.length&&e+280<=r;){var _=a.uc[s];if("."===_[0])var c=1,f=4;else{var u=Me(a.node,_);c=u.id,f=8192==(61440&u.mode)?2:16384==(61440&u.mode)?4:40960==(61440&u.mode)?10:8}ee=[c>>>0,(Q=c,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],x[t+e>>2]=ee[0],x[t+e+4>>2]=ee[1],ee=[280*(s+1)>>>0,(Q=280*(s+1),1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],x[t+e+8>>2]=ee[0],x[t+e+12>>2]=ee[1],R[t+e+16>>1]=280,A[t+e+18>>0]=f,P(_,T,t+e+19,256),e+=280,s+=1}return je(a,280*s,0),e}catch(e){return void 0!==Qe&&e instanceof Te||K(e),-e.mc}},n:function(){return 42},B:function(e,t,r){tt=r;try{var a=at(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return a.lc?0:-59;case 21519:if(!a.lc)return-59;var n=rt();return x[n>>2]=0;case 21520:return a.lc?-28:-59;case 21531:if(e=n=rt(),!a.jc.rd)throw new Te(59);return a.jc.rd(a,t,e);default:K("bad ioctl syscall "+t)}}catch(e){return void 0!==Qe&&e instanceof Te||K(e),-e.mc}},C:function(e,t){try{return et(Ye,e=I(e),t)}catch(e){return void 0!==Qe&&e instanceof Te||K(e),-e.mc}},p:function(e,t,r){tt=r;try{return Xe(I(e),t,r?rt():0).tc}catch(e){return void 0!==Qe&&e instanceof Te||K(e),-e.mc}},I:function(e,t){try{return et(Ge,e=I(e),t)}catch(e){return void 0!==Qe&&e instanceof Te||K(e),-e.mc}},E:function(e,t){try{return He(e=I(e),t=I(t)),0}catch(e){return void 0!==Qe&&e instanceof Te||K(e),-e.mc}},F:function(e){try{if(!e)return-21;var t={__size__:390,domainname:325,machine:260,nodename:65,release:130,sysname:0,version:195};return D("Emscripten",e+t.sysname),D("emscripten",e+t.nodename),D("1.0",e+t.release),D("#1",e+t.version),D("wasm32",e+t.machine),0}catch(e){return void 0!==Qe&&e instanceof Te||K(e),-e.mc}},D:function(e){try{var t=ke(e=I(e),{parent:!0}).node,r=ce(e),a=Me(t,r);e:{try{var n=Me(t,r)}catch(e){var i=e.mc;break e}i=Ie(t,"wx")||(16384==(61440&n.mode)?31:0)}if(i)throw new Te(i);if(!t.hc.Nc)throw new Te(63);if(a.Bc)throw new Te(10);try{Ae.willDeletePath&&Ae.willDeletePath(e)}catch(t){d("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.hc.Nc(t,r);var o=Fe(a.parent.id,a.name);if(ve[o]===a)ve[o]=a.wc;else for(var s=ve[o];s;){if(s.wc===a){s.wc=a.wc;break}s=s.wc}try{Ae.onDeletePath&&Ae.onDeletePath(e)}catch(t){d("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}return 0}catch(e){return void 0!==Qe&&e instanceof Te||K(e),-e.mc}},K:function(e){delete Ut[e-1]},c:function(){K()},Q:ne,O:function(e,t){return e-t},R:function(){self.postMessage({t:"gfx"})},s:function(){var e=new URL(location.origin).hostname;if(0===e.length&&(e=new URL(location.href.replace("blob:","")).hostname),/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e))0===e.indexOf("10.")&&(e="10.*"),0===e.indexOf("192.168.")&&(e="192.168.*"),0===e.indexOf("172.")&&(e="172.*"),0===e.indexOf("127.")&&(e="127.*");else{var t=new RegExp("("+String.fromCharCode(92)+".ngrok"+String.fromCharCode(92)+".io)$","i");t.test(e)&&(e="*.ngrok.io"),(t=new RegExp("("+String.fromCharCode(92)+".arweb"+String.fromCharCode(92)+".app)$","i")).test(e)&&(e="*.arweb.app")}t=S(e)+1;var r=ur(t);return P(e,T,r,t+1),r},S:function(){self.postMessage({t:"licerr"})},l:function(e,t,r){var a;for(ir.length=0,r>>=2;a=T[t++];)(a=105>a)&&1&r&&r++,ir.push(a?L[r++>>1]:x[r]),++r;return re[e].apply(null,ir)},k:function(e,t,r){function a(){C.get(e)(t)}0<=r?xt(a,r):function(e){kt((function(){nt(e)}))}(a)},J:function(){return 2147483648},M:Bt,u:function(e,t,r){T.copyWithin(e,t,t+r)},v:function(e){var t=T.length;if(2147483648<e)return!1;for(var r=1;4>=r;r*=2){var a=t*(1+.2/r);a=Math.min(a,e+100663296),0<(a=Math.max(e,a))%65536&&(a+=65536-a%65536);e:{try{m.grow(Math.min(2147483648,a)-E.byteLength+65535>>>16),U();var n=1;break e}catch(e){}n=void 0}if(n)return!0}return!1},L:function(e,t,r,a,n){function i(e,r){Nt(e,r.response,(function(e){nt((function(){l?C.get(l)(e):t&&t(e)}))}),(function(e){nt((function(){l?C.get(l)(e):t&&t(e)}))}))}function o(e){nt((function(){h?C.get(h)(e):n&&n(e)}))}function s(e){nt((function(){p?C.get(p)(e):r&&r(e)}))}function _(e){nt((function(){d?C.get(d)(e):a&&a(e)}))}function c(e){nt((function(){l?C.get(l)(e):t&&t(e)}))}var f=e+112,u=I(f),l=F[f+36>>2],p=F[f+40>>2],d=F[f+44>>2],h=F[f+48>>2],m=F[f+52>>2],b=!!(4&m),g=!!(32&m);if(m=!!(16&m),"EM_IDB_STORE"===u)u=F[f+84>>2],Nt(e,T.slice(u,u+F[f+88>>2]),c,s);else if("EM_IDB_DELETE"===u)!function(e,t,r){var a=Dt;if(a){var n=F[e+112+64>>2];n||(n=F[e+8>>2]),n=I(n);try{var i=a.transaction(["FILES"],"readwrite").objectStore("FILES").delete(n);i.onsuccess=function(r){r=r.target.result,F[e+12>>2]=0,Ct(e+16,0),Ct(e+24,0),Ct(e+32,0),k[e+40>>1]=4,k[e+42>>1]=200,P("OK",T,e+44,64),t(e,0,r)},i.onerror=function(t){k[e+40>>1]=4,k[e+42>>1]=404,P("Not Found",T,e+44,64),r(e,0,t)}}catch(t){r(e,0,t)}}else r(e,0,"IndexedDB not available!")}(e,c,s);else if(m){if(g)return 0;Vt(e,b?i:c,s,_,o)}else!function(e,t,r){var a=Dt;if(a){var n=F[e+112+64>>2];n||(n=F[e+8>>2]),n=I(n);try{var i=a.transaction(["FILES"],"readonly").objectStore("FILES").get(n);i.onsuccess=function(a){if(a.target.result){var n=(a=a.target.result).byteLength||a.length,i=ur(n);T.set(new Uint8Array(a),i),F[e+12>>2]=i,Ct(e+16,n),Ct(e+24,0),Ct(e+32,n),k[e+40>>1]=4,k[e+42>>1]=200,P("OK",T,e+44,64),t(e,0,a)}else k[e+40>>1]=4,k[e+42>>1]=404,P("Not Found",T,e+44,64),r(e,0,"no data")},i.onerror=function(t){k[e+40>>1]=4,k[e+42>>1]=404,P("Not Found",T,e+44,64),r(e,0,t)}}catch(t){r(e,0,t)}}else r(e,0,"IndexedDB not available!")}(e,c,g?s:b?function(e){Vt(e,i,s,_,o)}:function(e){Vt(e,c,s,_,o)});return e},y:function(e,t){try{var r=0;return Gt().forEach((function(a,n){var i=t+r;x[e+4*n>>2]=i,D(a,i),r+=a.length+1})),0}catch(e){return void 0!==Qe&&e instanceof Te||K(e),e.mc}},z:function(e,t){try{var r=Gt();x[e>>2]=r.length;var a=0;return r.forEach((function(e){a+=e.length+1})),x[t>>2]=a,0}catch(e){return void 0!==Qe&&e instanceof Te||K(e),e.mc}},N:function(e){Er(e)},g:function(e){try{var t=at(e);if(null===t.tc)throw new Te(8);t.uc&&(t.uc=null);try{t.jc.close&&t.jc.close(t)}catch(e){throw e}finally{we[t.tc]=null}return t.tc=null,0}catch(e){return void 0!==Qe&&e instanceof Te||K(e),e.mc}},A:function(e,t,r,a){try{e:{for(var n=at(e),i=e=0;i<r;i++){var o=x[t+(8*i+4)>>2],s=n,_=x[t+8*i>>2],c=o,f=void 0,u=A;if(0>c||0>f)throw new Te(28);if(null===s.tc)throw new Te(8);if(1==(2097155&s.flags))throw new Te(8);if(16384==(61440&s.node.mode))throw new Te(31);if(!s.jc.read)throw new Te(28);var l=void 0!==f;if(l){if(!s.seekable)throw new Te(70)}else f=s.position;var p=s.jc.read(s,u,_,c,f);l||(s.position+=p);var d=p;if(0>d){var h=-1;break e}if(e+=d,d<o)break}h=e}return x[a>>2]=h,0}catch(e){return void 0!==Qe&&e instanceof Te||K(e),e.mc}},t:function(e,t,r,a,n){try{var i=at(e);return-9007199254740992>=(e=4294967296*r+(t>>>0))||9007199254740992<=e?-61:(je(i,e,a),ee=[i.position>>>0,(Q=i.position,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],x[n>>2]=ee[0],x[n+4>>2]=ee[1],i.uc&&0===e&&0===a&&(i.uc=null),0)}catch(e){return void 0!==Qe&&e instanceof Te||K(e),e.mc}},j:function(e,t,r,a){try{e:{for(var n=at(e),i=e=0;i<r;i++){var o=n,s=x[t+8*i>>2],_=x[t+(8*i+4)>>2],c=void 0,f=A;if(0>_||0>c)throw new Te(28);if(null===o.tc)throw new Te(8);if(0==(2097155&o.flags))throw new Te(8);if(16384==(61440&o.node.mode))throw new Te(31);if(!o.jc.write)throw new Te(28);o.seekable&&1024&o.flags&&je(o,0,2);var u=void 0!==c;if(u){if(!o.seekable)throw new Te(70)}else c=o.position;var l=o.jc.write(o,f,s,_,c,void 0);u||(o.position+=l);try{o.path&&Ae.onWriteToFile&&Ae.onWriteToFile(o.path)}catch(e){d("FS.trackingDelegate['onWriteToFile']('"+o.path+"') threw an exception: "+e.message)}var p=l;if(0>p){var h=-1;break e}e+=p}h=e}return x[a>>2]=h,0}catch(e){return void 0!==Qe&&e instanceof Te||K(e),e.mc}},f:function(e){var t=Date.now();return x[e>>2]=t/1e3|0,x[e+4>>2]=t%1e3*1e3|0,0},m:function(e,t){nr.bindTexture(e,Xt[t])},o:function(e,t){for(var r=0;r<e;r++){var a=nr.createTexture(),n=a&&qt(Xt);a?(a.name=n,Xt[n]=a):Zt||(Zt=1282),x[t+4*r>>2]=n}},h:function(e,t,r,a,n,i,o,s,_){var c=nr,f=c.texImage2D;if(_){var u=s-5120;u=1==u?T:4==u?x:6==u?M:5==u||28922==u?F:k;var l=31-Math.clz32(u.BYTES_PER_ELEMENT);_=u.subarray(_>>l,_+n*(a*({5:3,6:4,8:2,29502:3,29504:4}[o-6402]||1)*(1<<l)+4-1&-4)>>l)}else _=null;f.call(c,e,t,r,a,n,i,o,s,_)},i:function(e,t,r){nr.texParameteri(e,t,r)},r:function e(t,r){return t=new Date(1e3*x[t>>2]),x[r>>2]=t.getUTCSeconds(),x[r+4>>2]=t.getUTCMinutes(),x[r+8>>2]=t.getUTCHours(),x[r+12>>2]=t.getUTCDate(),x[r+16>>2]=t.getUTCMonth(),x[r+20>>2]=t.getUTCFullYear()-1900,x[r+24>>2]=t.getUTCDay(),x[r+36>>2]=0,x[r+32>>2]=0,x[r+28>>2]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,e.Tc||(e.Tc=B("GMT")),x[r+40>>2]=e.Tc,r},q:function(e,t){!function(){function e(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(!Jt){Jt=!0;var t=(new Date).getFullYear(),r=new Date(t,0,1),a=new Date(t,6,1);t=r.getTimezoneOffset();var n=a.getTimezoneOffset(),i=Math.max(t,n);x[mr()>>2]=60*i,x[hr()>>2]=Number(t!=n),r=e(r),a=e(a),r=B(r),a=B(a),n<t?(x[dr()>>2]=r,x[dr()+4>>2]=a):(x[dr()>>2]=a,x[dr()+4>>2]=r)}}(),e=new Date(1e3*x[e>>2]),x[t>>2]=e.getSeconds(),x[t+4>>2]=e.getMinutes(),x[t+8>>2]=e.getHours(),x[t+12>>2]=e.getDate(),x[t+16>>2]=e.getMonth(),x[t+20>>2]=e.getFullYear()-1900,x[t+24>>2]=e.getDay();var r=new Date(e.getFullYear(),0,1);x[t+28>>2]=(e.getTime()-r.getTime())/864e5|0,x[t+36>>2]=-60*e.getTimezoneOffset();var a=new Date(e.getFullYear(),6,1).getTimezoneOffset();return e=0|(a!=(r=r.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(r,a)),x[t+32>>2]=e,e=x[dr()+(e?4:0)>>2],x[t+40>>2]=e,t},P:function(){return 6},w:function(){return 28},x:function(e,t,r,a){return function(e,t,r,a){function n(e,t,r){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=r[0]+e;return e}function i(e,t){return n(e,t,"0")}function o(e,t){function r(e){return 0>e?-1:0<e?1:0}var a;return 0===(a=r(e.getFullYear()-t.getFullYear()))&&0===(a=r(e.getMonth()-t.getMonth()))&&(a=r(e.getDate()-t.getDate())),a}function s(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function _(e){e=ar(new Date(e.oc+1900,0,1),e.Mc);var t=new Date(e.getFullYear()+1,0,4),r=s(new Date(e.getFullYear(),0,4));return t=s(t),0>=o(r,e)?0>=o(t,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var c=x[a+40>>2];for(var f in a={Gd:x[a>>2],Fd:x[a+4>>2],Kc:x[a+8>>2],Ec:x[a+12>>2],zc:x[a+16>>2],oc:x[a+20>>2],Lc:x[a+24>>2],Mc:x[a+28>>2],Vd:x[a+32>>2],Ed:x[a+36>>2],Hd:c?I(c):""},r=I(r),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(f,"g"),c[f]);var u="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),l="January February March April May June July August September October November December".split(" ");for(f in c={"%a":function(e){return u[e.Lc].substring(0,3)},"%A":function(e){return u[e.Lc]},"%b":function(e){return l[e.zc].substring(0,3)},"%B":function(e){return l[e.zc]},"%C":function(e){return i((e.oc+1900)/100|0,2)},"%d":function(e){return i(e.Ec,2)},"%e":function(e){return n(e.Ec,2," ")},"%g":function(e){return _(e).toString().substring(2)},"%G":function(e){return _(e)},"%H":function(e){return i(e.Kc,2)},"%I":function(e){return 0==(e=e.Kc)?e=12:12<e&&(e-=12),i(e,2)},"%j":function(e){return i(e.Ec+er(Qt(e.oc+1900)?tr:rr,e.zc-1),3)},"%m":function(e){return i(e.zc+1,2)},"%M":function(e){return i(e.Fd,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.Kc&&12>e.Kc?"AM":"PM"},"%S":function(e){return i(e.Gd,2)},"%t":function(){return"\t"},"%u":function(e){return e.Lc||7},"%U":function(e){var t=new Date(e.oc+1900,0,1),r=0===t.getDay()?t:ar(t,7-t.getDay());return 0>o(r,e=new Date(e.oc+1900,e.zc,e.Ec))?i(Math.ceil((31-r.getDate()+(er(Qt(e.getFullYear())?tr:rr,e.getMonth()-1)-31)+e.getDate())/7),2):0===o(r,t)?"01":"00"},"%V":function(e){var t=new Date(e.oc+1901,0,4),r=s(new Date(e.oc+1900,0,4));t=s(t);var a=ar(new Date(e.oc+1900,0,1),e.Mc);return 0>o(a,r)?"53":0>=o(t,a)?"01":i(Math.ceil((r.getFullYear()<e.oc+1900?e.Mc+32-r.getDate():e.Mc+1-r.getDate())/7),2)},"%w":function(e){return e.Lc},"%W":function(e){var t=new Date(e.oc,0,1),r=1===t.getDay()?t:ar(t,0===t.getDay()?1:7-t.getDay()+1);return 0>o(r,e=new Date(e.oc+1900,e.zc,e.Ec))?i(Math.ceil((31-r.getDate()+(er(Qt(e.getFullYear())?tr:rr,e.getMonth()-1)-31)+e.getDate())/7),2):0===o(r,t)?"01":"00"},"%y":function(e){return(e.oc+1900).toString().substring(2)},"%Y":function(e){return e.oc+1900},"%z":function(e){var t=0<=(e=e.Ed);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Hd},"%%":function(){return"%"}})0<=r.indexOf(f)&&(r=r.replace(new RegExp(f,"g"),c[f](a)));return(f=sr(r,!1)).length>t?0:(A.set(f,e),f.length-1)}(e,t,r,a)},d:function(e){var t=Date.now()/1e3|0;return e&&(x[e>>2]=t),t}},cr=function(){function e(e){t.asm=e.exports,m=t.asm.T,U(),C=t.asm.Y,N.unshift(t.asm.U),Z()}var r={a:_r};if(q(),t.instantiateWasm)try{return t.instantiateWasm(r,e)}catch(e){return d("Module.instantiateWasm callback failed with error: "+e),!1}return r=function(e){var t=J;try{e:{try{if(t==J&&l){var r=new Uint8Array(l);break e}if(c){r=c(t);break e}throw"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"}catch(e){K(e)}r=void 0}var a=new WebAssembly.Module(r),n=new WebAssembly.Instance(a,e)}catch(t){throw e=t.toString(),d("failed to compile wasm module: "+e),(0<=e.indexOf("imported Memory")||0<=e.indexOf("memory import"))&&d("Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)."),t}return[n,a]}(r),e(r[0]),t.asm}();t.___wasm_call_ctors=cr.U,t._zappar_has_initialized=cr.V,t._zappar_invert=cr.W,t._zappar_loaded=cr.X,t._zappar_pipeline_create=cr.Z,t._zappar_pipeline_destroy=cr._,t._zappar_pipeline_camera_frame_submit=cr.$,t._zappar_pipeline_camera_frame_submit_raw_pointer=cr.aa,t._zappar_pipeline_frame_update=cr.ba,t._zappar_pipeline_camera_frame_user_data=cr.ca,t._zappar_pipeline_camera_model=cr.da,t._zappar_pipeline_frame_number=cr.ea,t._zappar_pipeline_motion_accelerometer_submit=cr.fa,t._zappar_pipeline_motion_rotation_rate_submit=cr.ga,t._zappar_pipeline_motion_attitude_submit=cr.ha,t._zappar_pipeline_motion_attitude_matrix_submit=cr.ia,t._zappar_pipeline_camera_frame_user_facing=cr.ja,t._zappar_pipeline_camera_frame_texture_matrix=cr.ka,t._zappar_pipeline_camera_pose_with_attitude=cr.la,t._zappar_pipeline_camera_pose_with_origin=cr.ma,t._zappar_pipeline_camera_frame_camera_attitude=cr.na,t._zappar_pipeline_camera_frame_device_attitude=cr.oa,t._zappar_pipeline_camera_frame_texture_gl=cr.pa,t._zappar_pipeline_camera_frame_upload_gl=cr.qa,t._zappar_pipeline_sequence_record_start=cr.ra,t._zappar_pipeline_sequence_record_stop=cr.sa,t._zappar_pipeline_sequence_record_clear=cr.ta,t._zappar_pipeline_sequence_record_device_attitude_matrices_set=cr.ua,t._zappar_pipeline_sequence_record_data_size=cr.va,t._zappar_pipeline_sequence_record_data=cr.wa,t._zappar_pipeline_process_gl=cr.xa,t._zappar_pipeline_camera_pose_default=cr.ya,t._zappar_instant_world_tracker_create=cr.za,t._zappar_instant_world_tracker_destroy=cr.Aa,t._zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw=cr.Ba,t._zappar_instant_world_tracker_anchor_pose_raw=cr.Ca,t._zappar_instant_world_tracker_enabled_set=cr.Da,t._zappar_instant_world_tracker_enabled=cr.Ea,t._zappar_image_tracker_create=cr.Fa,t._zappar_image_tracker_destroy=cr.Ga,t._zappar_image_tracker_target_load_from_memory=cr.Ha,t.__Z42zappar_image_tracker_target_load_from_fileP23zappar_image_tracker_tiPKc=cr.Ia;var fr=t._free=cr.Ja;t._zappar_image_tracker_anchor_count=cr.Ka,t._zappar_image_tracker_anchor_id=cr.La,t._zappar_image_tracker_anchor_pose_raw=cr.Ma,t._zappar_image_tracker_enabled_set=cr.Na,t._zappar_image_tracker_enabled=cr.Oa,t._zappar_image_tracker_target_loaded_version=cr.Pa,t.__Z33zappar_image_tracker_target_countP23zappar_image_tracker_ti=cr.Qa,t.__Z46zappar_image_tracker_target_preview_compressedP23zappar_image_tracker_tii=cr.Ra,t.__Z51zappar_image_tracker_target_preview_compressed_sizeP23zappar_image_tracker_tii=cr.Sa,t.__Z55zappar_image_tracker_target_preview_compressed_mimetypeP23zappar_image_tracker_tii=cr.Ta,t.__Z40zappar_image_tracker_target_preview_rgbaP23zappar_image_tracker_tii=cr.Ua,t.__Z45zappar_image_tracker_target_preview_rgba_sizeP23zappar_image_tracker_tii=cr.Va,t.__Z46zappar_image_tracker_target_preview_rgba_widthP23zappar_image_tracker_tii=cr.Wa,t.__Z47zappar_image_tracker_target_preview_rgba_heightP23zappar_image_tracker_tii=cr.Xa,t.__Z38zappar_image_tracker_target_radius_topP23zappar_image_tracker_tii=cr.Ya,t.__Z41zappar_image_tracker_target_radius_bottomP23zappar_image_tracker_tii=cr.Za,t.__Z39zappar_image_tracker_target_side_lengthP23zappar_image_tracker_tii=cr._a,t.__Z49zappar_image_tracker_target_physical_scale_factorP23zappar_image_tracker_tii=cr.$a,t._zappar_face_tracker_create=cr.ab,t._zappar_face_tracker_destroy=cr.bb,t._zappar_face_tracker_model_load_from_memory=cr.cb,t._zappar_face_tracker_anchor_count=cr.db,t._zappar_face_tracker_anchor_id=cr.eb,t._zappar_face_tracker_anchor_pose_raw=cr.fb,t._zappar_face_tracker_anchor_identity_coefficients=cr.gb,t._zappar_face_tracker_anchor_expression_coefficients=cr.hb,t._zappar_face_tracker_enabled_set=cr.ib,t._zappar_face_tracker_enabled=cr.jb,t._zappar_face_tracker_max_faces_set=cr.kb,t._zappar_face_tracker_max_faces=cr.lb,t._zappar_face_tracker_model_loaded_version=cr.mb,t._zappar_face_landmark_create=cr.nb,t._zappar_face_landmark_destroy=cr.ob,t.__Z27zappar_face_landmark_updateP23zappar_face_landmark_tiPKfS2_i=cr.pb,t._zappar_face_landmark_anchor_pose=cr.qb,t._zappar_barcode_finder_create=cr.rb,t._zappar_barcode_finder_destroy=cr.sb,t._zappar_barcode_finder_found_number=cr.tb,t._zappar_barcode_finder_found_text=cr.ub,t._zappar_barcode_finder_enabled_set=cr.vb,t._zappar_barcode_finder_enabled=cr.wb,t._zappar_barcode_finder_found_format=cr.xb,t._zappar_barcode_finder_formats=cr.yb,t._zappar_barcode_finder_formats_set=cr.zb;var ur=t._malloc=cr.Ab;t._zappar_face_mesh_create=cr.Bb,t._zappar_face_mesh_destroy=cr.Cb,t.__Z33zappar_face_mesh_load_from_memoryP19zappar_face_mesh_tiPKciiiii=cr.Db,t.__Z29zappar_face_mesh_indices_sizeP19zappar_face_mesh_ti=cr.Eb,t.__Z25zappar_face_mesh_uvs_sizeP19zappar_face_mesh_ti=cr.Fb,t.__Z30zappar_face_mesh_vertices_sizeP19zappar_face_mesh_ti=cr.Gb,t.__Z31zappar_face_mesh_loaded_versionP19zappar_face_mesh_ti=cr.Hb,t.__Z25zappar_face_mesh_verticesP19zappar_face_mesh_ti=cr.Ib,t.__Z20zappar_face_mesh_uvsP19zappar_face_mesh_ti=cr.Jb,t.__Z24zappar_face_mesh_indicesP19zappar_face_mesh_ti=cr.Kb,t.__Z23zappar_face_mesh_updateP19zappar_face_mesh_tiPKfS2_i=cr.Lb,t.__Z29zappar_face_mesh_normals_sizeP19zappar_face_mesh_ti=cr.Mb,t.__Z24zappar_face_mesh_normalsP19zappar_face_mesh_ti=cr.Nb,t._zappar_camera_source_create=cr.Ob,t._zappar_camera_source_destroy=cr.Pb,t._zappar_camera_source_start=cr.Qb,t._zappar_camera_source_pause=cr.Rb,t._zappar_camera_default_device_id=cr.Sb,t._zappar_sequence_source_create=cr.Tb,t.__Z28zappar_sequence_source_startP25zappar_sequence_source_ti=cr.Ub,t.__Z39zappar_sequence_source_load_from_memoryP25zappar_sequence_source_tiPKci=cr.Vb,t.__Z28zappar_sequence_source_pauseP25zappar_sequence_source_ti=cr.Wb,t._zappar_sequence_source_destroy=cr.Xb,t._zappar_sequence_source_max_playback_fps_set=cr.Yb,t._zappar_log_level_set=cr.Zb,t._zappar_log_level=cr._b,t._zappar_analytics_project_id_set=cr.$b;var lr,pr=t.___errno_location=cr.ac,dr=t.__get_tzname=cr.bc,hr=t.__get_daylight=cr.cc,mr=t.__get_timezone=cr.dc,br=t.stackSave=cr.ec,gr=t.stackRestore=cr.fc,wr=t.stackAlloc=cr.gc;function yr(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function vr(){function e(){if(!lr&&(lr=!0,t.calledRun=!0,!g)){if(t.noFSInit||Se||(Se=!0,qe(),t.stdin=t.stdin,t.stdout=t.stdout,t.stderr=t.stderr,t.stdin?Ze("stdin",t.stdin):He("/dev/tty","/dev/stdin"),t.stdout?Ze("stdout",null,t.stdout):He("/dev/tty","/dev/stdout"),t.stderr?Ze("stderr",null,t.stderr):He("/dev/tty1","/dev/stderr"),Xe("/dev/stdin",0),Xe("/dev/stdout",1),Xe("/dev/stderr",1)),ae(N),Ee=!1,ae(H),r(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var e=t.postRun.shift();W.unshift(e)}ae(W)}}if(!(0<Y)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)G();ae(V),0<Y||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),e()}),1)):e())}}function Er(e){b=e,h||(t.onExit&&t.onExit(e),g=!0),_(e,new yr(e))}if(t.cwrap=function(e,t,r,a){var n=(r=r||[]).every((function(e){return"number"===e}));return"string"!==t&&n&&!a?y(e):function(){return v(e,t,r,arguments)}},t.setValue=function(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":A[e>>0]=t;break;case"i16":R[e>>1]=t;break;case"i32":x[e>>2]=t;break;case"i64":ee=[t>>>0,(Q=t,1<=+Math.abs(Q)?0<Q?(0|Math.min(+Math.floor(Q/4294967296),4294967295))>>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],x[e>>2]=ee[0],x[e+4>>2]=ee[1];break;case"float":M[e>>2]=t;break;case"double":L[e>>3]=t;break;default:K("invalid type for setValue: "+r)}},t.getValue=function(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return A[e>>0];case"i16":return R[e>>1];case"i32":case"i64":return x[e>>2];case"float":return M[e>>2];case"double":return L[e>>3];default:K("invalid type for getValue: "+t)}return null},t.UTF8ToString=I,j=function e(){lr||vr(),lr||(j=e)},t.run=vr,t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return vr(),e});const i=n;class o{constructor(e){this._messageSender=e,this._freeBufferPool=[],this._buffer=new ArrayBuffer(16),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=1,this._startOffset=-1,this._timeoutSet=!1,this._appender={int:e=>this.int(e),bool:e=>this.int(e?1:0),float:e=>this.float(e),string:e=>this.string(e),dataWithLength:e=>this.arrayBuffer(e),type:e=>this.int(e),matrix4x4:e=>this.float32ArrayBuffer(e),matrix3x3:e=>this.float32ArrayBuffer(e),identityCoefficients:e=>this.float32ArrayBuffer(e),expressionCoefficients:e=>this.float32ArrayBuffer(e),cameraModel:e=>this.float32ArrayBuffer(e),timestamp:e=>this.double(e),barcodeFormat:e=>this.int(e),faceLandmarkName:e=>this.int(e),instantTrackerTransformOrientation:e=>this.int(e),logLevel:e=>this.int(e)},this._freeBufferPool.push(new ArrayBuffer(16)),this._freeBufferPool.push(new ArrayBuffer(16))}bufferReturn(e){this._freeBufferPool.push(e)}_ensureArrayBuffer(e){let t,r=4*(this._offset+e+8);if(this._buffer&&this._buffer.byteLength>=r)return;if(!t){let e=r;e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,t=new ArrayBuffer(e)}let a=this._buffer?this._i32View:void 0;this._buffer=t,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),a&&this._i32View.set(a.subarray(0,this._offset))}sendMessage(e,t){this._ensureArrayBuffer(4),this._startOffset=this._offset,this._i32View[this._offset+1]=e,this._offset+=2,t(this._appender),this._i32View[this._startOffset]=this._offset-this._startOffset,this._startOffset=-1,this._sendOneTime()}_sendOneTime(){!1===this._timeoutSet&&(this._timeoutSet=!0,setTimeout((()=>{this._timeoutSet=!1,this._send()}),0))}_send(){0!==this._freeBufferPool.length?(this._i32View[0]=this._offset,this._messageSender(this._buffer),this._buffer=void 0,this._buffer=this._freeBufferPool.pop(),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=1,this._startOffset=-1):this._sendOneTime()}int(e){this._ensureArrayBuffer(1),this._i32View[this._offset]=e,this._offset++}double(e){this._ensureArrayBuffer(2),this._offset%2==1&&this._offset++,this._f64View[this._offset/2]=e,this._offset+=2}float(e){this._ensureArrayBuffer(1),this._f32View[this._offset]=e,this._offset++}int32Array(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._i32View[this._offset+t]=e[t];this._offset+=e.length}float32Array(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._f32View[this._offset+t]=e[t];this._offset+=e.length}booleanArray(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._i32View[this._offset+t]=e[t]?1:0;this._offset+=e.length}uint8ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.byteLength,this._offset++,this._u8View.set(e,4*this._offset),this._offset+=e.byteLength>>2,0!=(3&e.byteLength)&&this._offset++}arrayBuffer(e){let t=new Uint8Array(e);this.uint8ArrayBuffer(t)}uint8ClampedArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.byteLength,this._offset++,this._u8cView.set(e,4*this._offset),this._offset+=e.byteLength>>2,0!=(3&e.byteLength)&&this._offset++}float32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._f32View.set(e,this._offset),this._offset+=e.length}uint16ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++;let t=2*this._offset;this._u16View.set(e,t),this._offset+=e.length>>1,0!=(1&e.length)&&this._offset++}int32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._i32View.set(e,this._offset),this._offset+=e.length}uint32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._u32View.set(e,this._offset),this._offset+=e.length}string(e){let t=(new TextEncoder).encode(e);this._ensureArrayBuffer(t.byteLength/4),this._i32View[this._offset]=t.byteLength,this._offset++,this._u8View.set(t,4*this._offset),this._offset+=t.byteLength>>2,0!=(3&t.byteLength)&&this._offset++}}class s{constructor(){this._buffer=new ArrayBuffer(0),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=0,this._length=0,this._startOffset=-1,this._processor={int:()=>this._i32View[this._startOffset++],bool:()=>1===this._i32View[this._startOffset++],type:()=>this._i32View[this._startOffset++],float:()=>this._f32View[this._startOffset++],timestamp:()=>{this._startOffset%2==1&&this._startOffset++;let e=this._f64View[this._startOffset/2];return this._startOffset+=2,e},string:()=>{let e=this._i32View[this._startOffset++],t=(new TextDecoder).decode(new Uint8Array(this._buffer,4*this._startOffset,e));return this._startOffset+=e>>2,0!=(3&e)&&this._startOffset++,t},dataWithLength:()=>{let e=this._i32View[this._startOffset++],t=new Uint8Array(e);return t.set(this._u8View.subarray(4*this._startOffset,4*this._startOffset+e)),this._startOffset+=t.byteLength>>2,0!=(3&t.byteLength)&&this._startOffset++,t.buffer},matrix4x4:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+16)),this._startOffset+=e,t},matrix3x3:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+9)),this._startOffset+=e,t},identityCoefficients:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+50)),this._startOffset+=e,t},expressionCoefficients:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+29)),this._startOffset+=e,t},cameraModel:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+6)),this._startOffset+=e,t},barcodeFormat:()=>this._i32View[this._startOffset++],faceLandmarkName:()=>this._i32View[this._startOffset++],instantTrackerTransformOrientation:()=>this._i32View[this._startOffset++],logLevel:()=>this._i32View[this._startOffset++]}}setData(e){this._buffer=e,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=0,this._length=0,e.byteLength>=4&&(this._offset=1,this._length=this._i32View[0]),this._startOffset=-1}hasMessage(){return this._offset+1<this._length}forMessages(e){for(;this.hasMessage();){let t=this._i32View[this._offset],r=this._i32View[this._offset+1];this._startOffset=this._offset+2,this._offset+=t,e(r,this._processor)}}}class _{constructor(e,t){this._impl=e,this._sender=t,this._deserializer=new s,this.serializersByPipelineId=new Map,this._pipeline_id_by_pipeline_id=new Map,this._pipeline_by_instance=new Map,this._pipeline_id_by_camera_source_id=new Map,this._camera_source_by_instance=new Map,this._pipeline_id_by_sequence_source_id=new Map,this._sequence_source_by_instance=new Map,this._pipeline_id_by_image_tracker_id=new Map,this._image_tracker_by_instance=new Map,this._pipeline_id_by_face_tracker_id=new Map,this._face_tracker_by_instance=new Map,this._pipeline_id_by_face_mesh_id=new Map,this._face_mesh_by_instance=new Map,this._pipeline_id_by_face_landmark_id=new Map,this._face_landmark_by_instance=new Map,this._pipeline_id_by_barcode_finder_id=new Map,this._barcode_finder_by_instance=new Map,this._pipeline_id_by_instant_world_tracker_id=new Map,this._instant_world_tracker_by_instance=new Map}processBuffer(e){this._deserializer.setData(e),this._deserializer.forMessages(((e,t)=>{switch(e){case 34:this._impl.log_level_set(t.logLevel());break;case 31:this._impl.analytics_project_id_set(t.string());break;case 27:{let e=t.type(),r=this._impl.pipeline_create();this._pipeline_by_instance.set(e,r),this._pipeline_id_by_pipeline_id.set(e,e),this.serializersByPipelineId.set(e,new o((t=>{this._sender(e,t)})));break}case 28:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_destroy(r),this._pipeline_by_instance.delete(e);break}case 9:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_frame_update(r);break}case 8:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_camera_frame_submit(r,t.dataWithLength(),t.int(),t.int(),t.int(),t.matrix4x4(),t.cameraModel(),t.bool());break}case 10:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_accelerometer_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 11:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_rotation_rate_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 12:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_attitude_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 13:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_attitude_matrix_submit(r,t.matrix4x4());break}case 29:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=t.string(),i=this._impl.camera_source_create(a,n);this._camera_source_by_instance.set(e,i),this._pipeline_id_by_camera_source_id.set(e,r);break}case 30:{let e=t.type(),r=this._camera_source_by_instance.get(e);if(void 0===r)return;this._impl.camera_source_destroy(r),this._camera_source_by_instance.delete(e);break}case 35:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.sequence_source_create(a);this._sequence_source_by_instance.set(e,n),this._pipeline_id_by_sequence_source_id.set(e,r);break}case 36:{let e=t.type(),r=this._sequence_source_by_instance.get(e);if(void 0===r)return;this._impl.sequence_source_destroy(r),this._sequence_source_by_instance.delete(e);break}case 2:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.image_tracker_create(a);this._image_tracker_by_instance.set(e,n),this._pipeline_id_by_image_tracker_id.set(e,r);break}case 14:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_destroy(r),this._image_tracker_by_instance.delete(e);break}case 4:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_target_load_from_memory(r,t.dataWithLength());break}case 3:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_enabled_set(r,t.bool());break}case 20:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.face_tracker_create(a);this._face_tracker_by_instance.set(e,n),this._pipeline_id_by_face_tracker_id.set(e,r);break}case 21:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_destroy(r),this._face_tracker_by_instance.delete(e);break}case 22:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_model_load_from_memory(r,t.dataWithLength());break}case 23:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_enabled_set(r,t.bool());break}case 24:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_max_faces_set(r,t.int());break}case 25:{let e=t.type(),r=this._impl.face_mesh_create();this._face_mesh_by_instance.set(e,r);break}case 26:{let e=t.type(),r=this._face_mesh_by_instance.get(e);if(void 0===r)return;this._impl.face_mesh_destroy(r),this._face_mesh_by_instance.delete(e);break}case 32:{let e=t.type(),r=t.faceLandmarkName(),a=this._impl.face_landmark_create(r);this._face_landmark_by_instance.set(e,a);break}case 33:{let e=t.type(),r=this._face_landmark_by_instance.get(e);if(void 0===r)return;this._impl.face_landmark_destroy(r),this._face_landmark_by_instance.delete(e);break}case 16:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.barcode_finder_create(a);this._barcode_finder_by_instance.set(e,n),this._pipeline_id_by_barcode_finder_id.set(e,r);break}case 17:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_destroy(r),this._barcode_finder_by_instance.delete(e);break}case 18:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_enabled_set(r,t.bool());break}case 19:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_formats_set(r,t.barcodeFormat());break}case 5:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.instant_world_tracker_create(a);this._instant_world_tracker_by_instance.set(e,n),this._pipeline_id_by_instant_world_tracker_id.set(e,r);break}case 15:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_destroy(r),this._instant_world_tracker_by_instance.delete(e);break}case 6:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_enabled_set(r,t.bool());break}case 7:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_anchor_pose_set_from_camera_offset_raw(r,t.float(),t.float(),t.float(),t.instantTrackerTransformOrientation());break}}}))}exploreState(){for(let[e,t]of this._pipeline_by_instance){let r=this._pipeline_id_by_pipeline_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);a&&(a.sendMessage(7,(r=>{r.type(e),r.int(this._impl.pipeline_frame_number(t))})),a.sendMessage(6,(r=>{r.type(e),r.cameraModel(this._impl.pipeline_camera_model(t))})),a.sendMessage(5,(r=>{r.type(e),r.int(this._impl.pipeline_camera_frame_user_data(t))})),a.sendMessage(11,(r=>{r.type(e),r.matrix4x4(this._impl.pipeline_camera_frame_camera_attitude(t))})),a.sendMessage(12,(r=>{r.type(e),r.matrix4x4(this._impl.pipeline_camera_frame_device_attitude(t))})))}for(let[e,t]of this._camera_source_by_instance){let t=this._pipeline_id_by_camera_source_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._sequence_source_by_instance){let t=this._pipeline_id_by_sequence_source_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._image_tracker_by_instance){let r=this._pipeline_id_by_image_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(19,(r=>{r.type(e),r.int(this._impl.image_tracker_target_loaded_version(t))})),a.sendMessage(1,(r=>{r.type(e),r.int(this._impl.image_tracker_anchor_count(t))}));for(let r=0;r<this._impl.image_tracker_anchor_count(t);r++)a.sendMessage(2,(a=>{a.type(e),a.int(r),a.string(this._impl.image_tracker_anchor_id(t,r))}));for(let r=0;r<this._impl.image_tracker_anchor_count(t);r++)a.sendMessage(3,(a=>{a.type(e),a.int(r),a.matrix4x4(this._impl.image_tracker_anchor_pose_raw(t,r))}))}}for(let[e,t]of this._face_tracker_by_instance){let r=this._pipeline_id_by_face_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(18,(r=>{r.type(e),r.int(this._impl.face_tracker_model_loaded_version(t))})),a.sendMessage(13,(r=>{r.type(e),r.int(this._impl.face_tracker_anchor_count(t))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(14,(a=>{a.type(e),a.int(r),a.string(this._impl.face_tracker_anchor_id(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(15,(a=>{a.type(e),a.int(r),a.matrix4x4(this._impl.face_tracker_anchor_pose_raw(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(16,(a=>{a.type(e),a.int(r),a.identityCoefficients(this._impl.face_tracker_anchor_identity_coefficients(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(17,(a=>{a.type(e),a.int(r),a.expressionCoefficients(this._impl.face_tracker_anchor_expression_coefficients(t,r))}))}}for(let[e,t]of this._face_mesh_by_instance){let t=this._pipeline_id_by_face_mesh_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._face_landmark_by_instance){let t=this._pipeline_id_by_face_landmark_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._barcode_finder_by_instance){let r=this._pipeline_id_by_barcode_finder_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(8,(r=>{r.type(e),r.int(this._impl.barcode_finder_found_number(t))}));for(let r=0;r<this._impl.barcode_finder_found_number(t);r++)a.sendMessage(9,(a=>{a.type(e),a.int(r),a.string(this._impl.barcode_finder_found_text(t,r))}));for(let r=0;r<this._impl.barcode_finder_found_number(t);r++)a.sendMessage(10,(a=>{a.type(e),a.int(r),a.barcodeFormat(this._impl.barcode_finder_found_format(t,r))}))}}for(let[e,t]of this._instant_world_tracker_by_instance){let r=this._pipeline_id_by_instant_world_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);a&&a.sendMessage(4,(r=>{r.type(e),r.matrix4x4(this._impl.instant_world_tracker_anchor_pose_raw(t))}))}}}class c{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(){for(var e=0,t=this._funcs.length;e<t;e++)this._funcs[e]()}}class f{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(e){for(var t=0,r=this._funcs.length;t<r;t++)this._funcs[t](e)}}var u,l,p,d,h,m=r(975);!function(e){e[e.UNKNOWN=131072]="UNKNOWN",e[e.AZTEC=1]="AZTEC",e[e.CODABAR=2]="CODABAR",e[e.CODE_39=4]="CODE_39",e[e.CODE_93=8]="CODE_93",e[e.CODE_128=16]="CODE_128",e[e.DATA_MATRIX=32]="DATA_MATRIX",e[e.EAN_8=64]="EAN_8",e[e.EAN_13=128]="EAN_13",e[e.ITF=256]="ITF",e[e.MAXICODE=512]="MAXICODE",e[e.PDF_417=1024]="PDF_417",e[e.QR_CODE=2048]="QR_CODE",e[e.RSS_14=4096]="RSS_14",e[e.RSS_EXPANDED=8192]="RSS_EXPANDED",e[e.UPC_A=16384]="UPC_A",e[e.UPC_E=32768]="UPC_E",e[e.UPC_EAN_EXTENSION=65536]="UPC_EAN_EXTENSION",e[e.ALL=131071]="ALL"}(u||(u={})),function(e){e[e.EYE_LEFT=0]="EYE_LEFT",e[e.EYE_RIGHT=1]="EYE_RIGHT",e[e.EAR_LEFT=2]="EAR_LEFT",e[e.EAR_RIGHT=3]="EAR_RIGHT",e[e.NOSE_BRIDGE=4]="NOSE_BRIDGE",e[e.NOSE_TIP=5]="NOSE_TIP",e[e.NOSE_BASE=6]="NOSE_BASE",e[e.LIP_TOP=7]="LIP_TOP",e[e.LIP_BOTTOM=8]="LIP_BOTTOM",e[e.MOUTH_CENTER=9]="MOUTH_CENTER",e[e.CHIN=10]="CHIN",e[e.EYEBROW_LEFT=11]="EYEBROW_LEFT",e[e.EYEBROW_RIGHT=12]="EYEBROW_RIGHT"}(l||(l={})),function(e){e[e.WORLD=3]="WORLD",e[e.MINUS_Z_AWAY_FROM_USER=4]="MINUS_Z_AWAY_FROM_USER",e[e.MINUS_Z_HEADING=5]="MINUS_Z_HEADING",e[e.UNCHANGED=6]="UNCHANGED"}(p||(p={})),function(e){e[e.LOG_LEVEL_NONE=0]="LOG_LEVEL_NONE",e[e.LOG_LEVEL_ERROR=1]="LOG_LEVEL_ERROR",e[e.LOG_LEVEL_WARNING=2]="LOG_LEVEL_WARNING",e[e.LOG_LEVEL_VERBOSE=3]="LOG_LEVEL_VERBOSE"}(d||(d={})),function(e){e[e.FRAME_PIXEL_FORMAT_I420=0]="FRAME_PIXEL_FORMAT_I420",e[e.FRAME_PIXEL_FORMAT_I420A=1]="FRAME_PIXEL_FORMAT_I420A",e[e.FRAME_PIXEL_FORMAT_I422=2]="FRAME_PIXEL_FORMAT_I422",e[e.FRAME_PIXEL_FORMAT_I444=3]="FRAME_PIXEL_FORMAT_I444",e[e.FRAME_PIXEL_FORMAT_NV12=4]="FRAME_PIXEL_FORMAT_NV12",e[e.FRAME_PIXEL_FORMAT_RGBA=5]="FRAME_PIXEL_FORMAT_RGBA",e[e.FRAME_PIXEL_FORMAT_BGRA=6]="FRAME_PIXEL_FORMAT_BGRA",e[e.FRAME_PIXEL_FORMAT_Y=7]="FRAME_PIXEL_FORMAT_Y"}(h||(h={}));const b=new Map;class g{constructor(e){this._gl=e,this._viewports=[],this._underlyingViewport=this._gl.viewport,this._viewports.push(this._gl.getParameter(this._gl.VIEWPORT)),this._gl.viewport=(e,t,r,a)=>{this._viewports[this._viewports.length-1]=[e,t,r,a],this._underlyingViewport.call(this._gl,e,t,r,a)}}static get(e){let t=b.get(e);return t||(t=new g(e),b.set(e,t)),t}push(){this._viewports.push(this._viewports[this._viewports.length-1])}pop(){const e=this._viewports.pop(),t=this._viewports[this._viewports.length-1];e&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]||this._underlyingViewport.call(this._gl,t[0],t[1],t[2],t[3])}}var w,y=r(238);!function(e){e[e.OBJECT_URL=0]="OBJECT_URL",e[e.SRC_OBJECT=1]="SRC_OBJECT"}(w||(w={}));let v={deviceMotionMutliplier:-1,blacklisted:!1,showGyroPermissionsWarningIfNecessary:!1,showSafariPermissionsResetIfNecessary:!1,requestHighFrameRate:!1,videoWidth:640,videoHeight:480,dataWidth:320,dataHeight:240,videoElementInDOM:!1,preferMediaStreamTrackProcessorCamera:!1,preferImageBitmapCamera:!1};"undefined"!=typeof window&&(window.zeeProfile=v,window.location.href.indexOf("_mstppipeline")>=0&&(console.log("Configuring for MSTP camera pipeline (if supported)"),v.preferMediaStreamTrackProcessorCamera=!0),window.location.href.indexOf("_imagebitmappipeline")>=0&&(console.log("Configuring for ImageBitmap camera pipeline (if supported)"),v.preferImageBitmapCamera=!0));let E=new y.UAParser,A=(E.getOS().name||"unknown").toLowerCase(),T=(E.getEngine().name||"unknown").toLowerCase();function R(e){let t=e.split(".");if(t.length>=2){const e=parseInt(t[0]),r=parseInt(t[1]);(e<11||11===e&&r<3)&&(v.blacklisted=!0),(e<12||12===e&&r<2)&&(v.videoElementInDOM=!0),(12===e&&r>=2||e>=13)&&(v.showGyroPermissionsWarningIfNecessary=!0),e>=13&&(v.showSafariPermissionsResetIfNecessary=!0),(e>=12&&r>1||e>=13)&&navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().frameRate&&(v.requestHighFrameRate=!0,e<14&&(v.videoHeight=360,v.dataHeight=180))}}function k(e,t,r){let a=e.createShader(t);if(!a)throw new Error("Unable to create shader");e.shaderSource(a,r),e.compileShader(a);let n=e.getShaderInfoLog(a);if(n&&n.trim().length>0)throw new Error("Shader compile error: "+n);return a}"webkit"===T&&"ios"!==A&&(v.deviceMotionMutliplier=1,"undefined"!=typeof window&&void 0!==window.orientation&&R("15.0")),"webkit"===T&&"ios"===A&&(v.deviceMotionMutliplier=1,R(E.getOS().version||"15.0"));class x{constructor(e){this._gl=e,this._isPaused=!0,this._hadFrames=!1,this._isUserFacing=!1,this._cameraToScreenRotation=0,this._isUploadFrame=!0,this._computedTransformRotation=-1,this._computedFrontCameraRotation=!1,this._cameraUvTransform=m.Ue(),this._framebufferWidth=0,this._framebufferHeight=0,this._framebufferId=null,this._renderTexture=null}resetGLContext(){this._framebufferId=null,this._renderTexture=null,this._vertexBuffer=void 0,this._indexBuffer=void 0,this._greyscaleShader=void 0}destroy(){this.resetGLContext()}uploadFrame(e,t,r,a){let n=this._gl;const i=g.get(n);i.push();const o=n.isEnabled(n.SCISSOR_TEST),s=n.isEnabled(n.DEPTH_TEST),_=n.isEnabled(n.BLEND),c=n.isEnabled(n.CULL_FACE),f=n.getParameter(n.ACTIVE_TEXTURE),u=n.getParameter(n.UNPACK_FLIP_Y_WEBGL),l=n.getParameter(n.CURRENT_PROGRAM);n.activeTexture(n.TEXTURE0);const p=n.getParameter(n.TEXTURE_BINDING_2D),d=n.getParameter(n.FRAMEBUFFER_BINDING),h=n.getParameter(n.ARRAY_BUFFER_BINDING),m=n.getParameter(n.ELEMENT_ARRAY_BUFFER_BINDING);n.disable(n.SCISSOR_TEST),n.disable(n.DEPTH_TEST),n.disable(n.BLEND),n.disable(n.CULL_FACE),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.bindTexture(n.TEXTURE_2D,e);const b=n.RGBA,w=n.RGBA,y=n.UNSIGNED_BYTE;n.texImage2D(n.TEXTURE_2D,0,b,w,y,t);let E=0,A=0;"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?(E=t.videoWidth,A=t.videoHeight):(E=t.width,A=t.height),A>E&&(A=[E,E=A][0]),this._updateTransforms(r,a);let T=this._getFramebuffer(n,v.dataWidth/4,v.dataHeight),R=this._getVertexBuffer(n),k=this._getIndexBuffer(n),x=this._getGreyscaleShader(n);const F=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_SIZE),M=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_TYPE),L=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_NORMALIZED),z=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_STRIDE),O=n.getVertexAttribOffset(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_POINTER),I=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_ENABLED),P=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),S=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_SIZE),B=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_TYPE),D=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_NORMALIZED),U=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_STRIDE),C=n.getVertexAttribOffset(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_POINTER),V=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_ENABLED),N=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING);n.bindFramebuffer(n.FRAMEBUFFER,T),n.viewport(0,0,this._framebufferWidth,this._framebufferHeight),n.clear(n.COLOR_BUFFER_BIT),n.bindBuffer(n.ARRAY_BUFFER,R),n.vertexAttribPointer(x.aVertexPositionLoc,2,n.FLOAT,!1,16,0),n.enableVertexAttribArray(x.aVertexPositionLoc),n.vertexAttribPointer(x.aTextureCoordLoc,2,n.FLOAT,!1,16,8),n.enableVertexAttribArray(x.aTextureCoordLoc),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,k),n.useProgram(x.program),n.uniform1f(x.uTexWidthLoc,v.dataWidth),n.uniformMatrix4fv(x.uUvTransformLoc,!1,this._cameraUvTransform),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,e),n.uniform1i(x.uSamplerLoc,0),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0),n.bindBuffer(n.ARRAY_BUFFER,P),n.vertexAttribPointer(x.aVertexPositionLoc,F,M,L,z,O),n.bindBuffer(n.ARRAY_BUFFER,N),n.vertexAttribPointer(x.aTextureCoordLoc,S,B,D,U,C),n.bindBuffer(n.ARRAY_BUFFER,h),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,m),I||n.disableVertexAttribArray(x.aVertexPositionLoc),V||n.disableVertexAttribArray(x.aTextureCoordLoc),n.bindFramebuffer(n.FRAMEBUFFER,d),n.useProgram(l),n.bindTexture(n.TEXTURE_2D,p),n.activeTexture(f),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,u),i.pop(),_&&n.enable(n.BLEND),c&&n.enable(n.CULL_FACE),s&&n.enable(n.DEPTH_TEST),o&&n.enable(n.SCISSOR_TEST)}readFrame(e,t){let r=this._gl,a=new Uint8Array(t);const n=r.getParameter(r.FRAMEBUFFER_BINDING);let i=this._getFramebuffer(r,v.dataWidth/4,v.dataHeight);return r.bindFramebuffer(r.FRAMEBUFFER,i),r.readPixels(0,0,this._framebufferWidth,this._framebufferHeight,r.RGBA,r.UNSIGNED_BYTE,a),r.bindFramebuffer(r.FRAMEBUFFER,n),{uvTransform:this._cameraUvTransform,data:t,texture:e,dataWidth:v.dataWidth,dataHeight:v.dataHeight,userFacing:this._computedFrontCameraRotation}}_updateTransforms(e,t){e==this._computedTransformRotation&&t==this._computedFrontCameraRotation||(this._computedTransformRotation=e,this._computedFrontCameraRotation=t,this._cameraUvTransform=this._getCameraUvTransform())}_getCameraUvTransform(){switch(this._computedTransformRotation){case 270:return new Float32Array([0,1,0,0,-1,0,0,0,0,0,1,0,1,0,0,1]);case 180:return new Float32Array([-1,0,0,0,0,-1,0,0,0,0,1,0,1,1,0,1]);case 90:return new Float32Array([0,-1,0,0,1,0,0,0,0,0,1,0,0,1,0,1])}return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}_getFramebuffer(e,t,r){if(this._framebufferWidth===t&&this._framebufferHeight===r&&this._framebufferId)return this._framebufferId;if(this._framebufferId&&(e.deleteFramebuffer(this._framebufferId),this._framebufferId=null),this._renderTexture&&(e.deleteTexture(this._renderTexture),this._renderTexture=null),this._framebufferId=e.createFramebuffer(),!this._framebufferId)throw new Error("Unable to create framebuffer");if(e.bindFramebuffer(e.FRAMEBUFFER,this._framebufferId),this._renderTexture=e.createTexture(),!this._renderTexture)throw new Error("Unable to create render texture");e.activeTexture(e.TEXTURE0);const a=e.getParameter(e.TEXTURE_BINDING_2D);e.bindTexture(e.TEXTURE_2D,this._renderTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameterf(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this._renderTexture,0);let n=e.checkFramebufferStatus(e.FRAMEBUFFER);if(n!==e.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer not complete: "+n.toString());return this._framebufferWidth=t,this._framebufferHeight=r,e.bindTexture(e.TEXTURE_2D,a),e.bindFramebuffer(e.FRAMEBUFFER,null),this._framebufferId}_getVertexBuffer(e){if(this._vertexBuffer)return this._vertexBuffer;if(this._vertexBuffer=e.createBuffer(),!this._vertexBuffer)throw new Error("Unable to create vertex buffer");e.bindBuffer(e.ARRAY_BUFFER,this._vertexBuffer);let t=new Float32Array([-1,-1,0,0,-1,1,0,1,1,1,1,1,1,-1,1,0]);return e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW),this._vertexBuffer}_getIndexBuffer(e){if(this._indexBuffer)return this._indexBuffer;if(this._indexBuffer=e.createBuffer(),!this._indexBuffer)throw new Error("Unable to create index buffer");e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._indexBuffer);let t=new Uint16Array([0,1,2,0,2,3]);return e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW),this._indexBuffer}_getGreyscaleShader(e){if(this._greyscaleShader)return this._greyscaleShader;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=k(e,e.VERTEX_SHADER,O),a=k(e,e.FRAGMENT_SHADER,I);e.attachShader(t,r),e.attachShader(t,a),function(e,t){e.linkProgram(t);let r=e.getProgramInfoLog(t);if(r&&r.trim().length>0)throw new Error("Unable to link: "+r)}(e,t);let n=e.getUniformLocation(t,"uTexWidth");if(!n)throw new Error("Unable to get uniform location uTexWidth");let i=e.getUniformLocation(t,"uUvTransform");if(!i)throw new Error("Unable to get uniform location uUvTransform");let o=e.getUniformLocation(t,"uSampler");if(!o)throw new Error("Unable to get uniform location uSampler");return this._greyscaleShader={program:t,aVertexPositionLoc:e.getAttribLocation(t,"aVertexPosition"),aTextureCoordLoc:e.getAttribLocation(t,"aTextureCoord"),uTexWidthLoc:n,uUvTransformLoc:i,uSamplerLoc:o},this._greyscaleShader}}let F,M,L,z,O="\n attribute vec4 aVertexPosition;\n attribute vec2 aTextureCoord;\n\n varying highp vec2 vTextureCoord1;\n varying highp vec2 vTextureCoord2;\n varying highp vec2 vTextureCoord3;\n varying highp vec2 vTextureCoord4;\n\n uniform float uTexWidth;\n\tuniform mat4 uUvTransform;\n\n void main(void) {\n highp vec2 offset1 = vec2(1.5 / uTexWidth, 0);\n highp vec2 offset2 = vec2(0.5 / uTexWidth, 0);\n\n gl_Position = aVertexPosition;\n vTextureCoord1 = (uUvTransform * vec4(aTextureCoord - offset1, 0, 1)).xy;\n vTextureCoord2 = (uUvTransform * vec4(aTextureCoord - offset2, 0, 1)).xy;\n vTextureCoord3 = (uUvTransform * vec4(aTextureCoord + offset2, 0, 1)).xy;\n vTextureCoord4 = (uUvTransform * vec4(aTextureCoord + offset1, 0, 1)).xy;\n }\n",I="\n varying highp vec2 vTextureCoord1;\n varying highp vec2 vTextureCoord2;\n varying highp vec2 vTextureCoord3;\n varying highp vec2 vTextureCoord4;\n\n uniform sampler2D uSampler;\n\n const lowp vec3 colorWeights = vec3(77.0 / 256.0, 150.0 / 256.0, 29.0 / 256.0);\n\n void main(void) {\n lowp vec4 outpx;\n\n outpx.r = dot(colorWeights, texture2D(uSampler, vTextureCoord1).xyz);\n outpx.g = dot(colorWeights, texture2D(uSampler, vTextureCoord2).xyz);\n outpx.b = dot(colorWeights, texture2D(uSampler, vTextureCoord3).xyz);\n outpx.a = dot(colorWeights, texture2D(uSampler, vTextureCoord4).xyz);\n\n gl_FragColor = outpx;\n }\n";var P=function(e,t,r,a){return new(r||(r=Promise))((function(n,i){function o(e){try{_(a.next(e))}catch(e){i(e)}}function s(e){try{_(a.throw(e))}catch(e){i(e)}}function _(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}_((a=a.apply(e,t||[])).next())}))};let S=new class{constructor(){this.onOutgoingMessage=new c,this.onIncomingMessage=new f,this._outgoingMessages=[]}postIncomingMessage(e){this.onIncomingMessage.emit(e)}postOutgoingMessage(e,t){this._outgoingMessages.push({msg:e,transferables:t}),this.onOutgoingMessage.emit()}getOutgoingMessages(){let e=this._outgoingMessages;return this._outgoingMessages=[],e}},B=0;function D(e){return P(this,void 0,void 0,(function*(){let t=i({locateFile:(t,r)=>t.endsWith("zcv.wasm")?e:r+t,onRuntimeInitialized:()=>{let e=function(e){let t=e.cwrap("zappar_log_level","number",[]),r=e.cwrap("zappar_log_level_set",null,["number"]),a=e.cwrap("zappar_analytics_project_id_set",null,["string"]),n=e.cwrap("zappar_pipeline_create","number",[]),i=e.cwrap("zappar_pipeline_destroy",null,["number"]),o=e.cwrap("zappar_pipeline_frame_update",null,["number"]),s=e.cwrap("zappar_pipeline_frame_number","number",["number"]),_=e.cwrap("zappar_pipeline_camera_model","number",["number"]),c=e.cwrap("zappar_pipeline_camera_frame_user_data","number",["number"]),f=e.cwrap("zappar_pipeline_camera_frame_submit",null,["number","number","number","number","number","number","number","number","number"]),u=e.cwrap("zappar_pipeline_camera_frame_submit_raw_pointer",null,["number","number","number","number","number","number","number","number","number","number","number"]),l=e.cwrap("zappar_pipeline_camera_frame_camera_attitude","number",["number"]),p=e.cwrap("zappar_pipeline_camera_frame_device_attitude","number",["number"]),d=e.cwrap("zappar_pipeline_motion_accelerometer_submit",null,["number","number","number","number","number"]),h=e.cwrap("zappar_pipeline_motion_rotation_rate_submit",null,["number","number","number","number","number"]),m=e.cwrap("zappar_pipeline_motion_attitude_submit",null,["number","number","number","number","number"]),b=e.cwrap("zappar_pipeline_motion_attitude_matrix_submit",null,["number","number"]),g=e.cwrap("zappar_camera_source_create","number",["number","string"]),w=e.cwrap("zappar_camera_source_destroy",null,["number"]),y=e.cwrap("zappar_sequence_source_create","number",["number"]),v=e.cwrap("zappar_sequence_source_destroy",null,["number"]),E=e.cwrap("zappar_image_tracker_create","number",["number"]),A=e.cwrap("zappar_image_tracker_destroy",null,["number"]),T=e.cwrap("zappar_image_tracker_target_load_from_memory",null,["number","number","number"]),R=e.cwrap("zappar_image_tracker_target_loaded_version","number",["number"]),k=e.cwrap("zappar_image_tracker_enabled","number",["number"]),x=e.cwrap("zappar_image_tracker_enabled_set",null,["number","number"]),F=e.cwrap("zappar_image_tracker_anchor_count","number",["number"]),M=e.cwrap("zappar_image_tracker_anchor_id","string",["number","number"]),L=e.cwrap("zappar_image_tracker_anchor_pose_raw","number",["number","number"]),z=e.cwrap("zappar_face_tracker_create","number",["number"]),O=e.cwrap("zappar_face_tracker_destroy",null,["number"]),I=e.cwrap("zappar_face_tracker_model_load_from_memory",null,["number","number","number"]),P=e.cwrap("zappar_face_tracker_model_loaded_version","number",["number"]),S=e.cwrap("zappar_face_tracker_enabled_set",null,["number","number"]),B=e.cwrap("zappar_face_tracker_enabled","number",["number"]),D=e.cwrap("zappar_face_tracker_max_faces_set",null,["number","number"]),U=e.cwrap("zappar_face_tracker_max_faces","number",["number"]),C=e.cwrap("zappar_face_tracker_anchor_count","number",["number"]),V=e.cwrap("zappar_face_tracker_anchor_id","string",["number","number"]),N=e.cwrap("zappar_face_tracker_anchor_pose_raw","number",["number","number"]),H=e.cwrap("zappar_face_tracker_anchor_identity_coefficients","number",["number","number"]),W=e.cwrap("zappar_face_tracker_anchor_expression_coefficients","number",["number","number"]),G=e.cwrap("zappar_face_mesh_create","number",[]),Y=e.cwrap("zappar_face_mesh_destroy",null,["number"]),X=e.cwrap("zappar_face_landmark_create","number",["number"]),j=e.cwrap("zappar_face_landmark_destroy",null,["number"]),q=e.cwrap("zappar_barcode_finder_create","number",["number"]),Z=e.cwrap("zappar_barcode_finder_destroy",null,["number"]),K=e.cwrap("zappar_barcode_finder_enabled_set",null,["number","number"]),J=e.cwrap("zappar_barcode_finder_enabled","number",["number"]),$=e.cwrap("zappar_barcode_finder_found_number","number",["number"]),Q=e.cwrap("zappar_barcode_finder_found_text","string",["number","number"]),ee=e.cwrap("zappar_barcode_finder_found_format","number",["number","number"]),te=e.cwrap("zappar_barcode_finder_formats","number",["number"]),re=e.cwrap("zappar_barcode_finder_formats_set",null,["number","number"]),ae=e.cwrap("zappar_instant_world_tracker_create","number",["number"]),ne=e.cwrap("zappar_instant_world_tracker_destroy",null,["number"]),ie=e.cwrap("zappar_instant_world_tracker_enabled_set",null,["number","number"]),oe=e.cwrap("zappar_instant_world_tracker_enabled","number",["number"]),se=e.cwrap("zappar_instant_world_tracker_anchor_pose_raw","number",["number"]),_e=e.cwrap("zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw",null,["number","number","number","number","number"]),ce=32,fe=e._malloc(ce),ue=(e._malloc(64),new Map),le=(t,r)=>{let a=ue.get(t);return(!a||a[0]<r)&&(a&&e._free(a[1]),a=[r,e._malloc(r)],ue.set(t,a)),a[1]};return{log_level:()=>t(),log_level_set:e=>r(e),analytics_project_id_set:e=>a(e),pipeline_create:()=>n(),pipeline_destroy:()=>{i()},pipeline_frame_update:e=>o(e),pipeline_frame_number:e=>s(e),pipeline_camera_model:t=>{let r=_(t),a=new Float32Array(6);return a.set(e.HEAPF32.subarray(r/4,6+r/4)),r=a,r},pipeline_camera_frame_user_data:e=>c(e),pipeline_camera_frame_submit:(t,r,a,n,i,o,s,_)=>{ce<r.byteLength&&(e._free(fe),ce=r.byteLength,fe=e._malloc(ce));let c=fe,u=r.byteLength;e.HEAPU8.set(new Uint8Array(r),fe);let l=a,p=n,d=i,h=le(4,o.byteLength);e.HEAPF32.set(o,h/4);let m=le(5,s.byteLength);return e.HEAPF32.set(s,m/4),f(t,c,u,l,p,d,h,m,_?1:0)},pipeline_camera_frame_submit_raw_pointer:(t,r,a,n,i,o,s,_,c,f,l)=>{let p=r,d=a,h=n,m=i,b=o,g=s,w=le(6,_.byteLength);e.HEAPF32.set(_,w/4);let y=c,v=le(8,f.byteLength);return e.HEAPF32.set(f,v/4),u(t,p,d,h,m,b,g,w,y,v,l?1:0)},pipeline_camera_frame_camera_attitude:t=>{let r=l(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},pipeline_camera_frame_device_attitude:t=>{let r=p(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},pipeline_motion_accelerometer_submit:(e,t,r,a,n)=>d(e,t,r,a,n),pipeline_motion_rotation_rate_submit:(e,t,r,a,n)=>h(e,t,r,a,n),pipeline_motion_attitude_submit:(e,t,r,a,n)=>m(e,t,r,a,n),pipeline_motion_attitude_matrix_submit:(t,r)=>{let a=le(0,r.byteLength);return e.HEAPF32.set(r,a/4),b(t,a)},camera_source_create:(e,t)=>g(e,t),camera_source_destroy:()=>{w()},sequence_source_create:e=>y(e),sequence_source_destroy:()=>{v()},image_tracker_create:e=>E(e),image_tracker_destroy:()=>{A()},image_tracker_target_load_from_memory:(t,r)=>{ce<r.byteLength&&(e._free(fe),ce=r.byteLength,fe=e._malloc(ce));let a=fe,n=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),fe),T(t,a,n)},image_tracker_target_loaded_version:e=>R(e),image_tracker_enabled:e=>{let t=k(e);return t=1===t,t},image_tracker_enabled_set:(e,t)=>x(e,t?1:0),image_tracker_anchor_count:e=>F(e),image_tracker_anchor_id:(e,t)=>M(e,t),image_tracker_anchor_pose_raw:(t,r)=>{let a=L(t,r),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(a/4,16+a/4)),a=n,a},face_tracker_create:e=>z(e),face_tracker_destroy:()=>{O()},face_tracker_model_load_from_memory:(t,r)=>{ce<r.byteLength&&(e._free(fe),ce=r.byteLength,fe=e._malloc(ce));let a=fe,n=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),fe),I(t,a,n)},face_tracker_model_loaded_version:e=>P(e),face_tracker_enabled_set:(e,t)=>S(e,t?1:0),face_tracker_enabled:e=>{let t=B(e);return t=1===t,t},face_tracker_max_faces_set:(e,t)=>D(e,t),face_tracker_max_faces:e=>U(e),face_tracker_anchor_count:e=>C(e),face_tracker_anchor_id:(e,t)=>V(e,t),face_tracker_anchor_pose_raw:(t,r)=>{let a=N(t,r),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(a/4,16+a/4)),a=n,a},face_tracker_anchor_identity_coefficients:(t,r)=>{let a=H(t,r),n=new Float32Array(50);return n.set(e.HEAPF32.subarray(a/4,50+a/4)),a=n,a},face_tracker_anchor_expression_coefficients:(t,r)=>{let a=W(t,r),n=new Float32Array(29);return n.set(e.HEAPF32.subarray(a/4,29+a/4)),a=n,a},face_mesh_create:()=>G(),face_mesh_destroy:()=>{Y()},face_landmark_create:e=>X(e),face_landmark_destroy:()=>{j()},barcode_finder_create:e=>q(e),barcode_finder_destroy:()=>{Z()},barcode_finder_enabled_set:(e,t)=>K(e,t?1:0),barcode_finder_enabled:e=>{let t=J(e);return t=1===t,t},barcode_finder_found_number:e=>$(e),barcode_finder_found_text:(e,t)=>Q(e,t),barcode_finder_found_format:(e,t)=>ee(e,t),barcode_finder_formats:e=>te(e),barcode_finder_formats_set:(e,t)=>re(e,t),instant_world_tracker_create:e=>ae(e),instant_world_tracker_destroy:()=>{ne()},instant_world_tracker_enabled_set:(e,t)=>ie(e,t?1:0),instant_world_tracker_enabled:e=>{let t=oe(e);return t=1===t,t},instant_world_tracker_anchor_pose_raw:t=>{let r=se(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},instant_world_tracker_anchor_pose_set_from_camera_offset_raw:(e,t,r,a,n)=>_e(e,t,r,a,n)}}(t),r=new _(e,((e,t)=>{S.postOutgoingMessage({p:e,t:"zappar",d:t},[t])}));S.postOutgoingMessage("loaded",[]),S.onIncomingMessage.bind((a=>{var n;switch(a.t){case"zappar":r.processBuffer(a.d),S.postOutgoingMessage({t:"buf",d:a.d},[a.d]);break;case"buf":null===(n=r.serializersByPipelineId.get(a.p))||void 0===n||n.bufferReturn(a.d);break;case"cameraFrameC2S":{let t,n=a,i=r._pipeline_by_instance.get(n.p);i&&(e.pipeline_camera_frame_submit(i,n.d,n.width,n.height,n.token,n.c2d,n.cm,n.userFacing),e.pipeline_frame_update(i),t=e.pipeline_camera_frame_device_attitude(i),r.exploreState());let o={token:n.token,d:n.d,p:n.p,t:"cameraFrameRecycleS2C",att:t};S.postOutgoingMessage(o,[n.d]);break}case"streamC2S":{let n=a;!function(e,t,r,a,n,i,o){P(this,void 0,void 0,(function*(){const s=yield r.getReader();for(;;){let r=yield s.read();if(r.done)return void console.log("Stream done");let _=r.value,c=_.allocationSize();c>C&&(U>0&&e._free(U),U=e._malloc(c),C=c),yield _.copyTo(e.HEAPU8.subarray(U,U+C));let f=V;V++;const u=_.visibleRect.width,l=_.visibleRect.height;let p,d=u,h=l;switch(B){case 270:p=new Float32Array([0,1,0,0,-1,0,0,0,0,0,1,0,1,0,0,1]),d=l,h=u;break;case 180:p=new Float32Array([-1,0,0,0,0,-1,0,0,0,0,1,0,1,1,0,1]);break;case 90:p=new Float32Array([0,-1,0,0,1,0,0,0,0,0,1,0,0,1,0,1]),d=l,h=u;break;default:p=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}let b=_.clone();n?m.xJ(N,[-1,1,-1]):m.yR(N);let g=300*v.dataWidth/320;H[0]=g,H[1]=g,H[2]=.5*v.dataWidth,H[3]=.5*v.dataHeight;const w={token:f,d:b,p:a,t:"videoFrameS2C",userFacing:n,uvTransform:p,w:d,h,cameraToDevice:N,cameraModel:H,source:o};S.postOutgoingMessage(w,[w.d,w.uvTransform.buffer]);const y=i._pipeline_by_instance.get(a);y&&(t.pipeline_camera_frame_submit_raw_pointer(y,U,c,W(_.format),u,l,f,N,B,H,n),t.pipeline_frame_update(y),i.exploreState()),_.close()}}))}(t,e,n.s,n.p,n.userFacing,r,n.source);break}case"cameraToScreenC2S":B=a.r;break;case"imageBitmapC2S":!function(e,t,r,a){const[n,i]=function(){if(!L||!z){const e=new OffscreenCanvas(1,1);if(z=e.getContext("webgl"),!z)throw new Error("Unable to get offscreen GL context");L=new x(z)}return[L,z]}();if(M||(M=i.createTexture(),i.bindTexture(i.TEXTURE_2D,M),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR)),!M)return;(!F||F.byteLength<v.dataWidth*v.dataHeight)&&(console.log("Generating pixel buffer",v.dataWidth*v.dataHeight),F=new ArrayBuffer(v.dataWidth*v.dataHeight)),n.uploadFrame(M,e.i,e.r,e.userFacing);let o=n.readFrame(M,F),s={t:"imageBitmapS2C",dataWidth:o.dataWidth,dataHeight:o.dataHeight,frame:e.i,userFacing:o.userFacing,uvTransform:o.uvTransform||m.Ue(),tokenId:e.tokenId,p:e.p};a.postOutgoingMessage(s,[e.i]);let _=r._pipeline_by_instance.get(e.p);_&&(t.pipeline_camera_frame_submit(_,F,o.dataWidth,o.dataHeight,e.tokenId,e.cameraToDevice,e.cameraModel,o.userFacing),t.pipeline_frame_update(_),r.exploreState())}(a,e,r,S)}}))}})}))}let U=0,C=0,V=1;const N=m.Ue(),H=new Float32Array([300,300,160,120,0,0]);function W(e){switch(e){case"I420":return h.FRAME_PIXEL_FORMAT_I420;case"I420A":return h.FRAME_PIXEL_FORMAT_I420A;case"I422":return h.FRAME_PIXEL_FORMAT_I422;case"I444":return h.FRAME_PIXEL_FORMAT_I444;case"NV12":return h.FRAME_PIXEL_FORMAT_NV12;case"RGBA":case"RGBX":return h.FRAME_PIXEL_FORMAT_RGBA;case"BGRA":case"BGRX":return h.FRAME_PIXEL_FORMAT_BGRA}return h.FRAME_PIXEL_FORMAT_Y}const G=self;S.onOutgoingMessage.bind((()=>{let e=S.getOutgoingMessages();for(let t of e)G.postMessage(t.msg,t.transferables)}));let Y=e=>{e&&e.data&&"wasm"===e.data.t&&(D(location.href.startsWith("blob")?e.data.url:new URL(r(394),r.b).toString()),G.removeEventListener("message",Y))};G.addEventListener("message",Y),G.addEventListener("message",(e=>{S.postIncomingMessage(e.data)}))},394:(e,t,r)=>{e.exports=r.p+"557cf735d27efb96e262.wasm"}},a={};function n(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return r[e].call(i.exports,i,i.exports,n),i.exports}return n.m=r,n.x=()=>{var e=n.O(void 0,[169],(()=>n(752)));return n.O(e)},n.amdO={},e=[],n.O=(t,r,a,i)=>{if(!r){var o=1/0;for(f=0;f<e.length;f++){for(var[r,a,i]=e[f],s=!0,_=0;_<r.length;_++)(!1&i||o>=i)&&Object.keys(n.O).every((e=>n.O[e](r[_])))?r.splice(_--,1):(s=!1,i<o&&(o=i));if(s){e.splice(f--,1);var c=a();void 0!==c&&(t=c)}}return t}i=i||0;for(var f=e.length;f>0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[r,a,i]},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".zappar-cv.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{n.b=self.location+"";var e={752:1};n.f.i=(t,r)=>{e[t]||importScripts(n.p+n.u(t))};var t=self.webpackChunkZCV=self.webpackChunkZCV||[],r=t.push.bind(t);t.push=t=>{var[a,i,o]=t;for(var s in i)n.o(i,s)&&(n.m[s]=i[s]);for(o&&o(n);a.length;)e[a.pop()]=1;r(t)}})(),t=n.x,n.x=()=>n.e(169).then(t),n.x()})()}));