From 49680aa4b112bdfc042e7a3c9ab766bd7956b1a2 Mon Sep 17 00:00:00 2001 From: Brian Beck Date: Wed, 8 Apr 2026 09:08:59 -0700 Subject: [PATCH] update asset URLs to tribes2.online --- docs/404.html | 2 +- docs/404/index.html | 2 +- .../_buildManifest.js | 0 .../_clientMiddlewareManifest.json | 0 .../_ssgManifest.js | 0 ...eaa877b756003b3.js => 0baa0c6f20549fef.js} | 2 +- docs/_next/static/chunks/2a02daea7eb2756c.js | 1 + ...9f21d966613a96e.js => 4cde5a883a99f9c9.js} | 2 +- ...63fc3798baf75bd.js => 8b82d6c1705317af.js} | 2 +- ...0cecef8385b39df.js => c8d20bf4c6d52266.js} | 2 +- ...0f1f445ab9525e3.js => d0ff1d6ce0fd9297.js} | 2 +- ...abf3874637c5516.js => e5f31ffb0a3e45f4.js} | 2 +- ...3ceca71888c9b70.js => f66959b00ac693d8.js} | 2 +- ...f9470a691b55cfe.js => fce06ff30e9ff4bb.js} | 2 +- docs/gallery/index.html | 2 +- docs/gallery/index.txt | 4 +- docs/index.html | 2 +- docs/index.txt | 4 +- src/WarriorProvider.tsx | 29 ++++++----- src/app/gallery/page.tsx | 52 +++++++++---------- src/deployPaths.ts | 3 ++ src/exportUtils.ts | 11 ++-- src/useManifest.ts | 4 +- 23 files changed, 68 insertions(+), 64 deletions(-) rename docs/_next/static/{kzYjkQr65mRpo7Nh2-DI8 => Ip_GuyV0-9tYYuXg6C6XE}/_buildManifest.js (100%) rename docs/_next/static/{kzYjkQr65mRpo7Nh2-DI8 => Ip_GuyV0-9tYYuXg6C6XE}/_clientMiddlewareManifest.json (100%) rename docs/_next/static/{kzYjkQr65mRpo7Nh2-DI8 => Ip_GuyV0-9tYYuXg6C6XE}/_ssgManifest.js (100%) rename docs/_next/static/chunks/{3eaa877b756003b3.js => 0baa0c6f20549fef.js} (99%) create mode 100644 docs/_next/static/chunks/2a02daea7eb2756c.js rename docs/_next/static/chunks/{d9f21d966613a96e.js => 4cde5a883a99f9c9.js} (70%) rename docs/_next/static/chunks/{d63fc3798baf75bd.js => 8b82d6c1705317af.js} (99%) rename docs/_next/static/chunks/{40cecef8385b39df.js => c8d20bf4c6d52266.js} (63%) rename docs/_next/static/chunks/{a0f1f445ab9525e3.js => d0ff1d6ce0fd9297.js} (97%) rename docs/_next/static/chunks/{2abf3874637c5516.js => e5f31ffb0a3e45f4.js} (51%) rename docs/_next/static/chunks/{43ceca71888c9b70.js => f66959b00ac693d8.js} (89%) rename docs/_next/static/chunks/{5f9470a691b55cfe.js => fce06ff30e9ff4bb.js} (96%) create mode 100644 src/deployPaths.ts diff --git a/docs/404.html b/docs/404.html index 3bf31bc..66f1251 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404: This page could not be found.T2 Model Viewer & Skinner

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.T2 Model Viewer & Skinner

404

This page could not be found.

\ No newline at end of file diff --git a/docs/404/index.html b/docs/404/index.html index 3bf31bc..66f1251 100644 --- a/docs/404/index.html +++ b/docs/404/index.html @@ -1 +1 @@ -404: This page could not be found.T2 Model Viewer & Skinner

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.T2 Model Viewer & Skinner

404

This page could not be found.

\ No newline at end of file diff --git a/docs/_next/static/kzYjkQr65mRpo7Nh2-DI8/_buildManifest.js b/docs/_next/static/Ip_GuyV0-9tYYuXg6C6XE/_buildManifest.js similarity index 100% rename from docs/_next/static/kzYjkQr65mRpo7Nh2-DI8/_buildManifest.js rename to docs/_next/static/Ip_GuyV0-9tYYuXg6C6XE/_buildManifest.js diff --git a/docs/_next/static/kzYjkQr65mRpo7Nh2-DI8/_clientMiddlewareManifest.json b/docs/_next/static/Ip_GuyV0-9tYYuXg6C6XE/_clientMiddlewareManifest.json similarity index 100% rename from docs/_next/static/kzYjkQr65mRpo7Nh2-DI8/_clientMiddlewareManifest.json rename to docs/_next/static/Ip_GuyV0-9tYYuXg6C6XE/_clientMiddlewareManifest.json diff --git a/docs/_next/static/kzYjkQr65mRpo7Nh2-DI8/_ssgManifest.js b/docs/_next/static/Ip_GuyV0-9tYYuXg6C6XE/_ssgManifest.js similarity index 100% rename from docs/_next/static/kzYjkQr65mRpo7Nh2-DI8/_ssgManifest.js rename to docs/_next/static/Ip_GuyV0-9tYYuXg6C6XE/_ssgManifest.js diff --git a/docs/_next/static/chunks/3eaa877b756003b3.js b/docs/_next/static/chunks/0baa0c6f20549fef.js similarity index 99% rename from docs/_next/static/chunks/3eaa877b756003b3.js rename to docs/_next/static/chunks/0baa0c6f20549fef.js index 6d593dd..f69f803 100644 --- a/docs/_next/static/chunks/3eaa877b756003b3.js +++ b/docs/_next/static/chunks/0baa0c6f20549fef.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29947,e=>{e.v(JSON.parse('{"defaultSkins":{"lmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"mmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"hmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"lfemale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"mfemale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"hfemale":[],"lbioderm":["Horde","Inferno","Storm"],"mbioderm":["Horde","Inferno","Storm"],"hbioderm":["Horde","Inferno","Storm"]},"modelDefaults":{"lmale":"Blood Eagle","mmale":"Blood Eagle","hmale":"Blood Eagle","lfemale":"Blood Eagle","mfemale":"Blood Eagle","hfemale":"Blood Eagle","lbioderm":"Storm","mbioderm":"Storm","hbioderm":"Storm","chaingun":"weapon_chaingun","disc":"weapon_disc","elf":"weapon_elf","energy":"weapon_energy","grenade_launcher":"weapon_grenade_launcher","mine":"mine","missile":"weapon_missile","mortar":"weapon_mortar","plasmathrower":"weapon_plasmathrower","repair":"weapon_repair","shocklance":"weapon_shocklance","sniper":"weapon_sniper","targeting":"weapon_targeting","vehicle_land_mpbbase":"vehicle_land_mpbbase","vehicle_grav_scout":"vehicle_grav_scout","vehicle_grav_tank":"vehicle_grav_tank","turret_assaulttank_mortar":"turret_assaulttank_mortar","vehicle_air_scout":"vehicle_air_scout","vehicle_air_bomber":"vehicle_air_bomber","vehicle_air_hapc":"vehicle_air_hapc"},"animationLabels":{"Forward":"Run Forward","Back":"Run Backward","Back0":"Run Backward","Root":"Idle","Root2":"Run Backward","Root3":"Idle","Idlepda":"Idle (PDA)","PDA":"Idle (PDA)","Root1":"Idle (PDA)","Jump":"Jump","Jump0":"Jump (Alternate)","Jump1":"Jump (Alternate)","Jump2":"Jump (Alternate)","Jump3":"Jump (Alternate)","Jet":"Jet","Fall":"Fall","Land":"Land","Land1":"Land (Alternate)","ski":"Ski","Side":"Strafe Left","Celwave":"Wave","Celbow":"Bow","Celdisco":"Dance","Celdance":"Dance","Celflex":"Flex","Celflex1":"Flex","Celrocky":"Awesome","Celjump":"Awesome","Celsalute":"Salute","celTaunt":"Too Bad","CelebrationGora":"Wave Arms","Celgora":"Wave Arms","CelebrationJump":"Bull Charge","Tauntbull":"Bull Charge","CelebrationJump0":"Celebrate","CelebrationJump4":"The Greatest","CelebrationRoar":"Roar","Celroar":"Roar","Celraor":"Roar","Celflex2":"Flex","celyeah":"Yeah","celtaunt":"Too Bad","Tauntbutt":"Butt","Tauntkiss":"Blow Kiss","Tauntbest":"The Greatest","Taunimp":"Move!","Tauntimp":"Move!","Sitting":"Sit","Scoutroot":"Gravcycle","Recoilde":"Recoil","Light_recoil":"Recoil","Dieforward":"Death (Fall Forward)","DeathForward":"Death (Fall Forward)","Dieslump":"Death (Slump)","DeathSlump":"Death (Slump)","Diespin":"Death (Spin)","DeathSpin":"Death (Spin)","diechest":"Death (Hold Chest)","Diechest":"Death (Hold Chest)","DeathChest":"Death (Hold Chest)","Dieback":"Death (Hold Back)","DeathBack":"Death (Hold Back)","Diehead":"Death (Hold Head)","DeathHead":"Death (Hold Head)","Dieknees":"Death (On Knees)","DeathKnees":"Death (On Knees)","Dieleglf":"Death (Left Leg Injury)","Dieleglft":"Death (Left Leg Injury)","DeathLegLeft":"Death (Left Leg Injury)","Dielegrt":"Death (Right Leg Injury)","Dielegtrt":"Death (Right Leg Injury)","DeathLegRight":"Death (Right Leg Injury)","Dielegrt0":"Death (Right Leg Injury)","Diesidelf":"Death (Left Side)","DeathSideLeft":"Death (Left Side)","Diesidert":"Death (Right Side)","DeathSideRight":"Death (Right Side)","Diesidert0":"Death (Right Side Alternate)"},"cameraOverrides":{"chaingun":{"target":"0m 0m 0m","fov":"12deg"},"plasmathrower":{"target":"0.002m -0.001m 0m","fov":"12deg"},"energy":{"fov":"31deg","orbit":"135deg 70deg 105%"},"hmale":{"fov":"24deg"},"hfemale":{"fov":"24deg"},"hbioderm":{"fov":"24deg"},"vehicle_grav_scout":{"orbit":"290deg 60deg 130%"},"vehicle_grav_tank":{"orbit":"290deg 60deg 130%"},"turret_assaulttank_mortar":{"orbit":"290deg 60deg 130%"},"vehicle_land_mpbbase":{"orbit":"290deg 60deg 130%"},"vehicle_air_scout":{"orbit":"290deg 60deg 130%"},"vehicle_air_bomber":{"orbit":"290deg 60deg 130%"},"vehicle_air_hapc":{"orbit":"290deg 60deg 130%"}},"animationLabelOverrides":{"mmale":{"Back":"Strafe Left"},"mfemale":{"Dielegrt":"Death (Slump)"},"lbioderm":{"Root":"Gravcycle"}},"materials":{"lmale":[{"name":"base","label":"Warrior","fileSuffix":".lmale"}],"mmale":[{"name":"base","label":"Warrior","fileSuffix":".mmale"}],"hmale":[{"name":"base","label":"Warrior","fileSuffix":".hmale"}],"lfemale":[{"name":"base","label":"Warrior","fileSuffix":".lfemale"}],"mfemale":[{"name":"base","label":"Warrior","fileSuffix":".mfemale"}],"lbioderm":[{"name":"base","label":"Warrior","fileSuffix":".lbioderm"}],"mbioderm":[{"name":"base","label":"Warrior","fileSuffix":".mbioderm"}],"hbioderm":[{"name":"base","label":"Warrior","fileSuffix":".hbioderm"}],"disc":[{"name":"weapon_disc","label":"Weapon"},{"name":"dcase00","label":"Disc Case","size":[256,256],"baseColorFactor":[1,1,1,0.7],"emissiveFactor":[1,1,1],"emissiveTexture":true,"alphaMode":"BLEND","metallicFactor":0,"roughnessFactor":1,"frameCount":6,"frameTimings":[21,1,1,1,1,1],"optional":true}],"chaingun":[{"label":"Chaingun","name":"weapon_chaingun"}],"grenade_launcher":[{"label":"Grenade Launcher","name":"weapon_grenade_launcher"}],"sniper":[{"label":"Weapon","name":"weapon_sniper"},{"label":"Green Light","name":"greenlight","hasDefault":false,"optional":true},{"label":"Red Light","name":"lite_red","hasDefault":false,"optional":true}],"plasmathrower":[{"label":"Rear & Barrel","name":"weapon_plasma10","file":"weapon_plasma1"},{"label":"Top & Front","name":"weapon_plasma21","file":"weapon_plasma2"},{"name":"weapon_plasma1","file":"weapon_plasma1","selectable":false},{"name":"weapon_plasma2","file":"weapon_plasma2","selectable":false}],"energy":[{"label":"Weapon","name":"blinn1","file":"weapon_energy"}],"shocklance":[{"label":"Weapon","name":"weapon_shocklance","size":[512,256]},{"label":"Glow","name":"weapon_shocklance_glow_","file":"weapon_shocklance_glow ","emissiveFactor":[1,1,1],"alphaMode":"MASK","alphaCutoff":255,"emissiveTexture":true,"metallicFactor":0,"roughnessFactor":1,"size":[256,128],"optional":true}],"elf":[{"label":"Weapon","name":"weapon_elf","file":"weapon_elf"}],"missile":[{"label":"Weapon","name":"weapon_missile"}],"mortar":[{"label":"Weapon","name":"weapon_mortar"}],"repair":[{"label":"Weapon","name":"weapon_repair"}],"targeting":[{"label":"Weapon","name":"weapon_targeting"}],"mine":[{"label":"Weapon","name":"mine","size":[512,512],"metallicFactor":0,"roughnessFactor":1}],"vehicle_air_scout":[{"label":"Vehicle","name":"vehicle_air_scout0","file":"vehicle_air_scout"},{"name":"Unassigned","hidden":true,"hasDefault":false},{"name":"vehicle_air_scout","hidden":true,"hasDefault":false},{"label":"Flare","name":"shrikeflare2","emissiveFactor":[0,0,0],"alphaMode":"BLEND","emissiveTexture":true,"metallicFactor":0,"roughnessFactor":1,"size":[256,256],"optional":true}],"vehicle_air_bomber":[{"label":"Cockpit & Thrusters","name":"vehicle_air_bomber10","file":"vehicle_air_bomber1","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Rear","name":"vehicle_air_bomber2","size":[256,512]},{"label":"Wings","name":"vehicle_air_bomber31","file":"vehicle_air_bomber3"},{"name":"vehicle_air_bomber1","size":[256,512],"selectable":false},{"name":"vehicle_air_bomber3","selectable":false}],"vehicle_air_hapc":[{"label":"Cockpit","name":"vehicle_air_bomber1","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Wings","name":"vehicle_air_hpc2"},{"label":"Seats","name":"vehicle_air_hpc1"},{"label":"Thrusters","name":"vehicle_air_hpc30","file":"vehicle_air_hpc3"},{"name":"vehicle_air_hpc3","selectable":false}],"vehicle_grav_scout":[{"label":"Vehicle","name":"Vehicle_grav_scout0","file":"Vehicle_grav_scout","size":[512,256]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Pipes","name":"Vehicle_grav_scout_pipes1","file":"Vehicle_grav_scout_pipes","metallicFactor":0,"roughnessFactor":1},{"name":"Vehicle_grav_scout","hidden":true,"hasDefault":false},{"label":"Side Thrusters","name":"Vehicle_grav_scout_pipes","file":"Vehicle_grav_scout_pipes","emissiveFactor":[1,1,1],"alphaMode":"OPAQUE","metallicFactor":0,"roughnessFactor":1,"emissiveTexture":true,"selectable":false},{"label":"Windshield","name":"Vehicle_grav_scout_windshield","file":"Vehicle_grav_scout_windshield","selectable":false,"alphaMode":"BLEND","baseColorFactor":[1,1,1,0.5],"metallicFactor":0,"roughnessFactor":1,"size":[128,128],"optional":true},{"label":"Windshield Inner","name":"Vehicle_grav_scout_windshieldInner","file":"Vehicle_grav_scout_windshieldInner","selectable":false,"alphaMode":"BLEND","baseColorFactor":[1,1,1,0.5],"metallicFactor":0,"roughnessFactor":1,"size":[128,128],"optional":true}],"vehicle_grav_tank":[{"label":"Center","name":"Vehicle_grav_tank_bodyMain","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Sides","name":"vehicle_grav_tank_bodyside10","file":"vehicle_grav_tank_bodyside1","size":[256,512]},{"label":"Thrusters","name":"vehicle_grav_tank_bodyside21","file":"vehicle_grav_tank_bodyside2"},{"name":"vehicle_grav_tank_bodyside2","selectable":false},{"name":"vehicle_grav_tank_bodyside1","selectable":false}],"turret_assaulttank_mortar":[{"label":"Turret","name":"turret_assaulttank_mortar","file":"turret_assaultTank"}],"vehicle_land_mpbbase":[{"label":"Vehicle Front","name":"vehicle_land_mpb1"},{"label":"Vehicle Back","name":"vehicle_land_mpb2"},{"label":"Wheels","name":"Vehicle_Land_Assault_wheel","file":"Vehicle_Land_Assault_Wheel","size":[512,256],"optional":true}]},"animations":{"global":["Forward","Back","Jump","Jet","Fall","Land","ski","Root"],"lmale":["Idlepda","Side","Jump0","Land1","Recoilde","Celwave","Celdisco","Celflex","Celrocky","Celsalute","celTaunt","Taunimp","Tauntbest","Dieback","diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Dieslump","Diespin","Scoutroot","Sitting"],"mmale":["Back0","Jump3","Recoilde","Celwave","Celdance","Celflex","Celrocky","Celsalute","celtaunt","Tauntbest","Tauntimp","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Diespin","Sitting"],"hmale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celdance","Celflex","Celjump","Celsalute","celtaunt","Tauntbest","Tauntimp","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dielegrt","Diesidelf","Diesidert","Diesidert0","Dieslump","Diespin"],"lfemale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celbow","Celdance","Celsalute","Tauntbest","Tauntbutt","Tauntimp","Tauntkiss","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Dieslump","Diespin","Scoutroot","Sitting"],"mfemale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celbow","Celdisco","Celsalute","Tauntbest","Tauntbutt","Tauntimp","Tauntkiss","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Dielegrt0","Diesidelf","Diesidert","Diespin","Sitting"],"lbioderm":["Root3","PDA","Jump2","Side","Light_recoil","CelebrationGora","CelebrationJump","CelebrationJump0","CelebrationJump4","CelebrationRoar","Salute","Celflex2","celyeah","DeathBack","DeathChest","DeathForward","DeathHead","DeathKnees","DeathLegLeft","DeathLegRight","DeathSideLeft","DeathSideRight","DeathSlump","DeathSpin","Sitting"],"mbioderm":["Root1","Jump2","Side","Recoilde","Salute","Celflex1","Celgora","Celjump","Celroar","celyeah","Tauntbest","Tauntbull","DeathBack","DeathChest","DeathHead","DeathSideLeft","DeathSpin","Dieforward","Dieknees","Dieleglft","Dielegtrt","Diesidert","Dieslump","Sitting"],"hbioderm":["Root1","Jump2","Side","Recoilde","Salute","Celflex2","Celgora","Celjump","Celraor","celyeah","Tauntbest","Tauntbull","DeathBack","DeathChest","DeathForward","DeathHead","DeathKnees","DeathLegLeft","DeathLegRight","DeathSideLeft","DeathSideRight","DeathSlump","DeathSpin"]}}'))},67034,(e,t,r)=>{!function(){var e={675:function(e,t){"use strict";t.byteLength=function(e){var t=f(e),r=t[0],i=t[1];return(r+i)*3/4-i},t.toByteArray=function(e){var t,r,n=f(e),o=n[0],l=n[1],s=new a((o+l)*3/4-l),h=0,u=l>0?o-4:o;for(r=0;r>16&255,s[h++]=t>>8&255,s[h++]=255&t;return 2===l&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,s[h++]=255&t),1===l&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,s[h++]=t>>8&255,s[h++]=255&t),s},t.fromByteArray=function(e){for(var t,i=e.length,a=i%3,n=[],o=0,l=i-a;o>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return n.join("")}(e,o,o+16383>l?l:o+16383));return 1===a?n.push(r[(t=e[i-1])>>2]+r[t<<4&63]+"=="):2===a&&n.push(r[(t=(e[i-2]<<8)+e[i-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),n.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,l=n.length;o0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var i=r===t?0:4-r%4;return[r,i]}i[45]=62,i[95]=63},72:function(e,t,r){"use strict";var i=r(675),a=r(783),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return h(e)}return f(e,t,r)}function f(e,t,r){if("string"==typeof e){var i=e,a=t;if(("string"!=typeof a||""===a)&&(a="utf8"),!l.isEncoding(a))throw TypeError("Unknown encoding: "+a);var n=0|p(i,a),f=o(n),s=f.write(i,a);return s!==n&&(f=f.slice(0,s)),f}if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(T(e,ArrayBuffer)||e&&T(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(T(e,SharedArrayBuffer)||e&&T(e.buffer,SharedArrayBuffer)))return function(e,t,r){var i;if(t<0||e.byteLength=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||T(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return A(e).length;default:if(a)return i?-1:B(e).length;t=(""+t).toLowerCase(),a=!0}}function d(e,t,r){var a,n,o,l=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var a="",n=t;n0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(n=r*=1)!=n&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(a)return -1;else r=e.length-1;else if(r<0)if(!a)return -1;else r=0;if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:b(e,t,r,i,a);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(a)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b(e,[t],r,i,a)}throw TypeError("val must be string, number or Buffer")}function b(e,t,r,i,a){var n,o=1,l=e.length,f=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return -1;o=2,l/=2,f/=2,r/=2}function s(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var h=-1;for(n=r;nl&&(r=l-f),n=r;n>=0;n--){for(var u=!0,c=0;cr&&(e+=" ... "),""},n&&(l.prototype[n]=l.prototype.inspect),l.prototype.compare=function(e,t,r,i,a){if(T(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),t<0||r>e.length||i<0||a>this.length)throw RangeError("out of range index");if(i>=a&&t>=r)return 0;if(i>=a)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var n=a-i,o=r-t,f=Math.min(n,o),s=this.slice(i,a),h=e.slice(t,r),u=0;u239?4:s>223?3:s>191?2:1;if(a+u<=r)switch(u){case 1:s<128&&(h=s);break;case 2:(192&(n=e[a+1]))==128&&(f=(31&s)<<6|63&n)>127&&(h=f);break;case 3:n=e[a+1],o=e[a+2],(192&n)==128&&(192&o)==128&&(f=(15&s)<<12|(63&n)<<6|63&o)>2047&&(f<55296||f>57343)&&(h=f);break;case 4:n=e[a+1],o=e[a+2],l=e[a+3],(192&n)==128&&(192&o)==128&&(192&l)==128&&(f=(15&s)<<18|(63&n)<<12|(63&o)<<6|63&l)>65535&&f<1114112&&(h=f)}null===h?(h=65533,u=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),a+=u}var c=i,p=c.length;if(p<=4096)return String.fromCharCode.apply(String,c);for(var d="",g=0;gr)throw RangeError("Trying to access beyond buffer length")}function _(e,t,r,i,a,n){if(!l.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw RangeError("Index out of range")}function w(e,t,r,i,a,n){if(r+i>e.length||r<0)throw RangeError("Index out of range")}function D(e,t,r,i,n){return t*=1,r>>>=0,n||w(e,t,r,4,34028234663852886e22,-34028234663852886e22),a.write(e,t,r,i,23,4),r+4}function S(e,t,r,i,n){return t*=1,r>>>=0,n||w(e,t,r,8,17976931348623157e292,-17976931348623157e292),a.write(e,t,r,i,52,8),r+8}l.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a,n,o,l,f,s,h,u,c=this.length-t;if((void 0===r||r>c)&&(r=c),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return function(e,t,r,i){r=Number(r)||0;var a=e.length-r;i?(i=Number(i))>a&&(i=a):i=a;var n=t.length;i>n/2&&(i=n/2);for(var o=0;o>8,a.push(r%256),a.push(i);return a}(e,this.length-h),this,h,u);default:if(p)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||v(e,t,this.length);for(var i=this[e],a=1,n=0;++n>>=0,t>>>=0,r||v(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},l.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var i=this[e],a=1,n=0;++n=(a*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var i=t,a=1,n=this[e+--i];i>0&&(a*=256);)n+=this[e+--i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),a.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),a.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),a.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),a.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,i){if(e*=1,t>>>=0,r>>>=0,!i){var a=Math.pow(2,8*r)-1;_(this,e,t,r,a,0)}var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,!i){var a=Math.pow(2,8*r)-1;_(this,e,t,r,a,0)}var n=r-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,i){if(e*=1,t>>>=0,!i){var a=Math.pow(2,8*r-1);_(this,e,t,r,a-1,-a)}var n=0,o=1,l=0;for(this[t]=255&e;++n>>=0,!i){var a=Math.pow(2,8*r-1);_(this,e,t,r,a-1,-a)}var n=r-1,o=1,l=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===l&&0!==this[t+n+1]&&(l=1),this[t+n]=(e/o|0)-l&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return S(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return S(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,i){if(!l.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return a},l.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===e.length){var a,n=e.charCodeAt(0);("utf8"===i&&n<128||"latin1"===i)&&(e=n)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!a){if(r>56319||o+1===i){(t-=3)>-1&&n.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&n.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;n.push(r)}else if(r<2048){if((t-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return n}function E(e){for(var t=[],r=0;r=t.length)&&!(a>=e.length);++a)t[a+r]=e[a];return a}function T(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var x=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var i=16*r,a=0;a<16;++a)t[i+a]=e[r]+e[a];return t}()},783:function(e,t){t.read=function(e,t,r,i,a){var n,o,l=8*a-i-1,f=(1<>1,h=-7,u=r?a-1:0,c=r?-1:1,p=e[t+u];for(u+=c,n=p&(1<<-h)-1,p>>=-h,h+=l;h>0;n=256*n+e[t+u],u+=c,h-=8);for(o=n&(1<<-h)-1,n>>=-h,h+=i;h>0;o=256*o+e[t+u],u+=c,h-=8);if(0===n)n=1-s;else{if(n===f)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),n-=s}return(p?-1:1)*o*Math.pow(2,n-i)},t.write=function(e,t,r,i,a,n){var o,l,f,s=8*n-a-1,h=(1<>1,c=5960464477539062e-23*(23===a),p=i?0:n-1,d=i?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(l=+!!isNaN(t),o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?t+=c/f:t+=c*Math.pow(2,1-u),t*f>=2&&(o++,f/=2),o+u>=h?(l=0,o=h):o+u>=1?(l=(t*f-1)*Math.pow(2,a),o+=u):(l=t*Math.pow(2,u-1)*Math.pow(2,a),o=0));a>=8;e[r+p]=255&l,p+=d,l/=256,a-=8);for(o=o<0;e[r+p]=255&o,p+=d,o/=256,s-=8);e[r+p-d]|=128*g}}},r={};function i(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,i),o=!1}finally{o&&delete r[t]}return n.exports}i.ab="/ROOT/node_modules/next/dist/compiled/buffer/",t.exports=i(72)}()},5993,e=>{e.v("/t2-model-skinner/_next/static/media/imageProcessing.worker.dbca7ab4.ts")},63871,e=>{"use strict";e.s(["ModelViewerContext",()=>r,"default",()=>i]);var t=e.i(71645);let r=t.default.createContext(null);function i(){let e=(0,t.useContext)(r);if(!e)throw Error("No ModelViewerContext.Provider");return e}r.displayName="ModelViewerContext"},91135,e=>{e.v(t=>Promise.all(["static/chunks/2abf3874637c5516.js"].map(t=>e.l(t))).then(()=>t(69642)))},22143,e=>{e.v(t=>Promise.all(["static/chunks/2d6d26cb79779ffe.js"].map(t=>e.l(t))).then(()=>t(66641)))}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29947,e=>{e.v(JSON.parse('{"defaultSkins":{"lmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"mmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"hmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"lfemale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"mfemale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"hfemale":[],"lbioderm":["Horde","Inferno","Storm"],"mbioderm":["Horde","Inferno","Storm"],"hbioderm":["Horde","Inferno","Storm"]},"modelDefaults":{"lmale":"Blood Eagle","mmale":"Blood Eagle","hmale":"Blood Eagle","lfemale":"Blood Eagle","mfemale":"Blood Eagle","hfemale":"Blood Eagle","lbioderm":"Storm","mbioderm":"Storm","hbioderm":"Storm","chaingun":"weapon_chaingun","disc":"weapon_disc","elf":"weapon_elf","energy":"weapon_energy","grenade_launcher":"weapon_grenade_launcher","mine":"mine","missile":"weapon_missile","mortar":"weapon_mortar","plasmathrower":"weapon_plasmathrower","repair":"weapon_repair","shocklance":"weapon_shocklance","sniper":"weapon_sniper","targeting":"weapon_targeting","vehicle_land_mpbbase":"vehicle_land_mpbbase","vehicle_grav_scout":"vehicle_grav_scout","vehicle_grav_tank":"vehicle_grav_tank","turret_assaulttank_mortar":"turret_assaulttank_mortar","vehicle_air_scout":"vehicle_air_scout","vehicle_air_bomber":"vehicle_air_bomber","vehicle_air_hapc":"vehicle_air_hapc"},"animationLabels":{"Forward":"Run Forward","Back":"Run Backward","Back0":"Run Backward","Root":"Idle","Root2":"Run Backward","Root3":"Idle","Idlepda":"Idle (PDA)","PDA":"Idle (PDA)","Root1":"Idle (PDA)","Jump":"Jump","Jump0":"Jump (Alternate)","Jump1":"Jump (Alternate)","Jump2":"Jump (Alternate)","Jump3":"Jump (Alternate)","Jet":"Jet","Fall":"Fall","Land":"Land","Land1":"Land (Alternate)","ski":"Ski","Side":"Strafe Left","Celwave":"Wave","Celbow":"Bow","Celdisco":"Dance","Celdance":"Dance","Celflex":"Flex","Celflex1":"Flex","Celrocky":"Awesome","Celjump":"Awesome","Celsalute":"Salute","celTaunt":"Too Bad","CelebrationGora":"Wave Arms","Celgora":"Wave Arms","CelebrationJump":"Bull Charge","Tauntbull":"Bull Charge","CelebrationJump0":"Celebrate","CelebrationJump4":"The Greatest","CelebrationRoar":"Roar","Celroar":"Roar","Celraor":"Roar","Celflex2":"Flex","celyeah":"Yeah","celtaunt":"Too Bad","Tauntbutt":"Butt","Tauntkiss":"Blow Kiss","Tauntbest":"The Greatest","Taunimp":"Move!","Tauntimp":"Move!","Sitting":"Sit","Scoutroot":"Gravcycle","Recoilde":"Recoil","Light_recoil":"Recoil","Dieforward":"Death (Fall Forward)","DeathForward":"Death (Fall Forward)","Dieslump":"Death (Slump)","DeathSlump":"Death (Slump)","Diespin":"Death (Spin)","DeathSpin":"Death (Spin)","diechest":"Death (Hold Chest)","Diechest":"Death (Hold Chest)","DeathChest":"Death (Hold Chest)","Dieback":"Death (Hold Back)","DeathBack":"Death (Hold Back)","Diehead":"Death (Hold Head)","DeathHead":"Death (Hold Head)","Dieknees":"Death (On Knees)","DeathKnees":"Death (On Knees)","Dieleglf":"Death (Left Leg Injury)","Dieleglft":"Death (Left Leg Injury)","DeathLegLeft":"Death (Left Leg Injury)","Dielegrt":"Death (Right Leg Injury)","Dielegtrt":"Death (Right Leg Injury)","DeathLegRight":"Death (Right Leg Injury)","Dielegrt0":"Death (Right Leg Injury)","Diesidelf":"Death (Left Side)","DeathSideLeft":"Death (Left Side)","Diesidert":"Death (Right Side)","DeathSideRight":"Death (Right Side)","Diesidert0":"Death (Right Side Alternate)"},"cameraOverrides":{"chaingun":{"target":"0m 0m 0m","fov":"12deg"},"plasmathrower":{"target":"0.002m -0.001m 0m","fov":"12deg"},"energy":{"fov":"31deg","orbit":"135deg 70deg 105%"},"hmale":{"fov":"24deg"},"hfemale":{"fov":"24deg"},"hbioderm":{"fov":"24deg"},"vehicle_grav_scout":{"orbit":"290deg 60deg 130%"},"vehicle_grav_tank":{"orbit":"290deg 60deg 130%"},"turret_assaulttank_mortar":{"orbit":"290deg 60deg 130%"},"vehicle_land_mpbbase":{"orbit":"290deg 60deg 130%"},"vehicle_air_scout":{"orbit":"290deg 60deg 130%"},"vehicle_air_bomber":{"orbit":"290deg 60deg 130%"},"vehicle_air_hapc":{"orbit":"290deg 60deg 130%"}},"animationLabelOverrides":{"mmale":{"Back":"Strafe Left"},"mfemale":{"Dielegrt":"Death (Slump)"},"lbioderm":{"Root":"Gravcycle"}},"materials":{"lmale":[{"name":"base","label":"Warrior","fileSuffix":".lmale"}],"mmale":[{"name":"base","label":"Warrior","fileSuffix":".mmale"}],"hmale":[{"name":"base","label":"Warrior","fileSuffix":".hmale"}],"lfemale":[{"name":"base","label":"Warrior","fileSuffix":".lfemale"}],"mfemale":[{"name":"base","label":"Warrior","fileSuffix":".mfemale"}],"lbioderm":[{"name":"base","label":"Warrior","fileSuffix":".lbioderm"}],"mbioderm":[{"name":"base","label":"Warrior","fileSuffix":".mbioderm"}],"hbioderm":[{"name":"base","label":"Warrior","fileSuffix":".hbioderm"}],"disc":[{"name":"weapon_disc","label":"Weapon"},{"name":"dcase00","label":"Disc Case","size":[256,256],"baseColorFactor":[1,1,1,0.7],"emissiveFactor":[1,1,1],"emissiveTexture":true,"alphaMode":"BLEND","metallicFactor":0,"roughnessFactor":1,"frameCount":6,"frameTimings":[21,1,1,1,1,1],"optional":true}],"chaingun":[{"label":"Chaingun","name":"weapon_chaingun"}],"grenade_launcher":[{"label":"Grenade Launcher","name":"weapon_grenade_launcher"}],"sniper":[{"label":"Weapon","name":"weapon_sniper"},{"label":"Green Light","name":"greenlight","hasDefault":false,"optional":true},{"label":"Red Light","name":"lite_red","hasDefault":false,"optional":true}],"plasmathrower":[{"label":"Rear & Barrel","name":"weapon_plasma10","file":"weapon_plasma1"},{"label":"Top & Front","name":"weapon_plasma21","file":"weapon_plasma2"},{"name":"weapon_plasma1","file":"weapon_plasma1","selectable":false},{"name":"weapon_plasma2","file":"weapon_plasma2","selectable":false}],"energy":[{"label":"Weapon","name":"blinn1","file":"weapon_energy"}],"shocklance":[{"label":"Weapon","name":"weapon_shocklance","size":[512,256]},{"label":"Glow","name":"weapon_shocklance_glow_","file":"weapon_shocklance_glow ","emissiveFactor":[1,1,1],"alphaMode":"MASK","alphaCutoff":255,"emissiveTexture":true,"metallicFactor":0,"roughnessFactor":1,"size":[256,128],"optional":true}],"elf":[{"label":"Weapon","name":"weapon_elf","file":"weapon_elf"}],"missile":[{"label":"Weapon","name":"weapon_missile"}],"mortar":[{"label":"Weapon","name":"weapon_mortar"}],"repair":[{"label":"Weapon","name":"weapon_repair"}],"targeting":[{"label":"Weapon","name":"weapon_targeting"}],"mine":[{"label":"Weapon","name":"mine","size":[512,512],"metallicFactor":0,"roughnessFactor":1}],"vehicle_air_scout":[{"label":"Vehicle","name":"vehicle_air_scout0","file":"vehicle_air_scout"},{"name":"Unassigned","hidden":true,"hasDefault":false},{"name":"vehicle_air_scout","hidden":true,"hasDefault":false},{"label":"Flare","name":"shrikeflare2","emissiveFactor":[0,0,0],"alphaMode":"BLEND","emissiveTexture":true,"metallicFactor":0,"roughnessFactor":1,"size":[256,256],"optional":true}],"vehicle_air_bomber":[{"label":"Cockpit & Thrusters","name":"vehicle_air_bomber10","file":"vehicle_air_bomber1","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Rear","name":"vehicle_air_bomber2","size":[256,512]},{"label":"Wings","name":"vehicle_air_bomber31","file":"vehicle_air_bomber3"},{"name":"vehicle_air_bomber1","size":[256,512],"selectable":false},{"name":"vehicle_air_bomber3","selectable":false}],"vehicle_air_hapc":[{"label":"Cockpit","name":"vehicle_air_bomber1","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Wings","name":"vehicle_air_hpc2"},{"label":"Seats","name":"vehicle_air_hpc1"},{"label":"Thrusters","name":"vehicle_air_hpc30","file":"vehicle_air_hpc3"},{"name":"vehicle_air_hpc3","selectable":false}],"vehicle_grav_scout":[{"label":"Vehicle","name":"Vehicle_grav_scout0","file":"Vehicle_grav_scout","size":[512,256]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Pipes","name":"Vehicle_grav_scout_pipes1","file":"Vehicle_grav_scout_pipes","metallicFactor":0,"roughnessFactor":1},{"name":"Vehicle_grav_scout","hidden":true,"hasDefault":false},{"label":"Side Thrusters","name":"Vehicle_grav_scout_pipes","file":"Vehicle_grav_scout_pipes","emissiveFactor":[1,1,1],"alphaMode":"OPAQUE","metallicFactor":0,"roughnessFactor":1,"emissiveTexture":true,"selectable":false},{"label":"Windshield","name":"Vehicle_grav_scout_windshield","file":"Vehicle_grav_scout_windshield","selectable":false,"alphaMode":"BLEND","baseColorFactor":[1,1,1,0.5],"metallicFactor":0,"roughnessFactor":1,"size":[128,128],"optional":true},{"label":"Windshield Inner","name":"Vehicle_grav_scout_windshieldInner","file":"Vehicle_grav_scout_windshieldInner","selectable":false,"alphaMode":"BLEND","baseColorFactor":[1,1,1,0.5],"metallicFactor":0,"roughnessFactor":1,"size":[128,128],"optional":true}],"vehicle_grav_tank":[{"label":"Center","name":"Vehicle_grav_tank_bodyMain","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Sides","name":"vehicle_grav_tank_bodyside10","file":"vehicle_grav_tank_bodyside1","size":[256,512]},{"label":"Thrusters","name":"vehicle_grav_tank_bodyside21","file":"vehicle_grav_tank_bodyside2"},{"name":"vehicle_grav_tank_bodyside2","selectable":false},{"name":"vehicle_grav_tank_bodyside1","selectable":false}],"turret_assaulttank_mortar":[{"label":"Turret","name":"turret_assaulttank_mortar","file":"turret_assaultTank"}],"vehicle_land_mpbbase":[{"label":"Vehicle Front","name":"vehicle_land_mpb1"},{"label":"Vehicle Back","name":"vehicle_land_mpb2"},{"label":"Wheels","name":"Vehicle_Land_Assault_wheel","file":"Vehicle_Land_Assault_Wheel","size":[512,256],"optional":true}]},"animations":{"global":["Forward","Back","Jump","Jet","Fall","Land","ski","Root"],"lmale":["Idlepda","Side","Jump0","Land1","Recoilde","Celwave","Celdisco","Celflex","Celrocky","Celsalute","celTaunt","Taunimp","Tauntbest","Dieback","diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Dieslump","Diespin","Scoutroot","Sitting"],"mmale":["Back0","Jump3","Recoilde","Celwave","Celdance","Celflex","Celrocky","Celsalute","celtaunt","Tauntbest","Tauntimp","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Diespin","Sitting"],"hmale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celdance","Celflex","Celjump","Celsalute","celtaunt","Tauntbest","Tauntimp","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dielegrt","Diesidelf","Diesidert","Diesidert0","Dieslump","Diespin"],"lfemale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celbow","Celdance","Celsalute","Tauntbest","Tauntbutt","Tauntimp","Tauntkiss","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Dieslump","Diespin","Scoutroot","Sitting"],"mfemale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celbow","Celdisco","Celsalute","Tauntbest","Tauntbutt","Tauntimp","Tauntkiss","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Dielegrt0","Diesidelf","Diesidert","Diespin","Sitting"],"lbioderm":["Root3","PDA","Jump2","Side","Light_recoil","CelebrationGora","CelebrationJump","CelebrationJump0","CelebrationJump4","CelebrationRoar","Salute","Celflex2","celyeah","DeathBack","DeathChest","DeathForward","DeathHead","DeathKnees","DeathLegLeft","DeathLegRight","DeathSideLeft","DeathSideRight","DeathSlump","DeathSpin","Sitting"],"mbioderm":["Root1","Jump2","Side","Recoilde","Salute","Celflex1","Celgora","Celjump","Celroar","celyeah","Tauntbest","Tauntbull","DeathBack","DeathChest","DeathHead","DeathSideLeft","DeathSpin","Dieforward","Dieknees","Dieleglft","Dielegtrt","Diesidert","Dieslump","Sitting"],"hbioderm":["Root1","Jump2","Side","Recoilde","Salute","Celflex2","Celgora","Celjump","Celraor","celyeah","Tauntbest","Tauntbull","DeathBack","DeathChest","DeathForward","DeathHead","DeathKnees","DeathLegLeft","DeathLegRight","DeathSideLeft","DeathSideRight","DeathSlump","DeathSpin"]}}'))},67034,(e,t,r)=>{!function(){var e={675:function(e,t){"use strict";t.byteLength=function(e){var t=f(e),r=t[0],i=t[1];return(r+i)*3/4-i},t.toByteArray=function(e){var t,r,n=f(e),o=n[0],l=n[1],s=new a((o+l)*3/4-l),h=0,u=l>0?o-4:o;for(r=0;r>16&255,s[h++]=t>>8&255,s[h++]=255&t;return 2===l&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,s[h++]=255&t),1===l&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,s[h++]=t>>8&255,s[h++]=255&t),s},t.fromByteArray=function(e){for(var t,i=e.length,a=i%3,n=[],o=0,l=i-a;o>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return n.join("")}(e,o,o+16383>l?l:o+16383));return 1===a?n.push(r[(t=e[i-1])>>2]+r[t<<4&63]+"=="):2===a&&n.push(r[(t=(e[i-2]<<8)+e[i-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),n.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,l=n.length;o0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var i=r===t?0:4-r%4;return[r,i]}i[45]=62,i[95]=63},72:function(e,t,r){"use strict";var i=r(675),a=r(783),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return h(e)}return f(e,t,r)}function f(e,t,r){if("string"==typeof e){var i=e,a=t;if(("string"!=typeof a||""===a)&&(a="utf8"),!l.isEncoding(a))throw TypeError("Unknown encoding: "+a);var n=0|p(i,a),f=o(n),s=f.write(i,a);return s!==n&&(f=f.slice(0,s)),f}if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(T(e,ArrayBuffer)||e&&T(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(T(e,SharedArrayBuffer)||e&&T(e.buffer,SharedArrayBuffer)))return function(e,t,r){var i;if(t<0||e.byteLength=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||T(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return A(e).length;default:if(a)return i?-1:B(e).length;t=(""+t).toLowerCase(),a=!0}}function d(e,t,r){var a,n,o,l=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var a="",n=t;n0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(n=r*=1)!=n&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(a)return -1;else r=e.length-1;else if(r<0)if(!a)return -1;else r=0;if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:b(e,t,r,i,a);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(a)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b(e,[t],r,i,a)}throw TypeError("val must be string, number or Buffer")}function b(e,t,r,i,a){var n,o=1,l=e.length,f=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return -1;o=2,l/=2,f/=2,r/=2}function s(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var h=-1;for(n=r;nl&&(r=l-f),n=r;n>=0;n--){for(var u=!0,c=0;cr&&(e+=" ... "),""},n&&(l.prototype[n]=l.prototype.inspect),l.prototype.compare=function(e,t,r,i,a){if(T(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),t<0||r>e.length||i<0||a>this.length)throw RangeError("out of range index");if(i>=a&&t>=r)return 0;if(i>=a)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var n=a-i,o=r-t,f=Math.min(n,o),s=this.slice(i,a),h=e.slice(t,r),u=0;u239?4:s>223?3:s>191?2:1;if(a+u<=r)switch(u){case 1:s<128&&(h=s);break;case 2:(192&(n=e[a+1]))==128&&(f=(31&s)<<6|63&n)>127&&(h=f);break;case 3:n=e[a+1],o=e[a+2],(192&n)==128&&(192&o)==128&&(f=(15&s)<<12|(63&n)<<6|63&o)>2047&&(f<55296||f>57343)&&(h=f);break;case 4:n=e[a+1],o=e[a+2],l=e[a+3],(192&n)==128&&(192&o)==128&&(192&l)==128&&(f=(15&s)<<18|(63&n)<<12|(63&o)<<6|63&l)>65535&&f<1114112&&(h=f)}null===h?(h=65533,u=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),a+=u}var c=i,p=c.length;if(p<=4096)return String.fromCharCode.apply(String,c);for(var d="",g=0;gr)throw RangeError("Trying to access beyond buffer length")}function _(e,t,r,i,a,n){if(!l.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw RangeError("Index out of range")}function w(e,t,r,i,a,n){if(r+i>e.length||r<0)throw RangeError("Index out of range")}function D(e,t,r,i,n){return t*=1,r>>>=0,n||w(e,t,r,4,34028234663852886e22,-34028234663852886e22),a.write(e,t,r,i,23,4),r+4}function S(e,t,r,i,n){return t*=1,r>>>=0,n||w(e,t,r,8,17976931348623157e292,-17976931348623157e292),a.write(e,t,r,i,52,8),r+8}l.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a,n,o,l,f,s,h,u,c=this.length-t;if((void 0===r||r>c)&&(r=c),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return function(e,t,r,i){r=Number(r)||0;var a=e.length-r;i?(i=Number(i))>a&&(i=a):i=a;var n=t.length;i>n/2&&(i=n/2);for(var o=0;o>8,a.push(r%256),a.push(i);return a}(e,this.length-h),this,h,u);default:if(p)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||v(e,t,this.length);for(var i=this[e],a=1,n=0;++n>>=0,t>>>=0,r||v(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},l.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var i=this[e],a=1,n=0;++n=(a*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var i=t,a=1,n=this[e+--i];i>0&&(a*=256);)n+=this[e+--i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),a.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),a.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),a.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),a.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,i){if(e*=1,t>>>=0,r>>>=0,!i){var a=Math.pow(2,8*r)-1;_(this,e,t,r,a,0)}var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,!i){var a=Math.pow(2,8*r)-1;_(this,e,t,r,a,0)}var n=r-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,i){if(e*=1,t>>>=0,!i){var a=Math.pow(2,8*r-1);_(this,e,t,r,a-1,-a)}var n=0,o=1,l=0;for(this[t]=255&e;++n>>=0,!i){var a=Math.pow(2,8*r-1);_(this,e,t,r,a-1,-a)}var n=r-1,o=1,l=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===l&&0!==this[t+n+1]&&(l=1),this[t+n]=(e/o|0)-l&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return S(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return S(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,i){if(!l.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return a},l.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===e.length){var a,n=e.charCodeAt(0);("utf8"===i&&n<128||"latin1"===i)&&(e=n)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!a){if(r>56319||o+1===i){(t-=3)>-1&&n.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&n.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;n.push(r)}else if(r<2048){if((t-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return n}function E(e){for(var t=[],r=0;r=t.length)&&!(a>=e.length);++a)t[a+r]=e[a];return a}function T(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var x=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var i=16*r,a=0;a<16;++a)t[i+a]=e[r]+e[a];return t}()},783:function(e,t){t.read=function(e,t,r,i,a){var n,o,l=8*a-i-1,f=(1<>1,h=-7,u=r?a-1:0,c=r?-1:1,p=e[t+u];for(u+=c,n=p&(1<<-h)-1,p>>=-h,h+=l;h>0;n=256*n+e[t+u],u+=c,h-=8);for(o=n&(1<<-h)-1,n>>=-h,h+=i;h>0;o=256*o+e[t+u],u+=c,h-=8);if(0===n)n=1-s;else{if(n===f)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),n-=s}return(p?-1:1)*o*Math.pow(2,n-i)},t.write=function(e,t,r,i,a,n){var o,l,f,s=8*n-a-1,h=(1<>1,c=5960464477539062e-23*(23===a),p=i?0:n-1,d=i?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(l=+!!isNaN(t),o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?t+=c/f:t+=c*Math.pow(2,1-u),t*f>=2&&(o++,f/=2),o+u>=h?(l=0,o=h):o+u>=1?(l=(t*f-1)*Math.pow(2,a),o+=u):(l=t*Math.pow(2,u-1)*Math.pow(2,a),o=0));a>=8;e[r+p]=255&l,p+=d,l/=256,a-=8);for(o=o<0;e[r+p]=255&o,p+=d,o/=256,s-=8);e[r+p-d]|=128*g}}},r={};function i(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,i),o=!1}finally{o&&delete r[t]}return n.exports}i.ab="/ROOT/node_modules/next/dist/compiled/buffer/",t.exports=i(72)}()},5993,e=>{e.v("/t2-model-skinner/_next/static/media/imageProcessing.worker.dbca7ab4.ts")},63871,e=>{"use strict";e.s(["ModelViewerContext",()=>r,"default",()=>i]);var t=e.i(71645);let r=t.default.createContext(null);function i(){let e=(0,t.useContext)(r);if(!e)throw Error("No ModelViewerContext.Provider");return e}r.displayName="ModelViewerContext"},91135,e=>{e.v(t=>Promise.all(["static/chunks/e5f31ffb0a3e45f4.js"].map(t=>e.l(t))).then(()=>t(69642)))},22143,e=>{e.v(t=>Promise.all(["static/chunks/2d6d26cb79779ffe.js"].map(t=>e.l(t))).then(()=>t(66641)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/2a02daea7eb2756c.js b/docs/_next/static/chunks/2a02daea7eb2756c.js new file mode 100644 index 0000000..cfb5256 --- /dev/null +++ b/docs/_next/static/chunks/2a02daea7eb2756c.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96165,t=>{"use strict";t.s(["SKIN_ASSET_BASE_URL",()=>e,"SKIN_GALLERY_BASE_URL",()=>n,"SKIN_MANIFEST_URL",()=>r]);let e="https://assets.tribes2.online/skins/files",r="https://assets.tribes2.online/skins/manifest.json",n="https://assets.tribes2.online/skins/gallery"},34582,(t,e,r)=>{"use strict";r.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return(r+n)*3/4-n},r.toByteArray=function(t){var e,r,n=f(t),a=n[0],s=n[1],u=new o((a+s)*3/4-s),l=0,c=s>0?a-4:a;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;a>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}(t,a,a+16383>s?s:a+16383));return 1===i?o.push(n[(e=t[r-1])>>2]+n[e<<4&63]+"=="):2===i&&o.push(n[(e=(t[r-2]<<8)+t[r-1])>>10]+n[e>>4&63]+n[e<<2&63]+"="),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}i[45]=62,i[95]=63},38492,(t,e,r)=>{r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,l=-7,c=r?i-1:0,h=r?-1:1,d=t[e+c];for(c+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+c],c+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=f}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,l=(1<>1,h=5960464477539062e-23*(23===i),d=n?0:o-1,p=n?1:-1,y=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(s=+!!isNaN(e),a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+c>=1?e+=h/u:e+=h*Math.pow(2,1-c),e*u>=2&&(a++,u/=2),a+c>=l?(s=0,a=l):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*y}},43943,(t,e,r)=>{"use strict";var n=t.r(34582),i=t.r(38492),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return l(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t){var n=t,i=e;if(("string"!=typeof i||""===i)&&(i="utf8"),!s.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|p(n,i),u=a(o),f=u.write(n,i);return f!==o&&(u=u.slice(0,f)),u}if(ArrayBuffer.isView(t)){var l=t;if(C(l,Uint8Array)){var y=new Uint8Array(l);return h(y.buffer,y.byteOffset,y.byteLength)}return c(l)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(C(t,ArrayBuffer)||t&&C(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(C(t,SharedArrayBuffer)||t&&C(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var g=t.valueOf&&t.valueOf();if(null!=g&&g!==t)return s.from(g,e,r);var m=function(t){if(s.isBuffer(t)){var e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?a(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(m)return m;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return f(t),a(t<0?0:0|d(t))}function c(t){for(var e=t.length<0?0:0|d(t.length),r=a(e),n=0;n=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||C(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return A(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return O(t).length;default:if(i)return n?-1:A(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){var i,o,a,s=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(i)return -1;else r=t.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return b(t,[e],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;h239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(l=f);break;case 2:(192&(o=t[i+1]))==128&&(u=(31&f)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],(192&o)==128&&(192&a)==128&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}var h=n,d=h.length;if(d<=4096)return String.fromCharCode.apply(String,h);for(var p="",y=0;yr)throw RangeError("Trying to access beyond buffer length")}function w(t,e,r,n,i,o){if(!s.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw RangeError("Index out of range")}function S(t,e,r,n,i,o){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function k(t,e,r,n,o){return e*=1,r>>>=0,o||S(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function E(t,e,r,n,o){return e*=1,r>>>=0,o||S(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}r.Buffer=s,r.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return(f(t),t<=0)?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)},s.allocUnsafe=function(t){return l(t)},s.allocUnsafeSlow=function(t){return l(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(C(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),C(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);in.length?s.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else if(s.isBuffer(o))o.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;ee&&(t+=" ... "),""},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(t,e,r,n,i){if(C(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),l=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,a,s,u,f,l,c,h=this.length-e;if((void 0===r||r>h)&&(r=h),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var d=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a>8,i.push(r%256),i.push(n);return i}(t,this.length-l),this,l,c);default:if(d)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||_(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||_(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||_(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||_(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||_(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||_(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return(t>>>=0,e||_(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||_(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||_(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||_(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||_(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||_(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||_(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||_(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||_(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a|0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return k(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return k(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return E(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return E(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!i){if(r>56319||a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function O(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var i=0;i=e.length)&&!(i>=t.length);++i)e[i+r]=t[i];return i}function C(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var T=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},30662,(t,e,r)=>{!function(){"use strict";var t={864:function(t){var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise(function(r,n){var i,o,a;function s(r){t.removeListener(e,u),n(r)}function u(){"function"==typeof t.removeListener&&t.removeListener("error",s),r([].slice.call(arguments))}y(t,e,u,{once:!0}),"error"!==e&&(i=t,o=s,a={once:!0},"function"==typeof i.on&&y(i,"error",o,a))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(t){if("function"!=typeof t)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){if(s(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=u(t))>0&&a.length>i&&!a.warned){a.warned=!0;var i,o,a,f=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=a.length,console&&console.warn&&console.warn(f)}return t}function l(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else for(var f=u.length,l=p(u,f),r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}},a=!0;try{t[e](o,o.exports,n),a=!1}finally{a&&delete r[e]}return o.exports}n.ab="/ROOT/node_modules/next/dist/compiled/events/",e.exports=n(864)}()},77398,(t,e,r)=>{var n=t.i(67034),i=t.i(47167);!function(){var r={992:function(t){t.exports=function(t,r,n){if(t.filter)return t.filter(r,n);if(null==t||"function"!=typeof r)throw TypeError();for(var i=[],o=0;o-1?i(r):r}},139:function(t,e,r){"use strict";var n=r(212),i=r(192),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),f=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(f)try{f({},"a",{value:1})}catch(t){f=null}t.exports=function(t){var e=s(n,a,arguments);return u&&f&&u(e,"length").configurable&&f(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var c=function(){return s(n,o,arguments)};f?f(t.exports,"apply",{value:c}):t.exports.apply=c},181:function(t){"use strict";t.exports=EvalError},545:function(t){"use strict";t.exports=Error},22:function(t){"use strict";t.exports=RangeError},803:function(t){"use strict";t.exports=ReferenceError},182:function(t){"use strict";t.exports=SyntaxError},202:function(t){"use strict";t.exports=TypeError},284:function(t){"use strict";t.exports=URIError},144:function(t){var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,i){if("[object Function]"!==r.call(n))throw TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var a=0;a1&&"boolean"!=typeof e)throw new f('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=j(t),n=r.length>0?r[0]:"",i=L("%"+n+"%",e),o=i.name,a=i.value,s=!1,l=i.alias;l&&(n=l[0],R(r,O([0,1],l)));for(var c=1,h=!0;c=r.length){var m=d(a,p);a=(h=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[p]}else h=A(a,p),a=a[p];h&&!s&&(w[o]=a)}}return a}},14:function(t){"use strict";var e={__proto__:null,foo:{}},r=Object;t.exports=function(){return({__proto__:e}).foo===e.foo&&!(e instanceof r)}},942:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(773);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},773:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},115:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(832);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},832:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},270:function(t,e,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty;t.exports=r(212).call(n,i)},782:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},157:function(t){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,n=function(t){return(!e||!t||"object"!=typeof t||!(Symbol.toStringTag in t))&&"[object Arguments]"===r.call(t)},i=function(t){return!!n(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==r.call(t)&&"[object Function]"===r.call(t.callee)},o=function(){return n(arguments)}();n.isLegacyArguments=i,t.exports=o?n:i},391:function(t){"use strict";var e=Object.prototype.toString,r=Function.prototype.toString,n=/^\s*(?:function)?\*/,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,o=Object.getPrototypeOf,a=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(t){}}(),s=a?o(a):{};t.exports=function(t){return"function"==typeof t&&(!!n.test(r.call(t))||(i?o(t)===s:"[object GeneratorFunction]"===e.call(t)))}},994:function(e,r,n){"use strict";var i=n(144),o=n(349),a=n(256),s=a("Object.prototype.toString"),u=n(942)()&&"symbol"==typeof Symbol.toStringTag,f=o(),l=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1)}},369:function(t){t.exports=function(t){return t instanceof n.Buffer}},584:function(t,e,r){"use strict";var n=r(157),i=r(391),o=r(490),a=r(994);function s(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,f="undefined"!=typeof Symbol,l=s(Object.prototype.toString),c=s(Number.prototype.valueOf),h=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(f)var y=s(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function m(t){return"[object Map]"===l(t)}function b(t){return"[object Set]"===l(t)}function v(t){return"[object WeakMap]"===l(t)}function _(t){return"[object WeakSet]"===l(t)}function w(t){return"[object ArrayBuffer]"===l(t)}function S(t){return"undefined"!=typeof ArrayBuffer&&(w.working?w(t):t instanceof ArrayBuffer)}function k(t){return"[object DataView]"===l(t)}function E(t){return"undefined"!=typeof DataView&&(k.working?k(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||E(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},m.working="undefined"!=typeof Map&&m(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(m.working?m(t):t instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(b.working?b(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},_.working="undefined"!=typeof WeakSet&&_(new WeakSet),e.isWeakSet=function(t){return _(t)},w.working="undefined"!=typeof ArrayBuffer&&w(new ArrayBuffer),e.isArrayBuffer=S,k.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&k(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=E;var x="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(t){return"[object SharedArrayBuffer]"===l(t)}function O(t){return void 0!==x&&(void 0===A.working&&(A.working=A(new x)),A.working?A(t):t instanceof x)}function R(t){return g(t,c)}function C(t){return g(t,h)}function T(t){return g(t,d)}function I(t){return u&&g(t,p)}function B(t){return f&&g(t,y)}e.isSharedArrayBuffer=O,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=R,e.isStringObject=C,e.isBooleanObject=T,e.isBigIntObject=I,e.isSymbolObject=B,e.isBoxedPrimitive=function(t){return R(t)||C(t)||T(t)||I(t)||B(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(S(t)||O(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw Error(t+" is not supported in userland")}})})},177:function(t,e,r){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),h(n,t,n.depth)}function l(t,e){var r=f.styles[e];return r?"\x1b["+f.colors[r][0]+"m"+t+"\x1b["+f.colors[r][1]+"m":t}function c(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&!(r.constructor&&r.constructor.prototype===r)){var i,o,a,s,u,f,l=r.inspect(n,t);return v(l)||(l=h(t,l,n)),l}var c=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,r);if(c)return c;var S=Object.keys(r),A=(u={},S.forEach(function(t,e){u[t]=!0}),u);if(t.showHidden&&(S=Object.getOwnPropertyNames(r)),E(r)&&(S.indexOf("message")>=0||S.indexOf("description")>=0))return d(r);if(0===S.length){if(x(r)){var O=r.name?": "+r.name:"";return t.stylize("[Function"+O+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return t.stylize(Date.prototype.toString.call(r),"date");if(E(r))return d(r)}var R="",T=!1,I=["{","}"];if(y(r)&&(T=!0,I=["[","]"]),x(r)&&(R=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(R=" "+RegExp.prototype.toString.call(r)),k(r)&&(R=" "+Date.prototype.toUTCString.call(r)),E(r)&&(R=" "+d(r)),0===S.length&&(!T||0==r.length))return I[0]+R+I[1];if(n<0)if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");else return t.stylize("[Object]","special");return t.seen.push(r),f=T?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&s++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?a[0]+(""===o?"":o+"\n ")+" "+i.join(",\n ")+" "+a[1]:a[0]+o+" "+i.join(", ")+" "+a[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),C(n,i)||(a="["+i+"]"),!s&&(0>t.seen.indexOf(u.value)?(s=m(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),_(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function v(t){return"string"==typeof t}function _(t){return void 0===t}function w(t){return S(t)&&"[object RegExp]"===A(t)}function S(t){return"object"==typeof t&&null!==t}function k(t){return S(t)&&"[object Date]"===A(t)}function E(t){return S(t)&&("[object Error]"===A(t)||t instanceof Error)}function x(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function O(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(!a[t=t.toUpperCase()])if(s.test(t)){var r=i.default.pid;a[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else a[t]=function(){};return a[t]},e.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(584),e.isArray=y,e.isBoolean=g,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=_,e.isRegExp=w,e.types.isRegExp=w,e.isObject=S,e.isDate=k,e.types.isDate=k,e.isError=E,e.types.isNativeError=E,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(369);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[O((t=new Date).getHours()),O(t.getMinutes()),O(t.getSeconds())].join(":"),[t.getDate(),R[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(782),e._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');if(T&&t[T]){var e=t[T];if("function"!=typeof e)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),i=[],o=0;o{var n=t.i(47167);!function(){var r={782:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},646:function(t){"use strict";let e={};function r(t,r,n){n||(n=Error);class i extends n{constructor(t,e,n){super("string"==typeof r?r:r(t,e,n))}}i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(!Array.isArray(t))return"of ".concat(e," ").concat(String(t));{let r=t.length;return(t=t.map(t=>String(t)),r>2)?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,r){var i,o,a,s;let u,f;if("string"==typeof e&&(i="not ",e.substr(0,i.length)===i)?(u="must not be",e=e.replace(/^not /,"")):u="must be",o=" argument",(void 0===a||a>t.length)&&(a=t.length),t.substring(a-o.length,a)===o)f="The ".concat(t," ").concat(u," ").concat(n(e,"type"));else{let r=("number"!=typeof s&&(s=0),s+1>t.length||-1===t.indexOf(".",s))?"argument":"property";f='The "'.concat(t,'" ').concat(r," ").concat(u," ").concat(n(e,"type"))}return f+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},403:function(t,e,r){"use strict";var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=r(709),a=r(337);r(782)(l,o);for(var s=i(a.prototype),u=0;u0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===h.prototype||(o=e,e=h.from(o)),n)u.endEmitted?k(t,new S):R(t,u,e,!0);else if(u.ended)k(t,new _);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?R(t,u,e,!1):B(t,u)):R(t,u,e,!1)}else n||(u.reading=!1,B(t,u));return!u.ended&&(u.lengthe.highWaterMark&&((r=t)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r),t<=e.length)?t:e.ended?e.length:(e.needReadable=!0,0)}function T(t){var e=t._readableState;a("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(a("emitReadable",e.flowing),e.emittedReadable=!0,n.default.nextTick(I,t))}function I(t){var e=t._readableState;a("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,z(t)}function B(t,e){e.readingMore||(e.readingMore=!0,n.default.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){a("readable nexttick read 0"),t.read(0)}function U(t,e){a("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),z(t),e.flowing&&!e.reading&&t.read(0)}function z(t){var e=t._readableState;for(a("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){var r;return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r)}function N(t){var e=t._readableState;a("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.default.nextTick(F,e,t))}function F(t,e){if(a("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function M(t,e){for(var r=0,n=t.length;r=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?N(this):T(this),null;if(0===(t=C(t,r))&&r.ended)return 0===r.length&&N(this),null;var i=r.needReadable;return a("need readable",i),(0===r.length||r.length-t0?D(t,r):null)?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==t&&r.ended&&N(this)),null!==e&&this.emit("data",e),e},A.prototype._read=function(t){k(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r,i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,a("pipe count=%d opts=%j",o.pipesCount,e);var s=e&&!1===e.end||t===n.default.stdout||t===n.default.stderr?g:u;function u(){a("onend"),t.end()}o.endEmitted?n.default.nextTick(s):i.once("end",s),t.on("unpipe",function e(r,n){a("onunpipe"),r===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,a("cleanup"),t.removeListener("close",p),t.removeListener("finish",y),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",e),i.removeListener("end",u),i.removeListener("end",g),i.removeListener("data",h),c=!0,o.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&f())});var f=(r=i,function(){var t=r._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&l(r,"data")&&(t.flowing=!0,z(r))});t.on("drain",f);var c=!1;function h(e){a("ondata");var r=t.write(e);a("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==M(o.pipes,t))&&!c&&(a("false write response, pause",o.awaitDrain),o.awaitDrain++),i.pause())}function d(e){a("onerror",e),g(),t.removeListener("error",d),0===l(t,"error")&&k(t,e)}function p(){t.removeListener("finish",y),g()}function y(){a("onfinish"),t.removeListener("close",p),g()}function g(){a("unpipe"),i.unpipe(t)}return i.on("data",h),!function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",y),t.emit("pipe",i),o.flowing||(a("pipe resume"),i.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"!==t||i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,a("on readable",i.length,i.reading),i.length?T(this):i.reading||n.default.nextTick(L,this)),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=c.prototype.removeListener.call(this,t,e);return"readable"===t&&n.default.nextTick(j,this),r},A.prototype.removeAllListeners=function(t){var e=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&n.default.nextTick(j,this),e},A.prototype.resume=function(){var t,e,r=this._readableState;return r.flowing||(a("resume"),r.flowing=!r.readableListening,t=this,(e=r).resumeScheduled||(e.resumeScheduled=!0,n.default.nextTick(U,t,e))),r.paused=!1,this},A.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){if(a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!=i)(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new S(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new g("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var i,o,a,s=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),s.corked&&(s.corked=1,this.uncork()),s.ending||(i=this,o=s,a=r,o.ending=!0,B(i,o),a&&(o.finished?n.default.nextTick(a):i.once("finish",a)),o.ended=!0,i.writable=!1),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=h.destroy,A.prototype._undestroy=h.undestroy,A.prototype._destroy=function(t,e){e(t)}},871:function(t,e,r){"use strict";function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o,a=r(698),s=Symbol("lastResolve"),u=Symbol("lastReject"),f=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function y(t){var e=t[s];if(null!==e){var r=t[d].read();null!==r&&(t[c]=null,t[s]=null,t[u]=null,e(p(r,!1)))}}function g(t){n.default.nextTick(y,t)}var m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((i(o={get stream(){return this[d]},next:function(){var t,e,r=this,i=this[f];if(null!==i)return Promise.reject(i);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(t,e){n.default.nextTick(function(){r[f]?e(r[f]):t(p(void 0,!0))})});var o=this[c];if(o)e=new Promise((t=this,function(e,r){o.then(function(){if(t[l])return void e(p(void 0,!0));t[h](e,r)},r)}));else{var a=this[d].read();if(null!==a)return Promise.resolve(p(a,!1));e=new Promise(this[h])}return this[c]=e,e}},Symbol.asyncIterator,function(){return this}),i(o,"return",function(){var t=this;return new Promise(function(e,r){t[d].destroy(null,function(t){if(t)return void r(t);e(p(void 0,!0))})})}),o),m);t.exports=function(t){var e,r=Object.create(b,(i(e={},d,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,u,{value:null,writable:!0}),i(e,f,{value:null,writable:!0}),i(e,l,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var n=r[d].read();n?(r[c]=null,r[s]=null,r[u]=null,t(p(n,!1))):(r[s]=t,r[u]=e)},writable:!0}),e));return r[c]=null,a(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];null!==e&&(r[c]=null,r[s]=null,r[u]=null,e(t)),r[f]=t;return}var n=r[s];null!==n&&(r[c]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0}),t.on("readable",g.bind(null,r)),r}},379:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}var i=r(300).Buffer,o=r(837).inspect,a=o&&o.custom||"inspect";t.exports=function(){var t;function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return t=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return i.alloc(0);for(var e,r,n=i.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=a,i.prototype.copy.call(e,n,r),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=i.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(o.copy(e,e.length-t,0,a),0==(t-=a)){a===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++n}return this.length-=n,e}},{key:a,value:function(t,e){return o(this,function(t){for(var e=1;e0,f=s=function(t){e||(e=t),t&&d.forEach(u),g||(d.forEach(u),h(e))},c=!1,s=function(){c||(c=!0,f.apply(void 0,arguments))},p=!1,t.on("close",function(){p=!0}),void 0===n&&(n=r(698)),n(t,{readable:g,writable:o},function(t){if(t)return s(t);p=!0,s()}),y=!1,function(e){if(!p&&!y){if(y=!0,t.setHeader&&"function"==typeof t.abort)return t.abort();if("function"==typeof t.destroy)return t.destroy();s(e||new a("pipe"))}}});return l.reduce(f)}},776:function(t,e,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=null!=e.highWaterMark?e.highWaterMark:i?e[r]:null;if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},678:function(t,e,r){t.exports=r(781)},55:function(t,e,r){var n=r(300),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n.SlowBuffer(t)}},173:function(t,e,r){t.exports=i;var n=r(361).EventEmitter;function i(){n.call(this)}r(782)(i,n),i.Readable=r(709),i.Writable=r(337),i.Duplex=r(403),i.Transform=r(170),i.PassThrough=r(889),i.finished=r(698),i.pipeline=r(442),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(l(),0===n.listenerCount(this,"error"))throw t}function l(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",l),r.removeListener("close",l),t.removeListener("close",l)}return r.on("error",f),t.on("error",f),r.on("end",l),r.on("close",l),t.on("close",l),t.emit("pipe",r),t}},704:function(t,e,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){var e;if(!t)return"utf8";for(;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=l,this.end=c,e=3;break;default:this.write=h,this.end=d;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if((192&e[0])!=128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((192&e[1])!=128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(192&e[2])!=128)return t.lastNeed=2,"�"}}(this,t,0);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length)}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){var e,r;if(0===t.length)return"";if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},769:function(e){e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}};function r(e){try{if(!t.g.localStorage)return!1}catch(t){return!1}var r=t.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}},300:function(e){"use strict";e.exports=t.r(43943)},361:function(e){"use strict";e.exports=t.r(30662)},781:function(e){"use strict";e.exports=t.r(30662).EventEmitter},837:function(e){"use strict";e.exports=t.r(77398)}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var n=i[t]={exports:{}},a=!0;try{r[t](n,n.exports,o),a=!1}finally{a&&delete i[t]}return n.exports}o.ab="/ROOT/node_modules/next/dist/compiled/stream-browserify/",e.exports=o(173)}()},31032,(t,e,r)=>{"use strict";e.exports=t.r(12569)},87780,(t,e,r)=>{"use strict";var n=t.i(67034);if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer=void 0!==n.Buffer,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var i=new ArrayBuffer(0);try{r.blob=0===new Blob([i],{type:"application/zip"}).size}catch(t){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),r.blob=0===o.getBlob("application/zip").size}catch(t){r.blob=!1}}}try{r.nodestream=!!t.r(31032).Readable}catch(t){r.nodestream=!1}},55951,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(87780),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(t){for(var e,r,i,a,s,u,f,l=[],c=0,h=t.length,d=h,p="string"!==n.getTypeOf(t);c>2,s=(3&e)<<4|r>>4,u=d>1?(15&r)<<2|i>>6:64,f=d>2?63&i:64,l.push(o.charAt(a)+o.charAt(s)+o.charAt(u)+o.charAt(f));return l.join("")},r.decode=function(t){var e,r,n,a,s,u,f,l,c=0,h=0,d="data:";if(t.substr(0,d.length)===d)throw Error("Invalid base64 input, it looks like a data url.");var p=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===o.charAt(64)&&p--,t.charAt(t.length-2)===o.charAt(64)&&p--,p%1!=0)throw Error("Invalid base64 input, bad content length.");for(l=i.uint8array?new Uint8Array(0|p):Array(0|p);c>4,r=(15&s)<<4|u>>2,n=(3&u)<<6|f,l[h++]=e,64!==u&&(l[h++]=r),64!==f&&(l[h++]=n);return l}},42527,(t,e,r)=>{"use strict";var n=t.i(67034);e.exports={isNode:void 0!==n.Buffer,newBufferFrom:function(t,e){if(n.Buffer.from&&n.Buffer.from!==Uint8Array.from)return n.Buffer.from(t,e);if("number"==typeof t)throw Error('The "data" argument must not be a number');return new n.Buffer(t,e)},allocBuffer:function(t){if(n.Buffer.alloc)return n.Buffer.alloc(t);var e=new n.Buffer(t);return e.fill(0),e},isBuffer:function(t){return n.Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},27024,(t,e,r)=>{"use strict";var n,i,o=t.g.MutationObserver||t.g.WebKitMutationObserver;if(o){var a=0,s=new o(c),u=t.g.document.createTextNode("");s.observe(u,{characterData:!0}),n=function(){u.data=a=++a%2}}else if(t.g.setImmediate||void 0===t.g.MessageChannel)n="document"in t.g&&"onreadystatechange"in t.g.document.createElement("script")?function(){var e=t.g.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.g.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var f=new t.g.MessageChannel;f.port1.onmessage=c,n=function(){f.port2.postMessage(0)}}var l=[];function c(){i=!0;for(var t,e,r=l.length;r;){for(e=l,l=[],t=-1;++t{"use strict";var n=t.r(27024);function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function f(t){if("function"!=typeof t)throw TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==i&&d(this,t)}function l(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function c(t,e,r){n(function(){var n;try{n=e(r)}catch(e){return o.reject(t,e)}n===t?o.reject(t,TypeError("Cannot resolve promise with itself")):o.resolve(t,n)})}function h(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,o.reject(t,e))}function i(e){r||(r=!0,o.resolve(t,e))}var a=p(function(){e(i,n)});"error"===a.status&&n(a.value)}function p(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}e.exports=f,f.prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then(function(r){return e.resolve(t()).then(function(){return r})},function(r){return e.resolve(t()).then(function(){throw r})})},f.prototype.catch=function(t){return this.then(null,t)},f.prototype.then=function(t,e){if("function"!=typeof t&&this.state===s||"function"!=typeof e&&this.state===a)return this;var r=new this.constructor(i);return this.state!==u?c(r,this.state===s?t:e,this.outcome):this.queue.push(new l(r,t,e)),r},l.prototype.callFulfilled=function(t){o.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){c(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){o.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){c(this.promise,this.onRejected,t)},o.resolve=function(t,e){var r=p(h,e);if("error"===r.status)return o.reject(t,r.value);var n=r.value;if(n)d(t,n);else{t.state=s,t.outcome=e;for(var i=-1,a=t.queue.length;++i{"use strict";e.exports={Promise:"undefined"!=typeof Promise?Promise:t.r(22998)}},83986,(t,e,r)=>{var n=t.i(47167);"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/next/dist/compiled/setimmediate/"),({189:function(){!function(t,e){"use strict";if(!t.setImmediate){var r,i,o,a,s,u=1,f={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"===({}).toString.call(t.process)?s=function(t){n.default.nextTick(function(){p(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(r="setImmediate$"+Math.random()+"$",i=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&p(+e.data.slice(r.length))},t.addEventListener?t.addEventListener("message",i,!1):t.attachEvent("onmessage",i),s=function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},s=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(a=c.documentElement,s=function(t){var e=c.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,a.removeChild(e),e=null},a.appendChild(e)}):s=function(t){setTimeout(p,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=Function(""+t));for(var e=Array(arguments.length-1),r=0;r{"use strict";var n=t.r(87780),i=t.r(55951),o=t.r(42527),a=t.r(24375);function s(t){return t}function u(t,e){for(var r=0;r1;)try{return f.stringifyByChunk(t,n,e)}catch(t){e=Math.floor(e/2)}return f.stringifyByChar(t)}function c(t,e){for(var r=0;r{"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=n},46253,(t,e,r)=>{"use strict";for(var n=t.r(65464),i=t.r(87780),o=t.r(42527),a=t.r(48913),s=Array(256),u=0;u<256;u++)s[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;s[254]=s[254]=1;var f=function(t){var e,r,n,o,a,s=t.length,u=0;for(o=0;o>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e},l=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&(192&t[r])==128;)r--;return r<0||0===r?e:r+s[t[r]]>e?r:e},c=function(t){var e,r,i,o,a=t.length,u=Array(2*a);for(r=0,e=0;e4){u[r++]=65533,e+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&e1){u[r++]=65533;continue}i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)};function h(){a.call(this,"utf-8 decode"),this.leftOver=null}function d(){a.call(this,"utf-8 encode")}r.utf8encode=function(t){return i.nodebuffer?o.newBufferFrom(t,"utf-8"):f(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):c(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(h,a),h.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=e;(e=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),e.set(o,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var a=l(e),s=e;a!==e.length&&(i.uint8array?(s=e.subarray(0,a),this.leftOver=e.subarray(a,e.length)):(s=e.slice(0,a),this.leftOver=e.slice(a,e.length))),this.push({data:r.utf8decode(s),meta:t.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=h,n.inherits(d,a),d.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=d},60550,(t,e,r)=>{"use strict";var n=t.r(48913),i=t.r(65464);function o(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(o,n),o.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=o},61714,(t,e,r)=>{"use strict";var n=t.r(31032).Readable;function i(t,e,r){n.call(this,e),this._helper=t;var i=this;t.on("data",function(t,e){i.push(t)||i._helper.pause(),r&&r(e)}).on("error",function(t){i.emit("error",t)}).on("end",function(){i.push(null)})}t.r(65464).inherits(i,n),i.prototype._read=function(){this._helper.resume()},e.exports=i},846,(t,e,r)=>{"use strict";var n=t.i(67034),i=t.r(65464),o=t.r(60550),a=t.r(48913),s=t.r(55951),u=t.r(87780),f=t.r(24375),l=null;if(u.nodestream)try{l=t.r(61714)}catch(t){}function c(t,e,r){var n=e;switch(e){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=e,this._mimeType=r,i.checkSupport(n),this._worker=t.pipe(new o(n)),t.lock()}catch(t){this._worker=new a("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){var e;return e=this,new f.Promise(function(r,o){var a=[],u=e._internalType,f=e._outputType,l=e._mimeType;e.on("data",function(e,r){a.push(e),t&&t(r)}).on("error",function(t){a=[],o(t)}).on("end",function(){try{var t=function(t,e,r){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),r);case"base64":return s.encode(e);default:return i.transformTo(t,e)}}(f,function(t,e){var r,i=0,o=null,a=0;for(r=0;r{"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},25625,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},63494,(t,e,r)=>{"use strict";var n=t.r(65464),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?0xedb88320^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r,n){var o=0+r;t^=-1;for(var a=0;a>>8^i[(t^e[a])&255];return -1^t}(0|e,t,t.length,0):function(t,e,r,n){var o=0+r;t^=-1;for(var a=0;a>>8^i[(t^e.charCodeAt(a))&255];return -1^t}(0|e,t,t.length,0):0}},1648,(t,e,r)=>{"use strict";var n=t.r(48913),i=t.r(63494);function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t.r(65464).inherits(o,n),o.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=o},41087,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(o,i),o.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=o},43220,(t,e,r)=>{"use strict";var n=t.r(24375),i=t.r(25625),o=t.r(1648),a=t.r(41087);function s(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}s.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(t,e,r){return t.pipe(new o).pipe(new a("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=s},52929,(t,e,r)=>{"use strict";var n=t.r(846),i=t.r(25625),o=t.r(46253),a=t.r(43220),s=t.r(48913),u=function(t,e,r){this.name=t,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=e,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};u.prototype={internalStream:function(t){var e=null,r="string";try{if(!t)throw Error("No output type specified.");r=t.toLowerCase();var i="string"===r||"text"===r;("binarystring"===r||"text"===r)&&(r="string"),e=this._decompressWorker();var a=!this._dataBinary;a&&!i&&(e=e.pipe(new o.Utf8EncodeWorker)),!a&&i&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(t){(e=new s("error")).error(t)}return new n(e,r,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof a&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new o.Utf8EncodeWorker)),a.createWorkerFrom(r,t,e)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof s?this._data:new i(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw TypeError(r+"must be non-object");for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)return void t.set(e.subarray(r,r+n),i);for(var o=0;o{"use strict";var n,i,o,a=t.r(79148);function s(t){for(var e=t.length;--e>=0;)t[e]=0}var u=573,f=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=Array(576);s(d);var p=Array(60);s(p);var y=Array(512);s(y);var g=Array(256);s(g);var m=Array(29);s(m);var b=Array(30);function v(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function _(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function w(t){return t<256?y[t]:y[256+(t>>>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function k(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0)return r>>>1}function A(t,e,r){var n,i,o=Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=x(o[s]++,s))}}function O(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function R(t){t.bi_valid>8?S(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function C(t,e,r,n){var i=2*e,o=2*r;return t[i]>1;r>=1;r--)T(t,o,r);i=f;do r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],T(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,T(t,o,1);while(t.heap_len>=2)t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,f=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,y=e.stat_desc.max_length,g=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(f[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;ry&&(o=y,g++),f[2*n+1]=o,!(n>l)&&(t.bl_count[o]++,a=0,n>=p&&(a=d[n-p]),s=f[2*n],t.opt_len+=s*(o+a),h&&(t.static_len+=s*(c[2*n+1]+a)));if(0!==g){do{for(o=y-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[y]--,g-=2}while(g>0)for(o=y;0!==o;o--)for(n=t.bl_count[o];0!==n;)!((i=t.heap[--r])>l)&&(f[2*i+1]!==o&&(t.opt_len+=(o-f[2*i+1])*f[2*i],f[2*i+1]=o),n--)}}(t,e),A(o,l,t.bl_count)}function P(t,e,r){var n,i,o=-1,a=e[1],s=0,u=7,f=4;for(0===a&&(u=138,f=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)i=a,a=e[(n+1)*2+1],++s>=7;a<30;a++)for(t=0,b[a]=s<<7;t<1<0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=0xf3ffc07f;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),a=function(t){var e;for(P(t,t.dyn_ltree,t.l_desc.max_code),P(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?U(t,e,r,n):4===t.strategy||o===i?(k(t,2+ +!!n,3),I(t,d,p)):(k(t,4+ +!!n,3),function(t,e,r,n){var i;for(k(t,e-257,5),k(t,r-1,5),k(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[(g[r]+256+1)*2]++,t.dyn_dtree[2*w(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){k(t,2,3),E(t,256,d),16===t.bi_valid?(S(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},74049,(t,e,r)=>{"use strict";e.exports=function(t,e,r,n){for(var i=65535&t,o=t>>>16&65535,a=0;0!==r;){a=r>2e3?2e3:r,r-=a;do o=o+(i=i+e[n++]|0)|0;while(--a)i%=65521,o%=65521}return i|o<<16}},63327,(t,e,r)=>{"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?0xedb88320^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var o=i+r;t^=-1;for(var a=i;a>>8^n[(t^e[a])&255];return -1^t}},19558,(t,e,r)=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},79674,(t,e,r)=>{"use strict";var n,i=t.r(79148),o=t.r(94333),a=t.r(74049),s=t.r(63327),u=t.r(19558),f=573;function l(t,e){return t.msg=u[e],e}function c(t){return(t<<1)-9*(t>4)}function h(t){for(var e=t.length;--e>=0;)t[e]=0}function d(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function p(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,d(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function g(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function m(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,f=t.window,l=t.w_mask,c=t.prev,h=t.strstart+258,d=f[o+a-1],p=f[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(f[(r=e)+a]!==p||f[r+a-1]!==d||f[r]!==f[o]||f[++r]!==f[o+1])continue;o+=2,r++;do;while(f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&oa){if(t.match_start=e,a=n,n>=s)break;d=f[o+a-1],p=f[o+a]}}while((e=c[e&l])>u&&0!=--i)return a<=t.lookahead?a:t.lookahead}function b(t){var e,r,n,o,u,f=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-262)){i.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;do n=t.head[--e],t.head[e]=n>=f?n-f:0;while(--r)e=r=f;do n=t.prev[--e],t.prev[e]=n>=f?n-f:0;while(--r)o+=f}if(0===t.strm.avail_in)break;if(r=function(t,e,r,n){var o=t.avail_in;return(o>n&&(o=n),0===o)?0:(t.avail_in-=o,i.arraySet(e,t.input,t.next_in,o,r),1===t.state.wrap?t.adler=a(t.adler,e,o,r):2===t.state.wrap&&(t.adler=s(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=r,t.lookahead+t.insert>=3)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<15&&(s=2,n-=16),o<1||o>9||8!==r||n<8||n>15||e<0||e>9||a<0||a>4)return l(t,-2);8===n&&(n=9);var u=new S;return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(b(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,p(t,!1),0===t.strm.avail_out)||t.strstart-t.block_start>=t.w_size-262&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:(t.strstart>t.block_start&&(p(t,!1),t.strm.avail_out),1)}),new w(4,4,8,4,v),new w(4,5,16,8,v),new w(4,6,32,32,v),new w(4,4,16,16,_),new w(8,16,32,32,_),new w(8,16,128,128,_),new w(8,32,128,256,_),new w(32,128,258,1024,_),new w(32,258,258,4096,_)],r.deflateInit=function(t,e){return x(t,e,8,15,8,0)},r.deflateInit2=x,r.deflateReset=E,r.deflateResetKeep=k,r.deflateSetHeader=function(t,e){return t&&t.state&&2===t.state.wrap?(t.state.gzhead=e,0):-2},r.deflate=function(t,e){if(!t||!t.state||e>5||e<0)return t?l(t,-2):-2;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return l(t,0===t.avail_out?-5:-2);if(i.strm=t,r=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,y(i,31),y(i,139),y(i,8),i.gzhead?(y(i,+!!i.gzhead.text+2*!!i.gzhead.hcrc+4*!!i.gzhead.extra+8*!!i.gzhead.name+16*!!i.gzhead.comment),y(i,255&i.gzhead.time),y(i,i.gzhead.time>>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:4*(i.strategy>=2||i.level<2)),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:4*(i.strategy>=2||i.level<2)),y(i,3),i.status=113);else{var r,i,a,u,f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=113,g(i,f),0!==i.strstart&&(g(i,t.adler>>>16),g(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&d(t),i.pending+2<=i.pending_buf_size&&(y(i,255&t.adler),y(i,t.adler>>8&255),t.adler=0,i.status=113)):i.status=113),0!==i.pending){if(d(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&c(e)<=c(r)&&4!==e)return l(t,-5);if(666===i.status&&0!==t.avail_in)return l(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var m=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(b(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=258){if(b(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+258;do;while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if((3===m||4===m)&&(i.status=666),1===m||3===m)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===m&&(1===e?o._tr_align(i):5!==e&&(o._tr_stored_block(i,0,0,!1),3===e&&(h(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),d(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&t.adler),y(i,t.adler>>8&255),y(i,t.adler>>16&255),y(i,t.adler>>24&255),y(i,255&t.total_in),y(i,t.total_in>>8&255),y(i,t.total_in>>16&255),y(i,t.total_in>>24&255)):(g(i,t.adler>>>16),g(i,65535&t.adler)),d(t),i.wrap>0&&(i.wrap=-i.wrap),+(0===i.pending))},r.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?l(t,-2):(t.state=null,113===e?l(t,-3):0):-2},r.deflateSetDictionary=function(t,e){var r,n,o,s,u,f,l,c,d=e.length;if(!t||!t.state||2===(s=(r=t.state).wrap)||1===s&&42!==r.status||r.lookahead)return -2;for(1===s&&(t.adler=a(t.adler,e,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(h(r.head),r.strstart=0,r.block_start=0,r.insert=0),c=new i.Buf8(r.w_size),i.arraySet(c,e,d-r.w_size,r.w_size,0),e=c,d=r.w_size),u=t.avail_in,f=t.next_in,l=t.input,t.avail_in=d,t.next_in=0,t.input=e,b(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do r.ins_h=(r.ins_h<{"use strict";var n=t.r(79148),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",a=0;a>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e},r.buf2binstring=function(t){return u(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r4){f[n++]=65533,r+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&r1){f[n++]=65533;continue}i<65536?f[n++]=i:(i-=65536,f[n++]=55296|i>>10&1023,f[n++]=56320|1023&i)}return u(f,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&(192&t[r])==128;)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}},98899,(t,e,r)=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},48901,(t,e,r)=>{"use strict";var n=t.r(79674),i=t.r(79148),o=t.r(63202),a=t.r(19558),s=t.r(98899),u=Object.prototype.toString;function f(t){if(!(this instanceof f))return new f(t);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e,r=this.options;r.raw&&r.windowBits>0?r.windowBits=-r.windowBits:r.gzip&&r.windowBits>0&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var l=n.deflateInit2(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy);if(0!==l)throw Error(a[l]);if(r.header&&n.deflateSetHeader(this.strm,r.header),r.dictionary){if(e="string"==typeof r.dictionary?o.string2buf(r.dictionary):"[object ArrayBuffer]"===u.call(r.dictionary)?new Uint8Array(r.dictionary):r.dictionary,0!==(l=n.deflateSetDictionary(this.strm,e)))throw Error(a[l]);this._dict_set=!0}}function l(t,e){var r=new f(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(t,e){var r,a,s=this.strm,f=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:4*(!0===e),"string"==typeof t?s.input=o.string2buf(t):"[object ArrayBuffer]"===u.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(f),s.next_out=0,s.avail_out=f),1!==(r=n.deflate(s,a))&&0!==r)return this.onEnd(r),this.ended=!0,!1;(0===s.avail_out||0===s.avail_in&&(4===a||2===a))&&("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r)return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):(2===a&&(this.onEnd(0),s.avail_out=0),!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Deflate=f,r.deflate=l,r.deflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},r.gzip=function(t,e){return(e=e||{}).gzip=!0,l(t,e)}},75531,(t,e,r)=>{"use strict";e.exports=function(t,e){var r,n,i,o,a,s,u,f,l,c,h,d,p,y,g,m,b,v,_,w,S,k,E,x,A;r=t.state,n=t.next_in,x=t.input,i=n+(t.avail_in-5),o=t.next_out,A=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),u=r.dmax,f=r.wsize,l=r.whave,c=r.wnext,h=r.window,d=r.hold,p=r.bits,y=r.lencode,g=r.distcode,m=(1<>>=_=v>>>24,p-=_,0==(_=v>>>16&255))A[o++]=65535&v;else if(16&_)for(w=65535&v,(_&=15)&&(p<_&&(d+=x[n++]<>>=_,p-=_),p<15&&(d+=x[n++]<>>=_=v>>>24,p-=_,16&(_=v>>>16&255)){if(S=65535&v,p<(_&=15)&&(d+=x[n++]<u){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=_,p-=_,S>(_=o-a)){if((_=S-_)>l&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(k=0,E=h,0===c){if(k+=f-_,_2;)A[o++]=E[k++],A[o++]=E[k++],A[o++]=E[k++],w-=3;w&&(A[o++]=E[k++],w>1&&(A[o++]=E[k++]))}else{k=o-S;do A[o++]=A[k++],A[o++]=A[k++],A[o++]=A[k++],w-=3;while(w>2)w&&(A[o++]=A[k++],w>1&&(A[o++]=A[k++]))}}else if((64&_)==0){v=g[(65535&v)+(d&(1<<_)-1)];continue}else{t.msg="invalid distance code",r.mode=30;break t}break}else if((64&_)==0){v=y[(65535&v)+(d&(1<<_)-1)];continue}else if(32&_){r.mode=12;break t}else{t.msg="invalid literal/length code",r.mode=30;break t}break}while(n>3,p-=w<<3,d&=(1<{"use strict";var n=t.r(79148),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,r,u,f,l,c,h){var d,p,y,g,m,b,v,_,w,S=h.bits,k=0,E=0,x=0,A=0,O=0,R=0,C=0,T=0,I=0,B=0,P=null,j=0,L=new n.Buf16(16),U=new n.Buf16(16),z=null,D=0;for(k=0;k<=15;k++)L[k]=0;for(E=0;E=1&&0===L[A];A--);if(O>A&&(O=A),0===A)return f[l++]=0x1400000,f[l++]=0x1400000,h.bits=1,0;for(x=1;x0&&(0===t||1!==A))return -1;for(k=1,U[1]=0;k<15;k++)U[k+1]=U[k]+L[k];for(E=0;E852||2===t&&I>592)return 1;for(;;){v=k-C,c[E]b?(_=z[D+c[E]],w=P[j+c[E]]):(_=96,w=0),d=1<>C)+(p-=d)]=v<<24|_<<16|w;while(0!==p)for(d=1<>=1;if(0!==d?(B&=d-1,B+=d):B=0,E++,0==--L[k]){if(k===A)break;k=e[r+c[E]]}if(k>O&&(B&g)!==y){for(0===C&&(C=O),m+=x,T=1<<(R=k-C);R+C852||2===t&&I>592)return 1;f[y=B&g]=O<<24|R<<16|m-l}}return 0!==B&&(f[m+B]=k-C<<24|4194304),h.bits=O,0}},57235,(t,e,r)=>{"use strict";var n,i,o=t.r(79148),a=t.r(74049),s=t.r(63327),u=t.r(75531),f=t.r(73012);function l(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new o.Buf32(852),e.distcode=e.distdyn=new o.Buf32(592),e.sane=1,e.back=-1,0):-2}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,h(t)):-2}function p(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,d(t)):-2}function y(t,e){var r,n;return t?(t.state=n=new c,n.window=null,0!==(r=p(t,e))&&(t.state=null),r):-2}var g=!0;function m(t,e,r,n){var i,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(o.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),o.arraySet(a.window,e,r-n,i,a.wnext),(n-=i)?(o.arraySet(a.window,e,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=s(r.check,z,2,0),v=0,_=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){t.msg="incorrect header check",r.mode=30;break}if((15&v)!=8){t.msg="unknown compression method",r.mode=30;break}if(v>>>=4,_-=4,B=(15&v)+8,0===r.wbits)r.wbits=B;else if(B>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0,r.mode=3;case 3:for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.head&&(r.head.time=v),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,z[2]=v>>>16&255,z[3]=v>>>24&255,r.check=s(r.check,z,4,0)),v=0,_=0,r.mode=4;case 4:for(;_<16;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.head&&(r.head.xflags=255&v,r.head.os=v>>8),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0,r.mode=5;case 5:if(1024&r.flags){for(;_<16;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.length=v,r.head&&(r.head.extra_len=v),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((k=r.length)>y&&(k=y),k&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),o.arraySet(r.head.extra,c,d,k,B)),512&r.flags&&(r.check=s(r.check,c,k,d)),y-=k,d+=k,r.length-=k),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===y)break e;k=0;do B=c[d+k++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B));while(B&&k>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}t.adler=r.check=l(v),v=0,_=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,2;t.adler=r.check=1,r.mode=12;case 12:if(5===e||6===e)break e;case 13:if(r.last){v>>>=7&_,_-=7&_,r.mode=27;break}for(;_<3;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}switch(r.last=1&v,_-=1,3&(v>>>=1)){case 0:r.mode=14;break;case 1:if(!function(t){if(g){var e;for(n=new o.Buf32(512),i=new o.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(f(1,t.lens,0,288,n,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;f(2,t.lens,0,32,i,0,t.work,{bits:5}),g=!1}t.lencode=n,t.lenbits=9,t.distcode=i,t.distbits=5}(r),r.mode=20,6===e){v>>>=2,_-=2;break e}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}v>>>=2,_-=2;break;case 14:for(v>>>=7&_,_-=7&_;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if((65535&v)!=(v>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&v,v=0,_=0,r.mode=15,6===e)break e;case 15:r.mode=16;case 16:if(k=r.length){if(k>y&&(k=y),k>b&&(k=b),0===k)break e;o.arraySet(h,c,d,k,p),y-=k,d+=k,b-=k,p+=k,r.length-=k;break}r.mode=12;break;case 17:for(;_<14;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(r.nlen=(31&v)+257,_-=5,r.ndist=(31&(v>>>=5))+1,_-=5,r.ncode=(15&(v>>>=5))+4,v>>>=4,_-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,_-=3}for(;r.have<19;)r.lens[D[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},P=f(0,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,P){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(R<16)v>>>=A,_-=A,r.lens[r.have++]=R;else{if(16===R){for(L=A+2;_>>=A,_-=A,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}B=r.lens[r.have-1],k=3+(3&v),v>>>=2,_-=2}else if(17===R){for(L=A+3;_>>=A,_-=A,B=0,k=3+(7&v),v>>>=3,_-=3}else{for(L=A+7;_>>=A,_-=A,B=0,k=11+(127&v),v>>>=7,_-=7}if(r.have+k>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;k--;)r.lens[r.have++]=B}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,j={bits:r.lenbits},P=f(1,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,P){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},P=f(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,P){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break e;case 20:r.mode=21;case 21:if(y>=6&&b>=258){t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,u(t,S),p=t.next_out,h=t.output,b=t.avail_out,d=t.next_in,c=t.input,y=t.avail_in,v=r.hold,_=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;A=(U=r.lencode[v&(1<>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(O&&(240&O)==0){for(C=A,T=O,I=R;A=(U=r.lencode[I+((v&(1<>C)])>>>24,O=U>>>16&255,R=65535&U,!(C+A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}v>>>=C,_-=C,r.back+=C}if(v>>>=A,_-=A,r.back+=A,r.length=R,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=12;break}if(64&O){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(L=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(U=r.distcode[v&(1<>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if((240&O)==0){for(C=A,T=O,I=R;A=(U=r.distcode[I+((v&(1<>C)])>>>24,O=U>>>16&255,R=65535&U,!(C+A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}v>>>=C,_-=C,r.back+=C}if(v>>>=A,_-=A,r.back+=A,64&O){t.msg="invalid distance code",r.mode=30;break}r.offset=R,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(L=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===b)break e;if(k=S-b,r.offset>k){if((k=r.offset-k)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}k>r.wnext?(k-=r.wnext,E=r.wsize-k):E=r.wnext-k,k>r.length&&(k=r.length),x=r.window}else x=h,E=p-r.offset,k=r.length;k>b&&(k=b),b-=k,r.length-=k;do h[p++]=x[E++];while(--k)0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;h[p++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;_<32;){if(0===y)break e;y--,v|=c[d++]<<_,_+=8}if(S-=b,t.total_out+=S,r.total+=S,S&&(t.adler=r.check=r.flags?s(r.check,h,S,p-S):a(r.check,h,S,p-S)),S=b,(r.flags?v:l(v))!==r.check){t.msg="incorrect data check",r.mode=30;break}v=0,_=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(v!==(0|r.total)){t.msg="incorrect length check",r.mode=30;break}v=0,_=0}r.mode=29;case 29:P=1;break e;case 30:P=-3;break e;case 31:return -4;default:return -2}return t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,(r.wsize||S!==t.avail_out&&r.mode<30&&(r.mode<27||4!==e))&&m(t,t.output,t.next_out,S-t.avail_out),w-=t.avail_in,S-=t.avail_out,t.total_in+=w,t.total_out+=S,r.total+=S,r.wrap&&S&&(t.adler=r.check=r.flags?s(r.check,h,S,t.next_out-S):a(r.check,h,S,t.next_out-S)),t.data_type=r.bits+64*!!r.last+128*(12===r.mode)+256*(20===r.mode||15===r.mode),(0===w&&0===S||4===e)&&0===P&&(P=-5),P},r.inflateEnd=function(t){if(!t||!t.state)return -2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},r.inflateGetHeader=function(t,e){var r;return t&&t.state&&(2&(r=t.state).wrap)!=0?(r.head=e,e.done=!1,0):-2},r.inflateSetDictionary=function(t,e){var r,n=e.length;return t&&t.state&&(0===(r=t.state).wrap||11===r.mode)?11===r.mode&&a(1,e,n,0)!==r.check?-3:m(t,e,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},r.inflateInfo="pako inflate (from Nodeca project)"},34131,(t,e,r)=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},24448,(t,e,r)=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},82473,(t,e,r)=>{"use strict";var n=t.r(57235),i=t.r(79148),o=t.r(63202),a=t.r(34131),s=t.r(19558),u=t.r(98899),f=t.r(24448),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits)==0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==a.Z_OK||(this.header=new f,n.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw)&&(r=n.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK))throw Error(s[r])}function h(t,e){var r=new c(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}c.prototype.push=function(t,e){var r,s,u,f,c,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,y=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?h.input=o.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?h.input=new Uint8Array(t):h.input=t,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===y&&(r=a.Z_OK,y=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0===h.avail_out||r===a.Z_STREAM_END||0===h.avail_in&&(s===a.Z_FINISH||s===a.Z_SYNC_FLUSH))&&("string"===this.options.to?(u=o.utf8border(h.output,h.next_out),f=h.next_out-u,c=o.buf2string(h.output,u),h.next_out=f,h.avail_out=d-f,f&&i.arraySet(h.output,h.output,u,f,0),this.onData(c)):this.onData(i.shrinkBuf(h.output,h.next_out))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==a.Z_STREAM_END)return(r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH)?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):(s===a.Z_SYNC_FLUSH&&(this.onEnd(a.Z_OK),h.avail_out=0),!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Inflate=c,r.inflate=h,r.inflateRaw=function(t,e){return(e=e||{}).raw=!0,h(t,e)},r.ungzip=h},9643,(t,e,r)=>{"use strict";var n=t.r(79148).assign,i=t.r(48901),o=t.r(82473),a=t.r(34131),s={};n(s,i,o,a),e.exports=s},72488,(t,e,r)=>{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t.r(9643),o=t.r(65464),a=t.r(48913),s=n?"uint8array":"array";function u(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",o.inherits(u,a),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,t.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new u("Deflate",t)},r.uncompressWorker=function(){return new u("Inflate",{})}},36462,(t,e,r)=>{"use strict";var n=t.r(48913);r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t.r(72488)},71471,(t,e,r)=>{"use strict";r.LOCAL_FILE_HEADER="PK\x03\x04",r.CENTRAL_FILE_HEADER="PK\x01\x02",r.CENTRAL_DIRECTORY_END="PK\x05\x06",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",r.DATA_DESCRIPTOR="PK\x07\b"},21908,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913),o=t.r(46253),a=t.r(63494),s=t.r(71471),u=function(t,e){var r,n="";for(r=0;r>>=8;return n},f=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16},l=function(t,e,r,i,l,c){var h,d,p=t.file,y=t.compression,g=c!==o.utf8encode,m=n.transformTo("string",c(p.name)),b=n.transformTo("string",o.utf8encode(p.name)),v=p.comment,_=n.transformTo("string",c(v)),w=n.transformTo("string",o.utf8encode(v)),S=b.length!==p.name.length,k=w.length!==v.length,E="",x="",A="",O=p.dir,R=p.date,C={crc32:0,compressedSize:0,uncompressedSize:0};(!e||r)&&(C.crc32=t.crc32,C.compressedSize=t.compressedSize,C.uncompressedSize=t.uncompressedSize);var T=0;e&&(T|=8),!g&&(S||k)&&(T|=2048);var I=0,B=0;(O&&(I|=16),"UNIX"===l)?(B=798,I|=f(p.unixPermissions,O)):(B=20,I|=63&(p.dosPermissions||0)),h=(R.getUTCHours()<<6|R.getUTCMinutes())<<5|R.getUTCSeconds()/2,d=(R.getUTCFullYear()-1980<<4|R.getUTCMonth()+1)<<5|R.getUTCDate(),S&&(x=u(1,1)+u(a(m),4)+b,E+="up"+u(x.length,2)+x),k&&(A=u(1,1)+u(a(_),4)+w,E+="uc"+u(A.length,2)+A);var P="";return P+="\n\0",P+=u(T,2),P+=y.magic,P+=u(h,2),P+=u(d,2),P+=u(C.crc32,4),P+=u(C.compressedSize,4),P+=u(C.uncompressedSize,4),P+=u(m.length,2),P+=u(E.length,2),{fileRecord:s.LOCAL_FILE_HEADER+P+m+E,dirRecord:s.CENTRAL_FILE_HEADER+u(B,2)+P+u(_.length,2)+"\0\0\0\0"+u(I,4)+u(i,4)+m+E+_}},c=function(t,e,r,i,o){var a=n.transformTo("string",o(i));return s.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(t,2)+u(t,2)+u(e,4)+u(r,4)+u(a.length,2)+a},h=function(t){return s.DATA_DESCRIPTOR+u(t.crc32,4)+u(t.compressedSize,4)+u(t.uncompressedSize,4)};function d(t,e,r,n){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(d,i),d.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,i.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},d.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=l(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=l(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:h(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e{"use strict";var n=t.r(36462),i=t.r(21908),o=function(t,e){var r=t||e,i=n[r];if(!i)throw Error(r+" is not a valid compression method !");return i};r.generateWorker=function(t,e,r){var n=new i(e.streamFiles,r,e.platform,e.encodeFileName),a=0;try{t.forEach(function(t,r){a++;var i=o(r.options.compression,e.compression),s=r.options.compressionOptions||e.compressionOptions||{},u=r.dir,f=r.date;r._compressWorker(i,s).withStreamInfo("file",{name:t,dir:u,date:f,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(n)}),n.entriesCount=a}catch(t){n.error(t)}return n}},13303,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t,e){i.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}n.inherits(o,i),o.prototype._bindStream=function(t){var e=this;this._stream=t,t.pause(),t.on("data",function(t){e.push({data:t,meta:{percent:0}})}).on("error",function(t){e.isPaused?this.generatedError=t:e.error(t)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=o},1223,(t,e,r)=>{"use strict";var n=t.r(46253),i=t.r(65464),o=t.r(48913),a=t.r(846),s=t.r(13133),u=t.r(43220),f=t.r(52929),l=t.r(6664),c=t.r(42527),h=t.r(13303),d=function(t,e,r){var n,a=i.getTypeOf(e),l=i.extend(r||{},s);l.date=l.date||new Date,null!==l.compression&&(l.compression=l.compression.toUpperCase()),"string"==typeof l.unixPermissions&&(l.unixPermissions=parseInt(l.unixPermissions,8)),l.unixPermissions&&16384&l.unixPermissions&&(l.dir=!0),l.dosPermissions&&16&l.dosPermissions&&(l.dir=!0),l.dir&&(t=y(t)),l.createFolders&&(n=p(t))&&g.call(this,n,!0);var d="string"===a&&!1===l.binary&&!1===l.base64;r&&void 0!==r.binary||(l.binary=!d),(e instanceof u&&0===e.uncompressedSize||l.dir||!e||0===e.length)&&(l.base64=!1,l.binary=!0,e="",l.compression="STORE",a="string");var m=null;m=e instanceof u||e instanceof o?e:c.isNode&&c.isStream(e)?new h(t,e):i.prepareContent(t,e,l.binary,l.optimizedBinaryString,l.base64);var b=new f(t,m,l);this.files[t]=b},p=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},y=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},g=function(t,e){return e=void 0!==e?e:s.createFolders,t=y(t),this.files[t]||d.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function m(t){return"[object RegExp]"===Object.prototype.toString.call(t)}e.exports={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,r,n;for(e in this.files)n=this.files[e],(r=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(r,n)},filter:function(t){var e=[];return this.forEach(function(r,n){t(r,n)&&e.push(n)}),e},file:function(t,e,r){if(1==arguments.length)if(m(t)){var n=t;return this.filter(function(t,e){return!e.dir&&n.test(t)})}else{var i=this.files[this.root+t];return i&&!i.dir?i:null}return t=this.root+t,d.call(this,t,e,r),this},folder:function(t){if(!t)return this;if(m(t))return this.filter(function(e,r){return r.dir&&t.test(e)});var e=this.root+t,r=g.call(this,e),n=this.clone();return n.root=r.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var r=this.filter(function(e,r){return r.name.slice(0,t.length)===t}),n=0;n{"use strict";var n=t.r(65464);function i(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC((t>>25&127)+1980,(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},12189,(t,e,r)=>{"use strict";var n=t.r(37384);function i(t){n.call(this,t);for(var e=0;e=0;--o)if(this.data[o]===e&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return -1},i.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),i=t.charCodeAt(3),o=this.readData(4);return e===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},41370,(t,e,r)=>{"use strict";var n=t.r(37384);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},15841,(t,e,r)=>{"use strict";var n=t.r(12189);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},44429,(t,e,r)=>{"use strict";var n=t.r(15841);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},71770,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(87780),o=t.r(12189),a=t.r(41370),s=t.r(44429),u=t.r(15841);e.exports=function(t){var e=n.getTypeOf(t);return(n.checkSupport(e),"string"!==e||i.uint8array)?"nodebuffer"===e?new s(t):i.uint8array?new u(n.transformTo("uint8array",t)):new o(n.transformTo("array",t)):new a(t)}},92861,(t,e,r)=>{"use strict";var n=t.r(71770),i=t.r(65464),o=t.r(43220),a=t.r(63494),s=t.r(46253),u=t.r(36462),f=t.r(87780),l=function(t){for(var e in u)if(Object.prototype.hasOwnProperty.call(u,e)&&u[e].magic===t)return u[e];return null};function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(t){var e,r;if(t.skip(22),this.fileNameLength=t.readInt(2),r=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=l(this.compressionMethod)))throw Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4{"use strict";var n=t.r(71770),i=t.r(65464),o=t.r(71471),a=t.r(92861),s=t.r(87780);function u(t){this.files=[],this.loadOptions=t}u.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+i.pretty(e)+", expected "+i.pretty(t)+")")}},isSignature:function(t,e){var r=this.reader.index;this.reader.setIndex(t);var n=this.reader.readString(4);return this.reader.setIndex(r),n===e},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=s.uint8array?"uint8array":"array",r=i.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,r,n=this.zip64EndOfCentralSize-44;01)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t0)this.isSignature(e,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(t){this.reader=n(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=u},37153,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(24375),o=t.r(46253),a=t.r(12938),s=t.r(1648),u=t.r(42527);e.exports=function(t,e){var r=this;return(e=n.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(t))?i.Promise.reject(Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var r=new a(e);return r.load(t),r}).then(function(t){var r=[i.Promise.resolve(t)],n=t.files;if(e.checkCRC32)for(var o=0;o{"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}n.prototype=t.r(1223),n.prototype.loadAsync=t.r(37153),n.support=t.r(87780),n.defaults=t.r(13133),n.version="3.10.1",n.loadAsync=function(t,e){return new n().loadAsync(t,e)},n.external=t.r(24375),e.exports=n}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/d9f21d966613a96e.js b/docs/_next/static/chunks/4cde5a883a99f9c9.js similarity index 70% rename from docs/_next/static/chunks/d9f21d966613a96e.js rename to docs/_next/static/chunks/4cde5a883a99f9c9.js index 5fb7da8..727ab72 100644 --- a/docs/_next/static/chunks/d9f21d966613a96e.js +++ b/docs/_next/static/chunks/4cde5a883a99f9c9.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,40141,e=>{"use strict";e.s(["GenIcon",()=>o],40141);var t=e.i(71645),a={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},r=t.default.createContext&&t.default.createContext(a),c=["attr","size","title"];function n(){return(n=Object.assign.bind()).apply(this,arguments)}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,r)}return a}function i(e){for(var t=1;tt.default.createElement(s,n({attr:i({},e.attr)},a),function e(a){return a&&a.map((a,r)=>t.default.createElement(a.tag,i({key:r},a.attr),e(a.child)))}(e.child))}function s(e){var l=a=>{var r,{attr:l,size:o,title:s}=e,u=function(e,t){if(null==e)return{};var a,r,c=function(e,t){if(null==e)return{};var a={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;a[r]=e[r]}return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}(e,c),h=o||a.size||"1em";return a.className&&(r=a.className),e.className&&(r=(r?r+" ":"")+e.className),t.default.createElement("svg",n({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,l,u,{className:r,style:i(i({color:e.color||a.color},a.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),s&&t.default.createElement("title",null,s),e.children)};return void 0!==r?t.default.createElement(r.Consumer,null,e=>l(e)):l(a)}},90106,e=>{"use strict";e.s(["BsBadge3dFill",()=>r,"BsFillGrid3X3GapFill",()=>a]);var t=e.i(40141);function a(e){return(0,t.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M10.157 5.968h-.844v4.06h.844c1.116 0 1.621-.667 1.621-2.02 0-1.354-.51-2.04-1.621-2.04"},child:[]},{tag:"path",attr:{d:"M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm5.184 4.368c.646 0 1.055.378 1.06.9.008.537-.427.919-1.086.919-.598-.004-1.037-.325-1.068-.756H3c.03.914.791 1.688 2.153 1.688 1.24 0 2.285-.66 2.272-1.798-.013-.953-.747-1.38-1.292-1.432v-.062c.44-.07 1.125-.527 1.108-1.375-.013-.906-.8-1.57-2.053-1.565-1.31.005-2.043.734-2.074 1.67h1.103c.022-.391.383-.751.936-.751.532 0 .928.33.928.813.004.479-.383.835-.928.835h-.632v.914zM8.126 11h2.189C12.125 11 13 9.893 13 7.985c0-1.894-.861-2.984-2.685-2.984H8.126z"},child:[]}]})(e)}},11152,e=>{"use strict";e.s(["FaAngleDown",()=>r,"FaArrowDown",()=>c,"FaArrowUp",()=>n,"FaChevronLeft",()=>l,"FaChevronRight",()=>i,"FaDownload",()=>o,"FaFolderOpen",()=>s,"FaGithub",()=>a,"FaLock",()=>u,"FaSearch",()=>h,"FaTimes",()=>m,"FaTrashAlt",()=>v,"FaUnlock",()=>d]);var t=e.i(40141);function a(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"},child:[]}]})(e)}function c(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"},child:[]}]})(e)}function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"},child:[]}]})(e)}function l(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"},child:[]}]})(e)}function o(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},child:[]}]})(e)}function s(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"},child:[]}]})(e)}function u(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"},child:[]}]})(e)}function h(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},child:[]}]})(e)}function m(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function v(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"},child:[]}]})(e)}function d(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}},15768,e=>{"use strict";e.s(["default",()=>r]);var t=e.i(71645);let a={customSkins:{},newSkins:{},packs:{},sizeMultiplier:{}};function r(){let[e,r]=(0,t.useState)(a);(0,t.useEffect)(()=>{let e=new AbortController,t=e.signal,a=!1;return(async()=>{let e;try{if(e=await fetch("".concat("https://exogen.github.io/t2-skins","/skins.json"),{signal:t}),!a){let t=await e.json();a||r(t)}}catch(e){console.error(e)}})(),()=>{a=!0,e.signal.aborted||e.abort()}},[]);let c=e!==a;return[e,c]}},20592,e=>{"use strict";e.s(["default",()=>t]);let t=e.i(29947).default},53653,e=>{"use strict";let t;e.s(["importMultipleFilesToModels",()=>u,"modelToModelType",()=>l,"modelTypes",()=>n]);var a=e.i(71315);let r=e.i(20592).default.materials,c=/^(\.|__MACOSX)/,n={player:["lmale","mmale","hmale","lfemale","mfemale","hfemale","lbioderm","mbioderm","hbioderm"],weapon:["disc","chaingun","grenade_launcher","sniper","plasmathrower","energy","shocklance","elf","missile","mortar","repair","targeting","mine"],vehicle:["vehicle_grav_scout","vehicle_grav_tank","vehicle_land_mpbbase","vehicle_air_scout","vehicle_air_bomber","vehicle_air_hapc"]};function l(e){switch(e){case"lmale":case"mmale":case"hmale":case"lfemale":case"mfemale":case"hfemale":case"lbioderm":case"mbioderm":case"hbioderm":return"player";case"disc":case"chaingun":case"grenade_launcher":case"sniper":case"plasmathrower":case"energy":case"shocklance":case"elf":case"missile":case"mortar":case"repair":case"targeting":case"mine":return"weapon";case"vehicle_grav_scout":case"vehicle_grav_tank":case"vehicle_land_mpbbase":case"vehicle_air_scout":case"vehicle_air_bomber":case"vehicle_air_hapc":return"vehicle";default:throw Error("Unknown model")}}async function i(e){let t=await a.default.loadAsync(e);return(await Promise.all(Object.entries(t.files).map(async e=>{let[t,a]=e;if(!c.test(t)&&/\.png$/i.exec(t)){let e=await a.async("base64");return{path:t,imageUrl:"data:image/png;base64,".concat(e)}}}))).filter(e=>!!e)}async function o(e){return new Promise((t,a)=>{let r=new FileReader;r.addEventListener("load",e=>{var r;"string"==typeof(null==(r=e.target)?void 0:r.result)?t(e.target.result):a()}),r.addEventListener("error",e=>{a()}),r.readAsDataURL(e)})}async function s(e){return(await Promise.all(Array.from(e).map(async e=>{var t;if(c.test(e.name))return null;switch((t=e).name.match(/\.png$/i)?"png":t.name.match(/\.zip$/i)?"zip":t.name.match(/\.vl2$/i)?"vl2":void 0){case"zip":case"vl2":{let t=e.name.match(/^(.+)\.(zip|vl2)$/i),a=t?t[1]:e.name;return(await i(e)).map(t=>({...t,path:"".concat(e.name,"/").concat(t.path),name:a}))}case"png":return{path:e.name,imageUrl:await o(e),name:null};default:return null}}))).flat().filter(e=>!!e)}async function u(e){var a=await s(e);let c=new Map;return a.forEach(e=>{let a=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t||(t=function(){let e=new Map;for(let t in r)r[t].forEach((a,r)=>{let c;if(a.fileSuffix?c=a.fileSuffix:!1!==a.selectable&&!0!==a.hidden&&(a.file||a.name)&&(c=a.file||a.name),c){var n;let l=null!=(n=e.get(c))?n:[];l.push({modelName:t,material:a,index:r}),e.set(c,l)}});return e}());let c=e.split("/").slice(-1)[0],n=c.match(/^(.+)\.(PNG|png)$/);if(n){let r=n[1],l=r.split(".");if(l.length>1){let a=".".concat(l[l.length-1]),i=t.get(a);if(i)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:l.slice(0,l.length-1).join("."),models:i}}else{let i=function(e){let a=/^(.+[^\d])(\d{2,})$/.exec(e);if(a){var r;let e=a[1],c=a[2],n=parseInt(c,10),l="".concat(e).concat("0".padStart(c.length,"0"));return(null!=(r=t.get(l))?r:[]).filter(e=>"number"==typeof e.material.frameCount).map(e=>({...e,frameIndex:n}))}return[]}(l[0]);if(i.length)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:a,models:i};{let i=t.get(l[0]);if(i)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:a,models:i}}}}return null}(e.path,e.name);a&&a.models.forEach(t=>{var r,n,l,i,o;let s=null!=(r=c.get(t.modelName))?r:new Map,u=null!=(n=s.get(a.skinName))?n:{name:a.skinName,isComplete:null,materials:new Map},h=null!=(l=t.material.file)?l:t.material.name,m=null!=(i=u.materials.get(h))?i:[];m[null!=(o=t.frameIndex)?o:0]=e.imageUrl,u.materials.set(h,m),s.set(a.skinName,u),c.set(t.modelName,s)})}),c.forEach((e,t)=>{let a=r[t].filter(e=>!1!==e.selectable&&!0!==e.hidden&&!0!==e.optional);e.forEach(e=>{e.isComplete=a.every(t=>{var a;return e.materials.has(null!=(a=t.file)?a:t.name)})})}),c}}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,40141,e=>{"use strict";e.s(["GenIcon",()=>o],40141);var t=e.i(71645),a={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},r=t.default.createContext&&t.default.createContext(a),c=["attr","size","title"];function n(){return(n=Object.assign.bind()).apply(this,arguments)}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,r)}return a}function i(e){for(var t=1;tt.default.createElement(s,n({attr:i({},e.attr)},a),function e(a){return a&&a.map((a,r)=>t.default.createElement(a.tag,i({key:r},a.attr),e(a.child)))}(e.child))}function s(e){var l=a=>{var r,{attr:l,size:o,title:s}=e,u=function(e,t){if(null==e)return{};var a,r,c=function(e,t){if(null==e)return{};var a={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;a[r]=e[r]}return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}(e,c),h=o||a.size||"1em";return a.className&&(r=a.className),e.className&&(r=(r?r+" ":"")+e.className),t.default.createElement("svg",n({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,l,u,{className:r,style:i(i({color:e.color||a.color},a.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),s&&t.default.createElement("title",null,s),e.children)};return void 0!==r?t.default.createElement(r.Consumer,null,e=>l(e)):l(a)}},90106,e=>{"use strict";e.s(["BsBadge3dFill",()=>r,"BsFillGrid3X3GapFill",()=>a]);var t=e.i(40141);function a(e){return(0,t.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M10.157 5.968h-.844v4.06h.844c1.116 0 1.621-.667 1.621-2.02 0-1.354-.51-2.04-1.621-2.04"},child:[]},{tag:"path",attr:{d:"M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm5.184 4.368c.646 0 1.055.378 1.06.9.008.537-.427.919-1.086.919-.598-.004-1.037-.325-1.068-.756H3c.03.914.791 1.688 2.153 1.688 1.24 0 2.285-.66 2.272-1.798-.013-.953-.747-1.38-1.292-1.432v-.062c.44-.07 1.125-.527 1.108-1.375-.013-.906-.8-1.57-2.053-1.565-1.31.005-2.043.734-2.074 1.67h1.103c.022-.391.383-.751.936-.751.532 0 .928.33.928.813.004.479-.383.835-.928.835h-.632v.914zM8.126 11h2.189C12.125 11 13 9.893 13 7.985c0-1.894-.861-2.984-2.685-2.984H8.126z"},child:[]}]})(e)}},11152,e=>{"use strict";e.s(["FaAngleDown",()=>r,"FaArrowDown",()=>c,"FaArrowUp",()=>n,"FaChevronLeft",()=>l,"FaChevronRight",()=>i,"FaDownload",()=>o,"FaFolderOpen",()=>s,"FaGithub",()=>a,"FaLock",()=>u,"FaSearch",()=>h,"FaTimes",()=>m,"FaTrashAlt",()=>v,"FaUnlock",()=>d]);var t=e.i(40141);function a(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"},child:[]}]})(e)}function c(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"},child:[]}]})(e)}function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"},child:[]}]})(e)}function l(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"},child:[]}]})(e)}function o(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},child:[]}]})(e)}function s(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"},child:[]}]})(e)}function u(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"},child:[]}]})(e)}function h(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},child:[]}]})(e)}function m(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function v(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"},child:[]}]})(e)}function d(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}},15768,e=>{"use strict";e.s(["default",()=>c]);var t=e.i(71645),a=e.i(96165);let r={customSkins:{},newSkins:{},packs:{},sizeMultiplier:{}};function c(){let[e,c]=(0,t.useState)(r);(0,t.useEffect)(()=>{let e=new AbortController,t=e.signal,r=!1;return(async()=>{let e;try{if(e=await fetch(a.SKIN_MANIFEST_URL,{signal:t}),!r){let t=await e.json();r||c(t)}}catch(e){console.error(e)}})(),()=>{r=!0,e.signal.aborted||e.abort()}},[]);let n=e!==r;return[e,n]}},20592,e=>{"use strict";e.s(["default",()=>t]);let t=e.i(29947).default},53653,e=>{"use strict";let t;e.s(["importMultipleFilesToModels",()=>u,"modelToModelType",()=>l,"modelTypes",()=>n]);var a=e.i(71315);let r=e.i(20592).default.materials,c=/^(\.|__MACOSX)/,n={player:["lmale","mmale","hmale","lfemale","mfemale","hfemale","lbioderm","mbioderm","hbioderm"],weapon:["disc","chaingun","grenade_launcher","sniper","plasmathrower","energy","shocklance","elf","missile","mortar","repair","targeting","mine"],vehicle:["vehicle_grav_scout","vehicle_grav_tank","vehicle_land_mpbbase","vehicle_air_scout","vehicle_air_bomber","vehicle_air_hapc"]};function l(e){switch(e){case"lmale":case"mmale":case"hmale":case"lfemale":case"mfemale":case"hfemale":case"lbioderm":case"mbioderm":case"hbioderm":return"player";case"disc":case"chaingun":case"grenade_launcher":case"sniper":case"plasmathrower":case"energy":case"shocklance":case"elf":case"missile":case"mortar":case"repair":case"targeting":case"mine":return"weapon";case"vehicle_grav_scout":case"vehicle_grav_tank":case"vehicle_land_mpbbase":case"vehicle_air_scout":case"vehicle_air_bomber":case"vehicle_air_hapc":return"vehicle";default:throw Error("Unknown model")}}async function i(e){let t=await a.default.loadAsync(e);return(await Promise.all(Object.entries(t.files).map(async e=>{let[t,a]=e;if(!c.test(t)&&/\.png$/i.exec(t)){let e=await a.async("base64");return{path:t,imageUrl:"data:image/png;base64,".concat(e)}}}))).filter(e=>!!e)}async function o(e){return new Promise((t,a)=>{let r=new FileReader;r.addEventListener("load",e=>{var r;"string"==typeof(null==(r=e.target)?void 0:r.result)?t(e.target.result):a()}),r.addEventListener("error",e=>{a()}),r.readAsDataURL(e)})}async function s(e){return(await Promise.all(Array.from(e).map(async e=>{var t;if(c.test(e.name))return null;switch((t=e).name.match(/\.png$/i)?"png":t.name.match(/\.zip$/i)?"zip":t.name.match(/\.vl2$/i)?"vl2":void 0){case"zip":case"vl2":{let t=e.name.match(/^(.+)\.(zip|vl2)$/i),a=t?t[1]:e.name;return(await i(e)).map(t=>({...t,path:"".concat(e.name,"/").concat(t.path),name:a}))}case"png":return{path:e.name,imageUrl:await o(e),name:null};default:return null}}))).flat().filter(e=>!!e)}async function u(e){var a=await s(e);let c=new Map;return a.forEach(e=>{let a=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t||(t=function(){let e=new Map;for(let t in r)r[t].forEach((a,r)=>{let c;if(a.fileSuffix?c=a.fileSuffix:!1!==a.selectable&&!0!==a.hidden&&(a.file||a.name)&&(c=a.file||a.name),c){var n;let l=null!=(n=e.get(c))?n:[];l.push({modelName:t,material:a,index:r}),e.set(c,l)}});return e}());let c=e.split("/").slice(-1)[0],n=c.match(/^(.+)\.(PNG|png)$/);if(n){let r=n[1],l=r.split(".");if(l.length>1){let a=".".concat(l[l.length-1]),i=t.get(a);if(i)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:l.slice(0,l.length-1).join("."),models:i}}else{let i=function(e){let a=/^(.+[^\d])(\d{2,})$/.exec(e);if(a){var r;let e=a[1],c=a[2],n=parseInt(c,10),l="".concat(e).concat("0".padStart(c.length,"0"));return(null!=(r=t.get(l))?r:[]).filter(e=>"number"==typeof e.material.frameCount).map(e=>({...e,frameIndex:n}))}return[]}(l[0]);if(i.length)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:a,models:i};{let i=t.get(l[0]);if(i)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:a,models:i}}}}return null}(e.path,e.name);a&&a.models.forEach(t=>{var r,n,l,i,o;let s=null!=(r=c.get(t.modelName))?r:new Map,u=null!=(n=s.get(a.skinName))?n:{name:a.skinName,isComplete:null,materials:new Map},h=null!=(l=t.material.file)?l:t.material.name,m=null!=(i=u.materials.get(h))?i:[];m[null!=(o=t.frameIndex)?o:0]=e.imageUrl,u.materials.set(h,m),s.set(a.skinName,u),c.set(t.modelName,s)})}),c.forEach((e,t)=>{let a=r[t].filter(e=>!1!==e.selectable&&!0!==e.hidden&&!0!==e.optional);e.forEach(e=>{e.isComplete=a.every(t=>{var a;return e.materials.has(null!=(a=t.file)?a:t.name)})})}),c}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/d63fc3798baf75bd.js b/docs/_next/static/chunks/8b82d6c1705317af.js similarity index 99% rename from docs/_next/static/chunks/d63fc3798baf75bd.js rename to docs/_next/static/chunks/8b82d6c1705317af.js index dbd059f..ea1a81c 100644 --- a/docs/_next/static/chunks/d63fc3798baf75bd.js +++ b/docs/_next/static/chunks/8b82d6c1705317af.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,34582,(t,e,r)=>{"use strict";r.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return(r+n)*3/4-n},r.toByteArray=function(t){var e,r,n=f(t),a=n[0],s=n[1],u=new o((a+s)*3/4-s),l=0,c=s>0?a-4:a;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;a>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}(t,a,a+16383>s?s:a+16383));return 1===i?o.push(n[(e=t[r-1])>>2]+n[e<<4&63]+"=="):2===i&&o.push(n[(e=(t[r-2]<<8)+t[r-1])>>10]+n[e>>4&63]+n[e<<2&63]+"="),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}i[45]=62,i[95]=63},38492,(t,e,r)=>{r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,l=-7,c=r?i-1:0,h=r?-1:1,d=t[e+c];for(c+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+c],c+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=f}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,l=(1<>1,h=5960464477539062e-23*(23===i),d=n?0:o-1,p=n?1:-1,y=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(s=+!!isNaN(e),a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+c>=1?e+=h/u:e+=h*Math.pow(2,1-c),e*u>=2&&(a++,u/=2),a+c>=l?(s=0,a=l):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*y}},43943,(t,e,r)=>{"use strict";var n=t.r(34582),i=t.r(38492),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return l(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t){var n=t,i=e;if(("string"!=typeof i||""===i)&&(i="utf8"),!s.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|p(n,i),u=a(o),f=u.write(n,i);return f!==o&&(u=u.slice(0,f)),u}if(ArrayBuffer.isView(t)){var l=t;if(C(l,Uint8Array)){var y=new Uint8Array(l);return h(y.buffer,y.byteOffset,y.byteLength)}return c(l)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(C(t,ArrayBuffer)||t&&C(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(C(t,SharedArrayBuffer)||t&&C(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var g=t.valueOf&&t.valueOf();if(null!=g&&g!==t)return s.from(g,e,r);var m=function(t){if(s.isBuffer(t)){var e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?a(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(m)return m;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return f(t),a(t<0?0:0|d(t))}function c(t){for(var e=t.length<0?0:0|d(t.length),r=a(e),n=0;n=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||C(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return A(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return O(t).length;default:if(i)return n?-1:A(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){var i,o,a,s=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(i)return -1;else r=t.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return b(t,[e],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;h239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(l=f);break;case 2:(192&(o=t[i+1]))==128&&(u=(31&f)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],(192&o)==128&&(192&a)==128&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}var h=n,d=h.length;if(d<=4096)return String.fromCharCode.apply(String,h);for(var p="",y=0;yr)throw RangeError("Trying to access beyond buffer length")}function w(t,e,r,n,i,o){if(!s.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw RangeError("Index out of range")}function S(t,e,r,n,i,o){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function k(t,e,r,n,o){return e*=1,r>>>=0,o||S(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function E(t,e,r,n,o){return e*=1,r>>>=0,o||S(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}r.Buffer=s,r.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return(f(t),t<=0)?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)},s.allocUnsafe=function(t){return l(t)},s.allocUnsafeSlow=function(t){return l(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(C(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),C(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);in.length?s.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else if(s.isBuffer(o))o.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;ee&&(t+=" ... "),""},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(t,e,r,n,i){if(C(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),l=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,a,s,u,f,l,c,h=this.length-e;if((void 0===r||r>h)&&(r=h),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var d=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a>8,i.push(r%256),i.push(n);return i}(t,this.length-l),this,l,c);default:if(d)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||_(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||_(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||_(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||_(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||_(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||_(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return(t>>>=0,e||_(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||_(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||_(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||_(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||_(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||_(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||_(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||_(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||_(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a|0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return k(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return k(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return E(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return E(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!i){if(r>56319||a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function O(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var i=0;i=e.length)&&!(i>=t.length);++i)e[i+r]=t[i];return i}function C(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var T=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},30662,(t,e,r)=>{!function(){"use strict";var t={864:function(t){var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise(function(r,n){var i,o,a;function s(r){t.removeListener(e,u),n(r)}function u(){"function"==typeof t.removeListener&&t.removeListener("error",s),r([].slice.call(arguments))}y(t,e,u,{once:!0}),"error"!==e&&(i=t,o=s,a={once:!0},"function"==typeof i.on&&y(i,"error",o,a))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(t){if("function"!=typeof t)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){if(s(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=u(t))>0&&a.length>i&&!a.warned){a.warned=!0;var i,o,a,f=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=a.length,console&&console.warn&&console.warn(f)}return t}function l(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else for(var f=u.length,l=p(u,f),r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}},a=!0;try{t[e](o,o.exports,n),a=!1}finally{a&&delete r[e]}return o.exports}n.ab="/ROOT/node_modules/next/dist/compiled/events/",e.exports=n(864)}()},77398,(t,e,r)=>{var n=t.i(67034),i=t.i(47167);!function(){var r={992:function(t){t.exports=function(t,r,n){if(t.filter)return t.filter(r,n);if(null==t||"function"!=typeof r)throw TypeError();for(var i=[],o=0;o-1?i(r):r}},139:function(t,e,r){"use strict";var n=r(212),i=r(192),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),f=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(f)try{f({},"a",{value:1})}catch(t){f=null}t.exports=function(t){var e=s(n,a,arguments);return u&&f&&u(e,"length").configurable&&f(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var c=function(){return s(n,o,arguments)};f?f(t.exports,"apply",{value:c}):t.exports.apply=c},181:function(t){"use strict";t.exports=EvalError},545:function(t){"use strict";t.exports=Error},22:function(t){"use strict";t.exports=RangeError},803:function(t){"use strict";t.exports=ReferenceError},182:function(t){"use strict";t.exports=SyntaxError},202:function(t){"use strict";t.exports=TypeError},284:function(t){"use strict";t.exports=URIError},144:function(t){var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,i){if("[object Function]"!==r.call(n))throw TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var a=0;a1&&"boolean"!=typeof e)throw new f('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=j(t),n=r.length>0?r[0]:"",i=L("%"+n+"%",e),o=i.name,a=i.value,s=!1,l=i.alias;l&&(n=l[0],R(r,O([0,1],l)));for(var c=1,h=!0;c=r.length){var m=d(a,p);a=(h=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[p]}else h=A(a,p),a=a[p];h&&!s&&(w[o]=a)}}return a}},14:function(t){"use strict";var e={__proto__:null,foo:{}},r=Object;t.exports=function(){return({__proto__:e}).foo===e.foo&&!(e instanceof r)}},942:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(773);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},773:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},115:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(832);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},832:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},270:function(t,e,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty;t.exports=r(212).call(n,i)},782:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},157:function(t){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,n=function(t){return(!e||!t||"object"!=typeof t||!(Symbol.toStringTag in t))&&"[object Arguments]"===r.call(t)},i=function(t){return!!n(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==r.call(t)&&"[object Function]"===r.call(t.callee)},o=function(){return n(arguments)}();n.isLegacyArguments=i,t.exports=o?n:i},391:function(t){"use strict";var e=Object.prototype.toString,r=Function.prototype.toString,n=/^\s*(?:function)?\*/,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,o=Object.getPrototypeOf,a=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(t){}}(),s=a?o(a):{};t.exports=function(t){return"function"==typeof t&&(!!n.test(r.call(t))||(i?o(t)===s:"[object GeneratorFunction]"===e.call(t)))}},994:function(e,r,n){"use strict";var i=n(144),o=n(349),a=n(256),s=a("Object.prototype.toString"),u=n(942)()&&"symbol"==typeof Symbol.toStringTag,f=o(),l=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1)}},369:function(t){t.exports=function(t){return t instanceof n.Buffer}},584:function(t,e,r){"use strict";var n=r(157),i=r(391),o=r(490),a=r(994);function s(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,f="undefined"!=typeof Symbol,l=s(Object.prototype.toString),c=s(Number.prototype.valueOf),h=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(f)var y=s(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function m(t){return"[object Map]"===l(t)}function b(t){return"[object Set]"===l(t)}function v(t){return"[object WeakMap]"===l(t)}function _(t){return"[object WeakSet]"===l(t)}function w(t){return"[object ArrayBuffer]"===l(t)}function S(t){return"undefined"!=typeof ArrayBuffer&&(w.working?w(t):t instanceof ArrayBuffer)}function k(t){return"[object DataView]"===l(t)}function E(t){return"undefined"!=typeof DataView&&(k.working?k(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||E(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},m.working="undefined"!=typeof Map&&m(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(m.working?m(t):t instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(b.working?b(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},_.working="undefined"!=typeof WeakSet&&_(new WeakSet),e.isWeakSet=function(t){return _(t)},w.working="undefined"!=typeof ArrayBuffer&&w(new ArrayBuffer),e.isArrayBuffer=S,k.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&k(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=E;var x="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(t){return"[object SharedArrayBuffer]"===l(t)}function O(t){return void 0!==x&&(void 0===A.working&&(A.working=A(new x)),A.working?A(t):t instanceof x)}function R(t){return g(t,c)}function C(t){return g(t,h)}function T(t){return g(t,d)}function I(t){return u&&g(t,p)}function B(t){return f&&g(t,y)}e.isSharedArrayBuffer=O,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=R,e.isStringObject=C,e.isBooleanObject=T,e.isBigIntObject=I,e.isSymbolObject=B,e.isBoxedPrimitive=function(t){return R(t)||C(t)||T(t)||I(t)||B(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(S(t)||O(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw Error(t+" is not supported in userland")}})})},177:function(t,e,r){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),h(n,t,n.depth)}function l(t,e){var r=f.styles[e];return r?"\x1b["+f.colors[r][0]+"m"+t+"\x1b["+f.colors[r][1]+"m":t}function c(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&!(r.constructor&&r.constructor.prototype===r)){var i,o,a,s,u,f,l=r.inspect(n,t);return v(l)||(l=h(t,l,n)),l}var c=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,r);if(c)return c;var S=Object.keys(r),A=(u={},S.forEach(function(t,e){u[t]=!0}),u);if(t.showHidden&&(S=Object.getOwnPropertyNames(r)),E(r)&&(S.indexOf("message")>=0||S.indexOf("description")>=0))return d(r);if(0===S.length){if(x(r)){var O=r.name?": "+r.name:"";return t.stylize("[Function"+O+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return t.stylize(Date.prototype.toString.call(r),"date");if(E(r))return d(r)}var R="",T=!1,I=["{","}"];if(y(r)&&(T=!0,I=["[","]"]),x(r)&&(R=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(R=" "+RegExp.prototype.toString.call(r)),k(r)&&(R=" "+Date.prototype.toUTCString.call(r)),E(r)&&(R=" "+d(r)),0===S.length&&(!T||0==r.length))return I[0]+R+I[1];if(n<0)if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");else return t.stylize("[Object]","special");return t.seen.push(r),f=T?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&s++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?a[0]+(""===o?"":o+"\n ")+" "+i.join(",\n ")+" "+a[1]:a[0]+o+" "+i.join(", ")+" "+a[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),C(n,i)||(a="["+i+"]"),!s&&(0>t.seen.indexOf(u.value)?(s=m(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),_(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function v(t){return"string"==typeof t}function _(t){return void 0===t}function w(t){return S(t)&&"[object RegExp]"===A(t)}function S(t){return"object"==typeof t&&null!==t}function k(t){return S(t)&&"[object Date]"===A(t)}function E(t){return S(t)&&("[object Error]"===A(t)||t instanceof Error)}function x(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function O(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(!a[t=t.toUpperCase()])if(s.test(t)){var r=i.default.pid;a[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else a[t]=function(){};return a[t]},e.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(584),e.isArray=y,e.isBoolean=g,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=_,e.isRegExp=w,e.types.isRegExp=w,e.isObject=S,e.isDate=k,e.types.isDate=k,e.isError=E,e.types.isNativeError=E,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(369);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[O((t=new Date).getHours()),O(t.getMinutes()),O(t.getSeconds())].join(":"),[t.getDate(),R[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(782),e._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');if(T&&t[T]){var e=t[T];if("function"!=typeof e)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),i=[],o=0;o{var n=t.i(47167);!function(){var r={782:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},646:function(t){"use strict";let e={};function r(t,r,n){n||(n=Error);class i extends n{constructor(t,e,n){super("string"==typeof r?r:r(t,e,n))}}i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(!Array.isArray(t))return"of ".concat(e," ").concat(String(t));{let r=t.length;return(t=t.map(t=>String(t)),r>2)?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,r){var i,o,a,s;let u,f;if("string"==typeof e&&(i="not ",e.substr(0,i.length)===i)?(u="must not be",e=e.replace(/^not /,"")):u="must be",o=" argument",(void 0===a||a>t.length)&&(a=t.length),t.substring(a-o.length,a)===o)f="The ".concat(t," ").concat(u," ").concat(n(e,"type"));else{let r=("number"!=typeof s&&(s=0),s+1>t.length||-1===t.indexOf(".",s))?"argument":"property";f='The "'.concat(t,'" ').concat(r," ").concat(u," ").concat(n(e,"type"))}return f+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},403:function(t,e,r){"use strict";var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=r(709),a=r(337);r(782)(l,o);for(var s=i(a.prototype),u=0;u0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===h.prototype||(o=e,e=h.from(o)),n)u.endEmitted?k(t,new S):R(t,u,e,!0);else if(u.ended)k(t,new _);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?R(t,u,e,!1):B(t,u)):R(t,u,e,!1)}else n||(u.reading=!1,B(t,u));return!u.ended&&(u.lengthe.highWaterMark&&((r=t)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r),t<=e.length)?t:e.ended?e.length:(e.needReadable=!0,0)}function T(t){var e=t._readableState;a("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(a("emitReadable",e.flowing),e.emittedReadable=!0,n.default.nextTick(I,t))}function I(t){var e=t._readableState;a("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,z(t)}function B(t,e){e.readingMore||(e.readingMore=!0,n.default.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){a("readable nexttick read 0"),t.read(0)}function U(t,e){a("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),z(t),e.flowing&&!e.reading&&t.read(0)}function z(t){var e=t._readableState;for(a("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){var r;return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r)}function N(t){var e=t._readableState;a("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.default.nextTick(F,e,t))}function F(t,e){if(a("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function M(t,e){for(var r=0,n=t.length;r=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?N(this):T(this),null;if(0===(t=C(t,r))&&r.ended)return 0===r.length&&N(this),null;var i=r.needReadable;return a("need readable",i),(0===r.length||r.length-t0?D(t,r):null)?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==t&&r.ended&&N(this)),null!==e&&this.emit("data",e),e},A.prototype._read=function(t){k(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r,i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,a("pipe count=%d opts=%j",o.pipesCount,e);var s=e&&!1===e.end||t===n.default.stdout||t===n.default.stderr?g:u;function u(){a("onend"),t.end()}o.endEmitted?n.default.nextTick(s):i.once("end",s),t.on("unpipe",function e(r,n){a("onunpipe"),r===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,a("cleanup"),t.removeListener("close",p),t.removeListener("finish",y),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",e),i.removeListener("end",u),i.removeListener("end",g),i.removeListener("data",h),c=!0,o.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&f())});var f=(r=i,function(){var t=r._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&l(r,"data")&&(t.flowing=!0,z(r))});t.on("drain",f);var c=!1;function h(e){a("ondata");var r=t.write(e);a("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==M(o.pipes,t))&&!c&&(a("false write response, pause",o.awaitDrain),o.awaitDrain++),i.pause())}function d(e){a("onerror",e),g(),t.removeListener("error",d),0===l(t,"error")&&k(t,e)}function p(){t.removeListener("finish",y),g()}function y(){a("onfinish"),t.removeListener("close",p),g()}function g(){a("unpipe"),i.unpipe(t)}return i.on("data",h),!function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",y),t.emit("pipe",i),o.flowing||(a("pipe resume"),i.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"!==t||i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,a("on readable",i.length,i.reading),i.length?T(this):i.reading||n.default.nextTick(L,this)),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=c.prototype.removeListener.call(this,t,e);return"readable"===t&&n.default.nextTick(j,this),r},A.prototype.removeAllListeners=function(t){var e=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&n.default.nextTick(j,this),e},A.prototype.resume=function(){var t,e,r=this._readableState;return r.flowing||(a("resume"),r.flowing=!r.readableListening,t=this,(e=r).resumeScheduled||(e.resumeScheduled=!0,n.default.nextTick(U,t,e))),r.paused=!1,this},A.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){if(a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!=i)(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new S(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new g("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var i,o,a,s=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),s.corked&&(s.corked=1,this.uncork()),s.ending||(i=this,o=s,a=r,o.ending=!0,B(i,o),a&&(o.finished?n.default.nextTick(a):i.once("finish",a)),o.ended=!0,i.writable=!1),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=h.destroy,A.prototype._undestroy=h.undestroy,A.prototype._destroy=function(t,e){e(t)}},871:function(t,e,r){"use strict";function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o,a=r(698),s=Symbol("lastResolve"),u=Symbol("lastReject"),f=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function y(t){var e=t[s];if(null!==e){var r=t[d].read();null!==r&&(t[c]=null,t[s]=null,t[u]=null,e(p(r,!1)))}}function g(t){n.default.nextTick(y,t)}var m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((i(o={get stream(){return this[d]},next:function(){var t,e,r=this,i=this[f];if(null!==i)return Promise.reject(i);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(t,e){n.default.nextTick(function(){r[f]?e(r[f]):t(p(void 0,!0))})});var o=this[c];if(o)e=new Promise((t=this,function(e,r){o.then(function(){if(t[l])return void e(p(void 0,!0));t[h](e,r)},r)}));else{var a=this[d].read();if(null!==a)return Promise.resolve(p(a,!1));e=new Promise(this[h])}return this[c]=e,e}},Symbol.asyncIterator,function(){return this}),i(o,"return",function(){var t=this;return new Promise(function(e,r){t[d].destroy(null,function(t){if(t)return void r(t);e(p(void 0,!0))})})}),o),m);t.exports=function(t){var e,r=Object.create(b,(i(e={},d,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,u,{value:null,writable:!0}),i(e,f,{value:null,writable:!0}),i(e,l,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var n=r[d].read();n?(r[c]=null,r[s]=null,r[u]=null,t(p(n,!1))):(r[s]=t,r[u]=e)},writable:!0}),e));return r[c]=null,a(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];null!==e&&(r[c]=null,r[s]=null,r[u]=null,e(t)),r[f]=t;return}var n=r[s];null!==n&&(r[c]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0}),t.on("readable",g.bind(null,r)),r}},379:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}var i=r(300).Buffer,o=r(837).inspect,a=o&&o.custom||"inspect";t.exports=function(){var t;function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return t=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return i.alloc(0);for(var e,r,n=i.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=a,i.prototype.copy.call(e,n,r),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=i.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(o.copy(e,e.length-t,0,a),0==(t-=a)){a===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++n}return this.length-=n,e}},{key:a,value:function(t,e){return o(this,function(t){for(var e=1;e0,f=s=function(t){e||(e=t),t&&d.forEach(u),g||(d.forEach(u),h(e))},c=!1,s=function(){c||(c=!0,f.apply(void 0,arguments))},p=!1,t.on("close",function(){p=!0}),void 0===n&&(n=r(698)),n(t,{readable:g,writable:o},function(t){if(t)return s(t);p=!0,s()}),y=!1,function(e){if(!p&&!y){if(y=!0,t.setHeader&&"function"==typeof t.abort)return t.abort();if("function"==typeof t.destroy)return t.destroy();s(e||new a("pipe"))}}});return l.reduce(f)}},776:function(t,e,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=null!=e.highWaterMark?e.highWaterMark:i?e[r]:null;if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},678:function(t,e,r){t.exports=r(781)},55:function(t,e,r){var n=r(300),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n.SlowBuffer(t)}},173:function(t,e,r){t.exports=i;var n=r(361).EventEmitter;function i(){n.call(this)}r(782)(i,n),i.Readable=r(709),i.Writable=r(337),i.Duplex=r(403),i.Transform=r(170),i.PassThrough=r(889),i.finished=r(698),i.pipeline=r(442),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(l(),0===n.listenerCount(this,"error"))throw t}function l(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",l),r.removeListener("close",l),t.removeListener("close",l)}return r.on("error",f),t.on("error",f),r.on("end",l),r.on("close",l),t.on("close",l),t.emit("pipe",r),t}},704:function(t,e,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){var e;if(!t)return"utf8";for(;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=l,this.end=c,e=3;break;default:this.write=h,this.end=d;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if((192&e[0])!=128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((192&e[1])!=128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(192&e[2])!=128)return t.lastNeed=2,"�"}}(this,t,0);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length)}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){var e,r;if(0===t.length)return"";if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},769:function(e){e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}};function r(e){try{if(!t.g.localStorage)return!1}catch(t){return!1}var r=t.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}},300:function(e){"use strict";e.exports=t.r(43943)},361:function(e){"use strict";e.exports=t.r(30662)},781:function(e){"use strict";e.exports=t.r(30662).EventEmitter},837:function(e){"use strict";e.exports=t.r(77398)}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var n=i[t]={exports:{}},a=!0;try{r[t](n,n.exports,o),a=!1}finally{a&&delete i[t]}return n.exports}o.ab="/ROOT/node_modules/next/dist/compiled/stream-browserify/",e.exports=o(173)}()},31032,(t,e,r)=>{"use strict";e.exports=t.r(12569)},87780,(t,e,r)=>{"use strict";var n=t.i(67034);if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer=void 0!==n.Buffer,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var i=new ArrayBuffer(0);try{r.blob=0===new Blob([i],{type:"application/zip"}).size}catch(t){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),r.blob=0===o.getBlob("application/zip").size}catch(t){r.blob=!1}}}try{r.nodestream=!!t.r(31032).Readable}catch(t){r.nodestream=!1}},55951,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(87780),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(t){for(var e,r,i,a,s,u,f,l=[],c=0,h=t.length,d=h,p="string"!==n.getTypeOf(t);c>2,s=(3&e)<<4|r>>4,u=d>1?(15&r)<<2|i>>6:64,f=d>2?63&i:64,l.push(o.charAt(a)+o.charAt(s)+o.charAt(u)+o.charAt(f));return l.join("")},r.decode=function(t){var e,r,n,a,s,u,f,l,c=0,h=0,d="data:";if(t.substr(0,d.length)===d)throw Error("Invalid base64 input, it looks like a data url.");var p=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===o.charAt(64)&&p--,t.charAt(t.length-2)===o.charAt(64)&&p--,p%1!=0)throw Error("Invalid base64 input, bad content length.");for(l=i.uint8array?new Uint8Array(0|p):Array(0|p);c>4,r=(15&s)<<4|u>>2,n=(3&u)<<6|f,l[h++]=e,64!==u&&(l[h++]=r),64!==f&&(l[h++]=n);return l}},42527,(t,e,r)=>{"use strict";var n=t.i(67034);e.exports={isNode:void 0!==n.Buffer,newBufferFrom:function(t,e){if(n.Buffer.from&&n.Buffer.from!==Uint8Array.from)return n.Buffer.from(t,e);if("number"==typeof t)throw Error('The "data" argument must not be a number');return new n.Buffer(t,e)},allocBuffer:function(t){if(n.Buffer.alloc)return n.Buffer.alloc(t);var e=new n.Buffer(t);return e.fill(0),e},isBuffer:function(t){return n.Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},27024,(t,e,r)=>{"use strict";var n,i,o=t.g.MutationObserver||t.g.WebKitMutationObserver;if(o){var a=0,s=new o(c),u=t.g.document.createTextNode("");s.observe(u,{characterData:!0}),n=function(){u.data=a=++a%2}}else if(t.g.setImmediate||void 0===t.g.MessageChannel)n="document"in t.g&&"onreadystatechange"in t.g.document.createElement("script")?function(){var e=t.g.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.g.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var f=new t.g.MessageChannel;f.port1.onmessage=c,n=function(){f.port2.postMessage(0)}}var l=[];function c(){i=!0;for(var t,e,r=l.length;r;){for(e=l,l=[],t=-1;++t{"use strict";var n=t.r(27024);function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function f(t){if("function"!=typeof t)throw TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==i&&d(this,t)}function l(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function c(t,e,r){n(function(){var n;try{n=e(r)}catch(e){return o.reject(t,e)}n===t?o.reject(t,TypeError("Cannot resolve promise with itself")):o.resolve(t,n)})}function h(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,o.reject(t,e))}function i(e){r||(r=!0,o.resolve(t,e))}var a=p(function(){e(i,n)});"error"===a.status&&n(a.value)}function p(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}e.exports=f,f.prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then(function(r){return e.resolve(t()).then(function(){return r})},function(r){return e.resolve(t()).then(function(){throw r})})},f.prototype.catch=function(t){return this.then(null,t)},f.prototype.then=function(t,e){if("function"!=typeof t&&this.state===s||"function"!=typeof e&&this.state===a)return this;var r=new this.constructor(i);return this.state!==u?c(r,this.state===s?t:e,this.outcome):this.queue.push(new l(r,t,e)),r},l.prototype.callFulfilled=function(t){o.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){c(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){o.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){c(this.promise,this.onRejected,t)},o.resolve=function(t,e){var r=p(h,e);if("error"===r.status)return o.reject(t,r.value);var n=r.value;if(n)d(t,n);else{t.state=s,t.outcome=e;for(var i=-1,a=t.queue.length;++i{"use strict";e.exports={Promise:"undefined"!=typeof Promise?Promise:t.r(22998)}},83986,(t,e,r)=>{var n=t.i(47167);"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/next/dist/compiled/setimmediate/"),({189:function(){!function(t,e){"use strict";if(!t.setImmediate){var r,i,o,a,s,u=1,f={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"===({}).toString.call(t.process)?s=function(t){n.default.nextTick(function(){p(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(r="setImmediate$"+Math.random()+"$",i=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&p(+e.data.slice(r.length))},t.addEventListener?t.addEventListener("message",i,!1):t.attachEvent("onmessage",i),s=function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},s=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(a=c.documentElement,s=function(t){var e=c.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,a.removeChild(e),e=null},a.appendChild(e)}):s=function(t){setTimeout(p,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=Function(""+t));for(var e=Array(arguments.length-1),r=0;r{"use strict";var n=t.r(87780),i=t.r(55951),o=t.r(42527),a=t.r(24375);function s(t){return t}function u(t,e){for(var r=0;r1;)try{return f.stringifyByChunk(t,n,e)}catch(t){e=Math.floor(e/2)}return f.stringifyByChar(t)}function c(t,e){for(var r=0;r{"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=n},46253,(t,e,r)=>{"use strict";for(var n=t.r(65464),i=t.r(87780),o=t.r(42527),a=t.r(48913),s=Array(256),u=0;u<256;u++)s[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;s[254]=s[254]=1;var f=function(t){var e,r,n,o,a,s=t.length,u=0;for(o=0;o>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e},l=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&(192&t[r])==128;)r--;return r<0||0===r?e:r+s[t[r]]>e?r:e},c=function(t){var e,r,i,o,a=t.length,u=Array(2*a);for(r=0,e=0;e4){u[r++]=65533,e+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&e1){u[r++]=65533;continue}i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)};function h(){a.call(this,"utf-8 decode"),this.leftOver=null}function d(){a.call(this,"utf-8 encode")}r.utf8encode=function(t){return i.nodebuffer?o.newBufferFrom(t,"utf-8"):f(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):c(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(h,a),h.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=e;(e=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),e.set(o,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var a=l(e),s=e;a!==e.length&&(i.uint8array?(s=e.subarray(0,a),this.leftOver=e.subarray(a,e.length)):(s=e.slice(0,a),this.leftOver=e.slice(a,e.length))),this.push({data:r.utf8decode(s),meta:t.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=h,n.inherits(d,a),d.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=d},60550,(t,e,r)=>{"use strict";var n=t.r(48913),i=t.r(65464);function o(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(o,n),o.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=o},61714,(t,e,r)=>{"use strict";var n=t.r(31032).Readable;function i(t,e,r){n.call(this,e),this._helper=t;var i=this;t.on("data",function(t,e){i.push(t)||i._helper.pause(),r&&r(e)}).on("error",function(t){i.emit("error",t)}).on("end",function(){i.push(null)})}t.r(65464).inherits(i,n),i.prototype._read=function(){this._helper.resume()},e.exports=i},846,(t,e,r)=>{"use strict";var n=t.i(67034),i=t.r(65464),o=t.r(60550),a=t.r(48913),s=t.r(55951),u=t.r(87780),f=t.r(24375),l=null;if(u.nodestream)try{l=t.r(61714)}catch(t){}function c(t,e,r){var n=e;switch(e){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=e,this._mimeType=r,i.checkSupport(n),this._worker=t.pipe(new o(n)),t.lock()}catch(t){this._worker=new a("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){var e;return e=this,new f.Promise(function(r,o){var a=[],u=e._internalType,f=e._outputType,l=e._mimeType;e.on("data",function(e,r){a.push(e),t&&t(r)}).on("error",function(t){a=[],o(t)}).on("end",function(){try{var t=function(t,e,r){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),r);case"base64":return s.encode(e);default:return i.transformTo(t,e)}}(f,function(t,e){var r,i=0,o=null,a=0;for(r=0;r{"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},25625,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},63494,(t,e,r)=>{"use strict";var n=t.r(65464),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?0xedb88320^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r,n){var o=0+r;t^=-1;for(var a=0;a>>8^i[(t^e[a])&255];return -1^t}(0|e,t,t.length,0):function(t,e,r,n){var o=0+r;t^=-1;for(var a=0;a>>8^i[(t^e.charCodeAt(a))&255];return -1^t}(0|e,t,t.length,0):0}},1648,(t,e,r)=>{"use strict";var n=t.r(48913),i=t.r(63494);function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t.r(65464).inherits(o,n),o.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=o},41087,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(o,i),o.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=o},43220,(t,e,r)=>{"use strict";var n=t.r(24375),i=t.r(25625),o=t.r(1648),a=t.r(41087);function s(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}s.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(t,e,r){return t.pipe(new o).pipe(new a("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=s},52929,(t,e,r)=>{"use strict";var n=t.r(846),i=t.r(25625),o=t.r(46253),a=t.r(43220),s=t.r(48913),u=function(t,e,r){this.name=t,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=e,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};u.prototype={internalStream:function(t){var e=null,r="string";try{if(!t)throw Error("No output type specified.");r=t.toLowerCase();var i="string"===r||"text"===r;("binarystring"===r||"text"===r)&&(r="string"),e=this._decompressWorker();var a=!this._dataBinary;a&&!i&&(e=e.pipe(new o.Utf8EncodeWorker)),!a&&i&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(t){(e=new s("error")).error(t)}return new n(e,r,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof a&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new o.Utf8EncodeWorker)),a.createWorkerFrom(r,t,e)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof s?this._data:new i(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw TypeError(r+"must be non-object");for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)return void t.set(e.subarray(r,r+n),i);for(var o=0;o{"use strict";var n,i,o,a=t.r(79148);function s(t){for(var e=t.length;--e>=0;)t[e]=0}var u=573,f=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=Array(576);s(d);var p=Array(60);s(p);var y=Array(512);s(y);var g=Array(256);s(g);var m=Array(29);s(m);var b=Array(30);function v(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function _(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function w(t){return t<256?y[t]:y[256+(t>>>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function k(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0)return r>>>1}function A(t,e,r){var n,i,o=Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=x(o[s]++,s))}}function O(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function R(t){t.bi_valid>8?S(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function C(t,e,r,n){var i=2*e,o=2*r;return t[i]>1;r>=1;r--)T(t,o,r);i=f;do r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],T(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,T(t,o,1);while(t.heap_len>=2)t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,f=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,y=e.stat_desc.max_length,g=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(f[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;ry&&(o=y,g++),f[2*n+1]=o,!(n>l)&&(t.bl_count[o]++,a=0,n>=p&&(a=d[n-p]),s=f[2*n],t.opt_len+=s*(o+a),h&&(t.static_len+=s*(c[2*n+1]+a)));if(0!==g){do{for(o=y-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[y]--,g-=2}while(g>0)for(o=y;0!==o;o--)for(n=t.bl_count[o];0!==n;)!((i=t.heap[--r])>l)&&(f[2*i+1]!==o&&(t.opt_len+=(o-f[2*i+1])*f[2*i],f[2*i+1]=o),n--)}}(t,e),A(o,l,t.bl_count)}function P(t,e,r){var n,i,o=-1,a=e[1],s=0,u=7,f=4;for(0===a&&(u=138,f=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)i=a,a=e[(n+1)*2+1],++s>=7;a<30;a++)for(t=0,b[a]=s<<7;t<1<0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=0xf3ffc07f;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),a=function(t){var e;for(P(t,t.dyn_ltree,t.l_desc.max_code),P(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?U(t,e,r,n):4===t.strategy||o===i?(k(t,2+ +!!n,3),I(t,d,p)):(k(t,4+ +!!n,3),function(t,e,r,n){var i;for(k(t,e-257,5),k(t,r-1,5),k(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[(g[r]+256+1)*2]++,t.dyn_dtree[2*w(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){k(t,2,3),E(t,256,d),16===t.bi_valid?(S(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},74049,(t,e,r)=>{"use strict";e.exports=function(t,e,r,n){for(var i=65535&t,o=t>>>16&65535,a=0;0!==r;){a=r>2e3?2e3:r,r-=a;do o=o+(i=i+e[n++]|0)|0;while(--a)i%=65521,o%=65521}return i|o<<16}},63327,(t,e,r)=>{"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?0xedb88320^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var o=i+r;t^=-1;for(var a=i;a>>8^n[(t^e[a])&255];return -1^t}},19558,(t,e,r)=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},79674,(t,e,r)=>{"use strict";var n,i=t.r(79148),o=t.r(94333),a=t.r(74049),s=t.r(63327),u=t.r(19558),f=573;function l(t,e){return t.msg=u[e],e}function c(t){return(t<<1)-9*(t>4)}function h(t){for(var e=t.length;--e>=0;)t[e]=0}function d(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function p(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,d(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function g(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function m(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,f=t.window,l=t.w_mask,c=t.prev,h=t.strstart+258,d=f[o+a-1],p=f[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(f[(r=e)+a]!==p||f[r+a-1]!==d||f[r]!==f[o]||f[++r]!==f[o+1])continue;o+=2,r++;do;while(f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&oa){if(t.match_start=e,a=n,n>=s)break;d=f[o+a-1],p=f[o+a]}}while((e=c[e&l])>u&&0!=--i)return a<=t.lookahead?a:t.lookahead}function b(t){var e,r,n,o,u,f=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-262)){i.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;do n=t.head[--e],t.head[e]=n>=f?n-f:0;while(--r)e=r=f;do n=t.prev[--e],t.prev[e]=n>=f?n-f:0;while(--r)o+=f}if(0===t.strm.avail_in)break;if(r=function(t,e,r,n){var o=t.avail_in;return(o>n&&(o=n),0===o)?0:(t.avail_in-=o,i.arraySet(e,t.input,t.next_in,o,r),1===t.state.wrap?t.adler=a(t.adler,e,o,r):2===t.state.wrap&&(t.adler=s(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=r,t.lookahead+t.insert>=3)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<15&&(s=2,n-=16),o<1||o>9||8!==r||n<8||n>15||e<0||e>9||a<0||a>4)return l(t,-2);8===n&&(n=9);var u=new S;return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(b(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,p(t,!1),0===t.strm.avail_out)||t.strstart-t.block_start>=t.w_size-262&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:(t.strstart>t.block_start&&(p(t,!1),t.strm.avail_out),1)}),new w(4,4,8,4,v),new w(4,5,16,8,v),new w(4,6,32,32,v),new w(4,4,16,16,_),new w(8,16,32,32,_),new w(8,16,128,128,_),new w(8,32,128,256,_),new w(32,128,258,1024,_),new w(32,258,258,4096,_)],r.deflateInit=function(t,e){return x(t,e,8,15,8,0)},r.deflateInit2=x,r.deflateReset=E,r.deflateResetKeep=k,r.deflateSetHeader=function(t,e){return t&&t.state&&2===t.state.wrap?(t.state.gzhead=e,0):-2},r.deflate=function(t,e){if(!t||!t.state||e>5||e<0)return t?l(t,-2):-2;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return l(t,0===t.avail_out?-5:-2);if(i.strm=t,r=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,y(i,31),y(i,139),y(i,8),i.gzhead?(y(i,+!!i.gzhead.text+2*!!i.gzhead.hcrc+4*!!i.gzhead.extra+8*!!i.gzhead.name+16*!!i.gzhead.comment),y(i,255&i.gzhead.time),y(i,i.gzhead.time>>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:4*(i.strategy>=2||i.level<2)),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:4*(i.strategy>=2||i.level<2)),y(i,3),i.status=113);else{var r,i,a,u,f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=113,g(i,f),0!==i.strstart&&(g(i,t.adler>>>16),g(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&d(t),i.pending+2<=i.pending_buf_size&&(y(i,255&t.adler),y(i,t.adler>>8&255),t.adler=0,i.status=113)):i.status=113),0!==i.pending){if(d(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&c(e)<=c(r)&&4!==e)return l(t,-5);if(666===i.status&&0!==t.avail_in)return l(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var m=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(b(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=258){if(b(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+258;do;while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if((3===m||4===m)&&(i.status=666),1===m||3===m)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===m&&(1===e?o._tr_align(i):5!==e&&(o._tr_stored_block(i,0,0,!1),3===e&&(h(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),d(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&t.adler),y(i,t.adler>>8&255),y(i,t.adler>>16&255),y(i,t.adler>>24&255),y(i,255&t.total_in),y(i,t.total_in>>8&255),y(i,t.total_in>>16&255),y(i,t.total_in>>24&255)):(g(i,t.adler>>>16),g(i,65535&t.adler)),d(t),i.wrap>0&&(i.wrap=-i.wrap),+(0===i.pending))},r.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?l(t,-2):(t.state=null,113===e?l(t,-3):0):-2},r.deflateSetDictionary=function(t,e){var r,n,o,s,u,f,l,c,d=e.length;if(!t||!t.state||2===(s=(r=t.state).wrap)||1===s&&42!==r.status||r.lookahead)return -2;for(1===s&&(t.adler=a(t.adler,e,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(h(r.head),r.strstart=0,r.block_start=0,r.insert=0),c=new i.Buf8(r.w_size),i.arraySet(c,e,d-r.w_size,r.w_size,0),e=c,d=r.w_size),u=t.avail_in,f=t.next_in,l=t.input,t.avail_in=d,t.next_in=0,t.input=e,b(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do r.ins_h=(r.ins_h<{"use strict";var n=t.r(79148),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",a=0;a>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e},r.buf2binstring=function(t){return u(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r4){f[n++]=65533,r+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&r1){f[n++]=65533;continue}i<65536?f[n++]=i:(i-=65536,f[n++]=55296|i>>10&1023,f[n++]=56320|1023&i)}return u(f,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&(192&t[r])==128;)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}},98899,(t,e,r)=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},48901,(t,e,r)=>{"use strict";var n=t.r(79674),i=t.r(79148),o=t.r(63202),a=t.r(19558),s=t.r(98899),u=Object.prototype.toString;function f(t){if(!(this instanceof f))return new f(t);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e,r=this.options;r.raw&&r.windowBits>0?r.windowBits=-r.windowBits:r.gzip&&r.windowBits>0&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var l=n.deflateInit2(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy);if(0!==l)throw Error(a[l]);if(r.header&&n.deflateSetHeader(this.strm,r.header),r.dictionary){if(e="string"==typeof r.dictionary?o.string2buf(r.dictionary):"[object ArrayBuffer]"===u.call(r.dictionary)?new Uint8Array(r.dictionary):r.dictionary,0!==(l=n.deflateSetDictionary(this.strm,e)))throw Error(a[l]);this._dict_set=!0}}function l(t,e){var r=new f(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(t,e){var r,a,s=this.strm,f=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:4*(!0===e),"string"==typeof t?s.input=o.string2buf(t):"[object ArrayBuffer]"===u.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(f),s.next_out=0,s.avail_out=f),1!==(r=n.deflate(s,a))&&0!==r)return this.onEnd(r),this.ended=!0,!1;(0===s.avail_out||0===s.avail_in&&(4===a||2===a))&&("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r)return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):(2===a&&(this.onEnd(0),s.avail_out=0),!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Deflate=f,r.deflate=l,r.deflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},r.gzip=function(t,e){return(e=e||{}).gzip=!0,l(t,e)}},75531,(t,e,r)=>{"use strict";e.exports=function(t,e){var r,n,i,o,a,s,u,f,l,c,h,d,p,y,g,m,b,v,_,w,S,k,E,x,A;r=t.state,n=t.next_in,x=t.input,i=n+(t.avail_in-5),o=t.next_out,A=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),u=r.dmax,f=r.wsize,l=r.whave,c=r.wnext,h=r.window,d=r.hold,p=r.bits,y=r.lencode,g=r.distcode,m=(1<>>=_=v>>>24,p-=_,0==(_=v>>>16&255))A[o++]=65535&v;else if(16&_)for(w=65535&v,(_&=15)&&(p<_&&(d+=x[n++]<>>=_,p-=_),p<15&&(d+=x[n++]<>>=_=v>>>24,p-=_,16&(_=v>>>16&255)){if(S=65535&v,p<(_&=15)&&(d+=x[n++]<u){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=_,p-=_,S>(_=o-a)){if((_=S-_)>l&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(k=0,E=h,0===c){if(k+=f-_,_2;)A[o++]=E[k++],A[o++]=E[k++],A[o++]=E[k++],w-=3;w&&(A[o++]=E[k++],w>1&&(A[o++]=E[k++]))}else{k=o-S;do A[o++]=A[k++],A[o++]=A[k++],A[o++]=A[k++],w-=3;while(w>2)w&&(A[o++]=A[k++],w>1&&(A[o++]=A[k++]))}}else if((64&_)==0){v=g[(65535&v)+(d&(1<<_)-1)];continue}else{t.msg="invalid distance code",r.mode=30;break t}break}else if((64&_)==0){v=y[(65535&v)+(d&(1<<_)-1)];continue}else if(32&_){r.mode=12;break t}else{t.msg="invalid literal/length code",r.mode=30;break t}break}while(n>3,p-=w<<3,d&=(1<{"use strict";var n=t.r(79148),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,r,u,f,l,c,h){var d,p,y,g,m,b,v,_,w,S=h.bits,k=0,E=0,x=0,A=0,O=0,R=0,C=0,T=0,I=0,B=0,P=null,j=0,L=new n.Buf16(16),U=new n.Buf16(16),z=null,D=0;for(k=0;k<=15;k++)L[k]=0;for(E=0;E=1&&0===L[A];A--);if(O>A&&(O=A),0===A)return f[l++]=0x1400000,f[l++]=0x1400000,h.bits=1,0;for(x=1;x0&&(0===t||1!==A))return -1;for(k=1,U[1]=0;k<15;k++)U[k+1]=U[k]+L[k];for(E=0;E852||2===t&&I>592)return 1;for(;;){v=k-C,c[E]b?(_=z[D+c[E]],w=P[j+c[E]]):(_=96,w=0),d=1<>C)+(p-=d)]=v<<24|_<<16|w;while(0!==p)for(d=1<>=1;if(0!==d?(B&=d-1,B+=d):B=0,E++,0==--L[k]){if(k===A)break;k=e[r+c[E]]}if(k>O&&(B&g)!==y){for(0===C&&(C=O),m+=x,T=1<<(R=k-C);R+C852||2===t&&I>592)return 1;f[y=B&g]=O<<24|R<<16|m-l}}return 0!==B&&(f[m+B]=k-C<<24|4194304),h.bits=O,0}},57235,(t,e,r)=>{"use strict";var n,i,o=t.r(79148),a=t.r(74049),s=t.r(63327),u=t.r(75531),f=t.r(73012);function l(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new o.Buf32(852),e.distcode=e.distdyn=new o.Buf32(592),e.sane=1,e.back=-1,0):-2}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,h(t)):-2}function p(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,d(t)):-2}function y(t,e){var r,n;return t?(t.state=n=new c,n.window=null,0!==(r=p(t,e))&&(t.state=null),r):-2}var g=!0;function m(t,e,r,n){var i,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(o.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),o.arraySet(a.window,e,r-n,i,a.wnext),(n-=i)?(o.arraySet(a.window,e,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=s(r.check,z,2,0),v=0,_=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){t.msg="incorrect header check",r.mode=30;break}if((15&v)!=8){t.msg="unknown compression method",r.mode=30;break}if(v>>>=4,_-=4,B=(15&v)+8,0===r.wbits)r.wbits=B;else if(B>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0,r.mode=3;case 3:for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.head&&(r.head.time=v),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,z[2]=v>>>16&255,z[3]=v>>>24&255,r.check=s(r.check,z,4,0)),v=0,_=0,r.mode=4;case 4:for(;_<16;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.head&&(r.head.xflags=255&v,r.head.os=v>>8),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0,r.mode=5;case 5:if(1024&r.flags){for(;_<16;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.length=v,r.head&&(r.head.extra_len=v),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((k=r.length)>y&&(k=y),k&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),o.arraySet(r.head.extra,c,d,k,B)),512&r.flags&&(r.check=s(r.check,c,k,d)),y-=k,d+=k,r.length-=k),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===y)break e;k=0;do B=c[d+k++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B));while(B&&k>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}t.adler=r.check=l(v),v=0,_=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,2;t.adler=r.check=1,r.mode=12;case 12:if(5===e||6===e)break e;case 13:if(r.last){v>>>=7&_,_-=7&_,r.mode=27;break}for(;_<3;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}switch(r.last=1&v,_-=1,3&(v>>>=1)){case 0:r.mode=14;break;case 1:if(!function(t){if(g){var e;for(n=new o.Buf32(512),i=new o.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(f(1,t.lens,0,288,n,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;f(2,t.lens,0,32,i,0,t.work,{bits:5}),g=!1}t.lencode=n,t.lenbits=9,t.distcode=i,t.distbits=5}(r),r.mode=20,6===e){v>>>=2,_-=2;break e}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}v>>>=2,_-=2;break;case 14:for(v>>>=7&_,_-=7&_;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if((65535&v)!=(v>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&v,v=0,_=0,r.mode=15,6===e)break e;case 15:r.mode=16;case 16:if(k=r.length){if(k>y&&(k=y),k>b&&(k=b),0===k)break e;o.arraySet(h,c,d,k,p),y-=k,d+=k,b-=k,p+=k,r.length-=k;break}r.mode=12;break;case 17:for(;_<14;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(r.nlen=(31&v)+257,_-=5,r.ndist=(31&(v>>>=5))+1,_-=5,r.ncode=(15&(v>>>=5))+4,v>>>=4,_-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,_-=3}for(;r.have<19;)r.lens[D[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},P=f(0,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,P){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(R<16)v>>>=A,_-=A,r.lens[r.have++]=R;else{if(16===R){for(L=A+2;_>>=A,_-=A,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}B=r.lens[r.have-1],k=3+(3&v),v>>>=2,_-=2}else if(17===R){for(L=A+3;_>>=A,_-=A,B=0,k=3+(7&v),v>>>=3,_-=3}else{for(L=A+7;_>>=A,_-=A,B=0,k=11+(127&v),v>>>=7,_-=7}if(r.have+k>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;k--;)r.lens[r.have++]=B}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,j={bits:r.lenbits},P=f(1,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,P){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},P=f(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,P){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break e;case 20:r.mode=21;case 21:if(y>=6&&b>=258){t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,u(t,S),p=t.next_out,h=t.output,b=t.avail_out,d=t.next_in,c=t.input,y=t.avail_in,v=r.hold,_=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;A=(U=r.lencode[v&(1<>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(O&&(240&O)==0){for(C=A,T=O,I=R;A=(U=r.lencode[I+((v&(1<>C)])>>>24,O=U>>>16&255,R=65535&U,!(C+A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}v>>>=C,_-=C,r.back+=C}if(v>>>=A,_-=A,r.back+=A,r.length=R,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=12;break}if(64&O){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(L=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(U=r.distcode[v&(1<>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if((240&O)==0){for(C=A,T=O,I=R;A=(U=r.distcode[I+((v&(1<>C)])>>>24,O=U>>>16&255,R=65535&U,!(C+A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}v>>>=C,_-=C,r.back+=C}if(v>>>=A,_-=A,r.back+=A,64&O){t.msg="invalid distance code",r.mode=30;break}r.offset=R,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(L=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===b)break e;if(k=S-b,r.offset>k){if((k=r.offset-k)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}k>r.wnext?(k-=r.wnext,E=r.wsize-k):E=r.wnext-k,k>r.length&&(k=r.length),x=r.window}else x=h,E=p-r.offset,k=r.length;k>b&&(k=b),b-=k,r.length-=k;do h[p++]=x[E++];while(--k)0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;h[p++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;_<32;){if(0===y)break e;y--,v|=c[d++]<<_,_+=8}if(S-=b,t.total_out+=S,r.total+=S,S&&(t.adler=r.check=r.flags?s(r.check,h,S,p-S):a(r.check,h,S,p-S)),S=b,(r.flags?v:l(v))!==r.check){t.msg="incorrect data check",r.mode=30;break}v=0,_=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(v!==(0|r.total)){t.msg="incorrect length check",r.mode=30;break}v=0,_=0}r.mode=29;case 29:P=1;break e;case 30:P=-3;break e;case 31:return -4;default:return -2}return t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,(r.wsize||S!==t.avail_out&&r.mode<30&&(r.mode<27||4!==e))&&m(t,t.output,t.next_out,S-t.avail_out),w-=t.avail_in,S-=t.avail_out,t.total_in+=w,t.total_out+=S,r.total+=S,r.wrap&&S&&(t.adler=r.check=r.flags?s(r.check,h,S,t.next_out-S):a(r.check,h,S,t.next_out-S)),t.data_type=r.bits+64*!!r.last+128*(12===r.mode)+256*(20===r.mode||15===r.mode),(0===w&&0===S||4===e)&&0===P&&(P=-5),P},r.inflateEnd=function(t){if(!t||!t.state)return -2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},r.inflateGetHeader=function(t,e){var r;return t&&t.state&&(2&(r=t.state).wrap)!=0?(r.head=e,e.done=!1,0):-2},r.inflateSetDictionary=function(t,e){var r,n=e.length;return t&&t.state&&(0===(r=t.state).wrap||11===r.mode)?11===r.mode&&a(1,e,n,0)!==r.check?-3:m(t,e,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},r.inflateInfo="pako inflate (from Nodeca project)"},34131,(t,e,r)=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},24448,(t,e,r)=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},82473,(t,e,r)=>{"use strict";var n=t.r(57235),i=t.r(79148),o=t.r(63202),a=t.r(34131),s=t.r(19558),u=t.r(98899),f=t.r(24448),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits)==0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==a.Z_OK||(this.header=new f,n.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw)&&(r=n.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK))throw Error(s[r])}function h(t,e){var r=new c(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}c.prototype.push=function(t,e){var r,s,u,f,c,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,y=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?h.input=o.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?h.input=new Uint8Array(t):h.input=t,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===y&&(r=a.Z_OK,y=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0===h.avail_out||r===a.Z_STREAM_END||0===h.avail_in&&(s===a.Z_FINISH||s===a.Z_SYNC_FLUSH))&&("string"===this.options.to?(u=o.utf8border(h.output,h.next_out),f=h.next_out-u,c=o.buf2string(h.output,u),h.next_out=f,h.avail_out=d-f,f&&i.arraySet(h.output,h.output,u,f,0),this.onData(c)):this.onData(i.shrinkBuf(h.output,h.next_out))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==a.Z_STREAM_END)return(r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH)?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):(s===a.Z_SYNC_FLUSH&&(this.onEnd(a.Z_OK),h.avail_out=0),!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Inflate=c,r.inflate=h,r.inflateRaw=function(t,e){return(e=e||{}).raw=!0,h(t,e)},r.ungzip=h},9643,(t,e,r)=>{"use strict";var n=t.r(79148).assign,i=t.r(48901),o=t.r(82473),a=t.r(34131),s={};n(s,i,o,a),e.exports=s},72488,(t,e,r)=>{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t.r(9643),o=t.r(65464),a=t.r(48913),s=n?"uint8array":"array";function u(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",o.inherits(u,a),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,t.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new u("Deflate",t)},r.uncompressWorker=function(){return new u("Inflate",{})}},36462,(t,e,r)=>{"use strict";var n=t.r(48913);r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t.r(72488)},71471,(t,e,r)=>{"use strict";r.LOCAL_FILE_HEADER="PK\x03\x04",r.CENTRAL_FILE_HEADER="PK\x01\x02",r.CENTRAL_DIRECTORY_END="PK\x05\x06",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",r.DATA_DESCRIPTOR="PK\x07\b"},21908,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913),o=t.r(46253),a=t.r(63494),s=t.r(71471),u=function(t,e){var r,n="";for(r=0;r>>=8;return n},f=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16},l=function(t,e,r,i,l,c){var h,d,p=t.file,y=t.compression,g=c!==o.utf8encode,m=n.transformTo("string",c(p.name)),b=n.transformTo("string",o.utf8encode(p.name)),v=p.comment,_=n.transformTo("string",c(v)),w=n.transformTo("string",o.utf8encode(v)),S=b.length!==p.name.length,k=w.length!==v.length,E="",x="",A="",O=p.dir,R=p.date,C={crc32:0,compressedSize:0,uncompressedSize:0};(!e||r)&&(C.crc32=t.crc32,C.compressedSize=t.compressedSize,C.uncompressedSize=t.uncompressedSize);var T=0;e&&(T|=8),!g&&(S||k)&&(T|=2048);var I=0,B=0;(O&&(I|=16),"UNIX"===l)?(B=798,I|=f(p.unixPermissions,O)):(B=20,I|=63&(p.dosPermissions||0)),h=(R.getUTCHours()<<6|R.getUTCMinutes())<<5|R.getUTCSeconds()/2,d=(R.getUTCFullYear()-1980<<4|R.getUTCMonth()+1)<<5|R.getUTCDate(),S&&(x=u(1,1)+u(a(m),4)+b,E+="up"+u(x.length,2)+x),k&&(A=u(1,1)+u(a(_),4)+w,E+="uc"+u(A.length,2)+A);var P="";return P+="\n\0",P+=u(T,2),P+=y.magic,P+=u(h,2),P+=u(d,2),P+=u(C.crc32,4),P+=u(C.compressedSize,4),P+=u(C.uncompressedSize,4),P+=u(m.length,2),P+=u(E.length,2),{fileRecord:s.LOCAL_FILE_HEADER+P+m+E,dirRecord:s.CENTRAL_FILE_HEADER+u(B,2)+P+u(_.length,2)+"\0\0\0\0"+u(I,4)+u(i,4)+m+E+_}},c=function(t,e,r,i,o){var a=n.transformTo("string",o(i));return s.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(t,2)+u(t,2)+u(e,4)+u(r,4)+u(a.length,2)+a},h=function(t){return s.DATA_DESCRIPTOR+u(t.crc32,4)+u(t.compressedSize,4)+u(t.uncompressedSize,4)};function d(t,e,r,n){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(d,i),d.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,i.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},d.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=l(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=l(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:h(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e{"use strict";var n=t.r(36462),i=t.r(21908),o=function(t,e){var r=t||e,i=n[r];if(!i)throw Error(r+" is not a valid compression method !");return i};r.generateWorker=function(t,e,r){var n=new i(e.streamFiles,r,e.platform,e.encodeFileName),a=0;try{t.forEach(function(t,r){a++;var i=o(r.options.compression,e.compression),s=r.options.compressionOptions||e.compressionOptions||{},u=r.dir,f=r.date;r._compressWorker(i,s).withStreamInfo("file",{name:t,dir:u,date:f,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(n)}),n.entriesCount=a}catch(t){n.error(t)}return n}},13303,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t,e){i.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}n.inherits(o,i),o.prototype._bindStream=function(t){var e=this;this._stream=t,t.pause(),t.on("data",function(t){e.push({data:t,meta:{percent:0}})}).on("error",function(t){e.isPaused?this.generatedError=t:e.error(t)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=o},1223,(t,e,r)=>{"use strict";var n=t.r(46253),i=t.r(65464),o=t.r(48913),a=t.r(846),s=t.r(13133),u=t.r(43220),f=t.r(52929),l=t.r(6664),c=t.r(42527),h=t.r(13303),d=function(t,e,r){var n,a=i.getTypeOf(e),l=i.extend(r||{},s);l.date=l.date||new Date,null!==l.compression&&(l.compression=l.compression.toUpperCase()),"string"==typeof l.unixPermissions&&(l.unixPermissions=parseInt(l.unixPermissions,8)),l.unixPermissions&&16384&l.unixPermissions&&(l.dir=!0),l.dosPermissions&&16&l.dosPermissions&&(l.dir=!0),l.dir&&(t=y(t)),l.createFolders&&(n=p(t))&&g.call(this,n,!0);var d="string"===a&&!1===l.binary&&!1===l.base64;r&&void 0!==r.binary||(l.binary=!d),(e instanceof u&&0===e.uncompressedSize||l.dir||!e||0===e.length)&&(l.base64=!1,l.binary=!0,e="",l.compression="STORE",a="string");var m=null;m=e instanceof u||e instanceof o?e:c.isNode&&c.isStream(e)?new h(t,e):i.prepareContent(t,e,l.binary,l.optimizedBinaryString,l.base64);var b=new f(t,m,l);this.files[t]=b},p=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},y=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},g=function(t,e){return e=void 0!==e?e:s.createFolders,t=y(t),this.files[t]||d.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function m(t){return"[object RegExp]"===Object.prototype.toString.call(t)}e.exports={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,r,n;for(e in this.files)n=this.files[e],(r=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(r,n)},filter:function(t){var e=[];return this.forEach(function(r,n){t(r,n)&&e.push(n)}),e},file:function(t,e,r){if(1==arguments.length)if(m(t)){var n=t;return this.filter(function(t,e){return!e.dir&&n.test(t)})}else{var i=this.files[this.root+t];return i&&!i.dir?i:null}return t=this.root+t,d.call(this,t,e,r),this},folder:function(t){if(!t)return this;if(m(t))return this.filter(function(e,r){return r.dir&&t.test(e)});var e=this.root+t,r=g.call(this,e),n=this.clone();return n.root=r.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var r=this.filter(function(e,r){return r.name.slice(0,t.length)===t}),n=0;n{"use strict";var n=t.r(65464);function i(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC((t>>25&127)+1980,(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},12189,(t,e,r)=>{"use strict";var n=t.r(37384);function i(t){n.call(this,t);for(var e=0;e=0;--o)if(this.data[o]===e&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return -1},i.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),i=t.charCodeAt(3),o=this.readData(4);return e===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},41370,(t,e,r)=>{"use strict";var n=t.r(37384);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},15841,(t,e,r)=>{"use strict";var n=t.r(12189);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},44429,(t,e,r)=>{"use strict";var n=t.r(15841);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},71770,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(87780),o=t.r(12189),a=t.r(41370),s=t.r(44429),u=t.r(15841);e.exports=function(t){var e=n.getTypeOf(t);return(n.checkSupport(e),"string"!==e||i.uint8array)?"nodebuffer"===e?new s(t):i.uint8array?new u(n.transformTo("uint8array",t)):new o(n.transformTo("array",t)):new a(t)}},92861,(t,e,r)=>{"use strict";var n=t.r(71770),i=t.r(65464),o=t.r(43220),a=t.r(63494),s=t.r(46253),u=t.r(36462),f=t.r(87780),l=function(t){for(var e in u)if(Object.prototype.hasOwnProperty.call(u,e)&&u[e].magic===t)return u[e];return null};function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(t){var e,r;if(t.skip(22),this.fileNameLength=t.readInt(2),r=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=l(this.compressionMethod)))throw Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4{"use strict";var n=t.r(71770),i=t.r(65464),o=t.r(71471),a=t.r(92861),s=t.r(87780);function u(t){this.files=[],this.loadOptions=t}u.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+i.pretty(e)+", expected "+i.pretty(t)+")")}},isSignature:function(t,e){var r=this.reader.index;this.reader.setIndex(t);var n=this.reader.readString(4);return this.reader.setIndex(r),n===e},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=s.uint8array?"uint8array":"array",r=i.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,r,n=this.zip64EndOfCentralSize-44;01)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t0)this.isSignature(e,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(t){this.reader=n(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=u},37153,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(24375),o=t.r(46253),a=t.r(12938),s=t.r(1648),u=t.r(42527);e.exports=function(t,e){var r=this;return(e=n.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(t))?i.Promise.reject(Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var r=new a(e);return r.load(t),r}).then(function(t){var r=[i.Promise.resolve(t)],n=t.files;if(e.checkCRC32)for(var o=0;o{"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}n.prototype=t.r(1223),n.prototype.loadAsync=t.r(37153),n.support=t.r(87780),n.defaults=t.r(13133),n.version="3.10.1",n.loadAsync=function(t,e){return new n().loadAsync(t,e)},n.external=t.r(24375),e.exports=n}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,34582,(t,e,r)=>{"use strict";r.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return(r+n)*3/4-n},r.toByteArray=function(t){var e,r,n=f(t),a=n[0],s=n[1],u=new o((a+s)*3/4-s),l=0,c=s>0?a-4:a;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;a>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}(t,a,a+16383>s?s:a+16383));return 1===i?o.push(n[(e=t[r-1])>>2]+n[e<<4&63]+"=="):2===i&&o.push(n[(e=(t[r-2]<<8)+t[r-1])>>10]+n[e>>4&63]+n[e<<2&63]+"="),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}i[45]=62,i[95]=63},38492,(t,e,r)=>{r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,l=-7,c=r?i-1:0,h=r?-1:1,d=t[e+c];for(c+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+c],c+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=f}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,l=(1<>1,h=5960464477539062e-23*(23===i),d=n?0:o-1,p=n?1:-1,y=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(s=+!!isNaN(e),a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+c>=1?e+=h/u:e+=h*Math.pow(2,1-c),e*u>=2&&(a++,u/=2),a+c>=l?(s=0,a=l):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*y}},43943,(t,e,r)=>{"use strict";var n=t.r(34582),i=t.r(38492),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return l(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t){var n=t,i=e;if(("string"!=typeof i||""===i)&&(i="utf8"),!s.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|p(n,i),u=a(o),f=u.write(n,i);return f!==o&&(u=u.slice(0,f)),u}if(ArrayBuffer.isView(t)){var l=t;if(C(l,Uint8Array)){var y=new Uint8Array(l);return h(y.buffer,y.byteOffset,y.byteLength)}return c(l)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(C(t,ArrayBuffer)||t&&C(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(C(t,SharedArrayBuffer)||t&&C(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var g=t.valueOf&&t.valueOf();if(null!=g&&g!==t)return s.from(g,e,r);var m=function(t){if(s.isBuffer(t)){var e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?a(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(m)return m;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return f(t),a(t<0?0:0|d(t))}function c(t){for(var e=t.length<0?0:0|d(t.length),r=a(e),n=0;n=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||C(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return A(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return O(t).length;default:if(i)return n?-1:A(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){var i,o,a,s=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(i)return -1;else r=t.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return b(t,[e],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;h239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(l=f);break;case 2:(192&(o=t[i+1]))==128&&(u=(31&f)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],(192&o)==128&&(192&a)==128&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}var h=n,d=h.length;if(d<=4096)return String.fromCharCode.apply(String,h);for(var p="",y=0;yr)throw RangeError("Trying to access beyond buffer length")}function w(t,e,r,n,i,o){if(!s.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw RangeError("Index out of range")}function S(t,e,r,n,i,o){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function k(t,e,r,n,o){return e*=1,r>>>=0,o||S(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function E(t,e,r,n,o){return e*=1,r>>>=0,o||S(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}r.Buffer=s,r.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return(f(t),t<=0)?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)},s.allocUnsafe=function(t){return l(t)},s.allocUnsafeSlow=function(t){return l(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(C(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),C(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);in.length?s.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else if(s.isBuffer(o))o.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;ee&&(t+=" ... "),""},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(t,e,r,n,i){if(C(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),l=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,a,s,u,f,l,c,h=this.length-e;if((void 0===r||r>h)&&(r=h),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var d=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a>8,i.push(r%256),i.push(n);return i}(t,this.length-l),this,l,c);default:if(d)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||_(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||_(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||_(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||_(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||_(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||_(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return(t>>>=0,e||_(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||_(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||_(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||_(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||_(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||_(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||_(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||_(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||_(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a|0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return k(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return k(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return E(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return E(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!i){if(r>56319||a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function O(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var i=0;i=e.length)&&!(i>=t.length);++i)e[i+r]=t[i];return i}function C(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var T=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},30662,(t,e,r)=>{!function(){"use strict";var t={864:function(t){var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise(function(r,n){var i,o,a;function s(r){t.removeListener(e,u),n(r)}function u(){"function"==typeof t.removeListener&&t.removeListener("error",s),r([].slice.call(arguments))}y(t,e,u,{once:!0}),"error"!==e&&(i=t,o=s,a={once:!0},"function"==typeof i.on&&y(i,"error",o,a))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(t){if("function"!=typeof t)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){if(s(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=u(t))>0&&a.length>i&&!a.warned){a.warned=!0;var i,o,a,f=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=a.length,console&&console.warn&&console.warn(f)}return t}function l(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else for(var f=u.length,l=p(u,f),r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}},a=!0;try{t[e](o,o.exports,n),a=!1}finally{a&&delete r[e]}return o.exports}n.ab="/ROOT/node_modules/next/dist/compiled/events/",e.exports=n(864)}()},77398,(t,e,r)=>{var n=t.i(67034),i=t.i(47167);!function(){var r={992:function(t){t.exports=function(t,r,n){if(t.filter)return t.filter(r,n);if(null==t||"function"!=typeof r)throw TypeError();for(var i=[],o=0;o-1?i(r):r}},139:function(t,e,r){"use strict";var n=r(212),i=r(192),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),f=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(f)try{f({},"a",{value:1})}catch(t){f=null}t.exports=function(t){var e=s(n,a,arguments);return u&&f&&u(e,"length").configurable&&f(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var c=function(){return s(n,o,arguments)};f?f(t.exports,"apply",{value:c}):t.exports.apply=c},181:function(t){"use strict";t.exports=EvalError},545:function(t){"use strict";t.exports=Error},22:function(t){"use strict";t.exports=RangeError},803:function(t){"use strict";t.exports=ReferenceError},182:function(t){"use strict";t.exports=SyntaxError},202:function(t){"use strict";t.exports=TypeError},284:function(t){"use strict";t.exports=URIError},144:function(t){var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,i){if("[object Function]"!==r.call(n))throw TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var a=0;a1&&"boolean"!=typeof e)throw new f('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=j(t),n=r.length>0?r[0]:"",i=L("%"+n+"%",e),o=i.name,a=i.value,s=!1,l=i.alias;l&&(n=l[0],R(r,O([0,1],l)));for(var c=1,h=!0;c=r.length){var m=d(a,p);a=(h=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[p]}else h=A(a,p),a=a[p];h&&!s&&(w[o]=a)}}return a}},14:function(t){"use strict";var e={__proto__:null,foo:{}},r=Object;t.exports=function(){return({__proto__:e}).foo===e.foo&&!(e instanceof r)}},942:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(773);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},773:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},115:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(832);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},832:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},270:function(t,e,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty;t.exports=r(212).call(n,i)},782:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},157:function(t){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,n=function(t){return(!e||!t||"object"!=typeof t||!(Symbol.toStringTag in t))&&"[object Arguments]"===r.call(t)},i=function(t){return!!n(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==r.call(t)&&"[object Function]"===r.call(t.callee)},o=function(){return n(arguments)}();n.isLegacyArguments=i,t.exports=o?n:i},391:function(t){"use strict";var e=Object.prototype.toString,r=Function.prototype.toString,n=/^\s*(?:function)?\*/,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,o=Object.getPrototypeOf,a=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(t){}}(),s=a?o(a):{};t.exports=function(t){return"function"==typeof t&&(!!n.test(r.call(t))||(i?o(t)===s:"[object GeneratorFunction]"===e.call(t)))}},994:function(e,r,n){"use strict";var i=n(144),o=n(349),a=n(256),s=a("Object.prototype.toString"),u=n(942)()&&"symbol"==typeof Symbol.toStringTag,f=o(),l=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1)}},369:function(t){t.exports=function(t){return t instanceof n.Buffer}},584:function(t,e,r){"use strict";var n=r(157),i=r(391),o=r(490),a=r(994);function s(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,f="undefined"!=typeof Symbol,l=s(Object.prototype.toString),c=s(Number.prototype.valueOf),h=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(f)var y=s(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function m(t){return"[object Map]"===l(t)}function b(t){return"[object Set]"===l(t)}function v(t){return"[object WeakMap]"===l(t)}function _(t){return"[object WeakSet]"===l(t)}function w(t){return"[object ArrayBuffer]"===l(t)}function S(t){return"undefined"!=typeof ArrayBuffer&&(w.working?w(t):t instanceof ArrayBuffer)}function k(t){return"[object DataView]"===l(t)}function E(t){return"undefined"!=typeof DataView&&(k.working?k(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||E(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},m.working="undefined"!=typeof Map&&m(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(m.working?m(t):t instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(b.working?b(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},_.working="undefined"!=typeof WeakSet&&_(new WeakSet),e.isWeakSet=function(t){return _(t)},w.working="undefined"!=typeof ArrayBuffer&&w(new ArrayBuffer),e.isArrayBuffer=S,k.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&k(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=E;var x="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(t){return"[object SharedArrayBuffer]"===l(t)}function O(t){return void 0!==x&&(void 0===A.working&&(A.working=A(new x)),A.working?A(t):t instanceof x)}function R(t){return g(t,c)}function C(t){return g(t,h)}function T(t){return g(t,d)}function I(t){return u&&g(t,p)}function B(t){return f&&g(t,y)}e.isSharedArrayBuffer=O,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=R,e.isStringObject=C,e.isBooleanObject=T,e.isBigIntObject=I,e.isSymbolObject=B,e.isBoxedPrimitive=function(t){return R(t)||C(t)||T(t)||I(t)||B(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(S(t)||O(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw Error(t+" is not supported in userland")}})})},177:function(t,e,r){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),h(n,t,n.depth)}function l(t,e){var r=f.styles[e];return r?"\x1b["+f.colors[r][0]+"m"+t+"\x1b["+f.colors[r][1]+"m":t}function c(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&!(r.constructor&&r.constructor.prototype===r)){var i,o,a,s,u,f,l=r.inspect(n,t);return v(l)||(l=h(t,l,n)),l}var c=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,r);if(c)return c;var S=Object.keys(r),A=(u={},S.forEach(function(t,e){u[t]=!0}),u);if(t.showHidden&&(S=Object.getOwnPropertyNames(r)),E(r)&&(S.indexOf("message")>=0||S.indexOf("description")>=0))return d(r);if(0===S.length){if(x(r)){var O=r.name?": "+r.name:"";return t.stylize("[Function"+O+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return t.stylize(Date.prototype.toString.call(r),"date");if(E(r))return d(r)}var R="",T=!1,I=["{","}"];if(y(r)&&(T=!0,I=["[","]"]),x(r)&&(R=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(R=" "+RegExp.prototype.toString.call(r)),k(r)&&(R=" "+Date.prototype.toUTCString.call(r)),E(r)&&(R=" "+d(r)),0===S.length&&(!T||0==r.length))return I[0]+R+I[1];if(n<0)if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");else return t.stylize("[Object]","special");return t.seen.push(r),f=T?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&s++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?a[0]+(""===o?"":o+"\n ")+" "+i.join(",\n ")+" "+a[1]:a[0]+o+" "+i.join(", ")+" "+a[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),C(n,i)||(a="["+i+"]"),!s&&(0>t.seen.indexOf(u.value)?(s=m(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),_(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function v(t){return"string"==typeof t}function _(t){return void 0===t}function w(t){return S(t)&&"[object RegExp]"===A(t)}function S(t){return"object"==typeof t&&null!==t}function k(t){return S(t)&&"[object Date]"===A(t)}function E(t){return S(t)&&("[object Error]"===A(t)||t instanceof Error)}function x(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function O(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(!a[t=t.toUpperCase()])if(s.test(t)){var r=i.default.pid;a[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else a[t]=function(){};return a[t]},e.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(584),e.isArray=y,e.isBoolean=g,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=_,e.isRegExp=w,e.types.isRegExp=w,e.isObject=S,e.isDate=k,e.types.isDate=k,e.isError=E,e.types.isNativeError=E,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(369);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[O((t=new Date).getHours()),O(t.getMinutes()),O(t.getSeconds())].join(":"),[t.getDate(),R[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(782),e._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');if(T&&t[T]){var e=t[T];if("function"!=typeof e)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),i=[],o=0;o{var n=t.i(47167);!function(){var r={782:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},646:function(t){"use strict";let e={};function r(t,r,n){n||(n=Error);class i extends n{constructor(t,e,n){super("string"==typeof r?r:r(t,e,n))}}i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(!Array.isArray(t))return"of ".concat(e," ").concat(String(t));{let r=t.length;return(t=t.map(t=>String(t)),r>2)?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,r){var i,o,a,s;let u,f;if("string"==typeof e&&(i="not ",e.substr(0,i.length)===i)?(u="must not be",e=e.replace(/^not /,"")):u="must be",o=" argument",(void 0===a||a>t.length)&&(a=t.length),t.substring(a-o.length,a)===o)f="The ".concat(t," ").concat(u," ").concat(n(e,"type"));else{let r=("number"!=typeof s&&(s=0),s+1>t.length||-1===t.indexOf(".",s))?"argument":"property";f='The "'.concat(t,'" ').concat(r," ").concat(u," ").concat(n(e,"type"))}return f+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},403:function(t,e,r){"use strict";var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=r(709),a=r(337);r(782)(l,o);for(var s=i(a.prototype),u=0;u0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===h.prototype||(o=e,e=h.from(o)),n)u.endEmitted?k(t,new S):R(t,u,e,!0);else if(u.ended)k(t,new _);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?R(t,u,e,!1):B(t,u)):R(t,u,e,!1)}else n||(u.reading=!1,B(t,u));return!u.ended&&(u.lengthe.highWaterMark&&((r=t)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r),t<=e.length)?t:e.ended?e.length:(e.needReadable=!0,0)}function T(t){var e=t._readableState;a("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(a("emitReadable",e.flowing),e.emittedReadable=!0,n.default.nextTick(I,t))}function I(t){var e=t._readableState;a("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,z(t)}function B(t,e){e.readingMore||(e.readingMore=!0,n.default.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){a("readable nexttick read 0"),t.read(0)}function U(t,e){a("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),z(t),e.flowing&&!e.reading&&t.read(0)}function z(t){var e=t._readableState;for(a("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){var r;return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r)}function N(t){var e=t._readableState;a("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.default.nextTick(F,e,t))}function F(t,e){if(a("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function M(t,e){for(var r=0,n=t.length;r=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?N(this):T(this),null;if(0===(t=C(t,r))&&r.ended)return 0===r.length&&N(this),null;var i=r.needReadable;return a("need readable",i),(0===r.length||r.length-t0?D(t,r):null)?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==t&&r.ended&&N(this)),null!==e&&this.emit("data",e),e},A.prototype._read=function(t){k(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r,i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,a("pipe count=%d opts=%j",o.pipesCount,e);var s=e&&!1===e.end||t===n.default.stdout||t===n.default.stderr?g:u;function u(){a("onend"),t.end()}o.endEmitted?n.default.nextTick(s):i.once("end",s),t.on("unpipe",function e(r,n){a("onunpipe"),r===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,a("cleanup"),t.removeListener("close",p),t.removeListener("finish",y),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",e),i.removeListener("end",u),i.removeListener("end",g),i.removeListener("data",h),c=!0,o.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&f())});var f=(r=i,function(){var t=r._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&l(r,"data")&&(t.flowing=!0,z(r))});t.on("drain",f);var c=!1;function h(e){a("ondata");var r=t.write(e);a("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==M(o.pipes,t))&&!c&&(a("false write response, pause",o.awaitDrain),o.awaitDrain++),i.pause())}function d(e){a("onerror",e),g(),t.removeListener("error",d),0===l(t,"error")&&k(t,e)}function p(){t.removeListener("finish",y),g()}function y(){a("onfinish"),t.removeListener("close",p),g()}function g(){a("unpipe"),i.unpipe(t)}return i.on("data",h),!function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",y),t.emit("pipe",i),o.flowing||(a("pipe resume"),i.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"!==t||i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,a("on readable",i.length,i.reading),i.length?T(this):i.reading||n.default.nextTick(L,this)),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=c.prototype.removeListener.call(this,t,e);return"readable"===t&&n.default.nextTick(j,this),r},A.prototype.removeAllListeners=function(t){var e=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&n.default.nextTick(j,this),e},A.prototype.resume=function(){var t,e,r=this._readableState;return r.flowing||(a("resume"),r.flowing=!r.readableListening,t=this,(e=r).resumeScheduled||(e.resumeScheduled=!0,n.default.nextTick(U,t,e))),r.paused=!1,this},A.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){if(a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!=i)(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new S(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new g("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var i,o,a,s=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),s.corked&&(s.corked=1,this.uncork()),s.ending||(i=this,o=s,a=r,o.ending=!0,B(i,o),a&&(o.finished?n.default.nextTick(a):i.once("finish",a)),o.ended=!0,i.writable=!1),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=h.destroy,A.prototype._undestroy=h.undestroy,A.prototype._destroy=function(t,e){e(t)}},871:function(t,e,r){"use strict";function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o,a=r(698),s=Symbol("lastResolve"),u=Symbol("lastReject"),f=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function y(t){var e=t[s];if(null!==e){var r=t[d].read();null!==r&&(t[c]=null,t[s]=null,t[u]=null,e(p(r,!1)))}}function g(t){n.default.nextTick(y,t)}var m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((i(o={get stream(){return this[d]},next:function(){var t,e,r=this,i=this[f];if(null!==i)return Promise.reject(i);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(t,e){n.default.nextTick(function(){r[f]?e(r[f]):t(p(void 0,!0))})});var o=this[c];if(o)e=new Promise((t=this,function(e,r){o.then(function(){if(t[l])return void e(p(void 0,!0));t[h](e,r)},r)}));else{var a=this[d].read();if(null!==a)return Promise.resolve(p(a,!1));e=new Promise(this[h])}return this[c]=e,e}},Symbol.asyncIterator,function(){return this}),i(o,"return",function(){var t=this;return new Promise(function(e,r){t[d].destroy(null,function(t){if(t)return void r(t);e(p(void 0,!0))})})}),o),m);t.exports=function(t){var e,r=Object.create(b,(i(e={},d,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,u,{value:null,writable:!0}),i(e,f,{value:null,writable:!0}),i(e,l,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var n=r[d].read();n?(r[c]=null,r[s]=null,r[u]=null,t(p(n,!1))):(r[s]=t,r[u]=e)},writable:!0}),e));return r[c]=null,a(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];null!==e&&(r[c]=null,r[s]=null,r[u]=null,e(t)),r[f]=t;return}var n=r[s];null!==n&&(r[c]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0}),t.on("readable",g.bind(null,r)),r}},379:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}var i=r(300).Buffer,o=r(837).inspect,a=o&&o.custom||"inspect";t.exports=function(){var t;function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return t=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return i.alloc(0);for(var e,r,n=i.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=a,i.prototype.copy.call(e,n,r),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=i.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(o.copy(e,e.length-t,0,a),0==(t-=a)){a===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++n}return this.length-=n,e}},{key:a,value:function(t,e){return o(this,function(t){for(var e=1;e0,f=s=function(t){e||(e=t),t&&d.forEach(u),g||(d.forEach(u),h(e))},c=!1,s=function(){c||(c=!0,f.apply(void 0,arguments))},p=!1,t.on("close",function(){p=!0}),void 0===n&&(n=r(698)),n(t,{readable:g,writable:o},function(t){if(t)return s(t);p=!0,s()}),y=!1,function(e){if(!p&&!y){if(y=!0,t.setHeader&&"function"==typeof t.abort)return t.abort();if("function"==typeof t.destroy)return t.destroy();s(e||new a("pipe"))}}});return l.reduce(f)}},776:function(t,e,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=null!=e.highWaterMark?e.highWaterMark:i?e[r]:null;if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},678:function(t,e,r){t.exports=r(781)},55:function(t,e,r){var n=r(300),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n.SlowBuffer(t)}},173:function(t,e,r){t.exports=i;var n=r(361).EventEmitter;function i(){n.call(this)}r(782)(i,n),i.Readable=r(709),i.Writable=r(337),i.Duplex=r(403),i.Transform=r(170),i.PassThrough=r(889),i.finished=r(698),i.pipeline=r(442),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(l(),0===n.listenerCount(this,"error"))throw t}function l(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",l),r.removeListener("close",l),t.removeListener("close",l)}return r.on("error",f),t.on("error",f),r.on("end",l),r.on("close",l),t.on("close",l),t.emit("pipe",r),t}},704:function(t,e,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){var e;if(!t)return"utf8";for(;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=l,this.end=c,e=3;break;default:this.write=h,this.end=d;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if((192&e[0])!=128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((192&e[1])!=128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(192&e[2])!=128)return t.lastNeed=2,"�"}}(this,t,0);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length)}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){var e,r;if(0===t.length)return"";if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},769:function(e){e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}};function r(e){try{if(!t.g.localStorage)return!1}catch(t){return!1}var r=t.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}},300:function(e){"use strict";e.exports=t.r(43943)},361:function(e){"use strict";e.exports=t.r(30662)},781:function(e){"use strict";e.exports=t.r(30662).EventEmitter},837:function(e){"use strict";e.exports=t.r(77398)}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var n=i[t]={exports:{}},a=!0;try{r[t](n,n.exports,o),a=!1}finally{a&&delete i[t]}return n.exports}o.ab="/ROOT/node_modules/next/dist/compiled/stream-browserify/",e.exports=o(173)}()},31032,(t,e,r)=>{"use strict";e.exports=t.r(12569)},87780,(t,e,r)=>{"use strict";var n=t.i(67034);if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer=void 0!==n.Buffer,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var i=new ArrayBuffer(0);try{r.blob=0===new Blob([i],{type:"application/zip"}).size}catch(t){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),r.blob=0===o.getBlob("application/zip").size}catch(t){r.blob=!1}}}try{r.nodestream=!!t.r(31032).Readable}catch(t){r.nodestream=!1}},55951,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(87780),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(t){for(var e,r,i,a,s,u,f,l=[],c=0,h=t.length,d=h,p="string"!==n.getTypeOf(t);c>2,s=(3&e)<<4|r>>4,u=d>1?(15&r)<<2|i>>6:64,f=d>2?63&i:64,l.push(o.charAt(a)+o.charAt(s)+o.charAt(u)+o.charAt(f));return l.join("")},r.decode=function(t){var e,r,n,a,s,u,f,l,c=0,h=0,d="data:";if(t.substr(0,d.length)===d)throw Error("Invalid base64 input, it looks like a data url.");var p=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===o.charAt(64)&&p--,t.charAt(t.length-2)===o.charAt(64)&&p--,p%1!=0)throw Error("Invalid base64 input, bad content length.");for(l=i.uint8array?new Uint8Array(0|p):Array(0|p);c>4,r=(15&s)<<4|u>>2,n=(3&u)<<6|f,l[h++]=e,64!==u&&(l[h++]=r),64!==f&&(l[h++]=n);return l}},42527,(t,e,r)=>{"use strict";var n=t.i(67034);e.exports={isNode:void 0!==n.Buffer,newBufferFrom:function(t,e){if(n.Buffer.from&&n.Buffer.from!==Uint8Array.from)return n.Buffer.from(t,e);if("number"==typeof t)throw Error('The "data" argument must not be a number');return new n.Buffer(t,e)},allocBuffer:function(t){if(n.Buffer.alloc)return n.Buffer.alloc(t);var e=new n.Buffer(t);return e.fill(0),e},isBuffer:function(t){return n.Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},27024,(t,e,r)=>{"use strict";var n,i,o=t.g.MutationObserver||t.g.WebKitMutationObserver;if(o){var a=0,s=new o(c),u=t.g.document.createTextNode("");s.observe(u,{characterData:!0}),n=function(){u.data=a=++a%2}}else if(t.g.setImmediate||void 0===t.g.MessageChannel)n="document"in t.g&&"onreadystatechange"in t.g.document.createElement("script")?function(){var e=t.g.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.g.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var f=new t.g.MessageChannel;f.port1.onmessage=c,n=function(){f.port2.postMessage(0)}}var l=[];function c(){i=!0;for(var t,e,r=l.length;r;){for(e=l,l=[],t=-1;++t{"use strict";var n=t.r(27024);function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function f(t){if("function"!=typeof t)throw TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==i&&d(this,t)}function l(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function c(t,e,r){n(function(){var n;try{n=e(r)}catch(e){return o.reject(t,e)}n===t?o.reject(t,TypeError("Cannot resolve promise with itself")):o.resolve(t,n)})}function h(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,o.reject(t,e))}function i(e){r||(r=!0,o.resolve(t,e))}var a=p(function(){e(i,n)});"error"===a.status&&n(a.value)}function p(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}e.exports=f,f.prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then(function(r){return e.resolve(t()).then(function(){return r})},function(r){return e.resolve(t()).then(function(){throw r})})},f.prototype.catch=function(t){return this.then(null,t)},f.prototype.then=function(t,e){if("function"!=typeof t&&this.state===s||"function"!=typeof e&&this.state===a)return this;var r=new this.constructor(i);return this.state!==u?c(r,this.state===s?t:e,this.outcome):this.queue.push(new l(r,t,e)),r},l.prototype.callFulfilled=function(t){o.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){c(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){o.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){c(this.promise,this.onRejected,t)},o.resolve=function(t,e){var r=p(h,e);if("error"===r.status)return o.reject(t,r.value);var n=r.value;if(n)d(t,n);else{t.state=s,t.outcome=e;for(var i=-1,a=t.queue.length;++i{"use strict";e.exports={Promise:"undefined"!=typeof Promise?Promise:t.r(22998)}},83986,(t,e,r)=>{var n=t.i(47167);"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/next/dist/compiled/setimmediate/"),({189:function(){!function(t,e){"use strict";if(!t.setImmediate){var r,i,o,a,s,u=1,f={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"===({}).toString.call(t.process)?s=function(t){n.default.nextTick(function(){p(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(r="setImmediate$"+Math.random()+"$",i=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&p(+e.data.slice(r.length))},t.addEventListener?t.addEventListener("message",i,!1):t.attachEvent("onmessage",i),s=function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},s=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(a=c.documentElement,s=function(t){var e=c.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,a.removeChild(e),e=null},a.appendChild(e)}):s=function(t){setTimeout(p,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=Function(""+t));for(var e=Array(arguments.length-1),r=0;r{"use strict";var n=t.r(87780),i=t.r(55951),o=t.r(42527),a=t.r(24375);function s(t){return t}function u(t,e){for(var r=0;r1;)try{return f.stringifyByChunk(t,n,e)}catch(t){e=Math.floor(e/2)}return f.stringifyByChar(t)}function c(t,e){for(var r=0;r{"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=n},46253,(t,e,r)=>{"use strict";for(var n=t.r(65464),i=t.r(87780),o=t.r(42527),a=t.r(48913),s=Array(256),u=0;u<256;u++)s[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;s[254]=s[254]=1;var f=function(t){var e,r,n,o,a,s=t.length,u=0;for(o=0;o>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e},l=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&(192&t[r])==128;)r--;return r<0||0===r?e:r+s[t[r]]>e?r:e},c=function(t){var e,r,i,o,a=t.length,u=Array(2*a);for(r=0,e=0;e4){u[r++]=65533,e+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&e1){u[r++]=65533;continue}i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)};function h(){a.call(this,"utf-8 decode"),this.leftOver=null}function d(){a.call(this,"utf-8 encode")}r.utf8encode=function(t){return i.nodebuffer?o.newBufferFrom(t,"utf-8"):f(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):c(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(h,a),h.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=e;(e=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),e.set(o,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var a=l(e),s=e;a!==e.length&&(i.uint8array?(s=e.subarray(0,a),this.leftOver=e.subarray(a,e.length)):(s=e.slice(0,a),this.leftOver=e.slice(a,e.length))),this.push({data:r.utf8decode(s),meta:t.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=h,n.inherits(d,a),d.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=d},60550,(t,e,r)=>{"use strict";var n=t.r(48913),i=t.r(65464);function o(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(o,n),o.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=o},61714,(t,e,r)=>{"use strict";var n=t.r(31032).Readable;function i(t,e,r){n.call(this,e),this._helper=t;var i=this;t.on("data",function(t,e){i.push(t)||i._helper.pause(),r&&r(e)}).on("error",function(t){i.emit("error",t)}).on("end",function(){i.push(null)})}t.r(65464).inherits(i,n),i.prototype._read=function(){this._helper.resume()},e.exports=i},846,(t,e,r)=>{"use strict";var n=t.i(67034),i=t.r(65464),o=t.r(60550),a=t.r(48913),s=t.r(55951),u=t.r(87780),f=t.r(24375),l=null;if(u.nodestream)try{l=t.r(61714)}catch(t){}function c(t,e,r){var n=e;switch(e){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=e,this._mimeType=r,i.checkSupport(n),this._worker=t.pipe(new o(n)),t.lock()}catch(t){this._worker=new a("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){var e;return e=this,new f.Promise(function(r,o){var a=[],u=e._internalType,f=e._outputType,l=e._mimeType;e.on("data",function(e,r){a.push(e),t&&t(r)}).on("error",function(t){a=[],o(t)}).on("end",function(){try{var t=function(t,e,r){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),r);case"base64":return s.encode(e);default:return i.transformTo(t,e)}}(f,function(t,e){var r,i=0,o=null,a=0;for(r=0;r{"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},25625,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},63494,(t,e,r)=>{"use strict";var n=t.r(65464),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?0xedb88320^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r,n){var o=0+r;t^=-1;for(var a=0;a>>8^i[(t^e[a])&255];return -1^t}(0|e,t,t.length,0):function(t,e,r,n){var o=0+r;t^=-1;for(var a=0;a>>8^i[(t^e.charCodeAt(a))&255];return -1^t}(0|e,t,t.length,0):0}},1648,(t,e,r)=>{"use strict";var n=t.r(48913),i=t.r(63494);function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t.r(65464).inherits(o,n),o.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=o},41087,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(o,i),o.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=o},43220,(t,e,r)=>{"use strict";var n=t.r(24375),i=t.r(25625),o=t.r(1648),a=t.r(41087);function s(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}s.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(t,e,r){return t.pipe(new o).pipe(new a("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=s},52929,(t,e,r)=>{"use strict";var n=t.r(846),i=t.r(25625),o=t.r(46253),a=t.r(43220),s=t.r(48913),u=function(t,e,r){this.name=t,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=e,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};u.prototype={internalStream:function(t){var e=null,r="string";try{if(!t)throw Error("No output type specified.");r=t.toLowerCase();var i="string"===r||"text"===r;("binarystring"===r||"text"===r)&&(r="string"),e=this._decompressWorker();var a=!this._dataBinary;a&&!i&&(e=e.pipe(new o.Utf8EncodeWorker)),!a&&i&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(t){(e=new s("error")).error(t)}return new n(e,r,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof a&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new o.Utf8EncodeWorker)),a.createWorkerFrom(r,t,e)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof s?this._data:new i(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw TypeError(r+"must be non-object");for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)return void t.set(e.subarray(r,r+n),i);for(var o=0;o{"use strict";var n,i,o,a=t.r(79148);function s(t){for(var e=t.length;--e>=0;)t[e]=0}var u=573,f=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=Array(576);s(d);var p=Array(60);s(p);var y=Array(512);s(y);var g=Array(256);s(g);var m=Array(29);s(m);var b=Array(30);function v(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function _(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function w(t){return t<256?y[t]:y[256+(t>>>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function k(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0)return r>>>1}function A(t,e,r){var n,i,o=Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=x(o[s]++,s))}}function O(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function R(t){t.bi_valid>8?S(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function C(t,e,r,n){var i=2*e,o=2*r;return t[i]>1;r>=1;r--)T(t,o,r);i=f;do r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],T(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,T(t,o,1);while(t.heap_len>=2)t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,f=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,y=e.stat_desc.max_length,g=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(f[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;ry&&(o=y,g++),f[2*n+1]=o,!(n>l)&&(t.bl_count[o]++,a=0,n>=p&&(a=d[n-p]),s=f[2*n],t.opt_len+=s*(o+a),h&&(t.static_len+=s*(c[2*n+1]+a)));if(0!==g){do{for(o=y-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[y]--,g-=2}while(g>0)for(o=y;0!==o;o--)for(n=t.bl_count[o];0!==n;)!((i=t.heap[--r])>l)&&(f[2*i+1]!==o&&(t.opt_len+=(o-f[2*i+1])*f[2*i],f[2*i+1]=o),n--)}}(t,e),A(o,l,t.bl_count)}function P(t,e,r){var n,i,o=-1,a=e[1],s=0,u=7,f=4;for(0===a&&(u=138,f=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)i=a,a=e[(n+1)*2+1],++s>=7;a<30;a++)for(t=0,b[a]=s<<7;t<1<0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=0xf3ffc07f;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),a=function(t){var e;for(P(t,t.dyn_ltree,t.l_desc.max_code),P(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?U(t,e,r,n):4===t.strategy||o===i?(k(t,2+ +!!n,3),I(t,d,p)):(k(t,4+ +!!n,3),function(t,e,r,n){var i;for(k(t,e-257,5),k(t,r-1,5),k(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[(g[r]+256+1)*2]++,t.dyn_dtree[2*w(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){k(t,2,3),E(t,256,d),16===t.bi_valid?(S(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},74049,(t,e,r)=>{"use strict";e.exports=function(t,e,r,n){for(var i=65535&t,o=t>>>16&65535,a=0;0!==r;){a=r>2e3?2e3:r,r-=a;do o=o+(i=i+e[n++]|0)|0;while(--a)i%=65521,o%=65521}return i|o<<16}},63327,(t,e,r)=>{"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?0xedb88320^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var o=i+r;t^=-1;for(var a=i;a>>8^n[(t^e[a])&255];return -1^t}},19558,(t,e,r)=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},79674,(t,e,r)=>{"use strict";var n,i=t.r(79148),o=t.r(94333),a=t.r(74049),s=t.r(63327),u=t.r(19558),f=573;function l(t,e){return t.msg=u[e],e}function c(t){return(t<<1)-9*(t>4)}function h(t){for(var e=t.length;--e>=0;)t[e]=0}function d(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function p(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,d(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function g(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function m(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,f=t.window,l=t.w_mask,c=t.prev,h=t.strstart+258,d=f[o+a-1],p=f[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(f[(r=e)+a]!==p||f[r+a-1]!==d||f[r]!==f[o]||f[++r]!==f[o+1])continue;o+=2,r++;do;while(f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&oa){if(t.match_start=e,a=n,n>=s)break;d=f[o+a-1],p=f[o+a]}}while((e=c[e&l])>u&&0!=--i)return a<=t.lookahead?a:t.lookahead}function b(t){var e,r,n,o,u,f=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-262)){i.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;do n=t.head[--e],t.head[e]=n>=f?n-f:0;while(--r)e=r=f;do n=t.prev[--e],t.prev[e]=n>=f?n-f:0;while(--r)o+=f}if(0===t.strm.avail_in)break;if(r=function(t,e,r,n){var o=t.avail_in;return(o>n&&(o=n),0===o)?0:(t.avail_in-=o,i.arraySet(e,t.input,t.next_in,o,r),1===t.state.wrap?t.adler=a(t.adler,e,o,r):2===t.state.wrap&&(t.adler=s(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=r,t.lookahead+t.insert>=3)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<15&&(s=2,n-=16),o<1||o>9||8!==r||n<8||n>15||e<0||e>9||a<0||a>4)return l(t,-2);8===n&&(n=9);var u=new S;return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(b(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,p(t,!1),0===t.strm.avail_out)||t.strstart-t.block_start>=t.w_size-262&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:(t.strstart>t.block_start&&(p(t,!1),t.strm.avail_out),1)}),new w(4,4,8,4,v),new w(4,5,16,8,v),new w(4,6,32,32,v),new w(4,4,16,16,_),new w(8,16,32,32,_),new w(8,16,128,128,_),new w(8,32,128,256,_),new w(32,128,258,1024,_),new w(32,258,258,4096,_)],r.deflateInit=function(t,e){return x(t,e,8,15,8,0)},r.deflateInit2=x,r.deflateReset=E,r.deflateResetKeep=k,r.deflateSetHeader=function(t,e){return t&&t.state&&2===t.state.wrap?(t.state.gzhead=e,0):-2},r.deflate=function(t,e){if(!t||!t.state||e>5||e<0)return t?l(t,-2):-2;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return l(t,0===t.avail_out?-5:-2);if(i.strm=t,r=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,y(i,31),y(i,139),y(i,8),i.gzhead?(y(i,+!!i.gzhead.text+2*!!i.gzhead.hcrc+4*!!i.gzhead.extra+8*!!i.gzhead.name+16*!!i.gzhead.comment),y(i,255&i.gzhead.time),y(i,i.gzhead.time>>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:4*(i.strategy>=2||i.level<2)),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:4*(i.strategy>=2||i.level<2)),y(i,3),i.status=113);else{var r,i,a,u,f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=113,g(i,f),0!==i.strstart&&(g(i,t.adler>>>16),g(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&d(t),i.pending+2<=i.pending_buf_size&&(y(i,255&t.adler),y(i,t.adler>>8&255),t.adler=0,i.status=113)):i.status=113),0!==i.pending){if(d(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&c(e)<=c(r)&&4!==e)return l(t,-5);if(666===i.status&&0!==t.avail_in)return l(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var m=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(b(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=258){if(b(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+258;do;while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if((3===m||4===m)&&(i.status=666),1===m||3===m)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===m&&(1===e?o._tr_align(i):5!==e&&(o._tr_stored_block(i,0,0,!1),3===e&&(h(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),d(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&t.adler),y(i,t.adler>>8&255),y(i,t.adler>>16&255),y(i,t.adler>>24&255),y(i,255&t.total_in),y(i,t.total_in>>8&255),y(i,t.total_in>>16&255),y(i,t.total_in>>24&255)):(g(i,t.adler>>>16),g(i,65535&t.adler)),d(t),i.wrap>0&&(i.wrap=-i.wrap),+(0===i.pending))},r.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?l(t,-2):(t.state=null,113===e?l(t,-3):0):-2},r.deflateSetDictionary=function(t,e){var r,n,o,s,u,f,l,c,d=e.length;if(!t||!t.state||2===(s=(r=t.state).wrap)||1===s&&42!==r.status||r.lookahead)return -2;for(1===s&&(t.adler=a(t.adler,e,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(h(r.head),r.strstart=0,r.block_start=0,r.insert=0),c=new i.Buf8(r.w_size),i.arraySet(c,e,d-r.w_size,r.w_size,0),e=c,d=r.w_size),u=t.avail_in,f=t.next_in,l=t.input,t.avail_in=d,t.next_in=0,t.input=e,b(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do r.ins_h=(r.ins_h<{"use strict";var n=t.r(79148),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",a=0;a>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e},r.buf2binstring=function(t){return u(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r4){f[n++]=65533,r+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&r1){f[n++]=65533;continue}i<65536?f[n++]=i:(i-=65536,f[n++]=55296|i>>10&1023,f[n++]=56320|1023&i)}return u(f,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&(192&t[r])==128;)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}},98899,(t,e,r)=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},48901,(t,e,r)=>{"use strict";var n=t.r(79674),i=t.r(79148),o=t.r(63202),a=t.r(19558),s=t.r(98899),u=Object.prototype.toString;function f(t){if(!(this instanceof f))return new f(t);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e,r=this.options;r.raw&&r.windowBits>0?r.windowBits=-r.windowBits:r.gzip&&r.windowBits>0&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var l=n.deflateInit2(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy);if(0!==l)throw Error(a[l]);if(r.header&&n.deflateSetHeader(this.strm,r.header),r.dictionary){if(e="string"==typeof r.dictionary?o.string2buf(r.dictionary):"[object ArrayBuffer]"===u.call(r.dictionary)?new Uint8Array(r.dictionary):r.dictionary,0!==(l=n.deflateSetDictionary(this.strm,e)))throw Error(a[l]);this._dict_set=!0}}function l(t,e){var r=new f(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(t,e){var r,a,s=this.strm,f=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:4*(!0===e),"string"==typeof t?s.input=o.string2buf(t):"[object ArrayBuffer]"===u.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(f),s.next_out=0,s.avail_out=f),1!==(r=n.deflate(s,a))&&0!==r)return this.onEnd(r),this.ended=!0,!1;(0===s.avail_out||0===s.avail_in&&(4===a||2===a))&&("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r)return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):(2===a&&(this.onEnd(0),s.avail_out=0),!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Deflate=f,r.deflate=l,r.deflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},r.gzip=function(t,e){return(e=e||{}).gzip=!0,l(t,e)}},75531,(t,e,r)=>{"use strict";e.exports=function(t,e){var r,n,i,o,a,s,u,f,l,c,h,d,p,y,g,m,b,v,_,w,S,k,E,x,A;r=t.state,n=t.next_in,x=t.input,i=n+(t.avail_in-5),o=t.next_out,A=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),u=r.dmax,f=r.wsize,l=r.whave,c=r.wnext,h=r.window,d=r.hold,p=r.bits,y=r.lencode,g=r.distcode,m=(1<>>=_=v>>>24,p-=_,0==(_=v>>>16&255))A[o++]=65535&v;else if(16&_)for(w=65535&v,(_&=15)&&(p<_&&(d+=x[n++]<>>=_,p-=_),p<15&&(d+=x[n++]<>>=_=v>>>24,p-=_,16&(_=v>>>16&255)){if(S=65535&v,p<(_&=15)&&(d+=x[n++]<u){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=_,p-=_,S>(_=o-a)){if((_=S-_)>l&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(k=0,E=h,0===c){if(k+=f-_,_2;)A[o++]=E[k++],A[o++]=E[k++],A[o++]=E[k++],w-=3;w&&(A[o++]=E[k++],w>1&&(A[o++]=E[k++]))}else{k=o-S;do A[o++]=A[k++],A[o++]=A[k++],A[o++]=A[k++],w-=3;while(w>2)w&&(A[o++]=A[k++],w>1&&(A[o++]=A[k++]))}}else if((64&_)==0){v=g[(65535&v)+(d&(1<<_)-1)];continue}else{t.msg="invalid distance code",r.mode=30;break t}break}else if((64&_)==0){v=y[(65535&v)+(d&(1<<_)-1)];continue}else if(32&_){r.mode=12;break t}else{t.msg="invalid literal/length code",r.mode=30;break t}break}while(n>3,p-=w<<3,d&=(1<{"use strict";var n=t.r(79148),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,r,u,f,l,c,h){var d,p,y,g,m,b,v,_,w,S=h.bits,k=0,E=0,x=0,A=0,O=0,R=0,C=0,T=0,I=0,B=0,P=null,j=0,L=new n.Buf16(16),U=new n.Buf16(16),z=null,D=0;for(k=0;k<=15;k++)L[k]=0;for(E=0;E=1&&0===L[A];A--);if(O>A&&(O=A),0===A)return f[l++]=0x1400000,f[l++]=0x1400000,h.bits=1,0;for(x=1;x0&&(0===t||1!==A))return -1;for(k=1,U[1]=0;k<15;k++)U[k+1]=U[k]+L[k];for(E=0;E852||2===t&&I>592)return 1;for(;;){v=k-C,c[E]b?(_=z[D+c[E]],w=P[j+c[E]]):(_=96,w=0),d=1<>C)+(p-=d)]=v<<24|_<<16|w;while(0!==p)for(d=1<>=1;if(0!==d?(B&=d-1,B+=d):B=0,E++,0==--L[k]){if(k===A)break;k=e[r+c[E]]}if(k>O&&(B&g)!==y){for(0===C&&(C=O),m+=x,T=1<<(R=k-C);R+C852||2===t&&I>592)return 1;f[y=B&g]=O<<24|R<<16|m-l}}return 0!==B&&(f[m+B]=k-C<<24|4194304),h.bits=O,0}},57235,(t,e,r)=>{"use strict";var n,i,o=t.r(79148),a=t.r(74049),s=t.r(63327),u=t.r(75531),f=t.r(73012);function l(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new o.Buf32(852),e.distcode=e.distdyn=new o.Buf32(592),e.sane=1,e.back=-1,0):-2}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,h(t)):-2}function p(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,d(t)):-2}function y(t,e){var r,n;return t?(t.state=n=new c,n.window=null,0!==(r=p(t,e))&&(t.state=null),r):-2}var g=!0;function m(t,e,r,n){var i,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(o.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),o.arraySet(a.window,e,r-n,i,a.wnext),(n-=i)?(o.arraySet(a.window,e,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=s(r.check,z,2,0),v=0,_=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){t.msg="incorrect header check",r.mode=30;break}if((15&v)!=8){t.msg="unknown compression method",r.mode=30;break}if(v>>>=4,_-=4,B=(15&v)+8,0===r.wbits)r.wbits=B;else if(B>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0,r.mode=3;case 3:for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.head&&(r.head.time=v),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,z[2]=v>>>16&255,z[3]=v>>>24&255,r.check=s(r.check,z,4,0)),v=0,_=0,r.mode=4;case 4:for(;_<16;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.head&&(r.head.xflags=255&v,r.head.os=v>>8),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0,r.mode=5;case 5:if(1024&r.flags){for(;_<16;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.length=v,r.head&&(r.head.extra_len=v),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((k=r.length)>y&&(k=y),k&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),o.arraySet(r.head.extra,c,d,k,B)),512&r.flags&&(r.check=s(r.check,c,k,d)),y-=k,d+=k,r.length-=k),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===y)break e;k=0;do B=c[d+k++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B));while(B&&k>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}t.adler=r.check=l(v),v=0,_=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,2;t.adler=r.check=1,r.mode=12;case 12:if(5===e||6===e)break e;case 13:if(r.last){v>>>=7&_,_-=7&_,r.mode=27;break}for(;_<3;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}switch(r.last=1&v,_-=1,3&(v>>>=1)){case 0:r.mode=14;break;case 1:if(!function(t){if(g){var e;for(n=new o.Buf32(512),i=new o.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(f(1,t.lens,0,288,n,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;f(2,t.lens,0,32,i,0,t.work,{bits:5}),g=!1}t.lencode=n,t.lenbits=9,t.distcode=i,t.distbits=5}(r),r.mode=20,6===e){v>>>=2,_-=2;break e}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}v>>>=2,_-=2;break;case 14:for(v>>>=7&_,_-=7&_;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if((65535&v)!=(v>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&v,v=0,_=0,r.mode=15,6===e)break e;case 15:r.mode=16;case 16:if(k=r.length){if(k>y&&(k=y),k>b&&(k=b),0===k)break e;o.arraySet(h,c,d,k,p),y-=k,d+=k,b-=k,p+=k,r.length-=k;break}r.mode=12;break;case 17:for(;_<14;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(r.nlen=(31&v)+257,_-=5,r.ndist=(31&(v>>>=5))+1,_-=5,r.ncode=(15&(v>>>=5))+4,v>>>=4,_-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,_-=3}for(;r.have<19;)r.lens[D[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},P=f(0,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,P){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(R<16)v>>>=A,_-=A,r.lens[r.have++]=R;else{if(16===R){for(L=A+2;_>>=A,_-=A,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}B=r.lens[r.have-1],k=3+(3&v),v>>>=2,_-=2}else if(17===R){for(L=A+3;_>>=A,_-=A,B=0,k=3+(7&v),v>>>=3,_-=3}else{for(L=A+7;_>>=A,_-=A,B=0,k=11+(127&v),v>>>=7,_-=7}if(r.have+k>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;k--;)r.lens[r.have++]=B}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,j={bits:r.lenbits},P=f(1,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,P){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},P=f(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,P){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break e;case 20:r.mode=21;case 21:if(y>=6&&b>=258){t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,u(t,S),p=t.next_out,h=t.output,b=t.avail_out,d=t.next_in,c=t.input,y=t.avail_in,v=r.hold,_=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;A=(U=r.lencode[v&(1<>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(O&&(240&O)==0){for(C=A,T=O,I=R;A=(U=r.lencode[I+((v&(1<>C)])>>>24,O=U>>>16&255,R=65535&U,!(C+A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}v>>>=C,_-=C,r.back+=C}if(v>>>=A,_-=A,r.back+=A,r.length=R,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=12;break}if(64&O){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(L=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(U=r.distcode[v&(1<>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if((240&O)==0){for(C=A,T=O,I=R;A=(U=r.distcode[I+((v&(1<>C)])>>>24,O=U>>>16&255,R=65535&U,!(C+A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}v>>>=C,_-=C,r.back+=C}if(v>>>=A,_-=A,r.back+=A,64&O){t.msg="invalid distance code",r.mode=30;break}r.offset=R,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(L=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===b)break e;if(k=S-b,r.offset>k){if((k=r.offset-k)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}k>r.wnext?(k-=r.wnext,E=r.wsize-k):E=r.wnext-k,k>r.length&&(k=r.length),x=r.window}else x=h,E=p-r.offset,k=r.length;k>b&&(k=b),b-=k,r.length-=k;do h[p++]=x[E++];while(--k)0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;h[p++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;_<32;){if(0===y)break e;y--,v|=c[d++]<<_,_+=8}if(S-=b,t.total_out+=S,r.total+=S,S&&(t.adler=r.check=r.flags?s(r.check,h,S,p-S):a(r.check,h,S,p-S)),S=b,(r.flags?v:l(v))!==r.check){t.msg="incorrect data check",r.mode=30;break}v=0,_=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(v!==(0|r.total)){t.msg="incorrect length check",r.mode=30;break}v=0,_=0}r.mode=29;case 29:P=1;break e;case 30:P=-3;break e;case 31:return -4;default:return -2}return t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,(r.wsize||S!==t.avail_out&&r.mode<30&&(r.mode<27||4!==e))&&m(t,t.output,t.next_out,S-t.avail_out),w-=t.avail_in,S-=t.avail_out,t.total_in+=w,t.total_out+=S,r.total+=S,r.wrap&&S&&(t.adler=r.check=r.flags?s(r.check,h,S,t.next_out-S):a(r.check,h,S,t.next_out-S)),t.data_type=r.bits+64*!!r.last+128*(12===r.mode)+256*(20===r.mode||15===r.mode),(0===w&&0===S||4===e)&&0===P&&(P=-5),P},r.inflateEnd=function(t){if(!t||!t.state)return -2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},r.inflateGetHeader=function(t,e){var r;return t&&t.state&&(2&(r=t.state).wrap)!=0?(r.head=e,e.done=!1,0):-2},r.inflateSetDictionary=function(t,e){var r,n=e.length;return t&&t.state&&(0===(r=t.state).wrap||11===r.mode)?11===r.mode&&a(1,e,n,0)!==r.check?-3:m(t,e,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},r.inflateInfo="pako inflate (from Nodeca project)"},34131,(t,e,r)=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},24448,(t,e,r)=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},82473,(t,e,r)=>{"use strict";var n=t.r(57235),i=t.r(79148),o=t.r(63202),a=t.r(34131),s=t.r(19558),u=t.r(98899),f=t.r(24448),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits)==0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==a.Z_OK||(this.header=new f,n.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw)&&(r=n.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK))throw Error(s[r])}function h(t,e){var r=new c(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}c.prototype.push=function(t,e){var r,s,u,f,c,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,y=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?h.input=o.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?h.input=new Uint8Array(t):h.input=t,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===y&&(r=a.Z_OK,y=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0===h.avail_out||r===a.Z_STREAM_END||0===h.avail_in&&(s===a.Z_FINISH||s===a.Z_SYNC_FLUSH))&&("string"===this.options.to?(u=o.utf8border(h.output,h.next_out),f=h.next_out-u,c=o.buf2string(h.output,u),h.next_out=f,h.avail_out=d-f,f&&i.arraySet(h.output,h.output,u,f,0),this.onData(c)):this.onData(i.shrinkBuf(h.output,h.next_out))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==a.Z_STREAM_END)return(r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH)?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):(s===a.Z_SYNC_FLUSH&&(this.onEnd(a.Z_OK),h.avail_out=0),!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Inflate=c,r.inflate=h,r.inflateRaw=function(t,e){return(e=e||{}).raw=!0,h(t,e)},r.ungzip=h},9643,(t,e,r)=>{"use strict";var n=t.r(79148).assign,i=t.r(48901),o=t.r(82473),a=t.r(34131),s={};n(s,i,o,a),e.exports=s},72488,(t,e,r)=>{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t.r(9643),o=t.r(65464),a=t.r(48913),s=n?"uint8array":"array";function u(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",o.inherits(u,a),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,t.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new u("Deflate",t)},r.uncompressWorker=function(){return new u("Inflate",{})}},36462,(t,e,r)=>{"use strict";var n=t.r(48913);r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t.r(72488)},71471,(t,e,r)=>{"use strict";r.LOCAL_FILE_HEADER="PK\x03\x04",r.CENTRAL_FILE_HEADER="PK\x01\x02",r.CENTRAL_DIRECTORY_END="PK\x05\x06",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",r.DATA_DESCRIPTOR="PK\x07\b"},21908,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913),o=t.r(46253),a=t.r(63494),s=t.r(71471),u=function(t,e){var r,n="";for(r=0;r>>=8;return n},f=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16},l=function(t,e,r,i,l,c){var h,d,p=t.file,y=t.compression,g=c!==o.utf8encode,m=n.transformTo("string",c(p.name)),b=n.transformTo("string",o.utf8encode(p.name)),v=p.comment,_=n.transformTo("string",c(v)),w=n.transformTo("string",o.utf8encode(v)),S=b.length!==p.name.length,k=w.length!==v.length,E="",x="",A="",O=p.dir,R=p.date,C={crc32:0,compressedSize:0,uncompressedSize:0};(!e||r)&&(C.crc32=t.crc32,C.compressedSize=t.compressedSize,C.uncompressedSize=t.uncompressedSize);var T=0;e&&(T|=8),!g&&(S||k)&&(T|=2048);var I=0,B=0;(O&&(I|=16),"UNIX"===l)?(B=798,I|=f(p.unixPermissions,O)):(B=20,I|=63&(p.dosPermissions||0)),h=(R.getUTCHours()<<6|R.getUTCMinutes())<<5|R.getUTCSeconds()/2,d=(R.getUTCFullYear()-1980<<4|R.getUTCMonth()+1)<<5|R.getUTCDate(),S&&(x=u(1,1)+u(a(m),4)+b,E+="up"+u(x.length,2)+x),k&&(A=u(1,1)+u(a(_),4)+w,E+="uc"+u(A.length,2)+A);var P="";return P+="\n\0",P+=u(T,2),P+=y.magic,P+=u(h,2),P+=u(d,2),P+=u(C.crc32,4),P+=u(C.compressedSize,4),P+=u(C.uncompressedSize,4),P+=u(m.length,2),P+=u(E.length,2),{fileRecord:s.LOCAL_FILE_HEADER+P+m+E,dirRecord:s.CENTRAL_FILE_HEADER+u(B,2)+P+u(_.length,2)+"\0\0\0\0"+u(I,4)+u(i,4)+m+E+_}},c=function(t,e,r,i,o){var a=n.transformTo("string",o(i));return s.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(t,2)+u(t,2)+u(e,4)+u(r,4)+u(a.length,2)+a},h=function(t){return s.DATA_DESCRIPTOR+u(t.crc32,4)+u(t.compressedSize,4)+u(t.uncompressedSize,4)};function d(t,e,r,n){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(d,i),d.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,i.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},d.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=l(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=l(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:h(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e{"use strict";var n=t.r(36462),i=t.r(21908),o=function(t,e){var r=t||e,i=n[r];if(!i)throw Error(r+" is not a valid compression method !");return i};r.generateWorker=function(t,e,r){var n=new i(e.streamFiles,r,e.platform,e.encodeFileName),a=0;try{t.forEach(function(t,r){a++;var i=o(r.options.compression,e.compression),s=r.options.compressionOptions||e.compressionOptions||{},u=r.dir,f=r.date;r._compressWorker(i,s).withStreamInfo("file",{name:t,dir:u,date:f,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(n)}),n.entriesCount=a}catch(t){n.error(t)}return n}},13303,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t,e){i.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}n.inherits(o,i),o.prototype._bindStream=function(t){var e=this;this._stream=t,t.pause(),t.on("data",function(t){e.push({data:t,meta:{percent:0}})}).on("error",function(t){e.isPaused?this.generatedError=t:e.error(t)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=o},1223,(t,e,r)=>{"use strict";var n=t.r(46253),i=t.r(65464),o=t.r(48913),a=t.r(846),s=t.r(13133),u=t.r(43220),f=t.r(52929),l=t.r(6664),c=t.r(42527),h=t.r(13303),d=function(t,e,r){var n,a=i.getTypeOf(e),l=i.extend(r||{},s);l.date=l.date||new Date,null!==l.compression&&(l.compression=l.compression.toUpperCase()),"string"==typeof l.unixPermissions&&(l.unixPermissions=parseInt(l.unixPermissions,8)),l.unixPermissions&&16384&l.unixPermissions&&(l.dir=!0),l.dosPermissions&&16&l.dosPermissions&&(l.dir=!0),l.dir&&(t=y(t)),l.createFolders&&(n=p(t))&&g.call(this,n,!0);var d="string"===a&&!1===l.binary&&!1===l.base64;r&&void 0!==r.binary||(l.binary=!d),(e instanceof u&&0===e.uncompressedSize||l.dir||!e||0===e.length)&&(l.base64=!1,l.binary=!0,e="",l.compression="STORE",a="string");var m=null;m=e instanceof u||e instanceof o?e:c.isNode&&c.isStream(e)?new h(t,e):i.prepareContent(t,e,l.binary,l.optimizedBinaryString,l.base64);var b=new f(t,m,l);this.files[t]=b},p=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},y=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},g=function(t,e){return e=void 0!==e?e:s.createFolders,t=y(t),this.files[t]||d.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function m(t){return"[object RegExp]"===Object.prototype.toString.call(t)}e.exports={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,r,n;for(e in this.files)n=this.files[e],(r=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(r,n)},filter:function(t){var e=[];return this.forEach(function(r,n){t(r,n)&&e.push(n)}),e},file:function(t,e,r){if(1==arguments.length)if(m(t)){var n=t;return this.filter(function(t,e){return!e.dir&&n.test(t)})}else{var i=this.files[this.root+t];return i&&!i.dir?i:null}return t=this.root+t,d.call(this,t,e,r),this},folder:function(t){if(!t)return this;if(m(t))return this.filter(function(e,r){return r.dir&&t.test(e)});var e=this.root+t,r=g.call(this,e),n=this.clone();return n.root=r.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var r=this.filter(function(e,r){return r.name.slice(0,t.length)===t}),n=0;n{"use strict";var n=t.r(65464);function i(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC((t>>25&127)+1980,(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},12189,(t,e,r)=>{"use strict";var n=t.r(37384);function i(t){n.call(this,t);for(var e=0;e=0;--o)if(this.data[o]===e&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return -1},i.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),i=t.charCodeAt(3),o=this.readData(4);return e===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},41370,(t,e,r)=>{"use strict";var n=t.r(37384);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},15841,(t,e,r)=>{"use strict";var n=t.r(12189);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},44429,(t,e,r)=>{"use strict";var n=t.r(15841);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},71770,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(87780),o=t.r(12189),a=t.r(41370),s=t.r(44429),u=t.r(15841);e.exports=function(t){var e=n.getTypeOf(t);return(n.checkSupport(e),"string"!==e||i.uint8array)?"nodebuffer"===e?new s(t):i.uint8array?new u(n.transformTo("uint8array",t)):new o(n.transformTo("array",t)):new a(t)}},92861,(t,e,r)=>{"use strict";var n=t.r(71770),i=t.r(65464),o=t.r(43220),a=t.r(63494),s=t.r(46253),u=t.r(36462),f=t.r(87780),l=function(t){for(var e in u)if(Object.prototype.hasOwnProperty.call(u,e)&&u[e].magic===t)return u[e];return null};function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(t){var e,r;if(t.skip(22),this.fileNameLength=t.readInt(2),r=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=l(this.compressionMethod)))throw Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4{"use strict";var n=t.r(71770),i=t.r(65464),o=t.r(71471),a=t.r(92861),s=t.r(87780);function u(t){this.files=[],this.loadOptions=t}u.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+i.pretty(e)+", expected "+i.pretty(t)+")")}},isSignature:function(t,e){var r=this.reader.index;this.reader.setIndex(t);var n=this.reader.readString(4);return this.reader.setIndex(r),n===e},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=s.uint8array?"uint8array":"array",r=i.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,r,n=this.zip64EndOfCentralSize-44;01)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t0)this.isSignature(e,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(t){this.reader=n(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=u},37153,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(24375),o=t.r(46253),a=t.r(12938),s=t.r(1648),u=t.r(42527);e.exports=function(t,e){var r=this;return(e=n.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(t))?i.Promise.reject(Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var r=new a(e);return r.load(t),r}).then(function(t){var r=[i.Promise.resolve(t)],n=t.files;if(e.checkCRC32)for(var o=0;o{"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}n.prototype=t.r(1223),n.prototype.loadAsync=t.r(37153),n.support=t.r(87780),n.defaults=t.r(13133),n.version="3.10.1",n.loadAsync=function(t,e){return new n().loadAsync(t,e)},n.external=t.r(24375),e.exports=n},96165,t=>{"use strict";t.s(["SKIN_ASSET_BASE_URL",()=>e,"SKIN_GALLERY_BASE_URL",()=>n,"SKIN_MANIFEST_URL",()=>r]);let e="https://assets.tribes2.online/skins/files",r="https://assets.tribes2.online/skins/manifest.json",n="https://assets.tribes2.online/skins/gallery"}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/40cecef8385b39df.js b/docs/_next/static/chunks/c8d20bf4c6d52266.js similarity index 63% rename from docs/_next/static/chunks/40cecef8385b39df.js rename to docs/_next/static/chunks/c8d20bf4c6d52266.js index e62a634..4a68458 100644 --- a/docs/_next/static/chunks/40cecef8385b39df.js +++ b/docs/_next/static/chunks/c8d20bf4c6d52266.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36159,(e,t,r)=>{"use strict";function n(){return null}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n}}),("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},98183,(e,t,r)=>{"use strict";function n(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function l(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function a(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,l(e));else t.set(r,l(n));return t}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{formatUrl:function(){return a},formatWithValidation:function(){return u},urlObjectKeys:function(){return o}});let n=e.r(90809)._(e.r(98183)),l=/https?|ftp|gopher|file/;function a(e){let{auth:t,hostname:r}=e,a=e.protocol||"",o=e.pathname||"",u=e.hash||"",i=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?"["+r+"]":r),e.port&&(c+=":"+e.port)),i&&"object"==typeof i&&(i=String(n.urlQueryToSearchParams(i)));let s=e.search||i&&"?"+i||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||l.test(a))&&!1!==c?(c="//"+(c||""),o&&"/"!==o[0]&&(o="/"+o)):c||(c=""),u&&"#"!==u[0]&&(u="#"+u),s&&"?"!==s[0]&&(s="?"+s),""+a+c+(o=o.replace(/[?#]/g,encodeURIComponent))+(s=s.replace("#","%23"))+u}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return a(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return l}});let n=e.r(71645);function l(e,t){let r=(0,n.useRef)(null),l=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=l.current;t&&(l.current=null,t())}else e&&(r.current=a(e,n)),t&&(l.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{DecodeError:function(){return v},MiddlewareNotFoundError:function(){return _},MissingStaticPage:function(){return m},NormalizeError:function(){return y},PageNotFoundError:function(){return g},SP:function(){return p},ST:function(){return h},WEB_VITALS:function(){return n},execOnce:function(){return l},getDisplayName:function(){return c},getLocationOrigin:function(){return u},getURL:function(){return i},isAbsoluteUrl:function(){return o},isResSent:function(){return s},loadGetInitialProps:function(){return d},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return b}});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function l(e){let t,r=!1;return function(){for(var n=arguments.length,l=Array(n),a=0;aa.test(e);function u(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function i(){let{href:e}=window.location,t=u();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function s(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function d(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await d(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&s(r))return n;if(!n)throw Object.defineProperty(Error('"'+c(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.'),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let p="undefined"!=typeof performance,h=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class m extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class _ extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function b(e){return JSON.stringify({message:e.message,stack:e.stack})}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(18967),l=e.r(52817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,l.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{default:function(){return y},useLinkStatus:function(){return m}});let n=e.r(90809),l=e.r(43476),a=n._(e.r(71645)),o=e.r(95057),u=e.r(8372),i=e.r(18581),c=e.r(18967),s=e.r(5550);e.r(33525);let f=e.r(91949),d=e.r(73668),p=e.r(99781);e.r(84508);let h=e.r(65165);function v(e){return"string"==typeof e?e:(0,o.formatUrl)(e)}function y(e){var t;let r,n,o,[y,m]=(0,a.useOptimistic)(f.IDLE_LINK_STATUS),_=(0,a.useRef)(null),{href:b,as:j,children:O,prefetch:w=null,passHref:S,replace:x,shallow:k,scroll:A,onClick:T,onMouseEnter:E,onTouchStart:C,legacyBehavior:M=!1,onNavigate:P,ref:I,unstable_dynamicOnHover:U,...N}=e;r=O,M&&("string"==typeof r||"number"==typeof r)&&(r=(0,l.jsx)("a",{children:r}));let R=a.default.useContext(u.AppRouterContext),L=!1!==w,z=!1!==w?null===(t=w)||"auto"===t?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:D,as:H}=a.default.useMemo(()=>{let e=v(b);return{href:e,as:j?v(j):e}},[b,j]);M&&(n=a.default.Children.only(r));let G=M?n&&"object"==typeof n&&n.ref:I,F=a.default.useCallback(e=>(null!==R&&(_.current=(0,f.mountLinkInstance)(e,D,R,z,L,m)),()=>{_.current&&((0,f.unmountLinkForCurrentNavigation)(_.current),_.current=null),(0,f.unmountPrefetchableInstance)(e)}),[L,D,R,z,m]),B={ref:(0,i.useMergedRef)(F,G),onClick(e){M||"function"!=typeof T||T(e),M&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),R&&(e.defaultPrevented||function(e,t,r,n,l,o,u){let{nodeName:i}=e.currentTarget;if(!("A"===i.toUpperCase()&&function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||e.currentTarget.hasAttribute("download"))){if(!(0,d.isLocalURL)(t)){l&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),u){let e=!1;if(u({preventDefault:()=>{e=!0}}),e)return}a.default.startTransition(()=>{(0,p.dispatchNavigateAction)(r||t,l?"replace":"push",null==o||o,n.current)})}}(e,D,H,_,x,A,P))},onMouseEnter(e){M||"function"!=typeof E||E(e),M&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),R&&L&&(0,f.onNavigationIntent)(e.currentTarget,!0===U)},onTouchStart:function(e){M||"function"!=typeof C||C(e),M&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),R&&L&&(0,f.onNavigationIntent)(e.currentTarget,!0===U)}};return(0,c.isAbsoluteUrl)(H)?B.href=H:M&&!S&&("a"!==n.type||"href"in n.props)||(B.href=(0,s.addBasePath)(H)),o=M?a.default.cloneElement(n,B):(0,l.jsx)("a",{...N,...B,children:r}),(0,l.jsx)(g.Provider,{value:y,children:o})}let g=(0,a.createContext)(f.IDLE_LINK_STATUS),m=()=>(0,a.useContext)(g);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},29402,(e,t,r)=>{var n,l,a="__lodash_hash_undefined__",o=1/0,u="[object Arguments]",i="[object Array]",c="[object Boolean]",s="[object Date]",f="[object Error]",d="[object Function]",p="[object Map]",h="[object Number]",v="[object Object]",y="[object Promise]",g="[object RegExp]",m="[object Set]",_="[object String]",b="[object Symbol]",j="[object WeakMap]",O="[object ArrayBuffer]",w="[object DataView]",S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,x=/^\w*$/,k=/^\./,A=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,T=/\\(\\)?/g,E=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,M={};M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M[u]=M[i]=M[O]=M[c]=M[w]=M[s]=M[f]=M[d]=M[p]=M[h]=M[v]=M[g]=M[m]=M[_]=M[j]=!1;var P=e.g&&e.g.Object===Object&&e.g,I="object"==typeof self&&self&&self.Object===Object&&self,U=P||I||Function("return this")(),N=r&&!r.nodeType&&r,R=N&&t&&!t.nodeType&&t,L=R&&R.exports===N&&P.process,z=function(){try{return L&&L.binding("util")}catch(e){}}(),D=z&&z.isTypedArray;function H(e,t){for(var r=-1,n=e?e.length:0,l=Array(n);++r-1},eb.prototype.set=function(e,t){var r=this.__data__,n=eS(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ej.prototype.clear=function(){this.__data__={hash:new e_,map:new(eo||eb),string:new e_}},ej.prototype.delete=function(e){return eP(this,e).delete(e)},ej.prototype.get=function(e){return eP(this,e).get(e)},ej.prototype.has=function(e){return eP(this,e).has(e)},ej.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eO.prototype.add=eO.prototype.push=function(e){return this.__data__.set(e,a),this},eO.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.clear=function(){this.__data__=new eb},ew.prototype.delete=function(e){return this.__data__.delete(e)},ew.prototype.get=function(e){return this.__data__.get(e)},ew.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.set=function(e,t){var r=this.__data__;if(r instanceof eb){var n=r.__data__;if(!eo||n.length<199)return n.push([e,t]),this;r=this.__data__=new ej(n)}return r.set(e,t),this};var ex=function(e,t){return function(r,n){if(null==r)return r;if(!eq(r))return e(r,n);for(var l=r.length,a=-1,o=Object(r);(t?a--:++au))return!1;var c=a.get(e);if(c&&a.get(t))return c==t;var s=-1,f=!0,d=1&l?new eO:void 0;for(a.set(e,t),a.set(t,e);++s-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eK(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eQ(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eQ(e)&&X.call(e)==b}var eY=D?G(D):function(e){return eQ(e)&&e$(e.length)&&!!M[X.call(e)]};function eX(e){return eq(e)?function(e,t){var r=eV(e)||eB(e)?function(e,t){for(var r=-1,n=Array(e);++rt||a&&o&&i&&!u&&!c||n&&o&&i||!r&&i||!l)return 1;if(!n&&!a&&!c&&e=u)return i;return i*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});i--;)u[i]=u[i].value;return u}(e,t,r))}},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},l=Object.keys(n).join("|"),a=RegExp(l,"g"),o=RegExp(l,"");function u(e){return n[e]}var i=function(e){return e.replace(a,u)};t.exports=i,t.exports.has=function(e){return!!e.match(o)},t.exports.remove=i},97052,e=>{e.v({Back:"gallery-module__zlwOTG__Back",Detail:"gallery-module__zlwOTG__Detail",DownloadButton:"gallery-module__zlwOTG__DownloadButton",DownloadHiRes:"gallery-module__zlwOTG__DownloadHiRes",DownloadSection:"gallery-module__zlwOTG__DownloadSection",DownloadSkin:"gallery-module__zlwOTG__DownloadSkin",DownloadSpinner:"gallery-module__zlwOTG__DownloadSpinner",Gallery:"gallery-module__zlwOTG__Gallery",GalleryPage:"gallery-module__zlwOTG__GalleryPage",HeaderEnd:"gallery-module__zlwOTG__HeaderEnd",HeaderMain:"gallery-module__zlwOTG__HeaderMain",HiResSelect:"gallery-module__zlwOTG__HiResSelect",IconLink:"gallery-module__zlwOTG__IconLink",InputContainer:"gallery-module__zlwOTG__InputContainer",Label:"gallery-module__zlwOTG__Label",LoadInEditor:"gallery-module__zlwOTG__LoadInEditor",Name:"gallery-module__zlwOTG__Name",PackVersion:"gallery-module__zlwOTG__PackVersion",Preview:"gallery-module__zlwOTG__Preview",SearchButton:"gallery-module__zlwOTG__SearchButton",SearchInput:"gallery-module__zlwOTG__SearchInput",Skin:"gallery-module__zlwOTG__Skin",Spinner:"gallery-module__zlwOTG__Spinner",Tools:"gallery-module__zlwOTG__Tools",spin:"gallery-module__zlwOTG__spin"})},25500,e=>{"use strict";e.s(["default",()=>L],25500);var t=e.i(43476),r=e.i(71645),n=e.i(36159),l=e.i(22016),a=e.i(40141);function o(e){return(0,a.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{opacity:"0.2",fillRule:"evenodd",clipRule:"evenodd",d:"M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M12 22C17.5228 22 22 17.5228 22 12H19C19 15.866 15.866 19 12 19V22Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M2 12C2 6.47715 6.47715 2 12 2V5C8.13401 5 5 8.13401 5 12H2Z",fill:"currentColor"},child:[]}]})(e)}var u=e.i(90106),i=e.i(11152),c=e.i(50361),s=e.i(24540);function f(e,t,r){try{return e(t)}catch(e){return(0,s.l)("[nuqs] Error while parsing value `%s`: %O"+(r?" (for key `%s`)":""),t,e,r),null}}function d(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),f(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide(r){var n;return null!=(n=t(r))?n:e}}},withOptions(e){return{...this,...e}}}}function p(e,t){return e.valueOf()===t.valueOf()}d({parse:e=>e,serialize:String}),d({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),d({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),d({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),d({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String}),d({parse:e=>"true"===e.toLowerCase(),serialize:String}),d({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:p}),d({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:p}),d({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:p});let h=(0,c.r)(),v={};function y(e,t,r,n,l,a){let o=!1,u=Object.entries(e).reduce((e,u)=>{var i,s,d,p,h,v;let[y,g]=u,m=null!=(i=null==t?void 0:t[y])?i:y,_=n[m],b="multi"===g.type?[]:null,j=void 0===_?null!=(s="multi"===g.type?null==r?void 0:r.getAll(m):null==r?void 0:r.get(m))?s:b:_;return l&&a&&((v=null!=(d=l[m])?d:b)===j||null!==v&&null!==j&&"string"!=typeof v&&"string"!=typeof j&&v.length===j.length&&v.every((e,t)=>e===j[t]))?e[y]=null!=(p=a[y])?p:null:(o=!0,e[y]=null!=(h=(0,c.i)(j)?null:f(g.parse,j,m))?h:null,l&&(l[m]=j)),e},{});if(!o){let t=Object.keys(e),r=Object.keys(null!=a?a:{});o=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:u,hasChanged:o}}function g(e,t){return Object.fromEntries(Object.keys(e).map(r=>{var n,l;return[r,null!=(l=null!=(n=e[r])?n:t[r])?l:null]}))}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{parse:n,type:l,serialize:a,eq:o,defaultValue:u,...i}=t,[{[e]:f},d]=function(e){var t,n,l;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=(0,r.useId)(),u=(0,s.i)(),i=(0,s.a)(),{history:f="replace",scroll:d=null!=(t=null==u?void 0:u.scroll)&&t,shallow:p=null==(n=null==u?void 0:u.shallow)||n,throttleMs:m=c.s.timeMs,limitUrlUpdates:_=null==u?void 0:u.limitUrlUpdates,clearOnDefault:b=null==(l=null==u?void 0:u.clearOnDefault)||l,startTransition:j,urlKeys:O=v}=a,w=Object.keys(e).join(","),S=(0,r.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>{var t;return[e,null!=(t=O[e])?t:e]})),[w,JSON.stringify(O)]),x=(0,s.r)(Object.values(S)),k=x.searchParams,A=(0,r.useRef)({}),T=(0,r.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>{var r;return[t,null!=(r=e[t].defaultValue)?r:null]})),[Object.values(e).map(e=>{let{defaultValue:t}=e;return t}).join(",")]),E=c.t.useQueuedQueries(Object.values(S)),[C,M]=(0,r.useState)(()=>y(e,O,null!=k?k:new URLSearchParams,E).state),P=(0,r.useRef)(C);if((0,s.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",o,w,C,k),Object.keys(A.current).join("&")!==Object.values(S).join("&")){let{state:t,hasChanged:r}=y(e,O,k,E,A.current,P.current);r&&((0,s.c)("[nuq+ %s `%s`] State changed: %O",o,w,{state:t,initialSearchParams:k,queuedQueries:E,queryRef:A.current,stateRef:P.current}),P.current=t,M(t)),A.current=Object.fromEntries(Object.entries(S).map(t=>{var r,n;let[l,a]=t;return[a,(null==(r=e[l])?void 0:r.type)==="multi"?null==k?void 0:k.getAll(a):null!=(n=null==k?void 0:k.get(a))?n:null]}))}(0,r.useEffect)(()=>{let{state:t,hasChanged:r}=y(e,O,k,E,A.current,P.current);r&&((0,s.c)("[nuq+ %s `%s`] State changed: %O",o,w,{state:t,initialSearchParams:k,queuedQueries:E,queryRef:A.current,stateRef:P.current}),P.current=t,M(t))},[Object.values(S).map(e=>"".concat(e,"=").concat(null==k?void 0:k.getAll(e))).join("&"),JSON.stringify(E)]),(0,r.useEffect)(()=>{let t=Object.keys(e).reduce((t,r)=>(t[r]=t=>{let{state:n,query:l}=t;M(t=>{var a,u,i;let{defaultValue:c}=e[r],f=S[r],d=null!=(a=null!=n?n:c)?a:null;return Object.is(null!=(i=null!=(u=t[r])?u:c)?i:null,d)?((0,s.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",o,w,f,n,c,P.current),t):(P.current={...P.current,[r]:d},A.current[f]=l,(0,s.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",o,w,f,n,c,P.current),P.current)})},t),{});for(let r of Object.keys(e)){let e=S[r];(0,s.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",o,e,w),h.on(e,t[r])}return()=>{for(let r of Object.keys(e)){let e=S[r];(0,s.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",o,e,w),h.off(e,t[r])}}},[w,S]);let I=(0,r.useCallback)(function(t){var r,n,l,a,u,v,y,O,k,A,E,C,M,I,U,N,R,L,z,D,H,G,F,B,V,q,W;let $,K=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},Q=Object.fromEntries(Object.keys(e).map(e=>[e,null])),Z="function"==typeof t?null!=(r=t(g(P.current,T)))?r:Q:null!=t?t:Q;(0,s.c)("[nuq+ %s `%s`] setState: %O",o,w,Z);let Y=0,X=!1,J=[];for(let[t,r]of Object.entries(Z)){let o=e[t],g=S[t];if(!o||void 0===r)continue;(null!=(u=null!=(a=K.clearOnDefault)?a:o.clearOnDefault)?u:b)&&null!==r&&void 0!==o.defaultValue&&(null!=(v=o.eq)?v:(e,t)=>e===t)(r,o.defaultValue)&&(r=null);let w=null===r?null:(null!=(y=o.serialize)?y:String)(r);h.emit(g,{state:r,query:w});let T={key:g,query:w,options:{history:null!=(k=null!=(O=K.history)?O:o.history)?k:f,shallow:null!=(E=null!=(A=K.shallow)?A:o.shallow)?E:p,scroll:null!=(M=null!=(C=K.scroll)?C:o.scroll)?M:d,startTransition:null!=(U=null!=(I=K.startTransition)?I:o.startTransition)?U:j}};if((null==K||null==(n=K.limitUrlUpdates)?void 0:n.method)==="debounce"||(null==_?void 0:_.method)==="debounce"||(null==(l=o.limitUrlUpdates)?void 0:l.method)==="debounce"){!0===T.options.shallow&&console.warn((0,s.s)(422));let e=null!=(D=null!=(z=null!=(L=null==K||null==(N=K.limitUrlUpdates)?void 0:N.timeMs)?L:null==_?void 0:_.timeMs)?z:null==(R=o.limitUrlUpdates)?void 0:R.timeMs)?D:c.s.timeMs,t=c.t.push(T,e,x,i);Yt(e),X?c.n.flush(x,i):c.n.getPendingPromise(x));return null!=$?$:ee},[w,f,p,d,m,null==_?void 0:_.method,null==_?void 0:_.timeMs,j,S,x.updateUrl,x.getSearchParamsSnapshot,x.rateLimitFactor,i,T]);return[(0,r.useMemo)(()=>g(C,T),[C,T]),I]}({[e]:{parse:null!=n?n:e=>e,type:l,serialize:a,eq:o,defaultValue:u}},i);return[f,(0,r.useCallback)(function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return d(r=>({[e]:"function"==typeof t?t(r[e]):t}),r)},[e,d])]}var _=e.i(29402),b=e.i(38360);let j={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},O=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function w(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{keys:n,threshold:l=j.MATCHES,baseSort:a=O,sorter:o=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:l}=e,{rank:a,keyIndex:o}=t;return n!==a?n>a?-1:1:l===o?r(e,t):l{let{rank:n,rankedValue:l,keyIndex:a,keyThreshold:o}=e,{itemValue:u,attributes:i}=t,f=S(u,c,s),d=l,{minRanking:p,maxRanking:h,threshold:v}=i;return f=j.MATCHES?f=p:f>h&&(f=h),f>n&&(n=f,a=r,o=v,d=u),{rankedValue:d,rank:n,keyIndex:a,keyThreshold:o}},{rankedValue:u,rank:j.NO_MATCH,keyIndex:-1,keyThreshold:s.threshold}):{rankedValue:u,rank:S(u,c,s),keyIndex:-1,keyThreshold:s.threshold}),{rank:d,keyThreshold:p=l}=f;return d>=p&&e.push({...f,item:a,index:o}),e},[])).map(e=>{let{item:t}=e;return t})}function S(e,t,r){if(e=x(e,r),(t=x(t,r)).length>e.length)return j.NO_MATCH;if(e===t)return j.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),l=n.next(),a=l.value;if(e.length===t.length&&0===a)return j.EQUAL;if(0===a)return j.STARTS_WITH;let o=l;for(;!o.done;){if(o.value>0&&" "===e[o.value-1])return j.WORD_STARTS_WITH;o=n.next()}return a>0?j.CONTAINS:1===t.length?j.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return j.NO_MATCH;var o=n-a;let u=r/t.length;return j.MATCHES+1/o*u}(e,t)}function x(e,t){let{keepDiacritics:r}=t;return e="".concat(e),r||(e=(0,b.default)(e)),e}w.rankings=j;let k={maxRanking:1/0,minRanking:-1/0};var A=e.i(15768),T=e.i(97052),E=e.i(69642),C=e.i(53653),M=e.i(20592);let P=[];function I(e){return M.default.materials[e].map(e=>{var t;if(e.hidden||!1===e.selectable)return null;let r=null!=(t=e.file)?t:e.name;if(r)if("number"==typeof e.frameCount&&e.frameCount>1)return Array(e.frameCount).fill(r).map((e,t)=>{if(!(t>0))return e;{let r=/^(.+[^\d])(\d{2,})$/.exec(e);if(r){let e=r[1],n=r[2];return"".concat(e).concat(t.toString().padStart(n.length,"0"))}throw Error("frameCount > 0, but could not parse index")}});else return r}).flat().filter(e=>null!=e).map(e=>"".concat(e,".png"))}let U={lmale:0,mmale:1,lfemale:2,mfemale:3,hmale:4,lbioderm:5,mbioderm:6,hbioderm:7,energy:8,disc:9,chaingun:10,grenade_launcher:11,sniper:12,elf:13,shocklance:14,plasmathrower:15,missile:16,mortar:17,repair:18,targeting:19,vehicle_grav_scout:20,vehicle_grav_tank:21,turret_assaulttank_mortar:22,vehicle_land_mpbbase:23,vehicle_air_scout:24,vehicle_air_bomber:25,vehicle_air_hapc:26};function N(e){let t=[];return Object.entries(e).forEach(e=>{let[r,n]=e;t.push(...n.map(e=>({name:e,model:r})))}),(0,_.default)(t,[e=>e.name.toLowerCase(),e=>U[e.model]],["asc","asc"])}function R(){var e,a,c;let s=(0,r.useRef)(null),[f,d]=m("q",{defaultValue:"",clearOnDefault:!0}),[p,h]=(0,r.useState)(f.trim()?"search":"select"),v=(0,r.useDeferredValue)(f),[y,g]=(0,A.default)(),[b,j]=m("filter",{defaultValue:"lmale",clearOnDefault:!1}),[O,S]=(0,r.useState)(!1),[x,k]=(0,r.useState)("prompt"),M="hfemale"===b?"hmale":b,U=null!=(c=null==(e=y.customSkins)?void 0:e[M])?c:P,R="new"===b,L=null==y||null==(a=y.packs)?void 0:a[b],z=null!=L;(0,r.useEffect)(()=>{let e=localStorage.getItem("hiResDownload");switch(e){case"yes":case"no":k(e)}},[]),(0,r.useEffect)(()=>{if(L&&O){let e=!1;return(async()=>{let t=L.files,r=t.some(e=>y.sizeMultiplier[e]>1);if(r&&"prompt"===x){window.alert("This download contains HD textures, which require the QoL patch. Select “yes” or “no” for HD support, then try again."),s.current&&s.current.focus(),S(!1);return}let n="yes"===x?t:t.map(e=>y.sizeMultiplier[e]>1?e.replace(/\.png$/,"@1x.png"):e),l="zSkinPack-".concat(b,"-v").concat(L.version,".vl2");r&&"no"===x&&(l=l.replace(/\.vl2$/,"@1x.vl2"));let a=await (0,E.collectFiles)(n);if(!e){let t=(0,E.createZipFile)(a);await new Promise(e=>setTimeout(e,500)),e||await (0,E.saveZipFile)(t,l),e||S(!1)}})(),()=>{e=!0,S(!1)}}},[x,O,y.sizeMultiplier,L,b]);let D=(0,r.useMemo)(()=>{var e;return(0,_.default)(Object.keys(null!=(e=null==y?void 0:y.packs)?e:{}),e=>e.toLowerCase(),["asc"])},[y]),H=(0,r.useMemo)(()=>{var e,t;let r=R?null==y?void 0:y.newSkins:z?null==y||null==(t=y.packs)||null==(e=t[b])?void 0:e.skins:null;return r?N(r):[]},[R,z,b,y]),G=(0,r.useMemo)(()=>y.customSkins?N(y.customSkins):[],[y.customSkins]),F=v.trim().length>0,B=(0,r.useMemo)(()=>F?w(G,v,{keys:["name"]}):[],[G,v,F]),V="search"===p&&F?B:R||z?H:U;(0,r.useEffect)(()=>{S(!1)},[b]);let q=(0,r.useRef)(null),W=(0,r.useRef)(null);return(0,r.useEffect)(()=>{var e,t;switch(p){case"search":null==(e=q.current)||e.focus();break;case"select":null==(t=W.current)||t.focus()}},[p]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.default,{children:(0,t.jsx)("title",{children:"Tribes 2 Skin Gallery"})}),(0,t.jsxs)("main",{className:T.default.GalleryPage,children:[(0,t.jsxs)("header",{className:T.default.Tools,children:[(0,t.jsxs)(l.default,{className:T.default.Back,href:"../",children:[(0,t.jsx)(i.FaChevronLeft,{size:12,className:T.default.Icon})," ",(0,t.jsx)("span",{className:T.default.Label,children:"Back to Editor"})]}),(0,t.jsxs)("div",{className:T.default.HeaderMain,children:[(0,t.jsx)("button",{className:T.default.SearchButton,title:"select"===p?"Search":"Close search mode",onClick:()=>{h(e=>"select"===e?"search":"select"),d("")},children:"select"===p?(0,t.jsx)(i.FaSearch,{}):(0,t.jsx)(i.FaTimes,{})}),(0,t.jsxs)("div",{className:T.default.InputContainer,children:[(0,t.jsx)("input",{type:"text",ref:q,className:T.default.SearchInput,hidden:"select"===p,placeholder:"Search ".concat(G.length.toLocaleString()," skins…"),value:f,onChange:e=>d(e.target.value),onKeyDown:e=>{"Escape"===e.key&&(h("select"),d(""))}}),(0,t.jsxs)("select",{ref:W,id:"ModelSelect","aria-label":"Player model",onChange:e=>{j(e.target.value)},value:b,style:{visibility:"search"===p?"hidden":"visible"},children:[(0,t.jsx)("option",{value:"new",children:"All new skins ✨"}),(0,t.jsx)("optgroup",{label:"Packs",children:D.map(e=>(0,t.jsx)("option",{value:e,children:e},e))}),(0,t.jsxs)("optgroup",{label:"Players","data-model-type":"player",children:[(0,t.jsx)("option",{value:"lmale",children:"Human Male • Light"}),(0,t.jsx)("option",{value:"mmale",children:"Human Male • Medium"}),(0,t.jsx)("option",{value:"hmale",children:"Human Male • Heavy"}),(0,t.jsx)("option",{value:"lfemale",children:"Human Female • Light"}),(0,t.jsx)("option",{value:"mfemale",children:"Human Female • Medium"}),(0,t.jsx)("option",{value:"hfemale",children:"Human Female • Heavy"}),(0,t.jsx)("option",{value:"lbioderm",children:"Bioderm • Light"}),(0,t.jsx)("option",{value:"mbioderm",children:"Bioderm • Medium"}),(0,t.jsx)("option",{value:"hbioderm",children:"Bioderm • Heavy"})]}),(0,t.jsxs)("optgroup",{label:"Weapons","data-model-type":"weapon",children:[(0,t.jsx)("option",{value:"disc",children:"Disc Launcher"}),(0,t.jsx)("option",{value:"chaingun",children:"Chaingun"}),(0,t.jsx)("option",{value:"grenade_launcher",children:"Grenade Launcher"}),(0,t.jsx)("option",{value:"sniper",children:"Laser Rifle"}),(0,t.jsx)("option",{value:"plasmathrower",children:"Plasma Cannon"}),(0,t.jsx)("option",{value:"energy",children:"Blaster"}),(0,t.jsx)("option",{value:"shocklance",children:"Shocklance"}),(0,t.jsx)("option",{value:"elf",children:"ELF Projector"}),(0,t.jsx)("option",{value:"missile",children:"Missile Launcher"}),(0,t.jsx)("option",{value:"mortar",children:"Mortar"}),(0,t.jsx)("option",{value:"repair",children:"Repair Pack"}),(0,t.jsx)("option",{value:"targeting",children:"Targeting Laser"})]}),(0,t.jsxs)("optgroup",{label:"Vehicles","data-model-type":"vehicle",children:[(0,t.jsx)("option",{value:"vehicle_grav_scout",children:"Wildcat Grav Cycle"}),(0,t.jsx)("option",{value:"vehicle_grav_tank",children:"Beowulf Assault Tank"}),(0,t.jsx)("option",{value:"vehicle_land_mpbbase",children:"Jericho Mobile Point Base"}),(0,t.jsx)("option",{value:"vehicle_air_scout",children:"Shrike Scout Fighter"}),(0,t.jsx)("option",{value:"vehicle_air_bomber",children:"Thundersword Bomber"}),(0,t.jsx)("option",{value:"vehicle_air_hapc",children:"HAVOC Gunship Transport"})]})]})]})]}),(0,t.jsxs)("div",{className:T.default.HeaderEnd,children:["select"===p&&z?(0,t.jsxs)("div",{className:T.default.DownloadSection,children:[(0,t.jsx)("button",{type:"button",className:T.default.DownloadButton,onClick:async()=>{S(!0)},children:"Download"})," ",O?(0,t.jsx)(o,{className:T.default.DownloadSpinner}):(0,t.jsxs)("span",{className:T.default.PackVersion,children:["v",L.version," • ",L.files.length.toLocaleString()," ",1===L.files.length?"file":"files"]})]}):null,(0,t.jsxs)("div",{className:T.default.DownloadHiRes,children:[(0,t.jsx)("label",{htmlFor:"hiResSelect",children:"HD support?"}),(0,t.jsxs)("select",{id:"hiResSelect",className:T.default.HiResSelect,ref:s,value:x,disabled:O,onChange:e=>{switch(e.target.value){case"prompt":k(e.target.value),localStorage.removeItem("hiResDownload");break;case"yes":case"no":k(e.target.value),localStorage.setItem("hiResDownload",e.target.value)}},children:[(0,t.jsx)("option",{value:"prompt",children:"Ask"}),(0,t.jsx)("option",{value:"yes",children:"Yes"}),(0,t.jsx)("option",{value:"no",children:"No"})]})]})]})]}),g?(0,t.jsx)("div",{className:T.default.Gallery,children:V.map(e=>{let r,n;"string"==typeof e?(r=e,n=M):(r=e.name,n=e.model);let a="".concat("https://exogen.github.io/t2-skins","/gallery/").concat(encodeURIComponent(r),".").concat(n,".webp");return(0,t.jsxs)("div",{className:T.default.Skin,children:[(0,t.jsx)("img",{className:T.default.Preview,loading:"lazy",src:a,width:680,height:800,alt:r}),(0,t.jsxs)("div",{className:T.default.Detail,children:[(0,t.jsx)(l.default,{className:T.default.LoadInEditor,href:"/?m=".concat(n,"&s=").concat(encodeURIComponent(r)),children:(0,t.jsx)(u.BsBadge3dFill,{title:"Load in Editor","aria-label":"Load in Editor"})}),(0,t.jsx)("span",{className:T.default.Name,children:r}),(0,t.jsx)("button",{type:"button",className:T.default.DownloadSkin,title:"Download ".concat(r," skin"),"aria-label":"Download ".concat(r," skin"),onClick:async()=>{let e=(0,C.modelToModelType)(n),t=n.replace(/(?:^([a-z])|_([a-z]))/g,(e,t,r)=>(t||r).toUpperCase()),l="",a=[];switch(e){case"player":l="zPlayerSkin-".concat(r,".vl2"),a=C.modelTypes.player.filter(e=>y.customSkins[e].includes(r)).map(e=>"".concat(r,".").concat(e,".png"));break;case"weapon":l="zWeapon".concat(t,"-").concat(r,".vl2"),a=I(n).map(e=>"".concat(r,"/").concat(e));break;case"vehicle":l="z".concat(t,"-").concat(r,".vl2"),a=I(n).map(e=>"".concat(r,"/").concat(e))}if(a.length){let e=a.some(e=>y.sizeMultiplier[e]>1);if(e&&"prompt"===x){window.alert("This download contains HD textures, which require the QoL patch. Select “yes” or “no” for HD support, then try again."),s.current&&s.current.focus();return}let t="yes"===x?a:a.map(e=>y.sizeMultiplier[e]>1?e.replace(/\.png$/,"@1x.png"):e);e&&"no"===x&&(l=l.replace(/\.vl2$/,"@1x.vl2"));let r=await (0,E.collectFiles)(t,{skipNotFound:!0}),n=(0,E.createZipFile)(r.map(e=>{let{name:t,data:r}=e;return{name:t.split("/").slice(-1)[0],data:r}}));await (0,E.saveZipFile)(n,l)}},children:(0,t.jsx)(i.FaDownload,{})})]})]},"".concat(r,":").concat(n))})}):(0,t.jsx)(o,{className:T.default.Spinner})]})]})}function L(){return(0,t.jsx)(r.Suspense,{children:(0,t.jsx)(R,{})})}}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36159,(e,t,r)=>{"use strict";function n(){return null}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n}}),("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},98183,(e,t,r)=>{"use strict";function n(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function l(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function a(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,l(e));else t.set(r,l(n));return t}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{formatUrl:function(){return a},formatWithValidation:function(){return u},urlObjectKeys:function(){return o}});let n=e.r(90809)._(e.r(98183)),l=/https?|ftp|gopher|file/;function a(e){let{auth:t,hostname:r}=e,a=e.protocol||"",o=e.pathname||"",u=e.hash||"",i=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?"["+r+"]":r),e.port&&(c+=":"+e.port)),i&&"object"==typeof i&&(i=String(n.urlQueryToSearchParams(i)));let s=e.search||i&&"?"+i||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||l.test(a))&&!1!==c?(c="//"+(c||""),o&&"/"!==o[0]&&(o="/"+o)):c||(c=""),u&&"#"!==u[0]&&(u="#"+u),s&&"?"!==s[0]&&(s="?"+s),""+a+c+(o=o.replace(/[?#]/g,encodeURIComponent))+(s=s.replace("#","%23"))+u}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return a(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return l}});let n=e.r(71645);function l(e,t){let r=(0,n.useRef)(null),l=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=l.current;t&&(l.current=null,t())}else e&&(r.current=a(e,n)),t&&(l.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{DecodeError:function(){return v},MiddlewareNotFoundError:function(){return g},MissingStaticPage:function(){return m},NormalizeError:function(){return y},PageNotFoundError:function(){return _},SP:function(){return p},ST:function(){return h},WEB_VITALS:function(){return n},execOnce:function(){return l},getDisplayName:function(){return c},getLocationOrigin:function(){return u},getURL:function(){return i},isAbsoluteUrl:function(){return o},isResSent:function(){return s},loadGetInitialProps:function(){return d},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return b}});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function l(e){let t,r=!1;return function(){for(var n=arguments.length,l=Array(n),a=0;aa.test(e);function u(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function i(){let{href:e}=window.location,t=u();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function s(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function d(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await d(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&s(r))return n;if(!n)throw Object.defineProperty(Error('"'+c(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.'),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let p="undefined"!=typeof performance,h=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class _ extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class m extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class g extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function b(e){return JSON.stringify({message:e.message,stack:e.stack})}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(18967),l=e.r(52817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,l.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{default:function(){return y},useLinkStatus:function(){return m}});let n=e.r(90809),l=e.r(43476),a=n._(e.r(71645)),o=e.r(95057),u=e.r(8372),i=e.r(18581),c=e.r(18967),s=e.r(5550);e.r(33525);let f=e.r(91949),d=e.r(73668),p=e.r(99781);e.r(84508);let h=e.r(65165);function v(e){return"string"==typeof e?e:(0,o.formatUrl)(e)}function y(e){var t;let r,n,o,[y,m]=(0,a.useOptimistic)(f.IDLE_LINK_STATUS),g=(0,a.useRef)(null),{href:b,as:j,children:O,prefetch:w=null,passHref:S,replace:x,shallow:k,scroll:A,onClick:E,onMouseEnter:T,onTouchStart:C,legacyBehavior:M=!1,onNavigate:I,ref:P,unstable_dynamicOnHover:U,...N}=e;r=O,M&&("string"==typeof r||"number"==typeof r)&&(r=(0,l.jsx)("a",{children:r}));let R=a.default.useContext(u.AppRouterContext),L=!1!==w,z=!1!==w?null===(t=w)||"auto"===t?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:D,as:H}=a.default.useMemo(()=>{let e=v(b);return{href:e,as:j?v(j):e}},[b,j]);M&&(n=a.default.Children.only(r));let G=M?n&&"object"==typeof n&&n.ref:P,F=a.default.useCallback(e=>(null!==R&&(g.current=(0,f.mountLinkInstance)(e,D,R,z,L,m)),()=>{g.current&&((0,f.unmountLinkForCurrentNavigation)(g.current),g.current=null),(0,f.unmountPrefetchableInstance)(e)}),[L,D,R,z,m]),B={ref:(0,i.useMergedRef)(F,G),onClick(e){M||"function"!=typeof E||E(e),M&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),R&&(e.defaultPrevented||function(e,t,r,n,l,o,u){let{nodeName:i}=e.currentTarget;if(!("A"===i.toUpperCase()&&function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||e.currentTarget.hasAttribute("download"))){if(!(0,d.isLocalURL)(t)){l&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),u){let e=!1;if(u({preventDefault:()=>{e=!0}}),e)return}a.default.startTransition(()=>{(0,p.dispatchNavigateAction)(r||t,l?"replace":"push",null==o||o,n.current)})}}(e,D,H,g,x,A,I))},onMouseEnter(e){M||"function"!=typeof T||T(e),M&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),R&&L&&(0,f.onNavigationIntent)(e.currentTarget,!0===U)},onTouchStart:function(e){M||"function"!=typeof C||C(e),M&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),R&&L&&(0,f.onNavigationIntent)(e.currentTarget,!0===U)}};return(0,c.isAbsoluteUrl)(H)?B.href=H:M&&!S&&("a"!==n.type||"href"in n.props)||(B.href=(0,s.addBasePath)(H)),o=M?a.default.cloneElement(n,B):(0,l.jsx)("a",{...N,...B,children:r}),(0,l.jsx)(_.Provider,{value:y,children:o})}let _=(0,a.createContext)(f.IDLE_LINK_STATUS),m=()=>(0,a.useContext)(_);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},29402,(e,t,r)=>{var n,l,a="__lodash_hash_undefined__",o=1/0,u="[object Arguments]",i="[object Array]",c="[object Boolean]",s="[object Date]",f="[object Error]",d="[object Function]",p="[object Map]",h="[object Number]",v="[object Object]",y="[object Promise]",_="[object RegExp]",m="[object Set]",g="[object String]",b="[object Symbol]",j="[object WeakMap]",O="[object ArrayBuffer]",w="[object DataView]",S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,x=/^\w*$/,k=/^\./,A=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,E=/\\(\\)?/g,T=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,M={};M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M[u]=M[i]=M[O]=M[c]=M[w]=M[s]=M[f]=M[d]=M[p]=M[h]=M[v]=M[_]=M[m]=M[g]=M[j]=!1;var I=e.g&&e.g.Object===Object&&e.g,P="object"==typeof self&&self&&self.Object===Object&&self,U=I||P||Function("return this")(),N=r&&!r.nodeType&&r,R=N&&t&&!t.nodeType&&t,L=R&&R.exports===N&&I.process,z=function(){try{return L&&L.binding("util")}catch(e){}}(),D=z&&z.isTypedArray;function H(e,t){for(var r=-1,n=e?e.length:0,l=Array(n);++r-1},eb.prototype.set=function(e,t){var r=this.__data__,n=eS(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ej.prototype.clear=function(){this.__data__={hash:new eg,map:new(eo||eb),string:new eg}},ej.prototype.delete=function(e){return eI(this,e).delete(e)},ej.prototype.get=function(e){return eI(this,e).get(e)},ej.prototype.has=function(e){return eI(this,e).has(e)},ej.prototype.set=function(e,t){return eI(this,e).set(e,t),this},eO.prototype.add=eO.prototype.push=function(e){return this.__data__.set(e,a),this},eO.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.clear=function(){this.__data__=new eb},ew.prototype.delete=function(e){return this.__data__.delete(e)},ew.prototype.get=function(e){return this.__data__.get(e)},ew.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.set=function(e,t){var r=this.__data__;if(r instanceof eb){var n=r.__data__;if(!eo||n.length<199)return n.push([e,t]),this;r=this.__data__=new ej(n)}return r.set(e,t),this};var ex=function(e,t){return function(r,n){if(null==r)return r;if(!eq(r))return e(r,n);for(var l=r.length,a=-1,o=Object(r);(t?a--:++au))return!1;var c=a.get(e);if(c&&a.get(t))return c==t;var s=-1,f=!0,d=1&l?new eO:void 0;for(a.set(e,t),a.set(t,e);++s-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function e$(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eQ(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eQ(e)&&X.call(e)==b}var eY=D?G(D):function(e){return eQ(e)&&eK(e.length)&&!!M[X.call(e)]};function eX(e){return eq(e)?function(e,t){var r=eV(e)||eB(e)?function(e,t){for(var r=-1,n=Array(e);++rt||a&&o&&i&&!u&&!c||n&&o&&i||!r&&i||!l)return 1;if(!n&&!a&&!c&&e=u)return i;return i*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});i--;)u[i]=u[i].value;return u}(e,t,r))}},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},l=Object.keys(n).join("|"),a=RegExp(l,"g"),o=RegExp(l,"");function u(e){return n[e]}var i=function(e){return e.replace(a,u)};t.exports=i,t.exports.has=function(e){return!!e.match(o)},t.exports.remove=i},97052,e=>{e.v({Back:"gallery-module__zlwOTG__Back",Detail:"gallery-module__zlwOTG__Detail",DownloadButton:"gallery-module__zlwOTG__DownloadButton",DownloadHiRes:"gallery-module__zlwOTG__DownloadHiRes",DownloadSection:"gallery-module__zlwOTG__DownloadSection",DownloadSkin:"gallery-module__zlwOTG__DownloadSkin",DownloadSpinner:"gallery-module__zlwOTG__DownloadSpinner",Gallery:"gallery-module__zlwOTG__Gallery",GalleryPage:"gallery-module__zlwOTG__GalleryPage",HeaderEnd:"gallery-module__zlwOTG__HeaderEnd",HeaderMain:"gallery-module__zlwOTG__HeaderMain",HiResSelect:"gallery-module__zlwOTG__HiResSelect",IconLink:"gallery-module__zlwOTG__IconLink",InputContainer:"gallery-module__zlwOTG__InputContainer",Label:"gallery-module__zlwOTG__Label",LoadInEditor:"gallery-module__zlwOTG__LoadInEditor",Name:"gallery-module__zlwOTG__Name",PackVersion:"gallery-module__zlwOTG__PackVersion",Preview:"gallery-module__zlwOTG__Preview",SearchButton:"gallery-module__zlwOTG__SearchButton",SearchInput:"gallery-module__zlwOTG__SearchInput",Skin:"gallery-module__zlwOTG__Skin",Spinner:"gallery-module__zlwOTG__Spinner",Tools:"gallery-module__zlwOTG__Tools",spin:"gallery-module__zlwOTG__spin"})},25500,e=>{"use strict";e.s(["default",()=>z],25500);var t=e.i(43476),r=e.i(71645),n=e.i(36159),l=e.i(22016),a=e.i(40141);function o(e){return(0,a.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{opacity:"0.2",fillRule:"evenodd",clipRule:"evenodd",d:"M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M12 22C17.5228 22 22 17.5228 22 12H19C19 15.866 15.866 19 12 19V22Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M2 12C2 6.47715 6.47715 2 12 2V5C8.13401 5 5 8.13401 5 12H2Z",fill:"currentColor"},child:[]}]})(e)}var u=e.i(90106),i=e.i(11152),c=e.i(50361),s=e.i(24540);function f(e,t,r){try{return e(t)}catch(e){return(0,s.l)("[nuqs] Error while parsing value `%s`: %O"+(r?" (for key `%s`)":""),t,e,r),null}}function d(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),f(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide(r){var n;return null!=(n=t(r))?n:e}}},withOptions(e){return{...this,...e}}}}function p(e,t){return e.valueOf()===t.valueOf()}d({parse:e=>e,serialize:String}),d({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),d({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),d({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),d({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String}),d({parse:e=>"true"===e.toLowerCase(),serialize:String}),d({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:p}),d({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:p}),d({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:p});let h=(0,c.r)(),v={};function y(e,t,r,n,l,a){let o=!1,u=Object.entries(e).reduce((e,u)=>{var i,s,d,p,h,v;let[y,_]=u,m=null!=(i=null==t?void 0:t[y])?i:y,g=n[m],b="multi"===_.type?[]:null,j=void 0===g?null!=(s="multi"===_.type?null==r?void 0:r.getAll(m):null==r?void 0:r.get(m))?s:b:g;return l&&a&&((v=null!=(d=l[m])?d:b)===j||null!==v&&null!==j&&"string"!=typeof v&&"string"!=typeof j&&v.length===j.length&&v.every((e,t)=>e===j[t]))?e[y]=null!=(p=a[y])?p:null:(o=!0,e[y]=null!=(h=(0,c.i)(j)?null:f(_.parse,j,m))?h:null,l&&(l[m]=j)),e},{});if(!o){let t=Object.keys(e),r=Object.keys(null!=a?a:{});o=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:u,hasChanged:o}}function _(e,t){return Object.fromEntries(Object.keys(e).map(r=>{var n,l;return[r,null!=(l=null!=(n=e[r])?n:t[r])?l:null]}))}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{parse:n,type:l,serialize:a,eq:o,defaultValue:u,...i}=t,[{[e]:f},d]=function(e){var t,n,l;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=(0,r.useId)(),u=(0,s.i)(),i=(0,s.a)(),{history:f="replace",scroll:d=null!=(t=null==u?void 0:u.scroll)&&t,shallow:p=null==(n=null==u?void 0:u.shallow)||n,throttleMs:m=c.s.timeMs,limitUrlUpdates:g=null==u?void 0:u.limitUrlUpdates,clearOnDefault:b=null==(l=null==u?void 0:u.clearOnDefault)||l,startTransition:j,urlKeys:O=v}=a,w=Object.keys(e).join(","),S=(0,r.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>{var t;return[e,null!=(t=O[e])?t:e]})),[w,JSON.stringify(O)]),x=(0,s.r)(Object.values(S)),k=x.searchParams,A=(0,r.useRef)({}),E=(0,r.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>{var r;return[t,null!=(r=e[t].defaultValue)?r:null]})),[Object.values(e).map(e=>{let{defaultValue:t}=e;return t}).join(",")]),T=c.t.useQueuedQueries(Object.values(S)),[C,M]=(0,r.useState)(()=>y(e,O,null!=k?k:new URLSearchParams,T).state),I=(0,r.useRef)(C);if((0,s.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",o,w,C,k),Object.keys(A.current).join("&")!==Object.values(S).join("&")){let{state:t,hasChanged:r}=y(e,O,k,T,A.current,I.current);r&&((0,s.c)("[nuq+ %s `%s`] State changed: %O",o,w,{state:t,initialSearchParams:k,queuedQueries:T,queryRef:A.current,stateRef:I.current}),I.current=t,M(t)),A.current=Object.fromEntries(Object.entries(S).map(t=>{var r,n;let[l,a]=t;return[a,(null==(r=e[l])?void 0:r.type)==="multi"?null==k?void 0:k.getAll(a):null!=(n=null==k?void 0:k.get(a))?n:null]}))}(0,r.useEffect)(()=>{let{state:t,hasChanged:r}=y(e,O,k,T,A.current,I.current);r&&((0,s.c)("[nuq+ %s `%s`] State changed: %O",o,w,{state:t,initialSearchParams:k,queuedQueries:T,queryRef:A.current,stateRef:I.current}),I.current=t,M(t))},[Object.values(S).map(e=>"".concat(e,"=").concat(null==k?void 0:k.getAll(e))).join("&"),JSON.stringify(T)]),(0,r.useEffect)(()=>{let t=Object.keys(e).reduce((t,r)=>(t[r]=t=>{let{state:n,query:l}=t;M(t=>{var a,u,i;let{defaultValue:c}=e[r],f=S[r],d=null!=(a=null!=n?n:c)?a:null;return Object.is(null!=(i=null!=(u=t[r])?u:c)?i:null,d)?((0,s.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",o,w,f,n,c,I.current),t):(I.current={...I.current,[r]:d},A.current[f]=l,(0,s.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",o,w,f,n,c,I.current),I.current)})},t),{});for(let r of Object.keys(e)){let e=S[r];(0,s.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",o,e,w),h.on(e,t[r])}return()=>{for(let r of Object.keys(e)){let e=S[r];(0,s.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",o,e,w),h.off(e,t[r])}}},[w,S]);let P=(0,r.useCallback)(function(t){var r,n,l,a,u,v,y,O,k,A,T,C,M,P,U,N,R,L,z,D,H,G,F,B,V,q,W;let K,$=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},Q=Object.fromEntries(Object.keys(e).map(e=>[e,null])),Z="function"==typeof t?null!=(r=t(_(I.current,E)))?r:Q:null!=t?t:Q;(0,s.c)("[nuq+ %s `%s`] setState: %O",o,w,Z);let Y=0,X=!1,J=[];for(let[t,r]of Object.entries(Z)){let o=e[t],_=S[t];if(!o||void 0===r)continue;(null!=(u=null!=(a=$.clearOnDefault)?a:o.clearOnDefault)?u:b)&&null!==r&&void 0!==o.defaultValue&&(null!=(v=o.eq)?v:(e,t)=>e===t)(r,o.defaultValue)&&(r=null);let w=null===r?null:(null!=(y=o.serialize)?y:String)(r);h.emit(_,{state:r,query:w});let E={key:_,query:w,options:{history:null!=(k=null!=(O=$.history)?O:o.history)?k:f,shallow:null!=(T=null!=(A=$.shallow)?A:o.shallow)?T:p,scroll:null!=(M=null!=(C=$.scroll)?C:o.scroll)?M:d,startTransition:null!=(U=null!=(P=$.startTransition)?P:o.startTransition)?U:j}};if((null==$||null==(n=$.limitUrlUpdates)?void 0:n.method)==="debounce"||(null==g?void 0:g.method)==="debounce"||(null==(l=o.limitUrlUpdates)?void 0:l.method)==="debounce"){!0===E.options.shallow&&console.warn((0,s.s)(422));let e=null!=(D=null!=(z=null!=(L=null==$||null==(N=$.limitUrlUpdates)?void 0:N.timeMs)?L:null==g?void 0:g.timeMs)?z:null==(R=o.limitUrlUpdates)?void 0:R.timeMs)?D:c.s.timeMs,t=c.t.push(E,e,x,i);Yt(e),X?c.n.flush(x,i):c.n.getPendingPromise(x));return null!=K?K:ee},[w,f,p,d,m,null==g?void 0:g.method,null==g?void 0:g.timeMs,j,S,x.updateUrl,x.getSearchParamsSnapshot,x.rateLimitFactor,i,E]);return[(0,r.useMemo)(()=>_(C,E),[C,E]),P]}({[e]:{parse:null!=n?n:e=>e,type:l,serialize:a,eq:o,defaultValue:u}},i);return[f,(0,r.useCallback)(function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return d(r=>({[e]:"function"==typeof t?t(r[e]):t}),r)},[e,d])]}var g=e.i(29402),b=e.i(38360);let j={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},O=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function w(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{keys:n,threshold:l=j.MATCHES,baseSort:a=O,sorter:o=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:l}=e,{rank:a,keyIndex:o}=t;return n!==a?n>a?-1:1:l===o?r(e,t):l{let{rank:n,rankedValue:l,keyIndex:a,keyThreshold:o}=e,{itemValue:u,attributes:i}=t,f=S(u,c,s),d=l,{minRanking:p,maxRanking:h,threshold:v}=i;return f=j.MATCHES?f=p:f>h&&(f=h),f>n&&(n=f,a=r,o=v,d=u),{rankedValue:d,rank:n,keyIndex:a,keyThreshold:o}},{rankedValue:u,rank:j.NO_MATCH,keyIndex:-1,keyThreshold:s.threshold}):{rankedValue:u,rank:S(u,c,s),keyIndex:-1,keyThreshold:s.threshold}),{rank:d,keyThreshold:p=l}=f;return d>=p&&e.push({...f,item:a,index:o}),e},[])).map(e=>{let{item:t}=e;return t})}function S(e,t,r){if(e=x(e,r),(t=x(t,r)).length>e.length)return j.NO_MATCH;if(e===t)return j.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),l=n.next(),a=l.value;if(e.length===t.length&&0===a)return j.EQUAL;if(0===a)return j.STARTS_WITH;let o=l;for(;!o.done;){if(o.value>0&&" "===e[o.value-1])return j.WORD_STARTS_WITH;o=n.next()}return a>0?j.CONTAINS:1===t.length?j.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return j.NO_MATCH;var o=n-a;let u=r/t.length;return j.MATCHES+1/o*u}(e,t)}function x(e,t){let{keepDiacritics:r}=t;return e="".concat(e),r||(e=(0,b.default)(e)),e}w.rankings=j;let k={maxRanking:1/0,minRanking:-1/0};var A=e.i(15768),E=e.i(97052),T=e.i(69642),C=e.i(53653),M=e.i(20592),I=e.i(96165);let P=[];function U(e){return M.default.materials[e].map(e=>{var t;if(e.hidden||!1===e.selectable)return null;let r=null!=(t=e.file)?t:e.name;if(r)if("number"==typeof e.frameCount&&e.frameCount>1)return Array(e.frameCount).fill(r).map((e,t)=>{if(!(t>0))return e;{let r=/^(.+[^\d])(\d{2,})$/.exec(e);if(r){let e=r[1],n=r[2];return"".concat(e).concat(t.toString().padStart(n.length,"0"))}throw Error("frameCount > 0, but could not parse index")}});else return r}).flat().filter(e=>null!=e).map(e=>"".concat(e,".png"))}let N={lmale:0,mmale:1,lfemale:2,mfemale:3,hmale:4,lbioderm:5,mbioderm:6,hbioderm:7,energy:8,disc:9,chaingun:10,grenade_launcher:11,sniper:12,elf:13,shocklance:14,plasmathrower:15,missile:16,mortar:17,repair:18,targeting:19,vehicle_grav_scout:20,vehicle_grav_tank:21,turret_assaulttank_mortar:22,vehicle_land_mpbbase:23,vehicle_air_scout:24,vehicle_air_bomber:25,vehicle_air_hapc:26};function R(e){let t=[];return Object.entries(e).forEach(e=>{let[r,n]=e;t.push(...n.map(e=>({name:e,model:r})))}),(0,g.default)(t,[e=>e.name.toLowerCase(),e=>N[e.model]],["asc","asc"])}function L(){var e,a,c;let s=(0,r.useRef)(null),[f,d]=m("q",{defaultValue:"",clearOnDefault:!0}),[p,h]=(0,r.useState)(f.trim()?"search":"select"),v=(0,r.useDeferredValue)(f),[y,_]=(0,A.default)(),[b,j]=m("filter",{defaultValue:"lmale",clearOnDefault:!1}),[O,S]=(0,r.useState)(!1),[x,k]=(0,r.useState)("prompt"),M="hfemale"===b?"hmale":b,N=null!=(c=null==(e=y.customSkins)?void 0:e[M])?c:P,L="new"===b,z=null==y||null==(a=y.packs)?void 0:a[b],D=null!=z;(0,r.useEffect)(()=>{let e=localStorage.getItem("hiResDownload");switch(e){case"yes":case"no":k(e)}},[]),(0,r.useEffect)(()=>{if(z&&O){let e=!1;return(async()=>{let t=z.files,r=t.some(e=>y.sizeMultiplier[e]>1);if(r&&"prompt"===x){window.alert("This download contains HD textures, which require the QoL patch. Select “yes” or “no” for HD support, then try again."),s.current&&s.current.focus(),S(!1);return}let n="yes"===x?t:t.map(e=>y.sizeMultiplier[e]>1?e.replace(/\.png$/,"@1x.png"):e),l="zSkinPack-".concat(b,"-v").concat(z.version,".vl2");r&&"no"===x&&(l=l.replace(/\.vl2$/,"@1x.vl2"));let a=await (0,T.collectFiles)(n);if(!e){let t=(0,T.createZipFile)(a);await new Promise(e=>setTimeout(e,500)),e||await (0,T.saveZipFile)(t,l),e||S(!1)}})(),()=>{e=!0,S(!1)}}},[x,O,y.sizeMultiplier,z,b]);let H=(0,r.useMemo)(()=>{var e;return(0,g.default)(Object.keys(null!=(e=null==y?void 0:y.packs)?e:{}),e=>e.toLowerCase(),["asc"])},[y]),G=(0,r.useMemo)(()=>{var e,t;let r=L?null==y?void 0:y.newSkins:D?null==y||null==(t=y.packs)||null==(e=t[b])?void 0:e.skins:null;return r?R(r):[]},[L,D,b,y]),F=(0,r.useMemo)(()=>y.customSkins?R(y.customSkins):[],[y.customSkins]),B=v.trim().length>0,V=(0,r.useMemo)(()=>B?w(F,v,{keys:["name"]}):[],[F,v,B]),q="search"===p&&B?V:L||D?G:N;(0,r.useEffect)(()=>{S(!1)},[b]);let W=(0,r.useRef)(null),K=(0,r.useRef)(null);return(0,r.useEffect)(()=>{var e,t;switch(p){case"search":null==(e=W.current)||e.focus();break;case"select":null==(t=K.current)||t.focus()}},[p]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.default,{children:(0,t.jsx)("title",{children:"Tribes 2 Skin Gallery"})}),(0,t.jsxs)("main",{className:E.default.GalleryPage,children:[(0,t.jsxs)("header",{className:E.default.Tools,children:[(0,t.jsxs)(l.default,{className:E.default.Back,href:"../",children:[(0,t.jsx)(i.FaChevronLeft,{size:12,className:E.default.Icon})," ",(0,t.jsx)("span",{className:E.default.Label,children:"Back to Editor"})]}),(0,t.jsxs)("div",{className:E.default.HeaderMain,children:[(0,t.jsx)("button",{className:E.default.SearchButton,title:"select"===p?"Search":"Close search mode",onClick:()=>{h(e=>"select"===e?"search":"select"),d("")},children:"select"===p?(0,t.jsx)(i.FaSearch,{}):(0,t.jsx)(i.FaTimes,{})}),(0,t.jsxs)("div",{className:E.default.InputContainer,children:[(0,t.jsx)("input",{type:"text",ref:W,className:E.default.SearchInput,hidden:"select"===p,placeholder:"Search ".concat(F.length.toLocaleString()," skins…"),value:f,onChange:e=>d(e.target.value),onKeyDown:e=>{"Escape"===e.key&&(h("select"),d(""))}}),(0,t.jsxs)("select",{ref:K,id:"ModelSelect","aria-label":"Player model",onChange:e=>{j(e.target.value)},value:b,style:{visibility:"search"===p?"hidden":"visible"},children:[(0,t.jsx)("option",{value:"new",children:"All new skins ✨"}),(0,t.jsx)("optgroup",{label:"Packs",children:H.map(e=>(0,t.jsx)("option",{value:e,children:e},e))}),(0,t.jsxs)("optgroup",{label:"Players","data-model-type":"player",children:[(0,t.jsx)("option",{value:"lmale",children:"Human Male • Light"}),(0,t.jsx)("option",{value:"mmale",children:"Human Male • Medium"}),(0,t.jsx)("option",{value:"hmale",children:"Human Male • Heavy"}),(0,t.jsx)("option",{value:"lfemale",children:"Human Female • Light"}),(0,t.jsx)("option",{value:"mfemale",children:"Human Female • Medium"}),(0,t.jsx)("option",{value:"hfemale",children:"Human Female • Heavy"}),(0,t.jsx)("option",{value:"lbioderm",children:"Bioderm • Light"}),(0,t.jsx)("option",{value:"mbioderm",children:"Bioderm • Medium"}),(0,t.jsx)("option",{value:"hbioderm",children:"Bioderm • Heavy"})]}),(0,t.jsxs)("optgroup",{label:"Weapons","data-model-type":"weapon",children:[(0,t.jsx)("option",{value:"disc",children:"Disc Launcher"}),(0,t.jsx)("option",{value:"chaingun",children:"Chaingun"}),(0,t.jsx)("option",{value:"grenade_launcher",children:"Grenade Launcher"}),(0,t.jsx)("option",{value:"sniper",children:"Laser Rifle"}),(0,t.jsx)("option",{value:"plasmathrower",children:"Plasma Cannon"}),(0,t.jsx)("option",{value:"energy",children:"Blaster"}),(0,t.jsx)("option",{value:"shocklance",children:"Shocklance"}),(0,t.jsx)("option",{value:"elf",children:"ELF Projector"}),(0,t.jsx)("option",{value:"missile",children:"Missile Launcher"}),(0,t.jsx)("option",{value:"mortar",children:"Mortar"}),(0,t.jsx)("option",{value:"repair",children:"Repair Pack"}),(0,t.jsx)("option",{value:"targeting",children:"Targeting Laser"})]}),(0,t.jsxs)("optgroup",{label:"Vehicles","data-model-type":"vehicle",children:[(0,t.jsx)("option",{value:"vehicle_grav_scout",children:"Wildcat Grav Cycle"}),(0,t.jsx)("option",{value:"vehicle_grav_tank",children:"Beowulf Assault Tank"}),(0,t.jsx)("option",{value:"vehicle_land_mpbbase",children:"Jericho Mobile Point Base"}),(0,t.jsx)("option",{value:"vehicle_air_scout",children:"Shrike Scout Fighter"}),(0,t.jsx)("option",{value:"vehicle_air_bomber",children:"Thundersword Bomber"}),(0,t.jsx)("option",{value:"vehicle_air_hapc",children:"HAVOC Gunship Transport"})]})]})]})]}),(0,t.jsxs)("div",{className:E.default.HeaderEnd,children:["select"===p&&D?(0,t.jsxs)("div",{className:E.default.DownloadSection,children:[(0,t.jsx)("button",{type:"button",className:E.default.DownloadButton,onClick:async()=>{S(!0)},children:"Download"})," ",O?(0,t.jsx)(o,{className:E.default.DownloadSpinner}):(0,t.jsxs)("span",{className:E.default.PackVersion,children:["v",z.version," • ",z.files.length.toLocaleString()," ",1===z.files.length?"file":"files"]})]}):null,(0,t.jsxs)("div",{className:E.default.DownloadHiRes,children:[(0,t.jsx)("label",{htmlFor:"hiResSelect",children:"HD support?"}),(0,t.jsxs)("select",{id:"hiResSelect",className:E.default.HiResSelect,ref:s,value:x,disabled:O,onChange:e=>{switch(e.target.value){case"prompt":k(e.target.value),localStorage.removeItem("hiResDownload");break;case"yes":case"no":k(e.target.value),localStorage.setItem("hiResDownload",e.target.value)}},children:[(0,t.jsx)("option",{value:"prompt",children:"Ask"}),(0,t.jsx)("option",{value:"yes",children:"Yes"}),(0,t.jsx)("option",{value:"no",children:"No"})]})]})]})]}),_?(0,t.jsx)("div",{className:E.default.Gallery,children:q.map(e=>{let r,n;"string"==typeof e?(r=e,n=M):(r=e.name,n=e.model);let a="".concat(I.SKIN_GALLERY_BASE_URL,"/").concat(encodeURIComponent(r),".").concat(n,".webp");return(0,t.jsxs)("div",{className:E.default.Skin,children:[(0,t.jsx)("img",{className:E.default.Preview,loading:"lazy",src:a,width:680,height:800,alt:r}),(0,t.jsxs)("div",{className:E.default.Detail,children:[(0,t.jsx)(l.default,{className:E.default.LoadInEditor,href:"/?m=".concat(n,"&s=").concat(encodeURIComponent(r)),children:(0,t.jsx)(u.BsBadge3dFill,{title:"Load in Editor","aria-label":"Load in Editor"})}),(0,t.jsx)("span",{className:E.default.Name,children:r}),(0,t.jsx)("button",{type:"button",className:E.default.DownloadSkin,title:"Download ".concat(r," skin"),"aria-label":"Download ".concat(r," skin"),onClick:async()=>{let e=(0,C.modelToModelType)(n),t=n.replace(/(?:^([a-z])|_([a-z]))/g,(e,t,r)=>(t||r).toUpperCase()),l="",a=[];switch(e){case"player":l="zPlayerSkin-".concat(r,".vl2"),a=C.modelTypes.player.filter(e=>y.customSkins[e].includes(r)).map(e=>"".concat(r,".").concat(e,".png"));break;case"weapon":l="zWeapon".concat(t,"-").concat(r,".vl2"),a=U(n).map(e=>"".concat(r,"/").concat(e));break;case"vehicle":l="z".concat(t,"-").concat(r,".vl2"),a=U(n).map(e=>"".concat(r,"/").concat(e))}if(a.length){let e=a.some(e=>y.sizeMultiplier[e]>1);if(e&&"prompt"===x){window.alert("This download contains HD textures, which require the QoL patch. Select “yes” or “no” for HD support, then try again."),s.current&&s.current.focus();return}let t="yes"===x?a:a.map(e=>y.sizeMultiplier[e]>1?e.replace(/\.png$/,"@1x.png"):e);e&&"no"===x&&(l=l.replace(/\.vl2$/,"@1x.vl2"));let r=await (0,T.collectFiles)(t,{skipNotFound:!0}),n=(0,T.createZipFile)(r.map(e=>{let{name:t,data:r}=e;return{name:t.split("/").slice(-1)[0],data:r}}));await (0,T.saveZipFile)(n,l)}},children:(0,t.jsx)(i.FaDownload,{})})]})]},"".concat(r,":").concat(n))})}):(0,t.jsx)(o,{className:E.default.Spinner})]})]})}function z(){return(0,t.jsx)(r.Suspense,{children:(0,t.jsx)(L,{})})}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/a0f1f445ab9525e3.js b/docs/_next/static/chunks/d0ff1d6ce0fd9297.js similarity index 97% rename from docs/_next/static/chunks/a0f1f445ab9525e3.js rename to docs/_next/static/chunks/d0ff1d6ce0fd9297.js index 85f169a..837651e 100644 --- a/docs/_next/static/chunks/a0f1f445ab9525e3.js +++ b/docs/_next/static/chunks/d0ff1d6ce0fd9297.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},29947,e=>{e.v(JSON.parse('{"defaultSkins":{"lmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"mmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"hmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"lfemale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"mfemale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"hfemale":[],"lbioderm":["Horde","Inferno","Storm"],"mbioderm":["Horde","Inferno","Storm"],"hbioderm":["Horde","Inferno","Storm"]},"modelDefaults":{"lmale":"Blood Eagle","mmale":"Blood Eagle","hmale":"Blood Eagle","lfemale":"Blood Eagle","mfemale":"Blood Eagle","hfemale":"Blood Eagle","lbioderm":"Storm","mbioderm":"Storm","hbioderm":"Storm","chaingun":"weapon_chaingun","disc":"weapon_disc","elf":"weapon_elf","energy":"weapon_energy","grenade_launcher":"weapon_grenade_launcher","mine":"mine","missile":"weapon_missile","mortar":"weapon_mortar","plasmathrower":"weapon_plasmathrower","repair":"weapon_repair","shocklance":"weapon_shocklance","sniper":"weapon_sniper","targeting":"weapon_targeting","vehicle_land_mpbbase":"vehicle_land_mpbbase","vehicle_grav_scout":"vehicle_grav_scout","vehicle_grav_tank":"vehicle_grav_tank","turret_assaulttank_mortar":"turret_assaulttank_mortar","vehicle_air_scout":"vehicle_air_scout","vehicle_air_bomber":"vehicle_air_bomber","vehicle_air_hapc":"vehicle_air_hapc"},"animationLabels":{"Forward":"Run Forward","Back":"Run Backward","Back0":"Run Backward","Root":"Idle","Root2":"Run Backward","Root3":"Idle","Idlepda":"Idle (PDA)","PDA":"Idle (PDA)","Root1":"Idle (PDA)","Jump":"Jump","Jump0":"Jump (Alternate)","Jump1":"Jump (Alternate)","Jump2":"Jump (Alternate)","Jump3":"Jump (Alternate)","Jet":"Jet","Fall":"Fall","Land":"Land","Land1":"Land (Alternate)","ski":"Ski","Side":"Strafe Left","Celwave":"Wave","Celbow":"Bow","Celdisco":"Dance","Celdance":"Dance","Celflex":"Flex","Celflex1":"Flex","Celrocky":"Awesome","Celjump":"Awesome","Celsalute":"Salute","celTaunt":"Too Bad","CelebrationGora":"Wave Arms","Celgora":"Wave Arms","CelebrationJump":"Bull Charge","Tauntbull":"Bull Charge","CelebrationJump0":"Celebrate","CelebrationJump4":"The Greatest","CelebrationRoar":"Roar","Celroar":"Roar","Celraor":"Roar","Celflex2":"Flex","celyeah":"Yeah","celtaunt":"Too Bad","Tauntbutt":"Butt","Tauntkiss":"Blow Kiss","Tauntbest":"The Greatest","Taunimp":"Move!","Tauntimp":"Move!","Sitting":"Sit","Scoutroot":"Gravcycle","Recoilde":"Recoil","Light_recoil":"Recoil","Dieforward":"Death (Fall Forward)","DeathForward":"Death (Fall Forward)","Dieslump":"Death (Slump)","DeathSlump":"Death (Slump)","Diespin":"Death (Spin)","DeathSpin":"Death (Spin)","diechest":"Death (Hold Chest)","Diechest":"Death (Hold Chest)","DeathChest":"Death (Hold Chest)","Dieback":"Death (Hold Back)","DeathBack":"Death (Hold Back)","Diehead":"Death (Hold Head)","DeathHead":"Death (Hold Head)","Dieknees":"Death (On Knees)","DeathKnees":"Death (On Knees)","Dieleglf":"Death (Left Leg Injury)","Dieleglft":"Death (Left Leg Injury)","DeathLegLeft":"Death (Left Leg Injury)","Dielegrt":"Death (Right Leg Injury)","Dielegtrt":"Death (Right Leg Injury)","DeathLegRight":"Death (Right Leg Injury)","Dielegrt0":"Death (Right Leg Injury)","Diesidelf":"Death (Left Side)","DeathSideLeft":"Death (Left Side)","Diesidert":"Death (Right Side)","DeathSideRight":"Death (Right Side)","Diesidert0":"Death (Right Side Alternate)"},"cameraOverrides":{"chaingun":{"target":"0m 0m 0m","fov":"12deg"},"plasmathrower":{"target":"0.002m -0.001m 0m","fov":"12deg"},"energy":{"fov":"31deg","orbit":"135deg 70deg 105%"},"hmale":{"fov":"24deg"},"hfemale":{"fov":"24deg"},"hbioderm":{"fov":"24deg"},"vehicle_grav_scout":{"orbit":"290deg 60deg 130%"},"vehicle_grav_tank":{"orbit":"290deg 60deg 130%"},"turret_assaulttank_mortar":{"orbit":"290deg 60deg 130%"},"vehicle_land_mpbbase":{"orbit":"290deg 60deg 130%"},"vehicle_air_scout":{"orbit":"290deg 60deg 130%"},"vehicle_air_bomber":{"orbit":"290deg 60deg 130%"},"vehicle_air_hapc":{"orbit":"290deg 60deg 130%"}},"animationLabelOverrides":{"mmale":{"Back":"Strafe Left"},"mfemale":{"Dielegrt":"Death (Slump)"},"lbioderm":{"Root":"Gravcycle"}},"materials":{"lmale":[{"name":"base","label":"Warrior","fileSuffix":".lmale"}],"mmale":[{"name":"base","label":"Warrior","fileSuffix":".mmale"}],"hmale":[{"name":"base","label":"Warrior","fileSuffix":".hmale"}],"lfemale":[{"name":"base","label":"Warrior","fileSuffix":".lfemale"}],"mfemale":[{"name":"base","label":"Warrior","fileSuffix":".mfemale"}],"lbioderm":[{"name":"base","label":"Warrior","fileSuffix":".lbioderm"}],"mbioderm":[{"name":"base","label":"Warrior","fileSuffix":".mbioderm"}],"hbioderm":[{"name":"base","label":"Warrior","fileSuffix":".hbioderm"}],"disc":[{"name":"weapon_disc","label":"Weapon"},{"name":"dcase00","label":"Disc Case","size":[256,256],"baseColorFactor":[1,1,1,0.7],"emissiveFactor":[1,1,1],"emissiveTexture":true,"alphaMode":"BLEND","metallicFactor":0,"roughnessFactor":1,"frameCount":6,"frameTimings":[21,1,1,1,1,1],"optional":true}],"chaingun":[{"label":"Chaingun","name":"weapon_chaingun"}],"grenade_launcher":[{"label":"Grenade Launcher","name":"weapon_grenade_launcher"}],"sniper":[{"label":"Weapon","name":"weapon_sniper"},{"label":"Green Light","name":"greenlight","hasDefault":false,"optional":true},{"label":"Red Light","name":"lite_red","hasDefault":false,"optional":true}],"plasmathrower":[{"label":"Rear & Barrel","name":"weapon_plasma10","file":"weapon_plasma1"},{"label":"Top & Front","name":"weapon_plasma21","file":"weapon_plasma2"},{"name":"weapon_plasma1","file":"weapon_plasma1","selectable":false},{"name":"weapon_plasma2","file":"weapon_plasma2","selectable":false}],"energy":[{"label":"Weapon","name":"blinn1","file":"weapon_energy"}],"shocklance":[{"label":"Weapon","name":"weapon_shocklance","size":[512,256]},{"label":"Glow","name":"weapon_shocklance_glow_","file":"weapon_shocklance_glow ","emissiveFactor":[1,1,1],"alphaMode":"MASK","alphaCutoff":255,"emissiveTexture":true,"metallicFactor":0,"roughnessFactor":1,"size":[256,128],"optional":true}],"elf":[{"label":"Weapon","name":"weapon_elf","file":"weapon_elf"}],"missile":[{"label":"Weapon","name":"weapon_missile"}],"mortar":[{"label":"Weapon","name":"weapon_mortar"}],"repair":[{"label":"Weapon","name":"weapon_repair"}],"targeting":[{"label":"Weapon","name":"weapon_targeting"}],"mine":[{"label":"Weapon","name":"mine","size":[512,512],"metallicFactor":0,"roughnessFactor":1}],"vehicle_air_scout":[{"label":"Vehicle","name":"vehicle_air_scout0","file":"vehicle_air_scout"},{"name":"Unassigned","hidden":true,"hasDefault":false},{"name":"vehicle_air_scout","hidden":true,"hasDefault":false},{"label":"Flare","name":"shrikeflare2","emissiveFactor":[0,0,0],"alphaMode":"BLEND","emissiveTexture":true,"metallicFactor":0,"roughnessFactor":1,"size":[256,256],"optional":true}],"vehicle_air_bomber":[{"label":"Cockpit & Thrusters","name":"vehicle_air_bomber10","file":"vehicle_air_bomber1","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Rear","name":"vehicle_air_bomber2","size":[256,512]},{"label":"Wings","name":"vehicle_air_bomber31","file":"vehicle_air_bomber3"},{"name":"vehicle_air_bomber1","size":[256,512],"selectable":false},{"name":"vehicle_air_bomber3","selectable":false}],"vehicle_air_hapc":[{"label":"Cockpit","name":"vehicle_air_bomber1","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Wings","name":"vehicle_air_hpc2"},{"label":"Seats","name":"vehicle_air_hpc1"},{"label":"Thrusters","name":"vehicle_air_hpc30","file":"vehicle_air_hpc3"},{"name":"vehicle_air_hpc3","selectable":false}],"vehicle_grav_scout":[{"label":"Vehicle","name":"Vehicle_grav_scout0","file":"Vehicle_grav_scout","size":[512,256]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Pipes","name":"Vehicle_grav_scout_pipes1","file":"Vehicle_grav_scout_pipes","metallicFactor":0,"roughnessFactor":1},{"name":"Vehicle_grav_scout","hidden":true,"hasDefault":false},{"label":"Side Thrusters","name":"Vehicle_grav_scout_pipes","file":"Vehicle_grav_scout_pipes","emissiveFactor":[1,1,1],"alphaMode":"OPAQUE","metallicFactor":0,"roughnessFactor":1,"emissiveTexture":true,"selectable":false},{"label":"Windshield","name":"Vehicle_grav_scout_windshield","file":"Vehicle_grav_scout_windshield","selectable":false,"alphaMode":"BLEND","baseColorFactor":[1,1,1,0.5],"metallicFactor":0,"roughnessFactor":1,"size":[128,128],"optional":true},{"label":"Windshield Inner","name":"Vehicle_grav_scout_windshieldInner","file":"Vehicle_grav_scout_windshieldInner","selectable":false,"alphaMode":"BLEND","baseColorFactor":[1,1,1,0.5],"metallicFactor":0,"roughnessFactor":1,"size":[128,128],"optional":true}],"vehicle_grav_tank":[{"label":"Center","name":"Vehicle_grav_tank_bodyMain","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Sides","name":"vehicle_grav_tank_bodyside10","file":"vehicle_grav_tank_bodyside1","size":[256,512]},{"label":"Thrusters","name":"vehicle_grav_tank_bodyside21","file":"vehicle_grav_tank_bodyside2"},{"name":"vehicle_grav_tank_bodyside2","selectable":false},{"name":"vehicle_grav_tank_bodyside1","selectable":false}],"turret_assaulttank_mortar":[{"label":"Turret","name":"turret_assaulttank_mortar","file":"turret_assaultTank"}],"vehicle_land_mpbbase":[{"label":"Vehicle Front","name":"vehicle_land_mpb1"},{"label":"Vehicle Back","name":"vehicle_land_mpb2"},{"label":"Wheels","name":"Vehicle_Land_Assault_wheel","file":"Vehicle_Land_Assault_Wheel","size":[512,256],"optional":true}]},"animations":{"global":["Forward","Back","Jump","Jet","Fall","Land","ski","Root"],"lmale":["Idlepda","Side","Jump0","Land1","Recoilde","Celwave","Celdisco","Celflex","Celrocky","Celsalute","celTaunt","Taunimp","Tauntbest","Dieback","diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Dieslump","Diespin","Scoutroot","Sitting"],"mmale":["Back0","Jump3","Recoilde","Celwave","Celdance","Celflex","Celrocky","Celsalute","celtaunt","Tauntbest","Tauntimp","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Diespin","Sitting"],"hmale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celdance","Celflex","Celjump","Celsalute","celtaunt","Tauntbest","Tauntimp","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dielegrt","Diesidelf","Diesidert","Diesidert0","Dieslump","Diespin"],"lfemale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celbow","Celdance","Celsalute","Tauntbest","Tauntbutt","Tauntimp","Tauntkiss","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Dieslump","Diespin","Scoutroot","Sitting"],"mfemale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celbow","Celdisco","Celsalute","Tauntbest","Tauntbutt","Tauntimp","Tauntkiss","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Dielegrt0","Diesidelf","Diesidert","Diespin","Sitting"],"lbioderm":["Root3","PDA","Jump2","Side","Light_recoil","CelebrationGora","CelebrationJump","CelebrationJump0","CelebrationJump4","CelebrationRoar","Salute","Celflex2","celyeah","DeathBack","DeathChest","DeathForward","DeathHead","DeathKnees","DeathLegLeft","DeathLegRight","DeathSideLeft","DeathSideRight","DeathSlump","DeathSpin","Sitting"],"mbioderm":["Root1","Jump2","Side","Recoilde","Salute","Celflex1","Celgora","Celjump","Celroar","celyeah","Tauntbest","Tauntbull","DeathBack","DeathChest","DeathHead","DeathSideLeft","DeathSpin","Dieforward","Dieknees","Dieleglft","Dielegtrt","Diesidert","Dieslump","Sitting"],"hbioderm":["Root1","Jump2","Side","Recoilde","Salute","Celflex2","Celgora","Celjump","Celraor","celyeah","Tauntbest","Tauntbull","DeathBack","DeathChest","DeathForward","DeathHead","DeathKnees","DeathLegLeft","DeathLegRight","DeathSideLeft","DeathSideRight","DeathSlump","DeathSpin"]}}'))},67034,(e,t,r)=>{!function(){var e={675:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,a=s(e),o=a[0],l=a[1],f=new i((o+l)*3/4-l),u=0,h=l>0?o-4:o;for(r=0;r>16&255,f[u++]=t>>8&255,f[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,f[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,f[u++]=t>>8&255,f[u++]=255&t),f},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,l=n-i;o>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}(e,o,o+16383>l?l:o+16383));return 1===i?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,l=a.length;o0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},72:function(e,t,r){"use strict";var n=r(675),i=r(783),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!l.isEncoding(i))throw TypeError("Unknown encoding: "+i);var a=0|p(n,i),s=o(a),f=s.write(n,i);return f!==a&&(s=s.slice(0,f)),s}if(ArrayBuffer.isView(e))return h(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(k(e,ArrayBuffer)||e&&k(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(k(e,SharedArrayBuffer)||e&&k(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||k(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return E(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return A(e).length;default:if(i)return n?-1:E(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i,a,o,l=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(a=r*=1)!=a&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var a,o=1,l=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,l/=2,s/=2,r/=2}function f(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(a=r;al&&(r=l-s),a=r;a>=0;a--){for(var h=!0,c=0;cr&&(e+=" ... "),""},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if(k(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var a=i-n,o=r-t,s=Math.min(a,o),f=this.slice(n,i),u=e.slice(t,r),h=0;h239?4:f>223?3:f>191?2:1;if(i+h<=r)switch(h){case 1:f<128&&(u=f);break;case 2:(192&(a=e[i+1]))==128&&(s=(31&f)<<6|63&a)>127&&(u=s);break;case 3:a=e[i+1],o=e[i+2],(192&a)==128&&(192&o)==128&&(s=(15&f)<<12|(63&a)<<6|63&o)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:a=e[i+1],o=e[i+2],l=e[i+3],(192&a)==128&&(192&o)==128&&(192&l)==128&&(s=(15&f)<<18|(63&a)<<12|(63&o)<<6|63&l)>65535&&s<1114112&&(u=s)}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=h}var c=n,p=c.length;if(p<=4096)return String.fromCharCode.apply(String,c);for(var d="",g=0;gr)throw RangeError("Trying to access beyond buffer length")}function w(e,t,r,n,i,a){if(!l.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw RangeError("Index out of range")}function _(e,t,r,n,i,a){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function D(e,t,r,n,a){return t*=1,r>>>=0,a||_(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function S(e,t,r,n,a){return t*=1,r>>>=0,a||_(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,a,o,l,s,f,u,h,c=this.length-t;if((void 0===r||r>c)&&(r=c),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var o=0;o>8,i.push(r%256),i.push(n);return i}(e,this.length-u),this,u,h);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,e,t,r,i,0)}var a=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,e,t,r,i,0)}var a=r-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,e,t,r,i-1,-i)}var a=0,o=1,l=0;for(this[t]=255&e;++a>>=0,!n){var i=Math.pow(2,8*r-1);w(this,e,t,r,i-1,-i)}var a=r-1,o=1,l=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===l&&0!==this[t+a+1]&&(l=1),this[t+a]=(e/o|0)-l&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return S(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return S(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,a=e.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function C(e){for(var t=[],r=0;r=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function k(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var L=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},783:function(e,t){t.read=function(e,t,r,n,i){var a,o,l=8*i-n-1,s=(1<>1,u=-7,h=r?i-1:0,c=r?-1:1,p=e[t+h];for(h+=c,a=p&(1<<-u)-1,p>>=-u,u+=l;u>0;a=256*a+e[t+h],h+=c,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=c,u-=8);if(0===a)a=1-f;else{if(a===s)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=f}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,l,s,f=8*a-i-1,u=(1<>1,c=5960464477539062e-23*(23===i),p=n?0:a-1,d=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(l=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-o))<1&&(o--,s*=2),o+h>=1?t+=c/s:t+=c*Math.pow(2,1-h),t*s>=2&&(o++,s/=2),o+h>=u?(l=0,o=u):o+h>=1?(l=(t*s-1)*Math.pow(2,i),o+=h):(l=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&l,p+=d,l/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=d,o/=256,f-=8);e[r+p-d]|=128*g}}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var a=r[t]={exports:{}},o=!0;try{e[t](a,a.exports,n),o=!1}finally{o&&delete r[t]}return a.exports}n.ab="/ROOT/node_modules/next/dist/compiled/buffer/",t.exports=n(72)}()},78631,(e,t,r)=>{!function(t,r){if("function"==typeof define&&define.amd){let t;void 0!==(t=r())&&e.v(t)}else r()}(e.e,function(){"use strict";function r(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){l(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:e.g.global===e.g?e.g:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(e,t,o){var l=a.URL||a.webkitURL,s=document.createElement("a");s.download=t=t||e.name||"download",s.rel="noopener","string"==typeof e?(s.href=e,s.origin===location.origin?i(s):n(s.href)?r(e,t,o):i(s,s.target="_blank")):(s.href=l.createObjectURL(e),setTimeout(function(){l.revokeObjectURL(s.href)},4e4),setTimeout(function(){i(s)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,a){if(t=t||e.name||"download","string"!=typeof e){var o;navigator.msSaveOrOpenBlob((void 0===(o=a)?o={autoBom:!1}:"object"!=typeof o&&(console.warn("Deprecated: Expected third argument to be a object"),o={autoBom:!o}),o.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),t)}else if(n(e))r(e,t,a);else{var l=document.createElement("a");l.href=e,l.target="_blank",setTimeout(function(){i(l)})}}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,n);var l="application/octet-stream"===e.type,s=/constructor/i.test(a.HTMLElement)||a.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent);if((f||l&&s||o)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=f?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var h=a.URL||a.webkitURL,c=h.createObjectURL(e);i?i.location=c:location.href=c,i=null,setTimeout(function(){h.revokeObjectURL(c)},4e4)}});a.saveAs=l.saveAs=l,t.exports=l})},69642,e=>{"use strict";e.s(["collectFiles",()=>o,"createZipFile",()=>n,"savePngFile",()=>a,"saveZipFile",()=>i]);var t=e.i(71315),r=e.i(78631);function n(e){let r=new t.default;for(let t of e)r.file("textures/skins/".concat(t.name),t.data);return r}async function i(e,t){let n=await e.generateAsync({type:"blob"});(0,r.saveAs)(n,t)}function a(e,t){(0,r.saveAs)(e,t)}async function o(e){let{skipNotFound:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(await Promise.all(e.map(async e=>{let r="".concat("https://exogen.github.io/t2-skins/skins","/").concat(e),n=await fetch(r);if(!n.ok){if(t&&404===n.status)return null;throw Error("Response failed: ".concat(n.status," ").concat(n.statusText))}let i=await n.arrayBuffer();return{name:e.replace(/@1x\.png$/,".png"),data:i}}))).filter(e=>null!=e)}}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},29947,e=>{e.v(JSON.parse('{"defaultSkins":{"lmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"mmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"hmale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"lfemale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"mfemale":["Blood Eagle","Children of the Phoenix","Diamond Sword","Inferno","Starwolf","Storm"],"hfemale":[],"lbioderm":["Horde","Inferno","Storm"],"mbioderm":["Horde","Inferno","Storm"],"hbioderm":["Horde","Inferno","Storm"]},"modelDefaults":{"lmale":"Blood Eagle","mmale":"Blood Eagle","hmale":"Blood Eagle","lfemale":"Blood Eagle","mfemale":"Blood Eagle","hfemale":"Blood Eagle","lbioderm":"Storm","mbioderm":"Storm","hbioderm":"Storm","chaingun":"weapon_chaingun","disc":"weapon_disc","elf":"weapon_elf","energy":"weapon_energy","grenade_launcher":"weapon_grenade_launcher","mine":"mine","missile":"weapon_missile","mortar":"weapon_mortar","plasmathrower":"weapon_plasmathrower","repair":"weapon_repair","shocklance":"weapon_shocklance","sniper":"weapon_sniper","targeting":"weapon_targeting","vehicle_land_mpbbase":"vehicle_land_mpbbase","vehicle_grav_scout":"vehicle_grav_scout","vehicle_grav_tank":"vehicle_grav_tank","turret_assaulttank_mortar":"turret_assaulttank_mortar","vehicle_air_scout":"vehicle_air_scout","vehicle_air_bomber":"vehicle_air_bomber","vehicle_air_hapc":"vehicle_air_hapc"},"animationLabels":{"Forward":"Run Forward","Back":"Run Backward","Back0":"Run Backward","Root":"Idle","Root2":"Run Backward","Root3":"Idle","Idlepda":"Idle (PDA)","PDA":"Idle (PDA)","Root1":"Idle (PDA)","Jump":"Jump","Jump0":"Jump (Alternate)","Jump1":"Jump (Alternate)","Jump2":"Jump (Alternate)","Jump3":"Jump (Alternate)","Jet":"Jet","Fall":"Fall","Land":"Land","Land1":"Land (Alternate)","ski":"Ski","Side":"Strafe Left","Celwave":"Wave","Celbow":"Bow","Celdisco":"Dance","Celdance":"Dance","Celflex":"Flex","Celflex1":"Flex","Celrocky":"Awesome","Celjump":"Awesome","Celsalute":"Salute","celTaunt":"Too Bad","CelebrationGora":"Wave Arms","Celgora":"Wave Arms","CelebrationJump":"Bull Charge","Tauntbull":"Bull Charge","CelebrationJump0":"Celebrate","CelebrationJump4":"The Greatest","CelebrationRoar":"Roar","Celroar":"Roar","Celraor":"Roar","Celflex2":"Flex","celyeah":"Yeah","celtaunt":"Too Bad","Tauntbutt":"Butt","Tauntkiss":"Blow Kiss","Tauntbest":"The Greatest","Taunimp":"Move!","Tauntimp":"Move!","Sitting":"Sit","Scoutroot":"Gravcycle","Recoilde":"Recoil","Light_recoil":"Recoil","Dieforward":"Death (Fall Forward)","DeathForward":"Death (Fall Forward)","Dieslump":"Death (Slump)","DeathSlump":"Death (Slump)","Diespin":"Death (Spin)","DeathSpin":"Death (Spin)","diechest":"Death (Hold Chest)","Diechest":"Death (Hold Chest)","DeathChest":"Death (Hold Chest)","Dieback":"Death (Hold Back)","DeathBack":"Death (Hold Back)","Diehead":"Death (Hold Head)","DeathHead":"Death (Hold Head)","Dieknees":"Death (On Knees)","DeathKnees":"Death (On Knees)","Dieleglf":"Death (Left Leg Injury)","Dieleglft":"Death (Left Leg Injury)","DeathLegLeft":"Death (Left Leg Injury)","Dielegrt":"Death (Right Leg Injury)","Dielegtrt":"Death (Right Leg Injury)","DeathLegRight":"Death (Right Leg Injury)","Dielegrt0":"Death (Right Leg Injury)","Diesidelf":"Death (Left Side)","DeathSideLeft":"Death (Left Side)","Diesidert":"Death (Right Side)","DeathSideRight":"Death (Right Side)","Diesidert0":"Death (Right Side Alternate)"},"cameraOverrides":{"chaingun":{"target":"0m 0m 0m","fov":"12deg"},"plasmathrower":{"target":"0.002m -0.001m 0m","fov":"12deg"},"energy":{"fov":"31deg","orbit":"135deg 70deg 105%"},"hmale":{"fov":"24deg"},"hfemale":{"fov":"24deg"},"hbioderm":{"fov":"24deg"},"vehicle_grav_scout":{"orbit":"290deg 60deg 130%"},"vehicle_grav_tank":{"orbit":"290deg 60deg 130%"},"turret_assaulttank_mortar":{"orbit":"290deg 60deg 130%"},"vehicle_land_mpbbase":{"orbit":"290deg 60deg 130%"},"vehicle_air_scout":{"orbit":"290deg 60deg 130%"},"vehicle_air_bomber":{"orbit":"290deg 60deg 130%"},"vehicle_air_hapc":{"orbit":"290deg 60deg 130%"}},"animationLabelOverrides":{"mmale":{"Back":"Strafe Left"},"mfemale":{"Dielegrt":"Death (Slump)"},"lbioderm":{"Root":"Gravcycle"}},"materials":{"lmale":[{"name":"base","label":"Warrior","fileSuffix":".lmale"}],"mmale":[{"name":"base","label":"Warrior","fileSuffix":".mmale"}],"hmale":[{"name":"base","label":"Warrior","fileSuffix":".hmale"}],"lfemale":[{"name":"base","label":"Warrior","fileSuffix":".lfemale"}],"mfemale":[{"name":"base","label":"Warrior","fileSuffix":".mfemale"}],"lbioderm":[{"name":"base","label":"Warrior","fileSuffix":".lbioderm"}],"mbioderm":[{"name":"base","label":"Warrior","fileSuffix":".mbioderm"}],"hbioderm":[{"name":"base","label":"Warrior","fileSuffix":".hbioderm"}],"disc":[{"name":"weapon_disc","label":"Weapon"},{"name":"dcase00","label":"Disc Case","size":[256,256],"baseColorFactor":[1,1,1,0.7],"emissiveFactor":[1,1,1],"emissiveTexture":true,"alphaMode":"BLEND","metallicFactor":0,"roughnessFactor":1,"frameCount":6,"frameTimings":[21,1,1,1,1,1],"optional":true}],"chaingun":[{"label":"Chaingun","name":"weapon_chaingun"}],"grenade_launcher":[{"label":"Grenade Launcher","name":"weapon_grenade_launcher"}],"sniper":[{"label":"Weapon","name":"weapon_sniper"},{"label":"Green Light","name":"greenlight","hasDefault":false,"optional":true},{"label":"Red Light","name":"lite_red","hasDefault":false,"optional":true}],"plasmathrower":[{"label":"Rear & Barrel","name":"weapon_plasma10","file":"weapon_plasma1"},{"label":"Top & Front","name":"weapon_plasma21","file":"weapon_plasma2"},{"name":"weapon_plasma1","file":"weapon_plasma1","selectable":false},{"name":"weapon_plasma2","file":"weapon_plasma2","selectable":false}],"energy":[{"label":"Weapon","name":"blinn1","file":"weapon_energy"}],"shocklance":[{"label":"Weapon","name":"weapon_shocklance","size":[512,256]},{"label":"Glow","name":"weapon_shocklance_glow_","file":"weapon_shocklance_glow ","emissiveFactor":[1,1,1],"alphaMode":"MASK","alphaCutoff":255,"emissiveTexture":true,"metallicFactor":0,"roughnessFactor":1,"size":[256,128],"optional":true}],"elf":[{"label":"Weapon","name":"weapon_elf","file":"weapon_elf"}],"missile":[{"label":"Weapon","name":"weapon_missile"}],"mortar":[{"label":"Weapon","name":"weapon_mortar"}],"repair":[{"label":"Weapon","name":"weapon_repair"}],"targeting":[{"label":"Weapon","name":"weapon_targeting"}],"mine":[{"label":"Weapon","name":"mine","size":[512,512],"metallicFactor":0,"roughnessFactor":1}],"vehicle_air_scout":[{"label":"Vehicle","name":"vehicle_air_scout0","file":"vehicle_air_scout"},{"name":"Unassigned","hidden":true,"hasDefault":false},{"name":"vehicle_air_scout","hidden":true,"hasDefault":false},{"label":"Flare","name":"shrikeflare2","emissiveFactor":[0,0,0],"alphaMode":"BLEND","emissiveTexture":true,"metallicFactor":0,"roughnessFactor":1,"size":[256,256],"optional":true}],"vehicle_air_bomber":[{"label":"Cockpit & Thrusters","name":"vehicle_air_bomber10","file":"vehicle_air_bomber1","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Rear","name":"vehicle_air_bomber2","size":[256,512]},{"label":"Wings","name":"vehicle_air_bomber31","file":"vehicle_air_bomber3"},{"name":"vehicle_air_bomber1","size":[256,512],"selectable":false},{"name":"vehicle_air_bomber3","selectable":false}],"vehicle_air_hapc":[{"label":"Cockpit","name":"vehicle_air_bomber1","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Wings","name":"vehicle_air_hpc2"},{"label":"Seats","name":"vehicle_air_hpc1"},{"label":"Thrusters","name":"vehicle_air_hpc30","file":"vehicle_air_hpc3"},{"name":"vehicle_air_hpc3","selectable":false}],"vehicle_grav_scout":[{"label":"Vehicle","name":"Vehicle_grav_scout0","file":"Vehicle_grav_scout","size":[512,256]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Pipes","name":"Vehicle_grav_scout_pipes1","file":"Vehicle_grav_scout_pipes","metallicFactor":0,"roughnessFactor":1},{"name":"Vehicle_grav_scout","hidden":true,"hasDefault":false},{"label":"Side Thrusters","name":"Vehicle_grav_scout_pipes","file":"Vehicle_grav_scout_pipes","emissiveFactor":[1,1,1],"alphaMode":"OPAQUE","metallicFactor":0,"roughnessFactor":1,"emissiveTexture":true,"selectable":false},{"label":"Windshield","name":"Vehicle_grav_scout_windshield","file":"Vehicle_grav_scout_windshield","selectable":false,"alphaMode":"BLEND","baseColorFactor":[1,1,1,0.5],"metallicFactor":0,"roughnessFactor":1,"size":[128,128],"optional":true},{"label":"Windshield Inner","name":"Vehicle_grav_scout_windshieldInner","file":"Vehicle_grav_scout_windshieldInner","selectable":false,"alphaMode":"BLEND","baseColorFactor":[1,1,1,0.5],"metallicFactor":0,"roughnessFactor":1,"size":[128,128],"optional":true}],"vehicle_grav_tank":[{"label":"Center","name":"Vehicle_grav_tank_bodyMain","size":[256,512]},{"name":"Unassigned","hidden":true,"hasDefault":false},{"label":"Sides","name":"vehicle_grav_tank_bodyside10","file":"vehicle_grav_tank_bodyside1","size":[256,512]},{"label":"Thrusters","name":"vehicle_grav_tank_bodyside21","file":"vehicle_grav_tank_bodyside2"},{"name":"vehicle_grav_tank_bodyside2","selectable":false},{"name":"vehicle_grav_tank_bodyside1","selectable":false}],"turret_assaulttank_mortar":[{"label":"Turret","name":"turret_assaulttank_mortar","file":"turret_assaultTank"}],"vehicle_land_mpbbase":[{"label":"Vehicle Front","name":"vehicle_land_mpb1"},{"label":"Vehicle Back","name":"vehicle_land_mpb2"},{"label":"Wheels","name":"Vehicle_Land_Assault_wheel","file":"Vehicle_Land_Assault_Wheel","size":[512,256],"optional":true}]},"animations":{"global":["Forward","Back","Jump","Jet","Fall","Land","ski","Root"],"lmale":["Idlepda","Side","Jump0","Land1","Recoilde","Celwave","Celdisco","Celflex","Celrocky","Celsalute","celTaunt","Taunimp","Tauntbest","Dieback","diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Dieslump","Diespin","Scoutroot","Sitting"],"mmale":["Back0","Jump3","Recoilde","Celwave","Celdance","Celflex","Celrocky","Celsalute","celtaunt","Tauntbest","Tauntimp","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Diespin","Sitting"],"hmale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celdance","Celflex","Celjump","Celsalute","celtaunt","Tauntbest","Tauntimp","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dielegrt","Diesidelf","Diesidert","Diesidert0","Dieslump","Diespin"],"lfemale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celbow","Celdance","Celsalute","Tauntbest","Tauntbutt","Tauntimp","Tauntkiss","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Diesidelf","Diesidert","Dieslump","Diespin","Scoutroot","Sitting"],"mfemale":["Idlepda","Jump1","Side","Recoilde","Celwave","Celbow","Celdisco","Celsalute","Tauntbest","Tauntbutt","Tauntimp","Tauntkiss","Dieback","Diechest","Dieforward","Diehead","Dieknees","Dieleglf","Dielegrt","Dielegrt0","Diesidelf","Diesidert","Diespin","Sitting"],"lbioderm":["Root3","PDA","Jump2","Side","Light_recoil","CelebrationGora","CelebrationJump","CelebrationJump0","CelebrationJump4","CelebrationRoar","Salute","Celflex2","celyeah","DeathBack","DeathChest","DeathForward","DeathHead","DeathKnees","DeathLegLeft","DeathLegRight","DeathSideLeft","DeathSideRight","DeathSlump","DeathSpin","Sitting"],"mbioderm":["Root1","Jump2","Side","Recoilde","Salute","Celflex1","Celgora","Celjump","Celroar","celyeah","Tauntbest","Tauntbull","DeathBack","DeathChest","DeathHead","DeathSideLeft","DeathSpin","Dieforward","Dieknees","Dieleglft","Dielegtrt","Diesidert","Dieslump","Sitting"],"hbioderm":["Root1","Jump2","Side","Recoilde","Salute","Celflex2","Celgora","Celjump","Celraor","celyeah","Tauntbest","Tauntbull","DeathBack","DeathChest","DeathForward","DeathHead","DeathKnees","DeathLegLeft","DeathLegRight","DeathSideLeft","DeathSideRight","DeathSlump","DeathSpin"]}}'))},67034,(e,t,r)=>{!function(){var e={675:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,a=s(e),o=a[0],l=a[1],f=new i((o+l)*3/4-l),u=0,h=l>0?o-4:o;for(r=0;r>16&255,f[u++]=t>>8&255,f[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,f[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,f[u++]=t>>8&255,f[u++]=255&t),f},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,l=n-i;o>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}(e,o,o+16383>l?l:o+16383));return 1===i?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,l=a.length;o0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},72:function(e,t,r){"use strict";var n=r(675),i=r(783),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!l.isEncoding(i))throw TypeError("Unknown encoding: "+i);var a=0|p(n,i),s=o(a),f=s.write(n,i);return f!==a&&(s=s.slice(0,f)),s}if(ArrayBuffer.isView(e))return h(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(k(e,ArrayBuffer)||e&&k(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(k(e,SharedArrayBuffer)||e&&k(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||k(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return E(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return A(e).length;default:if(i)return n?-1:E(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i,a,o,l=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(a=r*=1)!=a&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var a,o=1,l=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,l/=2,s/=2,r/=2}function f(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(a=r;al&&(r=l-s),a=r;a>=0;a--){for(var h=!0,c=0;cr&&(e+=" ... "),""},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if(k(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var a=i-n,o=r-t,s=Math.min(a,o),f=this.slice(n,i),u=e.slice(t,r),h=0;h239?4:f>223?3:f>191?2:1;if(i+h<=r)switch(h){case 1:f<128&&(u=f);break;case 2:(192&(a=e[i+1]))==128&&(s=(31&f)<<6|63&a)>127&&(u=s);break;case 3:a=e[i+1],o=e[i+2],(192&a)==128&&(192&o)==128&&(s=(15&f)<<12|(63&a)<<6|63&o)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:a=e[i+1],o=e[i+2],l=e[i+3],(192&a)==128&&(192&o)==128&&(192&l)==128&&(s=(15&f)<<18|(63&a)<<12|(63&o)<<6|63&l)>65535&&s<1114112&&(u=s)}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=h}var c=n,p=c.length;if(p<=4096)return String.fromCharCode.apply(String,c);for(var d="",g=0;gr)throw RangeError("Trying to access beyond buffer length")}function w(e,t,r,n,i,a){if(!l.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw RangeError("Index out of range")}function _(e,t,r,n,i,a){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function D(e,t,r,n,a){return t*=1,r>>>=0,a||_(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function S(e,t,r,n,a){return t*=1,r>>>=0,a||_(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,a,o,l,s,f,u,h,c=this.length-t;if((void 0===r||r>c)&&(r=c),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var o=0;o>8,i.push(r%256),i.push(n);return i}(e,this.length-u),this,u,h);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,e,t,r,i,0)}var a=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,e,t,r,i,0)}var a=r-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,e,t,r,i-1,-i)}var a=0,o=1,l=0;for(this[t]=255&e;++a>>=0,!n){var i=Math.pow(2,8*r-1);w(this,e,t,r,i-1,-i)}var a=r-1,o=1,l=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===l&&0!==this[t+a+1]&&(l=1),this[t+a]=(e/o|0)-l&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return S(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return S(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,a=e.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function C(e){for(var t=[],r=0;r=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function k(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var L=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},783:function(e,t){t.read=function(e,t,r,n,i){var a,o,l=8*i-n-1,s=(1<>1,u=-7,h=r?i-1:0,c=r?-1:1,p=e[t+h];for(h+=c,a=p&(1<<-u)-1,p>>=-u,u+=l;u>0;a=256*a+e[t+h],h+=c,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=c,u-=8);if(0===a)a=1-f;else{if(a===s)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=f}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,l,s,f=8*a-i-1,u=(1<>1,c=5960464477539062e-23*(23===i),p=n?0:a-1,d=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(l=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-o))<1&&(o--,s*=2),o+h>=1?t+=c/s:t+=c*Math.pow(2,1-h),t*s>=2&&(o++,s/=2),o+h>=u?(l=0,o=u):o+h>=1?(l=(t*s-1)*Math.pow(2,i),o+=h):(l=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&l,p+=d,l/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=d,o/=256,f-=8);e[r+p-d]|=128*g}}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var a=r[t]={exports:{}},o=!0;try{e[t](a,a.exports,n),o=!1}finally{o&&delete r[t]}return a.exports}n.ab="/ROOT/node_modules/next/dist/compiled/buffer/",t.exports=n(72)}()},78631,(e,t,r)=>{!function(t,r){if("function"==typeof define&&define.amd){let t;void 0!==(t=r())&&e.v(t)}else r()}(e.e,function(){"use strict";function r(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){l(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:e.g.global===e.g?e.g:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(e,t,o){var l=a.URL||a.webkitURL,s=document.createElement("a");s.download=t=t||e.name||"download",s.rel="noopener","string"==typeof e?(s.href=e,s.origin===location.origin?i(s):n(s.href)?r(e,t,o):i(s,s.target="_blank")):(s.href=l.createObjectURL(e),setTimeout(function(){l.revokeObjectURL(s.href)},4e4),setTimeout(function(){i(s)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,a){if(t=t||e.name||"download","string"!=typeof e){var o;navigator.msSaveOrOpenBlob((void 0===(o=a)?o={autoBom:!1}:"object"!=typeof o&&(console.warn("Deprecated: Expected third argument to be a object"),o={autoBom:!o}),o.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),t)}else if(n(e))r(e,t,a);else{var l=document.createElement("a");l.href=e,l.target="_blank",setTimeout(function(){i(l)})}}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,n);var l="application/octet-stream"===e.type,s=/constructor/i.test(a.HTMLElement)||a.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent);if((f||l&&s||o)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=f?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var h=a.URL||a.webkitURL,c=h.createObjectURL(e);i?i.location=c:location.href=c,i=null,setTimeout(function(){h.revokeObjectURL(c)},4e4)}});a.saveAs=l.saveAs=l,t.exports=l})},69642,e=>{"use strict";e.s(["collectFiles",()=>l,"createZipFile",()=>i,"savePngFile",()=>o,"saveZipFile",()=>a]);var t=e.i(71315),r=e.i(78631),n=e.i(96165);function i(e){let r=new t.default;for(let t of e)r.file("textures/skins/".concat(t.name),t.data);return r}async function a(e,t){let n=await e.generateAsync({type:"blob"});(0,r.saveAs)(n,t)}function o(e,t){(0,r.saveAs)(e,t)}async function l(e){let{skipNotFound:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(await Promise.all(e.map(async e=>{let r="".concat(n.SKIN_ASSET_BASE_URL,"/").concat(e),i=await fetch(r);if(!i.ok){if(t&&404===i.status)return null;throw Error("Response failed: ".concat(i.status," ").concat(i.statusText))}let a=await i.arrayBuffer();return{name:e.replace(/@1x\.png$/,".png"),data:a}}))).filter(e=>null!=e)}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/2abf3874637c5516.js b/docs/_next/static/chunks/e5f31ffb0a3e45f4.js similarity index 51% rename from docs/_next/static/chunks/2abf3874637c5516.js rename to docs/_next/static/chunks/e5f31ffb0a3e45f4.js index b0d6fa4..169b439 100644 --- a/docs/_next/static/chunks/2abf3874637c5516.js +++ b/docs/_next/static/chunks/e5f31ffb0a3e45f4.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78631,(e,t,n)=>{!function(t,n){if("function"==typeof define&&define.amd){let t;void 0!==(t=n())&&e.v(t)}else n()}(e.e,function(){"use strict";function n(e,t,n){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){s(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function o(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:e.g.global===e.g?e.g:void 0,r=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!r?function(e,t,r){var s=i.URL||i.webkitURL,c=document.createElement("a");c.download=t=t||e.name||"download",c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?a(c):o(c.href)?n(e,t,r):a(c,c.target="_blank")):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){a(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download","string"!=typeof e){var r;navigator.msSaveOrOpenBlob((void 0===(r=i)?r={autoBom:!1}:"object"!=typeof r&&(console.warn("Deprecated: Expected third argument to be a object"),r={autoBom:!r}),r.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),t)}else if(o(e))n(e,t,i);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout(function(){a(s)})}}:function(e,t,o,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,o);var s="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||r)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},u.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,d=f.createObjectURL(e);a?a.location=d:location.href=d,a=null,setTimeout(function(){f.revokeObjectURL(d)},4e4)}});i.saveAs=s.saveAs=s,t.exports=s})},69642,e=>{"use strict";e.s(["collectFiles",()=>r,"createZipFile",()=>o,"savePngFile",()=>i,"saveZipFile",()=>a]);var t=e.i(71315),n=e.i(78631);function o(e){let n=new t.default;for(let t of e)n.file("textures/skins/".concat(t.name),t.data);return n}async function a(e,t){let o=await e.generateAsync({type:"blob"});(0,n.saveAs)(o,t)}function i(e,t){(0,n.saveAs)(e,t)}async function r(e){let{skipNotFound:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(await Promise.all(e.map(async e=>{let n="".concat("https://exogen.github.io/t2-skins/skins","/").concat(e),o=await fetch(n);if(!o.ok){if(t&&404===o.status)return null;throw Error("Response failed: ".concat(o.status," ").concat(o.statusText))}let a=await o.arrayBuffer();return{name:e.replace(/@1x\.png$/,".png"),data:a}}))).filter(e=>null!=e)}}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78631,(e,t,n)=>{!function(t,n){if("function"==typeof define&&define.amd){let t;void 0!==(t=n())&&e.v(t)}else n()}(e.e,function(){"use strict";function n(e,t,n){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){c(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function o(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:e.g.global===e.g?e.g:void 0,r=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!r?function(e,t,r){var c=i.URL||i.webkitURL,s=document.createElement("a");s.download=t=t||e.name||"download",s.rel="noopener","string"==typeof e?(s.href=e,s.origin===location.origin?a(s):o(s.href)?n(e,t,r):a(s,s.target="_blank")):(s.href=c.createObjectURL(e),setTimeout(function(){c.revokeObjectURL(s.href)},4e4),setTimeout(function(){a(s)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download","string"!=typeof e){var r;navigator.msSaveOrOpenBlob((void 0===(r=i)?r={autoBom:!1}:"object"!=typeof r&&(console.warn("Deprecated: Expected third argument to be a object"),r={autoBom:!r}),r.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),t)}else if(o(e))n(e,t,i);else{var c=document.createElement("a");c.href=e,c.target="_blank",setTimeout(function(){a(c)})}}:function(e,t,o,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,o);var c="application/octet-stream"===e.type,s=/constructor/i.test(i.HTMLElement)||i.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||c&&s||r)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},u.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,d=f.createObjectURL(e);a?a.location=d:location.href=d,a=null,setTimeout(function(){f.revokeObjectURL(d)},4e4)}});i.saveAs=c.saveAs=c,t.exports=c})},69642,e=>{"use strict";e.s(["collectFiles",()=>c,"createZipFile",()=>a,"savePngFile",()=>r,"saveZipFile",()=>i]);var t=e.i(71315),n=e.i(78631),o=e.i(96165);function a(e){let n=new t.default;for(let t of e)n.file("textures/skins/".concat(t.name),t.data);return n}async function i(e,t){let o=await e.generateAsync({type:"blob"});(0,n.saveAs)(o,t)}function r(e,t){(0,n.saveAs)(e,t)}async function c(e){let{skipNotFound:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(await Promise.all(e.map(async e=>{let n="".concat(o.SKIN_ASSET_BASE_URL,"/").concat(e),a=await fetch(n);if(!a.ok){if(t&&404===a.status)return null;throw Error("Response failed: ".concat(a.status," ").concat(a.statusText))}let i=await a.arrayBuffer();return{name:e.replace(/@1x\.png$/,".png"),data:i}}))).filter(e=>null!=e)}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/43ceca71888c9b70.js b/docs/_next/static/chunks/f66959b00ac693d8.js similarity index 89% rename from docs/_next/static/chunks/43ceca71888c9b70.js rename to docs/_next/static/chunks/f66959b00ac693d8.js index eb953b4..e063da1 100644 --- a/docs/_next/static/chunks/43ceca71888c9b70.js +++ b/docs/_next/static/chunks/f66959b00ac693d8.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43794,(t,e,r)=>{!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t=[],e=0;e{t.v(t.b(["static/chunks/9338a92aac995757.js","static/chunks/a55df98dcb3b60ad.js","static/chunks/turbopack-95cb340f669027bc.js"]))},67585,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let i=t.r(32061);function n(t){let{reason:e,children:r}=t;if("undefined"==typeof window)throw Object.defineProperty(new i.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r}},9885,(t,e,r)=>{"use strict";function i(t){return t.split("/").map(t=>encodeURIComponent(t)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return i}})},52157,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return a}});let i=t.r(43476),n=t.r(74080),s=t.r(63599),o=t.r(9885);function a(t){let{moduleIds:e}=t;if("undefined"!=typeof window)return null;let r=s.workAsyncStorage.getStore();if(void 0===r)return null;let a=[];if(r.reactLoadableManifest&&e){let t=r.reactLoadableManifest;for(let r of e){if(!t[r])continue;let e=t[r].files;a.push(...e)}}return 0===a.length?null:(0,i.jsx)(i.Fragment,{children:a.map(t=>{let e=r.assetPrefix+"/_next/"+(0,o.encodeURIPath)(t);return t.endsWith(".css")?(0,i.jsx)("link",{precedence:"dynamic",href:e,rel:"stylesheet",as:"style"},t):((0,n.preload)(e,{as:"script",fetchPriority:"low"}),null)})})}},69093,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return h}});let i=t.r(43476),n=t.r(71645),s=t.r(67585),o=t.r(52157);function a(t){return{default:t&&"default"in t?t.default:t}}let l={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},h=function(t){let e={...l,...t},r=(0,n.lazy)(()=>e.loader().then(a)),h=e.loading;function c(t){let a=h?(0,i.jsx)(h,{isLoading:!0,pastDelay:!0,error:null}):null,l=!e.ssr||!!e.loading,c=l?n.Suspense:n.Fragment,u=e.ssr?(0,i.jsxs)(i.Fragment,{children:["undefined"==typeof window?(0,i.jsx)(o.PreloadChunks,{moduleIds:e.modules}):null,(0,i.jsx)(r,{...t})]}):(0,i.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,i.jsx)(r,{...t})});return(0,i.jsx)(c,{...l?{fallback:a}:{},children:u})}return c.displayName="LoadableComponent",c}},70703,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n}});let i=t.r(55682)._(t.r(69093));function n(t,e){var r;let n={};"function"==typeof t&&(n.loader=t);let s={...n,...e};return(0,i.default)({...s,modules:null==(r=s.loadableGenerated)?void 0:r.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},52683,t=>{"use strict";let e,r,i,n;t.s(["default",()=>u7],52683);var s,o,a,l,h,c,u,d,f,g,p,m,y,x,b,_,w,C,S,T,O,k,M,E,D,j,A,P,F,L,R,I,B,N,W,U,H,X,V,Y,z,G,q,K,Q=t.i(43476),J=t.i(71645);function Z(t,e,r){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e,"string"))?i:i+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function tt(t){for(var e=1;e=0)continue;r[i]=t[i]}return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0||({}).propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tr(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}class ti{constructor(){Z(this,"browserShadowBlurConstant",1),Z(this,"DPI",96),Z(this,"devicePixelRatio","undefined"!=typeof window?window.devicePixelRatio:1),Z(this,"perfLimitSizeTotal",2097152),Z(this,"maxCacheSideLimit",4096),Z(this,"minCacheSideLimit",256),Z(this,"disableStyleCopyPaste",!1),Z(this,"enableGLFiltering",!0),Z(this,"textureSize",4096),Z(this,"forceGLPutImageData",!1),Z(this,"cachesBoundsOfCurve",!1),Z(this,"fontPaths",{}),Z(this,"NUM_FRACTION_DIGITS",4)}}let tn=new class extends ti{configure(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(this,t)}addFonts(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.fontPaths=tt(tt({},this.fontPaths),t)}removeFonts(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(t=>{delete this.fontPaths[t]})}clearFonts(){this.fontPaths={}}restoreDefaults(t){let e=new ti,r=(null==t?void 0:t.reduce((t,r)=>(t[r]=e[r],t),{}))||e;this.configure(r)}constructor(t){super(),this.configure(t)}},ts=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;ithis.testPrecision(e,t)),e.getExtension("WEBGL_lose_context").loseContext(),ts("log","WebGL: max texture size ".concat(this.maxTextureSize)))}isSupported(t){return!!this.maxTextureSize&&this.maxTextureSize>=t}}let tc={},tu=()=>e||(e={document:document,window:window,isTouchSupported:"ontouchstart"in window||"ontouchstart"in document||window&&window.navigator&&window.navigator.maxTouchPoints>0,WebGLProbe:new th,dispose(){},copyPasteData:tc}),td=()=>tu().document,tf=()=>tu().window,tg=()=>{var t;return Math.max(null!=(t=tn.devicePixelRatio)?t:tf().devicePixelRatio,1)},tp=new class{getFontCache(t){let{fontFamily:e,fontStyle:r,fontWeight:i}=t;e=e.toLowerCase(),this.charWidthsCache[e]||(this.charWidthsCache[e]={});let n=this.charWidthsCache[e],s="".concat(r.toLowerCase(),"_").concat((i+"").toLowerCase());return n[s]||(n[s]={}),n[s]}clearFontCache(t){(t=(t||"").toLowerCase())?this.charWidthsCache[t]&&delete this.charWidthsCache[t]:this.charWidthsCache={}}limitDimsByArea(t){let{perfLimitSizeTotal:e}=tn,r=Math.sqrt(e*t);return[Math.floor(r),Math.floor(e/r)]}constructor(){Z(this,"charWidthsCache",{}),Z(this,"boundsOfCurveCache",{})}},tm="6.7.1";function tv(){}let ty=Math.PI/2,tx=2*Math.PI,tb=Math.PI/180,t_=Object.freeze([1,0,0,1,0,0]),tw="center",tC="left",tS="bottom",tT="right",tO="none",tk=/\r?\n/,tM="moving",tE="scaling",tD="rotating",tj="rotate",tA="skewing",tP="resizing",tF="modifyPoly",tL="changed",tR="scale",tI="scaleX",tB="scaleY",tN="skewX",tW="skewY",tU="fill",tH="stroke",tX="modified",tV="json",tY=new class{has(t){return this[tV].has(t)}getClass(t){let e=this[tV].get(t);if(!e)throw new to("No class registered for ".concat(t));return e}setClass(t,e){e?this[tV].set(e,t):(this[tV].set(t.type,t),this[tV].set(t.type.toLowerCase(),t))}getSVGClass(t){return this.svg.get(t)}setSVGClass(t,e){this.svg.set(null!=e?e:t.type.toLowerCase(),t)}constructor(){this[tV]=new Map,this.svg=new Map}},tz=new class extends Array{remove(t){let e=this.indexOf(t);e>-1&&this.splice(e,1)}cancelAll(){let t=this.splice(0);return t.forEach(t=>t.abort()),t}cancelByCanvas(t){if(!t)return[];let e=this.filter(e=>{var r;return e.target===t||"object"==typeof e.target&&(null==(r=e.target)?void 0:r.canvas)===t});return e.forEach(t=>t.abort()),e}cancelByTarget(t){if(!t)return[];let e=this.filter(e=>e.target===t);return e.forEach(t=>t.abort()),e}};class tG{on(t,e){return(this.__eventListeners||(this.__eventListeners={}),"object"==typeof t)?(Object.entries(t).forEach(t=>{let[e,r]=t;this.on(e,r)}),()=>this.off(t)):e?(this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e),()=>this.off(t,e)):()=>!1}once(t,e){if("object"==typeof t){let e=[];return Object.entries(t).forEach(t=>{let[r,i]=t;e.push(this.once(r,i))}),()=>e.forEach(t=>t())}if(e){let r=this.on(t,function(){for(var t=arguments.length,i=Array(t),n=0;n!1}_removeEventListener(t,e){if(this.__eventListeners[t])if(e){let r=this.__eventListeners[t],i=r.indexOf(e);i>-1&&r.splice(i,1)}else this.__eventListeners[t]=[]}off(t,e){if(this.__eventListeners)if(void 0===t)for(let t in this.__eventListeners)this._removeEventListener(t);else"object"==typeof t?Object.entries(t).forEach(t=>{let[e,r]=t;this._removeEventListener(e,r)}):this._removeEventListener(t,e)}fire(t,e){var r;if(!this.__eventListeners)return;let i=null==(r=this.__eventListeners[t])?void 0:r.concat();if(i)for(let t=0;t{let r=t.indexOf(e);return -1!==r&&t.splice(r,1),t},tK=t=>{if(0===t)return 1;switch(Math.abs(t)/ty){case 1:case 3:return 0;case 2:return -1}return Math.cos(t)},tQ=t=>{if(0===t)return 0;let e=Math.sign(t);switch(t/ty){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(t)};class tJ{add(t){return new tJ(this.x+t.x,this.y+t.y)}addEquals(t){return this.x+=t.x,this.y+=t.y,this}scalarAdd(t){return new tJ(this.x+t,this.y+t)}scalarAddEquals(t){return this.x+=t,this.y+=t,this}subtract(t){return new tJ(this.x-t.x,this.y-t.y)}subtractEquals(t){return this.x-=t.x,this.y-=t.y,this}scalarSubtract(t){return new tJ(this.x-t,this.y-t)}scalarSubtractEquals(t){return this.x-=t,this.y-=t,this}multiply(t){return new tJ(this.x*t.x,this.y*t.y)}scalarMultiply(t){return new tJ(this.x*t,this.y*t)}scalarMultiplyEquals(t){return this.x*=t,this.y*=t,this}divide(t){return new tJ(this.x/t.x,this.y/t.y)}scalarDivide(t){return new tJ(this.x/t,this.y/t)}scalarDivideEquals(t){return this.x/=t,this.y/=t,this}eq(t){return this.x===t.x&&this.y===t.y}lt(t){return this.xt.x&&this.y>t.y}gte(t){return this.x>=t.x&&this.y>=t.y}lerp(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5;return e=Math.max(Math.min(1,e),0),new tJ(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)}distanceFrom(t){let e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)}midPointFrom(t){return this.lerp(t)}min(t){return new tJ(Math.min(this.x,t.x),Math.min(this.y,t.y))}max(t){return new tJ(Math.max(this.x,t.x),Math.max(this.y,t.y))}toString(){return"".concat(this.x,",").concat(this.y)}setXY(t,e){return this.x=t,this.y=e,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setFromPoint(t){return this.x=t.x,this.y=t.y,this}swap(t){let e=this.x,r=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=r}clone(){return new tJ(this.x,this.y)}rotate(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tZ,r=tQ(t),i=tK(t),n=this.subtract(e);return new tJ(n.x*i-n.y*r,n.x*r+n.y*i).add(e)}transform(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new tJ(t[0]*this.x+t[2]*this.y+(e?0:t[4]),t[1]*this.x+t[3]*this.y+(e?0:t[5]))}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;"object"==typeof t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e)}}let tZ=new tJ(0,0),t$=t=>!!t&&Array.isArray(t._objects);function t0(t){class e extends t{_onObjectAdded(t){}_onObjectRemoved(t){}_onStackOrderChanged(t){}add(){for(var t=arguments.length,e=Array(t),r=0;rthis._onObjectAdded(t)),i}insertAt(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;ithis._onObjectAdded(t)),this._objects.length}remove(){let t=this._objects,e=[];for(var r=arguments.length,i=Array(r),n=0;n{let i=t.indexOf(r);-1!==i&&(t.splice(i,1),e.push(r),this._onObjectRemoved(r))}),e}forEachObject(t){this.getObjects().forEach((e,r,i)=>t(e,r,i))}getObjects(){for(var t=arguments.length,e=Array(t),r=0;rt.isType(...e))}item(t){return this._objects[t]}isEmpty(){return 0===this._objects.length}size(){return this._objects.length}contains(t,r){return!!this._objects.includes(t)||!!r&&this._objects.some(r=>r instanceof e&&r.contains(t,!0))}complexity(){return this._objects.reduce((t,e)=>t+=e.complexity?e.complexity():0,0)}sendObjectToBack(t){return!(!t||t===this._objects[0])&&(tq(this._objects,t),this._objects.unshift(t),this._onStackOrderChanged(t),!0)}bringObjectToFront(t){return!(!t||t===this._objects[this._objects.length-1])&&(tq(this._objects,t),this._objects.push(t),this._onStackOrderChanged(t),!0)}sendObjectBackwards(t,e){if(!t)return!1;let r=this._objects.indexOf(t);if(0!==r){let i=this.findNewLowerIndex(t,r,e);return tq(this._objects,t),this._objects.splice(i,0,t),this._onStackOrderChanged(t),!0}return!1}bringObjectForward(t,e){if(!t)return!1;let r=this._objects.indexOf(t);if(r!==this._objects.length-1){let i=this.findNewUpperIndex(t,r,e);return tq(this._objects,t),this._objects.splice(i,0,t),this._onStackOrderChanged(t),!0}return!1}moveObjectTo(t,e){return t!==this._objects[e]&&(tq(this._objects,t),this._objects.splice(e,0,t),this._onStackOrderChanged(t),!0)}findNewLowerIndex(t,e,r){let i;if(r){i=e;for(let r=e-1;r>=0;--r)if(t.isOverlapping(this._objects[r])){i=r;break}}else i=e-1;return i}findNewUpperIndex(t,e,r){let i;if(r){i=e;for(let r=e+1;r1&&void 0!==arguments[1]?arguments[1]:{},o=[],a=new tJ(e,r),l=a.add(new tJ(i,n));for(let t=this._objects.length-1;t>=0;t--){let e=this._objects[t];e.selectable&&e.visible&&(s&&e.intersectsWithRect(a,l)||e.isContainedWithinRect(a,l)||s&&e.containsPoint(a)||s&&e.containsPoint(l))&&o.push(e)}return o}constructor(){super(...arguments),Z(this,"_objects",[])}}return e}class t1 extends tG{_setOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(let e in t)this.set(e,t[e])}_setObject(t){for(let e in t)this._set(e,t[e])}set(t,e){return"object"==typeof t?this._setObject(t):this._set(t,e),this}_set(t,e){this[t]=e}toggle(t){let e=this.get(t);return"boolean"==typeof e&&this.set(t,!e),this}get(t){return this[t]}}function t2(t){return tf().requestAnimationFrame(t)}function t5(t){return tf().cancelAnimationFrame(t)}let t4=0,t3=()=>t4++,t9=()=>{let t=td().createElement("canvas");if(!t||void 0===t.getContext)throw new to("Failed to create `canvas` element");return t},t6=()=>td().createElement("img"),t8=t=>{let e=t9();return e.width=t.width,e.height=t.height,e},t7=(t,e,r)=>t.toDataURL("image/".concat(e),r),et=(t,e,r)=>new Promise((i,n)=>{t.toBlob(i,"image/".concat(e),r)}),ee=t=>t*tb,er=t=>t/tb,ei=t=>t.every((t,e)=>t===t_[e]),en=(t,e,r)=>new tJ(t).transform(e,r),es=t=>{let e=1/(t[0]*t[3]-t[1]*t[2]),r=[e*t[3],-e*t[1],-e*t[2],e*t[0],0,0],{x:i,y:n}=new tJ(t[4],t[5]).transform(r,!0);return r[4]=-i,r[5]=-n,r},eo=(t,e,r)=>[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],r?0:t[0]*e[4]+t[2]*e[5]+t[4],r?0:t[1]*e[4]+t[3]*e[5]+t[5]],ea=(t,e)=>t.reduceRight((t,r)=>r&&t?eo(r,t,e):r||t,void 0)||t_.concat(),el=t=>{let[e,r]=t;return Math.atan2(r,e)},eh=t=>{let e=el(t),r=Math.pow(t[0],2)+Math.pow(t[1],2),i=Math.sqrt(r),n=(t[0]*t[3]-t[2]*t[1])/i,s=Math.atan2(t[0]*t[2]+t[1]*t[3],r);return{angle:er(e),scaleX:i,scaleY:n,skewX:er(s),skewY:0,translateX:t[4]||0,translateY:t[5]||0}},ec=function(t){return[1,0,0,1,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0]};function eu(){let{angle:t=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{x:e=0,y:r=0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=ee(t),n=tK(i),s=tQ(i);return[n,s,-s,n,e?e-(n*e-s*r):0,r?r-(s*e+n*r):0]}let ed=function(t){return[t,0,0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,0,0]},ef=t=>Math.tan(ee(t)),eg=t=>[1,0,ef(t),1,0,0],ep=t=>[1,ef(t),0,1,0,0],em=t=>{let{scaleX:e=1,scaleY:r=1,flipX:i=!1,flipY:n=!1,skewX:s=0,skewY:o=0}=t,a=ed(i?-e:e,n?-r:r);return s&&(a=eo(a,eg(s),!0)),o&&(a=eo(a,ep(o),!0)),a},ev=t=>{let{translateX:e=0,translateY:r=0,angle:i=0}=t,n=ec(e,r);i&&(n=eo(n,eu({angle:i})));let s=em(t);return ei(s)||(n=eo(n,s)),n},ey=function(t){let{signal:e,crossOrigin:r=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(i,n){let s;if(e&&e.aborted)return n(new ta("loadImage"));let o=t6();e&&(s=function(t){o.src="",n(t)},e.addEventListener("abort",s,{once:!0}));let a=function(){o.onload=o.onerror=null,s&&(null==e||e.removeEventListener("abort",s)),i(o)};t?(o.onload=a,o.onerror=function(){s&&(null==e||e.removeEventListener("abort",s)),n(new to("Error loading ".concat(o.src)))},r&&(o.crossOrigin=r),o.src=t):a()})},ex=function(t){let{signal:e,reviver:r=tv}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((i,n)=>{let s=[];e&&e.addEventListener("abort",n,{once:!0}),Promise.all(t.map(t=>tY.getClass(t.type).fromObject(t,{signal:e}).then(e=>(r(t,e),s.push(e),e)))).then(i).catch(t=>{s.forEach(t=>{t.dispose&&t.dispose()}),n(t)}).finally(()=>{e&&e.removeEventListener("abort",n)})})},eb=function(t){let{signal:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((r,i)=>{let n=[];e&&e.addEventListener("abort",i,{once:!0});let s=Object.values(t).map(t=>t&&t.type&&tY.has(t.type)?ex([t],{signal:e}).then(t=>{let[e]=t;return n.push(e),e}):t),o=Object.keys(t);Promise.all(s).then(t=>t.reduce((t,e,r)=>(t[o[r]]=e,t),{})).then(r).catch(t=>{n.forEach(t=>{t.dispose&&t.dispose()}),i(t)}).finally(()=>{e&&e.removeEventListener("abort",i)})})},e_=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).reduce((e,r)=>(r in t&&(e[r]=t[r]),e),{})},ew=(t,e)=>Object.keys(t).reduce((r,i)=>(e(t[i],i,t)&&(r[i]=t[i]),r),{}),eC=(t,e)=>parseFloat(Number(t).toFixed(e)),eS=t=>"matrix("+t.map(t=>eC(t,tn.NUM_FRACTION_DIGITS)).join(" ")+")",eT=t=>!!t&&void 0!==t.toLive,eO=t=>!!t&&"function"==typeof t.toObject,ek=t=>!!t&&void 0!==t.offsetX&&"source"in t,eM=t=>!!t&&"multiSelectionStacking"in t;function eE(t){let e=t&&eD(t),r=0,i=0;if(!t||!e)return{left:r,top:i};let n=t,s=e.documentElement,o=e.body||{scrollLeft:0,scrollTop:0};for(;n&&(n.parentNode||n.host)&&((n=n.parentNode||n.host)===e?(r=o.scrollLeft||s.scrollLeft||0,i=o.scrollTop||s.scrollTop||0):(r+=n.scrollLeft||0,i+=n.scrollTop||0),1!==n.nodeType||"fixed"!==n.style.position););return{left:r,top:i}}let eD=t=>t.ownerDocument||null,ej=t=>{var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||null},eA=function(t,e,r){let{width:i,height:n}=r,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;t.width=i,t.height=n,s>1&&(t.setAttribute("width",(i*s).toString()),t.setAttribute("height",(n*s).toString()),e.scale(s,s))},eP=(t,e)=>{let{width:r,height:i}=e;r&&(t.style.width="number"==typeof r?"".concat(r,"px"):r),i&&(t.style.height="number"==typeof i?"".concat(i,"px"):i)};function eF(t){return void 0!==t.onselectstart&&(t.onselectstart=()=>!1),t.style.userSelect=tO,t}class eL{createLowerCanvas(t){let e=t&&void 0!==t.getContext?t:t&&td().getElementById(t)||t9();if(e.hasAttribute("data-fabric"))throw new to("Trying to initialize a canvas that has already been initialized. Did you forget to dispose the canvas?");return this._originalCanvasStyle=e.style.cssText,e.setAttribute("data-fabric","main"),e.classList.add("lower-canvas"),e}cleanupDOM(t){let{width:e,height:r}=t,{el:i}=this.lower;i.classList.remove("lower-canvas"),i.removeAttribute("data-fabric"),i.setAttribute("width","".concat(e)),i.setAttribute("height","".concat(r)),i.style.cssText=this._originalCanvasStyle||"",this._originalCanvasStyle=void 0}setDimensions(t,e){let{el:r,ctx:i}=this.lower;eA(r,i,t,e)}setCSSDimensions(t){eP(this.lower.el,t)}calcOffset(){return function(t){var e;let r=t&&eD(t),i={left:0,top:0};if(!r)return i;let n=(null==(e=ej(t))?void 0:e.getComputedStyle(t,null))||{};i.left+=parseInt(n.borderLeftWidth,10)||0,i.top+=parseInt(n.borderTopWidth,10)||0,i.left+=parseInt(n.paddingLeft,10)||0,i.top+=parseInt(n.paddingTop,10)||0;let s={left:0,top:0},o=r.documentElement;void 0!==t.getBoundingClientRect&&(s=t.getBoundingClientRect());let a=eE(t);return{left:s.left+a.left-(o.clientLeft||0)+i.left,top:s.top+a.top-(o.clientTop||0)+i.top}}(this.lower.el)}dispose(){tu().dispose(this.lower.el),delete this.lower}constructor(t){Z(this,"_originalCanvasStyle",void 0),Z(this,"lower",void 0);let e=this.createLowerCanvas(t);this.lower={el:e,ctx:e.getContext("2d")}}}let eR={backgroundVpt:!0,backgroundColor:"",overlayVpt:!0,overlayColor:"",includeDefaultValues:!0,svgViewportTransformation:!0,renderOnAddRemove:!0,skipOffscreen:!0,enableRetinaScaling:!0,imageSmoothingEnabled:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,viewportTransform:[...t_]};class eI extends t0(t1){get lowerCanvasEl(){var t;return null==(t=this.elements.lower)?void 0:t.el}get contextContainer(){var t;return null==(t=this.elements.lower)?void 0:t.ctx}static getDefaults(){return eI.ownDefaults}initElements(t){this.elements=new eL(t)}add(){let t=super.add(...arguments);return arguments.length>0&&this.renderOnAddRemove&&this.requestRenderAll(),t}insertAt(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i0&&this.renderOnAddRemove&&this.requestRenderAll(),n}remove(){let t=super.remove(...arguments);return t.length>0&&this.renderOnAddRemove&&this.requestRenderAll(),t}_onObjectAdded(t){t.canvas&&t.canvas!==this&&(ts("warn","Canvas is trying to add an object that belongs to a different canvas.\nResulting to default behavior: removing object from previous canvas and adding to new canvas"),t.canvas.remove(t)),t._set("canvas",this),t.setCoords(),this.fire("object:added",{target:t}),t.fire("added",{target:this})}_onObjectRemoved(t){t._set("canvas",void 0),this.fire("object:removed",{target:t}),t.fire("removed",{target:this})}_onStackOrderChanged(){this.renderOnAddRemove&&this.requestRenderAll()}getRetinaScaling(){return this.enableRetinaScaling?tg():1}calcOffset(){return this._offset=this.elements.calcOffset()}getWidth(){return this.width}getHeight(){return this.height}setWidth(t,e){return this.setDimensions({width:t},e)}setHeight(t,e){return this.setDimensions({height:t},e)}_setDimensionsImpl(t){let{cssOnly:e=!1,backstoreOnly:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e){let e=tt({width:this.width,height:this.height},t);this.elements.setDimensions(e,this.getRetinaScaling()),this.hasLostContext=!0,this.width=e.width,this.height=e.height}r||this.elements.setCSSDimensions(t),this.calcOffset()}setDimensions(t,e){this._setDimensionsImpl(t,e),e&&e.cssOnly||this.requestRenderAll()}getZoom(){return this.viewportTransform[0]}setViewportTransform(t){this.viewportTransform=t,this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll()}zoomToPoint(t,e){let r=[...this.viewportTransform],i=en(t,es(r));r[0]=e,r[3]=e;let n=en(i,r);r[4]+=t.x-n.x,r[5]+=t.y-n.y,this.setViewportTransform(r)}setZoom(t){this.zoomToPoint(new tJ(0,0),t)}absolutePan(t){let e=[...this.viewportTransform];return e[4]=-t.x,e[5]=-t.y,this.setViewportTransform(e)}relativePan(t){return this.absolutePan(new tJ(-t.x-this.viewportTransform[4],-t.y-this.viewportTransform[5]))}getElement(){return this.elements.lower.el}clearContext(t){t.clearRect(0,0,this.width,this.height)}getContext(){return this.elements.lower.ctx}clear(){this.remove(...this.getObjects()),this.backgroundImage=void 0,this.overlayImage=void 0,this.backgroundColor="",this.overlayColor="",this.clearContext(this.getContext()),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll()}renderAll(){this.cancelRequestedRender(),this.destroyed||this.renderCanvas(this.getContext(),this._objects)}renderAndReset(){this.nextRenderHandle=0,this.renderAll()}requestRenderAll(){this.nextRenderHandle||this.disposed||this.destroyed||(this.nextRenderHandle=t2(()=>this.renderAndReset()))}calcViewportBoundaries(){let t=this.width,e=this.height,r=es(this.viewportTransform),i=en({x:0,y:0},r),n=en({x:t,y:e},r),s=i.min(n),o=i.max(n);return this.vptCoords={tl:s,tr:new tJ(o.x,s.y),bl:new tJ(s.x,o.y),br:o}}cancelRequestedRender(){this.nextRenderHandle&&(t5(this.nextRenderHandle),this.nextRenderHandle=0)}drawControls(t){}renderCanvas(t,e){if(this.destroyed)return;let r=this.viewportTransform,i=this.clipPath;this.calcViewportBoundaries(),this.clearContext(t),t.imageSmoothingEnabled=this.imageSmoothingEnabled,t.patternQuality="best",this.fire("before:render",{ctx:t}),this._renderBackground(t),t.save(),t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this._renderObjects(t,e),t.restore(),this.controlsAboveOverlay||this.skipControlsDrawing||this.drawControls(t),i&&(i._set("canvas",this),i.shouldCache(),i._transformDone=!0,i.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(t,i)),this._renderOverlay(t),this.controlsAboveOverlay&&!this.skipControlsDrawing&&this.drawControls(t),this.fire("after:render",{ctx:t}),this.__cleanupTask&&(this.__cleanupTask(),this.__cleanupTask=void 0)}drawClipPathOnCanvas(t,e){let r=this.viewportTransform;t.save(),t.transform(...r),t.globalCompositeOperation="destination-in",e.transform(t),t.scale(1/e.zoomX,1/e.zoomY),t.drawImage(e._cacheCanvas,-e.cacheTranslationX,-e.cacheTranslationY),t.restore()}_renderObjects(t,e){for(let r=0,i=e.length;r!t.excludeFromExport).map(r=>this._toObject(r,t,e))},this.__serializeBgOverlay(t,e)),i?{clipPath:i}:null)}_toObject(t,e,r){let i;this.includeDefaultValues||(i=t.includeDefaultValues,t.includeDefaultValues=!1);let n=t[e](r);return this.includeDefaultValues||(t.includeDefaultValues=!!i),n}__serializeBgOverlay(t,e){let r={},i=this.backgroundImage,n=this.overlayImage,s=this.backgroundColor,o=this.overlayColor;return eT(s)?s.excludeFromExport||(r.background=s.toObject(e)):s&&(r.background=s),eT(o)?o.excludeFromExport||(r.overlay=o.toObject(e)):o&&(r.overlay=o),i&&!i.excludeFromExport&&(r.backgroundImage=this._toObject(i,t,e)),n&&!n.excludeFromExport&&(r.overlayImage=this._toObject(n,t,e)),r}toSVG(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;t.reviver=e;let r=[];return this._setSVGPreamble(r,t),this._setSVGHeader(r,t),this.clipPath&&r.push('\n')),this._setSVGBgOverlayColor(r,"background"),this._setSVGBgOverlayImage(r,"backgroundImage",e),this._setSVGObjects(r,e),this.clipPath&&r.push("\n"),this._setSVGBgOverlayColor(r,"overlay"),this._setSVGBgOverlayImage(r,"overlayImage",e),r.push(""),r.join("")}_setSVGPreamble(t,e){e.suppressPreamble||t.push('\n','\n')}_setSVGHeader(t,e){let r,i=e.width||"".concat(this.width),n=e.height||"".concat(this.height),s=tn.NUM_FRACTION_DIGITS,o=e.viewBox;if(o)r='viewBox="'.concat(o.x," ").concat(o.y," ").concat(o.width," ").concat(o.height,'" ');else if(this.svgViewportTransformation){let t=this.viewportTransform;r='viewBox="'.concat(eC(-t[4]/t[0],s)," ").concat(eC(-t[5]/t[3],s)," ").concat(eC(this.width/t[0],s)," ").concat(eC(this.height/t[3],s),'" ')}else r='viewBox="0 0 '.concat(this.width," ").concat(this.height,'" ');t.push("\n',"Created with Fabric.js ",tm,"\n","\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),"\n")}createSVGClipPathMarkup(t){let e=this.clipPath;return e?(e.clipPathId="CLIPPATH_".concat(t3()),'\n').concat(e.toClipPathSVG(t.reviver),"\n")):""}createSVGRefElementsMarkup(){return["background","overlay"].map(t=>{let e=this["".concat(t,"Color")];if(eT(e)){let r=this["".concat(t,"Vpt")],i=this.viewportTransform,n={isType:()=>!1,width:this.width/(r?i[0]:1),height:this.height/(r?i[3]:1)};return e.toSVG(n,{additionalTransform:r?eS(i):""})}}).join("")}createSVGFontFacesMarkup(){let t=[],e={},r=tn.fontPaths;this._objects.forEach(function e(r){t.push(r),t$(r)&&r._objects.forEach(e)}),t.forEach(t=>{if(!t||"function"!=typeof t._renderText)return;let{styles:i,fontFamily:n}=t;!e[n]&&r[n]&&(e[n]=!0,i&&Object.values(i).forEach(t=>{Object.values(t).forEach(t=>{let{fontFamily:i=""}=t;!e[i]&&r[i]&&(e[i]=!0)})}))});let i=Object.keys(e).map(t=>" @font-face {\n font-family: '".concat(t,"';\n src: url('").concat(r[t],"');\n }\n")).join("");return i?' \n"):""}_setSVGObjects(t,e){this.forEachObject(r=>{r.excludeFromExport||this._setSVGObject(t,r,e)})}_setSVGObject(t,e,r){t.push(e.toSVG(r))}_setSVGBgOverlayImage(t,e,r){let i=this[e];i&&!i.excludeFromExport&&i.toSVG&&t.push(i.toSVG(r))}_setSVGBgOverlayColor(t,e){let r=this["".concat(e,"Color")];if(r)if(eT(r)){let i=r.repeat||"",n=this.width,s=this.height,o=this["".concat(e,"Vpt")]?eS(es(this.viewportTransform)):"";t.push('\n'))}else t.push('\n")}loadFromJSON(t,e){let{signal:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return Promise.reject(new to("`json` is undefined"));let i="string"==typeof t?JSON.parse(t):t,{objects:n=[],backgroundImage:s,background:o,overlayImage:a,overlay:l,clipPath:h}=i,c=this.renderOnAddRemove;return this.renderOnAddRemove=!1,Promise.all([ex(n,{reviver:e,signal:r}),eb({backgroundImage:s,backgroundColor:o,overlayImage:a,overlayColor:l,clipPath:h},{signal:r})]).then(t=>{let[e,r]=t;return this.clear(),this.add(...e),this.set(i),this.set(r),this.renderOnAddRemove=c,this})}clone(t){let e=this.toObject(t);return this.cloneWithoutData().loadFromJSON(e)}cloneWithoutData(){let t=t8(this);return new this.constructor(t)}toDataURL(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{format:e="png",quality:r=1,multiplier:i=1,enableRetinaScaling:n=!1}=t,s=i*(n?this.getRetinaScaling():1);return t7(this.toCanvasElement(s,t),e,r)}toBlob(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{format:e="png",quality:r=1,multiplier:i=1,enableRetinaScaling:n=!1}=t,s=i*(n?this.getRetinaScaling():1);return et(this.toCanvasElement(s,t),e,r)}toCanvasElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,{width:e,height:r,left:i,top:n,filter:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=(e||this.width)*t,a=(r||this.height)*t,l=this.getZoom(),h=this.width,c=this.height,u=this.skipControlsDrawing,d=l*t,f=this.viewportTransform,g=[d,0,0,d,(f[4]-(i||0))*t,(f[5]-(n||0))*t],p=this.enableRetinaScaling,m=t8({width:o,height:a}),y=s?this._objects.filter(t=>s(t)):this._objects;return this.enableRetinaScaling=!1,this.viewportTransform=g,this.width=o,this.height=a,this.skipControlsDrawing=!0,this.calcViewportBoundaries(),this.renderCanvas(m.getContext("2d"),y),this.viewportTransform=f,this.width=h,this.height=c,this.calcViewportBoundaries(),this.enableRetinaScaling=p,this.skipControlsDrawing=u,m}dispose(){return this.disposed||this.elements.cleanupDOM({width:this.width,height:this.height}),tz.cancelByCanvas(this),this.disposed=!0,new Promise((t,e)=>{let r=()=>{this.destroy(),t(!0)};r.kill=e,this.__cleanupTask&&this.__cleanupTask.kill("aborted"),this.destroyed?t(!1):this.nextRenderHandle?this.__cleanupTask=r:r()})}destroy(){this.destroyed=!0,this.cancelRequestedRender(),this.forEachObject(t=>t.dispose()),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose(),this.backgroundImage=void 0,this.overlayImage&&this.overlayImage.dispose(),this.overlayImage=void 0,this.elements.dispose()}toString(){return"#")}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Object.assign(this,this.constructor.getDefaults()),this.set(e),this.initElements(t),this._setDimensionsImpl({width:this.width||this.elements.lower.el.width||0,height:this.height||this.elements.lower.el.height||0}),this.skipControlsDrawing=!1,this.viewportTransform=[...this.viewportTransform],this.calcViewportBoundaries()}}Z(eI,"ownDefaults",eR);let eB=["touchstart","touchmove","touchend"],eN=t=>{let e=eE(t.target),r=function(t){let e=t.changedTouches;return e&&e[0]?e[0]:t}(t);return new tJ(r.clientX+e.left,r.clientY+e.top)},eW=t=>eB.includes(t.type)||"touch"===t.pointerType,eU=t=>{t.preventDefault(),t.stopPropagation()},eH=t=>{let e=0,r=0,i=0,n=0;for(let s=0,o=t.length;si||!s)&&(i=o),(on||!s)&&(n=a),(aeY(t,eo(e,t.calcOwnMatrix())),eY=(t,e)=>{let r=eh(e),{translateX:i,translateY:n,scaleX:s,scaleY:o}=r,a=te(r,eX),l=new tJ(i,n);t.flipX=!1,t.flipY=!1,Object.assign(t,a),t.set({scaleX:s,scaleY:o}),t.setPositionByOrigin(l,tw,tw)},ez=t=>{t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},eG=t=>({scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}),eq=(t,e,r)=>{let i=t/2,n=e/2,s=eH([new tJ(-i,-n),new tJ(i,-n),new tJ(-i,n),new tJ(i,n)].map(t=>t.transform(r)));return new tJ(s.width,s.height)},eK=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t_;return eo(es(arguments.length>1&&void 0!==arguments[1]?arguments[1]:t_),t)},eQ=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t_,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t_;return t.transform(eK(e,r))},eJ=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t_,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t_;return t.transform(eK(e,r),!0)},eZ=(t,e,r)=>{let i=eK(e,r);return eY(t,eo(i,t.calcOwnMatrix())),i},e$=(t,e)=>{var r;let{transform:{target:i}}=e;null==(r=i.canvas)||r.fire("object:".concat(t),tt(tt({},e),{},{target:i})),i.fire(t,e)},e0={left:-.5,top:-.5,center:0,bottom:.5,right:.5},e1=t=>"string"==typeof t?e0[t]:t-.5,e2="not-allowed";function e5(t){return e1(t.originX)===e1(tw)&&e1(t.originY)===e1(tw)}let e4=(t,e)=>t[e],e3=(t,e,r,i)=>({e:t,transform:e,pointer:new tJ(r,i)});function e9(t,e){return Math.round((t.getTotalAngle()+er(Math.atan2(e.y,e.x))+360)%360/45)}function e6(t,e,r,i,n){var s;let{target:o,corner:a}=t,l=o.controls[a],h=(null==(s=o.canvas)?void 0:s.getZoom())||1,c=o.padding/h,u=function(t,e,r,i){let n=t.getRelativeCenterPoint(),s=void 0!==r&&void 0!==i?t.translateToGivenOrigin(n,tw,tw,r,i):new tJ(t.left,t.top);return(t.angle?e.rotate(-ee(t.angle),n):e).subtract(s)}(o,new tJ(i,n),e,r);return u.x>=c&&(u.x-=c),u.x<=-c&&(u.x+=c),u.y>=c&&(u.y-=c),u.y<=c&&(u.y+=c),u.x-=l.offsetX,u.y-=l.offsetY,u}let e8=(t,e,r,i)=>{let{target:n,offsetX:s,offsetY:o}=e,a=r-s,l=i-o,h=!e4(n,"lockMovementX")&&n.left!==a,c=!e4(n,"lockMovementY")&&n.top!==l;return h&&n.set(tC,a),c&&n.set("top",l),(h||c)&&e$(tM,e3(t,e,r,i)),h||c},e7={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#639",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32"},rt=(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t),re=(t,e,r,i)=>{let n,s;t/=255;let o=Math.max(t,e/=255,r/=255),a=Math.min(t,e,r),l=(o+a)/2;if(o===a)n=s=0;else{let i=o-a;switch(s=l>.5?i/(2-o-a):i/(o+a),o){case t:n=(e-r)/i+6*(e0&&void 0!==arguments[0]?arguments[0]:"1";return parseFloat(t)/(t.endsWith("%")?100:1)},ri=t=>Math.min(Math.round(t),255).toString(16).toUpperCase().padStart(2,"0"),rn=t=>{let[e,r,i,n=1]=t,s=Math.round(.3*e+.59*r+.11*i);return[s,s,s,n]};class rs{_tryParsingColor(t){return(t=t.toLowerCase())in e7&&(t=e7[t]),"transparent"===t?[255,255,255,0]:rs.sourceFromHex(t)||rs.sourceFromRgb(t)||rs.sourceFromHsl(t)||(this.isUnrecognised=!0,[0,0,0,1])}getSource(){return this._source}setSource(t){this._source=t}toRgb(){let[t,e,r]=this.getSource();return"rgb(".concat(t,",").concat(e,",").concat(r,")")}toRgba(){return"rgba(".concat(this.getSource().join(","),")")}toHsl(){let[t,e,r]=re(...this.getSource());return"hsl(".concat(t,",").concat(e,"%,").concat(r,"%)")}toHsla(){let[t,e,r,i]=re(...this.getSource());return"hsla(".concat(t,",").concat(e,"%,").concat(r,"%,").concat(i,")")}toHex(){return this.toHexa().slice(0,6)}toHexa(){let[t,e,r,i]=this.getSource();return"".concat(ri(t)).concat(ri(e)).concat(ri(r)).concat(ri(Math.round(255*i)))}getAlpha(){return this.getSource()[3]}setAlpha(t){return this._source[3]=t,this}toGrayscale(){return this.setSource(rn(this.getSource())),this}toBlackWhite(t){let[e,,,r]=rn(this.getSource()),i=e<(t||127)?0:255;return this.setSource([i,i,i,r]),this}overlayWith(t){t instanceof rs||(t=new rs(t));let e=this.getSource(),r=t.getSource(),[i,n,s]=e.map((t,e)=>Math.round(.5*t+.5*r[e]));return this.setSource([i,n,s,e[3]]),this}static fromRgb(t){return rs.fromRgba(t)}static fromRgba(t){return new rs(rs.sourceFromRgb(t))}static sourceFromRgb(t){let e=t.match(/^rgba?\(\s*(\d{0,3}(?:\.\d+)?%?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*(?:\s*[,/]\s*(\d{0,3}(?:\.\d+)?%?)\s*)?\)$/i);if(e){let[t,r,i]=e.slice(1,4).map(t=>{let e=parseFloat(t);return t.endsWith("%")?Math.round(2.55*e):e});return[t,r,i,rr(e[4])]}}static fromHsl(t){return rs.fromHsla(t)}static fromHsla(t){return new rs(rs.sourceFromHsl(t))}static sourceFromHsl(t){let e,r,i,n=t.match(/^hsla?\(\s*([+-]?\d{0,3}(?:\.\d+)?(?:deg|turn|rad)?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*(?:\s*[,/]\s*(\d*(?:\.\d+)?%?)\s*)?\)$/i);if(!n)return;let s=(rs.parseAngletoDegrees(n[1])%360+360)%360/360,o=parseFloat(n[2])/100,a=parseFloat(n[3])/100;if(0===o)e=r=i=a;else{let t=a<=.5?a*(o+1):a+o-a*o,n=2*a-t;e=rt(n,t,s+1/3),r=rt(n,t,s),i=rt(n,t,s-1/3)}return[Math.round(255*e),Math.round(255*r),Math.round(255*i),rr(n[4])]}static fromHex(t){return new rs(rs.sourceFromHex(t))}static sourceFromHex(t){if(t.match(/^#?(([0-9a-f]){3,4}|([0-9a-f]{2}){3,4})$/i)){let e=t.slice(t.indexOf("#")+1),[r,i,n,s=255]=(e.length<=4?e.split("").map(t=>t+t):e.match(/.{2}/g)).map(t=>parseInt(t,16));return[r,i,n,s/255]}}static parseAngletoDegrees(t){let e=t.toLowerCase(),r=parseFloat(e);return e.includes("rad")?er(r):e.includes("turn")?360*r:r}constructor(t){if(Z(this,"isUnrecognised",!1),t)if(t instanceof rs)this.setSource([...t._source]);else if(Array.isArray(t)){let[e,r,i,n=1]=t;this.setSource([e,r,i,n])}else this.setSource(this._tryParsingColor(t));else this.setSource([0,0,0,1])}}let ro=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,r=/\D{0,2}$/.exec(t),i=parseFloat(t),n=tn.DPI;switch(null==r?void 0:r[0]){case"mm":return i*n/25.4;case"cm":return i*n/2.54;case"in":return i*n;case"pt":return i*n/72;case"pc":return i*n/72*12;case"em":return i*e;default:return i}},ra=t=>{let[e,r]=t.trim().split(" "),[i,n]=e&&e!==tO?[e.slice(1,4),e.slice(5,8)]:e===tO?[e,e]:["Mid","Mid"];return{meetOrSlice:r||"meet",alignX:i,alignY:n}},rl=function(t,e){let r,i,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e)if(e.toLive)r="url(#SVGID_".concat(e.id,")");else{let t=new rs(e),n=t.getAlpha();r=t.toRgb(),1!==n&&(i=n.toString())}else r="none";return n?"".concat(t,": ").concat(r,"; ").concat(i?"".concat(t,"-opacity: ").concat(i,"; "):""):"".concat(t,'="').concat(r,'" ').concat(i?"".concat(t,'-opacity="').concat(i,'" '):"")};class rh{getSvgStyles(t){let e=this.fillRule?this.fillRule:"nonzero",r=this.strokeWidth?this.strokeWidth:"0",i=this.strokeDashArray?this.strokeDashArray.join(" "):tO,n=this.strokeDashOffset?this.strokeDashOffset:"0",s=this.strokeLineCap?this.strokeLineCap:"butt",o=this.strokeLineJoin?this.strokeLineJoin:"miter",a=this.strokeMiterLimit?this.strokeMiterLimit:"4",l=void 0!==this.opacity?this.opacity:"1",h=this.visible?"":" visibility: hidden;",c=t?"":this.getSvgFilter(),u=rl(tU,this.fill);return rl(tH,this.stroke)+"stroke-width: "+r+"; stroke-dasharray: "+i+"; stroke-linecap: "+s+"; stroke-dashoffset: "+n+"; stroke-linejoin: "+o+"; stroke-miterlimit: "+a+"; "+u+"fill-rule: "+e+"; opacity: "+l+";"+c+h}getSvgFilter(){return this.shadow?"filter: url(#SVGID_".concat(this.shadow.id,");"):""}getSvgCommons(){return[this.id?'id="'.concat(this.id,'" '):"",this.clipPath?'clip-path="url(#'.concat(this.clipPath.clipPathId,')" '):""].join("")}getSvgTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t?this.calcTransformMatrix():this.calcOwnMatrix(),i='transform="'.concat(eS(r));return"".concat(i).concat(e,'" ')}_toSVG(t){return[""]}toSVG(t){return this._createBaseSVGMarkup(this._toSVG(t),{reviver:t})}toClipPathSVG(t){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(t),{reviver:t})}_createBaseClipPathSVGMarkup(t){let{reviver:e,additionalTransform:r=""}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),n=t.indexOf("COMMON_PARTS");return t[n]=i,e?e(t.join("")):t.join("")}_createBaseSVGMarkup(t){let e,{noStyle:r,reviver:i,withShadow:n,additionalTransform:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r?"":'style="'.concat(this.getSvgStyles(),'" '),a=n?'style="'.concat(this.getSvgFilter(),'" '):"",l=this.clipPath,h=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",c=l&&l.absolutePositioned,u=this.stroke,d=this.fill,f=this.shadow,g=[],p=t.indexOf("COMMON_PARTS");l&&(l.clipPathId="CLIPPATH_".concat(t3()),e='\n').concat(l.toClipPathSVG(i),"\n")),c&&g.push("\n"),g.push("\n");let m=""+o+h+(r?"":this.addPaintOrder())+" "+(s?'transform="'.concat(s,'" '):"");return t[p]=m,eT(d)&&g.push(d.toSVG(this)),eT(u)&&g.push(u.toSVG(this)),f&&g.push(f.toSVG(this)),l&&g.push(e),g.push(t.join("")),g.push("\n"),c&&g.push("\n"),i?i(g.join("")):g.join("")}addPaintOrder(){return this.paintFirst!==tU?' paint-order="'.concat(this.paintFirst,'" '):""}}function rc(t){return RegExp("^("+t.join("|")+")\\b","i")}let ru="textDecorationThickness",rd=["fontSize","fontWeight","fontFamily","fontStyle"],rf=["underline","overline","linethrough"],rg=[...rd,"lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide","pathAlign"],rp=[...rg,...rf,"textBackgroundColor","direction",ru],rm=[...rd,...rf,tH,"strokeWidth",tU,"deltaY","textBackgroundColor",ru],rv="justify",ry="justify-left",rx="justify-right",rb="justify-center",r_=String.raw(s||(s=tr(["[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?"],["[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?"]))),rw=String.raw(o||(o=tr(["(?:s*,?s+|s*,s*)"],["(?:\\s*,?\\s+|\\s*,\\s*)"]))),rC=RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+r_+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+r_+"))?\\s+(.*)"),rS={cx:tC,x:tC,r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing","text-decoration-thickness":ru},rT="font-size",rO="clip-path",rk=(rc(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),rc(["symbol","image","marker","pattern","view","svg"]),rc(["symbol","g","a","svg","clipPath","defs"])),rM=(new RegExp(String.raw(a||(a=tr(["^s*(",")","(",")","(",")","(",")s*$"],["^\\s*(",")","(",")","(",")","(",")\\s*$"])),r_,rw,r_,rw,r_,rw,r_)),new tJ(1,0)),rE=new tJ,rD=(t,e)=>t.rotate(e),rj=(t,e)=>new tJ(e).subtract(t),rA=t=>t.distanceFrom(rE),rP=(t,e)=>Math.atan2(rI(t,e),rB(t,e)),rF=t=>rP(rM,t),rL=t=>t.eq(rE)?t:t.scalarDivide(rA(t)),rR=function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return rL(new tJ(-t.y,t.x).scalarMultiply(e?1:-1))},rI=(t,e)=>t.x*e.y-t.y*e.x,rB=(t,e)=>t.x*e.x+t.y*e.y,rN=(t,e,r)=>{if(t.eq(e)||t.eq(r))return!0;let i=rI(e,r),n=rI(e,t),s=rI(r,t);return i>=0?n>=0&&s<=0:!(n<=0&&s>=0)},rW="(-?\\d+(?:\\.\\d*)?(?:px)?(?:\\s?|$))?",rU=RegExp("(?:\\s|^)"+rW+rW+"("+r_+"?(?:px)?)?(?:\\s?|$)(?:$|\\s)");class rH{static parseShadow(t){let e=t.trim(),[,r=0,i=0,n=0]=(rU.exec(e)||[]).map(t=>parseFloat(t)||0);return{color:(e.replace(rU,"")||"rgb(0,0,0)").trim(),offsetX:r,offsetY:i,blur:n}}toString(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")}toSVG(t){let e=rD(new tJ(this.offsetX,this.offsetY),ee(-t.angle)),r=new rs(this.color),i=40,n=40;return t.width&&t.height&&(i=100*eC((Math.abs(e.x)+this.blur)/t.width,tn.NUM_FRACTION_DIGITS)+20,n=100*eC((Math.abs(e.y)+this.blur)/t.height,tn.NUM_FRACTION_DIGITS)+20),t.flipX&&(e.x*=-1),t.flipY&&(e.y*=-1),'\n \n \n \n \n \n \n \n \n\n')}toObject(){let t={color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling,type:this.constructor.type},e=rH.ownDefaults;return this.includeDefaultValues?t:ew(t,(t,r)=>t!==e[r])}static async fromObject(t){return new this(t)}constructor(t){let e="string"==typeof t?rH.parseShadow(t):t;Object.assign(this,rH.ownDefaults,e),this.id=t3()}}Z(rH,"ownDefaults",{color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1}),Z(rH,"type","shadow"),tY.setClass(rH,"shadow");let rX=(t,e,r)=>Math.max(t,Math.min(e,r)),rV=["top",tC,tI,tB,"flipX","flipY","originX","originY","angle","opacity","globalCompositeOperation","shadow","visible",tN,tW],rY=[tU,tH,"strokeWidth","strokeDashArray","width","height","paintFirst","strokeUniform","strokeLineCap","strokeDashOffset","strokeLineJoin","strokeMiterLimit","backgroundColor","clipPath"],rz=(t,e,r,i)=>(tt*Math.pow(2,10*(i-=1))*Math.sin((i*n-e)*tx/r),rq=(t,e,r,i)=>-r*Math.cos(t/i*ty)+r+e,rK=(t,e,r,i)=>(t/=i)<1/2.75?7.5625*t*t*r+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,rQ=(t,e,r,i)=>r-rK(i-t,0,r,i)+e;var rJ=Object.freeze({__proto__:null,defaultEasing:rq,easeInBack:function(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1.70158;return r*(t/=i)*t*((n+1)*t-n)+e},easeInBounce:rQ,easeInCirc:(t,e,r,i)=>-r*(Math.sqrt(1-(t/=i)*t)-1)+e,easeInCubic:(t,e,r,i)=>r*(t/i)**3+e,easeInElastic:(t,e,r,i)=>{let n=0;if(0===t)return e;if(1==(t/=i))return e+r;n||(n=.3*i);let{a:s,s:o,p:a}=rz(r,r,n,1.70158);return-rG(s,o,a,t,i)+e},easeInExpo:(t,e,r,i)=>0===t?e:r*2**(10*(t/i-1))+e,easeInOutBack:function(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1.70158;return(t/=i/2)<1?r/2*(t*t*((1+(n*=1.525))*t-n))+e:r/2*((t-=2)*t*((1+(n*=1.525))*t+n)+2)+e},easeInOutBounce:(t,e,r,i)=>t(t/=i/2)<1?-r/2*(Math.sqrt(1-t**2)-1)+e:r/2*(Math.sqrt(1-(t-=2)*t)+1)+e,easeInOutCubic:(t,e,r,i)=>(t/=i/2)<1?r/2*t**3+e:r/2*((t-2)**3+2)+e,easeInOutElastic:(t,e,r,i)=>{let n=0;if(0===t)return e;if(2==(t/=i/2))return e+r;n||(n=.3*1.5*i);let{a:s,s:o,p:a,c:l}=rz(r,r,n,1.70158);return t<1?-.5*rG(s,o,a,t,i)+e:s*Math.pow(2,-10*(t-=1))*Math.sin((t*i-o)*tx/a)*.5+l+e},easeInOutExpo:(t,e,r,i)=>0===t?e:t===i?e+r:(t/=i/2)<1?r/2*2**(10*(t-1))+e:-(r/2*(2**(-10*--t)+2))+e,easeInOutQuad:(t,e,r,i)=>(t/=i/2)<1?r/2*t**2+e:-r/2*(--t*(t-2)-1)+e,easeInOutQuart:(t,e,r,i)=>(t/=i/2)<1?r/2*t**4+e:-r/2*((t-=2)*t**3-2)+e,easeInOutQuint:(t,e,r,i)=>(t/=i/2)<1?r/2*t**5+e:r/2*((t-2)**5+2)+e,easeInOutSine:(t,e,r,i)=>-r/2*(Math.cos(Math.PI*t/i)-1)+e,easeInQuad:(t,e,r,i)=>r*(t/=i)*t+e,easeInQuart:(t,e,r,i)=>r*(t/=i)*t**3+e,easeInQuint:(t,e,r,i)=>r*(t/i)**5+e,easeInSine:(t,e,r,i)=>-r*Math.cos(t/i*ty)+r+e,easeOutBack:function(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1.70158;return r*((t=t/i-1)*t*((n+1)*t+n)+1)+e},easeOutBounce:rK,easeOutCirc:(t,e,r,i)=>r*Math.sqrt(1-(t=t/i-1)*t)+e,easeOutCubic:(t,e,r,i)=>r*((t/i-1)**3+1)+e,easeOutElastic:(t,e,r,i)=>{let n=0;if(0===t)return e;if(1==(t/=i))return e+r;n||(n=.3*i);let{a:s,s:o,p:a,c:l}=rz(r,r,n,1.70158);return s*2**(-10*t)*Math.sin((t*i-o)*tx/a)+l+e},easeOutExpo:(t,e,r,i)=>t===i?e+r:-(r*(2**(-10*t/i)+1))+e,easeOutQuad:(t,e,r,i)=>-r*(t/=i)*(t-2)+e,easeOutQuart:(t,e,r,i)=>-r*((t=t/i-1)*t**3-1)+e,easeOutQuint:(t,e,r,i)=>r*((t/i-1)**5+1)+e,easeOutSine:(t,e,r,i)=>r*Math.sin(t/i*ty)+e});let rZ=()=>!1;class r${get state(){return this._state}isDone(){return"aborted"===this._state||"completed"===this._state}start(){let t=t=>{"pending"===this._state&&(this.startTime=t||+new Date,this._state="running",this._onStart(),this.tick(this.startTime))};this.register(),this.delay>0?setTimeout(()=>t2(t),this.delay):t2(t)}tick(t){let e=(t||+new Date)-this.startTime,r=Math.min(e,this.duration);this.durationProgress=r/this.duration;let{value:i,valueProgress:n}=this.calculate(r);this.value=Object.freeze(i),this.valueProgress=n,"aborted"!==this._state&&(this._abort(this.value,this.valueProgress,this.durationProgress)?(this._state="aborted",this.unregister()):e>=this.duration?(this.durationProgress=this.valueProgress=1,this._onChange(this.endValue,this.valueProgress,this.durationProgress),this._state="completed",this._onComplete(this.endValue,this.valueProgress,this.durationProgress),this.unregister()):(this._onChange(this.value,this.valueProgress,this.durationProgress),t2(this.tick)))}register(){tz.push(this)}unregister(){tz.remove(this)}abort(){this._state="aborted",this.unregister()}constructor(t){let{startValue:e,byValue:r,duration:i=500,delay:n=0,easing:s=rq,onStart:o=tv,onChange:a=tv,onComplete:l=tv,abort:h=rZ,target:c}=t;Z(this,"_state","pending"),Z(this,"durationProgress",0),Z(this,"valueProgress",0),this.tick=this.tick.bind(this),this.duration=i,this.delay=n,this.easing=s,this._onStart=o,this._onChange=a,this._onComplete=l,this._abort=h,this.target=c,this.startValue=e,this.byValue=r,this.value=this.startValue,this.endValue=Object.freeze(this.calculate(this.duration).value)}}let r0=["startValue","endValue"];class r1 extends r${calculate(t){let e=this.easing(t,this.startValue,this.byValue,this.duration);return{value:e,valueProgress:Math.abs((e-this.startValue)/this.byValue)}}constructor(t){let{startValue:e=0,endValue:r=100}=t;super(tt(tt({},te(t,r0)),{},{startValue:e,byValue:r-e}))}}let r2=["startValue","endValue"];class r5 extends r${calculate(t){let e=this.startValue.map((e,r)=>this.easing(t,e,this.byValue[r],this.duration,r));return{value:e,valueProgress:Math.abs((e[0]-this.startValue[0])/this.byValue[0])}}constructor(t){let{startValue:e=[0],endValue:r=[100]}=t;super(tt(tt({},te(t,r2)),{},{startValue:e,byValue:r.map((t,r)=>t-e[r])}))}}let r4=["startValue","endValue","easing","onChange","onComplete","abort"],r3=(t,e,r,i)=>e+r*(1-Math.cos(t/i*ty)),r9=t=>t&&((e,r,i)=>t(new rs(e).toRgba(),r,i));class r6 extends r${calculate(t){let[e,r,i,n]=this.startValue.map((e,r)=>this.easing(t,e,this.byValue[r],this.duration,r)),s=[...[e,r,i].map(Math.round),rX(0,n,1)];return{value:s,valueProgress:s.map((t,e)=>0!==this.byValue[e]?Math.abs((t-this.startValue[e])/this.byValue[e]):0).find(t=>0!==t)||0}}constructor(t){let{startValue:e,endValue:r,easing:i=r3,onChange:n,onComplete:s,abort:o}=t,a=te(t,r4),l=new rs(e).getSource();super(tt(tt({},a),{},{startValue:l,byValue:new rs(r).getSource().map((t,e)=>t-l[e]),easing:i,onChange:r9(n),onComplete:r9(s),abort:r9(o)}))}}function r8(t){let e=Array.isArray(t.startValue)||Array.isArray(t.endValue)?new r5(t):new r1(t);return e.start(),e}function r7(t){let e=new r6(t);return e.start(),e}class it{includes(t){return this.points.some(e=>e.eq(t))}append(){for(var t=arguments.length,e=Array(t),r=0;r!this.includes(t))),this}static isPointContained(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.eq(r))return t.eq(e);if(e.x===r.x)return t.x===e.x&&(i||t.y>=Math.min(e.y,r.y)&&t.y<=Math.max(e.y,r.y));if(e.y===r.y)return t.y===e.y&&(i||t.x>=Math.min(e.x,r.x)&&t.x<=Math.max(e.x,r.x));{let n=rj(e,r),s=rj(e,t).divide(n);return i?Math.abs(s.x)===Math.abs(s.y):s.x===s.y&&s.x>=0&&s.x<=1}}static isPointInPolygon(t,e){let r=new tJ(t).setX(Math.min(t.x-1,...e.map(t=>t.x))),i=0;for(let n=0;n4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=e.x-t.x,a=e.y-t.y,l=i.x-r.x,h=i.y-r.y,c=t.x-r.x,u=t.y-r.y,d=l*u-h*c,f=o*u-a*c,g=h*o-l*a;if(0!==g){let e=d/g,r=f/g;return(n||0<=e&&e<=1)&&(s||0<=r&&r<=1)?new it("Intersection").append(new tJ(t.x+e*o,t.y+e*a)):new it}if(0===d||0===f){let o=n||s||it.isPointContained(t,r,i)||it.isPointContained(e,r,i)||it.isPointContained(r,t,e)||it.isPointContained(i,t,e);return new it(o?"Coincident":void 0)}return new it("Parallel")}static intersectSegmentLine(t,e,r,i){return it.intersectLineLine(t,e,r,i,!1,!0)}static intersectSegmentSegment(t,e,r,i){return it.intersectLineLine(t,e,r,i,!1,!1)}static intersectLinePolygon(t,e,r){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=new it,s=r.length;for(let o,a,l,h=0;h0&&(n.status="Intersection"),n}static intersectSegmentPolygon(t,e,r){return it.intersectLinePolygon(t,e,r,!1)}static intersectPolygonPolygon(t,e){let r=new it,i=t.length,n=[];for(let s=0;s0&&n.length===t.length?new it("Coincident"):(r.points.length>0&&(r.status="Intersection"),r)}static intersectPolygonRectangle(t,e,r){let i=e.min(r),n=e.max(r),s=new tJ(n.x,i.y),o=new tJ(i.x,n.y);return it.intersectPolygonPolygon(t,[i,s,n,o])}constructor(t){this.status=t,this.points=[]}}class ie extends t1{getX(){return this.getXY().x}setX(t){this.setXY(this.getXY().setX(t))}getY(){return this.getXY().y}setY(t){this.setXY(this.getXY().setY(t))}getRelativeX(){return this.left}setRelativeX(t){this.left=t}getRelativeY(){return this.top}setRelativeY(t){this.top=t}getXY(){let t=this.getRelativeXY();return this.group?en(t,this.group.calcTransformMatrix()):t}setXY(t,e,r){this.group&&(t=en(t,es(this.group.calcTransformMatrix()))),this.setRelativeXY(t,e,r)}getRelativeXY(){return new tJ(this.left,this.top)}setRelativeXY(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.originX,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.originY;this.setPositionByOrigin(t,e,r)}isStrokeAccountedForInDimensions(){return!1}getCoords(){let{tl:t,tr:e,br:r,bl:i}=this.aCoords||(this.aCoords=this.calcACoords()),n=[t,e,r,i];if(this.group){let t=this.group.calcTransformMatrix();return n.map(e=>en(e,t))}return n}intersectsWithRect(t,e){return"Intersection"===it.intersectPolygonRectangle(this.getCoords(),t,e).status}intersectsWithObject(t){let e=it.intersectPolygonPolygon(this.getCoords(),t.getCoords());return"Intersection"===e.status||"Coincident"===e.status||t.isContainedWithinObject(this)||this.isContainedWithinObject(t)}isContainedWithinObject(t){return this.getCoords().every(e=>t.containsPoint(e))}isContainedWithinRect(t,e){let{left:r,top:i,width:n,height:s}=this.getBoundingRect();return r>=t.x&&r+n<=e.x&&i>=t.y&&i+s<=e.y}isOverlapping(t){return this.intersectsWithObject(t)||this.isContainedWithinObject(t)||t.isContainedWithinObject(this)}containsPoint(t){return it.isPointInPolygon(t,this.getCoords())}isOnScreen(){if(!this.canvas)return!1;let{tl:t,br:e}=this.canvas.vptCoords;return!!this.getCoords().some(r=>r.x<=e.x&&r.x>=t.x&&r.y<=e.y&&r.y>=t.y)||!!this.intersectsWithRect(t,e)||this.containsPoint(t.midPointFrom(e))}isPartiallyOnScreen(){if(!this.canvas)return!1;let{tl:t,br:e}=this.canvas.vptCoords;return!!this.intersectsWithRect(t,e)||this.getCoords().every(r=>(r.x>=e.x||r.x<=t.x)&&(r.y>=e.y||r.y<=t.y))&&this.containsPoint(t.midPointFrom(e))}getBoundingRect(){return eH(this.getCoords())}getScaledWidth(){return this._getTransformedDimensions().x}getScaledHeight(){return this._getTransformedDimensions().y}scale(t){this._set(tI,t),this._set(tB,t),this.setCoords()}scaleToWidth(t){let e=this.getBoundingRect().width/this.getScaledWidth();return this.scale(t/this.width/e)}scaleToHeight(t){let e=this.getBoundingRect().height/this.getScaledHeight();return this.scale(t/this.height/e)}getCanvasRetinaScaling(){var t;return(null==(t=this.canvas)?void 0:t.getRetinaScaling())||1}getTotalAngle(){return this.group?er(el(this.calcTransformMatrix())):this.angle}getViewportTransform(){var t;return(null==(t=this.canvas)?void 0:t.viewportTransform)||t_.concat()}calcACoords(){let t=eu({angle:this.angle}),{x:e,y:r}=this.getRelativeCenterPoint(),i=eo(ec(e,r),t),n=this._getTransformedDimensions(),s=n.x/2,o=n.y/2;return{tl:en({x:-s,y:-o},i),tr:en({x:s,y:-o},i),bl:en({x:-s,y:o},i),br:en({x:s,y:o},i)}}setCoords(){this.aCoords=this.calcACoords()}transformMatrixKey(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=[];return!t&&this.group&&(e=this.group.transformMatrixKey(t)),e.push(this.top,this.left,this.width,this.height,this.scaleX,this.scaleY,this.angle,this.strokeWidth,this.skewX,this.skewY,+this.flipX,+this.flipY,e1(this.originX),e1(this.originY)),e}calcTransformMatrix(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.calcOwnMatrix();if(t||!this.group)return e;let r=this.transformMatrixKey(t),i=this.matrixCache;return i&&i.key.every((t,e)=>t===r[e])?i.value:(this.group&&(e=eo(this.group.calcTransformMatrix(!1),e)),this.matrixCache={key:r,value:e},e)}calcOwnMatrix(){let t=this.transformMatrixKey(!0),e=this.ownMatrixCache;if(e&&e.key===t)return e.value;let r=this.getRelativeCenterPoint(),i=ev({angle:this.angle,translateX:r.x,translateY:r.y,scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY});return this.ownMatrixCache={key:t,value:i},i}_getNonTransformedDimensions(){return new tJ(this.width,this.height).scalarAdd(this.strokeWidth)}_calculateCurrentDimensions(t){return this._getTransformedDimensions(t).transform(this.getViewportTransform(),!0).scalarAdd(2*this.padding)}_getTransformedDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=tt({scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,width:this.width,height:this.height,strokeWidth:this.strokeWidth},t),r=e.strokeWidth,i=r,n=0;this.strokeUniform&&(i=0,n=r);let s=e.width+i,o=e.height+i;return(0===e.skewX&&0===e.skewY?new tJ(s*e.scaleX,o*e.scaleY):eq(s,o,em(e))).scalarAdd(n)}translateToGivenOrigin(t,e,r,i,n){let s=t.x,o=t.y,a=e1(i)-e1(e),l=e1(n)-e1(r);if(a||l){let t=this._getTransformedDimensions();s+=a*t.x,o+=l*t.y}return new tJ(s,o)}translateToCenterPoint(t,e,r){if(e===tw&&r===tw)return t;let i=this.translateToGivenOrigin(t,e,r,tw,tw);return this.angle?i.rotate(ee(this.angle),t):i}translateToOriginPoint(t,e,r){let i=this.translateToGivenOrigin(t,tw,tw,e,r);return this.angle?i.rotate(ee(this.angle),t):i}getCenterPoint(){let t=this.getRelativeCenterPoint();return this.group?en(t,this.group.calcTransformMatrix()):t}getRelativeCenterPoint(){return this.translateToCenterPoint(new tJ(this.left,this.top),this.originX,this.originY)}getPointByOrigin(t,e){return this.translateToOriginPoint(this.getRelativeCenterPoint(),t,e)}setPositionByOrigin(t,e,r){let i=this.translateToCenterPoint(t,e,r),n=this.translateToOriginPoint(i,this.originX,this.originY);this.set({left:n.x,top:n.y})}_getLeftTopCoords(){return this.translateToOriginPoint(this.getRelativeCenterPoint(),tC,"top")}}let ir=["type"],ii=["extraParam"],is=class t extends ie{static getDefaults(){return t.ownDefaults}get type(){let t=this.constructor.type;return"FabricObject"===t?"object":t.toLowerCase()}set type(t){ts("warn","Setting type has no effect",t)}_createCacheCanvas(){this._cacheCanvas=t9(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0}_limitCacheSize(t){let e=t.width,r=t.height,i=tn.maxCacheSideLimit,n=tn.minCacheSideLimit;if(e<=i&&r<=i&&e*r<=tn.perfLimitSizeTotal)return ea&&(t.zoomX/=e/a,t.width=a,t.capped=!0),r>l&&(t.zoomY/=r/l,t.height=l,t.capped=!0),t}_getCacheCanvasDimensions(){let t=this.getTotalObjectScaling(),e=this._getTransformedDimensions({skewX:0,skewY:0}),r=e.x*t.x/this.scaleX,i=e.y*t.y/this.scaleY;return{width:Math.ceil(r+2),height:Math.ceil(i+2),zoomX:t.x,zoomY:t.y,x:r,y:i}}_updateCacheCanvas(){let t=this._cacheCanvas,e=this._cacheContext,{width:r,height:i,zoomX:n,zoomY:s,x:o,y:a}=this._limitCacheSize(this._getCacheCanvasDimensions()),l=r!==t.width||i!==t.height,h=this.zoomX!==n||this.zoomY!==s;if(!t||!e)return!1;if(l||h){r!==t.width||i!==t.height?(t.width=r,t.height=i):(e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height));let l=o/2,h=a/2;return this.cacheTranslationX=Math.round(t.width/2-l)+l,this.cacheTranslationY=Math.round(t.height/2-h)+h,e.translate(this.cacheTranslationX,this.cacheTranslationY),e.scale(n,s),this.zoomX=n,this.zoomY=s,!0}return!1}setOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setOptions(t)}transform(t){let e=this.group&&!this.group._transformDone||this.group&&this.canvas&&t===this.canvas.contextTop,r=this.calcTransformMatrix(!e);t.transform(r[0],r[1],r[2],r[3],r[4],r[5])}getObjectScaling(){if(!this.group)return new tJ(Math.abs(this.scaleX),Math.abs(this.scaleY));let t=eh(this.calcTransformMatrix());return new tJ(Math.abs(t.scaleX),Math.abs(t.scaleY))}getTotalObjectScaling(){let t=this.getObjectScaling();if(this.canvas){let e=this.canvas.getZoom(),r=this.getCanvasRetinaScaling();return t.scalarMultiply(e*r)}return t}getObjectOpacity(){let t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t}_constrainScale(t){return Math.abs(t){t.transform(i)}),e.parentClipPaths.push(t),t.absolutePositioned){let t=es(this.calcTransformMatrix());i.transform(t[0],t[1],t[2],t[3],t[4],t[5])}return t.transform(i),t.drawObject(i,!0,e),r}_drawClipPath(t,e,r){if(!e)return;e._transformDone=!0;let i=this.createClipPathLayer(e,r);this.drawClipPathOnCache(t,e,i)}drawCacheOnCanvas(t){t.scale(1/this.zoomX,1/this.zoomY),t.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)}isCacheDirty(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isNotVisible())return!1;let e=this._cacheCanvas,r=this._cacheContext;return!(!e||!r||t||!this._updateCacheCanvas())||!!(this.dirty||this.clipPath&&this.clipPath.absolutePositioned)&&(e&&r&&!t&&(r.save(),r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,e.width,e.height),r.restore()),!0)}_renderBackground(t){if(!this.backgroundColor)return;let e=this._getNonTransformedDimensions();t.fillStyle=this.backgroundColor,t.fillRect(-e.x/2,-e.y/2,e.x,e.y),this._removeShadow(t)}_setOpacity(t){this.group&&!this.group._transformDone?t.globalAlpha=this.getObjectOpacity():t.globalAlpha*=this.opacity}_setStrokeStyles(t,e){let r=e.stroke;r&&(t.lineWidth=e.strokeWidth,t.lineCap=e.strokeLineCap,t.lineDashOffset=e.strokeDashOffset,t.lineJoin=e.strokeLineJoin,t.miterLimit=e.strokeMiterLimit,eT(r)?"percentage"===r.gradientUnits||r.gradientTransform||r.patternTransform?this._applyPatternForTransformedGradient(t,r):(t.strokeStyle=r.toLive(t),this._applyPatternGradientTransform(t,r)):t.strokeStyle=e.stroke)}_setFillStyles(t,e){let{fill:r}=e;r&&(eT(r)?(t.fillStyle=r.toLive(t),this._applyPatternGradientTransform(t,r)):t.fillStyle=r)}_setClippingProperties(t){t.globalAlpha=1,t.strokeStyle="transparent",t.fillStyle="#000000"}_setLineDash(t,e){e&&0!==e.length&&t.setLineDash(e)}_setShadow(t){if(!this.shadow)return;let e=this.shadow,r=this.canvas,i=this.getCanvasRetinaScaling(),[n,,,s]=(null==r?void 0:r.viewportTransform)||t_,o=n*i,a=s*i,l=e.nonScaling?new tJ(1,1):this.getObjectScaling();t.shadowColor=e.color,t.shadowBlur=e.blur*tn.browserShadowBlurConstant*(o+a)*(l.x+l.y)/4,t.shadowOffsetX=e.offsetX*o*l.x,t.shadowOffsetY=e.offsetY*a*l.y}_removeShadow(t){this.shadow&&(t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0)}_applyPatternGradientTransform(t,e){if(!eT(e))return{offsetX:0,offsetY:0};let r=e.gradientTransform||e.patternTransform,i=-this.width/2+e.offsetX||0,n=-this.height/2+e.offsetY||0;return"percentage"===e.gradientUnits?t.transform(this.width,0,0,this.height,i,n):t.transform(1,0,0,1,i,n),r&&t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),{offsetX:i,offsetY:n}}_renderPaintInOrder(t){this.paintFirst===tH?(this._renderStroke(t),this._renderFill(t)):(this._renderFill(t),this._renderStroke(t))}_render(t){}_renderFill(t){this.fill&&(t.save(),this._setFillStyles(t,this),"evenodd"===this.fillRule?t.fill("evenodd"):t.fill(),t.restore())}_renderStroke(t){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this.strokeUniform){let e=this.getObjectScaling();t.scale(1/e.x,1/e.y)}this._setLineDash(t,this.strokeDashArray),this._setStrokeStyles(t,this),t.stroke(),t.restore()}}_applyPatternForTransformedGradient(t,e){var r;let i=this._limitCacheSize(this._getCacheCanvasDimensions()),n=this.getCanvasRetinaScaling(),s=i.x/this.scaleX/n,o=i.y/this.scaleY/n,a=t8({width:Math.ceil(s),height:Math.ceil(o)}),l=a.getContext("2d");l&&(l.beginPath(),l.moveTo(0,0),l.lineTo(s,0),l.lineTo(s,o),l.lineTo(0,o),l.closePath(),l.translate(s/2,o/2),l.scale(i.zoomX/this.scaleX/n,i.zoomY/this.scaleY/n),this._applyPatternGradientTransform(l,e),l.fillStyle=e.toLive(t),l.fill(),t.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),t.scale(n*this.scaleX/i.zoomX,n*this.scaleY/i.zoomY),t.strokeStyle=null!=(r=l.createPattern(a,"no-repeat"))?r:"")}_findCenterFromElement(){return new tJ(this.left+this.width/2,this.top+this.height/2)}clone(t){let e=this.toObject(t);return this.constructor.fromObject(e)}cloneAsImage(t){let e=this.toCanvasElement(t);return new(tY.getClass("image"))(e)}toCanvasElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=eG(this),r=this.group,i=this.shadow,n=Math.abs,s=t.enableRetinaScaling?tg():1,o=(t.multiplier||1)*s,a=t.canvasProvider||(t=>new eI(t,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1}));delete this.group,t.withoutTransform&&ez(this),t.withoutShadow&&(this.shadow=null),t.viewportTransform&&eZ(this,this.getViewportTransform()),this.setCoords();let l=t9(),h=this.getBoundingRect(),c=this.shadow,u=new tJ;if(c){let t=c.blur,e=c.nonScaling?new tJ(1,1):this.getObjectScaling();u.x=2*Math.round(n(c.offsetX)+t)*n(e.x),u.y=2*Math.round(n(c.offsetY)+t)*n(e.y)}let d=h.width+u.x,f=h.height+u.y;l.width=Math.ceil(d),l.height=Math.ceil(f);let g=a(l);"jpeg"===t.format&&(g.backgroundColor="#fff"),this.setPositionByOrigin(new tJ(g.width/2,g.height/2),tw,tw);let p=this.canvas;g._objects=[this],this.set("canvas",g),this.setCoords();let m=g.toCanvasElement(o||1,t);return this.set("canvas",p),this.shadow=i,r&&(this.group=r),this.set(e),this.setCoords(),g._objects=[],g.destroy(),m}toDataURL(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t7(this.toCanvasElement(t),t.format||"png",t.quality||1)}toBlob(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return et(this.toCanvasElement(t),t.format||"png",t.quality||1)}isType(){for(var t=arguments.length,e=Array(t),r=0;r{let[i,n]=r;return t[i]=this._animate(i,n,e),t},{})}_animate(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.split("."),n=this.constructor.colorProperties.includes(i[i.length-1]),{abort:s,startValue:o,onChange:a,onComplete:l}=r,h=tt(tt({},r),{},{target:this,startValue:null!=o?o:i.reduce((t,e)=>t[e],this),endValue:e,abort:null==s?void 0:s.bind(this),onChange:(t,e,r)=>{i.reduce((e,r,n)=>(n===i.length-1&&(e[r]=t),e[r]),this),a&&a(t,e,r)},onComplete:(t,e,r)=>{this.setCoords(),l&&l(t,e,r)}});return n?r7(h):r8(h)}isDescendantOf(t){let{parent:e,group:r}=this;return e===t||r===t||!!e&&e.isDescendantOf(t)||!!r&&r!==e&&r.isDescendantOf(t)}getAncestors(){let t=[],e=this;do(e=e.parent)&&t.push(e);while(e)return t}findCommonAncestors(t){if(this===t)return{fork:[],otherFork:[],common:[this,...this.getAncestors()]};let e=this.getAncestors(),r=t.getAncestors();if(0===e.length&&r.length>0&&this===r[r.length-1])return{fork:[],otherFork:[t,...r.slice(0,r.length-1)],common:[this]};for(let i,n=0;n-1&&s>o}toObject(){let e,r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).concat(t.customProperties,this.constructor.customProperties||[]),i=tn.NUM_FRACTION_DIGITS,{clipPath:n,fill:s,stroke:o,shadow:a,strokeDashArray:l,left:h,top:c,originX:u,originY:d,width:f,height:g,strokeWidth:p,strokeLineCap:m,strokeDashOffset:y,strokeLineJoin:x,strokeUniform:b,strokeMiterLimit:_,scaleX:w,scaleY:C,angle:S,flipX:T,flipY:O,opacity:k,visible:M,backgroundColor:E,fillRule:D,paintFirst:j,globalCompositeOperation:A,skewX:P,skewY:F}=this;n&&!n.excludeFromExport&&(e=n.toObject(r.concat("inverted","absolutePositioned")));let L=t=>eC(t,i),R=tt(tt({},e_(this,r)),{},{type:this.constructor.type,version:tm,originX:u,originY:d,left:L(h),top:L(c),width:L(f),height:L(g),fill:eO(s)?s.toObject():s,stroke:eO(o)?o.toObject():o,strokeWidth:L(p),strokeDashArray:l?l.concat():l,strokeLineCap:m,strokeDashOffset:y,strokeLineJoin:x,strokeUniform:b,strokeMiterLimit:L(_),scaleX:L(w),scaleY:L(C),angle:L(S),flipX:T,flipY:O,opacity:L(k),shadow:a?a.toObject():a,visible:M,backgroundColor:E,fillRule:D,paintFirst:j,globalCompositeOperation:A,skewX:L(P),skewY:L(F)},e?{clipPath:e}:null);return this.includeDefaultValues?R:this._removeDefaultValues(R)}toDatalessObject(t){return this.toObject(t)}_removeDefaultValues(t){let e=this.constructor.getDefaults(),r=Object.keys(e).length>0?e:Object.getPrototypeOf(this);return ew(t,(t,e)=>{if(e===tC||"top"===e||"type"===e)return!0;let i=r[e];return t!==i&&!(Array.isArray(t)&&Array.isArray(i)&&0===t.length&&0===i.length)})}toString(){return"#<".concat(this.constructor.type,">")}static _fromObject(t){let e=te(t,ir),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{extraParam:i}=r;return eb(e,te(r,ii)).then(t=>i?(delete t[i],new this(e[i],t)):new this(t))}static fromObject(t,e){return this._fromObject(t,e)}constructor(e){super(),Z(this,"_cacheContext",null),Object.assign(this,t.ownDefaults),this.setOptions(e)}};Z(is,"stateProperties",rV),Z(is,"cacheProperties",rY),Z(is,"ownDefaults",{top:0,left:0,width:0,height:0,angle:0,flipX:!1,flipY:!1,scaleX:1,scaleY:1,minScaleLimit:0,skewX:0,skewY:0,originX:tC,originY:"top",strokeWidth:1,strokeUniform:!1,padding:0,opacity:1,paintFirst:tU,fill:"rgb(0,0,0)",fillRule:"nonzero",stroke:null,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,globalCompositeOperation:"source-over",backgroundColor:"",shadow:null,visible:!0,includeDefaultValues:!0,excludeFromExport:!1,objectCaching:!0,clipPath:void 0,inverted:!1,absolutePositioned:!1,centeredRotation:!0,centeredScaling:!1,dirty:!0}),Z(is,"type","FabricObject"),Z(is,"colorProperties",[tU,tH,"backgroundColor"]),Z(is,"customProperties",[]),tY.setClass(is),tY.setClass(is,"object");let io=(t,e,r)=>(i,n,s,o)=>{let a=e(i,n,s,o);return a&&e$(t,tt(tt({},e3(i,n,s,o)),r)),a};function ia(t){return(e,r,i,n)=>{let{target:s,originX:o,originY:a}=r,l=s.getRelativeCenterPoint(),h=s.translateToOriginPoint(l,o,a),c=t(e,r,i,n);return s.setPositionByOrigin(h,r.originX,r.originY),c}}let il=io(tP,ia((t,e,r,i)=>{let n=e6(e,e.originX,e.originY,r,i);if(e1(e.originX)===e1(tw)||e1(e.originX)===e1(tT)&&n.x<0||e1(e.originX)===e1(tC)&&n.x>0){let{target:t}=e,r=t.strokeWidth/(t.strokeUniform?t.scaleX:1),i=e5(e)?2:1,s=t.width,o=Math.abs(n.x*i/t.scaleX)-r;return t.set("width",Math.max(o,1)),s!==t.width}return!1}));function ih(t,e,r,i,n){i=i||{};let s=this.sizeX||i.cornerSize||n.cornerSize,o=this.sizeY||i.cornerSize||n.cornerSize,a=void 0!==i.transparentCorners?i.transparentCorners:n.transparentCorners,l=a?tH:tU,h=!a&&(i.cornerStrokeColor||n.cornerStrokeColor),c,u=e,d=r;t.save(),t.fillStyle=i.cornerColor||n.cornerColor||"",t.strokeStyle=i.cornerStrokeColor||n.cornerStrokeColor||"",s>o?(c=s,t.scale(1,o/s),d=r*s/o):o>s?(c=o,t.scale(s/o,1),u=e*o/s):c=s,t.beginPath(),t.arc(u,d,c/2,0,tx,!1),t[l](),h&&t.stroke(),t.restore()}function ic(t,e,r,i,n){i=i||{};let s=this.sizeX||i.cornerSize||n.cornerSize,o=this.sizeY||i.cornerSize||n.cornerSize,a=void 0!==i.transparentCorners?i.transparentCorners:n.transparentCorners,l=a?tH:tU,h=!a&&(i.cornerStrokeColor||n.cornerStrokeColor),c=s/2,u=o/2;t.save(),t.fillStyle=i.cornerColor||n.cornerColor||"",t.strokeStyle=i.cornerStrokeColor||n.cornerStrokeColor||"",t.translate(e,r);let d=n.getTotalAngle();t.rotate(ee(d)),t["".concat(l,"Rect")](-c,-u,s,o),h&&t.strokeRect(-c,-u,s,o),t.restore()}class iu{shouldActivate(t,e,r,i){var n;let{tl:s,tr:o,br:a,bl:l}=i;return(null==(n=e.canvas)?void 0:n.getActiveObject())===e&&e.isControlVisible(t)&&it.isPointInPolygon(r,[s,o,a,l])}getActionHandler(t,e,r){return this.actionHandler}getMouseDownHandler(t,e,r){return this.mouseDownHandler}getMouseUpHandler(t,e,r){return this.mouseUpHandler}cursorStyleHandler(t,e,r){return e.cursorStyle}getActionName(t,e,r){return e.actionName}getVisibility(t,e){var r,i;return null!=(r=null==(i=t._controlsVisibility)?void 0:i[e])?r:this.visible}setVisibility(t,e,r){this.visible=t}positionHandler(t,e,r,i){return new tJ(this.x*t.x+this.offsetX,this.y*t.y+this.offsetY).transform(e)}calcCornerCoords(t,e,r,i,n,s){let o=ea([ec(r,i),eu({angle:t}),ed((n?this.touchSizeX:this.sizeX)||e,(n?this.touchSizeY:this.sizeY)||e)]);return{tl:new tJ(-.5,-.5).transform(o),tr:new tJ(.5,-.5).transform(o),br:new tJ(.5,.5).transform(o),bl:new tJ(-.5,.5).transform(o)}}render(t,e,r,i,n){"circle"===((i=i||{}).cornerStyle||n.cornerStyle)?ih.call(this,t,e,r,i,n):ic.call(this,t,e,r,i,n)}constructor(t){Z(this,"visible",!0),Z(this,"actionName",tR),Z(this,"angle",0),Z(this,"x",0),Z(this,"y",0),Z(this,"offsetX",0),Z(this,"offsetY",0),Z(this,"sizeX",0),Z(this,"sizeY",0),Z(this,"touchSizeX",0),Z(this,"touchSizeY",0),Z(this,"cursorStyle","crosshair"),Z(this,"withConnection",!1),Object.assign(this,t)}}let id=(t,e,r)=>r.lockRotation?e2:e.cursorStyle,ig=io(tD,ia((t,e,r,i)=>{let{target:n,ex:s,ey:o,theta:a,originX:l,originY:h}=e,c=n.translateToOriginPoint(n.getRelativeCenterPoint(),l,h);if(e4(n,"lockRotation"))return!1;let u=Math.atan2(o-c.y,s-c.x),d=er(Math.atan2(i-c.y,r-c.x)-u+a);if(n.snapAngle&&n.snapAngle>0){let t=n.snapAngle,e=n.snapThreshold||t,r=Math.ceil(d/t)*t,i=Math.floor(d/t)*t;Math.abs(d-i){let i=ip(t,r);if(im(r,0!==e.x&&0===e.y?"x":0===e.x&&0!==e.y?"y":"",i))return e2;let n=e9(r,e);return"".concat(iv[n],"-resize")};function ix(t,e,r,i){let n,s,o,a,l,h,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},u=e.target,d=c.by,f=ip(t,u);if(im(u,d,f))return!1;if(e.gestureScale)s=e.scaleX*e.gestureScale,o=e.scaleY*e.gestureScale;else{if(n=e6(e,e.originX,e.originY,r,i),l="y"!==d?Math.sign(n.x||e.signX||1):1,h="x"!==d?Math.sign(n.y||e.signY||1):1,e.signX||(e.signX=l),e.signY||(e.signY=h),e4(u,"lockScalingFlip")&&(e.signX!==l||e.signY!==h))return!1;if(a=u._getTransformedDimensions(),f&&!d){let t=Math.abs(n.x)+Math.abs(n.y),{original:r}=e,i=t/(Math.abs(a.x*r.scaleX/u.scaleX)+Math.abs(a.y*r.scaleY/u.scaleY));s=r.scaleX*i,o=r.scaleY*i}else s=Math.abs(n.x*u.scaleX/a.x),o=Math.abs(n.y*u.scaleY/a.y);e5(e)&&(s*=2,o*=2),e.signX!==l&&"y"!==d&&(e.originX=.5-e1(e.originX),s*=-1,e.signX=l),e.signY!==h&&"x"!==d&&(e.originY=.5-e1(e.originY),o*=-1,e.signY=h)}let g=u.scaleX,p=u.scaleY;return d?("x"===d&&u.set(tI,s),"y"===d&&u.set(tB,o)):(e4(u,"lockScalingX")||u.set(tI,s),e4(u,"lockScalingY")||u.set(tB,o)),g!==u.scaleX||p!==u.scaleY}let ib=io(tE,ia((t,e,r,i)=>ix(t,e,r,i))),i_=io(tE,ia((t,e,r,i)=>ix(t,e,r,i,{by:"x"}))),iw=io(tE,ia((t,e,r,i)=>ix(t,e,r,i,{by:"y"}))),iC=["target","ex","ey","skewingSide"],iS={x:{counterAxis:"y",scale:tI,skew:tN,lockSkewing:"lockSkewingX",origin:"originX",flip:"flipX"},y:{counterAxis:"x",scale:tB,skew:tW,lockSkewing:"lockSkewingY",origin:"originY",flip:"flipY"}},iT=["ns","nesw","ew","nwse"],iO=(t,e,r)=>{if(0!==e.x&&e4(r,"lockSkewingY")||0!==e.y&&e4(r,"lockSkewingX"))return e2;let i=e9(r,e)%4;return"".concat(iT[i],"-resize")};function ik(t,e,r,i,n){let{target:s}=r,{counterAxis:o,origin:a,lockSkewing:l,skew:h,flip:c}=iS[t];if(e4(s,l))return!1;let{origin:u,flip:d}=iS[o],f=-Math.sign(e1(r[u])*(s[d]?-1:1))*(s[c]?-1:1),g=-(.5*((0===s[h]&&e6(r,tw,tw,i,n)[t]>0||s[h]>0?1:-1)*f))+.5;return io(tA,ia((e,r,i,n)=>(function(t,e,r){let{target:i,ex:n,ey:s,skewingSide:o}=e,a=te(e,iC),{skew:l}=iS[t],h=r.subtract(new tJ(n,s)).divide(new tJ(i.scaleX,i.scaleY))[t],c=i[l],u=Math.tan(ee(a[l])),d=er(Math.atan(2*h*o/Math.max("y"===t?i._getTransformedDimensions({scaleX:1,scaleY:1,skewX:0}).x:i._getTransformedDimensions({scaleX:1,scaleY:1}).y,1)+u));i.set(l,d);let f=c!==i[l];if(f&&"y"===t){let{skewX:t,scaleX:e}=i,r=i._getTransformedDimensions({skewY:c}),n=i._getTransformedDimensions(),s=0!==t?r.x/n.x:1;1!==s&&i.set(tI,s*e)}return f})(t,r,new tJ(i,n))))(e,tt(tt({},r),{},{[a]:g,skewingSide:f}),i,n)}let iM=(t,e,r,i)=>ik("x",t,e,r,i),iE=(t,e,r,i)=>ik("y",t,e,r,i);function iD(t,e){return t[e.canvas.altActionKey]}let ij=(t,e,r)=>{let i=iD(t,r);return 0===e.x?i?tN:tB:0===e.y?i?tW:tI:""},iA=(t,e,r)=>iD(t,r)?iO(0,e,r):iy(t,e,r),iP=(t,e,r,i)=>iD(t,e.target)?iE(t,e,r,i):i_(t,e,r,i),iF=(t,e,r,i)=>iD(t,e.target)?iM(t,e,r,i):iw(t,e,r,i),iL=()=>({ml:new iu({x:-.5,y:0,cursorStyleHandler:iA,actionHandler:iP,getActionName:ij}),mr:new iu({x:.5,y:0,cursorStyleHandler:iA,actionHandler:iP,getActionName:ij}),mb:new iu({x:0,y:.5,cursorStyleHandler:iA,actionHandler:iF,getActionName:ij}),mt:new iu({x:0,y:-.5,cursorStyleHandler:iA,actionHandler:iF,getActionName:ij}),tl:new iu({x:-.5,y:-.5,cursorStyleHandler:iy,actionHandler:ib}),tr:new iu({x:.5,y:-.5,cursorStyleHandler:iy,actionHandler:ib}),bl:new iu({x:-.5,y:.5,cursorStyleHandler:iy,actionHandler:ib}),br:new iu({x:.5,y:.5,cursorStyleHandler:iy,actionHandler:ib}),mtr:new iu({x:0,y:-.5,actionHandler:ig,cursorStyleHandler:id,offsetY:-40,withConnection:!0,actionName:tj})}),iR=()=>({mr:new iu({x:.5,y:0,actionHandler:il,cursorStyleHandler:iA,actionName:tP}),ml:new iu({x:-.5,y:0,actionHandler:il,cursorStyleHandler:iA,actionName:tP})}),iI=()=>tt(tt({},iL()),iR());class iB extends is{static getDefaults(){return tt(tt({},super.getDefaults()),iB.ownDefaults)}static createControls(){return{controls:iL()}}_updateCacheCanvas(){let t=this.canvas;if(this.noScaleCache&&t&&t._currentTransform){let e=t._currentTransform,r=e.target,i=e.action;if(this===r&&i&&i.startsWith(tR))return!1}return super._updateCacheCanvas()}getActiveControl(){let t=this.__corner;return t?{key:t,control:this.controls[t],coord:this.oCoords[t]}:void 0}findControl(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasControls||!this.canvas)return;this.__corner=void 0;let r=Object.entries(this.oCoords);for(let i=r.length-1;i>=0;i--){let[n,s]=r[i],o=this.controls[n];if(o.shouldActivate(n,this,t,e?s.touchCorner:s.corner))return this.__corner=n,{key:n,control:o,coord:this.oCoords[n]}}}calcOCoords(){let t=this.getViewportTransform(),e=this.getCenterPoint(),r=eo(ec(e.x,e.y),eu({angle:this.getTotalAngle()-(this.group&&this.flipX?180:0)})),i=eo(t,r),n=eo(i,[1/t[0],0,0,1/t[3],0,0]),s=this.group?eh(this.calcTransformMatrix()):void 0;s&&(s.scaleX=Math.abs(s.scaleX),s.scaleY=Math.abs(s.scaleY));let o=this._calculateCurrentDimensions(s),a={};return this.forEachControl((t,e)=>{let r=t.positionHandler(o,n,this,t);a[e]=Object.assign(r,this._calcCornerCoords(t,r))}),a}_calcCornerCoords(t,e){let r=this.getTotalAngle();return{corner:t.calcCornerCoords(r,this.cornerSize,e.x,e.y,!1,this),touchCorner:t.calcCornerCoords(r,this.touchCornerSize,e.x,e.y,!0,this)}}setCoords(){super.setCoords(),this.canvas&&(this.oCoords=this.calcOCoords())}forEachControl(t){for(let e in this.controls)t(this.controls[e],e,this)}drawSelectionBackground(t){if(!this.selectionBackgroundColor||this.canvas&&this.canvas._activeObject!==this)return;t.save();let e=this.getRelativeCenterPoint(),r=this._calculateCurrentDimensions(),i=this.getViewportTransform();t.translate(e.x,e.y),t.scale(1/i[0],1/i[3]),t.rotate(ee(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-r.x/2,-r.y/2,r.x,r.y),t.restore()}strokeBorders(t,e){t.strokeRect(-e.x/2,-e.y/2,e.x,e.y)}_drawBorders(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=tt({hasControls:this.hasControls,borderColor:this.borderColor,borderDashArray:this.borderDashArray},r);t.save(),t.strokeStyle=i.borderColor,this._setLineDash(t,i.borderDashArray),this.strokeBorders(t,e),i.hasControls&&this.drawControlsConnectingLines(t,e),t.restore()}_renderControls(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{hasBorders:r,hasControls:i}=this,n=tt({hasBorders:r,hasControls:i},e),s=this.getViewportTransform(),o=n.hasBorders,a=n.hasControls,l=eh(eo(s,this.calcTransformMatrix()));t.save(),t.translate(l.translateX,l.translateY),t.lineWidth=this.borderScaleFactor,this.group===this.parent&&(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(l.angle-=180),t.rotate(ee(this.group?l.angle:this.angle)),o&&this.drawBorders(t,l,e),a&&this.drawControls(t,e),t.restore()}drawBorders(t,e,r){let i;if(r&&r.forActiveSelection||this.group){let t=eq(this.width,this.height,em(e)),r=this.isStrokeAccountedForInDimensions()?tZ:(this.strokeUniform?(new tJ).scalarAdd(this.canvas?this.canvas.getZoom():1):new tJ(e.scaleX,e.scaleY)).scalarMultiply(this.strokeWidth);i=t.add(r).scalarAdd(this.borderScaleFactor).scalarAdd(2*this.padding)}else i=this._calculateCurrentDimensions().scalarAdd(this.borderScaleFactor);this._drawBorders(t,i,r)}drawControlsConnectingLines(t,e){let r=!1;t.beginPath(),this.forEachControl((i,n)=>{i.withConnection&&i.getVisibility(this,n)&&(r=!0,t.moveTo(i.x*e.x,i.y*e.y),t.lineTo(i.x*e.x+i.offsetX,i.y*e.y+i.offsetY))}),r&&t.stroke()}drawControls(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.save();let r=this.getCanvasRetinaScaling(),{cornerStrokeColor:i,cornerDashArray:n,cornerColor:s}=this,o=tt({cornerStrokeColor:i,cornerDashArray:n,cornerColor:s},e);t.setTransform(r,0,0,r,0,0),t.strokeStyle=t.fillStyle=o.cornerColor,this.transparentCorners||(t.strokeStyle=o.cornerStrokeColor),this._setLineDash(t,o.cornerDashArray),this.forEachControl((e,r)=>{if(e.getVisibility(this,r)){let i=this.oCoords[r];e.render(t,i.x,i.y,o,this)}}),t.restore()}isControlVisible(t){return this.controls[t]&&this.controls[t].getVisibility(this,t)}setControlVisible(t,e){this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[t]=e}setControlsVisibility(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.entries(t).forEach(t=>{let[e,r]=t;return this.setControlVisible(e,r)})}clearContextTop(t){if(!this.canvas)return;let e=this.canvas.contextTop;if(!e)return;let r=this.canvas.viewportTransform;e.save(),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this.transform(e);let i=this.width+4,n=this.height+4;return e.clearRect(-i/2,-n/2,i,n),t||e.restore(),e}onDeselect(t){return!1}onSelect(t){return!1}shouldStartDragging(t){return!1}onDragStart(t){return!1}canDrop(t){return!1}renderDragSourceEffect(t){}renderDropTargetEffect(t){}constructor(t){super(),Object.assign(this,this.constructor.createControls(),iB.ownDefaults),this.setOptions(t)}}function iN(t,e){return e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(r=>{"constructor"!==r&&Object.defineProperty(t.prototype,r,Object.getOwnPropertyDescriptor(e.prototype,r)||Object.create(null))})}),t}Z(iB,"ownDefaults",{noScaleCache:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,cornerSize:13,touchCornerSize:24,transparentCorners:!0,cornerColor:"rgb(178,204,255)",cornerStrokeColor:"",cornerStyle:"rect",cornerDashArray:null,hasControls:!0,borderColor:"rgb(178,204,255)",borderDashArray:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,hasBorders:!0,selectionBackgroundColor:"",selectable:!0,evented:!0,perPixelTargetFind:!1,activeOn:"down",hoverCursor:null,moveCursor:null});class iW extends iB{}iN(iW,[rh]),tY.setClass(iW),tY.setClass(iW,"object");let iU=(t,e,r,i)=>{let n=2*(i=Math.round(i))+1,{data:s}=t.getImageData(e-i,r-i,n,n);for(let t=3;t0)return!1;return!0};class iH{createSideVector(t,e){let r=rj(t,e);return this.options.strokeUniform?r.multiply(this.scale):r}projectOrthogonally(t,e,r){return this.applySkew(t.add(this.calcOrthogonalProjection(t,e,r)))}isSkewed(){return 0!==this.options.skewX||0!==this.options.skewY}applySkew(t){let e=new tJ(t);return e.y+=e.x*Math.tan(ee(this.options.skewY)),e.x+=e.y*Math.tan(ee(this.options.skewX)),e}scaleUnitVector(t,e){return t.multiply(this.strokeUniformScalar).scalarMultiply(e)}constructor(t){this.options=t,this.strokeProjectionMagnitude=this.options.strokeWidth/2,this.scale=new tJ(this.options.scaleX,this.options.scaleY),this.strokeUniformScalar=this.options.strokeUniform?new tJ(1/this.options.scaleX,1/this.options.scaleY):new tJ(1,1)}}let iX=new tJ;class iV extends iH{static getOrthogonalRotationFactor(t,e){return Math.abs(e?rP(t,e):rF(t))2&&void 0!==arguments[2]?arguments[2]:this.strokeProjectionMagnitude,i=rR(this.createSideVector(t,e)),n=iV.getOrthogonalRotationFactor(i,this.bisector);return this.scaleUnitVector(i,r*n)}projectBevel(){let t=[];return(this.alpha%tx==0?[this.B]:[this.B,this.C]).forEach(e=>{t.push(this.projectOrthogonally(this.A,e)),t.push(this.projectOrthogonally(this.A,e,-this.strokeProjectionMagnitude))}),t}projectMiter(){let t=[],e=1/Math.sin(Math.abs(this.alpha)/2),r=this.scaleUnitVector(this.bisector,-this.strokeProjectionMagnitude*e),i=this.options.strokeUniform?rA(this.scaleUnitVector(this.bisector,this.options.strokeMiterLimit)):this.options.strokeMiterLimit;return rA(r)/this.strokeProjectionMagnitude<=i&&t.push(this.applySkew(this.A.add(r))),t.push(...this.projectBevel()),t}projectRoundNoSkew(t,e){let r=[],i=new tJ(iV.getOrthogonalRotationFactor(this.bisector),iV.getOrthogonalRotationFactor(new tJ(this.bisector.y,this.bisector.x)));return[new tJ(1,0).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i),new tJ(0,1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i)].forEach(i=>{rN(i,t,e)&&r.push(this.A.add(i))}),r}projectRoundWithSkew(t,e){let r=[],{skewX:i,skewY:n,scaleX:s,scaleY:o,strokeUniform:a}=this.options,l=new tJ(Math.tan(ee(i)),Math.tan(ee(n))),h=this.strokeProjectionMagnitude,c=a?h/o/Math.sqrt(1/o**2+1/s**2*l.y**2):h/Math.sqrt(1+l.y**2),u=new tJ(Math.sqrt(Math.max(h**2-c**2,0)),c),d=a?h/Math.sqrt(1+l.x**2*(1/o)**2/(1/s+1/s*l.x*l.y)**2):h/Math.sqrt(1+l.x**2/(1+l.x*l.y)**2),f=new tJ(d,Math.sqrt(Math.max(h**2-d**2,0)));return[f,f.scalarMultiply(-1),u,u.scalarMultiply(-1)].map(t=>this.applySkew(a?t.multiply(this.strokeUniformScalar):t)).forEach(i=>{rN(i,t,e)&&r.push(this.applySkew(this.A).add(i))}),r}projectRound(){let t=[];t.push(...this.projectBevel());let e=this.alpha%tx==0,r=this.applySkew(this.A),i=t[2*!e].subtract(r),n=t[+!!e].subtract(r),s=rI(i,e?this.applySkew(this.AB.scalarMultiply(-1)):this.applySkew(this.bisector.multiply(this.strokeUniformScalar).scalarMultiply(-1)))>0,o=s?i:n,a=s?n:i;return this.isSkewed()?t.push(...this.projectRoundWithSkew(o,a)):t.push(...this.projectRoundNoSkew(o,a)),t}projectPoints(){switch(this.options.strokeLineJoin){case"miter":return this.projectMiter();case"round":return this.projectRound();default:return this.projectBevel()}}project(){return this.projectPoints().map(t=>({originPoint:this.A,projectedPoint:t,angle:this.alpha,bisector:this.bisector}))}constructor(t,e,r,i){super(i),Z(this,"AB",void 0),Z(this,"AC",void 0),Z(this,"alpha",void 0),Z(this,"bisector",void 0),this.A=new tJ(t),this.B=new tJ(e),this.C=new tJ(r),this.AB=this.createSideVector(this.A,this.B),this.AC=this.createSideVector(this.A,this.C),this.alpha=rP(this.AB,this.AC),this.bisector=rL(rD(this.AB.eq(iX)?this.AC:this.AB,this.alpha/2))}}class iY extends iH{calcOrthogonalProjection(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.strokeProjectionMagnitude,i=this.createSideVector(t,e);return this.scaleUnitVector(rR(i),r)}projectButt(){return[this.projectOrthogonally(this.A,this.T,this.strokeProjectionMagnitude),this.projectOrthogonally(this.A,this.T,-this.strokeProjectionMagnitude)]}projectRound(){let t=[];if(!this.isSkewed()&&this.A.eq(this.T)){let e=new tJ(1,1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar);t.push(this.applySkew(this.A.add(e)),this.applySkew(this.A.subtract(e)))}else t.push(...new iV(this.A,this.T,this.T,this.options).projectRound());return t}projectSquare(){let t=[];if(this.A.eq(this.T)){let e=new tJ(1,1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar);t.push(this.A.add(e),this.A.subtract(e))}else{let e=this.calcOrthogonalProjection(this.A,this.T,this.strokeProjectionMagnitude),r=this.scaleUnitVector(rL(this.createSideVector(this.A,this.T)),-this.strokeProjectionMagnitude),i=this.A.add(r);t.push(i.add(e),i.subtract(e))}return t.map(t=>this.applySkew(t))}projectPoints(){switch(this.options.strokeLineCap){case"round":return this.projectRound();case"square":return this.projectSquare();default:return this.projectButt()}}project(){return this.projectPoints().map(t=>({originPoint:this.A,projectedPoint:t}))}constructor(t,e,r){super(r),this.A=new tJ(t),this.T=new tJ(e)}}let iz=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[];if(0===t.length)return i;let n=t.reduce((t,e)=>(t[t.length-1].eq(e)||t.push(new tJ(e)),t),[new tJ(t[0])]);if(1===n.length)r=!0;else if(!r){let t=n[0],e=((t,e)=>{for(let r=t.length-1;r>=0;r--)if(e(t[r],r,t))return r;return -1})(n,e=>!e.eq(t));n.splice(e+1)}return n.forEach((t,n,s)=>{let o,a;0===n?(a=s[1],o=r?t:s[s.length-1]):n===s.length-1?(o=s[n-1],a=r?t:s[0]):(o=s[n-1],a=s[n+1]),r&&1===s.length?i.push(...new iY(t,t,e).project()):r&&(0===n||n===s.length-1)?i.push(...new iY(t,0===n?a:o,e).project()):i.push(...new iV(t,o,a,e).project())}),i},iG=t=>{let e={};return Object.keys(t).forEach(r=>{e[r]={},Object.keys(t[r]).forEach(i=>{e[r][i]=tt({},t[r][i])})}),e},iq=t=>t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"),iK=t=>(r||r||(r="Intl"in tf()&&"Segmenter"in Intl&&new Intl.Segmenter(void 0,{granularity:"grapheme"})),r)?Array.from(r.segment(t)).map(t=>{let{segment:e}=t;return e}):iQ(t),iQ=t=>{let e=[];for(let r,i=0;i{let r=t.charCodeAt(e);if(isNaN(r))return"";if(r<55296||r>57343)return t.charAt(e);if(55296<=r&&r<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";let r=t.charCodeAt(e+1);if(56320>r||r>57343)throw"High surrogate without following low surrogate";return t.charAt(e)+t.charAt(e+1)}if(0===e)throw"Low surrogate without preceding high surrogate";let i=t.charCodeAt(e-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1};var iZ=Object.freeze({__proto__:null,capitalize:function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"".concat(t.charAt(0).toUpperCase()).concat(e?t.slice(1):t.slice(1).toLowerCase())},escapeXml:iq,graphemeSplit:iK});let i$=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.fill!==e.fill||t.stroke!==e.stroke||t.strokeWidth!==e.strokeWidth||t.fontSize!==e.fontSize||t.fontFamily!==e.fontFamily||t.fontWeight!==e.fontWeight||t.fontStyle!==e.fontStyle||t.textDecorationThickness!==e.textDecorationThickness||t.textBackgroundColor!==e.textBackgroundColor||t.deltaY!==e.deltaY||r&&(t.overline!==e.overline||t.underline!==e.underline||t.linethrough!==e.linethrough)},i0=(t,e)=>{let r=e.split("\n"),i=[],n=-1,s={};t=iG(t);for(let e=0;e0&&(i$(s,o,!0)?i.push({start:n,end:n+1,style:o}):i[i.length-1].end++),s=o||{}}else n+=o.length,s={}}return i},i1=(t,e)=>{if(!Array.isArray(t))return iG(t);let r=e.split(tk),i={},n=-1,s=0;for(let e=0;e{var e;return null!=(e=rS[t])?e:t},i3=RegExp("(".concat(r_,")"),"gi"),i9="(".concat(r_,")"),i6=String.raw(l||(l=tr(["(skewX)(",")"],["(skewX)\\(","\\)"])),i9),i8=String.raw(h||(h=tr(["(skewY)(",")"],["(skewY)\\(","\\)"])),i9),i7=String.raw(c||(c=tr(["(rotate)(","(?: "," ",")?)"],["(rotate)\\(","(?: "," ",")?\\)"])),i9,i9,i9),nt=String.raw(u||(u=tr(["(scale)(","(?: ",")?)"],["(scale)\\(","(?: ",")?\\)"])),i9,i9),ne=String.raw(d||(d=tr(["(translate)(","(?: ",")?)"],["(translate)\\(","(?: ",")?\\)"])),i9,i9),nr=String.raw(f||(f=tr(["(matrix)("," "," "," "," "," ",")"],["(matrix)\\("," "," "," "," "," ","\\)"])),i9,i9,i9,i9,i9,i9),ni="(?:".concat(nr,"|").concat(ne,"|").concat(i7,"|").concat(nt,"|").concat(i6,"|").concat(i8,")"),nn=new RegExp(String.raw(g||(g=tr(["^s*(?:","?)s*$"],["^\\s*(?:","?)\\s*$"])),"(?:".concat(ni,"*)"))),ns=new RegExp(ni),no=RegExp(ni,"g");function na(t){let e=[];if(!(t=t.replace(i3," $1 ").replace(/,/gi," ").replace(/\s+/gi," ").replace(/\s*([()])\s*/gi,"$1"))||t&&!nn.test(t))return[...t_];for(let r of t.matchAll(no)){let t=ns.exec(r[0]);if(!t)continue;let i=t_,[,n,...s]=t.filter(t=>!!t),[o,a,l,h,c,u]=s.map(t=>parseFloat(t));switch(n){case"translate":i=ec(o,a);break;case tj:i=eu({angle:o},{x:a,y:l});break;case tR:i=ed(o,a);break;case tN:i=eg(o);break;case tW:i=ep(o);break;case"matrix":i=[o,a,l,h,c,u]}e.push(i)}return ea(e)}let nl={stroke:"strokeOpacity",fill:"fillOpacity"};function nh(t,e,r){if(!t)return{};let i,n={},s=16;t.parentNode&&rk.test(t.parentNode.nodeName)&&(n=nh(t.parentElement,e,r)).fontSize&&(i=s=ro(n.fontSize));let o=tt(tt(tt({},e.reduce((e,r)=>{let i=t.getAttribute(r);return i&&(e[r]=i),e},{})),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};for(let i in e)(function(t,e){let r=!0,i=i5(t,e.pop());return i&&e.length&&(r=function(t,e){let r,i=!0;for(;t.parentElement&&1===t.parentElement.nodeType&&e.length;)i&&(r=e.pop()),i=i5(t=t.parentElement,r);return 0===e.length}(t,e)),i&&r&&0===e.length})(t,i.split(" "))&&(r=tt(tt({},r),e[i]));return r}(t,r)),function(t){let e={},r=t.getAttribute("style");return r&&("string"==typeof r?r.replace(/;\s*$/,"").split(";").forEach(t=>{if(!t)return;let[r,i]=t.split(":");e[r.trim().toLowerCase()]=i.trim()}):Object.entries(r).forEach(t=>{let[r,i]=t;void 0!==i&&(e[r.toLowerCase()]=i)})),e}(t));o[rO]&&t.setAttribute(rO,o[rO]),o[rT]&&(i=ro(o[rT],s),o[rT]="".concat(i));let a={};for(let t in o){let e=i4(t),r=function(t,e,r,i){let n=Array.isArray(e),s,o=e;if(t!==tU&&t!==tH||e!==tO){if("strokeUniform"===t)return"non-scaling-stroke"===e;if("strokeDashArray"===t)o=e===tO?null:e.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===t)o=r&&r.transformMatrix?eo(r.transformMatrix,na(e)):na(e);else if("visible"===t)o=e!==tO&&"hidden"!==e,r&&!1===r.visible&&(o=!1);else if("opacity"===t)o=parseFloat(e),r&&void 0!==r.opacity&&(o*=r.opacity);else if("textAnchor"===t)o="start"===e?tC:"end"===e?tT:tw;else if("charSpacing"===t||t===ru)s=ro(e,i)/i*1e3;else if("paintFirst"===t){let t=e.indexOf(tU),r=e.indexOf(tH);o=tU,(t>-1&&r>-1&&r-1)&&(o=tH)}else{if("href"===t||"xlink:href"===t||"font"===t||"id"===t)return e;if("imageSmoothing"===t)return"optimizeQuality"===e;s=n?e.map(ro):ro(e,i)}}else o="";return!n&&isNaN(s)?o:s}(e,o[t],n,i);a[e]=r}a&&a.font&&function(t,e){let r=t.match(rC);if(!r)return;let i=r[1],n=r[3],s=r[4],o=r[5],a=r[6];i&&(e.fontStyle=i),n&&(e.fontWeight=isNaN(parseFloat(n))?n:parseFloat(n)),s&&(e.fontSize=ro(s)),a&&(e.fontFamily=a),o&&(e.lineHeight="normal"===o?1:o)}(a.font,a);let l=tt(tt({},n),a);return rk.test(t.nodeName)?l:function(t){let e=iW.getDefaults();return Object.entries(nl).forEach(r=>{let[i,n]=r;if(void 0===t[n]||""===t[i])return;if(void 0===t[i]){if(!e[i])return;t[i]=e[i]}if(0===t[i].indexOf("url("))return;let s=new rs(t[i]);t[i]=s.setAlpha(eC(s.getAlpha()*t[n],2)).toRgba()}),t}(l)}let nc=["left","top","width","height","visible"],nu=["rx","ry"];class nd extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),nd.ownDefaults)}_initRxRy(){let{rx:t,ry:e}=this;t&&!e?this.ry=t:e&&!t&&(this.rx=e)}_render(t){let{width:e,height:r}=this,i=-e/2,n=-r/2,s=this.rx?Math.min(this.rx,e/2):0,o=this.ry?Math.min(this.ry,r/2):0,a=0!==s||0!==o;t.beginPath(),t.moveTo(i+s,n),t.lineTo(i+e-s,n),a&&t.bezierCurveTo(i+e-.4477152502*s,n,i+e,n+.4477152502*o,i+e,n+o),t.lineTo(i+e,n+r-o),a&&t.bezierCurveTo(i+e,n+r-.4477152502*o,i+e-.4477152502*s,n+r,i+e-s,n+r),t.lineTo(i+s,n+r),a&&t.bezierCurveTo(i+.4477152502*s,n+r,i,n+r-.4477152502*o,i,n+r-o),t.lineTo(i,n+o),a&&t.bezierCurveTo(i,n+.4477152502*o,i+.4477152502*s,n,i+s,n),t.closePath(),this._renderPaintInOrder(t)}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject([...nu,...t])}_toSVG(){let{width:t,height:e,rx:r,ry:i}=this;return["\n')]}static async fromElement(t,e,r){let i=nh(t,this.ATTRIBUTE_NAMES,r),{left:n=0,top:s=0,width:o=0,height:a=0,visible:l=!0}=i,h=te(i,nc);return new this(tt(tt(tt({},e),h),{},{left:n,top:s,width:o,height:a,visible:!!(l&&o&&a)}))}constructor(t){super(),Object.assign(this,nd.ownDefaults),this.setOptions(t),this._initRxRy()}}Z(nd,"type","Rect"),Z(nd,"cacheProperties",[...rY,...nu]),Z(nd,"ownDefaults",{rx:0,ry:0}),Z(nd,"ATTRIBUTE_NAMES",[...i2,"x","y","rx","ry","width","height"]),tY.setClass(nd),tY.setSVGClass(nd);let nf="initialization",ng="added",np="removed",nm="imperative",nv=(t,e)=>{let{strokeUniform:r,strokeWidth:i,width:n,height:s,group:o}=e,a=o&&o!==t?eK(o.calcTransformMatrix(),t.calcTransformMatrix()):null,l=a?e.getRelativeCenterPoint().transform(a):e.getRelativeCenterPoint(),h=!e.isStrokeAccountedForInDimensions(),c=r&&h?eJ(new tJ(i,i),void 0,t.calcTransformMatrix()):tZ,u=!r&&h?i:0,d=eq(n+u,s+u,ea([a,e.calcOwnMatrix()],!0)).add(c).scalarDivide(2);return[l.subtract(d),l.add(d)]};class ny{calcLayoutResult(t,e){if(this.shouldPerformLayout(t))return this.calcBoundingBox(e,t)}shouldPerformLayout(t){let{type:e,prevStrategy:r,strategy:i}=t;return e===nf||e===nm||!!r&&i!==r}shouldLayoutClipPath(t){let{type:e,target:{clipPath:r}}=t;return e!==nf&&r&&!r.absolutePositioned}getInitialSize(t,e){return e.size}calcBoundingBox(t,e){let{type:r,target:i}=e;if(r===nm&&e.overrides)return e.overrides;if(0===t.length)return;let{left:n,top:s,width:o,height:a}=eH(t.map(t=>nv(i,t)).reduce((t,e)=>t.concat(e),[])),l=new tJ(o,a),h=new tJ(n,s).add(l.scalarDivide(2));if(r===nf){let t=this.getInitialSize(e,{size:l,center:h});return{center:h,relativeCorrection:new tJ(0,0),size:t}}return{center:h.transform(i.calcOwnMatrix()),size:l}}}Z(ny,"type","strategy");class nx extends ny{shouldPerformLayout(t){return!0}}Z(nx,"type","fit-content"),tY.setClass(nx);let nb=["strategy"],n_=["target","strategy","bubbles","prevStrategy"],nw="layoutManager";class nC{performLayout(t){let e=tt(tt({bubbles:!0,strategy:this.strategy},t),{},{prevStrategy:this._prevLayoutStrategy,stopPropagation(){this.bubbles=!1}});this.onBeforeLayout(e);let r=this.getLayoutResult(e);r&&this.commitLayout(e,r),this.onAfterLayout(e,r),this._prevLayoutStrategy=e.strategy}attachHandlers(t,e){let{target:r}=e;return[tX,tM,tP,tD,tE,tA,tL,tF,"modifyPath"].map(e=>t.on(e,t=>this.performLayout(e===tX?{type:"object_modified",trigger:e,e:t,target:r}:{type:"object_modifying",trigger:e,e:t,target:r})))}subscribe(t,e){this.unsubscribe(t,e);let r=this.attachHandlers(t,e);this._subscriptions.set(t,r)}unsubscribe(t,e){(this._subscriptions.get(t)||[]).forEach(t=>t()),this._subscriptions.delete(t)}unsubscribeTargets(t){t.targets.forEach(e=>this.unsubscribe(e,t))}subscribeTargets(t){t.targets.forEach(e=>this.subscribe(e,t))}onBeforeLayout(t){let{target:e,type:r}=t,{canvas:i}=e;if(r===nf||r===ng?this.subscribeTargets(t):r===np&&this.unsubscribeTargets(t),e.fire("layout:before",{context:t}),i&&i.fire("object:layout:before",{target:e,context:t}),r===nm&&t.deep){let r=te(t,nb);e.forEachObject(t=>t.layoutManager&&t.layoutManager.performLayout(tt(tt({},r),{},{bubbles:!1,target:t})))}}getLayoutResult(t){let{target:e,strategy:r,type:i}=t,n=r.calcLayoutResult(t,e.getObjects());if(!n)return;let s=i===nf?new tJ:e.getRelativeCenterPoint(),{center:o,correction:a=new tJ,relativeCorrection:l=new tJ}=n,h=s.subtract(o).add(a).transform(i===nf?t_:es(e.calcOwnMatrix()),!0).add(l);return{result:n,prevCenter:s,nextCenter:o,offset:h}}commitLayout(t,e){var r,i;let{target:n}=t,{result:{size:s},nextCenter:o}=e;(n.set({width:s.x,height:s.y}),this.layoutObjects(t,e),t.type===nf)?n.set({left:null!=(r=t.x)?r:o.x+s.x*e1(n.originX),top:null!=(i=t.y)?i:o.y+s.y*e1(n.originY)}):(n.setPositionByOrigin(o,tw,tw),n.setCoords(),n.set("dirty",!0))}layoutObjects(t,e){let{target:r}=t;r.forEachObject(i=>{i.group===r&&this.layoutObject(t,e,i)}),t.strategy.shouldLayoutClipPath(t)&&this.layoutObject(t,e,r.clipPath)}layoutObject(t,e,r){let{offset:i}=e;r.set({left:r.left+i.x,top:r.top+i.y})}onAfterLayout(t,e){let{target:r,strategy:i,bubbles:n,prevStrategy:s}=t,o=te(t,n_),{canvas:a}=r;r.fire("layout:after",{context:t,result:e}),a&&a.fire("object:layout:after",{context:t,result:e,target:r});let l=r.parent;n&&null!=l&&l.layoutManager&&((o.path||(o.path=[])).push(r),l.layoutManager.performLayout(tt(tt({},o),{},{target:l}))),r.set("dirty",!0)}dispose(){let{_subscriptions:t}=this;t.forEach(t=>t.forEach(t=>t())),t.clear()}toObject(){return{type:nw,strategy:this.strategy.constructor.type}}toJSON(){return this.toObject()}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nx;Z(this,"strategy",void 0),this.strategy=t,this._subscriptions=new Map}}tY.setClass(nC,nw);let nS=["type","objects","layoutManager"];class nT extends nC{performLayout(){}}class nO extends t0(iW){static getDefaults(){return tt(tt({},super.getDefaults()),nO.ownDefaults)}groupInit(t,e){var r;this._objects=[...t],this.__objectSelectionTracker=this.__objectSelectionMonitor.bind(this,!0),this.__objectSelectionDisposer=this.__objectSelectionMonitor.bind(this,!1),this.forEachObject(t=>{this.enterGroup(t,!1)}),this.layoutManager=null!=(r=e.layoutManager)?r:new nC,this.layoutManager.performLayout({type:nf,target:this,targets:[...t],x:e.left,y:e.top})}canEnterGroup(t){return t===this||this.isDescendantOf(t)?(ts("error","Group: circular object trees are not supported, this call has no effect"),!1):-1===this._objects.indexOf(t)||(ts("error","Group: duplicate objects are not supported inside group, this call has no effect"),!1)}_filterObjectsBeforeEnteringGroup(t){return t.filter((t,e,r)=>this.canEnterGroup(t)&&r.indexOf(t)===e)}add(){for(var t=arguments.length,e=Array(t),r=0;r1?e-1:0),i=1;i{r._set(t,e)}),this}_shouldSetNestedCoords(){return this.subTargetCheck}removeAll(){return this._activeObjects=[],this.remove(...this._objects)}__objectSelectionMonitor(t,e){let{target:r}=e,i=this._activeObjects;if(t)i.push(r),this._set("dirty",!0);else if(i.length>0){let t=i.indexOf(r);t>-1&&(i.splice(t,1),this._set("dirty",!0))}}_watchObject(t,e){t&&this._watchObject(!1,e),t?(e.on("selected",this.__objectSelectionTracker),e.on("deselected",this.__objectSelectionDisposer)):(e.off("selected",this.__objectSelectionTracker),e.off("deselected",this.__objectSelectionDisposer))}enterGroup(t,e){t.group&&t.group.remove(t),t._set("parent",this),this._enterGroup(t,e)}_enterGroup(t,e){e&&eY(t,eo(es(this.calcTransformMatrix()),t.calcTransformMatrix())),this._shouldSetNestedCoords()&&t.setCoords(),t._set("group",this),t._set("canvas",this.canvas),this._watchObject(!0,t);let r=this.canvas&&this.canvas.getActiveObject&&this.canvas.getActiveObject();r&&(r===t||t.isDescendantOf(r))&&this._activeObjects.push(t)}exitGroup(t,e){this._exitGroup(t,e),t._set("parent",void 0),t._set("canvas",void 0)}_exitGroup(t,e){t._set("group",void 0),e||(eY(t,eo(this.calcTransformMatrix(),t.calcTransformMatrix())),t.setCoords()),this._watchObject(!1,t);let r=this._activeObjects.length>0?this._activeObjects.indexOf(t):-1;r>-1&&this._activeObjects.splice(r,1)}shouldCache(){let t=iW.prototype.shouldCache.call(this);if(t){for(let t=0;tt.setCoords())}triggerLayout(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.layoutManager.performLayout(tt({target:this,type:nm},t))}render(t){this._transformDone=!0,super.render(t),this._transformDone=!1}__serializeObjects(t,e){let r=this.includeDefaultValues;return this._objects.filter(function(t){return!t.excludeFromExport}).map(function(i){let n=i.includeDefaultValues;i.includeDefaultValues=r;let s=i[t||"toObject"](e);return i.includeDefaultValues=n,s})}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.layoutManager.toObject();return tt(tt(tt({},super.toObject(["subTargetCheck","interactive",...t])),"fit-content"!==e.strategy||this.includeDefaultValues?{layoutManager:e}:{}),{},{objects:this.__serializeObjects("toObject",t)})}toString(){return"#")}dispose(){this.layoutManager.unsubscribeTargets({targets:this.getObjects(),target:this}),this._activeObjects=[],this.forEachObject(t=>{this._watchObject(!1,t),t.dispose()}),super.dispose()}_createSVGBgRect(t){if(!this.backgroundColor)return"";let e=nd.prototype._toSVG.call(this),r=e.indexOf("COMMON_PARTS");e[r]='for="group" ';let i=e.join("");return t?t(i):i}_toSVG(t){let e=["\n"],r=this._createSVGBgRect(t);r&&e.push(" ",r);for(let r=0;r\n"),e}getSvgStyles(){let t=void 0!==this.opacity&&1!==this.opacity?"opacity: ".concat(this.opacity,";"):"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")}toClipPathSVG(t){let e=[],r=this._createSVGBgRect(t);r&&e.push(" ",r);for(let r=0;r{let[e,r]=t,i=new this(e,tt(tt(tt({},s),r),{},{layoutManager:new nT}));return n?i.layoutManager=new(tY.getClass(n.type))(new(tY.getClass(n.strategy))):i.layoutManager=new nC,i.layoutManager.subscribeTargets({type:nf,target:i,targets:i.getObjects()}),i.setCoords(),i})}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Z(this,"_activeObjects",[]),Z(this,"__objectSelectionTracker",void 0),Z(this,"__objectSelectionDisposer",void 0),Object.assign(this,nO.ownDefaults),this.setOptions(e),this.groupInit(t,e)}}Z(nO,"type","Group"),Z(nO,"ownDefaults",{strokeWidth:0,subTargetCheck:!1,interactive:!1}),tY.setClass(nO);let nk=(t,e)=>Math.min(e.width/t.width,e.height/t.height),nM=(t,e)=>Math.max(e.width/t.width,e.height/t.height),nE="\\s*,?\\s*",nD="".concat(nE,"(").concat(r_,")"),nj="".concat(nD).concat(nD).concat(nD).concat(nE,"([01])").concat(nE,"([01])").concat(nD).concat(nD),nA={m:"l",M:"L"},nP=(t,e,r,i,n,s,o,a,l,h,c)=>{let u=tK(t),d=tQ(t),f=tK(e),g=tQ(e),p=r*n*f-i*s*g+o,m=i*n*f+r*s*g+a;return["C",h+l*(-r*n*d-i*s*u),c+l*(-i*n*d+r*s*u),p+l*(r*n*g+i*s*f),m+l*(i*n*g-r*s*f),p,m]},nF=(t,e,r,i)=>{let n=Math.atan2(e,t),s=Math.atan2(i,r);return s>=n?s-n:2*Math.PI-(n-s)};function nL(t,e,r,i,n,s,o,a){let l;if(tn.cachesBoundsOfCurve&&(l=[...arguments].join(),tp.boundsOfCurveCache[l]))return tp.boundsOfCurveCache[l];let h=Math.sqrt,c=Math.abs,u=[],d=[[0,0],[0,0]],f=6*t-12*r+6*n,g=-3*t+9*r-9*n+3*o,p=3*r-3*t;for(let t=0;t<2;++t){if(t>0&&(f=6*e-12*i+6*s,g=-3*e+9*i-9*s+3*a,p=3*i-3*e),1e-12>c(g)){if(1e-12>c(f))continue;let t=-p/f;0{let[i,n,s,o,a,l,h,c]=r,u=((t,e,r,i,n,s,o)=>{if(0===r||0===i)return[];let a=0,l=0,h=0,c=Math.PI,u=o*tb,d=tQ(u),f=tK(u),g=.5*(-f*t-d*e),p=.5*(-f*e+d*t),m=r**2,y=i**2,x=p**2,b=g**2,_=m*y-m*x-y*b,w=Math.abs(r),C=Math.abs(i);if(_<0){let t=Math.sqrt(1-_/(m*y));w*=t,C*=t}else h=(n===s?-1:1)*Math.sqrt(_/(m*x+y*b));let S=h*w*p/C,T=-h*C*g/w,O=f*S-d*T+.5*t,k=d*S+f*T+.5*e,M=nF(1,0,(g-S)/w,(p-T)/C),E=nF((g-S)/w,(p-T)/C,(-g-S)/w,(-p-T)/C);0===s&&E>0?E-=2*c:1===s&&E<0&&(E+=2*c);let D=Math.ceil(Math.abs(E/c*2)),j=[],A=E/D,P=8/3*Math.sin(A/4)*Math.sin(A/4)/Math.sin(A/2),F=M+A;for(let t=0;t{let e=0,r=0,i=0,n=0,s=[],o,a=0,l=0;for(let h of t){let t,c=[...h];switch(c[0]){case"l":c[1]+=e,c[2]+=r;case"L":t=["L",e=c[1],r=c[2]];break;case"h":c[1]+=e;case"H":t=["L",e=c[1],r];break;case"v":c[1]+=r;case"V":t=["L",e,r=c[1]];break;case"m":c[1]+=e,c[2]+=r;case"M":e=c[1],r=c[2],i=c[1],n=c[2],t=["M",e,r];break;case"c":c[1]+=e,c[2]+=r,c[3]+=e,c[4]+=r,c[5]+=e,c[6]+=r;case"C":a=c[3],l=c[4],e=c[5],r=c[6],t=["C",c[1],c[2],a,l,e,r];break;case"s":c[1]+=e,c[2]+=r,c[3]+=e,c[4]+=r;case"S":"C"===o?(a=2*e-a,l=2*r-l):(a=e,l=r),e=c[3],r=c[4],a=(t=["C",a,l,c[1],c[2],e,r])[3],l=t[4];break;case"q":c[1]+=e,c[2]+=r,c[3]+=e,c[4]+=r;case"Q":a=c[1],l=c[2],t=["Q",a,l,e=c[3],r=c[4]];break;case"t":c[1]+=e,c[2]+=r;case"T":"Q"===o?(a=2*e-a,l=2*r-l):(a=e,l=r),t=["Q",a,l,e=c[1],r=c[2]];break;case"a":c[6]+=e,c[7]+=r;case"A":nR(e,r,c).forEach(t=>s.push(t)),e=c[6],r=c[7];break;case"z":case"Z":e=i,r=n,t=["Z"]}t?(s.push(t),o=t[0]):o=""}return s},nB=(t,e,r,i)=>Math.sqrt((r-t)**2+(i-e)**2),nN=(t,e,r,i,n,s,o,a)=>l=>{let h=l**3,c=(t=>3*t**2*(1-t))(l),u=(t=>3*t*(1-t)**2)(l),d=(1-l)**3;return new tJ(o*h+n*c+r*u+t*d,a*h+s*c+i*u+e*d)},nW=t=>2*t*(1-t),nU=(t,e,r,i,n,s,o,a)=>l=>{let h=l**2,c=nW(l),u=(1-l)**2;return Math.atan2(3*(u*(i-e)+c*(s-i)+h*(a-s)),3*(u*(r-t)+c*(n-r)+h*(o-n)))},nH=(t,e,r,i,n,s)=>o=>{let a=o**2,l=nW(o),h=(1-o)**2;return new tJ(n*a+r*l+t*h,s*a+i*l+e*h)},nX=(t,e,r,i,n,s)=>o=>{let a=1-o;return Math.atan2(2*(a*(i-e)+o*(s-i)),2*(a*(r-t)+o*(n-r)))},nV=(t,e,r)=>{let i=new tJ(e,r),n=0;for(let e=1;e<=100;e+=1){let r=t(e/100);n+=nB(i.x,i.y,r.x,r.y),i=r}return n},nY=t=>{let e,r,i=0,n=0,s=0,o=0,a=0,l=[];for(let h of t){let t={x:n,y:s,command:h[0],length:0};switch(h[0]){case"M":(r=t).x=o=n=h[1],r.y=a=s=h[2];break;case"L":(r=t).length=nB(n,s,h[1],h[2]),n=h[1],s=h[2];break;case"C":e=nN(n,s,h[1],h[2],h[3],h[4],h[5],h[6]),(r=t).iterator=e,r.angleFinder=nU(n,s,h[1],h[2],h[3],h[4],h[5],h[6]),r.length=nV(e,n,s),n=h[5],s=h[6];break;case"Q":e=nH(n,s,h[1],h[2],h[3],h[4]),(r=t).iterator=e,r.angleFinder=nX(n,s,h[1],h[2],h[3],h[4]),r.length=nV(e,n,s),n=h[3],s=h[4];break;case"Z":(r=t).destX=o,r.destY=a,r.length=nB(n,s,o,a),n=o,s=a}i+=r.length,l.push(r)}return l.push({length:i,x:n,y:s}),l},nz=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:nY(t),i=0;for(;e-r[i].length>0&&i{let r,i=0,n=0,s={x:t.x,y:t.y},o=tt({},s),a=.01,l=0,h=t.iterator,c=t.angleFinder;for(;n1e-4;)o=h(i),l=i,(r=nB(s.x,s.y,o.x,o.y))+n>e?(i-=a,a/=2):(s=o,i+=a,n+=r);return tt(tt({},o),{},{angle:c(l)})})(n,e)}},nG=RegExp("[mzlhvcsqta][^mzlhvcsqta]*","gi"),nq=RegExp(nj,"g"),nK=RegExp(r_,"gi"),nQ={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},nJ=t=>{var e;let r=[];for(let i of null!=(e=t.match(nG))?e:[]){let t=i[0];if("z"===t||"Z"===t){r.push([t]);continue}let e=nQ[t.toLowerCase()],n=[];if("a"===t||"A"===t){nq.lastIndex=0;for(let t=null;t=nq.exec(i);)n.push(...t.slice(1))}else n=i.match(nK)||[];for(let i=0;i0&&o?o:t;for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:0,i=new tJ(t[0]),n=new tJ(t[1]),s=1,o=0,a=[],l=t.length,h=l>2;for(h&&(s=t[2].xt[e-2].x?1:i.x===t[e-2].x?0:-1,o=i.y>t[e-2].y?1:i.y===t[e-2].y?0:-1),a.push(["L",i.x+s*r,i.y+o*r]),a},n$=(t,e)=>t.map(t=>t.map((t,r)=>0===r||void 0===e?t:eC(t,e)).join(" ")).join(" ");function n0(t,e){let r=t.style;r&&e&&("string"==typeof e?r.cssText+=";"+e:Object.entries(e).forEach(t=>{let[e,i]=t;return r.setProperty(e,i)}))}Object.freeze({__proto__:null,addTransformToObject:eV,animate:r8,animateColor:r7,applyTransformToObject:eY,calcAngleBetweenVectors:rP,calcDimensionsMatrix:em,calcPlaneChangeMatrix:eK,calcVectorRotation:rF,cancelAnimFrame:t5,capValue:rX,composeMatrix:ev,copyCanvasElement:t=>{var e;let r=t8(t);return null==(e=r.getContext("2d"))||e.drawImage(t,0,0),r},cos:tK,createCanvasElement:t9,createImage:t6,createRotateMatrix:eu,createScaleMatrix:ed,createSkewXMatrix:eg,createSkewYMatrix:ep,createTranslateMatrix:ec,createVector:rj,crossProduct:rI,degreesToRadians:ee,dotProduct:rB,ease:rJ,enlivenObjectEnlivables:eb,enlivenObjects:ex,findScaleToCover:nM,findScaleToFit:nk,getBoundsOfCurve:nL,getOrthonormalVector:rR,getPathSegmentsInfo:nY,getPointOnPath:nz,getPointer:eN,getRandomInt:(t,e)=>Math.floor(Math.random()*(e-t+1))+t,getRegularPolygonPath:(t,e)=>{let r=2*Math.PI/t,i=-ty;t%2==0&&(i+=r/2);let n=Array(t+1);for(let s=0;s{let e=["instantiated_by_use","style","id","class"];switch(t){case"linearGradient":return e.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);case"radialGradient":return e.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);case"stop":return e.concat(["offset","stop-color","stop-opacity"])}return e},getUnitVector:rL,groupSVGElements:(t,e)=>t&&1===t.length?t[0]:new nO(t,e),hasStyleChanged:i$,invertTransform:es,isBetweenVectors:rN,isIdentityMatrix:ei,isTouchEvent:eW,isTransparent:iU,joinPath:n$,loadImage:ey,magnitude:rA,makeBoundingBoxFromPoints:eH,makePathSimpler:nI,matrixToSVG:eS,mergeClipPaths:(t,e)=>{var r;let i=t,n=e;i.inverted&&!n.inverted&&(i=e,n=t),eZ(n,null==(r=n.group)?void 0:r.calcTransformMatrix(),i.calcTransformMatrix());let s=i.inverted&&n.inverted;return s&&(i.inverted=n.inverted=!1),new nO([i],{clipPath:n,inverted:s})},multiplyTransformMatrices:eo,multiplyTransformMatrixArray:ea,parsePath:nJ,parsePreserveAspectRatioAttribute:ra,parseUnit:ro,pick:e_,projectStrokeOnPoints:iz,qrDecompose:eh,radiansToDegrees:er,removeFromArray:tq,removeTransformFromObject:(t,e)=>{let r=eo(es(e),t.calcOwnMatrix());eY(t,r)},removeTransformMatrixForSvgParsing:(t,e)=>{let r=t._findCenterFromElement();t.transformMatrix&&((t=>{if(t.transformMatrix){let{scaleX:e,scaleY:r,angle:i,skewX:n}=eh(t.transformMatrix);t.flipX=!1,t.flipY=!1,t.set(tI,e),t.set(tB,r),t.angle=i,t.skewX=n,t.skewY=0}})(t),r=r.transform(t.transformMatrix)),delete t.transformMatrix,e&&(t.scaleX*=e.scaleX,t.scaleY*=e.scaleY,t.cropX=e.cropX,t.cropY=e.cropY,r.x+=e.offsetLeft,r.y+=e.offsetTop,t.width=e.width,t.height=e.height),t.setPositionByOrigin(r,tw,tw)},request:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.onComplete||tv,i=new(tf()).XMLHttpRequest,n=e.signal,s=function(){i.abort()},o=function(){n&&n.removeEventListener("abort",s),i.onerror=i.ontimeout=tv};if(n&&n.aborted)throw new ta("request");return n&&n.addEventListener("abort",s,{once:!0}),i.onreadystatechange=function(){4===i.readyState&&(o(),r(i),i.onreadystatechange=tv)},i.onerror=i.ontimeout=o,i.open("get",t,!0),i.send(),i},requestAnimFrame:t2,resetObjectTransform:ez,rotatePoint:(t,e,r)=>t.rotate(r,e),rotateVector:rD,saveObjectTransform:eG,sendObjectToPlane:eZ,sendPointToPlane:eQ,sendVectorToPlane:eJ,setStyle:n0,sin:tQ,sizeAfterTransform:eq,string:iZ,stylesFromArray:i1,stylesToArray:i0,toBlob:et,toDataURL:t7,toFixed:eC,transformPath:(t,e,r)=>(r&&(e=eo(e,[1,0,0,1,-r.x,-r.y])),t.map(t=>{let r=[...t];for(let i=1;i1&&void 0!==arguments[1]?arguments[1]:{};super(t),Z(this,"upper",void 0),Z(this,"container",void 0);let{el:i}=this.lower,n=this.createUpperCanvas();this.upper={el:n,ctx:n.getContext("2d")},this.applyCanvasStyle(i,{allowTouchScrolling:e}),this.applyCanvasStyle(n,{allowTouchScrolling:e,styles:{position:"absolute",left:"0",top:"0"}});let s=this.createContainerElement();s.classList.add(r),i.parentNode&&i.parentNode.replaceChild(s,i),s.append(i,n),this.container=s}}class n2 extends eI{static getDefaults(){return tt(tt({},super.getDefaults()),n2.ownDefaults)}get upperCanvasEl(){var t;return null==(t=this.elements.upper)?void 0:t.el}get contextTop(){var t;return null==(t=this.elements.upper)?void 0:t.ctx}get wrapperEl(){return this.elements.container}initElements(t){this.elements=new n1(t,{allowTouchScrolling:this.allowTouchScrolling,containerClass:this.containerClass}),this._createCacheCanvas()}_onObjectAdded(t){this._objectsToRender=void 0,super._onObjectAdded(t)}_onObjectRemoved(t){this._objectsToRender=void 0,t===this._activeObject&&(this.fire("before:selection:cleared",{deselected:[t]}),this._discardActiveObject(),this.fire("selection:cleared",{deselected:[t]}),t.fire("deselected",{target:t})),t===this._hoveredTarget&&(this._hoveredTarget=void 0,this._hoveredTargets=[]),super._onObjectRemoved(t)}_onStackOrderChanged(){this._objectsToRender=void 0,super._onStackOrderChanged()}_chooseObjectsToRender(){let t=this._activeObject;return!this.preserveObjectStacking&&t?this._objects.filter(e=>!e.group&&e!==t).concat(t):this._objects}renderAll(){this.cancelRequestedRender(),this.destroyed||(!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1),this._objectsToRender||(this._objectsToRender=this._chooseObjectsToRender()),this.renderCanvas(this.getContext(),this._objectsToRender))}renderTopLayer(t){t.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(t),this.contextTopDirty=!0),t.restore()}renderTop(){let t=this.contextTop;this.clearContext(t),this.renderTopLayer(t),this.fire("after:render",{ctx:t})}setTargetFindTolerance(t){t=Math.round(t),this.targetFindTolerance=t;let e=this.getRetinaScaling(),r=Math.ceil((2*t+1)*e);this.pixelFindCanvasEl.width=this.pixelFindCanvasEl.height=r,this.pixelFindContext.scale(e,e)}isTargetTransparent(t,e,r){let i=this.targetFindTolerance,n=this.pixelFindContext;this.clearContext(n),n.save(),n.translate(-e+i,-r+i),n.transform(...this.viewportTransform);let s=t.selectionBackgroundColor;t.selectionBackgroundColor="",t.render(n),t.selectionBackgroundColor=s,n.restore();let o=Math.round(i*this.getRetinaScaling());return iU(n,o,o,o)}_isSelectionKeyPressed(t){let e=this.selectionKey;return!!e&&(Array.isArray(e)?!!e.find(e=>!!e&&!0===t[e]):t[e])}_shouldClearSelection(t,e){let r=this.getActiveObjects(),i=this._activeObject;return!!(!e||e&&i&&r.length>1&&-1===r.indexOf(e)&&i!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&i&&i!==e)}_shouldCenterTransform(t,e,r){let i;if(t)return e===tR||e===tI||e===tB||e===tP?i=this.centeredScaling||t.centeredScaling:e===tj&&(i=this.centeredRotation||t.centeredRotation),i?!r:r}_getOriginFromCorner(t,e){let r={x:t.originX,y:t.originY};return e&&(["ml","tl","bl"].includes(e)?r.x=tT:["mr","tr","br"].includes(e)&&(r.x=tC),["tl","mt","tr"].includes(e)?r.y=tS:["bl","mb","br"].includes(e)&&(r.y="top")),r}_setupCurrentTransform(t,e,r){var i;let n=e.group?eQ(this.getScenePoint(t),void 0,e.group.calcTransformMatrix()):this.getScenePoint(t),{key:s="",control:o}=e.getActiveControl()||{},a=r&&o?null==(i=o.getActionHandler(t,e,o))?void 0:i.bind(o):e8,l=((t,e,r,i)=>{if(!e||!t)return"drag";let n=i.controls[e];return n.getActionName(r,n,i)})(r,s,t,e),h=t[this.centeredKey],c=this._shouldCenterTransform(e,l,h)?{x:tw,y:tw}:this._getOriginFromCorner(e,s),u={target:e,action:l,actionHandler:a,actionPerformed:!1,corner:s,scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,offsetX:n.x-e.left,offsetY:n.y-e.top,originX:c.x,originY:c.y,ex:n.x,ey:n.y,lastX:n.x,lastY:n.y,theta:ee(e.angle),width:e.width,height:e.height,shiftKey:t.shiftKey,altKey:h,original:tt(tt({},eG(e)),{},{originX:c.x,originY:c.y})};this._currentTransform=u,this.fire("before:transform",{e:t,transform:u})}setCursor(t){this.upperCanvasEl.style.cursor=t}_drawSelection(t){let{x:e,y:r,deltaX:i,deltaY:n}=this._groupSelector,s=new tJ(e,r).transform(this.viewportTransform),o=new tJ(e+i,r+n).transform(this.viewportTransform),a=this.selectionLineWidth/2,l=Math.min(s.x,o.x),h=Math.min(s.y,o.y),c=Math.max(s.x,o.x),u=Math.max(s.y,o.y);this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(l,h,c-l,u-h)),this.selectionLineWidth&&this.selectionBorderColor&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,l+=a,h+=a,c-=a,u-=a,iW.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(l,h,c-l,u-h))}findTarget(t){if(this.skipTargetFind)return;let e=this.getViewportPoint(t),r=this._activeObject,i=this.getActiveObjects();if(this.targets=[],r&&i.length>=1){if(r.findControl(e,eW(t))||i.length>1&&this.searchPossibleTargets([r],e))return r;if(r===this.searchPossibleTargets([r],e)){if(this.preserveObjectStacking){let i=this.targets;this.targets=[];let n=this.searchPossibleTargets(this._objects,e);return t[this.altSelectionKey]&&n&&n!==r?(this.targets=i,r):n}return r}}return this.searchPossibleTargets(this._objects,e)}_pointIsInObjectSelectionArea(t,e){let r=t.getCoords(),i=this.getZoom(),n=t.padding/i;if(n){let[t,e,i,s]=r,o=Math.atan2(e.y-t.y,e.x-t.x),a=tK(o)*n,l=tQ(o)*n,h=a+l,c=a-l;r=[new tJ(t.x-c,t.y-h),new tJ(e.x+h,e.y-c),new tJ(i.x+c,i.y+h),new tJ(s.x-h,s.y+c)]}return it.isPointInPolygon(e,r)}_checkTarget(t,e){return!(!(t&&t.visible&&t.evented&&this._pointIsInObjectSelectionArea(t,eQ(e,void 0,this.viewportTransform)))||(this.perPixelTargetFind||t.perPixelTargetFind)&&!t.isEditing&&this.isTargetTransparent(t,e.x,e.y))||!1}_searchPossibleTargets(t,e){let r=t.length;for(;r--;){let i=t[r];if(this._checkTarget(i,e)){if(t$(i)&&i.subTargetCheck){let t=this._searchPossibleTargets(i._objects,e);t&&this.targets.push(t)}return i}}}searchPossibleTargets(t,e){let r=this._searchPossibleTargets(t,e);if(r&&t$(r)&&r.interactive&&this.targets[0]){let t=this.targets;for(let e=t.length-1;e>0;e--){let r=t[e];if(!t$(r)||!r.interactive)return r}return t[0]}return r}getViewportPoint(t){return this._pointer?this._pointer:this.getPointer(t,!0)}getScenePoint(t){return this._absolutePointer?this._absolutePointer:this.getPointer(t)}getPointer(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.upperCanvasEl,i=r.getBoundingClientRect(),n=eN(t),s=i.width||0,o=i.height||0;s&&o||("top"in i&&tS in i&&(o=Math.abs(i.top-i.bottom)),tT in i&&tC in i&&(s=Math.abs(i.right-i.left))),this.calcOffset(),n.x=n.x-this._offset.left,n.y=n.y-this._offset.top,e||(n=eQ(n,void 0,this.viewportTransform));let a=this.getRetinaScaling();1!==a&&(n.x/=a,n.y/=a);let l=0===s||0===o?new tJ(1,1):new tJ(r.width/s,r.height/o);return n.multiply(l)}_setDimensionsImpl(t,e){this._resetTransformEventData(),super._setDimensionsImpl(t,e),this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop)}_createCacheCanvas(){this.pixelFindCanvasEl=t9(),this.pixelFindContext=this.pixelFindCanvasEl.getContext("2d",{willReadFrequently:!0}),this.setTargetFindTolerance(this.targetFindTolerance)}getTopContext(){return this.elements.upper.ctx}getSelectionContext(){return this.elements.upper.ctx}getSelectionElement(){return this.elements.upper.el}getActiveObject(){return this._activeObject}getActiveObjects(){let t=this._activeObject;return eM(t)?t.getObjects():t?[t]:[]}_fireSelectionEvents(t,e){let r=!1,i=!1,n=this.getActiveObjects(),s=[],o=[];t.forEach(t=>{n.includes(t)||(r=!0,t.fire("deselected",{e:e,target:t}),o.push(t))}),n.forEach(i=>{t.includes(i)||(r=!0,i.fire("selected",{e:e,target:i}),s.push(i))}),t.length>0&&n.length>0?(i=!0,r&&this.fire("selection:updated",{e:e,selected:s,deselected:o})):n.length>0?(i=!0,this.fire("selection:created",{e:e,selected:s})):t.length>0&&(i=!0,this.fire("selection:cleared",{e:e,deselected:o})),i&&(this._objectsToRender=void 0)}setActiveObject(t,e){let r=this.getActiveObjects(),i=this._setActiveObject(t,e);return this._fireSelectionEvents(r,e),i}_setActiveObject(t,e){let r=this._activeObject;return r!==t&&!(!this._discardActiveObject(e,t)&&this._activeObject)&&!t.onSelect({e:e})&&(this._activeObject=t,eM(t)&&r!==t&&t.set("canvas",this),t.setCoords(),!0)}_discardActiveObject(t,e){let r=this._activeObject;return!!r&&!r.onDeselect({e:t,object:e})&&(this._currentTransform&&this._currentTransform.target===r&&this.endCurrentTransform(t),eM(r)&&r===this._hoveredTarget&&(this._hoveredTarget=void 0),this._activeObject=void 0,!0)}discardActiveObject(t){let e=this.getActiveObjects(),r=this.getActiveObject();e.length&&this.fire("before:selection:cleared",{e:t,deselected:[r]});let i=this._discardActiveObject(t);return this._fireSelectionEvents(e,t),i}endCurrentTransform(t){let e=this._currentTransform;this._finalizeCurrentTransform(t),e&&e.target&&(e.target.isMoving=!1),this._currentTransform=null}_finalizeCurrentTransform(t){let e=this._currentTransform,r=e.target,i={e:t,target:r,transform:e,action:e.action};r._scaling&&(r._scaling=!1),r.setCoords(),e.actionPerformed&&(this.fire("object:modified",i),r.fire(tX,i))}setViewportTransform(t){super.setViewportTransform(t);let e=this._activeObject;e&&e.setCoords()}destroy(){let t=this._activeObject;eM(t)&&(t.removeAll(),t.dispose()),delete this._activeObject,super.destroy(),this.pixelFindContext=null,this.pixelFindCanvasEl=void 0}clear(){this.discardActiveObject(),this._activeObject=void 0,this.clearContext(this.contextTop),super.clear()}drawControls(t){let e=this._activeObject;e&&e._renderControls(t)}_toObject(t,e,r){let i=this._realizeGroupTransformOnObject(t),n=super._toObject(t,e,r);return t.set(i),n}_realizeGroupTransformOnObject(t){let{group:e}=t;if(e&&eM(e)&&this._activeObject===e){let r=e_(t,["angle","flipX","flipY",tC,tI,tB,tN,tW,"top"]);return eV(t,e.calcOwnMatrix()),r}return{}}_setSVGObject(t,e,r){let i=this._realizeGroupTransformOnObject(e);super._setSVGObject(t,e,r),e.set(i)}constructor(){super(...arguments),Z(this,"targets",[]),Z(this,"_hoveredTargets",[]),Z(this,"_objectsToRender",void 0),Z(this,"_currentTransform",null),Z(this,"_groupSelector",null),Z(this,"contextTopDirty",!1)}}Z(n2,"ownDefaults",{uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",selection:!0,selectionKey:"shiftKey",selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",notAllowedCursor:"not-allowed",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,enablePointerEvents:!1,containerClass:"canvas-container",preserveObjectStacking:!1});class n5{exitTextEditing(){this.target=void 0,this.targets.forEach(t=>{t.isEditing&&t.exitEditing()})}add(t){this.targets.push(t)}remove(t){this.unregister(t),tq(this.targets,t)}register(t){this.target=t}unregister(t){t===this.target&&(this.target=void 0)}onMouseMove(t){var e;(null==(e=this.target)?void 0:e.isEditing)&&this.target.updateSelectionOnMouseMove(t)}clear(){this.targets=[],this.target=void 0}dispose(){this.clear(),this.__disposer(),delete this.__disposer}constructor(t){Z(this,"targets",[]),Z(this,"__disposer",void 0);let e=()=>{let{hiddenTextarea:e}=t.getActiveObject()||{};e&&e.focus()},r=t.upperCanvasEl;r.addEventListener("click",e),this.__disposer=()=>r.removeEventListener("click",e)}}let n4=["target","oldTarget","fireCanvas","e"],n3={passive:!1},n9=(t,e)=>{let r=t.getViewportPoint(e),i=t.getScenePoint(e);return{viewportPoint:r,scenePoint:i,pointer:r,absolutePointer:i}},n6=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i1?e-1:0),i=1;i{this.fire("mouse:out",tt(tt({},r),{},{target:t})),t&&t.fire("mouseout",tt({},r))}),this._hoveredTargets=[]}_onMouseEnter(t){this._currentTransform||this.findTarget(t)||(this.fire("mouse:over",tt({e:t},n9(this,t))),this._hoveredTarget=void 0,this._hoveredTargets=[])}_onDragStart(t){this._isClick=!1;let e=this.getActiveObject();if(e&&e.onDragStart(t)){this._dragSource=e;let r={e:t,target:e};return this.fire("dragstart",r),e.fire("dragstart",r),void n6(this.upperCanvasEl,"drag",this._onDragProgress)}eU(t)}_renderDragEffects(t,e,r){let i=!1,n=this._dropTarget;n&&n!==e&&n!==r&&(n.clearContextTop(),i=!0),null==e||e.clearContextTop(),r!==e&&(null==r||r.clearContextTop());let s=this.contextTop;s.save(),s.transform(...this.viewportTransform),e&&(s.save(),e.transform(s),e.renderDragSourceEffect(t),s.restore(),i=!0),r&&(s.save(),r.transform(s),r.renderDropTargetEffect(t),s.restore(),i=!0),s.restore(),i&&(this.contextTopDirty=!0)}_onDragEnd(t){let e=!!t.dataTransfer&&t.dataTransfer.dropEffect!==tO,r=e?this._activeObject:void 0,i={e:t,target:this._dragSource,subTargets:this.targets,dragSource:this._dragSource,didDrop:e,dropTarget:r};n8(this.upperCanvasEl,"drag",this._onDragProgress),this.fire("dragend",i),this._dragSource&&this._dragSource.fire("dragend",i),delete this._dragSource,this._onMouseUp(t)}_onDragProgress(t){let e={e:t,target:this._dragSource,dragSource:this._dragSource,dropTarget:this._draggedoverTarget};this.fire("drag",e),this._dragSource&&this._dragSource.fire("drag",e)}findDragTargets(t){return this.targets=[],{target:this._searchPossibleTargets(this._objects,this.getViewportPoint(t)),targets:[...this.targets]}}_onDragOver(t){let e,r="dragover",{target:i,targets:n}=this.findDragTargets(t),s=this._dragSource,o={e:t,target:i,subTargets:n,dragSource:s,canDrop:!1,dropTarget:void 0};this.fire(r,o),this._fireEnterLeaveEvents(i,o),i&&(i.canDrop(t)&&(e=i),i.fire(r,o));for(let i=0;i3||e<2||(this._cacheTransformEventData(t),2==e&&"dblclick"===t.type&&this._handleEvent(t,"dblclick"),3==e&&this._handleEvent(t,"tripleclick"),this._resetTransformEventData())}getPointerId(t){let e=t.changedTouches;return e?e[0]&&e[0].identifier:this.enablePointerEvents?t.pointerId:-1}_isMainEvent(t){return!0===t.isPrimary||!1!==t.isPrimary&&("touchend"===t.type&&0===t.touches.length||!t.changedTouches||t.changedTouches[0].identifier===this.mainTouchId)}_onTouchStart(t){let e=!this.allowTouchScrolling,r=this._activeObject;void 0===this.mainTouchId&&(this.mainTouchId=this.getPointerId(t)),this.__onMouseDown(t),(this.isDrawingMode||r&&this._target===r)&&(e=!0),e&&t.preventDefault(),this._resetTransformEventData();let i=this.upperCanvasEl,n=this._getEventPrefix(),s=eD(i);n6(s,"touchend",this._onTouchEnd,n3),e&&n6(s,"touchmove",this._onMouseMove,n3),n8(i,"".concat(n,"down"),this._onMouseDown)}_onMouseDown(t){this.__onMouseDown(t),this._resetTransformEventData();let e=this.upperCanvasEl,r=this._getEventPrefix();n8(e,"".concat(r,"move"),this._onMouseMove,n3);let i=eD(e);n6(i,"".concat(r,"up"),this._onMouseUp),n6(i,"".concat(r,"move"),this._onMouseMove,n3)}_onTouchEnd(t){if(t.touches.length>0)return;this.__onMouseUp(t),this._resetTransformEventData(),delete this.mainTouchId;let e=this._getEventPrefix(),r=eD(this.upperCanvasEl);n8(r,"touchend",this._onTouchEnd,n3),n8(r,"touchmove",this._onMouseMove,n3),this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(()=>{n6(this.upperCanvasEl,"".concat(e,"down"),this._onMouseDown),this._willAddMouseDown=0},400)}_onMouseUp(t){this.__onMouseUp(t),this._resetTransformEventData();let e=this.upperCanvasEl,r=this._getEventPrefix();if(this._isMainEvent(t)){let t=eD(this.upperCanvasEl);n8(t,"".concat(r,"up"),this._onMouseUp),n8(t,"".concat(r,"move"),this._onMouseMove,n3),n6(e,"".concat(r,"move"),this._onMouseMove,n3)}}_onMouseMove(t){let e=this.getActiveObject();this.allowTouchScrolling||e&&e.shouldStartDragging(t)||!t.preventDefault||t.preventDefault(),this.__onMouseMove(t)}_onResize(){this.calcOffset(),this._resetTransformEventData()}_shouldRender(t){let e=this.getActiveObject();return!!e!=!!t||e&&t&&e!==t}__onMouseUp(t){var e;this._cacheTransformEventData(t),this._handleEvent(t,"up:before");let r=this._currentTransform,i=this._isClick,n=this._target,{button:s}=t;if(s)return(this.fireMiddleClick&&1===s||this.fireRightClick&&2===s)&&this._handleEvent(t,"up"),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)return void this._onMouseUpInDrawingMode(t);if(!this._isMainEvent(t))return;let o,a,l=!1;if(r&&(this._finalizeCurrentTransform(t),l=r.actionPerformed),!i){let e=n===this._activeObject;this.handleSelection(t),l||(l=this._shouldRender(n)||!e&&n===this._activeObject)}if(n){let{key:e,control:i}=n.findControl(this.getViewportPoint(t),eW(t))||{};if(a=e,n.selectable&&n!==this._activeObject&&"up"===n.activeOn)this.setActiveObject(n,t),l=!0;else if(i){let e=i.getMouseUpHandler(t,n,i);e&&(o=this.getScenePoint(t),e.call(i,t,r,o.x,o.y))}n.isMoving=!1}if(r&&(r.target!==n||r.corner!==a)){let e=r.target&&r.target.controls[r.corner],i=e&&e.getMouseUpHandler(t,r.target,e);o=o||this.getScenePoint(t),i&&i.call(e,t,r,o.x,o.y)}this._setCursorFromEvent(t,n),this._handleEvent(t,"up"),this._groupSelector=null,this._currentTransform=null,n&&(n.__corner=void 0),l?this.requestRenderAll():i||null!=(e=this._activeObject)&&e.isEditing||this.renderTop()}_basicEventHandler(t,e){let{target:r,subTargets:i=[]}=e;this.fire(t,e),r&&r.fire(t,e);for(let n=0;n{r=t.hoverCursor||r}),this.setCursor(r)}handleMultiSelection(t,e){let r=this._activeObject,i=eM(r);if(r&&this._isSelectionKeyPressed(t)&&this.selection&&e&&e.selectable&&(r!==e||i)&&(i||!e.isDescendantOf(r)&&!r.isDescendantOf(e))&&!e.onSelect({e:t})&&!r.getActiveControl()){if(i){let i=r.getObjects();if(e===r){let r=this.getViewportPoint(t);if(!(e=this.searchPossibleTargets(i,r)||this.searchPossibleTargets(this._objects,r))||!e.selectable)return!1}e.group===r?(r.remove(e),this._hoveredTarget=e,this._hoveredTargets=[...this.targets],1===r.size()&&this._setActiveObject(r.item(0),t)):(r.multiSelectAdd(e),this._hoveredTarget=r,this._hoveredTargets=[...this.targets]),this._fireSelectionEvents(i,t)}else{r.isEditing&&r.exitEditing();let i=new(tY.getClass("ActiveSelection"))([],{canvas:this});i.multiSelectAdd(r,e),this._hoveredTarget=i,this._setActiveObject(i,t),this._fireSelectionEvents([r],t)}return!0}return!1}handleSelection(t){if(!this.selection||!this._groupSelector)return!1;let{x:e,y:r,deltaX:i,deltaY:n}=this._groupSelector,s=new tJ(e,r),o=s.add(new tJ(i,n)),a=s.min(o),l=s.max(o).subtract(a),h=this.collectObjects({left:a.x,top:a.y,width:l.x,height:l.y},{includeIntersecting:!this.selectionFullyContained}),c=s.eq(o)?h[0]?[h[0]]:[]:h.length>1?h.filter(e=>!e.onSelect({e:t})).reverse():h;if(1===c.length)this.setActiveObject(c[0],t);else if(c.length>1){let e=tY.getClass("ActiveSelection");this.setActiveObject(new e(c,{canvas:this}),t)}return this._groupSelector=null,!0}clear(){this.textEditingManager.clear(),super.clear()}destroy(){this.removeListeners(),this.textEditingManager.dispose(),super.destroy()}constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),Z(this,"_isClick",void 0),Z(this,"textEditingManager",new n5(this)),["_onMouseDown","_onTouchStart","_onMouseMove","_onMouseUp","_onTouchEnd","_onResize","_onMouseWheel","_onMouseOut","_onMouseEnter","_onContextMenu","_onClick","_onDragStart","_onDragEnd","_onDragProgress","_onDragOver","_onDragEnter","_onDragLeave","_onDrop"].forEach(t=>{this[t]=this[t].bind(this)}),this.addOrRemove(n6,"add")}}let se={x1:0,y1:0,x2:0,y2:0},sr=tt(tt({},se),{},{r1:0,r2:0}),si=(t,e)=>isNaN(t)&&"number"==typeof e?e:t,sn=/^(\d+\.\d+)%|(\d+)%$/;function ss(t){return t&&sn.test(t)}function so(t,e){return rX(0,si("number"==typeof t?t:"string"==typeof t?parseFloat(t)/(ss(t)?100:1):NaN,e),1)}let sa=/\s*;\s*/,sl=/\s*:\s*/;function sh(t){return"linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?"linear":"radial"}function sc(t){return"userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage"}function su(t,e){return t.getAttribute(e)}class sd{addColorStop(t){for(let e in t){let r=new rs(t[e]);this.colorStops.push({offset:parseFloat(e),color:r.toRgb(),opacity:r.getAlpha()})}return this}toObject(t){return tt(tt({},e_(this,t)),{},{type:this.type,coords:tt({},this.coords),colorStops:this.colorStops.map(t=>tt({},t)),offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?[...this.gradientTransform]:void 0})}toSVG(t){let{additionalTransform:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],i=this.gradientTransform?this.gradientTransform.concat():t_.concat(),n="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox",s=this.colorStops.map(t=>tt({},t)).sort((t,e)=>t.offset-e.offset),o=-this.offsetX,a=-this.offsetY;"objectBoundingBox"===n?(o/=t.width,a/=t.height):(o+=t.width/2,a+=t.height/2),t&&"function"==typeof t._renderPathCommands&&"percentage"!==this.gradientUnits&&(o-=t.pathOffset.x,a-=t.pathOffset.y),i[4]-=o,i[5]-=a;let l=['id="SVGID_'.concat(this.id,'"'),'gradientUnits="'.concat(n,'"'),'gradientTransform="'.concat(e?e+" ":"").concat(eS(i),'"'),""].join(" ");if("linear"===this.type){let{x1:t,y1:e,x2:i,y2:n}=this.coords;r.push("\n')}else if("radial"===this.type){let{x1:t,y1:e,x2:i,y2:n,r1:o,r2:a}=this.coords,h=o>a;r.push("\n'),h&&(s.reverse(),s.forEach(t=>{t.offset=1-t.offset}));let c=Math.min(o,a);if(c>0){let t=c/Math.max(o,a);s.forEach(e=>{e.offset+=t*(1-e.offset)})}}return s.forEach(t=>{let{color:e,offset:i,opacity:n}=t;r.push("\n')}),r.push("linear"===this.type?"":"","\n"),r.join("")}toLive(t){let{x1:e,y1:r,x2:i,y2:n,r1:s,r2:o}=this.coords,a="linear"===this.type?t.createLinearGradient(e,r,i,n):t.createRadialGradient(e,r,s,i,n,o);return this.colorStops.forEach(t=>{let{color:e,opacity:r,offset:i}=t;a.addColorStop(i,void 0!==r?new rs(e).setAlpha(r).toRgba():e)}),a}static async fromObject(t){let{colorStops:e,gradientTransform:r}=t;return new this(tt(tt({},t),{},{colorStops:e?e.map(t=>tt({},t)):void 0,gradientTransform:r?[...r]:void 0}))}static fromElement(t,e,r){var i;let n=sc(t),s=e._findCenterFromElement();return new this(tt({id:t.getAttribute("id")||void 0,type:sh(t),coords:(i={width:r.viewBoxWidth||r.width,height:r.viewBoxHeight||r.height},function(t,e){let r,{width:i,height:n,gradientUnits:s}=e;return Object.keys(t).reduce((e,o)=>{let a=t[o];return"Infinity"===a?r=1:"-Infinity"===a?r=0:(r="string"==typeof a?parseFloat(a):a,"string"==typeof a&&ss(a)&&(r*=.01,"pixels"===s&&("x1"!==o&&"x2"!==o&&"r2"!==o||(r*=i),"y1"!==o&&"y2"!==o||(r*=n)))),e[o]=r,e},{})}("linear"===sh(t)?{x1:su(t,"x1")||0,y1:su(t,"y1")||0,x2:su(t,"x2")||"100%",y2:su(t,"y2")||0}:{x1:su(t,"fx")||su(t,"cx")||"50%",y1:su(t,"fy")||su(t,"cy")||"50%",r1:0,x2:su(t,"cx")||"50%",y2:su(t,"cy")||"50%",r2:su(t,"r")||"50%"},tt(tt({},i),{},{gradientUnits:sc(t)}))),colorStops:function(t,e){let r=[],i=t.getElementsByTagName("stop"),n=so(e,1);for(let t=i.length;t--;)r.push(function(t,e){let r,i,n=t.getAttribute("style");if(n){let t=n.split(sa);""===t[t.length-1]&&t.pop();for(let e=t.length;e--;){let[n,s]=t[e].split(sl).map(t=>t.trim());"stop-color"===n?r=s:"stop-opacity"===n&&(i=s)}}let s=new rs(r||t.getAttribute("stop-color")||"rgb(0,0,0)");return{offset:so(t.getAttribute("offset"),0),color:s.toRgb(),opacity:si(parseFloat(i||t.getAttribute("stop-opacity")||""),1)*s.getAlpha()*e}}(i[t],n));return r}(t,r.opacity),gradientUnits:n,gradientTransform:na(t.getAttribute("gradientTransform")||"")},"pixels"===n?{offsetX:e.width/2-s.x,offsetY:e.height/2-s.y}:{offsetX:0,offsetY:0}))}constructor(t){let{type:e="linear",gradientUnits:r="pixels",coords:i={},colorStops:n=[],offsetX:s=0,offsetY:o=0,gradientTransform:a,id:l}=t||{};Object.assign(this,{type:e,gradientUnits:r,coords:tt(tt({},"radial"===e?sr:se),i),colorStops:n,offsetX:s,offsetY:o,gradientTransform:a,id:l?"".concat(l,"_").concat(t3()):t3()})}}Z(sd,"type","Gradient"),tY.setClass(sd,"gradient"),tY.setClass(sd,"linear"),tY.setClass(sd,"radial");let sf=["type","source","patternTransform"];class sg{get type(){return"pattern"}set type(t){ts("warn","Setting type has no effect",t)}isImageSource(){return!!this.source&&"string"==typeof this.source.src}isCanvasSource(){return!!this.source&&!!this.source.toDataURL}sourceToString(){return this.isImageSource()?this.source.src:this.isCanvasSource()?this.source.toDataURL():""}toLive(t){return this.source&&(!this.isImageSource()||this.source.complete&&0!==this.source.naturalWidth&&0!==this.source.naturalHeight)?t.createPattern(this.source,this.repeat):null}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],{repeat:e,crossOrigin:r}=this;return tt(tt({},e_(this,t)),{},{type:"pattern",source:this.sourceToString(),repeat:e,crossOrigin:r,offsetX:eC(this.offsetX,tn.NUM_FRACTION_DIGITS),offsetY:eC(this.offsetY,tn.NUM_FRACTION_DIGITS),patternTransform:this.patternTransform?[...this.patternTransform]:null})}toSVG(t){let{width:e,height:r}=t,{source:i,repeat:n,id:s}=this,o=si(this.offsetX/e,0),a=si(this.offsetY/r,0),l="repeat-y"===n||"no-repeat"===n?1+Math.abs(o||0):si(i.width/e,0),h="repeat-x"===n||"no-repeat"===n?1+Math.abs(a||0):si(i.height/r,0);return[''),''),"\n"].join("\n")}static async fromObject(t,e){let{type:r,source:i,patternTransform:n}=t,s=te(t,sf),o=await ey(i,tt(tt({},e),{},{crossOrigin:s.crossOrigin}));return new this(tt(tt({},s),{},{patternTransform:n&&n.slice(0),source:o}))}constructor(t){Z(this,"repeat","repeat"),Z(this,"offsetX",0),Z(this,"offsetY",0),Z(this,"crossOrigin",""),this.id=t3(),Object.assign(this,t)}}Z(sg,"type","Pattern"),tY.setClass(sg),tY.setClass(sg,"pattern");class sp{_setBrushStyles(t){t.strokeStyle=this.color,t.lineWidth=this.width,t.lineCap=this.strokeLineCap,t.miterLimit=this.strokeMiterLimit,t.lineJoin=this.strokeLineJoin,t.setLineDash(this.strokeDashArray||[])}_saveAndTransform(t){let e=this.canvas.viewportTransform;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}needsFullRender(){return 1>new rs(this.color).getAlpha()||!!this.shadow}_setShadow(){if(!this.shadow||!this.canvas)return;let t=this.canvas,e=this.shadow,r=t.contextTop,i=t.getZoom()*t.getRetinaScaling();r.shadowColor=e.color,r.shadowBlur=e.blur*i,r.shadowOffsetX=e.offsetX*i,r.shadowOffsetY=e.offsetY*i}_resetShadow(){let t=this.canvas.contextTop;t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0}_isOutSideCanvas(t){return t.x<0||t.x>this.canvas.getWidth()||t.y<0||t.y>this.canvas.getHeight()}constructor(t){Z(this,"color","rgb(0, 0, 0)"),Z(this,"width",1),Z(this,"shadow",null),Z(this,"strokeLineCap","round"),Z(this,"strokeLineJoin","round"),Z(this,"strokeMiterLimit",10),Z(this,"strokeDashArray",null),Z(this,"limitedToCanvasSize",!1),this.canvas=t}}let sm=["path","left","top"],sv=["d"];class sy extends iW{_setPath(t,e){this.path=nI(Array.isArray(t)?t:nJ(t)),this.setBoundingBox(e)}_findCenterFromElement(){let t=this._calcBoundsFromPath();return new tJ(t.left+t.width/2,t.top+t.height/2)}_renderPathCommands(t){let e=-this.pathOffset.x,r=-this.pathOffset.y;for(let i of(t.beginPath(),this.path))switch(i[0]){case"L":t.lineTo(i[1]+e,i[2]+r);break;case"M":t.moveTo(i[1]+e,i[2]+r);break;case"C":t.bezierCurveTo(i[1]+e,i[2]+r,i[3]+e,i[4]+r,i[5]+e,i[6]+r);break;case"Q":t.quadraticCurveTo(i[1]+e,i[2]+r,i[3]+e,i[4]+r);break;case"Z":t.closePath()}}_render(t){this._renderPathCommands(t),this._renderPaintInOrder(t)}toString(){return"#")}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return tt(tt({},super.toObject(t)),{},{path:this.path.map(t=>t.slice())})}toDatalessObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.toObject(t);return this.sourcePath&&(delete e.path,e.sourcePath=this.sourcePath),e}_toSVG(){let t=n$(this.path,tn.NUM_FRACTION_DIGITS);return["\n')]}_getOffsetTransform(){let t=tn.NUM_FRACTION_DIGITS;return" translate(".concat(eC(-this.pathOffset.x,t),", ").concat(eC(-this.pathOffset.y,t),")")}toClipPathSVG(t){let e=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})}toSVG(t){let e=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})}complexity(){return this.path.length}setDimensions(){this.setBoundingBox()}setBoundingBox(t){let{width:e,height:r,pathOffset:i}=this._calcDimensions();this.set({width:e,height:r,pathOffset:i}),t&&this.setPositionByOrigin(i,tw,tw)}_calcBoundsFromPath(){let t=[],e=0,r=0,i=0,n=0;for(let s of this.path)switch(s[0]){case"L":i=s[1],n=s[2],t.push({x:e,y:r},{x:i,y:n});break;case"M":i=s[1],n=s[2],e=i,r=n;break;case"C":t.push(...nL(i,n,s[1],s[2],s[3],s[4],s[5],s[6])),i=s[5],n=s[6];break;case"Q":t.push(...nL(i,n,s[1],s[2],s[1],s[2],s[3],s[4])),i=s[3],n=s[4];break;case"Z":i=e,n=r}return eH(t)}_calcDimensions(){let t=this._calcBoundsFromPath();return tt(tt({},t),{},{pathOffset:new tJ(t.left+t.width/2,t.top+t.height/2)})}static fromObject(t){return this._fromObject(t,{extraParam:"path"})}static async fromElement(t,e,r){let i=nh(t,this.ATTRIBUTE_NAMES,r),{d:n}=i;return new this(n,tt(tt(tt({},te(i,sv)),e),{},{left:void 0,top:void 0}))}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{path:r,left:i,top:n}=e,s=te(e,sm);super(),Object.assign(this,sy.ownDefaults),this.setOptions(s),this._setPath(t||[],!0),"number"==typeof i&&this.set(tC,i),"number"==typeof n&&this.set("top",n)}}Z(sy,"type","Path"),Z(sy,"cacheProperties",[...rY,"path","fillRule"]),Z(sy,"ATTRIBUTE_NAMES",[...i2,"d"]),tY.setClass(sy),tY.setSVGClass(sy);class sx extends sp{needsFullRender(){return super.needsFullRender()||this._hasStraightLine}static drawSegment(t,e,r){let i=e.midPointFrom(r);return t.quadraticCurveTo(e.x,e.y,i.x,i.y),i}onMouseDown(t,e){let{e:r}=e;this.canvas._isMainEvent(r)&&(this.drawStraightLine=!!this.straightLineKey&&r[this.straightLineKey],this._prepareForDrawing(t),this._addPoint(t),this._render())}onMouseMove(t,e){let{e:r}=e;if(this.canvas._isMainEvent(r)&&(this.drawStraightLine=!!this.straightLineKey&&r[this.straightLineKey],(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(t))&&this._addPoint(t)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{let t=this._points,e=t.length,r=this.canvas.contextTop;this._saveAndTransform(r),this.oldEnd&&(r.beginPath(),r.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=sx.drawSegment(r,t[e-2],t[e-1]),r.stroke(),r.restore()}}onMouseUp(t){let{e:e}=t;return!this.canvas._isMainEvent(e)||(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1)}_prepareForDrawing(t){this._reset(),this._addPoint(t),this.canvas.contextTop.moveTo(t.x,t.y)}_addPoint(t){return!(this._points.length>1&&t.eq(this._points[this._points.length-1]))&&(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(t),!0)}_reset(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1}_render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.canvas.contextTop,e=this._points[0],r=this._points[1];if(this._saveAndTransform(t),t.beginPath(),2===this._points.length&&e.x===r.x&&e.y===r.y){let t=this.width/1e3;e.x-=t,r.x+=t}t.moveTo(e.x,e.y);for(let i=1;i=i&&s.push(r=t[e]);return s.push(t[n]),s}_finalizeAndAddPath(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));let t=this.convertPointsToSVGPath(this._points);if("M 0 0 Q 0 0 0 0 L 0 0"===n$(t))return void this.canvas.requestRenderAll();let e=this.createPath(t);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:e}),this.canvas.add(e),this.canvas.requestRenderAll(),e.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:e})}constructor(t){super(t),Z(this,"decimate",.4),Z(this,"drawStraightLine",!1),Z(this,"straightLineKey","shiftKey"),this._points=[],this._hasStraightLine=!1}}let sb=["left","top","radius"],s_=["radius","startAngle","endAngle","counterClockwise"];class sw extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),sw.ownDefaults)}_set(t,e){return super._set(t,e),"radius"===t&&this.setRadius(e),this}_render(t){t.beginPath(),t.arc(0,0,this.radius,ee(this.startAngle),ee(this.endAngle),this.counterClockwise),this._renderPaintInOrder(t)}getRadiusX(){return this.get("radius")*this.get(tI)}getRadiusY(){return this.get("radius")*this.get(tB)}setRadius(t){this.radius=t,this.set({width:2*t,height:2*t})}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject([...s_,...t])}_toSVG(){let t=(this.endAngle-this.startAngle)%360;if(0===t)return["\n'];{let{radius:e}=this,r=ee(this.startAngle),i=ee(this.endAngle),n=tK(r)*e,s=tQ(r)*e,o=tK(i)*e,a=tQ(i)*e,l=+!this.counterClockwise;return['180)," ").concat(l," ").concat(o," ").concat(a,'" '),"COMMON_PARTS"," />\n"]}}static async fromElement(t,e,r){let i=nh(t,this.ATTRIBUTE_NAMES,r),{left:n=0,top:s=0,radius:o=0}=i;return new this(tt(tt({},te(i,sb)),{},{radius:o,left:n-o,top:s-o}))}static fromObject(t){return super._fromObject(t)}constructor(t){super(),Object.assign(this,sw.ownDefaults),this.setOptions(t)}}Z(sw,"type","Circle"),Z(sw,"cacheProperties",[...rY,...s_]),Z(sw,"ownDefaults",{radius:0,startAngle:0,endAngle:360,counterClockwise:!1}),Z(sw,"ATTRIBUTE_NAMES",["cx","cy","r",...i2]),tY.setClass(sw),tY.setSVGClass(sw);let sC=["x1","y1","x2","y2"],sS=["x1","y1","x2","y2"],sT=["x1","x2","y1","y2"];class sO extends iW{_setWidthHeight(){let{x1:t,y1:e,x2:r,y2:i}=this;this.width=Math.abs(r-t),this.height=Math.abs(i-e);let{left:n,top:s,width:o,height:a}=eH([{x:t,y:e},{x:r,y:i}]),l=new tJ(n+o/2,s+a/2);this.setPositionByOrigin(l,tw,tw)}_set(t,e){return super._set(t,e),sT.includes(t)&&this._setWidthHeight(),this}_render(t){var e;t.beginPath();let r=this.calcLinePoints();t.moveTo(r.x1,r.y1),t.lineTo(r.x2,r.y2),t.lineWidth=this.strokeWidth;let i=t.strokeStyle;eT(this.stroke)?t.strokeStyle=this.stroke.toLive(t):t.strokeStyle=null!=(e=this.stroke)?e:t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=i}_findCenterFromElement(){return new tJ((this.x1+this.x2)/2,(this.y1+this.y2)/2)}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return tt(tt({},super.toObject(t)),this.calcLinePoints())}_getNonTransformedDimensions(){let t=super._getNonTransformedDimensions();return"butt"===this.strokeLineCap&&(0===this.width&&(t.y-=this.strokeWidth),0===this.height&&(t.x-=this.strokeWidth)),t}calcLinePoints(){let{x1:t,x2:e,y1:r,y2:i,width:n,height:s}=this,o=t<=e?-1:1,a=r<=i?-1:1;return{x1:o*n/2,x2:-(o*n)/2,y1:a*s/2,y2:-(a*s)/2}}_toSVG(){let{x1:t,x2:e,y1:r,y2:i}=this.calcLinePoints();return["\n')]}static async fromElement(t,e,r){let i=nh(t,this.ATTRIBUTE_NAMES,r),{x1:n=0,y1:s=0,x2:o=0,y2:a=0}=i;return new this([n,s,o,a],te(i,sC))}static fromObject(t){let{x1:e,y1:r,x2:i,y2:n}=t,s=te(t,sS);return this._fromObject(tt(tt({},s),{},{points:[e,r,i,n]}),{extraParam:"points"})}constructor(){let[t,e,r,i]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Object.assign(this,sO.ownDefaults),this.setOptions(n),this.x1=t,this.x2=r,this.y1=e,this.y2=i,this._setWidthHeight();let{left:s,top:o}=n;"number"==typeof s&&this.set(tC,s),"number"==typeof o&&this.set("top",o)}}Z(sO,"type","Line"),Z(sO,"cacheProperties",[...rY,...sT]),Z(sO,"ATTRIBUTE_NAMES",i2.concat(sT)),tY.setClass(sO),tY.setSVGClass(sO);class sk extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),sk.ownDefaults)}_render(t){let e=this.width/2,r=this.height/2;t.beginPath(),t.moveTo(-e,r),t.lineTo(0,-r),t.lineTo(e,r),t.closePath(),this._renderPaintInOrder(t)}_toSVG(){let t=this.width/2,e=this.height/2;return["']}constructor(t){super(),Object.assign(this,sk.ownDefaults),this.setOptions(t)}}Z(sk,"type","Triangle"),Z(sk,"ownDefaults",{width:100,height:100}),tY.setClass(sk),tY.setSVGClass(sk);let sM=["rx","ry"];class sE extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),sE.ownDefaults)}_set(t,e){switch(super._set(t,e),t){case"rx":this.rx=e,this.set("width",2*e);break;case"ry":this.ry=e,this.set("height",2*e)}return this}getRx(){return this.get("rx")*this.get(tI)}getRy(){return this.get("ry")*this.get(tB)}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject([...sM,...t])}_toSVG(){return["\n')]}_render(t){t.beginPath(),t.save(),t.transform(1,0,0,this.ry/this.rx,0,0),t.arc(0,0,this.rx,0,tx,!1),t.restore(),this._renderPaintInOrder(t)}static async fromElement(t,e,r){let i=nh(t,this.ATTRIBUTE_NAMES,r);return i.left=(i.left||0)-i.rx,i.top=(i.top||0)-i.ry,new this(i)}constructor(t){super(),Object.assign(this,sE.ownDefaults),this.setOptions(t)}}Z(sE,"type","Ellipse"),Z(sE,"cacheProperties",[...rY,...sM]),Z(sE,"ownDefaults",{rx:0,ry:0}),Z(sE,"ATTRIBUTE_NAMES",[...i2,"cx","cy","rx","ry"]),tY.setClass(sE),tY.setSVGClass(sE);let sD=["left","top"],sj={exactBoundingBox:!1};class sA extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),sA.ownDefaults)}isOpen(){return!0}_projectStrokeOnPoints(t){return iz(this.points,t,this.isOpen())}_calcDimensions(t){t=tt({scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,strokeLineCap:this.strokeLineCap,strokeLineJoin:this.strokeLineJoin,strokeMiterLimit:this.strokeMiterLimit,strokeUniform:this.strokeUniform,strokeWidth:this.strokeWidth},t||{});let e=this.exactBoundingBox?this._projectStrokeOnPoints(t).map(t=>t.projectedPoint):this.points;if(0===e.length)return{left:0,top:0,width:0,height:0,pathOffset:new tJ,strokeOffset:new tJ,strokeDiff:new tJ};let r=eH(e),i=em(tt(tt({},t),{},{scaleX:1,scaleY:1})),n=eH(this.points.map(t=>en(t,i,!0))),s=new tJ(this.scaleX,this.scaleY),o=r.left+r.width/2,a=r.top+r.height/2;return this.exactBoundingBox&&(o-=a*Math.tan(ee(this.skewX)),a-=o*Math.tan(ee(this.skewY))),tt(tt({},r),{},{pathOffset:new tJ(o,a),strokeOffset:new tJ(n.left,n.top).subtract(new tJ(r.left,r.top)).multiply(s),strokeDiff:new tJ(r.width,r.height).subtract(new tJ(n.width,n.height)).multiply(s)})}_findCenterFromElement(){let t=eH(this.points);return new tJ(t.left+t.width/2,t.top+t.height/2)}setDimensions(){this.setBoundingBox()}setBoundingBox(t){let{left:e,top:r,width:i,height:n,pathOffset:s,strokeOffset:o,strokeDiff:a}=this._calcDimensions();this.set({width:i,height:n,pathOffset:s,strokeOffset:o,strokeDiff:a}),t&&this.setPositionByOrigin(new tJ(e+i/2,r+n/2),tw,tw)}isStrokeAccountedForInDimensions(){return this.exactBoundingBox}_getNonTransformedDimensions(){return this.exactBoundingBox?new tJ(this.width,this.height):super._getNonTransformedDimensions()}_getTransformedDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.exactBoundingBox){var e,r,i,n;let s;if(Object.keys(t).some(t=>this.strokeUniform||this.constructor.layoutProperties.includes(t))){let{width:i,height:n}=this._calcDimensions(t);s=new tJ(null!=(e=t.width)?e:i,null!=(r=t.height)?r:n)}else s=new tJ(null!=(i=t.width)?i:this.width,null!=(n=t.height)?n:this.height);return s.multiply(new tJ(t.scaleX||this.scaleX,t.scaleY||this.scaleY))}return super._getTransformedDimensions(t)}_set(t,e){let r=this.initialized&&this[t]!==e,i=super._set(t,e);return this.exactBoundingBox&&r&&((t===tI||t===tB)&&this.strokeUniform&&this.constructor.layoutProperties.includes("strokeUniform")||this.constructor.layoutProperties.includes(t))&&this.setDimensions(),i}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return tt(tt({},super.toObject(t)),{},{points:this.points.map(t=>{let{x:e,y:r}=t;return{x:e,y:r}})})}_toSVG(){let t=[],e=this.pathOffset.x,r=this.pathOffset.y,i=tn.NUM_FRACTION_DIGITS;for(let n=0,s=this.points.length;n\n')]}_render(t){let e=this.points.length,r=this.pathOffset.x,i=this.pathOffset.y;if(e&&!isNaN(this.points[e-1].y)){t.beginPath(),t.moveTo(this.points[0].x-r,this.points[0].y-i);for(let n=0;n0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Z(this,"strokeDiff",void 0),Object.assign(this,sA.ownDefaults),this.setOptions(e),this.points=t;let{left:r,top:i}=e;this.initialized=!0,this.setBoundingBox(!0),"number"==typeof r&&this.set(tC,r),"number"==typeof i&&this.set("top",i)}}Z(sA,"ownDefaults",sj),Z(sA,"type","Polyline"),Z(sA,"layoutProperties",[tN,tW,"strokeLineCap","strokeLineJoin","strokeMiterLimit","strokeWidth","strokeUniform","points"]),Z(sA,"cacheProperties",[...rY,"points"]),Z(sA,"ATTRIBUTE_NAMES",[...i2]),tY.setClass(sA),tY.setSVGClass(sA);class sP extends sA{isOpen(){return!1}}Z(sP,"ownDefaults",sj),Z(sP,"type","Polygon"),tY.setClass(sP),tY.setSVGClass(sP);class sF extends iW{isEmptyStyles(t){if(!this.styles||void 0!==t&&!this.styles[t])return!0;let e=void 0===t?this.styles:{line:this.styles[t]};for(let t in e)for(let r in e[t])for(let i in e[t][r])return!1;return!0}styleHas(t,e){if(!this.styles||void 0!==e&&!this.styles[e])return!1;let r=void 0===e?this.styles:{0:this.styles[e]};for(let e in r)for(let i in r[e])if(void 0!==r[e][i][t])return!0;return!1}cleanStyle(t){if(!this.styles)return!1;let e=this.styles,r,i,n=0,s=!0,o=0;for(let o in e){for(let a in r=0,e[o]){let l=e[o][a]||{};n++,void 0!==l[t]?(i?l[t]!==i&&(s=!1):i=l[t],l[t]===this[t]&&delete l[t]):s=!1,0!==Object.keys(l).length?r++:delete e[o][a]}0===r&&delete e[o]}for(let t=0;tvoid 0!==t);this._setStyleDeclaration(r,i,n)}getSelectionStyles(t,e,r){let i=[];for(let n=t;n<(e||t);n++)i.push(this.getStyleAtPosition(n,r));return i}getStyleAtPosition(t,e){let{lineIndex:r,charIndex:i}=this.get2DCursorLocation(t);return e?this.getCompleteStyleDeclaration(r,i):this._getStyleDeclaration(r,i)}setSelectionStyles(t,e,r){for(let i=e;i<(r||e);i++)this._extendStyles(i,t);this._forceClearCache=!0}_getStyleDeclaration(t,e){var r;let i=this.styles&&this.styles[t];return i&&null!=(r=i[e])?r:{}}getCompleteStyleDeclaration(t,e){return tt(tt({},e_(this,this.constructor._styleProperties)),this._getStyleDeclaration(t,e))}_setStyleDeclaration(t,e,r){this.styles[t][e]=r}_deleteStyleDeclaration(t,e){delete this.styles[t][e]}_getLineStyle(t){return!!this.styles[t]}_setLineStyle(t){this.styles[t]={}}_deleteLineStyle(t){delete this.styles[t]}}Z(sF,"_styleProperties",rm);let sL=/ +/g,sR=/"/g;function sI(t,e,r,i,n){return" ".concat(function(t,e){let{left:r,top:i,width:n,height:s}=e,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tn.NUM_FRACTION_DIGITS,a=rl(tU,t,!1),[l,h,c,u]=[r,i,n,s].map(t=>eC(t,o));return"')}(t,{left:e,top:r,width:i,height:n}),"\n")}let sB=["textAnchor","textDecoration","dx","dy","top","left","fontSize","strokeWidth"];class sN extends sF{static getDefaults(){return tt(tt({},super.getDefaults()),sN.ownDefaults)}setPathInfo(){let t=this.path;t&&(t.segmentsInfo=nY(t.path))}_splitText(){let t=this._splitTextIntoLines(this.text);return this.textLines=t.lines,this._textLines=t.graphemeLines,this._unwrappedTextLines=t._unwrappedLines,this._text=t.graphemeText,t}initDimensions(){this._splitText(),this._clearCache(),this.dirty=!0,this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),this.textAlign.includes(rv)&&this.enlargeSpaces()}enlargeSpaces(){let t,e,r,i,n,s,o;for(let a=0,l=this._textLines.length;a')}_getCacheCanvasDimensions(){let t=super._getCacheCanvasDimensions(),e=this.fontSize;return t.width+=e*t.zoomX,t.height+=e*t.zoomY,t}_render(t){let e=this.path;e&&!e.isNotVisible()&&e._render(t),this._setTextStyles(t),this._renderTextLinesBackground(t),this._renderTextDecoration(t,"underline"),this._renderText(t),this._renderTextDecoration(t,"overline"),this._renderTextDecoration(t,"linethrough")}_renderText(t){this.paintFirst===tH?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))}_setTextStyles(t,e,r){if(t.textBaseline="alphabetic",this.path)switch(this.pathAlign){case tw:t.textBaseline="middle";break;case"ascender":t.textBaseline="top";break;case"descender":t.textBaseline=tS}t.font=this._getFontDeclaration(e,r)}calcTextWidth(){let t=this.getLineWidth(0);for(let e=1,r=this._textLines.length;et&&(t=r)}return t}_renderTextLine(t,e,r,i,n,s){this._renderChars(t,e,r,i,n,s)}_renderTextLinesBackground(t){if(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))return;let e=t.fillStyle,r=this._getLeftOffset(),i=this._getTopOffset();for(let e=0,n=this._textLines.length;e=0:ie?t%=e:t<0&&(t+=e),this._setGraphemeOnPath(t,r),t+=r.kernedWidth}return{width:i,numOfSpaces:0}}_setGraphemeOnPath(t,e){let r=t+e.kernedWidth/2,i=this.path,n=nz(i.path,r,i.segmentsInfo);e.renderLeft=n.x-i.pathOffset.x,e.renderTop=n.y-i.pathOffset.y,e.angle=n.angle+(this.pathSide===tT?Math.PI:0)}_getGraphemeBox(t,e,r,i,n){let s=this.getCompleteStyleDeclaration(e,r),o=i?this.getCompleteStyleDeclaration(e,r-1):{},a=this._measureChar(t,s,i,o),l,h=a.kernedWidth,c=a.width;0!==this.charSpacing&&(c+=l=this._getWidthOfCharSpacing(),h+=l);let u={width:c,left:0,height:s.fontSize,kernedWidth:h,deltaY:s.deltaY};if(r>0&&!n){let t=this.__charBounds[e][r-1];u.left=t.left+t.width+a.kernedWidth-a.width}return u}getHeightOfLine(t){if(this.__lineHeights[t])return this.__lineHeights[t];let e=this.getHeightOfChar(t,0);for(let r=1,i=this._textLines[t].length;r0){let e=this.fontSize*y/1e3,r=i+d+f;"rtl"===this.direction&&(r=this.width-r-g),p&&m&&y&&(t.fillStyle=m,t.fillRect(r,w+a*C+S-o*e,g,e)),f=s.left,g=s.width,p=x,y=_,m=b,C=h,S=c}else g+=s.kernedWidth}let T=i+d+f;"rtl"===this.direction&&(T=this.width-T-g),t.fillStyle=b;let O=this.fontSize*_/1e3;x&&b&&_&&t.fillRect(T,w+a*C+S-o*O,g-s,O),r+=h}this._removeShadow(t)}_getFontDeclaration(){let{fontFamily:t=this.fontFamily,fontStyle:e=this.fontStyle,fontWeight:r=this.fontWeight,fontSize:i=this.fontSize}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,s=t.includes("'")||t.includes('"')||t.includes(",")||sN.genericFonts.includes(t.toLowerCase())?t:'"'.concat(t,'"');return[e,r,"".concat(n?this.CACHE_FONT_SIZE:i,"px"),s].join(" ")}render(t){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._forceClearCache&&this.initDimensions(),super.render(t)))}graphemeSplit(t){return iK(t)}_splitTextIntoLines(t){let e=t.split(this._reNewline),r=Array(e.length),i=["\n"],n=[];for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:[];return tt(tt({},super.toObject([...rp,...t])),{},{styles:i0(this.styles,this.text)},this.path?{path:this.path.toObject()}:{})}set(t,e){let{textLayoutProperties:r}=this.constructor;super.set(t,e);let i=!1,n=!1;if("object"==typeof t)for(let e in t)"path"===e&&this.setPathInfo(),i=i||r.includes(e),n=n||"path"===e;else i=r.includes(t),n="path"===t;return n&&this.setPathInfo(),i&&this.initialized&&(this.initDimensions(),this.setCoords()),this}complexity(){return 1}static async fromElement(t,e,r){let i=nh(t,sN.ATTRIBUTE_NAMES,r),n=tt(tt({},e),i),{textAnchor:s=tC,textDecoration:o="",dx:a=0,dy:l=0,top:h=0,left:c=0,fontSize:u=16,strokeWidth:d=1}=n,f=te(n,sB),g=new this((t.textContent||"").replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," "),tt({left:c+a,top:h+l,underline:o.includes("underline"),overline:o.includes("overline"),linethrough:o.includes("line-through"),strokeWidth:0,fontSize:u},f)),p=g.getScaledHeight()/g.height,m=((g.height+g.strokeWidth)*g.lineHeight-g.height)*p,y=g.getScaledHeight()+m,x=0;return s===tw&&(x=g.getScaledWidth()/2),s===tT&&(x=g.getScaledWidth()),g.set({left:g.left-x,top:g.top-(y-g.fontSize*(.07+g._fontSizeFraction))/g.lineHeight,strokeWidth:d}),g}static fromObject(t){return this._fromObject(tt(tt({},t),{},{styles:i1(t.styles||{},t.text)}),{extraParam:"text"})}constructor(t,e){super(),Z(this,"__charBounds",[]),Object.assign(this,sN.ownDefaults),this.setOptions(e),this.styles||(this.styles={}),this.text=t,this.initialized=!0,this.path&&this.setPathInfo(),this.initDimensions(),this.setCoords()}}Z(sN,"textLayoutProperties",rg),Z(sN,"cacheProperties",[...rY,...rp]),Z(sN,"ownDefaults",{_reNewline:tk,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:tC,fontStyle:"normal",lineHeight:1.16,textBackgroundColor:"",stroke:null,shadow:null,path:void 0,pathStartOffset:0,pathSide:tC,pathAlign:"baseline",charSpacing:0,deltaY:0,direction:"ltr",CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.28167,overline:-.81333},_fontSizeMult:1.13,[ru]:66.667}),Z(sN,"type","Text"),Z(sN,"genericFonts",["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]),Z(sN,"ATTRIBUTE_NAMES",i2.concat("x","y","dx","dy","font-family","font-style","font-weight","font-size","letter-spacing","text-decoration","text-anchor")),iN(sN,[class extends rh{_toSVG(){let t=this._getSVGLeftTopOffsets(),e=this._getSVGTextAndBg(t.textTop,t.textLeft);return this._wrapSVGTextAndBg(e)}toSVG(t){let e=this._createBaseSVGMarkup(this._toSVG(),{reviver:t,noStyle:!0,withShadow:!0}),r=this.path;return r?e+r._createBaseSVGMarkup(r._toSVG(),{reviver:t,withShadow:!0,additionalTransform:eS(this.calcOwnMatrix())}):e}_getSVGLeftTopOffsets(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}}_wrapSVGTextAndBg(t){let{textBgRects:e,textSpans:r}=t,i=this.getSvgTextDecoration(this);return[e.join(""),' ",r.join(""),"\n"]}_getSVGTextAndBg(t,e){let r=[],i=[],n,s=t;this.backgroundColor&&i.push(...sI(this.backgroundColor,-this.width/2,-this.height/2,this.width,this.height));for(let t=0,o=this._textLines.length;t").concat(iq(t),"")}_setSVGTextLineText(t,e,r,i){let n=this.getHeightOfLine(e),s=this.textAlign.includes(rv),o=this._textLines[e],a,l,h,c,u,d="",f=0;i+=n*(1-this._fontSizeFraction)/this.lineHeight;for(let n=0,g=o.length-1;n<=g;n++)u=n===g||this.charSpacing||this.path,d+=o[n],h=this.__charBounds[e][n],0===f?(r+=h.kernedWidth-h.width,f+=h.width):f+=h.kernedWidth,s&&!u&&this._reSpaceAndTab.test(o[n])&&(u=!0),u||(u=i$(a=a||this.getCompleteStyleDeclaration(e,n),l=this.getCompleteStyleDeclaration(e,n+1),!0)),u&&(c=this._getStyleDeclaration(e,n),t.push(this._createTextCharSpan(d,c,r,i,h)),d="",a=l,"rtl"===this.direction?r-=f:r+=f,f=0)}_setSVGTextLineBg(t,e,r,i){let n=this._textLines[e],s=this.getHeightOfLine(e)/this.lineHeight,o,a=0,l=0,h=this.getValueOfPropertyAt(e,0,"textBackgroundColor");for(let c=0;ct[e.replace("-","")]).join(" ")}}]),tY.setClass(sN),tY.setSVGClass(sN);class sW{isPointerOverSelection(t){let e=this.target,r=e.getSelectionStartFromPointer(t);return e.isEditing&&r>=e.selectionStart&&r<=e.selectionEnd&&e.selectionStart{b.remove()},eD(t.target||this.target.hiddenTextarea).body.appendChild(b),null==(r=t.dataTransfer)||r.setDragImage(b,p.x,p.y)}onDragStart(t){this.__dragStartFired=!0;let e=this.target,r=this.isActive();if(r&&t.dataTransfer){let r=this.__dragStartSelection={selectionStart:e.selectionStart,selectionEnd:e.selectionEnd},i=e._text.slice(r.selectionStart,r.selectionEnd).join(""),n=tt({text:e.text,value:i},r);t.dataTransfer.setData("text/plain",i),t.dataTransfer.setData("application/fabric",JSON.stringify({value:i,styles:e.getSelectionStyles(r.selectionStart,r.selectionEnd,!0)})),t.dataTransfer.effectAllowed="copyMove",this.setDragImage(t,n)}return e.abortCursorAnimation(),r}canDrop(t){if(this.target.editable&&!this.target.getActiveControl()&&!t.defaultPrevented){if(this.isActive()&&this.__dragStartSelection){let e=this.target.getSelectionStartFromPointer(t),r=this.__dragStartSelection;return er.selectionEnd}return!0}return!1}targetCanDrop(t){return this.target.canDrop(t)}dragEnterHandler(t){let{e:e}=t,r=this.targetCanDrop(e);!this.__isDraggingOver&&r&&(this.__isDraggingOver=!0)}dragOverHandler(t){let{e:e}=t,r=this.targetCanDrop(e);!this.__isDraggingOver&&r?this.__isDraggingOver=!0:this.__isDraggingOver&&!r&&(this.__isDraggingOver=!1),this.__isDraggingOver&&(e.preventDefault(),t.canDrop=!0,t.dropTarget=this.target)}dragLeaveHandler(){(this.__isDraggingOver||this.isActive())&&(this.__isDraggingOver=!1)}dropHandler(t){var e;let{e:r}=t,i=r.defaultPrevented;this.__isDraggingOver=!1,r.preventDefault();let n=null==(e=r.dataTransfer)?void 0:e.getData("text/plain");if(n&&!i){let e=this.target,i=e.canvas,s=e.getSelectionStartFromPointer(r),{styles:o}=r.dataTransfer.types.includes("application/fabric")?JSON.parse(r.dataTransfer.getData("application/fabric")):{},a=n[Math.max(0,n.length-1)];if(this.__dragStartSelection){let t=this.__dragStartSelection.selectionStart,r=this.__dragStartSelection.selectionEnd;s>t&&s<=r?s=t:s>r&&(s-=r-t),e.removeChars(t,r),delete this.__dragStartSelection}e._reNewline.test(a)&&(e._reNewline.test(e._text[s])||s===e._text.length)&&(n=n.trimEnd()),t.didDrop=!0,t.dropTarget=e,e.insertChars(n,o,s),i.setActiveObject(e),e.enterEditing(r),e.selectionStart=Math.min(s+0,e._text.length),e.selectionEnd=Math.min(e.selectionStart+n.length,e._text.length),e.hiddenTextarea.value=e.text,e._updateTextarea(),e.hiddenTextarea.focus(),e.fire(tL,{index:s+0,action:"drop"}),i.fire("text:changed",{target:e}),i.contextTopDirty=!0,i.requestRenderAll()}}dragEndHandler(t){let{e:e}=t;if(this.isActive()&&this.__dragStartFired&&this.__dragStartSelection){var r;let t=this.target,i=this.target.canvas,{selectionStart:n,selectionEnd:s}=this.__dragStartSelection,o=(null==(r=e.dataTransfer)?void 0:r.dropEffect)||tO;o===tO?(t.selectionStart=n,t.selectionEnd=s,t._updateTextarea(),t.hiddenTextarea.focus()):(t.clearContextTop(),"move"===o&&(t.removeChars(n,s),t.selectionStart=t.selectionEnd=n,t.hiddenTextarea&&(t.hiddenTextarea.value=t.text),t._updateTextarea(),t.fire(tL,{index:n,action:"dragend"}),i.fire("text:changed",{target:t}),i.requestRenderAll()),t.exitEditing())}this.__dragImageDisposer&&this.__dragImageDisposer(),delete this.__dragImageDisposer,delete this.__dragStartSelection,this.__isDraggingOver=!1}dispose(){this._dispose&&this._dispose()}constructor(t){Z(this,"target",void 0),Z(this,"__mouseDownInPlace",!1),Z(this,"__dragStartFired",!1),Z(this,"__isDraggingOver",!1),Z(this,"__dragStartSelection",void 0),Z(this,"__dragImageDisposer",void 0),Z(this,"_dispose",void 0),this.target=t;let e=[this.target.on("dragenter",this.dragEnterHandler.bind(this)),this.target.on("dragover",this.dragOverHandler.bind(this)),this.target.on("dragleave",this.dragLeaveHandler.bind(this)),this.target.on("dragend",this.dragEndHandler.bind(this)),this.target.on("drop",this.dropHandler.bind(this))];this._dispose=()=>{e.forEach(t=>t()),this._dispose=void 0}}}let sU=/[ \n\.,;!\?\-]/;class sH extends sN{initBehavior(){this._tick=this._tick.bind(this),this._onTickComplete=this._onTickComplete.bind(this),this.updateSelectionOnMouseMove=this.updateSelectionOnMouseMove.bind(this)}onDeselect(t){return this.isEditing&&this.exitEditing(),this.selected=!1,super.onDeselect(t)}_animateCursor(t){let{toValue:e,duration:r,delay:i,onComplete:n}=t;return r8({startValue:this._currentCursorOpacity,endValue:e,duration:r,delay:i,onComplete:n,abort:()=>!this.canvas||this.selectionStart!==this.selectionEnd,onChange:t=>{this._currentCursorOpacity=t,this.renderCursorOrSelection()}})}_tick(t){this._currentTickState=this._animateCursor({toValue:0,duration:this.cursorDuration/2,delay:Math.max(t||0,100),onComplete:this._onTickComplete})}_onTickComplete(){var t;null==(t=this._currentTickCompleteState)||t.abort(),this._currentTickCompleteState=this._animateCursor({toValue:1,duration:this.cursorDuration,onComplete:this._tick})}initDelayedCursor(t){this.abortCursorAnimation(),this._tick(t?0:this.cursorDelay)}abortCursorAnimation(){let t=!1;[this._currentTickState,this._currentTickCompleteState].forEach(e=>{e&&!e.isDone()&&(t=!0,e.abort())}),this._currentCursorOpacity=1,t&&this.clearContextTop()}restartCursorIfNeeded(){[this._currentTickState,this._currentTickCompleteState].some(t=>!t||t.isDone())&&this.initDelayedCursor()}selectAll(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this}cmdAll(){this.selectAll(),this.renderCursorOrSelection()}getSelectedText(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")}findWordBoundaryLeft(t){let e=0,r=t-1;if(this._reSpace.test(this._text[r]))for(;this._reSpace.test(this._text[r]);)e++,r--;for(;/\S/.test(this._text[r])&&r>-1;)e++,r--;return t-e}findWordBoundaryRight(t){let e=0,r=t;if(this._reSpace.test(this._text[r]))for(;this._reSpace.test(this._text[r]);)e++,r++;for(;/\S/.test(this._text[r])&&r-1;)e++,r--;return t-e}findLineBoundaryRight(t){let e=0,r=t;for(;!/\n/.test(this._text[r])&&r0&&this._reSpace.test(r[t])&&(-1===e||!tk.test(r[t-1]))?t-1:t,n=r[i];for(;i>0&&ithis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=r):(this.selectionStart=r,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===n||(this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}_setEditingProps(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0}fromStringToGraphemeSelection(t,e,r){let i=r.slice(0,t),n=this.graphemeSplit(i).length;if(t===e)return{selectionStart:n,selectionEnd:n};let s=r.slice(t,e);return{selectionStart:n,selectionEnd:n+this.graphemeSplit(s).length}}fromGraphemeToStringSelection(t,e,r){let i=r.slice(0,t).join("").length;return t===e?{selectionStart:i,selectionEnd:i}:{selectionStart:i,selectionEnd:i+r.slice(t,e).join("").length}}_updateTextarea(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){let t=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=t.selectionStart,this.hiddenTextarea.selectionEnd=t.selectionEnd}this.updateTextareaPosition()}}updateFromTextArea(){if(!this.hiddenTextarea)return;this.cursorOffsetCache={};let t=this.hiddenTextarea;this.text=t.value,this.set("dirty",!0),this.initDimensions(),this.setCoords();let e=this.fromStringToGraphemeSelection(t.selectionStart,t.selectionEnd,t.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}updateTextareaPosition(){if(this.selectionStart===this.selectionEnd){let t=this._calcTextareaPosition();this.hiddenTextarea.style.left=t.left,this.hiddenTextarea.style.top=t.top}}_calcTextareaPosition(){if(!this.canvas)return{left:"1px",top:"1px"};let t=this.inCompositionMode?this.compositionStart:this.selectionStart,e=this._getCursorBoundaries(t),r=this.get2DCursorLocation(t),i=r.lineIndex,n=r.charIndex,s=this.getValueOfPropertyAt(i,n,"fontSize")*this.lineHeight,o=e.leftOffset,a=this.getCanvasRetinaScaling(),l=this.canvas.upperCanvasEl,h=l.width/a,c=l.height/a,u=h-s,d=c-s,f=new tJ(e.left+o,e.top+e.topOffset+s).transform(this.calcTransformMatrix()).transform(this.canvas.viewportTransform).multiply(new tJ(l.clientWidth/h,l.clientHeight/c));return f.x<0&&(f.x=0),f.x>u&&(f.x=u),f.y<0&&(f.y=0),f.y>d&&(f.y=d),f.x+=this.canvas._offset.left,f.y+=this.canvas._offset.top,{left:"".concat(f.x,"px"),top:"".concat(f.y,"px"),fontSize:"".concat(s,"px"),charHeight:s}}_saveEditingProps(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}}_restoreEditingProps(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor||this.canvas.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor||this.canvas.moveCursor),delete this._savedProps)}_exitEditing(){let t=this.hiddenTextarea;this.selected=!1,this.isEditing=!1,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this.selectionStart!==this.selectionEnd&&this.clearContextTop()}exitEditingImpl(){this._exitEditing(),this.selectionEnd=this.selectionStart,this._restoreEditingProps(),this._forceClearCache&&(this.initDimensions(),this.setCoords())}exitEditing(){let t=this._textBeforeEdit!==this.text;return this.exitEditingImpl(),this.fire("editing:exited"),t&&this.fire(tX),this.canvas&&(this.canvas.fire("text:editing:exited",{target:this}),t&&this.canvas.fire("object:modified",{target:this})),this}_removeExtraneousStyles(){for(let t in this.styles)this._textLines[t]||delete this.styles[t]}removeStyleFromTo(t,e){let{lineIndex:r,charIndex:i}=this.get2DCursorLocation(t,!0),{lineIndex:n,charIndex:s}=this.get2DCursorLocation(e,!0);if(r!==n){if(this.styles[r])for(let t=i;t=s&&(t[r-e]=t[i],delete t[i])}}}shiftLineStyles(t,e){let r=Object.assign({},this.styles);for(let i in this.styles){let n=parseInt(i,10);n>t&&(this.styles[n+e]=r[n],r[n-e]||delete this.styles[n])}}insertNewlineStyleObject(t,e,r,i){let n={},s=this._unwrappedTextLines[t].length,o=s===e,a=!1;r||(r=1),this.shiftLineStyles(t,r);let l=this.styles[t]?this.styles[t][0===e?e:e-1]:void 0;for(let r in this.styles[t]){let i=parseInt(r,10);i>=e&&(a=!0,n[i-e]=this.styles[t][r],o&&0===e||delete this.styles[t][r])}let h=!1;for(a&&!o&&(this.styles[t+r]=n,h=!0),(h||s>e)&&r--;r>0;)i&&i[r-1]?this.styles[t+r]={0:tt({},i[r-1])}:l?this.styles[t+r]={0:tt({},l)}:delete this.styles[t+r],r--;this._forceClearCache=!0}insertCharStyleObject(t,e,r,i){this.styles||(this.styles={});let n=this.styles[t],s=n?tt({},n):{};for(let t in r||(r=1),s){let i=parseInt(t,10);i>=e&&(n[i+r]=s[i],s[i-r]||delete n[i])}if(this._forceClearCache=!0,i){for(;r--;)Object.keys(i[r]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][e+r]=tt({},i[r]));return}if(!n)return;let o=n[e?e-1:1];for(;o&&r--;)this.styles[t][e+r]=tt({},o)}insertNewStyleBlock(t,e,r){let i=this.get2DCursorLocation(e,!0),n=[0],s,o=0;for(let e=0;e0&&(this.insertCharStyleObject(i.lineIndex,i.charIndex,n[0],r),r=r&&r.slice(n[0]+1)),o&&this.insertNewlineStyleObject(i.lineIndex,i.charIndex+n[0],o),s=1;s0?this.insertCharStyleObject(i.lineIndex+s,0,n[s],r):r&&this.styles[i.lineIndex+s]&&r[0]&&(this.styles[i.lineIndex+s][0]=r[0]),r=r&&r.slice(n[s]+1);n[s]>0&&this.insertCharStyleObject(i.lineIndex+s,0,n[s],r)}removeChars(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t+1;this.removeStyleFromTo(t,e),this._text.splice(t,e-t),this.text=this._text.join(""),this.set("dirty",!0),this.initDimensions(),this.setCoords(),this._removeExtraneousStyles()}insertChars(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;i>r&&this.removeStyleFromTo(r,i);let n=this.graphemeSplit(t);this.insertNewStyleBlock(n,r,e),this._text=[...this._text.slice(0,r),...n,...this._text.slice(i)],this.text=this._text.join(""),this.set("dirty",!0),this.initDimensions(),this.setCoords(),this._removeExtraneousStyles()}setSelectionStartEndWithShift(t,e,r){r<=t?(e===t?this._selectionDirection=tC:this._selectionDirection===tT&&(this._selectionDirection=tC,this.selectionEnd=t),this.selectionStart=r):r>t&&r{let[r,i]=t;return e.setAttribute(r,i)});let{top:r,left:i,fontSize:n}=this._calcTextareaPosition();e.style.cssText="position: absolute; top: ".concat(r,"; left: ").concat(i,"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: ").concat(n,";"),(this.hiddenTextareaContainer||t.body).appendChild(e),Object.entries({blur:"blur",keydown:"onKeyDown",keyup:"onKeyUp",input:"onInput",copy:"copy",cut:"copy",paste:"paste",compositionstart:"onCompositionStart",compositionupdate:"onCompositionUpdate",compositionend:"onCompositionEnd"}).map(t=>{let[r,i]=t;return e.addEventListener(r,this[i].bind(this))}),this.hiddenTextarea=e}blur(){this.abortCursorAnimation()}onKeyDown(t){if(!this.isEditing)return;let e="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(t.keyCode in e)this[e[t.keyCode]](t);else{if(!(t.keyCode in this.ctrlKeysMapDown)||!t.ctrlKey&&!t.metaKey)return;this[this.ctrlKeysMapDown[t.keyCode]](t)}t.stopImmediatePropagation(),t.preventDefault(),t.keyCode>=33&&t.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}onKeyUp(t){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:t.keyCode in this.ctrlKeysMapUp&&(t.ctrlKey||t.metaKey)&&(this[this.ctrlKeysMapUp[t.keyCode]](t),t.stopImmediatePropagation(),t.preventDefault(),this.canvas&&this.canvas.requestRenderAll())}onInput(t){let e=this.fromPaste,{value:r,selectionStart:i,selectionEnd:n}=this.hiddenTextarea;if(this.fromPaste=!1,t&&t.stopPropagation(),!this.isEditing)return;let s=()=>{this.updateFromTextArea(),this.fire(tL),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())};if(""===this.hiddenTextarea.value)return this.styles={},void s();let o=this._splitTextIntoLines(r).graphemeText,a=this._text.length,l=o.length,h=this.selectionStart,c=this.selectionEnd,u=h!==c,d,f,g,p,m=l-a,y=this.fromStringToGraphemeSelection(i,n,r),x=h>y.selectionStart;u?(f=this._text.slice(h,c),m+=c-h):ld[0])),u?(g=h,p=c):x?(g=c-f.length,p=c):(g=c,p=c+f.length),this.removeStyleFromTo(g,p)),b.length){let{copyPasteData:t}=tu();e&&b.join("")===t.copiedText&&!tn.disableStyleCopyPaste&&(d=t.copiedTextStyle),this.insertNewStyleBlock(b,h,d)}s()}onCompositionStart(){this.inCompositionMode=!0}onCompositionEnd(){this.inCompositionMode=!1}onCompositionUpdate(t){let{target:e}=t,{selectionStart:r,selectionEnd:i}=e;this.compositionStart=r,this.compositionEnd=i,this.updateTextareaPosition()}copy(){if(this.selectionStart===this.selectionEnd)return;let{copyPasteData:t}=tu();t.copiedText=this.getSelectedText(),tn.disableStyleCopyPaste?t.copiedTextStyle=void 0:t.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0}paste(){this.fromPaste=!0}_getWidthBeforeCursor(t,e){let r,i=this._getLineLeftOffset(t);return e>0&&(i+=(r=this.__charBounds[t][e-1]).left+r.width),i}getDownCursorOffset(t,e){let r=this._getSelectionForOffset(t,e),i=this.get2DCursorLocation(r),n=i.lineIndex;if(n===this._textLines.length-1||t.metaKey||34===t.keyCode)return this._text.length-r;let s=i.charIndex,o=this._getWidthBeforeCursor(n,s),a=this._getIndexOnLine(n+1,o);return this._textLines[n].slice(s).length+a+1+this.missingNewlineOffset(n)}_getSelectionForOffset(t,e){return t.shiftKey&&this.selectionStart!==this.selectionEnd&&e?this.selectionEnd:this.selectionStart}getUpCursorOffset(t,e){let r=this._getSelectionForOffset(t,e),i=this.get2DCursorLocation(r),n=i.lineIndex;if(0===n||t.metaKey||33===t.keyCode)return-r;let s=i.charIndex,o=this._getWidthBeforeCursor(n,s),a=this._getIndexOnLine(n-1,o),l=this._textLines[n].slice(0,s),h=this.missingNewlineOffset(n-1);return-this._textLines[n-1].length+a-l.length+(1-h)}_getIndexOnLine(t,e){let r=this._textLines[t],i,n,s=this._getLineLeftOffset(t),o=0;for(let a=0,l=r.length;ae){n=!0;let t=Math.abs(s-i-e);o=Math.abs(s-e)=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",t)}moveCursorUp(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",t)}_moveCursorUpOrDown(t,e){let r=this["get".concat(t,"CursorOffset")](e,this._selectionDirection===tT);if(e.shiftKey?this.moveCursorWithShift(r):this.moveCursorWithoutShift(r),0!==r){let t=this.text.length;this.selectionStart=rX(0,this.selectionStart,t),this.selectionEnd=rX(0,this.selectionEnd,t),this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea()}}moveCursorWithShift(t){let e=this._selectionDirection===tC?this.selectionStart+t:this.selectionEnd+t;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,e),0!==t}moveCursorWithoutShift(t){return t<0?(this.selectionStart+=t,this.selectionEnd=this.selectionStart):(this.selectionEnd+=t,this.selectionStart=this.selectionEnd),0!==t}moveCursorLeft(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",t)}_move(t,e,r){let i;if(t.altKey)i=this["findWordBoundary".concat(r)](this[e]);else{if(!t.metaKey&&35!==t.keyCode&&36!==t.keyCode)return this[e]+="Left"===r?-1:1,!0;i=this["findLineBoundary".concat(r)](this[e])}return void 0!==i&&this[e]!==i&&(this[e]=i,!0)}_moveLeft(t,e){return this._move(t,e,"Left")}_moveRight(t,e){return this._move(t,e,"Right")}moveCursorLeftWithoutShift(t){let e=!0;return this._selectionDirection=tC,this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(e=this._moveLeft(t,"selectionStart")),this.selectionEnd=this.selectionStart,e}moveCursorLeftWithShift(t){return this._selectionDirection===tT&&this.selectionStart!==this.selectionEnd?this._moveLeft(t,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection=tC,this._moveLeft(t,"selectionStart")):void 0}moveCursorRight(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",t)}_moveCursorLeftOrRight(t,e){let r="moveCursor".concat(t).concat(e.shiftKey?"WithShift":"WithoutShift");this._currentCursorOpacity=1,this[r](e)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())}moveCursorRightWithShift(t){return this._selectionDirection===tC&&this.selectionStart!==this.selectionEnd?this._moveRight(t,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection=tT,this._moveRight(t,"selectionEnd")):void 0}moveCursorRightWithoutShift(t){let e=!0;return this._selectionDirection=tT,this.selectionStart===this.selectionEnd?(e=this._moveRight(t,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,e}}class sV extends sX{initBehavior(){this.on("mousedown",this._mouseDownHandler),this.on("mouseup",this.mouseUpHandler),this.on("mousedblclick",this.doubleClickHandler),this.on("mousetripleclick",this.tripleClickHandler),this.draggableTextDelegate=new sW(this),super.initBehavior()}shouldStartDragging(){return this.draggableTextDelegate.isActive()}onDragStart(t){return this.draggableTextDelegate.onDragStart(t)}canDrop(t){return this.draggableTextDelegate.canDrop(t)}doubleClickHandler(t){this.isEditing&&(this.selectWord(this.getSelectionStartFromPointer(t.e)),this.renderCursorOrSelection())}tripleClickHandler(t){this.isEditing&&(this.selectLine(this.getSelectionStartFromPointer(t.e)),this.renderCursorOrSelection())}_mouseDownHandler(t){let{e:e,alreadySelected:r}=t;this.canvas&&this.editable&&!e.button&&!this.getActiveControl()&&(this.draggableTextDelegate.start(e)||(this.canvas.textEditingManager.register(this),r&&(this.inCompositionMode=!1,this.setCursorByClick(e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()),this.selected||(this.selected=r||this.isEditing)))}mouseUpHandler(t){let{e:e,transform:r}=t,i=this.draggableTextDelegate.end(e);if(this.canvas){this.canvas.textEditingManager.unregister(this);let t=this.canvas._activeObject;if(t&&t!==this)return}!this.editable||this.group&&!this.group.interactive||r&&r.actionPerformed||e.button||i||this.selected&&!this.getActiveControl()&&(this.enterEditing(e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection())}setCursorByClick(t){let e=this.getSelectionStartFromPointer(t),r=this.selectionStart,i=this.selectionEnd;t.shiftKey?this.setSelectionStartEndWithShift(r,i,e):(this.selectionStart=e,this.selectionEnd=e),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())}getSelectionStartFromPointer(t){let e=this.canvas.getScenePoint(t).transform(es(this.calcTransformMatrix())).add(new tJ(-this._getLeftOffset(),-this._getTopOffset())),r=0,i=0,n=0;for(let t=0;t0&&(i+=this._textLines[t-1].length+this.missingNewlineOffset(t-1));let s=Math.abs(this._getLineLeftOffset(n)),o=this._textLines[n].length,a=this.__charBounds[n];for(let t=0;t{let r=e.getRetinaScaling();t.setTransform(r,0,0,r,0,0);let i=e.viewportTransform;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])},sJ=tt({selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,keysMap:{9:sK,27:sK,33:sY,34:sz,35:sq,36:sG,37:sG,38:sY,39:sq,40:sz},keysMapRtl:{9:sK,27:sK,33:sY,34:sz,35:sG,36:sq,37:sq,38:sY,39:sG,40:sz},ctrlKeysMapDown:{65:"cmdAll"},ctrlKeysMapUp:{67:"copy",88:"cut"}},{_selectionDirection:null,_reSpace:/\s|\r?\n/,inCompositionMode:!1});class sZ extends sV{static getDefaults(){return tt(tt({},super.getDefaults()),sZ.ownDefaults)}get type(){let t=super.type;return"itext"===t?"i-text":t}_set(t,e){return this.isEditing&&this._savedProps&&t in this._savedProps?(this._savedProps[t]=e,this):("canvas"===t&&(this.canvas instanceof st&&this.canvas.textEditingManager.remove(this),e instanceof st&&e.textEditingManager.add(this)),super._set(t,e))}setSelectionStart(t){t=Math.max(t,0),this._updateAndFire("selectionStart",t)}setSelectionEnd(t){t=Math.min(t,this.text.length),this._updateAndFire("selectionEnd",t)}_updateAndFire(t,e){this[t]!==e&&(this._fireSelectionChanged(),this[t]=e),this._updateTextarea()}_fireSelectionChanged(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})}initDimensions(){this.isEditing&&this.initDelayedCursor(),super.initDimensions()}getSelectionStyles(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart||0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selectionEnd,r=arguments.length>2?arguments[2]:void 0;return super.getSelectionStyles(t,e,r)}setSelectionStyles(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selectionStart||0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.selectionEnd;return super.setSelectionStyles(t,e,r)}get2DCursorLocation(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart,e=arguments.length>1?arguments[1]:void 0;return super.get2DCursorLocation(t,e)}render(t){super.render(t),this.cursorOffsetCache={},this.renderCursorOrSelection()}toCanvasElement(t){let e=this.isEditing;this.isEditing=!1;let r=super.toCanvasElement(t);return this.isEditing=e,r}renderCursorOrSelection(){if(!this.isEditing||!this.canvas)return;let t=this.clearContextTop(!0);if(!t)return;let e=this._getCursorBoundaries(),r=this.findAncestorsWithClipPath(),i=r.length>0,n,s=t;if(i){sQ(s=(n=t8(t.canvas)).getContext("2d"),this.canvas);let e=this.calcTransformMatrix();s.transform(e[0],e[1],e[2],e[3],e[4],e[5])}if(this.selectionStart!==this.selectionEnd||this.inCompositionMode?this.renderSelection(s,e):this.renderCursor(s,e),i)for(let e of r){let r=e.clipPath,i=t8(t.canvas),n=i.getContext("2d");if(sQ(n,this.canvas),!r.absolutePositioned){let t=e.calcTransformMatrix();n.transform(t[0],t[1],t[2],t[3],t[4],t[5])}r.transform(n),r.drawObject(n,!0,{}),this.drawClipPathOnCache(s,r,i)}i&&(t.setTransform(1,0,0,1,0,0),t.drawImage(n,0,0)),this.canvas.contextTopDirty=!0,t.restore()}findAncestorsWithClipPath(){let t=[],e=this;for(;e;)e.clipPath&&t.push(e),e=e.parent;return t}_getCursorBoundaries(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart,e=arguments.length>1?arguments[1]:void 0,r=this._getLeftOffset(),i=this._getTopOffset(),n=this._getCursorBoundariesOffsets(t,e);return{left:r,top:i,leftOffset:n.left,topOffset:n.top}}_getCursorBoundariesOffsets(t,e){return e?this.__getCursorBoundariesOffsets(t):this.cursorOffsetCache&&"top"in this.cursorOffsetCache?this.cursorOffsetCache:this.cursorOffsetCache=this.__getCursorBoundariesOffsets(t)}__getCursorBoundariesOffsets(t){let e=0,r=0,{charIndex:i,lineIndex:n}=this.get2DCursorLocation(t);for(let t=0;t0?r:0)};return"rtl"===this.direction&&(this.textAlign===tT||this.textAlign===rv||this.textAlign===rx?a.left*=-1:this.textAlign===tC||this.textAlign===ry?a.left=s-(r>0?r:0):this.textAlign!==tw&&this.textAlign!==rb||(a.left=s-(r>0?r:0))),a}renderCursorAt(t){this._renderCursor(this.canvas.contextTop,this._getCursorBoundaries(t,!0),t)}renderCursor(t,e){this._renderCursor(t,e,this.selectionStart)}getCursorRenderingData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getCursorBoundaries(t),r=this.get2DCursorLocation(t),i=r.lineIndex,n=r.charIndex>0?r.charIndex-1:0,s=this.getValueOfPropertyAt(i,n,"fontSize"),o=this.getObjectScaling().x*this.canvas.getZoom(),a=this.cursorWidth/o,l=this.getValueOfPropertyAt(i,n,"deltaY"),h=e.topOffset+(1-this._fontSizeFraction)*this.getHeightOfLine(i)/this.lineHeight-s*(1-this._fontSizeFraction);return{color:this.cursorColor||this.getValueOfPropertyAt(i,n,"fill"),opacity:this._currentCursorOpacity,left:e.left+e.leftOffset-a/2,top:h+e.top+l,width:a,height:s}}_renderCursor(t,e,r){let{color:i,opacity:n,left:s,top:o,width:a,height:l}=this.getCursorRenderingData(r,e);t.fillStyle=i,t.globalAlpha=n,t.fillRect(s,o,a,l)}renderSelection(t,e){let r={selectionStart:this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,selectionEnd:this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd};this._renderSelection(t,r,e)}renderDragSourceEffect(){let t=this.draggableTextDelegate.getDragStartSelection();this._renderSelection(this.canvas.contextTop,t,this._getCursorBoundaries(t.selectionStart,!0))}renderDropTargetEffect(t){let e=this.getSelectionStartFromPointer(t);this.renderCursorAt(e)}_renderSelection(t,e,r){let i=e.selectionStart,n=e.selectionEnd,s=this.textAlign.includes(rv),o=this.get2DCursorLocation(i),a=this.get2DCursorLocation(n),l=o.lineIndex,h=a.lineIndex,c=o.charIndex<0?0:o.charIndex,u=a.charIndex<0?0:a.charIndex;for(let e=l;e<=h;e++){let i=this._getLineLeftOffset(e)||0,n=this.getHeightOfLine(e),o=0,a=0,d=0;if(e===l&&(a=this.__charBounds[l][c].left),e>=l&&e1)&&(n/=this.lineHeight);let f=r.left+i+a,g=n,p=0,m=d-a;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",g=1,p=n):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(this.textAlign===tT||this.textAlign===rv||this.textAlign===rx?f=this.width-f-m:this.textAlign===tC||this.textAlign===ry?f=r.left+i-d:this.textAlign!==tw&&this.textAlign!==rb||(f=r.left+i-d)),t.fillRect(f,r.top+r.topOffset+p,m,g),r.topOffset+=o}}getCurrentCharFontSize(){let t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fontSize")}getCurrentCharColor(){let t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,tU)}_getCurrentCharIndex(){let t=this.get2DCursorLocation(this.selectionStart,!0),e=t.charIndex>0?t.charIndex-1:0;return{l:t.lineIndex,c:e}}dispose(){this.exitEditingImpl(),this.draggableTextDelegate.dispose(),super.dispose()}constructor(t,e){super(t,tt(tt({},sZ.ownDefaults),e)),this.initBehavior()}}Z(sZ,"ownDefaults",sJ),Z(sZ,"type","IText"),tY.setClass(sZ),tY.setClass(sZ,"i-text");class s$ extends sZ{static getDefaults(){return tt(tt({},super.getDefaults()),s$.ownDefaults)}static createControls(){return{controls:iI()}}initDimensions(){this.initialized&&(this.isEditing&&this.initDelayedCursor(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),this.textAlign.includes(rv)&&this.enlargeSpaces(),this.height=this.calcTextHeight())}_generateStyleMap(t){let e=0,r=0,i=0,n={};for(let s=0;s0?(r=0,i++,e++):!this.splitByGrapheme&&this._reSpaceAndTab.test(t.graphemeText[i])&&s>0&&(r++,i++),n[s]={line:e,offset:r},i+=t.graphemeLines[s].length,r+=t.graphemeLines[s].length;return n}styleHas(t,e){if(this._styleMap&&!this.isWrapping){let t=this._styleMap[e];t&&(e=t.line)}return super.styleHas(t,e)}isEmptyStyles(t){if(!this.styles)return!0;let e,r=0,i=!1,n=this._styleMap[t],s=this._styleMap[t+1];n&&(t=n.line,r=n.offset),s&&(i=s.line===t,e=s.offset);let o=void 0===t?this.styles:{line:this.styles[t]};for(let t in o)for(let n in o[t]){let s=parseInt(n,10);if(s>=r&&(!i||s{let s=0,o=e?this.graphemeSplit(t):this.wordSplit(t);return 0===o.length?[{word:[],width:0}]:o.map(t=>{let o=e?[t]:this.graphemeSplit(t),a=this._measureWord(o,n,s);return i=Math.max(a,i),s+=o.length+r.length,{word:o,width:a}})}),largestWordWidth:i}}_measureWord(t,e){let r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=0;for(let s=0,o=t.length;s3&&void 0!==arguments[3]?arguments[3]:0,a=this._getWidthOfCharSpacing(),l=this.splitByGrapheme,h=[],c=l?"":" ",u=0,d=[],f=0,g=0,p=!0,m=Math.max(e-=o,n,this.dynamicMinWidth),y=s[t];for(f=0,i=0;im&&!p?(h.push(d),d=[],u=r,p=!0):u+=a,p||l||d.push(c),d=d.concat(e),g=l?0:this._measureWord([c],t,f),f++,p=!1}return i&&h.push(d),n+o>this.dynamicMinWidth&&(this.dynamicMinWidth=n-a+o),h}isEndOfWrapping(t){return!this._styleMap[t+1]||this._styleMap[t+1].line!==this._styleMap[t].line}missingNewlineOffset(t,e){return this.splitByGrapheme&&!e?+!!this.isEndOfWrapping(t):1}_splitTextIntoLines(t){let e=super._splitTextIntoLines(t),r=this._wrapText(e.lines,this.width),i=Array(r.length);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject(["minWidth","splitByGrapheme",...t])}constructor(t,e){super(t,tt(tt({},s$.ownDefaults),e))}}Z(s$,"type","Textbox"),Z(s$,"textLayoutProperties",[...sZ.textLayoutProperties,"width"]),Z(s$,"ownDefaults",{minWidth:20,dynamicMinWidth:2,lockScalingFlip:!0,noScaleCache:!1,_wordJoiners:/[ \t\r]/,splitByGrapheme:!1}),tY.setClass(s$);class s0 extends ny{shouldPerformLayout(t){return!!t.target.clipPath&&super.shouldPerformLayout(t)}shouldLayoutClipPath(){return!1}calcLayoutResult(t,e){let{target:r}=t,{clipPath:i,group:n}=r;if(!i||!this.shouldPerformLayout(t))return;let{width:s,height:o}=eH(nv(r,i)),a=new tJ(s,o);if(i.absolutePositioned)return{center:eQ(i.getRelativeCenterPoint(),void 0,n?n.calcTransformMatrix():void 0),size:a};{let n=i.getRelativeCenterPoint().transform(r.calcOwnMatrix(),!0);if(this.shouldPerformLayout(t)){let{center:r=new tJ,correction:i=new tJ}=this.calcBoundingBox(e,t)||{};return{center:r.add(n),correction:i.subtract(n),size:a}}return{center:r.getRelativeCenterPoint().add(n),size:a}}}}Z(s0,"type","clip-path"),tY.setClass(s0);class s1 extends ny{getInitialSize(t,e){let{target:r}=t,{size:i}=e;return new tJ(r.width||i.x,r.height||i.y)}}Z(s1,"type","fixed"),tY.setClass(s1);class s2 extends nC{subscribeTargets(t){let e=t.target;t.targets.reduce((t,e)=>(e.parent&&t.add(e.parent),t),new Set).forEach(t=>{t.layoutManager.subscribeTargets({target:t,targets:[e]})})}unsubscribeTargets(t){let e=t.target,r=e.getObjects();t.targets.reduce((t,e)=>(e.parent&&t.add(e.parent),t),new Set).forEach(t=>{r.some(e=>e.parent===t)||t.layoutManager.unsubscribeTargets({target:t,targets:[e]})})}}class s5 extends nO{static getDefaults(){return tt(tt({},super.getDefaults()),s5.ownDefaults)}_shouldSetNestedCoords(){return!0}__objectSelectionMonitor(){}multiSelectAdd(){for(var t=arguments.length,e=Array(t),r=0;r{let e=this._objects.findIndex(e=>e.isInFrontOf(t)),r=-1===e?this.size():e;this.insertAt(r,t)})}canEnterGroup(t){return this.getObjects().some(e=>e.isDescendantOf(t)||t.isDescendantOf(e))?(ts("error","ActiveSelection: circular object trees are not supported, this call has no effect"),!1):super.canEnterGroup(t)}enterGroup(t,e){t.parent&&t.parent===t.group?t.parent._exitGroup(t):t.group&&t.parent!==t.group&&t.group.remove(t),this._enterGroup(t,e)}exitGroup(t,e){this._exitGroup(t,e),t.parent&&t.parent._enterGroup(t,!0)}_onAfterObjectsChange(t,e){super._onAfterObjectsChange(t,e);let r=new Set;e.forEach(t=>{let{parent:e}=t;e&&r.add(e)}),t===np?r.forEach(t=>{t._onAfterObjectsChange(ng,e)}):r.forEach(t=>{t._set("dirty",!0)})}onDeselect(){return this.removeAll(),!1}toString(){return"#")}shouldCache(){return!1}isOnACache(){return!1}_renderControls(t,e,r){t.save(),t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1;let i=tt(tt({hasControls:!1},r),{},{forActiveSelection:!0});for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Object.assign(this,s5.ownDefaults),this.setOptions(e);let{left:r,top:i,layoutManager:n}=e;this.groupInit(t,{left:r,top:i,layoutManager:null!=n?n:new s2})}}Z(s5,"type","ActiveSelection"),Z(s5,"ownDefaults",{multiSelectionStacking:"canvas-stacking"}),tY.setClass(s5),tY.setClass(s5,"activeSelection");class s4{applyFilters(t,e,r,i,n){let s=n.getContext("2d");if(!s)return;s.drawImage(e,0,0,r,i);let o={sourceWidth:r,sourceHeight:i,imageData:s.getImageData(0,0,r,i),originalEl:e,originalImageData:s.getImageData(0,0,r,i),canvasEl:n,ctx:s,filterBackend:this};t.forEach(t=>{t.applyTo(o)});let{imageData:a}=o;return a.width===r&&a.height===i||(n.width=a.width,n.height=a.height),s.putImageData(a,0,0),o}constructor(){Z(this,"resources",{})}}class s3{setupGLContext(t,e){this.dispose(),this.createWebGLCanvas(t,e)}createWebGLCanvas(t,e){let r=t8({width:t,height:e}),i=r.getContext("webgl",{alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1});i&&(i.clearColor(0,0,0,0),this.canvas=r,this.gl=i)}applyFilters(t,e,r,i,n,s){let o,a=this.gl,l=n.getContext("2d");if(!a||!l)return;s&&(o=this.getCachedTexture(s,e));let h={originalWidth:e.width||e.naturalWidth||0,originalHeight:e.height||e.naturalHeight||0,sourceWidth:r,sourceHeight:i,destinationWidth:r,destinationHeight:i,context:a,sourceTexture:this.createTexture(a,r,i,o?void 0:e),targetTexture:this.createTexture(a,r,i),originalTexture:o||this.createTexture(a,r,i,o?void 0:e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:n},c=a.createFramebuffer();return a.bindFramebuffer(a.FRAMEBUFFER,c),t.forEach(t=>{t&&t.applyTo(h)}),function(t){let e=t.targetCanvas,r=e.width,i=e.height,n=t.destinationWidth,s=t.destinationHeight;r===n&&i===s||(e.width=n,e.height=s)}(h),this.copyGLTo2D(a,h),a.bindTexture(a.TEXTURE_2D,null),a.deleteTexture(h.sourceTexture),a.deleteTexture(h.targetTexture),a.deleteFramebuffer(c),l.setTransform(1,0,0,1,0,0),h}dispose(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()}clearWebGLCaches(){this.programCache={},this.textureCache={}}createTexture(t,e,r,i,n){let{NEAREST:s,TEXTURE_2D:o,RGBA:a,UNSIGNED_BYTE:l,CLAMP_TO_EDGE:h,TEXTURE_MAG_FILTER:c,TEXTURE_MIN_FILTER:u,TEXTURE_WRAP_S:d,TEXTURE_WRAP_T:f}=t,g=t.createTexture();return t.bindTexture(o,g),t.texParameteri(o,c,n||s),t.texParameteri(o,u,n||s),t.texParameteri(o,d,h),t.texParameteri(o,f,h),i?t.texImage2D(o,0,a,a,l,i):t.texImage2D(o,0,a,e,r,0,a,l,null),g}getCachedTexture(t,e,r){let{textureCache:i}=this;if(i[t])return i[t];{let n=this.createTexture(this.gl,e.width,e.height,e,r);return n&&(i[t]=n),n}}evictCachesForKey(t){this.textureCache[t]&&(this.gl.deleteTexture(this.textureCache[t]),delete this.textureCache[t])}copyGLTo2D(t,e){let r=t.canvas,i=e.targetCanvas,n=i.getContext("2d");if(!n)return;n.translate(0,i.height),n.scale(1,-1);let s=r.height-i.height;n.drawImage(r,0,s,i.width,i.height,0,0,i.width,i.height)}copyGLTo2DPutImageData(t,e){let r=e.targetCanvas.getContext("2d"),i=e.destinationWidth,n=e.destinationHeight,s=i*n*4;if(!r)return;let o=new Uint8Array(this.imageBuffer,0,s),a=new Uint8ClampedArray(this.imageBuffer,0,s);t.readPixels(0,0,i,n,t.RGBA,t.UNSIGNED_BYTE,o);let l=new ImageData(a,i,n);r.putImageData(l,0,0)}captureGPUInfo(){if(this.gpuInfo)return this.gpuInfo;let t=this.gl,e={renderer:"",vendor:""};if(!t)return e;let r=t.getExtension("WEBGL_debug_renderer_info");if(r){let i=t.getParameter(r.UNMASKED_RENDERER_WEBGL),n=t.getParameter(r.UNMASKED_VENDOR_WEBGL);i&&(e.renderer=i.toLowerCase()),n&&(e.vendor=n.toLowerCase())}return this.gpuInfo=e,e}constructor(){let{tileSize:t=tn.textureSize}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Z(this,"aPosition",new Float32Array([0,0,0,1,1,0,1,1])),Z(this,"resources",{}),this.tileSize=t,this.setupGLContext(t,t),this.captureGPUInfo()}}function s9(){return n||arguments.length>0&&void 0!==arguments[0]&&!arguments[0]||(n=function(){let{WebGLProbe:t}=tu();return t.queryWebGL(t9()),tn.enableGLFiltering&&t.isSupported(tn.textureSize)?new s3({tileSize:tn.textureSize}):new s4}()),n}let s6=["filters","resizeFilter","src","crossOrigin","type"],s8=["cropX","cropY"];class s7 extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),s7.ownDefaults)}getElement(){return this._element}setElement(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.removeTexture(this.cacheKey),this.removeTexture("".concat(this.cacheKey,"_filtered")),this._element=t,this._originalElement=t,this._setWidthHeight(r),null==(e=t.classList)||e.add(s7.CSS_CANVAS),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters()}removeTexture(t){let e=s9(!1);e instanceof s3&&e.evictCachesForKey(t)}dispose(){super.dispose(),this.removeTexture(this.cacheKey),this.removeTexture("".concat(this.cacheKey,"_filtered")),this._cacheContext=null,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(t=>{let e=this[t];e&&tu().dispose(e),this[t]=void 0})}getCrossOrigin(){return this._originalElement&&(this._originalElement.crossOrigin||null)}getOriginalSize(){let t=this.getElement();return t?{width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}:{width:0,height:0}}_stroke(t){if(!this.stroke||0===this.strokeWidth)return;let e=this.width/2,r=this.height/2;t.beginPath(),t.moveTo(-e,-r),t.lineTo(e,-r),t.lineTo(e,r),t.lineTo(-e,r),t.lineTo(-e,-r),t.closePath()}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[];return this.filters.forEach(t=>{t&&e.push(t.toObject())}),tt(tt({},super.toObject([...s8,...t])),{},{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:e},this.resizeFilter?{resizeFilter:this.resizeFilter.toObject()}:{})}hasCrop(){return!!this.cropX||!!this.cropY||this.width\n',' \n',"\n"),o=' clip-path="url(#imageCrop_'+t+')" '}if(this.imageSmoothing||(a=' image-rendering="optimizeSpeed"'),t.push(" \n")),this.stroke||this.strokeDashArray){let t=this.fill;this.fill=null,s=[' \n')],this.fill=t}return this.paintFirst!==tU?n.concat(s,t):n.concat(t,s)}getSrc(t){let e=t?this._element:this._originalElement;return e?e.toDataURL?e.toDataURL():this.srcFromAttribute?e.getAttribute("src")||"":e.src:this.src||""}getSvgSrc(t){return this.getSrc(t)}setSrc(t){let{crossOrigin:e,signal:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ey(t,{crossOrigin:e,signal:r}).then(t=>{void 0!==e&&this.set({crossOrigin:e}),this.setElement(t)})}toString(){return'#')}applyResizeFilters(){let t=this.resizeFilter,e=this.minimumScaleTrigger,r=this.getTotalObjectScaling(),i=r.x,n=r.y,s=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||i>e&&n>e)return this._element=s,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=i,void(this._lastScaleY=n);let o=t8(s),{width:a,height:l}=s;this._element=o,this._lastScaleX=t.scaleX=i,this._lastScaleY=t.scaleY=n,s9().applyFilters([t],s,a,l,this._element),this._filterScalingX=o.width/this._originalElement.width,this._filterScalingY=o.height/this._originalElement.height}applyFilters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.filters||[];if(t=t.filter(t=>t&&!t.isNeutralState()),this.set("dirty",!0),this.removeTexture("".concat(this.cacheKey,"_filtered")),0===t.length)return this._element=this._originalElement,this._filteredEl=void 0,this._filterScalingX=1,void(this._filterScalingY=1);let e=this._originalElement,r=e.naturalWidth||e.width,i=e.naturalHeight||e.height;if(this._element===this._originalElement){let t=t8({width:r,height:i});this._element=t,this._filteredEl=t}else this._filteredEl&&(this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,r,i),this._lastScaleX=1,this._lastScaleY=1);s9().applyFilters(t,this._originalElement,r,i,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height)}_render(t){t.imageSmoothingEnabled=this.imageSmoothing,!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(t),this._renderPaintInOrder(t)}drawCacheOnCanvas(t){t.imageSmoothingEnabled=this.imageSmoothing,super.drawCacheOnCanvas(t)}shouldCache(){return this.needsItsOwnCache()}_renderFill(t){let e=this._element;if(!e)return;let r=this._filterScalingX,i=this._filterScalingY,n=this.width,s=this.height,o=Math.max(this.cropX,0),a=Math.max(this.cropY,0),l=e.naturalWidth||e.width,h=e.naturalHeight||e.height,c=o*r,u=a*i,d=Math.min(n*r,l-c),f=Math.min(s*i,h-u),g=Math.min(n,l/r-o),p=Math.min(s,h/i-a);e&&t.drawImage(e,c,u,d,f,-n/2,-s/2,g,p)}_needsResize(){let t=this.getTotalObjectScaling();return t.x!==this._lastScaleX||t.y!==this._lastScaleY}_resetWidthHeight(){this.set(this.getOriginalSize())}_setWidthHeight(){let{width:t,height:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.getOriginalSize();this.width=t||r.width,this.height=e||r.height}parsePreserveAspectRatioAttribute(){let t=ra(this.preserveAspectRatio||""),e=this.width,r=this.height,i={width:e,height:r},n,s=this._element.width,o=this._element.height,a=1,l=1,h=0,c=0,u=0,d=0;return t&&(t.alignX!==tO||t.alignY!==tO)?("meet"===t.meetOrSlice&&(n=(e-s*(a=l=nk(this._element,i)))/2,"Min"===t.alignX&&(h=-n),"Max"===t.alignX&&(h=n),n=(r-o*l)/2,"Min"===t.alignY&&(c=-n),"Max"===t.alignY&&(c=n)),"slice"===t.meetOrSlice&&(n=s-e/(a=l=nM(this._element,i)),"Mid"===t.alignX&&(u=n/2),"Max"===t.alignX&&(u=n),n=o-r/l,"Mid"===t.alignY&&(d=n/2),"Max"===t.alignY&&(d=n),s=e/a,o=r/l)):(a=e/s,l=r/o),{width:s,height:o,scaleX:a,scaleY:l,offsetLeft:h,offsetTop:c,cropX:u,cropY:d}}static fromObject(t,e){let{filters:r,resizeFilter:i,src:n,crossOrigin:s,type:o}=t,a=te(t,s6);return Promise.all([ey(n,tt(tt({},e),{},{crossOrigin:s})),r&&ex(r,e),i&&ex([i],e),eb(a,e)]).then(t=>{let[e,r=[],[i]=[],s={}]=t;return new this(e,tt(tt({},a),{},{src:n,filters:r,resizeFilter:i},s))})}static fromURL(t){let{crossOrigin:e=null,signal:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return ey(t,{crossOrigin:e,signal:r}).then(t=>new this(t,i))}static async fromElement(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=nh(t,this.ATTRIBUTE_NAMES,r);return this.fromURL(i["xlink:href"]||i.href,e,i).catch(t=>(ts("log","Unable to parse Image",t),null))}constructor(t,e){super(),Z(this,"_lastScaleX",1),Z(this,"_lastScaleY",1),Z(this,"_filterScalingX",1),Z(this,"_filterScalingY",1),this.filters=[],Object.assign(this,s7.ownDefaults),this.setOptions(e),this.cacheKey="texture".concat(t3()),this.setElement("string"==typeof t?(this.canvas&&eD(this.canvas.getElement())||td()).getElementById(t):t,e)}}Z(s7,"type","Image"),Z(s7,"cacheProperties",[...rY,...s8]),Z(s7,"ownDefaults",{strokeWidth:0,srcFromAttribute:!1,minimumScaleTrigger:.5,cropX:0,cropY:0,imageSmoothing:!0}),Z(s7,"CSS_CANVAS","canvas-img"),Z(s7,"ATTRIBUTE_NAMES",[...i2,"x","y","width","height","preserveAspectRatio","xlink:href","href","crossOrigin","image-rendering"]),tY.setClass(s7),tY.setSVGClass(s7),rc(["pattern","defs","symbol","metadata","clipPath","mask","desc"]);let ot=t=>function(e,r,i){let{points:n,pathOffset:s}=i;return new tJ(n[t]).subtract(s).transform(eo(i.getViewportTransform(),i.calcTransformMatrix()))},oe=(t,e,r,i)=>{let{target:n,pointIndex:s}=e,o=eQ(new tJ(r,i),void 0,n.calcOwnMatrix());return n.points[s]=o.add(n.pathOffset),n.setDimensions(),n.set("dirty",!0),!0},or=(t,e)=>function(r,i,n,s){let o=i.target,a=new tJ(o.points[(t>0?t:o.points.length)-1]),l=a.subtract(o.pathOffset).transform(o.calcOwnMatrix()),h=e(r,tt(tt({},i),{},{pointIndex:t}),n,s),c=a.subtract(o.pathOffset).transform(o.calcOwnMatrix()).subtract(l);return o.left-=c.x,o.top-=c.y,h},oi=t=>io(tF,or(t,oe)),on=(t,e,r)=>{let{path:i,pathOffset:n}=t,s=i[e];return new tJ(s[r]-n.x,s[r+1]-n.y).transform(eo(t.getViewportTransform(),t.calcTransformMatrix()))};function os(t,e,r){let{commandIndex:i,pointIndex:n}=this;return on(r,i,n)}function oo(t,e,r,i){let{target:n}=e,{commandIndex:s,pointIndex:o}=this,a=((t,e,r,i,n)=>{let{path:s,pathOffset:o}=t,a=s[(i>0?i:s.length)-1],l=new tJ(a[n],a[n+1]),h=l.subtract(o).transform(t.calcOwnMatrix()),c=eQ(new tJ(e,r),void 0,t.calcOwnMatrix());s[i][n]=c.x+o.x,s[i][n+1]=c.y+o.y,t.setDimensions();let u=l.subtract(t.pathOffset).transform(t.calcOwnMatrix()).subtract(h);return t.left-=u.x,t.top-=u.y,t.set("dirty",!0),!0})(n,r,i,s,o);return e$(this.actionName,tt(tt({},e3(t,e,r,i)),{},{commandIndex:s,pointIndex:o})),a}class oa extends iu{render(t,e,r,i,n){let s=tt(tt({},i),{},{cornerColor:this.controlFill,cornerStrokeColor:this.controlStroke,transparentCorners:!this.controlFill});super.render(t,e,r,s,n)}constructor(t){super(t)}}class ol extends oa{render(t,e,r,i,n){let{path:s}=n,{commandIndex:o,pointIndex:a,connectToCommandIndex:l,connectToPointIndex:h}=this;t.save(),t.strokeStyle=this.controlStroke,this.connectionDashArray&&t.setLineDash(this.connectionDashArray);let[c]=s[o],u=on(n,l,h);if("Q"===c){let i=on(n,o,a+2);t.moveTo(i.x,i.y),t.lineTo(e,r)}else t.moveTo(e,r);t.lineTo(u.x,u.y),t.stroke(),t.restore(),super.render(t,e,r,i,n)}constructor(t){super(t)}}let oh=(t,e,r,i,n,s)=>new(r?ol:oa)(tt(tt({commandIndex:t,pointIndex:e,actionName:"modifyPath",positionHandler:os,actionHandler:oo,connectToCommandIndex:n,connectToPointIndex:s},i),r?i.controlPointStyle:i.pointStyle));Object.freeze({__proto__:null,changeWidth:il,createObjectDefaultControls:iL,createPathControls:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i="M";return t.path.forEach((t,n)=>{let s=t[0];switch("Z"!==s&&(r["c_".concat(n,"_").concat(s)]=oh(n,t.length-2,!1,e)),s){case"C":let o;r["c_".concat(n,"_C_CP_1")]=oh(n,1,!0,e,n-1,"C"===(o=i)?5:"Q"===o?3:1),r["c_".concat(n,"_C_CP_2")]=oh(n,3,!0,e,n,5);break;case"Q":r["c_".concat(n,"_Q_CP_1")]=oh(n,1,!0,e,n,3)}i=s}),r},createPolyActionHandler:oi,createPolyControls:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};for(let i=0;i<("number"==typeof t?t:t.points.length);i++)r["p".concat(i)]=new iu(tt({actionName:tF,positionHandler:ot(i),actionHandler:oi(i)},e));return r},createPolyPositionHandler:ot,createResizeControls:iR,createTextboxDefaultControls:iI,dragHandler:e8,factoryPolyActionHandler:or,getLocalPoint:e6,polyActionHandler:oe,renderCircleControl:ih,renderSquareControl:ic,rotationStyleHandler:id,rotationWithSnapping:ig,scaleCursorStyleHandler:iy,scaleOrSkewActionName:ij,scaleSkewCursorStyleHandler:iA,scalingEqually:ib,scalingX:i_,scalingXOrSkewingY:iP,scalingY:iw,scalingYOrSkewingX:iF,skewCursorStyleHandler:iO,skewHandlerX:iM,skewHandlerY:iE,wrapWithFireEvent:io,wrapWithFixedAnchor:ia});let oc="precision highp float",ou="\n ".concat(oc,";\n varying vec2 vTexCoord;\n uniform sampler2D uTexture;\n void main() {\n gl_FragColor = texture2D(uTexture, vTexCoord);\n }"),od=["type"],of=["type"],og=RegExp(oc,"g");class op{get type(){return this.constructor.type}getFragmentSource(){return ou}getVertexSource(){return"\n attribute vec2 aPosition;\n varying vec2 vTexCoord;\n void main() {\n vTexCoord = aPosition;\n gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n }"}createProgram(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getFragmentSource(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getVertexSource(),{WebGLProbe:{GLPrecision:i="highp"}}=tu();"highp"!==i&&(e=e.replace(og,oc.replace("highp",i)));let n=t.createShader(t.VERTEX_SHADER),s=t.createShader(t.FRAGMENT_SHADER),o=t.createProgram();if(!n||!s||!o)throw new to("Vertex, fragment shader or program creation error");if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new to("Vertex shader compile error for ".concat(this.type,": ").concat(t.getShaderInfoLog(n)));if(t.shaderSource(s,e),t.compileShader(s),!t.getShaderParameter(s,t.COMPILE_STATUS))throw new to("Fragment shader compile error for ".concat(this.type,": ").concat(t.getShaderInfoLog(s)));if(t.attachShader(o,n),t.attachShader(o,s),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS))throw new to('Shader link error for "'.concat(this.type,'" ').concat(t.getProgramInfoLog(o)));let a=this.getUniformLocations(t,o)||{};return a.uStepW=t.getUniformLocation(o,"uStepW"),a.uStepH=t.getUniformLocation(o,"uStepH"),{program:o,attributeLocations:this.getAttributeLocations(t,o),uniformLocations:a}}getAttributeLocations(t,e){return{aPosition:t.getAttribLocation(e,"aPosition")}}getUniformLocations(t,e){let r=this.constructor.uniformLocations,i={};for(let n=0;n1){let r=t.destinationWidth,i=t.destinationHeight;t.sourceWidth===r&&t.sourceHeight===i||(e.deleteTexture(t.targetTexture),t.targetTexture=t.filterBackend.createTexture(e,r,i)),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.targetTexture,0)}else e.bindFramebuffer(e.FRAMEBUFFER,null),e.finish()}_swapTextures(t){t.passes--,t.pass++;let e=t.targetTexture;t.targetTexture=t.sourceTexture,t.sourceTexture=e}isNeutralState(t){return!1}applyTo(t){void 0!==t.webgl?(this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)}applyTo2d(t){}getCacheKey(){return this.type}retrieveShader(t){let e=this.getCacheKey();return t.programCache[e]||(t.programCache[e]=this.createProgram(t.context)),t.programCache[e]}applyToWebGL(t){let e=t.context,r=this.retrieveShader(t);0===t.pass&&t.originalTexture?e.bindTexture(e.TEXTURE_2D,t.originalTexture):e.bindTexture(e.TEXTURE_2D,t.sourceTexture),e.useProgram(r.program),this.sendAttributeData(e,r.attributeLocations,t.aPosition),e.uniform1f(r.uniformLocations.uStepW,1/t.sourceWidth),e.uniform1f(r.uniformLocations.uStepH,1/t.sourceHeight),this.sendUniformData(e,r.uniformLocations),e.viewport(0,0,t.destinationWidth,t.destinationHeight),e.drawArrays(e.TRIANGLE_STRIP,0,4)}bindAdditionalTexture(t,e,r){t.activeTexture(r),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE0)}unbindAdditionalTexture(t,e){t.activeTexture(e),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE0)}sendUniformData(t,e){}createHelpLayer(t){if(!t.helpLayer){let{sourceWidth:e,sourceHeight:r}=t;t.helpLayer=t8({width:e,height:r})}}toObject(){let t=Object.keys(this.constructor.defaults||{});return tt({type:this.type},t.reduce((t,e)=>(t[e]=this[e],t),{}))}toJSON(){return this.toObject()}static async fromObject(t,e){return new this(te(t,of))}constructor(){let t=te(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},od);Object.assign(this,this.constructor.defaults,t)}}Z(op,"type","BaseFilter"),Z(op,"uniformLocations",[]);let om={multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",difference:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"\n if (uColor.r < 0.5) {\n gl_FragColor.r *= 2.0 * uColor.r;\n } else {\n gl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n }\n if (uColor.g < 0.5) {\n gl_FragColor.g *= 2.0 * uColor.g;\n } else {\n gl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n }\n if (uColor.b < 0.5) {\n gl_FragColor.b *= 2.0 * uColor.b;\n } else {\n gl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n }\n ",tint:"\n gl_FragColor.rgb *= (1.0 - uColor.a);\n gl_FragColor.rgb += uColor.rgb;\n "};class ov extends op{getCacheKey(){return"".concat(this.type,"_").concat(this.mode)}getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform vec4 uColor;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n gl_FragColor = color;\n if (color.a > 0.0) {\n ".concat(om[this.mode],"\n }\n }\n ")}applyTo2d(t){let{imageData:{data:e}}=t,r=new rs(this.color).getSource(),i=this.alpha,n=r[0]*i,s=r[1]*i,o=r[2]*i,a=1-i;for(let t=0;tnew this(tt(tt({},n),{},{image:t})))}}Z(ob,"type","BlendImage"),Z(ob,"defaults",{mode:"multiply",alpha:1}),Z(ob,"uniformLocations",["uTransformMatrix","uImage"]),tY.setClass(ob);class o_ extends op{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform vec2 uDelta;\n varying vec2 vTexCoord;\n const float nSamples = 15.0;\n vec3 v3offset = vec3(12.9898, 78.233, 151.7182);\n float random(vec3 scale) {\n /* use the fragment position for a different seed per-pixel */\n return fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n }\n void main() {\n vec4 color = vec4(0.0);\n float totalC = 0.0;\n float totalA = 0.0;\n float offset = random(v3offset);\n for (float t = -nSamples; t <= nSamples; t++) {\n float percent = (t + offset - 0.5) / nSamples;\n vec4 sample = texture2D(uTexture, vTexCoord + uDelta * percent);\n float weight = 1.0 - abs(percent);\n float alpha = weight * sample.a;\n color.rgb += sample.rgb * alpha;\n color.a += alpha;\n totalA += weight;\n totalC += alpha;\n }\n gl_FragColor.rgb = color.rgb / totalC;\n gl_FragColor.a = color.a / totalA;\n }\n "}applyTo(t){void 0!==t.webgl?(this.aspectRatio=t.sourceWidth/t.sourceHeight,t.passes++,this._setupFrameBuffer(t),this.horizontal=!0,this.applyToWebGL(t),this._swapTextures(t),this._setupFrameBuffer(t),this.horizontal=!1,this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)}applyTo2d(t){let{imageData:{data:e,width:r,height:i}}=t;this.aspectRatio=r/i,this.horizontal=!0;let n=this.getBlurValue()*r,s=new Uint8ClampedArray(e),o=4*r;for(let t=0;tu&&(g=u);let p=e[g+3]*f;r+=e[g]*p,i+=e[g+1]*p,a+=e[g+2]*p,l+=p,h+=f}s[t]=r/l,s[t+1]=i/l,s[t+2]=a/l,s[t+3]=l/h}this.horizontal=!1,n=this.getBlurValue()*i;for(let t=0;tu&&(p=u);let m=s[p+3]*g;r+=s[p]*m,i+=s[p+1]*m,a+=s[p+2]*m,l+=m,h+=g}e[t]=r/l,e[t+1]=i/l,e[t+2]=a/l,e[t+3]=l/h}}sendUniformData(t,e){let r=this.chooseRightDelta();t.uniform2fv(e.uDelta,r)}isNeutralState(){return 0===this.blur}getBlurValue(){let t=1,{horizontal:e,aspectRatio:r}=this;return e?r>1&&(t=1/r):r<1&&(t=r),t*this.blur*.12}chooseRightDelta(){let t=this.getBlurValue();return this.horizontal?[t,0]:[0,t]}}Z(o_,"type","Blur"),Z(o_,"defaults",{blur:0}),Z(o_,"uniformLocations",["uDelta"]),tY.setClass(o_);class ow extends op{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform float uBrightness;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n color.rgb += uBrightness;\n gl_FragColor = color;\n }\n"}applyTo2d(t){let{imageData:{data:e}}=t,r=Math.round(255*this.brightness);for(let t=0;t{e.applyTo(t)})}toObject(){return{type:this.type,subFilters:this.subFilters.map(t=>t.toObject())}}isNeutralState(){return!this.subFilters.some(t=>!t.isNeutralState())}static fromObject(t,e){return Promise.all((t.subFilters||[]).map(t=>tY.getClass(t.type).fromObject(t,e))).then(t=>new this({subFilters:t}))}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(t),this.subFilters=t.subFilters||[]}}Z(oP,"type","Composed"),tY.setClass(oP);class oF extends op{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform float uContrast;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\n color.rgb = contrastF * (color.rgb - 0.5) + 0.5;\n gl_FragColor = color;\n }"}isNeutralState(){return 0===this.contrast}applyTo2d(t){let{imageData:{data:e}}=t,r=Math.floor(255*this.contrast),i=259*(r+255)/(255*(259-r));for(let t=0;t=_||o<0||o>=b||(l=4*(a*b+o),h=m[f*y+d],e+=p[l]*h,r+=p[l+1]*h,i+=p[l+2]*h,S||(n+=p[l+3]*h));C[s]=e,C[s+1]=r,C[s+2]=i,C[s+3]=S?p[s+3]:n}t.imageData=w}sendUniformData(t,e){t.uniform1fv(e.uMatrix,this.matrix)}toObject(){return tt(tt({},super.toObject()),{},{opaque:this.opaque,matrix:[...this.matrix]})}}Z(oR,"type","Convolute"),Z(oR,"defaults",{opaque:!1,matrix:[0,0,0,0,1,0,0,0,0]}),Z(oR,"uniformLocations",["uMatrix","uOpaque","uHalfSize","uSize"]),tY.setClass(oR);let oI="Gamma";class oB extends op{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform vec3 uGamma;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n vec3 correction = (1.0 / uGamma);\n color.r = pow(color.r, correction.r);\n color.g = pow(color.g, correction.g);\n color.b = pow(color.b, correction.b);\n gl_FragColor = color;\n gl_FragColor.rgb *= color.a;\n }\n"}applyTo2d(t){let{imageData:{data:e}}=t,r=this.gamma,i=1/r[0],n=1/r[1],s=1/r[2];this.rgbValues||(this.rgbValues={r:new Uint8Array(256),g:new Uint8Array(256),b:new Uint8Array(256)});let o=this.rgbValues;for(let t=0;t<256;t++)o.r[t]=255*Math.pow(t/255,i),o.g[t]=255*Math.pow(t/255,n),o.b[t]=255*Math.pow(t/255,s);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{};super(t),this.gamma=t.gamma||this.constructor.defaults.gamma.concat()}}Z(oB,"type",oI),Z(oB,"defaults",{gamma:[1,1,1]}),Z(oB,"uniformLocations",["uGamma"]),tY.setClass(oB);let oN={average:"\n precision highp float;\n uniform sampler2D uTexture;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n float average = (color.r + color.b + color.g) / 3.0;\n gl_FragColor = vec4(average, average, average, color.a);\n }\n ",lightness:"\n precision highp float;\n uniform sampler2D uTexture;\n uniform int uMode;\n varying vec2 vTexCoord;\n void main() {\n vec4 col = texture2D(uTexture, vTexCoord);\n float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\n gl_FragColor = vec4(average, average, average, col.a);\n }\n ",luminosity:"\n precision highp float;\n uniform sampler2D uTexture;\n uniform int uMode;\n varying vec2 vTexCoord;\n void main() {\n vec4 col = texture2D(uTexture, vTexCoord);\n float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\n gl_FragColor = vec4(average, average, average, col.a);\n }\n "};class oW extends op{applyTo2d(t){let{imageData:{data:e}}=t;for(let t,r=0;rn[0]&&i>n[1]&&o>n[2]&&r"\n color += texture2D(uTexture, vTexCoord + ".concat(t,") * uTaps[").concat(e,"] + texture2D(uTexture, vTexCoord - ").concat(t,") * uTaps[").concat(e,"];\n sum += 2.0 * uTaps[").concat(e,"];\n ")).join("\n"),"\n gl_FragColor = color / sum;\n }\n ")}applyToForWebgl(t){t.passes++,this.width=t.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=t.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),t.destinationWidth=this.dW,super.applyTo(t),t.sourceWidth=t.destinationWidth,this.height=t.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),t.destinationHeight=this.dH,super.applyTo(t),t.sourceHeight=t.destinationHeight}applyTo(t){void 0!==t.webgl?this.applyToForWebgl(t):this.applyTo2d(t)}isNeutralState(){return 1===this.scaleX&&1===this.scaleY}lanczosCreate(t){return e=>{if(e>=t||e<=-t)return 0;if(e<11920929e-14&&e>-11920929e-14)return 1;let r=(e*=Math.PI)/t;return Math.sin(e)/e*Math.sin(r)/r}}applyTo2d(t){let e,r=t.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;let s=r.width,o=r.height,a=Math.round(s*i),l=Math.round(o*n);e="sliceHack"===this.resizeType?this.sliceByTwo(t,s,o,a,l):"hermite"===this.resizeType?this.hermiteFastResize(t,s,o,a,l):"bilinear"===this.resizeType?this.bilinearFiltering(t,s,o,a,l):"lanczos"===this.resizeType?this.lanczosResize(t,s,o,a,l):new ImageData(a,l),t.imageData=e}sliceByTwo(t,e,r,i,n){let s=t.imageData,o=!1,a=!1,l=.5*e,h=.5*r,c=t.filterBackend.resources,u=0,d=0,f=e,g=0;c.sliceByTwo||(c.sliceByTwo=t9());let p=c.sliceByTwo;(p.width<1.5*e||p.height=e)){p[E=Math.floor(1e3*Math.abs(_-m.x))]||(p[E]={});for(let t=y.y-g;t<=y.y+g;t++)t<0||t>=r||(D=Math.floor(1e3*Math.abs(t-m.y)),p[E][D]||(p[E][D]=l(Math.sqrt(Math.pow(E*u,2)+Math.pow(D*d,2))/1e3)),(w=p[E][D])>0&&(C=4*(t*e+_),S+=w,T+=w*s[C],O+=w*s[C+1],k+=w*s[C+2],M+=w*s[C+3]))}a[C=4*(b*i+x)]=T/S,a[C+1]=O/S,a[C+2]=k/S,a[C+3]=M/S}return++x1&&s<-1||(c=2*s*s*s-3*s*s+1)>0&&(y+=c*h[(r=4*(t+i*e))+3],f+=c,h[r+3]<255&&(c=c*h[r+3]/250),g+=c*h[r],p+=c*h[r+1],m+=c*h[r+2],d+=c)}}u[n]=g/d,u[n+1]=p/d,u[n+2]=m/d,u[n+3]=y/f}return c}}Z(oG,"type","Resize"),Z(oG,"defaults",{resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3}),Z(oG,"uniformLocations",["uDelta","uTaps"]),tY.setClass(oG);class oq extends op{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform float uSaturation;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n float rgMax = max(color.r, color.g);\n float rgbMax = max(rgMax, color.b);\n color.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\n color.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\n color.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\n gl_FragColor = color;\n }\n"}applyTo2d(t){let{imageData:{data:e}}=t,r=-this.saturation;for(let t=0;t({x:t,y:t}),o9={left:"right",right:"left",bottom:"top",top:"bottom"},o6={start:"end",end:"start"};function o8(t,e){return"function"==typeof t?t(e):t}function o7(t){return t.split("-")[0]}function at(t){return t.split("-")[1]}function ae(t){return"y"===t?"height":"width"}let ar=new Set(["top","bottom"]);function ai(t){return ar.has(o7(t))?"y":"x"}function an(t){return"x"===ai(t)?"y":"x"}function as(t){return t.replace(/start|end/g,t=>o6[t])}let ao=["left","right"],aa=["right","left"],al=["top","bottom"],ah=["bottom","top"];function ac(t){return t.replace(/left|right|bottom|top/g,t=>o9[t])}function au(t){let{x:e,y:r,width:i,height:n}=t;return{width:i,height:n,top:r,left:e,right:e+i,bottom:r+n,x:e,y:r}}function ad(t,e,r){let i,{reference:n,floating:s}=t,o=ai(e),a=an(e),l=ae(a),h=o7(e),c="y"===o,u=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,f=n[l]/2-s[l]/2;switch(h){case"top":i={x:u,y:n.y-s.height};break;case"bottom":i={x:u,y:n.y+n.height};break;case"right":i={x:n.x+n.width,y:d};break;case"left":i={x:n.x-s.width,y:d};break;default:i={x:n.x,y:n.y}}switch(at(e)){case"start":i[a]-=f*(r&&c?-1:1);break;case"end":i[a]+=f*(r&&c?-1:1)}return i}let af=async(t,e,r)=>{let{placement:i="bottom",strategy:n="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),l=await (null==o.isRTL?void 0:o.isRTL(e)),h=await o.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:u}=ad(h,i,l),d=i,f={},g=0;for(let r=0;r{try{return t.matches(e)}catch(t){return!1}})}let aD=["transform","translate","scale","rotate","perspective"],aj=["transform","translate","scale","rotate","perspective","filter"],aA=["paint","layout","strict","content"];function aP(t){let e=aF(),r=aw(t)?aI(t):t;return aD.some(t=>!!r[t]&&"none"!==r[t])||!!r.containerType&&"normal"!==r.containerType||!e&&!!r.backdropFilter&&"none"!==r.backdropFilter||!e&&!!r.filter&&"none"!==r.filter||aj.some(t=>(r.willChange||"").includes(t))||aA.some(t=>(r.contain||"").includes(t))}function aF(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let aL=new Set(["html","body","#document"]);function aR(t){return aL.has(ay(t))}function aI(t){return ax(t).getComputedStyle(t)}function aB(t){return aw(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function aN(t){if("html"===ay(t))return t;let e=t.assignedSlot||t.parentNode||aS(t)&&t.host||ab(t);return aS(e)?e.host:e}function aW(t,e,r){var i;void 0===e&&(e=[]),void 0===r&&(r=!0);let n=function t(e){let r=aN(e);return aR(r)?e.ownerDocument?e.ownerDocument.body:e.body:aC(r)&&aO(r)?r:t(r)}(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=ax(n);if(s){let t=aU(o);return e.concat(o,o.visualViewport||[],aO(n)?n:[],t&&r?aW(t):[])}return e.concat(n,aW(n,[],r))}function aU(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function aH(t){let e=aI(t),r=parseFloat(e.width)||0,i=parseFloat(e.height)||0,n=aC(t),s=n?t.offsetWidth:r,o=n?t.offsetHeight:i,a=o5(r)!==s||o5(i)!==o;return a&&(r=s,i=o),{width:r,height:i,$:a}}function aX(t){return aw(t)?t:t.contextElement}function aV(t){let e=aX(t);if(!aC(e))return o3(1);let r=e.getBoundingClientRect(),{width:i,height:n,$:s}=aH(e),o=(s?o5(r.width):r.width)/i,a=(s?o5(r.height):r.height)/n;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}let aY=o3(0);function az(t){let e=ax(t);return aF()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:aY}function aG(t,e,r,i){var n;void 0===e&&(e=!1),void 0===r&&(r=!1);let s=t.getBoundingClientRect(),o=aX(t),a=o3(1);e&&(i?aw(i)&&(a=aV(i)):a=aV(t));let l=(void 0===(n=r)&&(n=!1),i&&(!n||i===ax(o))&&n)?az(o):o3(0),h=(s.left+l.x)/a.x,c=(s.top+l.y)/a.y,u=s.width/a.x,d=s.height/a.y;if(o){let t=ax(o),e=i&&aw(i)?ax(i):i,r=t,n=aU(r);for(;n&&i&&e!==r;){let t=aV(n),e=n.getBoundingClientRect(),i=aI(n),s=e.left+(n.clientLeft+parseFloat(i.paddingLeft))*t.x,o=e.top+(n.clientTop+parseFloat(i.paddingTop))*t.y;h*=t.x,c*=t.y,u*=t.x,d*=t.y,h+=s,c+=o,n=aU(r=ax(n))}}return au({width:u,height:d,x:h,y:c})}function aq(t,e){let r=aB(t).scrollLeft;return e?e.left+r:aG(ab(t)).left+r}function aK(t,e){let r=t.getBoundingClientRect();return{x:r.left+e.scrollLeft-aq(t,r),y:r.top+e.scrollTop}}let aQ=new Set(["absolute","fixed"]);function aJ(t,e,r){let i;if("viewport"===e)i=function(t,e){let r=ax(t),i=ab(t),n=r.visualViewport,s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;let t=aF();(!t||t&&"fixed"===e)&&(a=n.offsetLeft,l=n.offsetTop)}let h=aq(i);if(h<=0){let t=i.ownerDocument,e=t.body,r=getComputedStyle(e),n="CSS1Compat"===t.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,o=Math.abs(i.clientWidth-e.clientWidth-n);o<=25&&(s-=o)}else h<=25&&(s+=h);return{width:s,height:o,x:a,y:l}}(t,r);else if("document"===e)i=function(t){let e=ab(t),r=aB(t),i=t.ownerDocument.body,n=o2(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=o2(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),o=-r.scrollLeft+aq(t),a=-r.scrollTop;return"rtl"===aI(i).direction&&(o+=o2(e.clientWidth,i.clientWidth)-n),{width:n,height:s,x:o,y:a}}(ab(t));else if(aw(e))i=function(t,e){let r=aG(t,!0,"fixed"===e),i=r.top+t.clientTop,n=r.left+t.clientLeft,s=aC(t)?aV(t):o3(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y;return{width:o,height:a,x:n*s.x,y:i*s.y}}(e,r);else{let r=az(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return au(i)}function aZ(t){return"static"===aI(t).position}function a$(t,e){if(!aC(t)||"fixed"===aI(t).position)return null;if(e)return e(t);let r=t.offsetParent;return ab(t)===r&&(r=r.ownerDocument.body),r}function a0(t,e){var r;let i=ax(t);if(aE(t))return i;if(!aC(t)){let e=aN(t);for(;e&&!aR(e);){if(aw(e)&&!aZ(e))return e;e=aN(e)}return i}let n=a$(t,e);for(;n&&(r=n,ak.has(ay(r)))&&aZ(n);)n=a$(n,e);return n&&aR(n)&&aZ(n)&&!aP(n)?i:n||function(t){let e=aN(t);for(;aC(e)&&!aR(e);){if(aP(e))return e;if(aE(e))break;e=aN(e)}return null}(t)||i}let a1=async function(t){let e=this.getOffsetParent||a0,r=this.getDimensions,i=await r(t.floating);return{reference:function(t,e,r){let i=aC(e),n=ab(e),s="fixed"===r,o=aG(t,!0,s,e),a={scrollLeft:0,scrollTop:0},l=o3(0);if(i||!i&&!s)if(("body"!==ay(e)||aO(n))&&(a=aB(e)),i){let t=aG(e,!0,s,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else n&&(l.x=aq(n));s&&!i&&n&&(l.x=aq(n));let h=!n||i||s?o3(0):aK(n,a);return{x:o.left+a.scrollLeft-l.x-h.x,y:o.top+a.scrollTop-l.y-h.y,width:o.width,height:o.height}}(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},a2={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:r,offsetParent:i,strategy:n}=t,s="fixed"===n,o=ab(i),a=!!e&&aE(e.floating);if(i===o||a&&s)return r;let l={scrollLeft:0,scrollTop:0},h=o3(1),c=o3(0),u=aC(i);if((u||!u&&!s)&&(("body"!==ay(i)||aO(o))&&(l=aB(i)),aC(i))){let t=aG(i);h=aV(i),c.x=t.x+i.clientLeft,c.y=t.y+i.clientTop}let d=!o||u||s?o3(0):aK(o,l);return{width:r.width*h.x,height:r.height*h.y,x:r.x*h.x-l.scrollLeft*h.x+c.x+d.x,y:r.y*h.y-l.scrollTop*h.y+c.y+d.y}},getDocumentElement:ab,getClippingRect:function(t){let{element:e,boundary:r,rootBoundary:i,strategy:n}=t,s=[..."clippingAncestors"===r?aE(e)?[]:function(t,e){let r=e.get(t);if(r)return r;let i=aW(t,[],!1).filter(t=>aw(t)&&"body"!==ay(t)),n=null,s="fixed"===aI(t).position,o=s?aN(t):t;for(;aw(o)&&!aR(o);){let e=aI(o),r=aP(o);r||"fixed"!==e.position||(n=null),(s?!r&&!n:!r&&"static"===e.position&&!!n&&aQ.has(n.position)||aO(o)&&!r&&function t(e,r){let i=aN(e);return!(i===r||!aw(i)||aR(i))&&("fixed"===aI(i).position||t(i,r))}(t,o))?i=i.filter(t=>t!==o):n=e,o=aN(o)}return e.set(t,i),i}(e,this._c):[].concat(r),i],o=s[0],a=s.reduce((t,r)=>{let i=aJ(e,r,n);return t.top=o2(i.top,t.top),t.right=o1(i.right,t.right),t.bottom=o1(i.bottom,t.bottom),t.left=o2(i.left,t.left),t},aJ(e,o,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:a0,getElementRects:a1,getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){let{width:e,height:r}=aH(t);return{width:e,height:r}},getScale:aV,isElement:aw,isRTL:function(t){return"rtl"===aI(t).direction}};function a5(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function a4(t,e,r,i){let n;void 0===i&&(i={});let{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:h=!1}=i,c=aX(t),u=s||o?[...c?aW(c):[],...aW(e)]:[];u.forEach(t=>{s&&t.addEventListener("scroll",r,{passive:!0}),o&&t.addEventListener("resize",r)});let d=c&&l?function(t,e){let r,i=null,n=ab(t);function s(){var t;clearTimeout(r),null==(t=i)||t.disconnect(),i=null}return!function o(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),s();let h=t.getBoundingClientRect(),{left:c,top:u,width:d,height:f}=h;if(a||e(),!d||!f)return;let g=o4(u),p=o4(n.clientWidth-(c+d)),m={rootMargin:-g+"px "+-p+"px "+-o4(n.clientHeight-(u+f))+"px "+-o4(c)+"px",threshold:o2(0,o1(1,l))||1},y=!0;function x(e){let i=e[0].intersectionRatio;if(i!==l){if(!y)return o();i?o(!1,i):r=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==i||a5(h,t.getBoundingClientRect())||o(),y=!1}try{i=new IntersectionObserver(x,{...m,root:n.ownerDocument})}catch(t){i=new IntersectionObserver(x,m)}i.observe(t)}(!0),s}(c,r):null,f=-1,g=null;a&&(g=new ResizeObserver(t=>{let[i]=t;i&&i.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;null==(t=g)||t.observe(e)})),r()}),c&&!h&&g.observe(c),g.observe(e));let p=h?aG(t):null;return h&&function e(){let i=aG(t);p&&!a5(p,i)&&r(),p=i,n=requestAnimationFrame(e)}(),r(),()=>{var t;u.forEach(t=>{s&&t.removeEventListener("scroll",r),o&&t.removeEventListener("resize",r)}),null==d||d(),null==(t=g)||t.disconnect(),g=null,h&&cancelAnimationFrame(n)}}var a3=t.i(74080),a9="undefined"!=typeof document?J.useLayoutEffect:function(){};function a6(t,e){let r,i,n;if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!==e.length)return!1;for(i=r;0!=i--;)if(!a6(t[i],e[i]))return!1;return!0}if((r=(n=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(i=r;0!=i--;)if(!({}).hasOwnProperty.call(e,n[i]))return!1;for(i=r;0!=i--;){let r=n[i];if(("_owner"!==r||!t.$$typeof)&&!a6(t[r],e[r]))return!1}return!0}return t!=t&&e!=e}function a8(t){return"undefined"==typeof window?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function a7(t,e){let r=a8(t);return Math.round(e*r)/r}function lt(t){let e=J.useRef(t);return a9(()=>{e.current=t}),e}let le=(t,e)=>({...function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var r,i;let{x:n,y:s,placement:o,middlewareData:a}=e,l=await am(e,t);return o===(null==(r=a.offset)?void 0:r.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:n+l.x,y:s+l.y,data:{...l,placement:o}}}}}(t),options:[t,e]}),lr=(t,e)=>({...function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var r,i,n,s,o;let{placement:a,middlewareData:l,rects:h,initialPlacement:c,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...b}=o8(t,e);if(null!=(r=l.arrow)&&r.alignmentOffset)return{};let _=o7(a),w=ai(c),C=o7(c)===c,S=await (null==u.isRTL?void 0:u.isRTL(d.floating)),T=p||(C||!x?[ac(c)]:function(t){let e=ac(t);return[as(t),e,as(e)]}(c)),O="none"!==y;!p&&O&&T.push(...function(t,e,r,i){let n=at(t),s=function(t,e,r){switch(t){case"top":case"bottom":if(r)return e?aa:ao;return e?ao:aa;case"left":case"right":return e?al:ah;default:return[]}}(o7(t),"start"===r,i);return n&&(s=s.map(t=>t+"-"+n),e&&(s=s.concat(s.map(as)))),s}(c,x,y,S));let k=[c,...T],M=await ag(e,b),E=[],D=(null==(i=l.flip)?void 0:i.overflows)||[];if(f&&E.push(M[_]),g){let t=function(t,e,r){void 0===r&&(r=!1);let i=at(t),n=an(t),s=ae(n),o="x"===n?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=ac(o)),[o,ac(o)]}(a,h,S);E.push(M[t[0]],M[t[1]])}if(D=[...D,{placement:a,overflows:E}],!E.every(t=>t<=0)){let t=((null==(n=l.flip)?void 0:n.index)||0)+1,e=k[t];if(e&&("alignment"!==g||w===ai(e)||D.every(t=>ai(t.placement)!==w||t.overflows[0]>0)))return{data:{index:t,overflows:D},reset:{placement:e}};let r=null==(s=D.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:s.placement;if(!r)switch(m){case"bestFit":{let t=null==(o=D.filter(t=>{if(O){let e=ai(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:o[0];t&&(r=t);break}case"initialPlacement":r=c}if(a!==r)return{reset:{placement:r}}}return{}}}}(t),options:[t,e]});t.i(47167);var li='input:not([inert]),select:not([inert]),textarea:not([inert]),a[href]:not([inert]),button:not([inert]),[tabindex]:not(slot):not([inert]),audio[controls]:not([inert]),video[controls]:not([inert]),[contenteditable]:not([contenteditable="false"]):not([inert]),details>summary:first-of-type:not([inert]),details:not([inert])',ln="undefined"==typeof Element,ls=ln?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,lo=!ln&&Element.prototype.getRootNode?function(t){var e;return null==t||null==(e=t.getRootNode)?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},la=function t(e,r){void 0===r&&(r=!0);var i,n=null==e||null==(i=e.getAttribute)?void 0:i.call(e,"inert");return""===n||"true"===n||r&&e&&t(e.parentNode)},ll=function(t){var e,r=null==t||null==(e=t.getAttribute)?void 0:e.call(t,"contenteditable");return""===r||"true"===r},lh=function(t,e,r){if(la(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(li));return e&&ls.call(t,li)&&i.unshift(t),i=i.filter(r)},lc=function t(e,r,i){for(var n=[],s=Array.from(e);s.length;){var o=s.shift();if(!la(o,!1))if("SLOT"===o.tagName){var a=o.assignedElements(),l=t(a.length?a:o.children,!0,i);i.flatten?n.push.apply(n,l):n.push({scopeParent:o,candidates:l})}else{ls.call(o,li)&&i.filter(o)&&(r||!e.includes(o))&&n.push(o);var h=o.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(o),c=!la(h,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(o));if(h&&c){var u=t(!0===h?o.children:h.children,!0,i);i.flatten?n.push.apply(n,u):n.push({scopeParent:o,candidates:u})}else s.unshift.apply(s,o.children)}}return n},lu=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ld=function(t){if(!t)throw Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ll(t))&&!lu(t)?0:t.tabIndex},lf=function(t,e){var r=ld(t);return r<0&&e&&!lu(t)?0:r},lg=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},lp=function(t){return"INPUT"===t.tagName},lm=function(t,e){for(var r=0;rsummary:first-of-type")?t.parentElement:t;if(ls.call(n,"details:not([open]) *"))return!0;if(r&&"full"!==r&&"legacy-full"!==r){if("non-zero-area"===r)return lb(t)}else{if("function"==typeof i){for(var s=t;t;){var o=t.parentElement,a=lo(t);if(o&&!o.shadowRoot&&!0===i(o))return lb(t);t=t.assignedSlot?t.assignedSlot:o||a===t.ownerDocument?o:a.host}t=s}if(lx(t))return!t.getClientRects().length;if("legacy-full"!==r)return!0}return!1},lw=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var r=0;rld(e))&&!!lC(t,e)},lT=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!isNaN(e)||!!(e>=0)},lO=function t(e){var r=[],i=[];return e.forEach(function(e,n){var s=!!e.scopeParent,o=s?e.scopeParent:e,a=lf(o,s),l=s?t(e.candidates):o;0===a?s?r.push.apply(r,l):r.push(o):i.push({documentOrder:n,tabIndex:a,item:e,isScope:s,content:l})}),i.sort(lg).reduce(function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t},[]).concat(r)},lk=function(t,e){return lO((e=e||{}).getShadowRoot?lc([t],e.includeContainer,{filter:lS.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:lT}):lh(t,e.includeContainer,lS.bind(null,e)))},lM=function(t,e){return(e=e||{}).getShadowRoot?lc([t],e.includeContainer,{filter:lC.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):lh(t,e.includeContainer,lC.bind(null,e))},lE=function(t,e){if(e=e||{},!t)throw Error("No node provided");return!1!==ls.call(t,li)&&lS(e,t)};function lD(){let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(t=>{let{brand:e,version:r}=t;return e+"/"+r}).join(" "):navigator.userAgent}function lj(){let t=/android/i;return t.test(function(){let t=navigator.userAgentData;return null!=t&&t.platform?t.platform:navigator.platform}())||t.test(lD())}let lA="data-floating-ui-focusable";function lP(t){let e=t.activeElement;for(;(null==(r=e)||null==(r=r.shadowRoot)?void 0:r.activeElement)!=null;){var r;e=e.shadowRoot.activeElement}return e}function lF(t,e){if(!t||!e)return!1;let r=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(r&&aS(r)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function lL(t){return"composedPath"in t?t.composedPath()[0]:t.target}function lR(t,e){return null!=e&&("composedPath"in t?t.composedPath().includes(e):null!=t.target&&e.contains(t.target))}function lI(t){return(null==t?void 0:t.ownerDocument)||document}function lB(t){return aC(t)&&t.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function lN(t){return!!t&&"combobox"===t.getAttribute("role")&&lB(t)}function lW(t){return t?t.hasAttribute(lA)?t:t.querySelector("["+lA+"]")||t:null}function lU(t,e,r){return void 0===r&&(r=!0),t.filter(t=>{var i;return t.parentId===e&&(!r||(null==(i=t.context)?void 0:i.open))}).flatMap(e=>[e,...lU(t,e.id,r)])}function lH(t,e){var r;let i=[],n=null==(r=t.find(t=>t.id===e))?void 0:r.parentId;for(;n;){let e=t.find(t=>t.id===n);n=null==e?void 0:e.parentId,e&&(i=i.concat(e))}return i}function lX(t){t.preventDefault(),t.stopPropagation()}function lV(t,e){let r=["mouse","pen"];return e||r.push("",void 0),r.includes(t)}var lY="undefined"!=typeof document?J.useLayoutEffect:function(){};function lz(t){let e=J.useRef(t);return lY(()=>{e.current=t}),e}let lG={...J}.useInsertionEffect||(t=>t());function lq(t){let e=J.useRef(()=>{});return lG(()=>{e.current=t}),J.useCallback(function(){for(var t=arguments.length,r=Array(t),i=0;i({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function lQ(t,e){let r=lk(t,lK()),i=r.length;if(0===i)return;let n=lP(lI(t)),s=r.indexOf(n);return r[-1===s?1===e?0:i-1:s+e]}function lJ(t,e){let r=e||t.currentTarget,i=t.relatedTarget;return!i||!lF(r,i)}let lZ="active",l$="selected",l0={...J},l1=!1,l2=0,l5=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+l2++,l4=l0.useId||function(){let[t,e]=J.useState(()=>l1?l5():void 0);return lY(()=>{null==t&&e(l5())},[]),J.useEffect(()=>{l1=!0},[]),t},l3=J.createContext(null),l9=J.createContext(null),l6=()=>{var t;return(null==(t=J.useContext(l3))?void 0:t.id)||null},l8=()=>J.useContext(l9);function l7(t){return"data-floating-ui-"+t}let ht=0;function he(t,e){void 0===e&&(e={});let{preventScroll:r=!1,cancelPrevious:i=!0,sync:n=!1}=e;i&&cancelAnimationFrame(ht);let s=()=>null==t?void 0:t.focus({preventScroll:r});n?s():ht=requestAnimationFrame(s)}let hr={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function hi(t){return"inert"===t?hr.inert:"aria-hidden"===t?hr["aria-hidden"]:hr.none}let hn=new WeakSet,hs={},ho=0,ha=t=>t&&(t.host||ha(t.parentNode));function hl(t,e,r){var i;void 0===e&&(e=!1),void 0===r&&(r=!1);let n=((null==(i=t[0])?void 0:i.ownerDocument)||document).body;return function(t,e,r,i){let n="data-floating-ui-inert",s=i?"inert":r?"aria-hidden":null,o=t.map(t=>{if(e.contains(t))return t;let r=ha(t);return e.contains(r)?r:null}).filter(t=>null!=t),a=new Set,l=new Set(o),h=[];hs[n]||(hs[n]=new WeakMap);let c=hs[n];return o.forEach(function t(e){!(!e||a.has(e))&&(a.add(e),e.parentNode&&t(e.parentNode))}),function t(e){!e||l.has(e)||[].forEach.call(e.children,e=>{if("script"!==ay(e))if(a.has(e))t(e);else{let t=s?e.getAttribute(s):null,r=null!==t&&"false"!==t,i=hi(s),o=(i.get(e)||0)+1,a=(c.get(e)||0)+1;i.set(e,o),c.set(e,a),h.push(e),1===o&&r&&hn.add(e),1===a&&e.setAttribute(n,""),!r&&s&&e.setAttribute(s,"inert"===s?"":"true")}})}(e),a.clear(),ho++,()=>{h.forEach(t=>{let e=hi(s),r=(e.get(t)||0)-1,i=(c.get(t)||0)-1;e.set(t,r),c.set(t,i),r||(!hn.has(t)&&s&&t.removeAttribute(s),hn.delete(t)),i||t.removeAttribute(n)}),--ho||(hr.inert=new WeakMap,hr["aria-hidden"]=new WeakMap,hr.none=new WeakMap,hn=new WeakSet,hs={})}}(t.concat(Array.from(n.querySelectorAll('[aria-live],[role="status"],output'))),n,e,r)}let hh={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},hc=J.forwardRef(function(t,e){let[r,i]=J.useState();lY(()=>{/apple/i.test(navigator.vendor)&&i("button")},[]);let n={ref:e,tabIndex:0,role:r,"aria-hidden":!r||void 0,[l7("focus-guard")]:"",style:hh};return(0,Q.jsx)("span",{...t,...n})}),hu=J.createContext(null);function hd(t){return J.useMemo(()=>e=>{t.forEach(t=>{t&&(t.current=e)})},t)}let hf=[];function hg(){hf=hf.filter(t=>t.isConnected)}function hp(){return hg(),hf[hf.length-1]}function hm(t,e){var r;if(!e.current.includes("floating")&&!(null!=(r=t.getAttribute("role"))&&r.includes("dialog")))return;let i=lK(),n=lM(t,i).filter(t=>{let e=t.getAttribute("data-tabindex")||"";return lE(t,i)||t.hasAttribute("data-tabindex")&&!e.startsWith("-")}),s=t.getAttribute("tabindex");e.current.includes("floating")||0===n.length?"0"!==s&&t.setAttribute("tabindex","0"):("-1"!==s||t.hasAttribute("data-tabindex")&&"-1"!==t.getAttribute("data-tabindex"))&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}let hv=J.forwardRef(function(t,e){return(0,Q.jsx)("button",{...t,type:"button",ref:e,tabIndex:-1,style:hh})});function hy(t){let{context:e,children:r,disabled:i=!1,order:n=["content"],guards:s=!0,initialFocus:o=0,returnFocus:a=!0,restoreFocus:l=!1,modal:h=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:u=!0,outsideElementsInert:d=!1,getInsideElements:f=()=>[]}=t,{open:g,onOpenChange:p,events:m,dataRef:y,elements:{domReference:x,floating:b}}=e,_=lq(()=>{var t;return null==(t=y.current.floatingContext)?void 0:t.nodeId}),w=lq(f),C="number"==typeof o&&o<0,S=lN(x)&&C,T="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,O=!T||s,k=!O||T&&d,M=lz(n),E=lz(o),D=lz(a),j=l8(),A=J.useContext(hu),P=J.useRef(null),F=J.useRef(null),L=J.useRef(!1),R=J.useRef(!1),I=J.useRef(-1),B=J.useRef(-1),N=null!=A,W=lW(b),U=lq(function(t){return void 0===t&&(t=W),t?lk(t,lK()):[]}),H=lq(t=>{let e=U(t);return M.current.map(t=>x&&"reference"===t?x:W&&"floating"===t?W:e).filter(Boolean).flat()});J.useEffect(()=>{if(i||!h)return;function t(t){if("Tab"===t.key){lF(W,lP(lI(W)))&&0===U().length&&!S&&lX(t);let e=H(),r=lL(t);"reference"===M.current[0]&&r===x&&(lX(t),t.shiftKey?he(e[e.length-1]):he(e[1])),"floating"===M.current[1]&&r===W&&t.shiftKey&&(lX(t),he(e[0]))}}let e=lI(W);return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[i,x,W,h,M,S,U,H]),J.useEffect(()=>{if(!i&&b)return b.addEventListener("focusin",t),()=>{b.removeEventListener("focusin",t)};function t(t){let e=lL(t),r=U().indexOf(e);-1!==r&&(I.current=r)}},[i,b,U]),J.useEffect(()=>{if(i||!u)return;function t(){R.current=!0,setTimeout(()=>{R.current=!1})}function e(t){let e=t.relatedTarget,r=t.currentTarget,i=lL(t);queueMicrotask(()=>{let n=_(),s=!(lF(x,e)||lF(b,e)||lF(e,b)||lF(null==A?void 0:A.portalNode,e)||null!=e&&e.hasAttribute(l7("focus-guard"))||j&&(lU(j.nodesRef.current,n).find(t=>{var r,i;return lF(null==(r=t.context)?void 0:r.elements.floating,e)||lF(null==(i=t.context)?void 0:i.elements.domReference,e)})||lH(j.nodesRef.current,n).find(t=>{var r,i,n;return[null==(r=t.context)?void 0:r.elements.floating,lW(null==(i=t.context)?void 0:i.elements.floating)].includes(e)||(null==(n=t.context)?void 0:n.elements.domReference)===e})));if(r===x&&W&&hm(W,M),l&&r!==x&&!(null!=i&&i.isConnected)&&lP(lI(W))===lI(W).body){aC(W)&&W.focus();let t=I.current,e=U(),r=e[t]||e[e.length-1]||W;aC(r)&&r.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(S||!h)&&e&&s&&!R.current&&e!==hp()&&(L.current=!0,p(!1,t,"focus-out"))})}let r=!!(!j&&A);function n(){-1!==B.current&&(clearTimeout(B.current),B.current=-1),y.current.insideReactTree=!0,B.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(b&&aC(x))return x.addEventListener("focusout",e),x.addEventListener("pointerdown",t),b.addEventListener("focusout",e),r&&b.addEventListener("focusout",n,!0),()=>{x.removeEventListener("focusout",e),x.removeEventListener("pointerdown",t),b.removeEventListener("focusout",e),r&&b.removeEventListener("focusout",n,!0)}},[i,x,b,W,h,j,A,p,u,l,U,S,_,M,y]);let X=J.useRef(null),V=J.useRef(null),Y=hd([X,null==A?void 0:A.beforeInsideRef]),z=hd([V,null==A?void 0:A.afterInsideRef]);function G(t){return!i&&c&&h?(0,Q.jsx)(hv,{ref:"start"===t?P:F,onClick:t=>p(!1,t.nativeEvent),children:"string"==typeof c?c:"Dismiss"}):null}J.useEffect(()=>{var t,e;if(i||!b)return;let r=Array.from((null==A||null==(t=A.portalNode)?void 0:t.querySelectorAll("["+l7("portal")+"]"))||[]),n=[b,null==(e=(j?lH(j.nodesRef.current,_()):[]).find(t=>{var e;return lN((null==(e=t.context)?void 0:e.elements.domReference)||null)}))||null==(e=e.context)?void 0:e.elements.domReference,...r,...w(),P.current,F.current,X.current,V.current,null==A?void 0:A.beforeOutsideRef.current,null==A?void 0:A.afterOutsideRef.current,M.current.includes("reference")||S?x:null].filter(t=>null!=t),s=h||S?hl(n,!k,k):hl(n);return()=>{s()}},[i,x,b,h,M,A,S,O,k,j,_,w]),lY(()=>{if(i||!aC(W))return;let t=lP(lI(W));queueMicrotask(()=>{let e=H(W),r=E.current,i=("number"==typeof r?e[r]:r.current)||W,n=lF(W,t);C||n||!g||he(i,{preventScroll:i===W})})},[i,g,W,C,H,E]),lY(()=>{var t;if(i||!W)return;let e=lI(W);function r(t){let{reason:e,event:r,nested:i}=t;if(["hover","safe-polygon"].includes(e)&&"mouseleave"===r.type&&(L.current=!0),"outside-press"===e)if(i)L.current=!1;else if(0===r.mozInputSource&&r.isTrusted||(lj()&&r.pointerType?"click"===r.type&&1===r.buttons:0===r.detail&&!r.pointerType)||!lD().includes("jsdom/")&&(!lj()&&0===r.width&&0===r.height||lj()&&1===r.width&&1===r.height&&0===r.pressure&&0===r.detail&&"mouse"===r.pointerType||r.width<1&&r.height<1&&0===r.pressure&&0===r.detail&&"touch"===r.pointerType))L.current=!1;else{let t=!1;document.createElement("div").focus({get preventScroll(){return t=!0,!1}}),t?L.current=!1:L.current=!0}}t=lP(e),hg(),t&&"body"!==ay(t)&&(hf.push(t),hf.length>20&&(hf=hf.slice(-20))),m.on("openchange",r);let n=e.createElement("span");return n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),Object.assign(n.style,hh),N&&x&&x.insertAdjacentElement("afterend",n),()=>{m.off("openchange",r);let t=lP(e),i=lF(b,t)||j&&lU(j.nodesRef.current,_(),!1).some(e=>{var r;return lF(null==(r=e.context)?void 0:r.elements.floating,t)}),s=function(){if("boolean"==typeof D.current){let t=x||hp();return t&&t.isConnected?t:n}return D.current.current||n}();queueMicrotask(()=>{let r=function(t){let e=lK();return lE(t,e)?t:lk(t,e)[0]||t}(s);D.current&&!L.current&&aC(r)&&(r===t||t===e.body||i)&&r.focus({preventScroll:!0}),n.remove()})}},[i,b,W,D,y,m,j,N,x,_]),J.useEffect(()=>(queueMicrotask(()=>{L.current=!1}),()=>{queueMicrotask(hg)}),[i]),lY(()=>{if(!i&&A)return A.setFocusManagerState({modal:h,closeOnFocusOut:u,open:g,onOpenChange:p,domReference:x}),()=>{A.setFocusManagerState(null)}},[i,A,h,g,p,u,x]),lY(()=>{!i&&W&&hm(W,M)},[i,W,M]);let q=!i&&O&&(!h||!S)&&(N||h);return(0,Q.jsxs)(Q.Fragment,{children:[q&&(0,Q.jsx)(hc,{"data-type":"inside",ref:Y,onFocus:t=>{var e;if(h){let t=H();he("reference"===n[0]?t[0]:t[t.length-1])}else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(L.current=!1,lJ(t,A.portalNode)){let t=lQ(lI(x).body,1)||x;null==t||t.focus()}else null==(e=A.beforeOutsideRef.current)||e.focus()}}),!S&&G("start"),r,G("end"),q&&(0,Q.jsx)(hc,{"data-type":"inside",ref:z,onFocus:t=>{var e;if(h)he(H()[0]);else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(u&&(L.current=!0),lJ(t,A.portalNode)){let t=lQ(lI(x).body,-1)||x;null==t||t.focus()}else null==(e=A.afterOutsideRef.current)||e.focus()}})]})}function hx(t){return aC(t.target)&&"BUTTON"===t.target.tagName}function hb(t,e){void 0===e&&(e={});let{open:r,onOpenChange:i,dataRef:n,elements:{domReference:s}}=t,{enabled:o=!0,event:a="click",toggle:l=!0,ignoreMouse:h=!1,keyboardHandlers:c=!0,stickIfOpen:u=!0}=e,d=J.useRef(),f=J.useRef(!1),g=J.useMemo(()=>({onPointerDown(t){d.current=t.pointerType},onMouseDown(t){let e=d.current;0===t.button&&"click"!==a&&(lV(e,!0)&&h||(r&&l&&(!n.current.openEvent||!u||"mousedown"===n.current.openEvent.type)?i(!1,t.nativeEvent,"click"):(t.preventDefault(),i(!0,t.nativeEvent,"click"))))},onClick(t){let e=d.current;if("mousedown"===a&&d.current){d.current=void 0;return}lV(e,!0)&&h||(r&&l&&(!n.current.openEvent||!u||"click"===n.current.openEvent.type)?i(!1,t.nativeEvent,"click"):i(!0,t.nativeEvent,"click"))},onKeyDown(t){d.current=void 0,!(t.defaultPrevented||!c||hx(t))&&(" "!==t.key||lB(s)||(t.preventDefault(),f.current=!0),aC(t.target)&&"A"===t.target.tagName||"Enter"!==t.key||(r&&l?i(!1,t.nativeEvent,"click"):i(!0,t.nativeEvent,"click")))},onKeyUp(t){!(t.defaultPrevented||!c||hx(t)||lB(s))&&" "===t.key&&f.current&&(f.current=!1,r&&l?i(!1,t.nativeEvent,"click"):i(!0,t.nativeEvent,"click"))}}),[n,s,a,h,c,i,r,u,l]);return J.useMemo(()=>o?{reference:g}:{},[o,g])}let h_={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},hw={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hC=t=>{var e,r;return{escapeKey:"boolean"==typeof t?t:null!=(e=null==t?void 0:t.escapeKey)&&e,outsidePress:"boolean"==typeof t?t:null==(r=null==t?void 0:t.outsidePress)||r}};function hS(t,e){void 0===e&&(e={});let{open:r,onOpenChange:i,elements:n,dataRef:s}=t,{enabled:o=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:h="pointerdown",referencePress:c=!1,referencePressEvent:u="pointerdown",ancestorScroll:d=!1,bubbles:f,capture:g}=e,p=l8(),m=lq("function"==typeof l?l:()=>!1),y="function"==typeof l?m:l,x=J.useRef(!1),{escapeKey:b,outsidePress:_}=hC(f),{escapeKey:w,outsidePress:C}=hC(g),S=J.useRef(!1),T=lq(t=>{var e;if(!r||!o||!a||"Escape"!==t.key||S.current)return;let n=null==(e=s.current.floatingContext)?void 0:e.nodeId,l=p?lU(p.nodesRef.current,n):[];if(!b&&(t.stopPropagation(),l.length>0)){let t=!0;if(l.forEach(e=>{var r;if(null!=(r=e.context)&&r.open&&!e.context.dataRef.current.__escapeKeyBubbles){t=!1;return}}),!t)return}i(!1,"nativeEvent"in t?t.nativeEvent:t,"escape-key")}),O=lq(t=>{var e;let r=()=>{var e;T(t),null==(e=lL(t))||e.removeEventListener("keydown",r)};null==(e=lL(t))||e.addEventListener("keydown",r)}),k=lq(t=>{var e;let r=s.current.insideReactTree;s.current.insideReactTree=!1;let o=x.current;if(x.current=!1,"click"===h&&o||r||"function"==typeof y&&!y(t))return;let a=lL(t),l="["+l7("inert")+"]",c=lI(n.floating).querySelectorAll(l),u=aw(a)?a:null;for(;u&&!aR(u);){let t=aN(u);if(aR(t)||!aw(t))break;u=t}if(c.length&&aw(a)&&!a.matches("html,body")&&!lF(a,n.floating)&&Array.from(c).every(t=>!lF(u,t)))return;if(aC(a)&&D){let e=aR(a),r=aI(a),i=/auto|scroll/,n=e||i.test(r.overflowX),s=e||i.test(r.overflowY),o=n&&a.clientWidth>0&&a.scrollWidth>a.clientWidth,l=s&&a.clientHeight>0&&a.scrollHeight>a.clientHeight,h="rtl"===r.direction,c=l&&(h?t.offsetX<=a.offsetWidth-a.clientWidth:t.offsetX>a.clientWidth),u=o&&t.offsetY>a.clientHeight;if(c||u)return}let d=null==(e=s.current.floatingContext)?void 0:e.nodeId,f=p&&lU(p.nodesRef.current,d).some(e=>{var r;return lR(t,null==(r=e.context)?void 0:r.elements.floating)});if(lR(t,n.floating)||lR(t,n.domReference)||f)return;let g=p?lU(p.nodesRef.current,d):[];if(g.length>0){let t=!0;if(g.forEach(e=>{var r;if(null!=(r=e.context)&&r.open&&!e.context.dataRef.current.__outsidePressBubbles){t=!1;return}}),!t)return}i(!1,t,"outside-press")}),M=lq(t=>{var e;let r=()=>{var e;k(t),null==(e=lL(t))||e.removeEventListener(h,r)};null==(e=lL(t))||e.addEventListener(h,r)});J.useEffect(()=>{if(!r||!o)return;s.current.__escapeKeyBubbles=b,s.current.__outsidePressBubbles=_;let t=-1;function e(t){i(!1,t,"ancestor-scroll")}function l(){window.clearTimeout(t),S.current=!0}function c(){t=window.setTimeout(()=>{S.current=!1},5*!!aF())}let u=lI(n.floating);a&&(u.addEventListener("keydown",w?O:T,w),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",c)),y&&u.addEventListener(h,C?M:k,C);let f=[];return d&&(aw(n.domReference)&&(f=aW(n.domReference)),aw(n.floating)&&(f=f.concat(aW(n.floating))),!aw(n.reference)&&n.reference&&n.reference.contextElement&&(f=f.concat(aW(n.reference.contextElement)))),(f=f.filter(t=>{var e;return t!==(null==(e=u.defaultView)?void 0:e.visualViewport)})).forEach(t=>{t.addEventListener("scroll",e,{passive:!0})}),()=>{a&&(u.removeEventListener("keydown",w?O:T,w),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",c)),y&&u.removeEventListener(h,C?M:k,C),f.forEach(t=>{t.removeEventListener("scroll",e)}),window.clearTimeout(t)}},[s,n,a,y,h,r,i,d,o,b,_,T,w,O,k,C,M]),J.useEffect(()=>{s.current.insideReactTree=!1},[s,y,h]);let E=J.useMemo(()=>({onKeyDown:T,...c&&{[h_[u]]:t=>{i(!1,t.nativeEvent,"reference-press")},..."click"!==u&&{onClick(t){i(!1,t.nativeEvent,"reference-press")}}}}),[T,i,c,u]),D=J.useMemo(()=>({onKeyDown:T,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[hw[h]]:()=>{s.current.insideReactTree=!0}}),[T,h,s]);return J.useMemo(()=>o?{reference:E,floating:D}:{},[o,E,D])}function hT(t){void 0===t&&(t={});let{nodeId:e}=t,r=function(t){let{open:e=!1,onOpenChange:r,elements:i}=t,n=l4(),s=J.useRef({}),[o]=J.useState(()=>(function(){let t=new Map;return{emit(e,r){var i;null==(i=t.get(e))||i.forEach(t=>t(r))},on(e,r){t.has(e)||t.set(e,new Set),t.get(e).add(r)},off(e,r){var i;null==(i=t.get(e))||i.delete(r)}}})()),a=null!=l6(),[l,h]=J.useState(i.reference),c=lq((t,e,i)=>{s.current.openEvent=t?e:void 0,o.emit("openchange",{open:t,event:e,reason:i,nested:a}),null==r||r(t,e,i)}),u=J.useMemo(()=>({setPositionReference:h}),[]),d=J.useMemo(()=>({reference:l||i.reference||null,floating:i.floating||null,domReference:i.reference}),[l,i.reference,i.floating]);return J.useMemo(()=>({dataRef:s,open:e,onOpenChange:c,elements:d,events:o,floatingId:n,refs:u}),[e,c,d,o,n,u])}({...t,elements:{reference:null,floating:null,...t.elements}}),i=t.rootContext||r,n=i.elements,[s,o]=J.useState(null),[a,l]=J.useState(null),h=(null==n?void 0:n.domReference)||s,c=J.useRef(null),u=l8();lY(()=>{h&&(c.current=h)},[h]);let d=function(t){void 0===t&&(t={});let{placement:e="bottom",strategy:r="absolute",middleware:i=[],platform:n,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:h}=t,[c,u]=J.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,f]=J.useState(i);a6(d,i)||f(i);let[g,p]=J.useState(null),[m,y]=J.useState(null),x=J.useCallback(t=>{t!==C.current&&(C.current=t,p(t))},[]),b=J.useCallback(t=>{t!==S.current&&(S.current=t,y(t))},[]),_=s||g,w=o||m,C=J.useRef(null),S=J.useRef(null),T=J.useRef(c),O=null!=l,k=lt(l),M=lt(n),E=lt(h),D=J.useCallback(()=>{if(!C.current||!S.current)return;let t={placement:e,strategy:r,middleware:d};M.current&&(t.platform=M.current),((t,e,r)=>{let i=new Map,n={platform:a2,...r},s={...n.platform,_c:i};return af(t,e,{...n,platform:s})})(C.current,S.current,t).then(t=>{let e={...t,isPositioned:!1!==E.current};j.current&&!a6(T.current,e)&&(T.current=e,a3.flushSync(()=>{u(e)}))})},[d,e,r,M,E]);a9(()=>{!1===h&&T.current.isPositioned&&(T.current.isPositioned=!1,u(t=>({...t,isPositioned:!1})))},[h]);let j=J.useRef(!1);a9(()=>(j.current=!0,()=>{j.current=!1}),[]),a9(()=>{if(_&&(C.current=_),w&&(S.current=w),_&&w){if(k.current)return k.current(_,w,D);D()}},[_,w,D,k,O]);let A=J.useMemo(()=>({reference:C,floating:S,setReference:x,setFloating:b}),[x,b]),P=J.useMemo(()=>({reference:_,floating:w}),[_,w]),F=J.useMemo(()=>{let t={position:r,left:0,top:0};if(!P.floating)return t;let e=a7(P.floating,c.x),i=a7(P.floating,c.y);return a?{...t,transform:"translate("+e+"px, "+i+"px)",...a8(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:e,top:i}},[r,a,P.floating,c.x,c.y]);return J.useMemo(()=>({...c,update:D,refs:A,elements:P,floatingStyles:F}),[c,D,A,P,F])}({...t,elements:{...n,...a&&{reference:a}}}),f=J.useCallback(t=>{let e=aw(t)?{getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>t.getClientRects(),contextElement:t}:t;l(e),d.refs.setReference(e)},[d.refs]),g=J.useCallback(t=>{(aw(t)||null===t)&&(c.current=t,o(t)),(aw(d.refs.reference.current)||null===d.refs.reference.current||null!==t&&!aw(t))&&d.refs.setReference(t)},[d.refs]),p=J.useMemo(()=>({...d.refs,setReference:g,setPositionReference:f,domReference:c}),[d.refs,g,f]),m=J.useMemo(()=>({...d.elements,domReference:h}),[d.elements,h]),y=J.useMemo(()=>({...d,...i,refs:p,elements:m,nodeId:e}),[d,p,m,e,i]);return lY(()=>{i.dataRef.current.floatingContext=y;let t=null==u?void 0:u.nodesRef.current.find(t=>t.id===e);t&&(t.context=y)}),J.useMemo(()=>({...d,context:y,refs:p,elements:m}),[d,p,m,y])}function hO(t,e,r){let i=new Map,n="item"===r,s=t;if(n&&t){let{[lZ]:e,[l$]:r,...i}=t;s=i}return{..."floating"===r&&{tabIndex:-1,"data-floating-ui-focusable":""},...s,...e.map(e=>{let i=e?e[r]:null;return"function"==typeof i?t?i(t):null:i}).concat(t).reduce((t,e)=>(e&&Object.entries(e).forEach(e=>{let[r,s]=e;if(!(n&&[lZ,l$].includes(r)))if(0===r.indexOf("on")){if(i.has(r)||i.set(r,[]),"function"==typeof s){var o;null==(o=i.get(r))||o.push(s),t[r]=function(){for(var t,e=arguments.length,n=Array(e),s=0;st(...n)).find(t=>void 0!==t)}}}else t[r]=s}),t),{})}}function hk(t){void 0===t&&(t=[]);let e=t.map(t=>null==t?void 0:t.reference),r=t.map(t=>null==t?void 0:t.floating),i=t.map(t=>null==t?void 0:t.item),n=J.useCallback(e=>hO(e,t,"reference"),e),s=J.useCallback(e=>hO(e,t,"floating"),r),o=J.useCallback(e=>hO(e,t,"item"),i);return J.useMemo(()=>({getReferenceProps:n,getFloatingProps:s,getItemProps:o}),[n,s,o])}let hM=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hE(t,e){var r,i;void 0===e&&(e={});let{open:n,elements:s,floatingId:o}=t,{enabled:a=!0,role:l="dialog"}=e,h=l4(),c=(null==(r=s.domReference)?void 0:r.id)||h,u=J.useMemo(()=>{var t;return(null==(t=lW(s.floating))?void 0:t.id)||o},[s.floating,o]),d=null!=(i=hM.get(l))?i:l,f=null!=l6(),g=J.useMemo(()=>"tooltip"===d||"label"===l?{["aria-"+("label"===l?"labelledby":"describedby")]:n?u:void 0}:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===d?"dialog":d,"aria-controls":n?u:void 0,..."listbox"===d&&{role:"combobox"},..."menu"===d&&{id:c},..."menu"===d&&f&&{role:"menuitem"},..."select"===l&&{"aria-autocomplete":"none"},..."combobox"===l&&{"aria-autocomplete":"list"}},[d,u,f,n,c,l]),p=J.useMemo(()=>{let t={id:u,...d&&{role:d}};return"tooltip"===d||"label"===l?t:{...t,..."menu"===d&&{"aria-labelledby":c}}},[d,u,c,l]),m=J.useCallback(t=>{let{active:e,selected:r}=t,i={role:"option",...e&&{id:u+"-fui-option"}};switch(l){case"select":case"combobox":return{...i,"aria-selected":r}}return{}},[u,l]);return J.useMemo(()=>a?{reference:g,floating:p,item:m}:{},[a,g,p,m])}var hD=t.i(40141);function hj(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z"},child:[]}]})(t)}function hA(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z",clipRule:"evenodd"},child:[]}]})(t)}var hP=t.i(11152);function hF(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M123.193 29.635L121 406.18l84.31-82.836 65.87 159.02 67.5-27.96-65.87-159.02L391 294.342z"},child:[]}]})(t)}function hL(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M149.9 302.2c-39.1 0-70.7 31-70.7 69.3 0 30.3-27.3 46.2-47.2 46.2C53.7 446 90.7 464 126.3 464c52.1 0 94.3-41.4 94.3-92.4 0-38.4-31.6-69.4-70.7-69.4zM473.1 85.7l-31.6-31c-9.2-9-24-9-33.2 0L197 261.8l64.8 63.5 211.2-207c9.3-9 9.3-23.6.1-32.6z"},child:[]}]})(t)}function hR(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M96 448h106.7V64H96v384zM309.3 64v384H416V64H309.3z"},child:[]}]})(t)}function hI(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M96 52v408l320-204L96 52z"},child:[]}]})(t)}function hB(t){return(0,hD.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.904 16c1.777-3.219 2.076-8.13-4.904-7.966v3.966l-6-6 6-6v3.881c8.359-0.218 9.29 7.378 4.904 12.119z"},child:[]}]})(t)}function hN(t){return(0,hD.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9 3.881v-3.881l6 6-6 6v-3.966c-6.98-0.164-6.681 4.747-4.904 7.966-4.386-4.741-3.455-12.337 4.904-12.119z"},child:[]}]})(t)}function hW(t){return(0,hD.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM2 8c0-3.314 2.686-6 6-6v12c-3.314 0-6-2.686-6-6z"},child:[]}]})(t)}function hU(t){return(0,hD.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 4c-2.209 0-4 1.791-4 4s1.791 4 4 4 4-1.791 4-4-1.791-4-4-4zM8 10.5v-5c1.379 0 2.5 1.122 2.5 2.5s-1.121 2.5-2.5 2.5zM8 13c0.552 0 1 0.448 1 1v1c0 0.552-0.448 1-1 1s-1-0.448-1-1v-1c0-0.552 0.448-1 1-1zM8 3c-0.552 0-1-0.448-1-1v-1c0-0.552 0.448-1 1-1s1 0.448 1 1v1c0 0.552-0.448 1-1 1zM15 7c0.552 0 1 0.448 1 1s-0.448 1-1 1h-1c-0.552 0-1-0.448-1-1s0.448-1 1-1h1zM3 8c0 0.552-0.448 1-1 1h-1c-0.552 0-1-0.448-1-1s0.448-1 1-1h1c0.552 0 1 0.448 1 1zM12.95 11.536l0.707 0.707c0.39 0.39 0.39 1.024 0 1.414s-1.024 0.39-1.414 0l-0.707-0.707c-0.39-0.39-0.39-1.024 0-1.414s1.024-0.39 1.414 0zM3.050 4.464l-0.707-0.707c-0.391-0.391-0.391-1.024 0-1.414s1.024-0.391 1.414 0l0.707 0.707c0.391 0.391 0.391 1.024 0 1.414s-1.024 0.391-1.414 0zM12.95 4.464c-0.39 0.391-1.024 0.391-1.414 0s-0.39-1.024 0-1.414l0.707-0.707c0.39-0.391 1.024-0.391 1.414 0s0.39 1.024 0 1.414l-0.707 0.707zM3.050 11.536c0.39-0.39 1.024-0.39 1.414 0s0.391 1.024 0 1.414l-0.707 0.707c-0.391 0.39-1.024 0.39-1.414 0s-0.391-1.024 0-1.414l0.707-0.707z"},child:[]}]})(t)}function hH(t){return(0,hD.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.5 6h-5.5v-5.5c0-0.276-0.224-0.5-0.5-0.5h-3c-0.276 0-0.5 0.224-0.5 0.5v5.5h-5.5c-0.276 0-0.5 0.224-0.5 0.5v3c0 0.276 0.224 0.5 0.5 0.5h5.5v5.5c0 0.276 0.224 0.5 0.5 0.5h3c0.276 0 0.5-0.224 0.5-0.5v-5.5h5.5c0.276 0 0.5-0.224 0.5-0.5v-3c0-0.276-0.224-0.5-0.5-0.5z"},child:[]}]})(t)}let hX=J.default.createContext(null);function hV(){let t=(0,J.useContext)(hX);if(!t)throw Error("No WarriorContext.Provider");return t}hX.displayName="WarriorContext";let hY="undefined"!=typeof window&&window.document&&window.document.createElement?J.useLayoutEffect:J.useEffect,hz=(t,e)=>{let r=J.useRef(!0);hY(()=>t(r.current),e),hY(()=>(r.current=!1,()=>{r.current=!0}),[])},hG=function(t){let e=J.useRef();return e.current=t,J.useCallback(function(){for(var t,r=arguments.length,i=Array(r),n=0;n{hK.push(t)},h$.resetWarned=function(){hq={}},h$.noteOnce=function(t,e){hZ(hJ,t,e)};let h0=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new Set;return function t(e,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=i.has(e);if(h$(!o,"Warning: There may be circular references"),o)return!1;if(e===n)return!0;if(r&&s>1)return!1;i.add(e);let a=s+1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let r=0;rt(e[r],n[r],a))}return!1}(t,e)};var h1=t.i(43794);function h2(t,e,r,i){let n=(e-r)/(i-r),s={};switch(t){case"rtl":s.right="".concat(100*n,"%"),s.transform="translateX(50%)";break;case"btt":s.bottom="".concat(100*n,"%"),s.transform="translateY(50%)";break;case"ttb":s.top="".concat(100*n,"%"),s.transform="translateY(-50%)";break;default:s.left="".concat(100*n,"%"),s.transform="translateX(-50%)"}return s}function h5(t,e){return Array.isArray(t)?t[e]:t}let h4={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){let{keyCode:e}=t;if(t.altKey&&!t.ctrlKey||t.metaKey||e>=h4.F1&&e<=h4.F12)return!1;switch(e){case h4.ALT:case h4.CAPS_LOCK:case h4.CONTEXT_MENU:case h4.CTRL:case h4.DOWN:case h4.END:case h4.ESC:case h4.HOME:case h4.INSERT:case h4.LEFT:case h4.MAC_FF_META:case h4.META:case h4.NUMLOCK:case h4.NUM_CENTER:case h4.PAGE_DOWN:case h4.PAGE_UP:case h4.PAUSE:case h4.PRINT_SCREEN:case h4.RIGHT:case h4.SHIFT:case h4.UP:case h4.WIN_KEY:case h4.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=h4.ZERO&&t<=h4.NINE||t>=h4.NUM_ZERO&&t<=h4.NUM_MULTIPLY||t>=h4.A&&t<=h4.Z||-1!==window.navigator.userAgent.indexOf("WebKit")&&0===t)return!0;switch(t){case h4.SPACE:case h4.QUESTION_MARK:case h4.NUM_PLUS:case h4.NUM_MINUS:case h4.NUM_PERIOD:case h4.NUM_DIVISION:case h4.SEMICOLON:case h4.DASH:case h4.EQUALS:case h4.COMMA:case h4.PERIOD:case h4.SLASH:case h4.APOSTROPHE:case h4.SINGLE_QUOTE:case h4.OPEN_SQUARE_BRACKET:case h4.BACKSLASH:case h4.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},h3=J.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),h9=J.createContext({});function h6(){return(h6=Object.assign.bind()).apply(this,arguments)}let h8=J.forwardRef((t,e)=>{let{prefixCls:r,value:i,valueIndex:n,onStartMove:s,onDelete:o,style:a,render:l,dragging:h,draggingDelete:c,onOffsetChange:u,onChangeComplete:d,onFocus:f,onMouseEnter:g,...p}=t,{min:m,max:y,direction:x,disabled:b,keyboard:_,range:w,tabIndex:C,ariaLabelForHandle:S,ariaLabelledByForHandle:T,ariaRequired:O,ariaValueTextFormatterForHandle:k,styles:M,classNames:E}=J.useContext(h3),D="".concat(r,"-handle"),j=t=>{b||s(t,n)},A=h2(x,i,m,y),P={};if(null!==n){var F;P={tabIndex:b?null:h5(C,n),role:"slider","aria-valuemin":m,"aria-valuemax":y,"aria-valuenow":i,"aria-disabled":b,"aria-label":h5(S,n),"aria-labelledby":h5(T,n),"aria-required":h5(O,n),"aria-valuetext":null==(F=h5(k,n))?void 0:F(i),"aria-orientation":"ltr"===x||"rtl"===x?"horizontal":"vertical",onMouseDown:j,onTouchStart:j,onFocus:t=>{null==f||f(t,n)},onMouseEnter:t=>{g(t,n)},onKeyDown:t=>{if(!b&&_){let e=null;switch(t.which||t.keyCode){case h4.LEFT:e="ltr"===x||"btt"===x?-1:1;break;case h4.RIGHT:e="ltr"===x||"btt"===x?1:-1;break;case h4.UP:e="ttb"!==x?1:-1;break;case h4.DOWN:e="ttb"!==x?-1:1;break;case h4.HOME:e="min";break;case h4.END:e="max";break;case h4.PAGE_UP:e=2;break;case h4.PAGE_DOWN:e=-2;break;case h4.BACKSPACE:case h4.DELETE:null==o||o(n)}null!==e&&(t.preventDefault(),u(e,n))}},onKeyUp:t=>{switch(t.which||t.keyCode){case h4.LEFT:case h4.RIGHT:case h4.UP:case h4.DOWN:case h4.HOME:case h4.END:case h4.PAGE_UP:case h4.PAGE_DOWN:null==d||d()}}}}let L=J.createElement("div",h6({ref:e,className:(0,h1.default)(D,{["".concat(D,"-").concat(n+1)]:null!==n&&w,["".concat(D,"-dragging")]:h,["".concat(D,"-dragging-delete")]:c},E.handle),style:{...A,...a,...M.handle}},P,p));return l&&(L=l(L,{index:n,prefixCls:r,value:i,dragging:h,draggingDelete:c})),L});function h7(){return(h7=Object.assign.bind()).apply(this,arguments)}let ct=J.forwardRef((t,e)=>{let{prefixCls:r,style:i,onStartMove:n,onOffsetChange:s,values:o,handleRender:a,activeHandleRender:l,draggingIndex:h,draggingDelete:c,onFocus:u,...d}=t,f=J.useRef({}),[g,p]=J.useState(!1),[m,y]=J.useState(-1),x=t=>{y(t),p(!0)};J.useImperativeHandle(e,()=>({focus:t=>{var e;null==(e=f.current[t])||e.focus()},hideHelp:()=>{(0,a3.flushSync)(()=>{p(!1)})}}));let b={prefixCls:r,onStartMove:n,onOffsetChange:s,render:a,onFocus:(t,e)=>{x(e),null==u||u(t)},onMouseEnter:(t,e)=>{x(e)},...d};return J.createElement(J.Fragment,null,o.map((t,e)=>{let r=h===e;return J.createElement(h8,h7({ref:t=>{t?f.current[e]=t:delete f.current[e]},dragging:r,draggingDelete:r&&c,style:h5(i,e),key:e,value:t,valueIndex:e},b))}),l&&g&&J.createElement(h8,h7({key:"a11y"},b,{value:o[m],valueIndex:null,dragging:-1!==h,draggingDelete:c,render:l,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),ce=t=>{let{prefixCls:e,style:r,children:i,value:n,onClick:s}=t,{min:o,max:a,direction:l,includedStart:h,includedEnd:c,included:u}=J.useContext(h3),d="".concat(e,"-text"),f=h2(l,n,o,a);return J.createElement("span",{className:(0,h1.default)(d,{["".concat(d,"-active")]:u&&h<=n&&n<=c}),style:{...f,...r},onMouseDown:t=>{t.stopPropagation()},onClick:()=>{s(n)}},i)},cr=t=>{let{prefixCls:e,marks:r,onClick:i}=t,n="".concat(e,"-mark");return r.length?J.createElement("div",{className:n},r.map(t=>{let{value:e,style:r,label:s}=t;return J.createElement(ce,{key:e,prefixCls:n,style:r,value:e,onClick:i},s)})):null},ci=t=>{let{prefixCls:e,value:r,style:i,activeStyle:n}=t,{min:s,max:o,direction:a,included:l,includedStart:h,includedEnd:c}=J.useContext(h3),u="".concat(e,"-dot"),d=l&&h<=r&&r<=c,f={...h2(a,r,s,o),..."function"==typeof i?i(r):i};return d&&(f={...f,..."function"==typeof n?n(r):n}),J.createElement("span",{className:(0,h1.default)(u,{["".concat(u,"-active")]:d}),style:f})},cn=t=>{let{prefixCls:e,marks:r,dots:i,style:n,activeStyle:s}=t,{min:o,max:a,step:l}=J.useContext(h3),h=J.useMemo(()=>{let t=new Set;if(r.forEach(e=>{t.add(e.value)}),i&&null!==l){let e=o;for(;e<=a;)t.add(e),e+=l}return Array.from(t)},[o,a,l,i,r]);return J.createElement("div",{className:"".concat(e,"-step")},h.map(t=>J.createElement(ci,{prefixCls:e,key:t,value:t,style:n,activeStyle:s})))},cs=t=>{let{prefixCls:e,style:r,start:i,end:n,index:s,onStartMove:o,replaceCls:a}=t,{direction:l,min:h,max:c,disabled:u,range:d,classNames:f}=J.useContext(h3),g="".concat(e,"-track"),p=(i-h)/(c-h),m=(n-h)/(c-h),y=t=>{!u&&o&&o(t,-1)},x={};switch(l){case"rtl":x.right="".concat(100*p,"%"),x.width="".concat(100*m-100*p,"%");break;case"btt":x.bottom="".concat(100*p,"%"),x.height="".concat(100*m-100*p,"%");break;case"ttb":x.top="".concat(100*p,"%"),x.height="".concat(100*m-100*p,"%");break;default:x.left="".concat(100*p,"%"),x.width="".concat(100*m-100*p,"%")}let b=a||(0,h1.default)(g,{["".concat(g,"-").concat(s+1)]:null!==s&&d,["".concat(e,"-track-draggable")]:o},f.track);return J.createElement("div",{className:b,style:{...x,...r},onMouseDown:y,onTouchStart:y})},co=t=>{let{prefixCls:e,style:r,values:i,startPoint:n,onStartMove:s}=t,{included:o,range:a,min:l,styles:h,classNames:c}=J.useContext(h3),u=J.useMemo(()=>{if(!a){if(0===i.length)return[];let t=null!=n?n:l,e=i[0];return[{start:Math.min(t,e),end:Math.max(t,e)}]}let t=[];for(let e=0;e{let{start:n,end:o}=t;return J.createElement(cs,{index:i,prefixCls:e,style:{...h5(r,i),...h.track},start:n,end:o,key:i,onStartMove:s})}))};function ca(t){let e="targetTouches"in t?t.targetTouches[0]:t;return{pageX:e.pageX,pageY:e.pageY}}let cl=function(t,e,r,i,n,s,o,a,l,h,c){let[u,d]=J.useState(null),[f,g]=J.useState(-1),[p,m]=J.useState(!1),[y,x]=J.useState(r),[b,_]=J.useState(r),w=J.useRef(null),C=J.useRef(null),S=J.useRef(null),{onDragStart:T,onDragChange:O}=J.useContext(h9);hz(()=>{-1===f&&x(r)},[r,f]),J.useEffect(()=>()=>{document.removeEventListener("mousemove",w.current),document.removeEventListener("mouseup",C.current),S.current&&(S.current.removeEventListener("touchmove",w.current),S.current.removeEventListener("touchend",C.current))},[]);let k=(t,e,r)=>{void 0!==e&&d(e),x(t);let i=t;r&&(i=t.filter((t,e)=>e!==f)),o(i),O&&O({rawValues:t,deleteIndex:r?f:-1,draggingIndex:f,draggingValue:e})},M=hG((t,e,r)=>{if(-1===t){let t=b[0],r=b[b.length-1],o=e*(n-i);o=Math.min(o=Math.max(o,i-t),n-r),o=s(t+o)-t,k(b.map(t=>t+o))}else{let s=[...y];s[t]=b[t];let o=l(s,(n-i)*e,t,"dist");k(o.values,o.value,r)}});return[f,u,p,J.useMemo(()=>{let t=[...r].sort((t,e)=>t-e),e=[...y].sort((t,e)=>t-e),i={};e.forEach(t=>{i[t]=(i[t]||0)+1}),t.forEach(t=>{i[t]=(i[t]||0)-1});let n=+!!h;return Object.values(i).reduce((t,e)=>t+Math.abs(e),0)<=n?y:r},[r,y,h]),(i,n,s)=>{i.stopPropagation();let o=s||r,l=o[n];g(n),d(l),_(o),x(o),m(!1);let{pageX:u,pageY:f}=ca(i),p=!1;T&&T({rawValues:o,draggingIndex:n,draggingValue:l});let b=r=>{let i,s;r.preventDefault();let{pageX:o,pageY:a}=ca(r),l=o-u,d=a-f,{width:g,height:x}=t.current.getBoundingClientRect();switch(e){case"btt":i=-d/x,s=l;break;case"ttb":i=d/x,s=l;break;case"rtl":i=-l/g,s=d;break;default:i=l/g,s=d}m(p=!!h&&Math.abs(s)>130&&c{t.preventDefault(),document.removeEventListener("mouseup",O),document.removeEventListener("mousemove",b),S.current&&(S.current.removeEventListener("touchmove",w.current),S.current.removeEventListener("touchend",C.current)),w.current=null,C.current=null,S.current=null,a(p),g(-1),m(!1)};document.addEventListener("mouseup",O),document.addEventListener("mousemove",b),i.currentTarget.addEventListener("touchend",O),i.currentTarget.addEventListener("touchmove",b),w.current=b,C.current=O,S.current=i.currentTarget}]},ch=J.forwardRef((t,e)=>{let{prefixCls:r="rc-slider",className:i,style:n,classNames:s,styles:o,id:a,disabled:l=!1,keyboard:h=!0,autoFocus:c,onFocus:u,onBlur:d,min:f=0,max:g=100,step:p=1,value:m,defaultValue:y,range:x,count:b,onChange:_,onBeforeChange:w,onAfterChange:C,onChangeComplete:S,allowCross:T=!0,pushable:O=!1,reverse:k,vertical:M,included:E=!0,startPoint:D,trackStyle:j,handleStyle:A,railStyle:P,dotStyle:F,activeDotStyle:L,marks:R,dots:I,handleRender:B,activeHandleRender:N,track:W,tabIndex:U=0,ariaLabelForHandle:H,ariaLabelledByForHandle:X,ariaRequired:V,ariaValueTextFormatterForHandle:Y}=t,z=J.useRef(null),G=J.useRef(null),q=J.useMemo(()=>M?k?"ttb":"btt":k?"rtl":"ltr",[k,M]),[K,Q,Z,$,tt]=function(t){return(0,J.useMemo)(()=>{if(!0===t||!t)return[!!t,!1,!1,0];let{editable:e,draggableTrack:r,minCount:i,maxCount:n}=t;return[!0,e,!e&&r,i||0,n]},[t])}(x),te=J.useMemo(()=>isFinite(f)?f:0,[f]),tr=J.useMemo(()=>isFinite(g)?g:100,[g]),ti=J.useMemo(()=>null!==p&&p<=0?1:p,[p]),tn=J.useMemo(()=>"boolean"==typeof O?!!O&&ti:O>=0&&O,[O,ti]),ts=J.useMemo(()=>Object.keys(R||{}).map(t=>{let e=R[t],r={value:Number(t)};return e&&"object"==typeof e&&!J.isValidElement(e)&&("label"in e||"style"in e)?(r.style=e.style,r.label=e.label):r.label=e,r}).filter(t=>{let{label:e}=t;return e||"number"==typeof e}).sort((t,e)=>t.value-e.value),[R]),[to,ta]=function(t,e,r,i,n,s){let o=J.useCallback(r=>Math.max(t,Math.min(e,r)),[t,e]),a=J.useCallback(i=>{if(null!==r){let n=t+Math.round((o(i)-t)/r)*r,s=t=>(String(t).split(".")[1]||"").length,a=Math.max(s(r),s(e),s(t)),l=Number(n.toFixed(a));return t<=l&&l<=e?l:null}return null},[r,t,e,o]),l=J.useCallback(n=>{let s=o(n),l=i.map(t=>t.value);null!==r&&l.push(a(n)),l.push(t,e);let h=l[0],c=e-t;return l.forEach(t=>{let e=Math.abs(s-t);e<=c&&(h=t,c=e)}),h},[t,e,i,r,o,a]),h=function(n,s,o){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit";if("number"==typeof s){let c,u=n[o],d=u+s,f=[];i.forEach(t=>{f.push(t.value)}),f.push(t,e),f.push(a(u));let g=s>0?1:-1;"unit"===l?f.push(a(u+g*r)):f.push(a(d)),f=f.filter(t=>null!==t).filter(t=>s<0?t<=u:t>=u),"unit"===l&&(f=f.filter(t=>t!==u));let p="unit"===l?u:d,m=Math.abs((c=f[0])-p);if(f.forEach(t=>{let e=Math.abs(t-p);e1){let t=[...n];return t[o]=c,h(t,s-g,o,l)}return c}return"min"===s?t:"max"===s?e:void 0},c=function(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",n=t[r],s=h(t,e,r,i);return{value:s,changed:s!==n}},u=t=>null===s&&0===t||"number"==typeof s&&t3&&void 0!==arguments[3]?arguments[3]:"unit",o=t.map(l),a=o[r],d=h(o,e,r,i);if(o[r]=d,!1===n){let t=s||0;r>0&&o[r-1]!==a&&(o[r]=Math.max(o[r],o[r-1]+t)),r0;t-=1){let e=!0;for(;u(o[t]-o[t-1])&&e;)({value:o[t-1],changed:e}=c(o,-1,t-1))}for(let t=o.length-1;t>0;t-=1){let e=!0;for(;u(o[t]-o[t-1])&&e;)({value:o[t-1],changed:e}=c(o,-1,t-1))}for(let t=0;t{t||i(e)},[e]),[n,i]}(y,m),tc=J.useMemo(()=>{let t=null==tl?[]:Array.isArray(tl)?tl:[tl],[e=te]=t,r=null===tl?[]:[e];if(K){if(r=[...t],b||void 0===tl){let t=b>=0?b+1:2;for(r=r.slice(0,t);r.lengtht-e)}return r.forEach((t,e)=>{r[e]=to(t)}),r},[tl,K,te,b,to]),tu=t=>K?t:t[0],td=hG(t=>{let e=[...t].sort((t,e)=>t-e);_&&!h0(e,tc,!0)&&_(tu(e)),th(e)}),tf=hG(t=>{t&&z.current.hideHelp();let e=tu(tc);null==C||C(e),h$(!C,"[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead."),null==S||S(e)}),[tg,tp,tm,tv,ty]=cl(G,q,tc,te,tr,to,td,tf,ta,Q,$),tx=(t,e)=>{if(!l){let n=[...tc],s=0,o=0,a=tr-te;tc.forEach((e,r)=>{let i=Math.abs(t-e);i<=a&&(a=i,s=r),e{if(null!==tb){let t=tc.indexOf(tb);t>=0&&z.current.focus(t)}t_(null)},[tb]);let tw=J.useMemo(()=>(!Z||null!==ti)&&Z,[Z,ti]),tC=hG((t,e)=>{ty(t,e),null==w||w(tu(tc))}),tS=-1!==tg;J.useEffect(()=>{if(!tS){let t=tc.lastIndexOf(tp);z.current.focus(t)}},[tS]);let tT=J.useMemo(()=>[...tv].sort((t,e)=>t-e),[tv]),[tO,tk]=J.useMemo(()=>K?[tT[0],tT[tT.length-1]]:[te,tT[0]],[tT,K,te]);J.useImperativeHandle(e,()=>({focus:()=>{z.current.focus(0)},blur:()=>{var t;let{activeElement:e}=document;(null==(t=G.current)?void 0:t.contains(e))&&(null==e||e.blur())}})),J.useEffect(()=>{c&&z.current.focus(0)},[]);let tM=J.useMemo(()=>({min:te,max:tr,direction:q,disabled:l,keyboard:h,step:ti,included:E,includedStart:tO,includedEnd:tk,range:K,tabIndex:U,ariaLabelForHandle:H,ariaLabelledByForHandle:X,ariaRequired:V,ariaValueTextFormatterForHandle:Y,styles:o||{},classNames:s||{}}),[te,tr,q,l,h,ti,E,tO,tk,K,U,H,X,V,Y,o,s]);return J.createElement(h3.Provider,{value:tM},J.createElement("div",{ref:G,className:(0,h1.default)(r,i,{["".concat(r,"-disabled")]:l,["".concat(r,"-vertical")]:M,["".concat(r,"-horizontal")]:!M,["".concat(r,"-with-marks")]:ts.length}),style:n,onMouseDown:t=>{let e;t.preventDefault();let{width:r,height:i,left:n,top:s,bottom:o,right:a}=G.current.getBoundingClientRect(),{clientX:l,clientY:h}=t;switch(q){case"btt":e=(o-h)/i;break;case"ttb":e=(h-s)/i;break;case"rtl":e=(a-l)/r;break;default:e=(l-n)/r}tx(to(te+e*(tr-te)),t)},id:a},J.createElement("div",{className:(0,h1.default)("".concat(r,"-rail"),null==s?void 0:s.rail),style:{...P,...null==o?void 0:o.rail}}),!1!==W&&J.createElement(co,{prefixCls:r,style:j,values:tc,startPoint:D,onStartMove:tw?tC:void 0}),J.createElement(cn,{prefixCls:r,marks:ts,dots:I,style:F,activeStyle:L}),J.createElement(ct,{ref:z,prefixCls:r,style:A,values:tv,draggingIndex:tg,draggingDelete:tm,onStartMove:tC,onOffsetChange:(t,e)=>{if(!l){let r=ta(tc,t,e);null==w||w(tu(tc)),td(r.values),t_(r.value)}},onFocus:u,onBlur:d,handleRender:B,activeHandleRender:N,onChangeComplete:tf,onDelete:Q?t=>{if(l||!Q||tc.length<=$)return;let e=[...tc];e.splice(t,1),null==w||w(tu(e)),td(e);let r=Math.max(0,t-1);z.current.hideHelp(),z.current.focus(r)}:void 0}),J.createElement(cr,{prefixCls:r,marks:ts,onClick:tx})))}),cc={track:{height:8,background:"#03fccf"},handle:{width:20,height:20,marginTop:-6,borderColor:"#03fccf",background:"rgb(5, 69, 76)",opacity:1},rail:{height:8,border:"1px solid #555",background:"rgba(255, 255, 255, 0.3)"}};function cu(t){return(0,Q.jsx)(ch,{...t,styles:{...cc,...t.styles}})}var cd=t.i(20592);let{materials:cf}=cd.default;function cg(){var t;let e=(0,J.useRef)(null),r=(0,J.useRef)(null),[i,n]=(0,J.useState)("vl2"),{activeCanvas:s,backgroundColor:o,setBackgroundColor:a,selectedObjects:l,lockedObjects:h,lockSelection:c,unlockSelection:u,bringForward:d,sendBackward:f,duplicate:g,deleteSelection:p,undo:m,redo:y,canUndo:x,canRedo:b,copyToMetallic:_,brushColor:w,setBrushColor:C,brushSize:S,setBrushSize:T,hueRotate:O,setHueRotate:k,saturation:M,setSaturation:E,brightness:D,setBrightness:j,contrast:A,setContrast:P,opacity:F,setOpacity:L,layerMode:R,setLayerMode:I,activeCanvasType:B,addImages:N,exportSkin:W,selectedExportMaterials:U,setSelectedExportMaterials:H}=o0(),{actualModel:X}=hV(),V=cf[X],{canvas:Y,isDrawingMode:z,setDrawingMode:G}=oZ(s),[q,K]=(0,J.useState)(!1),Z=q?"⌘":"Ctrl ",[$,tt]=(0,J.useState)(!1),{refs:te,floatingStyles:tr,context:ti}=hT({open:$,onOpenChange:tt,placement:"bottom-end",middleware:[lr(),le(10)],whileElementsMounted:a4}),tn=hb(ti),ts=hS(ti),to=hE(ti);(0,J.useEffect)(()=>{$&&G(!0)},[$,G]);let{getReferenceProps:ta,getFloatingProps:tl}=hk([tn,ts,to]),[th,tc]=(0,J.useState)(!1),{refs:tu,floatingStyles:td,context:tf}=hT({open:th,onOpenChange:tc,placement:"bottom-end",middleware:[lr(),le(10)],whileElementsMounted:a4}),tg=hb(tf),{getReferenceProps:tp,getFloatingProps:tm}=hk([tg,hS(tf),hE(tf)]),[tv,ty]=(0,J.useState)(!1),{refs:tx,floatingStyles:tb,context:t_}=hT({open:tv,onOpenChange:ty,placement:"bottom-end",middleware:[lr(),le(10)],whileElementsMounted:a4}),tw=hb(t_),{getReferenceProps:tC,getFloatingProps:tS}=hk([tw,hS(t_),hE(t_)]),tT=!!l.length&&l.every(t=>h.has(t)),tO=l.length>0,tk=l.filter(t=>t instanceof s7).length>0,tM=t=>{a(t.target.value)};return(0,J.useEffect)(()=>{try{let t=localStorage.getItem("exportFileType");switch(t){case"vl2":case"png":n(t)}}catch(t){}},[]),(0,J.useEffect)(()=>{navigator.platform&&navigator.platform.startsWith("Mac")?K(!0):navigator.userAgent.match(/\(Macintosh;/)&&K(!0)},[]),(0,Q.jsxs)("div",{className:"CanvasTools",children:[(0,Q.jsxs)("div",{className:"CanvasBackgroundColor",children:[(0,Q.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorBlack",value:"black",checked:"black"===o,onChange:tM}),(0,Q.jsx)("label",{htmlFor:"canvasBackgroundColorBlack",children:(0,Q.jsx)("span",{className:"HiddenLabel",children:"Black"})}),(0,Q.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorMagenta",value:"magenta",checked:"magenta"===o,onChange:tM}),(0,Q.jsx)("label",{htmlFor:"canvasBackgroundColorMagenta",children:(0,Q.jsx)("span",{className:"HiddenLabel",children:"Magenta"})}),(0,Q.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorWhite",value:"white",checked:"white"===o,onChange:tM}),(0,Q.jsx)("label",{htmlFor:"canvasBackgroundColorWhite",children:(0,Q.jsx)("span",{className:"HiddenLabel",children:"White"})})]}),(0,Q.jsxs)("div",{className:"Buttons",children:["metallic"===B?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"ButtonGroup",children:[(0,Q.jsx)("button",{className:"ButtonGroup",type:"button","data-active":z?void 0:"","aria-label":"Select Mode",title:"Select Mode (S)",onClick:()=>{G(!1)},children:(0,Q.jsx)(hF,{})}),(0,Q.jsx)("button",{className:"ButtonGroup",type:"button","data-active":z?"":void 0,"aria-label":"Paint Mode",title:"Paint Mode (P)",ref:te.setReference,...ta(),children:(0,Q.jsx)(hL,{})})]}),$?(0,Q.jsx)(hy,{context:ti,modal:!1,children:(0,Q.jsx)("div",{className:"BrushToolsPopup",ref:te.setFloating,style:tr,...tl(),children:(0,Q.jsxs)("div",{className:"Fields",children:[(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{children:"Metallic Amount"}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:0,max:255,value:w,onChange:t=>{Array.isArray(t)&&(t=t[0]),C(t)},styles:{track:{display:"none"},handle:{width:20,height:20,marginTop:-6,borderColor:"rgb(20, 105, 241)",background:"rgb(".concat(w,", ").concat(w,", ").concat(w,")"),opacity:1},rail:{height:8,border:"1px solid #555",background:"linear-gradient(to right, black 0%, white 100%)"}}})})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{children:"Brush Size"}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:1,max:50,value:S,onChange:t=>{Array.isArray(t)&&(t=t[0]),T(t)}})})]})]})})}):null]}):null,(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("input",{ref:r,onChange:async t=>{N([await new Promise((e,r)=>{var i;let n=null==(i=t.target.files)?void 0:i[0];if(n){let t=new FileReader;t.addEventListener("load",t=>{var r;e(null==(r=t.target)?void 0:r.result)}),t.readAsDataURL(n)}else r(Error("No input file provided."))})])},type:"file",accept:".png, image/png",hidden:!0}),(0,Q.jsx)("button",{type:"button","aria-label":"Add Image",title:"Add Image",onClick:()=>{r.current&&r.current.click()},children:(0,Q.jsx)(hH,{style:{fontSize:14}})}),(0,Q.jsx)("button",{type:"button","data-active":th?"":void 0,"aria-label":"Filters",title:"Filters",disabled:tO&&!tk,ref:tu.setReference,...tp(),children:(0,Q.jsx)(hW,{})}),th?(0,Q.jsx)(hy,{context:tf,modal:!1,children:(0,Q.jsx)("div",{className:"BrushToolsPopup",ref:tu.setFloating,style:td,...tm(),children:(0,Q.jsxs)("div",{className:"Fields",children:[(0,Q.jsxs)("div",{className:"Field ApplyTo",children:[(0,Q.jsx)("label",{children:"Layer:"}),(0,Q.jsx)("ul",{children:l.length?(0,Q.jsxs)("li",{children:[(0,Q.jsx)("input",{type:"radio",name:"FilterLayer",value:"SelectedLayer",id:"FilterLayer-SelectedLayer",checked:"SelectedLayer"===R,onChange:()=>{I("SelectedLayer")}}),(0,Q.jsxs)("label",{htmlFor:"FilterLayer-SelectedLayer",children:["selected (",l.length.toLocaleString(),")"]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("li",{children:[(0,Q.jsx)("input",{type:"radio",name:"FilterLayer",value:"BaseLayer",id:"FilterLayer-BaseLayer",checked:"BaseLayer"===R,onChange:()=>{I("BaseLayer")}})," ",(0,Q.jsx)("label",{htmlFor:"FilterLayer-BaseLayer",children:"base"})]}),(0,Q.jsxs)("li",{children:[(0,Q.jsx)("input",{type:"radio",name:"FilterLayer",value:"AllLayers",id:"FilterLayer-AllLayers",checked:"AllLayers"===R,onChange:()=>{I("AllLayers")}}),(0,Q.jsxs)("label",{htmlFor:"FilterLayer-AllLayers",children:["all (",null!=(t=null==Y?void 0:Y._objects.filter(t=>t instanceof s7).length.toLocaleString())?t:0,")"]})]})]})})]}),"color"===B?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsxs)("label",{children:["Hue:"," ",(0,Q.jsx)("strong",{children:null==O?"MULTIPLE VALUES":(0,Q.jsxs)(Q.Fragment,{children:[Math.round(180*O),"°"]})})]}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:-180,max:180,startPoint:0,value:Math.round((null!=O?O:0)*180),onChange:t=>{Array.isArray(t)&&(t=t[0]),k(t/180)}})})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsxs)("label",{children:["Saturation:"," ",(0,Q.jsx)("strong",{children:null==M?"MULTIPLE VALUES":"".concat(Math.round(100*M+100),"%")})]}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:-100,max:100,startPoint:0,value:Math.round((null!=M?M:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),E(t/100)}})})]})]}):null,(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsxs)("label",{children:["Brightness:"," ",(0,Q.jsx)("strong",{children:null==D?"MULTIPLE VALUES":"".concat(Math.round(100*D+100),"%")})]}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:-100,max:100,startPoint:0,value:Math.round((null!=D?D:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),j(t/100)}})})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsxs)("label",{children:["Contrast:"," ",(0,Q.jsx)("strong",{children:null==A?"MULTIPLE VALUES":"".concat(Math.round(100*A+100),"%")})]}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:-100,max:100,startPoint:0,value:Math.round((null!=A?A:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),P(t/100)}})})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsxs)("label",{children:["Opacity:"," ",(0,Q.jsx)("strong",{children:null==F?"MULTIPLE VALUES":"".concat(Math.round((null!=F?F:1)*100),"%")})]}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:0,max:100,startPoint:0,value:Math.round((null!=F?F:1)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),L(t/100)}})})]})]})})}):null,(0,Q.jsx)("button",{type:"button","aria-label":tT?"Unlock":"Lock",title:tT?"Unlock (L)":"Lock (L)",onClick:tT?u:c,"data-locked":tT?"":void 0,disabled:!tO,children:tT?(0,Q.jsx)(hP.FaUnlock,{style:{fontSize:14}}):(0,Q.jsx)(hP.FaLock,{style:{fontSize:14}})}),(0,Q.jsxs)("div",{className:"ButtonGroup",children:[(0,Q.jsx)("button",{type:"button","aria-label":"Bring Forward",title:"Bring Forward (F)",onClick:d,disabled:!tO,children:(0,Q.jsx)(hP.FaArrowUp,{})}),(0,Q.jsx)("button",{type:"button","aria-label":"Send Backward",title:"Send Backward (B)",onClick:f,disabled:!tO,children:(0,Q.jsx)(hP.FaArrowDown,{})})]}),(0,Q.jsx)("button",{type:"button","aria-label":"Duplicate",title:"Duplicate (D)",onClick:g,disabled:!tO,children:(0,Q.jsx)(hj,{})}),(0,Q.jsx)("button",{type:"button","aria-label":"Delete",title:"Delete (Backspace)",onClick:p,disabled:tT||!tO,children:(0,Q.jsx)(hP.FaTrashAlt,{})}),(0,Q.jsxs)("div",{className:"ButtonGroup",children:[(0,Q.jsx)("button",{type:"button","aria-label":"Undo",title:"Undo (".concat(Z,"Z)"),onClick:m,disabled:!x,children:(0,Q.jsx)(hB,{})}),(0,Q.jsx)("button",{type:"button","aria-label":"Redo",title:"Redo (".concat(q?"".concat("⇧").concat(Z,"Z)"):"".concat(Z," Y"),")"),onClick:y,disabled:!b,children:(0,Q.jsx)(hN,{})})]}),"color"===B?(0,Q.jsxs)("button",{type:"button",className:"MetallicButton","aria-label":"Copy to Metallic",title:"Copy to Metallic",onClick:_,children:[(0,Q.jsx)(hA,{})," ",(0,Q.jsx)("span",{className:"ButtonLabel",children:"Metal"})]}):null]})]}),(0,Q.jsxs)("div",{className:"Export",children:[(0,Q.jsx)("input",{ref:e,type:"text",name:"CustomSkinName",placeholder:"Skin Name",size:12}),(0,Q.jsxs)("button",{className:"ExportOptionsButton",type:"button","data-active":tv?"":void 0,"aria-label":"Export Options",title:"Export Options",ref:tx.setReference,...tC(),children:[".",i,(0,Q.jsx)(hP.FaAngleDown,{})]}),tv?(0,Q.jsx)(hy,{context:t_,modal:!1,children:(0,Q.jsx)("div",{className:"ExportOptionsPopup",ref:tx.setFloating,style:tb,...tS(),children:(0,Q.jsxs)("div",{className:"Fields",children:[(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{children:"Export Materials"}),(0,Q.jsx)("ul",{className:"ExportOptionsList",children:V.map((t,e)=>t&&!1!==t.selectable&&!t.hidden?(0,Q.jsxs)("li",{children:[(0,Q.jsx)("input",{id:"MaterialSelect-".concat(t.name),type:"checkbox",checked:!1!==U[e],onChange:t=>{H(r=>{let i=r.slice();return i[e]=t.target.checked,i})}}),(0,Q.jsx)("label",{htmlFor:"MaterialSelect-".concat(t.name),children:t.label})]},t.name):null)})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{htmlFor:"ExportFormat",children:"Export Format"}),(0,Q.jsxs)("select",{id:"ExportFormat",value:i,onChange:t=>{n(t.target.value);try{localStorage.setItem("exportFileType",t.target.value)}catch(t){}},children:[(0,Q.jsx)("option",{value:"png",children:".png"}),(0,Q.jsx)("option",{value:"vl2",children:".vl2"})]})]})]})})}):null,(0,Q.jsx)("button",{type:"button",onClick:()=>{W({name:e.current?e.current.value:"",format:i})},children:"Export"})]})]})}function cp(){return(0,Q.jsxs)("footer",{className:"AppFooter",children:[(0,Q.jsx)("a",{href:"https://github.com/exogen/t2-model-skinner",className:"IconLink",children:(0,Q.jsx)(hP.FaGithub,{size:24})}),(0,Q.jsxs)("div",{className:"Sponsor",children:[(0,Q.jsx)("a",{href:"https://github.com/sponsors/exogen",target:"_blank",rel:"noreferrer",children:"Support this project"})," ",(0,Q.jsx)("span",{className:"Separator",children:"or"})," ",(0,Q.jsx)("a",{href:"https://www.buymeacoffee.com/mosswood",target:"_blank",rel:"noreferrer",children:(0,Q.jsx)("img",{src:"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png",alt:"Buy Me A Coffee",width:109,height:31})})]})]})}async function cm(t){return await s7.fromURL(t,{crossOrigin:"anonymous"})}var cv=t.i(55519);function cy(){let e=(0,J.useRef)(null),r=(0,J.useRef)(null),i=(0,J.useMemo)(()=>({async combineColorAndAlphaImageUrls(){for(var t=arguments.length,e=Array(t),i=0;i{let i=new Worker(t.r(79702)),n=cv.wrap(i);return e.current=i,r.current=n,()=>{n[cv.releaseProxy](),r.current=null,i.terminate()}},[]),i}function cx(){return{canvasPadding:64,basePath:"/t2-model-skinner"}}var cb=t.i(54826);let{materials:c_}=cd.default,cw=[512,512];function cC(e){var r,i;let{children:n}=e,{actualModel:s,selectedModelType:o}=hV(),[a,l]=(0,J.useState)(0),[h,c]=(0,J.useState)(0),[u,d]=(0,J.useState)(1),f=c_[s],g=null!=(r=f[a])?r:null,p=null!=(i=g.frameCount)?i:1,m=p>1,[y,x]=(0,J.useState)([]),b=(0,J.useMemo)(()=>{var t;let[e,r]=null!=(t=g.size)?t:cw;return[e*u,r*u]},[g.size,u]),_=0!==g.metallicFactor||1!==g.roughnessFactor,[w,C]=(0,J.useState)("color");_||"metallic"!==w||C("color"),h>=p&&c(0),(0,J.useEffect)(()=>{try{let t=localStorage.getItem("sizeMultiplier");switch(t){case"1":case"2":case"4":d(+t)}}catch(t){}},[]),(0,J.useEffect)(()=>{x(f.map(t=>!!(t&&!1!==t.selectable&&!t.hidden)))},[f]),(0,J.useEffect)(()=>{c(0)},[g]);let[S,T]=(0,J.useState)("black"),[O,k]=(0,J.useState)(()=>new Set),[M,E]=(0,J.useState)(200),[D,j]=(0,J.useState)(10),[A,P]=(0,J.useState)(()=>new Map),[F,L]=(0,J.useState)(()=>[]),R=g?"".concat(g.name,":").concat(w,":").concat(h,":").concat(u):null,I=g?"".concat(g.name,":metallic:").concat(h,":").concat(u):null,{canvases:B}=oZ(),{canvas:N,notifyChange:W,undo:U,redo:H,canUndo:X,canRedo:V}=oZ(R),{canvas:Y,setDrawingMode:z}=oZ(I),{combineColorAndAlphaImageUrls:G}=cy(),{canvasPadding:q}=cx(),[K,Z]=(0,J.useState)(()=>[]),[$,tt]=(0,J.useState)("BaseLayer");F.length?"SelectedLayer"!==$&&tt("SelectedLayer"):"SelectedLayer"===$&&tt("BaseLayer");let te=(0,J.useCallback)((t,e)=>{var r,i,n;let s=[],o=new Map(A),a=F;for(let l of("AllLayers"===$?a=null!=(r=null==N?void 0:N._objects)?r:[]:"BaseLayer"===$&&(a=null!=(i=null==N?void 0:N._objects.slice(0,1))?i:[]),a))if(l instanceof s7){let r={...null!=(n=A.get(l))?n:{},[t]:e};o.set(l,r),s.push([l,r])}P(o),Z(s)},[N,$,A,F]),tr=t=>{var e,r;let i=+("Opacity"===t),n=F;if("AllLayers"===$?n=null!=(e=null==N?void 0:N._objects)?e:[]:"BaseLayer"===$&&(n=null!=(r=null==N?void 0:N._objects.slice(0,1))?r:[]),!(n=n.filter(t=>t instanceof s7)).length)return[i,e=>te(t,e)];{let e=e=>{var r,s;return null!=(s=(null!=(r=A.get(n[e]))?r:{})[t])?s:i},r=e(0);return n.slice(1).every((t,i)=>e(i+1)===r)?[r,e=>te(t,e)]:[null,e=>te(t,e)]}},[ti,tn]=tr("HueRotation"),[ts,to]=tr("Saturation"),[ta,tl]=tr("Brightness"),[th,tc]=tr("Contrast"),[tu,td]=tr("Opacity");(0,J.useEffect)(()=>{if(K.length){for(let[t,e]of K)if(t instanceof s7){if(t.filters=[],"metallic"===w){let e=new oQ.Grayscale;t.filters.push(e)}for(let r in e){let i=e[r];if(null!=i)switch(r){case"HueRotation":t.filters.push(new oQ.HueRotation({rotation:i}));break;case"Saturation":t.filters.push(new oQ.Saturation({saturation:i}));break;case"Brightness":t.filters.push(new oQ.Brightness({brightness:i}));break;case"Contrast":t.filters.push(new oQ.Contrast({contrast:i}));break;case"Opacity":t.opacity=i}}t.applyFilters()}Z([]),W&&W()}},[K,w,W]);let tf=(0,J.useCallback)(()=>{F.length&&k(t=>{let e=new Set(t);for(let t of F)e.add(t),t.lockMovementX=!0,t.lockMovementY=!0,t.lockScalingX=!0,t.lockScalingY=!0,t.lockRotation=!0;return e})},[F]),tg=(0,J.useCallback)(()=>{F.length&&k(t=>{let e=new Set(t);for(let t of F)e.delete(t),t.lockMovementX=!1,t.lockMovementY=!1,t.lockScalingX=!1,t.lockScalingY=!1,t.lockRotation=!1;return e})},[F]),tp=(0,J.useCallback)(async()=>{let t=N.getActiveObject();t&&(N.bringObjectForward(t,!0),W())},[N,W]),tm=(0,J.useCallback)(async()=>{let t=N.getActiveObject();if(t){if(N._objects[0]===t||N._objects[1]===t)return;N.sendObjectBackwards(t,!0),W()}},[N,W]),tv=(0,J.useCallback)(async t=>{let e;for(let r of t){let t=await cm(r);if(!t.width||!t.height)throw Error("Zero-height image");let i=t.width/b[0],n=t.height/b[1];if(i>1||n>1){let e;t.scaleX=e=i>n?1/i:1/n,t.scaleY=e}if("metallic"===w){t.filters||(t.filters=[]);let e=new oQ.Grayscale;t.filters.push(e),t.applyFilters()}Y&&z(!1),N.centerObject(t),N.add(t),e=t}e&&(N.setActiveObject(e),N.requestRenderAll())},[b,w,Y,N,z]),ty=(0,J.useCallback)(async()=>{let t=N.getActiveObject();if(t){var e,r;let i=await t.clone();i.set({top:(null!=(e=i.top)?e:0)+20,left:(null!=(r=i.left)?r:0)+20,evented:!0}),"activeSelection"===i.type&&(i.canvas=N,i.forEachObject(t=>{N.add(t)}),i.setCoords()),N.discardActiveObject(),N.add(i),N.setActiveObject(i)}},[N]),tx=(0,J.useCallback)(async()=>{let t=N.getActiveObjects();N.discardActiveObject(),N.remove(...t),N.requestRenderAll()},[N]),tb=(0,J.useCallback)(async()=>{if("color"===w&&Y){let t=N.toDataURL({format:"png",multiplier:1,top:q,left:q,width:b[0],height:b[1]}),e=await cm(t);e.filters||(e.filters=[]);let r=new oQ.Grayscale;e.filters.push(r),e.applyFilters(),Y.centerObject(e),Y.add(e),Y.setActiveObject(e),z(!1),C("metallic")}},[Y,N,w,q,z,b]),t_=(0,J.useCallback)(async e=>{let{format:r,name:i=""}=e,{savePngFile:n,saveZipFile:a,createZipFile:l}=await t.A(91135);i=i.trim()||"MyCustomSkin";let h=await Promise.all(f.filter((t,e)=>!1!==y[e]).map(t=>{var e;let r=null!=(e=t.frameCount)?e:1;return Array(r).fill(null).map(async(e,n)=>{var a,l,h,c;let d,f,g=null==(a=B["".concat(t.name,":color:").concat(n,":").concat(u)])?void 0:a.canvas,p=null==(l=B["".concat(t.name,":metallic:").concat(n,":").concat(u)])?void 0:l.canvas,m=null!=(h=t.size)?h:cw,y=[m[0]*u,m[1]*u],x=g.toDataURL({format:"png",multiplier:1,top:q,left:q,width:y[0],height:y[1]});if(p){let t=p.toDataURL({format:"png",multiplier:1,top:q,left:q,width:y[0],height:y[1]});d=await G({colorImageUrl:x,metallicImageUrl:t})}else d=x;switch(o){case"player":f="".concat(i,".").concat(s,".png");break;case"weapon":case"vehicle":if(t){let e=null!=(c=t.file)?c:t.name;if(r>1){let t=e.match(/^(.+)(\d\d)$/);if(t){let e=t[1];f="".concat(e).concat(n.toString().padStart(2,"0"),".png")}else throw Error("Unexpected animation filename")}else f="".concat(e,".png")}else f="weapon"===o?"weapon_".concat(s,".png"):"".concat(s,".png");break;default:throw Error("Unknown model type")}return{imageUrl:d,filename:f}})}).flat());switch(r){case"png":h.forEach(t=>{let{imageUrl:e,filename:r}=t;n(e,r)});break;case"vl2":{let t=l(await Promise.all(h.map(async t=>({data:await (0,cb.imageUrlToArrayBuffer)(t.imageUrl),name:t.filename})))),e=s.replace(/(?:^([a-z])|_([a-z]))/g,(t,e,r)=>(e||r).toUpperCase()),r="",n=u>1?"-@".concat(u,"x"):"";switch(o){case"player":r="zPlayerSkin-".concat(i).concat(n,".vl2");break;case"weapon":r="zWeapon".concat(e,"-").concat(i).concat(n,".vl2");break;case"vehicle":r="z".concat(e,"-").concat(i).concat(n,".vl2")}await a(t,r)}}},[f,y,B,u,q,o,G,s]),tw=(0,J.useMemo)(()=>({activeCanvas:R,activeCanvasType:w,setActiveCanvasType:C,backgroundColor:S,setBackgroundColor:T,lockedObjects:O,setLockedObjects:k,brushColor:M,setBrushColor:E,brushSize:D,setBrushSize:j,hueRotate:ti,setHueRotate:tn,saturation:ts,setSaturation:to,brightness:ta,setBrightness:tl,contrast:th,setContrast:tc,opacity:tu,setOpacity:td,layerMode:$,setLayerMode:tt,selectedObjects:F,lockSelection:tf,unlockSelection:tg,bringForward:tp,sendBackward:tm,addImages:tv,duplicate:ty,deleteSelection:tx,undo:U,redo:H,canUndo:X,canRedo:V,copyToMetallic:tb,exportSkin:t_,selectedMaterialIndex:a,setSelectedMaterialIndex:l,textureSize:b,hasMetallic:_,selectedFrameIndex:h,setSelectedFrameIndex:c,hasAnimation:m,frameCount:p,sizeMultiplier:u,setSizeMultiplier:d,selectedExportMaterials:y,setSelectedExportMaterials:x}),[R,w,S,O,M,D,ti,tn,ts,to,ta,tl,th,tc,tu,td,$,F,tf,tg,tp,tm,tv,ty,tx,U,H,X,V,tb,t_,a,b,_,h,m,p,u,y]);return(0,J.useEffect)(()=>{if(N){let t=()=>{L(N.getActiveObjects())};return N.on("selection:cleared",t),N.on("selection:updated",t),N.on("selection:created",t),t(),()=>{N.off("selection:cleared",t),N.off("selection:updated",t),N.off("selection:created",t)}}},[N]),(0,J.useEffect)(()=>{Y&&(Y.freeDrawingBrush||(Y.freeDrawingBrush=new sx(Y)),Y.freeDrawingBrush.width=D)},[Y,D]),(0,J.useEffect)(()=>{Y&&(Y.freeDrawingBrush||(Y.freeDrawingBrush=new sx(Y)),Y.freeDrawingBrush.color="rgb(".concat(M,", ").concat(M,", ").concat(M,")"))},[Y,M]),(0,Q.jsx)(o$.Provider,{value:tw,children:n})}function cS(){let{backgroundColor:t,textureSize:e}=o0(),{canvasPadding:r}=cx();return e?(0,Q.jsx)("div",{className:"CanvasBackdrop",style:{backgroundColor:t,top:r,width:e[0],height:e[1]}}):null}function cT(t){let{children:e}=t,[r,i]=(0,J.useState)({}),n=(0,J.useCallback)((t,e)=>{i(r=>({...r,[t]:e}))},[]),s=(0,J.useCallback)(t=>{i(e=>{let{[t]:r,...i}=e;return i})},[]),o=(0,J.useMemo)(()=>({canvases:r,registerCanvas:n,unregisterCanvas:s}),[r,n,s]);return(0,Q.jsx)(oJ.Provider,{value:o,children:e})}function cO(t){let{children:e}=t,r=(0,J.useRef)(null),{activeCanvas:i,activeCanvasType:n,bringForward:s,sendBackward:o,duplicate:a,deleteSelection:l,addImages:h,undo:c,redo:u}=o0(),{canvas:d,notifyChange:f,setDrawingMode:g}=oZ(i),p=async function(){let{top:t=0,left:e=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(let n of d.getActiveObjects()){var r,i;n.top=(null!=(r=n.top)?r:0)+t,n.left=(null!=(i=n.left)?i:0)+e,n.setCoords()}f()};return(0,Q.jsx)("div",{className:"CanvasInteractions",tabIndex:0,ref:r,onDragOver:t=>{t.preventDefault()},onDrop:async t=>{t.preventDefault(),r.current&&r.current.focus();let{items:e}=t.dataTransfer,i=Array.from(e).filter(t=>"file"===t.kind&&t.type.match(/^image\//)),n=await Promise.all(i.map(async t=>{let e=t.getAsFile();if(!e)throw Error("Not a file.");let r=new FileReader;return await new Promise((t,i)=>{r.onload=async e=>{e.target&&"string"==typeof e.target.result?t(e.target.result):i(Error("Failed to load image data."))},r.readAsDataURL(e)})}).filter(Boolean));await h(n)},onKeyDown:async t=>{let e=t.target;if("INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName){if(t.ctrlKey||t.metaKey)switch(t.key){case"z":if(t.altKey)return;if(t.shiftKey){t.preventDefault(),u();return}t.preventDefault(),c();return;case"y":if(t.altKey||t.shiftKey)return;t.preventDefault(),u();return}if(!t.altKey&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey)switch(t.key){case"Backspace":case"Delete":t.preventDefault(),await l();break;case"ArrowLeft":t.preventDefault(),await p({left:-1});break;case"ArrowRight":t.preventDefault(),await p({left:1});break;case"ArrowUp":t.preventDefault(),await p({top:-1});break;case"ArrowDown":t.preventDefault(),await p({top:1});break;case"d":t.preventDefault(),await a();break;case"f":t.preventDefault(),await s();break;case"b":t.preventDefault(),await o();break;case"p":"metallic"===n&&(t.preventDefault(),g(!0));break;case"s":"metallic"===n&&(t.preventDefault(),g(!1))}}},children:e})}function ck(){let{activeCanvasType:t,setActiveCanvasType:e,hasMetallic:r,hasAnimation:i,frameCount:n,selectedFrameIndex:s,setSelectedFrameIndex:o,sizeMultiplier:a,setSizeMultiplier:l}=o0();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"CanvasToggle",children:[(0,Q.jsx)("button",{type:"button","data-selected":"color"===t?"":void 0,onClick:()=>{e("color")},children:"Color"}),r?(0,Q.jsx)("button",{type:"button","data-selected":"metallic"===t?"":void 0,onClick:()=>{e("metallic")},children:"Metallic"}):null]}),(0,Q.jsxs)("div",{className:"CanvasToggle",style:{display:"none"},children:[(0,Q.jsx)("button",{type:"button","data-selected":1===a?"":void 0,onClick:()=>{l(1)},children:"1×"}),(0,Q.jsx)("button",{type:"button","data-selected":2===a?"":void 0,onClick:()=>{l(2)},children:"2×"}),(0,Q.jsx)("button",{type:"button","data-selected":4===a?"":void 0,onClick:()=>{l(4)},children:"4×"})]}),i?(0,Q.jsxs)("div",{className:"FrameSelector",children:[(0,Q.jsx)("button",{type:"button",onClick:()=>{o(t=>(n+t-1)%n)},children:(0,Q.jsx)(hP.FaChevronLeft,{})}),(0,Q.jsxs)("span",{className:"FrameInfo",children:[s+1," / ",n]}),(0,Q.jsx)("button",{type:"button",onClick:()=>{o(t=>(t+1)%n)},children:(0,Q.jsx)(hP.FaChevronRight,{})})]}):null]})}var cM=t.i(90106),cE=t.i(53653),cD=t.i(15768);let{defaultSkins:cj,modelDefaults:cA}=cd.default,cP={},cF=new Map;function cL(){var t,e,r,i,n,s;let{selectedModel:o,setSelectedModel:a,selectedModelType:l,setSelectedModelType:h,selectedSkin:c,setSelectedSkin:u,setSelectedSkinType:d,actualModel:f,setSelectedAnimation:g,setAnimationPaused:p,importedSkins:m,addImportedSkins:y}=hV(),{setSelectedMaterialIndex:x}=o0(),[b,_]=(0,J.useState)(cP),[w,C]=(0,J.useState)(cP),[S,T]=(0,J.useState)(null),O=(0,J.useRef)(null),[k,M]=(0,cD.default)(),E=Array.from((null!=(s=m.get(f))?s:cF).values()).filter(t=>t.isComplete);M&&(b!==k.customSkins||w!==k.newSkins)&&(_(k.customSkins),C(k.newSkins));let D=null!=c?c:"";return c&&S&&(D="".concat(S,"/").concat(c)),(0,Q.jsxs)("div",{className:"Toolbar",children:[(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{htmlFor:"ModelSelect",children:"Model"}),(0,Q.jsxs)("select",{id:"ModelSelect",value:o,onChange:t=>{var e,r,i,n;let s=t.target.selectedOptions[0].parentNode,o=t.target.value,l="hfemale"===o?"hmale":o,{modelType:f}=s.dataset;if(!f)throw Error("No data-model-type found");let m=c&&((null==(e=cj[l])?void 0:e.includes(c))||(null==(r=b[l])?void 0:r.includes(c)))||!1,y=!1;c&&"new"===S&&m&&(y=null==(i=w[l])?void 0:i.includes(c)),g(null),p(!1),h(f),a(o),x(0),m||(u(null!=(n=cA[l])?n:null),d("default")),y||T(null)},children:[(0,Q.jsxs)("optgroup",{label:"Players","data-model-type":"player",children:[(0,Q.jsx)("option",{value:"lmale",children:"Human Male • Light"}),(0,Q.jsx)("option",{value:"mmale",children:"Human Male • Medium"}),(0,Q.jsx)("option",{value:"hmale",children:"Human Male • Heavy"}),(0,Q.jsx)("option",{value:"lfemale",children:"Human Female • Light"}),(0,Q.jsx)("option",{value:"mfemale",children:"Human Female • Medium"}),(0,Q.jsx)("option",{value:"hfemale",children:"Human Female • Heavy"}),(0,Q.jsx)("option",{value:"lbioderm",children:"Bioderm • Light"}),(0,Q.jsx)("option",{value:"mbioderm",children:"Bioderm • Medium"}),(0,Q.jsx)("option",{value:"hbioderm",children:"Bioderm • Heavy"})]}),(0,Q.jsxs)("optgroup",{label:"Weapons","data-model-type":"weapon",children:[(0,Q.jsx)("option",{value:"disc",children:"Disc Launcher"}),(0,Q.jsx)("option",{value:"chaingun",children:"Chaingun"}),(0,Q.jsx)("option",{value:"grenade_launcher",children:"Grenade Launcher"}),(0,Q.jsx)("option",{value:"sniper",children:"Laser Rifle"}),(0,Q.jsx)("option",{value:"plasmathrower",children:"Plasma Cannon"}),(0,Q.jsx)("option",{value:"energy",children:"Blaster"}),(0,Q.jsx)("option",{value:"shocklance",children:"Shocklance"}),(0,Q.jsx)("option",{value:"elf",children:"ELF Projector"}),(0,Q.jsx)("option",{value:"missile",children:"Missile Launcher"}),(0,Q.jsx)("option",{value:"mortar",children:"Mortar"}),(0,Q.jsx)("option",{value:"repair",children:"Repair Pack"}),(0,Q.jsx)("option",{value:"targeting",children:"Targeting Laser"}),(0,Q.jsx)("option",{value:"mine",children:"Mine"})]}),(0,Q.jsxs)("optgroup",{label:"Vehicles","data-model-type":"vehicle",children:[(0,Q.jsx)("option",{value:"vehicle_grav_scout",children:"Wildcat Grav Cycle"}),(0,Q.jsx)("option",{value:"vehicle_grav_tank",children:"Beowulf Assault Tank"}),(0,Q.jsx)("option",{value:"vehicle_land_mpbbase",children:"Jericho Mobile Point Base"}),(0,Q.jsx)("option",{value:"vehicle_air_scout",children:"Shrike Scout Fighter"}),(0,Q.jsx)("option",{value:"vehicle_air_bomber",children:"Thundersword Bomber"}),(0,Q.jsx)("option",{value:"vehicle_air_hapc",children:"HAVOC Gunship Transport"})]})]})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{htmlFor:"SkinSelect",children:"Skin"}),(0,Q.jsxs)("div",{className:"Buttons",children:[(0,Q.jsxs)("select",{id:"SkinSelect",value:D,onChange:t=>{var e,r;let i=t.target.selectedOptions[0].parentNode,n=t.target.value&&null!=(e=i.dataset.skinType)?e:null,s=t.target.value.split("/");u(null!=(r=s.slice(-1)[0])?r:null),d(n),s.length>1?T(s[0]):T(null)},children:[(0,Q.jsx)("option",{value:"",children:"Select a skin…"}),"player"===l?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("optgroup",{label:"Default Skins","data-skin-type":"default",children:null==(t=cj[f])?void 0:t.map(t=>(0,Q.jsx)("option",{value:t,children:t},t))}),E.length?(0,Q.jsx)("optgroup",{label:"Imported Skins","data-skin-type":"import",children:E.map(t=>{var e,r;return(0,Q.jsx)("option",{value:"import/".concat(null!=(e=t.name)?e:"__untitled__"),children:t.name||"Untitled Imported Skin"},"import/".concat(null!=(r=t.name)?r:"__untitled__"))})}):null,(null==(e=w[f])?void 0:e.length)?(0,Q.jsx)("optgroup",{label:"New Skins ✨","data-skin-type":"custom",children:null==(r=w[f])?void 0:r.map(t=>(0,Q.jsxs)("option",{value:"new/".concat(t),children:[t," ✨"]},"new/".concat(t)))}):null,(0,Q.jsx)("optgroup",{label:"Custom Skins","data-skin-type":"custom",children:b===cP?(0,Q.jsx)("option",{value:"",children:"Loading…"},"loading"):null==(i=b[f])?void 0:i.map(t=>(0,Q.jsx)("option",{value:t,children:t},t))})]}):null,"weapon"===l||"vehicle"===l?(0,Q.jsxs)(Q.Fragment,{children:[cA[f]?(0,Q.jsx)("optgroup",{label:"Default Skins","data-skin-type":"default",children:(0,Q.jsx)("option",{value:cA[f],children:"Default"})}):null,E.length?(0,Q.jsx)("optgroup",{label:"Imported Skins","data-skin-type":"import",children:E.map(t=>{var e,r;return(0,Q.jsx)("option",{value:"import/".concat(null!=(e=t.name)?e:"__untitled__"),children:t.name||"Untitled Imported Skin"},"import/".concat(null!=(r=t.name)?r:"__untitled__"))})}):null,(null==(n=b[f])?void 0:n.length)?(0,Q.jsx)("optgroup",{label:"Custom Skins","data-skin-type":"custom",children:b[f].map(t=>(0,Q.jsx)("option",{value:t,children:t},t))}):null]}):null]}),(0,Q.jsx)("button",{type:"button","aria-label":"Load Skin",title:"Load a Skin",onClick:()=>{O.current&&O.current.click()},children:(0,Q.jsx)(hP.FaFolderOpen,{style:{fontSize:18}})}),(0,Q.jsx)("input",{ref:O,onChange:async t=>{var e,r,i;let n=await (0,cE.importMultipleFilesToModels)(null!=(e=t.target.files)?e:[]);y(n);let s=n.get(f);if(s){let t=Array.from(s.values()).filter(t=>t.isComplete);if(t.length){let e=t[0];d("import"),T("import"),u(null!=(r=e.name)?r:"__untitled__"),x(0),g(null);return}}for(let[t,e]of Array.from(n.entries()))for(let r of Array.from(e.values()))if(r.isComplete){a(t),h((0,cE.modelToModelType)(t)),d("import"),T("import"),u(null!=(i=r.name)?i:"__untitled__"),x(0),g(null);break}},type:"file",accept:".png, image/png, .vl2, .zip, application/zip, application/zip-compressed",multiple:!0,hidden:!0})]})]}),(0,Q.jsx)("div",{className:"Field GalleryField",children:(0,Q.jsxs)("a",{href:"gallery/",target:"_blank",className:"GalleryLink",title:"Open skin gallery",children:[(0,Q.jsx)("span",{className:"FieldLabel",children:"Gallery"}),(0,Q.jsx)(cM.BsFillGrid3X3GapFill,{})]})})]})}var cR=t.i(18566);let{materials:cI,modelDefaults:cB,defaultSkins:cN}=cd.default,cW="https://exogen.github.io/t2-skins/skins",cU=new Map;function cH(t,e){if(e<2)return[t];let r=t.match(/^(.+)(\d\d)$/);if(r){let t=r[1];return Array(e).fill(null).map((e,r)=>"".concat(t).concat(r.toString().padStart(2,"0")))}throw Error("Did not match expected frame format")}function cX(t){let{basePath:e,actualModel:r,selectedModelType:i,selectedSkin:n,selectedSkinType:s}=t,o=cI[r];if(n&&"import"===s){let t=cU.get(r);if(t){let e="__untitled__"===n?null:n,r=t.get(e);if(r&&r.isComplete)return Object.fromEntries(r.materials)}throw Error("No skin found")}switch(i){case"player":switch(s){case"default":return{base:["".concat(e,"/textures/").concat(n,".").concat(r,".png")]};case"custom":return{base:["".concat(cW,"/").concat(n,".").concat(r,".png")]}}break;case"weapon":case"vehicle":return o.reduce((t,r)=>{if(r){var i,o,a,l,h;let c=null!=(i=r.frameCount)?i:1;switch(s){case"default":!1!==r.hasDefault&&(t[null!=(o=r.file)?o:r.name]=cH(null!=(a=r.file)?a:r.name,c).map(t=>"".concat(e,"/textures/").concat(t,".png")));break;case"custom":t[null!=(l=r.file)?l:r.name]=cH(null!=(h=r.file)?h:r.name,c).map(t=>"".concat(cW,"/").concat(n,"/").concat(t,".png"))}}return t},{})}return{}}function cV(t){var e,r;let{children:i}=t,n=(0,cR.useRouter)(),s=(0,cR.usePathname)(),o=(0,cR.useSearchParams)(),[a,l]=(0,J.useState)(!1),[h,c]=(0,J.useState)("lmale"),[u,d]=(0,J.useState)("player"),[f,g]=(0,J.useState)("Blood Eagle"),[p,m]=(0,J.useState)("default"),[y,x]=(0,J.useState)(null),[b,_]=(0,J.useState)(!1),[w,C]=(0,J.useState)(!1),{basePath:S}=cx(),T="hfemale"===h?"hmale":h,O="".concat(S,"/").concat(T).concat(y?".anim":"",".glb"),[k,M]=(0,J.useState)(cU),E=(0,J.useCallback)(t=>{let e=new Map(cU.entries());t.forEach((t,r)=>{var i;let n=null!=(i=e.get(r))?i:new Map;t.forEach((t,e)=>{n.set(e,t)}),e.set(r,n)}),M(cU=e)},[]),[D,j]=(0,J.useState)(()=>cX({basePath:S,actualModel:T,selectedModelType:u,selectedSkin:f,selectedSkinType:p})),A=(0,J.useMemo)(()=>cX({basePath:S,actualModel:T,selectedModelType:u,selectedSkin:cB[T],selectedSkinType:"default"}),[T,S,u]),P=(0,J.useMemo)(()=>({selectedModel:h,setSelectedModel:c,selectedModelType:u,setSelectedModelType:d,actualModel:T,selectedModelUrl:O,animationPaused:b,setAnimationPaused:_,selectedSkin:f,setSelectedSkin:g,selectedSkinType:p,setSelectedSkinType:m,selectedAnimation:y,setSelectedAnimation:x,skinImageUrls:D,setSkinImageUrls:j,defaultSkinImageUrls:A,slowModeEnabled:w,setSlowModeEnabled:C,importedSkins:k,addImportedSkins:E}),[h,c,u,d,T,O,b,_,f,g,p,m,y,x,D,j,A,w,k,E]);if(!a){let t=o.get("m"),i=o.get("s");if("string"==typeof t){let n=function(t){switch(t){case"lmale":case"mmale":case"hmale":case"lfemale":case"mfemale":case"hfemale":case"lbioderm":case"mbioderm":case"hbioderm":return"player";case"disc":case"chaingun":case"grenade_launcher":case"sniper":case"plasmathrower":case"energy":case"shocklance":case"elf":case"missile":case"mortar":case"repair":case"targeting":case"mine":return"weapon";case"vehicle_grav_scout":case"vehicle_grav_tank":case"vehicle_land_mpbbase":case"vehicle_air_scout":case"vehicle_air_bomber":case"vehicle_air_hapc":return"vehicle";default:return null}}(t);if(n&&(c(t),d(n),"string"==typeof i)){let n=i===cB[e="hfemale"===t?"hmale":t]||(null==(r=cN[e])?void 0:r.includes(i))?"default":"custom";g(i),m(n)}}l(!0)}return(0,J.useEffect)(()=>{if(!f)return;let t=o.get("m"),e=o.get("s");if(t!==h||e!==f){let t=new URLSearchParams(o);t.set("m",h),t.set("s",f);let e="".concat(s,"?").concat(t);n.replace(e,{scroll:!1})}},[s,n,o,h,f]),(0,J.useEffect)(()=>{if(f)try{let t=cX({basePath:S,actualModel:T,selectedModelType:u,selectedSkin:f,selectedSkinType:p});j(t)}catch(t){m("default"),g(cB[T])}},[T,S,u,f,p]),(0,Q.jsx)(hX.Provider,{value:P,children:i})}var cY=t.i(70703);let cz=J.default.createContext(null);function cG(){let t=(0,J.useContext)(cz);if(!t)throw Error("No EnvironmentContext.Provider");return t}cz.displayName="EnvironmentContext";let cq=J.default.createContext(null);function cK(){let t=(0,J.useContext)(cq);if(!t)throw Error("No SkinContext.Provider");return t}cq.displayName="SkinContext";var cQ=t.i(63871);function cJ(t){let{material:e,materialDef:r,textureType:i,imageUrl:n,frameRef:s,onReady:o}=t,{modelViewer:a}=(0,cQ.default)(),{basePath:l}=cx(),{slowModeEnabled:h}=hV();(0,J.useEffect)(()=>{let t,c=!1;return(async()=>{if(!r||r.hidden)if("metallicRoughnessTexture"===i){o&&o();return}else e.setAlphaMode("BLEND"),e.pbrMetallicRoughness.setBaseColorFactor([0,0,0,0]),o&&o();else{let{alphaMode:u,alphaCutoff:d,baseColorFactor:f,emissiveFactor:g,emissiveTexture:p=!1,metallicFactor:m=1,roughnessFactor:y=1,frameCount:x=1,frameTimings:b}=r,_=null!=n?n:Array(x).fill("".concat(l,"/white.png"));if(_.some(t=>!t))return;switch(i){case"baseColorTexture":f&&e.pbrMetallicRoughness.setBaseColorFactor(f),u&&e.setAlphaMode(u),d&&e.setAlphaCutoff(d),g&&e.setEmissiveFactor(g);break;case"metallicRoughnessTexture":e.pbrMetallicRoughness.setMetallicFactor(m),e.pbrMetallicRoughness.setRoughnessFactor(y),0===m&&1===y&&(_=Array(x).fill("".concat(l,"/green.png")))}let w=await Promise.all(_.map(t=>a.createTexture(t)));if(!c){let r="baseColorTexture"===i,n=s.current,a=()=>{let s=w[n.frameIndex];if(e.pbrMetallicRoughness[i].setTexture(s),r&&p&&e.emissiveTexture.setTexture(s),r&&(n.frameProgress+=h?.05:1),x>1){var o;let e=null!=(o=null==b?void 0:b[n.frameIndex])?o:1;r&&n.frameProgress>=e&&(n.frameIndex=(n.frameIndex+1)%x,n.frameProgress=0),t=requestAnimationFrame(a)}};a(0),o&&o()}}})(),()=>{c=!0,null!=t&&cancelAnimationFrame(t)}},[l,a,e,r,i,n,s,h,o])}function cZ(t){var e,r;let{material:i,materialDef:n,onReady:s}=t,{getSkinImages:o}=cK(),{colorImageUrl:a,metallicImageUrl:l}=null!=(r=o(null!=(e=null==n?void 0:n.file)?e:i.name))?r:{},h=(0,J.useRef)({frameIndex:0,frameProgress:0});return cJ({material:i,materialDef:n,textureType:"baseColorTexture",imageUrl:a,frameRef:h}),cJ({material:i,materialDef:n,textureType:"metallicRoughnessTexture",imageUrl:l,frameRef:h}),null}let{materials:c$}=cd.default;function c0(){let{actualModel:t}=hV(),{model:e}=(0,cQ.default)(),r=c$[t];return(0,Q.jsx)(Q.Fragment,{children:e.materials.map((t,e)=>{let i=r[e];return(0,Q.jsx)(cZ,{material:t,materialDef:i},t.name)})})}let c1=(0,cY.default)(()=>t.A(22143),{loadableGenerated:{modules:[66641]},ssr:!1}),{cameraOverrides:c2}=cd.default;function c5(){var t,e,r,i;let{selectedModel:n,selectedModelUrl:s,selectedModelType:o,selectedAnimation:a,animationPaused:l,slowModeEnabled:h}=hV(),{environmentImageUrl:c,showEnvironment:u,exposure:d}=cG();return(0,Q.jsx)(c1,{modelUrl:s,environmentImageUrl:c,showEnvironment:u,animationName:a,animationPaused:l,timeScale:h?.05:.5,cameraOrbit:null!=(i=null==(t=c2[n])?void 0:t.orbit)?i:"weapon"===o?"315deg 70deg 105%":void 0,cameraTarget:null==(e=c2[n])?void 0:e.target,fieldOfView:null==(r=c2[n])?void 0:r.fov,exposure:d,children:(0,Q.jsx)(c0,{})})}function c4(){let{selectedEnvironment:t,setSelectedEnvironment:e}=cG();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("label",{htmlFor:"EnvMapSelect",children:"Environment"}),(0,Q.jsxs)("select",{id:"EnvMapSelect",value:null!=t?t:"",onChange:t=>{e(t.target.value||null)},children:[(0,Q.jsx)("option",{value:"",children:"Default"}),(0,Q.jsx)("option",{value:"clarens_night_02_1k.hdr",children:"Clarens Night"}),(0,Q.jsx)("option",{value:"dry_cracked_lake_1k.hdr",children:"Dry Cracked Lake"}),(0,Q.jsx)("option",{value:"fouriesburg_mountain_midday_1k.hdr",children:"Fouriesburg Mountain"}),(0,Q.jsx)("option",{value:"goegap_1k.hdr",children:"Goegap"}),(0,Q.jsx)("option",{value:"hilly_terrain_01_1k.hdr",children:"Hilly Terrain"}),(0,Q.jsx)("option",{value:"kloofendal_48d_partly_cloudy_puresky_1k.hdr",children:"Kloofendal Partly Cloudy"}),(0,Q.jsx)("option",{value:"kloppenheim_06_puresky_1k.hdr",children:"Kloppenheim"}),(0,Q.jsx)("option",{value:"lilienstein_1k.hdr",children:"Lilienstein"}),(0,Q.jsx)("option",{value:"spruit_sunrise_1k_HDR.hdr",children:"Spruit Sunrise"}),(0,Q.jsx)("option",{value:"umhlanga_sunrise_1k.hdr",children:"Umhlanga Sunrise"})]})]})}function c3(){let{exposure:t,setExposure:e}=cG();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("label",{htmlFor:"EnvExposure",children:(0,Q.jsx)(hU,{size:16})}),(0,Q.jsx)("input",{"aria-label":"Exposure",id:"EnvExposure",type:"range",min:.2,max:2.2,step:.1,value:t,onChange:t=>{e(parseFloat(t.target.value))}})]})}let{animations:c9,animationLabels:c6,animationLabelOverrides:c8}=cd.default;function c7(){let{actualModel:t,selectedModelType:e,selectedAnimation:r,setSelectedAnimation:i,animationPaused:n,setAnimationPaused:s,slowModeEnabled:o,setSlowModeEnabled:a}=hV(),l=(0,J.useMemo)(()=>{var r;return[..."player"===e?c9.global:[],...null!=(r=c9[t])?r:[]]},[t,e]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"LabelWithControls",children:[(0,Q.jsx)("label",{children:"Animation"}),(0,Q.jsxs)("div",{className:"AnimationSpeed",children:[(0,Q.jsx)("input",{type:"checkbox",id:"SlowDownCheckbox",checked:o,onChange:t=>{a(t.target.checked)}})," ",(0,Q.jsx)("label",{htmlFor:"SlowDownCheckbox",children:"Slow?"})]})]}),(0,Q.jsxs)("div",{className:"Buttons",children:[(0,Q.jsxs)("select",{value:null!=r?r:"",onChange:t=>{i(t.target.value||null),s(!1)},children:[(0,Q.jsx)("option",{value:"",children:"None"}),l.map(e=>{var r,i;let n=null!=(i=null==(r=c8[t])?void 0:r[e])?i:c6[e];return(0,Q.jsx)("option",{value:e,children:null!=n?n:e},e)})]}),(0,Q.jsx)("button",{type:"button",disabled:!r,onClick:()=>{s(t=>!t)},children:n||!r?(0,Q.jsx)(hI,{}):(0,Q.jsx)(hR,{})})]})]})}function ut(t){let{children:e}=t,[r,i]=(0,J.useState)(null),[n,s]=(0,J.useState)(!1),[o,a]=(0,J.useState)(1),{basePath:l}=cx(),h=(0,J.useMemo)(()=>{let t=r?"".concat(l,"/").concat(r):null;return{selectedEnvironment:r,setSelectedEnvironment:i,showEnvironment:n,setShowEnvironment:s,exposure:o,setExposure:a,environmentImageUrl:t}},[l,r,n,o]);return(0,Q.jsx)(cz.Provider,{value:h,children:e})}function ue(t){let{children:e}=t,[r,i]=(0,J.useState)({}),n=(0,J.useMemo)(()=>({setSkinImages(t,e){i(r=>({...r,[t]:e}))},setColorImageUrl(t,e,r){i(i=>{var n,s;let o=Array.from(null!=(s=null==(n=i[t])?void 0:n.colorImageUrl)?s:[]);return o[r]=e,{...i,[t]:{...i[t],colorImageUrl:o}}})},setMetallicImageUrl(t,e,r){i(i=>{var n,s;let o=Array.from(null!=(s=null==(n=i[t])?void 0:n.metallicImageUrl)?s:[]);return o[r]=e,{...i,[t]:{...i[t],metallicImageUrl:o}}})}}),[]),s=(0,J.useMemo)(()=>({materialSkins:r,getSkinImages:t=>r[t],getColorImageUrl(t,e){var i;return null==(i=r[t].colorImageUrl)?void 0:i[e]},getMetallicImageUrl(t,e){var i;return null==(i=r[t].metallicImageUrl)?void 0:i[e]},...n}),[r,n]);return(0,Q.jsx)(cq.Provider,{value:s,children:e})}let{materials:ur}=cd.default;function ui(){let{actualModel:t}=hV(),{selectedMaterialIndex:e,setSelectedMaterialIndex:r}=o0(),i=ur[t];return(0,Q.jsx)("select",{value:e,onChange:t=>{r(parseInt(t.target.value,10))},children:i.map((t,e)=>{var r;return t&&!t.hidden&&!1!==t.selectable?(0,Q.jsx)("option",{value:e,children:null!=(r=t.label)?r:t.name},t.name):null})})}function un(t){let{canvasId:e,onChange:r,baseImageUrl:i,textureSize:n,defaultDrawingMode:s=!1}=t,o=(0,J.useRef)(null),[a,l]=(0,J.useState)(null),{activeCanvas:h}=o0(),{canvasPadding:c}=cx(),{registerCanvas:u,unregisterCanvas:d}=oZ(),[f,g]=(0,J.useState)(s),p=(0,J.useRef)(null),m=(0,J.useRef)(!0),[y,x]=(0,J.useState)(()=>[]),[b,_]=(0,J.useState)(()=>[]),w=y.length>1,C=b.length>0,S=(0,J.useCallback)(t=>{let e=p.current;e&&e(t)},[]),T=(0,J.useCallback)(async()=>{if(a&&y.length>1){let[t,e]=y.slice(-2);m.current=!1,a.renderOnAddRemove=!1,a.clear(),a.loadFromJSON(t,()=>{a.renderAll(),m.current=!0,a.renderOnAddRemove=!0}),x(t=>t.slice(0,-1)),_(t=>[e,...t])}},[a,y]),O=(0,J.useCallback)(()=>{if(a&&b.length>0){let t=b[0];m.current=!1,a.renderOnAddRemove=!1,a.clear(),a.loadFromJSON(t,()=>{a.renderAll(),m.current=!0,a.renderOnAddRemove=!0}),x(e=>[...e,t]),_(t=>t.slice(1))}},[a,b]);(0,J.useEffect)(()=>{p.current=r},[r]);let k=h===e;return(0,J.useEffect)(()=>{let t;if(!o.current)return;iB.ownDefaults={...iB.ownDefaults,transparentCorners:!1,borderColor:"#8afff1",cornerSize:9,cornerStyle:"circle",cornerColor:"#8afff1",cornerStrokeColor:"#1c9f7c",strokeWidth:10,perPixelTargetFind:!0};let e=new st(o.current,{preserveObjectStacking:!0,targetFindTolerance:2}),r=!1,i=()=>{S(e)};return e.on("object:modified",i),e.on("object:added",i),e.on("object:removed",i),e.on("after:render",()=>{!r&&m.current&&(clearTimeout(t),t=setTimeout(()=>{let t=(()=>{r=!0;let t=e.toDatalessJSON(["lockMovementX","lockMovementY","lockRotation","lockScalingX","lockScalingY","selectable","hoverCursor","moveCursor"]);return r=!1,t})();x(e=>{if(0===e.length)return[t];let r=e[e.length-1];return JSON.stringify(t)===JSON.stringify(r)?e:[...e.slice(-10),t]}),_([])},250))}),l(e),()=>{clearTimeout(t),l(null),e.dispose()}},[S]),(0,J.useEffect)(()=>{a&&(a.isDrawingMode=f,f&&(a.discardActiveObject(),a.requestRenderAll()))},[a,f]),(0,J.useEffect)(()=>{a&&k&&a.calcOffset()},[a,k]),(0,J.useEffect)(()=>{if(a)return u(e,{canvas:a,notifyChange:()=>{a.renderAll(),S(a)},undo:T,redo:O,canUndo:w,canRedo:C,isDrawingMode:f,setDrawingMode:g}),()=>{d(e)}},[a,u,d,e,S,f,g,T,O,w,C]),(0,J.useEffect)(()=>{x([]),_([])},[a,i,n]),(0,J.useEffect)(()=>{if(a&&n&&(m.current=!1,a.clear(),i)){let t=!1;return(async()=>{let e=await cm(i);if(!t){if(!e.width||!e.height)throw Error("Zero-height image");e.selectable=!1,e.lockMovementX=!0,e.lockMovementY=!0,e.lockScalingX=!0,e.lockScalingY=!0,e.lockRotation=!0,e.hoverCursor="default",e.moveCursor="default";let[t,r]=n,i=e.width===t?1:t/e.width,s=e.height===r?1:r/e.height;(1!==i||1!==s)&&(e.scaleX=i,e.scaleY=s),a.centerObject(e),a.add(e)}m.current=!0,a.requestRenderAll()})(),()=>{t=!0}}},[a,i,n]),(0,Q.jsx)("div",{className:"CanvasContainer","data-active":k?"true":"false",children:(0,Q.jsx)("canvas",{width:n[0]+2*c,height:n[1]+2*c,ref:o})})}let us=J.default.createContext(null);function uo(){let t=(0,J.useContext)(us);if(!t)throw Error("ImageLoaderContext.Provider not found!");return t}us.displayName="ImageLoaderContext";let ua=[512,512];function ul(t){var e,r,i,n;let{materialDef:s,frameIndex:o=0}=t,{skinImageUrls:a,defaultSkinImageUrls:l}=hV(),h=null==(e=a[null!=(i=s.file)?i:s.name])?void 0:e[o],c=null==(r=l[null!=(n=s.file)?n:s.name])?void 0:r[o],{setColorImageUrl:u}=cK(),{canvasPadding:d}=cx(),[f,g]=(0,J.useState)(null),{removeAlphaFromArrayBuffer:p}=cy(),{loadImage:m}=uo(),{sizeMultiplier:y}=o0(),x=(0,J.useMemo)(()=>{var t;let[e,r]=null!=(t=s.size)?t:ua;return[e*y,r*y]},[s.size,y]),b=(0,J.useCallback)(async t=>{var e;let r=t.toDataURL({format:"png",multiplier:1,top:d,left:d,width:x[0],height:x[1]});u(null!=(e=s.file)?e:s.name,r,o)},[x,d,u,s,o]);(0,J.useEffect)(()=>{if(h){let t=!1;return(async()=>{let e;try{e=await m(h)}catch(t){if(!1===s.hasDefault)return;e=await m(c)}let r=await p(e);t||g(r)})(),()=>{t=!0}}g(null)},[s,h,c,p,m]);let _="".concat(s.name,":color:").concat(o,":").concat(y);return x?(0,Q.jsx)(un,{canvasId:_,canvasType:"color",onChange:b,baseImageUrl:f,textureSize:x},_):null}let uh=[512,512];function uc(t){var e,r,i,n;let{materialDef:s,frameIndex:o=0}=t,{skinImageUrls:a,defaultSkinImageUrls:l}=hV(),h=null==(e=a[null!=(i=s.file)?i:s.name])?void 0:e[o],c=null==(r=l[null!=(n=s.file)?n:s.name])?void 0:r[o],{setMetallicImageUrl:u}=cK(),{canvasPadding:d}=cx(),[f,g]=(0,J.useState)(null),p=(0,J.useRef)(0),{convertGrayscaleImageUrlToMetallicRoughness:m,convertArrayBufferAlphaToGrayscale:y}=cy(),{loadImage:x}=uo(),{sizeMultiplier:b}=o0(),_=(0,J.useMemo)(()=>{var t;let[e,r]=null!=(t=s.size)?t:uh;return[e*b,r*b]},[s.size,b]),w=(0,J.useCallback)(async t=>{let e;p.current+=1;let r=t.toDataURL({format:"png",multiplier:1,top:d,left:d,width:_[0],height:_[1]});try{e=await m(r)}finally{p.current-=1}if(0===p.current){var i;u(null!=(i=s.file)?i:s.name,e,o)}},[_,d,u,m,s,o]);(0,J.useEffect)(()=>{if(h){let t=!1;return(async()=>{let e;try{e=await x(h)}catch(t){if(!1===s.hasDefault)return;e=await x(c)}let r=await y(e);t||g(r)})(),()=>{t=!0}}g(null)},[s,h,c,_,y,x]);let C="".concat(s.name,":metallic:").concat(o,":").concat(b);return _?(0,Q.jsx)(un,{canvasId:C,canvasType:"metallic",onChange:w,baseImageUrl:f,textureSize:_,defaultDrawingMode:!0},C):null}let{materials:uu}=cd.default;function ud(){let{actualModel:t}=hV(),e=uu[t];return(0,Q.jsx)(Q.Fragment,{children:e.map(e=>{var r;if(!e)return null;let i=0!==e.metallicFactor||1!==e.roughnessFactor,n=Array(null!=(r=e.frameCount)?r:1).fill(null);return(0,Q.jsxs)(J.default.Fragment,{children:[n.map((t,r)=>(0,Q.jsx)(ul,{materialDef:e,frameIndex:r},"color:".concat(r))),i?n.map((t,r)=>(0,Q.jsx)(uc,{materialDef:e,frameIndex:r},"metallic:".concat(r))):null]},"".concat(t,"-").concat(e.name))})})}var uf=J.createContext(void 0),ug=t=>{let{client:e,children:r}=t;return J.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Q.jsx)(uf.Provider,{value:e,children:r})};function up(t){let{children:e}=t,r=(t=>{let e=J.useContext(uf);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e})(),i=(0,J.useMemo)(()=>({loadImage:async t=>t.startsWith("data:")?(0,cb.imageUrlToArrayBuffer)(t):await r.fetchQuery({queryKey:[t]})}),[r]);return(0,Q.jsx)(us.Provider,{value:i,children:e})}function um(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function uv(t,e){var r=um(t,e,"get");return r.get?r.get.call(t):r.value}function uy(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function ux(t,e,r){uy(t,e),e.set(t,r)}function ub(t,e,r){var i=um(t,e,"set");if(i.set)i.set.call(t,r);else{if(!i.writable)throw TypeError("attempted to set read only private field");i.value=r}return r}function u_(t,e){var r=um(t,e,"update");if(r.set){if(!r.get)throw TypeError("attempted to read set only private field");return"__destrWrapper"in r||(r.__destrWrapper={set value(v){r.set.call(t,v)},get value(){return r.get.call(t)}}),r.__destrWrapper}if(!r.writable)throw TypeError("attempted to set read only private field");return r}var uw={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},uC=new(p=new WeakMap,m=new WeakMap,class{setTimeoutProvider(t){ub(this,p,t)}setTimeout(t,e){return uv(this,p).setTimeout(t,e)}clearTimeout(t){uv(this,p).clearTimeout(t)}setInterval(t,e){return uv(this,p).setInterval(t,e)}clearInterval(t){uv(this,p).clearInterval(t)}constructor(){ux(this,p,{writable:!0,value:uw}),ux(this,m,{writable:!0,value:!1})}}),uS="undefined"==typeof window||"Deno"in globalThis;function uT(){}function uO(t,e){return"function"==typeof t?t(e):t}function uk(t,e){let{type:r="all",exact:i,fetchStatus:n,predicate:s,queryKey:o,stale:a}=t;if(o){if(i){if(e.queryHash!==uE(o,e.options))return!1}else if(!uj(e.queryKey,o))return!1}if("all"!==r){let t=e.isActive();if("active"===r&&!t||"inactive"===r&&t)return!1}return("boolean"!=typeof a||e.isStale()===a)&&(!n||n===e.state.fetchStatus)&&(!s||!!s(e))}function uM(t,e){let{exact:r,status:i,predicate:n,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(uD(e.options.mutationKey)!==uD(s))return!1}else if(!uj(e.options.mutationKey,s))return!1}return(!i||e.state.status===i)&&(!n||!!n(e))}function uE(t,e){return((null==e?void 0:e.queryKeyHashFn)||uD)(t)}function uD(t){return JSON.stringify(t,(t,e)=>uF(e)?Object.keys(e).sort().reduce((t,r)=>(t[r]=e[r],t),{}):e)}function uj(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).every(r=>uj(t[r],e[r]))}var uA=Object.prototype.hasOwnProperty;function uP(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function uF(t){if(!uL(t))return!1;let e=t.constructor;if(void 0===e)return!0;let r=e.prototype;return!!uL(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype}function uL(t){return"[object Object]"===Object.prototype.toString.call(t)}function uR(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[...t,e];return r&&i.length>r?i.slice(1):i}function uI(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[e,...t];return r&&i.length>r?i.slice(0,-1):i}var uB=Symbol();function uN(t,e){return!t.queryFn&&(null==e?void 0:e.initialPromise)?()=>e.initialPromise:t.queryFn&&t.queryFn!==uB?t.queryFn:()=>Promise.reject(Error("Missing queryFn: '".concat(t.queryHash,"'")))}function uW(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}function uU(t,e){uy(t,e),e.add(t)}var uH=function(t){setTimeout(t,0)},uX=function(){let t=[],e=0,r=t=>{t()},i=t=>{t()},n=uH,s=i=>{e?t.push(i):n(()=>{r(i)})};return{batch:s=>{let o;e++;try{o=s()}finally{--e||(()=>{let e=t;t=[],e.length&&n(()=>{i(()=>{e.forEach(t=>{r(t)})})})})()}return o},batchCalls:t=>function(){for(var e=arguments.length,r=Array(e),i=0;i{t(...r)})},schedule:s,setNotifyFunction:t=>{r=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{n=t}}}(),uV=class{subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}},uY=new(y=new WeakMap,x=new WeakMap,b=new WeakMap,class extends uV{onSubscribe(){uv(this,x)||this.setEventListener(uv(this,b))}onUnsubscribe(){var t;this.hasListeners()||(null==(t=uv(this,x))||t.call(this),ub(this,x,void 0))}setEventListener(t){var e;ub(this,b,t),null==(e=uv(this,x))||e.call(this),ub(this,x,t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()}))}setFocused(t){uv(this,y)!==t&&(ub(this,y,t),this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){var t;return"boolean"==typeof uv(this,y)?uv(this,y):(null==(t=globalThis.document)?void 0:t.visibilityState)!=="hidden"}constructor(){super(),ux(this,y,{writable:!0,value:void 0}),ux(this,x,{writable:!0,value:void 0}),ux(this,b,{writable:!0,value:void 0}),ub(this,b,t=>{if(!uS&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}})}}),uz=new(_=new WeakMap,w=new WeakMap,C=new WeakMap,class extends uV{onSubscribe(){uv(this,w)||this.setEventListener(uv(this,C))}onUnsubscribe(){var t;this.hasListeners()||(null==(t=uv(this,w))||t.call(this),ub(this,w,void 0))}setEventListener(t){var e;ub(this,C,t),null==(e=uv(this,w))||e.call(this),ub(this,w,t(this.setOnline.bind(this)))}setOnline(t){uv(this,_)!==t&&(ub(this,_,t),this.listeners.forEach(e=>{e(t)}))}isOnline(){return uv(this,_)}constructor(){super(),ux(this,_,{writable:!0,value:!0}),ux(this,w,{writable:!0,value:void 0}),ux(this,C,{writable:!0,value:void 0}),ub(this,C,t=>{if(!uS&&window.addEventListener){let e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}})}});function uG(t){return Math.min(1e3*2**t,3e4)}function uq(t){return(null!=t?t:"online")!=="online"||uz.isOnline()}var uK=class extends Error{constructor(t){super("CancelledError"),this.revert=null==t?void 0:t.revert,this.silent=null==t?void 0:t.silent}};function uQ(t){let e,r=!1,i=0,n=function(){let t,e,r=new Promise((r,i)=>{t=r,e=i});function i(t){Object.assign(r,t),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},r.reject=t=>{i({status:"rejected",reason:t}),e(t)},r}(),s=()=>uY.isFocused()&&("always"===t.networkMode||uz.isOnline())&&t.canRun(),o=()=>uq(t.networkMode)&&t.canRun(),a=t=>{"pending"===n.status&&(null==e||e(),n.resolve(t))},l=t=>{"pending"===n.status&&(null==e||e(),n.reject(t))},h=()=>new Promise(r=>{var i;e=t=>{("pending"!==n.status||s())&&r(t)},null==(i=t.onPause)||i.call(t)}).then(()=>{if(e=void 0,"pending"===n.status){var r;null==(r=t.onContinue)||r.call(t)}}),c=()=>{let e;if("pending"!==n.status)return;let o=0===i?t.initialPromise:void 0;try{e=null!=o?o:t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(a).catch(e=>{var o,a,u;if("pending"!==n.status)return;let d=null!=(a=t.retry)?a:3*!uS,f=null!=(u=t.retryDelay)?u:uG,g="function"==typeof f?f(i,e):f,p=!0===d||"number"==typeof d&&i{uC.setTimeout(t,g)}).then(()=>s()?void 0:h()).then(()=>{r?l(e):c()})})};return{promise:n,status:()=>n.status,cancel:e=>{if("pending"===n.status){var r;let i=new uK(e);l(i),null==(r=t.onCancel)||r.call(t,i)}},continue:()=>(null==e||e(),n),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:o,start:()=>(o()?c():h().then(c),n)}}var uJ=(S=new WeakMap,class{destroy(){this.clearGcTimeout()}scheduleGc(){var t;this.clearGcTimeout(),"number"==typeof(t=this.gcTime)&&t>=0&&t!==1/0&&ub(this,S,uC.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,null!=t?t:uS?1/0:3e5)}clearGcTimeout(){uv(this,S)&&(uC.clearTimeout(uv(this,S)),ub(this,S,void 0))}constructor(){ux(this,S,{writable:!0,value:void 0})}}),uZ=(T=new WeakMap,O=new WeakMap,k=new WeakMap,M=new WeakMap,E=new WeakMap,D=new WeakMap,j=new WeakMap,A=new WeakSet,class extends uJ{get meta(){return this.options.meta}get promise(){var t;return null==(t=uv(this,E))?void 0:t.promise}setOptions(t){if(this.options={...uv(this,D),...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let t=u$(this.options);void 0!==t.data&&(this.setData(t.data,{updatedAt:t.dataUpdatedAt,manual:!0}),ub(this,T,t))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||uv(this,k).remove(this)}setData(t,e){var r,i;let n=(r=this.state.data,"function"==typeof(i=this.options).structuralSharing?i.structuralSharing(r,t):!1!==i.structuralSharing?function t(e,r){if(e===r)return e;let i=uP(e)&&uP(r);if(!i&&!(uF(e)&&uF(r)))return r;let n=(i?e:Object.keys(e)).length,s=i?r:Object.keys(r),o=s.length,a=i?Array(o):{},l=0;for(let h=0;h{var e;return!1!==(e=t.options.enabled,"function"==typeof e?e(this):e)})}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uB||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===uO(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!Math.max(this.state.dataUpdatedAt+(t||0)-Date.now(),0))}onFocus(){var t;let e=this.observers.find(t=>t.shouldFetchOnWindowFocus());null==e||e.refetch({cancelRefetch:!1}),null==(t=uv(this,E))||t.continue()}onOnline(){var t;let e=this.observers.find(t=>t.shouldFetchOnReconnect());null==e||e.refetch({cancelRefetch:!1}),null==(t=uv(this,E))||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),uv(this,k).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(uv(this,E)&&(uv(this,j)?uv(this,E).cancel({revert:!0}):uv(this,E).cancelRetry()),this.scheduleGc()),uv(this,k).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||uW(this,A,u0).call(this,{type:"invalidate"})}async fetch(t,e){var r,i,n,s,o,a,l,h,c,u,d,f;if("idle"!==this.state.fetchStatus&&(null==(r=uv(this,E))?void 0:r.status())!=="rejected"){if(void 0!==this.state.data&&(null==e?void 0:e.cancelRefetch))this.cancel({silent:!0});else if(uv(this,E))return uv(this,E).continueRetry(),uv(this,E).promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let g=new AbortController,p=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(ub(this,j,!0),g.signal)})},m=()=>{let t=uN(this.options,e),r=(()=>{let t={client:uv(this,M),queryKey:this.queryKey,meta:this.meta};return p(t),t})();return(ub(this,j,!1),this.options.persister)?this.options.persister(t,r,this):t(r)},y=(()=>{let t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:uv(this,M),state:this.state,fetchFn:m};return p(t),t})();null==(i=this.options.behavior)||i.onFetch(y,this),ub(this,O,this.state),("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=y.fetchOptions)?void 0:n.meta))&&uW(this,A,u0).call(this,{type:"fetch",meta:null==(s=y.fetchOptions)?void 0:s.meta}),ub(this,E,uQ({initialPromise:null==e?void 0:e.initialPromise,fn:y.fetchFn,onCancel:t=>{t instanceof uK&&t.revert&&this.setState({...uv(this,O),fetchStatus:"idle"}),g.abort()},onFail:(t,e)=>{uW(this,A,u0).call(this,{type:"failed",failureCount:t,error:e})},onPause:()=>{uW(this,A,u0).call(this,{type:"pause"})},onContinue:()=>{uW(this,A,u0).call(this,{type:"continue"})},retry:y.options.retry,retryDelay:y.options.retryDelay,networkMode:y.options.networkMode,canRun:()=>!0}));try{let t=await uv(this,E).start();if(void 0===t)throw Error("".concat(this.queryHash," data is undefined"));return this.setData(t),null==(o=(a=uv(this,k).config).onSuccess)||o.call(a,t,this),null==(l=(h=uv(this,k).config).onSettled)||l.call(h,t,this.state.error,this),t}catch(t){if(t instanceof uK){if(t.silent)return uv(this,E).promise;else if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw uW(this,A,u0).call(this,{type:"error",error:t}),null==(c=(u=uv(this,k).config).onError)||c.call(u,t,this),null==(d=(f=uv(this,k).config).onSettled)||d.call(f,this.state.data,t,this),t}finally{this.scheduleGc()}}constructor(t){var e;super(),uU(this,A),ux(this,T,{writable:!0,value:void 0}),ux(this,O,{writable:!0,value:void 0}),ux(this,k,{writable:!0,value:void 0}),ux(this,M,{writable:!0,value:void 0}),ux(this,E,{writable:!0,value:void 0}),ux(this,D,{writable:!0,value:void 0}),ux(this,j,{writable:!0,value:void 0}),ub(this,j,!1),ub(this,D,t.defaultOptions),this.setOptions(t.options),this.observers=[],ub(this,M,t.client),ub(this,k,uv(this,M).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ub(this,T,u$(this.options)),this.state=null!=(e=t.state)?e:uv(this,T),this.scheduleGc()}});function u$(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,r=void 0!==e,i=r?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?null!=i?i:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}function u0(t){let e=e=>{var r,i,n;switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...(n=e.data,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:uq(this.options.networkMode)?"fetching":"paused",...void 0===n&&{error:null,status:"pending"}}),fetchMeta:null!=(r=t.meta)?r:null};case"success":let s={...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:null!=(i=t.dataUpdatedAt)?i:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ub(this,O,t.manual?s:void 0),s;case"error":let o=t.error;return{...e,error:o,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}};this.state=e(this.state),uX.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),uv(this,k).notify({query:this,type:"updated",action:t})})}var u1=(P=new WeakMap,class extends uV{build(t,e,r){var i;let n=e.queryKey,s=null!=(i=e.queryHash)?i:uE(n,e),o=this.get(s);return o||(o=new uZ({client:t,queryKey:n,queryHash:s,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(n)}),this.add(o)),o}add(t){uv(this,P).has(t.queryHash)||(uv(this,P).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=uv(this,P).get(t.queryHash);e&&(t.destroy(),e===t&&uv(this,P).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){uX.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return uv(this,P).get(t)}getAll(){return[...uv(this,P).values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>uk(e,t))}findAll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAll();return Object.keys(t).length>0?e.filter(e=>uk(t,e)):e}notify(t){uX.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){uX.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){uX.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}constructor(t={}){super(),ux(this,P,{writable:!0,value:void 0}),this.config=t,ub(this,P,new Map)}}),u2=(F=new WeakMap,L=new WeakMap,R=new WeakMap,I=new WeakMap,B=new WeakSet,class extends uJ{setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){uv(this,L).includes(t)||(uv(this,L).push(t),this.clearGcTimeout(),uv(this,R).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ub(this,L,uv(this,L).filter(e=>e!==t)),this.scheduleGc(),uv(this,R).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){uv(this,L).length||("pending"===this.state.status?this.scheduleGc():uv(this,R).remove(this))}continue(){var t,e;return null!=(e=null==(t=uv(this,I))?void 0:t.continue())?e:this.execute(this.state.variables)}async execute(t){var e,r,i,n,s,o,a,l,h,c,u,d,f,g,p,m,y,x,b,_,w;let C=()=>{uW(this,B,u5).call(this,{type:"continue"})},S={client:uv(this,F),meta:this.options.meta,mutationKey:this.options.mutationKey};ub(this,I,uQ({fn:()=>this.options.mutationFn?this.options.mutationFn(t,S):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{uW(this,B,u5).call(this,{type:"failed",failureCount:t,error:e})},onPause:()=>{uW(this,B,u5).call(this,{type:"pause"})},onContinue:C,retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>uv(this,R).canRun(this)}));let T="pending"===this.state.status,O=!uv(this,I).canStart();try{if(T)C();else{uW(this,B,u5).call(this,{type:"pending",variables:t,isPaused:O}),await (null==(c=(u=uv(this,R).config).onMutate)?void 0:c.call(u,t,this,S));let e=await (null==(d=(f=this.options).onMutate)?void 0:d.call(f,t,S));e!==this.state.context&&uW(this,B,u5).call(this,{type:"pending",context:e,variables:t,isPaused:O})}let e=await uv(this,I).start();return await (null==(r=(i=uv(this,R).config).onSuccess)?void 0:r.call(i,e,t,this.state.context,this,S)),await (null==(n=(s=this.options).onSuccess)?void 0:n.call(s,e,t,this.state.context,S)),await (null==(o=(a=uv(this,R).config).onSettled)?void 0:o.call(a,e,null,this.state.variables,this.state.context,this,S)),await (null==(l=(h=this.options).onSettled)?void 0:l.call(h,e,null,t,this.state.context,S)),uW(this,B,u5).call(this,{type:"success",data:e}),e}catch(e){try{throw await (null==(g=(p=uv(this,R).config).onError)?void 0:g.call(p,e,t,this.state.context,this,S)),await (null==(m=(y=this.options).onError)?void 0:m.call(y,e,t,this.state.context,S)),await (null==(x=(b=uv(this,R).config).onSettled)?void 0:x.call(b,void 0,e,this.state.variables,this.state.context,this,S)),await (null==(_=(w=this.options).onSettled)?void 0:_.call(w,void 0,e,t,this.state.context,S)),e}finally{uW(this,B,u5).call(this,{type:"error",error:e})}}finally{uv(this,R).runNext(this)}}constructor(t){super(),uU(this,B),ux(this,F,{writable:!0,value:void 0}),ux(this,L,{writable:!0,value:void 0}),ux(this,R,{writable:!0,value:void 0}),ux(this,I,{writable:!0,value:void 0}),ub(this,F,t.client),this.mutationId=t.mutationId,ub(this,R,t.mutationCache),ub(this,L,[]),this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}});function u5(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),uX.batch(()=>{uv(this,L).forEach(e=>{e.onMutationUpdate(t)}),uv(this,R).notify({mutation:this,type:"updated",action:t})})}var u4=(N=new WeakMap,W=new WeakMap,U=new WeakMap,class extends uV{build(t,e,r){let i=new u2({client:t,mutationCache:this,mutationId:++u_(this,U).value,options:t.defaultMutationOptions(e),state:r});return this.add(i),i}add(t){uv(this,N).add(t);let e=u3(t);if("string"==typeof e){let r=uv(this,W).get(e);r?r.push(t):uv(this,W).set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(uv(this,N).delete(t)){let e=u3(t);if("string"==typeof e){let r=uv(this,W).get(e);if(r)if(r.length>1){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}else r[0]===t&&uv(this,W).delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){let e=u3(t);if("string"!=typeof e)return!0;{let r=uv(this,W).get(e),i=null==r?void 0:r.find(t=>"pending"===t.state.status);return!i||i===t}}runNext(t){let e=u3(t);if("string"!=typeof e)return Promise.resolve();{var r,i;let n=null==(r=uv(this,W).get(e))?void 0:r.find(e=>e!==t&&e.state.isPaused);return null!=(i=null==n?void 0:n.continue())?i:Promise.resolve()}}clear(){uX.batch(()=>{uv(this,N).forEach(t=>{this.notify({type:"removed",mutation:t})}),uv(this,N).clear(),uv(this,W).clear()})}getAll(){return Array.from(uv(this,N))}find(t){let e={exact:!0,...t};return this.getAll().find(t=>uM(e,t))}findAll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().filter(e=>uM(t,e))}notify(t){uX.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return uX.batch(()=>Promise.all(t.map(t=>t.continue().catch(uT))))}constructor(t={}){super(),ux(this,N,{writable:!0,value:void 0}),ux(this,W,{writable:!0,value:void 0}),ux(this,U,{writable:!0,value:void 0}),this.config=t,ub(this,N,new Set),ub(this,W,new Map),ub(this,U,0)}});function u3(t){var e;return null==(e=t.options.scope)?void 0:e.id}function u9(t){return{onFetch:(e,r)=>{var i,n,s,o,a;let l=e.options,h=null==(s=e.fetchOptions)||null==(n=s.meta)||null==(i=n.fetchMore)?void 0:i.direction,c=(null==(o=e.state.data)?void 0:o.pages)||[],u=(null==(a=e.state.data)?void 0:a.pageParams)||[],d={pages:[],pageParams:[]},f=0,g=async()=>{let r=!1,i=uN(e.options,e.fetchOptions),n=async(t,n,s)=>{if(r)return Promise.reject();if(null==n&&t.pages.length)return Promise.resolve(t);let o=(()=>{let t={client:e.client,queryKey:e.queryKey,pageParam:n,direction:s?"backward":"forward",meta:e.options.meta};return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?r=!0:e.signal.addEventListener("abort",()=>{r=!0}),e.signal)}),t})(),a=await i(o),{maxPages:l}=e.options,h=s?uI:uR;return{pages:h(t.pages,a,l),pageParams:h(t.pageParams,n,l)}};if(h&&c.length){let t="backward"===h,e={pages:c,pageParams:u},r=(t?function(t,e){var r;let{pages:i,pageParams:n}=e;return i.length>0?null==(r=t.getPreviousPageParam)?void 0:r.call(t,i[0],i,n[0],n):void 0}:u6)(l,e);d=await n(e,r,t)}else{let e=null!=t?t:c.length;do{var s;let t=0===f?null!=(s=u[0])?s:l.initialPageParam:u6(l,d);if(f>0&&null==t)break;d=await n(d,t),f++}while(f{var t,i;return null==(t=(i=e.options).persister)?void 0:t.call(i,g,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=g}}}function u6(t,e){let{pages:r,pageParams:i}=e,n=r.length-1;return r.length>0?t.getNextPageParam(r[n],r,i[n],i):void 0}let u8=new(H=new WeakMap,X=new WeakMap,V=new WeakMap,Y=new WeakMap,z=new WeakMap,G=new WeakMap,q=new WeakMap,K=new WeakMap,class{mount(){u_(this,G).value++,1===uv(this,G)&&(ub(this,q,uY.subscribe(async t=>{t&&(await this.resumePausedMutations(),uv(this,H).onFocus())})),ub(this,K,uz.subscribe(async t=>{t&&(await this.resumePausedMutations(),uv(this,H).onOnline())})))}unmount(){var t,e;u_(this,G).value--,0===uv(this,G)&&(null==(t=uv(this,q))||t.call(this),ub(this,q,void 0),null==(e=uv(this,K))||e.call(this),ub(this,K,void 0))}isFetching(t){return uv(this,H).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return uv(this,X).findAll({...t,status:"pending"}).length}getQueryData(t){var e;let r=this.defaultQueryOptions({queryKey:t});return null==(e=uv(this,H).get(r.queryHash))?void 0:e.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),r=uv(this,H).build(this,e),i=r.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(uO(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return uv(this,H).findAll(t).map(t=>{let{queryKey:e,state:r}=t;return[e,r.data]})}setQueryData(t,e,r){let i=this.defaultQueryOptions({queryKey:t}),n=uv(this,H).get(i.queryHash),s=null==n?void 0:n.state.data,o="function"==typeof e?e(s):e;if(void 0!==o)return uv(this,H).build(this,i).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return uX.batch(()=>uv(this,H).findAll(t).map(t=>{let{queryKey:i}=t;return[i,this.setQueryData(i,e,r)]}))}getQueryState(t){var e;let r=this.defaultQueryOptions({queryKey:t});return null==(e=uv(this,H).get(r.queryHash))?void 0:e.state}removeQueries(t){let e=uv(this,H);uX.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let r=uv(this,H);return uX.batch(()=>(r.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={revert:!0,...e};return Promise.all(uX.batch(()=>uv(this,H).findAll(t).map(t=>t.cancel(r)))).then(uT).catch(uT)}invalidateQueries(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return uX.batch(()=>{var r,i;return(uv(this,H).findAll(t).forEach(t=>{t.invalidate()}),(null==t?void 0:t.refetchType)==="none")?Promise.resolve():this.refetchQueries({...t,type:null!=(i=null!=(r=null==t?void 0:t.refetchType)?r:null==t?void 0:t.type)?i:"active"},e)})}refetchQueries(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={...r,cancelRefetch:null==(e=r.cancelRefetch)||e};return Promise.all(uX.batch(()=>uv(this,H).findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,i);return i.throwOnError||(e=e.catch(uT)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(uT)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let r=uv(this,H).build(this,e);return r.isStaleByTime(uO(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(uT).catch(uT)}fetchInfiniteQuery(t){return t.behavior=u9(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(uT).catch(uT)}ensureInfiniteQueryData(t){return t.behavior=u9(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return uz.isOnline()?uv(this,X).resumePausedMutations():Promise.resolve()}getQueryCache(){return uv(this,H)}getMutationCache(){return uv(this,X)}getDefaultOptions(){return uv(this,V)}setDefaultOptions(t){ub(this,V,t)}setQueryDefaults(t,e){uv(this,Y).set(uD(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...uv(this,Y).values()],r={};return e.forEach(e=>{uj(t,e.queryKey)&&Object.assign(r,e.defaultOptions)}),r}setMutationDefaults(t,e){uv(this,z).set(uD(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...uv(this,z).values()],r={};return e.forEach(e=>{uj(t,e.mutationKey)&&Object.assign(r,e.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;let e={...uv(this,V).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=uE(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===uB&&(e.enabled=!1),e}defaultMutationOptions(t){return(null==t?void 0:t._defaulted)?t:{...uv(this,V).mutations,...(null==t?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){uv(this,H).clear(),uv(this,X).clear()}constructor(t={}){ux(this,H,{writable:!0,value:void 0}),ux(this,X,{writable:!0,value:void 0}),ux(this,V,{writable:!0,value:void 0}),ux(this,Y,{writable:!0,value:void 0}),ux(this,z,{writable:!0,value:void 0}),ux(this,G,{writable:!0,value:void 0}),ux(this,q,{writable:!0,value:void 0}),ux(this,K,{writable:!0,value:void 0}),ub(this,H,t.queryCache||new u1),ub(this,X,t.mutationCache||new u4),ub(this,V,t.defaultOptions||{}),ub(this,Y,new Map),ub(this,z,new Map),ub(this,G,0)}})({defaultOptions:{queries:{queryFn:async function(t){let{queryKey:e}=t,[r]=e;return(0,cb.imageUrlToArrayBuffer)(r)},staleTime:1/0,gcTime:6e4,refetchOnWindowFocus:!1,refetchOnReconnect:!1}}});function u7(){return(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(ug,{client:u8,children:(0,Q.jsx)("main",{children:(0,Q.jsx)(up,{children:(0,Q.jsx)(J.Suspense,{children:(0,Q.jsx)(cV,{children:(0,Q.jsx)(ut,{children:(0,Q.jsxs)(ue,{children:[(0,Q.jsxs)("div",{className:"Viewport",children:[(0,Q.jsxs)("div",{className:"ModelTools",children:[(0,Q.jsx)("div",{className:"Field",children:(0,Q.jsx)(c4,{})}),(0,Q.jsx)("div",{className:"Field SliderField",children:(0,Q.jsx)(c3,{})}),(0,Q.jsx)("div",{className:"Field",children:(0,Q.jsx)(c7,{})})]}),(0,Q.jsx)(c5,{})]}),(0,Q.jsx)(cT,{children:(0,Q.jsx)(cC,{children:(0,Q.jsxs)(cO,{children:[(0,Q.jsx)(cL,{}),(0,Q.jsxs)("div",{className:"CanvasViewport",children:[(0,Q.jsxs)("div",{className:"CanvasSelector",children:[(0,Q.jsx)(ck,{}),(0,Q.jsx)(ui,{})]}),(0,Q.jsx)(cS,{}),(0,Q.jsx)(ud,{})]}),(0,Q.jsx)(cg,{}),(0,Q.jsx)(cp,{})]})})})]})})})})})})})})}}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43794,(t,e,r)=>{!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t=[],e=0;e{t.v(t.b(["static/chunks/9338a92aac995757.js","static/chunks/a55df98dcb3b60ad.js","static/chunks/turbopack-95cb340f669027bc.js"]))},67585,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let i=t.r(32061);function n(t){let{reason:e,children:r}=t;if("undefined"==typeof window)throw Object.defineProperty(new i.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r}},9885,(t,e,r)=>{"use strict";function i(t){return t.split("/").map(t=>encodeURIComponent(t)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return i}})},52157,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return a}});let i=t.r(43476),n=t.r(74080),s=t.r(63599),o=t.r(9885);function a(t){let{moduleIds:e}=t;if("undefined"!=typeof window)return null;let r=s.workAsyncStorage.getStore();if(void 0===r)return null;let a=[];if(r.reactLoadableManifest&&e){let t=r.reactLoadableManifest;for(let r of e){if(!t[r])continue;let e=t[r].files;a.push(...e)}}return 0===a.length?null:(0,i.jsx)(i.Fragment,{children:a.map(t=>{let e=r.assetPrefix+"/_next/"+(0,o.encodeURIPath)(t);return t.endsWith(".css")?(0,i.jsx)("link",{precedence:"dynamic",href:e,rel:"stylesheet",as:"style"},t):((0,n.preload)(e,{as:"script",fetchPriority:"low"}),null)})})}},69093,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return h}});let i=t.r(43476),n=t.r(71645),s=t.r(67585),o=t.r(52157);function a(t){return{default:t&&"default"in t?t.default:t}}let l={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},h=function(t){let e={...l,...t},r=(0,n.lazy)(()=>e.loader().then(a)),h=e.loading;function c(t){let a=h?(0,i.jsx)(h,{isLoading:!0,pastDelay:!0,error:null}):null,l=!e.ssr||!!e.loading,c=l?n.Suspense:n.Fragment,u=e.ssr?(0,i.jsxs)(i.Fragment,{children:["undefined"==typeof window?(0,i.jsx)(o.PreloadChunks,{moduleIds:e.modules}):null,(0,i.jsx)(r,{...t})]}):(0,i.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,i.jsx)(r,{...t})});return(0,i.jsx)(c,{...l?{fallback:a}:{},children:u})}return c.displayName="LoadableComponent",c}},70703,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n}});let i=t.r(55682)._(t.r(69093));function n(t,e){var r;let n={};"function"==typeof t&&(n.loader=t);let s={...n,...e};return(0,i.default)({...s,modules:null==(r=s.loadableGenerated)?void 0:r.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},52683,t=>{"use strict";let e,r,i,n;t.s(["default",()=>u7],52683);var s,o,a,l,h,c,u,d,f,g,p,m,y,x,b,_,w,C,S,T,O,k,M,E,D,j,A,P,F,L,R,I,B,N,W,U,H,X,V,Y,z,G,q,K,Q=t.i(43476),J=t.i(71645);function Z(t,e,r){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e,"string"))?i:i+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function tt(t){for(var e=1;e=0)continue;r[i]=t[i]}return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0||({}).propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tr(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}class ti{constructor(){Z(this,"browserShadowBlurConstant",1),Z(this,"DPI",96),Z(this,"devicePixelRatio","undefined"!=typeof window?window.devicePixelRatio:1),Z(this,"perfLimitSizeTotal",2097152),Z(this,"maxCacheSideLimit",4096),Z(this,"minCacheSideLimit",256),Z(this,"disableStyleCopyPaste",!1),Z(this,"enableGLFiltering",!0),Z(this,"textureSize",4096),Z(this,"forceGLPutImageData",!1),Z(this,"cachesBoundsOfCurve",!1),Z(this,"fontPaths",{}),Z(this,"NUM_FRACTION_DIGITS",4)}}let tn=new class extends ti{configure(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(this,t)}addFonts(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.fontPaths=tt(tt({},this.fontPaths),t)}removeFonts(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(t=>{delete this.fontPaths[t]})}clearFonts(){this.fontPaths={}}restoreDefaults(t){let e=new ti,r=(null==t?void 0:t.reduce((t,r)=>(t[r]=e[r],t),{}))||e;this.configure(r)}constructor(t){super(),this.configure(t)}},ts=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;ithis.testPrecision(e,t)),e.getExtension("WEBGL_lose_context").loseContext(),ts("log","WebGL: max texture size ".concat(this.maxTextureSize)))}isSupported(t){return!!this.maxTextureSize&&this.maxTextureSize>=t}}let tc={},tu=()=>e||(e={document:document,window:window,isTouchSupported:"ontouchstart"in window||"ontouchstart"in document||window&&window.navigator&&window.navigator.maxTouchPoints>0,WebGLProbe:new th,dispose(){},copyPasteData:tc}),td=()=>tu().document,tf=()=>tu().window,tg=()=>{var t;return Math.max(null!=(t=tn.devicePixelRatio)?t:tf().devicePixelRatio,1)},tp=new class{getFontCache(t){let{fontFamily:e,fontStyle:r,fontWeight:i}=t;e=e.toLowerCase(),this.charWidthsCache[e]||(this.charWidthsCache[e]={});let n=this.charWidthsCache[e],s="".concat(r.toLowerCase(),"_").concat((i+"").toLowerCase());return n[s]||(n[s]={}),n[s]}clearFontCache(t){(t=(t||"").toLowerCase())?this.charWidthsCache[t]&&delete this.charWidthsCache[t]:this.charWidthsCache={}}limitDimsByArea(t){let{perfLimitSizeTotal:e}=tn,r=Math.sqrt(e*t);return[Math.floor(r),Math.floor(e/r)]}constructor(){Z(this,"charWidthsCache",{}),Z(this,"boundsOfCurveCache",{})}},tm="6.7.1";function tv(){}let ty=Math.PI/2,tx=2*Math.PI,tb=Math.PI/180,t_=Object.freeze([1,0,0,1,0,0]),tw="center",tC="left",tS="bottom",tT="right",tO="none",tk=/\r?\n/,tM="moving",tE="scaling",tD="rotating",tj="rotate",tA="skewing",tP="resizing",tF="modifyPoly",tL="changed",tR="scale",tI="scaleX",tB="scaleY",tN="skewX",tW="skewY",tU="fill",tH="stroke",tX="modified",tV="json",tY=new class{has(t){return this[tV].has(t)}getClass(t){let e=this[tV].get(t);if(!e)throw new to("No class registered for ".concat(t));return e}setClass(t,e){e?this[tV].set(e,t):(this[tV].set(t.type,t),this[tV].set(t.type.toLowerCase(),t))}getSVGClass(t){return this.svg.get(t)}setSVGClass(t,e){this.svg.set(null!=e?e:t.type.toLowerCase(),t)}constructor(){this[tV]=new Map,this.svg=new Map}},tz=new class extends Array{remove(t){let e=this.indexOf(t);e>-1&&this.splice(e,1)}cancelAll(){let t=this.splice(0);return t.forEach(t=>t.abort()),t}cancelByCanvas(t){if(!t)return[];let e=this.filter(e=>{var r;return e.target===t||"object"==typeof e.target&&(null==(r=e.target)?void 0:r.canvas)===t});return e.forEach(t=>t.abort()),e}cancelByTarget(t){if(!t)return[];let e=this.filter(e=>e.target===t);return e.forEach(t=>t.abort()),e}};class tG{on(t,e){return(this.__eventListeners||(this.__eventListeners={}),"object"==typeof t)?(Object.entries(t).forEach(t=>{let[e,r]=t;this.on(e,r)}),()=>this.off(t)):e?(this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e),()=>this.off(t,e)):()=>!1}once(t,e){if("object"==typeof t){let e=[];return Object.entries(t).forEach(t=>{let[r,i]=t;e.push(this.once(r,i))}),()=>e.forEach(t=>t())}if(e){let r=this.on(t,function(){for(var t=arguments.length,i=Array(t),n=0;n!1}_removeEventListener(t,e){if(this.__eventListeners[t])if(e){let r=this.__eventListeners[t],i=r.indexOf(e);i>-1&&r.splice(i,1)}else this.__eventListeners[t]=[]}off(t,e){if(this.__eventListeners)if(void 0===t)for(let t in this.__eventListeners)this._removeEventListener(t);else"object"==typeof t?Object.entries(t).forEach(t=>{let[e,r]=t;this._removeEventListener(e,r)}):this._removeEventListener(t,e)}fire(t,e){var r;if(!this.__eventListeners)return;let i=null==(r=this.__eventListeners[t])?void 0:r.concat();if(i)for(let t=0;t{let r=t.indexOf(e);return -1!==r&&t.splice(r,1),t},tK=t=>{if(0===t)return 1;switch(Math.abs(t)/ty){case 1:case 3:return 0;case 2:return -1}return Math.cos(t)},tQ=t=>{if(0===t)return 0;let e=Math.sign(t);switch(t/ty){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(t)};class tJ{add(t){return new tJ(this.x+t.x,this.y+t.y)}addEquals(t){return this.x+=t.x,this.y+=t.y,this}scalarAdd(t){return new tJ(this.x+t,this.y+t)}scalarAddEquals(t){return this.x+=t,this.y+=t,this}subtract(t){return new tJ(this.x-t.x,this.y-t.y)}subtractEquals(t){return this.x-=t.x,this.y-=t.y,this}scalarSubtract(t){return new tJ(this.x-t,this.y-t)}scalarSubtractEquals(t){return this.x-=t,this.y-=t,this}multiply(t){return new tJ(this.x*t.x,this.y*t.y)}scalarMultiply(t){return new tJ(this.x*t,this.y*t)}scalarMultiplyEquals(t){return this.x*=t,this.y*=t,this}divide(t){return new tJ(this.x/t.x,this.y/t.y)}scalarDivide(t){return new tJ(this.x/t,this.y/t)}scalarDivideEquals(t){return this.x/=t,this.y/=t,this}eq(t){return this.x===t.x&&this.y===t.y}lt(t){return this.xt.x&&this.y>t.y}gte(t){return this.x>=t.x&&this.y>=t.y}lerp(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5;return e=Math.max(Math.min(1,e),0),new tJ(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)}distanceFrom(t){let e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)}midPointFrom(t){return this.lerp(t)}min(t){return new tJ(Math.min(this.x,t.x),Math.min(this.y,t.y))}max(t){return new tJ(Math.max(this.x,t.x),Math.max(this.y,t.y))}toString(){return"".concat(this.x,",").concat(this.y)}setXY(t,e){return this.x=t,this.y=e,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setFromPoint(t){return this.x=t.x,this.y=t.y,this}swap(t){let e=this.x,r=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=r}clone(){return new tJ(this.x,this.y)}rotate(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tZ,r=tQ(t),i=tK(t),n=this.subtract(e);return new tJ(n.x*i-n.y*r,n.x*r+n.y*i).add(e)}transform(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new tJ(t[0]*this.x+t[2]*this.y+(e?0:t[4]),t[1]*this.x+t[3]*this.y+(e?0:t[5]))}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;"object"==typeof t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e)}}let tZ=new tJ(0,0),t$=t=>!!t&&Array.isArray(t._objects);function t0(t){class e extends t{_onObjectAdded(t){}_onObjectRemoved(t){}_onStackOrderChanged(t){}add(){for(var t=arguments.length,e=Array(t),r=0;rthis._onObjectAdded(t)),i}insertAt(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;ithis._onObjectAdded(t)),this._objects.length}remove(){let t=this._objects,e=[];for(var r=arguments.length,i=Array(r),n=0;n{let i=t.indexOf(r);-1!==i&&(t.splice(i,1),e.push(r),this._onObjectRemoved(r))}),e}forEachObject(t){this.getObjects().forEach((e,r,i)=>t(e,r,i))}getObjects(){for(var t=arguments.length,e=Array(t),r=0;rt.isType(...e))}item(t){return this._objects[t]}isEmpty(){return 0===this._objects.length}size(){return this._objects.length}contains(t,r){return!!this._objects.includes(t)||!!r&&this._objects.some(r=>r instanceof e&&r.contains(t,!0))}complexity(){return this._objects.reduce((t,e)=>t+=e.complexity?e.complexity():0,0)}sendObjectToBack(t){return!(!t||t===this._objects[0])&&(tq(this._objects,t),this._objects.unshift(t),this._onStackOrderChanged(t),!0)}bringObjectToFront(t){return!(!t||t===this._objects[this._objects.length-1])&&(tq(this._objects,t),this._objects.push(t),this._onStackOrderChanged(t),!0)}sendObjectBackwards(t,e){if(!t)return!1;let r=this._objects.indexOf(t);if(0!==r){let i=this.findNewLowerIndex(t,r,e);return tq(this._objects,t),this._objects.splice(i,0,t),this._onStackOrderChanged(t),!0}return!1}bringObjectForward(t,e){if(!t)return!1;let r=this._objects.indexOf(t);if(r!==this._objects.length-1){let i=this.findNewUpperIndex(t,r,e);return tq(this._objects,t),this._objects.splice(i,0,t),this._onStackOrderChanged(t),!0}return!1}moveObjectTo(t,e){return t!==this._objects[e]&&(tq(this._objects,t),this._objects.splice(e,0,t),this._onStackOrderChanged(t),!0)}findNewLowerIndex(t,e,r){let i;if(r){i=e;for(let r=e-1;r>=0;--r)if(t.isOverlapping(this._objects[r])){i=r;break}}else i=e-1;return i}findNewUpperIndex(t,e,r){let i;if(r){i=e;for(let r=e+1;r1&&void 0!==arguments[1]?arguments[1]:{},o=[],a=new tJ(e,r),l=a.add(new tJ(i,n));for(let t=this._objects.length-1;t>=0;t--){let e=this._objects[t];e.selectable&&e.visible&&(s&&e.intersectsWithRect(a,l)||e.isContainedWithinRect(a,l)||s&&e.containsPoint(a)||s&&e.containsPoint(l))&&o.push(e)}return o}constructor(){super(...arguments),Z(this,"_objects",[])}}return e}class t1 extends tG{_setOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(let e in t)this.set(e,t[e])}_setObject(t){for(let e in t)this._set(e,t[e])}set(t,e){return"object"==typeof t?this._setObject(t):this._set(t,e),this}_set(t,e){this[t]=e}toggle(t){let e=this.get(t);return"boolean"==typeof e&&this.set(t,!e),this}get(t){return this[t]}}function t2(t){return tf().requestAnimationFrame(t)}function t5(t){return tf().cancelAnimationFrame(t)}let t4=0,t3=()=>t4++,t9=()=>{let t=td().createElement("canvas");if(!t||void 0===t.getContext)throw new to("Failed to create `canvas` element");return t},t6=()=>td().createElement("img"),t8=t=>{let e=t9();return e.width=t.width,e.height=t.height,e},t7=(t,e,r)=>t.toDataURL("image/".concat(e),r),et=(t,e,r)=>new Promise((i,n)=>{t.toBlob(i,"image/".concat(e),r)}),ee=t=>t*tb,er=t=>t/tb,ei=t=>t.every((t,e)=>t===t_[e]),en=(t,e,r)=>new tJ(t).transform(e,r),es=t=>{let e=1/(t[0]*t[3]-t[1]*t[2]),r=[e*t[3],-e*t[1],-e*t[2],e*t[0],0,0],{x:i,y:n}=new tJ(t[4],t[5]).transform(r,!0);return r[4]=-i,r[5]=-n,r},eo=(t,e,r)=>[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],r?0:t[0]*e[4]+t[2]*e[5]+t[4],r?0:t[1]*e[4]+t[3]*e[5]+t[5]],ea=(t,e)=>t.reduceRight((t,r)=>r&&t?eo(r,t,e):r||t,void 0)||t_.concat(),el=t=>{let[e,r]=t;return Math.atan2(r,e)},eh=t=>{let e=el(t),r=Math.pow(t[0],2)+Math.pow(t[1],2),i=Math.sqrt(r),n=(t[0]*t[3]-t[2]*t[1])/i,s=Math.atan2(t[0]*t[2]+t[1]*t[3],r);return{angle:er(e),scaleX:i,scaleY:n,skewX:er(s),skewY:0,translateX:t[4]||0,translateY:t[5]||0}},ec=function(t){return[1,0,0,1,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0]};function eu(){let{angle:t=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{x:e=0,y:r=0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=ee(t),n=tK(i),s=tQ(i);return[n,s,-s,n,e?e-(n*e-s*r):0,r?r-(s*e+n*r):0]}let ed=function(t){return[t,0,0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,0,0]},ef=t=>Math.tan(ee(t)),eg=t=>[1,0,ef(t),1,0,0],ep=t=>[1,ef(t),0,1,0,0],em=t=>{let{scaleX:e=1,scaleY:r=1,flipX:i=!1,flipY:n=!1,skewX:s=0,skewY:o=0}=t,a=ed(i?-e:e,n?-r:r);return s&&(a=eo(a,eg(s),!0)),o&&(a=eo(a,ep(o),!0)),a},ev=t=>{let{translateX:e=0,translateY:r=0,angle:i=0}=t,n=ec(e,r);i&&(n=eo(n,eu({angle:i})));let s=em(t);return ei(s)||(n=eo(n,s)),n},ey=function(t){let{signal:e,crossOrigin:r=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(i,n){let s;if(e&&e.aborted)return n(new ta("loadImage"));let o=t6();e&&(s=function(t){o.src="",n(t)},e.addEventListener("abort",s,{once:!0}));let a=function(){o.onload=o.onerror=null,s&&(null==e||e.removeEventListener("abort",s)),i(o)};t?(o.onload=a,o.onerror=function(){s&&(null==e||e.removeEventListener("abort",s)),n(new to("Error loading ".concat(o.src)))},r&&(o.crossOrigin=r),o.src=t):a()})},ex=function(t){let{signal:e,reviver:r=tv}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((i,n)=>{let s=[];e&&e.addEventListener("abort",n,{once:!0}),Promise.all(t.map(t=>tY.getClass(t.type).fromObject(t,{signal:e}).then(e=>(r(t,e),s.push(e),e)))).then(i).catch(t=>{s.forEach(t=>{t.dispose&&t.dispose()}),n(t)}).finally(()=>{e&&e.removeEventListener("abort",n)})})},eb=function(t){let{signal:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((r,i)=>{let n=[];e&&e.addEventListener("abort",i,{once:!0});let s=Object.values(t).map(t=>t&&t.type&&tY.has(t.type)?ex([t],{signal:e}).then(t=>{let[e]=t;return n.push(e),e}):t),o=Object.keys(t);Promise.all(s).then(t=>t.reduce((t,e,r)=>(t[o[r]]=e,t),{})).then(r).catch(t=>{n.forEach(t=>{t.dispose&&t.dispose()}),i(t)}).finally(()=>{e&&e.removeEventListener("abort",i)})})},e_=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).reduce((e,r)=>(r in t&&(e[r]=t[r]),e),{})},ew=(t,e)=>Object.keys(t).reduce((r,i)=>(e(t[i],i,t)&&(r[i]=t[i]),r),{}),eC=(t,e)=>parseFloat(Number(t).toFixed(e)),eS=t=>"matrix("+t.map(t=>eC(t,tn.NUM_FRACTION_DIGITS)).join(" ")+")",eT=t=>!!t&&void 0!==t.toLive,eO=t=>!!t&&"function"==typeof t.toObject,ek=t=>!!t&&void 0!==t.offsetX&&"source"in t,eM=t=>!!t&&"multiSelectionStacking"in t;function eE(t){let e=t&&eD(t),r=0,i=0;if(!t||!e)return{left:r,top:i};let n=t,s=e.documentElement,o=e.body||{scrollLeft:0,scrollTop:0};for(;n&&(n.parentNode||n.host)&&((n=n.parentNode||n.host)===e?(r=o.scrollLeft||s.scrollLeft||0,i=o.scrollTop||s.scrollTop||0):(r+=n.scrollLeft||0,i+=n.scrollTop||0),1!==n.nodeType||"fixed"!==n.style.position););return{left:r,top:i}}let eD=t=>t.ownerDocument||null,ej=t=>{var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||null},eA=function(t,e,r){let{width:i,height:n}=r,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;t.width=i,t.height=n,s>1&&(t.setAttribute("width",(i*s).toString()),t.setAttribute("height",(n*s).toString()),e.scale(s,s))},eP=(t,e)=>{let{width:r,height:i}=e;r&&(t.style.width="number"==typeof r?"".concat(r,"px"):r),i&&(t.style.height="number"==typeof i?"".concat(i,"px"):i)};function eF(t){return void 0!==t.onselectstart&&(t.onselectstart=()=>!1),t.style.userSelect=tO,t}class eL{createLowerCanvas(t){let e=t&&void 0!==t.getContext?t:t&&td().getElementById(t)||t9();if(e.hasAttribute("data-fabric"))throw new to("Trying to initialize a canvas that has already been initialized. Did you forget to dispose the canvas?");return this._originalCanvasStyle=e.style.cssText,e.setAttribute("data-fabric","main"),e.classList.add("lower-canvas"),e}cleanupDOM(t){let{width:e,height:r}=t,{el:i}=this.lower;i.classList.remove("lower-canvas"),i.removeAttribute("data-fabric"),i.setAttribute("width","".concat(e)),i.setAttribute("height","".concat(r)),i.style.cssText=this._originalCanvasStyle||"",this._originalCanvasStyle=void 0}setDimensions(t,e){let{el:r,ctx:i}=this.lower;eA(r,i,t,e)}setCSSDimensions(t){eP(this.lower.el,t)}calcOffset(){return function(t){var e;let r=t&&eD(t),i={left:0,top:0};if(!r)return i;let n=(null==(e=ej(t))?void 0:e.getComputedStyle(t,null))||{};i.left+=parseInt(n.borderLeftWidth,10)||0,i.top+=parseInt(n.borderTopWidth,10)||0,i.left+=parseInt(n.paddingLeft,10)||0,i.top+=parseInt(n.paddingTop,10)||0;let s={left:0,top:0},o=r.documentElement;void 0!==t.getBoundingClientRect&&(s=t.getBoundingClientRect());let a=eE(t);return{left:s.left+a.left-(o.clientLeft||0)+i.left,top:s.top+a.top-(o.clientTop||0)+i.top}}(this.lower.el)}dispose(){tu().dispose(this.lower.el),delete this.lower}constructor(t){Z(this,"_originalCanvasStyle",void 0),Z(this,"lower",void 0);let e=this.createLowerCanvas(t);this.lower={el:e,ctx:e.getContext("2d")}}}let eR={backgroundVpt:!0,backgroundColor:"",overlayVpt:!0,overlayColor:"",includeDefaultValues:!0,svgViewportTransformation:!0,renderOnAddRemove:!0,skipOffscreen:!0,enableRetinaScaling:!0,imageSmoothingEnabled:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,viewportTransform:[...t_]};class eI extends t0(t1){get lowerCanvasEl(){var t;return null==(t=this.elements.lower)?void 0:t.el}get contextContainer(){var t;return null==(t=this.elements.lower)?void 0:t.ctx}static getDefaults(){return eI.ownDefaults}initElements(t){this.elements=new eL(t)}add(){let t=super.add(...arguments);return arguments.length>0&&this.renderOnAddRemove&&this.requestRenderAll(),t}insertAt(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i0&&this.renderOnAddRemove&&this.requestRenderAll(),n}remove(){let t=super.remove(...arguments);return t.length>0&&this.renderOnAddRemove&&this.requestRenderAll(),t}_onObjectAdded(t){t.canvas&&t.canvas!==this&&(ts("warn","Canvas is trying to add an object that belongs to a different canvas.\nResulting to default behavior: removing object from previous canvas and adding to new canvas"),t.canvas.remove(t)),t._set("canvas",this),t.setCoords(),this.fire("object:added",{target:t}),t.fire("added",{target:this})}_onObjectRemoved(t){t._set("canvas",void 0),this.fire("object:removed",{target:t}),t.fire("removed",{target:this})}_onStackOrderChanged(){this.renderOnAddRemove&&this.requestRenderAll()}getRetinaScaling(){return this.enableRetinaScaling?tg():1}calcOffset(){return this._offset=this.elements.calcOffset()}getWidth(){return this.width}getHeight(){return this.height}setWidth(t,e){return this.setDimensions({width:t},e)}setHeight(t,e){return this.setDimensions({height:t},e)}_setDimensionsImpl(t){let{cssOnly:e=!1,backstoreOnly:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e){let e=tt({width:this.width,height:this.height},t);this.elements.setDimensions(e,this.getRetinaScaling()),this.hasLostContext=!0,this.width=e.width,this.height=e.height}r||this.elements.setCSSDimensions(t),this.calcOffset()}setDimensions(t,e){this._setDimensionsImpl(t,e),e&&e.cssOnly||this.requestRenderAll()}getZoom(){return this.viewportTransform[0]}setViewportTransform(t){this.viewportTransform=t,this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll()}zoomToPoint(t,e){let r=[...this.viewportTransform],i=en(t,es(r));r[0]=e,r[3]=e;let n=en(i,r);r[4]+=t.x-n.x,r[5]+=t.y-n.y,this.setViewportTransform(r)}setZoom(t){this.zoomToPoint(new tJ(0,0),t)}absolutePan(t){let e=[...this.viewportTransform];return e[4]=-t.x,e[5]=-t.y,this.setViewportTransform(e)}relativePan(t){return this.absolutePan(new tJ(-t.x-this.viewportTransform[4],-t.y-this.viewportTransform[5]))}getElement(){return this.elements.lower.el}clearContext(t){t.clearRect(0,0,this.width,this.height)}getContext(){return this.elements.lower.ctx}clear(){this.remove(...this.getObjects()),this.backgroundImage=void 0,this.overlayImage=void 0,this.backgroundColor="",this.overlayColor="",this.clearContext(this.getContext()),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll()}renderAll(){this.cancelRequestedRender(),this.destroyed||this.renderCanvas(this.getContext(),this._objects)}renderAndReset(){this.nextRenderHandle=0,this.renderAll()}requestRenderAll(){this.nextRenderHandle||this.disposed||this.destroyed||(this.nextRenderHandle=t2(()=>this.renderAndReset()))}calcViewportBoundaries(){let t=this.width,e=this.height,r=es(this.viewportTransform),i=en({x:0,y:0},r),n=en({x:t,y:e},r),s=i.min(n),o=i.max(n);return this.vptCoords={tl:s,tr:new tJ(o.x,s.y),bl:new tJ(s.x,o.y),br:o}}cancelRequestedRender(){this.nextRenderHandle&&(t5(this.nextRenderHandle),this.nextRenderHandle=0)}drawControls(t){}renderCanvas(t,e){if(this.destroyed)return;let r=this.viewportTransform,i=this.clipPath;this.calcViewportBoundaries(),this.clearContext(t),t.imageSmoothingEnabled=this.imageSmoothingEnabled,t.patternQuality="best",this.fire("before:render",{ctx:t}),this._renderBackground(t),t.save(),t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this._renderObjects(t,e),t.restore(),this.controlsAboveOverlay||this.skipControlsDrawing||this.drawControls(t),i&&(i._set("canvas",this),i.shouldCache(),i._transformDone=!0,i.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(t,i)),this._renderOverlay(t),this.controlsAboveOverlay&&!this.skipControlsDrawing&&this.drawControls(t),this.fire("after:render",{ctx:t}),this.__cleanupTask&&(this.__cleanupTask(),this.__cleanupTask=void 0)}drawClipPathOnCanvas(t,e){let r=this.viewportTransform;t.save(),t.transform(...r),t.globalCompositeOperation="destination-in",e.transform(t),t.scale(1/e.zoomX,1/e.zoomY),t.drawImage(e._cacheCanvas,-e.cacheTranslationX,-e.cacheTranslationY),t.restore()}_renderObjects(t,e){for(let r=0,i=e.length;r!t.excludeFromExport).map(r=>this._toObject(r,t,e))},this.__serializeBgOverlay(t,e)),i?{clipPath:i}:null)}_toObject(t,e,r){let i;this.includeDefaultValues||(i=t.includeDefaultValues,t.includeDefaultValues=!1);let n=t[e](r);return this.includeDefaultValues||(t.includeDefaultValues=!!i),n}__serializeBgOverlay(t,e){let r={},i=this.backgroundImage,n=this.overlayImage,s=this.backgroundColor,o=this.overlayColor;return eT(s)?s.excludeFromExport||(r.background=s.toObject(e)):s&&(r.background=s),eT(o)?o.excludeFromExport||(r.overlay=o.toObject(e)):o&&(r.overlay=o),i&&!i.excludeFromExport&&(r.backgroundImage=this._toObject(i,t,e)),n&&!n.excludeFromExport&&(r.overlayImage=this._toObject(n,t,e)),r}toSVG(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;t.reviver=e;let r=[];return this._setSVGPreamble(r,t),this._setSVGHeader(r,t),this.clipPath&&r.push('\n')),this._setSVGBgOverlayColor(r,"background"),this._setSVGBgOverlayImage(r,"backgroundImage",e),this._setSVGObjects(r,e),this.clipPath&&r.push("\n"),this._setSVGBgOverlayColor(r,"overlay"),this._setSVGBgOverlayImage(r,"overlayImage",e),r.push(""),r.join("")}_setSVGPreamble(t,e){e.suppressPreamble||t.push('\n','\n')}_setSVGHeader(t,e){let r,i=e.width||"".concat(this.width),n=e.height||"".concat(this.height),s=tn.NUM_FRACTION_DIGITS,o=e.viewBox;if(o)r='viewBox="'.concat(o.x," ").concat(o.y," ").concat(o.width," ").concat(o.height,'" ');else if(this.svgViewportTransformation){let t=this.viewportTransform;r='viewBox="'.concat(eC(-t[4]/t[0],s)," ").concat(eC(-t[5]/t[3],s)," ").concat(eC(this.width/t[0],s)," ").concat(eC(this.height/t[3],s),'" ')}else r='viewBox="0 0 '.concat(this.width," ").concat(this.height,'" ');t.push("\n',"Created with Fabric.js ",tm,"\n","\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),"\n")}createSVGClipPathMarkup(t){let e=this.clipPath;return e?(e.clipPathId="CLIPPATH_".concat(t3()),'\n').concat(e.toClipPathSVG(t.reviver),"\n")):""}createSVGRefElementsMarkup(){return["background","overlay"].map(t=>{let e=this["".concat(t,"Color")];if(eT(e)){let r=this["".concat(t,"Vpt")],i=this.viewportTransform,n={isType:()=>!1,width:this.width/(r?i[0]:1),height:this.height/(r?i[3]:1)};return e.toSVG(n,{additionalTransform:r?eS(i):""})}}).join("")}createSVGFontFacesMarkup(){let t=[],e={},r=tn.fontPaths;this._objects.forEach(function e(r){t.push(r),t$(r)&&r._objects.forEach(e)}),t.forEach(t=>{if(!t||"function"!=typeof t._renderText)return;let{styles:i,fontFamily:n}=t;!e[n]&&r[n]&&(e[n]=!0,i&&Object.values(i).forEach(t=>{Object.values(t).forEach(t=>{let{fontFamily:i=""}=t;!e[i]&&r[i]&&(e[i]=!0)})}))});let i=Object.keys(e).map(t=>" @font-face {\n font-family: '".concat(t,"';\n src: url('").concat(r[t],"');\n }\n")).join("");return i?' \n"):""}_setSVGObjects(t,e){this.forEachObject(r=>{r.excludeFromExport||this._setSVGObject(t,r,e)})}_setSVGObject(t,e,r){t.push(e.toSVG(r))}_setSVGBgOverlayImage(t,e,r){let i=this[e];i&&!i.excludeFromExport&&i.toSVG&&t.push(i.toSVG(r))}_setSVGBgOverlayColor(t,e){let r=this["".concat(e,"Color")];if(r)if(eT(r)){let i=r.repeat||"",n=this.width,s=this.height,o=this["".concat(e,"Vpt")]?eS(es(this.viewportTransform)):"";t.push('\n'))}else t.push('\n")}loadFromJSON(t,e){let{signal:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return Promise.reject(new to("`json` is undefined"));let i="string"==typeof t?JSON.parse(t):t,{objects:n=[],backgroundImage:s,background:o,overlayImage:a,overlay:l,clipPath:h}=i,c=this.renderOnAddRemove;return this.renderOnAddRemove=!1,Promise.all([ex(n,{reviver:e,signal:r}),eb({backgroundImage:s,backgroundColor:o,overlayImage:a,overlayColor:l,clipPath:h},{signal:r})]).then(t=>{let[e,r]=t;return this.clear(),this.add(...e),this.set(i),this.set(r),this.renderOnAddRemove=c,this})}clone(t){let e=this.toObject(t);return this.cloneWithoutData().loadFromJSON(e)}cloneWithoutData(){let t=t8(this);return new this.constructor(t)}toDataURL(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{format:e="png",quality:r=1,multiplier:i=1,enableRetinaScaling:n=!1}=t,s=i*(n?this.getRetinaScaling():1);return t7(this.toCanvasElement(s,t),e,r)}toBlob(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{format:e="png",quality:r=1,multiplier:i=1,enableRetinaScaling:n=!1}=t,s=i*(n?this.getRetinaScaling():1);return et(this.toCanvasElement(s,t),e,r)}toCanvasElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,{width:e,height:r,left:i,top:n,filter:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=(e||this.width)*t,a=(r||this.height)*t,l=this.getZoom(),h=this.width,c=this.height,u=this.skipControlsDrawing,d=l*t,f=this.viewportTransform,g=[d,0,0,d,(f[4]-(i||0))*t,(f[5]-(n||0))*t],p=this.enableRetinaScaling,m=t8({width:o,height:a}),y=s?this._objects.filter(t=>s(t)):this._objects;return this.enableRetinaScaling=!1,this.viewportTransform=g,this.width=o,this.height=a,this.skipControlsDrawing=!0,this.calcViewportBoundaries(),this.renderCanvas(m.getContext("2d"),y),this.viewportTransform=f,this.width=h,this.height=c,this.calcViewportBoundaries(),this.enableRetinaScaling=p,this.skipControlsDrawing=u,m}dispose(){return this.disposed||this.elements.cleanupDOM({width:this.width,height:this.height}),tz.cancelByCanvas(this),this.disposed=!0,new Promise((t,e)=>{let r=()=>{this.destroy(),t(!0)};r.kill=e,this.__cleanupTask&&this.__cleanupTask.kill("aborted"),this.destroyed?t(!1):this.nextRenderHandle?this.__cleanupTask=r:r()})}destroy(){this.destroyed=!0,this.cancelRequestedRender(),this.forEachObject(t=>t.dispose()),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose(),this.backgroundImage=void 0,this.overlayImage&&this.overlayImage.dispose(),this.overlayImage=void 0,this.elements.dispose()}toString(){return"#")}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Object.assign(this,this.constructor.getDefaults()),this.set(e),this.initElements(t),this._setDimensionsImpl({width:this.width||this.elements.lower.el.width||0,height:this.height||this.elements.lower.el.height||0}),this.skipControlsDrawing=!1,this.viewportTransform=[...this.viewportTransform],this.calcViewportBoundaries()}}Z(eI,"ownDefaults",eR);let eB=["touchstart","touchmove","touchend"],eN=t=>{let e=eE(t.target),r=function(t){let e=t.changedTouches;return e&&e[0]?e[0]:t}(t);return new tJ(r.clientX+e.left,r.clientY+e.top)},eW=t=>eB.includes(t.type)||"touch"===t.pointerType,eU=t=>{t.preventDefault(),t.stopPropagation()},eH=t=>{let e=0,r=0,i=0,n=0;for(let s=0,o=t.length;si||!s)&&(i=o),(on||!s)&&(n=a),(aeY(t,eo(e,t.calcOwnMatrix())),eY=(t,e)=>{let r=eh(e),{translateX:i,translateY:n,scaleX:s,scaleY:o}=r,a=te(r,eX),l=new tJ(i,n);t.flipX=!1,t.flipY=!1,Object.assign(t,a),t.set({scaleX:s,scaleY:o}),t.setPositionByOrigin(l,tw,tw)},ez=t=>{t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},eG=t=>({scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}),eq=(t,e,r)=>{let i=t/2,n=e/2,s=eH([new tJ(-i,-n),new tJ(i,-n),new tJ(-i,n),new tJ(i,n)].map(t=>t.transform(r)));return new tJ(s.width,s.height)},eK=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t_;return eo(es(arguments.length>1&&void 0!==arguments[1]?arguments[1]:t_),t)},eQ=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t_,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t_;return t.transform(eK(e,r))},eJ=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t_,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t_;return t.transform(eK(e,r),!0)},eZ=(t,e,r)=>{let i=eK(e,r);return eY(t,eo(i,t.calcOwnMatrix())),i},e$=(t,e)=>{var r;let{transform:{target:i}}=e;null==(r=i.canvas)||r.fire("object:".concat(t),tt(tt({},e),{},{target:i})),i.fire(t,e)},e0={left:-.5,top:-.5,center:0,bottom:.5,right:.5},e1=t=>"string"==typeof t?e0[t]:t-.5,e2="not-allowed";function e5(t){return e1(t.originX)===e1(tw)&&e1(t.originY)===e1(tw)}let e4=(t,e)=>t[e],e3=(t,e,r,i)=>({e:t,transform:e,pointer:new tJ(r,i)});function e9(t,e){return Math.round((t.getTotalAngle()+er(Math.atan2(e.y,e.x))+360)%360/45)}function e6(t,e,r,i,n){var s;let{target:o,corner:a}=t,l=o.controls[a],h=(null==(s=o.canvas)?void 0:s.getZoom())||1,c=o.padding/h,u=function(t,e,r,i){let n=t.getRelativeCenterPoint(),s=void 0!==r&&void 0!==i?t.translateToGivenOrigin(n,tw,tw,r,i):new tJ(t.left,t.top);return(t.angle?e.rotate(-ee(t.angle),n):e).subtract(s)}(o,new tJ(i,n),e,r);return u.x>=c&&(u.x-=c),u.x<=-c&&(u.x+=c),u.y>=c&&(u.y-=c),u.y<=c&&(u.y+=c),u.x-=l.offsetX,u.y-=l.offsetY,u}let e8=(t,e,r,i)=>{let{target:n,offsetX:s,offsetY:o}=e,a=r-s,l=i-o,h=!e4(n,"lockMovementX")&&n.left!==a,c=!e4(n,"lockMovementY")&&n.top!==l;return h&&n.set(tC,a),c&&n.set("top",l),(h||c)&&e$(tM,e3(t,e,r,i)),h||c},e7={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#639",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32"},rt=(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t),re=(t,e,r,i)=>{let n,s;t/=255;let o=Math.max(t,e/=255,r/=255),a=Math.min(t,e,r),l=(o+a)/2;if(o===a)n=s=0;else{let i=o-a;switch(s=l>.5?i/(2-o-a):i/(o+a),o){case t:n=(e-r)/i+6*(e0&&void 0!==arguments[0]?arguments[0]:"1";return parseFloat(t)/(t.endsWith("%")?100:1)},ri=t=>Math.min(Math.round(t),255).toString(16).toUpperCase().padStart(2,"0"),rn=t=>{let[e,r,i,n=1]=t,s=Math.round(.3*e+.59*r+.11*i);return[s,s,s,n]};class rs{_tryParsingColor(t){return(t=t.toLowerCase())in e7&&(t=e7[t]),"transparent"===t?[255,255,255,0]:rs.sourceFromHex(t)||rs.sourceFromRgb(t)||rs.sourceFromHsl(t)||(this.isUnrecognised=!0,[0,0,0,1])}getSource(){return this._source}setSource(t){this._source=t}toRgb(){let[t,e,r]=this.getSource();return"rgb(".concat(t,",").concat(e,",").concat(r,")")}toRgba(){return"rgba(".concat(this.getSource().join(","),")")}toHsl(){let[t,e,r]=re(...this.getSource());return"hsl(".concat(t,",").concat(e,"%,").concat(r,"%)")}toHsla(){let[t,e,r,i]=re(...this.getSource());return"hsla(".concat(t,",").concat(e,"%,").concat(r,"%,").concat(i,")")}toHex(){return this.toHexa().slice(0,6)}toHexa(){let[t,e,r,i]=this.getSource();return"".concat(ri(t)).concat(ri(e)).concat(ri(r)).concat(ri(Math.round(255*i)))}getAlpha(){return this.getSource()[3]}setAlpha(t){return this._source[3]=t,this}toGrayscale(){return this.setSource(rn(this.getSource())),this}toBlackWhite(t){let[e,,,r]=rn(this.getSource()),i=e<(t||127)?0:255;return this.setSource([i,i,i,r]),this}overlayWith(t){t instanceof rs||(t=new rs(t));let e=this.getSource(),r=t.getSource(),[i,n,s]=e.map((t,e)=>Math.round(.5*t+.5*r[e]));return this.setSource([i,n,s,e[3]]),this}static fromRgb(t){return rs.fromRgba(t)}static fromRgba(t){return new rs(rs.sourceFromRgb(t))}static sourceFromRgb(t){let e=t.match(/^rgba?\(\s*(\d{0,3}(?:\.\d+)?%?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*(?:\s*[,/]\s*(\d{0,3}(?:\.\d+)?%?)\s*)?\)$/i);if(e){let[t,r,i]=e.slice(1,4).map(t=>{let e=parseFloat(t);return t.endsWith("%")?Math.round(2.55*e):e});return[t,r,i,rr(e[4])]}}static fromHsl(t){return rs.fromHsla(t)}static fromHsla(t){return new rs(rs.sourceFromHsl(t))}static sourceFromHsl(t){let e,r,i,n=t.match(/^hsla?\(\s*([+-]?\d{0,3}(?:\.\d+)?(?:deg|turn|rad)?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*(?:\s*[,/]\s*(\d*(?:\.\d+)?%?)\s*)?\)$/i);if(!n)return;let s=(rs.parseAngletoDegrees(n[1])%360+360)%360/360,o=parseFloat(n[2])/100,a=parseFloat(n[3])/100;if(0===o)e=r=i=a;else{let t=a<=.5?a*(o+1):a+o-a*o,n=2*a-t;e=rt(n,t,s+1/3),r=rt(n,t,s),i=rt(n,t,s-1/3)}return[Math.round(255*e),Math.round(255*r),Math.round(255*i),rr(n[4])]}static fromHex(t){return new rs(rs.sourceFromHex(t))}static sourceFromHex(t){if(t.match(/^#?(([0-9a-f]){3,4}|([0-9a-f]{2}){3,4})$/i)){let e=t.slice(t.indexOf("#")+1),[r,i,n,s=255]=(e.length<=4?e.split("").map(t=>t+t):e.match(/.{2}/g)).map(t=>parseInt(t,16));return[r,i,n,s/255]}}static parseAngletoDegrees(t){let e=t.toLowerCase(),r=parseFloat(e);return e.includes("rad")?er(r):e.includes("turn")?360*r:r}constructor(t){if(Z(this,"isUnrecognised",!1),t)if(t instanceof rs)this.setSource([...t._source]);else if(Array.isArray(t)){let[e,r,i,n=1]=t;this.setSource([e,r,i,n])}else this.setSource(this._tryParsingColor(t));else this.setSource([0,0,0,1])}}let ro=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,r=/\D{0,2}$/.exec(t),i=parseFloat(t),n=tn.DPI;switch(null==r?void 0:r[0]){case"mm":return i*n/25.4;case"cm":return i*n/2.54;case"in":return i*n;case"pt":return i*n/72;case"pc":return i*n/72*12;case"em":return i*e;default:return i}},ra=t=>{let[e,r]=t.trim().split(" "),[i,n]=e&&e!==tO?[e.slice(1,4),e.slice(5,8)]:e===tO?[e,e]:["Mid","Mid"];return{meetOrSlice:r||"meet",alignX:i,alignY:n}},rl=function(t,e){let r,i,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e)if(e.toLive)r="url(#SVGID_".concat(e.id,")");else{let t=new rs(e),n=t.getAlpha();r=t.toRgb(),1!==n&&(i=n.toString())}else r="none";return n?"".concat(t,": ").concat(r,"; ").concat(i?"".concat(t,"-opacity: ").concat(i,"; "):""):"".concat(t,'="').concat(r,'" ').concat(i?"".concat(t,'-opacity="').concat(i,'" '):"")};class rh{getSvgStyles(t){let e=this.fillRule?this.fillRule:"nonzero",r=this.strokeWidth?this.strokeWidth:"0",i=this.strokeDashArray?this.strokeDashArray.join(" "):tO,n=this.strokeDashOffset?this.strokeDashOffset:"0",s=this.strokeLineCap?this.strokeLineCap:"butt",o=this.strokeLineJoin?this.strokeLineJoin:"miter",a=this.strokeMiterLimit?this.strokeMiterLimit:"4",l=void 0!==this.opacity?this.opacity:"1",h=this.visible?"":" visibility: hidden;",c=t?"":this.getSvgFilter(),u=rl(tU,this.fill);return rl(tH,this.stroke)+"stroke-width: "+r+"; stroke-dasharray: "+i+"; stroke-linecap: "+s+"; stroke-dashoffset: "+n+"; stroke-linejoin: "+o+"; stroke-miterlimit: "+a+"; "+u+"fill-rule: "+e+"; opacity: "+l+";"+c+h}getSvgFilter(){return this.shadow?"filter: url(#SVGID_".concat(this.shadow.id,");"):""}getSvgCommons(){return[this.id?'id="'.concat(this.id,'" '):"",this.clipPath?'clip-path="url(#'.concat(this.clipPath.clipPathId,')" '):""].join("")}getSvgTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t?this.calcTransformMatrix():this.calcOwnMatrix(),i='transform="'.concat(eS(r));return"".concat(i).concat(e,'" ')}_toSVG(t){return[""]}toSVG(t){return this._createBaseSVGMarkup(this._toSVG(t),{reviver:t})}toClipPathSVG(t){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(t),{reviver:t})}_createBaseClipPathSVGMarkup(t){let{reviver:e,additionalTransform:r=""}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),n=t.indexOf("COMMON_PARTS");return t[n]=i,e?e(t.join("")):t.join("")}_createBaseSVGMarkup(t){let e,{noStyle:r,reviver:i,withShadow:n,additionalTransform:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r?"":'style="'.concat(this.getSvgStyles(),'" '),a=n?'style="'.concat(this.getSvgFilter(),'" '):"",l=this.clipPath,h=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",c=l&&l.absolutePositioned,u=this.stroke,d=this.fill,f=this.shadow,g=[],p=t.indexOf("COMMON_PARTS");l&&(l.clipPathId="CLIPPATH_".concat(t3()),e='\n').concat(l.toClipPathSVG(i),"\n")),c&&g.push("\n"),g.push("\n");let m=""+o+h+(r?"":this.addPaintOrder())+" "+(s?'transform="'.concat(s,'" '):"");return t[p]=m,eT(d)&&g.push(d.toSVG(this)),eT(u)&&g.push(u.toSVG(this)),f&&g.push(f.toSVG(this)),l&&g.push(e),g.push(t.join("")),g.push("\n"),c&&g.push("\n"),i?i(g.join("")):g.join("")}addPaintOrder(){return this.paintFirst!==tU?' paint-order="'.concat(this.paintFirst,'" '):""}}function rc(t){return RegExp("^("+t.join("|")+")\\b","i")}let ru="textDecorationThickness",rd=["fontSize","fontWeight","fontFamily","fontStyle"],rf=["underline","overline","linethrough"],rg=[...rd,"lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide","pathAlign"],rp=[...rg,...rf,"textBackgroundColor","direction",ru],rm=[...rd,...rf,tH,"strokeWidth",tU,"deltaY","textBackgroundColor",ru],rv="justify",ry="justify-left",rx="justify-right",rb="justify-center",r_=String.raw(s||(s=tr(["[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?"],["[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?"]))),rw=String.raw(o||(o=tr(["(?:s*,?s+|s*,s*)"],["(?:\\s*,?\\s+|\\s*,\\s*)"]))),rC=RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+r_+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+r_+"))?\\s+(.*)"),rS={cx:tC,x:tC,r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing","text-decoration-thickness":ru},rT="font-size",rO="clip-path",rk=(rc(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),rc(["symbol","image","marker","pattern","view","svg"]),rc(["symbol","g","a","svg","clipPath","defs"])),rM=(new RegExp(String.raw(a||(a=tr(["^s*(",")","(",")","(",")","(",")s*$"],["^\\s*(",")","(",")","(",")","(",")\\s*$"])),r_,rw,r_,rw,r_,rw,r_)),new tJ(1,0)),rE=new tJ,rD=(t,e)=>t.rotate(e),rj=(t,e)=>new tJ(e).subtract(t),rA=t=>t.distanceFrom(rE),rP=(t,e)=>Math.atan2(rI(t,e),rB(t,e)),rF=t=>rP(rM,t),rL=t=>t.eq(rE)?t:t.scalarDivide(rA(t)),rR=function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return rL(new tJ(-t.y,t.x).scalarMultiply(e?1:-1))},rI=(t,e)=>t.x*e.y-t.y*e.x,rB=(t,e)=>t.x*e.x+t.y*e.y,rN=(t,e,r)=>{if(t.eq(e)||t.eq(r))return!0;let i=rI(e,r),n=rI(e,t),s=rI(r,t);return i>=0?n>=0&&s<=0:!(n<=0&&s>=0)},rW="(-?\\d+(?:\\.\\d*)?(?:px)?(?:\\s?|$))?",rU=RegExp("(?:\\s|^)"+rW+rW+"("+r_+"?(?:px)?)?(?:\\s?|$)(?:$|\\s)");class rH{static parseShadow(t){let e=t.trim(),[,r=0,i=0,n=0]=(rU.exec(e)||[]).map(t=>parseFloat(t)||0);return{color:(e.replace(rU,"")||"rgb(0,0,0)").trim(),offsetX:r,offsetY:i,blur:n}}toString(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")}toSVG(t){let e=rD(new tJ(this.offsetX,this.offsetY),ee(-t.angle)),r=new rs(this.color),i=40,n=40;return t.width&&t.height&&(i=100*eC((Math.abs(e.x)+this.blur)/t.width,tn.NUM_FRACTION_DIGITS)+20,n=100*eC((Math.abs(e.y)+this.blur)/t.height,tn.NUM_FRACTION_DIGITS)+20),t.flipX&&(e.x*=-1),t.flipY&&(e.y*=-1),'\n \n \n \n \n \n \n \n \n\n')}toObject(){let t={color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling,type:this.constructor.type},e=rH.ownDefaults;return this.includeDefaultValues?t:ew(t,(t,r)=>t!==e[r])}static async fromObject(t){return new this(t)}constructor(t){let e="string"==typeof t?rH.parseShadow(t):t;Object.assign(this,rH.ownDefaults,e),this.id=t3()}}Z(rH,"ownDefaults",{color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1}),Z(rH,"type","shadow"),tY.setClass(rH,"shadow");let rX=(t,e,r)=>Math.max(t,Math.min(e,r)),rV=["top",tC,tI,tB,"flipX","flipY","originX","originY","angle","opacity","globalCompositeOperation","shadow","visible",tN,tW],rY=[tU,tH,"strokeWidth","strokeDashArray","width","height","paintFirst","strokeUniform","strokeLineCap","strokeDashOffset","strokeLineJoin","strokeMiterLimit","backgroundColor","clipPath"],rz=(t,e,r,i)=>(tt*Math.pow(2,10*(i-=1))*Math.sin((i*n-e)*tx/r),rq=(t,e,r,i)=>-r*Math.cos(t/i*ty)+r+e,rK=(t,e,r,i)=>(t/=i)<1/2.75?7.5625*t*t*r+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,rQ=(t,e,r,i)=>r-rK(i-t,0,r,i)+e;var rJ=Object.freeze({__proto__:null,defaultEasing:rq,easeInBack:function(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1.70158;return r*(t/=i)*t*((n+1)*t-n)+e},easeInBounce:rQ,easeInCirc:(t,e,r,i)=>-r*(Math.sqrt(1-(t/=i)*t)-1)+e,easeInCubic:(t,e,r,i)=>r*(t/i)**3+e,easeInElastic:(t,e,r,i)=>{let n=0;if(0===t)return e;if(1==(t/=i))return e+r;n||(n=.3*i);let{a:s,s:o,p:a}=rz(r,r,n,1.70158);return-rG(s,o,a,t,i)+e},easeInExpo:(t,e,r,i)=>0===t?e:r*2**(10*(t/i-1))+e,easeInOutBack:function(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1.70158;return(t/=i/2)<1?r/2*(t*t*((1+(n*=1.525))*t-n))+e:r/2*((t-=2)*t*((1+(n*=1.525))*t+n)+2)+e},easeInOutBounce:(t,e,r,i)=>t(t/=i/2)<1?-r/2*(Math.sqrt(1-t**2)-1)+e:r/2*(Math.sqrt(1-(t-=2)*t)+1)+e,easeInOutCubic:(t,e,r,i)=>(t/=i/2)<1?r/2*t**3+e:r/2*((t-2)**3+2)+e,easeInOutElastic:(t,e,r,i)=>{let n=0;if(0===t)return e;if(2==(t/=i/2))return e+r;n||(n=.3*1.5*i);let{a:s,s:o,p:a,c:l}=rz(r,r,n,1.70158);return t<1?-.5*rG(s,o,a,t,i)+e:s*Math.pow(2,-10*(t-=1))*Math.sin((t*i-o)*tx/a)*.5+l+e},easeInOutExpo:(t,e,r,i)=>0===t?e:t===i?e+r:(t/=i/2)<1?r/2*2**(10*(t-1))+e:-(r/2*(2**(-10*--t)+2))+e,easeInOutQuad:(t,e,r,i)=>(t/=i/2)<1?r/2*t**2+e:-r/2*(--t*(t-2)-1)+e,easeInOutQuart:(t,e,r,i)=>(t/=i/2)<1?r/2*t**4+e:-r/2*((t-=2)*t**3-2)+e,easeInOutQuint:(t,e,r,i)=>(t/=i/2)<1?r/2*t**5+e:r/2*((t-2)**5+2)+e,easeInOutSine:(t,e,r,i)=>-r/2*(Math.cos(Math.PI*t/i)-1)+e,easeInQuad:(t,e,r,i)=>r*(t/=i)*t+e,easeInQuart:(t,e,r,i)=>r*(t/=i)*t**3+e,easeInQuint:(t,e,r,i)=>r*(t/i)**5+e,easeInSine:(t,e,r,i)=>-r*Math.cos(t/i*ty)+r+e,easeOutBack:function(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1.70158;return r*((t=t/i-1)*t*((n+1)*t+n)+1)+e},easeOutBounce:rK,easeOutCirc:(t,e,r,i)=>r*Math.sqrt(1-(t=t/i-1)*t)+e,easeOutCubic:(t,e,r,i)=>r*((t/i-1)**3+1)+e,easeOutElastic:(t,e,r,i)=>{let n=0;if(0===t)return e;if(1==(t/=i))return e+r;n||(n=.3*i);let{a:s,s:o,p:a,c:l}=rz(r,r,n,1.70158);return s*2**(-10*t)*Math.sin((t*i-o)*tx/a)+l+e},easeOutExpo:(t,e,r,i)=>t===i?e+r:-(r*(2**(-10*t/i)+1))+e,easeOutQuad:(t,e,r,i)=>-r*(t/=i)*(t-2)+e,easeOutQuart:(t,e,r,i)=>-r*((t=t/i-1)*t**3-1)+e,easeOutQuint:(t,e,r,i)=>r*((t/i-1)**5+1)+e,easeOutSine:(t,e,r,i)=>r*Math.sin(t/i*ty)+e});let rZ=()=>!1;class r${get state(){return this._state}isDone(){return"aborted"===this._state||"completed"===this._state}start(){let t=t=>{"pending"===this._state&&(this.startTime=t||+new Date,this._state="running",this._onStart(),this.tick(this.startTime))};this.register(),this.delay>0?setTimeout(()=>t2(t),this.delay):t2(t)}tick(t){let e=(t||+new Date)-this.startTime,r=Math.min(e,this.duration);this.durationProgress=r/this.duration;let{value:i,valueProgress:n}=this.calculate(r);this.value=Object.freeze(i),this.valueProgress=n,"aborted"!==this._state&&(this._abort(this.value,this.valueProgress,this.durationProgress)?(this._state="aborted",this.unregister()):e>=this.duration?(this.durationProgress=this.valueProgress=1,this._onChange(this.endValue,this.valueProgress,this.durationProgress),this._state="completed",this._onComplete(this.endValue,this.valueProgress,this.durationProgress),this.unregister()):(this._onChange(this.value,this.valueProgress,this.durationProgress),t2(this.tick)))}register(){tz.push(this)}unregister(){tz.remove(this)}abort(){this._state="aborted",this.unregister()}constructor(t){let{startValue:e,byValue:r,duration:i=500,delay:n=0,easing:s=rq,onStart:o=tv,onChange:a=tv,onComplete:l=tv,abort:h=rZ,target:c}=t;Z(this,"_state","pending"),Z(this,"durationProgress",0),Z(this,"valueProgress",0),this.tick=this.tick.bind(this),this.duration=i,this.delay=n,this.easing=s,this._onStart=o,this._onChange=a,this._onComplete=l,this._abort=h,this.target=c,this.startValue=e,this.byValue=r,this.value=this.startValue,this.endValue=Object.freeze(this.calculate(this.duration).value)}}let r0=["startValue","endValue"];class r1 extends r${calculate(t){let e=this.easing(t,this.startValue,this.byValue,this.duration);return{value:e,valueProgress:Math.abs((e-this.startValue)/this.byValue)}}constructor(t){let{startValue:e=0,endValue:r=100}=t;super(tt(tt({},te(t,r0)),{},{startValue:e,byValue:r-e}))}}let r2=["startValue","endValue"];class r5 extends r${calculate(t){let e=this.startValue.map((e,r)=>this.easing(t,e,this.byValue[r],this.duration,r));return{value:e,valueProgress:Math.abs((e[0]-this.startValue[0])/this.byValue[0])}}constructor(t){let{startValue:e=[0],endValue:r=[100]}=t;super(tt(tt({},te(t,r2)),{},{startValue:e,byValue:r.map((t,r)=>t-e[r])}))}}let r4=["startValue","endValue","easing","onChange","onComplete","abort"],r3=(t,e,r,i)=>e+r*(1-Math.cos(t/i*ty)),r9=t=>t&&((e,r,i)=>t(new rs(e).toRgba(),r,i));class r6 extends r${calculate(t){let[e,r,i,n]=this.startValue.map((e,r)=>this.easing(t,e,this.byValue[r],this.duration,r)),s=[...[e,r,i].map(Math.round),rX(0,n,1)];return{value:s,valueProgress:s.map((t,e)=>0!==this.byValue[e]?Math.abs((t-this.startValue[e])/this.byValue[e]):0).find(t=>0!==t)||0}}constructor(t){let{startValue:e,endValue:r,easing:i=r3,onChange:n,onComplete:s,abort:o}=t,a=te(t,r4),l=new rs(e).getSource();super(tt(tt({},a),{},{startValue:l,byValue:new rs(r).getSource().map((t,e)=>t-l[e]),easing:i,onChange:r9(n),onComplete:r9(s),abort:r9(o)}))}}function r8(t){let e=Array.isArray(t.startValue)||Array.isArray(t.endValue)?new r5(t):new r1(t);return e.start(),e}function r7(t){let e=new r6(t);return e.start(),e}class it{includes(t){return this.points.some(e=>e.eq(t))}append(){for(var t=arguments.length,e=Array(t),r=0;r!this.includes(t))),this}static isPointContained(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.eq(r))return t.eq(e);if(e.x===r.x)return t.x===e.x&&(i||t.y>=Math.min(e.y,r.y)&&t.y<=Math.max(e.y,r.y));if(e.y===r.y)return t.y===e.y&&(i||t.x>=Math.min(e.x,r.x)&&t.x<=Math.max(e.x,r.x));{let n=rj(e,r),s=rj(e,t).divide(n);return i?Math.abs(s.x)===Math.abs(s.y):s.x===s.y&&s.x>=0&&s.x<=1}}static isPointInPolygon(t,e){let r=new tJ(t).setX(Math.min(t.x-1,...e.map(t=>t.x))),i=0;for(let n=0;n4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=e.x-t.x,a=e.y-t.y,l=i.x-r.x,h=i.y-r.y,c=t.x-r.x,u=t.y-r.y,d=l*u-h*c,f=o*u-a*c,g=h*o-l*a;if(0!==g){let e=d/g,r=f/g;return(n||0<=e&&e<=1)&&(s||0<=r&&r<=1)?new it("Intersection").append(new tJ(t.x+e*o,t.y+e*a)):new it}if(0===d||0===f){let o=n||s||it.isPointContained(t,r,i)||it.isPointContained(e,r,i)||it.isPointContained(r,t,e)||it.isPointContained(i,t,e);return new it(o?"Coincident":void 0)}return new it("Parallel")}static intersectSegmentLine(t,e,r,i){return it.intersectLineLine(t,e,r,i,!1,!0)}static intersectSegmentSegment(t,e,r,i){return it.intersectLineLine(t,e,r,i,!1,!1)}static intersectLinePolygon(t,e,r){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=new it,s=r.length;for(let o,a,l,h=0;h0&&(n.status="Intersection"),n}static intersectSegmentPolygon(t,e,r){return it.intersectLinePolygon(t,e,r,!1)}static intersectPolygonPolygon(t,e){let r=new it,i=t.length,n=[];for(let s=0;s0&&n.length===t.length?new it("Coincident"):(r.points.length>0&&(r.status="Intersection"),r)}static intersectPolygonRectangle(t,e,r){let i=e.min(r),n=e.max(r),s=new tJ(n.x,i.y),o=new tJ(i.x,n.y);return it.intersectPolygonPolygon(t,[i,s,n,o])}constructor(t){this.status=t,this.points=[]}}class ie extends t1{getX(){return this.getXY().x}setX(t){this.setXY(this.getXY().setX(t))}getY(){return this.getXY().y}setY(t){this.setXY(this.getXY().setY(t))}getRelativeX(){return this.left}setRelativeX(t){this.left=t}getRelativeY(){return this.top}setRelativeY(t){this.top=t}getXY(){let t=this.getRelativeXY();return this.group?en(t,this.group.calcTransformMatrix()):t}setXY(t,e,r){this.group&&(t=en(t,es(this.group.calcTransformMatrix()))),this.setRelativeXY(t,e,r)}getRelativeXY(){return new tJ(this.left,this.top)}setRelativeXY(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.originX,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.originY;this.setPositionByOrigin(t,e,r)}isStrokeAccountedForInDimensions(){return!1}getCoords(){let{tl:t,tr:e,br:r,bl:i}=this.aCoords||(this.aCoords=this.calcACoords()),n=[t,e,r,i];if(this.group){let t=this.group.calcTransformMatrix();return n.map(e=>en(e,t))}return n}intersectsWithRect(t,e){return"Intersection"===it.intersectPolygonRectangle(this.getCoords(),t,e).status}intersectsWithObject(t){let e=it.intersectPolygonPolygon(this.getCoords(),t.getCoords());return"Intersection"===e.status||"Coincident"===e.status||t.isContainedWithinObject(this)||this.isContainedWithinObject(t)}isContainedWithinObject(t){return this.getCoords().every(e=>t.containsPoint(e))}isContainedWithinRect(t,e){let{left:r,top:i,width:n,height:s}=this.getBoundingRect();return r>=t.x&&r+n<=e.x&&i>=t.y&&i+s<=e.y}isOverlapping(t){return this.intersectsWithObject(t)||this.isContainedWithinObject(t)||t.isContainedWithinObject(this)}containsPoint(t){return it.isPointInPolygon(t,this.getCoords())}isOnScreen(){if(!this.canvas)return!1;let{tl:t,br:e}=this.canvas.vptCoords;return!!this.getCoords().some(r=>r.x<=e.x&&r.x>=t.x&&r.y<=e.y&&r.y>=t.y)||!!this.intersectsWithRect(t,e)||this.containsPoint(t.midPointFrom(e))}isPartiallyOnScreen(){if(!this.canvas)return!1;let{tl:t,br:e}=this.canvas.vptCoords;return!!this.intersectsWithRect(t,e)||this.getCoords().every(r=>(r.x>=e.x||r.x<=t.x)&&(r.y>=e.y||r.y<=t.y))&&this.containsPoint(t.midPointFrom(e))}getBoundingRect(){return eH(this.getCoords())}getScaledWidth(){return this._getTransformedDimensions().x}getScaledHeight(){return this._getTransformedDimensions().y}scale(t){this._set(tI,t),this._set(tB,t),this.setCoords()}scaleToWidth(t){let e=this.getBoundingRect().width/this.getScaledWidth();return this.scale(t/this.width/e)}scaleToHeight(t){let e=this.getBoundingRect().height/this.getScaledHeight();return this.scale(t/this.height/e)}getCanvasRetinaScaling(){var t;return(null==(t=this.canvas)?void 0:t.getRetinaScaling())||1}getTotalAngle(){return this.group?er(el(this.calcTransformMatrix())):this.angle}getViewportTransform(){var t;return(null==(t=this.canvas)?void 0:t.viewportTransform)||t_.concat()}calcACoords(){let t=eu({angle:this.angle}),{x:e,y:r}=this.getRelativeCenterPoint(),i=eo(ec(e,r),t),n=this._getTransformedDimensions(),s=n.x/2,o=n.y/2;return{tl:en({x:-s,y:-o},i),tr:en({x:s,y:-o},i),bl:en({x:-s,y:o},i),br:en({x:s,y:o},i)}}setCoords(){this.aCoords=this.calcACoords()}transformMatrixKey(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=[];return!t&&this.group&&(e=this.group.transformMatrixKey(t)),e.push(this.top,this.left,this.width,this.height,this.scaleX,this.scaleY,this.angle,this.strokeWidth,this.skewX,this.skewY,+this.flipX,+this.flipY,e1(this.originX),e1(this.originY)),e}calcTransformMatrix(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.calcOwnMatrix();if(t||!this.group)return e;let r=this.transformMatrixKey(t),i=this.matrixCache;return i&&i.key.every((t,e)=>t===r[e])?i.value:(this.group&&(e=eo(this.group.calcTransformMatrix(!1),e)),this.matrixCache={key:r,value:e},e)}calcOwnMatrix(){let t=this.transformMatrixKey(!0),e=this.ownMatrixCache;if(e&&e.key===t)return e.value;let r=this.getRelativeCenterPoint(),i=ev({angle:this.angle,translateX:r.x,translateY:r.y,scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY});return this.ownMatrixCache={key:t,value:i},i}_getNonTransformedDimensions(){return new tJ(this.width,this.height).scalarAdd(this.strokeWidth)}_calculateCurrentDimensions(t){return this._getTransformedDimensions(t).transform(this.getViewportTransform(),!0).scalarAdd(2*this.padding)}_getTransformedDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=tt({scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,width:this.width,height:this.height,strokeWidth:this.strokeWidth},t),r=e.strokeWidth,i=r,n=0;this.strokeUniform&&(i=0,n=r);let s=e.width+i,o=e.height+i;return(0===e.skewX&&0===e.skewY?new tJ(s*e.scaleX,o*e.scaleY):eq(s,o,em(e))).scalarAdd(n)}translateToGivenOrigin(t,e,r,i,n){let s=t.x,o=t.y,a=e1(i)-e1(e),l=e1(n)-e1(r);if(a||l){let t=this._getTransformedDimensions();s+=a*t.x,o+=l*t.y}return new tJ(s,o)}translateToCenterPoint(t,e,r){if(e===tw&&r===tw)return t;let i=this.translateToGivenOrigin(t,e,r,tw,tw);return this.angle?i.rotate(ee(this.angle),t):i}translateToOriginPoint(t,e,r){let i=this.translateToGivenOrigin(t,tw,tw,e,r);return this.angle?i.rotate(ee(this.angle),t):i}getCenterPoint(){let t=this.getRelativeCenterPoint();return this.group?en(t,this.group.calcTransformMatrix()):t}getRelativeCenterPoint(){return this.translateToCenterPoint(new tJ(this.left,this.top),this.originX,this.originY)}getPointByOrigin(t,e){return this.translateToOriginPoint(this.getRelativeCenterPoint(),t,e)}setPositionByOrigin(t,e,r){let i=this.translateToCenterPoint(t,e,r),n=this.translateToOriginPoint(i,this.originX,this.originY);this.set({left:n.x,top:n.y})}_getLeftTopCoords(){return this.translateToOriginPoint(this.getRelativeCenterPoint(),tC,"top")}}let ir=["type"],ii=["extraParam"],is=class t extends ie{static getDefaults(){return t.ownDefaults}get type(){let t=this.constructor.type;return"FabricObject"===t?"object":t.toLowerCase()}set type(t){ts("warn","Setting type has no effect",t)}_createCacheCanvas(){this._cacheCanvas=t9(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0}_limitCacheSize(t){let e=t.width,r=t.height,i=tn.maxCacheSideLimit,n=tn.minCacheSideLimit;if(e<=i&&r<=i&&e*r<=tn.perfLimitSizeTotal)return ea&&(t.zoomX/=e/a,t.width=a,t.capped=!0),r>l&&(t.zoomY/=r/l,t.height=l,t.capped=!0),t}_getCacheCanvasDimensions(){let t=this.getTotalObjectScaling(),e=this._getTransformedDimensions({skewX:0,skewY:0}),r=e.x*t.x/this.scaleX,i=e.y*t.y/this.scaleY;return{width:Math.ceil(r+2),height:Math.ceil(i+2),zoomX:t.x,zoomY:t.y,x:r,y:i}}_updateCacheCanvas(){let t=this._cacheCanvas,e=this._cacheContext,{width:r,height:i,zoomX:n,zoomY:s,x:o,y:a}=this._limitCacheSize(this._getCacheCanvasDimensions()),l=r!==t.width||i!==t.height,h=this.zoomX!==n||this.zoomY!==s;if(!t||!e)return!1;if(l||h){r!==t.width||i!==t.height?(t.width=r,t.height=i):(e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height));let l=o/2,h=a/2;return this.cacheTranslationX=Math.round(t.width/2-l)+l,this.cacheTranslationY=Math.round(t.height/2-h)+h,e.translate(this.cacheTranslationX,this.cacheTranslationY),e.scale(n,s),this.zoomX=n,this.zoomY=s,!0}return!1}setOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setOptions(t)}transform(t){let e=this.group&&!this.group._transformDone||this.group&&this.canvas&&t===this.canvas.contextTop,r=this.calcTransformMatrix(!e);t.transform(r[0],r[1],r[2],r[3],r[4],r[5])}getObjectScaling(){if(!this.group)return new tJ(Math.abs(this.scaleX),Math.abs(this.scaleY));let t=eh(this.calcTransformMatrix());return new tJ(Math.abs(t.scaleX),Math.abs(t.scaleY))}getTotalObjectScaling(){let t=this.getObjectScaling();if(this.canvas){let e=this.canvas.getZoom(),r=this.getCanvasRetinaScaling();return t.scalarMultiply(e*r)}return t}getObjectOpacity(){let t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t}_constrainScale(t){return Math.abs(t){t.transform(i)}),e.parentClipPaths.push(t),t.absolutePositioned){let t=es(this.calcTransformMatrix());i.transform(t[0],t[1],t[2],t[3],t[4],t[5])}return t.transform(i),t.drawObject(i,!0,e),r}_drawClipPath(t,e,r){if(!e)return;e._transformDone=!0;let i=this.createClipPathLayer(e,r);this.drawClipPathOnCache(t,e,i)}drawCacheOnCanvas(t){t.scale(1/this.zoomX,1/this.zoomY),t.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)}isCacheDirty(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isNotVisible())return!1;let e=this._cacheCanvas,r=this._cacheContext;return!(!e||!r||t||!this._updateCacheCanvas())||!!(this.dirty||this.clipPath&&this.clipPath.absolutePositioned)&&(e&&r&&!t&&(r.save(),r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,e.width,e.height),r.restore()),!0)}_renderBackground(t){if(!this.backgroundColor)return;let e=this._getNonTransformedDimensions();t.fillStyle=this.backgroundColor,t.fillRect(-e.x/2,-e.y/2,e.x,e.y),this._removeShadow(t)}_setOpacity(t){this.group&&!this.group._transformDone?t.globalAlpha=this.getObjectOpacity():t.globalAlpha*=this.opacity}_setStrokeStyles(t,e){let r=e.stroke;r&&(t.lineWidth=e.strokeWidth,t.lineCap=e.strokeLineCap,t.lineDashOffset=e.strokeDashOffset,t.lineJoin=e.strokeLineJoin,t.miterLimit=e.strokeMiterLimit,eT(r)?"percentage"===r.gradientUnits||r.gradientTransform||r.patternTransform?this._applyPatternForTransformedGradient(t,r):(t.strokeStyle=r.toLive(t),this._applyPatternGradientTransform(t,r)):t.strokeStyle=e.stroke)}_setFillStyles(t,e){let{fill:r}=e;r&&(eT(r)?(t.fillStyle=r.toLive(t),this._applyPatternGradientTransform(t,r)):t.fillStyle=r)}_setClippingProperties(t){t.globalAlpha=1,t.strokeStyle="transparent",t.fillStyle="#000000"}_setLineDash(t,e){e&&0!==e.length&&t.setLineDash(e)}_setShadow(t){if(!this.shadow)return;let e=this.shadow,r=this.canvas,i=this.getCanvasRetinaScaling(),[n,,,s]=(null==r?void 0:r.viewportTransform)||t_,o=n*i,a=s*i,l=e.nonScaling?new tJ(1,1):this.getObjectScaling();t.shadowColor=e.color,t.shadowBlur=e.blur*tn.browserShadowBlurConstant*(o+a)*(l.x+l.y)/4,t.shadowOffsetX=e.offsetX*o*l.x,t.shadowOffsetY=e.offsetY*a*l.y}_removeShadow(t){this.shadow&&(t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0)}_applyPatternGradientTransform(t,e){if(!eT(e))return{offsetX:0,offsetY:0};let r=e.gradientTransform||e.patternTransform,i=-this.width/2+e.offsetX||0,n=-this.height/2+e.offsetY||0;return"percentage"===e.gradientUnits?t.transform(this.width,0,0,this.height,i,n):t.transform(1,0,0,1,i,n),r&&t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),{offsetX:i,offsetY:n}}_renderPaintInOrder(t){this.paintFirst===tH?(this._renderStroke(t),this._renderFill(t)):(this._renderFill(t),this._renderStroke(t))}_render(t){}_renderFill(t){this.fill&&(t.save(),this._setFillStyles(t,this),"evenodd"===this.fillRule?t.fill("evenodd"):t.fill(),t.restore())}_renderStroke(t){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this.strokeUniform){let e=this.getObjectScaling();t.scale(1/e.x,1/e.y)}this._setLineDash(t,this.strokeDashArray),this._setStrokeStyles(t,this),t.stroke(),t.restore()}}_applyPatternForTransformedGradient(t,e){var r;let i=this._limitCacheSize(this._getCacheCanvasDimensions()),n=this.getCanvasRetinaScaling(),s=i.x/this.scaleX/n,o=i.y/this.scaleY/n,a=t8({width:Math.ceil(s),height:Math.ceil(o)}),l=a.getContext("2d");l&&(l.beginPath(),l.moveTo(0,0),l.lineTo(s,0),l.lineTo(s,o),l.lineTo(0,o),l.closePath(),l.translate(s/2,o/2),l.scale(i.zoomX/this.scaleX/n,i.zoomY/this.scaleY/n),this._applyPatternGradientTransform(l,e),l.fillStyle=e.toLive(t),l.fill(),t.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),t.scale(n*this.scaleX/i.zoomX,n*this.scaleY/i.zoomY),t.strokeStyle=null!=(r=l.createPattern(a,"no-repeat"))?r:"")}_findCenterFromElement(){return new tJ(this.left+this.width/2,this.top+this.height/2)}clone(t){let e=this.toObject(t);return this.constructor.fromObject(e)}cloneAsImage(t){let e=this.toCanvasElement(t);return new(tY.getClass("image"))(e)}toCanvasElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=eG(this),r=this.group,i=this.shadow,n=Math.abs,s=t.enableRetinaScaling?tg():1,o=(t.multiplier||1)*s,a=t.canvasProvider||(t=>new eI(t,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1}));delete this.group,t.withoutTransform&&ez(this),t.withoutShadow&&(this.shadow=null),t.viewportTransform&&eZ(this,this.getViewportTransform()),this.setCoords();let l=t9(),h=this.getBoundingRect(),c=this.shadow,u=new tJ;if(c){let t=c.blur,e=c.nonScaling?new tJ(1,1):this.getObjectScaling();u.x=2*Math.round(n(c.offsetX)+t)*n(e.x),u.y=2*Math.round(n(c.offsetY)+t)*n(e.y)}let d=h.width+u.x,f=h.height+u.y;l.width=Math.ceil(d),l.height=Math.ceil(f);let g=a(l);"jpeg"===t.format&&(g.backgroundColor="#fff"),this.setPositionByOrigin(new tJ(g.width/2,g.height/2),tw,tw);let p=this.canvas;g._objects=[this],this.set("canvas",g),this.setCoords();let m=g.toCanvasElement(o||1,t);return this.set("canvas",p),this.shadow=i,r&&(this.group=r),this.set(e),this.setCoords(),g._objects=[],g.destroy(),m}toDataURL(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t7(this.toCanvasElement(t),t.format||"png",t.quality||1)}toBlob(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return et(this.toCanvasElement(t),t.format||"png",t.quality||1)}isType(){for(var t=arguments.length,e=Array(t),r=0;r{let[i,n]=r;return t[i]=this._animate(i,n,e),t},{})}_animate(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.split("."),n=this.constructor.colorProperties.includes(i[i.length-1]),{abort:s,startValue:o,onChange:a,onComplete:l}=r,h=tt(tt({},r),{},{target:this,startValue:null!=o?o:i.reduce((t,e)=>t[e],this),endValue:e,abort:null==s?void 0:s.bind(this),onChange:(t,e,r)=>{i.reduce((e,r,n)=>(n===i.length-1&&(e[r]=t),e[r]),this),a&&a(t,e,r)},onComplete:(t,e,r)=>{this.setCoords(),l&&l(t,e,r)}});return n?r7(h):r8(h)}isDescendantOf(t){let{parent:e,group:r}=this;return e===t||r===t||!!e&&e.isDescendantOf(t)||!!r&&r!==e&&r.isDescendantOf(t)}getAncestors(){let t=[],e=this;do(e=e.parent)&&t.push(e);while(e)return t}findCommonAncestors(t){if(this===t)return{fork:[],otherFork:[],common:[this,...this.getAncestors()]};let e=this.getAncestors(),r=t.getAncestors();if(0===e.length&&r.length>0&&this===r[r.length-1])return{fork:[],otherFork:[t,...r.slice(0,r.length-1)],common:[this]};for(let i,n=0;n-1&&s>o}toObject(){let e,r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).concat(t.customProperties,this.constructor.customProperties||[]),i=tn.NUM_FRACTION_DIGITS,{clipPath:n,fill:s,stroke:o,shadow:a,strokeDashArray:l,left:h,top:c,originX:u,originY:d,width:f,height:g,strokeWidth:p,strokeLineCap:m,strokeDashOffset:y,strokeLineJoin:x,strokeUniform:b,strokeMiterLimit:_,scaleX:w,scaleY:C,angle:S,flipX:T,flipY:O,opacity:k,visible:M,backgroundColor:E,fillRule:D,paintFirst:j,globalCompositeOperation:A,skewX:P,skewY:F}=this;n&&!n.excludeFromExport&&(e=n.toObject(r.concat("inverted","absolutePositioned")));let L=t=>eC(t,i),R=tt(tt({},e_(this,r)),{},{type:this.constructor.type,version:tm,originX:u,originY:d,left:L(h),top:L(c),width:L(f),height:L(g),fill:eO(s)?s.toObject():s,stroke:eO(o)?o.toObject():o,strokeWidth:L(p),strokeDashArray:l?l.concat():l,strokeLineCap:m,strokeDashOffset:y,strokeLineJoin:x,strokeUniform:b,strokeMiterLimit:L(_),scaleX:L(w),scaleY:L(C),angle:L(S),flipX:T,flipY:O,opacity:L(k),shadow:a?a.toObject():a,visible:M,backgroundColor:E,fillRule:D,paintFirst:j,globalCompositeOperation:A,skewX:L(P),skewY:L(F)},e?{clipPath:e}:null);return this.includeDefaultValues?R:this._removeDefaultValues(R)}toDatalessObject(t){return this.toObject(t)}_removeDefaultValues(t){let e=this.constructor.getDefaults(),r=Object.keys(e).length>0?e:Object.getPrototypeOf(this);return ew(t,(t,e)=>{if(e===tC||"top"===e||"type"===e)return!0;let i=r[e];return t!==i&&!(Array.isArray(t)&&Array.isArray(i)&&0===t.length&&0===i.length)})}toString(){return"#<".concat(this.constructor.type,">")}static _fromObject(t){let e=te(t,ir),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{extraParam:i}=r;return eb(e,te(r,ii)).then(t=>i?(delete t[i],new this(e[i],t)):new this(t))}static fromObject(t,e){return this._fromObject(t,e)}constructor(e){super(),Z(this,"_cacheContext",null),Object.assign(this,t.ownDefaults),this.setOptions(e)}};Z(is,"stateProperties",rV),Z(is,"cacheProperties",rY),Z(is,"ownDefaults",{top:0,left:0,width:0,height:0,angle:0,flipX:!1,flipY:!1,scaleX:1,scaleY:1,minScaleLimit:0,skewX:0,skewY:0,originX:tC,originY:"top",strokeWidth:1,strokeUniform:!1,padding:0,opacity:1,paintFirst:tU,fill:"rgb(0,0,0)",fillRule:"nonzero",stroke:null,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,globalCompositeOperation:"source-over",backgroundColor:"",shadow:null,visible:!0,includeDefaultValues:!0,excludeFromExport:!1,objectCaching:!0,clipPath:void 0,inverted:!1,absolutePositioned:!1,centeredRotation:!0,centeredScaling:!1,dirty:!0}),Z(is,"type","FabricObject"),Z(is,"colorProperties",[tU,tH,"backgroundColor"]),Z(is,"customProperties",[]),tY.setClass(is),tY.setClass(is,"object");let io=(t,e,r)=>(i,n,s,o)=>{let a=e(i,n,s,o);return a&&e$(t,tt(tt({},e3(i,n,s,o)),r)),a};function ia(t){return(e,r,i,n)=>{let{target:s,originX:o,originY:a}=r,l=s.getRelativeCenterPoint(),h=s.translateToOriginPoint(l,o,a),c=t(e,r,i,n);return s.setPositionByOrigin(h,r.originX,r.originY),c}}let il=io(tP,ia((t,e,r,i)=>{let n=e6(e,e.originX,e.originY,r,i);if(e1(e.originX)===e1(tw)||e1(e.originX)===e1(tT)&&n.x<0||e1(e.originX)===e1(tC)&&n.x>0){let{target:t}=e,r=t.strokeWidth/(t.strokeUniform?t.scaleX:1),i=e5(e)?2:1,s=t.width,o=Math.abs(n.x*i/t.scaleX)-r;return t.set("width",Math.max(o,1)),s!==t.width}return!1}));function ih(t,e,r,i,n){i=i||{};let s=this.sizeX||i.cornerSize||n.cornerSize,o=this.sizeY||i.cornerSize||n.cornerSize,a=void 0!==i.transparentCorners?i.transparentCorners:n.transparentCorners,l=a?tH:tU,h=!a&&(i.cornerStrokeColor||n.cornerStrokeColor),c,u=e,d=r;t.save(),t.fillStyle=i.cornerColor||n.cornerColor||"",t.strokeStyle=i.cornerStrokeColor||n.cornerStrokeColor||"",s>o?(c=s,t.scale(1,o/s),d=r*s/o):o>s?(c=o,t.scale(s/o,1),u=e*o/s):c=s,t.beginPath(),t.arc(u,d,c/2,0,tx,!1),t[l](),h&&t.stroke(),t.restore()}function ic(t,e,r,i,n){i=i||{};let s=this.sizeX||i.cornerSize||n.cornerSize,o=this.sizeY||i.cornerSize||n.cornerSize,a=void 0!==i.transparentCorners?i.transparentCorners:n.transparentCorners,l=a?tH:tU,h=!a&&(i.cornerStrokeColor||n.cornerStrokeColor),c=s/2,u=o/2;t.save(),t.fillStyle=i.cornerColor||n.cornerColor||"",t.strokeStyle=i.cornerStrokeColor||n.cornerStrokeColor||"",t.translate(e,r);let d=n.getTotalAngle();t.rotate(ee(d)),t["".concat(l,"Rect")](-c,-u,s,o),h&&t.strokeRect(-c,-u,s,o),t.restore()}class iu{shouldActivate(t,e,r,i){var n;let{tl:s,tr:o,br:a,bl:l}=i;return(null==(n=e.canvas)?void 0:n.getActiveObject())===e&&e.isControlVisible(t)&&it.isPointInPolygon(r,[s,o,a,l])}getActionHandler(t,e,r){return this.actionHandler}getMouseDownHandler(t,e,r){return this.mouseDownHandler}getMouseUpHandler(t,e,r){return this.mouseUpHandler}cursorStyleHandler(t,e,r){return e.cursorStyle}getActionName(t,e,r){return e.actionName}getVisibility(t,e){var r,i;return null!=(r=null==(i=t._controlsVisibility)?void 0:i[e])?r:this.visible}setVisibility(t,e,r){this.visible=t}positionHandler(t,e,r,i){return new tJ(this.x*t.x+this.offsetX,this.y*t.y+this.offsetY).transform(e)}calcCornerCoords(t,e,r,i,n,s){let o=ea([ec(r,i),eu({angle:t}),ed((n?this.touchSizeX:this.sizeX)||e,(n?this.touchSizeY:this.sizeY)||e)]);return{tl:new tJ(-.5,-.5).transform(o),tr:new tJ(.5,-.5).transform(o),br:new tJ(.5,.5).transform(o),bl:new tJ(-.5,.5).transform(o)}}render(t,e,r,i,n){"circle"===((i=i||{}).cornerStyle||n.cornerStyle)?ih.call(this,t,e,r,i,n):ic.call(this,t,e,r,i,n)}constructor(t){Z(this,"visible",!0),Z(this,"actionName",tR),Z(this,"angle",0),Z(this,"x",0),Z(this,"y",0),Z(this,"offsetX",0),Z(this,"offsetY",0),Z(this,"sizeX",0),Z(this,"sizeY",0),Z(this,"touchSizeX",0),Z(this,"touchSizeY",0),Z(this,"cursorStyle","crosshair"),Z(this,"withConnection",!1),Object.assign(this,t)}}let id=(t,e,r)=>r.lockRotation?e2:e.cursorStyle,ig=io(tD,ia((t,e,r,i)=>{let{target:n,ex:s,ey:o,theta:a,originX:l,originY:h}=e,c=n.translateToOriginPoint(n.getRelativeCenterPoint(),l,h);if(e4(n,"lockRotation"))return!1;let u=Math.atan2(o-c.y,s-c.x),d=er(Math.atan2(i-c.y,r-c.x)-u+a);if(n.snapAngle&&n.snapAngle>0){let t=n.snapAngle,e=n.snapThreshold||t,r=Math.ceil(d/t)*t,i=Math.floor(d/t)*t;Math.abs(d-i){let i=ip(t,r);if(im(r,0!==e.x&&0===e.y?"x":0===e.x&&0!==e.y?"y":"",i))return e2;let n=e9(r,e);return"".concat(iv[n],"-resize")};function ix(t,e,r,i){let n,s,o,a,l,h,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},u=e.target,d=c.by,f=ip(t,u);if(im(u,d,f))return!1;if(e.gestureScale)s=e.scaleX*e.gestureScale,o=e.scaleY*e.gestureScale;else{if(n=e6(e,e.originX,e.originY,r,i),l="y"!==d?Math.sign(n.x||e.signX||1):1,h="x"!==d?Math.sign(n.y||e.signY||1):1,e.signX||(e.signX=l),e.signY||(e.signY=h),e4(u,"lockScalingFlip")&&(e.signX!==l||e.signY!==h))return!1;if(a=u._getTransformedDimensions(),f&&!d){let t=Math.abs(n.x)+Math.abs(n.y),{original:r}=e,i=t/(Math.abs(a.x*r.scaleX/u.scaleX)+Math.abs(a.y*r.scaleY/u.scaleY));s=r.scaleX*i,o=r.scaleY*i}else s=Math.abs(n.x*u.scaleX/a.x),o=Math.abs(n.y*u.scaleY/a.y);e5(e)&&(s*=2,o*=2),e.signX!==l&&"y"!==d&&(e.originX=.5-e1(e.originX),s*=-1,e.signX=l),e.signY!==h&&"x"!==d&&(e.originY=.5-e1(e.originY),o*=-1,e.signY=h)}let g=u.scaleX,p=u.scaleY;return d?("x"===d&&u.set(tI,s),"y"===d&&u.set(tB,o)):(e4(u,"lockScalingX")||u.set(tI,s),e4(u,"lockScalingY")||u.set(tB,o)),g!==u.scaleX||p!==u.scaleY}let ib=io(tE,ia((t,e,r,i)=>ix(t,e,r,i))),i_=io(tE,ia((t,e,r,i)=>ix(t,e,r,i,{by:"x"}))),iw=io(tE,ia((t,e,r,i)=>ix(t,e,r,i,{by:"y"}))),iC=["target","ex","ey","skewingSide"],iS={x:{counterAxis:"y",scale:tI,skew:tN,lockSkewing:"lockSkewingX",origin:"originX",flip:"flipX"},y:{counterAxis:"x",scale:tB,skew:tW,lockSkewing:"lockSkewingY",origin:"originY",flip:"flipY"}},iT=["ns","nesw","ew","nwse"],iO=(t,e,r)=>{if(0!==e.x&&e4(r,"lockSkewingY")||0!==e.y&&e4(r,"lockSkewingX"))return e2;let i=e9(r,e)%4;return"".concat(iT[i],"-resize")};function ik(t,e,r,i,n){let{target:s}=r,{counterAxis:o,origin:a,lockSkewing:l,skew:h,flip:c}=iS[t];if(e4(s,l))return!1;let{origin:u,flip:d}=iS[o],f=-Math.sign(e1(r[u])*(s[d]?-1:1))*(s[c]?-1:1),g=-(.5*((0===s[h]&&e6(r,tw,tw,i,n)[t]>0||s[h]>0?1:-1)*f))+.5;return io(tA,ia((e,r,i,n)=>(function(t,e,r){let{target:i,ex:n,ey:s,skewingSide:o}=e,a=te(e,iC),{skew:l}=iS[t],h=r.subtract(new tJ(n,s)).divide(new tJ(i.scaleX,i.scaleY))[t],c=i[l],u=Math.tan(ee(a[l])),d=er(Math.atan(2*h*o/Math.max("y"===t?i._getTransformedDimensions({scaleX:1,scaleY:1,skewX:0}).x:i._getTransformedDimensions({scaleX:1,scaleY:1}).y,1)+u));i.set(l,d);let f=c!==i[l];if(f&&"y"===t){let{skewX:t,scaleX:e}=i,r=i._getTransformedDimensions({skewY:c}),n=i._getTransformedDimensions(),s=0!==t?r.x/n.x:1;1!==s&&i.set(tI,s*e)}return f})(t,r,new tJ(i,n))))(e,tt(tt({},r),{},{[a]:g,skewingSide:f}),i,n)}let iM=(t,e,r,i)=>ik("x",t,e,r,i),iE=(t,e,r,i)=>ik("y",t,e,r,i);function iD(t,e){return t[e.canvas.altActionKey]}let ij=(t,e,r)=>{let i=iD(t,r);return 0===e.x?i?tN:tB:0===e.y?i?tW:tI:""},iA=(t,e,r)=>iD(t,r)?iO(0,e,r):iy(t,e,r),iP=(t,e,r,i)=>iD(t,e.target)?iE(t,e,r,i):i_(t,e,r,i),iF=(t,e,r,i)=>iD(t,e.target)?iM(t,e,r,i):iw(t,e,r,i),iL=()=>({ml:new iu({x:-.5,y:0,cursorStyleHandler:iA,actionHandler:iP,getActionName:ij}),mr:new iu({x:.5,y:0,cursorStyleHandler:iA,actionHandler:iP,getActionName:ij}),mb:new iu({x:0,y:.5,cursorStyleHandler:iA,actionHandler:iF,getActionName:ij}),mt:new iu({x:0,y:-.5,cursorStyleHandler:iA,actionHandler:iF,getActionName:ij}),tl:new iu({x:-.5,y:-.5,cursorStyleHandler:iy,actionHandler:ib}),tr:new iu({x:.5,y:-.5,cursorStyleHandler:iy,actionHandler:ib}),bl:new iu({x:-.5,y:.5,cursorStyleHandler:iy,actionHandler:ib}),br:new iu({x:.5,y:.5,cursorStyleHandler:iy,actionHandler:ib}),mtr:new iu({x:0,y:-.5,actionHandler:ig,cursorStyleHandler:id,offsetY:-40,withConnection:!0,actionName:tj})}),iR=()=>({mr:new iu({x:.5,y:0,actionHandler:il,cursorStyleHandler:iA,actionName:tP}),ml:new iu({x:-.5,y:0,actionHandler:il,cursorStyleHandler:iA,actionName:tP})}),iI=()=>tt(tt({},iL()),iR());class iB extends is{static getDefaults(){return tt(tt({},super.getDefaults()),iB.ownDefaults)}static createControls(){return{controls:iL()}}_updateCacheCanvas(){let t=this.canvas;if(this.noScaleCache&&t&&t._currentTransform){let e=t._currentTransform,r=e.target,i=e.action;if(this===r&&i&&i.startsWith(tR))return!1}return super._updateCacheCanvas()}getActiveControl(){let t=this.__corner;return t?{key:t,control:this.controls[t],coord:this.oCoords[t]}:void 0}findControl(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasControls||!this.canvas)return;this.__corner=void 0;let r=Object.entries(this.oCoords);for(let i=r.length-1;i>=0;i--){let[n,s]=r[i],o=this.controls[n];if(o.shouldActivate(n,this,t,e?s.touchCorner:s.corner))return this.__corner=n,{key:n,control:o,coord:this.oCoords[n]}}}calcOCoords(){let t=this.getViewportTransform(),e=this.getCenterPoint(),r=eo(ec(e.x,e.y),eu({angle:this.getTotalAngle()-(this.group&&this.flipX?180:0)})),i=eo(t,r),n=eo(i,[1/t[0],0,0,1/t[3],0,0]),s=this.group?eh(this.calcTransformMatrix()):void 0;s&&(s.scaleX=Math.abs(s.scaleX),s.scaleY=Math.abs(s.scaleY));let o=this._calculateCurrentDimensions(s),a={};return this.forEachControl((t,e)=>{let r=t.positionHandler(o,n,this,t);a[e]=Object.assign(r,this._calcCornerCoords(t,r))}),a}_calcCornerCoords(t,e){let r=this.getTotalAngle();return{corner:t.calcCornerCoords(r,this.cornerSize,e.x,e.y,!1,this),touchCorner:t.calcCornerCoords(r,this.touchCornerSize,e.x,e.y,!0,this)}}setCoords(){super.setCoords(),this.canvas&&(this.oCoords=this.calcOCoords())}forEachControl(t){for(let e in this.controls)t(this.controls[e],e,this)}drawSelectionBackground(t){if(!this.selectionBackgroundColor||this.canvas&&this.canvas._activeObject!==this)return;t.save();let e=this.getRelativeCenterPoint(),r=this._calculateCurrentDimensions(),i=this.getViewportTransform();t.translate(e.x,e.y),t.scale(1/i[0],1/i[3]),t.rotate(ee(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-r.x/2,-r.y/2,r.x,r.y),t.restore()}strokeBorders(t,e){t.strokeRect(-e.x/2,-e.y/2,e.x,e.y)}_drawBorders(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=tt({hasControls:this.hasControls,borderColor:this.borderColor,borderDashArray:this.borderDashArray},r);t.save(),t.strokeStyle=i.borderColor,this._setLineDash(t,i.borderDashArray),this.strokeBorders(t,e),i.hasControls&&this.drawControlsConnectingLines(t,e),t.restore()}_renderControls(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{hasBorders:r,hasControls:i}=this,n=tt({hasBorders:r,hasControls:i},e),s=this.getViewportTransform(),o=n.hasBorders,a=n.hasControls,l=eh(eo(s,this.calcTransformMatrix()));t.save(),t.translate(l.translateX,l.translateY),t.lineWidth=this.borderScaleFactor,this.group===this.parent&&(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(l.angle-=180),t.rotate(ee(this.group?l.angle:this.angle)),o&&this.drawBorders(t,l,e),a&&this.drawControls(t,e),t.restore()}drawBorders(t,e,r){let i;if(r&&r.forActiveSelection||this.group){let t=eq(this.width,this.height,em(e)),r=this.isStrokeAccountedForInDimensions()?tZ:(this.strokeUniform?(new tJ).scalarAdd(this.canvas?this.canvas.getZoom():1):new tJ(e.scaleX,e.scaleY)).scalarMultiply(this.strokeWidth);i=t.add(r).scalarAdd(this.borderScaleFactor).scalarAdd(2*this.padding)}else i=this._calculateCurrentDimensions().scalarAdd(this.borderScaleFactor);this._drawBorders(t,i,r)}drawControlsConnectingLines(t,e){let r=!1;t.beginPath(),this.forEachControl((i,n)=>{i.withConnection&&i.getVisibility(this,n)&&(r=!0,t.moveTo(i.x*e.x,i.y*e.y),t.lineTo(i.x*e.x+i.offsetX,i.y*e.y+i.offsetY))}),r&&t.stroke()}drawControls(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.save();let r=this.getCanvasRetinaScaling(),{cornerStrokeColor:i,cornerDashArray:n,cornerColor:s}=this,o=tt({cornerStrokeColor:i,cornerDashArray:n,cornerColor:s},e);t.setTransform(r,0,0,r,0,0),t.strokeStyle=t.fillStyle=o.cornerColor,this.transparentCorners||(t.strokeStyle=o.cornerStrokeColor),this._setLineDash(t,o.cornerDashArray),this.forEachControl((e,r)=>{if(e.getVisibility(this,r)){let i=this.oCoords[r];e.render(t,i.x,i.y,o,this)}}),t.restore()}isControlVisible(t){return this.controls[t]&&this.controls[t].getVisibility(this,t)}setControlVisible(t,e){this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[t]=e}setControlsVisibility(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.entries(t).forEach(t=>{let[e,r]=t;return this.setControlVisible(e,r)})}clearContextTop(t){if(!this.canvas)return;let e=this.canvas.contextTop;if(!e)return;let r=this.canvas.viewportTransform;e.save(),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this.transform(e);let i=this.width+4,n=this.height+4;return e.clearRect(-i/2,-n/2,i,n),t||e.restore(),e}onDeselect(t){return!1}onSelect(t){return!1}shouldStartDragging(t){return!1}onDragStart(t){return!1}canDrop(t){return!1}renderDragSourceEffect(t){}renderDropTargetEffect(t){}constructor(t){super(),Object.assign(this,this.constructor.createControls(),iB.ownDefaults),this.setOptions(t)}}function iN(t,e){return e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(r=>{"constructor"!==r&&Object.defineProperty(t.prototype,r,Object.getOwnPropertyDescriptor(e.prototype,r)||Object.create(null))})}),t}Z(iB,"ownDefaults",{noScaleCache:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,cornerSize:13,touchCornerSize:24,transparentCorners:!0,cornerColor:"rgb(178,204,255)",cornerStrokeColor:"",cornerStyle:"rect",cornerDashArray:null,hasControls:!0,borderColor:"rgb(178,204,255)",borderDashArray:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,hasBorders:!0,selectionBackgroundColor:"",selectable:!0,evented:!0,perPixelTargetFind:!1,activeOn:"down",hoverCursor:null,moveCursor:null});class iW extends iB{}iN(iW,[rh]),tY.setClass(iW),tY.setClass(iW,"object");let iU=(t,e,r,i)=>{let n=2*(i=Math.round(i))+1,{data:s}=t.getImageData(e-i,r-i,n,n);for(let t=3;t0)return!1;return!0};class iH{createSideVector(t,e){let r=rj(t,e);return this.options.strokeUniform?r.multiply(this.scale):r}projectOrthogonally(t,e,r){return this.applySkew(t.add(this.calcOrthogonalProjection(t,e,r)))}isSkewed(){return 0!==this.options.skewX||0!==this.options.skewY}applySkew(t){let e=new tJ(t);return e.y+=e.x*Math.tan(ee(this.options.skewY)),e.x+=e.y*Math.tan(ee(this.options.skewX)),e}scaleUnitVector(t,e){return t.multiply(this.strokeUniformScalar).scalarMultiply(e)}constructor(t){this.options=t,this.strokeProjectionMagnitude=this.options.strokeWidth/2,this.scale=new tJ(this.options.scaleX,this.options.scaleY),this.strokeUniformScalar=this.options.strokeUniform?new tJ(1/this.options.scaleX,1/this.options.scaleY):new tJ(1,1)}}let iX=new tJ;class iV extends iH{static getOrthogonalRotationFactor(t,e){return Math.abs(e?rP(t,e):rF(t))2&&void 0!==arguments[2]?arguments[2]:this.strokeProjectionMagnitude,i=rR(this.createSideVector(t,e)),n=iV.getOrthogonalRotationFactor(i,this.bisector);return this.scaleUnitVector(i,r*n)}projectBevel(){let t=[];return(this.alpha%tx==0?[this.B]:[this.B,this.C]).forEach(e=>{t.push(this.projectOrthogonally(this.A,e)),t.push(this.projectOrthogonally(this.A,e,-this.strokeProjectionMagnitude))}),t}projectMiter(){let t=[],e=1/Math.sin(Math.abs(this.alpha)/2),r=this.scaleUnitVector(this.bisector,-this.strokeProjectionMagnitude*e),i=this.options.strokeUniform?rA(this.scaleUnitVector(this.bisector,this.options.strokeMiterLimit)):this.options.strokeMiterLimit;return rA(r)/this.strokeProjectionMagnitude<=i&&t.push(this.applySkew(this.A.add(r))),t.push(...this.projectBevel()),t}projectRoundNoSkew(t,e){let r=[],i=new tJ(iV.getOrthogonalRotationFactor(this.bisector),iV.getOrthogonalRotationFactor(new tJ(this.bisector.y,this.bisector.x)));return[new tJ(1,0).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i),new tJ(0,1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i)].forEach(i=>{rN(i,t,e)&&r.push(this.A.add(i))}),r}projectRoundWithSkew(t,e){let r=[],{skewX:i,skewY:n,scaleX:s,scaleY:o,strokeUniform:a}=this.options,l=new tJ(Math.tan(ee(i)),Math.tan(ee(n))),h=this.strokeProjectionMagnitude,c=a?h/o/Math.sqrt(1/o**2+1/s**2*l.y**2):h/Math.sqrt(1+l.y**2),u=new tJ(Math.sqrt(Math.max(h**2-c**2,0)),c),d=a?h/Math.sqrt(1+l.x**2*(1/o)**2/(1/s+1/s*l.x*l.y)**2):h/Math.sqrt(1+l.x**2/(1+l.x*l.y)**2),f=new tJ(d,Math.sqrt(Math.max(h**2-d**2,0)));return[f,f.scalarMultiply(-1),u,u.scalarMultiply(-1)].map(t=>this.applySkew(a?t.multiply(this.strokeUniformScalar):t)).forEach(i=>{rN(i,t,e)&&r.push(this.applySkew(this.A).add(i))}),r}projectRound(){let t=[];t.push(...this.projectBevel());let e=this.alpha%tx==0,r=this.applySkew(this.A),i=t[2*!e].subtract(r),n=t[+!!e].subtract(r),s=rI(i,e?this.applySkew(this.AB.scalarMultiply(-1)):this.applySkew(this.bisector.multiply(this.strokeUniformScalar).scalarMultiply(-1)))>0,o=s?i:n,a=s?n:i;return this.isSkewed()?t.push(...this.projectRoundWithSkew(o,a)):t.push(...this.projectRoundNoSkew(o,a)),t}projectPoints(){switch(this.options.strokeLineJoin){case"miter":return this.projectMiter();case"round":return this.projectRound();default:return this.projectBevel()}}project(){return this.projectPoints().map(t=>({originPoint:this.A,projectedPoint:t,angle:this.alpha,bisector:this.bisector}))}constructor(t,e,r,i){super(i),Z(this,"AB",void 0),Z(this,"AC",void 0),Z(this,"alpha",void 0),Z(this,"bisector",void 0),this.A=new tJ(t),this.B=new tJ(e),this.C=new tJ(r),this.AB=this.createSideVector(this.A,this.B),this.AC=this.createSideVector(this.A,this.C),this.alpha=rP(this.AB,this.AC),this.bisector=rL(rD(this.AB.eq(iX)?this.AC:this.AB,this.alpha/2))}}class iY extends iH{calcOrthogonalProjection(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.strokeProjectionMagnitude,i=this.createSideVector(t,e);return this.scaleUnitVector(rR(i),r)}projectButt(){return[this.projectOrthogonally(this.A,this.T,this.strokeProjectionMagnitude),this.projectOrthogonally(this.A,this.T,-this.strokeProjectionMagnitude)]}projectRound(){let t=[];if(!this.isSkewed()&&this.A.eq(this.T)){let e=new tJ(1,1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar);t.push(this.applySkew(this.A.add(e)),this.applySkew(this.A.subtract(e)))}else t.push(...new iV(this.A,this.T,this.T,this.options).projectRound());return t}projectSquare(){let t=[];if(this.A.eq(this.T)){let e=new tJ(1,1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar);t.push(this.A.add(e),this.A.subtract(e))}else{let e=this.calcOrthogonalProjection(this.A,this.T,this.strokeProjectionMagnitude),r=this.scaleUnitVector(rL(this.createSideVector(this.A,this.T)),-this.strokeProjectionMagnitude),i=this.A.add(r);t.push(i.add(e),i.subtract(e))}return t.map(t=>this.applySkew(t))}projectPoints(){switch(this.options.strokeLineCap){case"round":return this.projectRound();case"square":return this.projectSquare();default:return this.projectButt()}}project(){return this.projectPoints().map(t=>({originPoint:this.A,projectedPoint:t}))}constructor(t,e,r){super(r),this.A=new tJ(t),this.T=new tJ(e)}}let iz=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[];if(0===t.length)return i;let n=t.reduce((t,e)=>(t[t.length-1].eq(e)||t.push(new tJ(e)),t),[new tJ(t[0])]);if(1===n.length)r=!0;else if(!r){let t=n[0],e=((t,e)=>{for(let r=t.length-1;r>=0;r--)if(e(t[r],r,t))return r;return -1})(n,e=>!e.eq(t));n.splice(e+1)}return n.forEach((t,n,s)=>{let o,a;0===n?(a=s[1],o=r?t:s[s.length-1]):n===s.length-1?(o=s[n-1],a=r?t:s[0]):(o=s[n-1],a=s[n+1]),r&&1===s.length?i.push(...new iY(t,t,e).project()):r&&(0===n||n===s.length-1)?i.push(...new iY(t,0===n?a:o,e).project()):i.push(...new iV(t,o,a,e).project())}),i},iG=t=>{let e={};return Object.keys(t).forEach(r=>{e[r]={},Object.keys(t[r]).forEach(i=>{e[r][i]=tt({},t[r][i])})}),e},iq=t=>t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"),iK=t=>(r||r||(r="Intl"in tf()&&"Segmenter"in Intl&&new Intl.Segmenter(void 0,{granularity:"grapheme"})),r)?Array.from(r.segment(t)).map(t=>{let{segment:e}=t;return e}):iQ(t),iQ=t=>{let e=[];for(let r,i=0;i{let r=t.charCodeAt(e);if(isNaN(r))return"";if(r<55296||r>57343)return t.charAt(e);if(55296<=r&&r<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";let r=t.charCodeAt(e+1);if(56320>r||r>57343)throw"High surrogate without following low surrogate";return t.charAt(e)+t.charAt(e+1)}if(0===e)throw"Low surrogate without preceding high surrogate";let i=t.charCodeAt(e-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1};var iZ=Object.freeze({__proto__:null,capitalize:function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"".concat(t.charAt(0).toUpperCase()).concat(e?t.slice(1):t.slice(1).toLowerCase())},escapeXml:iq,graphemeSplit:iK});let i$=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.fill!==e.fill||t.stroke!==e.stroke||t.strokeWidth!==e.strokeWidth||t.fontSize!==e.fontSize||t.fontFamily!==e.fontFamily||t.fontWeight!==e.fontWeight||t.fontStyle!==e.fontStyle||t.textDecorationThickness!==e.textDecorationThickness||t.textBackgroundColor!==e.textBackgroundColor||t.deltaY!==e.deltaY||r&&(t.overline!==e.overline||t.underline!==e.underline||t.linethrough!==e.linethrough)},i0=(t,e)=>{let r=e.split("\n"),i=[],n=-1,s={};t=iG(t);for(let e=0;e0&&(i$(s,o,!0)?i.push({start:n,end:n+1,style:o}):i[i.length-1].end++),s=o||{}}else n+=o.length,s={}}return i},i1=(t,e)=>{if(!Array.isArray(t))return iG(t);let r=e.split(tk),i={},n=-1,s=0;for(let e=0;e{var e;return null!=(e=rS[t])?e:t},i3=RegExp("(".concat(r_,")"),"gi"),i9="(".concat(r_,")"),i6=String.raw(l||(l=tr(["(skewX)(",")"],["(skewX)\\(","\\)"])),i9),i8=String.raw(h||(h=tr(["(skewY)(",")"],["(skewY)\\(","\\)"])),i9),i7=String.raw(c||(c=tr(["(rotate)(","(?: "," ",")?)"],["(rotate)\\(","(?: "," ",")?\\)"])),i9,i9,i9),nt=String.raw(u||(u=tr(["(scale)(","(?: ",")?)"],["(scale)\\(","(?: ",")?\\)"])),i9,i9),ne=String.raw(d||(d=tr(["(translate)(","(?: ",")?)"],["(translate)\\(","(?: ",")?\\)"])),i9,i9),nr=String.raw(f||(f=tr(["(matrix)("," "," "," "," "," ",")"],["(matrix)\\("," "," "," "," "," ","\\)"])),i9,i9,i9,i9,i9,i9),ni="(?:".concat(nr,"|").concat(ne,"|").concat(i7,"|").concat(nt,"|").concat(i6,"|").concat(i8,")"),nn=new RegExp(String.raw(g||(g=tr(["^s*(?:","?)s*$"],["^\\s*(?:","?)\\s*$"])),"(?:".concat(ni,"*)"))),ns=new RegExp(ni),no=RegExp(ni,"g");function na(t){let e=[];if(!(t=t.replace(i3," $1 ").replace(/,/gi," ").replace(/\s+/gi," ").replace(/\s*([()])\s*/gi,"$1"))||t&&!nn.test(t))return[...t_];for(let r of t.matchAll(no)){let t=ns.exec(r[0]);if(!t)continue;let i=t_,[,n,...s]=t.filter(t=>!!t),[o,a,l,h,c,u]=s.map(t=>parseFloat(t));switch(n){case"translate":i=ec(o,a);break;case tj:i=eu({angle:o},{x:a,y:l});break;case tR:i=ed(o,a);break;case tN:i=eg(o);break;case tW:i=ep(o);break;case"matrix":i=[o,a,l,h,c,u]}e.push(i)}return ea(e)}let nl={stroke:"strokeOpacity",fill:"fillOpacity"};function nh(t,e,r){if(!t)return{};let i,n={},s=16;t.parentNode&&rk.test(t.parentNode.nodeName)&&(n=nh(t.parentElement,e,r)).fontSize&&(i=s=ro(n.fontSize));let o=tt(tt(tt({},e.reduce((e,r)=>{let i=t.getAttribute(r);return i&&(e[r]=i),e},{})),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};for(let i in e)(function(t,e){let r=!0,i=i5(t,e.pop());return i&&e.length&&(r=function(t,e){let r,i=!0;for(;t.parentElement&&1===t.parentElement.nodeType&&e.length;)i&&(r=e.pop()),i=i5(t=t.parentElement,r);return 0===e.length}(t,e)),i&&r&&0===e.length})(t,i.split(" "))&&(r=tt(tt({},r),e[i]));return r}(t,r)),function(t){let e={},r=t.getAttribute("style");return r&&("string"==typeof r?r.replace(/;\s*$/,"").split(";").forEach(t=>{if(!t)return;let[r,i]=t.split(":");e[r.trim().toLowerCase()]=i.trim()}):Object.entries(r).forEach(t=>{let[r,i]=t;void 0!==i&&(e[r.toLowerCase()]=i)})),e}(t));o[rO]&&t.setAttribute(rO,o[rO]),o[rT]&&(i=ro(o[rT],s),o[rT]="".concat(i));let a={};for(let t in o){let e=i4(t),r=function(t,e,r,i){let n=Array.isArray(e),s,o=e;if(t!==tU&&t!==tH||e!==tO){if("strokeUniform"===t)return"non-scaling-stroke"===e;if("strokeDashArray"===t)o=e===tO?null:e.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===t)o=r&&r.transformMatrix?eo(r.transformMatrix,na(e)):na(e);else if("visible"===t)o=e!==tO&&"hidden"!==e,r&&!1===r.visible&&(o=!1);else if("opacity"===t)o=parseFloat(e),r&&void 0!==r.opacity&&(o*=r.opacity);else if("textAnchor"===t)o="start"===e?tC:"end"===e?tT:tw;else if("charSpacing"===t||t===ru)s=ro(e,i)/i*1e3;else if("paintFirst"===t){let t=e.indexOf(tU),r=e.indexOf(tH);o=tU,(t>-1&&r>-1&&r-1)&&(o=tH)}else{if("href"===t||"xlink:href"===t||"font"===t||"id"===t)return e;if("imageSmoothing"===t)return"optimizeQuality"===e;s=n?e.map(ro):ro(e,i)}}else o="";return!n&&isNaN(s)?o:s}(e,o[t],n,i);a[e]=r}a&&a.font&&function(t,e){let r=t.match(rC);if(!r)return;let i=r[1],n=r[3],s=r[4],o=r[5],a=r[6];i&&(e.fontStyle=i),n&&(e.fontWeight=isNaN(parseFloat(n))?n:parseFloat(n)),s&&(e.fontSize=ro(s)),a&&(e.fontFamily=a),o&&(e.lineHeight="normal"===o?1:o)}(a.font,a);let l=tt(tt({},n),a);return rk.test(t.nodeName)?l:function(t){let e=iW.getDefaults();return Object.entries(nl).forEach(r=>{let[i,n]=r;if(void 0===t[n]||""===t[i])return;if(void 0===t[i]){if(!e[i])return;t[i]=e[i]}if(0===t[i].indexOf("url("))return;let s=new rs(t[i]);t[i]=s.setAlpha(eC(s.getAlpha()*t[n],2)).toRgba()}),t}(l)}let nc=["left","top","width","height","visible"],nu=["rx","ry"];class nd extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),nd.ownDefaults)}_initRxRy(){let{rx:t,ry:e}=this;t&&!e?this.ry=t:e&&!t&&(this.rx=e)}_render(t){let{width:e,height:r}=this,i=-e/2,n=-r/2,s=this.rx?Math.min(this.rx,e/2):0,o=this.ry?Math.min(this.ry,r/2):0,a=0!==s||0!==o;t.beginPath(),t.moveTo(i+s,n),t.lineTo(i+e-s,n),a&&t.bezierCurveTo(i+e-.4477152502*s,n,i+e,n+.4477152502*o,i+e,n+o),t.lineTo(i+e,n+r-o),a&&t.bezierCurveTo(i+e,n+r-.4477152502*o,i+e-.4477152502*s,n+r,i+e-s,n+r),t.lineTo(i+s,n+r),a&&t.bezierCurveTo(i+.4477152502*s,n+r,i,n+r-.4477152502*o,i,n+r-o),t.lineTo(i,n+o),a&&t.bezierCurveTo(i,n+.4477152502*o,i+.4477152502*s,n,i+s,n),t.closePath(),this._renderPaintInOrder(t)}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject([...nu,...t])}_toSVG(){let{width:t,height:e,rx:r,ry:i}=this;return["\n')]}static async fromElement(t,e,r){let i=nh(t,this.ATTRIBUTE_NAMES,r),{left:n=0,top:s=0,width:o=0,height:a=0,visible:l=!0}=i,h=te(i,nc);return new this(tt(tt(tt({},e),h),{},{left:n,top:s,width:o,height:a,visible:!!(l&&o&&a)}))}constructor(t){super(),Object.assign(this,nd.ownDefaults),this.setOptions(t),this._initRxRy()}}Z(nd,"type","Rect"),Z(nd,"cacheProperties",[...rY,...nu]),Z(nd,"ownDefaults",{rx:0,ry:0}),Z(nd,"ATTRIBUTE_NAMES",[...i2,"x","y","rx","ry","width","height"]),tY.setClass(nd),tY.setSVGClass(nd);let nf="initialization",ng="added",np="removed",nm="imperative",nv=(t,e)=>{let{strokeUniform:r,strokeWidth:i,width:n,height:s,group:o}=e,a=o&&o!==t?eK(o.calcTransformMatrix(),t.calcTransformMatrix()):null,l=a?e.getRelativeCenterPoint().transform(a):e.getRelativeCenterPoint(),h=!e.isStrokeAccountedForInDimensions(),c=r&&h?eJ(new tJ(i,i),void 0,t.calcTransformMatrix()):tZ,u=!r&&h?i:0,d=eq(n+u,s+u,ea([a,e.calcOwnMatrix()],!0)).add(c).scalarDivide(2);return[l.subtract(d),l.add(d)]};class ny{calcLayoutResult(t,e){if(this.shouldPerformLayout(t))return this.calcBoundingBox(e,t)}shouldPerformLayout(t){let{type:e,prevStrategy:r,strategy:i}=t;return e===nf||e===nm||!!r&&i!==r}shouldLayoutClipPath(t){let{type:e,target:{clipPath:r}}=t;return e!==nf&&r&&!r.absolutePositioned}getInitialSize(t,e){return e.size}calcBoundingBox(t,e){let{type:r,target:i}=e;if(r===nm&&e.overrides)return e.overrides;if(0===t.length)return;let{left:n,top:s,width:o,height:a}=eH(t.map(t=>nv(i,t)).reduce((t,e)=>t.concat(e),[])),l=new tJ(o,a),h=new tJ(n,s).add(l.scalarDivide(2));if(r===nf){let t=this.getInitialSize(e,{size:l,center:h});return{center:h,relativeCorrection:new tJ(0,0),size:t}}return{center:h.transform(i.calcOwnMatrix()),size:l}}}Z(ny,"type","strategy");class nx extends ny{shouldPerformLayout(t){return!0}}Z(nx,"type","fit-content"),tY.setClass(nx);let nb=["strategy"],n_=["target","strategy","bubbles","prevStrategy"],nw="layoutManager";class nC{performLayout(t){let e=tt(tt({bubbles:!0,strategy:this.strategy},t),{},{prevStrategy:this._prevLayoutStrategy,stopPropagation(){this.bubbles=!1}});this.onBeforeLayout(e);let r=this.getLayoutResult(e);r&&this.commitLayout(e,r),this.onAfterLayout(e,r),this._prevLayoutStrategy=e.strategy}attachHandlers(t,e){let{target:r}=e;return[tX,tM,tP,tD,tE,tA,tL,tF,"modifyPath"].map(e=>t.on(e,t=>this.performLayout(e===tX?{type:"object_modified",trigger:e,e:t,target:r}:{type:"object_modifying",trigger:e,e:t,target:r})))}subscribe(t,e){this.unsubscribe(t,e);let r=this.attachHandlers(t,e);this._subscriptions.set(t,r)}unsubscribe(t,e){(this._subscriptions.get(t)||[]).forEach(t=>t()),this._subscriptions.delete(t)}unsubscribeTargets(t){t.targets.forEach(e=>this.unsubscribe(e,t))}subscribeTargets(t){t.targets.forEach(e=>this.subscribe(e,t))}onBeforeLayout(t){let{target:e,type:r}=t,{canvas:i}=e;if(r===nf||r===ng?this.subscribeTargets(t):r===np&&this.unsubscribeTargets(t),e.fire("layout:before",{context:t}),i&&i.fire("object:layout:before",{target:e,context:t}),r===nm&&t.deep){let r=te(t,nb);e.forEachObject(t=>t.layoutManager&&t.layoutManager.performLayout(tt(tt({},r),{},{bubbles:!1,target:t})))}}getLayoutResult(t){let{target:e,strategy:r,type:i}=t,n=r.calcLayoutResult(t,e.getObjects());if(!n)return;let s=i===nf?new tJ:e.getRelativeCenterPoint(),{center:o,correction:a=new tJ,relativeCorrection:l=new tJ}=n,h=s.subtract(o).add(a).transform(i===nf?t_:es(e.calcOwnMatrix()),!0).add(l);return{result:n,prevCenter:s,nextCenter:o,offset:h}}commitLayout(t,e){var r,i;let{target:n}=t,{result:{size:s},nextCenter:o}=e;(n.set({width:s.x,height:s.y}),this.layoutObjects(t,e),t.type===nf)?n.set({left:null!=(r=t.x)?r:o.x+s.x*e1(n.originX),top:null!=(i=t.y)?i:o.y+s.y*e1(n.originY)}):(n.setPositionByOrigin(o,tw,tw),n.setCoords(),n.set("dirty",!0))}layoutObjects(t,e){let{target:r}=t;r.forEachObject(i=>{i.group===r&&this.layoutObject(t,e,i)}),t.strategy.shouldLayoutClipPath(t)&&this.layoutObject(t,e,r.clipPath)}layoutObject(t,e,r){let{offset:i}=e;r.set({left:r.left+i.x,top:r.top+i.y})}onAfterLayout(t,e){let{target:r,strategy:i,bubbles:n,prevStrategy:s}=t,o=te(t,n_),{canvas:a}=r;r.fire("layout:after",{context:t,result:e}),a&&a.fire("object:layout:after",{context:t,result:e,target:r});let l=r.parent;n&&null!=l&&l.layoutManager&&((o.path||(o.path=[])).push(r),l.layoutManager.performLayout(tt(tt({},o),{},{target:l}))),r.set("dirty",!0)}dispose(){let{_subscriptions:t}=this;t.forEach(t=>t.forEach(t=>t())),t.clear()}toObject(){return{type:nw,strategy:this.strategy.constructor.type}}toJSON(){return this.toObject()}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nx;Z(this,"strategy",void 0),this.strategy=t,this._subscriptions=new Map}}tY.setClass(nC,nw);let nS=["type","objects","layoutManager"];class nT extends nC{performLayout(){}}class nO extends t0(iW){static getDefaults(){return tt(tt({},super.getDefaults()),nO.ownDefaults)}groupInit(t,e){var r;this._objects=[...t],this.__objectSelectionTracker=this.__objectSelectionMonitor.bind(this,!0),this.__objectSelectionDisposer=this.__objectSelectionMonitor.bind(this,!1),this.forEachObject(t=>{this.enterGroup(t,!1)}),this.layoutManager=null!=(r=e.layoutManager)?r:new nC,this.layoutManager.performLayout({type:nf,target:this,targets:[...t],x:e.left,y:e.top})}canEnterGroup(t){return t===this||this.isDescendantOf(t)?(ts("error","Group: circular object trees are not supported, this call has no effect"),!1):-1===this._objects.indexOf(t)||(ts("error","Group: duplicate objects are not supported inside group, this call has no effect"),!1)}_filterObjectsBeforeEnteringGroup(t){return t.filter((t,e,r)=>this.canEnterGroup(t)&&r.indexOf(t)===e)}add(){for(var t=arguments.length,e=Array(t),r=0;r1?e-1:0),i=1;i{r._set(t,e)}),this}_shouldSetNestedCoords(){return this.subTargetCheck}removeAll(){return this._activeObjects=[],this.remove(...this._objects)}__objectSelectionMonitor(t,e){let{target:r}=e,i=this._activeObjects;if(t)i.push(r),this._set("dirty",!0);else if(i.length>0){let t=i.indexOf(r);t>-1&&(i.splice(t,1),this._set("dirty",!0))}}_watchObject(t,e){t&&this._watchObject(!1,e),t?(e.on("selected",this.__objectSelectionTracker),e.on("deselected",this.__objectSelectionDisposer)):(e.off("selected",this.__objectSelectionTracker),e.off("deselected",this.__objectSelectionDisposer))}enterGroup(t,e){t.group&&t.group.remove(t),t._set("parent",this),this._enterGroup(t,e)}_enterGroup(t,e){e&&eY(t,eo(es(this.calcTransformMatrix()),t.calcTransformMatrix())),this._shouldSetNestedCoords()&&t.setCoords(),t._set("group",this),t._set("canvas",this.canvas),this._watchObject(!0,t);let r=this.canvas&&this.canvas.getActiveObject&&this.canvas.getActiveObject();r&&(r===t||t.isDescendantOf(r))&&this._activeObjects.push(t)}exitGroup(t,e){this._exitGroup(t,e),t._set("parent",void 0),t._set("canvas",void 0)}_exitGroup(t,e){t._set("group",void 0),e||(eY(t,eo(this.calcTransformMatrix(),t.calcTransformMatrix())),t.setCoords()),this._watchObject(!1,t);let r=this._activeObjects.length>0?this._activeObjects.indexOf(t):-1;r>-1&&this._activeObjects.splice(r,1)}shouldCache(){let t=iW.prototype.shouldCache.call(this);if(t){for(let t=0;tt.setCoords())}triggerLayout(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.layoutManager.performLayout(tt({target:this,type:nm},t))}render(t){this._transformDone=!0,super.render(t),this._transformDone=!1}__serializeObjects(t,e){let r=this.includeDefaultValues;return this._objects.filter(function(t){return!t.excludeFromExport}).map(function(i){let n=i.includeDefaultValues;i.includeDefaultValues=r;let s=i[t||"toObject"](e);return i.includeDefaultValues=n,s})}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.layoutManager.toObject();return tt(tt(tt({},super.toObject(["subTargetCheck","interactive",...t])),"fit-content"!==e.strategy||this.includeDefaultValues?{layoutManager:e}:{}),{},{objects:this.__serializeObjects("toObject",t)})}toString(){return"#")}dispose(){this.layoutManager.unsubscribeTargets({targets:this.getObjects(),target:this}),this._activeObjects=[],this.forEachObject(t=>{this._watchObject(!1,t),t.dispose()}),super.dispose()}_createSVGBgRect(t){if(!this.backgroundColor)return"";let e=nd.prototype._toSVG.call(this),r=e.indexOf("COMMON_PARTS");e[r]='for="group" ';let i=e.join("");return t?t(i):i}_toSVG(t){let e=["\n"],r=this._createSVGBgRect(t);r&&e.push(" ",r);for(let r=0;r\n"),e}getSvgStyles(){let t=void 0!==this.opacity&&1!==this.opacity?"opacity: ".concat(this.opacity,";"):"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")}toClipPathSVG(t){let e=[],r=this._createSVGBgRect(t);r&&e.push(" ",r);for(let r=0;r{let[e,r]=t,i=new this(e,tt(tt(tt({},s),r),{},{layoutManager:new nT}));return n?i.layoutManager=new(tY.getClass(n.type))(new(tY.getClass(n.strategy))):i.layoutManager=new nC,i.layoutManager.subscribeTargets({type:nf,target:i,targets:i.getObjects()}),i.setCoords(),i})}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Z(this,"_activeObjects",[]),Z(this,"__objectSelectionTracker",void 0),Z(this,"__objectSelectionDisposer",void 0),Object.assign(this,nO.ownDefaults),this.setOptions(e),this.groupInit(t,e)}}Z(nO,"type","Group"),Z(nO,"ownDefaults",{strokeWidth:0,subTargetCheck:!1,interactive:!1}),tY.setClass(nO);let nk=(t,e)=>Math.min(e.width/t.width,e.height/t.height),nM=(t,e)=>Math.max(e.width/t.width,e.height/t.height),nE="\\s*,?\\s*",nD="".concat(nE,"(").concat(r_,")"),nj="".concat(nD).concat(nD).concat(nD).concat(nE,"([01])").concat(nE,"([01])").concat(nD).concat(nD),nA={m:"l",M:"L"},nP=(t,e,r,i,n,s,o,a,l,h,c)=>{let u=tK(t),d=tQ(t),f=tK(e),g=tQ(e),p=r*n*f-i*s*g+o,m=i*n*f+r*s*g+a;return["C",h+l*(-r*n*d-i*s*u),c+l*(-i*n*d+r*s*u),p+l*(r*n*g+i*s*f),m+l*(i*n*g-r*s*f),p,m]},nF=(t,e,r,i)=>{let n=Math.atan2(e,t),s=Math.atan2(i,r);return s>=n?s-n:2*Math.PI-(n-s)};function nL(t,e,r,i,n,s,o,a){let l;if(tn.cachesBoundsOfCurve&&(l=[...arguments].join(),tp.boundsOfCurveCache[l]))return tp.boundsOfCurveCache[l];let h=Math.sqrt,c=Math.abs,u=[],d=[[0,0],[0,0]],f=6*t-12*r+6*n,g=-3*t+9*r-9*n+3*o,p=3*r-3*t;for(let t=0;t<2;++t){if(t>0&&(f=6*e-12*i+6*s,g=-3*e+9*i-9*s+3*a,p=3*i-3*e),1e-12>c(g)){if(1e-12>c(f))continue;let t=-p/f;0{let[i,n,s,o,a,l,h,c]=r,u=((t,e,r,i,n,s,o)=>{if(0===r||0===i)return[];let a=0,l=0,h=0,c=Math.PI,u=o*tb,d=tQ(u),f=tK(u),g=.5*(-f*t-d*e),p=.5*(-f*e+d*t),m=r**2,y=i**2,x=p**2,b=g**2,_=m*y-m*x-y*b,w=Math.abs(r),C=Math.abs(i);if(_<0){let t=Math.sqrt(1-_/(m*y));w*=t,C*=t}else h=(n===s?-1:1)*Math.sqrt(_/(m*x+y*b));let S=h*w*p/C,T=-h*C*g/w,O=f*S-d*T+.5*t,k=d*S+f*T+.5*e,M=nF(1,0,(g-S)/w,(p-T)/C),E=nF((g-S)/w,(p-T)/C,(-g-S)/w,(-p-T)/C);0===s&&E>0?E-=2*c:1===s&&E<0&&(E+=2*c);let D=Math.ceil(Math.abs(E/c*2)),j=[],A=E/D,P=8/3*Math.sin(A/4)*Math.sin(A/4)/Math.sin(A/2),F=M+A;for(let t=0;t{let e=0,r=0,i=0,n=0,s=[],o,a=0,l=0;for(let h of t){let t,c=[...h];switch(c[0]){case"l":c[1]+=e,c[2]+=r;case"L":t=["L",e=c[1],r=c[2]];break;case"h":c[1]+=e;case"H":t=["L",e=c[1],r];break;case"v":c[1]+=r;case"V":t=["L",e,r=c[1]];break;case"m":c[1]+=e,c[2]+=r;case"M":e=c[1],r=c[2],i=c[1],n=c[2],t=["M",e,r];break;case"c":c[1]+=e,c[2]+=r,c[3]+=e,c[4]+=r,c[5]+=e,c[6]+=r;case"C":a=c[3],l=c[4],e=c[5],r=c[6],t=["C",c[1],c[2],a,l,e,r];break;case"s":c[1]+=e,c[2]+=r,c[3]+=e,c[4]+=r;case"S":"C"===o?(a=2*e-a,l=2*r-l):(a=e,l=r),e=c[3],r=c[4],a=(t=["C",a,l,c[1],c[2],e,r])[3],l=t[4];break;case"q":c[1]+=e,c[2]+=r,c[3]+=e,c[4]+=r;case"Q":a=c[1],l=c[2],t=["Q",a,l,e=c[3],r=c[4]];break;case"t":c[1]+=e,c[2]+=r;case"T":"Q"===o?(a=2*e-a,l=2*r-l):(a=e,l=r),t=["Q",a,l,e=c[1],r=c[2]];break;case"a":c[6]+=e,c[7]+=r;case"A":nR(e,r,c).forEach(t=>s.push(t)),e=c[6],r=c[7];break;case"z":case"Z":e=i,r=n,t=["Z"]}t?(s.push(t),o=t[0]):o=""}return s},nB=(t,e,r,i)=>Math.sqrt((r-t)**2+(i-e)**2),nN=(t,e,r,i,n,s,o,a)=>l=>{let h=l**3,c=(t=>3*t**2*(1-t))(l),u=(t=>3*t*(1-t)**2)(l),d=(1-l)**3;return new tJ(o*h+n*c+r*u+t*d,a*h+s*c+i*u+e*d)},nW=t=>2*t*(1-t),nU=(t,e,r,i,n,s,o,a)=>l=>{let h=l**2,c=nW(l),u=(1-l)**2;return Math.atan2(3*(u*(i-e)+c*(s-i)+h*(a-s)),3*(u*(r-t)+c*(n-r)+h*(o-n)))},nH=(t,e,r,i,n,s)=>o=>{let a=o**2,l=nW(o),h=(1-o)**2;return new tJ(n*a+r*l+t*h,s*a+i*l+e*h)},nX=(t,e,r,i,n,s)=>o=>{let a=1-o;return Math.atan2(2*(a*(i-e)+o*(s-i)),2*(a*(r-t)+o*(n-r)))},nV=(t,e,r)=>{let i=new tJ(e,r),n=0;for(let e=1;e<=100;e+=1){let r=t(e/100);n+=nB(i.x,i.y,r.x,r.y),i=r}return n},nY=t=>{let e,r,i=0,n=0,s=0,o=0,a=0,l=[];for(let h of t){let t={x:n,y:s,command:h[0],length:0};switch(h[0]){case"M":(r=t).x=o=n=h[1],r.y=a=s=h[2];break;case"L":(r=t).length=nB(n,s,h[1],h[2]),n=h[1],s=h[2];break;case"C":e=nN(n,s,h[1],h[2],h[3],h[4],h[5],h[6]),(r=t).iterator=e,r.angleFinder=nU(n,s,h[1],h[2],h[3],h[4],h[5],h[6]),r.length=nV(e,n,s),n=h[5],s=h[6];break;case"Q":e=nH(n,s,h[1],h[2],h[3],h[4]),(r=t).iterator=e,r.angleFinder=nX(n,s,h[1],h[2],h[3],h[4]),r.length=nV(e,n,s),n=h[3],s=h[4];break;case"Z":(r=t).destX=o,r.destY=a,r.length=nB(n,s,o,a),n=o,s=a}i+=r.length,l.push(r)}return l.push({length:i,x:n,y:s}),l},nz=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:nY(t),i=0;for(;e-r[i].length>0&&i{let r,i=0,n=0,s={x:t.x,y:t.y},o=tt({},s),a=.01,l=0,h=t.iterator,c=t.angleFinder;for(;n1e-4;)o=h(i),l=i,(r=nB(s.x,s.y,o.x,o.y))+n>e?(i-=a,a/=2):(s=o,i+=a,n+=r);return tt(tt({},o),{},{angle:c(l)})})(n,e)}},nG=RegExp("[mzlhvcsqta][^mzlhvcsqta]*","gi"),nq=RegExp(nj,"g"),nK=RegExp(r_,"gi"),nQ={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},nJ=t=>{var e;let r=[];for(let i of null!=(e=t.match(nG))?e:[]){let t=i[0];if("z"===t||"Z"===t){r.push([t]);continue}let e=nQ[t.toLowerCase()],n=[];if("a"===t||"A"===t){nq.lastIndex=0;for(let t=null;t=nq.exec(i);)n.push(...t.slice(1))}else n=i.match(nK)||[];for(let i=0;i0&&o?o:t;for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:0,i=new tJ(t[0]),n=new tJ(t[1]),s=1,o=0,a=[],l=t.length,h=l>2;for(h&&(s=t[2].xt[e-2].x?1:i.x===t[e-2].x?0:-1,o=i.y>t[e-2].y?1:i.y===t[e-2].y?0:-1),a.push(["L",i.x+s*r,i.y+o*r]),a},n$=(t,e)=>t.map(t=>t.map((t,r)=>0===r||void 0===e?t:eC(t,e)).join(" ")).join(" ");function n0(t,e){let r=t.style;r&&e&&("string"==typeof e?r.cssText+=";"+e:Object.entries(e).forEach(t=>{let[e,i]=t;return r.setProperty(e,i)}))}Object.freeze({__proto__:null,addTransformToObject:eV,animate:r8,animateColor:r7,applyTransformToObject:eY,calcAngleBetweenVectors:rP,calcDimensionsMatrix:em,calcPlaneChangeMatrix:eK,calcVectorRotation:rF,cancelAnimFrame:t5,capValue:rX,composeMatrix:ev,copyCanvasElement:t=>{var e;let r=t8(t);return null==(e=r.getContext("2d"))||e.drawImage(t,0,0),r},cos:tK,createCanvasElement:t9,createImage:t6,createRotateMatrix:eu,createScaleMatrix:ed,createSkewXMatrix:eg,createSkewYMatrix:ep,createTranslateMatrix:ec,createVector:rj,crossProduct:rI,degreesToRadians:ee,dotProduct:rB,ease:rJ,enlivenObjectEnlivables:eb,enlivenObjects:ex,findScaleToCover:nM,findScaleToFit:nk,getBoundsOfCurve:nL,getOrthonormalVector:rR,getPathSegmentsInfo:nY,getPointOnPath:nz,getPointer:eN,getRandomInt:(t,e)=>Math.floor(Math.random()*(e-t+1))+t,getRegularPolygonPath:(t,e)=>{let r=2*Math.PI/t,i=-ty;t%2==0&&(i+=r/2);let n=Array(t+1);for(let s=0;s{let e=["instantiated_by_use","style","id","class"];switch(t){case"linearGradient":return e.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);case"radialGradient":return e.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);case"stop":return e.concat(["offset","stop-color","stop-opacity"])}return e},getUnitVector:rL,groupSVGElements:(t,e)=>t&&1===t.length?t[0]:new nO(t,e),hasStyleChanged:i$,invertTransform:es,isBetweenVectors:rN,isIdentityMatrix:ei,isTouchEvent:eW,isTransparent:iU,joinPath:n$,loadImage:ey,magnitude:rA,makeBoundingBoxFromPoints:eH,makePathSimpler:nI,matrixToSVG:eS,mergeClipPaths:(t,e)=>{var r;let i=t,n=e;i.inverted&&!n.inverted&&(i=e,n=t),eZ(n,null==(r=n.group)?void 0:r.calcTransformMatrix(),i.calcTransformMatrix());let s=i.inverted&&n.inverted;return s&&(i.inverted=n.inverted=!1),new nO([i],{clipPath:n,inverted:s})},multiplyTransformMatrices:eo,multiplyTransformMatrixArray:ea,parsePath:nJ,parsePreserveAspectRatioAttribute:ra,parseUnit:ro,pick:e_,projectStrokeOnPoints:iz,qrDecompose:eh,radiansToDegrees:er,removeFromArray:tq,removeTransformFromObject:(t,e)=>{let r=eo(es(e),t.calcOwnMatrix());eY(t,r)},removeTransformMatrixForSvgParsing:(t,e)=>{let r=t._findCenterFromElement();t.transformMatrix&&((t=>{if(t.transformMatrix){let{scaleX:e,scaleY:r,angle:i,skewX:n}=eh(t.transformMatrix);t.flipX=!1,t.flipY=!1,t.set(tI,e),t.set(tB,r),t.angle=i,t.skewX=n,t.skewY=0}})(t),r=r.transform(t.transformMatrix)),delete t.transformMatrix,e&&(t.scaleX*=e.scaleX,t.scaleY*=e.scaleY,t.cropX=e.cropX,t.cropY=e.cropY,r.x+=e.offsetLeft,r.y+=e.offsetTop,t.width=e.width,t.height=e.height),t.setPositionByOrigin(r,tw,tw)},request:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.onComplete||tv,i=new(tf()).XMLHttpRequest,n=e.signal,s=function(){i.abort()},o=function(){n&&n.removeEventListener("abort",s),i.onerror=i.ontimeout=tv};if(n&&n.aborted)throw new ta("request");return n&&n.addEventListener("abort",s,{once:!0}),i.onreadystatechange=function(){4===i.readyState&&(o(),r(i),i.onreadystatechange=tv)},i.onerror=i.ontimeout=o,i.open("get",t,!0),i.send(),i},requestAnimFrame:t2,resetObjectTransform:ez,rotatePoint:(t,e,r)=>t.rotate(r,e),rotateVector:rD,saveObjectTransform:eG,sendObjectToPlane:eZ,sendPointToPlane:eQ,sendVectorToPlane:eJ,setStyle:n0,sin:tQ,sizeAfterTransform:eq,string:iZ,stylesFromArray:i1,stylesToArray:i0,toBlob:et,toDataURL:t7,toFixed:eC,transformPath:(t,e,r)=>(r&&(e=eo(e,[1,0,0,1,-r.x,-r.y])),t.map(t=>{let r=[...t];for(let i=1;i1&&void 0!==arguments[1]?arguments[1]:{};super(t),Z(this,"upper",void 0),Z(this,"container",void 0);let{el:i}=this.lower,n=this.createUpperCanvas();this.upper={el:n,ctx:n.getContext("2d")},this.applyCanvasStyle(i,{allowTouchScrolling:e}),this.applyCanvasStyle(n,{allowTouchScrolling:e,styles:{position:"absolute",left:"0",top:"0"}});let s=this.createContainerElement();s.classList.add(r),i.parentNode&&i.parentNode.replaceChild(s,i),s.append(i,n),this.container=s}}class n2 extends eI{static getDefaults(){return tt(tt({},super.getDefaults()),n2.ownDefaults)}get upperCanvasEl(){var t;return null==(t=this.elements.upper)?void 0:t.el}get contextTop(){var t;return null==(t=this.elements.upper)?void 0:t.ctx}get wrapperEl(){return this.elements.container}initElements(t){this.elements=new n1(t,{allowTouchScrolling:this.allowTouchScrolling,containerClass:this.containerClass}),this._createCacheCanvas()}_onObjectAdded(t){this._objectsToRender=void 0,super._onObjectAdded(t)}_onObjectRemoved(t){this._objectsToRender=void 0,t===this._activeObject&&(this.fire("before:selection:cleared",{deselected:[t]}),this._discardActiveObject(),this.fire("selection:cleared",{deselected:[t]}),t.fire("deselected",{target:t})),t===this._hoveredTarget&&(this._hoveredTarget=void 0,this._hoveredTargets=[]),super._onObjectRemoved(t)}_onStackOrderChanged(){this._objectsToRender=void 0,super._onStackOrderChanged()}_chooseObjectsToRender(){let t=this._activeObject;return!this.preserveObjectStacking&&t?this._objects.filter(e=>!e.group&&e!==t).concat(t):this._objects}renderAll(){this.cancelRequestedRender(),this.destroyed||(!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1),this._objectsToRender||(this._objectsToRender=this._chooseObjectsToRender()),this.renderCanvas(this.getContext(),this._objectsToRender))}renderTopLayer(t){t.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(t),this.contextTopDirty=!0),t.restore()}renderTop(){let t=this.contextTop;this.clearContext(t),this.renderTopLayer(t),this.fire("after:render",{ctx:t})}setTargetFindTolerance(t){t=Math.round(t),this.targetFindTolerance=t;let e=this.getRetinaScaling(),r=Math.ceil((2*t+1)*e);this.pixelFindCanvasEl.width=this.pixelFindCanvasEl.height=r,this.pixelFindContext.scale(e,e)}isTargetTransparent(t,e,r){let i=this.targetFindTolerance,n=this.pixelFindContext;this.clearContext(n),n.save(),n.translate(-e+i,-r+i),n.transform(...this.viewportTransform);let s=t.selectionBackgroundColor;t.selectionBackgroundColor="",t.render(n),t.selectionBackgroundColor=s,n.restore();let o=Math.round(i*this.getRetinaScaling());return iU(n,o,o,o)}_isSelectionKeyPressed(t){let e=this.selectionKey;return!!e&&(Array.isArray(e)?!!e.find(e=>!!e&&!0===t[e]):t[e])}_shouldClearSelection(t,e){let r=this.getActiveObjects(),i=this._activeObject;return!!(!e||e&&i&&r.length>1&&-1===r.indexOf(e)&&i!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&i&&i!==e)}_shouldCenterTransform(t,e,r){let i;if(t)return e===tR||e===tI||e===tB||e===tP?i=this.centeredScaling||t.centeredScaling:e===tj&&(i=this.centeredRotation||t.centeredRotation),i?!r:r}_getOriginFromCorner(t,e){let r={x:t.originX,y:t.originY};return e&&(["ml","tl","bl"].includes(e)?r.x=tT:["mr","tr","br"].includes(e)&&(r.x=tC),["tl","mt","tr"].includes(e)?r.y=tS:["bl","mb","br"].includes(e)&&(r.y="top")),r}_setupCurrentTransform(t,e,r){var i;let n=e.group?eQ(this.getScenePoint(t),void 0,e.group.calcTransformMatrix()):this.getScenePoint(t),{key:s="",control:o}=e.getActiveControl()||{},a=r&&o?null==(i=o.getActionHandler(t,e,o))?void 0:i.bind(o):e8,l=((t,e,r,i)=>{if(!e||!t)return"drag";let n=i.controls[e];return n.getActionName(r,n,i)})(r,s,t,e),h=t[this.centeredKey],c=this._shouldCenterTransform(e,l,h)?{x:tw,y:tw}:this._getOriginFromCorner(e,s),u={target:e,action:l,actionHandler:a,actionPerformed:!1,corner:s,scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,offsetX:n.x-e.left,offsetY:n.y-e.top,originX:c.x,originY:c.y,ex:n.x,ey:n.y,lastX:n.x,lastY:n.y,theta:ee(e.angle),width:e.width,height:e.height,shiftKey:t.shiftKey,altKey:h,original:tt(tt({},eG(e)),{},{originX:c.x,originY:c.y})};this._currentTransform=u,this.fire("before:transform",{e:t,transform:u})}setCursor(t){this.upperCanvasEl.style.cursor=t}_drawSelection(t){let{x:e,y:r,deltaX:i,deltaY:n}=this._groupSelector,s=new tJ(e,r).transform(this.viewportTransform),o=new tJ(e+i,r+n).transform(this.viewportTransform),a=this.selectionLineWidth/2,l=Math.min(s.x,o.x),h=Math.min(s.y,o.y),c=Math.max(s.x,o.x),u=Math.max(s.y,o.y);this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(l,h,c-l,u-h)),this.selectionLineWidth&&this.selectionBorderColor&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,l+=a,h+=a,c-=a,u-=a,iW.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(l,h,c-l,u-h))}findTarget(t){if(this.skipTargetFind)return;let e=this.getViewportPoint(t),r=this._activeObject,i=this.getActiveObjects();if(this.targets=[],r&&i.length>=1){if(r.findControl(e,eW(t))||i.length>1&&this.searchPossibleTargets([r],e))return r;if(r===this.searchPossibleTargets([r],e)){if(this.preserveObjectStacking){let i=this.targets;this.targets=[];let n=this.searchPossibleTargets(this._objects,e);return t[this.altSelectionKey]&&n&&n!==r?(this.targets=i,r):n}return r}}return this.searchPossibleTargets(this._objects,e)}_pointIsInObjectSelectionArea(t,e){let r=t.getCoords(),i=this.getZoom(),n=t.padding/i;if(n){let[t,e,i,s]=r,o=Math.atan2(e.y-t.y,e.x-t.x),a=tK(o)*n,l=tQ(o)*n,h=a+l,c=a-l;r=[new tJ(t.x-c,t.y-h),new tJ(e.x+h,e.y-c),new tJ(i.x+c,i.y+h),new tJ(s.x-h,s.y+c)]}return it.isPointInPolygon(e,r)}_checkTarget(t,e){return!(!(t&&t.visible&&t.evented&&this._pointIsInObjectSelectionArea(t,eQ(e,void 0,this.viewportTransform)))||(this.perPixelTargetFind||t.perPixelTargetFind)&&!t.isEditing&&this.isTargetTransparent(t,e.x,e.y))||!1}_searchPossibleTargets(t,e){let r=t.length;for(;r--;){let i=t[r];if(this._checkTarget(i,e)){if(t$(i)&&i.subTargetCheck){let t=this._searchPossibleTargets(i._objects,e);t&&this.targets.push(t)}return i}}}searchPossibleTargets(t,e){let r=this._searchPossibleTargets(t,e);if(r&&t$(r)&&r.interactive&&this.targets[0]){let t=this.targets;for(let e=t.length-1;e>0;e--){let r=t[e];if(!t$(r)||!r.interactive)return r}return t[0]}return r}getViewportPoint(t){return this._pointer?this._pointer:this.getPointer(t,!0)}getScenePoint(t){return this._absolutePointer?this._absolutePointer:this.getPointer(t)}getPointer(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.upperCanvasEl,i=r.getBoundingClientRect(),n=eN(t),s=i.width||0,o=i.height||0;s&&o||("top"in i&&tS in i&&(o=Math.abs(i.top-i.bottom)),tT in i&&tC in i&&(s=Math.abs(i.right-i.left))),this.calcOffset(),n.x=n.x-this._offset.left,n.y=n.y-this._offset.top,e||(n=eQ(n,void 0,this.viewportTransform));let a=this.getRetinaScaling();1!==a&&(n.x/=a,n.y/=a);let l=0===s||0===o?new tJ(1,1):new tJ(r.width/s,r.height/o);return n.multiply(l)}_setDimensionsImpl(t,e){this._resetTransformEventData(),super._setDimensionsImpl(t,e),this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop)}_createCacheCanvas(){this.pixelFindCanvasEl=t9(),this.pixelFindContext=this.pixelFindCanvasEl.getContext("2d",{willReadFrequently:!0}),this.setTargetFindTolerance(this.targetFindTolerance)}getTopContext(){return this.elements.upper.ctx}getSelectionContext(){return this.elements.upper.ctx}getSelectionElement(){return this.elements.upper.el}getActiveObject(){return this._activeObject}getActiveObjects(){let t=this._activeObject;return eM(t)?t.getObjects():t?[t]:[]}_fireSelectionEvents(t,e){let r=!1,i=!1,n=this.getActiveObjects(),s=[],o=[];t.forEach(t=>{n.includes(t)||(r=!0,t.fire("deselected",{e:e,target:t}),o.push(t))}),n.forEach(i=>{t.includes(i)||(r=!0,i.fire("selected",{e:e,target:i}),s.push(i))}),t.length>0&&n.length>0?(i=!0,r&&this.fire("selection:updated",{e:e,selected:s,deselected:o})):n.length>0?(i=!0,this.fire("selection:created",{e:e,selected:s})):t.length>0&&(i=!0,this.fire("selection:cleared",{e:e,deselected:o})),i&&(this._objectsToRender=void 0)}setActiveObject(t,e){let r=this.getActiveObjects(),i=this._setActiveObject(t,e);return this._fireSelectionEvents(r,e),i}_setActiveObject(t,e){let r=this._activeObject;return r!==t&&!(!this._discardActiveObject(e,t)&&this._activeObject)&&!t.onSelect({e:e})&&(this._activeObject=t,eM(t)&&r!==t&&t.set("canvas",this),t.setCoords(),!0)}_discardActiveObject(t,e){let r=this._activeObject;return!!r&&!r.onDeselect({e:t,object:e})&&(this._currentTransform&&this._currentTransform.target===r&&this.endCurrentTransform(t),eM(r)&&r===this._hoveredTarget&&(this._hoveredTarget=void 0),this._activeObject=void 0,!0)}discardActiveObject(t){let e=this.getActiveObjects(),r=this.getActiveObject();e.length&&this.fire("before:selection:cleared",{e:t,deselected:[r]});let i=this._discardActiveObject(t);return this._fireSelectionEvents(e,t),i}endCurrentTransform(t){let e=this._currentTransform;this._finalizeCurrentTransform(t),e&&e.target&&(e.target.isMoving=!1),this._currentTransform=null}_finalizeCurrentTransform(t){let e=this._currentTransform,r=e.target,i={e:t,target:r,transform:e,action:e.action};r._scaling&&(r._scaling=!1),r.setCoords(),e.actionPerformed&&(this.fire("object:modified",i),r.fire(tX,i))}setViewportTransform(t){super.setViewportTransform(t);let e=this._activeObject;e&&e.setCoords()}destroy(){let t=this._activeObject;eM(t)&&(t.removeAll(),t.dispose()),delete this._activeObject,super.destroy(),this.pixelFindContext=null,this.pixelFindCanvasEl=void 0}clear(){this.discardActiveObject(),this._activeObject=void 0,this.clearContext(this.contextTop),super.clear()}drawControls(t){let e=this._activeObject;e&&e._renderControls(t)}_toObject(t,e,r){let i=this._realizeGroupTransformOnObject(t),n=super._toObject(t,e,r);return t.set(i),n}_realizeGroupTransformOnObject(t){let{group:e}=t;if(e&&eM(e)&&this._activeObject===e){let r=e_(t,["angle","flipX","flipY",tC,tI,tB,tN,tW,"top"]);return eV(t,e.calcOwnMatrix()),r}return{}}_setSVGObject(t,e,r){let i=this._realizeGroupTransformOnObject(e);super._setSVGObject(t,e,r),e.set(i)}constructor(){super(...arguments),Z(this,"targets",[]),Z(this,"_hoveredTargets",[]),Z(this,"_objectsToRender",void 0),Z(this,"_currentTransform",null),Z(this,"_groupSelector",null),Z(this,"contextTopDirty",!1)}}Z(n2,"ownDefaults",{uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",selection:!0,selectionKey:"shiftKey",selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",notAllowedCursor:"not-allowed",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,enablePointerEvents:!1,containerClass:"canvas-container",preserveObjectStacking:!1});class n5{exitTextEditing(){this.target=void 0,this.targets.forEach(t=>{t.isEditing&&t.exitEditing()})}add(t){this.targets.push(t)}remove(t){this.unregister(t),tq(this.targets,t)}register(t){this.target=t}unregister(t){t===this.target&&(this.target=void 0)}onMouseMove(t){var e;(null==(e=this.target)?void 0:e.isEditing)&&this.target.updateSelectionOnMouseMove(t)}clear(){this.targets=[],this.target=void 0}dispose(){this.clear(),this.__disposer(),delete this.__disposer}constructor(t){Z(this,"targets",[]),Z(this,"__disposer",void 0);let e=()=>{let{hiddenTextarea:e}=t.getActiveObject()||{};e&&e.focus()},r=t.upperCanvasEl;r.addEventListener("click",e),this.__disposer=()=>r.removeEventListener("click",e)}}let n4=["target","oldTarget","fireCanvas","e"],n3={passive:!1},n9=(t,e)=>{let r=t.getViewportPoint(e),i=t.getScenePoint(e);return{viewportPoint:r,scenePoint:i,pointer:r,absolutePointer:i}},n6=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i1?e-1:0),i=1;i{this.fire("mouse:out",tt(tt({},r),{},{target:t})),t&&t.fire("mouseout",tt({},r))}),this._hoveredTargets=[]}_onMouseEnter(t){this._currentTransform||this.findTarget(t)||(this.fire("mouse:over",tt({e:t},n9(this,t))),this._hoveredTarget=void 0,this._hoveredTargets=[])}_onDragStart(t){this._isClick=!1;let e=this.getActiveObject();if(e&&e.onDragStart(t)){this._dragSource=e;let r={e:t,target:e};return this.fire("dragstart",r),e.fire("dragstart",r),void n6(this.upperCanvasEl,"drag",this._onDragProgress)}eU(t)}_renderDragEffects(t,e,r){let i=!1,n=this._dropTarget;n&&n!==e&&n!==r&&(n.clearContextTop(),i=!0),null==e||e.clearContextTop(),r!==e&&(null==r||r.clearContextTop());let s=this.contextTop;s.save(),s.transform(...this.viewportTransform),e&&(s.save(),e.transform(s),e.renderDragSourceEffect(t),s.restore(),i=!0),r&&(s.save(),r.transform(s),r.renderDropTargetEffect(t),s.restore(),i=!0),s.restore(),i&&(this.contextTopDirty=!0)}_onDragEnd(t){let e=!!t.dataTransfer&&t.dataTransfer.dropEffect!==tO,r=e?this._activeObject:void 0,i={e:t,target:this._dragSource,subTargets:this.targets,dragSource:this._dragSource,didDrop:e,dropTarget:r};n8(this.upperCanvasEl,"drag",this._onDragProgress),this.fire("dragend",i),this._dragSource&&this._dragSource.fire("dragend",i),delete this._dragSource,this._onMouseUp(t)}_onDragProgress(t){let e={e:t,target:this._dragSource,dragSource:this._dragSource,dropTarget:this._draggedoverTarget};this.fire("drag",e),this._dragSource&&this._dragSource.fire("drag",e)}findDragTargets(t){return this.targets=[],{target:this._searchPossibleTargets(this._objects,this.getViewportPoint(t)),targets:[...this.targets]}}_onDragOver(t){let e,r="dragover",{target:i,targets:n}=this.findDragTargets(t),s=this._dragSource,o={e:t,target:i,subTargets:n,dragSource:s,canDrop:!1,dropTarget:void 0};this.fire(r,o),this._fireEnterLeaveEvents(i,o),i&&(i.canDrop(t)&&(e=i),i.fire(r,o));for(let i=0;i3||e<2||(this._cacheTransformEventData(t),2==e&&"dblclick"===t.type&&this._handleEvent(t,"dblclick"),3==e&&this._handleEvent(t,"tripleclick"),this._resetTransformEventData())}getPointerId(t){let e=t.changedTouches;return e?e[0]&&e[0].identifier:this.enablePointerEvents?t.pointerId:-1}_isMainEvent(t){return!0===t.isPrimary||!1!==t.isPrimary&&("touchend"===t.type&&0===t.touches.length||!t.changedTouches||t.changedTouches[0].identifier===this.mainTouchId)}_onTouchStart(t){let e=!this.allowTouchScrolling,r=this._activeObject;void 0===this.mainTouchId&&(this.mainTouchId=this.getPointerId(t)),this.__onMouseDown(t),(this.isDrawingMode||r&&this._target===r)&&(e=!0),e&&t.preventDefault(),this._resetTransformEventData();let i=this.upperCanvasEl,n=this._getEventPrefix(),s=eD(i);n6(s,"touchend",this._onTouchEnd,n3),e&&n6(s,"touchmove",this._onMouseMove,n3),n8(i,"".concat(n,"down"),this._onMouseDown)}_onMouseDown(t){this.__onMouseDown(t),this._resetTransformEventData();let e=this.upperCanvasEl,r=this._getEventPrefix();n8(e,"".concat(r,"move"),this._onMouseMove,n3);let i=eD(e);n6(i,"".concat(r,"up"),this._onMouseUp),n6(i,"".concat(r,"move"),this._onMouseMove,n3)}_onTouchEnd(t){if(t.touches.length>0)return;this.__onMouseUp(t),this._resetTransformEventData(),delete this.mainTouchId;let e=this._getEventPrefix(),r=eD(this.upperCanvasEl);n8(r,"touchend",this._onTouchEnd,n3),n8(r,"touchmove",this._onMouseMove,n3),this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(()=>{n6(this.upperCanvasEl,"".concat(e,"down"),this._onMouseDown),this._willAddMouseDown=0},400)}_onMouseUp(t){this.__onMouseUp(t),this._resetTransformEventData();let e=this.upperCanvasEl,r=this._getEventPrefix();if(this._isMainEvent(t)){let t=eD(this.upperCanvasEl);n8(t,"".concat(r,"up"),this._onMouseUp),n8(t,"".concat(r,"move"),this._onMouseMove,n3),n6(e,"".concat(r,"move"),this._onMouseMove,n3)}}_onMouseMove(t){let e=this.getActiveObject();this.allowTouchScrolling||e&&e.shouldStartDragging(t)||!t.preventDefault||t.preventDefault(),this.__onMouseMove(t)}_onResize(){this.calcOffset(),this._resetTransformEventData()}_shouldRender(t){let e=this.getActiveObject();return!!e!=!!t||e&&t&&e!==t}__onMouseUp(t){var e;this._cacheTransformEventData(t),this._handleEvent(t,"up:before");let r=this._currentTransform,i=this._isClick,n=this._target,{button:s}=t;if(s)return(this.fireMiddleClick&&1===s||this.fireRightClick&&2===s)&&this._handleEvent(t,"up"),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)return void this._onMouseUpInDrawingMode(t);if(!this._isMainEvent(t))return;let o,a,l=!1;if(r&&(this._finalizeCurrentTransform(t),l=r.actionPerformed),!i){let e=n===this._activeObject;this.handleSelection(t),l||(l=this._shouldRender(n)||!e&&n===this._activeObject)}if(n){let{key:e,control:i}=n.findControl(this.getViewportPoint(t),eW(t))||{};if(a=e,n.selectable&&n!==this._activeObject&&"up"===n.activeOn)this.setActiveObject(n,t),l=!0;else if(i){let e=i.getMouseUpHandler(t,n,i);e&&(o=this.getScenePoint(t),e.call(i,t,r,o.x,o.y))}n.isMoving=!1}if(r&&(r.target!==n||r.corner!==a)){let e=r.target&&r.target.controls[r.corner],i=e&&e.getMouseUpHandler(t,r.target,e);o=o||this.getScenePoint(t),i&&i.call(e,t,r,o.x,o.y)}this._setCursorFromEvent(t,n),this._handleEvent(t,"up"),this._groupSelector=null,this._currentTransform=null,n&&(n.__corner=void 0),l?this.requestRenderAll():i||null!=(e=this._activeObject)&&e.isEditing||this.renderTop()}_basicEventHandler(t,e){let{target:r,subTargets:i=[]}=e;this.fire(t,e),r&&r.fire(t,e);for(let n=0;n{r=t.hoverCursor||r}),this.setCursor(r)}handleMultiSelection(t,e){let r=this._activeObject,i=eM(r);if(r&&this._isSelectionKeyPressed(t)&&this.selection&&e&&e.selectable&&(r!==e||i)&&(i||!e.isDescendantOf(r)&&!r.isDescendantOf(e))&&!e.onSelect({e:t})&&!r.getActiveControl()){if(i){let i=r.getObjects();if(e===r){let r=this.getViewportPoint(t);if(!(e=this.searchPossibleTargets(i,r)||this.searchPossibleTargets(this._objects,r))||!e.selectable)return!1}e.group===r?(r.remove(e),this._hoveredTarget=e,this._hoveredTargets=[...this.targets],1===r.size()&&this._setActiveObject(r.item(0),t)):(r.multiSelectAdd(e),this._hoveredTarget=r,this._hoveredTargets=[...this.targets]),this._fireSelectionEvents(i,t)}else{r.isEditing&&r.exitEditing();let i=new(tY.getClass("ActiveSelection"))([],{canvas:this});i.multiSelectAdd(r,e),this._hoveredTarget=i,this._setActiveObject(i,t),this._fireSelectionEvents([r],t)}return!0}return!1}handleSelection(t){if(!this.selection||!this._groupSelector)return!1;let{x:e,y:r,deltaX:i,deltaY:n}=this._groupSelector,s=new tJ(e,r),o=s.add(new tJ(i,n)),a=s.min(o),l=s.max(o).subtract(a),h=this.collectObjects({left:a.x,top:a.y,width:l.x,height:l.y},{includeIntersecting:!this.selectionFullyContained}),c=s.eq(o)?h[0]?[h[0]]:[]:h.length>1?h.filter(e=>!e.onSelect({e:t})).reverse():h;if(1===c.length)this.setActiveObject(c[0],t);else if(c.length>1){let e=tY.getClass("ActiveSelection");this.setActiveObject(new e(c,{canvas:this}),t)}return this._groupSelector=null,!0}clear(){this.textEditingManager.clear(),super.clear()}destroy(){this.removeListeners(),this.textEditingManager.dispose(),super.destroy()}constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),Z(this,"_isClick",void 0),Z(this,"textEditingManager",new n5(this)),["_onMouseDown","_onTouchStart","_onMouseMove","_onMouseUp","_onTouchEnd","_onResize","_onMouseWheel","_onMouseOut","_onMouseEnter","_onContextMenu","_onClick","_onDragStart","_onDragEnd","_onDragProgress","_onDragOver","_onDragEnter","_onDragLeave","_onDrop"].forEach(t=>{this[t]=this[t].bind(this)}),this.addOrRemove(n6,"add")}}let se={x1:0,y1:0,x2:0,y2:0},sr=tt(tt({},se),{},{r1:0,r2:0}),si=(t,e)=>isNaN(t)&&"number"==typeof e?e:t,sn=/^(\d+\.\d+)%|(\d+)%$/;function ss(t){return t&&sn.test(t)}function so(t,e){return rX(0,si("number"==typeof t?t:"string"==typeof t?parseFloat(t)/(ss(t)?100:1):NaN,e),1)}let sa=/\s*;\s*/,sl=/\s*:\s*/;function sh(t){return"linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?"linear":"radial"}function sc(t){return"userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage"}function su(t,e){return t.getAttribute(e)}class sd{addColorStop(t){for(let e in t){let r=new rs(t[e]);this.colorStops.push({offset:parseFloat(e),color:r.toRgb(),opacity:r.getAlpha()})}return this}toObject(t){return tt(tt({},e_(this,t)),{},{type:this.type,coords:tt({},this.coords),colorStops:this.colorStops.map(t=>tt({},t)),offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?[...this.gradientTransform]:void 0})}toSVG(t){let{additionalTransform:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],i=this.gradientTransform?this.gradientTransform.concat():t_.concat(),n="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox",s=this.colorStops.map(t=>tt({},t)).sort((t,e)=>t.offset-e.offset),o=-this.offsetX,a=-this.offsetY;"objectBoundingBox"===n?(o/=t.width,a/=t.height):(o+=t.width/2,a+=t.height/2),t&&"function"==typeof t._renderPathCommands&&"percentage"!==this.gradientUnits&&(o-=t.pathOffset.x,a-=t.pathOffset.y),i[4]-=o,i[5]-=a;let l=['id="SVGID_'.concat(this.id,'"'),'gradientUnits="'.concat(n,'"'),'gradientTransform="'.concat(e?e+" ":"").concat(eS(i),'"'),""].join(" ");if("linear"===this.type){let{x1:t,y1:e,x2:i,y2:n}=this.coords;r.push("\n')}else if("radial"===this.type){let{x1:t,y1:e,x2:i,y2:n,r1:o,r2:a}=this.coords,h=o>a;r.push("\n'),h&&(s.reverse(),s.forEach(t=>{t.offset=1-t.offset}));let c=Math.min(o,a);if(c>0){let t=c/Math.max(o,a);s.forEach(e=>{e.offset+=t*(1-e.offset)})}}return s.forEach(t=>{let{color:e,offset:i,opacity:n}=t;r.push("\n')}),r.push("linear"===this.type?"":"","\n"),r.join("")}toLive(t){let{x1:e,y1:r,x2:i,y2:n,r1:s,r2:o}=this.coords,a="linear"===this.type?t.createLinearGradient(e,r,i,n):t.createRadialGradient(e,r,s,i,n,o);return this.colorStops.forEach(t=>{let{color:e,opacity:r,offset:i}=t;a.addColorStop(i,void 0!==r?new rs(e).setAlpha(r).toRgba():e)}),a}static async fromObject(t){let{colorStops:e,gradientTransform:r}=t;return new this(tt(tt({},t),{},{colorStops:e?e.map(t=>tt({},t)):void 0,gradientTransform:r?[...r]:void 0}))}static fromElement(t,e,r){var i;let n=sc(t),s=e._findCenterFromElement();return new this(tt({id:t.getAttribute("id")||void 0,type:sh(t),coords:(i={width:r.viewBoxWidth||r.width,height:r.viewBoxHeight||r.height},function(t,e){let r,{width:i,height:n,gradientUnits:s}=e;return Object.keys(t).reduce((e,o)=>{let a=t[o];return"Infinity"===a?r=1:"-Infinity"===a?r=0:(r="string"==typeof a?parseFloat(a):a,"string"==typeof a&&ss(a)&&(r*=.01,"pixels"===s&&("x1"!==o&&"x2"!==o&&"r2"!==o||(r*=i),"y1"!==o&&"y2"!==o||(r*=n)))),e[o]=r,e},{})}("linear"===sh(t)?{x1:su(t,"x1")||0,y1:su(t,"y1")||0,x2:su(t,"x2")||"100%",y2:su(t,"y2")||0}:{x1:su(t,"fx")||su(t,"cx")||"50%",y1:su(t,"fy")||su(t,"cy")||"50%",r1:0,x2:su(t,"cx")||"50%",y2:su(t,"cy")||"50%",r2:su(t,"r")||"50%"},tt(tt({},i),{},{gradientUnits:sc(t)}))),colorStops:function(t,e){let r=[],i=t.getElementsByTagName("stop"),n=so(e,1);for(let t=i.length;t--;)r.push(function(t,e){let r,i,n=t.getAttribute("style");if(n){let t=n.split(sa);""===t[t.length-1]&&t.pop();for(let e=t.length;e--;){let[n,s]=t[e].split(sl).map(t=>t.trim());"stop-color"===n?r=s:"stop-opacity"===n&&(i=s)}}let s=new rs(r||t.getAttribute("stop-color")||"rgb(0,0,0)");return{offset:so(t.getAttribute("offset"),0),color:s.toRgb(),opacity:si(parseFloat(i||t.getAttribute("stop-opacity")||""),1)*s.getAlpha()*e}}(i[t],n));return r}(t,r.opacity),gradientUnits:n,gradientTransform:na(t.getAttribute("gradientTransform")||"")},"pixels"===n?{offsetX:e.width/2-s.x,offsetY:e.height/2-s.y}:{offsetX:0,offsetY:0}))}constructor(t){let{type:e="linear",gradientUnits:r="pixels",coords:i={},colorStops:n=[],offsetX:s=0,offsetY:o=0,gradientTransform:a,id:l}=t||{};Object.assign(this,{type:e,gradientUnits:r,coords:tt(tt({},"radial"===e?sr:se),i),colorStops:n,offsetX:s,offsetY:o,gradientTransform:a,id:l?"".concat(l,"_").concat(t3()):t3()})}}Z(sd,"type","Gradient"),tY.setClass(sd,"gradient"),tY.setClass(sd,"linear"),tY.setClass(sd,"radial");let sf=["type","source","patternTransform"];class sg{get type(){return"pattern"}set type(t){ts("warn","Setting type has no effect",t)}isImageSource(){return!!this.source&&"string"==typeof this.source.src}isCanvasSource(){return!!this.source&&!!this.source.toDataURL}sourceToString(){return this.isImageSource()?this.source.src:this.isCanvasSource()?this.source.toDataURL():""}toLive(t){return this.source&&(!this.isImageSource()||this.source.complete&&0!==this.source.naturalWidth&&0!==this.source.naturalHeight)?t.createPattern(this.source,this.repeat):null}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],{repeat:e,crossOrigin:r}=this;return tt(tt({},e_(this,t)),{},{type:"pattern",source:this.sourceToString(),repeat:e,crossOrigin:r,offsetX:eC(this.offsetX,tn.NUM_FRACTION_DIGITS),offsetY:eC(this.offsetY,tn.NUM_FRACTION_DIGITS),patternTransform:this.patternTransform?[...this.patternTransform]:null})}toSVG(t){let{width:e,height:r}=t,{source:i,repeat:n,id:s}=this,o=si(this.offsetX/e,0),a=si(this.offsetY/r,0),l="repeat-y"===n||"no-repeat"===n?1+Math.abs(o||0):si(i.width/e,0),h="repeat-x"===n||"no-repeat"===n?1+Math.abs(a||0):si(i.height/r,0);return[''),''),"\n"].join("\n")}static async fromObject(t,e){let{type:r,source:i,patternTransform:n}=t,s=te(t,sf),o=await ey(i,tt(tt({},e),{},{crossOrigin:s.crossOrigin}));return new this(tt(tt({},s),{},{patternTransform:n&&n.slice(0),source:o}))}constructor(t){Z(this,"repeat","repeat"),Z(this,"offsetX",0),Z(this,"offsetY",0),Z(this,"crossOrigin",""),this.id=t3(),Object.assign(this,t)}}Z(sg,"type","Pattern"),tY.setClass(sg),tY.setClass(sg,"pattern");class sp{_setBrushStyles(t){t.strokeStyle=this.color,t.lineWidth=this.width,t.lineCap=this.strokeLineCap,t.miterLimit=this.strokeMiterLimit,t.lineJoin=this.strokeLineJoin,t.setLineDash(this.strokeDashArray||[])}_saveAndTransform(t){let e=this.canvas.viewportTransform;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}needsFullRender(){return 1>new rs(this.color).getAlpha()||!!this.shadow}_setShadow(){if(!this.shadow||!this.canvas)return;let t=this.canvas,e=this.shadow,r=t.contextTop,i=t.getZoom()*t.getRetinaScaling();r.shadowColor=e.color,r.shadowBlur=e.blur*i,r.shadowOffsetX=e.offsetX*i,r.shadowOffsetY=e.offsetY*i}_resetShadow(){let t=this.canvas.contextTop;t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0}_isOutSideCanvas(t){return t.x<0||t.x>this.canvas.getWidth()||t.y<0||t.y>this.canvas.getHeight()}constructor(t){Z(this,"color","rgb(0, 0, 0)"),Z(this,"width",1),Z(this,"shadow",null),Z(this,"strokeLineCap","round"),Z(this,"strokeLineJoin","round"),Z(this,"strokeMiterLimit",10),Z(this,"strokeDashArray",null),Z(this,"limitedToCanvasSize",!1),this.canvas=t}}let sm=["path","left","top"],sv=["d"];class sy extends iW{_setPath(t,e){this.path=nI(Array.isArray(t)?t:nJ(t)),this.setBoundingBox(e)}_findCenterFromElement(){let t=this._calcBoundsFromPath();return new tJ(t.left+t.width/2,t.top+t.height/2)}_renderPathCommands(t){let e=-this.pathOffset.x,r=-this.pathOffset.y;for(let i of(t.beginPath(),this.path))switch(i[0]){case"L":t.lineTo(i[1]+e,i[2]+r);break;case"M":t.moveTo(i[1]+e,i[2]+r);break;case"C":t.bezierCurveTo(i[1]+e,i[2]+r,i[3]+e,i[4]+r,i[5]+e,i[6]+r);break;case"Q":t.quadraticCurveTo(i[1]+e,i[2]+r,i[3]+e,i[4]+r);break;case"Z":t.closePath()}}_render(t){this._renderPathCommands(t),this._renderPaintInOrder(t)}toString(){return"#")}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return tt(tt({},super.toObject(t)),{},{path:this.path.map(t=>t.slice())})}toDatalessObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.toObject(t);return this.sourcePath&&(delete e.path,e.sourcePath=this.sourcePath),e}_toSVG(){let t=n$(this.path,tn.NUM_FRACTION_DIGITS);return["\n')]}_getOffsetTransform(){let t=tn.NUM_FRACTION_DIGITS;return" translate(".concat(eC(-this.pathOffset.x,t),", ").concat(eC(-this.pathOffset.y,t),")")}toClipPathSVG(t){let e=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})}toSVG(t){let e=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})}complexity(){return this.path.length}setDimensions(){this.setBoundingBox()}setBoundingBox(t){let{width:e,height:r,pathOffset:i}=this._calcDimensions();this.set({width:e,height:r,pathOffset:i}),t&&this.setPositionByOrigin(i,tw,tw)}_calcBoundsFromPath(){let t=[],e=0,r=0,i=0,n=0;for(let s of this.path)switch(s[0]){case"L":i=s[1],n=s[2],t.push({x:e,y:r},{x:i,y:n});break;case"M":i=s[1],n=s[2],e=i,r=n;break;case"C":t.push(...nL(i,n,s[1],s[2],s[3],s[4],s[5],s[6])),i=s[5],n=s[6];break;case"Q":t.push(...nL(i,n,s[1],s[2],s[1],s[2],s[3],s[4])),i=s[3],n=s[4];break;case"Z":i=e,n=r}return eH(t)}_calcDimensions(){let t=this._calcBoundsFromPath();return tt(tt({},t),{},{pathOffset:new tJ(t.left+t.width/2,t.top+t.height/2)})}static fromObject(t){return this._fromObject(t,{extraParam:"path"})}static async fromElement(t,e,r){let i=nh(t,this.ATTRIBUTE_NAMES,r),{d:n}=i;return new this(n,tt(tt(tt({},te(i,sv)),e),{},{left:void 0,top:void 0}))}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{path:r,left:i,top:n}=e,s=te(e,sm);super(),Object.assign(this,sy.ownDefaults),this.setOptions(s),this._setPath(t||[],!0),"number"==typeof i&&this.set(tC,i),"number"==typeof n&&this.set("top",n)}}Z(sy,"type","Path"),Z(sy,"cacheProperties",[...rY,"path","fillRule"]),Z(sy,"ATTRIBUTE_NAMES",[...i2,"d"]),tY.setClass(sy),tY.setSVGClass(sy);class sx extends sp{needsFullRender(){return super.needsFullRender()||this._hasStraightLine}static drawSegment(t,e,r){let i=e.midPointFrom(r);return t.quadraticCurveTo(e.x,e.y,i.x,i.y),i}onMouseDown(t,e){let{e:r}=e;this.canvas._isMainEvent(r)&&(this.drawStraightLine=!!this.straightLineKey&&r[this.straightLineKey],this._prepareForDrawing(t),this._addPoint(t),this._render())}onMouseMove(t,e){let{e:r}=e;if(this.canvas._isMainEvent(r)&&(this.drawStraightLine=!!this.straightLineKey&&r[this.straightLineKey],(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(t))&&this._addPoint(t)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{let t=this._points,e=t.length,r=this.canvas.contextTop;this._saveAndTransform(r),this.oldEnd&&(r.beginPath(),r.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=sx.drawSegment(r,t[e-2],t[e-1]),r.stroke(),r.restore()}}onMouseUp(t){let{e:e}=t;return!this.canvas._isMainEvent(e)||(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1)}_prepareForDrawing(t){this._reset(),this._addPoint(t),this.canvas.contextTop.moveTo(t.x,t.y)}_addPoint(t){return!(this._points.length>1&&t.eq(this._points[this._points.length-1]))&&(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(t),!0)}_reset(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1}_render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.canvas.contextTop,e=this._points[0],r=this._points[1];if(this._saveAndTransform(t),t.beginPath(),2===this._points.length&&e.x===r.x&&e.y===r.y){let t=this.width/1e3;e.x-=t,r.x+=t}t.moveTo(e.x,e.y);for(let i=1;i=i&&s.push(r=t[e]);return s.push(t[n]),s}_finalizeAndAddPath(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));let t=this.convertPointsToSVGPath(this._points);if("M 0 0 Q 0 0 0 0 L 0 0"===n$(t))return void this.canvas.requestRenderAll();let e=this.createPath(t);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:e}),this.canvas.add(e),this.canvas.requestRenderAll(),e.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:e})}constructor(t){super(t),Z(this,"decimate",.4),Z(this,"drawStraightLine",!1),Z(this,"straightLineKey","shiftKey"),this._points=[],this._hasStraightLine=!1}}let sb=["left","top","radius"],s_=["radius","startAngle","endAngle","counterClockwise"];class sw extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),sw.ownDefaults)}_set(t,e){return super._set(t,e),"radius"===t&&this.setRadius(e),this}_render(t){t.beginPath(),t.arc(0,0,this.radius,ee(this.startAngle),ee(this.endAngle),this.counterClockwise),this._renderPaintInOrder(t)}getRadiusX(){return this.get("radius")*this.get(tI)}getRadiusY(){return this.get("radius")*this.get(tB)}setRadius(t){this.radius=t,this.set({width:2*t,height:2*t})}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject([...s_,...t])}_toSVG(){let t=(this.endAngle-this.startAngle)%360;if(0===t)return["\n'];{let{radius:e}=this,r=ee(this.startAngle),i=ee(this.endAngle),n=tK(r)*e,s=tQ(r)*e,o=tK(i)*e,a=tQ(i)*e,l=+!this.counterClockwise;return['180)," ").concat(l," ").concat(o," ").concat(a,'" '),"COMMON_PARTS"," />\n"]}}static async fromElement(t,e,r){let i=nh(t,this.ATTRIBUTE_NAMES,r),{left:n=0,top:s=0,radius:o=0}=i;return new this(tt(tt({},te(i,sb)),{},{radius:o,left:n-o,top:s-o}))}static fromObject(t){return super._fromObject(t)}constructor(t){super(),Object.assign(this,sw.ownDefaults),this.setOptions(t)}}Z(sw,"type","Circle"),Z(sw,"cacheProperties",[...rY,...s_]),Z(sw,"ownDefaults",{radius:0,startAngle:0,endAngle:360,counterClockwise:!1}),Z(sw,"ATTRIBUTE_NAMES",["cx","cy","r",...i2]),tY.setClass(sw),tY.setSVGClass(sw);let sC=["x1","y1","x2","y2"],sS=["x1","y1","x2","y2"],sT=["x1","x2","y1","y2"];class sO extends iW{_setWidthHeight(){let{x1:t,y1:e,x2:r,y2:i}=this;this.width=Math.abs(r-t),this.height=Math.abs(i-e);let{left:n,top:s,width:o,height:a}=eH([{x:t,y:e},{x:r,y:i}]),l=new tJ(n+o/2,s+a/2);this.setPositionByOrigin(l,tw,tw)}_set(t,e){return super._set(t,e),sT.includes(t)&&this._setWidthHeight(),this}_render(t){var e;t.beginPath();let r=this.calcLinePoints();t.moveTo(r.x1,r.y1),t.lineTo(r.x2,r.y2),t.lineWidth=this.strokeWidth;let i=t.strokeStyle;eT(this.stroke)?t.strokeStyle=this.stroke.toLive(t):t.strokeStyle=null!=(e=this.stroke)?e:t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=i}_findCenterFromElement(){return new tJ((this.x1+this.x2)/2,(this.y1+this.y2)/2)}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return tt(tt({},super.toObject(t)),this.calcLinePoints())}_getNonTransformedDimensions(){let t=super._getNonTransformedDimensions();return"butt"===this.strokeLineCap&&(0===this.width&&(t.y-=this.strokeWidth),0===this.height&&(t.x-=this.strokeWidth)),t}calcLinePoints(){let{x1:t,x2:e,y1:r,y2:i,width:n,height:s}=this,o=t<=e?-1:1,a=r<=i?-1:1;return{x1:o*n/2,x2:-(o*n)/2,y1:a*s/2,y2:-(a*s)/2}}_toSVG(){let{x1:t,x2:e,y1:r,y2:i}=this.calcLinePoints();return["\n')]}static async fromElement(t,e,r){let i=nh(t,this.ATTRIBUTE_NAMES,r),{x1:n=0,y1:s=0,x2:o=0,y2:a=0}=i;return new this([n,s,o,a],te(i,sC))}static fromObject(t){let{x1:e,y1:r,x2:i,y2:n}=t,s=te(t,sS);return this._fromObject(tt(tt({},s),{},{points:[e,r,i,n]}),{extraParam:"points"})}constructor(){let[t,e,r,i]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Object.assign(this,sO.ownDefaults),this.setOptions(n),this.x1=t,this.x2=r,this.y1=e,this.y2=i,this._setWidthHeight();let{left:s,top:o}=n;"number"==typeof s&&this.set(tC,s),"number"==typeof o&&this.set("top",o)}}Z(sO,"type","Line"),Z(sO,"cacheProperties",[...rY,...sT]),Z(sO,"ATTRIBUTE_NAMES",i2.concat(sT)),tY.setClass(sO),tY.setSVGClass(sO);class sk extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),sk.ownDefaults)}_render(t){let e=this.width/2,r=this.height/2;t.beginPath(),t.moveTo(-e,r),t.lineTo(0,-r),t.lineTo(e,r),t.closePath(),this._renderPaintInOrder(t)}_toSVG(){let t=this.width/2,e=this.height/2;return["']}constructor(t){super(),Object.assign(this,sk.ownDefaults),this.setOptions(t)}}Z(sk,"type","Triangle"),Z(sk,"ownDefaults",{width:100,height:100}),tY.setClass(sk),tY.setSVGClass(sk);let sM=["rx","ry"];class sE extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),sE.ownDefaults)}_set(t,e){switch(super._set(t,e),t){case"rx":this.rx=e,this.set("width",2*e);break;case"ry":this.ry=e,this.set("height",2*e)}return this}getRx(){return this.get("rx")*this.get(tI)}getRy(){return this.get("ry")*this.get(tB)}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject([...sM,...t])}_toSVG(){return["\n')]}_render(t){t.beginPath(),t.save(),t.transform(1,0,0,this.ry/this.rx,0,0),t.arc(0,0,this.rx,0,tx,!1),t.restore(),this._renderPaintInOrder(t)}static async fromElement(t,e,r){let i=nh(t,this.ATTRIBUTE_NAMES,r);return i.left=(i.left||0)-i.rx,i.top=(i.top||0)-i.ry,new this(i)}constructor(t){super(),Object.assign(this,sE.ownDefaults),this.setOptions(t)}}Z(sE,"type","Ellipse"),Z(sE,"cacheProperties",[...rY,...sM]),Z(sE,"ownDefaults",{rx:0,ry:0}),Z(sE,"ATTRIBUTE_NAMES",[...i2,"cx","cy","rx","ry"]),tY.setClass(sE),tY.setSVGClass(sE);let sD=["left","top"],sj={exactBoundingBox:!1};class sA extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),sA.ownDefaults)}isOpen(){return!0}_projectStrokeOnPoints(t){return iz(this.points,t,this.isOpen())}_calcDimensions(t){t=tt({scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,strokeLineCap:this.strokeLineCap,strokeLineJoin:this.strokeLineJoin,strokeMiterLimit:this.strokeMiterLimit,strokeUniform:this.strokeUniform,strokeWidth:this.strokeWidth},t||{});let e=this.exactBoundingBox?this._projectStrokeOnPoints(t).map(t=>t.projectedPoint):this.points;if(0===e.length)return{left:0,top:0,width:0,height:0,pathOffset:new tJ,strokeOffset:new tJ,strokeDiff:new tJ};let r=eH(e),i=em(tt(tt({},t),{},{scaleX:1,scaleY:1})),n=eH(this.points.map(t=>en(t,i,!0))),s=new tJ(this.scaleX,this.scaleY),o=r.left+r.width/2,a=r.top+r.height/2;return this.exactBoundingBox&&(o-=a*Math.tan(ee(this.skewX)),a-=o*Math.tan(ee(this.skewY))),tt(tt({},r),{},{pathOffset:new tJ(o,a),strokeOffset:new tJ(n.left,n.top).subtract(new tJ(r.left,r.top)).multiply(s),strokeDiff:new tJ(r.width,r.height).subtract(new tJ(n.width,n.height)).multiply(s)})}_findCenterFromElement(){let t=eH(this.points);return new tJ(t.left+t.width/2,t.top+t.height/2)}setDimensions(){this.setBoundingBox()}setBoundingBox(t){let{left:e,top:r,width:i,height:n,pathOffset:s,strokeOffset:o,strokeDiff:a}=this._calcDimensions();this.set({width:i,height:n,pathOffset:s,strokeOffset:o,strokeDiff:a}),t&&this.setPositionByOrigin(new tJ(e+i/2,r+n/2),tw,tw)}isStrokeAccountedForInDimensions(){return this.exactBoundingBox}_getNonTransformedDimensions(){return this.exactBoundingBox?new tJ(this.width,this.height):super._getNonTransformedDimensions()}_getTransformedDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.exactBoundingBox){var e,r,i,n;let s;if(Object.keys(t).some(t=>this.strokeUniform||this.constructor.layoutProperties.includes(t))){let{width:i,height:n}=this._calcDimensions(t);s=new tJ(null!=(e=t.width)?e:i,null!=(r=t.height)?r:n)}else s=new tJ(null!=(i=t.width)?i:this.width,null!=(n=t.height)?n:this.height);return s.multiply(new tJ(t.scaleX||this.scaleX,t.scaleY||this.scaleY))}return super._getTransformedDimensions(t)}_set(t,e){let r=this.initialized&&this[t]!==e,i=super._set(t,e);return this.exactBoundingBox&&r&&((t===tI||t===tB)&&this.strokeUniform&&this.constructor.layoutProperties.includes("strokeUniform")||this.constructor.layoutProperties.includes(t))&&this.setDimensions(),i}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return tt(tt({},super.toObject(t)),{},{points:this.points.map(t=>{let{x:e,y:r}=t;return{x:e,y:r}})})}_toSVG(){let t=[],e=this.pathOffset.x,r=this.pathOffset.y,i=tn.NUM_FRACTION_DIGITS;for(let n=0,s=this.points.length;n\n')]}_render(t){let e=this.points.length,r=this.pathOffset.x,i=this.pathOffset.y;if(e&&!isNaN(this.points[e-1].y)){t.beginPath(),t.moveTo(this.points[0].x-r,this.points[0].y-i);for(let n=0;n0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Z(this,"strokeDiff",void 0),Object.assign(this,sA.ownDefaults),this.setOptions(e),this.points=t;let{left:r,top:i}=e;this.initialized=!0,this.setBoundingBox(!0),"number"==typeof r&&this.set(tC,r),"number"==typeof i&&this.set("top",i)}}Z(sA,"ownDefaults",sj),Z(sA,"type","Polyline"),Z(sA,"layoutProperties",[tN,tW,"strokeLineCap","strokeLineJoin","strokeMiterLimit","strokeWidth","strokeUniform","points"]),Z(sA,"cacheProperties",[...rY,"points"]),Z(sA,"ATTRIBUTE_NAMES",[...i2]),tY.setClass(sA),tY.setSVGClass(sA);class sP extends sA{isOpen(){return!1}}Z(sP,"ownDefaults",sj),Z(sP,"type","Polygon"),tY.setClass(sP),tY.setSVGClass(sP);class sF extends iW{isEmptyStyles(t){if(!this.styles||void 0!==t&&!this.styles[t])return!0;let e=void 0===t?this.styles:{line:this.styles[t]};for(let t in e)for(let r in e[t])for(let i in e[t][r])return!1;return!0}styleHas(t,e){if(!this.styles||void 0!==e&&!this.styles[e])return!1;let r=void 0===e?this.styles:{0:this.styles[e]};for(let e in r)for(let i in r[e])if(void 0!==r[e][i][t])return!0;return!1}cleanStyle(t){if(!this.styles)return!1;let e=this.styles,r,i,n=0,s=!0,o=0;for(let o in e){for(let a in r=0,e[o]){let l=e[o][a]||{};n++,void 0!==l[t]?(i?l[t]!==i&&(s=!1):i=l[t],l[t]===this[t]&&delete l[t]):s=!1,0!==Object.keys(l).length?r++:delete e[o][a]}0===r&&delete e[o]}for(let t=0;tvoid 0!==t);this._setStyleDeclaration(r,i,n)}getSelectionStyles(t,e,r){let i=[];for(let n=t;n<(e||t);n++)i.push(this.getStyleAtPosition(n,r));return i}getStyleAtPosition(t,e){let{lineIndex:r,charIndex:i}=this.get2DCursorLocation(t);return e?this.getCompleteStyleDeclaration(r,i):this._getStyleDeclaration(r,i)}setSelectionStyles(t,e,r){for(let i=e;i<(r||e);i++)this._extendStyles(i,t);this._forceClearCache=!0}_getStyleDeclaration(t,e){var r;let i=this.styles&&this.styles[t];return i&&null!=(r=i[e])?r:{}}getCompleteStyleDeclaration(t,e){return tt(tt({},e_(this,this.constructor._styleProperties)),this._getStyleDeclaration(t,e))}_setStyleDeclaration(t,e,r){this.styles[t][e]=r}_deleteStyleDeclaration(t,e){delete this.styles[t][e]}_getLineStyle(t){return!!this.styles[t]}_setLineStyle(t){this.styles[t]={}}_deleteLineStyle(t){delete this.styles[t]}}Z(sF,"_styleProperties",rm);let sL=/ +/g,sR=/"/g;function sI(t,e,r,i,n){return" ".concat(function(t,e){let{left:r,top:i,width:n,height:s}=e,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tn.NUM_FRACTION_DIGITS,a=rl(tU,t,!1),[l,h,c,u]=[r,i,n,s].map(t=>eC(t,o));return"')}(t,{left:e,top:r,width:i,height:n}),"\n")}let sB=["textAnchor","textDecoration","dx","dy","top","left","fontSize","strokeWidth"];class sN extends sF{static getDefaults(){return tt(tt({},super.getDefaults()),sN.ownDefaults)}setPathInfo(){let t=this.path;t&&(t.segmentsInfo=nY(t.path))}_splitText(){let t=this._splitTextIntoLines(this.text);return this.textLines=t.lines,this._textLines=t.graphemeLines,this._unwrappedTextLines=t._unwrappedLines,this._text=t.graphemeText,t}initDimensions(){this._splitText(),this._clearCache(),this.dirty=!0,this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),this.textAlign.includes(rv)&&this.enlargeSpaces()}enlargeSpaces(){let t,e,r,i,n,s,o;for(let a=0,l=this._textLines.length;a')}_getCacheCanvasDimensions(){let t=super._getCacheCanvasDimensions(),e=this.fontSize;return t.width+=e*t.zoomX,t.height+=e*t.zoomY,t}_render(t){let e=this.path;e&&!e.isNotVisible()&&e._render(t),this._setTextStyles(t),this._renderTextLinesBackground(t),this._renderTextDecoration(t,"underline"),this._renderText(t),this._renderTextDecoration(t,"overline"),this._renderTextDecoration(t,"linethrough")}_renderText(t){this.paintFirst===tH?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))}_setTextStyles(t,e,r){if(t.textBaseline="alphabetic",this.path)switch(this.pathAlign){case tw:t.textBaseline="middle";break;case"ascender":t.textBaseline="top";break;case"descender":t.textBaseline=tS}t.font=this._getFontDeclaration(e,r)}calcTextWidth(){let t=this.getLineWidth(0);for(let e=1,r=this._textLines.length;et&&(t=r)}return t}_renderTextLine(t,e,r,i,n,s){this._renderChars(t,e,r,i,n,s)}_renderTextLinesBackground(t){if(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))return;let e=t.fillStyle,r=this._getLeftOffset(),i=this._getTopOffset();for(let e=0,n=this._textLines.length;e=0:ie?t%=e:t<0&&(t+=e),this._setGraphemeOnPath(t,r),t+=r.kernedWidth}return{width:i,numOfSpaces:0}}_setGraphemeOnPath(t,e){let r=t+e.kernedWidth/2,i=this.path,n=nz(i.path,r,i.segmentsInfo);e.renderLeft=n.x-i.pathOffset.x,e.renderTop=n.y-i.pathOffset.y,e.angle=n.angle+(this.pathSide===tT?Math.PI:0)}_getGraphemeBox(t,e,r,i,n){let s=this.getCompleteStyleDeclaration(e,r),o=i?this.getCompleteStyleDeclaration(e,r-1):{},a=this._measureChar(t,s,i,o),l,h=a.kernedWidth,c=a.width;0!==this.charSpacing&&(c+=l=this._getWidthOfCharSpacing(),h+=l);let u={width:c,left:0,height:s.fontSize,kernedWidth:h,deltaY:s.deltaY};if(r>0&&!n){let t=this.__charBounds[e][r-1];u.left=t.left+t.width+a.kernedWidth-a.width}return u}getHeightOfLine(t){if(this.__lineHeights[t])return this.__lineHeights[t];let e=this.getHeightOfChar(t,0);for(let r=1,i=this._textLines[t].length;r0){let e=this.fontSize*y/1e3,r=i+d+f;"rtl"===this.direction&&(r=this.width-r-g),p&&m&&y&&(t.fillStyle=m,t.fillRect(r,w+a*C+S-o*e,g,e)),f=s.left,g=s.width,p=x,y=_,m=b,C=h,S=c}else g+=s.kernedWidth}let T=i+d+f;"rtl"===this.direction&&(T=this.width-T-g),t.fillStyle=b;let O=this.fontSize*_/1e3;x&&b&&_&&t.fillRect(T,w+a*C+S-o*O,g-s,O),r+=h}this._removeShadow(t)}_getFontDeclaration(){let{fontFamily:t=this.fontFamily,fontStyle:e=this.fontStyle,fontWeight:r=this.fontWeight,fontSize:i=this.fontSize}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,s=t.includes("'")||t.includes('"')||t.includes(",")||sN.genericFonts.includes(t.toLowerCase())?t:'"'.concat(t,'"');return[e,r,"".concat(n?this.CACHE_FONT_SIZE:i,"px"),s].join(" ")}render(t){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._forceClearCache&&this.initDimensions(),super.render(t)))}graphemeSplit(t){return iK(t)}_splitTextIntoLines(t){let e=t.split(this._reNewline),r=Array(e.length),i=["\n"],n=[];for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:[];return tt(tt({},super.toObject([...rp,...t])),{},{styles:i0(this.styles,this.text)},this.path?{path:this.path.toObject()}:{})}set(t,e){let{textLayoutProperties:r}=this.constructor;super.set(t,e);let i=!1,n=!1;if("object"==typeof t)for(let e in t)"path"===e&&this.setPathInfo(),i=i||r.includes(e),n=n||"path"===e;else i=r.includes(t),n="path"===t;return n&&this.setPathInfo(),i&&this.initialized&&(this.initDimensions(),this.setCoords()),this}complexity(){return 1}static async fromElement(t,e,r){let i=nh(t,sN.ATTRIBUTE_NAMES,r),n=tt(tt({},e),i),{textAnchor:s=tC,textDecoration:o="",dx:a=0,dy:l=0,top:h=0,left:c=0,fontSize:u=16,strokeWidth:d=1}=n,f=te(n,sB),g=new this((t.textContent||"").replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," "),tt({left:c+a,top:h+l,underline:o.includes("underline"),overline:o.includes("overline"),linethrough:o.includes("line-through"),strokeWidth:0,fontSize:u},f)),p=g.getScaledHeight()/g.height,m=((g.height+g.strokeWidth)*g.lineHeight-g.height)*p,y=g.getScaledHeight()+m,x=0;return s===tw&&(x=g.getScaledWidth()/2),s===tT&&(x=g.getScaledWidth()),g.set({left:g.left-x,top:g.top-(y-g.fontSize*(.07+g._fontSizeFraction))/g.lineHeight,strokeWidth:d}),g}static fromObject(t){return this._fromObject(tt(tt({},t),{},{styles:i1(t.styles||{},t.text)}),{extraParam:"text"})}constructor(t,e){super(),Z(this,"__charBounds",[]),Object.assign(this,sN.ownDefaults),this.setOptions(e),this.styles||(this.styles={}),this.text=t,this.initialized=!0,this.path&&this.setPathInfo(),this.initDimensions(),this.setCoords()}}Z(sN,"textLayoutProperties",rg),Z(sN,"cacheProperties",[...rY,...rp]),Z(sN,"ownDefaults",{_reNewline:tk,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:tC,fontStyle:"normal",lineHeight:1.16,textBackgroundColor:"",stroke:null,shadow:null,path:void 0,pathStartOffset:0,pathSide:tC,pathAlign:"baseline",charSpacing:0,deltaY:0,direction:"ltr",CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.28167,overline:-.81333},_fontSizeMult:1.13,[ru]:66.667}),Z(sN,"type","Text"),Z(sN,"genericFonts",["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]),Z(sN,"ATTRIBUTE_NAMES",i2.concat("x","y","dx","dy","font-family","font-style","font-weight","font-size","letter-spacing","text-decoration","text-anchor")),iN(sN,[class extends rh{_toSVG(){let t=this._getSVGLeftTopOffsets(),e=this._getSVGTextAndBg(t.textTop,t.textLeft);return this._wrapSVGTextAndBg(e)}toSVG(t){let e=this._createBaseSVGMarkup(this._toSVG(),{reviver:t,noStyle:!0,withShadow:!0}),r=this.path;return r?e+r._createBaseSVGMarkup(r._toSVG(),{reviver:t,withShadow:!0,additionalTransform:eS(this.calcOwnMatrix())}):e}_getSVGLeftTopOffsets(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}}_wrapSVGTextAndBg(t){let{textBgRects:e,textSpans:r}=t,i=this.getSvgTextDecoration(this);return[e.join(""),' ",r.join(""),"\n"]}_getSVGTextAndBg(t,e){let r=[],i=[],n,s=t;this.backgroundColor&&i.push(...sI(this.backgroundColor,-this.width/2,-this.height/2,this.width,this.height));for(let t=0,o=this._textLines.length;t").concat(iq(t),"")}_setSVGTextLineText(t,e,r,i){let n=this.getHeightOfLine(e),s=this.textAlign.includes(rv),o=this._textLines[e],a,l,h,c,u,d="",f=0;i+=n*(1-this._fontSizeFraction)/this.lineHeight;for(let n=0,g=o.length-1;n<=g;n++)u=n===g||this.charSpacing||this.path,d+=o[n],h=this.__charBounds[e][n],0===f?(r+=h.kernedWidth-h.width,f+=h.width):f+=h.kernedWidth,s&&!u&&this._reSpaceAndTab.test(o[n])&&(u=!0),u||(u=i$(a=a||this.getCompleteStyleDeclaration(e,n),l=this.getCompleteStyleDeclaration(e,n+1),!0)),u&&(c=this._getStyleDeclaration(e,n),t.push(this._createTextCharSpan(d,c,r,i,h)),d="",a=l,"rtl"===this.direction?r-=f:r+=f,f=0)}_setSVGTextLineBg(t,e,r,i){let n=this._textLines[e],s=this.getHeightOfLine(e)/this.lineHeight,o,a=0,l=0,h=this.getValueOfPropertyAt(e,0,"textBackgroundColor");for(let c=0;ct[e.replace("-","")]).join(" ")}}]),tY.setClass(sN),tY.setSVGClass(sN);class sW{isPointerOverSelection(t){let e=this.target,r=e.getSelectionStartFromPointer(t);return e.isEditing&&r>=e.selectionStart&&r<=e.selectionEnd&&e.selectionStart{b.remove()},eD(t.target||this.target.hiddenTextarea).body.appendChild(b),null==(r=t.dataTransfer)||r.setDragImage(b,p.x,p.y)}onDragStart(t){this.__dragStartFired=!0;let e=this.target,r=this.isActive();if(r&&t.dataTransfer){let r=this.__dragStartSelection={selectionStart:e.selectionStart,selectionEnd:e.selectionEnd},i=e._text.slice(r.selectionStart,r.selectionEnd).join(""),n=tt({text:e.text,value:i},r);t.dataTransfer.setData("text/plain",i),t.dataTransfer.setData("application/fabric",JSON.stringify({value:i,styles:e.getSelectionStyles(r.selectionStart,r.selectionEnd,!0)})),t.dataTransfer.effectAllowed="copyMove",this.setDragImage(t,n)}return e.abortCursorAnimation(),r}canDrop(t){if(this.target.editable&&!this.target.getActiveControl()&&!t.defaultPrevented){if(this.isActive()&&this.__dragStartSelection){let e=this.target.getSelectionStartFromPointer(t),r=this.__dragStartSelection;return er.selectionEnd}return!0}return!1}targetCanDrop(t){return this.target.canDrop(t)}dragEnterHandler(t){let{e:e}=t,r=this.targetCanDrop(e);!this.__isDraggingOver&&r&&(this.__isDraggingOver=!0)}dragOverHandler(t){let{e:e}=t,r=this.targetCanDrop(e);!this.__isDraggingOver&&r?this.__isDraggingOver=!0:this.__isDraggingOver&&!r&&(this.__isDraggingOver=!1),this.__isDraggingOver&&(e.preventDefault(),t.canDrop=!0,t.dropTarget=this.target)}dragLeaveHandler(){(this.__isDraggingOver||this.isActive())&&(this.__isDraggingOver=!1)}dropHandler(t){var e;let{e:r}=t,i=r.defaultPrevented;this.__isDraggingOver=!1,r.preventDefault();let n=null==(e=r.dataTransfer)?void 0:e.getData("text/plain");if(n&&!i){let e=this.target,i=e.canvas,s=e.getSelectionStartFromPointer(r),{styles:o}=r.dataTransfer.types.includes("application/fabric")?JSON.parse(r.dataTransfer.getData("application/fabric")):{},a=n[Math.max(0,n.length-1)];if(this.__dragStartSelection){let t=this.__dragStartSelection.selectionStart,r=this.__dragStartSelection.selectionEnd;s>t&&s<=r?s=t:s>r&&(s-=r-t),e.removeChars(t,r),delete this.__dragStartSelection}e._reNewline.test(a)&&(e._reNewline.test(e._text[s])||s===e._text.length)&&(n=n.trimEnd()),t.didDrop=!0,t.dropTarget=e,e.insertChars(n,o,s),i.setActiveObject(e),e.enterEditing(r),e.selectionStart=Math.min(s+0,e._text.length),e.selectionEnd=Math.min(e.selectionStart+n.length,e._text.length),e.hiddenTextarea.value=e.text,e._updateTextarea(),e.hiddenTextarea.focus(),e.fire(tL,{index:s+0,action:"drop"}),i.fire("text:changed",{target:e}),i.contextTopDirty=!0,i.requestRenderAll()}}dragEndHandler(t){let{e:e}=t;if(this.isActive()&&this.__dragStartFired&&this.__dragStartSelection){var r;let t=this.target,i=this.target.canvas,{selectionStart:n,selectionEnd:s}=this.__dragStartSelection,o=(null==(r=e.dataTransfer)?void 0:r.dropEffect)||tO;o===tO?(t.selectionStart=n,t.selectionEnd=s,t._updateTextarea(),t.hiddenTextarea.focus()):(t.clearContextTop(),"move"===o&&(t.removeChars(n,s),t.selectionStart=t.selectionEnd=n,t.hiddenTextarea&&(t.hiddenTextarea.value=t.text),t._updateTextarea(),t.fire(tL,{index:n,action:"dragend"}),i.fire("text:changed",{target:t}),i.requestRenderAll()),t.exitEditing())}this.__dragImageDisposer&&this.__dragImageDisposer(),delete this.__dragImageDisposer,delete this.__dragStartSelection,this.__isDraggingOver=!1}dispose(){this._dispose&&this._dispose()}constructor(t){Z(this,"target",void 0),Z(this,"__mouseDownInPlace",!1),Z(this,"__dragStartFired",!1),Z(this,"__isDraggingOver",!1),Z(this,"__dragStartSelection",void 0),Z(this,"__dragImageDisposer",void 0),Z(this,"_dispose",void 0),this.target=t;let e=[this.target.on("dragenter",this.dragEnterHandler.bind(this)),this.target.on("dragover",this.dragOverHandler.bind(this)),this.target.on("dragleave",this.dragLeaveHandler.bind(this)),this.target.on("dragend",this.dragEndHandler.bind(this)),this.target.on("drop",this.dropHandler.bind(this))];this._dispose=()=>{e.forEach(t=>t()),this._dispose=void 0}}}let sU=/[ \n\.,;!\?\-]/;class sH extends sN{initBehavior(){this._tick=this._tick.bind(this),this._onTickComplete=this._onTickComplete.bind(this),this.updateSelectionOnMouseMove=this.updateSelectionOnMouseMove.bind(this)}onDeselect(t){return this.isEditing&&this.exitEditing(),this.selected=!1,super.onDeselect(t)}_animateCursor(t){let{toValue:e,duration:r,delay:i,onComplete:n}=t;return r8({startValue:this._currentCursorOpacity,endValue:e,duration:r,delay:i,onComplete:n,abort:()=>!this.canvas||this.selectionStart!==this.selectionEnd,onChange:t=>{this._currentCursorOpacity=t,this.renderCursorOrSelection()}})}_tick(t){this._currentTickState=this._animateCursor({toValue:0,duration:this.cursorDuration/2,delay:Math.max(t||0,100),onComplete:this._onTickComplete})}_onTickComplete(){var t;null==(t=this._currentTickCompleteState)||t.abort(),this._currentTickCompleteState=this._animateCursor({toValue:1,duration:this.cursorDuration,onComplete:this._tick})}initDelayedCursor(t){this.abortCursorAnimation(),this._tick(t?0:this.cursorDelay)}abortCursorAnimation(){let t=!1;[this._currentTickState,this._currentTickCompleteState].forEach(e=>{e&&!e.isDone()&&(t=!0,e.abort())}),this._currentCursorOpacity=1,t&&this.clearContextTop()}restartCursorIfNeeded(){[this._currentTickState,this._currentTickCompleteState].some(t=>!t||t.isDone())&&this.initDelayedCursor()}selectAll(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this}cmdAll(){this.selectAll(),this.renderCursorOrSelection()}getSelectedText(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")}findWordBoundaryLeft(t){let e=0,r=t-1;if(this._reSpace.test(this._text[r]))for(;this._reSpace.test(this._text[r]);)e++,r--;for(;/\S/.test(this._text[r])&&r>-1;)e++,r--;return t-e}findWordBoundaryRight(t){let e=0,r=t;if(this._reSpace.test(this._text[r]))for(;this._reSpace.test(this._text[r]);)e++,r++;for(;/\S/.test(this._text[r])&&r-1;)e++,r--;return t-e}findLineBoundaryRight(t){let e=0,r=t;for(;!/\n/.test(this._text[r])&&r0&&this._reSpace.test(r[t])&&(-1===e||!tk.test(r[t-1]))?t-1:t,n=r[i];for(;i>0&&ithis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=r):(this.selectionStart=r,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===n||(this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}_setEditingProps(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0}fromStringToGraphemeSelection(t,e,r){let i=r.slice(0,t),n=this.graphemeSplit(i).length;if(t===e)return{selectionStart:n,selectionEnd:n};let s=r.slice(t,e);return{selectionStart:n,selectionEnd:n+this.graphemeSplit(s).length}}fromGraphemeToStringSelection(t,e,r){let i=r.slice(0,t).join("").length;return t===e?{selectionStart:i,selectionEnd:i}:{selectionStart:i,selectionEnd:i+r.slice(t,e).join("").length}}_updateTextarea(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){let t=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=t.selectionStart,this.hiddenTextarea.selectionEnd=t.selectionEnd}this.updateTextareaPosition()}}updateFromTextArea(){if(!this.hiddenTextarea)return;this.cursorOffsetCache={};let t=this.hiddenTextarea;this.text=t.value,this.set("dirty",!0),this.initDimensions(),this.setCoords();let e=this.fromStringToGraphemeSelection(t.selectionStart,t.selectionEnd,t.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}updateTextareaPosition(){if(this.selectionStart===this.selectionEnd){let t=this._calcTextareaPosition();this.hiddenTextarea.style.left=t.left,this.hiddenTextarea.style.top=t.top}}_calcTextareaPosition(){if(!this.canvas)return{left:"1px",top:"1px"};let t=this.inCompositionMode?this.compositionStart:this.selectionStart,e=this._getCursorBoundaries(t),r=this.get2DCursorLocation(t),i=r.lineIndex,n=r.charIndex,s=this.getValueOfPropertyAt(i,n,"fontSize")*this.lineHeight,o=e.leftOffset,a=this.getCanvasRetinaScaling(),l=this.canvas.upperCanvasEl,h=l.width/a,c=l.height/a,u=h-s,d=c-s,f=new tJ(e.left+o,e.top+e.topOffset+s).transform(this.calcTransformMatrix()).transform(this.canvas.viewportTransform).multiply(new tJ(l.clientWidth/h,l.clientHeight/c));return f.x<0&&(f.x=0),f.x>u&&(f.x=u),f.y<0&&(f.y=0),f.y>d&&(f.y=d),f.x+=this.canvas._offset.left,f.y+=this.canvas._offset.top,{left:"".concat(f.x,"px"),top:"".concat(f.y,"px"),fontSize:"".concat(s,"px"),charHeight:s}}_saveEditingProps(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}}_restoreEditingProps(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor||this.canvas.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor||this.canvas.moveCursor),delete this._savedProps)}_exitEditing(){let t=this.hiddenTextarea;this.selected=!1,this.isEditing=!1,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this.selectionStart!==this.selectionEnd&&this.clearContextTop()}exitEditingImpl(){this._exitEditing(),this.selectionEnd=this.selectionStart,this._restoreEditingProps(),this._forceClearCache&&(this.initDimensions(),this.setCoords())}exitEditing(){let t=this._textBeforeEdit!==this.text;return this.exitEditingImpl(),this.fire("editing:exited"),t&&this.fire(tX),this.canvas&&(this.canvas.fire("text:editing:exited",{target:this}),t&&this.canvas.fire("object:modified",{target:this})),this}_removeExtraneousStyles(){for(let t in this.styles)this._textLines[t]||delete this.styles[t]}removeStyleFromTo(t,e){let{lineIndex:r,charIndex:i}=this.get2DCursorLocation(t,!0),{lineIndex:n,charIndex:s}=this.get2DCursorLocation(e,!0);if(r!==n){if(this.styles[r])for(let t=i;t=s&&(t[r-e]=t[i],delete t[i])}}}shiftLineStyles(t,e){let r=Object.assign({},this.styles);for(let i in this.styles){let n=parseInt(i,10);n>t&&(this.styles[n+e]=r[n],r[n-e]||delete this.styles[n])}}insertNewlineStyleObject(t,e,r,i){let n={},s=this._unwrappedTextLines[t].length,o=s===e,a=!1;r||(r=1),this.shiftLineStyles(t,r);let l=this.styles[t]?this.styles[t][0===e?e:e-1]:void 0;for(let r in this.styles[t]){let i=parseInt(r,10);i>=e&&(a=!0,n[i-e]=this.styles[t][r],o&&0===e||delete this.styles[t][r])}let h=!1;for(a&&!o&&(this.styles[t+r]=n,h=!0),(h||s>e)&&r--;r>0;)i&&i[r-1]?this.styles[t+r]={0:tt({},i[r-1])}:l?this.styles[t+r]={0:tt({},l)}:delete this.styles[t+r],r--;this._forceClearCache=!0}insertCharStyleObject(t,e,r,i){this.styles||(this.styles={});let n=this.styles[t],s=n?tt({},n):{};for(let t in r||(r=1),s){let i=parseInt(t,10);i>=e&&(n[i+r]=s[i],s[i-r]||delete n[i])}if(this._forceClearCache=!0,i){for(;r--;)Object.keys(i[r]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][e+r]=tt({},i[r]));return}if(!n)return;let o=n[e?e-1:1];for(;o&&r--;)this.styles[t][e+r]=tt({},o)}insertNewStyleBlock(t,e,r){let i=this.get2DCursorLocation(e,!0),n=[0],s,o=0;for(let e=0;e0&&(this.insertCharStyleObject(i.lineIndex,i.charIndex,n[0],r),r=r&&r.slice(n[0]+1)),o&&this.insertNewlineStyleObject(i.lineIndex,i.charIndex+n[0],o),s=1;s0?this.insertCharStyleObject(i.lineIndex+s,0,n[s],r):r&&this.styles[i.lineIndex+s]&&r[0]&&(this.styles[i.lineIndex+s][0]=r[0]),r=r&&r.slice(n[s]+1);n[s]>0&&this.insertCharStyleObject(i.lineIndex+s,0,n[s],r)}removeChars(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t+1;this.removeStyleFromTo(t,e),this._text.splice(t,e-t),this.text=this._text.join(""),this.set("dirty",!0),this.initDimensions(),this.setCoords(),this._removeExtraneousStyles()}insertChars(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;i>r&&this.removeStyleFromTo(r,i);let n=this.graphemeSplit(t);this.insertNewStyleBlock(n,r,e),this._text=[...this._text.slice(0,r),...n,...this._text.slice(i)],this.text=this._text.join(""),this.set("dirty",!0),this.initDimensions(),this.setCoords(),this._removeExtraneousStyles()}setSelectionStartEndWithShift(t,e,r){r<=t?(e===t?this._selectionDirection=tC:this._selectionDirection===tT&&(this._selectionDirection=tC,this.selectionEnd=t),this.selectionStart=r):r>t&&r{let[r,i]=t;return e.setAttribute(r,i)});let{top:r,left:i,fontSize:n}=this._calcTextareaPosition();e.style.cssText="position: absolute; top: ".concat(r,"; left: ").concat(i,"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: ").concat(n,";"),(this.hiddenTextareaContainer||t.body).appendChild(e),Object.entries({blur:"blur",keydown:"onKeyDown",keyup:"onKeyUp",input:"onInput",copy:"copy",cut:"copy",paste:"paste",compositionstart:"onCompositionStart",compositionupdate:"onCompositionUpdate",compositionend:"onCompositionEnd"}).map(t=>{let[r,i]=t;return e.addEventListener(r,this[i].bind(this))}),this.hiddenTextarea=e}blur(){this.abortCursorAnimation()}onKeyDown(t){if(!this.isEditing)return;let e="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(t.keyCode in e)this[e[t.keyCode]](t);else{if(!(t.keyCode in this.ctrlKeysMapDown)||!t.ctrlKey&&!t.metaKey)return;this[this.ctrlKeysMapDown[t.keyCode]](t)}t.stopImmediatePropagation(),t.preventDefault(),t.keyCode>=33&&t.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}onKeyUp(t){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:t.keyCode in this.ctrlKeysMapUp&&(t.ctrlKey||t.metaKey)&&(this[this.ctrlKeysMapUp[t.keyCode]](t),t.stopImmediatePropagation(),t.preventDefault(),this.canvas&&this.canvas.requestRenderAll())}onInput(t){let e=this.fromPaste,{value:r,selectionStart:i,selectionEnd:n}=this.hiddenTextarea;if(this.fromPaste=!1,t&&t.stopPropagation(),!this.isEditing)return;let s=()=>{this.updateFromTextArea(),this.fire(tL),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())};if(""===this.hiddenTextarea.value)return this.styles={},void s();let o=this._splitTextIntoLines(r).graphemeText,a=this._text.length,l=o.length,h=this.selectionStart,c=this.selectionEnd,u=h!==c,d,f,g,p,m=l-a,y=this.fromStringToGraphemeSelection(i,n,r),x=h>y.selectionStart;u?(f=this._text.slice(h,c),m+=c-h):ld[0])),u?(g=h,p=c):x?(g=c-f.length,p=c):(g=c,p=c+f.length),this.removeStyleFromTo(g,p)),b.length){let{copyPasteData:t}=tu();e&&b.join("")===t.copiedText&&!tn.disableStyleCopyPaste&&(d=t.copiedTextStyle),this.insertNewStyleBlock(b,h,d)}s()}onCompositionStart(){this.inCompositionMode=!0}onCompositionEnd(){this.inCompositionMode=!1}onCompositionUpdate(t){let{target:e}=t,{selectionStart:r,selectionEnd:i}=e;this.compositionStart=r,this.compositionEnd=i,this.updateTextareaPosition()}copy(){if(this.selectionStart===this.selectionEnd)return;let{copyPasteData:t}=tu();t.copiedText=this.getSelectedText(),tn.disableStyleCopyPaste?t.copiedTextStyle=void 0:t.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0}paste(){this.fromPaste=!0}_getWidthBeforeCursor(t,e){let r,i=this._getLineLeftOffset(t);return e>0&&(i+=(r=this.__charBounds[t][e-1]).left+r.width),i}getDownCursorOffset(t,e){let r=this._getSelectionForOffset(t,e),i=this.get2DCursorLocation(r),n=i.lineIndex;if(n===this._textLines.length-1||t.metaKey||34===t.keyCode)return this._text.length-r;let s=i.charIndex,o=this._getWidthBeforeCursor(n,s),a=this._getIndexOnLine(n+1,o);return this._textLines[n].slice(s).length+a+1+this.missingNewlineOffset(n)}_getSelectionForOffset(t,e){return t.shiftKey&&this.selectionStart!==this.selectionEnd&&e?this.selectionEnd:this.selectionStart}getUpCursorOffset(t,e){let r=this._getSelectionForOffset(t,e),i=this.get2DCursorLocation(r),n=i.lineIndex;if(0===n||t.metaKey||33===t.keyCode)return-r;let s=i.charIndex,o=this._getWidthBeforeCursor(n,s),a=this._getIndexOnLine(n-1,o),l=this._textLines[n].slice(0,s),h=this.missingNewlineOffset(n-1);return-this._textLines[n-1].length+a-l.length+(1-h)}_getIndexOnLine(t,e){let r=this._textLines[t],i,n,s=this._getLineLeftOffset(t),o=0;for(let a=0,l=r.length;ae){n=!0;let t=Math.abs(s-i-e);o=Math.abs(s-e)=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",t)}moveCursorUp(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",t)}_moveCursorUpOrDown(t,e){let r=this["get".concat(t,"CursorOffset")](e,this._selectionDirection===tT);if(e.shiftKey?this.moveCursorWithShift(r):this.moveCursorWithoutShift(r),0!==r){let t=this.text.length;this.selectionStart=rX(0,this.selectionStart,t),this.selectionEnd=rX(0,this.selectionEnd,t),this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea()}}moveCursorWithShift(t){let e=this._selectionDirection===tC?this.selectionStart+t:this.selectionEnd+t;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,e),0!==t}moveCursorWithoutShift(t){return t<0?(this.selectionStart+=t,this.selectionEnd=this.selectionStart):(this.selectionEnd+=t,this.selectionStart=this.selectionEnd),0!==t}moveCursorLeft(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",t)}_move(t,e,r){let i;if(t.altKey)i=this["findWordBoundary".concat(r)](this[e]);else{if(!t.metaKey&&35!==t.keyCode&&36!==t.keyCode)return this[e]+="Left"===r?-1:1,!0;i=this["findLineBoundary".concat(r)](this[e])}return void 0!==i&&this[e]!==i&&(this[e]=i,!0)}_moveLeft(t,e){return this._move(t,e,"Left")}_moveRight(t,e){return this._move(t,e,"Right")}moveCursorLeftWithoutShift(t){let e=!0;return this._selectionDirection=tC,this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(e=this._moveLeft(t,"selectionStart")),this.selectionEnd=this.selectionStart,e}moveCursorLeftWithShift(t){return this._selectionDirection===tT&&this.selectionStart!==this.selectionEnd?this._moveLeft(t,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection=tC,this._moveLeft(t,"selectionStart")):void 0}moveCursorRight(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",t)}_moveCursorLeftOrRight(t,e){let r="moveCursor".concat(t).concat(e.shiftKey?"WithShift":"WithoutShift");this._currentCursorOpacity=1,this[r](e)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())}moveCursorRightWithShift(t){return this._selectionDirection===tC&&this.selectionStart!==this.selectionEnd?this._moveRight(t,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection=tT,this._moveRight(t,"selectionEnd")):void 0}moveCursorRightWithoutShift(t){let e=!0;return this._selectionDirection=tT,this.selectionStart===this.selectionEnd?(e=this._moveRight(t,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,e}}class sV extends sX{initBehavior(){this.on("mousedown",this._mouseDownHandler),this.on("mouseup",this.mouseUpHandler),this.on("mousedblclick",this.doubleClickHandler),this.on("mousetripleclick",this.tripleClickHandler),this.draggableTextDelegate=new sW(this),super.initBehavior()}shouldStartDragging(){return this.draggableTextDelegate.isActive()}onDragStart(t){return this.draggableTextDelegate.onDragStart(t)}canDrop(t){return this.draggableTextDelegate.canDrop(t)}doubleClickHandler(t){this.isEditing&&(this.selectWord(this.getSelectionStartFromPointer(t.e)),this.renderCursorOrSelection())}tripleClickHandler(t){this.isEditing&&(this.selectLine(this.getSelectionStartFromPointer(t.e)),this.renderCursorOrSelection())}_mouseDownHandler(t){let{e:e,alreadySelected:r}=t;this.canvas&&this.editable&&!e.button&&!this.getActiveControl()&&(this.draggableTextDelegate.start(e)||(this.canvas.textEditingManager.register(this),r&&(this.inCompositionMode=!1,this.setCursorByClick(e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()),this.selected||(this.selected=r||this.isEditing)))}mouseUpHandler(t){let{e:e,transform:r}=t,i=this.draggableTextDelegate.end(e);if(this.canvas){this.canvas.textEditingManager.unregister(this);let t=this.canvas._activeObject;if(t&&t!==this)return}!this.editable||this.group&&!this.group.interactive||r&&r.actionPerformed||e.button||i||this.selected&&!this.getActiveControl()&&(this.enterEditing(e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection())}setCursorByClick(t){let e=this.getSelectionStartFromPointer(t),r=this.selectionStart,i=this.selectionEnd;t.shiftKey?this.setSelectionStartEndWithShift(r,i,e):(this.selectionStart=e,this.selectionEnd=e),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())}getSelectionStartFromPointer(t){let e=this.canvas.getScenePoint(t).transform(es(this.calcTransformMatrix())).add(new tJ(-this._getLeftOffset(),-this._getTopOffset())),r=0,i=0,n=0;for(let t=0;t0&&(i+=this._textLines[t-1].length+this.missingNewlineOffset(t-1));let s=Math.abs(this._getLineLeftOffset(n)),o=this._textLines[n].length,a=this.__charBounds[n];for(let t=0;t{let r=e.getRetinaScaling();t.setTransform(r,0,0,r,0,0);let i=e.viewportTransform;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])},sJ=tt({selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,keysMap:{9:sK,27:sK,33:sY,34:sz,35:sq,36:sG,37:sG,38:sY,39:sq,40:sz},keysMapRtl:{9:sK,27:sK,33:sY,34:sz,35:sG,36:sq,37:sq,38:sY,39:sG,40:sz},ctrlKeysMapDown:{65:"cmdAll"},ctrlKeysMapUp:{67:"copy",88:"cut"}},{_selectionDirection:null,_reSpace:/\s|\r?\n/,inCompositionMode:!1});class sZ extends sV{static getDefaults(){return tt(tt({},super.getDefaults()),sZ.ownDefaults)}get type(){let t=super.type;return"itext"===t?"i-text":t}_set(t,e){return this.isEditing&&this._savedProps&&t in this._savedProps?(this._savedProps[t]=e,this):("canvas"===t&&(this.canvas instanceof st&&this.canvas.textEditingManager.remove(this),e instanceof st&&e.textEditingManager.add(this)),super._set(t,e))}setSelectionStart(t){t=Math.max(t,0),this._updateAndFire("selectionStart",t)}setSelectionEnd(t){t=Math.min(t,this.text.length),this._updateAndFire("selectionEnd",t)}_updateAndFire(t,e){this[t]!==e&&(this._fireSelectionChanged(),this[t]=e),this._updateTextarea()}_fireSelectionChanged(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})}initDimensions(){this.isEditing&&this.initDelayedCursor(),super.initDimensions()}getSelectionStyles(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart||0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selectionEnd,r=arguments.length>2?arguments[2]:void 0;return super.getSelectionStyles(t,e,r)}setSelectionStyles(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selectionStart||0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.selectionEnd;return super.setSelectionStyles(t,e,r)}get2DCursorLocation(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart,e=arguments.length>1?arguments[1]:void 0;return super.get2DCursorLocation(t,e)}render(t){super.render(t),this.cursorOffsetCache={},this.renderCursorOrSelection()}toCanvasElement(t){let e=this.isEditing;this.isEditing=!1;let r=super.toCanvasElement(t);return this.isEditing=e,r}renderCursorOrSelection(){if(!this.isEditing||!this.canvas)return;let t=this.clearContextTop(!0);if(!t)return;let e=this._getCursorBoundaries(),r=this.findAncestorsWithClipPath(),i=r.length>0,n,s=t;if(i){sQ(s=(n=t8(t.canvas)).getContext("2d"),this.canvas);let e=this.calcTransformMatrix();s.transform(e[0],e[1],e[2],e[3],e[4],e[5])}if(this.selectionStart!==this.selectionEnd||this.inCompositionMode?this.renderSelection(s,e):this.renderCursor(s,e),i)for(let e of r){let r=e.clipPath,i=t8(t.canvas),n=i.getContext("2d");if(sQ(n,this.canvas),!r.absolutePositioned){let t=e.calcTransformMatrix();n.transform(t[0],t[1],t[2],t[3],t[4],t[5])}r.transform(n),r.drawObject(n,!0,{}),this.drawClipPathOnCache(s,r,i)}i&&(t.setTransform(1,0,0,1,0,0),t.drawImage(n,0,0)),this.canvas.contextTopDirty=!0,t.restore()}findAncestorsWithClipPath(){let t=[],e=this;for(;e;)e.clipPath&&t.push(e),e=e.parent;return t}_getCursorBoundaries(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart,e=arguments.length>1?arguments[1]:void 0,r=this._getLeftOffset(),i=this._getTopOffset(),n=this._getCursorBoundariesOffsets(t,e);return{left:r,top:i,leftOffset:n.left,topOffset:n.top}}_getCursorBoundariesOffsets(t,e){return e?this.__getCursorBoundariesOffsets(t):this.cursorOffsetCache&&"top"in this.cursorOffsetCache?this.cursorOffsetCache:this.cursorOffsetCache=this.__getCursorBoundariesOffsets(t)}__getCursorBoundariesOffsets(t){let e=0,r=0,{charIndex:i,lineIndex:n}=this.get2DCursorLocation(t);for(let t=0;t0?r:0)};return"rtl"===this.direction&&(this.textAlign===tT||this.textAlign===rv||this.textAlign===rx?a.left*=-1:this.textAlign===tC||this.textAlign===ry?a.left=s-(r>0?r:0):this.textAlign!==tw&&this.textAlign!==rb||(a.left=s-(r>0?r:0))),a}renderCursorAt(t){this._renderCursor(this.canvas.contextTop,this._getCursorBoundaries(t,!0),t)}renderCursor(t,e){this._renderCursor(t,e,this.selectionStart)}getCursorRenderingData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getCursorBoundaries(t),r=this.get2DCursorLocation(t),i=r.lineIndex,n=r.charIndex>0?r.charIndex-1:0,s=this.getValueOfPropertyAt(i,n,"fontSize"),o=this.getObjectScaling().x*this.canvas.getZoom(),a=this.cursorWidth/o,l=this.getValueOfPropertyAt(i,n,"deltaY"),h=e.topOffset+(1-this._fontSizeFraction)*this.getHeightOfLine(i)/this.lineHeight-s*(1-this._fontSizeFraction);return{color:this.cursorColor||this.getValueOfPropertyAt(i,n,"fill"),opacity:this._currentCursorOpacity,left:e.left+e.leftOffset-a/2,top:h+e.top+l,width:a,height:s}}_renderCursor(t,e,r){let{color:i,opacity:n,left:s,top:o,width:a,height:l}=this.getCursorRenderingData(r,e);t.fillStyle=i,t.globalAlpha=n,t.fillRect(s,o,a,l)}renderSelection(t,e){let r={selectionStart:this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,selectionEnd:this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd};this._renderSelection(t,r,e)}renderDragSourceEffect(){let t=this.draggableTextDelegate.getDragStartSelection();this._renderSelection(this.canvas.contextTop,t,this._getCursorBoundaries(t.selectionStart,!0))}renderDropTargetEffect(t){let e=this.getSelectionStartFromPointer(t);this.renderCursorAt(e)}_renderSelection(t,e,r){let i=e.selectionStart,n=e.selectionEnd,s=this.textAlign.includes(rv),o=this.get2DCursorLocation(i),a=this.get2DCursorLocation(n),l=o.lineIndex,h=a.lineIndex,c=o.charIndex<0?0:o.charIndex,u=a.charIndex<0?0:a.charIndex;for(let e=l;e<=h;e++){let i=this._getLineLeftOffset(e)||0,n=this.getHeightOfLine(e),o=0,a=0,d=0;if(e===l&&(a=this.__charBounds[l][c].left),e>=l&&e1)&&(n/=this.lineHeight);let f=r.left+i+a,g=n,p=0,m=d-a;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",g=1,p=n):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(this.textAlign===tT||this.textAlign===rv||this.textAlign===rx?f=this.width-f-m:this.textAlign===tC||this.textAlign===ry?f=r.left+i-d:this.textAlign!==tw&&this.textAlign!==rb||(f=r.left+i-d)),t.fillRect(f,r.top+r.topOffset+p,m,g),r.topOffset+=o}}getCurrentCharFontSize(){let t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fontSize")}getCurrentCharColor(){let t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,tU)}_getCurrentCharIndex(){let t=this.get2DCursorLocation(this.selectionStart,!0),e=t.charIndex>0?t.charIndex-1:0;return{l:t.lineIndex,c:e}}dispose(){this.exitEditingImpl(),this.draggableTextDelegate.dispose(),super.dispose()}constructor(t,e){super(t,tt(tt({},sZ.ownDefaults),e)),this.initBehavior()}}Z(sZ,"ownDefaults",sJ),Z(sZ,"type","IText"),tY.setClass(sZ),tY.setClass(sZ,"i-text");class s$ extends sZ{static getDefaults(){return tt(tt({},super.getDefaults()),s$.ownDefaults)}static createControls(){return{controls:iI()}}initDimensions(){this.initialized&&(this.isEditing&&this.initDelayedCursor(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),this.textAlign.includes(rv)&&this.enlargeSpaces(),this.height=this.calcTextHeight())}_generateStyleMap(t){let e=0,r=0,i=0,n={};for(let s=0;s0?(r=0,i++,e++):!this.splitByGrapheme&&this._reSpaceAndTab.test(t.graphemeText[i])&&s>0&&(r++,i++),n[s]={line:e,offset:r},i+=t.graphemeLines[s].length,r+=t.graphemeLines[s].length;return n}styleHas(t,e){if(this._styleMap&&!this.isWrapping){let t=this._styleMap[e];t&&(e=t.line)}return super.styleHas(t,e)}isEmptyStyles(t){if(!this.styles)return!0;let e,r=0,i=!1,n=this._styleMap[t],s=this._styleMap[t+1];n&&(t=n.line,r=n.offset),s&&(i=s.line===t,e=s.offset);let o=void 0===t?this.styles:{line:this.styles[t]};for(let t in o)for(let n in o[t]){let s=parseInt(n,10);if(s>=r&&(!i||s{let s=0,o=e?this.graphemeSplit(t):this.wordSplit(t);return 0===o.length?[{word:[],width:0}]:o.map(t=>{let o=e?[t]:this.graphemeSplit(t),a=this._measureWord(o,n,s);return i=Math.max(a,i),s+=o.length+r.length,{word:o,width:a}})}),largestWordWidth:i}}_measureWord(t,e){let r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=0;for(let s=0,o=t.length;s3&&void 0!==arguments[3]?arguments[3]:0,a=this._getWidthOfCharSpacing(),l=this.splitByGrapheme,h=[],c=l?"":" ",u=0,d=[],f=0,g=0,p=!0,m=Math.max(e-=o,n,this.dynamicMinWidth),y=s[t];for(f=0,i=0;im&&!p?(h.push(d),d=[],u=r,p=!0):u+=a,p||l||d.push(c),d=d.concat(e),g=l?0:this._measureWord([c],t,f),f++,p=!1}return i&&h.push(d),n+o>this.dynamicMinWidth&&(this.dynamicMinWidth=n-a+o),h}isEndOfWrapping(t){return!this._styleMap[t+1]||this._styleMap[t+1].line!==this._styleMap[t].line}missingNewlineOffset(t,e){return this.splitByGrapheme&&!e?+!!this.isEndOfWrapping(t):1}_splitTextIntoLines(t){let e=super._splitTextIntoLines(t),r=this._wrapText(e.lines,this.width),i=Array(r.length);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject(["minWidth","splitByGrapheme",...t])}constructor(t,e){super(t,tt(tt({},s$.ownDefaults),e))}}Z(s$,"type","Textbox"),Z(s$,"textLayoutProperties",[...sZ.textLayoutProperties,"width"]),Z(s$,"ownDefaults",{minWidth:20,dynamicMinWidth:2,lockScalingFlip:!0,noScaleCache:!1,_wordJoiners:/[ \t\r]/,splitByGrapheme:!1}),tY.setClass(s$);class s0 extends ny{shouldPerformLayout(t){return!!t.target.clipPath&&super.shouldPerformLayout(t)}shouldLayoutClipPath(){return!1}calcLayoutResult(t,e){let{target:r}=t,{clipPath:i,group:n}=r;if(!i||!this.shouldPerformLayout(t))return;let{width:s,height:o}=eH(nv(r,i)),a=new tJ(s,o);if(i.absolutePositioned)return{center:eQ(i.getRelativeCenterPoint(),void 0,n?n.calcTransformMatrix():void 0),size:a};{let n=i.getRelativeCenterPoint().transform(r.calcOwnMatrix(),!0);if(this.shouldPerformLayout(t)){let{center:r=new tJ,correction:i=new tJ}=this.calcBoundingBox(e,t)||{};return{center:r.add(n),correction:i.subtract(n),size:a}}return{center:r.getRelativeCenterPoint().add(n),size:a}}}}Z(s0,"type","clip-path"),tY.setClass(s0);class s1 extends ny{getInitialSize(t,e){let{target:r}=t,{size:i}=e;return new tJ(r.width||i.x,r.height||i.y)}}Z(s1,"type","fixed"),tY.setClass(s1);class s2 extends nC{subscribeTargets(t){let e=t.target;t.targets.reduce((t,e)=>(e.parent&&t.add(e.parent),t),new Set).forEach(t=>{t.layoutManager.subscribeTargets({target:t,targets:[e]})})}unsubscribeTargets(t){let e=t.target,r=e.getObjects();t.targets.reduce((t,e)=>(e.parent&&t.add(e.parent),t),new Set).forEach(t=>{r.some(e=>e.parent===t)||t.layoutManager.unsubscribeTargets({target:t,targets:[e]})})}}class s5 extends nO{static getDefaults(){return tt(tt({},super.getDefaults()),s5.ownDefaults)}_shouldSetNestedCoords(){return!0}__objectSelectionMonitor(){}multiSelectAdd(){for(var t=arguments.length,e=Array(t),r=0;r{let e=this._objects.findIndex(e=>e.isInFrontOf(t)),r=-1===e?this.size():e;this.insertAt(r,t)})}canEnterGroup(t){return this.getObjects().some(e=>e.isDescendantOf(t)||t.isDescendantOf(e))?(ts("error","ActiveSelection: circular object trees are not supported, this call has no effect"),!1):super.canEnterGroup(t)}enterGroup(t,e){t.parent&&t.parent===t.group?t.parent._exitGroup(t):t.group&&t.parent!==t.group&&t.group.remove(t),this._enterGroup(t,e)}exitGroup(t,e){this._exitGroup(t,e),t.parent&&t.parent._enterGroup(t,!0)}_onAfterObjectsChange(t,e){super._onAfterObjectsChange(t,e);let r=new Set;e.forEach(t=>{let{parent:e}=t;e&&r.add(e)}),t===np?r.forEach(t=>{t._onAfterObjectsChange(ng,e)}):r.forEach(t=>{t._set("dirty",!0)})}onDeselect(){return this.removeAll(),!1}toString(){return"#")}shouldCache(){return!1}isOnACache(){return!1}_renderControls(t,e,r){t.save(),t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1;let i=tt(tt({hasControls:!1},r),{},{forActiveSelection:!0});for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Object.assign(this,s5.ownDefaults),this.setOptions(e);let{left:r,top:i,layoutManager:n}=e;this.groupInit(t,{left:r,top:i,layoutManager:null!=n?n:new s2})}}Z(s5,"type","ActiveSelection"),Z(s5,"ownDefaults",{multiSelectionStacking:"canvas-stacking"}),tY.setClass(s5),tY.setClass(s5,"activeSelection");class s4{applyFilters(t,e,r,i,n){let s=n.getContext("2d");if(!s)return;s.drawImage(e,0,0,r,i);let o={sourceWidth:r,sourceHeight:i,imageData:s.getImageData(0,0,r,i),originalEl:e,originalImageData:s.getImageData(0,0,r,i),canvasEl:n,ctx:s,filterBackend:this};t.forEach(t=>{t.applyTo(o)});let{imageData:a}=o;return a.width===r&&a.height===i||(n.width=a.width,n.height=a.height),s.putImageData(a,0,0),o}constructor(){Z(this,"resources",{})}}class s3{setupGLContext(t,e){this.dispose(),this.createWebGLCanvas(t,e)}createWebGLCanvas(t,e){let r=t8({width:t,height:e}),i=r.getContext("webgl",{alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1});i&&(i.clearColor(0,0,0,0),this.canvas=r,this.gl=i)}applyFilters(t,e,r,i,n,s){let o,a=this.gl,l=n.getContext("2d");if(!a||!l)return;s&&(o=this.getCachedTexture(s,e));let h={originalWidth:e.width||e.naturalWidth||0,originalHeight:e.height||e.naturalHeight||0,sourceWidth:r,sourceHeight:i,destinationWidth:r,destinationHeight:i,context:a,sourceTexture:this.createTexture(a,r,i,o?void 0:e),targetTexture:this.createTexture(a,r,i),originalTexture:o||this.createTexture(a,r,i,o?void 0:e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:n},c=a.createFramebuffer();return a.bindFramebuffer(a.FRAMEBUFFER,c),t.forEach(t=>{t&&t.applyTo(h)}),function(t){let e=t.targetCanvas,r=e.width,i=e.height,n=t.destinationWidth,s=t.destinationHeight;r===n&&i===s||(e.width=n,e.height=s)}(h),this.copyGLTo2D(a,h),a.bindTexture(a.TEXTURE_2D,null),a.deleteTexture(h.sourceTexture),a.deleteTexture(h.targetTexture),a.deleteFramebuffer(c),l.setTransform(1,0,0,1,0,0),h}dispose(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()}clearWebGLCaches(){this.programCache={},this.textureCache={}}createTexture(t,e,r,i,n){let{NEAREST:s,TEXTURE_2D:o,RGBA:a,UNSIGNED_BYTE:l,CLAMP_TO_EDGE:h,TEXTURE_MAG_FILTER:c,TEXTURE_MIN_FILTER:u,TEXTURE_WRAP_S:d,TEXTURE_WRAP_T:f}=t,g=t.createTexture();return t.bindTexture(o,g),t.texParameteri(o,c,n||s),t.texParameteri(o,u,n||s),t.texParameteri(o,d,h),t.texParameteri(o,f,h),i?t.texImage2D(o,0,a,a,l,i):t.texImage2D(o,0,a,e,r,0,a,l,null),g}getCachedTexture(t,e,r){let{textureCache:i}=this;if(i[t])return i[t];{let n=this.createTexture(this.gl,e.width,e.height,e,r);return n&&(i[t]=n),n}}evictCachesForKey(t){this.textureCache[t]&&(this.gl.deleteTexture(this.textureCache[t]),delete this.textureCache[t])}copyGLTo2D(t,e){let r=t.canvas,i=e.targetCanvas,n=i.getContext("2d");if(!n)return;n.translate(0,i.height),n.scale(1,-1);let s=r.height-i.height;n.drawImage(r,0,s,i.width,i.height,0,0,i.width,i.height)}copyGLTo2DPutImageData(t,e){let r=e.targetCanvas.getContext("2d"),i=e.destinationWidth,n=e.destinationHeight,s=i*n*4;if(!r)return;let o=new Uint8Array(this.imageBuffer,0,s),a=new Uint8ClampedArray(this.imageBuffer,0,s);t.readPixels(0,0,i,n,t.RGBA,t.UNSIGNED_BYTE,o);let l=new ImageData(a,i,n);r.putImageData(l,0,0)}captureGPUInfo(){if(this.gpuInfo)return this.gpuInfo;let t=this.gl,e={renderer:"",vendor:""};if(!t)return e;let r=t.getExtension("WEBGL_debug_renderer_info");if(r){let i=t.getParameter(r.UNMASKED_RENDERER_WEBGL),n=t.getParameter(r.UNMASKED_VENDOR_WEBGL);i&&(e.renderer=i.toLowerCase()),n&&(e.vendor=n.toLowerCase())}return this.gpuInfo=e,e}constructor(){let{tileSize:t=tn.textureSize}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Z(this,"aPosition",new Float32Array([0,0,0,1,1,0,1,1])),Z(this,"resources",{}),this.tileSize=t,this.setupGLContext(t,t),this.captureGPUInfo()}}function s9(){return n||arguments.length>0&&void 0!==arguments[0]&&!arguments[0]||(n=function(){let{WebGLProbe:t}=tu();return t.queryWebGL(t9()),tn.enableGLFiltering&&t.isSupported(tn.textureSize)?new s3({tileSize:tn.textureSize}):new s4}()),n}let s6=["filters","resizeFilter","src","crossOrigin","type"],s8=["cropX","cropY"];class s7 extends iW{static getDefaults(){return tt(tt({},super.getDefaults()),s7.ownDefaults)}getElement(){return this._element}setElement(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.removeTexture(this.cacheKey),this.removeTexture("".concat(this.cacheKey,"_filtered")),this._element=t,this._originalElement=t,this._setWidthHeight(r),null==(e=t.classList)||e.add(s7.CSS_CANVAS),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters()}removeTexture(t){let e=s9(!1);e instanceof s3&&e.evictCachesForKey(t)}dispose(){super.dispose(),this.removeTexture(this.cacheKey),this.removeTexture("".concat(this.cacheKey,"_filtered")),this._cacheContext=null,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(t=>{let e=this[t];e&&tu().dispose(e),this[t]=void 0})}getCrossOrigin(){return this._originalElement&&(this._originalElement.crossOrigin||null)}getOriginalSize(){let t=this.getElement();return t?{width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}:{width:0,height:0}}_stroke(t){if(!this.stroke||0===this.strokeWidth)return;let e=this.width/2,r=this.height/2;t.beginPath(),t.moveTo(-e,-r),t.lineTo(e,-r),t.lineTo(e,r),t.lineTo(-e,r),t.lineTo(-e,-r),t.closePath()}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[];return this.filters.forEach(t=>{t&&e.push(t.toObject())}),tt(tt({},super.toObject([...s8,...t])),{},{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:e},this.resizeFilter?{resizeFilter:this.resizeFilter.toObject()}:{})}hasCrop(){return!!this.cropX||!!this.cropY||this.width\n',' \n',"\n"),o=' clip-path="url(#imageCrop_'+t+')" '}if(this.imageSmoothing||(a=' image-rendering="optimizeSpeed"'),t.push(" \n")),this.stroke||this.strokeDashArray){let t=this.fill;this.fill=null,s=[' \n')],this.fill=t}return this.paintFirst!==tU?n.concat(s,t):n.concat(t,s)}getSrc(t){let e=t?this._element:this._originalElement;return e?e.toDataURL?e.toDataURL():this.srcFromAttribute?e.getAttribute("src")||"":e.src:this.src||""}getSvgSrc(t){return this.getSrc(t)}setSrc(t){let{crossOrigin:e,signal:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ey(t,{crossOrigin:e,signal:r}).then(t=>{void 0!==e&&this.set({crossOrigin:e}),this.setElement(t)})}toString(){return'#')}applyResizeFilters(){let t=this.resizeFilter,e=this.minimumScaleTrigger,r=this.getTotalObjectScaling(),i=r.x,n=r.y,s=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||i>e&&n>e)return this._element=s,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=i,void(this._lastScaleY=n);let o=t8(s),{width:a,height:l}=s;this._element=o,this._lastScaleX=t.scaleX=i,this._lastScaleY=t.scaleY=n,s9().applyFilters([t],s,a,l,this._element),this._filterScalingX=o.width/this._originalElement.width,this._filterScalingY=o.height/this._originalElement.height}applyFilters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.filters||[];if(t=t.filter(t=>t&&!t.isNeutralState()),this.set("dirty",!0),this.removeTexture("".concat(this.cacheKey,"_filtered")),0===t.length)return this._element=this._originalElement,this._filteredEl=void 0,this._filterScalingX=1,void(this._filterScalingY=1);let e=this._originalElement,r=e.naturalWidth||e.width,i=e.naturalHeight||e.height;if(this._element===this._originalElement){let t=t8({width:r,height:i});this._element=t,this._filteredEl=t}else this._filteredEl&&(this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,r,i),this._lastScaleX=1,this._lastScaleY=1);s9().applyFilters(t,this._originalElement,r,i,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height)}_render(t){t.imageSmoothingEnabled=this.imageSmoothing,!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(t),this._renderPaintInOrder(t)}drawCacheOnCanvas(t){t.imageSmoothingEnabled=this.imageSmoothing,super.drawCacheOnCanvas(t)}shouldCache(){return this.needsItsOwnCache()}_renderFill(t){let e=this._element;if(!e)return;let r=this._filterScalingX,i=this._filterScalingY,n=this.width,s=this.height,o=Math.max(this.cropX,0),a=Math.max(this.cropY,0),l=e.naturalWidth||e.width,h=e.naturalHeight||e.height,c=o*r,u=a*i,d=Math.min(n*r,l-c),f=Math.min(s*i,h-u),g=Math.min(n,l/r-o),p=Math.min(s,h/i-a);e&&t.drawImage(e,c,u,d,f,-n/2,-s/2,g,p)}_needsResize(){let t=this.getTotalObjectScaling();return t.x!==this._lastScaleX||t.y!==this._lastScaleY}_resetWidthHeight(){this.set(this.getOriginalSize())}_setWidthHeight(){let{width:t,height:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.getOriginalSize();this.width=t||r.width,this.height=e||r.height}parsePreserveAspectRatioAttribute(){let t=ra(this.preserveAspectRatio||""),e=this.width,r=this.height,i={width:e,height:r},n,s=this._element.width,o=this._element.height,a=1,l=1,h=0,c=0,u=0,d=0;return t&&(t.alignX!==tO||t.alignY!==tO)?("meet"===t.meetOrSlice&&(n=(e-s*(a=l=nk(this._element,i)))/2,"Min"===t.alignX&&(h=-n),"Max"===t.alignX&&(h=n),n=(r-o*l)/2,"Min"===t.alignY&&(c=-n),"Max"===t.alignY&&(c=n)),"slice"===t.meetOrSlice&&(n=s-e/(a=l=nM(this._element,i)),"Mid"===t.alignX&&(u=n/2),"Max"===t.alignX&&(u=n),n=o-r/l,"Mid"===t.alignY&&(d=n/2),"Max"===t.alignY&&(d=n),s=e/a,o=r/l)):(a=e/s,l=r/o),{width:s,height:o,scaleX:a,scaleY:l,offsetLeft:h,offsetTop:c,cropX:u,cropY:d}}static fromObject(t,e){let{filters:r,resizeFilter:i,src:n,crossOrigin:s,type:o}=t,a=te(t,s6);return Promise.all([ey(n,tt(tt({},e),{},{crossOrigin:s})),r&&ex(r,e),i&&ex([i],e),eb(a,e)]).then(t=>{let[e,r=[],[i]=[],s={}]=t;return new this(e,tt(tt({},a),{},{src:n,filters:r,resizeFilter:i},s))})}static fromURL(t){let{crossOrigin:e=null,signal:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return ey(t,{crossOrigin:e,signal:r}).then(t=>new this(t,i))}static async fromElement(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=nh(t,this.ATTRIBUTE_NAMES,r);return this.fromURL(i["xlink:href"]||i.href,e,i).catch(t=>(ts("log","Unable to parse Image",t),null))}constructor(t,e){super(),Z(this,"_lastScaleX",1),Z(this,"_lastScaleY",1),Z(this,"_filterScalingX",1),Z(this,"_filterScalingY",1),this.filters=[],Object.assign(this,s7.ownDefaults),this.setOptions(e),this.cacheKey="texture".concat(t3()),this.setElement("string"==typeof t?(this.canvas&&eD(this.canvas.getElement())||td()).getElementById(t):t,e)}}Z(s7,"type","Image"),Z(s7,"cacheProperties",[...rY,...s8]),Z(s7,"ownDefaults",{strokeWidth:0,srcFromAttribute:!1,minimumScaleTrigger:.5,cropX:0,cropY:0,imageSmoothing:!0}),Z(s7,"CSS_CANVAS","canvas-img"),Z(s7,"ATTRIBUTE_NAMES",[...i2,"x","y","width","height","preserveAspectRatio","xlink:href","href","crossOrigin","image-rendering"]),tY.setClass(s7),tY.setSVGClass(s7),rc(["pattern","defs","symbol","metadata","clipPath","mask","desc"]);let ot=t=>function(e,r,i){let{points:n,pathOffset:s}=i;return new tJ(n[t]).subtract(s).transform(eo(i.getViewportTransform(),i.calcTransformMatrix()))},oe=(t,e,r,i)=>{let{target:n,pointIndex:s}=e,o=eQ(new tJ(r,i),void 0,n.calcOwnMatrix());return n.points[s]=o.add(n.pathOffset),n.setDimensions(),n.set("dirty",!0),!0},or=(t,e)=>function(r,i,n,s){let o=i.target,a=new tJ(o.points[(t>0?t:o.points.length)-1]),l=a.subtract(o.pathOffset).transform(o.calcOwnMatrix()),h=e(r,tt(tt({},i),{},{pointIndex:t}),n,s),c=a.subtract(o.pathOffset).transform(o.calcOwnMatrix()).subtract(l);return o.left-=c.x,o.top-=c.y,h},oi=t=>io(tF,or(t,oe)),on=(t,e,r)=>{let{path:i,pathOffset:n}=t,s=i[e];return new tJ(s[r]-n.x,s[r+1]-n.y).transform(eo(t.getViewportTransform(),t.calcTransformMatrix()))};function os(t,e,r){let{commandIndex:i,pointIndex:n}=this;return on(r,i,n)}function oo(t,e,r,i){let{target:n}=e,{commandIndex:s,pointIndex:o}=this,a=((t,e,r,i,n)=>{let{path:s,pathOffset:o}=t,a=s[(i>0?i:s.length)-1],l=new tJ(a[n],a[n+1]),h=l.subtract(o).transform(t.calcOwnMatrix()),c=eQ(new tJ(e,r),void 0,t.calcOwnMatrix());s[i][n]=c.x+o.x,s[i][n+1]=c.y+o.y,t.setDimensions();let u=l.subtract(t.pathOffset).transform(t.calcOwnMatrix()).subtract(h);return t.left-=u.x,t.top-=u.y,t.set("dirty",!0),!0})(n,r,i,s,o);return e$(this.actionName,tt(tt({},e3(t,e,r,i)),{},{commandIndex:s,pointIndex:o})),a}class oa extends iu{render(t,e,r,i,n){let s=tt(tt({},i),{},{cornerColor:this.controlFill,cornerStrokeColor:this.controlStroke,transparentCorners:!this.controlFill});super.render(t,e,r,s,n)}constructor(t){super(t)}}class ol extends oa{render(t,e,r,i,n){let{path:s}=n,{commandIndex:o,pointIndex:a,connectToCommandIndex:l,connectToPointIndex:h}=this;t.save(),t.strokeStyle=this.controlStroke,this.connectionDashArray&&t.setLineDash(this.connectionDashArray);let[c]=s[o],u=on(n,l,h);if("Q"===c){let i=on(n,o,a+2);t.moveTo(i.x,i.y),t.lineTo(e,r)}else t.moveTo(e,r);t.lineTo(u.x,u.y),t.stroke(),t.restore(),super.render(t,e,r,i,n)}constructor(t){super(t)}}let oh=(t,e,r,i,n,s)=>new(r?ol:oa)(tt(tt({commandIndex:t,pointIndex:e,actionName:"modifyPath",positionHandler:os,actionHandler:oo,connectToCommandIndex:n,connectToPointIndex:s},i),r?i.controlPointStyle:i.pointStyle));Object.freeze({__proto__:null,changeWidth:il,createObjectDefaultControls:iL,createPathControls:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i="M";return t.path.forEach((t,n)=>{let s=t[0];switch("Z"!==s&&(r["c_".concat(n,"_").concat(s)]=oh(n,t.length-2,!1,e)),s){case"C":let o;r["c_".concat(n,"_C_CP_1")]=oh(n,1,!0,e,n-1,"C"===(o=i)?5:"Q"===o?3:1),r["c_".concat(n,"_C_CP_2")]=oh(n,3,!0,e,n,5);break;case"Q":r["c_".concat(n,"_Q_CP_1")]=oh(n,1,!0,e,n,3)}i=s}),r},createPolyActionHandler:oi,createPolyControls:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};for(let i=0;i<("number"==typeof t?t:t.points.length);i++)r["p".concat(i)]=new iu(tt({actionName:tF,positionHandler:ot(i),actionHandler:oi(i)},e));return r},createPolyPositionHandler:ot,createResizeControls:iR,createTextboxDefaultControls:iI,dragHandler:e8,factoryPolyActionHandler:or,getLocalPoint:e6,polyActionHandler:oe,renderCircleControl:ih,renderSquareControl:ic,rotationStyleHandler:id,rotationWithSnapping:ig,scaleCursorStyleHandler:iy,scaleOrSkewActionName:ij,scaleSkewCursorStyleHandler:iA,scalingEqually:ib,scalingX:i_,scalingXOrSkewingY:iP,scalingY:iw,scalingYOrSkewingX:iF,skewCursorStyleHandler:iO,skewHandlerX:iM,skewHandlerY:iE,wrapWithFireEvent:io,wrapWithFixedAnchor:ia});let oc="precision highp float",ou="\n ".concat(oc,";\n varying vec2 vTexCoord;\n uniform sampler2D uTexture;\n void main() {\n gl_FragColor = texture2D(uTexture, vTexCoord);\n }"),od=["type"],of=["type"],og=RegExp(oc,"g");class op{get type(){return this.constructor.type}getFragmentSource(){return ou}getVertexSource(){return"\n attribute vec2 aPosition;\n varying vec2 vTexCoord;\n void main() {\n vTexCoord = aPosition;\n gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n }"}createProgram(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getFragmentSource(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getVertexSource(),{WebGLProbe:{GLPrecision:i="highp"}}=tu();"highp"!==i&&(e=e.replace(og,oc.replace("highp",i)));let n=t.createShader(t.VERTEX_SHADER),s=t.createShader(t.FRAGMENT_SHADER),o=t.createProgram();if(!n||!s||!o)throw new to("Vertex, fragment shader or program creation error");if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new to("Vertex shader compile error for ".concat(this.type,": ").concat(t.getShaderInfoLog(n)));if(t.shaderSource(s,e),t.compileShader(s),!t.getShaderParameter(s,t.COMPILE_STATUS))throw new to("Fragment shader compile error for ".concat(this.type,": ").concat(t.getShaderInfoLog(s)));if(t.attachShader(o,n),t.attachShader(o,s),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS))throw new to('Shader link error for "'.concat(this.type,'" ').concat(t.getProgramInfoLog(o)));let a=this.getUniformLocations(t,o)||{};return a.uStepW=t.getUniformLocation(o,"uStepW"),a.uStepH=t.getUniformLocation(o,"uStepH"),{program:o,attributeLocations:this.getAttributeLocations(t,o),uniformLocations:a}}getAttributeLocations(t,e){return{aPosition:t.getAttribLocation(e,"aPosition")}}getUniformLocations(t,e){let r=this.constructor.uniformLocations,i={};for(let n=0;n1){let r=t.destinationWidth,i=t.destinationHeight;t.sourceWidth===r&&t.sourceHeight===i||(e.deleteTexture(t.targetTexture),t.targetTexture=t.filterBackend.createTexture(e,r,i)),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.targetTexture,0)}else e.bindFramebuffer(e.FRAMEBUFFER,null),e.finish()}_swapTextures(t){t.passes--,t.pass++;let e=t.targetTexture;t.targetTexture=t.sourceTexture,t.sourceTexture=e}isNeutralState(t){return!1}applyTo(t){void 0!==t.webgl?(this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)}applyTo2d(t){}getCacheKey(){return this.type}retrieveShader(t){let e=this.getCacheKey();return t.programCache[e]||(t.programCache[e]=this.createProgram(t.context)),t.programCache[e]}applyToWebGL(t){let e=t.context,r=this.retrieveShader(t);0===t.pass&&t.originalTexture?e.bindTexture(e.TEXTURE_2D,t.originalTexture):e.bindTexture(e.TEXTURE_2D,t.sourceTexture),e.useProgram(r.program),this.sendAttributeData(e,r.attributeLocations,t.aPosition),e.uniform1f(r.uniformLocations.uStepW,1/t.sourceWidth),e.uniform1f(r.uniformLocations.uStepH,1/t.sourceHeight),this.sendUniformData(e,r.uniformLocations),e.viewport(0,0,t.destinationWidth,t.destinationHeight),e.drawArrays(e.TRIANGLE_STRIP,0,4)}bindAdditionalTexture(t,e,r){t.activeTexture(r),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE0)}unbindAdditionalTexture(t,e){t.activeTexture(e),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE0)}sendUniformData(t,e){}createHelpLayer(t){if(!t.helpLayer){let{sourceWidth:e,sourceHeight:r}=t;t.helpLayer=t8({width:e,height:r})}}toObject(){let t=Object.keys(this.constructor.defaults||{});return tt({type:this.type},t.reduce((t,e)=>(t[e]=this[e],t),{}))}toJSON(){return this.toObject()}static async fromObject(t,e){return new this(te(t,of))}constructor(){let t=te(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},od);Object.assign(this,this.constructor.defaults,t)}}Z(op,"type","BaseFilter"),Z(op,"uniformLocations",[]);let om={multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",difference:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"\n if (uColor.r < 0.5) {\n gl_FragColor.r *= 2.0 * uColor.r;\n } else {\n gl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n }\n if (uColor.g < 0.5) {\n gl_FragColor.g *= 2.0 * uColor.g;\n } else {\n gl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n }\n if (uColor.b < 0.5) {\n gl_FragColor.b *= 2.0 * uColor.b;\n } else {\n gl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n }\n ",tint:"\n gl_FragColor.rgb *= (1.0 - uColor.a);\n gl_FragColor.rgb += uColor.rgb;\n "};class ov extends op{getCacheKey(){return"".concat(this.type,"_").concat(this.mode)}getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform vec4 uColor;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n gl_FragColor = color;\n if (color.a > 0.0) {\n ".concat(om[this.mode],"\n }\n }\n ")}applyTo2d(t){let{imageData:{data:e}}=t,r=new rs(this.color).getSource(),i=this.alpha,n=r[0]*i,s=r[1]*i,o=r[2]*i,a=1-i;for(let t=0;tnew this(tt(tt({},n),{},{image:t})))}}Z(ob,"type","BlendImage"),Z(ob,"defaults",{mode:"multiply",alpha:1}),Z(ob,"uniformLocations",["uTransformMatrix","uImage"]),tY.setClass(ob);class o_ extends op{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform vec2 uDelta;\n varying vec2 vTexCoord;\n const float nSamples = 15.0;\n vec3 v3offset = vec3(12.9898, 78.233, 151.7182);\n float random(vec3 scale) {\n /* use the fragment position for a different seed per-pixel */\n return fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n }\n void main() {\n vec4 color = vec4(0.0);\n float totalC = 0.0;\n float totalA = 0.0;\n float offset = random(v3offset);\n for (float t = -nSamples; t <= nSamples; t++) {\n float percent = (t + offset - 0.5) / nSamples;\n vec4 sample = texture2D(uTexture, vTexCoord + uDelta * percent);\n float weight = 1.0 - abs(percent);\n float alpha = weight * sample.a;\n color.rgb += sample.rgb * alpha;\n color.a += alpha;\n totalA += weight;\n totalC += alpha;\n }\n gl_FragColor.rgb = color.rgb / totalC;\n gl_FragColor.a = color.a / totalA;\n }\n "}applyTo(t){void 0!==t.webgl?(this.aspectRatio=t.sourceWidth/t.sourceHeight,t.passes++,this._setupFrameBuffer(t),this.horizontal=!0,this.applyToWebGL(t),this._swapTextures(t),this._setupFrameBuffer(t),this.horizontal=!1,this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)}applyTo2d(t){let{imageData:{data:e,width:r,height:i}}=t;this.aspectRatio=r/i,this.horizontal=!0;let n=this.getBlurValue()*r,s=new Uint8ClampedArray(e),o=4*r;for(let t=0;tu&&(g=u);let p=e[g+3]*f;r+=e[g]*p,i+=e[g+1]*p,a+=e[g+2]*p,l+=p,h+=f}s[t]=r/l,s[t+1]=i/l,s[t+2]=a/l,s[t+3]=l/h}this.horizontal=!1,n=this.getBlurValue()*i;for(let t=0;tu&&(p=u);let m=s[p+3]*g;r+=s[p]*m,i+=s[p+1]*m,a+=s[p+2]*m,l+=m,h+=g}e[t]=r/l,e[t+1]=i/l,e[t+2]=a/l,e[t+3]=l/h}}sendUniformData(t,e){let r=this.chooseRightDelta();t.uniform2fv(e.uDelta,r)}isNeutralState(){return 0===this.blur}getBlurValue(){let t=1,{horizontal:e,aspectRatio:r}=this;return e?r>1&&(t=1/r):r<1&&(t=r),t*this.blur*.12}chooseRightDelta(){let t=this.getBlurValue();return this.horizontal?[t,0]:[0,t]}}Z(o_,"type","Blur"),Z(o_,"defaults",{blur:0}),Z(o_,"uniformLocations",["uDelta"]),tY.setClass(o_);class ow extends op{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform float uBrightness;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n color.rgb += uBrightness;\n gl_FragColor = color;\n }\n"}applyTo2d(t){let{imageData:{data:e}}=t,r=Math.round(255*this.brightness);for(let t=0;t{e.applyTo(t)})}toObject(){return{type:this.type,subFilters:this.subFilters.map(t=>t.toObject())}}isNeutralState(){return!this.subFilters.some(t=>!t.isNeutralState())}static fromObject(t,e){return Promise.all((t.subFilters||[]).map(t=>tY.getClass(t.type).fromObject(t,e))).then(t=>new this({subFilters:t}))}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(t),this.subFilters=t.subFilters||[]}}Z(oP,"type","Composed"),tY.setClass(oP);class oF extends op{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform float uContrast;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\n color.rgb = contrastF * (color.rgb - 0.5) + 0.5;\n gl_FragColor = color;\n }"}isNeutralState(){return 0===this.contrast}applyTo2d(t){let{imageData:{data:e}}=t,r=Math.floor(255*this.contrast),i=259*(r+255)/(255*(259-r));for(let t=0;t=_||o<0||o>=b||(l=4*(a*b+o),h=m[f*y+d],e+=p[l]*h,r+=p[l+1]*h,i+=p[l+2]*h,S||(n+=p[l+3]*h));C[s]=e,C[s+1]=r,C[s+2]=i,C[s+3]=S?p[s+3]:n}t.imageData=w}sendUniformData(t,e){t.uniform1fv(e.uMatrix,this.matrix)}toObject(){return tt(tt({},super.toObject()),{},{opaque:this.opaque,matrix:[...this.matrix]})}}Z(oR,"type","Convolute"),Z(oR,"defaults",{opaque:!1,matrix:[0,0,0,0,1,0,0,0,0]}),Z(oR,"uniformLocations",["uMatrix","uOpaque","uHalfSize","uSize"]),tY.setClass(oR);let oI="Gamma";class oB extends op{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform vec3 uGamma;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n vec3 correction = (1.0 / uGamma);\n color.r = pow(color.r, correction.r);\n color.g = pow(color.g, correction.g);\n color.b = pow(color.b, correction.b);\n gl_FragColor = color;\n gl_FragColor.rgb *= color.a;\n }\n"}applyTo2d(t){let{imageData:{data:e}}=t,r=this.gamma,i=1/r[0],n=1/r[1],s=1/r[2];this.rgbValues||(this.rgbValues={r:new Uint8Array(256),g:new Uint8Array(256),b:new Uint8Array(256)});let o=this.rgbValues;for(let t=0;t<256;t++)o.r[t]=255*Math.pow(t/255,i),o.g[t]=255*Math.pow(t/255,n),o.b[t]=255*Math.pow(t/255,s);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{};super(t),this.gamma=t.gamma||this.constructor.defaults.gamma.concat()}}Z(oB,"type",oI),Z(oB,"defaults",{gamma:[1,1,1]}),Z(oB,"uniformLocations",["uGamma"]),tY.setClass(oB);let oN={average:"\n precision highp float;\n uniform sampler2D uTexture;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n float average = (color.r + color.b + color.g) / 3.0;\n gl_FragColor = vec4(average, average, average, color.a);\n }\n ",lightness:"\n precision highp float;\n uniform sampler2D uTexture;\n uniform int uMode;\n varying vec2 vTexCoord;\n void main() {\n vec4 col = texture2D(uTexture, vTexCoord);\n float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\n gl_FragColor = vec4(average, average, average, col.a);\n }\n ",luminosity:"\n precision highp float;\n uniform sampler2D uTexture;\n uniform int uMode;\n varying vec2 vTexCoord;\n void main() {\n vec4 col = texture2D(uTexture, vTexCoord);\n float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\n gl_FragColor = vec4(average, average, average, col.a);\n }\n "};class oW extends op{applyTo2d(t){let{imageData:{data:e}}=t;for(let t,r=0;rn[0]&&i>n[1]&&o>n[2]&&r"\n color += texture2D(uTexture, vTexCoord + ".concat(t,") * uTaps[").concat(e,"] + texture2D(uTexture, vTexCoord - ").concat(t,") * uTaps[").concat(e,"];\n sum += 2.0 * uTaps[").concat(e,"];\n ")).join("\n"),"\n gl_FragColor = color / sum;\n }\n ")}applyToForWebgl(t){t.passes++,this.width=t.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=t.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),t.destinationWidth=this.dW,super.applyTo(t),t.sourceWidth=t.destinationWidth,this.height=t.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),t.destinationHeight=this.dH,super.applyTo(t),t.sourceHeight=t.destinationHeight}applyTo(t){void 0!==t.webgl?this.applyToForWebgl(t):this.applyTo2d(t)}isNeutralState(){return 1===this.scaleX&&1===this.scaleY}lanczosCreate(t){return e=>{if(e>=t||e<=-t)return 0;if(e<11920929e-14&&e>-11920929e-14)return 1;let r=(e*=Math.PI)/t;return Math.sin(e)/e*Math.sin(r)/r}}applyTo2d(t){let e,r=t.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;let s=r.width,o=r.height,a=Math.round(s*i),l=Math.round(o*n);e="sliceHack"===this.resizeType?this.sliceByTwo(t,s,o,a,l):"hermite"===this.resizeType?this.hermiteFastResize(t,s,o,a,l):"bilinear"===this.resizeType?this.bilinearFiltering(t,s,o,a,l):"lanczos"===this.resizeType?this.lanczosResize(t,s,o,a,l):new ImageData(a,l),t.imageData=e}sliceByTwo(t,e,r,i,n){let s=t.imageData,o=!1,a=!1,l=.5*e,h=.5*r,c=t.filterBackend.resources,u=0,d=0,f=e,g=0;c.sliceByTwo||(c.sliceByTwo=t9());let p=c.sliceByTwo;(p.width<1.5*e||p.height=e)){p[E=Math.floor(1e3*Math.abs(_-m.x))]||(p[E]={});for(let t=y.y-g;t<=y.y+g;t++)t<0||t>=r||(D=Math.floor(1e3*Math.abs(t-m.y)),p[E][D]||(p[E][D]=l(Math.sqrt(Math.pow(E*u,2)+Math.pow(D*d,2))/1e3)),(w=p[E][D])>0&&(C=4*(t*e+_),S+=w,T+=w*s[C],O+=w*s[C+1],k+=w*s[C+2],M+=w*s[C+3]))}a[C=4*(b*i+x)]=T/S,a[C+1]=O/S,a[C+2]=k/S,a[C+3]=M/S}return++x1&&s<-1||(c=2*s*s*s-3*s*s+1)>0&&(y+=c*h[(r=4*(t+i*e))+3],f+=c,h[r+3]<255&&(c=c*h[r+3]/250),g+=c*h[r],p+=c*h[r+1],m+=c*h[r+2],d+=c)}}u[n]=g/d,u[n+1]=p/d,u[n+2]=m/d,u[n+3]=y/f}return c}}Z(oG,"type","Resize"),Z(oG,"defaults",{resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3}),Z(oG,"uniformLocations",["uDelta","uTaps"]),tY.setClass(oG);class oq extends op{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform float uSaturation;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n float rgMax = max(color.r, color.g);\n float rgbMax = max(rgMax, color.b);\n color.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\n color.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\n color.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\n gl_FragColor = color;\n }\n"}applyTo2d(t){let{imageData:{data:e}}=t,r=-this.saturation;for(let t=0;t({x:t,y:t}),o9={left:"right",right:"left",bottom:"top",top:"bottom"},o6={start:"end",end:"start"};function o8(t,e){return"function"==typeof t?t(e):t}function o7(t){return t.split("-")[0]}function at(t){return t.split("-")[1]}function ae(t){return"y"===t?"height":"width"}let ar=new Set(["top","bottom"]);function ai(t){return ar.has(o7(t))?"y":"x"}function an(t){return"x"===ai(t)?"y":"x"}function as(t){return t.replace(/start|end/g,t=>o6[t])}let ao=["left","right"],aa=["right","left"],al=["top","bottom"],ah=["bottom","top"];function ac(t){return t.replace(/left|right|bottom|top/g,t=>o9[t])}function au(t){let{x:e,y:r,width:i,height:n}=t;return{width:i,height:n,top:r,left:e,right:e+i,bottom:r+n,x:e,y:r}}function ad(t,e,r){let i,{reference:n,floating:s}=t,o=ai(e),a=an(e),l=ae(a),h=o7(e),c="y"===o,u=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,f=n[l]/2-s[l]/2;switch(h){case"top":i={x:u,y:n.y-s.height};break;case"bottom":i={x:u,y:n.y+n.height};break;case"right":i={x:n.x+n.width,y:d};break;case"left":i={x:n.x-s.width,y:d};break;default:i={x:n.x,y:n.y}}switch(at(e)){case"start":i[a]-=f*(r&&c?-1:1);break;case"end":i[a]+=f*(r&&c?-1:1)}return i}let af=async(t,e,r)=>{let{placement:i="bottom",strategy:n="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),l=await (null==o.isRTL?void 0:o.isRTL(e)),h=await o.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:u}=ad(h,i,l),d=i,f={},g=0;for(let r=0;r{try{return t.matches(e)}catch(t){return!1}})}let aD=["transform","translate","scale","rotate","perspective"],aj=["transform","translate","scale","rotate","perspective","filter"],aA=["paint","layout","strict","content"];function aP(t){let e=aF(),r=aw(t)?aI(t):t;return aD.some(t=>!!r[t]&&"none"!==r[t])||!!r.containerType&&"normal"!==r.containerType||!e&&!!r.backdropFilter&&"none"!==r.backdropFilter||!e&&!!r.filter&&"none"!==r.filter||aj.some(t=>(r.willChange||"").includes(t))||aA.some(t=>(r.contain||"").includes(t))}function aF(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let aL=new Set(["html","body","#document"]);function aR(t){return aL.has(ay(t))}function aI(t){return ax(t).getComputedStyle(t)}function aB(t){return aw(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function aN(t){if("html"===ay(t))return t;let e=t.assignedSlot||t.parentNode||aS(t)&&t.host||ab(t);return aS(e)?e.host:e}function aW(t,e,r){var i;void 0===e&&(e=[]),void 0===r&&(r=!0);let n=function t(e){let r=aN(e);return aR(r)?e.ownerDocument?e.ownerDocument.body:e.body:aC(r)&&aO(r)?r:t(r)}(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=ax(n);if(s){let t=aU(o);return e.concat(o,o.visualViewport||[],aO(n)?n:[],t&&r?aW(t):[])}return e.concat(n,aW(n,[],r))}function aU(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function aH(t){let e=aI(t),r=parseFloat(e.width)||0,i=parseFloat(e.height)||0,n=aC(t),s=n?t.offsetWidth:r,o=n?t.offsetHeight:i,a=o5(r)!==s||o5(i)!==o;return a&&(r=s,i=o),{width:r,height:i,$:a}}function aX(t){return aw(t)?t:t.contextElement}function aV(t){let e=aX(t);if(!aC(e))return o3(1);let r=e.getBoundingClientRect(),{width:i,height:n,$:s}=aH(e),o=(s?o5(r.width):r.width)/i,a=(s?o5(r.height):r.height)/n;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}let aY=o3(0);function az(t){let e=ax(t);return aF()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:aY}function aG(t,e,r,i){var n;void 0===e&&(e=!1),void 0===r&&(r=!1);let s=t.getBoundingClientRect(),o=aX(t),a=o3(1);e&&(i?aw(i)&&(a=aV(i)):a=aV(t));let l=(void 0===(n=r)&&(n=!1),i&&(!n||i===ax(o))&&n)?az(o):o3(0),h=(s.left+l.x)/a.x,c=(s.top+l.y)/a.y,u=s.width/a.x,d=s.height/a.y;if(o){let t=ax(o),e=i&&aw(i)?ax(i):i,r=t,n=aU(r);for(;n&&i&&e!==r;){let t=aV(n),e=n.getBoundingClientRect(),i=aI(n),s=e.left+(n.clientLeft+parseFloat(i.paddingLeft))*t.x,o=e.top+(n.clientTop+parseFloat(i.paddingTop))*t.y;h*=t.x,c*=t.y,u*=t.x,d*=t.y,h+=s,c+=o,n=aU(r=ax(n))}}return au({width:u,height:d,x:h,y:c})}function aq(t,e){let r=aB(t).scrollLeft;return e?e.left+r:aG(ab(t)).left+r}function aK(t,e){let r=t.getBoundingClientRect();return{x:r.left+e.scrollLeft-aq(t,r),y:r.top+e.scrollTop}}let aQ=new Set(["absolute","fixed"]);function aJ(t,e,r){let i;if("viewport"===e)i=function(t,e){let r=ax(t),i=ab(t),n=r.visualViewport,s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;let t=aF();(!t||t&&"fixed"===e)&&(a=n.offsetLeft,l=n.offsetTop)}let h=aq(i);if(h<=0){let t=i.ownerDocument,e=t.body,r=getComputedStyle(e),n="CSS1Compat"===t.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,o=Math.abs(i.clientWidth-e.clientWidth-n);o<=25&&(s-=o)}else h<=25&&(s+=h);return{width:s,height:o,x:a,y:l}}(t,r);else if("document"===e)i=function(t){let e=ab(t),r=aB(t),i=t.ownerDocument.body,n=o2(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=o2(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),o=-r.scrollLeft+aq(t),a=-r.scrollTop;return"rtl"===aI(i).direction&&(o+=o2(e.clientWidth,i.clientWidth)-n),{width:n,height:s,x:o,y:a}}(ab(t));else if(aw(e))i=function(t,e){let r=aG(t,!0,"fixed"===e),i=r.top+t.clientTop,n=r.left+t.clientLeft,s=aC(t)?aV(t):o3(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y;return{width:o,height:a,x:n*s.x,y:i*s.y}}(e,r);else{let r=az(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return au(i)}function aZ(t){return"static"===aI(t).position}function a$(t,e){if(!aC(t)||"fixed"===aI(t).position)return null;if(e)return e(t);let r=t.offsetParent;return ab(t)===r&&(r=r.ownerDocument.body),r}function a0(t,e){var r;let i=ax(t);if(aE(t))return i;if(!aC(t)){let e=aN(t);for(;e&&!aR(e);){if(aw(e)&&!aZ(e))return e;e=aN(e)}return i}let n=a$(t,e);for(;n&&(r=n,ak.has(ay(r)))&&aZ(n);)n=a$(n,e);return n&&aR(n)&&aZ(n)&&!aP(n)?i:n||function(t){let e=aN(t);for(;aC(e)&&!aR(e);){if(aP(e))return e;if(aE(e))break;e=aN(e)}return null}(t)||i}let a1=async function(t){let e=this.getOffsetParent||a0,r=this.getDimensions,i=await r(t.floating);return{reference:function(t,e,r){let i=aC(e),n=ab(e),s="fixed"===r,o=aG(t,!0,s,e),a={scrollLeft:0,scrollTop:0},l=o3(0);if(i||!i&&!s)if(("body"!==ay(e)||aO(n))&&(a=aB(e)),i){let t=aG(e,!0,s,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else n&&(l.x=aq(n));s&&!i&&n&&(l.x=aq(n));let h=!n||i||s?o3(0):aK(n,a);return{x:o.left+a.scrollLeft-l.x-h.x,y:o.top+a.scrollTop-l.y-h.y,width:o.width,height:o.height}}(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},a2={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:r,offsetParent:i,strategy:n}=t,s="fixed"===n,o=ab(i),a=!!e&&aE(e.floating);if(i===o||a&&s)return r;let l={scrollLeft:0,scrollTop:0},h=o3(1),c=o3(0),u=aC(i);if((u||!u&&!s)&&(("body"!==ay(i)||aO(o))&&(l=aB(i)),aC(i))){let t=aG(i);h=aV(i),c.x=t.x+i.clientLeft,c.y=t.y+i.clientTop}let d=!o||u||s?o3(0):aK(o,l);return{width:r.width*h.x,height:r.height*h.y,x:r.x*h.x-l.scrollLeft*h.x+c.x+d.x,y:r.y*h.y-l.scrollTop*h.y+c.y+d.y}},getDocumentElement:ab,getClippingRect:function(t){let{element:e,boundary:r,rootBoundary:i,strategy:n}=t,s=[..."clippingAncestors"===r?aE(e)?[]:function(t,e){let r=e.get(t);if(r)return r;let i=aW(t,[],!1).filter(t=>aw(t)&&"body"!==ay(t)),n=null,s="fixed"===aI(t).position,o=s?aN(t):t;for(;aw(o)&&!aR(o);){let e=aI(o),r=aP(o);r||"fixed"!==e.position||(n=null),(s?!r&&!n:!r&&"static"===e.position&&!!n&&aQ.has(n.position)||aO(o)&&!r&&function t(e,r){let i=aN(e);return!(i===r||!aw(i)||aR(i))&&("fixed"===aI(i).position||t(i,r))}(t,o))?i=i.filter(t=>t!==o):n=e,o=aN(o)}return e.set(t,i),i}(e,this._c):[].concat(r),i],o=s[0],a=s.reduce((t,r)=>{let i=aJ(e,r,n);return t.top=o2(i.top,t.top),t.right=o1(i.right,t.right),t.bottom=o1(i.bottom,t.bottom),t.left=o2(i.left,t.left),t},aJ(e,o,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:a0,getElementRects:a1,getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){let{width:e,height:r}=aH(t);return{width:e,height:r}},getScale:aV,isElement:aw,isRTL:function(t){return"rtl"===aI(t).direction}};function a5(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function a4(t,e,r,i){let n;void 0===i&&(i={});let{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:h=!1}=i,c=aX(t),u=s||o?[...c?aW(c):[],...aW(e)]:[];u.forEach(t=>{s&&t.addEventListener("scroll",r,{passive:!0}),o&&t.addEventListener("resize",r)});let d=c&&l?function(t,e){let r,i=null,n=ab(t);function s(){var t;clearTimeout(r),null==(t=i)||t.disconnect(),i=null}return!function o(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),s();let h=t.getBoundingClientRect(),{left:c,top:u,width:d,height:f}=h;if(a||e(),!d||!f)return;let g=o4(u),p=o4(n.clientWidth-(c+d)),m={rootMargin:-g+"px "+-p+"px "+-o4(n.clientHeight-(u+f))+"px "+-o4(c)+"px",threshold:o2(0,o1(1,l))||1},y=!0;function x(e){let i=e[0].intersectionRatio;if(i!==l){if(!y)return o();i?o(!1,i):r=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==i||a5(h,t.getBoundingClientRect())||o(),y=!1}try{i=new IntersectionObserver(x,{...m,root:n.ownerDocument})}catch(t){i=new IntersectionObserver(x,m)}i.observe(t)}(!0),s}(c,r):null,f=-1,g=null;a&&(g=new ResizeObserver(t=>{let[i]=t;i&&i.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;null==(t=g)||t.observe(e)})),r()}),c&&!h&&g.observe(c),g.observe(e));let p=h?aG(t):null;return h&&function e(){let i=aG(t);p&&!a5(p,i)&&r(),p=i,n=requestAnimationFrame(e)}(),r(),()=>{var t;u.forEach(t=>{s&&t.removeEventListener("scroll",r),o&&t.removeEventListener("resize",r)}),null==d||d(),null==(t=g)||t.disconnect(),g=null,h&&cancelAnimationFrame(n)}}var a3=t.i(74080),a9="undefined"!=typeof document?J.useLayoutEffect:function(){};function a6(t,e){let r,i,n;if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!==e.length)return!1;for(i=r;0!=i--;)if(!a6(t[i],e[i]))return!1;return!0}if((r=(n=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(i=r;0!=i--;)if(!({}).hasOwnProperty.call(e,n[i]))return!1;for(i=r;0!=i--;){let r=n[i];if(("_owner"!==r||!t.$$typeof)&&!a6(t[r],e[r]))return!1}return!0}return t!=t&&e!=e}function a8(t){return"undefined"==typeof window?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function a7(t,e){let r=a8(t);return Math.round(e*r)/r}function lt(t){let e=J.useRef(t);return a9(()=>{e.current=t}),e}let le=(t,e)=>({...function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var r,i;let{x:n,y:s,placement:o,middlewareData:a}=e,l=await am(e,t);return o===(null==(r=a.offset)?void 0:r.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:n+l.x,y:s+l.y,data:{...l,placement:o}}}}}(t),options:[t,e]}),lr=(t,e)=>({...function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var r,i,n,s,o;let{placement:a,middlewareData:l,rects:h,initialPlacement:c,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...b}=o8(t,e);if(null!=(r=l.arrow)&&r.alignmentOffset)return{};let _=o7(a),w=ai(c),C=o7(c)===c,S=await (null==u.isRTL?void 0:u.isRTL(d.floating)),T=p||(C||!x?[ac(c)]:function(t){let e=ac(t);return[as(t),e,as(e)]}(c)),O="none"!==y;!p&&O&&T.push(...function(t,e,r,i){let n=at(t),s=function(t,e,r){switch(t){case"top":case"bottom":if(r)return e?aa:ao;return e?ao:aa;case"left":case"right":return e?al:ah;default:return[]}}(o7(t),"start"===r,i);return n&&(s=s.map(t=>t+"-"+n),e&&(s=s.concat(s.map(as)))),s}(c,x,y,S));let k=[c,...T],M=await ag(e,b),E=[],D=(null==(i=l.flip)?void 0:i.overflows)||[];if(f&&E.push(M[_]),g){let t=function(t,e,r){void 0===r&&(r=!1);let i=at(t),n=an(t),s=ae(n),o="x"===n?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=ac(o)),[o,ac(o)]}(a,h,S);E.push(M[t[0]],M[t[1]])}if(D=[...D,{placement:a,overflows:E}],!E.every(t=>t<=0)){let t=((null==(n=l.flip)?void 0:n.index)||0)+1,e=k[t];if(e&&("alignment"!==g||w===ai(e)||D.every(t=>ai(t.placement)!==w||t.overflows[0]>0)))return{data:{index:t,overflows:D},reset:{placement:e}};let r=null==(s=D.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:s.placement;if(!r)switch(m){case"bestFit":{let t=null==(o=D.filter(t=>{if(O){let e=ai(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:o[0];t&&(r=t);break}case"initialPlacement":r=c}if(a!==r)return{reset:{placement:r}}}return{}}}}(t),options:[t,e]});t.i(47167);var li='input:not([inert]),select:not([inert]),textarea:not([inert]),a[href]:not([inert]),button:not([inert]),[tabindex]:not(slot):not([inert]),audio[controls]:not([inert]),video[controls]:not([inert]),[contenteditable]:not([contenteditable="false"]):not([inert]),details>summary:first-of-type:not([inert]),details:not([inert])',ln="undefined"==typeof Element,ls=ln?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,lo=!ln&&Element.prototype.getRootNode?function(t){var e;return null==t||null==(e=t.getRootNode)?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},la=function t(e,r){void 0===r&&(r=!0);var i,n=null==e||null==(i=e.getAttribute)?void 0:i.call(e,"inert");return""===n||"true"===n||r&&e&&t(e.parentNode)},ll=function(t){var e,r=null==t||null==(e=t.getAttribute)?void 0:e.call(t,"contenteditable");return""===r||"true"===r},lh=function(t,e,r){if(la(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(li));return e&&ls.call(t,li)&&i.unshift(t),i=i.filter(r)},lc=function t(e,r,i){for(var n=[],s=Array.from(e);s.length;){var o=s.shift();if(!la(o,!1))if("SLOT"===o.tagName){var a=o.assignedElements(),l=t(a.length?a:o.children,!0,i);i.flatten?n.push.apply(n,l):n.push({scopeParent:o,candidates:l})}else{ls.call(o,li)&&i.filter(o)&&(r||!e.includes(o))&&n.push(o);var h=o.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(o),c=!la(h,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(o));if(h&&c){var u=t(!0===h?o.children:h.children,!0,i);i.flatten?n.push.apply(n,u):n.push({scopeParent:o,candidates:u})}else s.unshift.apply(s,o.children)}}return n},lu=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ld=function(t){if(!t)throw Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ll(t))&&!lu(t)?0:t.tabIndex},lf=function(t,e){var r=ld(t);return r<0&&e&&!lu(t)?0:r},lg=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},lp=function(t){return"INPUT"===t.tagName},lm=function(t,e){for(var r=0;rsummary:first-of-type")?t.parentElement:t;if(ls.call(n,"details:not([open]) *"))return!0;if(r&&"full"!==r&&"legacy-full"!==r){if("non-zero-area"===r)return lb(t)}else{if("function"==typeof i){for(var s=t;t;){var o=t.parentElement,a=lo(t);if(o&&!o.shadowRoot&&!0===i(o))return lb(t);t=t.assignedSlot?t.assignedSlot:o||a===t.ownerDocument?o:a.host}t=s}if(lx(t))return!t.getClientRects().length;if("legacy-full"!==r)return!0}return!1},lw=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var r=0;rld(e))&&!!lC(t,e)},lT=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!isNaN(e)||!!(e>=0)},lO=function t(e){var r=[],i=[];return e.forEach(function(e,n){var s=!!e.scopeParent,o=s?e.scopeParent:e,a=lf(o,s),l=s?t(e.candidates):o;0===a?s?r.push.apply(r,l):r.push(o):i.push({documentOrder:n,tabIndex:a,item:e,isScope:s,content:l})}),i.sort(lg).reduce(function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t},[]).concat(r)},lk=function(t,e){return lO((e=e||{}).getShadowRoot?lc([t],e.includeContainer,{filter:lS.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:lT}):lh(t,e.includeContainer,lS.bind(null,e)))},lM=function(t,e){return(e=e||{}).getShadowRoot?lc([t],e.includeContainer,{filter:lC.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):lh(t,e.includeContainer,lC.bind(null,e))},lE=function(t,e){if(e=e||{},!t)throw Error("No node provided");return!1!==ls.call(t,li)&&lS(e,t)};function lD(){let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(t=>{let{brand:e,version:r}=t;return e+"/"+r}).join(" "):navigator.userAgent}function lj(){let t=/android/i;return t.test(function(){let t=navigator.userAgentData;return null!=t&&t.platform?t.platform:navigator.platform}())||t.test(lD())}let lA="data-floating-ui-focusable";function lP(t){let e=t.activeElement;for(;(null==(r=e)||null==(r=r.shadowRoot)?void 0:r.activeElement)!=null;){var r;e=e.shadowRoot.activeElement}return e}function lF(t,e){if(!t||!e)return!1;let r=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(r&&aS(r)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function lL(t){return"composedPath"in t?t.composedPath()[0]:t.target}function lR(t,e){return null!=e&&("composedPath"in t?t.composedPath().includes(e):null!=t.target&&e.contains(t.target))}function lI(t){return(null==t?void 0:t.ownerDocument)||document}function lB(t){return aC(t)&&t.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function lN(t){return!!t&&"combobox"===t.getAttribute("role")&&lB(t)}function lW(t){return t?t.hasAttribute(lA)?t:t.querySelector("["+lA+"]")||t:null}function lU(t,e,r){return void 0===r&&(r=!0),t.filter(t=>{var i;return t.parentId===e&&(!r||(null==(i=t.context)?void 0:i.open))}).flatMap(e=>[e,...lU(t,e.id,r)])}function lH(t,e){var r;let i=[],n=null==(r=t.find(t=>t.id===e))?void 0:r.parentId;for(;n;){let e=t.find(t=>t.id===n);n=null==e?void 0:e.parentId,e&&(i=i.concat(e))}return i}function lX(t){t.preventDefault(),t.stopPropagation()}function lV(t,e){let r=["mouse","pen"];return e||r.push("",void 0),r.includes(t)}var lY="undefined"!=typeof document?J.useLayoutEffect:function(){};function lz(t){let e=J.useRef(t);return lY(()=>{e.current=t}),e}let lG={...J}.useInsertionEffect||(t=>t());function lq(t){let e=J.useRef(()=>{});return lG(()=>{e.current=t}),J.useCallback(function(){for(var t=arguments.length,r=Array(t),i=0;i({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function lQ(t,e){let r=lk(t,lK()),i=r.length;if(0===i)return;let n=lP(lI(t)),s=r.indexOf(n);return r[-1===s?1===e?0:i-1:s+e]}function lJ(t,e){let r=e||t.currentTarget,i=t.relatedTarget;return!i||!lF(r,i)}let lZ="active",l$="selected",l0={...J},l1=!1,l2=0,l5=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+l2++,l4=l0.useId||function(){let[t,e]=J.useState(()=>l1?l5():void 0);return lY(()=>{null==t&&e(l5())},[]),J.useEffect(()=>{l1=!0},[]),t},l3=J.createContext(null),l9=J.createContext(null),l6=()=>{var t;return(null==(t=J.useContext(l3))?void 0:t.id)||null},l8=()=>J.useContext(l9);function l7(t){return"data-floating-ui-"+t}let ht=0;function he(t,e){void 0===e&&(e={});let{preventScroll:r=!1,cancelPrevious:i=!0,sync:n=!1}=e;i&&cancelAnimationFrame(ht);let s=()=>null==t?void 0:t.focus({preventScroll:r});n?s():ht=requestAnimationFrame(s)}let hr={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function hi(t){return"inert"===t?hr.inert:"aria-hidden"===t?hr["aria-hidden"]:hr.none}let hn=new WeakSet,hs={},ho=0,ha=t=>t&&(t.host||ha(t.parentNode));function hl(t,e,r){var i;void 0===e&&(e=!1),void 0===r&&(r=!1);let n=((null==(i=t[0])?void 0:i.ownerDocument)||document).body;return function(t,e,r,i){let n="data-floating-ui-inert",s=i?"inert":r?"aria-hidden":null,o=t.map(t=>{if(e.contains(t))return t;let r=ha(t);return e.contains(r)?r:null}).filter(t=>null!=t),a=new Set,l=new Set(o),h=[];hs[n]||(hs[n]=new WeakMap);let c=hs[n];return o.forEach(function t(e){!(!e||a.has(e))&&(a.add(e),e.parentNode&&t(e.parentNode))}),function t(e){!e||l.has(e)||[].forEach.call(e.children,e=>{if("script"!==ay(e))if(a.has(e))t(e);else{let t=s?e.getAttribute(s):null,r=null!==t&&"false"!==t,i=hi(s),o=(i.get(e)||0)+1,a=(c.get(e)||0)+1;i.set(e,o),c.set(e,a),h.push(e),1===o&&r&&hn.add(e),1===a&&e.setAttribute(n,""),!r&&s&&e.setAttribute(s,"inert"===s?"":"true")}})}(e),a.clear(),ho++,()=>{h.forEach(t=>{let e=hi(s),r=(e.get(t)||0)-1,i=(c.get(t)||0)-1;e.set(t,r),c.set(t,i),r||(!hn.has(t)&&s&&t.removeAttribute(s),hn.delete(t)),i||t.removeAttribute(n)}),--ho||(hr.inert=new WeakMap,hr["aria-hidden"]=new WeakMap,hr.none=new WeakMap,hn=new WeakSet,hs={})}}(t.concat(Array.from(n.querySelectorAll('[aria-live],[role="status"],output'))),n,e,r)}let hh={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},hc=J.forwardRef(function(t,e){let[r,i]=J.useState();lY(()=>{/apple/i.test(navigator.vendor)&&i("button")},[]);let n={ref:e,tabIndex:0,role:r,"aria-hidden":!r||void 0,[l7("focus-guard")]:"",style:hh};return(0,Q.jsx)("span",{...t,...n})}),hu=J.createContext(null);function hd(t){return J.useMemo(()=>e=>{t.forEach(t=>{t&&(t.current=e)})},t)}let hf=[];function hg(){hf=hf.filter(t=>t.isConnected)}function hp(){return hg(),hf[hf.length-1]}function hm(t,e){var r;if(!e.current.includes("floating")&&!(null!=(r=t.getAttribute("role"))&&r.includes("dialog")))return;let i=lK(),n=lM(t,i).filter(t=>{let e=t.getAttribute("data-tabindex")||"";return lE(t,i)||t.hasAttribute("data-tabindex")&&!e.startsWith("-")}),s=t.getAttribute("tabindex");e.current.includes("floating")||0===n.length?"0"!==s&&t.setAttribute("tabindex","0"):("-1"!==s||t.hasAttribute("data-tabindex")&&"-1"!==t.getAttribute("data-tabindex"))&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}let hv=J.forwardRef(function(t,e){return(0,Q.jsx)("button",{...t,type:"button",ref:e,tabIndex:-1,style:hh})});function hy(t){let{context:e,children:r,disabled:i=!1,order:n=["content"],guards:s=!0,initialFocus:o=0,returnFocus:a=!0,restoreFocus:l=!1,modal:h=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:u=!0,outsideElementsInert:d=!1,getInsideElements:f=()=>[]}=t,{open:g,onOpenChange:p,events:m,dataRef:y,elements:{domReference:x,floating:b}}=e,_=lq(()=>{var t;return null==(t=y.current.floatingContext)?void 0:t.nodeId}),w=lq(f),C="number"==typeof o&&o<0,S=lN(x)&&C,T="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,O=!T||s,k=!O||T&&d,M=lz(n),E=lz(o),D=lz(a),j=l8(),A=J.useContext(hu),P=J.useRef(null),F=J.useRef(null),L=J.useRef(!1),R=J.useRef(!1),I=J.useRef(-1),B=J.useRef(-1),N=null!=A,W=lW(b),U=lq(function(t){return void 0===t&&(t=W),t?lk(t,lK()):[]}),H=lq(t=>{let e=U(t);return M.current.map(t=>x&&"reference"===t?x:W&&"floating"===t?W:e).filter(Boolean).flat()});J.useEffect(()=>{if(i||!h)return;function t(t){if("Tab"===t.key){lF(W,lP(lI(W)))&&0===U().length&&!S&&lX(t);let e=H(),r=lL(t);"reference"===M.current[0]&&r===x&&(lX(t),t.shiftKey?he(e[e.length-1]):he(e[1])),"floating"===M.current[1]&&r===W&&t.shiftKey&&(lX(t),he(e[0]))}}let e=lI(W);return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[i,x,W,h,M,S,U,H]),J.useEffect(()=>{if(!i&&b)return b.addEventListener("focusin",t),()=>{b.removeEventListener("focusin",t)};function t(t){let e=lL(t),r=U().indexOf(e);-1!==r&&(I.current=r)}},[i,b,U]),J.useEffect(()=>{if(i||!u)return;function t(){R.current=!0,setTimeout(()=>{R.current=!1})}function e(t){let e=t.relatedTarget,r=t.currentTarget,i=lL(t);queueMicrotask(()=>{let n=_(),s=!(lF(x,e)||lF(b,e)||lF(e,b)||lF(null==A?void 0:A.portalNode,e)||null!=e&&e.hasAttribute(l7("focus-guard"))||j&&(lU(j.nodesRef.current,n).find(t=>{var r,i;return lF(null==(r=t.context)?void 0:r.elements.floating,e)||lF(null==(i=t.context)?void 0:i.elements.domReference,e)})||lH(j.nodesRef.current,n).find(t=>{var r,i,n;return[null==(r=t.context)?void 0:r.elements.floating,lW(null==(i=t.context)?void 0:i.elements.floating)].includes(e)||(null==(n=t.context)?void 0:n.elements.domReference)===e})));if(r===x&&W&&hm(W,M),l&&r!==x&&!(null!=i&&i.isConnected)&&lP(lI(W))===lI(W).body){aC(W)&&W.focus();let t=I.current,e=U(),r=e[t]||e[e.length-1]||W;aC(r)&&r.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(S||!h)&&e&&s&&!R.current&&e!==hp()&&(L.current=!0,p(!1,t,"focus-out"))})}let r=!!(!j&&A);function n(){-1!==B.current&&(clearTimeout(B.current),B.current=-1),y.current.insideReactTree=!0,B.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(b&&aC(x))return x.addEventListener("focusout",e),x.addEventListener("pointerdown",t),b.addEventListener("focusout",e),r&&b.addEventListener("focusout",n,!0),()=>{x.removeEventListener("focusout",e),x.removeEventListener("pointerdown",t),b.removeEventListener("focusout",e),r&&b.removeEventListener("focusout",n,!0)}},[i,x,b,W,h,j,A,p,u,l,U,S,_,M,y]);let X=J.useRef(null),V=J.useRef(null),Y=hd([X,null==A?void 0:A.beforeInsideRef]),z=hd([V,null==A?void 0:A.afterInsideRef]);function G(t){return!i&&c&&h?(0,Q.jsx)(hv,{ref:"start"===t?P:F,onClick:t=>p(!1,t.nativeEvent),children:"string"==typeof c?c:"Dismiss"}):null}J.useEffect(()=>{var t,e;if(i||!b)return;let r=Array.from((null==A||null==(t=A.portalNode)?void 0:t.querySelectorAll("["+l7("portal")+"]"))||[]),n=[b,null==(e=(j?lH(j.nodesRef.current,_()):[]).find(t=>{var e;return lN((null==(e=t.context)?void 0:e.elements.domReference)||null)}))||null==(e=e.context)?void 0:e.elements.domReference,...r,...w(),P.current,F.current,X.current,V.current,null==A?void 0:A.beforeOutsideRef.current,null==A?void 0:A.afterOutsideRef.current,M.current.includes("reference")||S?x:null].filter(t=>null!=t),s=h||S?hl(n,!k,k):hl(n);return()=>{s()}},[i,x,b,h,M,A,S,O,k,j,_,w]),lY(()=>{if(i||!aC(W))return;let t=lP(lI(W));queueMicrotask(()=>{let e=H(W),r=E.current,i=("number"==typeof r?e[r]:r.current)||W,n=lF(W,t);C||n||!g||he(i,{preventScroll:i===W})})},[i,g,W,C,H,E]),lY(()=>{var t;if(i||!W)return;let e=lI(W);function r(t){let{reason:e,event:r,nested:i}=t;if(["hover","safe-polygon"].includes(e)&&"mouseleave"===r.type&&(L.current=!0),"outside-press"===e)if(i)L.current=!1;else if(0===r.mozInputSource&&r.isTrusted||(lj()&&r.pointerType?"click"===r.type&&1===r.buttons:0===r.detail&&!r.pointerType)||!lD().includes("jsdom/")&&(!lj()&&0===r.width&&0===r.height||lj()&&1===r.width&&1===r.height&&0===r.pressure&&0===r.detail&&"mouse"===r.pointerType||r.width<1&&r.height<1&&0===r.pressure&&0===r.detail&&"touch"===r.pointerType))L.current=!1;else{let t=!1;document.createElement("div").focus({get preventScroll(){return t=!0,!1}}),t?L.current=!1:L.current=!0}}t=lP(e),hg(),t&&"body"!==ay(t)&&(hf.push(t),hf.length>20&&(hf=hf.slice(-20))),m.on("openchange",r);let n=e.createElement("span");return n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),Object.assign(n.style,hh),N&&x&&x.insertAdjacentElement("afterend",n),()=>{m.off("openchange",r);let t=lP(e),i=lF(b,t)||j&&lU(j.nodesRef.current,_(),!1).some(e=>{var r;return lF(null==(r=e.context)?void 0:r.elements.floating,t)}),s=function(){if("boolean"==typeof D.current){let t=x||hp();return t&&t.isConnected?t:n}return D.current.current||n}();queueMicrotask(()=>{let r=function(t){let e=lK();return lE(t,e)?t:lk(t,e)[0]||t}(s);D.current&&!L.current&&aC(r)&&(r===t||t===e.body||i)&&r.focus({preventScroll:!0}),n.remove()})}},[i,b,W,D,y,m,j,N,x,_]),J.useEffect(()=>(queueMicrotask(()=>{L.current=!1}),()=>{queueMicrotask(hg)}),[i]),lY(()=>{if(!i&&A)return A.setFocusManagerState({modal:h,closeOnFocusOut:u,open:g,onOpenChange:p,domReference:x}),()=>{A.setFocusManagerState(null)}},[i,A,h,g,p,u,x]),lY(()=>{!i&&W&&hm(W,M)},[i,W,M]);let q=!i&&O&&(!h||!S)&&(N||h);return(0,Q.jsxs)(Q.Fragment,{children:[q&&(0,Q.jsx)(hc,{"data-type":"inside",ref:Y,onFocus:t=>{var e;if(h){let t=H();he("reference"===n[0]?t[0]:t[t.length-1])}else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(L.current=!1,lJ(t,A.portalNode)){let t=lQ(lI(x).body,1)||x;null==t||t.focus()}else null==(e=A.beforeOutsideRef.current)||e.focus()}}),!S&&G("start"),r,G("end"),q&&(0,Q.jsx)(hc,{"data-type":"inside",ref:z,onFocus:t=>{var e;if(h)he(H()[0]);else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(u&&(L.current=!0),lJ(t,A.portalNode)){let t=lQ(lI(x).body,-1)||x;null==t||t.focus()}else null==(e=A.afterOutsideRef.current)||e.focus()}})]})}function hx(t){return aC(t.target)&&"BUTTON"===t.target.tagName}function hb(t,e){void 0===e&&(e={});let{open:r,onOpenChange:i,dataRef:n,elements:{domReference:s}}=t,{enabled:o=!0,event:a="click",toggle:l=!0,ignoreMouse:h=!1,keyboardHandlers:c=!0,stickIfOpen:u=!0}=e,d=J.useRef(),f=J.useRef(!1),g=J.useMemo(()=>({onPointerDown(t){d.current=t.pointerType},onMouseDown(t){let e=d.current;0===t.button&&"click"!==a&&(lV(e,!0)&&h||(r&&l&&(!n.current.openEvent||!u||"mousedown"===n.current.openEvent.type)?i(!1,t.nativeEvent,"click"):(t.preventDefault(),i(!0,t.nativeEvent,"click"))))},onClick(t){let e=d.current;if("mousedown"===a&&d.current){d.current=void 0;return}lV(e,!0)&&h||(r&&l&&(!n.current.openEvent||!u||"click"===n.current.openEvent.type)?i(!1,t.nativeEvent,"click"):i(!0,t.nativeEvent,"click"))},onKeyDown(t){d.current=void 0,!(t.defaultPrevented||!c||hx(t))&&(" "!==t.key||lB(s)||(t.preventDefault(),f.current=!0),aC(t.target)&&"A"===t.target.tagName||"Enter"!==t.key||(r&&l?i(!1,t.nativeEvent,"click"):i(!0,t.nativeEvent,"click")))},onKeyUp(t){!(t.defaultPrevented||!c||hx(t)||lB(s))&&" "===t.key&&f.current&&(f.current=!1,r&&l?i(!1,t.nativeEvent,"click"):i(!0,t.nativeEvent,"click"))}}),[n,s,a,h,c,i,r,u,l]);return J.useMemo(()=>o?{reference:g}:{},[o,g])}let h_={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},hw={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hC=t=>{var e,r;return{escapeKey:"boolean"==typeof t?t:null!=(e=null==t?void 0:t.escapeKey)&&e,outsidePress:"boolean"==typeof t?t:null==(r=null==t?void 0:t.outsidePress)||r}};function hS(t,e){void 0===e&&(e={});let{open:r,onOpenChange:i,elements:n,dataRef:s}=t,{enabled:o=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:h="pointerdown",referencePress:c=!1,referencePressEvent:u="pointerdown",ancestorScroll:d=!1,bubbles:f,capture:g}=e,p=l8(),m=lq("function"==typeof l?l:()=>!1),y="function"==typeof l?m:l,x=J.useRef(!1),{escapeKey:b,outsidePress:_}=hC(f),{escapeKey:w,outsidePress:C}=hC(g),S=J.useRef(!1),T=lq(t=>{var e;if(!r||!o||!a||"Escape"!==t.key||S.current)return;let n=null==(e=s.current.floatingContext)?void 0:e.nodeId,l=p?lU(p.nodesRef.current,n):[];if(!b&&(t.stopPropagation(),l.length>0)){let t=!0;if(l.forEach(e=>{var r;if(null!=(r=e.context)&&r.open&&!e.context.dataRef.current.__escapeKeyBubbles){t=!1;return}}),!t)return}i(!1,"nativeEvent"in t?t.nativeEvent:t,"escape-key")}),O=lq(t=>{var e;let r=()=>{var e;T(t),null==(e=lL(t))||e.removeEventListener("keydown",r)};null==(e=lL(t))||e.addEventListener("keydown",r)}),k=lq(t=>{var e;let r=s.current.insideReactTree;s.current.insideReactTree=!1;let o=x.current;if(x.current=!1,"click"===h&&o||r||"function"==typeof y&&!y(t))return;let a=lL(t),l="["+l7("inert")+"]",c=lI(n.floating).querySelectorAll(l),u=aw(a)?a:null;for(;u&&!aR(u);){let t=aN(u);if(aR(t)||!aw(t))break;u=t}if(c.length&&aw(a)&&!a.matches("html,body")&&!lF(a,n.floating)&&Array.from(c).every(t=>!lF(u,t)))return;if(aC(a)&&D){let e=aR(a),r=aI(a),i=/auto|scroll/,n=e||i.test(r.overflowX),s=e||i.test(r.overflowY),o=n&&a.clientWidth>0&&a.scrollWidth>a.clientWidth,l=s&&a.clientHeight>0&&a.scrollHeight>a.clientHeight,h="rtl"===r.direction,c=l&&(h?t.offsetX<=a.offsetWidth-a.clientWidth:t.offsetX>a.clientWidth),u=o&&t.offsetY>a.clientHeight;if(c||u)return}let d=null==(e=s.current.floatingContext)?void 0:e.nodeId,f=p&&lU(p.nodesRef.current,d).some(e=>{var r;return lR(t,null==(r=e.context)?void 0:r.elements.floating)});if(lR(t,n.floating)||lR(t,n.domReference)||f)return;let g=p?lU(p.nodesRef.current,d):[];if(g.length>0){let t=!0;if(g.forEach(e=>{var r;if(null!=(r=e.context)&&r.open&&!e.context.dataRef.current.__outsidePressBubbles){t=!1;return}}),!t)return}i(!1,t,"outside-press")}),M=lq(t=>{var e;let r=()=>{var e;k(t),null==(e=lL(t))||e.removeEventListener(h,r)};null==(e=lL(t))||e.addEventListener(h,r)});J.useEffect(()=>{if(!r||!o)return;s.current.__escapeKeyBubbles=b,s.current.__outsidePressBubbles=_;let t=-1;function e(t){i(!1,t,"ancestor-scroll")}function l(){window.clearTimeout(t),S.current=!0}function c(){t=window.setTimeout(()=>{S.current=!1},5*!!aF())}let u=lI(n.floating);a&&(u.addEventListener("keydown",w?O:T,w),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",c)),y&&u.addEventListener(h,C?M:k,C);let f=[];return d&&(aw(n.domReference)&&(f=aW(n.domReference)),aw(n.floating)&&(f=f.concat(aW(n.floating))),!aw(n.reference)&&n.reference&&n.reference.contextElement&&(f=f.concat(aW(n.reference.contextElement)))),(f=f.filter(t=>{var e;return t!==(null==(e=u.defaultView)?void 0:e.visualViewport)})).forEach(t=>{t.addEventListener("scroll",e,{passive:!0})}),()=>{a&&(u.removeEventListener("keydown",w?O:T,w),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",c)),y&&u.removeEventListener(h,C?M:k,C),f.forEach(t=>{t.removeEventListener("scroll",e)}),window.clearTimeout(t)}},[s,n,a,y,h,r,i,d,o,b,_,T,w,O,k,C,M]),J.useEffect(()=>{s.current.insideReactTree=!1},[s,y,h]);let E=J.useMemo(()=>({onKeyDown:T,...c&&{[h_[u]]:t=>{i(!1,t.nativeEvent,"reference-press")},..."click"!==u&&{onClick(t){i(!1,t.nativeEvent,"reference-press")}}}}),[T,i,c,u]),D=J.useMemo(()=>({onKeyDown:T,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[hw[h]]:()=>{s.current.insideReactTree=!0}}),[T,h,s]);return J.useMemo(()=>o?{reference:E,floating:D}:{},[o,E,D])}function hT(t){void 0===t&&(t={});let{nodeId:e}=t,r=function(t){let{open:e=!1,onOpenChange:r,elements:i}=t,n=l4(),s=J.useRef({}),[o]=J.useState(()=>(function(){let t=new Map;return{emit(e,r){var i;null==(i=t.get(e))||i.forEach(t=>t(r))},on(e,r){t.has(e)||t.set(e,new Set),t.get(e).add(r)},off(e,r){var i;null==(i=t.get(e))||i.delete(r)}}})()),a=null!=l6(),[l,h]=J.useState(i.reference),c=lq((t,e,i)=>{s.current.openEvent=t?e:void 0,o.emit("openchange",{open:t,event:e,reason:i,nested:a}),null==r||r(t,e,i)}),u=J.useMemo(()=>({setPositionReference:h}),[]),d=J.useMemo(()=>({reference:l||i.reference||null,floating:i.floating||null,domReference:i.reference}),[l,i.reference,i.floating]);return J.useMemo(()=>({dataRef:s,open:e,onOpenChange:c,elements:d,events:o,floatingId:n,refs:u}),[e,c,d,o,n,u])}({...t,elements:{reference:null,floating:null,...t.elements}}),i=t.rootContext||r,n=i.elements,[s,o]=J.useState(null),[a,l]=J.useState(null),h=(null==n?void 0:n.domReference)||s,c=J.useRef(null),u=l8();lY(()=>{h&&(c.current=h)},[h]);let d=function(t){void 0===t&&(t={});let{placement:e="bottom",strategy:r="absolute",middleware:i=[],platform:n,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:h}=t,[c,u]=J.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,f]=J.useState(i);a6(d,i)||f(i);let[g,p]=J.useState(null),[m,y]=J.useState(null),x=J.useCallback(t=>{t!==C.current&&(C.current=t,p(t))},[]),b=J.useCallback(t=>{t!==S.current&&(S.current=t,y(t))},[]),_=s||g,w=o||m,C=J.useRef(null),S=J.useRef(null),T=J.useRef(c),O=null!=l,k=lt(l),M=lt(n),E=lt(h),D=J.useCallback(()=>{if(!C.current||!S.current)return;let t={placement:e,strategy:r,middleware:d};M.current&&(t.platform=M.current),((t,e,r)=>{let i=new Map,n={platform:a2,...r},s={...n.platform,_c:i};return af(t,e,{...n,platform:s})})(C.current,S.current,t).then(t=>{let e={...t,isPositioned:!1!==E.current};j.current&&!a6(T.current,e)&&(T.current=e,a3.flushSync(()=>{u(e)}))})},[d,e,r,M,E]);a9(()=>{!1===h&&T.current.isPositioned&&(T.current.isPositioned=!1,u(t=>({...t,isPositioned:!1})))},[h]);let j=J.useRef(!1);a9(()=>(j.current=!0,()=>{j.current=!1}),[]),a9(()=>{if(_&&(C.current=_),w&&(S.current=w),_&&w){if(k.current)return k.current(_,w,D);D()}},[_,w,D,k,O]);let A=J.useMemo(()=>({reference:C,floating:S,setReference:x,setFloating:b}),[x,b]),P=J.useMemo(()=>({reference:_,floating:w}),[_,w]),F=J.useMemo(()=>{let t={position:r,left:0,top:0};if(!P.floating)return t;let e=a7(P.floating,c.x),i=a7(P.floating,c.y);return a?{...t,transform:"translate("+e+"px, "+i+"px)",...a8(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:e,top:i}},[r,a,P.floating,c.x,c.y]);return J.useMemo(()=>({...c,update:D,refs:A,elements:P,floatingStyles:F}),[c,D,A,P,F])}({...t,elements:{...n,...a&&{reference:a}}}),f=J.useCallback(t=>{let e=aw(t)?{getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>t.getClientRects(),contextElement:t}:t;l(e),d.refs.setReference(e)},[d.refs]),g=J.useCallback(t=>{(aw(t)||null===t)&&(c.current=t,o(t)),(aw(d.refs.reference.current)||null===d.refs.reference.current||null!==t&&!aw(t))&&d.refs.setReference(t)},[d.refs]),p=J.useMemo(()=>({...d.refs,setReference:g,setPositionReference:f,domReference:c}),[d.refs,g,f]),m=J.useMemo(()=>({...d.elements,domReference:h}),[d.elements,h]),y=J.useMemo(()=>({...d,...i,refs:p,elements:m,nodeId:e}),[d,p,m,e,i]);return lY(()=>{i.dataRef.current.floatingContext=y;let t=null==u?void 0:u.nodesRef.current.find(t=>t.id===e);t&&(t.context=y)}),J.useMemo(()=>({...d,context:y,refs:p,elements:m}),[d,p,m,y])}function hO(t,e,r){let i=new Map,n="item"===r,s=t;if(n&&t){let{[lZ]:e,[l$]:r,...i}=t;s=i}return{..."floating"===r&&{tabIndex:-1,"data-floating-ui-focusable":""},...s,...e.map(e=>{let i=e?e[r]:null;return"function"==typeof i?t?i(t):null:i}).concat(t).reduce((t,e)=>(e&&Object.entries(e).forEach(e=>{let[r,s]=e;if(!(n&&[lZ,l$].includes(r)))if(0===r.indexOf("on")){if(i.has(r)||i.set(r,[]),"function"==typeof s){var o;null==(o=i.get(r))||o.push(s),t[r]=function(){for(var t,e=arguments.length,n=Array(e),s=0;st(...n)).find(t=>void 0!==t)}}}else t[r]=s}),t),{})}}function hk(t){void 0===t&&(t=[]);let e=t.map(t=>null==t?void 0:t.reference),r=t.map(t=>null==t?void 0:t.floating),i=t.map(t=>null==t?void 0:t.item),n=J.useCallback(e=>hO(e,t,"reference"),e),s=J.useCallback(e=>hO(e,t,"floating"),r),o=J.useCallback(e=>hO(e,t,"item"),i);return J.useMemo(()=>({getReferenceProps:n,getFloatingProps:s,getItemProps:o}),[n,s,o])}let hM=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hE(t,e){var r,i;void 0===e&&(e={});let{open:n,elements:s,floatingId:o}=t,{enabled:a=!0,role:l="dialog"}=e,h=l4(),c=(null==(r=s.domReference)?void 0:r.id)||h,u=J.useMemo(()=>{var t;return(null==(t=lW(s.floating))?void 0:t.id)||o},[s.floating,o]),d=null!=(i=hM.get(l))?i:l,f=null!=l6(),g=J.useMemo(()=>"tooltip"===d||"label"===l?{["aria-"+("label"===l?"labelledby":"describedby")]:n?u:void 0}:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===d?"dialog":d,"aria-controls":n?u:void 0,..."listbox"===d&&{role:"combobox"},..."menu"===d&&{id:c},..."menu"===d&&f&&{role:"menuitem"},..."select"===l&&{"aria-autocomplete":"none"},..."combobox"===l&&{"aria-autocomplete":"list"}},[d,u,f,n,c,l]),p=J.useMemo(()=>{let t={id:u,...d&&{role:d}};return"tooltip"===d||"label"===l?t:{...t,..."menu"===d&&{"aria-labelledby":c}}},[d,u,c,l]),m=J.useCallback(t=>{let{active:e,selected:r}=t,i={role:"option",...e&&{id:u+"-fui-option"}};switch(l){case"select":case"combobox":return{...i,"aria-selected":r}}return{}},[u,l]);return J.useMemo(()=>a?{reference:g,floating:p,item:m}:{},[a,g,p,m])}var hD=t.i(40141);function hj(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z"},child:[]}]})(t)}function hA(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z",clipRule:"evenodd"},child:[]}]})(t)}var hP=t.i(11152);function hF(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M123.193 29.635L121 406.18l84.31-82.836 65.87 159.02 67.5-27.96-65.87-159.02L391 294.342z"},child:[]}]})(t)}function hL(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M149.9 302.2c-39.1 0-70.7 31-70.7 69.3 0 30.3-27.3 46.2-47.2 46.2C53.7 446 90.7 464 126.3 464c52.1 0 94.3-41.4 94.3-92.4 0-38.4-31.6-69.4-70.7-69.4zM473.1 85.7l-31.6-31c-9.2-9-24-9-33.2 0L197 261.8l64.8 63.5 211.2-207c9.3-9 9.3-23.6.1-32.6z"},child:[]}]})(t)}function hR(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M96 448h106.7V64H96v384zM309.3 64v384H416V64H309.3z"},child:[]}]})(t)}function hI(t){return(0,hD.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M96 52v408l320-204L96 52z"},child:[]}]})(t)}function hB(t){return(0,hD.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.904 16c1.777-3.219 2.076-8.13-4.904-7.966v3.966l-6-6 6-6v3.881c8.359-0.218 9.29 7.378 4.904 12.119z"},child:[]}]})(t)}function hN(t){return(0,hD.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9 3.881v-3.881l6 6-6 6v-3.966c-6.98-0.164-6.681 4.747-4.904 7.966-4.386-4.741-3.455-12.337 4.904-12.119z"},child:[]}]})(t)}function hW(t){return(0,hD.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM2 8c0-3.314 2.686-6 6-6v12c-3.314 0-6-2.686-6-6z"},child:[]}]})(t)}function hU(t){return(0,hD.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 4c-2.209 0-4 1.791-4 4s1.791 4 4 4 4-1.791 4-4-1.791-4-4-4zM8 10.5v-5c1.379 0 2.5 1.122 2.5 2.5s-1.121 2.5-2.5 2.5zM8 13c0.552 0 1 0.448 1 1v1c0 0.552-0.448 1-1 1s-1-0.448-1-1v-1c0-0.552 0.448-1 1-1zM8 3c-0.552 0-1-0.448-1-1v-1c0-0.552 0.448-1 1-1s1 0.448 1 1v1c0 0.552-0.448 1-1 1zM15 7c0.552 0 1 0.448 1 1s-0.448 1-1 1h-1c-0.552 0-1-0.448-1-1s0.448-1 1-1h1zM3 8c0 0.552-0.448 1-1 1h-1c-0.552 0-1-0.448-1-1s0.448-1 1-1h1c0.552 0 1 0.448 1 1zM12.95 11.536l0.707 0.707c0.39 0.39 0.39 1.024 0 1.414s-1.024 0.39-1.414 0l-0.707-0.707c-0.39-0.39-0.39-1.024 0-1.414s1.024-0.39 1.414 0zM3.050 4.464l-0.707-0.707c-0.391-0.391-0.391-1.024 0-1.414s1.024-0.391 1.414 0l0.707 0.707c0.391 0.391 0.391 1.024 0 1.414s-1.024 0.391-1.414 0zM12.95 4.464c-0.39 0.391-1.024 0.391-1.414 0s-0.39-1.024 0-1.414l0.707-0.707c0.39-0.391 1.024-0.391 1.414 0s0.39 1.024 0 1.414l-0.707 0.707zM3.050 11.536c0.39-0.39 1.024-0.39 1.414 0s0.391 1.024 0 1.414l-0.707 0.707c-0.391 0.39-1.024 0.39-1.414 0s-0.391-1.024 0-1.414l0.707-0.707z"},child:[]}]})(t)}function hH(t){return(0,hD.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.5 6h-5.5v-5.5c0-0.276-0.224-0.5-0.5-0.5h-3c-0.276 0-0.5 0.224-0.5 0.5v5.5h-5.5c-0.276 0-0.5 0.224-0.5 0.5v3c0 0.276 0.224 0.5 0.5 0.5h5.5v5.5c0 0.276 0.224 0.5 0.5 0.5h3c0.276 0 0.5-0.224 0.5-0.5v-5.5h5.5c0.276 0 0.5-0.224 0.5-0.5v-3c0-0.276-0.224-0.5-0.5-0.5z"},child:[]}]})(t)}let hX=J.default.createContext(null);function hV(){let t=(0,J.useContext)(hX);if(!t)throw Error("No WarriorContext.Provider");return t}hX.displayName="WarriorContext";let hY="undefined"!=typeof window&&window.document&&window.document.createElement?J.useLayoutEffect:J.useEffect,hz=(t,e)=>{let r=J.useRef(!0);hY(()=>t(r.current),e),hY(()=>(r.current=!1,()=>{r.current=!0}),[])},hG=function(t){let e=J.useRef();return e.current=t,J.useCallback(function(){for(var t,r=arguments.length,i=Array(r),n=0;n{hK.push(t)},h$.resetWarned=function(){hq={}},h$.noteOnce=function(t,e){hZ(hJ,t,e)};let h0=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new Set;return function t(e,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=i.has(e);if(h$(!o,"Warning: There may be circular references"),o)return!1;if(e===n)return!0;if(r&&s>1)return!1;i.add(e);let a=s+1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let r=0;rt(e[r],n[r],a))}return!1}(t,e)};var h1=t.i(43794);function h2(t,e,r,i){let n=(e-r)/(i-r),s={};switch(t){case"rtl":s.right="".concat(100*n,"%"),s.transform="translateX(50%)";break;case"btt":s.bottom="".concat(100*n,"%"),s.transform="translateY(50%)";break;case"ttb":s.top="".concat(100*n,"%"),s.transform="translateY(-50%)";break;default:s.left="".concat(100*n,"%"),s.transform="translateX(-50%)"}return s}function h5(t,e){return Array.isArray(t)?t[e]:t}let h4={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){let{keyCode:e}=t;if(t.altKey&&!t.ctrlKey||t.metaKey||e>=h4.F1&&e<=h4.F12)return!1;switch(e){case h4.ALT:case h4.CAPS_LOCK:case h4.CONTEXT_MENU:case h4.CTRL:case h4.DOWN:case h4.END:case h4.ESC:case h4.HOME:case h4.INSERT:case h4.LEFT:case h4.MAC_FF_META:case h4.META:case h4.NUMLOCK:case h4.NUM_CENTER:case h4.PAGE_DOWN:case h4.PAGE_UP:case h4.PAUSE:case h4.PRINT_SCREEN:case h4.RIGHT:case h4.SHIFT:case h4.UP:case h4.WIN_KEY:case h4.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=h4.ZERO&&t<=h4.NINE||t>=h4.NUM_ZERO&&t<=h4.NUM_MULTIPLY||t>=h4.A&&t<=h4.Z||-1!==window.navigator.userAgent.indexOf("WebKit")&&0===t)return!0;switch(t){case h4.SPACE:case h4.QUESTION_MARK:case h4.NUM_PLUS:case h4.NUM_MINUS:case h4.NUM_PERIOD:case h4.NUM_DIVISION:case h4.SEMICOLON:case h4.DASH:case h4.EQUALS:case h4.COMMA:case h4.PERIOD:case h4.SLASH:case h4.APOSTROPHE:case h4.SINGLE_QUOTE:case h4.OPEN_SQUARE_BRACKET:case h4.BACKSLASH:case h4.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},h3=J.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),h9=J.createContext({});function h6(){return(h6=Object.assign.bind()).apply(this,arguments)}let h8=J.forwardRef((t,e)=>{let{prefixCls:r,value:i,valueIndex:n,onStartMove:s,onDelete:o,style:a,render:l,dragging:h,draggingDelete:c,onOffsetChange:u,onChangeComplete:d,onFocus:f,onMouseEnter:g,...p}=t,{min:m,max:y,direction:x,disabled:b,keyboard:_,range:w,tabIndex:C,ariaLabelForHandle:S,ariaLabelledByForHandle:T,ariaRequired:O,ariaValueTextFormatterForHandle:k,styles:M,classNames:E}=J.useContext(h3),D="".concat(r,"-handle"),j=t=>{b||s(t,n)},A=h2(x,i,m,y),P={};if(null!==n){var F;P={tabIndex:b?null:h5(C,n),role:"slider","aria-valuemin":m,"aria-valuemax":y,"aria-valuenow":i,"aria-disabled":b,"aria-label":h5(S,n),"aria-labelledby":h5(T,n),"aria-required":h5(O,n),"aria-valuetext":null==(F=h5(k,n))?void 0:F(i),"aria-orientation":"ltr"===x||"rtl"===x?"horizontal":"vertical",onMouseDown:j,onTouchStart:j,onFocus:t=>{null==f||f(t,n)},onMouseEnter:t=>{g(t,n)},onKeyDown:t=>{if(!b&&_){let e=null;switch(t.which||t.keyCode){case h4.LEFT:e="ltr"===x||"btt"===x?-1:1;break;case h4.RIGHT:e="ltr"===x||"btt"===x?1:-1;break;case h4.UP:e="ttb"!==x?1:-1;break;case h4.DOWN:e="ttb"!==x?-1:1;break;case h4.HOME:e="min";break;case h4.END:e="max";break;case h4.PAGE_UP:e=2;break;case h4.PAGE_DOWN:e=-2;break;case h4.BACKSPACE:case h4.DELETE:null==o||o(n)}null!==e&&(t.preventDefault(),u(e,n))}},onKeyUp:t=>{switch(t.which||t.keyCode){case h4.LEFT:case h4.RIGHT:case h4.UP:case h4.DOWN:case h4.HOME:case h4.END:case h4.PAGE_UP:case h4.PAGE_DOWN:null==d||d()}}}}let L=J.createElement("div",h6({ref:e,className:(0,h1.default)(D,{["".concat(D,"-").concat(n+1)]:null!==n&&w,["".concat(D,"-dragging")]:h,["".concat(D,"-dragging-delete")]:c},E.handle),style:{...A,...a,...M.handle}},P,p));return l&&(L=l(L,{index:n,prefixCls:r,value:i,dragging:h,draggingDelete:c})),L});function h7(){return(h7=Object.assign.bind()).apply(this,arguments)}let ct=J.forwardRef((t,e)=>{let{prefixCls:r,style:i,onStartMove:n,onOffsetChange:s,values:o,handleRender:a,activeHandleRender:l,draggingIndex:h,draggingDelete:c,onFocus:u,...d}=t,f=J.useRef({}),[g,p]=J.useState(!1),[m,y]=J.useState(-1),x=t=>{y(t),p(!0)};J.useImperativeHandle(e,()=>({focus:t=>{var e;null==(e=f.current[t])||e.focus()},hideHelp:()=>{(0,a3.flushSync)(()=>{p(!1)})}}));let b={prefixCls:r,onStartMove:n,onOffsetChange:s,render:a,onFocus:(t,e)=>{x(e),null==u||u(t)},onMouseEnter:(t,e)=>{x(e)},...d};return J.createElement(J.Fragment,null,o.map((t,e)=>{let r=h===e;return J.createElement(h8,h7({ref:t=>{t?f.current[e]=t:delete f.current[e]},dragging:r,draggingDelete:r&&c,style:h5(i,e),key:e,value:t,valueIndex:e},b))}),l&&g&&J.createElement(h8,h7({key:"a11y"},b,{value:o[m],valueIndex:null,dragging:-1!==h,draggingDelete:c,render:l,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),ce=t=>{let{prefixCls:e,style:r,children:i,value:n,onClick:s}=t,{min:o,max:a,direction:l,includedStart:h,includedEnd:c,included:u}=J.useContext(h3),d="".concat(e,"-text"),f=h2(l,n,o,a);return J.createElement("span",{className:(0,h1.default)(d,{["".concat(d,"-active")]:u&&h<=n&&n<=c}),style:{...f,...r},onMouseDown:t=>{t.stopPropagation()},onClick:()=>{s(n)}},i)},cr=t=>{let{prefixCls:e,marks:r,onClick:i}=t,n="".concat(e,"-mark");return r.length?J.createElement("div",{className:n},r.map(t=>{let{value:e,style:r,label:s}=t;return J.createElement(ce,{key:e,prefixCls:n,style:r,value:e,onClick:i},s)})):null},ci=t=>{let{prefixCls:e,value:r,style:i,activeStyle:n}=t,{min:s,max:o,direction:a,included:l,includedStart:h,includedEnd:c}=J.useContext(h3),u="".concat(e,"-dot"),d=l&&h<=r&&r<=c,f={...h2(a,r,s,o),..."function"==typeof i?i(r):i};return d&&(f={...f,..."function"==typeof n?n(r):n}),J.createElement("span",{className:(0,h1.default)(u,{["".concat(u,"-active")]:d}),style:f})},cn=t=>{let{prefixCls:e,marks:r,dots:i,style:n,activeStyle:s}=t,{min:o,max:a,step:l}=J.useContext(h3),h=J.useMemo(()=>{let t=new Set;if(r.forEach(e=>{t.add(e.value)}),i&&null!==l){let e=o;for(;e<=a;)t.add(e),e+=l}return Array.from(t)},[o,a,l,i,r]);return J.createElement("div",{className:"".concat(e,"-step")},h.map(t=>J.createElement(ci,{prefixCls:e,key:t,value:t,style:n,activeStyle:s})))},cs=t=>{let{prefixCls:e,style:r,start:i,end:n,index:s,onStartMove:o,replaceCls:a}=t,{direction:l,min:h,max:c,disabled:u,range:d,classNames:f}=J.useContext(h3),g="".concat(e,"-track"),p=(i-h)/(c-h),m=(n-h)/(c-h),y=t=>{!u&&o&&o(t,-1)},x={};switch(l){case"rtl":x.right="".concat(100*p,"%"),x.width="".concat(100*m-100*p,"%");break;case"btt":x.bottom="".concat(100*p,"%"),x.height="".concat(100*m-100*p,"%");break;case"ttb":x.top="".concat(100*p,"%"),x.height="".concat(100*m-100*p,"%");break;default:x.left="".concat(100*p,"%"),x.width="".concat(100*m-100*p,"%")}let b=a||(0,h1.default)(g,{["".concat(g,"-").concat(s+1)]:null!==s&&d,["".concat(e,"-track-draggable")]:o},f.track);return J.createElement("div",{className:b,style:{...x,...r},onMouseDown:y,onTouchStart:y})},co=t=>{let{prefixCls:e,style:r,values:i,startPoint:n,onStartMove:s}=t,{included:o,range:a,min:l,styles:h,classNames:c}=J.useContext(h3),u=J.useMemo(()=>{if(!a){if(0===i.length)return[];let t=null!=n?n:l,e=i[0];return[{start:Math.min(t,e),end:Math.max(t,e)}]}let t=[];for(let e=0;e{let{start:n,end:o}=t;return J.createElement(cs,{index:i,prefixCls:e,style:{...h5(r,i),...h.track},start:n,end:o,key:i,onStartMove:s})}))};function ca(t){let e="targetTouches"in t?t.targetTouches[0]:t;return{pageX:e.pageX,pageY:e.pageY}}let cl=function(t,e,r,i,n,s,o,a,l,h,c){let[u,d]=J.useState(null),[f,g]=J.useState(-1),[p,m]=J.useState(!1),[y,x]=J.useState(r),[b,_]=J.useState(r),w=J.useRef(null),C=J.useRef(null),S=J.useRef(null),{onDragStart:T,onDragChange:O}=J.useContext(h9);hz(()=>{-1===f&&x(r)},[r,f]),J.useEffect(()=>()=>{document.removeEventListener("mousemove",w.current),document.removeEventListener("mouseup",C.current),S.current&&(S.current.removeEventListener("touchmove",w.current),S.current.removeEventListener("touchend",C.current))},[]);let k=(t,e,r)=>{void 0!==e&&d(e),x(t);let i=t;r&&(i=t.filter((t,e)=>e!==f)),o(i),O&&O({rawValues:t,deleteIndex:r?f:-1,draggingIndex:f,draggingValue:e})},M=hG((t,e,r)=>{if(-1===t){let t=b[0],r=b[b.length-1],o=e*(n-i);o=Math.min(o=Math.max(o,i-t),n-r),o=s(t+o)-t,k(b.map(t=>t+o))}else{let s=[...y];s[t]=b[t];let o=l(s,(n-i)*e,t,"dist");k(o.values,o.value,r)}});return[f,u,p,J.useMemo(()=>{let t=[...r].sort((t,e)=>t-e),e=[...y].sort((t,e)=>t-e),i={};e.forEach(t=>{i[t]=(i[t]||0)+1}),t.forEach(t=>{i[t]=(i[t]||0)-1});let n=+!!h;return Object.values(i).reduce((t,e)=>t+Math.abs(e),0)<=n?y:r},[r,y,h]),(i,n,s)=>{i.stopPropagation();let o=s||r,l=o[n];g(n),d(l),_(o),x(o),m(!1);let{pageX:u,pageY:f}=ca(i),p=!1;T&&T({rawValues:o,draggingIndex:n,draggingValue:l});let b=r=>{let i,s;r.preventDefault();let{pageX:o,pageY:a}=ca(r),l=o-u,d=a-f,{width:g,height:x}=t.current.getBoundingClientRect();switch(e){case"btt":i=-d/x,s=l;break;case"ttb":i=d/x,s=l;break;case"rtl":i=-l/g,s=d;break;default:i=l/g,s=d}m(p=!!h&&Math.abs(s)>130&&c{t.preventDefault(),document.removeEventListener("mouseup",O),document.removeEventListener("mousemove",b),S.current&&(S.current.removeEventListener("touchmove",w.current),S.current.removeEventListener("touchend",C.current)),w.current=null,C.current=null,S.current=null,a(p),g(-1),m(!1)};document.addEventListener("mouseup",O),document.addEventListener("mousemove",b),i.currentTarget.addEventListener("touchend",O),i.currentTarget.addEventListener("touchmove",b),w.current=b,C.current=O,S.current=i.currentTarget}]},ch=J.forwardRef((t,e)=>{let{prefixCls:r="rc-slider",className:i,style:n,classNames:s,styles:o,id:a,disabled:l=!1,keyboard:h=!0,autoFocus:c,onFocus:u,onBlur:d,min:f=0,max:g=100,step:p=1,value:m,defaultValue:y,range:x,count:b,onChange:_,onBeforeChange:w,onAfterChange:C,onChangeComplete:S,allowCross:T=!0,pushable:O=!1,reverse:k,vertical:M,included:E=!0,startPoint:D,trackStyle:j,handleStyle:A,railStyle:P,dotStyle:F,activeDotStyle:L,marks:R,dots:I,handleRender:B,activeHandleRender:N,track:W,tabIndex:U=0,ariaLabelForHandle:H,ariaLabelledByForHandle:X,ariaRequired:V,ariaValueTextFormatterForHandle:Y}=t,z=J.useRef(null),G=J.useRef(null),q=J.useMemo(()=>M?k?"ttb":"btt":k?"rtl":"ltr",[k,M]),[K,Q,Z,$,tt]=function(t){return(0,J.useMemo)(()=>{if(!0===t||!t)return[!!t,!1,!1,0];let{editable:e,draggableTrack:r,minCount:i,maxCount:n}=t;return[!0,e,!e&&r,i||0,n]},[t])}(x),te=J.useMemo(()=>isFinite(f)?f:0,[f]),tr=J.useMemo(()=>isFinite(g)?g:100,[g]),ti=J.useMemo(()=>null!==p&&p<=0?1:p,[p]),tn=J.useMemo(()=>"boolean"==typeof O?!!O&&ti:O>=0&&O,[O,ti]),ts=J.useMemo(()=>Object.keys(R||{}).map(t=>{let e=R[t],r={value:Number(t)};return e&&"object"==typeof e&&!J.isValidElement(e)&&("label"in e||"style"in e)?(r.style=e.style,r.label=e.label):r.label=e,r}).filter(t=>{let{label:e}=t;return e||"number"==typeof e}).sort((t,e)=>t.value-e.value),[R]),[to,ta]=function(t,e,r,i,n,s){let o=J.useCallback(r=>Math.max(t,Math.min(e,r)),[t,e]),a=J.useCallback(i=>{if(null!==r){let n=t+Math.round((o(i)-t)/r)*r,s=t=>(String(t).split(".")[1]||"").length,a=Math.max(s(r),s(e),s(t)),l=Number(n.toFixed(a));return t<=l&&l<=e?l:null}return null},[r,t,e,o]),l=J.useCallback(n=>{let s=o(n),l=i.map(t=>t.value);null!==r&&l.push(a(n)),l.push(t,e);let h=l[0],c=e-t;return l.forEach(t=>{let e=Math.abs(s-t);e<=c&&(h=t,c=e)}),h},[t,e,i,r,o,a]),h=function(n,s,o){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit";if("number"==typeof s){let c,u=n[o],d=u+s,f=[];i.forEach(t=>{f.push(t.value)}),f.push(t,e),f.push(a(u));let g=s>0?1:-1;"unit"===l?f.push(a(u+g*r)):f.push(a(d)),f=f.filter(t=>null!==t).filter(t=>s<0?t<=u:t>=u),"unit"===l&&(f=f.filter(t=>t!==u));let p="unit"===l?u:d,m=Math.abs((c=f[0])-p);if(f.forEach(t=>{let e=Math.abs(t-p);e1){let t=[...n];return t[o]=c,h(t,s-g,o,l)}return c}return"min"===s?t:"max"===s?e:void 0},c=function(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",n=t[r],s=h(t,e,r,i);return{value:s,changed:s!==n}},u=t=>null===s&&0===t||"number"==typeof s&&t3&&void 0!==arguments[3]?arguments[3]:"unit",o=t.map(l),a=o[r],d=h(o,e,r,i);if(o[r]=d,!1===n){let t=s||0;r>0&&o[r-1]!==a&&(o[r]=Math.max(o[r],o[r-1]+t)),r0;t-=1){let e=!0;for(;u(o[t]-o[t-1])&&e;)({value:o[t-1],changed:e}=c(o,-1,t-1))}for(let t=o.length-1;t>0;t-=1){let e=!0;for(;u(o[t]-o[t-1])&&e;)({value:o[t-1],changed:e}=c(o,-1,t-1))}for(let t=0;t{t||i(e)},[e]),[n,i]}(y,m),tc=J.useMemo(()=>{let t=null==tl?[]:Array.isArray(tl)?tl:[tl],[e=te]=t,r=null===tl?[]:[e];if(K){if(r=[...t],b||void 0===tl){let t=b>=0?b+1:2;for(r=r.slice(0,t);r.lengtht-e)}return r.forEach((t,e)=>{r[e]=to(t)}),r},[tl,K,te,b,to]),tu=t=>K?t:t[0],td=hG(t=>{let e=[...t].sort((t,e)=>t-e);_&&!h0(e,tc,!0)&&_(tu(e)),th(e)}),tf=hG(t=>{t&&z.current.hideHelp();let e=tu(tc);null==C||C(e),h$(!C,"[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead."),null==S||S(e)}),[tg,tp,tm,tv,ty]=cl(G,q,tc,te,tr,to,td,tf,ta,Q,$),tx=(t,e)=>{if(!l){let n=[...tc],s=0,o=0,a=tr-te;tc.forEach((e,r)=>{let i=Math.abs(t-e);i<=a&&(a=i,s=r),e{if(null!==tb){let t=tc.indexOf(tb);t>=0&&z.current.focus(t)}t_(null)},[tb]);let tw=J.useMemo(()=>(!Z||null!==ti)&&Z,[Z,ti]),tC=hG((t,e)=>{ty(t,e),null==w||w(tu(tc))}),tS=-1!==tg;J.useEffect(()=>{if(!tS){let t=tc.lastIndexOf(tp);z.current.focus(t)}},[tS]);let tT=J.useMemo(()=>[...tv].sort((t,e)=>t-e),[tv]),[tO,tk]=J.useMemo(()=>K?[tT[0],tT[tT.length-1]]:[te,tT[0]],[tT,K,te]);J.useImperativeHandle(e,()=>({focus:()=>{z.current.focus(0)},blur:()=>{var t;let{activeElement:e}=document;(null==(t=G.current)?void 0:t.contains(e))&&(null==e||e.blur())}})),J.useEffect(()=>{c&&z.current.focus(0)},[]);let tM=J.useMemo(()=>({min:te,max:tr,direction:q,disabled:l,keyboard:h,step:ti,included:E,includedStart:tO,includedEnd:tk,range:K,tabIndex:U,ariaLabelForHandle:H,ariaLabelledByForHandle:X,ariaRequired:V,ariaValueTextFormatterForHandle:Y,styles:o||{},classNames:s||{}}),[te,tr,q,l,h,ti,E,tO,tk,K,U,H,X,V,Y,o,s]);return J.createElement(h3.Provider,{value:tM},J.createElement("div",{ref:G,className:(0,h1.default)(r,i,{["".concat(r,"-disabled")]:l,["".concat(r,"-vertical")]:M,["".concat(r,"-horizontal")]:!M,["".concat(r,"-with-marks")]:ts.length}),style:n,onMouseDown:t=>{let e;t.preventDefault();let{width:r,height:i,left:n,top:s,bottom:o,right:a}=G.current.getBoundingClientRect(),{clientX:l,clientY:h}=t;switch(q){case"btt":e=(o-h)/i;break;case"ttb":e=(h-s)/i;break;case"rtl":e=(a-l)/r;break;default:e=(l-n)/r}tx(to(te+e*(tr-te)),t)},id:a},J.createElement("div",{className:(0,h1.default)("".concat(r,"-rail"),null==s?void 0:s.rail),style:{...P,...null==o?void 0:o.rail}}),!1!==W&&J.createElement(co,{prefixCls:r,style:j,values:tc,startPoint:D,onStartMove:tw?tC:void 0}),J.createElement(cn,{prefixCls:r,marks:ts,dots:I,style:F,activeStyle:L}),J.createElement(ct,{ref:z,prefixCls:r,style:A,values:tv,draggingIndex:tg,draggingDelete:tm,onStartMove:tC,onOffsetChange:(t,e)=>{if(!l){let r=ta(tc,t,e);null==w||w(tu(tc)),td(r.values),t_(r.value)}},onFocus:u,onBlur:d,handleRender:B,activeHandleRender:N,onChangeComplete:tf,onDelete:Q?t=>{if(l||!Q||tc.length<=$)return;let e=[...tc];e.splice(t,1),null==w||w(tu(e)),td(e);let r=Math.max(0,t-1);z.current.hideHelp(),z.current.focus(r)}:void 0}),J.createElement(cr,{prefixCls:r,marks:ts,onClick:tx})))}),cc={track:{height:8,background:"#03fccf"},handle:{width:20,height:20,marginTop:-6,borderColor:"#03fccf",background:"rgb(5, 69, 76)",opacity:1},rail:{height:8,border:"1px solid #555",background:"rgba(255, 255, 255, 0.3)"}};function cu(t){return(0,Q.jsx)(ch,{...t,styles:{...cc,...t.styles}})}var cd=t.i(20592);let{materials:cf}=cd.default;function cg(){var t;let e=(0,J.useRef)(null),r=(0,J.useRef)(null),[i,n]=(0,J.useState)("vl2"),{activeCanvas:s,backgroundColor:o,setBackgroundColor:a,selectedObjects:l,lockedObjects:h,lockSelection:c,unlockSelection:u,bringForward:d,sendBackward:f,duplicate:g,deleteSelection:p,undo:m,redo:y,canUndo:x,canRedo:b,copyToMetallic:_,brushColor:w,setBrushColor:C,brushSize:S,setBrushSize:T,hueRotate:O,setHueRotate:k,saturation:M,setSaturation:E,brightness:D,setBrightness:j,contrast:A,setContrast:P,opacity:F,setOpacity:L,layerMode:R,setLayerMode:I,activeCanvasType:B,addImages:N,exportSkin:W,selectedExportMaterials:U,setSelectedExportMaterials:H}=o0(),{actualModel:X}=hV(),V=cf[X],{canvas:Y,isDrawingMode:z,setDrawingMode:G}=oZ(s),[q,K]=(0,J.useState)(!1),Z=q?"⌘":"Ctrl ",[$,tt]=(0,J.useState)(!1),{refs:te,floatingStyles:tr,context:ti}=hT({open:$,onOpenChange:tt,placement:"bottom-end",middleware:[lr(),le(10)],whileElementsMounted:a4}),tn=hb(ti),ts=hS(ti),to=hE(ti);(0,J.useEffect)(()=>{$&&G(!0)},[$,G]);let{getReferenceProps:ta,getFloatingProps:tl}=hk([tn,ts,to]),[th,tc]=(0,J.useState)(!1),{refs:tu,floatingStyles:td,context:tf}=hT({open:th,onOpenChange:tc,placement:"bottom-end",middleware:[lr(),le(10)],whileElementsMounted:a4}),tg=hb(tf),{getReferenceProps:tp,getFloatingProps:tm}=hk([tg,hS(tf),hE(tf)]),[tv,ty]=(0,J.useState)(!1),{refs:tx,floatingStyles:tb,context:t_}=hT({open:tv,onOpenChange:ty,placement:"bottom-end",middleware:[lr(),le(10)],whileElementsMounted:a4}),tw=hb(t_),{getReferenceProps:tC,getFloatingProps:tS}=hk([tw,hS(t_),hE(t_)]),tT=!!l.length&&l.every(t=>h.has(t)),tO=l.length>0,tk=l.filter(t=>t instanceof s7).length>0,tM=t=>{a(t.target.value)};return(0,J.useEffect)(()=>{try{let t=localStorage.getItem("exportFileType");switch(t){case"vl2":case"png":n(t)}}catch(t){}},[]),(0,J.useEffect)(()=>{navigator.platform&&navigator.platform.startsWith("Mac")?K(!0):navigator.userAgent.match(/\(Macintosh;/)&&K(!0)},[]),(0,Q.jsxs)("div",{className:"CanvasTools",children:[(0,Q.jsxs)("div",{className:"CanvasBackgroundColor",children:[(0,Q.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorBlack",value:"black",checked:"black"===o,onChange:tM}),(0,Q.jsx)("label",{htmlFor:"canvasBackgroundColorBlack",children:(0,Q.jsx)("span",{className:"HiddenLabel",children:"Black"})}),(0,Q.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorMagenta",value:"magenta",checked:"magenta"===o,onChange:tM}),(0,Q.jsx)("label",{htmlFor:"canvasBackgroundColorMagenta",children:(0,Q.jsx)("span",{className:"HiddenLabel",children:"Magenta"})}),(0,Q.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorWhite",value:"white",checked:"white"===o,onChange:tM}),(0,Q.jsx)("label",{htmlFor:"canvasBackgroundColorWhite",children:(0,Q.jsx)("span",{className:"HiddenLabel",children:"White"})})]}),(0,Q.jsxs)("div",{className:"Buttons",children:["metallic"===B?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"ButtonGroup",children:[(0,Q.jsx)("button",{className:"ButtonGroup",type:"button","data-active":z?void 0:"","aria-label":"Select Mode",title:"Select Mode (S)",onClick:()=>{G(!1)},children:(0,Q.jsx)(hF,{})}),(0,Q.jsx)("button",{className:"ButtonGroup",type:"button","data-active":z?"":void 0,"aria-label":"Paint Mode",title:"Paint Mode (P)",ref:te.setReference,...ta(),children:(0,Q.jsx)(hL,{})})]}),$?(0,Q.jsx)(hy,{context:ti,modal:!1,children:(0,Q.jsx)("div",{className:"BrushToolsPopup",ref:te.setFloating,style:tr,...tl(),children:(0,Q.jsxs)("div",{className:"Fields",children:[(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{children:"Metallic Amount"}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:0,max:255,value:w,onChange:t=>{Array.isArray(t)&&(t=t[0]),C(t)},styles:{track:{display:"none"},handle:{width:20,height:20,marginTop:-6,borderColor:"rgb(20, 105, 241)",background:"rgb(".concat(w,", ").concat(w,", ").concat(w,")"),opacity:1},rail:{height:8,border:"1px solid #555",background:"linear-gradient(to right, black 0%, white 100%)"}}})})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{children:"Brush Size"}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:1,max:50,value:S,onChange:t=>{Array.isArray(t)&&(t=t[0]),T(t)}})})]})]})})}):null]}):null,(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("input",{ref:r,onChange:async t=>{N([await new Promise((e,r)=>{var i;let n=null==(i=t.target.files)?void 0:i[0];if(n){let t=new FileReader;t.addEventListener("load",t=>{var r;e(null==(r=t.target)?void 0:r.result)}),t.readAsDataURL(n)}else r(Error("No input file provided."))})])},type:"file",accept:".png, image/png",hidden:!0}),(0,Q.jsx)("button",{type:"button","aria-label":"Add Image",title:"Add Image",onClick:()=>{r.current&&r.current.click()},children:(0,Q.jsx)(hH,{style:{fontSize:14}})}),(0,Q.jsx)("button",{type:"button","data-active":th?"":void 0,"aria-label":"Filters",title:"Filters",disabled:tO&&!tk,ref:tu.setReference,...tp(),children:(0,Q.jsx)(hW,{})}),th?(0,Q.jsx)(hy,{context:tf,modal:!1,children:(0,Q.jsx)("div",{className:"BrushToolsPopup",ref:tu.setFloating,style:td,...tm(),children:(0,Q.jsxs)("div",{className:"Fields",children:[(0,Q.jsxs)("div",{className:"Field ApplyTo",children:[(0,Q.jsx)("label",{children:"Layer:"}),(0,Q.jsx)("ul",{children:l.length?(0,Q.jsxs)("li",{children:[(0,Q.jsx)("input",{type:"radio",name:"FilterLayer",value:"SelectedLayer",id:"FilterLayer-SelectedLayer",checked:"SelectedLayer"===R,onChange:()=>{I("SelectedLayer")}}),(0,Q.jsxs)("label",{htmlFor:"FilterLayer-SelectedLayer",children:["selected (",l.length.toLocaleString(),")"]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("li",{children:[(0,Q.jsx)("input",{type:"radio",name:"FilterLayer",value:"BaseLayer",id:"FilterLayer-BaseLayer",checked:"BaseLayer"===R,onChange:()=>{I("BaseLayer")}})," ",(0,Q.jsx)("label",{htmlFor:"FilterLayer-BaseLayer",children:"base"})]}),(0,Q.jsxs)("li",{children:[(0,Q.jsx)("input",{type:"radio",name:"FilterLayer",value:"AllLayers",id:"FilterLayer-AllLayers",checked:"AllLayers"===R,onChange:()=>{I("AllLayers")}}),(0,Q.jsxs)("label",{htmlFor:"FilterLayer-AllLayers",children:["all (",null!=(t=null==Y?void 0:Y._objects.filter(t=>t instanceof s7).length.toLocaleString())?t:0,")"]})]})]})})]}),"color"===B?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsxs)("label",{children:["Hue:"," ",(0,Q.jsx)("strong",{children:null==O?"MULTIPLE VALUES":(0,Q.jsxs)(Q.Fragment,{children:[Math.round(180*O),"°"]})})]}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:-180,max:180,startPoint:0,value:Math.round((null!=O?O:0)*180),onChange:t=>{Array.isArray(t)&&(t=t[0]),k(t/180)}})})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsxs)("label",{children:["Saturation:"," ",(0,Q.jsx)("strong",{children:null==M?"MULTIPLE VALUES":"".concat(Math.round(100*M+100),"%")})]}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:-100,max:100,startPoint:0,value:Math.round((null!=M?M:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),E(t/100)}})})]})]}):null,(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsxs)("label",{children:["Brightness:"," ",(0,Q.jsx)("strong",{children:null==D?"MULTIPLE VALUES":"".concat(Math.round(100*D+100),"%")})]}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:-100,max:100,startPoint:0,value:Math.round((null!=D?D:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),j(t/100)}})})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsxs)("label",{children:["Contrast:"," ",(0,Q.jsx)("strong",{children:null==A?"MULTIPLE VALUES":"".concat(Math.round(100*A+100),"%")})]}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:-100,max:100,startPoint:0,value:Math.round((null!=A?A:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),P(t/100)}})})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsxs)("label",{children:["Opacity:"," ",(0,Q.jsx)("strong",{children:null==F?"MULTIPLE VALUES":"".concat(Math.round((null!=F?F:1)*100),"%")})]}),(0,Q.jsx)("div",{className:"SliderContainer",children:(0,Q.jsx)(cu,{min:0,max:100,startPoint:0,value:Math.round((null!=F?F:1)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),L(t/100)}})})]})]})})}):null,(0,Q.jsx)("button",{type:"button","aria-label":tT?"Unlock":"Lock",title:tT?"Unlock (L)":"Lock (L)",onClick:tT?u:c,"data-locked":tT?"":void 0,disabled:!tO,children:tT?(0,Q.jsx)(hP.FaUnlock,{style:{fontSize:14}}):(0,Q.jsx)(hP.FaLock,{style:{fontSize:14}})}),(0,Q.jsxs)("div",{className:"ButtonGroup",children:[(0,Q.jsx)("button",{type:"button","aria-label":"Bring Forward",title:"Bring Forward (F)",onClick:d,disabled:!tO,children:(0,Q.jsx)(hP.FaArrowUp,{})}),(0,Q.jsx)("button",{type:"button","aria-label":"Send Backward",title:"Send Backward (B)",onClick:f,disabled:!tO,children:(0,Q.jsx)(hP.FaArrowDown,{})})]}),(0,Q.jsx)("button",{type:"button","aria-label":"Duplicate",title:"Duplicate (D)",onClick:g,disabled:!tO,children:(0,Q.jsx)(hj,{})}),(0,Q.jsx)("button",{type:"button","aria-label":"Delete",title:"Delete (Backspace)",onClick:p,disabled:tT||!tO,children:(0,Q.jsx)(hP.FaTrashAlt,{})}),(0,Q.jsxs)("div",{className:"ButtonGroup",children:[(0,Q.jsx)("button",{type:"button","aria-label":"Undo",title:"Undo (".concat(Z,"Z)"),onClick:m,disabled:!x,children:(0,Q.jsx)(hB,{})}),(0,Q.jsx)("button",{type:"button","aria-label":"Redo",title:"Redo (".concat(q?"".concat("⇧").concat(Z,"Z)"):"".concat(Z," Y"),")"),onClick:y,disabled:!b,children:(0,Q.jsx)(hN,{})})]}),"color"===B?(0,Q.jsxs)("button",{type:"button",className:"MetallicButton","aria-label":"Copy to Metallic",title:"Copy to Metallic",onClick:_,children:[(0,Q.jsx)(hA,{})," ",(0,Q.jsx)("span",{className:"ButtonLabel",children:"Metal"})]}):null]})]}),(0,Q.jsxs)("div",{className:"Export",children:[(0,Q.jsx)("input",{ref:e,type:"text",name:"CustomSkinName",placeholder:"Skin Name",size:12}),(0,Q.jsxs)("button",{className:"ExportOptionsButton",type:"button","data-active":tv?"":void 0,"aria-label":"Export Options",title:"Export Options",ref:tx.setReference,...tC(),children:[".",i,(0,Q.jsx)(hP.FaAngleDown,{})]}),tv?(0,Q.jsx)(hy,{context:t_,modal:!1,children:(0,Q.jsx)("div",{className:"ExportOptionsPopup",ref:tx.setFloating,style:tb,...tS(),children:(0,Q.jsxs)("div",{className:"Fields",children:[(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{children:"Export Materials"}),(0,Q.jsx)("ul",{className:"ExportOptionsList",children:V.map((t,e)=>t&&!1!==t.selectable&&!t.hidden?(0,Q.jsxs)("li",{children:[(0,Q.jsx)("input",{id:"MaterialSelect-".concat(t.name),type:"checkbox",checked:!1!==U[e],onChange:t=>{H(r=>{let i=r.slice();return i[e]=t.target.checked,i})}}),(0,Q.jsx)("label",{htmlFor:"MaterialSelect-".concat(t.name),children:t.label})]},t.name):null)})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{htmlFor:"ExportFormat",children:"Export Format"}),(0,Q.jsxs)("select",{id:"ExportFormat",value:i,onChange:t=>{n(t.target.value);try{localStorage.setItem("exportFileType",t.target.value)}catch(t){}},children:[(0,Q.jsx)("option",{value:"png",children:".png"}),(0,Q.jsx)("option",{value:"vl2",children:".vl2"})]})]})]})})}):null,(0,Q.jsx)("button",{type:"button",onClick:()=>{W({name:e.current?e.current.value:"",format:i})},children:"Export"})]})]})}function cp(){return(0,Q.jsxs)("footer",{className:"AppFooter",children:[(0,Q.jsx)("a",{href:"https://github.com/exogen/t2-model-skinner",className:"IconLink",children:(0,Q.jsx)(hP.FaGithub,{size:24})}),(0,Q.jsxs)("div",{className:"Sponsor",children:[(0,Q.jsx)("a",{href:"https://github.com/sponsors/exogen",target:"_blank",rel:"noreferrer",children:"Support this project"})," ",(0,Q.jsx)("span",{className:"Separator",children:"or"})," ",(0,Q.jsx)("a",{href:"https://www.buymeacoffee.com/mosswood",target:"_blank",rel:"noreferrer",children:(0,Q.jsx)("img",{src:"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png",alt:"Buy Me A Coffee",width:109,height:31})})]})]})}async function cm(t){return await s7.fromURL(t,{crossOrigin:"anonymous"})}var cv=t.i(55519);function cy(){let e=(0,J.useRef)(null),r=(0,J.useRef)(null),i=(0,J.useMemo)(()=>({async combineColorAndAlphaImageUrls(){for(var t=arguments.length,e=Array(t),i=0;i{let i=new Worker(t.r(79702)),n=cv.wrap(i);return e.current=i,r.current=n,()=>{n[cv.releaseProxy](),r.current=null,i.terminate()}},[]),i}function cx(){return{canvasPadding:64,basePath:"/t2-model-skinner"}}var cb=t.i(54826);let{materials:c_}=cd.default,cw=[512,512];function cC(e){var r,i;let{children:n}=e,{actualModel:s,selectedModelType:o}=hV(),[a,l]=(0,J.useState)(0),[h,c]=(0,J.useState)(0),[u,d]=(0,J.useState)(1),f=c_[s],g=null!=(r=f[a])?r:null,p=null!=(i=g.frameCount)?i:1,m=p>1,[y,x]=(0,J.useState)([]),b=(0,J.useMemo)(()=>{var t;let[e,r]=null!=(t=g.size)?t:cw;return[e*u,r*u]},[g.size,u]),_=0!==g.metallicFactor||1!==g.roughnessFactor,[w,C]=(0,J.useState)("color");_||"metallic"!==w||C("color"),h>=p&&c(0),(0,J.useEffect)(()=>{try{let t=localStorage.getItem("sizeMultiplier");switch(t){case"1":case"2":case"4":d(+t)}}catch(t){}},[]),(0,J.useEffect)(()=>{x(f.map(t=>!!(t&&!1!==t.selectable&&!t.hidden)))},[f]),(0,J.useEffect)(()=>{c(0)},[g]);let[S,T]=(0,J.useState)("black"),[O,k]=(0,J.useState)(()=>new Set),[M,E]=(0,J.useState)(200),[D,j]=(0,J.useState)(10),[A,P]=(0,J.useState)(()=>new Map),[F,L]=(0,J.useState)(()=>[]),R=g?"".concat(g.name,":").concat(w,":").concat(h,":").concat(u):null,I=g?"".concat(g.name,":metallic:").concat(h,":").concat(u):null,{canvases:B}=oZ(),{canvas:N,notifyChange:W,undo:U,redo:H,canUndo:X,canRedo:V}=oZ(R),{canvas:Y,setDrawingMode:z}=oZ(I),{combineColorAndAlphaImageUrls:G}=cy(),{canvasPadding:q}=cx(),[K,Z]=(0,J.useState)(()=>[]),[$,tt]=(0,J.useState)("BaseLayer");F.length?"SelectedLayer"!==$&&tt("SelectedLayer"):"SelectedLayer"===$&&tt("BaseLayer");let te=(0,J.useCallback)((t,e)=>{var r,i,n;let s=[],o=new Map(A),a=F;for(let l of("AllLayers"===$?a=null!=(r=null==N?void 0:N._objects)?r:[]:"BaseLayer"===$&&(a=null!=(i=null==N?void 0:N._objects.slice(0,1))?i:[]),a))if(l instanceof s7){let r={...null!=(n=A.get(l))?n:{},[t]:e};o.set(l,r),s.push([l,r])}P(o),Z(s)},[N,$,A,F]),tr=t=>{var e,r;let i=+("Opacity"===t),n=F;if("AllLayers"===$?n=null!=(e=null==N?void 0:N._objects)?e:[]:"BaseLayer"===$&&(n=null!=(r=null==N?void 0:N._objects.slice(0,1))?r:[]),!(n=n.filter(t=>t instanceof s7)).length)return[i,e=>te(t,e)];{let e=e=>{var r,s;return null!=(s=(null!=(r=A.get(n[e]))?r:{})[t])?s:i},r=e(0);return n.slice(1).every((t,i)=>e(i+1)===r)?[r,e=>te(t,e)]:[null,e=>te(t,e)]}},[ti,tn]=tr("HueRotation"),[ts,to]=tr("Saturation"),[ta,tl]=tr("Brightness"),[th,tc]=tr("Contrast"),[tu,td]=tr("Opacity");(0,J.useEffect)(()=>{if(K.length){for(let[t,e]of K)if(t instanceof s7){if(t.filters=[],"metallic"===w){let e=new oQ.Grayscale;t.filters.push(e)}for(let r in e){let i=e[r];if(null!=i)switch(r){case"HueRotation":t.filters.push(new oQ.HueRotation({rotation:i}));break;case"Saturation":t.filters.push(new oQ.Saturation({saturation:i}));break;case"Brightness":t.filters.push(new oQ.Brightness({brightness:i}));break;case"Contrast":t.filters.push(new oQ.Contrast({contrast:i}));break;case"Opacity":t.opacity=i}}t.applyFilters()}Z([]),W&&W()}},[K,w,W]);let tf=(0,J.useCallback)(()=>{F.length&&k(t=>{let e=new Set(t);for(let t of F)e.add(t),t.lockMovementX=!0,t.lockMovementY=!0,t.lockScalingX=!0,t.lockScalingY=!0,t.lockRotation=!0;return e})},[F]),tg=(0,J.useCallback)(()=>{F.length&&k(t=>{let e=new Set(t);for(let t of F)e.delete(t),t.lockMovementX=!1,t.lockMovementY=!1,t.lockScalingX=!1,t.lockScalingY=!1,t.lockRotation=!1;return e})},[F]),tp=(0,J.useCallback)(async()=>{let t=N.getActiveObject();t&&(N.bringObjectForward(t,!0),W())},[N,W]),tm=(0,J.useCallback)(async()=>{let t=N.getActiveObject();if(t){if(N._objects[0]===t||N._objects[1]===t)return;N.sendObjectBackwards(t,!0),W()}},[N,W]),tv=(0,J.useCallback)(async t=>{let e;for(let r of t){let t=await cm(r);if(!t.width||!t.height)throw Error("Zero-height image");let i=t.width/b[0],n=t.height/b[1];if(i>1||n>1){let e;t.scaleX=e=i>n?1/i:1/n,t.scaleY=e}if("metallic"===w){t.filters||(t.filters=[]);let e=new oQ.Grayscale;t.filters.push(e),t.applyFilters()}Y&&z(!1),N.centerObject(t),N.add(t),e=t}e&&(N.setActiveObject(e),N.requestRenderAll())},[b,w,Y,N,z]),ty=(0,J.useCallback)(async()=>{let t=N.getActiveObject();if(t){var e,r;let i=await t.clone();i.set({top:(null!=(e=i.top)?e:0)+20,left:(null!=(r=i.left)?r:0)+20,evented:!0}),"activeSelection"===i.type&&(i.canvas=N,i.forEachObject(t=>{N.add(t)}),i.setCoords()),N.discardActiveObject(),N.add(i),N.setActiveObject(i)}},[N]),tx=(0,J.useCallback)(async()=>{let t=N.getActiveObjects();N.discardActiveObject(),N.remove(...t),N.requestRenderAll()},[N]),tb=(0,J.useCallback)(async()=>{if("color"===w&&Y){let t=N.toDataURL({format:"png",multiplier:1,top:q,left:q,width:b[0],height:b[1]}),e=await cm(t);e.filters||(e.filters=[]);let r=new oQ.Grayscale;e.filters.push(r),e.applyFilters(),Y.centerObject(e),Y.add(e),Y.setActiveObject(e),z(!1),C("metallic")}},[Y,N,w,q,z,b]),t_=(0,J.useCallback)(async e=>{let{format:r,name:i=""}=e,{savePngFile:n,saveZipFile:a,createZipFile:l}=await t.A(91135);i=i.trim()||"MyCustomSkin";let h=await Promise.all(f.filter((t,e)=>!1!==y[e]).map(t=>{var e;let r=null!=(e=t.frameCount)?e:1;return Array(r).fill(null).map(async(e,n)=>{var a,l,h,c;let d,f,g=null==(a=B["".concat(t.name,":color:").concat(n,":").concat(u)])?void 0:a.canvas,p=null==(l=B["".concat(t.name,":metallic:").concat(n,":").concat(u)])?void 0:l.canvas,m=null!=(h=t.size)?h:cw,y=[m[0]*u,m[1]*u],x=g.toDataURL({format:"png",multiplier:1,top:q,left:q,width:y[0],height:y[1]});if(p){let t=p.toDataURL({format:"png",multiplier:1,top:q,left:q,width:y[0],height:y[1]});d=await G({colorImageUrl:x,metallicImageUrl:t})}else d=x;switch(o){case"player":f="".concat(i,".").concat(s,".png");break;case"weapon":case"vehicle":if(t){let e=null!=(c=t.file)?c:t.name;if(r>1){let t=e.match(/^(.+)(\d\d)$/);if(t){let e=t[1];f="".concat(e).concat(n.toString().padStart(2,"0"),".png")}else throw Error("Unexpected animation filename")}else f="".concat(e,".png")}else f="weapon"===o?"weapon_".concat(s,".png"):"".concat(s,".png");break;default:throw Error("Unknown model type")}return{imageUrl:d,filename:f}})}).flat());switch(r){case"png":h.forEach(t=>{let{imageUrl:e,filename:r}=t;n(e,r)});break;case"vl2":{let t=l(await Promise.all(h.map(async t=>({data:await (0,cb.imageUrlToArrayBuffer)(t.imageUrl),name:t.filename})))),e=s.replace(/(?:^([a-z])|_([a-z]))/g,(t,e,r)=>(e||r).toUpperCase()),r="",n=u>1?"-@".concat(u,"x"):"";switch(o){case"player":r="zPlayerSkin-".concat(i).concat(n,".vl2");break;case"weapon":r="zWeapon".concat(e,"-").concat(i).concat(n,".vl2");break;case"vehicle":r="z".concat(e,"-").concat(i).concat(n,".vl2")}await a(t,r)}}},[f,y,B,u,q,o,G,s]),tw=(0,J.useMemo)(()=>({activeCanvas:R,activeCanvasType:w,setActiveCanvasType:C,backgroundColor:S,setBackgroundColor:T,lockedObjects:O,setLockedObjects:k,brushColor:M,setBrushColor:E,brushSize:D,setBrushSize:j,hueRotate:ti,setHueRotate:tn,saturation:ts,setSaturation:to,brightness:ta,setBrightness:tl,contrast:th,setContrast:tc,opacity:tu,setOpacity:td,layerMode:$,setLayerMode:tt,selectedObjects:F,lockSelection:tf,unlockSelection:tg,bringForward:tp,sendBackward:tm,addImages:tv,duplicate:ty,deleteSelection:tx,undo:U,redo:H,canUndo:X,canRedo:V,copyToMetallic:tb,exportSkin:t_,selectedMaterialIndex:a,setSelectedMaterialIndex:l,textureSize:b,hasMetallic:_,selectedFrameIndex:h,setSelectedFrameIndex:c,hasAnimation:m,frameCount:p,sizeMultiplier:u,setSizeMultiplier:d,selectedExportMaterials:y,setSelectedExportMaterials:x}),[R,w,S,O,M,D,ti,tn,ts,to,ta,tl,th,tc,tu,td,$,F,tf,tg,tp,tm,tv,ty,tx,U,H,X,V,tb,t_,a,b,_,h,m,p,u,y]);return(0,J.useEffect)(()=>{if(N){let t=()=>{L(N.getActiveObjects())};return N.on("selection:cleared",t),N.on("selection:updated",t),N.on("selection:created",t),t(),()=>{N.off("selection:cleared",t),N.off("selection:updated",t),N.off("selection:created",t)}}},[N]),(0,J.useEffect)(()=>{Y&&(Y.freeDrawingBrush||(Y.freeDrawingBrush=new sx(Y)),Y.freeDrawingBrush.width=D)},[Y,D]),(0,J.useEffect)(()=>{Y&&(Y.freeDrawingBrush||(Y.freeDrawingBrush=new sx(Y)),Y.freeDrawingBrush.color="rgb(".concat(M,", ").concat(M,", ").concat(M,")"))},[Y,M]),(0,Q.jsx)(o$.Provider,{value:tw,children:n})}function cS(){let{backgroundColor:t,textureSize:e}=o0(),{canvasPadding:r}=cx();return e?(0,Q.jsx)("div",{className:"CanvasBackdrop",style:{backgroundColor:t,top:r,width:e[0],height:e[1]}}):null}function cT(t){let{children:e}=t,[r,i]=(0,J.useState)({}),n=(0,J.useCallback)((t,e)=>{i(r=>({...r,[t]:e}))},[]),s=(0,J.useCallback)(t=>{i(e=>{let{[t]:r,...i}=e;return i})},[]),o=(0,J.useMemo)(()=>({canvases:r,registerCanvas:n,unregisterCanvas:s}),[r,n,s]);return(0,Q.jsx)(oJ.Provider,{value:o,children:e})}function cO(t){let{children:e}=t,r=(0,J.useRef)(null),{activeCanvas:i,activeCanvasType:n,bringForward:s,sendBackward:o,duplicate:a,deleteSelection:l,addImages:h,undo:c,redo:u}=o0(),{canvas:d,notifyChange:f,setDrawingMode:g}=oZ(i),p=async function(){let{top:t=0,left:e=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(let n of d.getActiveObjects()){var r,i;n.top=(null!=(r=n.top)?r:0)+t,n.left=(null!=(i=n.left)?i:0)+e,n.setCoords()}f()};return(0,Q.jsx)("div",{className:"CanvasInteractions",tabIndex:0,ref:r,onDragOver:t=>{t.preventDefault()},onDrop:async t=>{t.preventDefault(),r.current&&r.current.focus();let{items:e}=t.dataTransfer,i=Array.from(e).filter(t=>"file"===t.kind&&t.type.match(/^image\//)),n=await Promise.all(i.map(async t=>{let e=t.getAsFile();if(!e)throw Error("Not a file.");let r=new FileReader;return await new Promise((t,i)=>{r.onload=async e=>{e.target&&"string"==typeof e.target.result?t(e.target.result):i(Error("Failed to load image data."))},r.readAsDataURL(e)})}).filter(Boolean));await h(n)},onKeyDown:async t=>{let e=t.target;if("INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName){if(t.ctrlKey||t.metaKey)switch(t.key){case"z":if(t.altKey)return;if(t.shiftKey){t.preventDefault(),u();return}t.preventDefault(),c();return;case"y":if(t.altKey||t.shiftKey)return;t.preventDefault(),u();return}if(!t.altKey&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey)switch(t.key){case"Backspace":case"Delete":t.preventDefault(),await l();break;case"ArrowLeft":t.preventDefault(),await p({left:-1});break;case"ArrowRight":t.preventDefault(),await p({left:1});break;case"ArrowUp":t.preventDefault(),await p({top:-1});break;case"ArrowDown":t.preventDefault(),await p({top:1});break;case"d":t.preventDefault(),await a();break;case"f":t.preventDefault(),await s();break;case"b":t.preventDefault(),await o();break;case"p":"metallic"===n&&(t.preventDefault(),g(!0));break;case"s":"metallic"===n&&(t.preventDefault(),g(!1))}}},children:e})}function ck(){let{activeCanvasType:t,setActiveCanvasType:e,hasMetallic:r,hasAnimation:i,frameCount:n,selectedFrameIndex:s,setSelectedFrameIndex:o,sizeMultiplier:a,setSizeMultiplier:l}=o0();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"CanvasToggle",children:[(0,Q.jsx)("button",{type:"button","data-selected":"color"===t?"":void 0,onClick:()=>{e("color")},children:"Color"}),r?(0,Q.jsx)("button",{type:"button","data-selected":"metallic"===t?"":void 0,onClick:()=>{e("metallic")},children:"Metallic"}):null]}),(0,Q.jsxs)("div",{className:"CanvasToggle",style:{display:"none"},children:[(0,Q.jsx)("button",{type:"button","data-selected":1===a?"":void 0,onClick:()=>{l(1)},children:"1×"}),(0,Q.jsx)("button",{type:"button","data-selected":2===a?"":void 0,onClick:()=>{l(2)},children:"2×"}),(0,Q.jsx)("button",{type:"button","data-selected":4===a?"":void 0,onClick:()=>{l(4)},children:"4×"})]}),i?(0,Q.jsxs)("div",{className:"FrameSelector",children:[(0,Q.jsx)("button",{type:"button",onClick:()=>{o(t=>(n+t-1)%n)},children:(0,Q.jsx)(hP.FaChevronLeft,{})}),(0,Q.jsxs)("span",{className:"FrameInfo",children:[s+1," / ",n]}),(0,Q.jsx)("button",{type:"button",onClick:()=>{o(t=>(t+1)%n)},children:(0,Q.jsx)(hP.FaChevronRight,{})})]}):null]})}var cM=t.i(90106),cE=t.i(53653),cD=t.i(15768);let{defaultSkins:cj,modelDefaults:cA}=cd.default,cP={},cF=new Map;function cL(){var t,e,r,i,n,s;let{selectedModel:o,setSelectedModel:a,selectedModelType:l,setSelectedModelType:h,selectedSkin:c,setSelectedSkin:u,setSelectedSkinType:d,actualModel:f,setSelectedAnimation:g,setAnimationPaused:p,importedSkins:m,addImportedSkins:y}=hV(),{setSelectedMaterialIndex:x}=o0(),[b,_]=(0,J.useState)(cP),[w,C]=(0,J.useState)(cP),[S,T]=(0,J.useState)(null),O=(0,J.useRef)(null),[k,M]=(0,cD.default)(),E=Array.from((null!=(s=m.get(f))?s:cF).values()).filter(t=>t.isComplete);M&&(b!==k.customSkins||w!==k.newSkins)&&(_(k.customSkins),C(k.newSkins));let D=null!=c?c:"";return c&&S&&(D="".concat(S,"/").concat(c)),(0,Q.jsxs)("div",{className:"Toolbar",children:[(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{htmlFor:"ModelSelect",children:"Model"}),(0,Q.jsxs)("select",{id:"ModelSelect",value:o,onChange:t=>{var e,r,i,n;let s=t.target.selectedOptions[0].parentNode,o=t.target.value,l="hfemale"===o?"hmale":o,{modelType:f}=s.dataset;if(!f)throw Error("No data-model-type found");let m=c&&((null==(e=cj[l])?void 0:e.includes(c))||(null==(r=b[l])?void 0:r.includes(c)))||!1,y=!1;c&&"new"===S&&m&&(y=null==(i=w[l])?void 0:i.includes(c)),g(null),p(!1),h(f),a(o),x(0),m||(u(null!=(n=cA[l])?n:null),d("default")),y||T(null)},children:[(0,Q.jsxs)("optgroup",{label:"Players","data-model-type":"player",children:[(0,Q.jsx)("option",{value:"lmale",children:"Human Male • Light"}),(0,Q.jsx)("option",{value:"mmale",children:"Human Male • Medium"}),(0,Q.jsx)("option",{value:"hmale",children:"Human Male • Heavy"}),(0,Q.jsx)("option",{value:"lfemale",children:"Human Female • Light"}),(0,Q.jsx)("option",{value:"mfemale",children:"Human Female • Medium"}),(0,Q.jsx)("option",{value:"hfemale",children:"Human Female • Heavy"}),(0,Q.jsx)("option",{value:"lbioderm",children:"Bioderm • Light"}),(0,Q.jsx)("option",{value:"mbioderm",children:"Bioderm • Medium"}),(0,Q.jsx)("option",{value:"hbioderm",children:"Bioderm • Heavy"})]}),(0,Q.jsxs)("optgroup",{label:"Weapons","data-model-type":"weapon",children:[(0,Q.jsx)("option",{value:"disc",children:"Disc Launcher"}),(0,Q.jsx)("option",{value:"chaingun",children:"Chaingun"}),(0,Q.jsx)("option",{value:"grenade_launcher",children:"Grenade Launcher"}),(0,Q.jsx)("option",{value:"sniper",children:"Laser Rifle"}),(0,Q.jsx)("option",{value:"plasmathrower",children:"Plasma Cannon"}),(0,Q.jsx)("option",{value:"energy",children:"Blaster"}),(0,Q.jsx)("option",{value:"shocklance",children:"Shocklance"}),(0,Q.jsx)("option",{value:"elf",children:"ELF Projector"}),(0,Q.jsx)("option",{value:"missile",children:"Missile Launcher"}),(0,Q.jsx)("option",{value:"mortar",children:"Mortar"}),(0,Q.jsx)("option",{value:"repair",children:"Repair Pack"}),(0,Q.jsx)("option",{value:"targeting",children:"Targeting Laser"}),(0,Q.jsx)("option",{value:"mine",children:"Mine"})]}),(0,Q.jsxs)("optgroup",{label:"Vehicles","data-model-type":"vehicle",children:[(0,Q.jsx)("option",{value:"vehicle_grav_scout",children:"Wildcat Grav Cycle"}),(0,Q.jsx)("option",{value:"vehicle_grav_tank",children:"Beowulf Assault Tank"}),(0,Q.jsx)("option",{value:"vehicle_land_mpbbase",children:"Jericho Mobile Point Base"}),(0,Q.jsx)("option",{value:"vehicle_air_scout",children:"Shrike Scout Fighter"}),(0,Q.jsx)("option",{value:"vehicle_air_bomber",children:"Thundersword Bomber"}),(0,Q.jsx)("option",{value:"vehicle_air_hapc",children:"HAVOC Gunship Transport"})]})]})]}),(0,Q.jsxs)("div",{className:"Field",children:[(0,Q.jsx)("label",{htmlFor:"SkinSelect",children:"Skin"}),(0,Q.jsxs)("div",{className:"Buttons",children:[(0,Q.jsxs)("select",{id:"SkinSelect",value:D,onChange:t=>{var e,r;let i=t.target.selectedOptions[0].parentNode,n=t.target.value&&null!=(e=i.dataset.skinType)?e:null,s=t.target.value.split("/");u(null!=(r=s.slice(-1)[0])?r:null),d(n),s.length>1?T(s[0]):T(null)},children:[(0,Q.jsx)("option",{value:"",children:"Select a skin…"}),"player"===l?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("optgroup",{label:"Default Skins","data-skin-type":"default",children:null==(t=cj[f])?void 0:t.map(t=>(0,Q.jsx)("option",{value:t,children:t},t))}),E.length?(0,Q.jsx)("optgroup",{label:"Imported Skins","data-skin-type":"import",children:E.map(t=>{var e,r;return(0,Q.jsx)("option",{value:"import/".concat(null!=(e=t.name)?e:"__untitled__"),children:t.name||"Untitled Imported Skin"},"import/".concat(null!=(r=t.name)?r:"__untitled__"))})}):null,(null==(e=w[f])?void 0:e.length)?(0,Q.jsx)("optgroup",{label:"New Skins ✨","data-skin-type":"custom",children:null==(r=w[f])?void 0:r.map(t=>(0,Q.jsxs)("option",{value:"new/".concat(t),children:[t," ✨"]},"new/".concat(t)))}):null,(0,Q.jsx)("optgroup",{label:"Custom Skins","data-skin-type":"custom",children:b===cP?(0,Q.jsx)("option",{value:"",children:"Loading…"},"loading"):null==(i=b[f])?void 0:i.map(t=>(0,Q.jsx)("option",{value:t,children:t},t))})]}):null,"weapon"===l||"vehicle"===l?(0,Q.jsxs)(Q.Fragment,{children:[cA[f]?(0,Q.jsx)("optgroup",{label:"Default Skins","data-skin-type":"default",children:(0,Q.jsx)("option",{value:cA[f],children:"Default"})}):null,E.length?(0,Q.jsx)("optgroup",{label:"Imported Skins","data-skin-type":"import",children:E.map(t=>{var e,r;return(0,Q.jsx)("option",{value:"import/".concat(null!=(e=t.name)?e:"__untitled__"),children:t.name||"Untitled Imported Skin"},"import/".concat(null!=(r=t.name)?r:"__untitled__"))})}):null,(null==(n=b[f])?void 0:n.length)?(0,Q.jsx)("optgroup",{label:"Custom Skins","data-skin-type":"custom",children:b[f].map(t=>(0,Q.jsx)("option",{value:t,children:t},t))}):null]}):null]}),(0,Q.jsx)("button",{type:"button","aria-label":"Load Skin",title:"Load a Skin",onClick:()=>{O.current&&O.current.click()},children:(0,Q.jsx)(hP.FaFolderOpen,{style:{fontSize:18}})}),(0,Q.jsx)("input",{ref:O,onChange:async t=>{var e,r,i;let n=await (0,cE.importMultipleFilesToModels)(null!=(e=t.target.files)?e:[]);y(n);let s=n.get(f);if(s){let t=Array.from(s.values()).filter(t=>t.isComplete);if(t.length){let e=t[0];d("import"),T("import"),u(null!=(r=e.name)?r:"__untitled__"),x(0),g(null);return}}for(let[t,e]of Array.from(n.entries()))for(let r of Array.from(e.values()))if(r.isComplete){a(t),h((0,cE.modelToModelType)(t)),d("import"),T("import"),u(null!=(i=r.name)?i:"__untitled__"),x(0),g(null);break}},type:"file",accept:".png, image/png, .vl2, .zip, application/zip, application/zip-compressed",multiple:!0,hidden:!0})]})]}),(0,Q.jsx)("div",{className:"Field GalleryField",children:(0,Q.jsxs)("a",{href:"gallery/",target:"_blank",className:"GalleryLink",title:"Open skin gallery",children:[(0,Q.jsx)("span",{className:"FieldLabel",children:"Gallery"}),(0,Q.jsx)(cM.BsFillGrid3X3GapFill,{})]})})]})}var cR=t.i(18566),cI=t.i(96165);let{materials:cB,modelDefaults:cN,defaultSkins:cW}=cd.default,cU=new Map;function cH(t,e){if(e<2)return[t];let r=t.match(/^(.+)(\d\d)$/);if(r){let t=r[1];return Array(e).fill(null).map((e,r)=>"".concat(t).concat(r.toString().padStart(2,"0")))}throw Error("Did not match expected frame format")}function cX(t){let{basePath:e,actualModel:r,selectedModelType:i,selectedSkin:n,selectedSkinType:s}=t,o=cB[r];if(n&&"import"===s){let t=cU.get(r);if(t){let e="__untitled__"===n?null:n,r=t.get(e);if(r&&r.isComplete)return Object.fromEntries(r.materials)}throw Error("No skin found")}switch(i){case"player":switch(s){case"default":return{base:["".concat(e,"/textures/").concat(n,".").concat(r,".png")]};case"custom":return{base:["".concat(cI.SKIN_ASSET_BASE_URL,"/").concat(n,".").concat(r,".png")]}}break;case"weapon":case"vehicle":return o.reduce((t,r)=>{if(r){var i,o,a,l,h;let c=null!=(i=r.frameCount)?i:1;switch(s){case"default":!1!==r.hasDefault&&(t[null!=(o=r.file)?o:r.name]=cH(null!=(a=r.file)?a:r.name,c).map(t=>"".concat(e,"/textures/").concat(t,".png")));break;case"custom":t[null!=(l=r.file)?l:r.name]=cH(null!=(h=r.file)?h:r.name,c).map(t=>"".concat(cI.SKIN_ASSET_BASE_URL,"/").concat(n,"/").concat(t,".png"))}}return t},{})}return{}}function cV(t){var e,r;let{children:i}=t,n=(0,cR.useRouter)(),s=(0,cR.usePathname)(),o=(0,cR.useSearchParams)(),[a,l]=(0,J.useState)(!1),[h,c]=(0,J.useState)("lmale"),[u,d]=(0,J.useState)("player"),[f,g]=(0,J.useState)("Blood Eagle"),[p,m]=(0,J.useState)("default"),[y,x]=(0,J.useState)(null),[b,_]=(0,J.useState)(!1),[w,C]=(0,J.useState)(!1),{basePath:S}=cx(),T="hfemale"===h?"hmale":h,O="".concat(S,"/").concat(T).concat(y?".anim":"",".glb"),[k,M]=(0,J.useState)(cU),E=(0,J.useCallback)(t=>{let e=new Map(cU.entries());t.forEach((t,r)=>{var i;let n=null!=(i=e.get(r))?i:new Map;t.forEach((t,e)=>{n.set(e,t)}),e.set(r,n)}),M(cU=e)},[]),[D,j]=(0,J.useState)(()=>cX({basePath:S,actualModel:T,selectedModelType:u,selectedSkin:f,selectedSkinType:p})),A=(0,J.useMemo)(()=>cX({basePath:S,actualModel:T,selectedModelType:u,selectedSkin:cN[T],selectedSkinType:"default"}),[T,S,u]),P=(0,J.useMemo)(()=>({selectedModel:h,setSelectedModel:c,selectedModelType:u,setSelectedModelType:d,actualModel:T,selectedModelUrl:O,animationPaused:b,setAnimationPaused:_,selectedSkin:f,setSelectedSkin:g,selectedSkinType:p,setSelectedSkinType:m,selectedAnimation:y,setSelectedAnimation:x,skinImageUrls:D,setSkinImageUrls:j,defaultSkinImageUrls:A,slowModeEnabled:w,setSlowModeEnabled:C,importedSkins:k,addImportedSkins:E}),[h,c,u,d,T,O,b,_,f,g,p,m,y,x,D,j,A,w,k,E]);if(!a){let t=o.get("m"),i=o.get("s");if("string"==typeof t){let n=function(t){switch(t){case"lmale":case"mmale":case"hmale":case"lfemale":case"mfemale":case"hfemale":case"lbioderm":case"mbioderm":case"hbioderm":return"player";case"disc":case"chaingun":case"grenade_launcher":case"sniper":case"plasmathrower":case"energy":case"shocklance":case"elf":case"missile":case"mortar":case"repair":case"targeting":case"mine":return"weapon";case"vehicle_grav_scout":case"vehicle_grav_tank":case"vehicle_land_mpbbase":case"vehicle_air_scout":case"vehicle_air_bomber":case"vehicle_air_hapc":return"vehicle";default:return null}}(t);if(n&&(c(t),d(n),"string"==typeof i)){let n=i===cN[e="hfemale"===t?"hmale":t]||(null==(r=cW[e])?void 0:r.includes(i))?"default":"custom";g(i),m(n)}}l(!0)}return(0,J.useEffect)(()=>{if(!f)return;let t=o.get("m"),e=o.get("s");if(t!==h||e!==f){let t=new URLSearchParams(o);t.set("m",h),t.set("s",f);let e="".concat(s,"?").concat(t);n.replace(e,{scroll:!1})}},[s,n,o,h,f]),(0,J.useEffect)(()=>{if(f)try{let t=cX({basePath:S,actualModel:T,selectedModelType:u,selectedSkin:f,selectedSkinType:p});j(t)}catch(t){m("default"),g(cN[T])}},[T,S,u,f,p]),(0,Q.jsx)(hX.Provider,{value:P,children:i})}var cY=t.i(70703);let cz=J.default.createContext(null);function cG(){let t=(0,J.useContext)(cz);if(!t)throw Error("No EnvironmentContext.Provider");return t}cz.displayName="EnvironmentContext";let cq=J.default.createContext(null);function cK(){let t=(0,J.useContext)(cq);if(!t)throw Error("No SkinContext.Provider");return t}cq.displayName="SkinContext";var cQ=t.i(63871);function cJ(t){let{material:e,materialDef:r,textureType:i,imageUrl:n,frameRef:s,onReady:o}=t,{modelViewer:a}=(0,cQ.default)(),{basePath:l}=cx(),{slowModeEnabled:h}=hV();(0,J.useEffect)(()=>{let t,c=!1;return(async()=>{if(!r||r.hidden)if("metallicRoughnessTexture"===i){o&&o();return}else e.setAlphaMode("BLEND"),e.pbrMetallicRoughness.setBaseColorFactor([0,0,0,0]),o&&o();else{let{alphaMode:u,alphaCutoff:d,baseColorFactor:f,emissiveFactor:g,emissiveTexture:p=!1,metallicFactor:m=1,roughnessFactor:y=1,frameCount:x=1,frameTimings:b}=r,_=null!=n?n:Array(x).fill("".concat(l,"/white.png"));if(_.some(t=>!t))return;switch(i){case"baseColorTexture":f&&e.pbrMetallicRoughness.setBaseColorFactor(f),u&&e.setAlphaMode(u),d&&e.setAlphaCutoff(d),g&&e.setEmissiveFactor(g);break;case"metallicRoughnessTexture":e.pbrMetallicRoughness.setMetallicFactor(m),e.pbrMetallicRoughness.setRoughnessFactor(y),0===m&&1===y&&(_=Array(x).fill("".concat(l,"/green.png")))}let w=await Promise.all(_.map(t=>a.createTexture(t)));if(!c){let r="baseColorTexture"===i,n=s.current,a=()=>{let s=w[n.frameIndex];if(e.pbrMetallicRoughness[i].setTexture(s),r&&p&&e.emissiveTexture.setTexture(s),r&&(n.frameProgress+=h?.05:1),x>1){var o;let e=null!=(o=null==b?void 0:b[n.frameIndex])?o:1;r&&n.frameProgress>=e&&(n.frameIndex=(n.frameIndex+1)%x,n.frameProgress=0),t=requestAnimationFrame(a)}};a(0),o&&o()}}})(),()=>{c=!0,null!=t&&cancelAnimationFrame(t)}},[l,a,e,r,i,n,s,h,o])}function cZ(t){var e,r;let{material:i,materialDef:n,onReady:s}=t,{getSkinImages:o}=cK(),{colorImageUrl:a,metallicImageUrl:l}=null!=(r=o(null!=(e=null==n?void 0:n.file)?e:i.name))?r:{},h=(0,J.useRef)({frameIndex:0,frameProgress:0});return cJ({material:i,materialDef:n,textureType:"baseColorTexture",imageUrl:a,frameRef:h}),cJ({material:i,materialDef:n,textureType:"metallicRoughnessTexture",imageUrl:l,frameRef:h}),null}let{materials:c$}=cd.default;function c0(){let{actualModel:t}=hV(),{model:e}=(0,cQ.default)(),r=c$[t];return(0,Q.jsx)(Q.Fragment,{children:e.materials.map((t,e)=>{let i=r[e];return(0,Q.jsx)(cZ,{material:t,materialDef:i},t.name)})})}let c1=(0,cY.default)(()=>t.A(22143),{loadableGenerated:{modules:[66641]},ssr:!1}),{cameraOverrides:c2}=cd.default;function c5(){var t,e,r,i;let{selectedModel:n,selectedModelUrl:s,selectedModelType:o,selectedAnimation:a,animationPaused:l,slowModeEnabled:h}=hV(),{environmentImageUrl:c,showEnvironment:u,exposure:d}=cG();return(0,Q.jsx)(c1,{modelUrl:s,environmentImageUrl:c,showEnvironment:u,animationName:a,animationPaused:l,timeScale:h?.05:.5,cameraOrbit:null!=(i=null==(t=c2[n])?void 0:t.orbit)?i:"weapon"===o?"315deg 70deg 105%":void 0,cameraTarget:null==(e=c2[n])?void 0:e.target,fieldOfView:null==(r=c2[n])?void 0:r.fov,exposure:d,children:(0,Q.jsx)(c0,{})})}function c4(){let{selectedEnvironment:t,setSelectedEnvironment:e}=cG();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("label",{htmlFor:"EnvMapSelect",children:"Environment"}),(0,Q.jsxs)("select",{id:"EnvMapSelect",value:null!=t?t:"",onChange:t=>{e(t.target.value||null)},children:[(0,Q.jsx)("option",{value:"",children:"Default"}),(0,Q.jsx)("option",{value:"clarens_night_02_1k.hdr",children:"Clarens Night"}),(0,Q.jsx)("option",{value:"dry_cracked_lake_1k.hdr",children:"Dry Cracked Lake"}),(0,Q.jsx)("option",{value:"fouriesburg_mountain_midday_1k.hdr",children:"Fouriesburg Mountain"}),(0,Q.jsx)("option",{value:"goegap_1k.hdr",children:"Goegap"}),(0,Q.jsx)("option",{value:"hilly_terrain_01_1k.hdr",children:"Hilly Terrain"}),(0,Q.jsx)("option",{value:"kloofendal_48d_partly_cloudy_puresky_1k.hdr",children:"Kloofendal Partly Cloudy"}),(0,Q.jsx)("option",{value:"kloppenheim_06_puresky_1k.hdr",children:"Kloppenheim"}),(0,Q.jsx)("option",{value:"lilienstein_1k.hdr",children:"Lilienstein"}),(0,Q.jsx)("option",{value:"spruit_sunrise_1k_HDR.hdr",children:"Spruit Sunrise"}),(0,Q.jsx)("option",{value:"umhlanga_sunrise_1k.hdr",children:"Umhlanga Sunrise"})]})]})}function c3(){let{exposure:t,setExposure:e}=cG();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("label",{htmlFor:"EnvExposure",children:(0,Q.jsx)(hU,{size:16})}),(0,Q.jsx)("input",{"aria-label":"Exposure",id:"EnvExposure",type:"range",min:.2,max:2.2,step:.1,value:t,onChange:t=>{e(parseFloat(t.target.value))}})]})}let{animations:c9,animationLabels:c6,animationLabelOverrides:c8}=cd.default;function c7(){let{actualModel:t,selectedModelType:e,selectedAnimation:r,setSelectedAnimation:i,animationPaused:n,setAnimationPaused:s,slowModeEnabled:o,setSlowModeEnabled:a}=hV(),l=(0,J.useMemo)(()=>{var r;return[..."player"===e?c9.global:[],...null!=(r=c9[t])?r:[]]},[t,e]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"LabelWithControls",children:[(0,Q.jsx)("label",{children:"Animation"}),(0,Q.jsxs)("div",{className:"AnimationSpeed",children:[(0,Q.jsx)("input",{type:"checkbox",id:"SlowDownCheckbox",checked:o,onChange:t=>{a(t.target.checked)}})," ",(0,Q.jsx)("label",{htmlFor:"SlowDownCheckbox",children:"Slow?"})]})]}),(0,Q.jsxs)("div",{className:"Buttons",children:[(0,Q.jsxs)("select",{value:null!=r?r:"",onChange:t=>{i(t.target.value||null),s(!1)},children:[(0,Q.jsx)("option",{value:"",children:"None"}),l.map(e=>{var r,i;let n=null!=(i=null==(r=c8[t])?void 0:r[e])?i:c6[e];return(0,Q.jsx)("option",{value:e,children:null!=n?n:e},e)})]}),(0,Q.jsx)("button",{type:"button",disabled:!r,onClick:()=>{s(t=>!t)},children:n||!r?(0,Q.jsx)(hI,{}):(0,Q.jsx)(hR,{})})]})]})}function ut(t){let{children:e}=t,[r,i]=(0,J.useState)(null),[n,s]=(0,J.useState)(!1),[o,a]=(0,J.useState)(1),{basePath:l}=cx(),h=(0,J.useMemo)(()=>{let t=r?"".concat(l,"/").concat(r):null;return{selectedEnvironment:r,setSelectedEnvironment:i,showEnvironment:n,setShowEnvironment:s,exposure:o,setExposure:a,environmentImageUrl:t}},[l,r,n,o]);return(0,Q.jsx)(cz.Provider,{value:h,children:e})}function ue(t){let{children:e}=t,[r,i]=(0,J.useState)({}),n=(0,J.useMemo)(()=>({setSkinImages(t,e){i(r=>({...r,[t]:e}))},setColorImageUrl(t,e,r){i(i=>{var n,s;let o=Array.from(null!=(s=null==(n=i[t])?void 0:n.colorImageUrl)?s:[]);return o[r]=e,{...i,[t]:{...i[t],colorImageUrl:o}}})},setMetallicImageUrl(t,e,r){i(i=>{var n,s;let o=Array.from(null!=(s=null==(n=i[t])?void 0:n.metallicImageUrl)?s:[]);return o[r]=e,{...i,[t]:{...i[t],metallicImageUrl:o}}})}}),[]),s=(0,J.useMemo)(()=>({materialSkins:r,getSkinImages:t=>r[t],getColorImageUrl(t,e){var i;return null==(i=r[t].colorImageUrl)?void 0:i[e]},getMetallicImageUrl(t,e){var i;return null==(i=r[t].metallicImageUrl)?void 0:i[e]},...n}),[r,n]);return(0,Q.jsx)(cq.Provider,{value:s,children:e})}let{materials:ur}=cd.default;function ui(){let{actualModel:t}=hV(),{selectedMaterialIndex:e,setSelectedMaterialIndex:r}=o0(),i=ur[t];return(0,Q.jsx)("select",{value:e,onChange:t=>{r(parseInt(t.target.value,10))},children:i.map((t,e)=>{var r;return t&&!t.hidden&&!1!==t.selectable?(0,Q.jsx)("option",{value:e,children:null!=(r=t.label)?r:t.name},t.name):null})})}function un(t){let{canvasId:e,onChange:r,baseImageUrl:i,textureSize:n,defaultDrawingMode:s=!1}=t,o=(0,J.useRef)(null),[a,l]=(0,J.useState)(null),{activeCanvas:h}=o0(),{canvasPadding:c}=cx(),{registerCanvas:u,unregisterCanvas:d}=oZ(),[f,g]=(0,J.useState)(s),p=(0,J.useRef)(null),m=(0,J.useRef)(!0),[y,x]=(0,J.useState)(()=>[]),[b,_]=(0,J.useState)(()=>[]),w=y.length>1,C=b.length>0,S=(0,J.useCallback)(t=>{let e=p.current;e&&e(t)},[]),T=(0,J.useCallback)(async()=>{if(a&&y.length>1){let[t,e]=y.slice(-2);m.current=!1,a.renderOnAddRemove=!1,a.clear(),a.loadFromJSON(t,()=>{a.renderAll(),m.current=!0,a.renderOnAddRemove=!0}),x(t=>t.slice(0,-1)),_(t=>[e,...t])}},[a,y]),O=(0,J.useCallback)(()=>{if(a&&b.length>0){let t=b[0];m.current=!1,a.renderOnAddRemove=!1,a.clear(),a.loadFromJSON(t,()=>{a.renderAll(),m.current=!0,a.renderOnAddRemove=!0}),x(e=>[...e,t]),_(t=>t.slice(1))}},[a,b]);(0,J.useEffect)(()=>{p.current=r},[r]);let k=h===e;return(0,J.useEffect)(()=>{let t;if(!o.current)return;iB.ownDefaults={...iB.ownDefaults,transparentCorners:!1,borderColor:"#8afff1",cornerSize:9,cornerStyle:"circle",cornerColor:"#8afff1",cornerStrokeColor:"#1c9f7c",strokeWidth:10,perPixelTargetFind:!0};let e=new st(o.current,{preserveObjectStacking:!0,targetFindTolerance:2}),r=!1,i=()=>{S(e)};return e.on("object:modified",i),e.on("object:added",i),e.on("object:removed",i),e.on("after:render",()=>{!r&&m.current&&(clearTimeout(t),t=setTimeout(()=>{let t=(()=>{r=!0;let t=e.toDatalessJSON(["lockMovementX","lockMovementY","lockRotation","lockScalingX","lockScalingY","selectable","hoverCursor","moveCursor"]);return r=!1,t})();x(e=>{if(0===e.length)return[t];let r=e[e.length-1];return JSON.stringify(t)===JSON.stringify(r)?e:[...e.slice(-10),t]}),_([])},250))}),l(e),()=>{clearTimeout(t),l(null),e.dispose()}},[S]),(0,J.useEffect)(()=>{a&&(a.isDrawingMode=f,f&&(a.discardActiveObject(),a.requestRenderAll()))},[a,f]),(0,J.useEffect)(()=>{a&&k&&a.calcOffset()},[a,k]),(0,J.useEffect)(()=>{if(a)return u(e,{canvas:a,notifyChange:()=>{a.renderAll(),S(a)},undo:T,redo:O,canUndo:w,canRedo:C,isDrawingMode:f,setDrawingMode:g}),()=>{d(e)}},[a,u,d,e,S,f,g,T,O,w,C]),(0,J.useEffect)(()=>{x([]),_([])},[a,i,n]),(0,J.useEffect)(()=>{if(a&&n&&(m.current=!1,a.clear(),i)){let t=!1;return(async()=>{let e=await cm(i);if(!t){if(!e.width||!e.height)throw Error("Zero-height image");e.selectable=!1,e.lockMovementX=!0,e.lockMovementY=!0,e.lockScalingX=!0,e.lockScalingY=!0,e.lockRotation=!0,e.hoverCursor="default",e.moveCursor="default";let[t,r]=n,i=e.width===t?1:t/e.width,s=e.height===r?1:r/e.height;(1!==i||1!==s)&&(e.scaleX=i,e.scaleY=s),a.centerObject(e),a.add(e)}m.current=!0,a.requestRenderAll()})(),()=>{t=!0}}},[a,i,n]),(0,Q.jsx)("div",{className:"CanvasContainer","data-active":k?"true":"false",children:(0,Q.jsx)("canvas",{width:n[0]+2*c,height:n[1]+2*c,ref:o})})}let us=J.default.createContext(null);function uo(){let t=(0,J.useContext)(us);if(!t)throw Error("ImageLoaderContext.Provider not found!");return t}us.displayName="ImageLoaderContext";let ua=[512,512];function ul(t){var e,r,i,n;let{materialDef:s,frameIndex:o=0}=t,{skinImageUrls:a,defaultSkinImageUrls:l}=hV(),h=null==(e=a[null!=(i=s.file)?i:s.name])?void 0:e[o],c=null==(r=l[null!=(n=s.file)?n:s.name])?void 0:r[o],{setColorImageUrl:u}=cK(),{canvasPadding:d}=cx(),[f,g]=(0,J.useState)(null),{removeAlphaFromArrayBuffer:p}=cy(),{loadImage:m}=uo(),{sizeMultiplier:y}=o0(),x=(0,J.useMemo)(()=>{var t;let[e,r]=null!=(t=s.size)?t:ua;return[e*y,r*y]},[s.size,y]),b=(0,J.useCallback)(async t=>{var e;let r=t.toDataURL({format:"png",multiplier:1,top:d,left:d,width:x[0],height:x[1]});u(null!=(e=s.file)?e:s.name,r,o)},[x,d,u,s,o]);(0,J.useEffect)(()=>{if(h){let t=!1;return(async()=>{let e;try{e=await m(h)}catch(t){if(!1===s.hasDefault)return;e=await m(c)}let r=await p(e);t||g(r)})(),()=>{t=!0}}g(null)},[s,h,c,p,m]);let _="".concat(s.name,":color:").concat(o,":").concat(y);return x?(0,Q.jsx)(un,{canvasId:_,canvasType:"color",onChange:b,baseImageUrl:f,textureSize:x},_):null}let uh=[512,512];function uc(t){var e,r,i,n;let{materialDef:s,frameIndex:o=0}=t,{skinImageUrls:a,defaultSkinImageUrls:l}=hV(),h=null==(e=a[null!=(i=s.file)?i:s.name])?void 0:e[o],c=null==(r=l[null!=(n=s.file)?n:s.name])?void 0:r[o],{setMetallicImageUrl:u}=cK(),{canvasPadding:d}=cx(),[f,g]=(0,J.useState)(null),p=(0,J.useRef)(0),{convertGrayscaleImageUrlToMetallicRoughness:m,convertArrayBufferAlphaToGrayscale:y}=cy(),{loadImage:x}=uo(),{sizeMultiplier:b}=o0(),_=(0,J.useMemo)(()=>{var t;let[e,r]=null!=(t=s.size)?t:uh;return[e*b,r*b]},[s.size,b]),w=(0,J.useCallback)(async t=>{let e;p.current+=1;let r=t.toDataURL({format:"png",multiplier:1,top:d,left:d,width:_[0],height:_[1]});try{e=await m(r)}finally{p.current-=1}if(0===p.current){var i;u(null!=(i=s.file)?i:s.name,e,o)}},[_,d,u,m,s,o]);(0,J.useEffect)(()=>{if(h){let t=!1;return(async()=>{let e;try{e=await x(h)}catch(t){if(!1===s.hasDefault)return;e=await x(c)}let r=await y(e);t||g(r)})(),()=>{t=!0}}g(null)},[s,h,c,_,y,x]);let C="".concat(s.name,":metallic:").concat(o,":").concat(b);return _?(0,Q.jsx)(un,{canvasId:C,canvasType:"metallic",onChange:w,baseImageUrl:f,textureSize:_,defaultDrawingMode:!0},C):null}let{materials:uu}=cd.default;function ud(){let{actualModel:t}=hV(),e=uu[t];return(0,Q.jsx)(Q.Fragment,{children:e.map(e=>{var r;if(!e)return null;let i=0!==e.metallicFactor||1!==e.roughnessFactor,n=Array(null!=(r=e.frameCount)?r:1).fill(null);return(0,Q.jsxs)(J.default.Fragment,{children:[n.map((t,r)=>(0,Q.jsx)(ul,{materialDef:e,frameIndex:r},"color:".concat(r))),i?n.map((t,r)=>(0,Q.jsx)(uc,{materialDef:e,frameIndex:r},"metallic:".concat(r))):null]},"".concat(t,"-").concat(e.name))})})}var uf=J.createContext(void 0),ug=t=>{let{client:e,children:r}=t;return J.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Q.jsx)(uf.Provider,{value:e,children:r})};function up(t){let{children:e}=t,r=(t=>{let e=J.useContext(uf);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e})(),i=(0,J.useMemo)(()=>({loadImage:async t=>t.startsWith("data:")?(0,cb.imageUrlToArrayBuffer)(t):await r.fetchQuery({queryKey:[t]})}),[r]);return(0,Q.jsx)(us.Provider,{value:i,children:e})}function um(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function uv(t,e){var r=um(t,e,"get");return r.get?r.get.call(t):r.value}function uy(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function ux(t,e,r){uy(t,e),e.set(t,r)}function ub(t,e,r){var i=um(t,e,"set");if(i.set)i.set.call(t,r);else{if(!i.writable)throw TypeError("attempted to set read only private field");i.value=r}return r}function u_(t,e){var r=um(t,e,"update");if(r.set){if(!r.get)throw TypeError("attempted to read set only private field");return"__destrWrapper"in r||(r.__destrWrapper={set value(v){r.set.call(t,v)},get value(){return r.get.call(t)}}),r.__destrWrapper}if(!r.writable)throw TypeError("attempted to set read only private field");return r}var uw={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},uC=new(p=new WeakMap,m=new WeakMap,class{setTimeoutProvider(t){ub(this,p,t)}setTimeout(t,e){return uv(this,p).setTimeout(t,e)}clearTimeout(t){uv(this,p).clearTimeout(t)}setInterval(t,e){return uv(this,p).setInterval(t,e)}clearInterval(t){uv(this,p).clearInterval(t)}constructor(){ux(this,p,{writable:!0,value:uw}),ux(this,m,{writable:!0,value:!1})}}),uS="undefined"==typeof window||"Deno"in globalThis;function uT(){}function uO(t,e){return"function"==typeof t?t(e):t}function uk(t,e){let{type:r="all",exact:i,fetchStatus:n,predicate:s,queryKey:o,stale:a}=t;if(o){if(i){if(e.queryHash!==uE(o,e.options))return!1}else if(!uj(e.queryKey,o))return!1}if("all"!==r){let t=e.isActive();if("active"===r&&!t||"inactive"===r&&t)return!1}return("boolean"!=typeof a||e.isStale()===a)&&(!n||n===e.state.fetchStatus)&&(!s||!!s(e))}function uM(t,e){let{exact:r,status:i,predicate:n,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(uD(e.options.mutationKey)!==uD(s))return!1}else if(!uj(e.options.mutationKey,s))return!1}return(!i||e.state.status===i)&&(!n||!!n(e))}function uE(t,e){return((null==e?void 0:e.queryKeyHashFn)||uD)(t)}function uD(t){return JSON.stringify(t,(t,e)=>uF(e)?Object.keys(e).sort().reduce((t,r)=>(t[r]=e[r],t),{}):e)}function uj(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).every(r=>uj(t[r],e[r]))}var uA=Object.prototype.hasOwnProperty;function uP(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function uF(t){if(!uL(t))return!1;let e=t.constructor;if(void 0===e)return!0;let r=e.prototype;return!!uL(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype}function uL(t){return"[object Object]"===Object.prototype.toString.call(t)}function uR(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[...t,e];return r&&i.length>r?i.slice(1):i}function uI(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[e,...t];return r&&i.length>r?i.slice(0,-1):i}var uB=Symbol();function uN(t,e){return!t.queryFn&&(null==e?void 0:e.initialPromise)?()=>e.initialPromise:t.queryFn&&t.queryFn!==uB?t.queryFn:()=>Promise.reject(Error("Missing queryFn: '".concat(t.queryHash,"'")))}function uW(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}function uU(t,e){uy(t,e),e.add(t)}var uH=function(t){setTimeout(t,0)},uX=function(){let t=[],e=0,r=t=>{t()},i=t=>{t()},n=uH,s=i=>{e?t.push(i):n(()=>{r(i)})};return{batch:s=>{let o;e++;try{o=s()}finally{--e||(()=>{let e=t;t=[],e.length&&n(()=>{i(()=>{e.forEach(t=>{r(t)})})})})()}return o},batchCalls:t=>function(){for(var e=arguments.length,r=Array(e),i=0;i{t(...r)})},schedule:s,setNotifyFunction:t=>{r=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{n=t}}}(),uV=class{subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}},uY=new(y=new WeakMap,x=new WeakMap,b=new WeakMap,class extends uV{onSubscribe(){uv(this,x)||this.setEventListener(uv(this,b))}onUnsubscribe(){var t;this.hasListeners()||(null==(t=uv(this,x))||t.call(this),ub(this,x,void 0))}setEventListener(t){var e;ub(this,b,t),null==(e=uv(this,x))||e.call(this),ub(this,x,t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()}))}setFocused(t){uv(this,y)!==t&&(ub(this,y,t),this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){var t;return"boolean"==typeof uv(this,y)?uv(this,y):(null==(t=globalThis.document)?void 0:t.visibilityState)!=="hidden"}constructor(){super(),ux(this,y,{writable:!0,value:void 0}),ux(this,x,{writable:!0,value:void 0}),ux(this,b,{writable:!0,value:void 0}),ub(this,b,t=>{if(!uS&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}})}}),uz=new(_=new WeakMap,w=new WeakMap,C=new WeakMap,class extends uV{onSubscribe(){uv(this,w)||this.setEventListener(uv(this,C))}onUnsubscribe(){var t;this.hasListeners()||(null==(t=uv(this,w))||t.call(this),ub(this,w,void 0))}setEventListener(t){var e;ub(this,C,t),null==(e=uv(this,w))||e.call(this),ub(this,w,t(this.setOnline.bind(this)))}setOnline(t){uv(this,_)!==t&&(ub(this,_,t),this.listeners.forEach(e=>{e(t)}))}isOnline(){return uv(this,_)}constructor(){super(),ux(this,_,{writable:!0,value:!0}),ux(this,w,{writable:!0,value:void 0}),ux(this,C,{writable:!0,value:void 0}),ub(this,C,t=>{if(!uS&&window.addEventListener){let e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}})}});function uG(t){return Math.min(1e3*2**t,3e4)}function uq(t){return(null!=t?t:"online")!=="online"||uz.isOnline()}var uK=class extends Error{constructor(t){super("CancelledError"),this.revert=null==t?void 0:t.revert,this.silent=null==t?void 0:t.silent}};function uQ(t){let e,r=!1,i=0,n=function(){let t,e,r=new Promise((r,i)=>{t=r,e=i});function i(t){Object.assign(r,t),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},r.reject=t=>{i({status:"rejected",reason:t}),e(t)},r}(),s=()=>uY.isFocused()&&("always"===t.networkMode||uz.isOnline())&&t.canRun(),o=()=>uq(t.networkMode)&&t.canRun(),a=t=>{"pending"===n.status&&(null==e||e(),n.resolve(t))},l=t=>{"pending"===n.status&&(null==e||e(),n.reject(t))},h=()=>new Promise(r=>{var i;e=t=>{("pending"!==n.status||s())&&r(t)},null==(i=t.onPause)||i.call(t)}).then(()=>{if(e=void 0,"pending"===n.status){var r;null==(r=t.onContinue)||r.call(t)}}),c=()=>{let e;if("pending"!==n.status)return;let o=0===i?t.initialPromise:void 0;try{e=null!=o?o:t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(a).catch(e=>{var o,a,u;if("pending"!==n.status)return;let d=null!=(a=t.retry)?a:3*!uS,f=null!=(u=t.retryDelay)?u:uG,g="function"==typeof f?f(i,e):f,p=!0===d||"number"==typeof d&&i{uC.setTimeout(t,g)}).then(()=>s()?void 0:h()).then(()=>{r?l(e):c()})})};return{promise:n,status:()=>n.status,cancel:e=>{if("pending"===n.status){var r;let i=new uK(e);l(i),null==(r=t.onCancel)||r.call(t,i)}},continue:()=>(null==e||e(),n),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:o,start:()=>(o()?c():h().then(c),n)}}var uJ=(S=new WeakMap,class{destroy(){this.clearGcTimeout()}scheduleGc(){var t;this.clearGcTimeout(),"number"==typeof(t=this.gcTime)&&t>=0&&t!==1/0&&ub(this,S,uC.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,null!=t?t:uS?1/0:3e5)}clearGcTimeout(){uv(this,S)&&(uC.clearTimeout(uv(this,S)),ub(this,S,void 0))}constructor(){ux(this,S,{writable:!0,value:void 0})}}),uZ=(T=new WeakMap,O=new WeakMap,k=new WeakMap,M=new WeakMap,E=new WeakMap,D=new WeakMap,j=new WeakMap,A=new WeakSet,class extends uJ{get meta(){return this.options.meta}get promise(){var t;return null==(t=uv(this,E))?void 0:t.promise}setOptions(t){if(this.options={...uv(this,D),...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let t=u$(this.options);void 0!==t.data&&(this.setData(t.data,{updatedAt:t.dataUpdatedAt,manual:!0}),ub(this,T,t))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||uv(this,k).remove(this)}setData(t,e){var r,i;let n=(r=this.state.data,"function"==typeof(i=this.options).structuralSharing?i.structuralSharing(r,t):!1!==i.structuralSharing?function t(e,r){if(e===r)return e;let i=uP(e)&&uP(r);if(!i&&!(uF(e)&&uF(r)))return r;let n=(i?e:Object.keys(e)).length,s=i?r:Object.keys(r),o=s.length,a=i?Array(o):{},l=0;for(let h=0;h{var e;return!1!==(e=t.options.enabled,"function"==typeof e?e(this):e)})}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uB||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===uO(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!Math.max(this.state.dataUpdatedAt+(t||0)-Date.now(),0))}onFocus(){var t;let e=this.observers.find(t=>t.shouldFetchOnWindowFocus());null==e||e.refetch({cancelRefetch:!1}),null==(t=uv(this,E))||t.continue()}onOnline(){var t;let e=this.observers.find(t=>t.shouldFetchOnReconnect());null==e||e.refetch({cancelRefetch:!1}),null==(t=uv(this,E))||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),uv(this,k).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(uv(this,E)&&(uv(this,j)?uv(this,E).cancel({revert:!0}):uv(this,E).cancelRetry()),this.scheduleGc()),uv(this,k).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||uW(this,A,u0).call(this,{type:"invalidate"})}async fetch(t,e){var r,i,n,s,o,a,l,h,c,u,d,f;if("idle"!==this.state.fetchStatus&&(null==(r=uv(this,E))?void 0:r.status())!=="rejected"){if(void 0!==this.state.data&&(null==e?void 0:e.cancelRefetch))this.cancel({silent:!0});else if(uv(this,E))return uv(this,E).continueRetry(),uv(this,E).promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let g=new AbortController,p=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(ub(this,j,!0),g.signal)})},m=()=>{let t=uN(this.options,e),r=(()=>{let t={client:uv(this,M),queryKey:this.queryKey,meta:this.meta};return p(t),t})();return(ub(this,j,!1),this.options.persister)?this.options.persister(t,r,this):t(r)},y=(()=>{let t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:uv(this,M),state:this.state,fetchFn:m};return p(t),t})();null==(i=this.options.behavior)||i.onFetch(y,this),ub(this,O,this.state),("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=y.fetchOptions)?void 0:n.meta))&&uW(this,A,u0).call(this,{type:"fetch",meta:null==(s=y.fetchOptions)?void 0:s.meta}),ub(this,E,uQ({initialPromise:null==e?void 0:e.initialPromise,fn:y.fetchFn,onCancel:t=>{t instanceof uK&&t.revert&&this.setState({...uv(this,O),fetchStatus:"idle"}),g.abort()},onFail:(t,e)=>{uW(this,A,u0).call(this,{type:"failed",failureCount:t,error:e})},onPause:()=>{uW(this,A,u0).call(this,{type:"pause"})},onContinue:()=>{uW(this,A,u0).call(this,{type:"continue"})},retry:y.options.retry,retryDelay:y.options.retryDelay,networkMode:y.options.networkMode,canRun:()=>!0}));try{let t=await uv(this,E).start();if(void 0===t)throw Error("".concat(this.queryHash," data is undefined"));return this.setData(t),null==(o=(a=uv(this,k).config).onSuccess)||o.call(a,t,this),null==(l=(h=uv(this,k).config).onSettled)||l.call(h,t,this.state.error,this),t}catch(t){if(t instanceof uK){if(t.silent)return uv(this,E).promise;else if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw uW(this,A,u0).call(this,{type:"error",error:t}),null==(c=(u=uv(this,k).config).onError)||c.call(u,t,this),null==(d=(f=uv(this,k).config).onSettled)||d.call(f,this.state.data,t,this),t}finally{this.scheduleGc()}}constructor(t){var e;super(),uU(this,A),ux(this,T,{writable:!0,value:void 0}),ux(this,O,{writable:!0,value:void 0}),ux(this,k,{writable:!0,value:void 0}),ux(this,M,{writable:!0,value:void 0}),ux(this,E,{writable:!0,value:void 0}),ux(this,D,{writable:!0,value:void 0}),ux(this,j,{writable:!0,value:void 0}),ub(this,j,!1),ub(this,D,t.defaultOptions),this.setOptions(t.options),this.observers=[],ub(this,M,t.client),ub(this,k,uv(this,M).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ub(this,T,u$(this.options)),this.state=null!=(e=t.state)?e:uv(this,T),this.scheduleGc()}});function u$(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,r=void 0!==e,i=r?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?null!=i?i:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}function u0(t){let e=e=>{var r,i,n;switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...(n=e.data,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:uq(this.options.networkMode)?"fetching":"paused",...void 0===n&&{error:null,status:"pending"}}),fetchMeta:null!=(r=t.meta)?r:null};case"success":let s={...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:null!=(i=t.dataUpdatedAt)?i:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ub(this,O,t.manual?s:void 0),s;case"error":let o=t.error;return{...e,error:o,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}};this.state=e(this.state),uX.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),uv(this,k).notify({query:this,type:"updated",action:t})})}var u1=(P=new WeakMap,class extends uV{build(t,e,r){var i;let n=e.queryKey,s=null!=(i=e.queryHash)?i:uE(n,e),o=this.get(s);return o||(o=new uZ({client:t,queryKey:n,queryHash:s,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(n)}),this.add(o)),o}add(t){uv(this,P).has(t.queryHash)||(uv(this,P).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=uv(this,P).get(t.queryHash);e&&(t.destroy(),e===t&&uv(this,P).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){uX.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return uv(this,P).get(t)}getAll(){return[...uv(this,P).values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>uk(e,t))}findAll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAll();return Object.keys(t).length>0?e.filter(e=>uk(t,e)):e}notify(t){uX.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){uX.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){uX.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}constructor(t={}){super(),ux(this,P,{writable:!0,value:void 0}),this.config=t,ub(this,P,new Map)}}),u2=(F=new WeakMap,L=new WeakMap,R=new WeakMap,I=new WeakMap,B=new WeakSet,class extends uJ{setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){uv(this,L).includes(t)||(uv(this,L).push(t),this.clearGcTimeout(),uv(this,R).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ub(this,L,uv(this,L).filter(e=>e!==t)),this.scheduleGc(),uv(this,R).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){uv(this,L).length||("pending"===this.state.status?this.scheduleGc():uv(this,R).remove(this))}continue(){var t,e;return null!=(e=null==(t=uv(this,I))?void 0:t.continue())?e:this.execute(this.state.variables)}async execute(t){var e,r,i,n,s,o,a,l,h,c,u,d,f,g,p,m,y,x,b,_,w;let C=()=>{uW(this,B,u5).call(this,{type:"continue"})},S={client:uv(this,F),meta:this.options.meta,mutationKey:this.options.mutationKey};ub(this,I,uQ({fn:()=>this.options.mutationFn?this.options.mutationFn(t,S):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{uW(this,B,u5).call(this,{type:"failed",failureCount:t,error:e})},onPause:()=>{uW(this,B,u5).call(this,{type:"pause"})},onContinue:C,retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>uv(this,R).canRun(this)}));let T="pending"===this.state.status,O=!uv(this,I).canStart();try{if(T)C();else{uW(this,B,u5).call(this,{type:"pending",variables:t,isPaused:O}),await (null==(c=(u=uv(this,R).config).onMutate)?void 0:c.call(u,t,this,S));let e=await (null==(d=(f=this.options).onMutate)?void 0:d.call(f,t,S));e!==this.state.context&&uW(this,B,u5).call(this,{type:"pending",context:e,variables:t,isPaused:O})}let e=await uv(this,I).start();return await (null==(r=(i=uv(this,R).config).onSuccess)?void 0:r.call(i,e,t,this.state.context,this,S)),await (null==(n=(s=this.options).onSuccess)?void 0:n.call(s,e,t,this.state.context,S)),await (null==(o=(a=uv(this,R).config).onSettled)?void 0:o.call(a,e,null,this.state.variables,this.state.context,this,S)),await (null==(l=(h=this.options).onSettled)?void 0:l.call(h,e,null,t,this.state.context,S)),uW(this,B,u5).call(this,{type:"success",data:e}),e}catch(e){try{throw await (null==(g=(p=uv(this,R).config).onError)?void 0:g.call(p,e,t,this.state.context,this,S)),await (null==(m=(y=this.options).onError)?void 0:m.call(y,e,t,this.state.context,S)),await (null==(x=(b=uv(this,R).config).onSettled)?void 0:x.call(b,void 0,e,this.state.variables,this.state.context,this,S)),await (null==(_=(w=this.options).onSettled)?void 0:_.call(w,void 0,e,t,this.state.context,S)),e}finally{uW(this,B,u5).call(this,{type:"error",error:e})}}finally{uv(this,R).runNext(this)}}constructor(t){super(),uU(this,B),ux(this,F,{writable:!0,value:void 0}),ux(this,L,{writable:!0,value:void 0}),ux(this,R,{writable:!0,value:void 0}),ux(this,I,{writable:!0,value:void 0}),ub(this,F,t.client),this.mutationId=t.mutationId,ub(this,R,t.mutationCache),ub(this,L,[]),this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}});function u5(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),uX.batch(()=>{uv(this,L).forEach(e=>{e.onMutationUpdate(t)}),uv(this,R).notify({mutation:this,type:"updated",action:t})})}var u4=(N=new WeakMap,W=new WeakMap,U=new WeakMap,class extends uV{build(t,e,r){let i=new u2({client:t,mutationCache:this,mutationId:++u_(this,U).value,options:t.defaultMutationOptions(e),state:r});return this.add(i),i}add(t){uv(this,N).add(t);let e=u3(t);if("string"==typeof e){let r=uv(this,W).get(e);r?r.push(t):uv(this,W).set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(uv(this,N).delete(t)){let e=u3(t);if("string"==typeof e){let r=uv(this,W).get(e);if(r)if(r.length>1){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}else r[0]===t&&uv(this,W).delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){let e=u3(t);if("string"!=typeof e)return!0;{let r=uv(this,W).get(e),i=null==r?void 0:r.find(t=>"pending"===t.state.status);return!i||i===t}}runNext(t){let e=u3(t);if("string"!=typeof e)return Promise.resolve();{var r,i;let n=null==(r=uv(this,W).get(e))?void 0:r.find(e=>e!==t&&e.state.isPaused);return null!=(i=null==n?void 0:n.continue())?i:Promise.resolve()}}clear(){uX.batch(()=>{uv(this,N).forEach(t=>{this.notify({type:"removed",mutation:t})}),uv(this,N).clear(),uv(this,W).clear()})}getAll(){return Array.from(uv(this,N))}find(t){let e={exact:!0,...t};return this.getAll().find(t=>uM(e,t))}findAll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().filter(e=>uM(t,e))}notify(t){uX.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return uX.batch(()=>Promise.all(t.map(t=>t.continue().catch(uT))))}constructor(t={}){super(),ux(this,N,{writable:!0,value:void 0}),ux(this,W,{writable:!0,value:void 0}),ux(this,U,{writable:!0,value:void 0}),this.config=t,ub(this,N,new Set),ub(this,W,new Map),ub(this,U,0)}});function u3(t){var e;return null==(e=t.options.scope)?void 0:e.id}function u9(t){return{onFetch:(e,r)=>{var i,n,s,o,a;let l=e.options,h=null==(s=e.fetchOptions)||null==(n=s.meta)||null==(i=n.fetchMore)?void 0:i.direction,c=(null==(o=e.state.data)?void 0:o.pages)||[],u=(null==(a=e.state.data)?void 0:a.pageParams)||[],d={pages:[],pageParams:[]},f=0,g=async()=>{let r=!1,i=uN(e.options,e.fetchOptions),n=async(t,n,s)=>{if(r)return Promise.reject();if(null==n&&t.pages.length)return Promise.resolve(t);let o=(()=>{let t={client:e.client,queryKey:e.queryKey,pageParam:n,direction:s?"backward":"forward",meta:e.options.meta};return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?r=!0:e.signal.addEventListener("abort",()=>{r=!0}),e.signal)}),t})(),a=await i(o),{maxPages:l}=e.options,h=s?uI:uR;return{pages:h(t.pages,a,l),pageParams:h(t.pageParams,n,l)}};if(h&&c.length){let t="backward"===h,e={pages:c,pageParams:u},r=(t?function(t,e){var r;let{pages:i,pageParams:n}=e;return i.length>0?null==(r=t.getPreviousPageParam)?void 0:r.call(t,i[0],i,n[0],n):void 0}:u6)(l,e);d=await n(e,r,t)}else{let e=null!=t?t:c.length;do{var s;let t=0===f?null!=(s=u[0])?s:l.initialPageParam:u6(l,d);if(f>0&&null==t)break;d=await n(d,t),f++}while(f{var t,i;return null==(t=(i=e.options).persister)?void 0:t.call(i,g,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=g}}}function u6(t,e){let{pages:r,pageParams:i}=e,n=r.length-1;return r.length>0?t.getNextPageParam(r[n],r,i[n],i):void 0}let u8=new(H=new WeakMap,X=new WeakMap,V=new WeakMap,Y=new WeakMap,z=new WeakMap,G=new WeakMap,q=new WeakMap,K=new WeakMap,class{mount(){u_(this,G).value++,1===uv(this,G)&&(ub(this,q,uY.subscribe(async t=>{t&&(await this.resumePausedMutations(),uv(this,H).onFocus())})),ub(this,K,uz.subscribe(async t=>{t&&(await this.resumePausedMutations(),uv(this,H).onOnline())})))}unmount(){var t,e;u_(this,G).value--,0===uv(this,G)&&(null==(t=uv(this,q))||t.call(this),ub(this,q,void 0),null==(e=uv(this,K))||e.call(this),ub(this,K,void 0))}isFetching(t){return uv(this,H).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return uv(this,X).findAll({...t,status:"pending"}).length}getQueryData(t){var e;let r=this.defaultQueryOptions({queryKey:t});return null==(e=uv(this,H).get(r.queryHash))?void 0:e.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),r=uv(this,H).build(this,e),i=r.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(uO(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return uv(this,H).findAll(t).map(t=>{let{queryKey:e,state:r}=t;return[e,r.data]})}setQueryData(t,e,r){let i=this.defaultQueryOptions({queryKey:t}),n=uv(this,H).get(i.queryHash),s=null==n?void 0:n.state.data,o="function"==typeof e?e(s):e;if(void 0!==o)return uv(this,H).build(this,i).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return uX.batch(()=>uv(this,H).findAll(t).map(t=>{let{queryKey:i}=t;return[i,this.setQueryData(i,e,r)]}))}getQueryState(t){var e;let r=this.defaultQueryOptions({queryKey:t});return null==(e=uv(this,H).get(r.queryHash))?void 0:e.state}removeQueries(t){let e=uv(this,H);uX.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let r=uv(this,H);return uX.batch(()=>(r.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={revert:!0,...e};return Promise.all(uX.batch(()=>uv(this,H).findAll(t).map(t=>t.cancel(r)))).then(uT).catch(uT)}invalidateQueries(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return uX.batch(()=>{var r,i;return(uv(this,H).findAll(t).forEach(t=>{t.invalidate()}),(null==t?void 0:t.refetchType)==="none")?Promise.resolve():this.refetchQueries({...t,type:null!=(i=null!=(r=null==t?void 0:t.refetchType)?r:null==t?void 0:t.type)?i:"active"},e)})}refetchQueries(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={...r,cancelRefetch:null==(e=r.cancelRefetch)||e};return Promise.all(uX.batch(()=>uv(this,H).findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,i);return i.throwOnError||(e=e.catch(uT)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(uT)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let r=uv(this,H).build(this,e);return r.isStaleByTime(uO(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(uT).catch(uT)}fetchInfiniteQuery(t){return t.behavior=u9(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(uT).catch(uT)}ensureInfiniteQueryData(t){return t.behavior=u9(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return uz.isOnline()?uv(this,X).resumePausedMutations():Promise.resolve()}getQueryCache(){return uv(this,H)}getMutationCache(){return uv(this,X)}getDefaultOptions(){return uv(this,V)}setDefaultOptions(t){ub(this,V,t)}setQueryDefaults(t,e){uv(this,Y).set(uD(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...uv(this,Y).values()],r={};return e.forEach(e=>{uj(t,e.queryKey)&&Object.assign(r,e.defaultOptions)}),r}setMutationDefaults(t,e){uv(this,z).set(uD(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...uv(this,z).values()],r={};return e.forEach(e=>{uj(t,e.mutationKey)&&Object.assign(r,e.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;let e={...uv(this,V).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=uE(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===uB&&(e.enabled=!1),e}defaultMutationOptions(t){return(null==t?void 0:t._defaulted)?t:{...uv(this,V).mutations,...(null==t?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){uv(this,H).clear(),uv(this,X).clear()}constructor(t={}){ux(this,H,{writable:!0,value:void 0}),ux(this,X,{writable:!0,value:void 0}),ux(this,V,{writable:!0,value:void 0}),ux(this,Y,{writable:!0,value:void 0}),ux(this,z,{writable:!0,value:void 0}),ux(this,G,{writable:!0,value:void 0}),ux(this,q,{writable:!0,value:void 0}),ux(this,K,{writable:!0,value:void 0}),ub(this,H,t.queryCache||new u1),ub(this,X,t.mutationCache||new u4),ub(this,V,t.defaultOptions||{}),ub(this,Y,new Map),ub(this,z,new Map),ub(this,G,0)}})({defaultOptions:{queries:{queryFn:async function(t){let{queryKey:e}=t,[r]=e;return(0,cb.imageUrlToArrayBuffer)(r)},staleTime:1/0,gcTime:6e4,refetchOnWindowFocus:!1,refetchOnReconnect:!1}}});function u7(){return(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(ug,{client:u8,children:(0,Q.jsx)("main",{children:(0,Q.jsx)(up,{children:(0,Q.jsx)(J.Suspense,{children:(0,Q.jsx)(cV,{children:(0,Q.jsx)(ut,{children:(0,Q.jsxs)(ue,{children:[(0,Q.jsxs)("div",{className:"Viewport",children:[(0,Q.jsxs)("div",{className:"ModelTools",children:[(0,Q.jsx)("div",{className:"Field",children:(0,Q.jsx)(c4,{})}),(0,Q.jsx)("div",{className:"Field SliderField",children:(0,Q.jsx)(c3,{})}),(0,Q.jsx)("div",{className:"Field",children:(0,Q.jsx)(c7,{})})]}),(0,Q.jsx)(c5,{})]}),(0,Q.jsx)(cT,{children:(0,Q.jsx)(cC,{children:(0,Q.jsxs)(cO,{children:[(0,Q.jsx)(cL,{}),(0,Q.jsxs)("div",{className:"CanvasViewport",children:[(0,Q.jsxs)("div",{className:"CanvasSelector",children:[(0,Q.jsx)(ck,{}),(0,Q.jsx)(ui,{})]}),(0,Q.jsx)(cS,{}),(0,Q.jsx)(ud,{})]}),(0,Q.jsx)(cg,{}),(0,Q.jsx)(cp,{})]})})})]})})})})})})})})}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/5f9470a691b55cfe.js b/docs/_next/static/chunks/fce06ff30e9ff4bb.js similarity index 96% rename from docs/_next/static/chunks/5f9470a691b55cfe.js rename to docs/_next/static/chunks/fce06ff30e9ff4bb.js index a5018ef..1eb4d1a 100644 --- a/docs/_next/static/chunks/5f9470a691b55cfe.js +++ b/docs/_next/static/chunks/fce06ff30e9ff4bb.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,40141,e=>{"use strict";e.s(["GenIcon",()=>o],40141);var t=e.i(71645),a={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},r=t.default.createContext&&t.default.createContext(a),c=["attr","size","title"];function n(){return(n=Object.assign.bind()).apply(this,arguments)}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,r)}return a}function i(e){for(var t=1;tt.default.createElement(s,n({attr:i({},e.attr)},a),function e(a){return a&&a.map((a,r)=>t.default.createElement(a.tag,i({key:r},a.attr),e(a.child)))}(e.child))}function s(e){var l=a=>{var r,{attr:l,size:o,title:s}=e,u=function(e,t){if(null==e)return{};var a,r,c=function(e,t){if(null==e)return{};var a={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;a[r]=e[r]}return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}(e,c),h=o||a.size||"1em";return a.className&&(r=a.className),e.className&&(r=(r?r+" ":"")+e.className),t.default.createElement("svg",n({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,l,u,{className:r,style:i(i({color:e.color||a.color},a.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),s&&t.default.createElement("title",null,s),e.children)};return void 0!==r?t.default.createElement(r.Consumer,null,e=>l(e)):l(a)}},11152,e=>{"use strict";e.s(["FaAngleDown",()=>r,"FaArrowDown",()=>c,"FaArrowUp",()=>n,"FaChevronLeft",()=>l,"FaChevronRight",()=>i,"FaDownload",()=>o,"FaFolderOpen",()=>s,"FaGithub",()=>a,"FaLock",()=>u,"FaSearch",()=>h,"FaTimes",()=>m,"FaTrashAlt",()=>v,"FaUnlock",()=>d]);var t=e.i(40141);function a(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"},child:[]}]})(e)}function c(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"},child:[]}]})(e)}function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"},child:[]}]})(e)}function l(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"},child:[]}]})(e)}function o(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},child:[]}]})(e)}function s(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"},child:[]}]})(e)}function u(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"},child:[]}]})(e)}function h(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},child:[]}]})(e)}function m(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function v(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"},child:[]}]})(e)}function d(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}},20592,e=>{"use strict";e.s(["default",()=>t]);let t=e.i(29947).default},90106,e=>{"use strict";e.s(["BsBadge3dFill",()=>r,"BsFillGrid3X3GapFill",()=>a]);var t=e.i(40141);function a(e){return(0,t.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M10.157 5.968h-.844v4.06h.844c1.116 0 1.621-.667 1.621-2.02 0-1.354-.51-2.04-1.621-2.04"},child:[]},{tag:"path",attr:{d:"M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm5.184 4.368c.646 0 1.055.378 1.06.9.008.537-.427.919-1.086.919-.598-.004-1.037-.325-1.068-.756H3c.03.914.791 1.688 2.153 1.688 1.24 0 2.285-.66 2.272-1.798-.013-.953-.747-1.38-1.292-1.432v-.062c.44-.07 1.125-.527 1.108-1.375-.013-.906-.8-1.57-2.053-1.565-1.31.005-2.043.734-2.074 1.67h1.103c.022-.391.383-.751.936-.751.532 0 .928.33.928.813.004.479-.383.835-.928.835h-.632v.914zM8.126 11h2.189C12.125 11 13 9.893 13 7.985c0-1.894-.861-2.984-2.685-2.984H8.126z"},child:[]}]})(e)}},53653,e=>{"use strict";let t;e.s(["importMultipleFilesToModels",()=>u,"modelToModelType",()=>l,"modelTypes",()=>n]);var a=e.i(71315);let r=e.i(20592).default.materials,c=/^(\.|__MACOSX)/,n={player:["lmale","mmale","hmale","lfemale","mfemale","hfemale","lbioderm","mbioderm","hbioderm"],weapon:["disc","chaingun","grenade_launcher","sniper","plasmathrower","energy","shocklance","elf","missile","mortar","repair","targeting","mine"],vehicle:["vehicle_grav_scout","vehicle_grav_tank","vehicle_land_mpbbase","vehicle_air_scout","vehicle_air_bomber","vehicle_air_hapc"]};function l(e){switch(e){case"lmale":case"mmale":case"hmale":case"lfemale":case"mfemale":case"hfemale":case"lbioderm":case"mbioderm":case"hbioderm":return"player";case"disc":case"chaingun":case"grenade_launcher":case"sniper":case"plasmathrower":case"energy":case"shocklance":case"elf":case"missile":case"mortar":case"repair":case"targeting":case"mine":return"weapon";case"vehicle_grav_scout":case"vehicle_grav_tank":case"vehicle_land_mpbbase":case"vehicle_air_scout":case"vehicle_air_bomber":case"vehicle_air_hapc":return"vehicle";default:throw Error("Unknown model")}}async function i(e){let t=await a.default.loadAsync(e);return(await Promise.all(Object.entries(t.files).map(async e=>{let[t,a]=e;if(!c.test(t)&&/\.png$/i.exec(t)){let e=await a.async("base64");return{path:t,imageUrl:"data:image/png;base64,".concat(e)}}}))).filter(e=>!!e)}async function o(e){return new Promise((t,a)=>{let r=new FileReader;r.addEventListener("load",e=>{var r;"string"==typeof(null==(r=e.target)?void 0:r.result)?t(e.target.result):a()}),r.addEventListener("error",e=>{a()}),r.readAsDataURL(e)})}async function s(e){return(await Promise.all(Array.from(e).map(async e=>{var t;if(c.test(e.name))return null;switch((t=e).name.match(/\.png$/i)?"png":t.name.match(/\.zip$/i)?"zip":t.name.match(/\.vl2$/i)?"vl2":void 0){case"zip":case"vl2":{let t=e.name.match(/^(.+)\.(zip|vl2)$/i),a=t?t[1]:e.name;return(await i(e)).map(t=>({...t,path:"".concat(e.name,"/").concat(t.path),name:a}))}case"png":return{path:e.name,imageUrl:await o(e),name:null};default:return null}}))).flat().filter(e=>!!e)}async function u(e){var a=await s(e);let c=new Map;return a.forEach(e=>{let a=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t||(t=function(){let e=new Map;for(let t in r)r[t].forEach((a,r)=>{let c;if(a.fileSuffix?c=a.fileSuffix:!1!==a.selectable&&!0!==a.hidden&&(a.file||a.name)&&(c=a.file||a.name),c){var n;let l=null!=(n=e.get(c))?n:[];l.push({modelName:t,material:a,index:r}),e.set(c,l)}});return e}());let c=e.split("/").slice(-1)[0],n=c.match(/^(.+)\.(PNG|png)$/);if(n){let r=n[1],l=r.split(".");if(l.length>1){let a=".".concat(l[l.length-1]),i=t.get(a);if(i)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:l.slice(0,l.length-1).join("."),models:i}}else{let i=function(e){let a=/^(.+[^\d])(\d{2,})$/.exec(e);if(a){var r;let e=a[1],c=a[2],n=parseInt(c,10),l="".concat(e).concat("0".padStart(c.length,"0"));return(null!=(r=t.get(l))?r:[]).filter(e=>"number"==typeof e.material.frameCount).map(e=>({...e,frameIndex:n}))}return[]}(l[0]);if(i.length)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:a,models:i};{let i=t.get(l[0]);if(i)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:a,models:i}}}}return null}(e.path,e.name);a&&a.models.forEach(t=>{var r,n,l,i,o;let s=null!=(r=c.get(t.modelName))?r:new Map,u=null!=(n=s.get(a.skinName))?n:{name:a.skinName,isComplete:null,materials:new Map},h=null!=(l=t.material.file)?l:t.material.name,m=null!=(i=u.materials.get(h))?i:[];m[null!=(o=t.frameIndex)?o:0]=e.imageUrl,u.materials.set(h,m),s.set(a.skinName,u),c.set(t.modelName,s)})}),c.forEach((e,t)=>{let a=r[t].filter(e=>!1!==e.selectable&&!0!==e.hidden&&!0!==e.optional);e.forEach(e=>{e.isComplete=a.every(t=>{var a;return e.materials.has(null!=(a=t.file)?a:t.name)})})}),c}},15768,e=>{"use strict";e.s(["default",()=>r]);var t=e.i(71645);let a={customSkins:{},newSkins:{},packs:{},sizeMultiplier:{}};function r(){let[e,r]=(0,t.useState)(a);(0,t.useEffect)(()=>{let e=new AbortController,t=e.signal,a=!1;return(async()=>{let e;try{if(e=await fetch("".concat("https://exogen.github.io/t2-skins","/skins.json"),{signal:t}),!a){let t=await e.json();a||r(t)}}catch(e){console.error(e)}})(),()=>{a=!0,e.signal.aborted||e.abort()}},[]);let c=e!==a;return[e,c]}}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,40141,e=>{"use strict";e.s(["GenIcon",()=>o],40141);var t=e.i(71645),a={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},r=t.default.createContext&&t.default.createContext(a),c=["attr","size","title"];function n(){return(n=Object.assign.bind()).apply(this,arguments)}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,r)}return a}function i(e){for(var t=1;tt.default.createElement(s,n({attr:i({},e.attr)},a),function e(a){return a&&a.map((a,r)=>t.default.createElement(a.tag,i({key:r},a.attr),e(a.child)))}(e.child))}function s(e){var l=a=>{var r,{attr:l,size:o,title:s}=e,u=function(e,t){if(null==e)return{};var a,r,c=function(e,t){if(null==e)return{};var a={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;a[r]=e[r]}return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}(e,c),h=o||a.size||"1em";return a.className&&(r=a.className),e.className&&(r=(r?r+" ":"")+e.className),t.default.createElement("svg",n({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,l,u,{className:r,style:i(i({color:e.color||a.color},a.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),s&&t.default.createElement("title",null,s),e.children)};return void 0!==r?t.default.createElement(r.Consumer,null,e=>l(e)):l(a)}},11152,e=>{"use strict";e.s(["FaAngleDown",()=>r,"FaArrowDown",()=>c,"FaArrowUp",()=>n,"FaChevronLeft",()=>l,"FaChevronRight",()=>i,"FaDownload",()=>o,"FaFolderOpen",()=>s,"FaGithub",()=>a,"FaLock",()=>u,"FaSearch",()=>h,"FaTimes",()=>m,"FaTrashAlt",()=>v,"FaUnlock",()=>d]);var t=e.i(40141);function a(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"},child:[]}]})(e)}function c(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"},child:[]}]})(e)}function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"},child:[]}]})(e)}function l(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"},child:[]}]})(e)}function o(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},child:[]}]})(e)}function s(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"},child:[]}]})(e)}function u(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"},child:[]}]})(e)}function h(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},child:[]}]})(e)}function m(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function v(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"},child:[]}]})(e)}function d(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}},20592,e=>{"use strict";e.s(["default",()=>t]);let t=e.i(29947).default},90106,e=>{"use strict";e.s(["BsBadge3dFill",()=>r,"BsFillGrid3X3GapFill",()=>a]);var t=e.i(40141);function a(e){return(0,t.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M10.157 5.968h-.844v4.06h.844c1.116 0 1.621-.667 1.621-2.02 0-1.354-.51-2.04-1.621-2.04"},child:[]},{tag:"path",attr:{d:"M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm5.184 4.368c.646 0 1.055.378 1.06.9.008.537-.427.919-1.086.919-.598-.004-1.037-.325-1.068-.756H3c.03.914.791 1.688 2.153 1.688 1.24 0 2.285-.66 2.272-1.798-.013-.953-.747-1.38-1.292-1.432v-.062c.44-.07 1.125-.527 1.108-1.375-.013-.906-.8-1.57-2.053-1.565-1.31.005-2.043.734-2.074 1.67h1.103c.022-.391.383-.751.936-.751.532 0 .928.33.928.813.004.479-.383.835-.928.835h-.632v.914zM8.126 11h2.189C12.125 11 13 9.893 13 7.985c0-1.894-.861-2.984-2.685-2.984H8.126z"},child:[]}]})(e)}},53653,e=>{"use strict";let t;e.s(["importMultipleFilesToModels",()=>u,"modelToModelType",()=>l,"modelTypes",()=>n]);var a=e.i(71315);let r=e.i(20592).default.materials,c=/^(\.|__MACOSX)/,n={player:["lmale","mmale","hmale","lfemale","mfemale","hfemale","lbioderm","mbioderm","hbioderm"],weapon:["disc","chaingun","grenade_launcher","sniper","plasmathrower","energy","shocklance","elf","missile","mortar","repair","targeting","mine"],vehicle:["vehicle_grav_scout","vehicle_grav_tank","vehicle_land_mpbbase","vehicle_air_scout","vehicle_air_bomber","vehicle_air_hapc"]};function l(e){switch(e){case"lmale":case"mmale":case"hmale":case"lfemale":case"mfemale":case"hfemale":case"lbioderm":case"mbioderm":case"hbioderm":return"player";case"disc":case"chaingun":case"grenade_launcher":case"sniper":case"plasmathrower":case"energy":case"shocklance":case"elf":case"missile":case"mortar":case"repair":case"targeting":case"mine":return"weapon";case"vehicle_grav_scout":case"vehicle_grav_tank":case"vehicle_land_mpbbase":case"vehicle_air_scout":case"vehicle_air_bomber":case"vehicle_air_hapc":return"vehicle";default:throw Error("Unknown model")}}async function i(e){let t=await a.default.loadAsync(e);return(await Promise.all(Object.entries(t.files).map(async e=>{let[t,a]=e;if(!c.test(t)&&/\.png$/i.exec(t)){let e=await a.async("base64");return{path:t,imageUrl:"data:image/png;base64,".concat(e)}}}))).filter(e=>!!e)}async function o(e){return new Promise((t,a)=>{let r=new FileReader;r.addEventListener("load",e=>{var r;"string"==typeof(null==(r=e.target)?void 0:r.result)?t(e.target.result):a()}),r.addEventListener("error",e=>{a()}),r.readAsDataURL(e)})}async function s(e){return(await Promise.all(Array.from(e).map(async e=>{var t;if(c.test(e.name))return null;switch((t=e).name.match(/\.png$/i)?"png":t.name.match(/\.zip$/i)?"zip":t.name.match(/\.vl2$/i)?"vl2":void 0){case"zip":case"vl2":{let t=e.name.match(/^(.+)\.(zip|vl2)$/i),a=t?t[1]:e.name;return(await i(e)).map(t=>({...t,path:"".concat(e.name,"/").concat(t.path),name:a}))}case"png":return{path:e.name,imageUrl:await o(e),name:null};default:return null}}))).flat().filter(e=>!!e)}async function u(e){var a=await s(e);let c=new Map;return a.forEach(e=>{let a=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t||(t=function(){let e=new Map;for(let t in r)r[t].forEach((a,r)=>{let c;if(a.fileSuffix?c=a.fileSuffix:!1!==a.selectable&&!0!==a.hidden&&(a.file||a.name)&&(c=a.file||a.name),c){var n;let l=null!=(n=e.get(c))?n:[];l.push({modelName:t,material:a,index:r}),e.set(c,l)}});return e}());let c=e.split("/").slice(-1)[0],n=c.match(/^(.+)\.(PNG|png)$/);if(n){let r=n[1],l=r.split(".");if(l.length>1){let a=".".concat(l[l.length-1]),i=t.get(a);if(i)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:l.slice(0,l.length-1).join("."),models:i}}else{let i=function(e){let a=/^(.+[^\d])(\d{2,})$/.exec(e);if(a){var r;let e=a[1],c=a[2],n=parseInt(c,10),l="".concat(e).concat("0".padStart(c.length,"0"));return(null!=(r=t.get(l))?r:[]).filter(e=>"number"==typeof e.material.frameCount).map(e=>({...e,frameIndex:n}))}return[]}(l[0]);if(i.length)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:a,models:i};{let i=t.get(l[0]);if(i)return{path:e,basename:c,nameWithoutExtension:r,extension:n[2],skinName:a,models:i}}}}return null}(e.path,e.name);a&&a.models.forEach(t=>{var r,n,l,i,o;let s=null!=(r=c.get(t.modelName))?r:new Map,u=null!=(n=s.get(a.skinName))?n:{name:a.skinName,isComplete:null,materials:new Map},h=null!=(l=t.material.file)?l:t.material.name,m=null!=(i=u.materials.get(h))?i:[];m[null!=(o=t.frameIndex)?o:0]=e.imageUrl,u.materials.set(h,m),s.set(a.skinName,u),c.set(t.modelName,s)})}),c.forEach((e,t)=>{let a=r[t].filter(e=>!1!==e.selectable&&!0!==e.hidden&&!0!==e.optional);e.forEach(e=>{e.isComplete=a.every(t=>{var a;return e.materials.has(null!=(a=t.file)?a:t.name)})})}),c}},15768,e=>{"use strict";e.s(["default",()=>c]);var t=e.i(71645),a=e.i(96165);let r={customSkins:{},newSkins:{},packs:{},sizeMultiplier:{}};function c(){let[e,c]=(0,t.useState)(r);(0,t.useEffect)(()=>{let e=new AbortController,t=e.signal,r=!1;return(async()=>{let e;try{if(e=await fetch(a.SKIN_MANIFEST_URL,{signal:t}),!r){let t=await e.json();r||c(t)}}catch(e){console.error(e)}})(),()=>{r=!0,e.signal.aborted||e.abort()}},[]);let n=e!==r;return[e,n]}}]); \ No newline at end of file diff --git a/docs/gallery/index.html b/docs/gallery/index.html index 69b7544..4ef0496 100644 --- a/docs/gallery/index.html +++ b/docs/gallery/index.html @@ -1 +1 @@ -T2 Model Viewer & Skinner \ No newline at end of file +T2 Model Viewer & Skinner \ No newline at end of file diff --git a/docs/gallery/index.txt b/docs/gallery/index.txt index 8338f86..e26c1ea 100644 --- a/docs/gallery/index.txt +++ b/docs/gallery/index.txt @@ -3,7 +3,7 @@ 3:I[39756,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"default"] 4:I[37457,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"default"] 5:I[47257,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"ClientPageRoot"] -6:I[25500,["/t2-model-skinner/_next/static/chunks/993ba35625024c1a.js","/t2-model-skinner/_next/static/chunks/a0f1f445ab9525e3.js","/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","/t2-model-skinner/_next/static/chunks/d9f21d966613a96e.js","/t2-model-skinner/_next/static/chunks/40cecef8385b39df.js"],"default"] +6:I[25500,["/t2-model-skinner/_next/static/chunks/993ba35625024c1a.js","/t2-model-skinner/_next/static/chunks/d0ff1d6ce0fd9297.js","/t2-model-skinner/_next/static/chunks/2a02daea7eb2756c.js","/t2-model-skinner/_next/static/chunks/4cde5a883a99f9c9.js","/t2-model-skinner/_next/static/chunks/c8d20bf4c6d52266.js"],"default"] 9:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"OutletBoundary"] b:I[11533,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"AsyncMetadataOutlet"] d:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"ViewportBoundary"] @@ -12,7 +12,7 @@ f:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-mode 12:I[68027,["/t2-model-skinner/_next/static/chunks/993ba35625024c1a.js"],"default"] :HL["/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","style"] :HL["/t2-model-skinner/_next/static/chunks/42cdb402ed9b36c5.css","style"] -0:{"P":null,"b":"kzYjkQr65mRpo7Nh2-DI8","p":"/t2-model-skinner","c":["","gallery",""],"i":false,"f":[[["",{"children":["gallery",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/993ba35625024c1a.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":["gallery",["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","searchParams":{},"params":{},"promises":["$@7","$@8"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/42cdb402ed9b36c5.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/a0f1f445ab9525e3.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/d9f21d966613a96e.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-model-skinner/_next/static/chunks/40cecef8385b39df.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$La",["$","$Lb",null,{"promise":"$@c"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Ld",null,{"children":"$Le"}],null],["$","$Lf",null,{"children":["$","div",null,{"hidden":true,"children":["$","$10",null,{"fallback":null,"children":"$L11"}]}]}]]}],false]],"m":"$undefined","G":["$12",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} +0:{"P":null,"b":"Ip_GuyV0-9tYYuXg6C6XE","p":"/t2-model-skinner","c":["","gallery",""],"i":false,"f":[[["",{"children":["gallery",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/993ba35625024c1a.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":["gallery",["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","searchParams":{},"params":{},"promises":["$@7","$@8"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/42cdb402ed9b36c5.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/d0ff1d6ce0fd9297.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/2a02daea7eb2756c.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/4cde5a883a99f9c9.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-model-skinner/_next/static/chunks/c8d20bf4c6d52266.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$La",["$","$Lb",null,{"promise":"$@c"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Ld",null,{"children":"$Le"}],null],["$","$Lf",null,{"children":["$","div",null,{"hidden":true,"children":["$","$10",null,{"fallback":null,"children":"$L11"}]}]}]]}],false]],"m":"$undefined","G":["$12",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} 7:{} 8:"$0:f:0:1:2:children:2:children:1:props:children:0:props:params" e:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/docs/index.html b/docs/index.html index 213115f..0c00666 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -T2 Model Viewer & Skinner
\ No newline at end of file +T2 Model Viewer & Skinner
\ No newline at end of file diff --git a/docs/index.txt b/docs/index.txt index 014490c..9466a11 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -3,7 +3,7 @@ 3:I[39756,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"default"] 4:I[37457,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"default"] 5:I[47257,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"ClientPageRoot"] -6:I[52683,["/t2-model-skinner/_next/static/chunks/993ba35625024c1a.js","/t2-model-skinner/_next/static/chunks/3eaa877b756003b3.js","/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","/t2-model-skinner/_next/static/chunks/43ceca71888c9b70.js","/t2-model-skinner/_next/static/chunks/5f9470a691b55cfe.js","/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js"],"default"] +6:I[52683,["/t2-model-skinner/_next/static/chunks/993ba35625024c1a.js","/t2-model-skinner/_next/static/chunks/0baa0c6f20549fef.js","/t2-model-skinner/_next/static/chunks/8b82d6c1705317af.js","/t2-model-skinner/_next/static/chunks/f66959b00ac693d8.js","/t2-model-skinner/_next/static/chunks/fce06ff30e9ff4bb.js","/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js"],"default"] 9:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"OutletBoundary"] b:I[11533,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"AsyncMetadataOutlet"] d:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"ViewportBoundary"] @@ -12,7 +12,7 @@ f:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-mode 12:I[68027,["/t2-model-skinner/_next/static/chunks/993ba35625024c1a.js"],"default"] :HL["/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","style"] :HL["/t2-model-skinner/_next/static/chunks/df18f9fdc6a3cb7c.css","style"] -0:{"P":null,"b":"kzYjkQr65mRpo7Nh2-DI8","p":"/t2-model-skinner","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/993ba35625024c1a.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","searchParams":{},"params":{},"promises":["$@7","$@8"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/df18f9fdc6a3cb7c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/3eaa877b756003b3.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/43ceca71888c9b70.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-model-skinner/_next/static/chunks/5f9470a691b55cfe.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$La",["$","$Lb",null,{"promise":"$@c"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Ld",null,{"children":"$Le"}],null],["$","$Lf",null,{"children":["$","div",null,{"hidden":true,"children":["$","$10",null,{"fallback":null,"children":"$L11"}]}]}]]}],false]],"m":"$undefined","G":["$12",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} +0:{"P":null,"b":"Ip_GuyV0-9tYYuXg6C6XE","p":"/t2-model-skinner","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/993ba35625024c1a.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","searchParams":{},"params":{},"promises":["$@7","$@8"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/df18f9fdc6a3cb7c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/0baa0c6f20549fef.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/8b82d6c1705317af.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/f66959b00ac693d8.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-model-skinner/_next/static/chunks/fce06ff30e9ff4bb.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$La",["$","$Lb",null,{"promise":"$@c"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Ld",null,{"children":"$Le"}],null],["$","$Lf",null,{"children":["$","div",null,{"hidden":true,"children":["$","$10",null,{"fallback":null,"children":"$L11"}]}]}]]}],false]],"m":"$undefined","G":["$12",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} 7:{} 8:"$0:f:0:1:2:children:1:props:children:0:props:params" e:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/src/WarriorProvider.tsx b/src/WarriorProvider.tsx index afee84f..df5405d 100644 --- a/src/WarriorProvider.tsx +++ b/src/WarriorProvider.tsx @@ -5,9 +5,9 @@ import { WarriorContext } from "./useWarrior"; import type { MaterialDefinition } from "./models"; import type { Skin } from "./importUtils"; import modelConfig from "./models"; +import { SKIN_ASSET_BASE_URL } from "./deployPaths"; const { materials, modelDefaults, defaultSkins } = modelConfig; -const baseSkinPath = `https://exogen.github.io/t2-skins/skins`; let IMPORTED_SKINS: Map> = new Map(); @@ -121,7 +121,7 @@ export function getSkinImageUrls({ }; case "custom": return { - base: [`${baseSkinPath}/${selectedSkin}.${actualModel}.png`], + base: [`${SKIN_ASSET_BASE_URL}/${selectedSkin}.${actualModel}.png`], }; } break; @@ -130,7 +130,7 @@ export function getSkinImageUrls({ return materialDefs.reduce( ( skinImageUrls: Record, - materialDef: MaterialDefinition + materialDef: MaterialDefinition, ) => { if (materialDef) { const frameCount = materialDef.frameCount ?? 1; @@ -140,7 +140,7 @@ export function getSkinImageUrls({ skinImageUrls[materialDef.file ?? materialDef.name] = getFrameNames( materialDef.file ?? materialDef.name, - frameCount + frameCount, ).map((name) => `${basePath}/textures/${name}.png`); } break; @@ -148,16 +148,17 @@ export function getSkinImageUrls({ skinImageUrls[materialDef.file ?? materialDef.name] = getFrameNames( materialDef.file ?? materialDef.name, - frameCount + frameCount, ).map( - (name) => `${baseSkinPath}/${selectedSkin}/${name}.png` + (name) => + `${SKIN_ASSET_BASE_URL}/${selectedSkin}/${name}.png`, ); break; } } return skinImageUrls; }, - {} + {}, ); } return {}; @@ -166,7 +167,7 @@ export function getSkinImageUrls({ function getModelUrl( basePath: string, actualModel: string, - selectedAnimation: string | null + selectedAnimation: string | null, ) { switch (actualModel) { default: @@ -185,13 +186,13 @@ export default function WarriorProvider({ children }: { children: ReactNode }) { const [selectedModel, setSelectedModel] = useState("lmale"); const [selectedModelType, setSelectedModelType] = useState("player"); const [selectedSkin, setSelectedSkin] = useState( - "Blood Eagle" + "Blood Eagle", ); const [selectedSkinType, setSelectedSkinType] = useState( - "default" + "default", ); const [selectedAnimation, setSelectedAnimation] = useState( - null + null, ); const [animationPaused, setAnimationPaused] = useState(false); const [slowModeEnabled, setSlowModeEnabled] = useState(false); @@ -200,7 +201,7 @@ export default function WarriorProvider({ children }: { children: ReactNode }) { const selectedModelUrl = getModelUrl( basePath, actualModel, - selectedAnimation + selectedAnimation, ); const [importedSkins, setImportedSkins] = useState(IMPORTED_SKINS); @@ -217,7 +218,7 @@ export default function WarriorProvider({ children }: { children: ReactNode }) { selectedModelType, selectedSkin, selectedSkinType, - }) + }), ); const defaultSkinImageUrls = useMemo( @@ -229,7 +230,7 @@ export default function WarriorProvider({ children }: { children: ReactNode }) { selectedSkin: modelDefaults[actualModel], selectedSkinType: "default", }), - [actualModel, basePath, selectedModelType] + [actualModel, basePath, selectedModelType], ); const context = useMemo(() => { diff --git a/src/app/gallery/page.tsx b/src/app/gallery/page.tsx index 8e5d44f..1b9bdb7 100644 --- a/src/app/gallery/page.tsx +++ b/src/app/gallery/page.tsx @@ -20,8 +20,8 @@ import styles from "./gallery.module.css"; import { collectFiles, createZipFile, saveZipFile } from "../../exportUtils"; import { modelToModelType, modelTypes } from "../../importUtils"; import modelConfig from "../../models"; +import { SKIN_GALLERY_BASE_URL } from "../../deployPaths"; -const baseManifestPath = `https://exogen.github.io/t2-skins`; const emptySkins: string[] = []; function modelToFileList(modelName: string) { @@ -93,7 +93,7 @@ const modelOrder: Record = { }; function skinDataToList( - skinData: Record + skinData: Record, ): Array<{ name: string; model: string }> { const allSkins: Array<{ name: string; model: string }> = []; @@ -104,7 +104,7 @@ function skinDataToList( return orderBy( allSkins, [(skin) => skin.name.toLowerCase(), (skin) => modelOrder[skin.model]], - ["asc", "asc"] + ["asc", "asc"], ); } @@ -115,7 +115,7 @@ function Gallery() { clearOnDefault: true, }); const [browseMode, setBrowseMode] = useState<"select" | "search">( - searchQuery.trim() ? "search" : "select" + searchQuery.trim() ? "search" : "select", ); const deferredSearchQuery = useDeferredValue(searchQuery); const [manifest, isLoaded] = useManifest(); @@ -125,7 +125,7 @@ function Gallery() { }); const [isPreparingDownload, setPreparingDownload] = useState(false); const [hiResDownload, setHiResDownload] = useState<"prompt" | "yes" | "no">( - "prompt" + "prompt", ); const actualModel = selectedModel === "hfemale" ? "hmale" : selectedModel; const customSkins = manifest.customSkins?.[actualModel] ?? emptySkins; @@ -152,12 +152,12 @@ function Gallery() { const fileNames = pack.files; const hasHiRes = fileNames.some( - (fileName) => manifest.sizeMultiplier[fileName] > 1 + (fileName) => manifest.sizeMultiplier[fileName] > 1, ); if (hasHiRes && hiResDownload === "prompt") { window.alert( - "This download contains HD textures, which require the QoL patch. Select “yes” or “no” for HD support, then try again." + "This download contains HD textures, which require the QoL patch. Select “yes” or “no” for HD support, then try again.", ); if (hiResSelectRef.current) { hiResSelectRef.current.focus(); @@ -213,7 +213,7 @@ function Gallery() { return orderBy( Object.keys(manifest?.packs ?? {}), (name) => name.toLowerCase(), - ["asc"] + ["asc"], ); }, [manifest]); @@ -221,8 +221,8 @@ function Gallery() { const skinData = isNew ? manifest?.newSkins : isPack - ? manifest?.packs?.[selectedModel]?.skins - : null; + ? manifest?.packs?.[selectedModel]?.skins + : null; if (skinData) { return skinDataToList(skinData); } else { @@ -250,8 +250,8 @@ function Gallery() { browseMode === "search" && hasSearchInput ? searchResults : isNew || isPack - ? selectedSkinList - : customSkins; + ? selectedSkinList + : customSkins; useEffect(() => { setPreparingDownload(false); @@ -288,7 +288,7 @@ function Gallery() { title={browseMode === "select" ? "Search" : "Close search mode"} onClick={() => { setBrowseMode((mode) => - mode === "select" ? "search" : "select" + mode === "select" ? "search" : "select", ); setSearchQuery(""); }} @@ -440,8 +440,8 @@ function Gallery() { skinName = name.name; skinModel = name.model; } - const url = `${baseManifestPath}/gallery/${encodeURIComponent( - skinName + const url = `${SKIN_GALLERY_BASE_URL}/${encodeURIComponent( + skinName, )}.${skinModel}.webp`; return ( @@ -458,7 +458,7 @@ function Gallery() { (a || b).toUpperCase() + (match, a, b) => (a || b).toUpperCase(), ); let zipFileName = ""; let fileNames: string[] = []; @@ -487,34 +487,34 @@ function Gallery() { fileNames = modelTypes.player .filter((modelName) => manifest.customSkins[modelName].includes( - skinName - ) + skinName, + ), ) .map( - (modelName) => `${skinName}.${modelName}.png` + (modelName) => `${skinName}.${modelName}.png`, ); break; case "weapon": zipFileName = `zWeapon${camelCaseModelName}-${skinName}.vl2`; fileNames = modelToFileList(skinModel).map( - (fileName) => `${skinName}/${fileName}` + (fileName) => `${skinName}/${fileName}`, ); break; case "vehicle": zipFileName = `z${camelCaseModelName}-${skinName}.vl2`; fileNames = modelToFileList(skinModel).map( - (fileName) => `${skinName}/${fileName}` + (fileName) => `${skinName}/${fileName}`, ); break; } if (fileNames.length) { const hasHiRes = fileNames.some( - (fileName) => manifest.sizeMultiplier[fileName] > 1 + (fileName) => manifest.sizeMultiplier[fileName] > 1, ); if (hasHiRes && hiResDownload === "prompt") { window.alert( - "This download contains HD textures, which require the QoL patch. Select “yes” or “no” for HD support, then try again." + "This download contains HD textures, which require the QoL patch. Select “yes” or “no” for HD support, then try again.", ); if (hiResSelectRef.current) { hiResSelectRef.current.focus(); @@ -534,7 +534,7 @@ function Gallery() { if (hasHiRes && hiResDownload === "no") { zipFileName = zipFileName.replace( /\.vl2$/, - "@1x.vl2" + "@1x.vl2", ); } @@ -547,7 +547,7 @@ function Gallery() { name: name.split("/").slice(-1)[0], data, }; - }) + }), ); await saveZipFile(zip, zipFileName); } diff --git a/src/deployPaths.ts b/src/deployPaths.ts new file mode 100644 index 0000000..841a5bd --- /dev/null +++ b/src/deployPaths.ts @@ -0,0 +1,3 @@ +export const SKIN_ASSET_BASE_URL = `https://assets.tribes2.online/skins/files`; +export const SKIN_MANIFEST_URL = `https://assets.tribes2.online/skins/manifest.json`; +export const SKIN_GALLERY_BASE_URL = `https://assets.tribes2.online/skins/gallery`; diff --git a/src/exportUtils.ts b/src/exportUtils.ts index 6751b5f..9ffae58 100644 --- a/src/exportUtils.ts +++ b/src/exportUtils.ts @@ -1,10 +1,9 @@ import JSZip from "jszip"; import { saveAs } from "file-saver"; - -const basePath = `https://exogen.github.io/t2-skins/skins`; +import { SKIN_ASSET_BASE_URL } from "./deployPaths"; export function createZipFile( - files: Array<{ name: string; data: ArrayBuffer | Blob }> + files: Array<{ name: string; data: ArrayBuffer | Blob }>, ) { const zip = new JSZip(); for (const file of files) { @@ -24,11 +23,11 @@ export function savePngFile(imageUrl: string, name: string) { export async function collectFiles( files: string[], - { skipNotFound = false }: { skipNotFound?: boolean } = {} + { skipNotFound = false }: { skipNotFound?: boolean } = {}, ) { const results = await Promise.all( files.map(async (fileName) => { - const url = `${basePath}/${fileName}`; + const url = `${SKIN_ASSET_BASE_URL}/${fileName}`; const res = await fetch(url); if (!res.ok) { if (skipNotFound && res.status === 404) { @@ -41,7 +40,7 @@ export async function collectFiles( name: fileName.replace(/@1x\.png$/, ".png"), data: arrayBuffer, }; - }) + }), ); return results.filter((fileInfo) => fileInfo != null); } diff --git a/src/useManifest.ts b/src/useManifest.ts index 811ef51..130f10a 100644 --- a/src/useManifest.ts +++ b/src/useManifest.ts @@ -1,4 +1,5 @@ import { useState, useEffect } from "react"; +import { SKIN_MANIFEST_URL } from "./deployPaths"; export type Manifest = { customSkins: Record; @@ -14,7 +15,6 @@ export type Manifest = { sizeMultiplier: Record; }; -const baseManifestPath = `https://exogen.github.io/t2-skins`; export const defaultManifest: Manifest = { customSkins: {}, newSkins: {}, @@ -33,7 +33,7 @@ export default function useManifest(): [Manifest, boolean] { const loadCustomSkins = async () => { let res; try { - res = await fetch(`${baseManifestPath}/skins.json`, { signal }); + res = await fetch(SKIN_MANIFEST_URL, { signal }); if (!ignore) { const json = await res.json(); if (!ignore) {