diff --git a/back-end/src/main/resources/static/index.html b/back-end/src/main/resources/static/index.html index d4a2fbd4..0b3fffff 100644 --- a/back-end/src/main/resources/static/index.html +++ b/back-end/src/main/resources/static/index.html @@ -34,6 +34,6 @@ - + \ No newline at end of file diff --git a/back-end/src/main/resources/static/main-45C2XOR6.js b/back-end/src/main/resources/static/main-45C2XOR6.js new file mode 100644 index 00000000..c9c7aa10 --- /dev/null +++ b/back-end/src/main/resources/static/main-45C2XOR6.js @@ -0,0 +1,4340 @@ +import{$ as Wr,$a as Ct,A as vo,Aa as Qm,Ab as f1,B as lc,Ba as t1,Bb as x1,C as Q0,Ca as e1,Cb as oi,D as Eo,Da as ks,Db as Ei,E as Um,Ea as Cn,Eb as p1,F as jl,Fa as n1,Fb as Ao,G as Gr,Ga as gc,Gb as en,H as td,Ha as P,Hb as he,I as Vm,Ia as ft,Ib as vc,J as zm,Ja as ad,Jb as m1,K as Hm,Ka as i1,Kb as pd,L as nr,La as $l,Lb as g1,M as Gm,Ma as Zl,N as kn,Na as r1,O as Ke,Oa as Li,P as ed,Pa as s1,Q as be,Qa as Cc,R as hc,Ra as o1,S as Wm,Sa as a1,T as yn,Ta as c1,U as nd,Ua as At,V as Le,Va as vi,W as le,Wa as V,X as uc,Xa as Lt,Y as dc,Ya as l1,Z as vt,Za as I,_ as fc,_a as N,a as Nt,aa as xc,ab as sn,b as Ze,ba as jm,bb as on,ca as Xl,cb as qt,d as Fm,da as Ps,db as xt,e as m_,ea as Yl,eb as at,f as Pm,fa as Mt,fb as te,g as dt,ga as Dt,gb as Kt,h as km,ha as Jn,hb as Jt,i as Rm,ia as Ci,ib as Xt,j as $0,ja as pc,jb as Ge,k as Z0,ka as id,kb as Ne,l as Fs,la as rd,lb as cd,m as mi,ma as ql,mb as ld,n as Hr,na as jt,nb as hd,o as si,oa as Xm,ob as ud,p as de,pa as sd,pb as Et,q as cc,qa as Ym,qb as h1,r as Im,ra as mc,rb as Kl,s as Om,sa as qm,sb as Jl,t as ze,ta as od,tb as u1,u as K0,ua as _o,ub as dd,v as gi,va as yo,vb as fd,w as Lm,wa as $m,wb as Rs,x as J0,xa as Zm,xb as d1,y as Nm,ya as Km,yb as xd,z as Co,za as Jm,zb as bo}from"./chunk-EOMJ6KLO.js";var VE=Fm((zl,_m)=>{"use strict";(function(t,e){typeof zl=="object"&&typeof _m=="object"?_m.exports=e():typeof define=="function"&&define.amd?define([],e):typeof zl=="object"?zl.jsQR=e():t.jsQR=e()})(typeof self<"u"?self:zl,function(){return function(r){var t={};function e(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return r[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=r,e.c=t,e.d=function(n,i,s){e.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(i,"a",i),i},e.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},e.p="",e(e.s=3)}([function(r,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function i(s,o){this.width=o,this.height=s.length/o,this.data=s}return i.createEmpty=function(s,o){return new i(new Uint8ClampedArray(s*o),s)},i.prototype.get=function(s,o){return s<0||s>=this.width||o<0||o>=this.height?!1:!!this.data[o*this.width+s]},i.prototype.set=function(s,o,a){this.data[o*this.width+s]=a?1:0},i.prototype.setRegion=function(s,o,a,c,l){for(var h=o;h=this.size&&(h=(h^this.primitive)&this.size-1);for(var u=0;u1&&a[0]===0){for(var l=1;ll.length&&(a=[l,c],c=a[0],l=a[1]);for(var h=new Uint8ClampedArray(l.length),u=l.length-c.length,d=0;du?u:l}var a=function(){function l(h,u){this.width=h,this.data=new Uint8ClampedArray(h*u)}return l.prototype.get=function(h,u){return this.data[u*this.width+h]},l.prototype.set=function(h,u,d){this.data[u*this.width+h]=d},l}();function c(l,h,u,d){if(l.length!==h*u*4)throw new Error("Malformed data passed to binarizer.");for(var f=new a(h,u),m=0;m0&&S>0)){var T=(A.get(S,b-1)+2*A.get(S-1,b)+A.get(S-1,b-1))/4;E6&&(_.setRegion(v-11,0,3,6,!0),_.setRegion(0,v-11,6,3,!0)),_}function d(C,v,_){for(var A=h[_.dataMask],b=C.height,S=u(v),w=[],E=0,y=0,D=!0,F=b-1;F>0;F-=2){F===6&&F--;for(var T=0;T=0;b--)for(var S=v-9;S>=v-11;S--)A=c(C.get(S,b),A);for(var w=0,S=5;S>=0;S--)for(var b=v-9;b>=v-11;b--)w=c(C.get(S,b),w);for(var E=1/0,y,D=0,F=o.VERSIONS;D=0;A--)A!==6&&(v=c(C.get(8,A),v));for(var b=C.height,S=0,A=b-1;A>=b-7;A--)S=c(C.get(8,A),S);for(var _=b-8;_1)for(var T=A.ecBlocks[0].numBlocks,z=A.ecBlocks[1].numBlocks,E=0;E0;)for(var H=0,tt=b;H=3;){var v=f.readBits(10);if(v>=1e3)throw new Error("Invalid numeric value above 999");var _=Math.floor(v/100),A=Math.floor(v/10)%10,b=v%10;g.push(48+_,48+A,48+b),x+=_.toString()+A.toString()+b.toString(),C-=3}if(C===2){var v=f.readBits(7);if(v>=100)throw new Error("Invalid numeric value above 99");var _=Math.floor(v/10),A=v%10;g.push(48+_,48+A),x+=_.toString()+A.toString()}else if(C===1){var v=f.readBits(4);if(v>=10)throw new Error("Invalid numeric value above 9");g.push(48+v),x+=v.toString()}return{bytes:g,text:x}}var c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function l(f,m){for(var g=[],x="",p=[9,11,13][m],C=f.readBits(p);C>=2;){var v=f.readBits(11),_=Math.floor(v/45),A=v%45;g.push(c[_].charCodeAt(0),c[A].charCodeAt(0)),x+=c[_]+c[A],C-=2}if(C===1){var _=f.readBits(6);g.push(c[_].charCodeAt(0)),x+=c[_]}return{bytes:g,text:x}}function h(f,m){for(var g=[],x="",p=[8,16,16][m],C=f.readBits(p),v=0;v>8,A&255),x+=String.fromCharCode(i.shiftJISTable[A])}return{bytes:g,text:x}}function d(f,m){for(var g,x,p,C,v=new n.BitStream(f),_=m<=9?0:m<=26?1:2,A={text:"",bytes:[],chunks:[],version:m};v.available()>=4;){var b=v.readBits(4);if(b===o.Terminator)return A;if(b===o.ECI)v.readBits(1)===0?A.chunks.push({type:s.ECI,assignmentNumber:v.readBits(7)}):v.readBits(1)===0?A.chunks.push({type:s.ECI,assignmentNumber:v.readBits(14)}):v.readBits(1)===0?A.chunks.push({type:s.ECI,assignmentNumber:v.readBits(21)}):A.chunks.push({type:s.ECI,assignmentNumber:-1});else if(b===o.Numeric){var S=a(v,_);A.text+=S.text,(g=A.bytes).push.apply(g,S.bytes),A.chunks.push({type:s.Numeric,text:S.text})}else if(b===o.Alphanumeric){var w=l(v,_);A.text+=w.text,(x=A.bytes).push.apply(x,w.bytes),A.chunks.push({type:s.Alphanumeric,text:w.text})}else if(b===o.Byte){var E=h(v,_);A.text+=E.text,(p=A.bytes).push.apply(p,E.bytes),A.chunks.push({type:s.Byte,bytes:E.bytes,text:E.text})}else if(b===o.Kanji){var y=u(v,_);A.text+=y.text,(C=A.bytes).push.apply(C,y.bytes),A.chunks.push({type:s.Kanji,bytes:y.bytes,text:y.text})}}if(v.available()===0||v.readBits(v.available())===0)return A}t.decode=d},function(r,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function i(s){this.byteOffset=0,this.bitOffset=0,this.bytes=s}return i.prototype.readBits=function(s){if(s<1||s>32||s>this.available())throw new Error("Cannot read "+s.toString()+" bits");var o=0;if(this.bitOffset>0){var a=8-this.bitOffset,c=s>8-c<>l,s-=c,this.bitOffset+=c,this.bitOffset===8&&(this.bitOffset=0,this.byteOffset++)}if(s>0){for(;s>=8;)o=o<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,s-=8;if(s>0){var l=8-s,h=255>>l<>l,this.bitOffset+=s}}return o},i.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},i}();t.BitStream=n},function(r,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(r,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e(1),i=e(2);function s(l,h,u,d){var f;h.degree()=d/2;){var C=m,v=x;if(m=g,x=p,m.isZero())return null;g=C;for(var _=l.zero,A=m.getCoefficient(m.degree()),b=l.inverse(A);g.degree()>=m.degree()&&!g.isZero();){var S=g.degree()-m.degree(),w=l.multiply(g.getCoefficient(g.degree()),b);_=_.addOrSubtract(l.buildMonomial(S,w)),g=g.addOrSubtract(m.multiplyByMonomial(S,w))}if(p=_.multiplyPoly(x).addOrSubtract(v),g.degree()>=m.degree())return null}var E=p.getCoefficient(0);if(E===0)return null;var y=l.inverse(E);return[p.multiply(y),g.multiply(y)]}function o(l,h){var u=h.degree();if(u===1)return[h.getCoefficient(1)];for(var d=new Array(u),f=0,m=1;m=w&&E>=y?(_=[C,p,v],D=_[0],F=_[1],T=_[2]):y>=E&&y>=w?(A=[p,C,v],D=A[0],F=A[1],T=A[2]):(b=[p,v,C],D=b[0],F=b[1],T=b[2]),(T.x-F.x)*(D.y-F.y)-(T.y-F.y)*(D.x-F.x)<0&&(S=[T,D],D=S[0],T=S[1]),{bottomLeft:D,topLeft:F,topRight:T}}function l(p,C,v,_){var A=(a(u(p,v,_,5))/7+a(u(p,C,_,5))/7+a(u(v,p,_,5))/7+a(u(C,p,_,5))/7)/4;if(A<1)throw new Error("Invalid module size");var b=Math.round(o(p,C)/A),S=Math.round(o(p,v)/A),w=Math.floor((b+S)/2)+7;switch(w%4){case 0:w++;break;case 2:w--;break}return{dimension:w,moduleSize:A}}function h(p,C,v,_){var A=[{x:Math.floor(p.x),y:Math.floor(p.y)}],b=Math.abs(C.y-p.y)>Math.abs(C.x-p.x),S,w,E,y;b?(S=Math.floor(p.y),w=Math.floor(p.x),E=Math.floor(C.y),y=Math.floor(C.x)):(S=Math.floor(p.x),w=Math.floor(p.y),E=Math.floor(C.x),y=Math.floor(C.y));for(var D=Math.abs(E-S),F=Math.abs(y-w),T=Math.floor(-D/2),z=S0){if(Y===y)break;Y+=H,T-=D}}for(var _t=[],bt=0;bt<_;bt++)A[bt]&&A[bt+1]?_t.push(o(A[bt],A[bt+1])):_t.push(0);return _t}function u(p,C,v,_){var A,b=C.y-p.y,S=C.x-p.x,w=h(p,C,v,Math.ceil(_/2)),E=h(p,{x:p.x-S,y:p.y-b},v,Math.ceil(_/2)),y=w.shift()+E.shift()-1;return(A=E.concat(y)).concat.apply(A,w)}function d(p,C){var v=a(p)/a(C),_=0;return C.forEach(function(A,b){_+=Math.pow(p[b]-A*v,2)}),{averageSize:v,error:_}}function f(p,C,v){try{var _=u(p,{x:-1,y:p.y},v,C.length),A=u(p,{x:p.x,y:-1},v,C.length),b={x:Math.max(0,p.x-p.y)-1,y:Math.max(0,p.y-p.x)-1},S=u(p,b,v,C.length),w={x:Math.min(v.width,p.x+p.y)+1,y:Math.min(v.height,p.y+p.x)+1},E=u(p,w,v,C.length),y=d(_,C),D=d(A,C),F=d(S,C),T=d(E,C),z=Math.sqrt(y.error*y.error+D.error*D.error+F.error*F.error+T.error*T.error),H=(y.averageSize+D.averageSize+F.averageSize+T.averageSize)/4,tt=(Math.pow(y.averageSize-H,2)+Math.pow(D.averageSize-H,2)+Math.pow(F.averageSize-H,2)+Math.pow(T.averageSize-H,2))/H;return z+tt}catch{return 1/0}}function m(p,C){for(var v=Math.round(C.x);p.get(v,Math.round(C.y));)v--;for(var _=Math.round(C.x);p.get(_,Math.round(C.y));)_++;for(var A=(v+_)/2,b=Math.round(C.y);p.get(Math.round(A),b);)b--;for(var S=Math.round(C.y);p.get(Math.round(A),S);)S++;var w=(b+S)/2;return{x:A,y:w}}function g(p){for(var C=[],v=[],_=[],A=[],b=function($){for(var ct=0,_t=!1,bt=[0,0,0,0,0],se=function(L){var j=p.get(L,$);if(j===_t)ct++;else{bt=[bt[1],bt[2],bt[3],bt[4],ct],ct=1,_t=j;var O=a(bt)/7,et=Math.abs(bt[0]-O)=zt.bottom.startX&&ut<=zt.bottom.endX||St>=zt.bottom.startX&&ut<=zt.bottom.endX||ut<=zt.bottom.startX&&St>=zt.bottom.endX&&bt[2]/(zt.bottom.endX-zt.bottom.startX)i});Tt.length>0?Tt[0].bottom=Vt:v.push({top:Vt,bottom:Vt})}if(R){var yt=L-bt[4],Gt=yt-bt[3],Vt={startX:Gt,y:$,endX:yt},Tt=A.filter(function(k){return Gt>=k.bottom.startX&&Gt<=k.bottom.endX||yt>=k.bottom.startX&&Gt<=k.bottom.endX||Gt<=k.bottom.startX&&yt>=k.bottom.endX&&bt[2]/(k.bottom.endX-k.bottom.startX)i});Tt.length>0?Tt[0].bottom=Vt:A.push({top:Vt,bottom:Vt})}}},K=-1;K<=p.width;K++)se(K);C.push.apply(C,v.filter(function(L){return L.bottom.y!==$&&L.bottom.y-L.top.y>=2})),v=v.filter(function(L){return L.bottom.y===$}),_.push.apply(_,A.filter(function(L){return L.bottom.y!==$})),A=A.filter(function(L){return L.bottom.y===$})},S=0;S<=p.height;S++)b(S);C.push.apply(C,v.filter(function($){return $.bottom.y-$.top.y>=2})),_.push.apply(_,A);var w=C.filter(function($){return $.bottom.y-$.top.y>=2}).map(function($){var ct=($.top.startX+$.top.endX+$.bottom.startX+$.bottom.endX)/4,_t=($.top.y+$.bottom.y+1)/2;if(p.get(Math.round(ct),Math.round(_t))){var bt=[$.top.endX-$.top.startX,$.bottom.endX-$.bottom.startX,$.bottom.y-$.top.y+1],se=a(bt)/bt.length,K=f({x:Math.round(ct),y:Math.round(_t)},[1,1,3,1,1],p);return{score:K,x:ct,y:_t,size:se}}}).filter(function($){return!!$}).sort(function($,ct){return $.score-ct.score}).map(function($,ct,_t){if(ct>n)return null;var bt=_t.filter(function(K,L){return ct!==L}).map(function(K){return{x:K.x,y:K.y,score:K.score+Math.pow(K.size-$.size,2)/$.size,size:K.size}}).sort(function(K,L){return K.score-L.score});if(bt.length<2)return null;var se=$.score+bt[0].score+bt[1].score;return{points:[$].concat(bt.slice(0,2)),score:se}}).filter(function($){return!!$}).sort(function($,ct){return $.score-ct.score});if(w.length===0)return null;var E=c(w[0].points[0],w[0].points[1],w[0].points[2]),y=E.topRight,D=E.topLeft,F=E.bottomLeft,T=x(p,_,y,D,F),z=[];T&&z.push({alignmentPattern:{x:T.alignmentPattern.x,y:T.alignmentPattern.y},bottomLeft:{x:F.x,y:F.y},dimension:T.dimension,topLeft:{x:D.x,y:D.y},topRight:{x:y.x,y:y.y}});var H=m(p,y),tt=m(p,D),it=m(p,F),Y=x(p,_,H,tt,it);return Y&&z.push({alignmentPattern:{x:Y.alignmentPattern.x,y:Y.alignmentPattern.y},bottomLeft:{x:it.x,y:it.y},topLeft:{x:tt.x,y:tt.y},topRight:{x:H.x,y:H.y},dimension:Y.dimension}),z.length===0?null:z}t.locate=g;function x(p,C,v,_,A){var b,S,w;try{b=l(_,v,A,p),S=b.dimension,w=b.moduleSize}catch{return null}var E={x:v.x-_.x+A.x,y:v.y-_.y+A.y},y=(o(_,A)+o(_,v))/2/w,D=1-3/y,F={x:_.x+D*(E.x-_.x),y:_.y+D*(E.y-_.y)},T=C.map(function(H){var tt=(H.top.startX+H.top.endX+H.bottom.startX+H.bottom.endX)/4,it=(H.top.y+H.bottom.y+1)/2;if(p.get(Math.floor(tt),Math.floor(it))){var Y=[H.top.endX-H.top.startX,H.bottom.endX-H.bottom.startX,H.bottom.y-H.top.y+1],$=a(Y)/Y.length,ct=f({x:Math.floor(tt),y:Math.floor(it)},[1,1,1],p),_t=ct+o({x:tt,y:it},F);return{x:tt,y:it,score:_t}}}).filter(function(H){return!!H}).sort(function(H,tt){return H.score-tt.score}),z=y>=15&&T.length?T[0]:F;return{alignmentPattern:z,dimension:S}}}]).default})});var XE=Fm((WE,jE)=>{"use strict";var GE=function(){var r=function(C,v){var _=236,A=17,b=C,S=e[v],w=null,E=0,y=null,D=[],F={},T=function(L,j){E=b*4+17,w=function(O){for(var et=new Array(O),Z=0;Z=7&&Y(L),y==null&&(y=bt(b,S,D)),ct(y,j)},z=function(L,j){for(var O=-1;O<=7;O+=1)if(!(L+O<=-1||E<=L+O))for(var et=-1;et<=7;et+=1)j+et<=-1||E<=j+et||(0<=O&&O<=6&&(et==0||et==6)||0<=et&&et<=6&&(O==0||O==6)||2<=O&&O<=4&&2<=et&&et<=4?w[L+O][j+et]=!0:w[L+O][j+et]=!1)},H=function(){for(var L=0,j=0,O=0;O<8;O+=1){T(!0,O);var et=i.getLostPoint(F);(O==0||L>et)&&(L=et,j=O)}return j},tt=function(){for(var L=8;L>O&1)==1;w[Math.floor(O/3)][O%3+E-8-3]=et}for(var O=0;O<18;O+=1){var et=!L&&(j>>O&1)==1;w[O%3+E-8-3][Math.floor(O/3)]=et}},$=function(L,j){for(var O=S<<3|j,et=i.getBCHTypeInfo(O),Z=0;Z<15;Z+=1){var R=!L&&(et>>Z&1)==1;Z<6?w[Z][8]=R:Z<8?w[Z+1][8]=R:w[E-15+Z][8]=R}for(var Z=0;Z<15;Z+=1){var R=!L&&(et>>Z&1)==1;Z<8?w[8][E-Z-1]=R:Z<9?w[8][15-Z-1+1]=R:w[8][15-Z-1]=R}w[E-8][8]=!L},ct=function(L,j){for(var O=-1,et=E-1,Z=7,R=0,St=i.getMaskFunction(j),ut=E-1;ut>0;ut-=2)for(ut==6&&(ut-=1);;){for(var Vt=0;Vt<2;Vt+=1)if(w[et][ut-Vt]==null){var Tt=!1;R>>Z&1)==1);var yt=St(et,ut-Vt);yt&&(Tt=!Tt),w[et][ut-Vt]=Tt,Z-=1,Z==-1&&(R+=1,Z=7)}if(et+=O,et<0||E<=et){et-=O,O=-O;break}}},_t=function(L,j){for(var O=0,et=0,Z=0,R=new Array(j.length),St=new Array(j.length),ut=0;ut=0?Xe.getAt(k):0}}for(var M=0,yt=0;ytut*8)throw"code length overflow. ("+Z.getLengthInBits()+">"+ut*8+")";for(Z.getLengthInBits()+4<=ut*8&&Z.put(0,4);Z.getLengthInBits()%8!=0;)Z.putBit(!1);for(;!(Z.getLengthInBits()>=ut*8||(Z.put(_,8),Z.getLengthInBits()>=ut*8));)Z.put(A,8);return _t(Z,et)};F.addData=function(L,j){j=j||"Byte";var O=null;switch(j){case"Numeric":O=l(L);break;case"Alphanumeric":O=h(L);break;case"Byte":O=u(L);break;case"Kanji":O=d(L);break;default:throw"mode:"+j}D.push(O),y=null},F.isDark=function(L,j){if(L<0||E<=L||j<0||E<=j)throw L+","+j;return w[L][j]},F.getModuleCount=function(){return E},F.make=function(){if(b<1){for(var L=1;L<40;L++){for(var j=a.getRSBlocks(L,S),O=c(),et=0;et"u"?L*4:j;var O="";O+='";for(var Z=0;Z';O+=""}return O+="",O+="
",O},F.createSvgTag=function(L,j,O,et){var Z={};typeof arguments[0]=="object"&&(Z=arguments[0],L=Z.cellSize,j=Z.margin,O=Z.alt,et=Z.title),L=L||2,j=typeof j>"u"?L*4:j,O=typeof O=="string"?{text:O}:O||{},O.text=O.text||null,O.id=O.text?O.id||"qrcode-description":null,et=typeof et=="string"?{text:et}:et||{},et.text=et.text||null,et.id=et.text?et.id||"qrcode-title":null;var R=F.getModuleCount()*L+j*2,St,ut,Vt,Tt,yt="",Gt;for(Gt="l"+L+",0 0,"+L+" -"+L+",0 0,-"+L+"z ",yt+=''+se(et.text)+"":"",yt+=O.text?''+se(O.text)+"":"",yt+='',yt+='"u"?L*4:j;var O=F.getModuleCount()*L+j*2,et=j,Z=O-j;return p(O,O,function(R,St){if(et<=R&&R"u"?L*4:j;var et=F.getModuleCount()*L+j*2,Z="";return Z+="",Z};var se=function(L){for(var j="",O=0;O":j+=">";break;case"&":j+="&";break;case'"':j+=""";break;default:j+=et;break}}return j},K=function(L){var j=1;L=typeof L>"u"?j*2:L;var O=F.getModuleCount()*j+L*2,et=L,Z=O-L,R,St,ut,Vt,Tt,yt={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},Gt={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},zt="";for(R=0;R=Z?Gt[Tt]:yt[Tt];zt+=` +`}return O%2&&L>0?zt.substring(0,zt.length-O-1)+Array(O+1).join("\u2580"):zt.substring(0,zt.length-1)};return F.createASCII=function(L,j){if(L=L||1,L<2)return K(j);L-=1,j=typeof j>"u"?L*2:j;var O=F.getModuleCount()*L+j*2,et=j,Z=O-j,R,St,ut,Vt,Tt=Array(L+1).join("\u2588\u2588"),yt=Array(L+1).join(" "),Gt="",zt="";for(R=0;R>>8),S.push(y&255)):S.push(A)}}return S}};var t={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},e={L:1,M:0,Q:3,H:2},n={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},i=function(){var C=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],v=1335,_=7973,A=21522,b={},S=function(w){for(var E=0;w!=0;)E+=1,w>>>=1;return E};return b.getBCHTypeInfo=function(w){for(var E=w<<10;S(E)-S(v)>=0;)E^=v<=0;)E^=_<5&&(y+=3+T-5)}for(var D=0;D=256;)b-=255;return C[b]},A}();function o(C,v){if(typeof C.length>"u")throw C.length+"/"+v;var _=function(){for(var b=0;b"u")throw"bad rs block @ typeNumber:"+b+"/errorCorrectionLevel:"+S;for(var E=w.length/3,y=[],D=0;D>>7-A%8&1)==1},_.put=function(A,b){for(var S=0;S>>b-S-1&1)==1)},_.getLengthInBits=function(){return v},_.putBit=function(A){var b=Math.floor(v/8);C.length<=b&&C.push(0),A&&(C[b]|=128>>>v%8),v+=1},_},l=function(C){var v=t.MODE_NUMBER,_=C,A={};A.getMode=function(){return v},A.getLength=function(w){return _.length},A.write=function(w){for(var E=_,y=0;y+2>>8&255)*192+(D&255),w.put(D,13),y+=2}if(y>>8)},v.writeBytes=function(_,A,b){A=A||0,b=b||_.length;for(var S=0;S0&&(_+=","),_+=C[A];return _+="]",_},v},m=function(){var C=0,v=0,_=0,A="",b={},S=function(E){A+=String.fromCharCode(w(E&63))},w=function(E){if(!(E<0)){if(E<26)return 65+E;if(E<52)return 97+(E-26);if(E<62)return 48+(E-52);if(E==62)return 43;if(E==63)return 47}throw"n:"+E};return b.writeByte=function(E){for(C=C<<8|E&255,v+=8,_+=1;v>=6;)S(C>>>v-6),v-=6},b.flush=function(){if(v>0&&(S(C<<6-v),C=0,v=0),_%3!=0)for(var E=3-_%3,y=0;y=v.length){if(b==0)return-1;throw"unexpected end of file./"+b}var E=v.charAt(_);if(_+=1,E=="=")return b=0,-1;if(E.match(/^\s$/))continue;A=A<<6|w(E.charCodeAt(0)),b+=6}var y=A>>>b-8&255;return b-=8,y};var w=function(E){if(65<=E&&E<=90)return E-65;if(97<=E&&E<=122)return E-97+26;if(48<=E&&E<=57)return E-48+52;if(E==43)return 62;if(E==47)return 63;throw"c:"+E};return S},x=function(C,v){var _=C,A=v,b=new Array(C*v),S={};S.setPixel=function(D,F,T){b[F*_+D]=T},S.write=function(D){D.writeString("GIF87a"),D.writeShort(_),D.writeShort(A),D.writeByte(128),D.writeByte(0),D.writeByte(0),D.writeByte(0),D.writeByte(0),D.writeByte(0),D.writeByte(255),D.writeByte(255),D.writeByte(255),D.writeString(","),D.writeShort(0),D.writeShort(0),D.writeShort(_),D.writeShort(A),D.writeByte(0);var F=2,T=E(F);D.writeByte(F);for(var z=0;T.length-z>255;)D.writeByte(255),D.writeBytes(T,z,255),z+=255;D.writeByte(T.length-z),D.writeBytes(T,z,T.length-z),D.writeByte(0),D.writeString(";")};var w=function(D){var F=D,T=0,z=0,H={};return H.write=function(tt,it){if(tt>>>it)throw"length over";for(;T+it>=8;)F.writeByte(255&(tt<>>=8-T,z=0,T=0;z=tt<0&&F.writeByte(z)},H},E=function(D){for(var F=1<>6,128|s&63):s<55296||s>=57344?n.push(224|s>>12,128|s>>6&63,128|s&63):(i++,s=65536+((s&1023)<<10|e.charCodeAt(i)&1023),n.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|s&63))}return n}return t(r)}})();(function(r){typeof define=="function"&&define.amd?define([],r):typeof WE=="object"&&(jE.exports=r())})(function(){return GE})});var Cd=class extends x1{constructor(){super(...arguments),this.supportsDOMEvents=!0}},vd=class r extends Cd{static makeCurrent(){f1(new r)}onAndCancel(t,e,n){return t.addEventListener(e,n),()=>{t.removeEventListener(e,n)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,e){return e=e||this.getDefaultDocument(),e.createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return e==="window"?window:e==="document"?t:e==="body"?t.body:null}getBaseHref(t){let e=v_();return e==null?null:E_(e)}resetBaseElement(){Ec=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return p1(document.cookie,t)}},Ec=null;function v_(){return Ec=Ec||document.querySelector("base"),Ec?Ec.getAttribute("href"):null}function E_(r){return new URL(r,document.baseURI).pathname}var __=(()=>{let t=class t{build(){return new XMLHttpRequest}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:t.\u0275fac});let r=t;return r})(),Ed=new yn(""),_1=(()=>{let t=class t{constructor(n,i){this._zone=i,this._eventNameToPlugin=new Map,n.forEach(s=>{s.manager=this}),this._plugins=n.slice().reverse()}addEventListener(n,i,s){return this._findPluginFor(i).addEventListener(n,i,s)}getZone(){return this._zone}_findPluginFor(n){let i=this._eventNameToPlugin.get(n);if(i)return i;if(i=this._plugins.find(o=>o.supports(n)),!i)throw new Ke(5101,!1);return this._eventNameToPlugin.set(n,i),i}};t.\u0275fac=function(i){return new(i||t)(Le(Ed),Le(Li))},t.\u0275prov=be({token:t,factory:t.\u0275fac});let r=t;return r})(),Ql=class{constructor(t){this._doc=t}},md="ng-app-id",y1=(()=>{let t=class t{constructor(n,i,s,o={}){this.doc=n,this.appId=i,this.nonce=s,this.platformId=o,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=pd(o),this.resetHostNodes()}addStyles(n){for(let i of n)this.changeUsageCount(i,1)===1&&this.onStyleAdded(i)}removeStyles(n){for(let i of n)this.changeUsageCount(i,-1)<=0&&this.onStyleRemoved(i)}ngOnDestroy(){let n=this.styleNodesInDOM;n&&(n.forEach(i=>i.remove()),n.clear());for(let i of this.getAllStyles())this.onStyleRemoved(i);this.resetHostNodes()}addHost(n){this.hostNodes.add(n);for(let i of this.getAllStyles())this.addStyleToHost(n,i)}removeHost(n){this.hostNodes.delete(n)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(n){for(let i of this.hostNodes)this.addStyleToHost(i,n)}onStyleRemoved(n){let i=this.styleRef;i.get(n)?.elements?.forEach(s=>s.remove()),i.delete(n)}collectServerRenderedStyles(){let n=this.doc.head?.querySelectorAll(`style[${md}="${this.appId}"]`);if(n?.length){let i=new Map;return n.forEach(s=>{s.textContent!=null&&i.set(s.textContent,s)}),i}return null}changeUsageCount(n,i){let s=this.styleRef;if(s.has(n)){let o=s.get(n);return o.usage+=i,o.usage}return s.set(n,{usage:i,elements:[]}),i}getStyleElement(n,i){let s=this.styleNodesInDOM,o=s?.get(i);if(o?.parentNode===n)return s.delete(i),o.removeAttribute(md),o;{let a=this.doc.createElement("style");return this.nonce&&a.setAttribute("nonce",this.nonce),a.textContent=i,this.platformIsServer&&a.setAttribute(md,this.appId),n.appendChild(a),a}}addStyleToHost(n,i){let s=this.getStyleElement(n,i),o=this.styleRef,a=o.get(i)?.elements;a?a.push(s):o.set(i,{elements:[s],usage:1})}resetHostNodes(){let n=this.hostNodes;n.clear(),n.add(this.doc.head)}};t.\u0275fac=function(i){return new(i||t)(Le(oi),Le(sd),Le(od,8),Le(mc))},t.\u0275prov=be({token:t,factory:t.\u0275fac});let r=t;return r})(),gd={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},yd=/%COMP%/g,b1="%COMP%",y_=`_nghost-${b1}`,b_=`_ngcontent-${b1}`,A_=!0,S_=new yn("",{providedIn:"root",factory:()=>A_});function w_(r){return b_.replace(yd,r)}function M_(r){return y_.replace(yd,r)}function A1(r,t){return t.map(e=>e.replace(yd,r))}var th=(()=>{let t=class t{constructor(n,i,s,o,a,c,l,h=null){this.eventManager=n,this.sharedStylesHost=i,this.appId=s,this.removeStylesOnCompDestroy=o,this.doc=a,this.platformId=c,this.ngZone=l,this.nonce=h,this.rendererByCompId=new Map,this.platformIsServer=pd(c),this.defaultRenderer=new _c(n,a,l,this.platformIsServer)}createRenderer(n,i){if(!n||!i)return this.defaultRenderer;this.platformIsServer&&i.encapsulation===uc.ShadowDom&&(i=Ze(Nt({},i),{encapsulation:uc.Emulated}));let s=this.getOrCreateRenderer(n,i);return s instanceof eh?s.applyToHost(n):s instanceof yc&&s.applyStyles(),s}getOrCreateRenderer(n,i){let s=this.rendererByCompId,o=s.get(i.id);if(!o){let a=this.doc,c=this.ngZone,l=this.eventManager,h=this.sharedStylesHost,u=this.removeStylesOnCompDestroy,d=this.platformIsServer;switch(i.encapsulation){case uc.Emulated:o=new eh(l,h,i,this.appId,u,a,c,d);break;case uc.ShadowDom:return new _d(l,h,n,i,a,c,this.nonce,d);default:o=new yc(l,h,i,u,a,c,d);break}s.set(i.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}};t.\u0275fac=function(i){return new(i||t)(Le(_1),Le(y1),Le(sd),Le(S_),Le(oi),Le(mc),Le(Li),Le(od))},t.\u0275prov=be({token:t,factory:t.\u0275fac});let r=t;return r})(),_c=class{constructor(t,e,n,i){this.eventManager=t,this.doc=e,this.ngZone=n,this.platformIsServer=i,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(t,e){return e?this.doc.createElementNS(gd[e]||e,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,e){(C1(t)?t.content:t).appendChild(e)}insertBefore(t,e,n){t&&(C1(t)?t.content:t).insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n=typeof t=="string"?this.doc.querySelector(t):t;if(!n)throw new Ke(-5104,!1);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,i){if(i){e=i+":"+e;let s=gd[i];s?t.setAttributeNS(s,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){let i=gd[n];i?t.removeAttributeNS(i,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,i){i&(gc.DashCase|gc.Important)?t.style.setProperty(e,n,i&gc.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&gc.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t!=null&&(t[e]=n)}setValue(t,e){t.nodeValue=e}listen(t,e,n){if(typeof t=="string"&&(t=bo().getGlobalEventTarget(this.doc,t),!t))throw new Error(`Unsupported event target ${t} for event ${e}`);return this.eventManager.addEventListener(t,e,this.decoratePreventDefault(n))}decoratePreventDefault(t){return e=>{if(e==="__ngUnwrap__")return t;(this.platformIsServer?this.ngZone.runGuarded(()=>t(e)):t(e))===!1&&e.preventDefault()}}};function C1(r){return r.tagName==="TEMPLATE"&&r.content!==void 0}var _d=class extends _c{constructor(t,e,n,i,s,o,a,c){super(t,s,o,c),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let l=A1(i.id,i.styles);for(let h of l){let u=document.createElement("style");a&&u.setAttribute("nonce",a),u.textContent=h,this.shadowRoot.appendChild(u)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,e){return super.appendChild(this.nodeOrShadowRoot(t),e)}insertBefore(t,e,n){return super.insertBefore(this.nodeOrShadowRoot(t),e,n)}removeChild(t,e){return super.removeChild(this.nodeOrShadowRoot(t),e)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},yc=class extends _c{constructor(t,e,n,i,s,o,a,c){super(t,s,o,a),this.sharedStylesHost=e,this.removeStylesOnCompDestroy=i,this.styles=c?A1(c,n.styles):n.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}},eh=class extends yc{constructor(t,e,n,i,s,o,a,c){let l=i+"-"+n.id;super(t,e,n,s,o,a,c,l),this.contentAttr=w_(l),this.hostAttr=M_(l)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,e){let n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}},D_=(()=>{let t=class t extends Ql{constructor(n){super(n)}supports(n){return!0}addEventListener(n,i,s){return n.addEventListener(i,s,!1),()=>this.removeEventListener(n,i,s)}removeEventListener(n,i,s){return n.removeEventListener(i,s)}};t.\u0275fac=function(i){return new(i||t)(Le(oi))},t.\u0275prov=be({token:t,factory:t.\u0275fac});let r=t;return r})(),v1=["alt","control","meta","shift"],B_={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},T_={alt:r=>r.altKey,control:r=>r.ctrlKey,meta:r=>r.metaKey,shift:r=>r.shiftKey},F_=(()=>{let t=class t extends Ql{constructor(n){super(n)}supports(n){return t.parseEventName(n)!=null}addEventListener(n,i,s){let o=t.parseEventName(i),a=t.eventCallback(o.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>bo().onAndCancel(n,o.domEventName,a))}static parseEventName(n){let i=n.toLowerCase().split("."),s=i.shift();if(i.length===0||!(s==="keydown"||s==="keyup"))return null;let o=t._normalizeKey(i.pop()),a="",c=i.indexOf("code");if(c>-1&&(i.splice(c,1),a="code."),v1.forEach(h=>{let u=i.indexOf(h);u>-1&&(i.splice(u,1),a+=h+".")}),a+=o,i.length!=0||o.length===0)return null;let l={};return l.domEventName=s,l.fullKey=a,l}static matchEventFullKeyCode(n,i){let s=B_[n.key]||n.key,o="";return i.indexOf("code.")>-1&&(s=n.code,o="code."),s==null||!s?!1:(s=s.toLowerCase(),s===" "?s="space":s==="."&&(s="dot"),v1.forEach(a=>{if(a!==s){let c=T_[a];c(n)&&(o+=a+".")}}),o+=s,o===i)}static eventCallback(n,i,s){return o=>{t.matchEventFullKeyCode(o,n)&&s.runGuarded(()=>i(o))}}static _normalizeKey(n){return n==="esc"?"escape":n}};t.\u0275fac=function(i){return new(i||t)(Le(oi))},t.\u0275prov=be({token:t,factory:t.\u0275fac});let r=t;return r})();function S1(r,t){return d1(Nt({rootComponent:r},P_(t)))}function P_(r){return{appProviders:[...L_,...r?.providers??[]],platformProviders:O_}}function k_(){vd.makeCurrent()}function R_(){return new rd}function I_(){return Xm(document),document}var O_=[{provide:mc,useValue:m1},{provide:Ym,useValue:k_,multi:!0},{provide:oi,useFactory:I_,deps:[]}];var L_=[{provide:jm,useValue:"root"},{provide:rd,useFactory:R_,deps:[]},{provide:Ed,useClass:D_,multi:!0,deps:[oi,Li,mc]},{provide:Ed,useClass:F_,multi:!0,deps:[oi]},th,y1,_1,{provide:$l,useExisting:th},{provide:g1,useClass:__,deps:[]},[]];var w1=(()=>{let t=class t{constructor(n){this._doc=n}getTitle(){return this._doc.title}setTitle(n){this._doc.title=n||""}};t.\u0275fac=function(i){return new(i||t)(Le(oi))},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();var bd=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:function(i){let s=null;return i?s=new(i||t):s=Le(N_),s},providedIn:"root"});let r=t;return r})(),N_=(()=>{let t=class t extends bd{constructor(n){super(),this._doc=n}sanitize(n,i){if(i==null)return null;switch(n){case ks.NONE:return i;case ks.HTML:return yo(i,"HTML")?_o(i):e1(this._doc,String(i)).toString();case ks.STYLE:return yo(i,"Style")?_o(i):i;case ks.SCRIPT:if(yo(i,"Script"))return _o(i);throw new Ke(5200,!1);case ks.URL:return yo(i,"URL")?_o(i):t1(String(i));case ks.RESOURCE_URL:if(yo(i,"ResourceURL"))return _o(i);throw new Ke(5201,!1);default:throw new Ke(5202,!1)}}bypassSecurityTrustHtml(n){return $m(n)}bypassSecurityTrustStyle(n){return Zm(n)}bypassSecurityTrustScript(n){return Km(n)}bypassSecurityTrustUrl(n){return Jm(n)}bypassSecurityTrustResourceUrl(n){return Qm(n)}};t.\u0275fac=function(i){return new(i||t)(Le(oi))},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();var fe="primary",Lc=Symbol("RouteTitle"),Dd=class{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){let e=this.params[t];return Array.isArray(e)?e[0]:e}return null}getAll(t){if(this.has(t)){let e=this.params[t];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}};function Bo(r){return new Dd(r)}function U_(r,t,e){let n=e.path.split("/");if(n.length>r.length||e.pathMatch==="full"&&(t.hasChildren()||n.lengthn[s]===i)}else return r===t}function R1(r){return r.length>0?r[r.length-1]:null}function Yr(r){return Im(r)?r:Jl(r)?si(Promise.resolve(r)):de(r)}var z_={exact:O1,subset:L1},I1={exact:H_,subset:G_,ignored:()=>!0};function D1(r,t,e){return z_[e.paths](r.root,t.root,e.matrixParams)&&I1[e.queryParams](r.queryParams,t.queryParams)&&!(e.fragment==="exact"&&r.fragment!==t.fragment)}function H_(r,t){return ir(r,t)}function O1(r,t,e){if(!Os(r.segments,t.segments)||!rh(r.segments,t.segments,e)||r.numberOfChildren!==t.numberOfChildren)return!1;for(let n in t.children)if(!r.children[n]||!O1(r.children[n],t.children[n],e))return!1;return!0}function G_(r,t){return Object.keys(t).length<=Object.keys(r).length&&Object.keys(t).every(e=>k1(r[e],t[e]))}function L1(r,t,e){return N1(r,t,t.segments,e)}function N1(r,t,e,n){if(r.segments.length>e.length){let i=r.segments.slice(0,e.length);return!(!Os(i,e)||t.hasChildren()||!rh(i,e,n))}else if(r.segments.length===e.length){if(!Os(r.segments,e)||!rh(r.segments,e,n))return!1;for(let i in t.children)if(!r.children[i]||!L1(r.children[i],t.children[i],n))return!1;return!0}else{let i=e.slice(0,r.segments.length),s=e.slice(r.segments.length);return!Os(r.segments,i)||!rh(r.segments,i,n)||!r.children[fe]?!1:N1(r.children[fe],t,s,n)}}function rh(r,t,e){return t.every((n,i)=>I1[e](r[i].parameters,n.parameters))}var jr=class{constructor(t=new ke([],{}),e={},n=null){this.root=t,this.queryParams=e,this.fragment=n}get queryParamMap(){return this._queryParamMap??=Bo(this.queryParams),this._queryParamMap}toString(){return X_.serialize(this)}},ke=class{constructor(t,e){this.segments=t,this.children=e,this.parent=null,Object.values(e).forEach(n=>n.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return sh(this)}},Is=class{constructor(t,e){this.path=t,this.parameters=e}get parameterMap(){return this._parameterMap??=Bo(this.parameters),this._parameterMap}toString(){return V1(this)}};function W_(r,t){return Os(r,t)&&r.every((e,n)=>ir(e.parameters,t[n].parameters))}function Os(r,t){return r.length!==t.length?!1:r.every((e,n)=>e.path===t[n].path)}function j_(r,t){let e=[];return Object.entries(r.children).forEach(([n,i])=>{n===fe&&(e=e.concat(t(i,n)))}),Object.entries(r.children).forEach(([n,i])=>{n!==fe&&(e=e.concat(t(i,n)))}),e}var ef=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:()=>new ah,providedIn:"root"});let r=t;return r})(),ah=class{parse(t){let e=new Fd(t);return new jr(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(t){let e=`/${bc(t.root,!0)}`,n=$_(t.queryParams),i=typeof t.fragment=="string"?`#${Y_(t.fragment)}`:"";return`${e}${n}${i}`}},X_=new ah;function sh(r){return r.segments.map(t=>V1(t)).join("/")}function bc(r,t){if(!r.hasChildren())return sh(r);if(t){let e=r.children[fe]?bc(r.children[fe],!1):"",n=[];return Object.entries(r.children).forEach(([i,s])=>{i!==fe&&n.push(`${i}:${bc(s,!1)}`)}),n.length>0?`${e}(${n.join("//")})`:e}else{let e=j_(r,(n,i)=>i===fe?[bc(r.children[fe],!1)]:[`${i}:${bc(n,!1)}`]);return Object.keys(r.children).length===1&&r.children[fe]!=null?`${sh(r)}/${e[0]}`:`${sh(r)}/(${e.join("//")})`}}function U1(r){return encodeURIComponent(r).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function nh(r){return U1(r).replace(/%3B/gi,";")}function Y_(r){return encodeURI(r)}function Td(r){return U1(r).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function oh(r){return decodeURIComponent(r)}function B1(r){return oh(r.replace(/\+/g,"%20"))}function V1(r){return`${Td(r.path)}${q_(r.parameters)}`}function q_(r){return Object.entries(r).map(([t,e])=>`;${Td(t)}=${Td(e)}`).join("")}function $_(r){let t=Object.entries(r).map(([e,n])=>Array.isArray(n)?n.map(i=>`${nh(e)}=${nh(i)}`).join("&"):`${nh(e)}=${nh(n)}`).filter(e=>e);return t.length?`?${t.join("&")}`:""}var Z_=/^[^\/()?;#]+/;function Ad(r){let t=r.match(Z_);return t?t[0]:""}var K_=/^[^\/()?;=#]+/;function J_(r){let t=r.match(K_);return t?t[0]:""}var Q_=/^[^=?&#]+/;function ty(r){let t=r.match(Q_);return t?t[0]:""}var ey=/^[^&#]+/;function ny(r){let t=r.match(ey);return t?t[0]:""}var Fd=class{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),this.remaining===""||this.peekStartsWith("?")||this.peekStartsWith("#")?new ke([],{}):new ke([],this.parseChildren())}parseQueryParams(){let t={};if(this.consumeOptional("?"))do this.parseQueryParam(t);while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(this.remaining==="")return{};this.consumeOptional("/");let t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n[fe]=new ke(t,e)),n}parseSegment(){let t=Ad(this.remaining);if(t===""&&this.peekStartsWith(";"))throw new Ke(4009,!1);return this.capture(t),new Is(oh(t),this.parseMatrixParams())}parseMatrixParams(){let t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){let e=J_(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){let i=Ad(this.remaining);i&&(n=i,this.capture(n))}t[oh(e)]=oh(n)}parseQueryParam(t){let e=ty(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){let o=ny(this.remaining);o&&(n=o,this.capture(n))}let i=B1(e),s=B1(n);if(t.hasOwnProperty(i)){let o=t[i];Array.isArray(o)||(o=[o],t[i]=o),o.push(s)}else t[i]=s}parseParens(t){let e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){let n=Ad(this.remaining),i=this.remaining[n.length];if(i!=="/"&&i!==")"&&i!==";")throw new Ke(4010,!1);let s;n.indexOf(":")>-1?(s=n.slice(0,n.indexOf(":")),this.capture(s),this.capture(":")):t&&(s=fe);let o=this.parseChildren();e[s]=Object.keys(o).length===1?o[fe]:new ke([],o),this.consumeOptional("//")}return e}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return this.peekStartsWith(t)?(this.remaining=this.remaining.substring(t.length),!0):!1}capture(t){if(!this.consumeOptional(t))throw new Ke(4011,!1)}};function z1(r){return r.segments.length>0?new ke([],{[fe]:r}):r}function H1(r){let t={};for(let[n,i]of Object.entries(r.children)){let s=H1(i);if(n===fe&&s.segments.length===0&&s.hasChildren())for(let[o,a]of Object.entries(s.children))t[o]=a;else(s.segments.length>0||s.hasChildren())&&(t[n]=s)}let e=new ke(r.segments,t);return iy(e)}function iy(r){if(r.numberOfChildren===1&&r.children[fe]){let t=r.children[fe];return new ke(r.segments.concat(t.segments),t.children)}return r}function To(r){return r instanceof jr}function ry(r,t,e=null,n=null){let i=G1(r);return W1(i,t,e,n)}function G1(r){let t;function e(s){let o={};for(let c of s.children){let l=e(c);o[c.outlet]=l}let a=new ke(s.url,o);return s===r&&(t=a),a}let n=e(r.root),i=z1(n);return t??i}function W1(r,t,e,n){let i=r;for(;i.parent;)i=i.parent;if(t.length===0)return Sd(i,i,i,e,n);let s=sy(t);if(s.toRoot())return Sd(i,i,new ke([],{}),e,n);let o=oy(s,i,r),a=o.processChildren?wc(o.segmentGroup,o.index,s.commands):X1(o.segmentGroup,o.index,s.commands);return Sd(i,o.segmentGroup,a,e,n)}function ch(r){return typeof r=="object"&&r!=null&&!r.outlets&&!r.segmentPath}function Bc(r){return typeof r=="object"&&r!=null&&r.outlets}function Sd(r,t,e,n,i){let s={};n&&Object.entries(n).forEach(([c,l])=>{s[c]=Array.isArray(l)?l.map(h=>`${h}`):`${l}`});let o;r===t?o=e:o=j1(r,t,e);let a=z1(H1(o));return new jr(a,s,i)}function j1(r,t,e){let n={};return Object.entries(r.children).forEach(([i,s])=>{s===t?n[i]=e:n[i]=j1(s,t,e)}),new ke(r.segments,n)}var lh=class{constructor(t,e,n){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=n,t&&n.length>0&&ch(n[0]))throw new Ke(4003,!1);let i=n.find(Bc);if(i&&i!==R1(n))throw new Ke(4004,!1)}toRoot(){return this.isAbsolute&&this.commands.length===1&&this.commands[0]=="/"}};function sy(r){if(typeof r[0]=="string"&&r.length===1&&r[0]==="/")return new lh(!0,0,r);let t=0,e=!1,n=r.reduce((i,s,o)=>{if(typeof s=="object"&&s!=null){if(s.outlets){let a={};return Object.entries(s.outlets).forEach(([c,l])=>{a[c]=typeof l=="string"?l.split("/"):l}),[...i,{outlets:a}]}if(s.segmentPath)return[...i,s.segmentPath]}return typeof s!="string"?[...i,s]:o===0?(s.split("/").forEach((a,c)=>{c==0&&a==="."||(c==0&&a===""?e=!0:a===".."?t++:a!=""&&i.push(a))}),i):[...i,s]},[]);return new lh(e,t,n)}var Mo=class{constructor(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n}};function oy(r,t,e){if(r.isAbsolute)return new Mo(t,!0,0);if(!e)return new Mo(t,!1,NaN);if(e.parent===null)return new Mo(e,!0,0);let n=ch(r.commands[0])?0:1,i=e.segments.length-1+n;return ay(e,i,r.numberOfDoubleDots)}function ay(r,t,e){let n=r,i=t,s=e;for(;s>i;){if(s-=i,n=n.parent,!n)throw new Ke(4005,!1);i=n.segments.length}return new Mo(n,!1,i-s)}function cy(r){return Bc(r[0])?r[0].outlets:{[fe]:r}}function X1(r,t,e){if(r??=new ke([],{}),r.segments.length===0&&r.hasChildren())return wc(r,t,e);let n=ly(r,t,e),i=e.slice(n.commandIndex);if(n.match&&n.pathIndexs!==fe)&&r.children[fe]&&r.numberOfChildren===1&&r.children[fe].segments.length===0){let s=wc(r.children[fe],t,e);return new ke(r.segments,s.children)}return Object.entries(n).forEach(([s,o])=>{typeof o=="string"&&(o=[o]),o!==null&&(i[s]=X1(r.children[s],t,o))}),Object.entries(r.children).forEach(([s,o])=>{n[s]===void 0&&(i[s]=o)}),new ke(r.segments,i)}}function ly(r,t,e){let n=0,i=t,s={match:!1,pathIndex:0,commandIndex:0};for(;i=e.length)return s;let o=r.segments[i],a=e[n];if(Bc(a))break;let c=`${a}`,l=n0&&c===void 0)break;if(c&&l&&typeof l=="object"&&l.outlets===void 0){if(!F1(c,l,o))return s;n+=2}else{if(!F1(c,{},o))return s;n++}i++}return{match:!0,pathIndex:i,commandIndex:n}}function Pd(r,t,e){let n=r.segments.slice(0,t),i=0;for(;i{typeof n=="string"&&(n=[n]),n!==null&&(t[e]=Pd(new ke([],{}),0,n))}),t}function T1(r){let t={};return Object.entries(r).forEach(([e,n])=>t[e]=`${n}`),t}function F1(r,t,e){return r==e.path&&ir(t,e.parameters)}var Mc="imperative",Sn=function(r){return r[r.NavigationStart=0]="NavigationStart",r[r.NavigationEnd=1]="NavigationEnd",r[r.NavigationCancel=2]="NavigationCancel",r[r.NavigationError=3]="NavigationError",r[r.RoutesRecognized=4]="RoutesRecognized",r[r.ResolveStart=5]="ResolveStart",r[r.ResolveEnd=6]="ResolveEnd",r[r.GuardsCheckStart=7]="GuardsCheckStart",r[r.GuardsCheckEnd=8]="GuardsCheckEnd",r[r.RouteConfigLoadStart=9]="RouteConfigLoadStart",r[r.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",r[r.ChildActivationStart=11]="ChildActivationStart",r[r.ChildActivationEnd=12]="ChildActivationEnd",r[r.ActivationStart=13]="ActivationStart",r[r.ActivationEnd=14]="ActivationEnd",r[r.Scroll=15]="Scroll",r[r.NavigationSkipped=16]="NavigationSkipped",r}(Sn||{}),_i=class{constructor(t,e){this.id=t,this.url=e}},Tc=class extends _i{constructor(t,e,n="imperative",i=null){super(t,e),this.type=Sn.NavigationStart,this.navigationTrigger=n,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}},Ls=class extends _i{constructor(t,e,n){super(t,e),this.urlAfterRedirects=n,this.type=Sn.NavigationEnd}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}},ci=function(r){return r[r.Redirect=0]="Redirect",r[r.SupersededByNewNavigation=1]="SupersededByNewNavigation",r[r.NoDataFromResolver=2]="NoDataFromResolver",r[r.GuardRejected=3]="GuardRejected",r}(ci||{}),kd=function(r){return r[r.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",r[r.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",r}(kd||{}),Xr=class extends _i{constructor(t,e,n,i){super(t,e),this.reason=n,this.code=i,this.type=Sn.NavigationCancel}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}},Ns=class extends _i{constructor(t,e,n,i){super(t,e),this.reason=n,this.code=i,this.type=Sn.NavigationSkipped}},Fc=class extends _i{constructor(t,e,n,i){super(t,e),this.error=n,this.target=i,this.type=Sn.NavigationError}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}},hh=class extends _i{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i,this.type=Sn.RoutesRecognized}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Rd=class extends _i{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i,this.type=Sn.GuardsCheckStart}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Id=class extends _i{constructor(t,e,n,i,s){super(t,e),this.urlAfterRedirects=n,this.state=i,this.shouldActivate=s,this.type=Sn.GuardsCheckEnd}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}},Od=class extends _i{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i,this.type=Sn.ResolveStart}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Ld=class extends _i{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i,this.type=Sn.ResolveEnd}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Nd=class{constructor(t){this.route=t,this.type=Sn.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}},Ud=class{constructor(t){this.route=t,this.type=Sn.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}},Vd=class{constructor(t){this.snapshot=t,this.type=Sn.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},zd=class{constructor(t){this.snapshot=t,this.type=Sn.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Hd=class{constructor(t){this.snapshot=t,this.type=Sn.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Gd=class{constructor(t){this.snapshot=t,this.type=Sn.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}};var Pc=class{},kc=class{constructor(t){this.url=t}};var Wd=class{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new mh,this.attachRef=null}},mh=(()=>{let t=class t{constructor(){this.contexts=new Map}onChildOutletCreated(n,i){let s=this.getOrCreateContext(n);s.outlet=i,this.contexts.set(n,s)}onChildOutletDestroyed(n){let i=this.getContext(n);i&&(i.outlet=null,i.attachRef=null)}onOutletDeactivated(){let n=this.contexts;return this.contexts=new Map,n}onOutletReAttached(n){this.contexts=n}getOrCreateContext(n){let i=this.getContext(n);return i||(i=new Wd,this.contexts.set(n,i)),i}getContext(n){return this.contexts.get(n)||null}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})(),uh=class{constructor(t){this._root=t}get root(){return this._root.value}parent(t){let e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null}children(t){let e=jd(t,this._root);return e?e.children.map(n=>n.value):[]}firstChild(t){let e=jd(t,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(t){let e=Xd(t,this._root);return e.length<2?[]:e[e.length-2].children.map(i=>i.value).filter(i=>i!==t)}pathFromRoot(t){return Xd(t,this._root).map(e=>e.value)}};function jd(r,t){if(r===t.value)return t;for(let e of t.children){let n=jd(r,e);if(n)return n}return null}function Xd(r,t){if(r===t.value)return[t];for(let e of t.children){let n=Xd(r,e);if(n.length)return n.unshift(t),n}return[]}var ai=class{constructor(t,e){this.value=t,this.children=e}toString(){return`TreeNode(${this.value})`}};function wo(r){let t={};return r&&r.children.forEach(e=>t[e.value.outlet]=e),t}var dh=class extends uh{constructor(t,e){super(t),this.snapshot=e,rf(this,t)}toString(){return this.snapshot.toString()}};function Y1(r){let t=uy(r),e=new mi([new Is("",{})]),n=new mi({}),i=new mi({}),s=new mi({}),o=new mi(""),a=new Rn(e,n,s,o,i,fe,r,t.root);return a.snapshot=t.root,new dh(new ai(a,[]),t)}function uy(r){let t={},e={},n={},i="",s=new Rc([],t,n,i,e,fe,r,null,{});return new fh("",new ai(s,[]))}var Rn=class{constructor(t,e,n,i,s,o,a,c){this.urlSubject=t,this.paramsSubject=e,this.queryParamsSubject=n,this.fragmentSubject=i,this.dataSubject=s,this.outlet=o,this.component=a,this._futureSnapshot=c,this.title=this.dataSubject?.pipe(ze(l=>l[Lc]))??de(void 0),this.url=t,this.params=e,this.queryParams=n,this.fragment=i,this.data=s}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(ze(t=>Bo(t))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(ze(t=>Bo(t))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}};function nf(r,t,e="emptyOnly"){let n,{routeConfig:i}=r;return t!==null&&(e==="always"||i?.path===""||!t.component&&!t.routeConfig?.loadComponent)?n={params:Nt(Nt({},t.params),r.params),data:Nt(Nt({},t.data),r.data),resolve:Nt(Nt(Nt(Nt({},r.data),t.data),i?.data),r._resolvedData)}:n={params:Nt({},r.params),data:Nt({},r.data),resolve:Nt(Nt({},r.data),r._resolvedData??{})},i&&$1(i)&&(n.resolve[Lc]=i.title),n}var Rc=class{get title(){return this.data?.[Lc]}constructor(t,e,n,i,s,o,a,c,l){this.url=t,this.params=e,this.queryParams=n,this.fragment=i,this.data=s,this.outlet=o,this.component=a,this.routeConfig=c,this._resolve=l}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=Bo(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=Bo(this.queryParams),this._queryParamMap}toString(){let t=this.url.map(n=>n.toString()).join("/"),e=this.routeConfig?this.routeConfig.path:"";return`Route(url:'${t}', path:'${e}')`}},fh=class extends uh{constructor(t,e){super(e),this.url=t,rf(this,e)}toString(){return q1(this._root)}};function rf(r,t){t.value._routerState=r,t.children.forEach(e=>rf(r,e))}function q1(r){let t=r.children.length>0?` { ${r.children.map(q1).join(", ")} } `:"";return`${r.value}${t}`}function wd(r){if(r.snapshot){let t=r.snapshot,e=r._futureSnapshot;r.snapshot=e,ir(t.queryParams,e.queryParams)||r.queryParamsSubject.next(e.queryParams),t.fragment!==e.fragment&&r.fragmentSubject.next(e.fragment),ir(t.params,e.params)||r.paramsSubject.next(e.params),V_(t.url,e.url)||r.urlSubject.next(e.url),ir(t.data,e.data)||r.dataSubject.next(e.data)}else r.snapshot=r._futureSnapshot,r.dataSubject.next(r._futureSnapshot.data)}function Yd(r,t){let e=ir(r.params,t.params)&&W_(r.url,t.url),n=!r.parent!=!t.parent;return e&&!n&&(!r.parent||Yd(r.parent,t.parent))}function $1(r){return typeof r.title=="string"||r.title===null}var sf=(()=>{let t=class t{constructor(){this.activated=null,this._activatedRoute=null,this.name=fe,this.activateEvents=new jt,this.deactivateEvents=new jt,this.attachEvents=new jt,this.detachEvents=new jt,this.parentContexts=le(mh),this.location=le(s1),this.changeDetector=le(Rs),this.environmentInjector=le(Xl),this.inputBinder=le(of,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(n){if(n.name){let{firstChange:i,previousValue:s}=n.name;if(i)return;this.isTrackedInParentContexts(s)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(s)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(n){return this.parentContexts.getContext(n)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;let n=this.parentContexts.getContext(this.name);n?.route&&(n.attachRef?this.attach(n.attachRef,n.route):this.activateWith(n.route,n.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Ke(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Ke(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Ke(4012,!1);this.location.detach();let n=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(n.instance),n}attach(n,i){this.activated=n,this._activatedRoute=i,this.location.insert(n.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(n.instance)}deactivate(){if(this.activated){let n=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(n)}}activateWith(n,i){if(this.isActivated)throw new Ke(4013,!1);this._activatedRoute=n;let s=this.location,a=n.snapshot.component,c=this.parentContexts.getOrCreateContext(this.name).children,l=new qd(n,c,s.injector);this.activated=s.createComponent(a,{index:s.length,injector:l,environmentInjector:i??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}};t.\u0275fac=function(i){return new(i||t)},t.\u0275dir=Wr({type:t,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[Yl]});let r=t;return r})(),qd=class r{__ngOutletInjector(t){return new r(this.route,this.childContexts,t)}constructor(t,e,n){this.route=t,this.childContexts=e,this.parent=n}get(t,e){return t===Rn?this.route:t===mh?this.childContexts:this.parent.get(t,e)}},of=new yn("");function dy(r,t,e){let n=Ic(r,t._root,e?e._root:void 0);return new dh(n,t)}function Ic(r,t,e){if(e&&r.shouldReuseRoute(t.value,e.value.snapshot)){let n=e.value;n._futureSnapshot=t.value;let i=fy(r,t,e);return new ai(n,i)}else{if(r.shouldAttach(t.value)){let s=r.retrieve(t.value);if(s!==null){let o=s.route;return o.value._futureSnapshot=t.value,o.children=t.children.map(a=>Ic(r,a)),o}}let n=xy(t.value),i=t.children.map(s=>Ic(r,s));return new ai(n,i)}}function fy(r,t,e){return t.children.map(n=>{for(let i of e.children)if(r.shouldReuseRoute(n.value,i.value.snapshot))return Ic(r,n,i);return Ic(r,n)})}function xy(r){return new Rn(new mi(r.url),new mi(r.params),new mi(r.queryParams),new mi(r.fragment),new mi(r.data),r.outlet,r.component,r)}var Z1="ngNavigationCancelingError";function K1(r,t){let{redirectTo:e,navigationBehaviorOptions:n}=To(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,i=J1(!1,ci.Redirect);return i.url=e,i.navigationBehaviorOptions=n,i}function J1(r,t){let e=new Error(`NavigationCancelingError: ${r||""}`);return e[Z1]=!0,e.cancellationCode=t,e}function py(r){return Q1(r)&&To(r.url)}function Q1(r){return!!r&&r[Z1]}var my=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["ng-component"]],standalone:!0,features:[Et],decls:1,vars:0,template:function(i,s){i&1&&Ct(0,"router-outlet")},dependencies:[sf],encapsulation:2});let r=t;return r})();function gy(r,t){return r.providers&&!r._injector&&(r._injector=a1(r.providers,t,`Route: ${r.path}`)),r._injector??t}function af(r){let t=r.children&&r.children.map(af),e=t?Ze(Nt({},r),{children:t}):Nt({},r);return!e.component&&!e.loadComponent&&(t||e.loadChildren)&&e.outlet&&e.outlet!==fe&&(e.component=my),e}function rr(r){return r.outlet||fe}function Cy(r,t){let e=r.filter(n=>rr(n)===t);return e.push(...r.filter(n=>rr(n)!==t)),e}function Nc(r){if(!r)return null;if(r.routeConfig?._injector)return r.routeConfig._injector;for(let t=r.parent;t;t=t.parent){let e=t.routeConfig;if(e?._loadedInjector)return e._loadedInjector;if(e?._injector)return e._injector}return null}var vy=(r,t,e,n)=>ze(i=>(new $d(t,i.targetRouterState,i.currentRouterState,e,n).activate(r),i)),$d=class{constructor(t,e,n,i,s){this.routeReuseStrategy=t,this.futureState=e,this.currState=n,this.forwardEvent=i,this.inputBindingEnabled=s}activate(t){let e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,t),wd(this.futureState.root),this.activateChildRoutes(e,n,t)}deactivateChildRoutes(t,e,n){let i=wo(e);t.children.forEach(s=>{let o=s.value.outlet;this.deactivateRoutes(s,i[o],n),delete i[o]}),Object.values(i).forEach(s=>{this.deactivateRouteAndItsChildren(s,n)})}deactivateRoutes(t,e,n){let i=t.value,s=e?e.value:null;if(i===s)if(i.component){let o=n.getContext(i.outlet);o&&this.deactivateChildRoutes(t,e,o.children)}else this.deactivateChildRoutes(t,e,n);else s&&this.deactivateRouteAndItsChildren(e,n)}deactivateRouteAndItsChildren(t,e){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)}detachAndStoreRouteSubtree(t,e){let n=e.getContext(t.value.outlet),i=n&&t.value.component?n.children:e,s=wo(t);for(let o of Object.values(s))this.deactivateRouteAndItsChildren(o,i);if(n&&n.outlet){let o=n.outlet.detach(),a=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:o,route:t,contexts:a})}}deactivateRouteAndOutlet(t,e){let n=e.getContext(t.value.outlet),i=n&&t.value.component?n.children:e,s=wo(t);for(let o of Object.values(s))this.deactivateRouteAndItsChildren(o,i);n&&(n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated()),n.attachRef=null,n.route=null)}activateChildRoutes(t,e,n){let i=wo(e);t.children.forEach(s=>{this.activateRoutes(s,i[s.value.outlet],n),this.forwardEvent(new Gd(s.value.snapshot))}),t.children.length&&this.forwardEvent(new zd(t.value.snapshot))}activateRoutes(t,e,n){let i=t.value,s=e?e.value:null;if(wd(i),i===s)if(i.component){let o=n.getOrCreateContext(i.outlet);this.activateChildRoutes(t,e,o.children)}else this.activateChildRoutes(t,e,n);else if(i.component){let o=n.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){let a=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),o.children.onOutletReAttached(a.contexts),o.attachRef=a.componentRef,o.route=a.route.value,o.outlet&&o.outlet.attach(a.componentRef,a.route.value),wd(a.route.value),this.activateChildRoutes(t,null,o.children)}else{let a=Nc(i.snapshot);o.attachRef=null,o.route=i,o.injector=a,o.outlet&&o.outlet.activateWith(i,o.injector),this.activateChildRoutes(t,null,o.children)}}else this.activateChildRoutes(t,null,n)}},xh=class{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}},Do=class{constructor(t,e){this.component=t,this.route=e}};function Ey(r,t,e){let n=r._root,i=t?t._root:null;return Ac(n,i,e,[n.value])}function _y(r){let t=r.routeConfig?r.routeConfig.canActivateChild:null;return!t||t.length===0?null:{node:r,guards:t}}function Po(r,t){let e=Symbol(),n=t.get(r,e);return n===e?typeof r=="function"&&!Wm(r)?r:t.get(r):n}function Ac(r,t,e,n,i={canDeactivateChecks:[],canActivateChecks:[]}){let s=wo(t);return r.children.forEach(o=>{yy(o,s[o.value.outlet],e,n.concat([o.value]),i),delete s[o.value.outlet]}),Object.entries(s).forEach(([o,a])=>Dc(a,e.getContext(o),i)),i}function yy(r,t,e,n,i={canDeactivateChecks:[],canActivateChecks:[]}){let s=r.value,o=t?t.value:null,a=e?e.getContext(r.value.outlet):null;if(o&&s.routeConfig===o.routeConfig){let c=by(o,s,s.routeConfig.runGuardsAndResolvers);c?i.canActivateChecks.push(new xh(n)):(s.data=o.data,s._resolvedData=o._resolvedData),s.component?Ac(r,t,a?a.children:null,n,i):Ac(r,t,e,n,i),c&&a&&a.outlet&&a.outlet.isActivated&&i.canDeactivateChecks.push(new Do(a.outlet.component,o))}else o&&Dc(t,a,i),i.canActivateChecks.push(new xh(n)),s.component?Ac(r,null,a?a.children:null,n,i):Ac(r,null,e,n,i);return i}function by(r,t,e){if(typeof e=="function")return e(r,t);switch(e){case"pathParamsChange":return!Os(r.url,t.url);case"pathParamsOrQueryParamsChange":return!Os(r.url,t.url)||!ir(r.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Yd(r,t)||!ir(r.queryParams,t.queryParams);case"paramsChange":default:return!Yd(r,t)}}function Dc(r,t,e){let n=wo(r),i=r.value;Object.entries(n).forEach(([s,o])=>{i.component?t?Dc(o,t.children.getContext(s),e):Dc(o,null,e):Dc(o,t,e)}),i.component?t&&t.outlet&&t.outlet.isActivated?e.canDeactivateChecks.push(new Do(t.outlet.component,i)):e.canDeactivateChecks.push(new Do(null,i)):e.canDeactivateChecks.push(new Do(null,i))}function Uc(r){return typeof r=="function"}function Ay(r){return typeof r=="boolean"}function Sy(r){return r&&Uc(r.canLoad)}function wy(r){return r&&Uc(r.canActivate)}function My(r){return r&&Uc(r.canActivateChild)}function Dy(r){return r&&Uc(r.canDeactivate)}function By(r){return r&&Uc(r.canMatch)}function tg(r){return r instanceof Om||r?.name==="EmptyError"}var ih=Symbol("INITIAL_VALUE");function Fo(){return nr(r=>K0(r.map(t=>t.pipe(Eo(1),Hm(ih)))).pipe(ze(t=>{for(let e of t)if(e!==!0){if(e===ih)return ih;if(e===!1||e instanceof jr)return e}return!0}),Co(t=>t!==ih),Eo(1)))}function Ty(r,t){return gi(e=>{let{targetSnapshot:n,currentSnapshot:i,guards:{canActivateChecks:s,canDeactivateChecks:o}}=e;return o.length===0&&s.length===0?de(Ze(Nt({},e),{guardsResult:!0})):Fy(o,n,i,r).pipe(gi(a=>a&&Ay(a)?Py(n,s,r,t):de(a)),ze(a=>Ze(Nt({},e),{guardsResult:a})))})}function Fy(r,t,e,n){return si(r).pipe(gi(i=>Ly(i.component,i.route,e,t,n)),Gr(i=>i!==!0,!0))}function Py(r,t,e,n){return si(t).pipe(lc(i=>Lm(Ry(i.route.parent,n),ky(i.route,n),Oy(r,i.path,e),Iy(r,i.route,e))),Gr(i=>i!==!0,!0))}function ky(r,t){return r!==null&&t&&t(new Hd(r)),de(!0)}function Ry(r,t){return r!==null&&t&&t(new Vd(r)),de(!0)}function Iy(r,t,e){let n=t.routeConfig?t.routeConfig.canActivate:null;if(!n||n.length===0)return de(!0);let i=n.map(s=>J0(()=>{let o=Nc(t)??e,a=Po(s,o),c=wy(a)?a.canActivate(t,r):Ps(o,()=>a(t,r));return Yr(c).pipe(Gr())}));return de(i).pipe(Fo())}function Oy(r,t,e){let n=t[t.length-1],s=t.slice(0,t.length-1).reverse().map(o=>_y(o)).filter(o=>o!==null).map(o=>J0(()=>{let a=o.guards.map(c=>{let l=Nc(o.node)??e,h=Po(c,l),u=My(h)?h.canActivateChild(n,r):Ps(l,()=>h(n,r));return Yr(u).pipe(Gr())});return de(a).pipe(Fo())}));return de(s).pipe(Fo())}function Ly(r,t,e,n,i){let s=t&&t.routeConfig?t.routeConfig.canDeactivate:null;if(!s||s.length===0)return de(!0);let o=s.map(a=>{let c=Nc(t)??i,l=Po(a,c),h=Dy(l)?l.canDeactivate(r,t,e,n):Ps(c,()=>l(r,t,e,n));return Yr(h).pipe(Gr())});return de(o).pipe(Fo())}function Ny(r,t,e,n){let i=t.canLoad;if(i===void 0||i.length===0)return de(!0);let s=i.map(o=>{let a=Po(o,r),c=Sy(a)?a.canLoad(t,e):Ps(r,()=>a(t,e));return Yr(c)});return de(s).pipe(Fo(),eg(n))}function eg(r){return Rm(kn(t=>{if(To(t))throw K1(r,t)}),ze(t=>t===!0))}function Uy(r,t,e,n){let i=t.canMatch;if(!i||i.length===0)return de(!0);let s=i.map(o=>{let a=Po(o,r),c=By(a)?a.canMatch(t,e):Ps(r,()=>a(t,e));return Yr(c)});return de(s).pipe(Fo(),eg(n))}var Oc=class{constructor(t){this.segmentGroup=t||null}},ph=class extends Error{constructor(t){super(),this.urlTree=t}};function So(r){return cc(new Oc(r))}function Vy(r){return cc(new Ke(4e3,!1))}function zy(r){return cc(J1(!1,ci.GuardRejected))}var Zd=class{constructor(t,e){this.urlSerializer=t,this.urlTree=e}lineralizeSegments(t,e){let n=[],i=e.root;for(;;){if(n=n.concat(i.segments),i.numberOfChildren===0)return de(n);if(i.numberOfChildren>1||!i.children[fe])return Vy(t.redirectTo);i=i.children[fe]}}applyRedirectCommands(t,e,n){let i=this.applyRedirectCreateUrlTree(e,this.urlSerializer.parse(e),t,n);if(e.startsWith("/"))throw new ph(i);return i}applyRedirectCreateUrlTree(t,e,n,i){let s=this.createSegmentGroup(t,e.root,n,i);return new jr(s,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(t,e){let n={};return Object.entries(t).forEach(([i,s])=>{if(typeof s=="string"&&s.startsWith(":")){let a=s.substring(1);n[i]=e[a]}else n[i]=s}),n}createSegmentGroup(t,e,n,i){let s=this.createSegments(t,e.segments,n,i),o={};return Object.entries(e.children).forEach(([a,c])=>{o[a]=this.createSegmentGroup(t,c,n,i)}),new ke(s,o)}createSegments(t,e,n,i){return e.map(s=>s.path.startsWith(":")?this.findPosParam(t,s,i):this.findOrReturn(s,n))}findPosParam(t,e,n){let i=n[e.path.substring(1)];if(!i)throw new Ke(4001,!1);return i}findOrReturn(t,e){let n=0;for(let i of e){if(i.path===t.path)return e.splice(n),i;n++}return t}},Kd={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function Hy(r,t,e,n,i){let s=cf(r,t,e);return s.matched?(n=gy(t,n),Uy(n,t,e,i).pipe(ze(o=>o===!0?s:Nt({},Kd)))):de(s)}function cf(r,t,e){if(t.path==="**")return Gy(e);if(t.path==="")return t.pathMatch==="full"&&(r.hasChildren()||e.length>0)?Nt({},Kd):{matched:!0,consumedSegments:[],remainingSegments:e,parameters:{},positionalParamSegments:{}};let i=(t.matcher||U_)(e,r,t);if(!i)return Nt({},Kd);let s={};Object.entries(i.posParams??{}).forEach(([a,c])=>{s[a]=c.path});let o=i.consumed.length>0?Nt(Nt({},s),i.consumed[i.consumed.length-1].parameters):s;return{matched:!0,consumedSegments:i.consumed,remainingSegments:e.slice(i.consumed.length),parameters:o,positionalParamSegments:i.posParams??{}}}function Gy(r){return{matched:!0,parameters:r.length>0?R1(r).parameters:{},consumedSegments:r,remainingSegments:[],positionalParamSegments:{}}}function P1(r,t,e,n){return e.length>0&&Xy(r,e,n)?{segmentGroup:new ke(t,jy(n,new ke(e,r.children))),slicedSegments:[]}:e.length===0&&Yy(r,e,n)?{segmentGroup:new ke(r.segments,Wy(r,e,n,r.children)),slicedSegments:e}:{segmentGroup:new ke(r.segments,r.children),slicedSegments:e}}function Wy(r,t,e,n){let i={};for(let s of e)if(gh(r,t,s)&&!n[rr(s)]){let o=new ke([],{});i[rr(s)]=o}return Nt(Nt({},n),i)}function jy(r,t){let e={};e[fe]=t;for(let n of r)if(n.path===""&&rr(n)!==fe){let i=new ke([],{});e[rr(n)]=i}return e}function Xy(r,t,e){return e.some(n=>gh(r,t,n)&&rr(n)!==fe)}function Yy(r,t,e){return e.some(n=>gh(r,t,n))}function gh(r,t,e){return(r.hasChildren()||t.length>0)&&e.pathMatch==="full"?!1:e.path===""}function qy(r,t,e,n){return rr(r)!==n&&(n===fe||!gh(t,e,r))?!1:cf(t,r,e).matched}function $y(r,t,e){return t.length===0&&!r.children[e]}var Jd=class{};function Zy(r,t,e,n,i,s,o="emptyOnly"){return new Qd(r,t,e,n,i,o,s).recognize()}var Ky=31,Qd=class{constructor(t,e,n,i,s,o,a){this.injector=t,this.configLoader=e,this.rootComponentType=n,this.config=i,this.urlTree=s,this.paramsInheritanceStrategy=o,this.urlSerializer=a,this.applyRedirects=new Zd(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(t){return new Ke(4002,`'${t.segmentGroup}'`)}recognize(){let t=P1(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(t).pipe(ze(e=>{let n=new Rc([],Object.freeze({}),Object.freeze(Nt({},this.urlTree.queryParams)),this.urlTree.fragment,{},fe,this.rootComponentType,null,{}),i=new ai(n,e),s=new fh("",i),o=ry(n,[],this.urlTree.queryParams,this.urlTree.fragment);return o.queryParams=this.urlTree.queryParams,s.url=this.urlSerializer.serialize(o),this.inheritParamsAndData(s._root,null),{state:s,tree:o}}))}match(t){return this.processSegmentGroup(this.injector,this.config,t,fe).pipe(vo(n=>{if(n instanceof ph)return this.urlTree=n.urlTree,this.match(n.urlTree.root);throw n instanceof Oc?this.noMatchError(n):n}))}inheritParamsAndData(t,e){let n=t.value,i=nf(n,e,this.paramsInheritanceStrategy);n.params=Object.freeze(i.params),n.data=Object.freeze(i.data),t.children.forEach(s=>this.inheritParamsAndData(s,n))}processSegmentGroup(t,e,n,i){return n.segments.length===0&&n.hasChildren()?this.processChildren(t,e,n):this.processSegment(t,e,n,n.segments,i,!0).pipe(ze(s=>s instanceof ai?[s]:[]))}processChildren(t,e,n){let i=[];for(let s of Object.keys(n.children))s==="primary"?i.unshift(s):i.push(s);return si(i).pipe(lc(s=>{let o=n.children[s],a=Cy(e,s);return this.processSegmentGroup(t,a,o,s)}),zm((s,o)=>(s.push(...o),s)),Q0(null),Vm(),gi(s=>{if(s===null)return So(n);let o=ng(s);return Jy(o),de(o)}))}processSegment(t,e,n,i,s,o){return si(e).pipe(lc(a=>this.processSegmentAgainstRoute(a._injector??t,e,a,n,i,s,o).pipe(vo(c=>{if(c instanceof Oc)return de(null);throw c}))),Gr(a=>!!a),vo(a=>{if(tg(a))return $y(n,i,s)?de(new Jd):So(n);throw a}))}processSegmentAgainstRoute(t,e,n,i,s,o,a){return qy(n,i,s,o)?n.redirectTo===void 0?this.matchSegmentAgainstRoute(t,i,n,s,o):this.allowRedirects&&a?this.expandSegmentAgainstRouteUsingRedirect(t,i,e,n,s,o):So(i):So(i)}expandSegmentAgainstRouteUsingRedirect(t,e,n,i,s,o){let{matched:a,consumedSegments:c,positionalParamSegments:l,remainingSegments:h}=cf(e,i,s);if(!a)return So(e);i.redirectTo.startsWith("/")&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>Ky&&(this.allowRedirects=!1));let u=this.applyRedirects.applyRedirectCommands(c,i.redirectTo,l);return this.applyRedirects.lineralizeSegments(i,u).pipe(gi(d=>this.processSegment(t,n,e,d.concat(h),o,!1)))}matchSegmentAgainstRoute(t,e,n,i,s){let o=Hy(e,n,i,t,this.urlSerializer);return n.path==="**"&&(e.children={}),o.pipe(nr(a=>a.matched?(t=n._injector??t,this.getChildConfig(t,n,i).pipe(nr(({routes:c})=>{let l=n._loadedInjector??t,{consumedSegments:h,remainingSegments:u,parameters:d}=a,f=new Rc(h,d,Object.freeze(Nt({},this.urlTree.queryParams)),this.urlTree.fragment,t8(n),rr(n),n.component??n._loadedComponent??null,n,e8(n)),{segmentGroup:m,slicedSegments:g}=P1(e,h,u,c);if(g.length===0&&m.hasChildren())return this.processChildren(l,c,m).pipe(ze(p=>p===null?null:new ai(f,p)));if(c.length===0&&g.length===0)return de(new ai(f,[]));let x=rr(n)===s;return this.processSegment(l,c,m,g,x?fe:s,!0).pipe(ze(p=>new ai(f,p instanceof ai?[p]:[])))}))):So(e)))}getChildConfig(t,e,n){return e.children?de({routes:e.children,injector:t}):e.loadChildren?e._loadedRoutes!==void 0?de({routes:e._loadedRoutes,injector:e._loadedInjector}):Ny(t,e,n,this.urlSerializer).pipe(gi(i=>i?this.configLoader.loadChildren(t,e).pipe(kn(s=>{e._loadedRoutes=s.routes,e._loadedInjector=s.injector})):zy(e))):de({routes:[],injector:t})}};function Jy(r){r.sort((t,e)=>t.value.outlet===fe?-1:e.value.outlet===fe?1:t.value.outlet.localeCompare(e.value.outlet))}function Qy(r){let t=r.value.routeConfig;return t&&t.path===""}function ng(r){let t=[],e=new Set;for(let n of r){if(!Qy(n)){t.push(n);continue}let i=t.find(s=>n.value.routeConfig===s.value.routeConfig);i!==void 0?(i.children.push(...n.children),e.add(i)):t.push(n)}for(let n of e){let i=ng(n.children);t.push(new ai(n.value,i))}return t.filter(n=>!e.has(n))}function t8(r){return r.data||{}}function e8(r){return r.resolve||{}}function n8(r,t,e,n,i,s){return gi(o=>Zy(r,t,e,n,o.extractedUrl,i,s).pipe(ze(({state:a,tree:c})=>Ze(Nt({},o),{targetSnapshot:a,urlAfterRedirects:c}))))}function i8(r,t){return gi(e=>{let{targetSnapshot:n,guards:{canActivateChecks:i}}=e;if(!i.length)return de(e);let s=new Set(i.map(c=>c.route)),o=new Set;for(let c of s)if(!o.has(c))for(let l of ig(c))o.add(l);let a=0;return si(o).pipe(lc(c=>s.has(c)?r8(c,n,r,t):(c.data=nf(c,c.parent,r).resolve,de(void 0))),kn(()=>a++),td(1),gi(c=>a===o.size?de(e):Hr))})}function ig(r){let t=r.children.map(e=>ig(e)).flat();return[r,...t]}function r8(r,t,e,n){let i=r.routeConfig,s=r._resolve;return i?.title!==void 0&&!$1(i)&&(s[Lc]=i.title),s8(s,r,t,n).pipe(ze(o=>(r._resolvedData=o,r.data=nf(r,r.parent,e).resolve,null)))}function s8(r,t,e,n){let i=Bd(r);if(i.length===0)return de({});let s={};return si(i).pipe(gi(o=>o8(r[o],t,e,n).pipe(Gr(),kn(a=>{s[o]=a}))),td(1),Um(s),vo(o=>tg(o)?Hr:cc(o)))}function o8(r,t,e,n){let i=Nc(t)??n,s=Po(r,i),o=s.resolve?s.resolve(t,e):Ps(i,()=>s(t,e));return Yr(o)}function Md(r){return nr(t=>{let e=r(t);return e?si(e).pipe(ze(()=>t)):de(t)})}var rg=(()=>{let t=class t{buildTitle(n){let i,s=n.root;for(;s!==void 0;)i=this.getResolvedTitleForRoute(s)??i,s=s.children.find(o=>o.outlet===fe);return i}getResolvedTitleForRoute(n){return n.data[Lc]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:()=>le(a8),providedIn:"root"});let r=t;return r})(),a8=(()=>{let t=class t extends rg{constructor(n){super(),this.title=n}updateTitle(n){let i=this.buildTitle(n);i!==void 0&&this.title.setTitle(i)}};t.\u0275fac=function(i){return new(i||t)(Le(w1))},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})(),lf=new yn("",{providedIn:"root",factory:()=>({})}),hf=new yn(""),c8=(()=>{let t=class t{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=le(fd)}loadComponent(n){if(this.componentLoaders.get(n))return this.componentLoaders.get(n);if(n._loadedComponent)return de(n._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(n);let i=Yr(n.loadComponent()).pipe(ze(sg),kn(o=>{this.onLoadEndListener&&this.onLoadEndListener(n),n._loadedComponent=o}),jl(()=>{this.componentLoaders.delete(n)})),s=new Z0(i,()=>new Fs).pipe($0());return this.componentLoaders.set(n,s),s}loadChildren(n,i){if(this.childrenLoaders.get(i))return this.childrenLoaders.get(i);if(i._loadedRoutes)return de({routes:i._loadedRoutes,injector:i._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(i);let o=l8(i,this.compiler,n,this.onLoadEndListener).pipe(jl(()=>{this.childrenLoaders.delete(i)})),a=new Z0(o,()=>new Fs).pipe($0());return this.childrenLoaders.set(i,a),a}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();function l8(r,t,e,n){return Yr(r.loadChildren()).pipe(ze(sg),gi(i=>i instanceof o1||Array.isArray(i)?de(i):si(t.compileModuleAsync(i))),ze(i=>{n&&n(r);let s,o,a=!1;return Array.isArray(i)?(o=i,a=!0):(s=i.create(e).injector,o=s.get(hf,[],{optional:!0,self:!0}).flat()),{routes:o.map(af),injector:s}}))}function h8(r){return r&&typeof r=="object"&&"default"in r}function sg(r){return h8(r)?r.default:r}var uf=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:()=>le(u8),providedIn:"root"});let r=t;return r})(),u8=(()=>{let t=class t{shouldProcessUrl(n){return!0}extract(n){return n}merge(n,i){return n}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})(),d8=new yn("");var f8=(()=>{let t=class t{get hasRequestedNavigation(){return this.navigationId!==0}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new Fs,this.transitionAbortSubject=new Fs,this.configLoader=le(c8),this.environmentInjector=le(Xl),this.urlSerializer=le(ef),this.rootContexts=le(mh),this.location=le(Ei),this.inputBindingEnabled=le(of,{optional:!0})!==null,this.titleStrategy=le(rg),this.options=le(lf,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=le(uf),this.createViewTransition=le(d8,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>de(void 0),this.rootComponentType=null;let n=s=>this.events.next(new Nd(s)),i=s=>this.events.next(new Ud(s));this.configLoader.onLoadEndListener=i,this.configLoader.onLoadStartListener=n}complete(){this.transitions?.complete()}handleNavigationRequest(n){let i=++this.navigationId;this.transitions?.next(Ze(Nt(Nt({},this.transitions.value),n),{id:i}))}setupNavigations(n,i,s){return this.transitions=new mi({id:0,currentUrlTree:i,currentRawUrl:i,extractedUrl:this.urlHandlingStrategy.extract(i),urlAfterRedirects:this.urlHandlingStrategy.extract(i),rawUrl:i,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:Mc,restoredState:null,currentSnapshot:s.snapshot,targetSnapshot:null,currentRouterState:s,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(Co(o=>o.id!==0),ze(o=>Ze(Nt({},o),{extractedUrl:this.urlHandlingStrategy.extract(o.rawUrl)})),nr(o=>{let a=!1,c=!1;return de(o).pipe(nr(l=>{if(this.navigationId>o.id)return this.cancelNavigationTransition(o,"",ci.SupersededByNewNavigation),Hr;this.currentTransition=o,this.currentNavigation={id:l.id,initialUrl:l.rawUrl,extractedUrl:l.extractedUrl,trigger:l.source,extras:l.extras,previousNavigation:this.lastSuccessfulNavigation?Ze(Nt({},this.lastSuccessfulNavigation),{previousNavigation:null}):null};let h=!n.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl(),u=l.extras.onSameUrlNavigation??n.onSameUrlNavigation;if(!h&&u!=="reload"){let d="";return this.events.next(new Ns(l.id,this.urlSerializer.serialize(l.rawUrl),d,kd.IgnoredSameUrlNavigation)),l.resolve(null),Hr}if(this.urlHandlingStrategy.shouldProcessUrl(l.rawUrl))return de(l).pipe(nr(d=>{let f=this.transitions?.getValue();return this.events.next(new Tc(d.id,this.urlSerializer.serialize(d.extractedUrl),d.source,d.restoredState)),f!==this.transitions?.getValue()?Hr:Promise.resolve(d)}),n8(this.environmentInjector,this.configLoader,this.rootComponentType,n.config,this.urlSerializer,this.paramsInheritanceStrategy),kn(d=>{o.targetSnapshot=d.targetSnapshot,o.urlAfterRedirects=d.urlAfterRedirects,this.currentNavigation=Ze(Nt({},this.currentNavigation),{finalUrl:d.urlAfterRedirects});let f=new hh(d.id,this.urlSerializer.serialize(d.extractedUrl),this.urlSerializer.serialize(d.urlAfterRedirects),d.targetSnapshot);this.events.next(f)}));if(h&&this.urlHandlingStrategy.shouldProcessUrl(l.currentRawUrl)){let{id:d,extractedUrl:f,source:m,restoredState:g,extras:x}=l,p=new Tc(d,this.urlSerializer.serialize(f),m,g);this.events.next(p);let C=Y1(this.rootComponentType).snapshot;return this.currentTransition=o=Ze(Nt({},l),{targetSnapshot:C,urlAfterRedirects:f,extras:Ze(Nt({},x),{skipLocationChange:!1,replaceUrl:!1})}),this.currentNavigation.finalUrl=f,de(o)}else{let d="";return this.events.next(new Ns(l.id,this.urlSerializer.serialize(l.extractedUrl),d,kd.IgnoredByUrlHandlingStrategy)),l.resolve(null),Hr}}),kn(l=>{let h=new Rd(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(h)}),ze(l=>(this.currentTransition=o=Ze(Nt({},l),{guards:Ey(l.targetSnapshot,l.currentSnapshot,this.rootContexts)}),o)),Ty(this.environmentInjector,l=>this.events.next(l)),kn(l=>{if(o.guardsResult=l.guardsResult,To(l.guardsResult))throw K1(this.urlSerializer,l.guardsResult);let h=new Id(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot,!!l.guardsResult);this.events.next(h)}),Co(l=>l.guardsResult?!0:(this.cancelNavigationTransition(l,"",ci.GuardRejected),!1)),Md(l=>{if(l.guards.canActivateChecks.length)return de(l).pipe(kn(h=>{let u=new Od(h.id,this.urlSerializer.serialize(h.extractedUrl),this.urlSerializer.serialize(h.urlAfterRedirects),h.targetSnapshot);this.events.next(u)}),nr(h=>{let u=!1;return de(h).pipe(i8(this.paramsInheritanceStrategy,this.environmentInjector),kn({next:()=>u=!0,complete:()=>{u||this.cancelNavigationTransition(h,"",ci.NoDataFromResolver)}}))}),kn(h=>{let u=new Ld(h.id,this.urlSerializer.serialize(h.extractedUrl),this.urlSerializer.serialize(h.urlAfterRedirects),h.targetSnapshot);this.events.next(u)}))}),Md(l=>{let h=u=>{let d=[];u.routeConfig?.loadComponent&&!u.routeConfig._loadedComponent&&d.push(this.configLoader.loadComponent(u.routeConfig).pipe(kn(f=>{u.component=f}),ze(()=>{})));for(let f of u.children)d.push(...h(f));return d};return K0(h(l.targetSnapshot.root)).pipe(Q0(null),Eo(1))}),Md(()=>this.afterPreactivation()),nr(()=>{let{currentSnapshot:l,targetSnapshot:h}=o,u=this.createViewTransition?.(this.environmentInjector,l.root,h.root);return u?si(u).pipe(ze(()=>o)):de(o)}),ze(l=>{let h=dy(n.routeReuseStrategy,l.targetSnapshot,l.currentRouterState);return this.currentTransition=o=Ze(Nt({},l),{targetRouterState:h}),this.currentNavigation.targetRouterState=h,o}),kn(()=>{this.events.next(new Pc)}),vy(this.rootContexts,n.routeReuseStrategy,l=>this.events.next(l),this.inputBindingEnabled),Eo(1),kn({next:l=>{a=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Ls(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects))),this.titleStrategy?.updateTitle(l.targetRouterState.snapshot),l.resolve(!0)},complete:()=>{a=!0}}),Gm(this.transitionAbortSubject.pipe(kn(l=>{throw l}))),jl(()=>{!a&&!c&&this.cancelNavigationTransition(o,"",ci.SupersededByNewNavigation),this.currentTransition?.id===o.id&&(this.currentNavigation=null,this.currentTransition=null)}),vo(l=>{if(c=!0,Q1(l))this.events.next(new Xr(o.id,this.urlSerializer.serialize(o.extractedUrl),l.message,l.cancellationCode)),py(l)?this.events.next(new kc(l.url)):o.resolve(!1);else{this.events.next(new Fc(o.id,this.urlSerializer.serialize(o.extractedUrl),l,o.targetSnapshot??void 0));try{o.resolve(n.errorHandler(l))}catch(h){this.options.resolveNavigationPromiseOnError?o.resolve(!1):o.reject(h)}}return Hr}))}))}cancelNavigationTransition(n,i,s){let o=new Xr(n.id,this.urlSerializer.serialize(n.extractedUrl),i,s);this.events.next(o),n.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){return this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))).toString()!==this.currentTransition?.extractedUrl.toString()&&!this.currentTransition?.extras.skipLocationChange}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();function x8(r){return r!==Mc}var p8=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:()=>le(m8),providedIn:"root"});let r=t;return r})(),tf=class{shouldDetach(t){return!1}store(t,e){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,e){return t.routeConfig===e.routeConfig}},m8=(()=>{let t=class t extends tf{};t.\u0275fac=(()=>{let n;return function(s){return(n||(n=pc(t)))(s||t)}})(),t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})(),og=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:()=>le(g8),providedIn:"root"});let r=t;return r})(),g8=(()=>{let t=class t extends og{constructor(){super(...arguments),this.location=le(Ei),this.urlSerializer=le(ef),this.options=le(lf,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=le(uf),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new jr,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=Y1(null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return this.canceledNavigationResolution!=="computed"?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(n){return this.location.subscribe(i=>{i.type==="popstate"&&n(i.url,i.state)})}handleRouterEvent(n,i){if(n instanceof Tc)this.stateMemento=this.createStateMemento();else if(n instanceof Ns)this.rawUrlTree=i.initialUrl;else if(n instanceof hh){if(this.urlUpdateStrategy==="eager"&&!i.extras.skipLocationChange){let s=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl);this.setBrowserUrl(s,i)}}else n instanceof Pc?(this.currentUrlTree=i.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl),this.routerState=i.targetRouterState,this.urlUpdateStrategy==="deferred"&&(i.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,i))):n instanceof Xr&&(n.code===ci.GuardRejected||n.code===ci.NoDataFromResolver)?this.restoreHistory(i):n instanceof Fc?this.restoreHistory(i,!0):n instanceof Ls&&(this.lastSuccessfulId=n.id,this.currentPageId=this.browserPageId)}setBrowserUrl(n,i){let s=this.urlSerializer.serialize(n);if(this.location.isCurrentPathEqualTo(s)||i.extras.replaceUrl){let o=this.browserPageId,a=Nt(Nt({},i.extras.state),this.generateNgRouterState(i.id,o));this.location.replaceState(s,"",a)}else{let o=Nt(Nt({},i.extras.state),this.generateNgRouterState(i.id,this.browserPageId+1));this.location.go(s,"",o)}}restoreHistory(n,i=!1){if(this.canceledNavigationResolution==="computed"){let s=this.browserPageId,o=this.currentPageId-s;o!==0?this.location.historyGo(o):this.currentUrlTree===n.finalUrl&&o===0&&(this.resetState(n),this.resetUrlToCurrentUrlTree())}else this.canceledNavigationResolution==="replace"&&(i&&this.resetState(n),this.resetUrlToCurrentUrlTree())}resetState(n){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(n,i){return this.canceledNavigationResolution==="computed"?{navigationId:n,\u0275routerPageId:i}:{navigationId:n}}};t.\u0275fac=(()=>{let n;return function(s){return(n||(n=pc(t)))(s||t)}})(),t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})(),Sc=function(r){return r[r.COMPLETE=0]="COMPLETE",r[r.FAILED=1]="FAILED",r[r.REDIRECTING=2]="REDIRECTING",r}(Sc||{});function C8(r,t){r.events.pipe(Co(e=>e instanceof Ls||e instanceof Xr||e instanceof Fc||e instanceof Ns),ze(e=>e instanceof Ls||e instanceof Ns?Sc.COMPLETE:(e instanceof Xr?e.code===ci.Redirect||e.code===ci.SupersededByNewNavigation:!1)?Sc.REDIRECTING:Sc.FAILED),Co(e=>e!==Sc.REDIRECTING),Eo(1)).subscribe(()=>{t()})}function v8(r){throw r}var E8={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},_8={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"},We=(()=>{let t=class t{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.isNgZoneEnabled=!1,this.console=le(Kl),this.stateManager=le(og),this.options=le(lf,{optional:!0})||{},this.pendingTasks=le(c1),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=le(f8),this.urlSerializer=le(ef),this.location=le(Ei),this.urlHandlingStrategy=le(uf),this._events=new Fs,this.errorHandler=this.options.errorHandler||v8,this.navigated=!1,this.routeReuseStrategy=le(p8),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=le(hf,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!le(of,{optional:!0}),this.eventsSubscription=new km,this.isNgZoneEnabled=le(Li)instanceof Li&&Li.isInAngularZone(),this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:n=>{this.console.warn(n)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){let n=this.navigationTransitions.events.subscribe(i=>{try{let s=this.navigationTransitions.currentTransition,o=this.navigationTransitions.currentNavigation;if(s!==null&&o!==null){if(this.stateManager.handleRouterEvent(i,o),i instanceof Xr&&i.code!==ci.Redirect&&i.code!==ci.SupersededByNewNavigation)this.navigated=!0;else if(i instanceof Ls)this.navigated=!0;else if(i instanceof kc){let a=this.urlHandlingStrategy.merge(i.url,s.currentRawUrl),c={info:s.extras.info,skipLocationChange:s.extras.skipLocationChange,replaceUrl:this.urlUpdateStrategy==="eager"||x8(s.source)};this.scheduleNavigation(a,Mc,null,c,{resolve:s.resolve,reject:s.reject,promise:s.promise})}}b8(i)&&this._events.next(i)}catch(s){this.navigationTransitions.transitionAbortSubject.next(s)}});this.eventsSubscription.add(n)}resetRootComponentType(n){this.routerState.root.component=n,this.navigationTransitions.rootComponentType=n}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),Mc,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((n,i)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(n,"popstate",i)},0)})}navigateToSyncWithBrowser(n,i,s){let o={replaceUrl:!0},a=s?.navigationId?s:null;if(s){let l=Nt({},s);delete l.navigationId,delete l.\u0275routerPageId,Object.keys(l).length!==0&&(o.state=l)}let c=this.parseUrl(n);this.scheduleNavigation(c,i,a,o)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(n){this.config=n.map(af),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(n,i={}){let{relativeTo:s,queryParams:o,fragment:a,queryParamsHandling:c,preserveFragment:l}=i,h=l?this.currentUrlTree.fragment:a,u=null;switch(c){case"merge":u=Nt(Nt({},this.currentUrlTree.queryParams),o);break;case"preserve":u=this.currentUrlTree.queryParams;break;default:u=o||null}u!==null&&(u=this.removeEmptyProps(u));let d;try{let f=s?s.snapshot:this.routerState.snapshot.root;d=G1(f)}catch{(typeof n[0]!="string"||!n[0].startsWith("/"))&&(n=[]),d=this.currentUrlTree.root}return W1(d,n,u,h??null)}navigateByUrl(n,i={skipLocationChange:!1}){let s=To(n)?n:this.parseUrl(n),o=this.urlHandlingStrategy.merge(s,this.rawUrlTree);return this.scheduleNavigation(o,Mc,null,i)}navigate(n,i={skipLocationChange:!1}){return y8(n),this.navigateByUrl(this.createUrlTree(n,i),i)}serializeUrl(n){return this.urlSerializer.serialize(n)}parseUrl(n){try{return this.urlSerializer.parse(n)}catch{return this.urlSerializer.parse("/")}}isActive(n,i){let s;if(i===!0?s=Nt({},E8):i===!1?s=Nt({},_8):s=i,To(n))return D1(this.currentUrlTree,n,s);let o=this.parseUrl(n);return D1(this.currentUrlTree,o,s)}removeEmptyProps(n){return Object.entries(n).reduce((i,[s,o])=>(o!=null&&(i[s]=o),i),{})}scheduleNavigation(n,i,s,o,a){if(this.disposed)return Promise.resolve(!1);let c,l,h;a?(c=a.resolve,l=a.reject,h=a.promise):h=new Promise((d,f)=>{c=d,l=f});let u=this.pendingTasks.add();return C8(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(u))}),this.navigationTransitions.handleNavigationRequest({source:i,restoredState:s,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:n,extras:o,resolve:c,reject:l,promise:h,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),h.catch(d=>Promise.reject(d))}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();function y8(r){for(let t=0;te.\u0275providers)])}function S8(r){return r.routerState.root}function w8(){let r=le(id);return t=>{let e=r.get(dd);if(t!==e.components[0])return;let n=r.get(We),i=r.get(M8);r.get(D8)===1&&n.initialNavigation(),r.get(B8,null,nd.Optional)?.setUpPreloading(),r.get(A8,null,nd.Optional)?.init(),n.resetRootComponentType(e.componentTypes[0]),i.closed||(i.next(),i.complete(),i.unsubscribe())}}var M8=new yn("",{factory:()=>new Fs}),D8=new yn("",{providedIn:"root",factory:()=>1});var B8=new yn("");var pg=(()=>{let t=class t{constructor(n,i){this._renderer=n,this._elementRef=i,this.onChange=s=>{},this.onTouched=()=>{}}setProperty(n,i){this._renderer.setProperty(this._elementRef.nativeElement,n,i)}registerOnTouched(n){this.onTouched=n}registerOnChange(n){this.onChange=n}setDisabledState(n){this.setProperty("disabled",n)}};t.\u0275fac=function(i){return new(i||t)(ft(Zl),ft(ql))},t.\u0275dir=Wr({type:t});let r=t;return r})(),T8=(()=>{let t=class t extends pg{};t.\u0275fac=(()=>{let n;return function(s){return(n||(n=pc(t)))(s||t)}})(),t.\u0275dir=Wr({type:t,features:[Cc]});let r=t;return r})(),mg=new yn("");var F8={provide:mg,useExisting:ed(()=>_h),multi:!0};function P8(){let r=bo()?bo().getUserAgent():"";return/android (\d+)/.test(r.toLowerCase())}var k8=new yn(""),_h=(()=>{let t=class t extends pg{constructor(n,i,s){super(n,i),this._compositionMode=s,this._composing=!1,this._compositionMode==null&&(this._compositionMode=!P8())}writeValue(n){let i=n??"";this.setProperty("value",i)}_handleInput(n){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(n)}_compositionStart(){this._composing=!0}_compositionEnd(n){this._composing=!1,this._compositionMode&&this.onChange(n)}};t.\u0275fac=function(i){return new(i||t)(ft(Zl),ft(ql),ft(k8,8))},t.\u0275dir=Wr({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,s){i&1&&xt("input",function(a){return s._handleInput(a.target.value)})("blur",function(){return s.onTouched()})("compositionstart",function(){return s._compositionStart()})("compositionend",function(a){return s._compositionEnd(a.target.value)})},features:[ud([F8]),Cc]});let r=t;return r})();var R8=new yn(""),I8=new yn("");function gg(r){return r!=null}function Cg(r){return Jl(r)?si(r):r}function vg(r){let t={};return r.forEach(e=>{t=e!=null?Nt(Nt({},t),e):t}),Object.keys(t).length===0?null:t}function Eg(r,t){return t.map(e=>e(r))}function O8(r){return!r.validate}function _g(r){return r.map(t=>O8(t)?t:e=>t.validate(e))}function L8(r){if(!r)return null;let t=r.filter(gg);return t.length==0?null:function(e){return vg(Eg(e,t))}}function yg(r){return r!=null?L8(_g(r)):null}function N8(r){if(!r)return null;let t=r.filter(gg);return t.length==0?null:function(e){let n=Eg(e,t).map(Cg);return Nm(n).pipe(ze(vg))}}function bg(r){return r!=null?N8(_g(r)):null}function cg(r,t){return r===null?[t]:Array.isArray(r)?[...r,t]:[r,t]}function U8(r){return r._rawValidators}function V8(r){return r._rawAsyncValidators}function df(r){return r?Array.isArray(r)?r:[r]:[]}function vh(r,t){return Array.isArray(r)?r.includes(t):r===t}function lg(r,t){let e=df(t);return df(r).forEach(i=>{vh(e,i)||e.push(i)}),e}function hg(r,t){return df(t).filter(e=>!vh(r,e))}var Eh=class{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=yg(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=bg(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control&&this.control.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},ff=class extends Eh{get formDirective(){return null}get path(){return null}},Hc=class extends Eh{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}},xf=class{constructor(t){this._cd=t}get isTouched(){return!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return!!this._cd?.submitted}},z8={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},p7=Ze(Nt({},z8),{"[class.ng-submitted]":"isSubmitted"}),Ag=(()=>{let t=class t extends xf{constructor(n){super(n)}};t.\u0275fac=function(i){return new(i||t)(ft(Hc,2))},t.\u0275dir=Wr({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,s){i&2&&l1("ng-untouched",s.isUntouched)("ng-touched",s.isTouched)("ng-pristine",s.isPristine)("ng-dirty",s.isDirty)("ng-valid",s.isValid)("ng-invalid",s.isInvalid)("ng-pending",s.isPending)},features:[Cc]});let r=t;return r})();var Vc="VALID",Ch="INVALID",ko="PENDING",zc="DISABLED";function H8(r){return(yh(r)?r.validators:r)||null}function G8(r){return Array.isArray(r)?yg(r):r||null}function W8(r,t){return(yh(t)?t.asyncValidators:r)||null}function j8(r){return Array.isArray(r)?bg(r):r||null}function yh(r){return r!=null&&!Array.isArray(r)&&typeof r=="object"}var pf=class{constructor(t,e){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get valid(){return this.status===Vc}get invalid(){return this.status===Ch}get pending(){return this.status==ko}get disabled(){return this.status===zc}get enabled(){return this.status!==zc}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(lg(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(lg(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(hg(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(hg(t,this._rawAsyncValidators))}hasValidator(t){return vh(this._rawValidators,t)}hasAsyncValidator(t){return vh(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(e=>{e.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(e=>{e.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status=ko,t.emitEvent!==!1&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=zc,this.errors=null,this._forEachChild(n=>{n.disable(Ze(Nt({},t),{onlySelf:!0}))}),this._updateValue(),t.emitEvent!==!1&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Ze(Nt({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(n=>n(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=Vc,this._forEachChild(n=>{n.enable(Ze(Nt({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Ze(Nt({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(n=>n(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Vc||this.status===ko)&&this._runAsyncValidator(t.emitEvent)),t.emitEvent!==!1&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?zc:Vc}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=ko,this._hasOwnPendingAsyncValidator=!0;let e=Cg(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(n=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(n,{emitEvent:t})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((n,i)=>n&&n._find(i),this)}getError(t,e){let n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new jt,this.statusChanges=new jt}_calculateStatus(){return this._allControlsDisabled()?zc:this.errors?Ch:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(ko)?ko:this._anyControlsHaveStatus(Ch)?Ch:Vc}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){yh(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){let e=this._parent&&this._parent.dirty;return!t&&!!e&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=G8(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=j8(this._rawAsyncValidators)}};var Sg=new yn("CallSetDisabledState",{providedIn:"root",factory:()=>mf}),mf="always";function X8(r,t){return[...t.path,r]}function Y8(r,t,e=mf){$8(r,t),t.valueAccessor.writeValue(r.value),(r.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(r.disabled),Z8(r,t),J8(r,t),K8(r,t),q8(r,t)}function ug(r,t){r.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function q8(r,t){if(t.valueAccessor.setDisabledState){let e=n=>{t.valueAccessor.setDisabledState(n)};r.registerOnDisabledChange(e),t._registerOnDestroy(()=>{r._unregisterOnDisabledChange(e)})}}function $8(r,t){let e=U8(r);t.validator!==null?r.setValidators(cg(e,t.validator)):typeof e=="function"&&r.setValidators([e]);let n=V8(r);t.asyncValidator!==null?r.setAsyncValidators(cg(n,t.asyncValidator)):typeof n=="function"&&r.setAsyncValidators([n]);let i=()=>r.updateValueAndValidity();ug(t._rawValidators,i),ug(t._rawAsyncValidators,i)}function Z8(r,t){t.valueAccessor.registerOnChange(e=>{r._pendingValue=e,r._pendingChange=!0,r._pendingDirty=!0,r.updateOn==="change"&&wg(r,t)})}function K8(r,t){t.valueAccessor.registerOnTouched(()=>{r._pendingTouched=!0,r.updateOn==="blur"&&r._pendingChange&&wg(r,t),r.updateOn!=="submit"&&r.markAsTouched()})}function wg(r,t){r._pendingDirty&&r.markAsDirty(),r.setValue(r._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(r._pendingValue),r._pendingChange=!1}function J8(r,t){let e=(n,i)=>{t.valueAccessor.writeValue(n),i&&t.viewToModelUpdate(n)};r.registerOnChange(e),t._registerOnDestroy(()=>{r._unregisterOnChange(e)})}function Q8(r,t){if(!r.hasOwnProperty("model"))return!1;let e=r.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function tb(r){return Object.getPrototypeOf(r.constructor)===T8}function eb(r,t){if(!t)return null;Array.isArray(t);let e,n,i;return t.forEach(s=>{s.constructor===_h?e=s:tb(s)?n=s:i=s}),i||n||e||null}function dg(r,t){let e=r.indexOf(t);e>-1&&r.splice(e,1)}function fg(r){return typeof r=="object"&&r!==null&&Object.keys(r).length===2&&"value"in r&&"disabled"in r}var nb=class extends pf{constructor(t=null,e,n){super(H8(e),W8(n,e)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),yh(e)&&(e.nonNullable||e.initialValueIsDefault)&&(fg(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(n=>n(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){dg(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){dg(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){fg(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var ib={provide:Hc,useExisting:ed(()=>gf)},xg=Promise.resolve(),gf=(()=>{let t=class t extends Hc{constructor(n,i,s,o,a,c){super(),this._changeDetectorRef=a,this.callSetDisabledState=c,this.control=new nb,this._registered=!1,this.name="",this.update=new jt,this._parent=n,this._setValidators(i),this._setAsyncValidators(s),this.valueAccessor=eb(this,o)}ngOnChanges(n){if(this._checkForErrors(),!this._registered||"name"in n){if(this._registered&&(this._checkName(),this.formDirective)){let i=n.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in n&&this._updateDisabled(n),Q8(n,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(n){this.viewModel=n,this.update.emit(n)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Y8(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(n){xg.then(()=>{this.control.setValue(n,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(n){let i=n.isDisabled.currentValue,s=i!==0&&xd(i);xg.then(()=>{s&&!this.control.disabled?this.control.disable():!s&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(n){return this._parent?X8(n,this._parent):[n]}};t.\u0275fac=function(i){return new(i||t)(ft(ff,9),ft(R8,10),ft(I8,10),ft(mg,10),ft(Rs,8),ft(Sg,8))},t.\u0275dir=Wr({type:t,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[dc.None,"disabled","isDisabled"],model:[dc.None,"ngModel","model"],options:[dc.None,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[ud([ib]),Cc,Yl]});let r=t;return r})();var rb=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=fc({type:t}),t.\u0275inj=hc({});let r=t;return r})();var Ro=(()=>{let t=class t{static withConfig(n){return{ngModule:t,providers:[{provide:Sg,useValue:n.callSetDisabledState??mf}]}}};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=fc({type:t}),t.\u0275inj=hc({imports:[rb]});let r=t;return r})();var ob=["textDiv"];function ab(r,t){if(r&1&&(I(0,"div",12),Xt(1),N()),r&2){let e=at(2);Lt("color",e.extraLabelColor),P(),Ne(" ",e.extraLabel,"")}}function cb(r,t){if(r&1&&(I(0,"div",13),Xt(1),N()),r&2){let e=at(2);P(),Ge(e.checkBoxLabel)}}function lb(r,t){if(r&1){let e=qt();I(0,"div")(1,"input",14),xt("click",function(i){Mt(e);let s=at(2);return Dt(s.onClickCheckbox(i))}),N()()}}function hb(r,t){if(r&1&&(I(0,"div",7)(1,"div")(2,"div"),Xt(3),N(),At(4,ab,2,3,"div",8),N(),I(5,"div",9),At(6,cb,2,1,"div",10)(7,lb,2,0,"div",11),N()()),r&2){let e=at();P(),Lt("display","flex"),P(2),Ge(e.label),P(),V("ngIf",e.extraLabel!==""),P(2),V("ngIf",e.enableCheckbox===!0),P(),V("ngIf",e.enableCheckbox===!0)}}function ub(r,t){if(r&1){let e=qt();I(0,"input",15,0),xt("click",function(){Mt(e);let i=at();return Dt(i.onClickInput())})("input",function(i){Mt(e);let s=at();return Dt(s.onChangeInput(i))}),hd("ngModelChange",function(i){Mt(e);let s=at();return ld(s.innerText,i)||(s.innerText=i),Dt(i)}),N()}if(r&2){let e=at();Lt("padding-right",e.type==="chat-input"?40:10,"px"),V("type",e.type)("placeholder",e.placeholder),cd("ngModel",e.innerText)}}function db(r,t){if(r&1){let e=qt();I(0,"img",16),xt("click",function(){Mt(e);let i=at();return Dt(i.onClickChatSendButton())}),N()}}function fb(r,t){if(r&1){let e=qt();I(0,"textarea",17,0),xt("click",function(){Mt(e);let i=at();return Dt(i.onClickInput())})("input",function(i){Mt(e);let s=at();return Dt(s.onChangeInput(i))}),hd("ngModelChange",function(i){Mt(e);let s=at();return ld(s.innerText,i)||(s.innerText=i),Dt(i)}),N()}if(r&2){let e=at();Lt("height",e.longTextHeight,"px"),V("placeholder",e.placeholder),cd("ngModel",e.innerText)}}var qr=(()=>{let t=class t{constructor(n){this.cd=n,this.textDiv=null,this.label="",this.extraLabel="",this.extraLabelColor="",this.placeholder="",this.maxWidth=300,this.longTextHeight=120,this.type="text",this.innerText="",this.enableCheckbox=!1,this.checkBoxLabel="",this.onChangeEvent=new jt,this.onClickEvent=new jt,this.onClickCheckboxEvent=new jt,this.onClickChatSendButtonEvent=new jt,this.isChecked=!1}onClickInput(){this.onClickEvent.emit(this.innerText)}onChangeInput(n){this.innerText=n.target.value,this.cd.detectChanges(),this.onChangeEvent.emit(this.innerText)}onClickCheckbox(n){this.isChecked=n.target.checked,this.onClickCheckboxEvent.emit(this.isChecked)}onClickChatSendButton(){this.onClickChatSendButtonEvent.emit()}};t.\u0275fac=function(i){return new(i||t)(ft(Rs))},t.\u0275cmp=vt({type:t,selectors:[["app-simple-input"]],viewQuery:function(i,s){if(i&1&&te(ob,5),i&2){let o;Kt(o=Jt())&&(s.textDiv=o.first)}},inputs:{label:"label",extraLabel:"extraLabel",extraLabelColor:"extraLabelColor",placeholder:"placeholder",maxWidth:"maxWidth",longTextHeight:"longTextHeight",type:"type",innerText:"innerText",enableCheckbox:"enableCheckbox",checkBoxLabel:"checkBoxLabel"},outputs:{onChangeEvent:"onChangeEvent",onClickEvent:"onClickEvent",onClickCheckboxEvent:"onClickCheckboxEvent",onClickChatSendButtonEvent:"onClickChatSendButtonEvent"},standalone:!0,features:[Et],decls:6,vars:6,consts:[["textDiv",""],["id","simple-input-component-container"],["id","label-container",4,"ngIf"],["id","input-container"],["id","input","autocomplete","off",3,"type","placeholder","padding-right","ngModel","click","input","ngModelChange",4,"ngIf"],["id","chat-send-button","src","assets/icons/send_message.png",3,"click",4,"ngIf"],["id","text",3,"placeholder","ngModel","height","click","input","ngModelChange",4,"ngIf"],["id","label-container"],["id","extra-label-container",3,"color",4,"ngIf"],["id","checkbox-container"],["id","checkbox-label-container",4,"ngIf"],[4,"ngIf"],["id","extra-label-container"],["id","checkbox-label-container"],["type","checkbox","id","check",3,"click"],["id","input","autocomplete","off",3,"click","input","ngModelChange","type","placeholder","ngModel"],["id","chat-send-button","src","assets/icons/send_message.png",3,"click"],["id","text",3,"click","input","ngModelChange","placeholder","ngModel"]],template:function(i,s){i&1&&(I(0,"div",1),At(1,hb,8,6,"div",2),I(2,"div",3),At(3,ub,2,5,"input",4)(4,db,1,0,"img",5)(5,fb,2,4,"textarea",6),N()()),i&2&&(Lt("height",s.type==="longText"?28+s.longTextHeight:77,"px"),P(),V("ngIf",s.label!==""),P(2),V("ngIf",s.type!=="longText"),P(),V("ngIf",s.type==="chat-input"),P(),V("ngIf",s.type==="longText"))},dependencies:[he,Ro,_h,Ag,gf],styles:['#simple-input-component-container[_ngcontent-%COMP%]{margin-top:6px;margin-bottom:6px;height:77px;width:350px}#extra-label-container[_ngcontent-%COMP%]{font-size:14px;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif}#label-container[_ngcontent-%COMP%]{font-size:14px;margin-bottom:6px;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;width:100%}#input-container[_ngcontent-%COMP%]{height:48px;width:100%;margin-top:6px;position:relative}#input[_ngcontent-%COMP%]{font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:16px;width:100%;height:48px;border:solid;border-width:1.5px;border-color:#d8d8da;border-radius:10px;border-spacing:0px;margin:0;padding:0 10px;box-sizing:border-box}#input[_ngcontent-%COMP%]:focus{border-color:#2c2c2c}#input[_ngcontent-%COMP%]::placeholder{color:#5c5c5c}#input[type=datetime-local][_ngcontent-%COMP%]{width:350px;text-align:left}#text[_ngcontent-%COMP%]{font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:16px;width:100%;height:120px;border:solid;border-width:1.5px;border-color:#d8d8da;border-radius:10px;border-spacing:0px;margin:0;padding:10px;box-sizing:border-box;resize:none}#text[_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;display:none}#text[_ngcontent-%COMP%]:focus{border-color:#2c2c2c}#text[_ngcontent-%COMP%]::placeholder{color:#5c5c5c}#label-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;justify-content:space-between;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif}#checkbox-container[_ngcontent-%COMP%]{font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:14px;display:flex;align-items:center;margin-left:20px}#chat-send-button[_ngcontent-%COMP%]{position:absolute;top:14px;right:10px;height:20px}#chat-send-button[_ngcontent-%COMP%]:hover{background-color:#0000001a;border-radius:50%;cursor:pointer}']});let r=t;return r})();function xb(r,t){r&1&&Ct(0,"img",3)}var Mg=(()=>{let t=class t{constructor(){this.imgSize=96,this.imgSrc="assets/heart.png",this.isEditable=!0}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-profile-img"]],inputs:{imgSize:"imgSize",imgSrc:"imgSrc",isEditable:"isEditable"},standalone:!0,features:[Et],decls:3,vars:2,consts:[["id","profile-img-container"],["id","profile-img",3,"src"],["id","edit-icon","width","32","height","32","src","assets/edit_icon.png",4,"ngIf"],["id","edit-icon","width","32","height","32","src","assets/edit_icon.png"]],template:function(i,s){i&1&&(I(0,"div",0),Ct(1,"img",1),At(2,xb,1,0,"img",2),N()),i&2&&(P(),V("src",s.imgSrc,Cn),P(),V("ngIf",s.isEditable))},dependencies:[he],styles:["#profile-img-container[_ngcontent-%COMP%]{width:96px;height:96px;border-radius:50%;display:flex;justify-content:center;align-items:center;margin-top:8px;margin-bottom:8px;position:relative}#profile-img[_ngcontent-%COMP%]{width:96px;height:96px;border-radius:50%}#edit-icon[_ngcontent-%COMP%]{position:absolute;bottom:0;right:0}#edit-icon[_ngcontent-%COMP%]:hover{cursor:pointer}"]});let r=t;return r})();function pb(r,t){if(r&1&&(I(0,"span",7),Xt(1),N()),r&2){let e=at(2);Lt("color",e.extraLabelColor),P(),Ge(e.extraLabel)}}function mb(r,t){if(r&1&&(I(0,"div",5),Xt(1),At(2,pb,2,3,"span",6),N()),r&2){let e=at();P(),Ne(" ",e.label," "),P(),V("ngIf",e.extraLabel!=="")}}function gb(r,t){if(r&1&&Ct(0,"img",12),r&2){let e=at().$implicit;V("src",e.imgSrc,Cn)}}function Cb(r,t){if(r&1){let e=qt();sn(0),I(1,"div",9,0),xt("click",function(){let i=Mt(e).$implicit,s=at(2);return Dt(s.onClickToggleButton(i.value))}),At(3,gb,1,1,"img",10),I(4,"span",11),Xt(5),N()(),on()}if(r&2){let e=t.$implicit,n=t.index,i=at().$implicit,s=at();P(),Lt("justify-content",s.align)("width",s.buttonWidth,"px")("height",s.buttonHeight,"px")("margin-right",n!==i.length-1?10:0,"px")("background-color",e.selected&&e.solid?e.selectedBackgroundColor:e.unselectedBackgroundColor)("color",e.selected&&e.solid?e.selectedFontColor:e.unselectedFontColor),V("ngClass",s.getClass(e)),P(2),V("ngIf",e.imgSrc!==void 0),P(),Lt("font-size",s.fontSize,"px"),P(),Ge(e.label)}}function vb(r,t){if(r&1&&(sn(0),I(1,"div",8),At(2,Cb,6,17,"ng-container",4),N(),on()),r&2){let e=t.$implicit,n=at();P(),Lt("margin-bottom",n.modifiedButtonElements.length>1?16:0,"px")("width",e.length*n.buttonWidth+(e.length-1)*10,"px"),P(),V("ngForOf",e)}}var yi=(()=>{let t=class t{constructor(){this.label="",this.extraLabel="",this.extraLabelColor="",this.componentWidth=350,this.buttonElements=[],this.buttonWidth=350,this.buttonHeight=48,this.fontSize=16,this.columnNum=3,this.multiSelection=!1,this.align="center",this.onClickToggleButtonEvent=new jt,this.modifiedButtonElements=[]}ngOnInit(){this._setButtonLayout()}_setButtonLayout(){if(this.columnNum!==-1){let n=[];for(let i=0;ii.value===n).selected=!this.buttonElements.find(i=>i.value===n).selected:(this.buttonElements.forEach(i=>i.selected=!1),this.buttonElements.find(i=>i.value===n).selected=!0),this.onClickToggleButtonEvent.emit(n)}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-simple-toggle"]],inputs:{label:"label",extraLabel:"extraLabel",extraLabelColor:"extraLabelColor",componentWidth:"componentWidth",buttonElements:"buttonElements",buttonWidth:"buttonWidth",buttonHeight:"buttonHeight",fontSize:"fontSize",columnNum:"columnNum",multiSelection:"multiSelection",align:"align"},outputs:{onClickToggleButtonEvent:"onClickToggleButtonEvent"},standalone:!0,features:[Et],decls:4,vars:2,consts:[["toggleButton",""],[1,"container"],["id","label-container",4,"ngIf"],["id","row-container"],[4,"ngFor","ngForOf"],["id","label-container"],["id","extra-label-container",3,"color",4,"ngIf"],["id","extra-label-container"],[1,"toggle-group-row-container"],[3,"click","ngClass"],["class","img","height","24px",3,"src",4,"ngIf"],[1,"label"],["height","24px",1,"img",3,"src"]],template:function(i,s){i&1&&(I(0,"div",1),At(1,mb,3,2,"div",2),I(2,"div",3),At(3,vb,3,5,"ng-container",4),N()()),i&2&&(P(),V("ngIf",s.label!==""),P(2),V("ngForOf",s.modifiedButtonElements))},dependencies:[vc,Ao,en,he],styles:['.container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;width:100%}.container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}#extra-label-container[_ngcontent-%COMP%]{font-size:14px;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif}#label-container[_ngcontent-%COMP%]{font-size:14px;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;margin-bottom:6px;width:100%}#row-container[_ngcontent-%COMP%]{width:100%}#row-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.toggle-group-row-container[_ngcontent-%COMP%]{display:flex;margin-bottom:16px}.label[_ngcontent-%COMP%]{font-size:16px;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif}.img[_ngcontent-%COMP%]{margin-right:8px}.unselected-button[_ngcontent-%COMP%]{width:110px;height:48px;border-width:1.5px;border-radius:10px;border-color:#d8d8da;border-style:solid;box-sizing:border-box;display:flex;justify-content:center;align-items:center;padding:0 10px;margin-right:10px;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:16px;font-weight:500}.selected-button[_ngcontent-%COMP%]{width:110px;height:48px;border-width:1.5px;border-radius:10px;border-color:#2c2c2c;border-style:solid;box-sizing:border-box;display:flex;justify-content:center;align-items:center;padding:0 10px;margin-right:10px;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:16px;font-weight:500}.unselected-button-solid[_ngcontent-%COMP%]{width:110px;height:48px;background-color:#f8f8f8;display:flex;justify-content:center;align-items:center;padding:0 10px;margin-right:10px;border-radius:10px;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:16px;font-weight:500}.selected-button-solid[_ngcontent-%COMP%]{width:110px;height:48px;display:flex;background-color:#000;color:#fff;justify-content:center;align-items:center;padding:0 10px;margin-right:10px;border-radius:10px;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:16px;font-weight:500}.button-hover[_ngcontent-%COMP%]:hover{cursor:pointer}']});let r=t;return r})();function Eb(r,t){if(r&1&&Ct(0,"img",3),r&2){let e=at();V("src",e.buttonElement.imgSrc,Cn)("height",e.heightSize)}}function _b(r,t){if(r&1&&(I(0,"div",4),Xt(1),N()),r&2){let e=at();Lt("font-size",e.heightSize,"px")("color",e.highContrast?"#f0f0f0":"black"),P(),Ne(" ",e.buttonElement.label," ")}}var Ah=(()=>{let t=class t{constructor(){this.heightSize=20,this.buttonElement=null,this.type="img",this.highContrast=!1,this.onClickEvent=new jt}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-simple-button"]],inputs:{heightSize:"heightSize",buttonElement:"buttonElement",type:"type",highContrast:"highContrast"},outputs:{onClickEvent:"onClickEvent"},standalone:!0,features:[Et],decls:3,vars:2,consts:[["id","simple-button",3,"click"],[3,"src","height",4,"ngIf"],["id","text-div",3,"font-size","color",4,"ngIf"],[3,"src","height"],["id","text-div"]],template:function(i,s){i&1&&(I(0,"div",0),xt("click",function(){return s.onClickEvent.emit()}),At(1,Eb,1,2,"img",1)(2,_b,2,5,"div",2),N()),i&2&&(P(),V("ngIf",s.type==="img"),P(),V("ngIf",s.type==="text"))},dependencies:[he],styles:["#simple-button[_ngcontent-%COMP%]{margin:10px;display:flex;justify-content:center;align-items:center;border-radius:10px}#simple-button[_ngcontent-%COMP%]:hover{cursor:pointer}#text-div[_ngcontent-%COMP%]{text-align:center}"]});let r=t;return r})();function yb(r,t){if(r&1){let e=qt();sn(0),I(1,"div",2),xt("click",function(){let i=Mt(e).$implicit,s=at();return Dt(s.onClickButton(i.value))}),Xt(2),N(),on()}if(r&2){let e=t.$implicit,n=at();P(),Lt("width",350-10*n.buttonElements.length/n.buttonElements.length,"px"),V("ngClass",n.getClass(e.value)),P(),Ge(e.label)}}var sr=(()=>{let t=class t{constructor(){this.buttonElements=[{selected:!0,value:0,label:"\uB2E4\uC74C"}],this.onClickEvent=new jt}onClickButton(n){this.onClickEvent.emit(n)}getClass(n){return this.buttonElements.find(i=>i.value===n).selected?"ready-button hover-button":"wait-button hover-button"}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-square-button"]],inputs:{buttonElements:"buttonElements"},outputs:{onClickEvent:"onClickEvent"},standalone:!0,features:[Et],decls:2,vars:1,consts:[["id","container"],[4,"ngFor","ngForOf"],[3,"click","ngClass"]],template:function(i,s){i&1&&(I(0,"div",0),At(1,yb,3,4,"ng-container",1),N()),i&2&&(P(),V("ngForOf",s.buttonElements))},dependencies:[en,Ao],styles:['#container[_ngcontent-%COMP%]{width:350px;height:48px;display:flex;justify-content:center;align-items:center}.ready-button[_ngcontent-%COMP%]{width:350px;height:48px;border-radius:10px;background-color:#006bff;font-size:16px;font-weight:500;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;color:#fff;display:flex;justify-content:center;align-items:center}.wait-button[_ngcontent-%COMP%]{width:350px;height:48px;border-radius:10px;background-color:#bcbcbc;font-size:16px;font-weight:500;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;color:#fff;display:flex;justify-content:center;align-items:center}.hover-button[_ngcontent-%COMP%]:hover{cursor:pointer}']});let r=t;return r})();function Gc(r,t){return function(){return r.apply(t,arguments)}}var{toString:bb}=Object.prototype,{getPrototypeOf:Ef}=Object,wh=(r=>t=>{let e=bb.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),or=r=>(r=r.toLowerCase(),t=>wh(t)===r),Mh=r=>t=>typeof t===r,{isArray:Io}=Array,Wc=Mh("undefined");function Ab(r){return r!==null&&!Wc(r)&&r.constructor!==null&&!Wc(r.constructor)&&bi(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}var Tg=or("ArrayBuffer");function Sb(r){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&Tg(r.buffer),t}var wb=Mh("string"),bi=Mh("function"),Fg=Mh("number"),Dh=r=>r!==null&&typeof r=="object",Mb=r=>r===!0||r===!1,Sh=r=>{if(wh(r)!=="object")return!1;let t=Ef(r);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},Db=or("Date"),Bb=or("File"),Tb=or("Blob"),Fb=or("FileList"),Pb=r=>Dh(r)&&bi(r.pipe),kb=r=>{let t;return r&&(typeof FormData=="function"&&r instanceof FormData||bi(r.append)&&((t=wh(r))==="formdata"||t==="object"&&bi(r.toString)&&r.toString()==="[object FormData]"))},Rb=or("URLSearchParams"),Ib=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function jc(r,t,{allOwnKeys:e=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),Io(r))for(n=0,i=r.length;n0;)if(i=e[n],t===i.toLowerCase())return i;return null}var kg=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Rg=r=>!Wc(r)&&r!==kg;function vf(){let{caseless:r}=Rg(this)&&this||{},t={},e=(n,i)=>{let s=r&&Pg(t,i)||i;Sh(t[s])&&Sh(n)?t[s]=vf(t[s],n):Sh(n)?t[s]=vf({},n):Io(n)?t[s]=n.slice():t[s]=n};for(let n=0,i=arguments.length;n(jc(t,(i,s)=>{e&&bi(i)?r[s]=Gc(i,e):r[s]=i},{allOwnKeys:n}),r),Lb=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Nb=(r,t,e,n)=>{r.prototype=Object.create(t.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:t.prototype}),e&&Object.assign(r.prototype,e)},Ub=(r,t,e,n)=>{let i,s,o,a={};if(t=t||{},r==null)return t;do{for(i=Object.getOwnPropertyNames(r),s=i.length;s-- >0;)o=i[s],(!n||n(o,r,t))&&!a[o]&&(t[o]=r[o],a[o]=!0);r=e!==!1&&Ef(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t},Vb=(r,t,e)=>{r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=t.length;let n=r.indexOf(t,e);return n!==-1&&n===e},zb=r=>{if(!r)return null;if(Io(r))return r;let t=r.length;if(!Fg(t))return null;let e=new Array(t);for(;t-- >0;)e[t]=r[t];return e},Hb=(r=>t=>r&&t instanceof r)(typeof Uint8Array<"u"&&Ef(Uint8Array)),Gb=(r,t)=>{let n=(r&&r[Symbol.iterator]).call(r),i;for(;(i=n.next())&&!i.done;){let s=i.value;t.call(r,s[0],s[1])}},Wb=(r,t)=>{let e,n=[];for(;(e=r.exec(t))!==null;)n.push(e);return n},jb=or("HTMLFormElement"),Xb=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,i){return n.toUpperCase()+i}),Dg=(({hasOwnProperty:r})=>(t,e)=>r.call(t,e))(Object.prototype),Yb=or("RegExp"),Ig=(r,t)=>{let e=Object.getOwnPropertyDescriptors(r),n={};jc(e,(i,s)=>{let o;(o=t(i,s,r))!==!1&&(n[s]=o||i)}),Object.defineProperties(r,n)},qb=r=>{Ig(r,(t,e)=>{if(bi(r)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;let n=r[e];if(bi(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},$b=(r,t)=>{let e={},n=i=>{i.forEach(s=>{e[s]=!0})};return Io(r)?n(r):n(String(r).split(t)),e},Zb=()=>{},Kb=(r,t)=>(r=+r,Number.isFinite(r)?r:t),Cf="abcdefghijklmnopqrstuvwxyz",Bg="0123456789",Og={DIGIT:Bg,ALPHA:Cf,ALPHA_DIGIT:Cf+Cf.toUpperCase()+Bg},Jb=(r=16,t=Og.ALPHA_DIGIT)=>{let e="",{length:n}=t;for(;r--;)e+=t[Math.random()*n|0];return e};function Qb(r){return!!(r&&bi(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}var tA=r=>{let t=new Array(10),e=(n,i)=>{if(Dh(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;let s=Io(n)?[]:{};return jc(n,(o,a)=>{let c=e(o,i+1);!Wc(c)&&(s[a]=c)}),t[i]=void 0,s}}return n};return e(r,0)},eA=or("AsyncFunction"),nA=r=>r&&(Dh(r)||bi(r))&&bi(r.then)&&bi(r.catch),ot={isArray:Io,isArrayBuffer:Tg,isBuffer:Ab,isFormData:kb,isArrayBufferView:Sb,isString:wb,isNumber:Fg,isBoolean:Mb,isObject:Dh,isPlainObject:Sh,isUndefined:Wc,isDate:Db,isFile:Bb,isBlob:Tb,isRegExp:Yb,isFunction:bi,isStream:Pb,isURLSearchParams:Rb,isTypedArray:Hb,isFileList:Fb,forEach:jc,merge:vf,extend:Ob,trim:Ib,stripBOM:Lb,inherits:Nb,toFlatObject:Ub,kindOf:wh,kindOfTest:or,endsWith:Vb,toArray:zb,forEachEntry:Gb,matchAll:Wb,isHTMLForm:jb,hasOwnProperty:Dg,hasOwnProp:Dg,reduceDescriptors:Ig,freezeMethods:qb,toObjectSet:$b,toCamelCase:Xb,noop:Zb,toFiniteNumber:Kb,findKey:Pg,global:kg,isContextDefined:Rg,ALPHABET:Og,generateString:Jb,isSpecCompliantForm:Qb,toJSONObject:tA,isAsyncFn:eA,isThenable:nA};function Oo(r,t,e,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),i&&(this.response=i)}ot.inherits(Oo,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ot.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Lg=Oo.prototype,Ng={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Ng[r]={value:r}});Object.defineProperties(Oo,Ng);Object.defineProperty(Lg,"isAxiosError",{value:!0});Oo.from=(r,t,e,n,i,s)=>{let o=Object.create(Lg);return ot.toFlatObject(r,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),Oo.call(o,r.message,t,e,n,i),o.cause=r,o.name=r.name,s&&Object.assign(o,s),o};var Ae=Oo;var Bh=null;function _f(r){return ot.isPlainObject(r)||ot.isArray(r)}function Vg(r){return ot.endsWith(r,"[]")?r.slice(0,-2):r}function Ug(r,t,e){return r?r.concat(t).map(function(i,s){return i=Vg(i),!e&&s?"["+i+"]":i}).join(e?".":""):t}function iA(r){return ot.isArray(r)&&!r.some(_f)}var rA=ot.toFlatObject(ot,{},null,function(t){return/^is[A-Z]/.test(t)});function sA(r,t,e){if(!ot.isObject(r))throw new TypeError("target must be an object");t=t||new(Bh||FormData),e=ot.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,x){return!ot.isUndefined(x[g])});let n=e.metaTokens,i=e.visitor||h,s=e.dots,o=e.indexes,c=(e.Blob||typeof Blob<"u"&&Blob)&&ot.isSpecCompliantForm(t);if(!ot.isFunction(i))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(ot.isDate(m))return m.toISOString();if(!c&&ot.isBlob(m))throw new Ae("Blob is not supported. Use a Buffer instead.");return ot.isArrayBuffer(m)||ot.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function h(m,g,x){let p=m;if(m&&!x&&typeof m=="object"){if(ot.endsWith(g,"{}"))g=n?g:g.slice(0,-2),m=JSON.stringify(m);else if(ot.isArray(m)&&iA(m)||(ot.isFileList(m)||ot.endsWith(g,"[]"))&&(p=ot.toArray(m)))return g=Vg(g),p.forEach(function(v,_){!(ot.isUndefined(v)||v===null)&&t.append(o===!0?Ug([g],_,s):o===null?g:g+"[]",l(v))}),!1}return _f(m)?!0:(t.append(Ug(x,g,s),l(m)),!1)}let u=[],d=Object.assign(rA,{defaultVisitor:h,convertValue:l,isVisitable:_f});function f(m,g){if(!ot.isUndefined(m)){if(u.indexOf(m)!==-1)throw Error("Circular reference detected in "+g.join("."));u.push(m),ot.forEach(m,function(p,C){(!(ot.isUndefined(p)||p===null)&&i.call(t,p,ot.isString(C)?C.trim():C,g,d))===!0&&f(p,g?g.concat(C):[C])}),u.pop()}}if(!ot.isObject(r))throw new TypeError("data must be an object");return f(r),t}var $r=sA;function zg(r){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Hg(r,t){this._pairs=[],r&&$r(r,this,t)}var Gg=Hg.prototype;Gg.append=function(t,e){this._pairs.push([t,e])};Gg.toString=function(t){let e=t?function(n){return t.call(this,n,zg)}:zg;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};var Th=Hg;function oA(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Xc(r,t,e){if(!t)return r;let n=e&&e.encode||oA,i=e&&e.serialize,s;if(i?s=i(t,e):s=ot.isURLSearchParams(t)?t.toString():new Th(t,e).toString(n),s){let o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+s}return r}var yf=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ot.forEach(this.handlers,function(n){n!==null&&t(n)})}},bf=yf;var Fh={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Wg=typeof URLSearchParams<"u"?URLSearchParams:Th;var jg=typeof FormData<"u"?FormData:null;var Xg=typeof Blob<"u"?Blob:null;var Yg={isBrowser:!0,classes:{URLSearchParams:Wg,FormData:jg,Blob:Xg},protocols:["http","https","file","blob","url","data"]};var Af={};m_(Af,{hasBrowserEnv:()=>qg,hasStandardBrowserEnv:()=>aA,hasStandardBrowserWebWorkerEnv:()=>cA});var qg=typeof window<"u"&&typeof document<"u",aA=(r=>qg&&["ReactNative","NativeScript","NS"].indexOf(r)<0)(typeof navigator<"u"&&navigator.product),cA=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var Hn=Nt(Nt({},Af),Yg);function Sf(r,t){return $r(r,new Hn.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,s){return Hn.isNode&&ot.isBuffer(e)?(this.append(n,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function lA(r){return ot.matchAll(/\w+|\[(\w*)]/g,r).map(t=>t[0]==="[]"?"":t[1]||t[0])}function hA(r){let t={},e=Object.keys(r),n,i=e.length,s;for(n=0;n=e.length;return o=!o&&ot.isArray(i)?i.length:o,c?(ot.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!ot.isObject(i[o]))&&(i[o]=[]),t(e,n,i[o],s)&&ot.isArray(i[o])&&(i[o]=hA(i[o])),!a)}if(ot.isFormData(r)&&ot.isFunction(r.entries)){let e={};return ot.forEachEntry(r,(n,i)=>{t(lA(n),i,e,0)}),e}return null}var Ph=uA;function dA(r,t,e){if(ot.isString(r))try{return(t||JSON.parse)(r),ot.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(r)}var wf={transitional:Fh,adapter:["xhr","http"],transformRequest:[function(t,e){let n=e.getContentType()||"",i=n.indexOf("application/json")>-1,s=ot.isObject(t);if(s&&ot.isHTMLForm(t)&&(t=new FormData(t)),ot.isFormData(t))return i?JSON.stringify(Ph(t)):t;if(ot.isArrayBuffer(t)||ot.isBuffer(t)||ot.isStream(t)||ot.isFile(t)||ot.isBlob(t))return t;if(ot.isArrayBufferView(t))return t.buffer;if(ot.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Sf(t,this.formSerializer).toString();if((a=ot.isFileList(t))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return $r(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||i?(e.setContentType("application/json",!1),dA(t)):t}],transformResponse:[function(t){let e=this.transitional||wf.transitional,n=e&&e.forcedJSONParsing,i=this.responseType==="json";if(t&&ot.isString(t)&&(n&&!this.responseType||i)){let o=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?Ae.from(a,Ae.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hn.classes.FormData,Blob:Hn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ot.forEach(["delete","get","head","post","put","patch"],r=>{wf.headers[r]={}});var Lo=wf;var fA=ot.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$g=r=>{let t={},e,n,i;return r&&r.split(` +`).forEach(function(o){i=o.indexOf(":"),e=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!e||t[e]&&fA[e])&&(e==="set-cookie"?t[e]?t[e].push(n):t[e]=[n]:t[e]=t[e]?t[e]+", "+n:n)}),t};var Zg=Symbol("internals");function Yc(r){return r&&String(r).trim().toLowerCase()}function kh(r){return r===!1||r==null?r:ot.isArray(r)?r.map(kh):String(r)}function xA(r){let t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=e.exec(r);)t[n[1]]=n[2];return t}var pA=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function Mf(r,t,e,n,i){if(ot.isFunction(n))return n.call(this,t,e);if(i&&(t=e),!!ot.isString(t)){if(ot.isString(n))return t.indexOf(n)!==-1;if(ot.isRegExp(n))return n.test(t)}}function mA(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}function gA(r,t){let e=ot.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+e,{value:function(i,s,o){return this[n].call(this,t,i,s,o)},configurable:!0})})}var No=class{constructor(t){t&&this.set(t)}set(t,e,n){let i=this;function s(a,c,l){let h=Yc(c);if(!h)throw new Error("header name must be a non-empty string");let u=ot.findKey(i,h);(!u||i[u]===void 0||l===!0||l===void 0&&i[u]!==!1)&&(i[u||c]=kh(a))}let o=(a,c)=>ot.forEach(a,(l,h)=>s(l,h,c));return ot.isPlainObject(t)||t instanceof this.constructor?o(t,e):ot.isString(t)&&(t=t.trim())&&!pA(t)?o($g(t),e):t!=null&&s(e,t,n),this}get(t,e){if(t=Yc(t),t){let n=ot.findKey(this,t);if(n){let i=this[n];if(!e)return i;if(e===!0)return xA(i);if(ot.isFunction(e))return e.call(this,i,n);if(ot.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Yc(t),t){let n=ot.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||Mf(this,this[n],n,e)))}return!1}delete(t,e){let n=this,i=!1;function s(o){if(o=Yc(o),o){let a=ot.findKey(n,o);a&&(!e||Mf(n,n[a],a,e))&&(delete n[a],i=!0)}}return ot.isArray(t)?t.forEach(s):s(t),i}clear(t){let e=Object.keys(this),n=e.length,i=!1;for(;n--;){let s=e[n];(!t||Mf(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){let e=this,n={};return ot.forEach(this,(i,s)=>{let o=ot.findKey(n,s);if(o){e[o]=kh(i),delete e[s];return}let a=t?mA(s):String(s).trim();a!==s&&delete e[s],e[a]=kh(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let e=Object.create(null);return ot.forEach(this,(n,i)=>{n!=null&&n!==!1&&(e[i]=t&&ot.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){let n=new this(t);return e.forEach(i=>n.set(i)),n}static accessor(t){let n=(this[Zg]=this[Zg]={accessors:{}}).accessors,i=this.prototype;function s(o){let a=Yc(o);n[a]||(gA(i,o),n[a]=!0)}return ot.isArray(t)?t.forEach(s):s(t),this}};No.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ot.reduceDescriptors(No.prototype,({value:r},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>r,set(n){this[e]=n}}});ot.freezeMethods(No);var Gn=No;function qc(r,t){let e=this||Lo,n=t||e,i=Gn.from(n.headers),s=n.data;return ot.forEach(r,function(a){s=a.call(e,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function $c(r){return!!(r&&r.__CANCEL__)}function Kg(r,t,e){Ae.call(this,r??"canceled",Ae.ERR_CANCELED,t,e),this.name="CanceledError"}ot.inherits(Kg,Ae,{__CANCEL__:!0});var Zr=Kg;function Df(r,t,e){let n=e.config.validateStatus;!e.status||!n||n(e.status)?r(e):t(new Ae("Request failed with status code "+e.status,[Ae.ERR_BAD_REQUEST,Ae.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}var Jg=Hn.hasStandardBrowserEnv?{write(r,t,e,n,i,s){let o=[r+"="+encodeURIComponent(t)];ot.isNumber(e)&&o.push("expires="+new Date(e).toGMTString()),ot.isString(n)&&o.push("path="+n),ot.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(r){let t=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Bf(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function Tf(r,t){return t?r.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):r}function Zc(r,t){return r&&!Bf(t)?Tf(r,t):t}var Qg=Hn.hasStandardBrowserEnv?function(){let t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a"),n;function i(s){let o=s;return t&&(e.setAttribute("href",o),o=e.href),e.setAttribute("href",o),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return n=i(window.location.href),function(o){let a=ot.isString(o)?i(o):o;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function Ff(r){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return t&&t[1]||""}function CA(r,t){r=r||10;let e=new Array(r),n=new Array(r),i=0,s=0,o;return t=t!==void 0?t:1e3,function(c){let l=Date.now(),h=n[s];o||(o=l),e[i]=c,n[i]=l;let u=s,d=0;for(;u!==i;)d+=e[u++],u=u%r;if(i=(i+1)%r,i===s&&(s=(s+1)%r),l-o{let s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-e,c=n(a),l=s<=o;e=s;let h={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:c||void 0,estimated:c&&o&&l?(o-s)/c:void 0,event:i};h[t?"download":"upload"]=!0,r(h)}}var vA=typeof XMLHttpRequest<"u",n2=vA&&function(r){return new Promise(function(e,n){let i=r.data,s=Gn.from(r.headers).normalize(),{responseType:o,withXSRFToken:a}=r,c;function l(){r.cancelToken&&r.cancelToken.unsubscribe(c),r.signal&&r.signal.removeEventListener("abort",c)}let h;if(ot.isFormData(i)){if(Hn.hasStandardBrowserEnv||Hn.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((h=s.getContentType())!==!1){let[g,...x]=h?h.split(";").map(p=>p.trim()).filter(Boolean):[];s.setContentType([g||"multipart/form-data",...x].join("; "))}}let u=new XMLHttpRequest;if(r.auth){let g=r.auth.username||"",x=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";s.set("Authorization","Basic "+btoa(g+":"+x))}let d=Zc(r.baseURL,r.url);u.open(r.method.toUpperCase(),Xc(d,r.params,r.paramsSerializer),!0),u.timeout=r.timeout;function f(){if(!u)return;let g=Gn.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),p={data:!o||o==="text"||o==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:g,config:r,request:u};Df(function(v){e(v),l()},function(v){n(v),l()},p),u=null}if("onloadend"in u?u.onloadend=f:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(f)},u.onabort=function(){u&&(n(new Ae("Request aborted",Ae.ECONNABORTED,r,u)),u=null)},u.onerror=function(){n(new Ae("Network Error",Ae.ERR_NETWORK,r,u)),u=null},u.ontimeout=function(){let x=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",p=r.transitional||Fh;r.timeoutErrorMessage&&(x=r.timeoutErrorMessage),n(new Ae(x,p.clarifyTimeoutError?Ae.ETIMEDOUT:Ae.ECONNABORTED,r,u)),u=null},Hn.hasStandardBrowserEnv&&(a&&ot.isFunction(a)&&(a=a(r)),a||a!==!1&&Qg(d))){let g=r.xsrfHeaderName&&r.xsrfCookieName&&Jg.read(r.xsrfCookieName);g&&s.set(r.xsrfHeaderName,g)}i===void 0&&s.setContentType(null),"setRequestHeader"in u&&ot.forEach(s.toJSON(),function(x,p){u.setRequestHeader(p,x)}),ot.isUndefined(r.withCredentials)||(u.withCredentials=!!r.withCredentials),o&&o!=="json"&&(u.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&u.addEventListener("progress",e2(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",e2(r.onUploadProgress)),(r.cancelToken||r.signal)&&(c=g=>{u&&(n(!g||g.type?new Zr(null,r,u):g),u.abort(),u=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));let m=Ff(d);if(m&&Hn.protocols.indexOf(m)===-1){n(new Ae("Unsupported protocol "+m+":",Ae.ERR_BAD_REQUEST,r));return}u.send(i||null)})};var Pf={http:Bh,xhr:n2};ot.forEach(Pf,(r,t)=>{if(r){try{Object.defineProperty(r,"name",{value:t})}catch{}Object.defineProperty(r,"adapterName",{value:t})}});var i2=r=>`- ${r}`,EA=r=>ot.isFunction(r)||r===null||r===!1,Rh={getAdapter:r=>{r=ot.isArray(r)?r:[r];let{length:t}=r,e,n,i={};for(let s=0;s`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build")),o=t?s.length>1?`since : +`+s.map(i2).join(` +`):" "+i2(s[0]):"as no adapter specified";throw new Ae("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:Pf};function kf(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Zr(null,r)}function Ih(r){return kf(r),r.headers=Gn.from(r.headers),r.data=qc.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Rh.getAdapter(r.adapter||Lo.adapter)(r).then(function(n){return kf(r),n.data=qc.call(r,r.transformResponse,n),n.headers=Gn.from(n.headers),n},function(n){return $c(n)||(kf(r),n&&n.response&&(n.response.data=qc.call(r,r.transformResponse,n.response),n.response.headers=Gn.from(n.response.headers))),Promise.reject(n)})}var r2=r=>r instanceof Gn?Nt({},r):r;function _r(r,t){t=t||{};let e={};function n(l,h,u){return ot.isPlainObject(l)&&ot.isPlainObject(h)?ot.merge.call({caseless:u},l,h):ot.isPlainObject(h)?ot.merge({},h):ot.isArray(h)?h.slice():h}function i(l,h,u){if(ot.isUndefined(h)){if(!ot.isUndefined(l))return n(void 0,l,u)}else return n(l,h,u)}function s(l,h){if(!ot.isUndefined(h))return n(void 0,h)}function o(l,h){if(ot.isUndefined(h)){if(!ot.isUndefined(l))return n(void 0,l)}else return n(void 0,h)}function a(l,h,u){if(u in t)return n(l,h);if(u in r)return n(void 0,l)}let c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(l,h)=>i(r2(l),r2(h),!0)};return ot.forEach(Object.keys(Object.assign({},r,t)),function(h){let u=c[h]||i,d=u(r[h],t[h],h);ot.isUndefined(d)&&u!==a||(e[h]=d)}),e}var Oh="1.6.8";var Rf={};["object","boolean","number","function","string","symbol"].forEach((r,t)=>{Rf[r]=function(n){return typeof n===r||"a"+(t<1?"n ":" ")+r}});var s2={};Rf.transitional=function(t,e,n){function i(s,o){return"[Axios v"+Oh+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(t===!1)throw new Ae(i(o," has been removed"+(e?" in "+e:"")),Ae.ERR_DEPRECATED);return e&&!s2[o]&&(s2[o]=!0,console.warn(i(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(s,o,a):!0}};function _A(r,t,e){if(typeof r!="object")throw new Ae("options must be an object",Ae.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),i=n.length;for(;i-- >0;){let s=n[i],o=t[s];if(o){let a=r[s],c=a===void 0||o(a,s,r);if(c!==!0)throw new Ae("option "+s+" must be "+c,Ae.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new Ae("Unknown option "+s,Ae.ERR_BAD_OPTION)}}var Lh={assertOptions:_A,validators:Rf};var Kr=Lh.validators,Uo=class{constructor(t){this.defaults=t,this.interceptors={request:new bf,response:new bf}}request(t,e){return dt(this,null,function*(){try{return yield this._request(t,e)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;let s=i.stack?i.stack.replace(/^.+\n/,""):"";n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` +`+s):n.stack=s}throw n}})}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=_r(this.defaults,e);let{transitional:n,paramsSerializer:i,headers:s}=e;n!==void 0&&Lh.assertOptions(n,{silentJSONParsing:Kr.transitional(Kr.boolean),forcedJSONParsing:Kr.transitional(Kr.boolean),clarifyTimeoutError:Kr.transitional(Kr.boolean)},!1),i!=null&&(ot.isFunction(i)?e.paramsSerializer={serialize:i}:Lh.assertOptions(i,{encode:Kr.function,serialize:Kr.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=s&&ot.merge(s.common,s[e.method]);s&&ot.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),e.headers=Gn.concat(o,s);let a=[],c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(e)===!1||(c=c&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});let l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let h,u=0,d;if(!c){let m=[Ih.bind(this),void 0];for(m.unshift.apply(m,a),m.push.apply(m,l),d=m.length,h=Promise.resolve(e);u{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s,o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},t(function(s,o,a){n.reason||(n.reason=new Zr(s,o,a),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new r(function(i){t=i}),cancel:t}}},o2=If;function Of(r){return function(e){return r.apply(null,e)}}function Lf(r){return ot.isObject(r)&&r.isAxiosError===!0}var Nf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Nf).forEach(([r,t])=>{Nf[t]=r});var a2=Nf;function c2(r){let t=new Kc(r),e=Gc(Kc.prototype.request,t);return ot.extend(e,Kc.prototype,t,{allOwnKeys:!0}),ot.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return c2(_r(r,i))},e}var fn=c2(Lo);fn.Axios=Kc;fn.CanceledError=Zr;fn.CancelToken=o2;fn.isCancel=$c;fn.VERSION=Oh;fn.toFormData=$r;fn.AxiosError=Ae;fn.Cancel=fn.CanceledError;fn.all=function(t){return Promise.all(t)};fn.spread=Of;fn.isAxiosError=Lf;fn.mergeConfig=_r;fn.AxiosHeaders=Gn;fn.formToJSON=r=>Ph(ot.isHTMLForm(r)?new FormData(r):r);fn.getAdapter=Rh.getAdapter;fn.HttpStatusCode=a2;fn.default=fn;var Wn=fn;var{Axios:wR,AxiosError:MR,CanceledError:DR,isCancel:BR,CancelToken:TR,VERSION:FR,all:PR,Cancel:kR,isAxiosError:RR,spread:IR,toFormData:OR,AxiosHeaders:LR,HttpStatusCode:NR,formToJSON:UR,getAdapter:VR,mergeConfig:zR}=Wn;var Jr=(()=>{let t=class t{constructor(){this.SCENE_BACKGROUND_COLOR="#FFFFFF",this.MOIM_ID="",this.DIARY_ID="",this.FACE_TYPE="",this.VIEW_TYPE="",this.TOP_NAVIGATOR_HEIGHT=60,this.BOTTOM_BUTTON_HEIGHT=80}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();var pe=(()=>{let t=class t{constructor(n){this._ssalonConfigService=n,this.apiExecutor=null,this.apiExecutorJson=null,this.apiURL="https://ssalon.co.kr/api",this.tokens={},this.token="",this.refreshToken="",this.myProfile=void 0,this.initApiExecutor()}ngOnInit(){return dt(this,null,function*(){})}setToken(n){this.token=n}initApiExecutor(){this.apiExecutor=Wn.create({baseURL:this.apiURL,headers:{"Content-Type":"multipart/form-data","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${this.token}`,withCredentials:!0}}),this.apiExecutorJson=Wn.create({baseURL:this.apiURL,headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${this.token}`,Refresh:this.refreshToken,withCredentials:!0}})}getMyProfile(){return dt(this,null,function*(){try{let n=yield this.apiExecutorJson?.get("/users/me/profile");this.myProfile=n.data,console.log(this.myProfile)}catch{}})}getLastMessages(n){return dt(this,null,function*(){try{let i=yield this.apiExecutor?.get(`/chat-history/${n}`);return console.log(i.data),i.data}catch{return!1}})}getTicket(n){return dt(this,null,function*(){try{let i=yield this.apiExecutor?.get(`/tickets/${n}`);return console.log(i.data),i.data}catch{return!1}})}createTicket(n,i){return dt(this,null,function*(){try{return console.log("post"),(yield this.apiExecutorJson?.post(`/tickets/${n}?template=${i}`)).data}catch{return(yield Wn.get("assets/decoration.json")).data}})}editTicket(n,i){return dt(this,null,function*(){try{return(yield this.apiExecutor?.put(`/tickets/${n}`,i)).data}catch(s){return console.log(s),(yield Wn.get("assets/decoration.json")).data}})}uploadTicketImages(n,i){return dt(this,null,function*(){try{return(yield this.apiExecutor?.post(`/tickets/${n}/image`,i)).data}catch(s){return console.log(s),(yield Wn.get("assets/decoration.json")).data}})}createMoimReview(n,i){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.post(`/diary/${n}/info`,i)).data}catch{return!1}})}getMoimReview(n){return dt(this,null,function*(){try{let i=yield this.apiExecutorJson?.get(`/diary/${n}/info`);return console.log(i.data),i.data}catch{return!1}})}getDiary(n){return dt(this,null,function*(){try{let i=yield this.apiExecutor?.get(`/diary/${n}`);return JSON.parse(i.data.resultJSON)}catch{return!1}})}createDiary(n,i){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.post(`/diary/${n}?template=${i}`)).data}catch(s){return console.log(s),(yield Wn.get("assets/decoration.json")).data}})}editDiary(n,i){return dt(this,null,function*(){try{return(yield this.apiExecutor?.put(`/diary/${n}`,i)).data}catch(s){return console.log(s),(yield Wn.get("assets/decoration.json")).data}})}uploadDiaryImages(n,i){return dt(this,null,function*(){try{return(yield this.apiExecutor?.post(`/diary/${n}/image`,i)).data}catch(s){return console.log(s),(yield Wn.get("assets/decoration.json")).data}})}uploadGeneralImage(n){return dt(this,null,function*(){try{return(yield this.apiExecutor?.post("/image-upload/general",n)).data}catch(i){return console.log(i),(yield Wn.get("assets/decoration.json")).data}})}getBarcode(n){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.get(`/tickets/${n}/link`)).data}catch{return"asdfo7a809sd7fwae9089iafa"}})}checkQR(n,i){return dt(this,null,function*(){try{let s={qrKey:i};return(yield this.apiExecutorJson?.post(`/tickets/${n}/link`,s)).data}catch{}})}changeAttendanceStatus(n,i,s=!1){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.post(`/moims/${n}/attendance/${i}`)).data}catch{}})}getJoiningUsers(n){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.get(`/moims/${n}/users`)).data}catch{}})}getMoimInfo(n){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.get(`/moims/${n}`)).data}catch(i){console.log(i)}})}getMoims(n=""){return dt(this,null,function*(){try{let i=n===""?"/moims?size=1000&isEnd=false":`/moims?isEnd=false&category=${n}&size=1000`;return(yield this.apiExecutorJson?.get(i)).data}catch(i){console.log(i)}})}getRunningMoims(){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.get("/moims?isParticipant=true&isEnd=false&size=100")).data}catch(n){console.log(n)}})}getEndedMoims(){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.get("/moims?isParticipant=true&isEnd=true&size=100")).data}catch(n){console.log(n)}})}joinMoim(n){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.post(`moims/${n}/users`))?.data}catch{return!1}})}checkParticipant(n){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.get(`moims/${n}/participant`)).data}catch{return!1}})}checkCreator(n){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.get(`moims/${n}/creator`)).data}catch{return!1}})}getProfile(){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.get("/users/me/profile")).data}catch{return!1}})}getIsRegister(){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.get("/users/me/signup-verify")).data.isRegistered}catch{return!1}})}createMeeting(n){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.post("/moims",n)).data}catch(i){console.log(i)}})}registerUser(n){return dt(this,null,function*(){try{return(yield this.apiExecutorJson?.post("/auth/signup",n)).data}catch(i){console.log(i)}})}};t.\u0275fac=function(i){return new(i||t)(Le(Jr))},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();var Ue=(()=>{let t=class t{constructor(){this.joinButtonElements=[{selected:!0,value:0,label:"\uCC38\uAC00\uD558\uAE30"}],this.createDiaryButtonElements=[{selected:!0,value:0,label:"\uD6C4\uAE30 \uC791\uC131\uD558\uAE30"}],this.loginButtonElements=[{selected:!1,value:0,label:"Google\uB85C \uC2DC\uC791\uD558\uAE30",solid:!1,imgSrc:"assets/login-icons/google.png"},{selected:!1,value:1,label:"Kakao\uB85C \uC2DC\uC791\uD558\uAE30",solid:!0,unselectedBackgroundColor:"#FEE500",unselectedFontColor:"#000000",selectedBackgroundColor:"#FEE500",selectedFontColor:"#000000",imgSrc:"assets/login-icons/kakao.png"},{selected:!1,value:2,label:"Naver\uB85C \uC2DC\uC791\uD558\uAE30",solid:!0,unselectedBackgroundColor:"#03C75A",unselectedFontColor:"#ffffff",selectedBackgroundColor:"#03C75A",selectedFontColor:"#ffffff",imgSrc:"assets/login-icons/naver.png"}],this.genderSelectionButtons=[{selected:!1,value:0,label:"\uB0A8\uC790"},{selected:!1,value:1,label:"\uC5EC\uC790"},{selected:!1,value:2,label:"\uAE30\uD0C0"}],this.locationSelectionButtons=[{selected:!1,value:0,label:"\uC11C\uC6B8\uD2B9\uBCC4\uC2DC"},{selected:!1,value:1,label:"\uACBD\uAE30\uB3C4"},{selected:!1,value:2,label:"\uAC15\uC6D0\uB3C4"},{selected:!1,value:3,label:"\uCDA9\uCCAD\uBD81\uB3C4"},{selected:!1,value:4,label:"\uCDA9\uCCAD\uB0A8\uB3C4"},{selected:!1,value:5,label:"\uC804\uB77C\uB0A8\uB3C4"},{selected:!1,value:6,label:"\uC804\uB77C\uBD81\uB3C4"},{selected:!1,value:7,label:"\uACBD\uC0C1\uBD81\uB3C4"},{selected:!1,value:8,label:"\uACBD\uC0C1\uB0A8\uB3C4"},{selected:!1,value:9,label:"\uC778\uCC9C\uAD11\uC5ED\uC2DC"}],this.interestSelectionButtons=[{selected:!1,value:0,label:"\uC6B4\uB3D9",imgSrc:"assets/interest-icons/excersize.png"},{selected:!1,value:1,label:"\uAC8C\uC784",imgSrc:"assets/interest-icons/game.png"},{selected:!1,value:2,label:"\uC74C\uC545",imgSrc:"assets/interest-icons/music.png"},{selected:!1,value:3,label:"\uC694\uB9AC",imgSrc:"assets/interest-icons/food.png"},{selected:!1,value:4,label:"\uB3C5\uC11C",imgSrc:"assets/interest-icons/book.png"}],this.categorySelectionButtons=[{selected:!0,value:0,label:"\uC804\uCCB4",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:1,label:"\uC6B4\uB3D9",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:2,label:"\uAC8C\uC784",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:3,label:"\uC74C\uC545",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:4,label:"\uC694\uB9AC",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:5,label:"\uB3C5\uC11C",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:6,label:"\uC601\uD654",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"}],this.createTicketButtons=[{selected:!1,value:0,label:"\uD2F0\uCF13\uB9CC\uB4E4\uAE30"}],this.createTicketTypeButtons=[{selected:!1,value:0,label:"\uCC98\uC74C\uBD80\uD130 \uB9CC\uB4E4\uAE30",imgSrc:"assets/create-ticket-type-icons/create.png"},{selected:!1,value:1,label:"\uD15C\uD50C\uB9BF\uC73C\uB85C \uB9CC\uB4E4\uAE30",imgSrc:"assets/create-ticket-type-icons/template.png"}],this.nextButtons=[{selected:!1,value:0,label:"\uB2E4\uC74C"}]}getLabelByValue(n,i){return n.find(s=>s.value===i)?.label}inintButtons(){this.joinButtonElements=[{selected:!0,value:0,label:"\uCC38\uAC00\uD558\uAE30"}],this.loginButtonElements=[{selected:!1,value:0,label:"Google\uB85C \uC2DC\uC791\uD558\uAE30",solid:!1,imgSrc:"assets/login-icons/google.png"},{selected:!1,value:1,label:"Kakao\uB85C \uC2DC\uC791\uD558\uAE30",solid:!0,unselectedBackgroundColor:"#FEE500",unselectedFontColor:"#000000",selectedBackgroundColor:"#FEE500",selectedFontColor:"#000000",imgSrc:"assets/login-icons/kakao.png"},{selected:!1,value:2,label:"Naver\uB85C \uC2DC\uC791\uD558\uAE30",solid:!0,unselectedBackgroundColor:"#03C75A",unselectedFontColor:"#ffffff",selectedBackgroundColor:"#03C75A",selectedFontColor:"#ffffff",imgSrc:"assets/login-icons/naver.png"}],this.genderSelectionButtons=[{selected:!1,value:0,label:"\uB0A8\uC790"},{selected:!1,value:1,label:"\uC5EC\uC790"},{selected:!1,value:2,label:"\uAE30\uD0C0"}],this.locationSelectionButtons=[{selected:!1,value:0,label:"\uC11C\uC6B8\uD2B9\uBCC4\uC2DC"},{selected:!1,value:1,label:"\uACBD\uAE30\uB3C4"},{selected:!1,value:2,label:"\uAC15\uC6D0\uB3C4"},{selected:!1,value:3,label:"\uCDA9\uCCAD\uBD81\uB3C4"},{selected:!1,value:4,label:"\uCDA9\uCCAD\uB0A8\uB3C4"},{selected:!1,value:5,label:"\uC804\uB77C\uB0A8\uB3C4"},{selected:!1,value:6,label:"\uC804\uB77C\uBD81\uB3C4"},{selected:!1,value:7,label:"\uACBD\uC0C1\uBD81\uB3C4"},{selected:!1,value:8,label:"\uACBD\uC0C1\uB0A8\uB3C4"},{selected:!1,value:9,label:"\uC778\uCC9C\uAD11\uC5ED\uC2DC"}],this.interestSelectionButtons=[{selected:!1,value:0,label:"\uC6B4\uB3D9",imgSrc:"assets/interest-icons/excersize.png"},{selected:!1,value:1,label:"\uAC8C\uC784",imgSrc:"assets/interest-icons/game.png"},{selected:!1,value:2,label:"\uC74C\uC545",imgSrc:"assets/interest-icons/music.png"},{selected:!1,value:3,label:"\uC694\uB9AC",imgSrc:"assets/interest-icons/food.png"},{selected:!1,value:4,label:"\uB3C5\uC11C",imgSrc:"assets/interest-icons/book.png"}],this.categorySelectionButtons=[{selected:!0,value:0,label:"\uC804\uCCB4",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:1,label:"\uC6B4\uB3D9",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:2,label:"\uAC8C\uC784",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:3,label:"\uC74C\uC545",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:4,label:"\uC694\uB9AC",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:5,label:"\uB3C5\uC11C",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"},{selected:!1,value:6,label:"\uC601\uD654",solid:!0,unselectedBackgroundColor:"#F8F8F8",unselectedFontColor:"#000000",selectedBackgroundColor:"#000000",selectedFontColor:"#ffffff"}],this.createTicketButtons=[{selected:!1,value:0,label:"\uD2F0\uCF13\uB9CC\uB4E4\uAE30"}],this.createTicketTypeButtons=[{selected:!1,value:0,label:"\uCC98\uC74C\uBD80\uD130 \uB9CC\uB4E4\uAE30",imgSrc:"assets/create-ticket-type-icons/create.png"},{selected:!1,value:1,label:"\uD15C\uD50C\uB9BF\uC73C\uB85C \uB9CC\uB4E4\uAE30",imgSrc:"assets/create-ticket-type-icons/template.png"}],this.nextButtons=[{selected:!1,value:0,label:"\uB2E4\uC74C"}]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();var yA=["progressBar"],bA=["nextButton"];function AA(r,t){if(r&1){let e=qt();I(0,"div",2),Ct(1,"app-profile-img",9),I(2,"app-simple-input",10),xt("onChangeEvent",function(i){Mt(e);let s=at();return Dt(s.onChangeUserInfo("nickname",i))}),N(),I(3,"app-simple-toggle",11),xt("onClickToggleButtonEvent",function(i){Mt(e);let s=at();return Dt(s.onChangeUserInfo("gender",i))}),N(),I(4,"app-simple-input",12),xt("onChangeEvent",function(i){Mt(e);let s=at();return Dt(s.onChangeUserInfo("introduction",i))}),N()()}if(r&2){let e=at();P(),V("imgSrc","assets/default_profile.png"),P(),V("label","\uB2C9\uB124\uC784")("extraLabel","(\uD544\uC218)")("extraLabelColor","#0090f2")("placeholder","\uB2C9\uB124\uC784\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694"),P(),V("label","\uC131\uBCC4")("extraLabel","(\uD544\uC218)")("extraLabelColor","#0090f2")("buttonElements",e.buttonElementsService.genderSelectionButtons)("buttonWidth",110),P(),V("label","\uC18C\uAC1C")("placeholder","\uAC04\uB2E8\uD55C \uC18C\uAC1C\uB97C \uD574\uC8FC\uC138\uC694")}}function SA(r,t){if(r&1){let e=qt();I(0,"div",2)(1,"app-simple-toggle",13),xt("onClickToggleButtonEvent",function(i){Mt(e);let s=at();return Dt(s.onChangeUserInfo("address",i))}),N()()}if(r&2){let e=at();P(),V("buttonElements",e.buttonElementsService.locationSelectionButtons)("columnNum",1)("buttonWidth",350)("align","left")}}function wA(r,t){if(r&1){let e=qt();I(0,"div",2)(1,"app-simple-toggle",14),xt("onClickToggleButtonEvent",function(i){Mt(e);let s=at();return Dt(s.onChangeUserInfo("interests",i))}),N()()}if(r&2){let e=at();P(),V("buttonElements",e.buttonElementsService.interestSelectionButtons)("columnNum",1)("buttonWidth",350)("align","left")("multiSelection",!0)}}var l2=(()=>{let t=class t{constructor(n,i,s){this._router=n,this._apiExecutorService=i,this.buttonElementsService=s,this.progressBar=null,this.nextButton=null,this.onBoardingStep=[{label:"\uD504\uB85C\uD544\uC744 \uC791\uC131\uD574\uC8FC\uC138\uC694",value:0},{label:"\uBAA8\uC784\uC744 \uD560 \uC7A5\uC18C\uB97C \uC120\uD0DD\uD574\uC8FC\uC138\uC694",value:1},{label:"\uAD00\uC2EC \uC788\uB294 \uCE74\uD14C\uACE0\uB9AC\uB97C \uC120\uD0DD\uD574\uC8FC\uC138\uC694",value:2}],this.nowOnboardingStep=this.onBoardingStep[0],this._userInfo={nickname:"",profilePrictureUrl:"",gender:"",address:"",introduction:"",interests:[]}}onChangeUserInfo(n,i){switch(n){case"nickname":this._userInfo.nickname=i;break;case"introduction":this._userInfo.introduction=i;break;case"gender":this._userInfo.gender=this.getStringFromGenderEnum(this.buttonElementsService.genderSelectionButtons.find(s=>s.selected===!0).value);break;case"address":this._userInfo.address=this.buttonElementsService.locationSelectionButtons.find(s=>s.selected===!0).label;break;case"interests":this._userInfo.interests=[...this.buttonElementsService.interestSelectionButtons].filter(s=>s.selected==!0).map(s=>s.label)}this.nowOnboardingStep===this.onBoardingStep[0]?this._userInfo.nickname!==""&&this._userInfo.introduction!==""&&this._userInfo.gender!==""&&(this.buttonElementsService.nextButtons[0].selected=!0):this.nowOnboardingStep===this.onBoardingStep[1]?this._userInfo.address!==""&&(this.buttonElementsService.nextButtons[0].selected=!0):this.nowOnboardingStep===this.onBoardingStep[2]&&this._userInfo.interests.length>0&&(this.buttonElementsService.nextButtons[0].selected=!0)}getStringFromGenderEnum(n){return n===0?"M":n===1?"F":"G"}onClickNextButton(n){return dt(this,null,function*(){if(this.buttonElementsService.nextButtons[0].selected){let i=this.nowOnboardingStep.value+1;i>=this.onBoardingStep.length?(this.buttonElementsService.interestSelectionButtons.every(s=>{s.selected=!1}),yield this._router.navigate(["/web/main"])):this.nowOnboardingStep=this.onBoardingStep[i],this.buttonElementsService.nextButtons[0].selected=!1}})}};t.\u0275fac=function(i){return new(i||t)(ft(We),ft(pe),ft(Ue))},t.\u0275cmp=vt({type:t,selectors:[["app-onboarding"]],viewQuery:function(i,s){if(i&1&&(te(yA,7),te(bA,7)),i&2){let o;Kt(o=Jt())&&(s.progressBar=o.first),Kt(o=Jt())&&(s.nextButton=o.first)}},standalone:!0,features:[Et],decls:12,vars:7,consts:[["progressBar",""],["nextButton",""],[1,"container"],["id","progress-bar",3,"value","max"],["id","onboarding-label"],["class","container",4,"ngIf"],["class"," container",4,"ngIf"],["id","next-button-container"],[3,"onClickEvent","buttonElements"],["id","profile-img",3,"imgSrc"],[3,"onChangeEvent","label","extraLabel","extraLabelColor","placeholder"],[3,"onClickToggleButtonEvent","label","extraLabel","extraLabelColor","buttonElements","buttonWidth"],[3,"onChangeEvent","label","placeholder"],[3,"onClickToggleButtonEvent","buttonElements","columnNum","buttonWidth","align"],[3,"onClickToggleButtonEvent","buttonElements","columnNum","buttonWidth","align","multiSelection"]],template:function(i,s){if(i&1){let o=qt();I(0,"div",2),Ct(1,"progress",3,0),I(3,"div",4)(4,"span"),Xt(5),N()(),At(6,AA,5,12,"div",5)(7,SA,2,4,"div",6)(8,wA,2,5,"div",5),I(9,"div",7)(10,"app-square-button",8,1),xt("onClickEvent",function(c){return Mt(o),Dt(s.onClickNextButton(c))}),N()()()}i&2&&(P(),V("value",s.nowOnboardingStep.value+1)("max",s.onBoardingStep.length),P(4),Ge(s.nowOnboardingStep.label),P(),V("ngIf",s.nowOnboardingStep.value===0),P(),V("ngIf",s.nowOnboardingStep.value===1),P(),V("ngIf",s.nowOnboardingStep.value===2),P(2),V("buttonElements",s.buttonElementsService.nextButtons))},dependencies:[he,qr,Mg,yi,sr],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;overflow-y:scroll;height:100%;width:100%;position:relative}.container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}#progress-bar[_ngcontent-%COMP%]{width:350px;height:10px;margin-top:28px;margin-bottom:28px;appearance:none}#progress-bar[_ngcontent-%COMP%]::-webkit-progress-bar{background-color:#efefef;border-radius:12px;overflow:hidden}#progress-bar[_ngcontent-%COMP%]::-webkit-progress-value{background-color:#006bff}#onboarding-label[_ngcontent-%COMP%]{width:350px;font-size:24px;font-weight:600;margin-bottom:16px;display:flex;align-items:left}#profile-img[_ngcontent-%COMP%]{margin-bottom:24px}#next-button-container[_ngcontent-%COMP%]{margin-bottom:20px}"]});let r=t;return r})();function MA(r,t){if(r&1&&(I(0,"span",5),Xt(1),N()),r&2){let e=at(2);Lt("color",e.extraLabelColor),P(),Ge(e.extraLabel)}}function DA(r,t){if(r&1&&(I(0,"div",3),Xt(1),At(2,MA,2,3,"span",4),N()),r&2){let e=at();P(),Ne(" ",e.label," "),P(),V("ngIf",e.extraLabel!=="")}}function BA(r,t){r&1&&(I(0,"div",14),Jn(),I(1,"svg",15),Ct(2,"path",16)(3,"path",17),N()())}function TA(r,t){if(r&1){let e=qt();sn(0),I(1,"div",8),xt("click",function(){let i=Mt(e).$implicit,s=at(3);return Dt(s.onClickTicket(i.moimId))}),Jn(),I(2,"svg",9),Ct(3,"path",10),N(),Ci(),Ct(4,"img",11),At(5,BA,4,0,"div",12),I(6,"div",13),Xt(7),N()(),on()}if(r&2){let e=t.$implicit,n=at(3);P(3),vi("fill",e.backgroundColor),P(),V("src",n.getThumbSrc(e.moimId),Cn),P(),V("ngIf",e.isCreator),P(2),Ge(e.meetingTitle)}}function FA(r,t){if(r&1&&(sn(0),I(1,"div",7),At(2,TA,8,4,"ng-container",6),N(),on()),r&2){let e=t.$implicit,n=at(2);P(),Lt("margin-bottom",n.modifiedTickets.length>1?16:0,"px")("width",n.ticketRowContainerWidth,"px"),P(),V("ngForOf",e)}}function PA(r,t){if(r&1&&(I(0,"div"),At(1,FA,3,5,"ng-container",6),N()),r&2){let e=at();P(),V("ngForOf",e.modifiedTickets)}}function kA(r,t){if(r&1){let e=qt();sn(0),I(1,"img",18),xt("click",function(){let i=Mt(e).$implicit,s=at(2);return Dt(s.onClickImage(i.value))}),N(),on()}if(r&2){let e=t.$implicit,n=at(2);P(),V("src",e.imgSrc,Cn)("height",n.imageHeight)}}function RA(r,t){if(r&1&&(I(0,"div",7),At(1,kA,2,2,"ng-container",6),N()),r&2){let e=at();P(),V("ngForOf",e.images)}}var Qr=(()=>{let t=class t{constructor(n){this._router=n,this.label="",this.extraLabel="",this.extraLabelColor="",this.moreButton=!1,this.imageHeight=200,this.isTicketContainer=!0,this.images=[{imgSrc:"assets/heart.png",value:0,label:"heart",selected:!1}],this.tickets=[],this.modifiedTickets=[],this.columnType=!1,this.columnNum=-1,this.isTicketsLoaded=!1,this.filter="",this.ticketRowContainerWidth=350,this.onClickImageEvent=new jt}ngOnInit(){this.isTicketContainer&&(this._setLayout(),this.columnType&&this.getColumnNum(),this.ticketRowContainerWidth=window.innerWidth*.95)}ngAfterViewChecked(){}_setLayout(){if(this.columnNum!==-1){let n=[];for(let i=0;i{let t=class t{constructor(){this.onClickNavigatorButtonEvent=new jt,this.navigatorButtons=[{selected:!0,value:jn.MAIN,label:"\uBA54\uC778"},{selected:!1,value:jn.SEARCH,label:"\uAC80\uC0C9"},{selected:!1,value:jn.CREATE,label:"\uAC1C\uCD5C"},{selected:!1,value:jn.MINE,label:"\uC99D\uD45C"},{selected:!1,value:jn.PROFILE,label:"\uD504\uB85C\uD544"}]}consturctor(){}ngAfterViewInit(){}onClickNavigatorButton(n){this.onClickNavigatorButtonEvent.emit(n),this.navigatorButtons.forEach(i=>{i.selected=i.value===n})}getColor(n){return this.navigatorButtons.find(i=>i.value===n).selected?"#000000":"#BCBCBC"}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-bottom-navigator"]],outputs:{onClickNavigatorButtonEvent:"onClickNavigatorButtonEvent"},standalone:!0,features:[Et],decls:20,vars:7,consts:[["id","navigator-button-container"],[1,"navigator-button",3,"click"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M12.5467 2.28456C12.224 2.0378 11.776 2.0378 11.4533 2.28456L2.95328 8.7845C2.7306 8.95478 2.59998 9.2191 2.59998 9.49943L2.59998 18.9292C2.59995 19.1836 2.59993 19.4256 2.61659 19.6296C2.63476 19.852 2.67715 20.1071 2.80707 20.3621C2.98923 20.7196 3.27989 21.0102 3.6374 21.1924C3.89237 21.3223 4.14748 21.3647 4.36989 21.3829C4.57384 21.3995 4.81586 21.3995 5.07016 21.3995H18.9297C19.184 21.3995 19.4261 21.3995 19.6301 21.3829C19.8525 21.3647 20.1076 21.3223 20.3626 21.1924C20.7201 21.0102 21.0107 20.7196 21.1929 20.3621C21.3228 20.1071 21.3652 19.852 21.3834 19.6296C21.4 19.4256 21.4 19.1836 21.4 18.9293L21.4 9.49943C21.4 9.2191 21.2694 8.95478 21.0467 8.7845L12.5467 2.28456ZM11.9392 4.17898C11.9751 4.15156 12.0249 4.15156 12.0607 4.17898L19.5607 9.91422C19.5855 9.93314 19.6 9.96251 19.6 9.99365V19.4995C19.6 19.5548 19.5552 19.5995 19.5 19.5995H12.9003V13.9995H11.1003V19.5995H4.49998C4.44475 19.5995 4.39998 19.5548 4.39998 19.4995V9.99365C4.39998 9.96251 4.4145 9.93314 4.43924 9.91422L11.9392 4.17898Z"],["fill-rule","evenodd","clip-rule","evenodd","d","M9.99972 2.1001C5.63668 2.1001 2.09973 5.63705 2.09973 10.0001C2.09973 14.3631 5.63668 17.9001 9.99972 17.9001C11.857 17.9001 13.5646 17.2592 14.9134 16.1864L19.8635 21.1365C20.2149 21.4879 20.7848 21.4879 21.1363 21.1365C21.4877 20.785 21.4877 20.2151 21.1363 19.8637L16.1862 14.9136C17.2588 13.5648 17.8997 11.8573 17.8997 10.0001C17.8997 5.63705 14.3628 2.1001 9.99972 2.1001ZM3.89973 10.0001C3.89973 6.63116 6.63079 3.9001 9.99972 3.9001C13.3687 3.9001 16.0997 6.63116 16.0997 10.0001C16.0997 13.369 13.3687 16.1001 9.99972 16.1001C6.63079 16.1001 3.89973 13.369 3.89973 10.0001Z"],["d","M12.8997 7.10029H11.0997V11.1003H7.09975V12.9003H11.0997V16.9003H12.8997V12.9003H16.8997V11.1003H12.8997V7.10029Z"],["fill-rule","evenodd","clip-rule","evenodd","d","M9.61084 2.3501C8.52377 2.35009 7.65308 2.35008 6.94931 2.40758C6.22665 2.46663 5.60108 2.59076 5.02524 2.88417C4.10325 3.35395 3.35364 4.10355 2.88386 5.02554C2.59045 5.60139 2.46632 6.22695 2.40728 6.94962C2.34978 7.65339 2.34978 8.52407 2.34979 9.61114L2.34979 14.389C2.34978 15.4761 2.34978 16.3468 2.40728 17.0506C2.46632 17.7732 2.59045 18.3988 2.88386 18.9746C3.35364 19.8966 4.10325 20.6462 5.02524 21.116C5.60108 21.4094 6.22665 21.5336 6.94931 21.5926C7.65307 21.6501 8.52372 21.6501 9.61075 21.6501H14.3887C15.4758 21.6501 16.3465 21.6501 17.0503 21.5926C17.7729 21.5336 18.3985 21.4094 18.9743 21.116C19.8963 20.6462 20.6459 19.8966 21.1157 18.9746C21.4091 18.3988 21.5333 17.7732 21.5923 17.0506C21.6498 16.3468 21.6498 15.4762 21.6498 14.3891V9.61115C21.6498 8.52411 21.6498 7.65337 21.5923 6.94962C21.5333 6.22695 21.4091 5.60139 21.1157 5.02554C20.6459 4.10355 19.8963 3.35395 18.9743 2.88417C18.3985 2.59076 17.7729 2.46663 17.0503 2.40758C16.3465 2.35008 15.4758 2.35009 14.3887 2.3501H9.61084ZM5.84242 4.48798C6.12222 4.34541 6.48454 4.25156 7.09589 4.20161C7.71775 4.1508 8.51484 4.1501 9.64979 4.1501H14.3498C15.4847 4.1501 16.2818 4.1508 16.9037 4.20161C17.515 4.25156 17.8774 4.34541 18.1572 4.48798C18.7405 4.78519 19.2147 5.25942 19.5119 5.84273C19.6545 6.12253 19.7483 6.48484 19.7983 7.09619C19.8491 7.71805 19.8498 8.51514 19.8498 9.6501V14.3501C19.8498 15.4851 19.8491 16.2821 19.7983 16.904C19.7483 17.5154 19.6545 17.8777 19.5119 18.1575C19.2147 18.7408 18.7405 19.215 18.1572 19.5122C17.8774 19.6548 17.515 19.7486 16.9037 19.7986C16.2818 19.8494 15.4847 19.8501 14.3498 19.8501H9.64979C8.51484 19.8501 7.71775 19.8494 7.09589 19.7986C6.48454 19.7486 6.12222 19.6548 5.84242 19.5122C5.25912 19.215 4.78488 18.7408 4.48767 18.1575C4.34511 17.8777 4.25125 17.5154 4.2013 16.904C4.15049 16.2821 4.14979 15.4851 4.14979 14.3501V9.6501C4.14979 8.51514 4.15049 7.71805 4.2013 7.09619C4.25125 6.48484 4.34511 6.12253 4.48767 5.84273C4.78488 5.25942 5.25912 4.78519 5.84242 4.48798Z"],["width","16","height","20","viewBox","0 0 16 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M15 11V11.9H15.9V11H15ZM15 15H15.9V14.1H15V15ZM1 15V14.1H0.1V15H1ZM1 11H0.1V11.9H1V11ZM3 0.1C1.39837 0.1 0.1 1.39837 0.1 3H1.9C1.9 2.39249 2.39249 1.9 3 1.9V0.1ZM13 0.1H3V1.9H13V0.1ZM15.9 3C15.9 1.39837 14.6016 0.1 13 0.1V1.9C13.6075 1.9 14.1 2.39249 14.1 3H15.9ZM15.9 11V3H14.1V11H15.9ZM13.9 13C13.9 12.3925 14.3925 11.9 15 11.9V10.1C13.3984 10.1 12.1 11.3984 12.1 13H13.9ZM15 14.1C14.3925 14.1 13.9 13.6075 13.9 13H12.1C12.1 14.6016 13.3984 15.9 15 15.9V14.1ZM15.9 17V15H14.1V17H15.9ZM13 19.9C14.6016 19.9 15.9 18.6016 15.9 17H14.1C14.1 17.6075 13.6075 18.1 13 18.1V19.9ZM3 19.9H13V18.1H3V19.9ZM0.1 17C0.1 18.6016 1.39837 19.9 3 19.9V18.1C2.39249 18.1 1.9 17.6075 1.9 17H0.1ZM0.1 15V17H1.9V15H0.1ZM2.1 13C2.1 13.6075 1.60751 14.1 1 14.1V15.9C2.60163 15.9 3.9 14.6016 3.9 13H2.1ZM1 11.9C1.60751 11.9 2.1 12.3925 2.1 13H3.9C3.9 11.3984 2.60163 10.1 1 10.1V11.9ZM0.1 3V11H1.9V3H0.1Z"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["cx","10","cy","5","r","4","stroke","black","stroke-width","2"],["id","path-2-inside-1_108_111","fill","white"],["fill-rule","evenodd","clip-rule","evenodd","d","M20 15V19C20 19.5523 19.5523 20 19 20H1C0.447715 20 0 19.5523 0 19V15C0 15 0 15 0 15C3.28568e-05 13.1591 4.47717 11.6667 10 11.6667C15.5228 11.6667 20 13.1591 20 15C20 15 20 15 20 15Z"],["d","M0 15L-2 15V15H0ZM20 15L22 15L22 15L20 15ZM18 15V19H22V15H18ZM18 19C18 18.4477 18.4477 18 19 18V22C20.6569 22 22 20.6569 22 19H18ZM19 18H1V22H19V18ZM1 18C1.55228 18 2 18.4477 2 19H-2C-2 20.6569 -0.656853 22 1 22V18ZM2 19V15H-2V19H2ZM2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15C2 15 2 15 2 15H-2C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15C-2 15 -2 15 -2 15H2ZM2 15C1.99999 15.4153 1.74572 15.4925 2.0238 15.2734C2.27934 15.072 2.77305 14.8031 3.5614 14.5404C5.1172 14.0218 7.39373 13.6667 10 13.6667V9.66669C7.08344 9.66669 4.35999 10.0578 2.2965 10.7456C1.27521 11.0861 0.30445 11.5355 -0.452072 12.1317C-1.18604 12.7101 -1.99998 13.6643 -2 15L2 15ZM10 13.6667C12.6063 13.6667 14.8828 14.0218 16.4386 14.5404C17.2269 14.8031 17.7207 15.072 17.9762 15.2734C18.2543 15.4925 18 15.4153 18 15L22 15C22 13.6643 21.186 12.7101 20.4521 12.1317C19.6956 11.5355 18.7248 11.0861 17.7035 10.7456C15.64 10.0578 12.9166 9.66669 10 9.66669V13.6667ZM18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15C18 15 18 15 18 15H22C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15C22 15 22 15 22 15H18Z","mask","url(#path-2-inside-1_108_111)"]],template:function(i,s){i&1&&(I(0,"div",0)(1,"div",1),xt("click",function(){return s.onClickNavigatorButton(0)}),Jn(),I(2,"svg",2),Ct(3,"path",3),N()(),Ci(),I(4,"div",1),xt("click",function(){return s.onClickNavigatorButton(1)}),Jn(),I(5,"svg",2),Ct(6,"path",4),N()(),Ci(),I(7,"div",1),xt("click",function(){return s.onClickNavigatorButton(2)}),Jn(),I(8,"svg",2),Ct(9,"path",5)(10,"path",6),N()(),Ci(),I(11,"div",1),xt("click",function(){return s.onClickNavigatorButton(3)}),Jn(),I(12,"svg",7),Ct(13,"path",8),N()(),Ci(),I(14,"div",1),xt("click",function(){return s.onClickNavigatorButton(4)}),Jn(),I(15,"svg",9),Ct(16,"circle",10),I(17,"mask",11),Ct(18,"path",12),N(),Ct(19,"path",13),N()()()),i&2&&(P(3),vi("fill",s.getColor(0)),P(3),vi("fill",s.getColor(1)),P(3),vi("fill",s.getColor(2)),P(),vi("fill",s.getColor(2)),P(3),vi("fill",s.getColor(3)),P(3),vi("stroke",s.getColor(4)),P(3),vi("fill",s.getColor(4)))},styles:["#navigator-button-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;justify-content:space-evenly;height:50px;width:100%;background-color:#fff}.selected-navigator-button[_ngcontent-%COMP%]{fill:#000}.unselected-navigator-icon[_ngcontent-%COMP%]{fill:#bcbcbc}.navigator-button[_ngcontent-%COMP%]:hover{cursor:pointer}"]});let r=t;return r})();var IA=["ticketContainer"];function OA(r,t){if(r&1&&(I(0,"div",6),Ct(1,"app-image-row-container",7),N()),r&2){let e=at(),n=e.$implicit,i=e.index,s=at();P(),V("tickets",s.ticketThumbnails[i])("isTicketContainer",!0)("label",n.label)}}function LA(r,t){if(r&1&&(sn(0),At(1,OA,2,3,"div",5),on()),r&2){let e=t.index,n=at();P(),V("ngIf",n.isLoadedTickets(e))}}var u2=(()=>{let t=class t{constructor(n,i,s){this._apiExecutorService=n,this._router=i,this.buttonElementsService=s,this.ticketContainer=null,this.ticketThumbnails=[]}ngOnInit(){return dt(this,null,function*(){let n=yield this._apiExecutorService.getMoims();this.ticketThumbnails.push(n.content);for(let i=0;i0&&this.ticketThumbnails[n]!==void 0?this.ticketThumbnails[n].length>0:!1}};t.\u0275fac=function(i){return new(i||t)(ft(pe),ft(We),ft(Ue))},t.\u0275cmp=vt({type:t,selectors:[["app-moim-list"]],viewQuery:function(i,s){if(i&1&&te(IA,5),i&2){let o;Kt(o=Jt())&&(s.ticketContainer=o.first)}},standalone:!0,features:[Et],decls:5,vars:7,consts:[["ticketContainer",""],["id","category-container"],[3,"onClickToggleButtonEvent","buttonElements","columnNum","buttonWidth","buttonHeight","componentWidth","fontSize"],["id","ticket-container"],[4,"ngFor","ngForOf"],["class","tickets-row-container",4,"ngIf"],[1,"tickets-row-container"],[3,"tickets","isTicketContainer","label"]],template:function(i,s){if(i&1){let o=qt();I(0,"div",1)(1,"app-simple-toggle",2),xt("onClickToggleButtonEvent",function(c){return Mt(o),Dt(s.onClickCategoryButton(c))}),N()(),I(2,"div",3,0),At(4,LA,2,1,"ng-container",4),N()}i&2&&(P(),V("buttonElements",s.buttonElementsService.categorySelectionButtons)("columnNum",-1)("buttonWidth",50)("buttonHeight",30)("componentWidth",430)("fontSize",14),P(3),V("ngForOf",s.buttonElementsService.categorySelectionButtons))},dependencies:[he,en,yi,Qr],styles:["#category-container[_ngcontent-%COMP%]{position:fixed;top:50px;display:flex;align-items:center;width:100%;height:50px;overflow-x:scroll;background-color:#fff;z-index:10}#category-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}#ticket-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;flex-direction:column;width:100%;background-color:#fff;margin-top:40px}#ticket-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.tickets-row-container[_ngcontent-%COMP%]{margin-bottom:40px}"]});let r=t;return r})();var d2=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-moim-search"]],standalone:!0,features:[Et],decls:2,vars:0,template:function(i,s){i&1&&(I(0,"p"),Xt(1,"moim-search works!"),N())}});let r=t;return r})();function NA(r,t){if(r&1){let e=qt();sn(0),I(1,"div",2),xt("click",function(){let i=Mt(e).$implicit,s=at();return Dt(s.onClickTab(i.value))}),Xt(2),N(),on()}if(r&2){let e=t.$implicit,n=at();P(),Lt("width",n.getButtonWidth(),"px"),V("ngClass",n.getClass(e.value)),P(),Ge(e.label)}}var Uh=(()=>{let t=class t{constructor(){this.tabs=[{selected:!0,value:0,label:"Tab 1"},{selected:!1,value:1,label:"Tab 2"},{selected:!1,value:2,label:"Tab 3"}],this.onClickTabEvent=new jt}onClickTab(n){this.onClickTabEvent.emit(n),this.tabs=this.tabs.map(i=>Ze(Nt({},i),{selected:i.value===n}))}getClass(n){return this.tabs.find(i=>i.value===n).selected?"selected-tab":"unselected-tab"}getButtonWidth(){return window.innerWidth/this.tabs.length}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-tab-group"]],inputs:{tabs:"tabs"},outputs:{onClickTabEvent:"onClickTabEvent"},standalone:!0,features:[Et],decls:2,vars:1,consts:[[1,"container"],[4,"ngFor","ngForOf"],[3,"click","ngClass"]],template:function(i,s){i&1&&(I(0,"div",0),At(1,NA,3,4,"ng-container",1),N()),i&2&&(P(),V("ngForOf",s.tabs))},dependencies:[en,Ao],styles:['.container[_ngcontent-%COMP%]{width:100%;height:30px;display:flex;flex-direction:row}.unselected-tab[_ngcontent-%COMP%]{border-bottom:2px solid #BCBCBC;display:flex;justify-content:center;align-items:center;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-weight:500;font-size:14px;color:#bcbcbc}.selected-tab[_ngcontent-%COMP%]{border-bottom:2px solid black;display:flex;justify-content:center;align-items:center;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-weight:500;font-size:14px}']});let r=t;return r})();function UA(r,t){if(r&1&&(I(0,"div"),Ct(1,"app-image-row-container",5),N()),r&2){let e=at();P(),V("isTicketContainer",!0)("tickets",e.runningTickets)("columnType",!0)}}function VA(r,t){if(r&1&&(I(0,"div"),Ct(1,"app-image-row-container",5),N()),r&2){let e=at();P(),V("isTicketContainer",!0)("tickets",e.endedTickets)("columnType",!0)}}var ts=function(r){return r[r.RUNNING=0]="RUNNING",r[r.ENDED=1]="ENDED",r}(ts||{}),f2=(()=>{let t=class t{constructor(n,i){this.buttonElementsService=n,this._apiExecutorService=i,this.tabElements=[{selected:!0,value:ts.RUNNING,label:"\uC9C4\uD589\uC911\uC778 \uBAA8\uC784"},{selected:!1,value:ts.ENDED,label:"\uB05D\uB09C \uBAA8\uC784"}],this.runningTickets=[],this.endedTickets=[],this.nowTab=ts.RUNNING,this.ticketListTabEnum=ts}ngOnInit(){return dt(this,null,function*(){let n=yield this._apiExecutorService.getRunningMoims();this.runningTickets=n.content;let i=yield this._apiExecutorService.getEndedMoims();this.endedTickets=i.content})}isLoaded(){let n=!1;return this.nowTab===ts.RUNNING?this.runningTickets!==void 0?n=this.runningTickets.length>0:n=!1:this.nowTab===ts.ENDED&&this.endedTickets!==void 0?n=this.endedTickets.length>0:n=!1,n}onCickTabButton(n){return dt(this,null,function*(){this.nowTab=n,this.nowTab===ts.RUNNING?(this.runningTickets=(yield this._apiExecutorService.getRunningMoims()).content,console.log(yield this._apiExecutorService.getRunningMoims())):this.endedTickets=(yield this._apiExecutorService.getEndedMoims()).content})}getMoimInfos(n){return dt(this,null,function*(){})}};t.\u0275fac=function(i){return new(i||t)(ft(Ue),ft(pe))},t.\u0275cmp=vt({type:t,selectors:[["app-my-ticket-list"]],standalone:!0,features:[Et],decls:6,vars:3,consts:[[1,"container"],["id","tab-container"],[3,"onClickTabEvent","tabs"],[1,"tab-content-container"],[4,"ngIf"],[3,"isTicketContainer","tickets","columnType"]],template:function(i,s){i&1&&(I(0,"div",0)(1,"div",1)(2,"app-tab-group",2),xt("onClickTabEvent",function(a){return s.onCickTabButton(a)}),N()(),I(3,"div",3),At(4,UA,2,3,"div",4)(5,VA,2,3,"div",4),N()()),i&2&&(P(2),V("tabs",s.tabElements),P(2),V("ngIf",s.nowTab===s.ticketListTabEnum.RUNNING&&s.isLoaded()),P(),V("ngIf",s.nowTab===s.ticketListTabEnum.ENDED&&s.isLoaded()))},dependencies:[he,Uh,Qr],styles:[".container[_ngcontent-%COMP%]{height:100%;width:100%;position:relative;overflow-y:scroll}.container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}#tab-container[_ngcontent-%COMP%]{position:fixed;top:50px;display:flex;align-items:center;width:100%;background-color:#fff;z-index:10}.tab-content-container[_ngcontent-%COMP%]{height:100%;width:100%;margin-top:40px;display:flex;justify-content:center}"]});let r=t;return r})();var x2=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-profile"]],standalone:!0,features:[Et],decls:2,vars:0,template:function(i,s){i&1&&(I(0,"p"),Xt(1,"profile works!"),N())}});let r=t;return r})();var p2=(()=>{let t=class t{constructor(){}getThumbnail(n,i,s){return` + + +`}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();function HA(r,t){r&1&&(I(0,"div"),Ct(1,"app-moim-list"),N())}function GA(r,t){r&1&&(I(0,"div"),Ct(1,"app-moim-search"),N())}function WA(r,t){r&1&&(I(0,"div"),Ct(1,"app-my-ticket-list"),N())}function jA(r,t){r&1&&(I(0,"div"),Ct(1,"app-profile"),N())}var jn=function(r){return r[r.MAIN=0]="MAIN",r[r.SEARCH=1]="SEARCH",r[r.CREATE=2]="CREATE",r[r.MINE=3]="MINE",r[r.PROFILE=4]="PROFILE",r}(jn||{}),m2=(()=>{let t=class t{constructor(n,i){this._router=n,this.thumbnailMakerService=i,this.navigatorSelectionButtons=[{selected:!0,value:jn.MAIN,label:"\uBA54\uC778"},{selected:!1,value:jn.SEARCH,label:"\uAC80\uC0C9"},{selected:!1,value:jn.CREATE,label:"\uAC1C\uCD5C"},{selected:!1,value:jn.MINE,label:"\uC99D\uD45C"},{selected:!1,value:jn.PROFILE,label:"\uD504\uB85C\uD544"}],this.mainTabEnum=jn,this.nowTab=jn.MAIN}ngOnInit(){}onClickNavigatorButton(n){this.nowTab=n,console.log(n),n===jn.CREATE&&this._router.navigate(["/web/meeting-create"])}getNavigatorButtonClass(n){return n?"navigator-button-selected":"navigator-button"}};t.\u0275fac=function(i){return new(i||t)(ft(We),ft(p2))},t.\u0275cmp=vt({type:t,selectors:[["app-main"]],standalone:!0,features:[Et],decls:10,vars:4,consts:[[1,"container"],["id","logo-container"],["src","assets/ssalon_logo_hand.svg","height","30px"],["id","tab-container"],[4,"ngIf"],["id","navigator-container"],[3,"onClickNavigatorButtonEvent"]],template:function(i,s){i&1&&(I(0,"div",0)(1,"div",1),Ct(2,"img",2),N(),I(3,"div",3),At(4,HA,2,0,"div",4)(5,GA,2,0,"div",4)(6,WA,2,0,"div",4)(7,jA,2,0,"div",4),N(),I(8,"div",5)(9,"app-bottom-navigator",6),xt("onClickNavigatorButtonEvent",function(a){return s.onClickNavigatorButton(a)}),N()()()),i&2&&(P(4),V("ngIf",s.nowTab===s.mainTabEnum.MAIN),P(),V("ngIf",s.nowTab===s.mainTabEnum.SEARCH),P(),V("ngIf",s.nowTab===s.mainTabEnum.MINE),P(),V("ngIf",s.nowTab===s.mainTabEnum.PROFILE))},dependencies:[he,h2,u2,d2,f2,x2],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;overflow-y:scroll;height:100%;width:100%;position:relative}.container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}#logo-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:left;margin-top:14px;width:95%}#tab-container[_ngcontent-%COMP%]{height:calc(100% - 80px);width:95%;margin-top:20px;overflow-y:scroll;position:relative}#tab-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}#navigator-container[_ngcontent-%COMP%]{width:100%}.navigator-button[_ngcontent-%COMP%]{height:20px}.navigator-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:#bcbcbc}.navigator-button-selected[_ngcontent-%COMP%]{height:20px;fill:#000;stroke:#0000}.navigator-button-selected[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:#2c2c2c}"]});let r=t;return r})();var rp="164";var XA=0,g2=1,YA=2;var QC=1,qA=2,Dr=3,hr=0,ni=1,Tr=2,ls=0,oa=1,C2=2,v2=3,E2=4,$A=5,Xs=100,ZA=101,KA=102,JA=103,QA=104,t9=200,e9=201,n9=202,i9=203,vx=204,Ex=205,r9=206,s9=207,o9=208,a9=209,c9=210,l9=211,h9=212,u9=213,d9=214,f9=0,x9=1,p9=2,fu=3,m9=4,g9=5,C9=6,v9=7,sp=0,E9=1,_9=2,hs=0,y9=1,b9=2,A9=3,S9=4,w9=5,M9=6,D9=7;var _2=300,ha=301,ua=302,_x=303,yx=304,zu=306,cl=1e3,qs=1001,bx=1002,wi=1003,B9=1004;var Vh=1005;var zi=1006,Uf=1007;var $s=1008;var us=1009,T9=1010,F9=1011,t5=1012,e5=1013,da=1014,cs=1015,Hu=1016,n5=1017,i5=1018,ml=1020,P9=35902,k9=1021,R9=1022,cr=1023,I9=1024,O9=1025,aa=1026,ll=1027,L9=1028,r5=1029,N9=1030,s5=1031,o5=1033,Vf=33776,zf=33777,Hf=33778,Gf=33779,y2=35840,b2=35841,A2=35842,S2=35843,w2=36196,M2=37492,D2=37496,B2=37808,T2=37809,F2=37810,P2=37811,k2=37812,R2=37813,I2=37814,O2=37815,L2=37816,N2=37817,U2=37818,V2=37819,z2=37820,H2=37821,Wf=36492,G2=36494,W2=36495,U9=36283,j2=36284,X2=36285,Y2=36286;var xu=2300,pu=2301,jf=2302,q2=2400,$2=2401,Z2=2402;var V9=3200,z9=3201,a5=0,H9=1,as="",Si="srgb",fs="srgb-linear",op="display-p3",Gu="display-p3-linear",mu="linear",qe="srgb",gu="rec709",Cu="p3";var Vo=7680;var K2=519,G9=512,W9=513,j9=514,c5=515,X9=516,Y9=517,q9=518,$9=519,J2=35044;var Q2="300 es",Fr=2e3,vu=2001,ur=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let i=this._listeners[t];if(i!==void 0){let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let s=0,o=i.length;s>8&255]+In[r>>16&255]+In[r>>24&255]+"-"+In[t&255]+In[t>>8&255]+"-"+In[t>>16&15|64]+In[t>>24&255]+"-"+In[e&63|128]+In[e>>8&255]+"-"+In[e>>16&255]+In[e>>24&255]+In[n&255]+In[n>>8&255]+In[n>>16&255]+In[n>>24&255]).toLowerCase()}function wn(r,t,e){return Math.max(t,Math.min(e,r))}function ap(r,t){return(r%t+t)%t}function Z9(r,t,e,n,i){return n+(r-t)*(i-n)/(e-t)}function K9(r,t,e){return r!==t?(e-r)/(t-r):0}function ol(r,t,e){return(1-e)*r+e*t}function J9(r,t,e,n){return ol(r,t,1-Math.exp(-e*n))}function Q9(r,t=1){return t-Math.abs(ap(r,t*2)-t)}function tS(r,t,e){return r<=t?0:r>=e?1:(r=(r-t)/(e-t),r*r*(3-2*r))}function eS(r,t,e){return r<=t?0:r>=e?1:(r=(r-t)/(e-t),r*r*r*(r*(r*6-15)+10))}function nS(r,t){return r+Math.floor(Math.random()*(t-r+1))}function iS(r,t){return r+Math.random()*(t-r)}function rS(r){return r*(.5-Math.random())}function sS(r){r!==void 0&&(tC=r);let t=tC+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function oS(r){return r*sl}function aS(r){return r*hl}function cS(r){return(r&r-1)===0&&r!==0}function lS(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function hS(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function uS(r,t,e,n,i){let s=Math.cos,o=Math.sin,a=s(e/2),c=o(e/2),l=s((t+n)/2),h=o((t+n)/2),u=s((t-n)/2),d=o((t-n)/2),f=s((n-t)/2),m=o((n-t)/2);switch(i){case"XYX":r.set(a*h,c*u,c*d,a*l);break;case"YZY":r.set(c*d,a*h,c*u,a*l);break;case"ZXZ":r.set(c*u,c*d,a*h,a*l);break;case"XZX":r.set(a*h,c*m,c*f,a*l);break;case"YXY":r.set(c*f,a*h,c*m,a*l);break;case"ZYZ":r.set(c*m,c*f,a*h,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function ia(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Xn(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var Qe={DEG2RAD:sl,RAD2DEG:hl,generateUUID:Ea,clamp:wn,euclideanModulo:ap,mapLinear:Z9,inverseLerp:K9,lerp:ol,damp:J9,pingpong:Q9,smoothstep:tS,smootherstep:eS,randInt:nS,randFloat:iS,randFloatSpread:rS,seededRandom:sS,degToRad:oS,radToDeg:aS,isPowerOfTwo:cS,ceilPowerOfTwo:lS,floorPowerOfTwo:hS,setQuaternionFromProperEuler:uS,normalize:Xn,denormalize:ia},re=class r{constructor(t=0,e=0){r.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(wn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,o=this.y-t.y;return this.x=s*n-o*i+t.x,this.y=s*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},ge=class r{constructor(t,e,n,i,s,o,a,c,l){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,c,l)}set(t,e,n,i,s,o,a,c,l){let h=this.elements;return h[0]=t,h[1]=i,h[2]=a,h[3]=e,h[4]=s,h[5]=c,h[6]=n,h[7]=o,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[3],c=n[6],l=n[1],h=n[4],u=n[7],d=n[2],f=n[5],m=n[8],g=i[0],x=i[3],p=i[6],C=i[1],v=i[4],_=i[7],A=i[2],b=i[5],S=i[8];return s[0]=o*g+a*C+c*A,s[3]=o*x+a*v+c*b,s[6]=o*p+a*_+c*S,s[1]=l*g+h*C+u*A,s[4]=l*x+h*v+u*b,s[7]=l*p+h*_+u*S,s[2]=d*g+f*C+m*A,s[5]=d*x+f*v+m*b,s[8]=d*p+f*_+m*S,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],c=t[6],l=t[7],h=t[8];return e*o*h-e*a*l-n*s*h+n*a*c+i*s*l-i*o*c}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],c=t[6],l=t[7],h=t[8],u=h*o-a*l,d=a*c-h*s,f=l*s-o*c,m=e*u+n*d+i*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/m;return t[0]=u*g,t[1]=(i*l-h*n)*g,t[2]=(a*n-i*o)*g,t[3]=d*g,t[4]=(h*e-i*c)*g,t[5]=(i*s-a*e)*g,t[6]=f*g,t[7]=(n*c-l*e)*g,t[8]=(o*e-n*s)*g,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,s,o,a){let c=Math.cos(s),l=Math.sin(s);return this.set(n*c,n*l,-n*(c*o+l*a)+o+t,-i*l,i*c,-i*(-l*o+c*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Xf.makeScale(t,e)),this}rotate(t){return this.premultiply(Xf.makeRotation(-t)),this}translate(t,e){return this.premultiply(Xf.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},Xf=new ge;function l5(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function ul(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function dS(){let r=ul("canvas");return r.style.display="block",r}var eC={};function fS(r){r in eC||(eC[r]=!0,console.warn(r))}var nC=new ge().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),iC=new ge().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),zh={[fs]:{transfer:mu,primaries:gu,toReference:r=>r,fromReference:r=>r},[Si]:{transfer:qe,primaries:gu,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Gu]:{transfer:mu,primaries:Cu,toReference:r=>r.applyMatrix3(iC),fromReference:r=>r.applyMatrix3(nC)},[op]:{transfer:qe,primaries:Cu,toReference:r=>r.convertSRGBToLinear().applyMatrix3(iC),fromReference:r=>r.applyMatrix3(nC).convertLinearToSRGB()}},xS=new Set([fs,Gu]),Ve={enabled:!0,_workingColorSpace:fs,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!xS.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,t,e){if(this.enabled===!1||t===e||!t||!e)return r;let n=zh[t].toReference,i=zh[e].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,t){return this.convert(r,this._workingColorSpace,t)},toWorkingColorSpace:function(r,t){return this.convert(r,t,this._workingColorSpace)},getPrimaries:function(r){return zh[r].primaries},getTransfer:function(r){return r===as?mu:zh[r].transfer}};function ca(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Yf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var zo,Ax=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{zo===void 0&&(zo=ul("canvas")),zo.width=t.width,zo.height=t.height;let n=zo.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=zo}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=ul("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let o=0;o{class r extends ur{constructor(e=r.DEFAULT_IMAGE,n=r.DEFAULT_MAPPING,i=qs,s=qs,o=zi,a=$s,c=cr,l=us,h=r.DEFAULT_ANISOTROPY,u=as){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:mS++}),this.uuid=Ea(),this.name="",this.source=new Eu(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=s,this.magFilter=o,this.minFilter=a,this.anisotropy=h,this.format=c,this.internalFormat=null,this.type=l,this.offset=new re(0,0),this.repeat=new re(1,1),this.center=new re(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ge,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==_2)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case cl:e.x=e.x-Math.floor(e.x);break;case qs:e.x=e.x<0?0:1;break;case bx:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case cl:e.y=e.y-Math.floor(e.y);break;case qs:e.y=e.y<0?0:1;break;case bx:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}return r.DEFAULT_IMAGE=null,r.DEFAULT_MAPPING=_2,r.DEFAULT_ANISOTROPY=1,r})(),Je=class r{constructor(t=0,e=0,n=0,i=1){r.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,s,c=t.elements,l=c[0],h=c[4],u=c[8],d=c[1],f=c[5],m=c[9],g=c[2],x=c[6],p=c[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(m-x)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(m+x)<.1&&Math.abs(l+f+p-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let v=(l+1)/2,_=(f+1)/2,A=(p+1)/2,b=(h+d)/4,S=(u+g)/4,w=(m+x)/4;return v>_&&v>A?v<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(v),i=b/n,s=S/n):_>A?_<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(_),n=b/i,s=w/i):A<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(A),n=S/s,i=w/s),this.set(n,i,s,e),this}let C=Math.sqrt((x-m)*(x-m)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(C)<.001&&(C=1),this.x=(x-m)/C,this.y=(u-g)/C,this.z=(d-h)/C,this.w=Math.acos((l+f+p-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Sx=class extends ur{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Je(0,0,t,e),this.scissorTest=!1,this.viewport=new Je(0,0,t,e);let i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:zi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let s=new xs(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];let o=n.count;for(let a=0;a=0?1:-1,v=1-p*p;if(v>Number.EPSILON){let A=Math.sqrt(v),b=Math.atan2(A,p*C);x=Math.sin(x*b)/A,a=Math.sin(a*b)/A}let _=a*C;if(c=c*x+d*_,l=l*x+f*_,h=h*x+m*_,u=u*x+g*_,x===1-a){let A=1/Math.sqrt(c*c+l*l+h*h+u*u);c*=A,l*=A,h*=A,u*=A}}t[e]=c,t[e+1]=l,t[e+2]=h,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,i,s,o){let a=n[i],c=n[i+1],l=n[i+2],h=n[i+3],u=s[o],d=s[o+1],f=s[o+2],m=s[o+3];return t[e]=a*m+h*u+c*f-l*d,t[e+1]=c*m+h*d+l*u-a*f,t[e+2]=l*m+h*f+a*d-c*u,t[e+3]=h*m-a*u-c*d-l*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,i=t._y,s=t._z,o=t._order,a=Math.cos,c=Math.sin,l=a(n/2),h=a(i/2),u=a(s/2),d=c(n/2),f=c(i/2),m=c(s/2);switch(o){case"XYZ":this._x=d*h*u+l*f*m,this._y=l*f*u-d*h*m,this._z=l*h*m+d*f*u,this._w=l*h*u-d*f*m;break;case"YXZ":this._x=d*h*u+l*f*m,this._y=l*f*u-d*h*m,this._z=l*h*m-d*f*u,this._w=l*h*u+d*f*m;break;case"ZXY":this._x=d*h*u-l*f*m,this._y=l*f*u+d*h*m,this._z=l*h*m+d*f*u,this._w=l*h*u-d*f*m;break;case"ZYX":this._x=d*h*u-l*f*m,this._y=l*f*u+d*h*m,this._z=l*h*m-d*f*u,this._w=l*h*u+d*f*m;break;case"YZX":this._x=d*h*u+l*f*m,this._y=l*f*u+d*h*m,this._z=l*h*m-d*f*u,this._w=l*h*u-d*f*m;break;case"XZY":this._x=d*h*u-l*f*m,this._y=l*f*u-d*h*m,this._z=l*h*m+d*f*u,this._w=l*h*u+d*f*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],s=e[8],o=e[1],a=e[5],c=e[9],l=e[2],h=e[6],u=e[10],d=n+a+u;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(h-c)*f,this._y=(s-l)*f,this._z=(o-i)*f}else if(n>a&&n>u){let f=2*Math.sqrt(1+n-a-u);this._w=(h-c)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+l)/f}else if(a>u){let f=2*Math.sqrt(1+a-n-u);this._w=(s-l)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(c+h)/f}else{let f=2*Math.sqrt(1+u-n-a);this._w=(o-i)/f,this._x=(s+l)/f,this._y=(c+h)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(wn(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,i=t._y,s=t._z,o=t._w,a=e._x,c=e._y,l=e._z,h=e._w;return this._x=n*h+o*a+i*l-s*c,this._y=i*h+o*c+s*a-n*l,this._z=s*h+o*l+n*c-i*a,this._w=o*h-n*a-i*c-s*l,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+s*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let c=1-a*a;if(c<=Number.EPSILON){let f=1-e;return this._w=f*o+e*this._w,this._x=f*n+e*this._x,this._y=f*i+e*this._y,this._z=f*s+e*this._z,this.normalize(),this}let l=Math.sqrt(c),h=Math.atan2(l,a),u=Math.sin((1-e)*h)/l,d=Math.sin(e*h)/l;return this._w=o*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=s*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},U=class r{constructor(t=0,e=0,n=0){r.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(rC.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(rC.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=t.elements,o=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,s=t.x,o=t.y,a=t.z,c=t.w,l=2*(o*i-a*n),h=2*(a*e-s*i),u=2*(s*n-o*e);return this.x=e+c*l+o*u-a*h,this.y=n+c*h+a*l-s*u,this.z=i+c*u+s*h-o*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,s=t.z,o=e.x,a=e.y,c=e.z;return this.x=i*c-s*a,this.y=s*o-n*c,this.z=n*a-i*o,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return $f.copy(this).projectOnVector(t),this.sub($f)}reflect(t){return this.sub($f.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(wn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},$f=new U,rC=new Di,kr=class{constructor(t=new U(1/0,1/0,1/0),e=new U(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Ni),Ni.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Jc),Gh.subVectors(this.max,Jc),Ho.subVectors(t.a,Jc),Go.subVectors(t.b,Jc),Wo.subVectors(t.c,Jc),es.subVectors(Go,Ho),ns.subVectors(Wo,Go),Us.subVectors(Ho,Wo);let e=[0,-es.z,es.y,0,-ns.z,ns.y,0,-Us.z,Us.y,es.z,0,-es.x,ns.z,0,-ns.x,Us.z,0,-Us.x,-es.y,es.x,0,-ns.y,ns.x,0,-Us.y,Us.x,0];return!Zf(e,Ho,Go,Wo,Gh)||(e=[1,0,0,0,1,0,0,0,1],!Zf(e,Ho,Go,Wo,Gh))?!1:(Wh.crossVectors(es,ns),e=[Wh.x,Wh.y,Wh.z],Zf(e,Ho,Go,Wo,Gh))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ni).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Ni).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(yr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),yr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),yr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),yr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),yr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),yr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),yr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),yr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(yr),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},yr=[new U,new U,new U,new U,new U,new U,new U,new U],Ni=new U,Hh=new kr,Ho=new U,Go=new U,Wo=new U,es=new U,ns=new U,Us=new U,Jc=new U,Gh=new U,Wh=new U,Vs=new U;function Zf(r,t,e,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){Vs.fromArray(r,s);let a=i.x*Math.abs(Vs.x)+i.y*Math.abs(Vs.y)+i.z*Math.abs(Vs.z),c=t.dot(Vs),l=e.dot(Vs),h=n.dot(Vs);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>a)return!1}return!0}var gS=new kr,Qc=new U,Kf=new U,Rr=class{constructor(t=new U,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):gS.setFromPoints(t).getCenter(n);let i=0;for(let s=0,o=t.length;sthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Qc.subVectors(t,this.center);let e=Qc.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(Qc,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(Kf.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Qc.copy(t.center).add(Kf)),this.expandByPoint(Qc.copy(t.center).sub(Kf))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},br=new U,Jf=new U,jh=new U,is=new U,Qf=new U,Xh=new U,tx=new U,fa=class{constructor(t=new U,e=new U(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,br)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=br.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(br.copy(this.origin).addScaledVector(this.direction,e),br.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Jf.copy(t).add(e).multiplyScalar(.5),jh.copy(e).sub(t).normalize(),is.copy(this.origin).sub(Jf);let s=t.distanceTo(e)*.5,o=-this.direction.dot(jh),a=is.dot(this.direction),c=-is.dot(jh),l=is.lengthSq(),h=Math.abs(1-o*o),u,d,f,m;if(h>0)if(u=o*c-a,d=o*a-c,m=s*h,u>=0)if(d>=-m)if(d<=m){let g=1/h;u*=g,d*=g,f=u*(u+o*d+2*a)+d*(o*u+d+2*c)+l}else d=s,u=Math.max(0,-(o*d+a)),f=-u*u+d*(d+2*c)+l;else d=-s,u=Math.max(0,-(o*d+a)),f=-u*u+d*(d+2*c)+l;else d<=-m?(u=Math.max(0,-(-o*s+a)),d=u>0?-s:Math.min(Math.max(-s,-c),s),f=-u*u+d*(d+2*c)+l):d<=m?(u=0,d=Math.min(Math.max(-s,-c),s),f=d*(d+2*c)+l):(u=Math.max(0,-(o*s+a)),d=u>0?s:Math.min(Math.max(-s,-c),s),f=-u*u+d*(d+2*c)+l);else d=o>0?-s:s,u=Math.max(0,-(o*d+a)),f=-u*u+d*(d+2*c)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(Jf).addScaledVector(jh,d),f}intersectSphere(t,e){br.subVectors(t.center,this.origin);let n=br.dot(this.direction),i=br.dot(br)-n*n,s=t.radius*t.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,c=n+o;return c<0?null:a<0?this.at(c,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,s,o,a,c,l=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(t.min.x-d.x)*l,i=(t.max.x-d.x)*l):(n=(t.max.x-d.x)*l,i=(t.min.x-d.x)*l),h>=0?(s=(t.min.y-d.y)*h,o=(t.max.y-d.y)*h):(s=(t.max.y-d.y)*h,o=(t.min.y-d.y)*h),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o=0?(a=(t.min.z-d.z)*u,c=(t.max.z-d.z)*u):(a=(t.max.z-d.z)*u,c=(t.min.z-d.z)*u),n>c||a>i)||((a>n||n!==n)&&(n=a),(c=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,br)!==null}intersectTriangle(t,e,n,i,s){Qf.subVectors(e,t),Xh.subVectors(n,t),tx.crossVectors(Qf,Xh);let o=this.direction.dot(tx),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;is.subVectors(this.origin,t);let c=a*this.direction.dot(Xh.crossVectors(is,Xh));if(c<0)return null;let l=a*this.direction.dot(Qf.cross(is));if(l<0||c+l>o)return null;let h=-a*is.dot(tx);return h<0?null:this.at(h/o,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},oe=class r{constructor(t,e,n,i,s,o,a,c,l,h,u,d,f,m,g,x){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,c,l,h,u,d,f,m,g,x)}set(t,e,n,i,s,o,a,c,l,h,u,d,f,m,g,x){let p=this.elements;return p[0]=t,p[4]=e,p[8]=n,p[12]=i,p[1]=s,p[5]=o,p[9]=a,p[13]=c,p[2]=l,p[6]=h,p[10]=u,p[14]=d,p[3]=f,p[7]=m,p[11]=g,p[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,i=1/jo.setFromMatrixColumn(t,0).length(),s=1/jo.setFromMatrixColumn(t,1).length(),o=1/jo.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,s=t.z,o=Math.cos(n),a=Math.sin(n),c=Math.cos(i),l=Math.sin(i),h=Math.cos(s),u=Math.sin(s);if(t.order==="XYZ"){let d=o*h,f=o*u,m=a*h,g=a*u;e[0]=c*h,e[4]=-c*u,e[8]=l,e[1]=f+m*l,e[5]=d-g*l,e[9]=-a*c,e[2]=g-d*l,e[6]=m+f*l,e[10]=o*c}else if(t.order==="YXZ"){let d=c*h,f=c*u,m=l*h,g=l*u;e[0]=d+g*a,e[4]=m*a-f,e[8]=o*l,e[1]=o*u,e[5]=o*h,e[9]=-a,e[2]=f*a-m,e[6]=g+d*a,e[10]=o*c}else if(t.order==="ZXY"){let d=c*h,f=c*u,m=l*h,g=l*u;e[0]=d-g*a,e[4]=-o*u,e[8]=m+f*a,e[1]=f+m*a,e[5]=o*h,e[9]=g-d*a,e[2]=-o*l,e[6]=a,e[10]=o*c}else if(t.order==="ZYX"){let d=o*h,f=o*u,m=a*h,g=a*u;e[0]=c*h,e[4]=m*l-f,e[8]=d*l+g,e[1]=c*u,e[5]=g*l+d,e[9]=f*l-m,e[2]=-l,e[6]=a*c,e[10]=o*c}else if(t.order==="YZX"){let d=o*c,f=o*l,m=a*c,g=a*l;e[0]=c*h,e[4]=g-d*u,e[8]=m*u+f,e[1]=u,e[5]=o*h,e[9]=-a*h,e[2]=-l*h,e[6]=f*u+m,e[10]=d-g*u}else if(t.order==="XZY"){let d=o*c,f=o*l,m=a*c,g=a*l;e[0]=c*h,e[4]=-u,e[8]=l*h,e[1]=d*u+g,e[5]=o*h,e[9]=f*u-m,e[2]=m*u-f,e[6]=a*h,e[10]=g*u+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(CS,t,vS)}lookAt(t,e,n){let i=this.elements;return li.subVectors(t,e),li.lengthSq()===0&&(li.z=1),li.normalize(),rs.crossVectors(n,li),rs.lengthSq()===0&&(Math.abs(n.z)===1?li.x+=1e-4:li.z+=1e-4,li.normalize(),rs.crossVectors(n,li)),rs.normalize(),Yh.crossVectors(li,rs),i[0]=rs.x,i[4]=Yh.x,i[8]=li.x,i[1]=rs.y,i[5]=Yh.y,i[9]=li.y,i[2]=rs.z,i[6]=Yh.z,i[10]=li.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[4],c=n[8],l=n[12],h=n[1],u=n[5],d=n[9],f=n[13],m=n[2],g=n[6],x=n[10],p=n[14],C=n[3],v=n[7],_=n[11],A=n[15],b=i[0],S=i[4],w=i[8],E=i[12],y=i[1],D=i[5],F=i[9],T=i[13],z=i[2],H=i[6],tt=i[10],it=i[14],Y=i[3],$=i[7],ct=i[11],_t=i[15];return s[0]=o*b+a*y+c*z+l*Y,s[4]=o*S+a*D+c*H+l*$,s[8]=o*w+a*F+c*tt+l*ct,s[12]=o*E+a*T+c*it+l*_t,s[1]=h*b+u*y+d*z+f*Y,s[5]=h*S+u*D+d*H+f*$,s[9]=h*w+u*F+d*tt+f*ct,s[13]=h*E+u*T+d*it+f*_t,s[2]=m*b+g*y+x*z+p*Y,s[6]=m*S+g*D+x*H+p*$,s[10]=m*w+g*F+x*tt+p*ct,s[14]=m*E+g*T+x*it+p*_t,s[3]=C*b+v*y+_*z+A*Y,s[7]=C*S+v*D+_*H+A*$,s[11]=C*w+v*F+_*tt+A*ct,s[15]=C*E+v*T+_*it+A*_t,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],o=t[1],a=t[5],c=t[9],l=t[13],h=t[2],u=t[6],d=t[10],f=t[14],m=t[3],g=t[7],x=t[11],p=t[15];return m*(+s*c*u-i*l*u-s*a*d+n*l*d+i*a*f-n*c*f)+g*(+e*c*f-e*l*d+s*o*d-i*o*f+i*l*h-s*c*h)+x*(+e*l*u-e*a*f-s*o*u+n*o*f+s*a*h-n*l*h)+p*(-i*a*h-e*c*u+e*a*d+i*o*u-n*o*d+n*c*h)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],c=t[6],l=t[7],h=t[8],u=t[9],d=t[10],f=t[11],m=t[12],g=t[13],x=t[14],p=t[15],C=u*x*l-g*d*l+g*c*f-a*x*f-u*c*p+a*d*p,v=m*d*l-h*x*l-m*c*f+o*x*f+h*c*p-o*d*p,_=h*g*l-m*u*l+m*a*f-o*g*f-h*a*p+o*u*p,A=m*u*c-h*g*c-m*a*d+o*g*d+h*a*x-o*u*x,b=e*C+n*v+i*_+s*A;if(b===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/b;return t[0]=C*S,t[1]=(g*d*s-u*x*s-g*i*f+n*x*f+u*i*p-n*d*p)*S,t[2]=(a*x*s-g*c*s+g*i*l-n*x*l-a*i*p+n*c*p)*S,t[3]=(u*c*s-a*d*s-u*i*l+n*d*l+a*i*f-n*c*f)*S,t[4]=v*S,t[5]=(h*x*s-m*d*s+m*i*f-e*x*f-h*i*p+e*d*p)*S,t[6]=(m*c*s-o*x*s-m*i*l+e*x*l+o*i*p-e*c*p)*S,t[7]=(o*d*s-h*c*s+h*i*l-e*d*l-o*i*f+e*c*f)*S,t[8]=_*S,t[9]=(m*u*s-h*g*s-m*n*f+e*g*f+h*n*p-e*u*p)*S,t[10]=(o*g*s-m*a*s+m*n*l-e*g*l-o*n*p+e*a*p)*S,t[11]=(h*a*s-o*u*s-h*n*l+e*u*l+o*n*f-e*a*f)*S,t[12]=A*S,t[13]=(h*g*i-m*u*i+m*n*d-e*g*d-h*n*x+e*u*x)*S,t[14]=(m*a*i-o*g*i-m*n*c+e*g*c+o*n*x-e*a*x)*S,t[15]=(o*u*i-h*a*i+h*n*c-e*u*c-o*n*d+e*a*d)*S,this}scale(t){let e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),s=1-n,o=t.x,a=t.y,c=t.z,l=s*o,h=s*a;return this.set(l*o+n,l*a-i*c,l*c+i*a,0,l*a+i*c,h*a+n,h*c-i*o,0,l*c-i*a,h*c+i*o,s*c*c+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,o){return this.set(1,n,s,0,t,1,o,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,s=e._x,o=e._y,a=e._z,c=e._w,l=s+s,h=o+o,u=a+a,d=s*l,f=s*h,m=s*u,g=o*h,x=o*u,p=a*u,C=c*l,v=c*h,_=c*u,A=n.x,b=n.y,S=n.z;return i[0]=(1-(g+p))*A,i[1]=(f+_)*A,i[2]=(m-v)*A,i[3]=0,i[4]=(f-_)*b,i[5]=(1-(d+p))*b,i[6]=(x+C)*b,i[7]=0,i[8]=(m+v)*S,i[9]=(x-C)*S,i[10]=(1-(d+g))*S,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements,s=jo.set(i[0],i[1],i[2]).length(),o=jo.set(i[4],i[5],i[6]).length(),a=jo.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],Ui.copy(this);let l=1/s,h=1/o,u=1/a;return Ui.elements[0]*=l,Ui.elements[1]*=l,Ui.elements[2]*=l,Ui.elements[4]*=h,Ui.elements[5]*=h,Ui.elements[6]*=h,Ui.elements[8]*=u,Ui.elements[9]*=u,Ui.elements[10]*=u,e.setFromRotationMatrix(Ui),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,i,s,o,a=Fr){let c=this.elements,l=2*s/(e-t),h=2*s/(n-i),u=(e+t)/(e-t),d=(n+i)/(n-i),f,m;if(a===Fr)f=-(o+s)/(o-s),m=-2*o*s/(o-s);else if(a===vu)f=-o/(o-s),m=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=l,c[4]=0,c[8]=u,c[12]=0,c[1]=0,c[5]=h,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=f,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(t,e,n,i,s,o,a=Fr){let c=this.elements,l=1/(e-t),h=1/(n-i),u=1/(o-s),d=(e+t)*l,f=(n+i)*h,m,g;if(a===Fr)m=(o+s)*u,g=-2*u;else if(a===vu)m=s*u,g=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=2*l,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*h,c[9]=0,c[13]=-f,c[2]=0,c[6]=0,c[10]=g,c[14]=-m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},jo=new U,Ui=new oe,CS=new U(0,0,0),vS=new U(1,1,1),rs=new U,Yh=new U,li=new U,sC=new oe,oC=new Di,Zs=(()=>{class r{constructor(e=0,n=0,i=0,s=r.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,s=this._order){return this._x=e,this._y=n,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){let s=e.elements,o=s[0],a=s[4],c=s[8],l=s[1],h=s[5],u=s[9],d=s[2],f=s[6],m=s[10];switch(n){case"XYZ":this._y=Math.asin(wn(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,m),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(f,h),this._z=0);break;case"YXZ":this._x=Math.asin(-wn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(c,m),this._z=Math.atan2(l,h)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(wn(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-a,h)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-wn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,h));break;case"YZX":this._z=Math.asin(wn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,h),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(c,m));break;case"XZY":this._z=Math.asin(-wn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,h),this._y=Math.atan2(c,o)):(this._x=Math.atan2(-u,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return sC.makeRotationFromQuaternion(e),this.setFromRotationMatrix(sC,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return oC.setFromEuler(this),this.setFromQuaternion(oC,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return r.DEFAULT_ORDER="XYZ",r})(),dl=class{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<{class r extends ur{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:ES++}),this.uuid=Ea(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let e=new U,n=new Zs,i=new Di,s=new U(1,1,1);function o(){i.setFromEuler(n,!1)}function a(){n.setFromQuaternion(i,void 0,!1)}n._onChange(o),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new oe},normalMatrix:{value:new ge}}),this.matrix=new oe,this.matrixWorld=new oe,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new dl,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return Xo.setFromAxisAngle(e,n),this.quaternion.multiply(Xo),this}rotateOnWorldAxis(e,n){return Xo.setFromAxisAngle(e,n),this.quaternion.premultiply(Xo),this}rotateX(e){return this.rotateOnAxis(cC,e)}rotateY(e){return this.rotateOnAxis(lC,e)}rotateZ(e){return this.rotateOnAxis(hC,e)}translateOnAxis(e,n){return aC.copy(e).applyQuaternion(this.quaternion),this.position.add(aC.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(cC,e)}translateY(e){return this.translateOnAxis(lC,e)}translateZ(e){return this.translateOnAxis(hC,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ar.copy(this.matrixWorld).invert())}lookAt(e,n,i){e.isVector3?qh.copy(e):qh.set(e,n,i);let s=this.parent;this.updateWorldMatrix(!0,!1),tl.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ar.lookAt(tl,qh,this.up):Ar.lookAt(qh,tl,this.up),this.quaternion.setFromRotationMatrix(Ar),s&&(Ar.extractRotation(s.matrixWorld),Xo.setFromRotationMatrix(Ar),this.quaternion.premultiply(Xo.invert()))}add(e){if(arguments.length>1){for(let n=0;n1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.sphere.center.toArray()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function o(c,l){return c[l.uuid]===void 0&&(c[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=o(e.geometries,this.geometry);let c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){let l=c.shapes;if(Array.isArray(l))for(let h=0,u=l.length;h0){s.children=[];for(let c=0;c0){s.animations=[];for(let c=0;c0&&(i.geometries=c),l.length>0&&(i.materials=l),h.length>0&&(i.textures=h),u.length>0&&(i.images=u),d.length>0&&(i.shapes=d),f.length>0&&(i.skeletons=f),m.length>0&&(i.animations=m),g.length>0&&(i.nodes=g)}return i.object=s,i;function a(c){let l=[];for(let h in c){let u=c[h];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,n,i,s){Vi.subVectors(i,e),Sr.subVectors(n,e),nx.subVectors(t,e);let o=Vi.dot(Vi),a=Vi.dot(Sr),c=Vi.dot(nx),l=Sr.dot(Sr),h=Sr.dot(nx),u=o*l-a*a;if(u===0)return s.set(0,0,0),null;let d=1/u,f=(l*c-a*h)*d,m=(o*h-a*c)*d;return s.set(1-f-m,m,f)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,wr)===null?!1:wr.x>=0&&wr.y>=0&&wr.x+wr.y<=1}static getInterpolation(t,e,n,i,s,o,a,c){return this.getBarycoord(t,e,n,i,wr)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(s,wr.x),c.addScaledVector(o,wr.y),c.addScaledVector(a,wr.z),c)}static isFrontFacing(t,e,n,i){return Vi.subVectors(n,e),Sr.subVectors(t,e),Vi.cross(Sr).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Vi.subVectors(this.c,this.b),Sr.subVectors(this.a,this.b),Vi.cross(Sr).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return r.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return r.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,s){return r.getInterpolation(t,this.a,this.b,this.c,e,n,i,s)}containsPoint(t){return r.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return r.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,i=this.b,s=this.c,o,a;qo.subVectors(i,n),$o.subVectors(s,n),ix.subVectors(t,n);let c=qo.dot(ix),l=$o.dot(ix);if(c<=0&&l<=0)return e.copy(n);rx.subVectors(t,i);let h=qo.dot(rx),u=$o.dot(rx);if(h>=0&&u<=h)return e.copy(i);let d=c*u-h*l;if(d<=0&&c>=0&&h<=0)return o=c/(c-h),e.copy(n).addScaledVector(qo,o);sx.subVectors(t,s);let f=qo.dot(sx),m=$o.dot(sx);if(m>=0&&f<=m)return e.copy(s);let g=f*l-c*m;if(g<=0&&l>=0&&m<=0)return a=l/(l-m),e.copy(n).addScaledVector($o,a);let x=h*m-f*u;if(x<=0&&u-h>=0&&f-m>=0)return dC.subVectors(s,i),a=(u-h)/(u-h+(f-m)),e.copy(i).addScaledVector(dC,a);let p=1/(x+g+d);return o=g*p,a=d*p,e.copy(n).addScaledVector(qo,o).addScaledVector($o,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},h5={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ss={h:0,s:0,l:0},$h={h:0,s:0,l:0};function ox(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}var ie=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Si){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Ve.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=Ve.workingColorSpace){return this.r=t,this.g=e,this.b=n,Ve.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=Ve.workingColorSpace){if(t=ap(t,1),e=wn(e,0,1),n=wn(n,0,1),e===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+e):n+e-n*e,o=2*n-s;this.r=ox(o,s,t+1/3),this.g=ox(o,s,t),this.b=ox(o,s,t-1/3)}return Ve.toWorkingColorSpace(this,i),this}setStyle(t,e=Si){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let s,o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(o===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Si){let n=h5[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=ca(t.r),this.g=ca(t.g),this.b=ca(t.b),this}copyLinearToSRGB(t){return this.r=Yf(t.r),this.g=Yf(t.g),this.b=Yf(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Si){return Ve.fromWorkingColorSpace(On.copy(this),t),Math.round(wn(On.r*255,0,255))*65536+Math.round(wn(On.g*255,0,255))*256+Math.round(wn(On.b*255,0,255))}getHexString(t=Si){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Ve.workingColorSpace){Ve.fromWorkingColorSpace(On.copy(this),e);let n=On.r,i=On.g,s=On.b,o=Math.max(n,i,s),a=Math.min(n,i,s),c,l,h=(a+o)/2;if(a===o)c=0,l=0;else{let u=o-a;switch(l=h<=.5?u/(o+a):u/(2-o-a),o){case n:c=(i-s)/u+(i0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let i=this[e];if(i===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==oa&&(n.blending=this.blending),this.side!==hr&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==vx&&(n.blendSrc=this.blendSrc),this.blendDst!==Ex&&(n.blendDst=this.blendDst),this.blendEquation!==Xs&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==fu&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==K2&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Vo&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Vo&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Vo&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let c=s[a];delete c.metadata,o.push(c)}return o}if(e){let s=i(t.textures),o=i(t.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let i=e.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},yu=class extends Bi{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ie(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Zs,this.combine=sp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var pn=new U,Zh=new re,Mi=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=J2,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=cs,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return fS("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,s=this.itemSize;i0&&(t.userData=this.userData),this.parameters!==void 0){let c=this.parameters;for(let l in c)c[l]!==void 0&&(t[l]=c[l]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let c in n){let l=n[c];t.data.attributes[c]=l.toJSON(t.data)}let i={},s=!1;for(let c in this.morphAttributes){let l=this.morphAttributes[c],h=[];for(let u=0,d=l.length;u0&&(i[c]=h,s=!0)}s&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone(e));let i=t.attributes;for(let l in i){let h=i[l];this.setAttribute(l,h.clone(e))}let s=t.morphAttributes;for(let l in s){let h=[],u=s[l];for(let d=0,f=u.length;d0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s(t.far-t.near)**2))&&(fC.copy(s).invert(),zs.copy(t.ray).applyMatrix4(fC),!(n.boundingBox!==null&&zs.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,zs)))}_computeIntersections(t,e,n){let i,s=this.geometry,o=this.material,a=s.index,c=s.attributes.position,l=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,d=s.groups,f=s.drawRange;if(a!==null)if(Array.isArray(o))for(let m=0,g=d.length;me.far?null:{distance:l,point:iu.clone(),object:r}}function ru(r,t,e,n,i,s,o,a,c,l){r.getVertexPosition(a,Ko),r.getVertexPosition(c,Jo),r.getVertexPosition(l,Qo);let h=wS(r,t,e,n,Ko,Jo,Qo,nu);if(h){i&&(Qh.fromBufferAttribute(i,a),tu.fromBufferAttribute(i,c),eu.fromBufferAttribute(i,l),h.uv=ra.getInterpolation(nu,Ko,Jo,Qo,Qh,tu,eu,new re)),s&&(Qh.fromBufferAttribute(s,a),tu.fromBufferAttribute(s,c),eu.fromBufferAttribute(s,l),h.uv1=ra.getInterpolation(nu,Ko,Jo,Qo,Qh,tu,eu,new re)),o&&(pC.fromBufferAttribute(o,a),mC.fromBufferAttribute(o,c),gC.fromBufferAttribute(o,l),h.normal=ra.getInterpolation(nu,Ko,Jo,Qo,pC,mC,gC,new U),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));let u={a,b:c,c:l,normal:new U,materialIndex:0};ra.getNormal(Ko,Jo,Qo,u.normal),h.face=u}return h}var fl=class r extends An{constructor(t=1,e=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};let a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);let c=[],l=[],h=[],u=[],d=0,f=0;m("z","y","x",-1,-1,n,e,t,o,s,0),m("z","y","x",1,-1,n,e,-t,o,s,1),m("x","z","y",1,1,t,n,e,i,o,2),m("x","z","y",1,-1,t,n,-e,i,o,3),m("x","y","z",1,-1,t,e,n,i,s,4),m("x","y","z",-1,-1,t,e,-n,i,s,5),this.setIndex(c),this.setAttribute("position",new mn(l,3)),this.setAttribute("normal",new mn(h,3)),this.setAttribute("uv",new mn(u,2));function m(g,x,p,C,v,_,A,b,S,w,E){let y=_/S,D=A/w,F=_/2,T=A/2,z=b/2,H=S+1,tt=w+1,it=0,Y=0,$=new U;for(let ct=0;ct0?1:-1,h.push($.x,$.y,$.z),u.push(bt/S),u.push(1-ct/w),it+=1}}for(let ct=0;ct0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},Su=class extends Gi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new oe,this.projectionMatrix=new oe,this.projectionMatrixInverse=new oe,this.coordinateSystem=Fr}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},os=new U,CC=new re,vC=new re,Ln=class extends Su{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=hl*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(sl*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return hl*2*Math.atan(Math.tan(sl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){os.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(os.x,os.y).multiplyScalar(-t/os.z),os.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(os.x,os.y).multiplyScalar(-t/os.z)}getViewSize(t,e){return this.getViewBounds(t,CC,vC),e.subVectors(vC,CC)}setViewOffset(t,e,n,i,s,o){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(sl*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let c=o.fullWidth,l=o.fullHeight;s+=o.offsetX*i/c,e-=o.offsetY*n/l,i*=o.width/c,n*=o.height/l}let a=this.filmOffset;a!==0&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},ta=-90,ea=1,Mx=class extends Gi{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let i=new Ln(ta,ea,t,e);i.layers=this.layers,this.add(i);let s=new Ln(ta,ea,t,e);s.layers=this.layers,this.add(s);let o=new Ln(ta,ea,t,e);o.layers=this.layers,this.add(o);let a=new Ln(ta,ea,t,e);a.layers=this.layers,this.add(a);let c=new Ln(ta,ea,t,e);c.layers=this.layers,this.add(c);let l=new Ln(ta,ea,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[n,i,s,o,a,c]=e;for(let l of e)this.remove(l);if(t===Fr)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(t===vu)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let l of e)this.add(l),l.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[s,o,a,c,l,h]=this.children,u=t.getRenderTarget(),d=t.getActiveCubeFace(),f=t.getActiveMipmapLevel(),m=t.xr.enabled;t.xr.enabled=!1;let g=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,s),t.setRenderTarget(n,1,i),t.render(e,o),t.setRenderTarget(n,2,i),t.render(e,a),t.setRenderTarget(n,3,i),t.render(e,c),t.setRenderTarget(n,4,i),t.render(e,l),n.texture.generateMipmaps=g,t.setRenderTarget(n,5,i),t.render(e,h),t.setRenderTarget(u,d,f),t.xr.enabled=m,n.texture.needsPMREMUpdate=!0}},wu=class extends xs{constructor(t,e,n,i,s,o,a,c,l,h){t=t!==void 0?t:[],e=e!==void 0?e:ha,super(t,e,n,i,s,o,a,c,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},Dx=class extends Pr{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new wu(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:zi}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},i=new fl(5,5,5),s=new dr({name:"CubemapFromEquirect",uniforms:xa(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:ni,blending:ls});s.uniforms.tEquirect.value=e;let o=new ei(i,s),a=e.minFilter;return e.minFilter===$s&&(e.minFilter=zi),new Mx(1,10,this).update(t,o),e.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,i){let s=t.getRenderTarget();for(let o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(e,n,i);t.setRenderTarget(s)}},lx=new U,FS=new U,PS=new ge,Br=class{constructor(t=new U(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let i=lx.subVectors(n,e).cross(FS.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let n=t.delta(lx),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let s=-(t.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:e.copy(t.start).addScaledVector(n,s)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||PS.getNormalMatrix(t),i=this.coplanarPoint(lx).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},Hs=new Rr,su=new U,xl=class{constructor(t=new Br,e=new Br,n=new Br,i=new Br,s=new Br,o=new Br){this.planes=[t,e,n,i,s,o]}set(t,e,n,i,s,o){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Fr){let n=this.planes,i=t.elements,s=i[0],o=i[1],a=i[2],c=i[3],l=i[4],h=i[5],u=i[6],d=i[7],f=i[8],m=i[9],g=i[10],x=i[11],p=i[12],C=i[13],v=i[14],_=i[15];if(n[0].setComponents(c-s,d-l,x-f,_-p).normalize(),n[1].setComponents(c+s,d+l,x+f,_+p).normalize(),n[2].setComponents(c+o,d+h,x+m,_+C).normalize(),n[3].setComponents(c-o,d-h,x-m,_-C).normalize(),n[4].setComponents(c-a,d-u,x-g,_-v).normalize(),e===Fr)n[5].setComponents(c+a,d+u,x+g,_+v).normalize();else if(e===vu)n[5].setComponents(a,u,g,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Hs.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Hs.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Hs)}intersectsSprite(t){return Hs.center.set(0,0,0),Hs.radius=.7071067811865476,Hs.applyMatrix4(t.matrixWorld),this.intersectsSphere(Hs)}intersectsSphere(t){let e=this.planes,n=t.center,i=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(n)0?t.max.x:t.min.x,su.y=i.normal.y>0?t.max.y:t.min.y,su.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(su)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function d5(){let r=null,t=!1,e=null,n=null;function i(s,o){e(s,o),n=r.requestAnimationFrame(i)}return{start:function(){t!==!0&&e!==null&&(n=r.requestAnimationFrame(i),t=!0)},stop:function(){r.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){r=s}}}function kS(r){let t=new WeakMap;function e(a,c){let l=a.array,h=a.usage,u=l.byteLength,d=r.createBuffer();r.bindBuffer(c,d),r.bufferData(c,l,h),a.onUploadCallback();let f;if(l instanceof Float32Array)f=r.FLOAT;else if(l instanceof Uint16Array)a.isFloat16BufferAttribute?f=r.HALF_FLOAT:f=r.UNSIGNED_SHORT;else if(l instanceof Int16Array)f=r.SHORT;else if(l instanceof Uint32Array)f=r.UNSIGNED_INT;else if(l instanceof Int32Array)f=r.INT;else if(l instanceof Int8Array)f=r.BYTE;else if(l instanceof Uint8Array)f=r.UNSIGNED_BYTE;else if(l instanceof Uint8ClampedArray)f=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+l);return{buffer:d,type:f,bytesPerElement:l.BYTES_PER_ELEMENT,version:a.version,size:u}}function n(a,c,l){let h=c.array,u=c._updateRange,d=c.updateRanges;if(r.bindBuffer(l,a),u.count===-1&&d.length===0&&r.bufferSubData(l,0,h),d.length!==0){for(let f=0,m=d.length;f 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,ZS=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,KS=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,JS=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,QS=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,tw=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,ew=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,nw=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif`,iw=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +float luminance( const in vec3 rgb ) { + const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); + return dot( weights, rgb ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,rw=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,sw=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,ow=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,aw=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,cw=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,lw=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,hw="gl_FragColor = linearToOutputTexel( gl_FragColor );",uw=` +const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( + vec3( 0.8224621, 0.177538, 0.0 ), + vec3( 0.0331941, 0.9668058, 0.0 ), + vec3( 0.0170827, 0.0723974, 0.9105199 ) +); +const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( + vec3( 1.2249401, - 0.2249404, 0.0 ), + vec3( - 0.0420569, 1.0420571, 0.0 ), + vec3( - 0.0196376, - 0.0786361, 1.0982735 ) +); +vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { + return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); +} +vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { + return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); +} +vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +} +vec4 LinearToLinear( in vec4 value ) { + return value; +} +vec4 LinearTosRGB( in vec4 value ) { + return sRGBTransferOETF( value ); +}`,dw=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,fw=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,xw=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,pw=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,mw=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,gw=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Cw=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,vw=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,Ew=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,_w=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,yw=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,bw=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,Aw=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Sw=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + #if defined ( LEGACY_LIGHTS ) + if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { + return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); + } + return 1.0; + #else + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; + #endif +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,ww=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,Mw=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,Dw=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Bw=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,Tw=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Fw=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,Pw=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,kw=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,Rw=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,Iw=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,Ow=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,Lw=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,Nw=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,Uw=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,Vw=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,zw=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,Hw=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,Gw=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,Ww=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,jw=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,Xw=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[MORPHTARGETS_COUNT]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,Yw=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,qw=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } + #else + objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; + objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; + objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; + objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; + #endif +#endif`,$w=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + #endif + #ifdef MORPHTARGETS_TEXTURE + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } + #else + #ifndef USE_MORPHNORMALS + uniform float morphTargetInfluences[ 8 ]; + #else + uniform float morphTargetInfluences[ 4 ]; + #endif + #endif +#endif`,Zw=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } + #else + transformed += morphTarget0 * morphTargetInfluences[ 0 ]; + transformed += morphTarget1 * morphTargetInfluences[ 1 ]; + transformed += morphTarget2 * morphTargetInfluences[ 2 ]; + transformed += morphTarget3 * morphTargetInfluences[ 3 ]; + #ifndef USE_MORPHNORMALS + transformed += morphTarget4 * morphTargetInfluences[ 4 ]; + transformed += morphTarget5 * morphTargetInfluences[ 5 ]; + transformed += morphTarget6 * morphTargetInfluences[ 6 ]; + transformed += morphTarget7 * morphTargetInfluences[ 7 ]; + #endif + #endif +#endif`,Kw=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,Jw=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,Qw=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,tM=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,eM=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,nM=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,iM=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,rM=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,sM=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,oM=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,aM=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,cM=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; +const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); +const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); +const float ShiftRight8 = 1. / 256.; +vec4 packDepthToRGBA( const in float v ) { + vec4 r = vec4( fract( v * PackFactors ), v ); + r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors ); +} +vec2 packDepthToRG( in highp float v ) { + return packDepthToRGBA( v ).yx; +} +float unpackRGToDepth( const in highp vec2 v ) { + return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); +} +vec4 pack2HalfToRGBA( vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,lM=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,hM=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,uM=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,dM=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,fM=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,xM=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,pM=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return shadow; + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return shadow; + } +#endif`,mM=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,gM=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,CM=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,vM=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,EM=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,_M=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,yM=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,bM=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,AM=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,SM=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,wM=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 OptimizedCineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,MM=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,DM=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + + #else + + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,BM=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,TM=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,FM=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,PM=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`,kM=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,RM=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,IM=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,OM=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,LM=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,NM=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,UM=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,VM=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #endif +}`,zM=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,HM=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,GM=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,WM=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,jM=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,XM=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,YM=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,qM=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,$M=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,ZM=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,KM=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,JM=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,QM=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,tD=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,eD=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,nD=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,iD=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,rD=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,sD=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,oD=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,aD=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,cD=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,lD=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,hD=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,uD=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,dD=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,me={alphahash_fragment:RS,alphahash_pars_fragment:IS,alphamap_fragment:OS,alphamap_pars_fragment:LS,alphatest_fragment:NS,alphatest_pars_fragment:US,aomap_fragment:VS,aomap_pars_fragment:zS,batching_pars_vertex:HS,batching_vertex:GS,begin_vertex:WS,beginnormal_vertex:jS,bsdfs:XS,iridescence_fragment:YS,bumpmap_pars_fragment:qS,clipping_planes_fragment:$S,clipping_planes_pars_fragment:ZS,clipping_planes_pars_vertex:KS,clipping_planes_vertex:JS,color_fragment:QS,color_pars_fragment:tw,color_pars_vertex:ew,color_vertex:nw,common:iw,cube_uv_reflection_fragment:rw,defaultnormal_vertex:sw,displacementmap_pars_vertex:ow,displacementmap_vertex:aw,emissivemap_fragment:cw,emissivemap_pars_fragment:lw,colorspace_fragment:hw,colorspace_pars_fragment:uw,envmap_fragment:dw,envmap_common_pars_fragment:fw,envmap_pars_fragment:xw,envmap_pars_vertex:pw,envmap_physical_pars_fragment:ww,envmap_vertex:mw,fog_vertex:gw,fog_pars_vertex:Cw,fog_fragment:vw,fog_pars_fragment:Ew,gradientmap_pars_fragment:_w,lightmap_pars_fragment:yw,lights_lambert_fragment:bw,lights_lambert_pars_fragment:Aw,lights_pars_begin:Sw,lights_toon_fragment:Mw,lights_toon_pars_fragment:Dw,lights_phong_fragment:Bw,lights_phong_pars_fragment:Tw,lights_physical_fragment:Fw,lights_physical_pars_fragment:Pw,lights_fragment_begin:kw,lights_fragment_maps:Rw,lights_fragment_end:Iw,logdepthbuf_fragment:Ow,logdepthbuf_pars_fragment:Lw,logdepthbuf_pars_vertex:Nw,logdepthbuf_vertex:Uw,map_fragment:Vw,map_pars_fragment:zw,map_particle_fragment:Hw,map_particle_pars_fragment:Gw,metalnessmap_fragment:Ww,metalnessmap_pars_fragment:jw,morphinstance_vertex:Xw,morphcolor_vertex:Yw,morphnormal_vertex:qw,morphtarget_pars_vertex:$w,morphtarget_vertex:Zw,normal_fragment_begin:Kw,normal_fragment_maps:Jw,normal_pars_fragment:Qw,normal_pars_vertex:tM,normal_vertex:eM,normalmap_pars_fragment:nM,clearcoat_normal_fragment_begin:iM,clearcoat_normal_fragment_maps:rM,clearcoat_pars_fragment:sM,iridescence_pars_fragment:oM,opaque_fragment:aM,packing:cM,premultiplied_alpha_fragment:lM,project_vertex:hM,dithering_fragment:uM,dithering_pars_fragment:dM,roughnessmap_fragment:fM,roughnessmap_pars_fragment:xM,shadowmap_pars_fragment:pM,shadowmap_pars_vertex:mM,shadowmap_vertex:gM,shadowmask_pars_fragment:CM,skinbase_vertex:vM,skinning_pars_vertex:EM,skinning_vertex:_M,skinnormal_vertex:yM,specularmap_fragment:bM,specularmap_pars_fragment:AM,tonemapping_fragment:SM,tonemapping_pars_fragment:wM,transmission_fragment:MM,transmission_pars_fragment:DM,uv_pars_fragment:BM,uv_pars_vertex:TM,uv_vertex:FM,worldpos_vertex:PM,background_vert:kM,background_frag:RM,backgroundCube_vert:IM,backgroundCube_frag:OM,cube_vert:LM,cube_frag:NM,depth_vert:UM,depth_frag:VM,distanceRGBA_vert:zM,distanceRGBA_frag:HM,equirect_vert:GM,equirect_frag:WM,linedashed_vert:jM,linedashed_frag:XM,meshbasic_vert:YM,meshbasic_frag:qM,meshlambert_vert:$M,meshlambert_frag:ZM,meshmatcap_vert:KM,meshmatcap_frag:JM,meshnormal_vert:QM,meshnormal_frag:tD,meshphong_vert:eD,meshphong_frag:nD,meshphysical_vert:iD,meshphysical_frag:rD,meshtoon_vert:sD,meshtoon_frag:oD,points_vert:aD,points_frag:cD,shadow_vert:lD,shadow_frag:hD,sprite_vert:uD,sprite_frag:dD},Bt={common:{diffuse:{value:new ie(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ge},alphaMap:{value:null},alphaMapTransform:{value:new ge},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ge}},envmap:{envMap:{value:null},envMapRotation:{value:new ge},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ge}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ge}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ge},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ge},normalScale:{value:new re(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ge},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ge}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ge}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ge}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ie(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ie(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ge},alphaTest:{value:0},uvTransform:{value:new ge}},sprite:{diffuse:{value:new ie(16777215)},opacity:{value:1},center:{value:new re(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ge},alphaMap:{value:null},alphaMapTransform:{value:new ge},alphaTest:{value:0}}},ar={basic:{uniforms:Yn([Bt.common,Bt.specularmap,Bt.envmap,Bt.aomap,Bt.lightmap,Bt.fog]),vertexShader:me.meshbasic_vert,fragmentShader:me.meshbasic_frag},lambert:{uniforms:Yn([Bt.common,Bt.specularmap,Bt.envmap,Bt.aomap,Bt.lightmap,Bt.emissivemap,Bt.bumpmap,Bt.normalmap,Bt.displacementmap,Bt.fog,Bt.lights,{emissive:{value:new ie(0)}}]),vertexShader:me.meshlambert_vert,fragmentShader:me.meshlambert_frag},phong:{uniforms:Yn([Bt.common,Bt.specularmap,Bt.envmap,Bt.aomap,Bt.lightmap,Bt.emissivemap,Bt.bumpmap,Bt.normalmap,Bt.displacementmap,Bt.fog,Bt.lights,{emissive:{value:new ie(0)},specular:{value:new ie(1118481)},shininess:{value:30}}]),vertexShader:me.meshphong_vert,fragmentShader:me.meshphong_frag},standard:{uniforms:Yn([Bt.common,Bt.envmap,Bt.aomap,Bt.lightmap,Bt.emissivemap,Bt.bumpmap,Bt.normalmap,Bt.displacementmap,Bt.roughnessmap,Bt.metalnessmap,Bt.fog,Bt.lights,{emissive:{value:new ie(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:me.meshphysical_vert,fragmentShader:me.meshphysical_frag},toon:{uniforms:Yn([Bt.common,Bt.aomap,Bt.lightmap,Bt.emissivemap,Bt.bumpmap,Bt.normalmap,Bt.displacementmap,Bt.gradientmap,Bt.fog,Bt.lights,{emissive:{value:new ie(0)}}]),vertexShader:me.meshtoon_vert,fragmentShader:me.meshtoon_frag},matcap:{uniforms:Yn([Bt.common,Bt.bumpmap,Bt.normalmap,Bt.displacementmap,Bt.fog,{matcap:{value:null}}]),vertexShader:me.meshmatcap_vert,fragmentShader:me.meshmatcap_frag},points:{uniforms:Yn([Bt.points,Bt.fog]),vertexShader:me.points_vert,fragmentShader:me.points_frag},dashed:{uniforms:Yn([Bt.common,Bt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:me.linedashed_vert,fragmentShader:me.linedashed_frag},depth:{uniforms:Yn([Bt.common,Bt.displacementmap]),vertexShader:me.depth_vert,fragmentShader:me.depth_frag},normal:{uniforms:Yn([Bt.common,Bt.bumpmap,Bt.normalmap,Bt.displacementmap,{opacity:{value:1}}]),vertexShader:me.meshnormal_vert,fragmentShader:me.meshnormal_frag},sprite:{uniforms:Yn([Bt.sprite,Bt.fog]),vertexShader:me.sprite_vert,fragmentShader:me.sprite_frag},background:{uniforms:{uvTransform:{value:new ge},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:me.background_vert,fragmentShader:me.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ge}},vertexShader:me.backgroundCube_vert,fragmentShader:me.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:me.cube_vert,fragmentShader:me.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:me.equirect_vert,fragmentShader:me.equirect_frag},distanceRGBA:{uniforms:Yn([Bt.common,Bt.displacementmap,{referencePosition:{value:new U},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:me.distanceRGBA_vert,fragmentShader:me.distanceRGBA_frag},shadow:{uniforms:Yn([Bt.lights,Bt.fog,{color:{value:new ie(0)},opacity:{value:1}}]),vertexShader:me.shadow_vert,fragmentShader:me.shadow_frag}};ar.physical={uniforms:Yn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ge},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ge},clearcoatNormalScale:{value:new re(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ge},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ge},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ge},sheen:{value:0},sheenColor:{value:new ie(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ge},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ge},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ge},transmissionSamplerSize:{value:new re},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ge},attenuationDistance:{value:0},attenuationColor:{value:new ie(0)},specularColor:{value:new ie(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ge},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ge},anisotropyVector:{value:new re},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ge}}]),vertexShader:me.meshphysical_vert,fragmentShader:me.meshphysical_frag};var ou={r:0,b:0,g:0},Gs=new Zs,fD=new oe;function xD(r,t,e,n,i,s,o){let a=new ie(0),c=s===!0?0:1,l,h,u=null,d=0,f=null;function m(C){let v=C.isScene===!0?C.background:null;return v&&v.isTexture&&(v=(C.backgroundBlurriness>0?e:t).get(v)),v}function g(C){let v=!1,_=m(C);_===null?p(a,c):_&&_.isColor&&(p(_,1),v=!0);let A=r.xr.getEnvironmentBlendMode();A==="additive"?n.buffers.color.setClear(0,0,0,1,o):A==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil)}function x(C,v){let _=m(v);_&&(_.isCubeTexture||_.mapping===zu)?(h===void 0&&(h=new ei(new fl(1,1,1),new dr({name:"BackgroundCubeMaterial",uniforms:xa(ar.backgroundCube.uniforms),vertexShader:ar.backgroundCube.vertexShader,fragmentShader:ar.backgroundCube.fragmentShader,side:ni,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(A,b,S){this.matrixWorld.copyPosition(S.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),Gs.copy(v.backgroundRotation),Gs.x*=-1,Gs.y*=-1,Gs.z*=-1,_.isCubeTexture&&_.isRenderTargetTexture===!1&&(Gs.y*=-1,Gs.z*=-1),h.material.uniforms.envMap.value=_,h.material.uniforms.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(fD.makeRotationFromEuler(Gs)),h.material.toneMapped=Ve.getTransfer(_.colorSpace)!==qe,(u!==_||d!==_.version||f!==r.toneMapping)&&(h.material.needsUpdate=!0,u=_,d=_.version,f=r.toneMapping),h.layers.enableAll(),C.unshift(h,h.geometry,h.material,0,0,null)):_&&_.isTexture&&(l===void 0&&(l=new ei(new Mu(2,2),new dr({name:"BackgroundMaterial",uniforms:xa(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:hr,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=_,l.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,l.material.toneMapped=Ve.getTransfer(_.colorSpace)!==qe,_.matrixAutoUpdate===!0&&_.updateMatrix(),l.material.uniforms.uvTransform.value.copy(_.matrix),(u!==_||d!==_.version||f!==r.toneMapping)&&(l.material.needsUpdate=!0,u=_,d=_.version,f=r.toneMapping),l.layers.enableAll(),C.unshift(l,l.geometry,l.material,0,0,null))}function p(C,v){C.getRGB(ou,u5(r)),n.buffers.color.setClear(ou.r,ou.g,ou.b,v,o)}return{getClearColor:function(){return a},setClearColor:function(C,v=1){a.set(C),c=v,p(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(C){c=C,p(a,c)},render:g,addToRenderList:x}}function pD(r,t){let e=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=d(null),s=i,o=!1;function a(y,D,F,T,z){let H=!1,tt=u(T,F,D);s!==tt&&(s=tt,l(s.object)),H=f(y,T,F,z),H&&m(y,T,F,z),z!==null&&t.update(z,r.ELEMENT_ARRAY_BUFFER),(H||o)&&(o=!1,_(y,D,F,T),z!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(z).buffer))}function c(){return r.createVertexArray()}function l(y){return r.bindVertexArray(y)}function h(y){return r.deleteVertexArray(y)}function u(y,D,F){let T=F.wireframe===!0,z=n[y.id];z===void 0&&(z={},n[y.id]=z);let H=z[D.id];H===void 0&&(H={},z[D.id]=H);let tt=H[T];return tt===void 0&&(tt=d(c()),H[T]=tt),tt}function d(y){let D=[],F=[],T=[];for(let z=0;z=0){let ct=z[Y],_t=H[Y];if(_t===void 0&&(Y==="instanceMatrix"&&y.instanceMatrix&&(_t=y.instanceMatrix),Y==="instanceColor"&&y.instanceColor&&(_t=y.instanceColor)),ct===void 0||ct.attribute!==_t||_t&&ct.data!==_t.data)return!0;tt++}return s.attributesNum!==tt||s.index!==T}function m(y,D,F,T){let z={},H=D.attributes,tt=0,it=F.getAttributes();for(let Y in it)if(it[Y].location>=0){let ct=H[Y];ct===void 0&&(Y==="instanceMatrix"&&y.instanceMatrix&&(ct=y.instanceMatrix),Y==="instanceColor"&&y.instanceColor&&(ct=y.instanceColor));let _t={};_t.attribute=ct,ct&&ct.data&&(_t.data=ct.data),z[Y]=_t,tt++}s.attributes=z,s.attributesNum=tt,s.index=T}function g(){let y=s.newAttributes;for(let D=0,F=y.length;D=0){let $=z[it];if($===void 0&&(it==="instanceMatrix"&&y.instanceMatrix&&($=y.instanceMatrix),it==="instanceColor"&&y.instanceColor&&($=y.instanceColor)),$!==void 0){let ct=$.normalized,_t=$.itemSize,bt=t.get($);if(bt===void 0)continue;let se=bt.buffer,K=bt.type,L=bt.bytesPerElement,j=K===r.INT||K===r.UNSIGNED_INT||$.gpuType===e5;if($.isInterleavedBufferAttribute){let O=$.data,et=O.stride,Z=$.offset;if(O.isInstancedInterleavedBuffer){for(let R=0;R0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";b="mediump"}return b==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let l=e.precision!==void 0?e.precision:"highp",h=c(l);h!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",h,"instead."),l=h);let u=e.logarithmicDepthBuffer===!0,d=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),f=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=r.getParameter(r.MAX_TEXTURE_SIZE),g=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),x=r.getParameter(r.MAX_VERTEX_ATTRIBS),p=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),C=r.getParameter(r.MAX_VARYING_VECTORS),v=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),_=f>0,A=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:a,precision:l,logarithmicDepthBuffer:u,maxTextures:d,maxVertexTextures:f,maxTextureSize:m,maxCubemapSize:g,maxAttributes:x,maxVertexUniforms:p,maxVaryings:C,maxFragmentUniforms:v,vertexTextures:_,maxSamples:A}}function CD(r){let t=this,e=null,n=0,i=!1,s=!1,o=new Br,a=new ge,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){let f=u.length!==0||d||n!==0||i;return i=d,n=u.length,f},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(u,d){e=h(u,d,0)},this.setState=function(u,d,f){let m=u.clippingPlanes,g=u.clipIntersection,x=u.clipShadows,p=r.get(u);if(!i||m===null||m.length===0||s&&!x)s?h(null):l();else{let C=s?0:n,v=C*4,_=p.clippingState||null;c.value=_,_=h(m,d,v,f);for(let A=0;A!==v;++A)_[A]=e[A];p.clippingState=_,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=C}};function l(){c.value!==e&&(c.value=e,c.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(u,d,f,m){let g=u!==null?u.length:0,x=null;if(g!==0){if(x=c.value,m!==!0||x===null){let p=f+g*4,C=d.matrixWorldInverse;a.getNormalMatrix(C),(x===null||x.length0){let l=new Dx(c.height);return l.fromEquirectangularTexture(r,o),t.set(o,l),o.addEventListener("dispose",i),e(l.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let c=t.get(a);c!==void 0&&(t.delete(a),c.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}var Bx=class extends Su{constructor(t=-1,e=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-t,o=n+t,a=i+e,c=i-e;if(this.view!==null&&this.view.enabled){let l=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=l*this.view.offsetX,o=s+l*this.view.width,a-=h*this.view.offsetY,c=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,c,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},sa=4,EC=[.125,.215,.35,.446,.526,.582],Ys=20,hx=new Bx,_C=new ie,ux=null,dx=0,fx=0,xx=!1,js=(1+Math.sqrt(5))/2,na=1/js,yC=[new U(-js,na,0),new U(js,na,0),new U(-na,0,js),new U(na,0,js),new U(0,js,-na),new U(0,js,na),new U(-1,1,-1),new U(1,1,-1),new U(-1,1,1),new U(1,1,1)],Du=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){ux=this._renderer.getRenderTarget(),dx=this._renderer.getActiveCubeFace(),fx=this._renderer.getActiveMipmapLevel(),xx=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,i,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=SC(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=AC(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?v:0,v,v),h.setRenderTarget(i),g&&h.render(m,a),h.render(t,a)}m.geometry.dispose(),m.material.dispose(),h.toneMapping=d,h.autoClear=u,t.background=x}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===ha||t.mapping===ua;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=SC()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=AC());let s=i?this._cubemapMaterial:this._equirectMaterial,o=new ei(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=t;let c=this._cubeSize;au(e,0,0,3*c,2*c),n.setRenderTarget(e),n.render(o,hx)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;let i=this._lodPlanes.length;for(let s=1;sYs&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Ys}`);let p=[],C=0;for(let S=0;Sv-sa?i-v+sa:0),b=4*(this._cubeSize-_);au(e,A,b,3*_,2*_),c.setRenderTarget(e),c.render(u,hx)}};function ED(r){let t=[],e=[],n=[],i=r,s=r-sa+1+EC.length;for(let o=0;or-sa?c=EC[o-r+sa-1]:o===0&&(c=0),n.push(c);let l=1/(a-2),h=-l,u=1+l,d=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,m=6,g=3,x=2,p=1,C=new Float32Array(g*m*f),v=new Float32Array(x*m*f),_=new Float32Array(p*m*f);for(let b=0;b2?0:-1,E=[S,w,0,S+2/3,w,0,S+2/3,w+1,0,S,w,0,S+2/3,w+1,0,S,w+1,0];C.set(E,g*m*b),v.set(d,x*m*b);let y=[b,b,b,b,b,b];_.set(y,p*m*b)}let A=new An;A.setAttribute("position",new Mi(C,g)),A.setAttribute("uv",new Mi(v,x)),A.setAttribute("faceIndex",new Mi(_,p)),t.push(A),i>sa&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function bC(r,t,e){let n=new Pr(r,t,e);return n.texture.mapping=zu,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function au(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function _D(r,t,e){let n=new Float32Array(Ys),i=new U(0,1,0);return new dr({name:"SphericalGaussianBlur",defines:{n:Ys,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:cp(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:ls,depthTest:!1,depthWrite:!1})}function AC(){return new dr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:cp(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:ls,depthTest:!1,depthWrite:!1})}function SC(){return new dr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:cp(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:ls,depthTest:!1,depthWrite:!1})}function cp(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function yD(r){let t=new WeakMap,e=null;function n(a){if(a&&a.isTexture){let c=a.mapping,l=c===_x||c===yx,h=c===ha||c===ua;if(l||h){let u=t.get(a),d=u!==void 0?u.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return e===null&&(e=new Du(r)),u=l?e.fromEquirectangular(a,u):e.fromCubemap(a,u),u.texture.pmremVersion=a.pmremVersion,t.set(a,u),u.texture;if(u!==void 0)return u.texture;{let f=a.image;return l&&f&&f.height>0||h&&f&&i(f)?(e===null&&(e=new Du(r)),u=l?e.fromEquirectangular(a):e.fromCubemap(a),u.texture.pmremVersion=a.pmremVersion,t.set(a,u),a.addEventListener("dispose",s),u.texture):null}}}return a}function i(a){let c=0,l=6;for(let h=0;ht.maxTextureSize&&(b=Math.ceil(A/t.maxTextureSize),A=t.maxTextureSize);let S=new Float32Array(A*b*4*u),w=new _u(S,A,b,u);w.type=cs,w.needsUpdate=!0;let E=_*4;for(let D=0;D0)return r;let i=t*e,s=wC[i];if(s===void 0&&(s=new Float32Array(i),wC[i]=s),t!==0){n.toArray(s,0);for(let o=1,a=0;o!==t;++o)a+=e,r[o].toArray(s,a)}return s}function vn(r,t){if(r.length!==t.length)return!1;for(let e=0,n=r.length;e":" "} ${a}: ${e[o]}`)}return n.join(` +`)}function vB(r){let t=Ve.getPrimaries(Ve.workingColorSpace),e=Ve.getPrimaries(r),n;switch(t===e?n="":t===Cu&&e===gu?n="LinearDisplayP3ToLinearSRGB":t===gu&&e===Cu&&(n="LinearSRGBToLinearDisplayP3"),r){case fs:case Gu:return[n,"LinearTransferOETF"];case Si:case op:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function kC(r,t,e){let n=r.getShaderParameter(t,r.COMPILE_STATUS),i=r.getShaderInfoLog(t).trim();if(n&&i==="")return"";let s=/ERROR: 0:(\d+)/.exec(i);if(s){let o=parseInt(s[1]);return e.toUpperCase()+` + +`+i+` + +`+CB(r.getShaderSource(t),o)}else return i}function EB(r,t){let e=vB(t);return`vec4 ${r}( vec4 value ) { return ${e[0]}( ${e[1]}( value ) ); }`}function _B(r,t){let e;switch(t){case y9:e="Linear";break;case b9:e="Reinhard";break;case A9:e="OptimizedCineon";break;case S9:e="ACESFilmic";break;case M9:e="AgX";break;case D9:e="Neutral";break;case w9:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}function yB(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(rl).join(` +`)}function bB(r){let t=[];for(let e in r){let n=r[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(` +`)}function AB(r,t){let e={},n=r.getProgramParameter(t,r.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function kx(r){return r.replace(SB,MB)}var wB=new Map;function MB(r,t){let e=me[t];if(e===void 0){let n=wB.get(t);if(n!==void 0)e=me[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return kx(e)}var DB=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function OC(r){return r.replace(DB,BB)}function BB(r,t,e,n){let i="";for(let s=parseInt(t);s0&&(x+=` +`),p=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m].filter(rl).join(` +`),p.length>0&&(p+=` +`)):(x=[LC(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(rl).join(` +`),p=[LC(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+l:"",e.envMap?"#define "+h:"",e.envMap?"#define "+u:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==hs?"#define TONE_MAPPING":"",e.toneMapping!==hs?me.tonemapping_pars_fragment:"",e.toneMapping!==hs?_B("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",me.colorspace_pars_fragment,EB("linearToOutputTexel",e.outputColorSpace),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` +`].filter(rl).join(` +`)),o=kx(o),o=RC(o,e),o=IC(o,e),a=kx(a),a=RC(a,e),a=IC(a,e),o=OC(o),a=OC(a),e.isRawShaderMaterial!==!0&&(C=`#version 300 es +`,x=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+x,p=["#define varying in",e.glslVersion===Q2?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Q2?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+p);let v=C+x+o,_=C+p+a,A=PC(i,i.VERTEX_SHADER,v),b=PC(i,i.FRAGMENT_SHADER,_);i.attachShader(g,A),i.attachShader(g,b),e.index0AttributeName!==void 0?i.bindAttribLocation(g,0,e.index0AttributeName):e.morphTargets===!0&&i.bindAttribLocation(g,0,"position"),i.linkProgram(g);function S(D){if(r.debug.checkShaderErrors){let F=i.getProgramInfoLog(g).trim(),T=i.getShaderInfoLog(A).trim(),z=i.getShaderInfoLog(b).trim(),H=!0,tt=!0;if(i.getProgramParameter(g,i.LINK_STATUS)===!1)if(H=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,g,A,b);else{let it=kC(i,A,"vertex"),Y=kC(i,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(g,i.VALIDATE_STATUS)+` + +Material Name: `+D.name+` +Material Type: `+D.type+` + +Program Info Log: `+F+` +`+it+` +`+Y)}else F!==""?console.warn("THREE.WebGLProgram: Program Info Log:",F):(T===""||z==="")&&(tt=!1);tt&&(D.diagnostics={runnable:H,programLog:F,vertexShader:{log:T,prefix:x},fragmentShader:{log:z,prefix:p}})}i.deleteShader(A),i.deleteShader(b),w=new la(i,g),E=AB(i,g)}let w;this.getUniforms=function(){return w===void 0&&S(this),w};let E;this.getAttributes=function(){return E===void 0&&S(this),E};let y=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return y===!1&&(y=i.getProgramParameter(g,mB)),y},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=gB++,this.cacheKey=t,this.usedTimes=1,this.program=g,this.vertexShader=A,this.fragmentShader=b,this}var OB=0,Rx=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new Ix(t),e.set(t,n)),n}},Ix=class{constructor(t){this.id=OB++,this.code=t,this.usedTimes=0}};function LB(r,t,e,n,i,s,o){let a=new dl,c=new Rx,l=new Set,h=[],u=i.logarithmicDepthBuffer,d=i.vertexTextures,f=i.precision,m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(E){return l.add(E),E===0?"uv":`uv${E}`}function x(E,y,D,F,T){let z=F.fog,H=T.geometry,tt=E.isMeshStandardMaterial?F.environment:null,it=(E.isMeshStandardMaterial?e:t).get(E.envMap||tt),Y=it&&it.mapping===zu?it.image.height:null,$=m[E.type];E.precision!==null&&(f=i.getMaxPrecision(E.precision),f!==E.precision&&console.warn("THREE.WebGLProgram.getParameters:",E.precision,"not supported, using",f,"instead."));let ct=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,_t=ct!==void 0?ct.length:0,bt=0;H.morphAttributes.position!==void 0&&(bt=1),H.morphAttributes.normal!==void 0&&(bt=2),H.morphAttributes.color!==void 0&&(bt=3);let se,K,L,j;if($){let Re=ar[$];se=Re.vertexShader,K=Re.fragmentShader}else se=E.vertexShader,K=E.fragmentShader,c.update(E),L=c.getVertexShaderID(E),j=c.getFragmentShaderID(E);let O=r.getRenderTarget(),et=T.isInstancedMesh===!0,Z=T.isBatchedMesh===!0,R=!!E.map,St=!!E.matcap,ut=!!it,Vt=!!E.aoMap,Tt=!!E.lightMap,yt=!!E.bumpMap,Gt=!!E.normalMap,zt=!!E.displacementMap,Xe=!!E.emissiveMap,k=!!E.metalnessMap,M=!!E.roughnessMap,st=E.anisotropy>0,ht=E.clearcoat>0,mt=E.dispersion>0,gt=E.iridescence>0,Zt=E.sheen>0,Rt=E.transmission>0,kt=st&&!!E.anisotropyMap,Ce=ht&&!!E.clearcoatMap,wt=ht&&!!E.clearcoatNormalMap,$t=ht&&!!E.clearcoatRoughnessMap,Be=gt&&!!E.iridescenceMap,ee=gt&&!!E.iridescenceThicknessMap,Ut=Zt&&!!E.sheenColorMap,ve=Zt&&!!E.sheenRoughnessMap,Se=!!E.specularMap,rn=!!E.specularColorMap,Ee=!!E.specularIntensityMap,X=Rt&&!!E.transmissionMap,pt=Rt&&!!E.thicknessMap,lt=!!E.gradientMap,Ft=!!E.alphaMap,Ot=E.alphaTest>0,Te=!!E.alphaHash,Ye=!!E.extensions,tn=hs;E.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(tn=r.toneMapping);let Tn={shaderID:$,shaderType:E.type,shaderName:E.name,vertexShader:se,fragmentShader:K,defines:E.defines,customVertexShaderID:L,customFragmentShaderID:j,isRawShaderMaterial:E.isRawShaderMaterial===!0,glslVersion:E.glslVersion,precision:f,batching:Z,instancing:et,instancingColor:et&&T.instanceColor!==null,instancingMorph:et&&T.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:O===null?r.outputColorSpace:O.isXRRenderTarget===!0?O.texture.colorSpace:fs,alphaToCoverage:!!E.alphaToCoverage,map:R,matcap:St,envMap:ut,envMapMode:ut&&it.mapping,envMapCubeUVHeight:Y,aoMap:Vt,lightMap:Tt,bumpMap:yt,normalMap:Gt,displacementMap:d&&zt,emissiveMap:Xe,normalMapObjectSpace:Gt&&E.normalMapType===H9,normalMapTangentSpace:Gt&&E.normalMapType===a5,metalnessMap:k,roughnessMap:M,anisotropy:st,anisotropyMap:kt,clearcoat:ht,clearcoatMap:Ce,clearcoatNormalMap:wt,clearcoatRoughnessMap:$t,dispersion:mt,iridescence:gt,iridescenceMap:Be,iridescenceThicknessMap:ee,sheen:Zt,sheenColorMap:Ut,sheenRoughnessMap:ve,specularMap:Se,specularColorMap:rn,specularIntensityMap:Ee,transmission:Rt,transmissionMap:X,thicknessMap:pt,gradientMap:lt,opaque:E.transparent===!1&&E.blending===oa&&E.alphaToCoverage===!1,alphaMap:Ft,alphaTest:Ot,alphaHash:Te,combine:E.combine,mapUv:R&&g(E.map.channel),aoMapUv:Vt&&g(E.aoMap.channel),lightMapUv:Tt&&g(E.lightMap.channel),bumpMapUv:yt&&g(E.bumpMap.channel),normalMapUv:Gt&&g(E.normalMap.channel),displacementMapUv:zt&&g(E.displacementMap.channel),emissiveMapUv:Xe&&g(E.emissiveMap.channel),metalnessMapUv:k&&g(E.metalnessMap.channel),roughnessMapUv:M&&g(E.roughnessMap.channel),anisotropyMapUv:kt&&g(E.anisotropyMap.channel),clearcoatMapUv:Ce&&g(E.clearcoatMap.channel),clearcoatNormalMapUv:wt&&g(E.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:$t&&g(E.clearcoatRoughnessMap.channel),iridescenceMapUv:Be&&g(E.iridescenceMap.channel),iridescenceThicknessMapUv:ee&&g(E.iridescenceThicknessMap.channel),sheenColorMapUv:Ut&&g(E.sheenColorMap.channel),sheenRoughnessMapUv:ve&&g(E.sheenRoughnessMap.channel),specularMapUv:Se&&g(E.specularMap.channel),specularColorMapUv:rn&&g(E.specularColorMap.channel),specularIntensityMapUv:Ee&&g(E.specularIntensityMap.channel),transmissionMapUv:X&&g(E.transmissionMap.channel),thicknessMapUv:pt&&g(E.thicknessMap.channel),alphaMapUv:Ft&&g(E.alphaMap.channel),vertexTangents:!!H.attributes.tangent&&(Gt||st),vertexColors:E.vertexColors,vertexAlphas:E.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,pointsUvs:T.isPoints===!0&&!!H.attributes.uv&&(R||Ft),fog:!!z,useFog:E.fog===!0,fogExp2:!!z&&z.isFogExp2,flatShading:E.flatShading===!0,sizeAttenuation:E.sizeAttenuation===!0,logarithmicDepthBuffer:u,skinning:T.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:_t,morphTextureStride:bt,numDirLights:y.directional.length,numPointLights:y.point.length,numSpotLights:y.spot.length,numSpotLightMaps:y.spotLightMap.length,numRectAreaLights:y.rectArea.length,numHemiLights:y.hemi.length,numDirLightShadows:y.directionalShadowMap.length,numPointLightShadows:y.pointShadowMap.length,numSpotLightShadows:y.spotShadowMap.length,numSpotLightShadowsWithMaps:y.numSpotLightShadowsWithMaps,numLightProbes:y.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:E.dithering,shadowMapEnabled:r.shadowMap.enabled&&D.length>0,shadowMapType:r.shadowMap.type,toneMapping:tn,useLegacyLights:r._useLegacyLights,decodeVideoTexture:R&&E.map.isVideoTexture===!0&&Ve.getTransfer(E.map.colorSpace)===qe,premultipliedAlpha:E.premultipliedAlpha,doubleSided:E.side===Tr,flipSided:E.side===ni,useDepthPacking:E.depthPacking>=0,depthPacking:E.depthPacking||0,index0AttributeName:E.index0AttributeName,extensionClipCullDistance:Ye&&E.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Ye&&E.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:E.customProgramCacheKey()};return Tn.vertexUv1s=l.has(1),Tn.vertexUv2s=l.has(2),Tn.vertexUv3s=l.has(3),l.clear(),Tn}function p(E){let y=[];if(E.shaderID?y.push(E.shaderID):(y.push(E.customVertexShaderID),y.push(E.customFragmentShaderID)),E.defines!==void 0)for(let D in E.defines)y.push(D),y.push(E.defines[D]);return E.isRawShaderMaterial===!1&&(C(y,E),v(y,E),y.push(r.outputColorSpace)),y.push(E.customProgramCacheKey),y.join()}function C(E,y){E.push(y.precision),E.push(y.outputColorSpace),E.push(y.envMapMode),E.push(y.envMapCubeUVHeight),E.push(y.mapUv),E.push(y.alphaMapUv),E.push(y.lightMapUv),E.push(y.aoMapUv),E.push(y.bumpMapUv),E.push(y.normalMapUv),E.push(y.displacementMapUv),E.push(y.emissiveMapUv),E.push(y.metalnessMapUv),E.push(y.roughnessMapUv),E.push(y.anisotropyMapUv),E.push(y.clearcoatMapUv),E.push(y.clearcoatNormalMapUv),E.push(y.clearcoatRoughnessMapUv),E.push(y.iridescenceMapUv),E.push(y.iridescenceThicknessMapUv),E.push(y.sheenColorMapUv),E.push(y.sheenRoughnessMapUv),E.push(y.specularMapUv),E.push(y.specularColorMapUv),E.push(y.specularIntensityMapUv),E.push(y.transmissionMapUv),E.push(y.thicknessMapUv),E.push(y.combine),E.push(y.fogExp2),E.push(y.sizeAttenuation),E.push(y.morphTargetsCount),E.push(y.morphAttributeCount),E.push(y.numDirLights),E.push(y.numPointLights),E.push(y.numSpotLights),E.push(y.numSpotLightMaps),E.push(y.numHemiLights),E.push(y.numRectAreaLights),E.push(y.numDirLightShadows),E.push(y.numPointLightShadows),E.push(y.numSpotLightShadows),E.push(y.numSpotLightShadowsWithMaps),E.push(y.numLightProbes),E.push(y.shadowMapType),E.push(y.toneMapping),E.push(y.numClippingPlanes),E.push(y.numClipIntersection),E.push(y.depthPacking)}function v(E,y){a.disableAll(),y.supportsVertexTextures&&a.enable(0),y.instancing&&a.enable(1),y.instancingColor&&a.enable(2),y.instancingMorph&&a.enable(3),y.matcap&&a.enable(4),y.envMap&&a.enable(5),y.normalMapObjectSpace&&a.enable(6),y.normalMapTangentSpace&&a.enable(7),y.clearcoat&&a.enable(8),y.iridescence&&a.enable(9),y.alphaTest&&a.enable(10),y.vertexColors&&a.enable(11),y.vertexAlphas&&a.enable(12),y.vertexUv1s&&a.enable(13),y.vertexUv2s&&a.enable(14),y.vertexUv3s&&a.enable(15),y.vertexTangents&&a.enable(16),y.anisotropy&&a.enable(17),y.alphaHash&&a.enable(18),y.batching&&a.enable(19),y.dispersion&&a.enable(20),E.push(a.mask),a.disableAll(),y.fog&&a.enable(0),y.useFog&&a.enable(1),y.flatShading&&a.enable(2),y.logarithmicDepthBuffer&&a.enable(3),y.skinning&&a.enable(4),y.morphTargets&&a.enable(5),y.morphNormals&&a.enable(6),y.morphColors&&a.enable(7),y.premultipliedAlpha&&a.enable(8),y.shadowMapEnabled&&a.enable(9),y.useLegacyLights&&a.enable(10),y.doubleSided&&a.enable(11),y.flipSided&&a.enable(12),y.useDepthPacking&&a.enable(13),y.dithering&&a.enable(14),y.transmission&&a.enable(15),y.sheen&&a.enable(16),y.opaque&&a.enable(17),y.pointsUvs&&a.enable(18),y.decodeVideoTexture&&a.enable(19),y.alphaToCoverage&&a.enable(20),E.push(a.mask)}function _(E){let y=m[E.type],D;if(y){let F=ar[y];D=DS.clone(F.uniforms)}else D=E.uniforms;return D}function A(E,y){let D;for(let F=0,T=h.length;F0?n.push(p):f.transparent===!0?i.push(p):e.push(p)}function c(u,d,f,m,g,x){let p=o(u,d,f,m,g,x);f.transmission>0?n.unshift(p):f.transparent===!0?i.unshift(p):e.unshift(p)}function l(u,d){e.length>1&&e.sort(u||UB),n.length>1&&n.sort(d||NC),i.length>1&&i.sort(d||NC)}function h(){for(let u=t,d=r.length;u=s.length?(o=new UC,s.push(o)):o=s[i],o}function e(){r=new WeakMap}return{get:t,dispose:e}}function zB(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new U,color:new ie};break;case"SpotLight":e={position:new U,direction:new U,color:new ie,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new U,color:new ie,distance:0,decay:0};break;case"HemisphereLight":e={direction:new U,skyColor:new ie,groundColor:new ie};break;case"RectAreaLight":e={color:new ie,position:new U,halfWidth:new U,halfHeight:new U};break}return r[t.id]=e,e}}}function HB(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new re};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new re};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new re,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}var GB=0;function WB(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function jB(r){let t=new zB,e=HB(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)n.probe.push(new U);let i=new U,s=new oe,o=new oe;function a(l,h){let u=0,d=0,f=0;for(let D=0;D<9;D++)n.probe[D].set(0,0,0);let m=0,g=0,x=0,p=0,C=0,v=0,_=0,A=0,b=0,S=0,w=0;l.sort(WB);let E=h===!0?Math.PI:1;for(let D=0,F=l.length;D0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Bt.LTC_FLOAT_1,n.rectAreaLTC2=Bt.LTC_FLOAT_2):(n.rectAreaLTC1=Bt.LTC_HALF_1,n.rectAreaLTC2=Bt.LTC_HALF_2)),n.ambient[0]=u,n.ambient[1]=d,n.ambient[2]=f;let y=n.hash;(y.directionalLength!==m||y.pointLength!==g||y.spotLength!==x||y.rectAreaLength!==p||y.hemiLength!==C||y.numDirectionalShadows!==v||y.numPointShadows!==_||y.numSpotShadows!==A||y.numSpotMaps!==b||y.numLightProbes!==w)&&(n.directional.length=m,n.spot.length=x,n.rectArea.length=p,n.point.length=g,n.hemi.length=C,n.directionalShadow.length=v,n.directionalShadowMap.length=v,n.pointShadow.length=_,n.pointShadowMap.length=_,n.spotShadow.length=A,n.spotShadowMap.length=A,n.directionalShadowMatrix.length=v,n.pointShadowMatrix.length=_,n.spotLightMatrix.length=A+b-S,n.spotLightMap.length=b,n.numSpotLightShadowsWithMaps=S,n.numLightProbes=w,y.directionalLength=m,y.pointLength=g,y.spotLength=x,y.rectAreaLength=p,y.hemiLength=C,y.numDirectionalShadows=v,y.numPointShadows=_,y.numSpotShadows=A,y.numSpotMaps=b,y.numLightProbes=w,n.version=GB++)}function c(l,h){let u=0,d=0,f=0,m=0,g=0,x=h.matrixWorldInverse;for(let p=0,C=l.length;p=o.length?(a=new VC(r),o.push(a)):a=o[s],a}function n(){t=new WeakMap}return{get:e,dispose:n}}var Ox=class extends Bi{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=V9,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},Lx=class extends Bi{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}},YB=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,qB=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function $B(r,t,e){let n=new xl,i=new re,s=new re,o=new Je,a=new Ox({depthPacking:z9}),c=new Lx,l={},h=e.maxTextureSize,u={[hr]:ni,[ni]:hr,[Tr]:Tr},d=new dr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new re},radius:{value:4}},vertexShader:YB,fragmentShader:qB}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let m=new An;m.setAttribute("position",new Mi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new ei(m,d),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=QC;let p=this.type;this.render=function(b,S,w){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||b.length===0)return;let E=r.getRenderTarget(),y=r.getActiveCubeFace(),D=r.getActiveMipmapLevel(),F=r.state;F.setBlending(ls),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);let T=p!==Dr&&this.type===Dr,z=p===Dr&&this.type!==Dr;for(let H=0,tt=b.length;Hh||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/$.x),i.x=s.x*$.x,Y.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/$.y),i.y=s.y*$.y,Y.mapSize.y=s.y)),Y.map===null||T===!0||z===!0){let _t=this.type!==Dr?{minFilter:wi,magFilter:wi}:{};Y.map!==null&&Y.map.dispose(),Y.map=new Pr(i.x,i.y,_t),Y.map.texture.name=it.name+".shadowMap",Y.camera.updateProjectionMatrix()}r.setRenderTarget(Y.map),r.clear();let ct=Y.getViewportCount();for(let _t=0;_t0||S.map&&S.alphaTest>0){let F=y.uuid,T=S.uuid,z=l[F];z===void 0&&(z={},l[F]=z);let H=z[T];H===void 0&&(H=y.clone(),z[T]=H,S.addEventListener("dispose",A)),y=H}if(y.visible=S.visible,y.wireframe=S.wireframe,E===Dr?y.side=S.shadowSide!==null?S.shadowSide:S.side:y.side=S.shadowSide!==null?S.shadowSide:u[S.side],y.alphaMap=S.alphaMap,y.alphaTest=S.alphaTest,y.map=S.map,y.clipShadows=S.clipShadows,y.clippingPlanes=S.clippingPlanes,y.clipIntersection=S.clipIntersection,y.displacementMap=S.displacementMap,y.displacementScale=S.displacementScale,y.displacementBias=S.displacementBias,y.wireframeLinewidth=S.wireframeLinewidth,y.linewidth=S.linewidth,w.isPointLight===!0&&y.isMeshDistanceMaterial===!0){let F=r.properties.get(y);F.light=w}return y}function _(b,S,w,E,y){if(b.visible===!1)return;if(b.layers.test(S.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&y===Dr)&&(!b.frustumCulled||n.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,b.matrixWorld);let T=t.update(b),z=b.material;if(Array.isArray(z)){let H=T.groups;for(let tt=0,it=H.length;tt=1):it.indexOf("OpenGL ES")!==-1&&(tt=parseFloat(/^OpenGL ES (\d)/.exec(it)[1]),H=tt>=2);let Y=null,$={},ct=r.getParameter(r.SCISSOR_BOX),_t=r.getParameter(r.VIEWPORT),bt=new Je().fromArray(ct),se=new Je().fromArray(_t);function K(X,pt,lt,Ft){let Ot=new Uint8Array(4),Te=r.createTexture();r.bindTexture(X,Te),r.texParameteri(X,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(X,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Ye=0;Ye"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new re,h=new WeakMap,u,d=new WeakMap,f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(k,M){return f?new OffscreenCanvas(k,M):ul("canvas")}function g(k,M,st){let ht=1,mt=Xe(k);if((mt.width>st||mt.height>st)&&(ht=st/Math.max(mt.width,mt.height)),ht<1)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap||typeof VideoFrame<"u"&&k instanceof VideoFrame){let gt=Math.floor(ht*mt.width),Zt=Math.floor(ht*mt.height);u===void 0&&(u=m(gt,Zt));let Rt=M?m(gt,Zt):u;return Rt.width=gt,Rt.height=Zt,Rt.getContext("2d").drawImage(k,0,0,gt,Zt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+mt.width+"x"+mt.height+") to ("+gt+"x"+Zt+")."),Rt}else return"data"in k&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+mt.width+"x"+mt.height+")."),k;return k}function x(k){return k.generateMipmaps&&k.minFilter!==wi&&k.minFilter!==zi}function p(k){r.generateMipmap(k)}function C(k,M,st,ht,mt=!1){if(k!==null){if(r[k]!==void 0)return r[k];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let gt=M;if(M===r.RED&&(st===r.FLOAT&&(gt=r.R32F),st===r.HALF_FLOAT&&(gt=r.R16F),st===r.UNSIGNED_BYTE&&(gt=r.R8)),M===r.RED_INTEGER&&(st===r.UNSIGNED_BYTE&&(gt=r.R8UI),st===r.UNSIGNED_SHORT&&(gt=r.R16UI),st===r.UNSIGNED_INT&&(gt=r.R32UI),st===r.BYTE&&(gt=r.R8I),st===r.SHORT&&(gt=r.R16I),st===r.INT&&(gt=r.R32I)),M===r.RG&&(st===r.FLOAT&&(gt=r.RG32F),st===r.HALF_FLOAT&&(gt=r.RG16F),st===r.UNSIGNED_BYTE&&(gt=r.RG8)),M===r.RG_INTEGER&&(st===r.UNSIGNED_BYTE&&(gt=r.RG8UI),st===r.UNSIGNED_SHORT&&(gt=r.RG16UI),st===r.UNSIGNED_INT&&(gt=r.RG32UI),st===r.BYTE&&(gt=r.RG8I),st===r.SHORT&&(gt=r.RG16I),st===r.INT&&(gt=r.RG32I)),M===r.RGB&&st===r.UNSIGNED_INT_5_9_9_9_REV&&(gt=r.RGB9_E5),M===r.RGBA){let Zt=mt?mu:Ve.getTransfer(ht);st===r.FLOAT&&(gt=r.RGBA32F),st===r.HALF_FLOAT&&(gt=r.RGBA16F),st===r.UNSIGNED_BYTE&&(gt=Zt===qe?r.SRGB8_ALPHA8:r.RGBA8),st===r.UNSIGNED_SHORT_4_4_4_4&&(gt=r.RGBA4),st===r.UNSIGNED_SHORT_5_5_5_1&&(gt=r.RGB5_A1)}return(gt===r.R16F||gt===r.R32F||gt===r.RG16F||gt===r.RG32F||gt===r.RGBA16F||gt===r.RGBA32F)&&t.get("EXT_color_buffer_float"),gt}function v(k,M){return x(k)===!0||k.isFramebufferTexture&&k.minFilter!==wi&&k.minFilter!==zi?Math.log2(Math.max(M.width,M.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?M.mipmaps.length:1}function _(k){let M=k.target;M.removeEventListener("dispose",_),b(M),M.isVideoTexture&&h.delete(M)}function A(k){let M=k.target;M.removeEventListener("dispose",A),w(M)}function b(k){let M=n.get(k);if(M.__webglInit===void 0)return;let st=k.source,ht=d.get(st);if(ht){let mt=ht[M.__cacheKey];mt.usedTimes--,mt.usedTimes===0&&S(k),Object.keys(ht).length===0&&d.delete(st)}n.remove(k)}function S(k){let M=n.get(k);r.deleteTexture(M.__webglTexture);let st=k.source,ht=d.get(st);delete ht[M.__cacheKey],o.memory.textures--}function w(k){let M=n.get(k);if(k.depthTexture&&k.depthTexture.dispose(),k.isWebGLCubeRenderTarget)for(let ht=0;ht<6;ht++){if(Array.isArray(M.__webglFramebuffer[ht]))for(let mt=0;mt=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+i.maxTextures),E+=1,k}function F(k){let M=[];return M.push(k.wrapS),M.push(k.wrapT),M.push(k.wrapR||0),M.push(k.magFilter),M.push(k.minFilter),M.push(k.anisotropy),M.push(k.internalFormat),M.push(k.format),M.push(k.type),M.push(k.generateMipmaps),M.push(k.premultiplyAlpha),M.push(k.flipY),M.push(k.unpackAlignment),M.push(k.colorSpace),M.join()}function T(k,M){let st=n.get(k);if(k.isVideoTexture&&Gt(k),k.isRenderTargetTexture===!1&&k.version>0&&st.__version!==k.version){let ht=k.image;if(ht===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ht.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{bt(st,k,M);return}}e.bindTexture(r.TEXTURE_2D,st.__webglTexture,r.TEXTURE0+M)}function z(k,M){let st=n.get(k);if(k.version>0&&st.__version!==k.version){bt(st,k,M);return}e.bindTexture(r.TEXTURE_2D_ARRAY,st.__webglTexture,r.TEXTURE0+M)}function H(k,M){let st=n.get(k);if(k.version>0&&st.__version!==k.version){bt(st,k,M);return}e.bindTexture(r.TEXTURE_3D,st.__webglTexture,r.TEXTURE0+M)}function tt(k,M){let st=n.get(k);if(k.version>0&&st.__version!==k.version){se(st,k,M);return}e.bindTexture(r.TEXTURE_CUBE_MAP,st.__webglTexture,r.TEXTURE0+M)}let it={[cl]:r.REPEAT,[qs]:r.CLAMP_TO_EDGE,[bx]:r.MIRRORED_REPEAT},Y={[wi]:r.NEAREST,[B9]:r.NEAREST_MIPMAP_NEAREST,[Vh]:r.NEAREST_MIPMAP_LINEAR,[zi]:r.LINEAR,[Uf]:r.LINEAR_MIPMAP_NEAREST,[$s]:r.LINEAR_MIPMAP_LINEAR},$={[G9]:r.NEVER,[$9]:r.ALWAYS,[W9]:r.LESS,[c5]:r.LEQUAL,[j9]:r.EQUAL,[q9]:r.GEQUAL,[X9]:r.GREATER,[Y9]:r.NOTEQUAL};function ct(k,M){if(M.type===cs&&t.has("OES_texture_float_linear")===!1&&(M.magFilter===zi||M.magFilter===Uf||M.magFilter===Vh||M.magFilter===$s||M.minFilter===zi||M.minFilter===Uf||M.minFilter===Vh||M.minFilter===$s)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(k,r.TEXTURE_WRAP_S,it[M.wrapS]),r.texParameteri(k,r.TEXTURE_WRAP_T,it[M.wrapT]),(k===r.TEXTURE_3D||k===r.TEXTURE_2D_ARRAY)&&r.texParameteri(k,r.TEXTURE_WRAP_R,it[M.wrapR]),r.texParameteri(k,r.TEXTURE_MAG_FILTER,Y[M.magFilter]),r.texParameteri(k,r.TEXTURE_MIN_FILTER,Y[M.minFilter]),M.compareFunction&&(r.texParameteri(k,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(k,r.TEXTURE_COMPARE_FUNC,$[M.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(M.magFilter===wi||M.minFilter!==Vh&&M.minFilter!==$s||M.type===cs&&t.has("OES_texture_float_linear")===!1)return;if(M.anisotropy>1||n.get(M).__currentAnisotropy){let st=t.get("EXT_texture_filter_anisotropic");r.texParameterf(k,st.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(M.anisotropy,i.getMaxAnisotropy())),n.get(M).__currentAnisotropy=M.anisotropy}}}function _t(k,M){let st=!1;k.__webglInit===void 0&&(k.__webglInit=!0,M.addEventListener("dispose",_));let ht=M.source,mt=d.get(ht);mt===void 0&&(mt={},d.set(ht,mt));let gt=F(M);if(gt!==k.__cacheKey){mt[gt]===void 0&&(mt[gt]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,st=!0),mt[gt].usedTimes++;let Zt=mt[k.__cacheKey];Zt!==void 0&&(mt[k.__cacheKey].usedTimes--,Zt.usedTimes===0&&S(M)),k.__cacheKey=gt,k.__webglTexture=mt[gt].texture}return st}function bt(k,M,st){let ht=r.TEXTURE_2D;(M.isDataArrayTexture||M.isCompressedArrayTexture)&&(ht=r.TEXTURE_2D_ARRAY),M.isData3DTexture&&(ht=r.TEXTURE_3D);let mt=_t(k,M),gt=M.source;e.bindTexture(ht,k.__webglTexture,r.TEXTURE0+st);let Zt=n.get(gt);if(gt.version!==Zt.__version||mt===!0){e.activeTexture(r.TEXTURE0+st);let Rt=Ve.getPrimaries(Ve.workingColorSpace),kt=M.colorSpace===as?null:Ve.getPrimaries(M.colorSpace),Ce=M.colorSpace===as||Rt===kt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,M.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,M.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,M.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ce);let wt=g(M.image,!1,i.maxTextureSize);wt=zt(M,wt);let $t=s.convert(M.format,M.colorSpace),Be=s.convert(M.type),ee=C(M.internalFormat,$t,Be,M.colorSpace,M.isVideoTexture);ct(ht,M);let Ut,ve=M.mipmaps,Se=M.isVideoTexture!==!0,rn=Zt.__version===void 0||mt===!0,Ee=gt.dataReady,X=v(M,wt);if(M.isDepthTexture)ee=r.DEPTH_COMPONENT16,M.type===cs?ee=r.DEPTH_COMPONENT32F:M.type===da?ee=r.DEPTH_COMPONENT24:M.type===ml&&(ee=r.DEPTH24_STENCIL8),rn&&(Se?e.texStorage2D(r.TEXTURE_2D,1,ee,wt.width,wt.height):e.texImage2D(r.TEXTURE_2D,0,ee,wt.width,wt.height,0,$t,Be,null));else if(M.isDataTexture)if(ve.length>0){Se&&rn&&e.texStorage2D(r.TEXTURE_2D,X,ee,ve[0].width,ve[0].height);for(let pt=0,lt=ve.length;pt>=1,lt>>=1}}else if(ve.length>0){if(Se&&rn){let pt=Xe(ve[0]);e.texStorage2D(r.TEXTURE_2D,X,ee,pt.width,pt.height)}for(let pt=0,lt=ve.length;pt0&&X++;let lt=Xe($t[0]);e.texStorage2D(r.TEXTURE_CUBE_MAP,X,ve,lt.width,lt.height)}for(let lt=0;lt<6;lt++)if(wt){Se?Ee&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+lt,0,0,0,$t[lt].width,$t[lt].height,ee,Ut,$t[lt].data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+lt,0,ve,$t[lt].width,$t[lt].height,0,ee,Ut,$t[lt].data);for(let Ft=0;Ft>gt),$t=Math.max(1,M.height>>gt);mt===r.TEXTURE_3D||mt===r.TEXTURE_2D_ARRAY?e.texImage3D(mt,gt,kt,wt,$t,M.depth,0,Zt,Rt,null):e.texImage2D(mt,gt,kt,wt,$t,0,Zt,Rt,null)}e.bindFramebuffer(r.FRAMEBUFFER,k),yt(M)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ht,mt,n.get(st).__webglTexture,0,Tt(M)):(mt===r.TEXTURE_2D||mt>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&mt<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,ht,mt,n.get(st).__webglTexture,gt),e.bindFramebuffer(r.FRAMEBUFFER,null)}function L(k,M,st){if(r.bindRenderbuffer(r.RENDERBUFFER,k),M.depthBuffer&&!M.stencilBuffer){let ht=r.DEPTH_COMPONENT24;if(st||yt(M)){let mt=M.depthTexture;mt&&mt.isDepthTexture&&(mt.type===cs?ht=r.DEPTH_COMPONENT32F:mt.type===da&&(ht=r.DEPTH_COMPONENT24));let gt=Tt(M);yt(M)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,gt,ht,M.width,M.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,gt,ht,M.width,M.height)}else r.renderbufferStorage(r.RENDERBUFFER,ht,M.width,M.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,k)}else if(M.depthBuffer&&M.stencilBuffer){let ht=Tt(M);st&&yt(M)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,ht,r.DEPTH24_STENCIL8,M.width,M.height):yt(M)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ht,r.DEPTH24_STENCIL8,M.width,M.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,M.width,M.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,k)}else{let ht=M.textures;for(let mt=0;mt1;if(Zt||(ht.__webglTexture===void 0&&(ht.__webglTexture=r.createTexture()),ht.__version=M.version,o.memory.textures++),gt){st.__webglFramebuffer=[];for(let Rt=0;Rt<6;Rt++)if(M.mipmaps&&M.mipmaps.length>0){st.__webglFramebuffer[Rt]=[];for(let kt=0;kt0){st.__webglFramebuffer=[];for(let Rt=0;Rt0&&yt(k)===!1){st.__webglMultisampledFramebuffer=r.createFramebuffer(),st.__webglColorRenderbuffer=[],e.bindFramebuffer(r.FRAMEBUFFER,st.__webglMultisampledFramebuffer);for(let Rt=0;Rt0)for(let kt=0;kt0)for(let kt=0;kt0){if(yt(k)===!1){let M=k.textures,st=k.width,ht=k.height,mt=r.COLOR_BUFFER_BIT,gt=k.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Zt=n.get(k),Rt=M.length>1;if(Rt)for(let kt=0;kt0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&M.__useRenderToTexture!==!1}function Gt(k){let M=o.render.frame;h.get(k)!==M&&(h.set(k,M),k.update())}function zt(k,M){let st=k.colorSpace,ht=k.format,mt=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||st!==fs&&st!==as&&(Ve.getTransfer(st)===qe?(ht!==cr||mt!==us)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",st)),M}function Xe(k){return typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement?(l.width=k.naturalWidth||k.width,l.height=k.naturalHeight||k.height):typeof VideoFrame<"u"&&k instanceof VideoFrame?(l.width=k.displayWidth,l.height=k.displayHeight):(l.width=k.width,l.height=k.height),l}this.allocateTextureUnit=D,this.resetTextureUnits=y,this.setTexture2D=T,this.setTexture2DArray=z,this.setTexture3D=H,this.setTextureCube=tt,this.rebindTextures=et,this.setupRenderTarget=Z,this.updateRenderTargetMipmap=R,this.updateMultisampleRenderTarget=Vt,this.setupDepthRenderbuffer=O,this.setupFrameBufferTexture=K,this.useMultisampledRTT=yt}function JB(r,t){function e(n,i=as){let s,o=Ve.getTransfer(i);if(n===us)return r.UNSIGNED_BYTE;if(n===n5)return r.UNSIGNED_SHORT_4_4_4_4;if(n===i5)return r.UNSIGNED_SHORT_5_5_5_1;if(n===P9)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===T9)return r.BYTE;if(n===F9)return r.SHORT;if(n===t5)return r.UNSIGNED_SHORT;if(n===e5)return r.INT;if(n===da)return r.UNSIGNED_INT;if(n===cs)return r.FLOAT;if(n===Hu)return r.HALF_FLOAT;if(n===k9)return r.ALPHA;if(n===R9)return r.RGB;if(n===cr)return r.RGBA;if(n===I9)return r.LUMINANCE;if(n===O9)return r.LUMINANCE_ALPHA;if(n===aa)return r.DEPTH_COMPONENT;if(n===ll)return r.DEPTH_STENCIL;if(n===L9)return r.RED;if(n===r5)return r.RED_INTEGER;if(n===N9)return r.RG;if(n===s5)return r.RG_INTEGER;if(n===o5)return r.RGBA_INTEGER;if(n===Vf||n===zf||n===Hf||n===Gf)if(o===qe)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Vf)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===zf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Hf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Gf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Vf)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===zf)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Hf)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Gf)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===y2||n===b2||n===A2||n===S2)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===y2)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===b2)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===A2)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===S2)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===w2||n===M2||n===D2)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===w2||n===M2)return o===qe?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===D2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===B2||n===T2||n===F2||n===P2||n===k2||n===R2||n===I2||n===O2||n===L2||n===N2||n===U2||n===V2||n===z2||n===H2)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===B2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===T2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===F2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===P2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===k2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===R2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===I2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===O2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===L2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===N2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===U2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===V2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===z2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===H2)return o===qe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Wf||n===G2||n===W2)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===Wf)return o===qe?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===G2)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===W2)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===U9||n===j2||n===X2||n===Y2)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===Wf)return s.COMPRESSED_RED_RGTC1_EXT;if(n===j2)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===X2)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Y2)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===ml?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:e}}var Nx=class extends Ln{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},lr=class extends Gi{constructor(){super(),this.isGroup=!0,this.type="Group"}},QB={type:"move"},al=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new lr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new lr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new U,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new U),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new lr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new U,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new U),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,s=null,o=null,a=this._targetRay,c=this._grip,l=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(l&&t.hand){o=!0;for(let g of t.hand.values()){let x=e.getJointPose(g,n),p=this._getHandJoint(l,g);x!==null&&(p.matrix.fromArray(x.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=x.radius),p.visible=x!==null}let h=l.joints["index-finger-tip"],u=l.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,m=.005;l.inputState.pinching&&d>f+m?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&d<=f-m&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else c!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(QB)))}return a!==null&&(a.visible=i!==null),c!==null&&(c.visible=s!==null),l!==null&&(l.visible=o!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new lr;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},tT=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,eT=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`,Ux=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){let i=new xs,s=t.properties.get(i);s.__webglTexture=e.texture,(e.depthNear!=n.depthNear||e.depthFar!=n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}render(t,e){if(this.texture!==null){if(this.mesh===null){let n=e.cameras[0].viewport,i=new dr({vertexShader:tT,fragmentShader:eT,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new ei(new Mu(20,20),i)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},Vx=class extends ur{constructor(t,e){super();let n=this,i=null,s=1,o=null,a="local-floor",c=1,l=null,h=null,u=null,d=null,f=null,m=null,g=new Ux,x=e.getContextAttributes(),p=null,C=null,v=[],_=[],A=new re,b=null,S=new Ln;S.layers.enable(1),S.viewport=new Je;let w=new Ln;w.layers.enable(2),w.viewport=new Je;let E=[S,w],y=new Nx;y.layers.enable(1),y.layers.enable(2);let D=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let L=v[K];return L===void 0&&(L=new al,v[K]=L),L.getTargetRaySpace()},this.getControllerGrip=function(K){let L=v[K];return L===void 0&&(L=new al,v[K]=L),L.getGripSpace()},this.getHand=function(K){let L=v[K];return L===void 0&&(L=new al,v[K]=L),L.getHandSpace()};function T(K){let L=_.indexOf(K.inputSource);if(L===-1)return;let j=v[L];j!==void 0&&(j.update(K.inputSource,K.frame,l||o),j.dispatchEvent({type:K.type,data:K.inputSource}))}function z(){i.removeEventListener("select",T),i.removeEventListener("selectstart",T),i.removeEventListener("selectend",T),i.removeEventListener("squeeze",T),i.removeEventListener("squeezestart",T),i.removeEventListener("squeezeend",T),i.removeEventListener("end",z),i.removeEventListener("inputsourceschange",H);for(let K=0;K=0&&(_[O]=null,v[O].disconnect(j))}for(let L=0;L=_.length){_.push(j),O=Z;break}else if(_[Z]===null){_[Z]=j,O=Z;break}if(O===-1)break}let et=v[O];et&&et.connect(j)}}let tt=new U,it=new U;function Y(K,L,j){tt.setFromMatrixPosition(L.matrixWorld),it.setFromMatrixPosition(j.matrixWorld);let O=tt.distanceTo(it),et=L.projectionMatrix.elements,Z=j.projectionMatrix.elements,R=et[14]/(et[10]-1),St=et[14]/(et[10]+1),ut=(et[9]+1)/et[5],Vt=(et[9]-1)/et[5],Tt=(et[8]-1)/et[0],yt=(Z[8]+1)/Z[0],Gt=R*Tt,zt=R*yt,Xe=O/(-Tt+yt),k=Xe*-Tt;L.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(k),K.translateZ(Xe),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert();let M=R+Xe,st=St+Xe,ht=Gt-k,mt=zt+(O-k),gt=ut*St/st*M,Zt=Vt*St/st*M;K.projectionMatrix.makePerspective(ht,mt,gt,Zt,M,st),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}function $(K,L){L===null?K.matrixWorld.copy(K.matrix):K.matrixWorld.multiplyMatrices(L.matrixWorld,K.matrix),K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(i===null)return;g.texture!==null&&(K.near=g.depthNear,K.far=g.depthFar),y.near=w.near=S.near=K.near,y.far=w.far=S.far=K.far,(D!==y.near||F!==y.far)&&(i.updateRenderState({depthNear:y.near,depthFar:y.far}),D=y.near,F=y.far,S.near=D,S.far=F,w.near=D,w.far=F,S.updateProjectionMatrix(),w.updateProjectionMatrix(),K.updateProjectionMatrix());let L=K.parent,j=y.cameras;$(y,L);for(let O=0;O0&&(x.alphaTest.value=p.alphaTest);let C=t.get(p),v=C.envMap,_=C.envMapRotation;if(v&&(x.envMap.value=v,Ws.copy(_),Ws.x*=-1,Ws.y*=-1,Ws.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(Ws.y*=-1,Ws.z*=-1),x.envMapRotation.value.setFromMatrix4(nT.makeRotationFromEuler(Ws)),x.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=p.reflectivity,x.ior.value=p.ior,x.refractionRatio.value=p.refractionRatio),p.lightMap){x.lightMap.value=p.lightMap;let A=r._useLegacyLights===!0?Math.PI:1;x.lightMapIntensity.value=p.lightMapIntensity*A,e(p.lightMap,x.lightMapTransform)}p.aoMap&&(x.aoMap.value=p.aoMap,x.aoMapIntensity.value=p.aoMapIntensity,e(p.aoMap,x.aoMapTransform))}function o(x,p){x.diffuse.value.copy(p.color),x.opacity.value=p.opacity,p.map&&(x.map.value=p.map,e(p.map,x.mapTransform))}function a(x,p){x.dashSize.value=p.dashSize,x.totalSize.value=p.dashSize+p.gapSize,x.scale.value=p.scale}function c(x,p,C,v){x.diffuse.value.copy(p.color),x.opacity.value=p.opacity,x.size.value=p.size*C,x.scale.value=v*.5,p.map&&(x.map.value=p.map,e(p.map,x.uvTransform)),p.alphaMap&&(x.alphaMap.value=p.alphaMap,e(p.alphaMap,x.alphaMapTransform)),p.alphaTest>0&&(x.alphaTest.value=p.alphaTest)}function l(x,p){x.diffuse.value.copy(p.color),x.opacity.value=p.opacity,x.rotation.value=p.rotation,p.map&&(x.map.value=p.map,e(p.map,x.mapTransform)),p.alphaMap&&(x.alphaMap.value=p.alphaMap,e(p.alphaMap,x.alphaMapTransform)),p.alphaTest>0&&(x.alphaTest.value=p.alphaTest)}function h(x,p){x.specular.value.copy(p.specular),x.shininess.value=Math.max(p.shininess,1e-4)}function u(x,p){p.gradientMap&&(x.gradientMap.value=p.gradientMap)}function d(x,p){x.metalness.value=p.metalness,p.metalnessMap&&(x.metalnessMap.value=p.metalnessMap,e(p.metalnessMap,x.metalnessMapTransform)),x.roughness.value=p.roughness,p.roughnessMap&&(x.roughnessMap.value=p.roughnessMap,e(p.roughnessMap,x.roughnessMapTransform)),p.envMap&&(x.envMapIntensity.value=p.envMapIntensity)}function f(x,p,C){x.ior.value=p.ior,p.sheen>0&&(x.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),x.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(x.sheenColorMap.value=p.sheenColorMap,e(p.sheenColorMap,x.sheenColorMapTransform)),p.sheenRoughnessMap&&(x.sheenRoughnessMap.value=p.sheenRoughnessMap,e(p.sheenRoughnessMap,x.sheenRoughnessMapTransform))),p.clearcoat>0&&(x.clearcoat.value=p.clearcoat,x.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(x.clearcoatMap.value=p.clearcoatMap,e(p.clearcoatMap,x.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,e(p.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(x.clearcoatNormalMap.value=p.clearcoatNormalMap,e(p.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===ni&&x.clearcoatNormalScale.value.negate())),p.dispersion>0&&(x.dispersion.value=p.dispersion),p.iridescence>0&&(x.iridescence.value=p.iridescence,x.iridescenceIOR.value=p.iridescenceIOR,x.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(x.iridescenceMap.value=p.iridescenceMap,e(p.iridescenceMap,x.iridescenceMapTransform)),p.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=p.iridescenceThicknessMap,e(p.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),p.transmission>0&&(x.transmission.value=p.transmission,x.transmissionSamplerMap.value=C.texture,x.transmissionSamplerSize.value.set(C.width,C.height),p.transmissionMap&&(x.transmissionMap.value=p.transmissionMap,e(p.transmissionMap,x.transmissionMapTransform)),x.thickness.value=p.thickness,p.thicknessMap&&(x.thicknessMap.value=p.thicknessMap,e(p.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=p.attenuationDistance,x.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(x.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(x.anisotropyMap.value=p.anisotropyMap,e(p.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=p.specularIntensity,x.specularColor.value.copy(p.specularColor),p.specularColorMap&&(x.specularColorMap.value=p.specularColorMap,e(p.specularColorMap,x.specularColorMapTransform)),p.specularIntensityMap&&(x.specularIntensityMap.value=p.specularIntensityMap,e(p.specularIntensityMap,x.specularIntensityMapTransform))}function m(x,p){p.matcap&&(x.matcap.value=p.matcap)}function g(x,p){let C=t.get(p).light;x.referencePosition.value.setFromMatrixPosition(C.matrixWorld),x.nearDistance.value=C.shadow.camera.near,x.farDistance.value=C.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function rT(r,t,e,n){let i={},s={},o=[],a=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function c(C,v){let _=v.program;n.uniformBlockBinding(C,_)}function l(C,v){let _=i[C.id];_===void 0&&(m(C),_=h(C),i[C.id]=_,C.addEventListener("dispose",x));let A=v.program;n.updateUBOMapping(C,A);let b=t.render.frame;s[C.id]!==b&&(d(C),s[C.id]=b)}function h(C){let v=u();C.__bindingPointIndex=v;let _=r.createBuffer(),A=C.__size,b=C.usage;return r.bindBuffer(r.UNIFORM_BUFFER,_),r.bufferData(r.UNIFORM_BUFFER,A,b),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,v,_),_}function u(){for(let C=0;C0&&(_+=A-b),C.__size=_,C.__cache={},this}function g(C){let v={boundary:0,storage:0};return typeof C=="number"||typeof C=="boolean"?(v.boundary=4,v.storage=4):C.isVector2?(v.boundary=8,v.storage=8):C.isVector3||C.isColor?(v.boundary=16,v.storage=12):C.isVector4?(v.boundary=16,v.storage=16):C.isMatrix3?(v.boundary=48,v.storage=48):C.isMatrix4?(v.boundary=64,v.storage=64):C.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",C),v}function x(C){let v=C.target;v.removeEventListener("dispose",x);let _=o.indexOf(v.__bindingPointIndex);o.splice(_,1),r.deleteBuffer(i[v.id]),delete i[v.id],delete s[v.id]}function p(){for(let C in i)r.deleteBuffer(i[C]);o=[],i={},s={}}return{bind:c,update:l,dispose:p}}var Tu=class{constructor(t={}){let{canvas:e=dS(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1}=t;this.isWebGLRenderer=!0;let d;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=o;let f=new Uint32Array(4),m=new Int32Array(4),g=null,x=null,p=[],C=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Si,this._useLegacyLights=!1,this.toneMapping=hs,this.toneMappingExposure=1;let v=this,_=!1,A=0,b=0,S=null,w=-1,E=null,y=new Je,D=new Je,F=null,T=new ie(0),z=0,H=e.width,tt=e.height,it=1,Y=null,$=null,ct=new Je(0,0,H,tt),_t=new Je(0,0,H,tt),bt=!1,se=new xl,K=!1,L=!1,j=new oe,O=new U,et={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Z(){return S===null?it:1}let R=n;function St(B,q){return e.getContext(B,q)}try{let B={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${rp}`),e.addEventListener("webglcontextlost",X,!1),e.addEventListener("webglcontextrestored",pt,!1),e.addEventListener("webglcontextcreationerror",lt,!1),R===null){let q="webgl2";if(R=St(q,B),R===null)throw St(q)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(B){throw console.error("THREE.WebGLRenderer: "+B.message),B}let ut,Vt,Tt,yt,Gt,zt,Xe,k,M,st,ht,mt,gt,Zt,Rt,kt,Ce,wt,$t,Be,ee,Ut,ve,Se;function rn(){ut=new bD(R),ut.init(),Ut=new JB(R,ut),Vt=new gD(R,ut,t,Ut),Tt=new ZB(R),yt=new wD(R),Gt=new NB,zt=new KB(R,ut,Tt,Gt,Vt,Ut,yt),Xe=new vD(v),k=new yD(v),M=new kS(R),ve=new pD(R,M),st=new AD(R,M,yt,ve),ht=new DD(R,st,M,yt),$t=new MD(R,Vt,zt),kt=new CD(Gt),mt=new LB(v,Xe,k,ut,Vt,ve,kt),gt=new iT(v,Gt),Zt=new VB,Rt=new XB(ut),wt=new xD(v,Xe,k,Tt,ht,d,c),Ce=new $B(v,ht,Vt),Se=new rT(R,yt,Vt,Tt),Be=new mD(R,ut,yt),ee=new SD(R,ut,yt),yt.programs=mt.programs,v.capabilities=Vt,v.extensions=ut,v.properties=Gt,v.renderLists=Zt,v.shadowMap=Ce,v.state=Tt,v.info=yt}rn();let Ee=new Vx(v,R);this.xr=Ee,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){let B=ut.get("WEBGL_lose_context");B&&B.loseContext()},this.forceContextRestore=function(){let B=ut.get("WEBGL_lose_context");B&&B.restoreContext()},this.getPixelRatio=function(){return it},this.setPixelRatio=function(B){B!==void 0&&(it=B,this.setSize(H,tt,!1))},this.getSize=function(B){return B.set(H,tt)},this.setSize=function(B,q,rt=!0){if(Ee.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}H=B,tt=q,e.width=Math.floor(B*it),e.height=Math.floor(q*it),rt===!0&&(e.style.width=B+"px",e.style.height=q+"px"),this.setViewport(0,0,B,q)},this.getDrawingBufferSize=function(B){return B.set(H*it,tt*it).floor()},this.setDrawingBufferSize=function(B,q,rt){H=B,tt=q,it=rt,e.width=Math.floor(B*rt),e.height=Math.floor(q*rt),this.setViewport(0,0,B,q)},this.getCurrentViewport=function(B){return B.copy(y)},this.getViewport=function(B){return B.copy(ct)},this.setViewport=function(B,q,rt,J){B.isVector4?ct.set(B.x,B.y,B.z,B.w):ct.set(B,q,rt,J),Tt.viewport(y.copy(ct).multiplyScalar(it).round())},this.getScissor=function(B){return B.copy(_t)},this.setScissor=function(B,q,rt,J){B.isVector4?_t.set(B.x,B.y,B.z,B.w):_t.set(B,q,rt,J),Tt.scissor(D.copy(_t).multiplyScalar(it).round())},this.getScissorTest=function(){return bt},this.setScissorTest=function(B){Tt.setScissorTest(bt=B)},this.setOpaqueSort=function(B){Y=B},this.setTransparentSort=function(B){$=B},this.getClearColor=function(B){return B.copy(wt.getClearColor())},this.setClearColor=function(){wt.setClearColor.apply(wt,arguments)},this.getClearAlpha=function(){return wt.getClearAlpha()},this.setClearAlpha=function(){wt.setClearAlpha.apply(wt,arguments)},this.clear=function(B=!0,q=!0,rt=!0){let J=0;if(B){let Q=!1;if(S!==null){let Pt=S.texture.format;Q=Pt===o5||Pt===s5||Pt===r5}if(Q){let Pt=S.texture.type,Ht=Pt===us||Pt===da||Pt===t5||Pt===ml||Pt===n5||Pt===i5,Wt=wt.getClearColor(),ne=wt.getClearAlpha(),ae=Wt.r,xe=Wt.g,ye=Wt.b;Ht?(f[0]=ae,f[1]=xe,f[2]=ye,f[3]=ne,R.clearBufferuiv(R.COLOR,0,f)):(m[0]=ae,m[1]=xe,m[2]=ye,m[3]=ne,R.clearBufferiv(R.COLOR,0,m))}else J|=R.COLOR_BUFFER_BIT}q&&(J|=R.DEPTH_BUFFER_BIT),rt&&(J|=R.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),R.clear(J)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",X,!1),e.removeEventListener("webglcontextrestored",pt,!1),e.removeEventListener("webglcontextcreationerror",lt,!1),Zt.dispose(),Rt.dispose(),Gt.dispose(),Xe.dispose(),k.dispose(),ht.dispose(),ve.dispose(),Se.dispose(),mt.dispose(),Ee.dispose(),Ee.removeEventListener("sessionstart",Re),Ee.removeEventListener("sessionend",er),zn.stop()};function X(B){B.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),_=!0}function pt(){console.log("THREE.WebGLRenderer: Context Restored."),_=!1;let B=yt.autoReset,q=Ce.enabled,rt=Ce.autoUpdate,J=Ce.needsUpdate,Q=Ce.type;rn(),yt.autoReset=B,Ce.enabled=q,Ce.autoUpdate=rt,Ce.needsUpdate=J,Ce.type=Q}function lt(B){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",B.statusMessage)}function Ft(B){let q=B.target;q.removeEventListener("dispose",Ft),Ot(q)}function Ot(B){Te(B),Gt.remove(B)}function Te(B){let q=Gt.get(B).programs;q!==void 0&&(q.forEach(function(rt){mt.releaseProgram(rt)}),B.isShaderMaterial&&mt.releaseShaderCache(B))}this.renderBufferDirect=function(B,q,rt,J,Q,Pt){q===null&&(q=et);let Ht=Q.isMesh&&Q.matrixWorld.determinant()<0,Wt=d_(B,q,rt,J,Q);Tt.setMaterial(J,Ht);let ne=rt.index,ae=1;if(J.wireframe===!0){if(ne=st.getWireframeAttribute(rt),ne===void 0)return;ae=2}let xe=rt.drawRange,ye=rt.attributes.position,dn=xe.start*ae,Fn=(xe.start+xe.count)*ae;Pt!==null&&(dn=Math.max(dn,Pt.start*ae),Fn=Math.min(Fn,(Pt.start+Pt.count)*ae)),ne!==null?(dn=Math.max(dn,0),Fn=Math.min(Fn,ne.count)):ye!=null&&(dn=Math.max(dn,0),Fn=Math.min(Fn,ye.count));let ri=Fn-dn;if(ri<0||ri===1/0)return;ve.setup(Q,J,Wt,rt,ne);let Er,Pe=Be;if(ne!==null&&(Er=M.get(ne),Pe=ee,Pe.setIndex(Er)),Q.isMesh)J.wireframe===!0?(Tt.setLineWidth(J.wireframeLinewidth*Z()),Pe.setMode(R.LINES)):Pe.setMode(R.TRIANGLES);else if(Q.isLine){let ce=J.linewidth;ce===void 0&&(ce=1),Tt.setLineWidth(ce*Z()),Q.isLineSegments?Pe.setMode(R.LINES):Q.isLineLoop?Pe.setMode(R.LINE_LOOP):Pe.setMode(R.LINE_STRIP)}else Q.isPoints?Pe.setMode(R.POINTS):Q.isSprite&&Pe.setMode(R.TRIANGLES);if(Q.isBatchedMesh)Q._multiDrawInstances!==null?Pe.renderMultiDrawInstances(Q._multiDrawStarts,Q._multiDrawCounts,Q._multiDrawCount,Q._multiDrawInstances):Pe.renderMultiDraw(Q._multiDrawStarts,Q._multiDrawCounts,Q._multiDrawCount);else if(Q.isInstancedMesh)Pe.renderInstances(dn,ri,Q.count);else if(rt.isInstancedBufferGeometry){let ce=rt._maxInstanceCount!==void 0?rt._maxInstanceCount:1/0,oc=Math.min(rt.instanceCount,ce);Pe.renderInstances(dn,ri,oc)}else Pe.render(dn,ri)};function Ye(B,q,rt){B.transparent===!0&&B.side===Tr&&B.forceSinglePass===!1?(B.side=ni,B.needsUpdate=!0,Wl(B,q,rt),B.side=hr,B.needsUpdate=!0,Wl(B,q,rt),B.side=Tr):Wl(B,q,rt)}this.compile=function(B,q,rt=null){rt===null&&(rt=B),x=Rt.get(rt),x.init(q),C.push(x),rt.traverseVisible(function(Q){Q.isLight&&Q.layers.test(q.layers)&&(x.pushLight(Q),Q.castShadow&&x.pushShadow(Q))}),B!==rt&&B.traverseVisible(function(Q){Q.isLight&&Q.layers.test(q.layers)&&(x.pushLight(Q),Q.castShadow&&x.pushShadow(Q))}),x.setupLights(v._useLegacyLights);let J=new Set;return B.traverse(function(Q){let Pt=Q.material;if(Pt)if(Array.isArray(Pt))for(let Ht=0;Ht{function Pt(){if(J.forEach(function(Ht){Gt.get(Ht).currentProgram.isReady()&&J.delete(Ht)}),J.size===0){Q(B);return}setTimeout(Pt,10)}ut.get("KHR_parallel_shader_compile")!==null?Pt():setTimeout(Pt,10)})};let tn=null;function Tn(B){tn&&tn(B)}function Re(){zn.stop()}function er(){zn.start()}let zn=new d5;zn.setAnimationLoop(Tn),typeof self<"u"&&zn.setContext(self),this.setAnimationLoop=function(B){tn=B,Ee.setAnimationLoop(B),B===null?zn.stop():zn.start()},Ee.addEventListener("sessionstart",Re),Ee.addEventListener("sessionend",er),this.render=function(B,q){if(q!==void 0&&q.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(_===!0)return;B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),q.parent===null&&q.matrixWorldAutoUpdate===!0&&q.updateMatrixWorld(),Ee.enabled===!0&&Ee.isPresenting===!0&&(Ee.cameraAutoUpdate===!0&&Ee.updateCamera(q),q=Ee.getCamera()),B.isScene===!0&&B.onBeforeRender(v,B,q,S),x=Rt.get(B,C.length),x.init(q),C.push(x),j.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),se.setFromProjectionMatrix(j),L=this.localClippingEnabled,K=kt.init(this.clippingPlanes,L),g=Zt.get(B,p.length),g.init(),p.push(g),bm(B,q,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(Y,$);let rt=Ee.enabled===!1||Ee.isPresenting===!1||Ee.hasDepthSensing()===!1;rt&&wt.addToRenderList(g,B),this.info.render.frame++,K===!0&&kt.beginShadows();let J=x.state.shadowsArray;Ce.render(J,B,q),K===!0&&kt.endShadows(),this.info.autoReset===!0&&this.info.reset();let Q=g.opaque,Pt=g.transmissive;if(x.setupLights(v._useLegacyLights),q.isArrayCamera){let Ht=q.cameras;if(Pt.length>0)for(let Wt=0,ne=Ht.length;Wt0&&Sm(Q,Pt,B,q),rt&&wt.render(B),Am(g,B,q);S!==null&&(zt.updateMultisampleRenderTarget(S),zt.updateRenderTargetMipmap(S)),B.isScene===!0&&B.onAfterRender(v,B,q),ve.resetDefaultState(),w=-1,E=null,C.pop(),C.length>0?(x=C[C.length-1],K===!0&&kt.setGlobalState(v.clippingPlanes,x.state.camera)):x=null,p.pop(),p.length>0?g=p[p.length-1]:g=null};function bm(B,q,rt,J){if(B.visible===!1)return;if(B.layers.test(q.layers)){if(B.isGroup)rt=B.renderOrder;else if(B.isLOD)B.autoUpdate===!0&&B.update(q);else if(B.isLight)x.pushLight(B),B.castShadow&&x.pushShadow(B);else if(B.isSprite){if(!B.frustumCulled||se.intersectsSprite(B)){J&&O.setFromMatrixPosition(B.matrixWorld).applyMatrix4(j);let Ht=ht.update(B),Wt=B.material;Wt.visible&&g.push(B,Ht,Wt,rt,O.z,null)}}else if((B.isMesh||B.isLine||B.isPoints)&&(!B.frustumCulled||se.intersectsObject(B))){let Ht=ht.update(B),Wt=B.material;if(J&&(B.boundingSphere!==void 0?(B.boundingSphere===null&&B.computeBoundingSphere(),O.copy(B.boundingSphere.center)):(Ht.boundingSphere===null&&Ht.computeBoundingSphere(),O.copy(Ht.boundingSphere.center)),O.applyMatrix4(B.matrixWorld).applyMatrix4(j)),Array.isArray(Wt)){let ne=Ht.groups;for(let ae=0,xe=ne.length;ae0&&Gl(Q,q,rt),Pt.length>0&&Gl(Pt,q,rt),Ht.length>0&&Gl(Ht,q,rt),Tt.buffers.depth.setTest(!0),Tt.buffers.depth.setMask(!0),Tt.buffers.color.setMask(!0),Tt.setPolygonOffset(!1)}function Sm(B,q,rt,J){if((rt.isScene===!0?rt.overrideMaterial:null)!==null)return;x.state.transmissionRenderTarget[J.id]===void 0&&(x.state.transmissionRenderTarget[J.id]=new Pr(1,1,{generateMipmaps:!0,type:ut.has("EXT_color_buffer_half_float")||ut.has("EXT_color_buffer_float")?Hu:us,minFilter:$s,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1}));let Pt=x.state.transmissionRenderTarget[J.id],Ht=J.viewport||y;Pt.setSize(Ht.z,Ht.w);let Wt=v.getRenderTarget();v.setRenderTarget(Pt),v.getClearColor(T),z=v.getClearAlpha(),z<1&&v.setClearColor(16777215,.5),v.clear();let ne=v.toneMapping;v.toneMapping=hs;let ae=J.viewport;if(J.viewport!==void 0&&(J.viewport=void 0),x.setupLightsView(J),K===!0&&kt.setGlobalState(v.clippingPlanes,J),Gl(B,rt,J),zt.updateMultisampleRenderTarget(Pt),zt.updateRenderTargetMipmap(Pt),ut.has("WEBGL_multisampled_render_to_texture")===!1){let xe=!1;for(let ye=0,dn=q.length;ye0),ye=!!rt.morphAttributes.position,dn=!!rt.morphAttributes.normal,Fn=!!rt.morphAttributes.color,ri=hs;J.toneMapped&&(S===null||S.isXRRenderTarget===!0)&&(ri=v.toneMapping);let Er=rt.morphAttributes.position||rt.morphAttributes.normal||rt.morphAttributes.color,Pe=Er!==void 0?Er.length:0,ce=Gt.get(J),oc=x.state.lights;if(K===!0&&(L===!0||B!==E)){let pi=B===E&&J.id===w;kt.setState(J,B,pi)}let $e=!1;J.version===ce.__version?(ce.needsLights&&ce.lightsStateVersion!==oc.state.version||ce.outputColorSpace!==Wt||Q.isBatchedMesh&&ce.batching===!1||!Q.isBatchedMesh&&ce.batching===!0||Q.isInstancedMesh&&ce.instancing===!1||!Q.isInstancedMesh&&ce.instancing===!0||Q.isSkinnedMesh&&ce.skinning===!1||!Q.isSkinnedMesh&&ce.skinning===!0||Q.isInstancedMesh&&ce.instancingColor===!0&&Q.instanceColor===null||Q.isInstancedMesh&&ce.instancingColor===!1&&Q.instanceColor!==null||Q.isInstancedMesh&&ce.instancingMorph===!0&&Q.morphTexture===null||Q.isInstancedMesh&&ce.instancingMorph===!1&&Q.morphTexture!==null||ce.envMap!==ne||J.fog===!0&&ce.fog!==Pt||ce.numClippingPlanes!==void 0&&(ce.numClippingPlanes!==kt.numPlanes||ce.numIntersection!==kt.numIntersection)||ce.vertexAlphas!==ae||ce.vertexTangents!==xe||ce.morphTargets!==ye||ce.morphNormals!==dn||ce.morphColors!==Fn||ce.toneMapping!==ri||ce.morphTargetsCount!==Pe)&&($e=!0):($e=!0,ce.__version=J.version);let Ts=ce.currentProgram;$e===!0&&(Ts=Wl(J,q,Q));let Bm=!1,ac=!1,X0=!1,Pn=Ts.getUniforms(),zr=ce.uniforms;if(Tt.useProgram(Ts.program)&&(Bm=!0,ac=!0,X0=!0),J.id!==w&&(w=J.id,ac=!0),Bm||E!==B){Pn.setValue(R,"projectionMatrix",B.projectionMatrix),Pn.setValue(R,"viewMatrix",B.matrixWorldInverse);let pi=Pn.map.cameraPosition;pi!==void 0&&pi.setValue(R,O.setFromMatrixPosition(B.matrixWorld)),Vt.logarithmicDepthBuffer&&Pn.setValue(R,"logDepthBufFC",2/(Math.log(B.far+1)/Math.LN2)),(J.isMeshPhongMaterial||J.isMeshToonMaterial||J.isMeshLambertMaterial||J.isMeshBasicMaterial||J.isMeshStandardMaterial||J.isShaderMaterial)&&Pn.setValue(R,"isOrthographic",B.isOrthographicCamera===!0),E!==B&&(E=B,ac=!0,X0=!0)}if(Q.isSkinnedMesh){Pn.setOptional(R,Q,"bindMatrix"),Pn.setOptional(R,Q,"bindMatrixInverse");let pi=Q.skeleton;pi&&(pi.boneTexture===null&&pi.computeBoneTexture(),Pn.setValue(R,"boneTexture",pi.boneTexture,zt))}Q.isBatchedMesh&&(Pn.setOptional(R,Q,"batchingTexture"),Pn.setValue(R,"batchingTexture",Q._matricesTexture,zt));let Y0=rt.morphAttributes;if((Y0.position!==void 0||Y0.normal!==void 0||Y0.color!==void 0)&&$t.update(Q,rt,Ts),(ac||ce.receiveShadow!==Q.receiveShadow)&&(ce.receiveShadow=Q.receiveShadow,Pn.setValue(R,"receiveShadow",Q.receiveShadow)),J.isMeshGouraudMaterial&&J.envMap!==null&&(zr.envMap.value=ne,zr.flipEnvMap.value=ne.isCubeTexture&&ne.isRenderTargetTexture===!1?-1:1),J.isMeshStandardMaterial&&J.envMap===null&&q.environment!==null&&(zr.envMapIntensity.value=q.environmentIntensity),ac&&(Pn.setValue(R,"toneMappingExposure",v.toneMappingExposure),ce.needsLights&&f_(zr,X0),Pt&&J.fog===!0&>.refreshFogUniforms(zr,Pt),gt.refreshMaterialUniforms(zr,J,it,tt,x.state.transmissionRenderTarget[B.id]),la.upload(R,Mm(ce),zr,zt)),J.isShaderMaterial&&J.uniformsNeedUpdate===!0&&(la.upload(R,Mm(ce),zr,zt),J.uniformsNeedUpdate=!1),J.isSpriteMaterial&&Pn.setValue(R,"center",Q.center),Pn.setValue(R,"modelViewMatrix",Q.modelViewMatrix),Pn.setValue(R,"normalMatrix",Q.normalMatrix),Pn.setValue(R,"modelMatrix",Q.matrixWorld),J.isShaderMaterial||J.isRawShaderMaterial){let pi=J.uniformsGroups;for(let q0=0,p_=pi.length;q00&&zt.useMultisampledRTT(B)===!1?Q=Gt.get(B).__webglMultisampledFramebuffer:Array.isArray(xe)?Q=xe[rt]:Q=xe,y.copy(B.viewport),D.copy(B.scissor),F=B.scissorTest}else y.copy(ct).multiplyScalar(it).floor(),D.copy(_t).multiplyScalar(it).floor(),F=bt;if(Tt.bindFramebuffer(R.FRAMEBUFFER,Q)&&J&&Tt.drawBuffers(B,Q),Tt.viewport(y),Tt.scissor(D),Tt.setScissorTest(F),Pt){let ne=Gt.get(B.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_CUBE_MAP_POSITIVE_X+q,ne.__webglTexture,rt)}else if(Ht){let ne=Gt.get(B.texture),ae=q||0;R.framebufferTextureLayer(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,ne.__webglTexture,rt||0,ae)}w=-1},this.readRenderTargetPixels=function(B,q,rt,J,Q,Pt,Ht){if(!(B&&B.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Wt=Gt.get(B).__webglFramebuffer;if(B.isWebGLCubeRenderTarget&&Ht!==void 0&&(Wt=Wt[Ht]),Wt){Tt.bindFramebuffer(R.FRAMEBUFFER,Wt);try{let ne=B.texture,ae=ne.format,xe=ne.type;if(!Vt.textureFormatReadable(ae)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Vt.textureTypeReadable(xe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q>=0&&q<=B.width-J&&rt>=0&&rt<=B.height-Q&&R.readPixels(q,rt,J,Q,Ut.convert(ae),Ut.convert(xe),Pt)}finally{let ne=S!==null?Gt.get(S).__webglFramebuffer:null;Tt.bindFramebuffer(R.FRAMEBUFFER,ne)}}},this.copyFramebufferToTexture=function(B,q,rt=0){let J=Math.pow(2,-rt),Q=Math.floor(q.image.width*J),Pt=Math.floor(q.image.height*J);zt.setTexture2D(q,0),R.copyTexSubImage2D(R.TEXTURE_2D,rt,0,0,B.x,B.y,Q,Pt),Tt.unbindTexture()},this.copyTextureToTexture=function(B,q,rt,J=0){let Q=q.image.width,Pt=q.image.height,Ht=Ut.convert(rt.format),Wt=Ut.convert(rt.type);zt.setTexture2D(rt,0),R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,rt.flipY),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,rt.premultiplyAlpha),R.pixelStorei(R.UNPACK_ALIGNMENT,rt.unpackAlignment),q.isDataTexture?R.texSubImage2D(R.TEXTURE_2D,J,B.x,B.y,Q,Pt,Ht,Wt,q.image.data):q.isCompressedTexture?R.compressedTexSubImage2D(R.TEXTURE_2D,J,B.x,B.y,q.mipmaps[0].width,q.mipmaps[0].height,Ht,q.mipmaps[0].data):R.texSubImage2D(R.TEXTURE_2D,J,B.x,B.y,Ht,Wt,q.image),J===0&&rt.generateMipmaps&&R.generateMipmap(R.TEXTURE_2D),Tt.unbindTexture()},this.copyTextureToTexture3D=function(B,q,rt,J,Q=0){let Pt=B.max.x-B.min.x,Ht=B.max.y-B.min.y,Wt=B.max.z-B.min.z,ne=Ut.convert(J.format),ae=Ut.convert(J.type),xe;if(J.isData3DTexture)zt.setTexture3D(J,0),xe=R.TEXTURE_3D;else if(J.isDataArrayTexture||J.isCompressedArrayTexture)zt.setTexture2DArray(J,0),xe=R.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,J.flipY),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,J.premultiplyAlpha),R.pixelStorei(R.UNPACK_ALIGNMENT,J.unpackAlignment);let ye=R.getParameter(R.UNPACK_ROW_LENGTH),dn=R.getParameter(R.UNPACK_IMAGE_HEIGHT),Fn=R.getParameter(R.UNPACK_SKIP_PIXELS),ri=R.getParameter(R.UNPACK_SKIP_ROWS),Er=R.getParameter(R.UNPACK_SKIP_IMAGES),Pe=rt.isCompressedTexture?rt.mipmaps[Q]:rt.image;R.pixelStorei(R.UNPACK_ROW_LENGTH,Pe.width),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,Pe.height),R.pixelStorei(R.UNPACK_SKIP_PIXELS,B.min.x),R.pixelStorei(R.UNPACK_SKIP_ROWS,B.min.y),R.pixelStorei(R.UNPACK_SKIP_IMAGES,B.min.z),rt.isDataTexture||rt.isData3DTexture?R.texSubImage3D(xe,Q,q.x,q.y,q.z,Pt,Ht,Wt,ne,ae,Pe.data):J.isCompressedArrayTexture?R.compressedTexSubImage3D(xe,Q,q.x,q.y,q.z,Pt,Ht,Wt,ne,Pe.data):R.texSubImage3D(xe,Q,q.x,q.y,q.z,Pt,Ht,Wt,ne,ae,Pe),R.pixelStorei(R.UNPACK_ROW_LENGTH,ye),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,dn),R.pixelStorei(R.UNPACK_SKIP_PIXELS,Fn),R.pixelStorei(R.UNPACK_SKIP_ROWS,ri),R.pixelStorei(R.UNPACK_SKIP_IMAGES,Er),Q===0&&J.generateMipmaps&&R.generateMipmap(xe),Tt.unbindTexture()},this.initTexture=function(B){B.isCubeTexture?zt.setTextureCube(B,0):B.isData3DTexture?zt.setTexture3D(B,0):B.isDataArrayTexture||B.isCompressedArrayTexture?zt.setTexture2DArray(B,0):zt.setTexture2D(B,0),Tt.unbindTexture()},this.resetState=function(){A=0,b=0,S=null,Tt.reset(),ve.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Fr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===op?"display-p3":"srgb",e.unpackColorSpace=Ve.workingColorSpace===Gu?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}};var Fu=class extends Gi{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Zs,this.environmentIntensity=1,this.environmentRotation=new Zs,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var Ti=class extends Bi{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new ie(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}},Pu=new U,ku=new U,zC=new oe,nl=new fa,cu=new Rr,mx=new U,HC=new U,Ks=class extends Gi{constructor(t=new An,e=new Ti){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(t.index===null){let e=t.attributes.position,n=[0];for(let i=1,s=e.count;i0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;sn)return;mx.applyMatrix4(r.matrixWorld);let c=t.ray.origin.distanceTo(mx);if(!(ct.far))return{distance:c,point:HC.clone().applyMatrix4(r.matrixWorld),index:i,face:null,faceIndex:null,object:r}}var GC=new U,WC=new U,pa=class extends Ks{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(t.index===null){let e=t.attributes.position,n=[];for(let i=0,s=e.count;i0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;si.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:c,index:t,face:null,object:o})}}var Hx=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){let n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){let e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){let e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e=[],n,i=this.getPoint(0),s=0;e.push(0);for(let o=1;o<=t;o++)n=this.getPoint(o/t),s+=n.distanceTo(i),e.push(s),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){let n=this.getLengths(),i=0,s=n.length,o;e?o=e:o=t*n[s-1];let a=0,c=s-1,l;for(;a<=c;)if(i=Math.floor(a+(c-a)/2),l=n[i]-o,l<0)a=i+1;else if(l>0)c=i-1;else{c=i;break}if(i=c,n[i]===o)return i/(s-1);let h=n[i],d=n[i+1]-h,f=(o-h)/d;return(i+f)/(s-1)}getTangent(t,e){let i=t-1e-4,s=t+1e-4;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),c=e||(o.isVector2?new re:new U);return c.copy(a).sub(o).normalize(),c}getTangentAt(t,e){let n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){let n=new U,i=[],s=[],o=[],a=new U,c=new oe;for(let f=0;f<=t;f++){let m=f/t;i[f]=this.getTangentAt(m,new U)}s[0]=new U,o[0]=new U;let l=Number.MAX_VALUE,h=Math.abs(i[0].x),u=Math.abs(i[0].y),d=Math.abs(i[0].z);h<=l&&(l=h,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),d<=l&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=t;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let m=Math.acos(wn(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(c.makeRotationAxis(a,m))}o[f].crossVectors(i[f],s[f])}if(e===!0){let f=Math.acos(wn(s[0].dot(s[t]),-1,1));f/=t,i[0].dot(a.crossVectors(s[0],s[t]))>0&&(f=-f);for(let m=1;m<=t;m++)s[m].applyMatrix4(c.makeRotationAxis(i[m],f*m)),o[m].crossVectors(i[m],s[m])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}},Js=class extends Hx{constructor(t=0,e=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=c}getPoint(t,e=new re){let n=e,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s=s)){let a=e[1];t=s)break t}o=n,n=0;break e}break n}for(;n>>1;te;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let a=0;a!==s;a++){let c=n[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),t=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),t=!1;break}o=c}if(i!==void 0&&sT(i))for(let a=0,c=i.length;a!==c;++a){let l=i[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===jf,s=t.length-1,o=1;for(let a=1;a0){t[o]=t[s];for(let a=s*n,c=o*n,l=0;l!==n;++l)e[c+l]=e[a+l];++o}return o!==t.length?(this.times=t.slice(0,o),this.values=e.slice(0,o*n)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};Hi.prototype.TimeBufferType=Float32Array;Hi.prototype.ValueBufferType=Float32Array;Hi.prototype.DefaultInterpolation=pu;var Qs=class extends Hi{};Qs.prototype.ValueTypeName="bool";Qs.prototype.ValueBufferType=Array;Qs.prototype.DefaultInterpolation=xu;Qs.prototype.InterpolantFactoryMethodLinear=void 0;Qs.prototype.InterpolantFactoryMethodSmooth=void 0;var Xx=class extends Hi{};Xx.prototype.ValueTypeName="color";var Yx=class extends Hi{};Yx.prototype.ValueTypeName="number";var qx=class extends Ca{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(n-e)/(i-e),l=t*a;for(let h=l+a;l!==h;l+=4)Di.slerpFlat(s,0,o,l-a,o,l,c);return s}},pl=class extends Hi{InterpolantFactoryMethodLinear(t){return new qx(this.times,this.values,this.getValueSize(),t)}};pl.prototype.ValueTypeName="quaternion";pl.prototype.DefaultInterpolation=pu;pl.prototype.InterpolantFactoryMethodSmooth=void 0;var to=class extends Hi{};to.prototype.ValueTypeName="string";to.prototype.ValueBufferType=Array;to.prototype.DefaultInterpolation=xu;to.prototype.InterpolantFactoryMethodLinear=void 0;to.prototype.InterpolantFactoryMethodSmooth=void 0;var $x=class extends Hi{};$x.prototype.ValueTypeName="vector";var Ru={enabled:!1,files:{},add:function(r,t){this.enabled!==!1&&(this.files[r]=t)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}},Zx=class{constructor(t,e,n){let i=this,s=!1,o=0,a=0,c,l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(h){a++,s===!1&&i.onStart!==void 0&&i.onStart(h,o,a),s=!0},this.itemEnd=function(h){o++,i.onProgress!==void 0&&i.onProgress(h,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return c?c(h):h},this.setURLModifier=function(h){return c=h,this},this.addHandler=function(h,u){return l.push(h,u),this},this.removeHandler=function(h){let u=l.indexOf(h);return u!==-1&&l.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=l.length;u{class r{constructor(e){this.manager=e!==void 0?e:lp,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,n){let i=this;return new Promise(function(s,o){i.load(e,s,n,o)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}return r.DEFAULT_MATERIAL_NAME="__DEFAULT",r})(),Mr={},Kx=class extends Error{constructor(t,e){super(t),this.response=e}},va=class extends eo{constructor(t){super(t)}load(t,e,n,i){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);let s=Ru.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e&&e(s),this.manager.itemEnd(t)},0),s;if(Mr[t]!==void 0){Mr[t].push({onLoad:e,onProgress:n,onError:i});return}Mr[t]=[],Mr[t].push({onLoad:e,onProgress:n,onError:i});let o=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,c=this.responseType;fetch(o).then(l=>{if(l.status===200||l.status===0){if(l.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||l.body===void 0||l.body.getReader===void 0)return l;let h=Mr[t],u=l.body.getReader(),d=l.headers.get("X-File-Size")||l.headers.get("Content-Length"),f=d?parseInt(d):0,m=f!==0,g=0,x=new ReadableStream({start(p){C();function C(){u.read().then(({done:v,value:_})=>{if(v)p.close();else{g+=_.byteLength;let A=new ProgressEvent("progress",{lengthComputable:m,loaded:g,total:f});for(let b=0,S=h.length;b{switch(c){case"arraybuffer":return l.arrayBuffer();case"blob":return l.blob();case"document":return l.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return l.json();default:if(a===void 0)return l.text();{let u=/charset="?([^;"\s]*)"?/i.exec(a),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return l.arrayBuffer().then(m=>f.decode(m))}}}).then(l=>{Ru.add(t,l);let h=Mr[t];delete Mr[t];for(let u=0,d=h.length;u{let h=Mr[t];if(h===void 0)throw this.manager.itemError(t),l;delete Mr[t];for(let u=0,d=h.length;u{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}};var Jx=class extends eo{constructor(t){super(t)}load(t,e,n,i){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);let s=this,o=Ru.get(t);if(o!==void 0)return s.manager.itemStart(t),setTimeout(function(){e&&e(o),s.manager.itemEnd(t)},0),o;let a=ul("img");function c(){h(),Ru.add(t,this),e&&e(this),s.manager.itemEnd(t)}function l(u){h(),i&&i(u),s.manager.itemError(t),s.manager.itemEnd(t)}function h(){a.removeEventListener("load",c,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",c,!1),a.addEventListener("error",l,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(t),a.src=t,a}};var Iu=class extends eo{constructor(t){super(t)}load(t,e,n,i){let s=new xs,o=new Jx(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(a){s.image=a,s.needsUpdate=!0,e!==void 0&&e(s)},n,i),s}},Qx=class extends Gi{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new ie(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}};var gx=new oe,YC=new U,qC=new U,tp=class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new re(512,512),this.map=null,this.mapPass=null,this.matrix=new oe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new xl,this._frameExtents=new re(1,1),this._viewportCount=1,this._viewports=[new Je(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,n=this.matrix;YC.setFromMatrixPosition(t.matrixWorld),e.position.copy(YC),qC.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(qC),e.updateMatrixWorld(),gx.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(gx),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(gx)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}};var $C=new oe,il=new U,Cx=new U,ep=class extends tp{constructor(){super(new Ln(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new re(4,2),this._viewportCount=6,this._viewports=[new Je(2,1,1,1),new Je(0,1,1,1),new Je(3,1,1,1),new Je(1,1,1,1),new Je(3,0,1,1),new Je(1,0,1,1)],this._cubeDirections=[new U(1,0,0),new U(-1,0,0),new U(0,0,1),new U(0,0,-1),new U(0,1,0),new U(0,-1,0)],this._cubeUps=[new U(0,1,0),new U(0,1,0),new U(0,1,0),new U(0,1,0),new U(0,0,1),new U(0,0,-1)]}updateMatrices(t,e=0){let n=this.camera,i=this.matrix,s=t.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),il.setFromMatrixPosition(t.matrixWorld),n.position.copy(il),Cx.copy(n.position),Cx.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(Cx),n.updateMatrixWorld(),i.makeTranslation(-il.x,-il.y,-il.z),$C.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix($C)}},Ou=class extends Qx{constructor(t,e,n=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new ep}get power(){return this.intensity*4*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}};var Lu=class{static decodeText(t){if(typeof TextDecoder<"u")return new TextDecoder().decode(t);let e="";for(let n=0,i=t.length;n"u"?Date:performance).now()}var hp="\\[\\]\\.:\\/",oT=new RegExp("["+hp+"]","g"),up="[^"+hp+"]",aT="[^"+hp.replace("\\.","")+"]",cT=/((?:WC+[\/:])*)/.source.replace("WC",up),lT=/(WCOD+)?/.source.replace("WCOD",aT),hT=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",up),uT=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",up),dT=new RegExp("^"+cT+lT+hT+uT+"$"),fT=["material","materials","bones","map"],np=class{constructor(t,e,n){let i=n||an.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(t,e)}setValue(t,e){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},an=(()=>{class r{constructor(e,n,i){this.path=n,this.parsedPath=i||r.parseTrackName(n),this.node=r.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,i){return e&&e.isAnimationObjectGroup?new r.Composite(e,n,i):new r(e,n,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(oT,"")}static parseTrackName(e){let n=dT.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let i={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let o=i.nodeName.substring(s+1);fT.indexOf(o)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=o)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){let i=e.skeleton.getBoneByName(n);if(i!==void 0)return i}if(e.children){let i=function(o){for(let a=0;a0&&(o=Math.pow(this.scaleFactor,s*8)),this._v3_1.setFromMatrixPosition(this._gizmoMatrixState),this.applyTransformMatrix(this.scale(o,this._v3_1))}break;case Yt.FOV:if(this.enableZoom&&this.camera.isPerspectiveCamera)if(n)this.dispatchEvent(Fi),this.dispatchEvent(ji),this.updateTbState(e,!0),this._startCursorPosition.setY(this.getCursorNDC(ue.x,ue.y,this.domElement).y*.5),this._currentCursorPosition.copy(this._startCursorPosition),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!1);else{this._currentCursorPosition.setY(this.getCursorNDC(ue.x,ue.y,this.domElement).y*.5);let s=this._currentCursorPosition.y-this._startCursorPosition.y,o=1;s<0?o=1/Math.pow(this.scaleFactor,-s*8):s>0&&(o=Math.pow(this.scaleFactor,s*8)),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);let a=this._v3_1.distanceTo(this._gizmos.position),c=a/o;c=Qe.clamp(c,this.minDistance,this.maxDistance);let l=a*Math.tan(Qe.DEG2RAD*this._fovState*.5),h=Qe.RAD2DEG*(Math.atan(l/c)*2);h=Qe.clamp(h,this.minFov,this.maxFov);let u=l/Math.tan(Qe.DEG2RAD*(h/2));o=a/u,this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),this.setFov(h),this.applyTransformMatrix(this.scale(o,this._v3_2,!1)),gn.copy(this._gizmos.position).sub(this.camera.position).normalize().multiplyScalar(u/a),this._m4_1.makeTranslation(gn.x,gn.y,gn.z)}break}this.dispatchEvent(je)}}onSinglePanEnd(){if(this._state==Yt.ROTATE){if(!this.enableRotate)return;if(this.enableAnimations)if(performance.now()-this._timeCurrent<120){let e=Math.abs((this._wPrev+this._wCurr)/2),n=this;this._animationId=window.requestAnimationFrame(function(i){n.updateTbState(Yt.ANIMATION_ROTATE,!0);let s=n.calculateRotationAxis(n._cursorPosPrev,n._cursorPosCurr);n.onRotationAnim(i,s,Math.min(e,n.wMax))})}else this.updateTbState(Yt.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(je);else this.updateTbState(Yt.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(je)}else(this._state==Yt.PAN||this._state==Yt.IDLE)&&(this.updateTbState(Yt.IDLE,!1),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!1),this.dispatchEvent(je));this.dispatchEvent(Fi)}onDoubleTap(t){if(this.enabled&&this.enablePan&&this.scene!=null){this.dispatchEvent(ji),this.setCenter(t.clientX,t.clientY);let e=this.unprojectOnObj(this.getCursorNDC(ue.x,ue.y,this.domElement),this.camera);if(e!=null&&this.enableAnimations){let n=this;this._animationId!=-1&&window.cancelAnimationFrame(this._animationId),this._timeStart=-1,this._animationId=window.requestAnimationFrame(function(i){n.updateTbState(Yt.ANIMATION_FOCUS,!0),n.onFocusAnim(i,e,n._cameraMatrixState,n._gizmoMatrixState)})}else e!=null&&!this.enableAnimations&&(this.updateTbState(Yt.FOCUS,!0),this.focus(e,this.scaleFactor),this.updateTbState(Yt.IDLE,!1),this.dispatchEvent(je))}this.dispatchEvent(Fi)}onDoublePanStart(){this.enabled&&this.enablePan&&(this.dispatchEvent(ji),this.updateTbState(Yt.PAN,!0),this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2),this._startCursorPosition.copy(this.unprojectOnTbPlane(this.camera,ue.x,ue.y,this.domElement,!0)),this._currentCursorPosition.copy(this._startCursorPosition),this.activateGizmos(!1))}onDoublePanMove(){this.enabled&&this.enablePan&&(this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2),this._state!=Yt.PAN&&(this.updateTbState(Yt.PAN,!0),this._startCursorPosition.copy(this._currentCursorPosition)),this._currentCursorPosition.copy(this.unprojectOnTbPlane(this.camera,ue.x,ue.y,this.domElement,!0)),this.applyTransformMatrix(this.pan(this._startCursorPosition,this._currentCursorPosition,!0)),this.dispatchEvent(je))}onDoublePanEnd(){this.updateTbState(Yt.IDLE,!1),this.dispatchEvent(Fi)}onRotateStart(){this.enabled&&this.enableRotate&&(this.dispatchEvent(ji),this.updateTbState(Yt.ZROTATE,!0),this._startFingerRotation=this.getAngle(this._touchCurrent[1],this._touchCurrent[0])+this.getAngle(this._touchStart[1],this._touchStart[0]),this._currentFingerRotation=this._startFingerRotation,this.camera.getWorldDirection(this._rotationAxis),!this.enablePan&&!this.enableZoom&&this.activateGizmos(!0))}onRotateMove(){if(this.enabled&&this.enableRotate){this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2);let t;this._state!=Yt.ZROTATE&&(this.updateTbState(Yt.ZROTATE,!0),this._startFingerRotation=this._currentFingerRotation),this._currentFingerRotation=this.getAngle(this._touchCurrent[1],this._touchCurrent[0])+this.getAngle(this._touchStart[1],this._touchStart[0]),this.enablePan?(this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),t=this.unprojectOnTbPlane(this.camera,ue.x,ue.y,this.domElement).applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._v3_2)):t=new U().setFromMatrixPosition(this._gizmoMatrixState);let e=Qe.DEG2RAD*(this._startFingerRotation-this._currentFingerRotation);this.applyTransformMatrix(this.zRotate(t,e)),this.dispatchEvent(je)}}onRotateEnd(){this.updateTbState(Yt.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(Fi)}onPinchStart(){this.enabled&&this.enableZoom&&(this.dispatchEvent(ji),this.updateTbState(Yt.SCALE,!0),this._startFingerDistance=this.calculatePointersDistance(this._touchCurrent[0],this._touchCurrent[1]),this._currentFingerDistance=this._startFingerDistance,this.activateGizmos(!1))}onPinchMove(){if(this.enabled&&this.enableZoom){this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2);let t=12;this._state!=Yt.SCALE&&(this._startFingerDistance=this._currentFingerDistance,this.updateTbState(Yt.SCALE,!0)),this._currentFingerDistance=Math.max(this.calculatePointersDistance(this._touchCurrent[0],this._touchCurrent[1]),t*this._devPxRatio);let e=this._currentFingerDistance/this._startFingerDistance,n;this.enablePan?this.camera.isOrthographicCamera?n=this.unprojectOnTbPlane(this.camera,ue.x,ue.y,this.domElement).applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._gizmos.position):this.camera.isPerspectiveCamera&&(n=this.unprojectOnTbPlane(this.camera,ue.x,ue.y,this.domElement).applyQuaternion(this.camera.quaternion).add(this._gizmos.position)):n=this._gizmos.position,this.applyTransformMatrix(this.scale(e,n)),this.dispatchEvent(je)}}onPinchEnd(){this.updateTbState(Yt.IDLE,!1),this.dispatchEvent(Fi)}onTriplePanStart(){if(this.enabled&&this.enableZoom){this.dispatchEvent(ji),this.updateTbState(Yt.SCALE,!0);let t=0,e=0,n=this._touchCurrent.length;for(let i=0;i0&&(o=Math.pow(this.scaleFactor,s*i)),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);let a=this._v3_1.distanceTo(this._gizmos.position),c=a/o;c=Qe.clamp(c,this.minDistance,this.maxDistance);let l=a*Math.tan(Qe.DEG2RAD*this._fovState*.5),h=Qe.RAD2DEG*(Math.atan(l/c)*2);h=Qe.clamp(h,this.minFov,this.maxFov);let u=l/Math.tan(Qe.DEG2RAD*(h/2));o=a/u,this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),this.setFov(h),this.applyTransformMatrix(this.scale(o,this._v3_2,!1)),gn.copy(this._gizmos.position).sub(this.camera.position).normalize().multiplyScalar(u/a),this._m4_1.makeTranslation(gn.x,gn.y,gn.z),this.dispatchEvent(je)}}onTriplePanEnd(){this.updateTbState(Yt.IDLE,!1),this.dispatchEvent(Fi)}setCenter(t,e){ue.x=t,ue.y=e}initializeMouseActions(){this.setMouseAction("PAN",0,"CTRL"),this.setMouseAction("PAN",2),this.setMouseAction("ROTATE",0),this.setMouseAction("ZOOM","WHEEL"),this.setMouseAction("ZOOM",1),this.setMouseAction("FOV","WHEEL","SHIFT"),this.setMouseAction("FOV",1,"SHIFT")}compareMouseAction(t,e){return t.operation==e.operation?t.mouse==e.mouse&&t.key==e.key:!1}setMouseAction(t,e,n=null){let i=["PAN","ROTATE","ZOOM","FOV"],s=[0,1,2,"WHEEL"],o=["CTRL","SHIFT",null],a;if(!i.includes(t)||!s.includes(e)||!o.includes(n)||e=="WHEEL"&&t!="ZOOM"&&t!="FOV")return!1;switch(t){case"PAN":a=Yt.PAN;break;case"ROTATE":a=Yt.ROTATE;break;case"ZOOM":a=Yt.SCALE;break;case"FOV":a=Yt.FOV;break}let c={operation:t,mouse:e,key:n,state:a};for(let l=0;l=1)this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.focus(e,this.scaleFactor),this._timeStart=-1,this.updateTbState(Yt.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(je);else{let a=this.easeOutCubic(o),c=1-a+this.scaleFactor*a;this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.focus(e,c,a),this.dispatchEvent(je);let l=this;this._animationId=window.requestAnimationFrame(function(h){l.onFocusAnim(h,e,n,i.clone())})}}else this._animationId=-1,this._timeStart=-1}onRotationAnim(t,e,n){if(this._timeStart==-1&&(this._anglePrev=0,this._angleCurrent=0,this._timeStart=t),this._state==Yt.ANIMATION_ROTATE){let i=(t-this._timeStart)/1e3;if(n+-this.dampingFactor*i>0){this._angleCurrent=.5*-this.dampingFactor*Math.pow(i,2)+n*i+0,this.applyTransformMatrix(this.rotate(e,this._angleCurrent)),this.dispatchEvent(je);let o=this;this._animationId=window.requestAnimationFrame(function(a){o.onRotationAnim(a,e,n)})}else this._animationId=-1,this._timeStart=-1,this.updateTbState(Yt.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(je)}else this._animationId=-1,this._timeStart=-1,this._state!=Yt.ROTATE&&(this.activateGizmos(!1),this.dispatchEvent(je))}pan(t,e,n=!1){let i=t.clone().sub(e);if(this.camera.isOrthographicCamera)i.multiplyScalar(1/this.camera.zoom);else if(this.camera.isPerspectiveCamera&&n){this._v3_1.setFromMatrixPosition(this._cameraMatrixState0),this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0);let s=this._v3_1.distanceTo(this._v3_2)/this.camera.position.distanceTo(this._gizmos.position);i.multiplyScalar(1/s)}return this._v3_1.set(i.x,i.y,0).applyQuaternion(this.camera.quaternion),this._m4_1.makeTranslation(this._v3_1.x,this._v3_1.y,this._v3_1.z),this.setTransformationMatrices(this._m4_1,this._m4_1),ui}reset(){this.camera.zoom=this._zoom0,this.camera.isPerspectiveCamera&&(this.camera.fov=this._fov0),this.camera.near=this._nearPos,this.camera.far=this._farPos,this._cameraMatrixState.copy(this._cameraMatrixState0),this._cameraMatrixState.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.up.copy(this._up0),this.camera.updateMatrix(),this.camera.updateProjectionMatrix(),this._gizmoMatrixState.copy(this._gizmoMatrixState0),this._gizmoMatrixState0.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this._gizmos.updateMatrix(),this._tbRadius=this.calculateTbRadius(this.camera),this.makeGizmos(this._gizmos.position,this._tbRadius),this.camera.lookAt(this._gizmos.position),this.updateTbState(Yt.IDLE,!1),this.dispatchEvent(je)}rotate(t,e){let n=this._gizmos.position;return this._translationMatrix.makeTranslation(-n.x,-n.y,-n.z),this._rotationMatrix.makeRotationAxis(t,-e),this._m4_1.makeTranslation(n.x,n.y,n.z),this._m4_1.multiply(this._rotationMatrix),this._m4_1.multiply(this._translationMatrix),this.setTransformationMatrices(this._m4_1),ui}copyState(){let t;this.camera.isOrthographicCamera?t=JSON.stringify({arcballState:{cameraFar:this.camera.far,cameraMatrix:this.camera.matrix,cameraNear:this.camera.near,cameraUp:this.camera.up,cameraZoom:this.camera.zoom,gizmoMatrix:this._gizmos.matrix}}):this.camera.isPerspectiveCamera&&(t=JSON.stringify({arcballState:{cameraFar:this.camera.far,cameraFov:this.camera.fov,cameraMatrix:this.camera.matrix,cameraNear:this.camera.near,cameraUp:this.camera.up,cameraZoom:this.camera.zoom,gizmoMatrix:this._gizmos.matrix}})),navigator.clipboard.writeText(t)}pasteState(){let t=this;navigator.clipboard.readText().then(function(n){t.setStateFromJSON(n)})}saveState(){this._cameraMatrixState0.copy(this.camera.matrix),this._gizmoMatrixState0.copy(this._gizmos.matrix),this._nearPos=this.camera.near,this._farPos=this.camera.far,this._zoom0=this.camera.zoom,this._up0.copy(this.camera.up),this.camera.isPerspectiveCamera&&(this._fov0=this.camera.fov)}scale(t,e,n=!0){Wi.copy(e);let i=1/t;if(this.camera.isOrthographicCamera){this.camera.zoom=this._zoomState,this.camera.zoom*=t,this.camera.zoom>this.maxZoom?(this.camera.zoom=this.maxZoom,i=this._zoomState/this.maxZoom):this.camera.zoomthis.maxDistance&&(i=this.maxDistance/s,o=s-s*i),gn.copy(Wi).sub(this._v3_1).normalize().multiplyScalar(o),this._m4_1.makeTranslation(gn.x,gn.y,gn.z),n){let c=this._v3_2;s=c.distanceTo(Wi),o=s-s*i,gn.copy(Wi).sub(this._v3_2).normalize().multiplyScalar(o),this._translationMatrix.makeTranslation(c.x,c.y,c.z),this._scaleMatrix.makeScale(i,i,i),this._m4_2.makeTranslation(gn.x,gn.y,gn.z).multiply(this._translationMatrix),this._m4_2.multiply(this._scaleMatrix),this._translationMatrix.makeTranslation(-c.x,-c.y,-c.z),this._m4_2.multiply(this._translationMatrix),this.setTransformationMatrices(this._m4_1,this._m4_2)}else this.setTransformationMatrices(this._m4_1);return ui}}setFov(t){this.camera.isPerspectiveCamera&&(this.camera.fov=Qe.clamp(t,this.minFov,this.maxFov),this.camera.updateProjectionMatrix())}setTransformationMatrices(t=null,e=null){t!=null?ui.camera!=null?ui.camera.copy(t):ui.camera=t.clone():ui.camera=null,e!=null?ui.gizmos!=null?ui.gizmos.copy(e):ui.gizmos=e.clone():ui.gizmos=null}zRotate(t,e){return this._rotationMatrix.makeRotationAxis(this._rotationAxis,e),this._translationMatrix.makeTranslation(-t.x,-t.y,-t.z),this._m4_1.makeTranslation(t.x,t.y,t.z),this._m4_1.multiply(this._rotationMatrix),this._m4_1.multiply(this._translationMatrix),this._v3_1.setFromMatrixPosition(this._gizmoMatrixState).sub(t),this._v3_2.copy(this._v3_1).applyAxisAngle(this._rotationAxis,e),this._v3_2.sub(this._v3_1),this._m4_2.makeTranslation(this._v3_2.x,this._v3_2.y,this._v3_2.z),this.setTransformationMatrices(this._m4_1,this._m4_2),ui}getRaycaster(){return gT}unprojectOnObj(t,e){let n=this.getRaycaster();n.near=e.near,n.far=e.far,n.setFromCamera(t,e);let i=n.intersectObjects(this.scene.children,!0);for(let s=0;s=0&&(this._v2_1.setX((-m-Math.sqrt(x))/(2*f)),this._v2_1.setY(u*this._v2_1.x+d),Qe.RAD2DEG*this._v2_1.angle()>=45)){let v=Math.sqrt(Math.pow(this._v2_1.x,2)+Math.pow(a-this._v2_1.y,2));return o.multiplyScalar(v),o.z+=a,o}f=u,m=d,g=-c*.5,x=Math.pow(m,2)-4*f*g,this._v2_1.setX((-m-Math.sqrt(x))/(2*f)),this._v2_1.setY(u*this._v2_1.x+d);let p=Math.sqrt(Math.pow(this._v2_1.x,2)+Math.pow(a-this._v2_1.y,2));return o.multiplyScalar(p),o.z+=a,o}}unprojectOnTbPlane(t,e,n,i,s=!1){if(t.type=="OrthographicCamera")return this._v2_1.copy(this.getCursorPosition(e,n,i)),this._v3_1.set(this._v2_1.x,this._v2_1.y,0),this._v3_1.clone();if(t.type=="PerspectiveCamera"){this._v2_1.copy(this.getCursorNDC(e,n,i)),this._v3_1.set(this._v2_1.x,this._v2_1.y,-1),this._v3_1.applyMatrix4(t.projectionMatrixInverse);let o=this._v3_1.clone().normalize(),a=this._v3_1.z,c=Math.sqrt(Math.pow(this._v3_1.x,2)+Math.pow(this._v3_1.y,2)),l;if(s?l=this._v3_1.setFromMatrixPosition(this._cameraMatrixState0).distanceTo(this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0)):l=t.position.distanceTo(this._gizmos.position),c==0)return o.set(0,0,0),o;let h=a/c,u=l,d=-u/h,f=Math.sqrt(Math.pow(u,2)+Math.pow(d,2));return o.multiplyScalar(f),o.z=0,o}}updateMatrixState(){this._cameraMatrixState.copy(this.camera.matrix),this._gizmoMatrixState.copy(this._gizmos.matrix),this.camera.isOrthographicCamera?(this._cameraProjectionState.copy(this.camera.projectionMatrix),this.camera.updateProjectionMatrix(),this._zoomState=this.camera.zoom):this.camera.isPerspectiveCamera&&(this._fovState=this.camera.fov)}updateTbState(t,e){this._state=t,e&&this.updateMatrixState()}update(){if(this.target.equals(this._currentTarget)===!1&&(this._gizmos.position.copy(this.target),this._tbRadius=this.calculateTbRadius(this.camera),this.makeGizmos(this.target,this._tbRadius),this._currentTarget.copy(this.target)),this.camera.isOrthographicCamera){if(this.camera.zoom>this.maxZoom||this.camera.zoomthis.maxDistance+1e-6||ethis.maxFov)&&(this.camera.fov=Qe.clamp(this.camera.fov,this.minFov,this.maxFov),this.camera.updateProjectionMatrix());let n=this._tbRadius;if(this._tbRadius=this.calculateTbRadius(this.camera),nthis._tbRadius+1e-6){let i=(this._gizmos.scale.x+this._gizmos.scale.y+this._gizmos.scale.z)/3,s=this._tbRadius/i,a=new Js(0,0,s,s).getPoints(this._curvePts),c=new An().setFromPoints(a);for(let l in this._gizmos.children)this._gizmos.children[l].geometry=c}}this.camera.lookAt(this._gizmos.position)}setStateFromJSON(t){let e=JSON.parse(t);if(e.arcballState!=null){this._cameraMatrixState.fromArray(e.arcballState.cameraMatrix.elements),this._cameraMatrixState.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.up.copy(e.arcballState.cameraUp),this.camera.near=e.arcballState.cameraNear,this.camera.far=e.arcballState.cameraFar,this.camera.zoom=e.arcballState.cameraZoom,this.camera.isPerspectiveCamera&&(this.camera.fov=e.arcballState.cameraFov),this._gizmoMatrixState.fromArray(e.arcballState.gizmoMatrix.elements),this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.camera.updateMatrix(),this.camera.updateProjectionMatrix(),this._gizmos.updateMatrix(),this._tbRadius=this.calculateTbRadius(this.camera);let n=new oe().copy(this._gizmoMatrixState0);this.makeGizmos(this._gizmos.position,this._tbRadius),this._gizmoMatrixState0.copy(n),this.camera.lookAt(this._gizmos.position),this.updateTbState(Yt.IDLE,!1),this.dispatchEvent(je)}}};function CT(){let r=(this._gizmos.scale.x+this._gizmos.scale.y+this._gizmos.scale.z)/3;this._tbRadius=this.calculateTbRadius(this.camera);let t=this._tbRadius/r,n=new Js(0,0,t,t).getPoints(this._curvePts),i=new An().setFromPoints(n);for(let s in this._gizmos.children)this._gizmos.children[s].geometry=i;this.dispatchEvent(je)}function vT(r){if(this.enabled){for(let t=0;t=this._switchSensibility){this._input=Ie.ONE_FINGER,this.updateTouchEvent(r),this.onSinglePanStart(r,"ROTATE");break}break;case Ie.TWO_FINGER:this.updateTouchEvent(r),this.onRotateMove(),this.onPinchMove(),this.onDoublePanMove();break;case Ie.MULT_FINGER:this.updateTouchEvent(r),this.onTriplePanMove(r);break}else if(r.pointerType!="touch"&&this._input==Ie.CURSOR){let t=null;r.ctrlKey||r.metaKey?t="CTRL":r.shiftKey&&(t="SHIFT");let e=this.getOpStateFromAction(this._button,t);e!=null&&this.onSinglePanMove(r,e)}this._downValid&&this.calculatePointersDistance(this._downEvents[this._downEvents.length-1],r)*this._devPxRatio>this._movementThreshold&&(this._downValid=!1)}function bT(r){if(r.pointerType=="touch"&&this._input!=Ie.CURSOR){let t=this._touchCurrent.length;for(let e=0;e0?s=1/this.scaleFactor:i<0&&(s=this.scaleFactor),e){case"ZOOM":if(this.updateTbState(Yt.SCALE,!0),i>0?s=1/Math.pow(this.scaleFactor,i):i<0&&(s=Math.pow(this.scaleFactor,-i)),this.cursorZoom&&this.enablePan){let o;this.camera.isOrthographicCamera?o=this.unprojectOnTbPlane(this.camera,r.clientX,r.clientY,this.domElement).applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._gizmos.position):this.camera.isPerspectiveCamera&&(o=this.unprojectOnTbPlane(this.camera,r.clientX,r.clientY,this.domElement).applyQuaternion(this.camera.quaternion).add(this._gizmos.position)),this.applyTransformMatrix(this.scale(s,o))}else this.applyTransformMatrix(this.scale(s,this._gizmos.position));this._grid!=null&&(this.disposeGrid(),this.drawGrid()),this.updateTbState(Yt.IDLE,!1),this.dispatchEvent(je),this.dispatchEvent(Fi);break;case"FOV":if(this.camera.isPerspectiveCamera){this.updateTbState(Yt.FOV,!0),r.deltaX!=0&&(i=r.deltaX/n,s=1,i>0?s=1/Math.pow(this.scaleFactor,i):i<0&&(s=Math.pow(this.scaleFactor,-i))),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);let o=this._v3_1.distanceTo(this._gizmos.position),a=o/s;a=Qe.clamp(a,this.minDistance,this.maxDistance);let c=o*Math.tan(Qe.DEG2RAD*this.camera.fov*.5),l=Qe.RAD2DEG*(Math.atan(c/a)*2);l>this.maxFov?l=this.maxFov:l=0?l.substring(0,h):l;u=u.toLowerCase();let d=h>=0?l.substring(h+1):"";if(d=d.trim(),u==="newmtl")i={name:d},o[d]=i;else if(u==="ka"||u==="kd"||u==="ks"||u==="ke"){let f=d.split(s,3);i[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else i[u]=d}let a=new dp(this.resourcePath||e,this.materialOptions);return a.setCrossOrigin(this.crossOrigin),a.setManager(this.manager),a.setMaterials(o),a}},dp=class{constructor(t="",e={}){this.baseUrl=t,this.options=e,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:hr,this.wrap=this.options.wrap!==void 0?this.options.wrap:cl}setCrossOrigin(t){return this.crossOrigin=t,this}setManager(t){this.manager=t}setMaterials(t){this.materialsInfo=this.convert(t),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(t){if(!this.options)return t;let e={};for(let n in t){let i=t[n],s={};e[n]=s;for(let o in i){let a=!0,c=i[o],l=o.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(c=[c[0]/255,c[1]/255,c[2]/255]),this.options&&this.options.ignoreZeroRGBs&&c[0]===0&&c[1]===0&&c[2]===0&&(a=!1);break;default:break}a&&(s[l]=c)}}return e}preload(){for(let t in this.materialsInfo)this.create(t)}getIndex(t){return this.nameLookup[t]}getAsArray(){let t=0;for(let e in this.materialsInfo)this.materialsArray[t]=this.create(e),this.nameLookup[e]=t,t++;return this.materialsArray}create(t){return this.materials[t]===void 0&&this.createMaterial_(t),this.materials[t]}createMaterial_(t){let e=this,n=this.materialsInfo[t],i={name:t,side:this.side};function s(a,c){return typeof c!="string"||c===""?"":/^https?:\/\//i.test(c)?c:a+c}function o(a,c){if(i[a])return;let l=e.getTextureParams(c,i),h=e.loadTexture(s(e.baseUrl,l.url));h.repeat.copy(l.scale),h.offset.copy(l.offset),h.wrapS=e.wrap,h.wrapT=e.wrap,(a==="map"||a==="emissiveMap")&&(h.colorSpace=Si),i[a]=h}for(let a in n){let c=n[a],l;if(c!=="")switch(a.toLowerCase()){case"kd":i.color=new ie().fromArray(c).convertSRGBToLinear();break;case"ks":i.specular=new ie().fromArray(c).convertSRGBToLinear();break;case"ke":i.emissive=new ie().fromArray(c).convertSRGBToLinear();break;case"map_kd":o("map",c);break;case"map_ks":o("specularMap",c);break;case"map_ke":o("emissiveMap",c);break;case"norm":o("normalMap",c);break;case"map_bump":case"bump":o("bumpMap",c);break;case"map_d":o("alphaMap",c),i.transparent=!0;break;case"ns":i.shininess=parseFloat(c);break;case"d":l=parseFloat(c),l<1&&(i.opacity=l,i.transparent=!0);break;case"tr":l=parseFloat(c),this.options&&this.options.invertTrProperty&&(l=1-l),l>0&&(i.opacity=1-l,i.transparent=!0);break;default:break}}return this.materials[t]=new ga(i),this.materials[t]}getTextureParams(t,e){let n={scale:new re(1,1),offset:new re(0,0)},i=t.split(/\s+/),s;return s=i.indexOf("-bm"),s>=0&&(e.bumpScale=parseFloat(i[s+1]),i.splice(s,2)),s=i.indexOf("-s"),s>=0&&(n.scale.set(parseFloat(i[s+1]),parseFloat(i[s+2])),i.splice(s,4)),s=i.indexOf("-o"),s>=0&&(n.offset.set(parseFloat(i[s+1]),parseFloat(i[s+2])),i.splice(s,4)),n.url=i.join(" ").trim(),n}loadTexture(t,e,n,i,s){let o=this.manager!==void 0?this.manager:lp,a=o.getHandler(t);a===null&&(a=new Iu(o)),a.setCrossOrigin&&a.setCrossOrigin(this.crossOrigin);let c=a.load(t,n,i,s);return e!==void 0&&(c.mapping=e),c}};var ST=/^[og]\s*(.+)?/,wT=/^mtllib /,MT=/^usemtl /,DT=/^usemap /,y5=/\s+/,b5=new U,fp=new U,A5=new U,S5=new U,Pi=new U,$u=new ie;function BT(){let r={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=e!==!1;return}let n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:e!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(i,s){let o=this._finalize(!1);o&&(o.inherited||o.groupCount<=0)&&this.materials.splice(o.index,1);let a={index:this.materials.length,name:i||"",mtllib:Array.isArray(s)&&s.length>0?s[s.length-1]:"",smooth:o!==void 0?o.smooth:this.smooth,groupStart:o!==void 0?o.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(c){let l={index:typeof c=="number"?c:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return l.clone=this.clone.bind(l),l}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){let s=this.currentMaterial();if(s&&s.groupEnd===-1&&(s.groupEnd=this.geometry.vertices.length/3,s.groupCount=s.groupEnd-s.groupStart,s.inherited=!1),i&&this.materials.length>1)for(let o=this.materials.length-1;o>=0;o--)this.materials[o].groupCount<=0&&this.materials.splice(o,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),s}},n&&n.name&&typeof n.clone=="function"){let i=n.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(t,e){let n=parseInt(t,10);return(n>=0?n-1:n+e/3)*3},parseNormalIndex:function(t,e){let n=parseInt(t,10);return(n>=0?n-1:n+e/3)*3},parseUVIndex:function(t,e){let n=parseInt(t,10);return(n>=0?n-1:n+e/2)*2},addVertex:function(t,e,n){let i=this.vertices,s=this.object.geometry.vertices;s.push(i[t+0],i[t+1],i[t+2]),s.push(i[e+0],i[e+1],i[e+2]),s.push(i[n+0],i[n+1],i[n+2])},addVertexPoint:function(t){let e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){let e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,n){let i=this.normals,s=this.object.geometry.normals;s.push(i[t+0],i[t+1],i[t+2]),s.push(i[e+0],i[e+1],i[e+2]),s.push(i[n+0],i[n+1],i[n+2])},addFaceNormal:function(t,e,n){let i=this.vertices,s=this.object.geometry.normals;b5.fromArray(i,t),fp.fromArray(i,e),A5.fromArray(i,n),Pi.subVectors(A5,fp),S5.subVectors(b5,fp),Pi.cross(S5),Pi.normalize(),s.push(Pi.x,Pi.y,Pi.z),s.push(Pi.x,Pi.y,Pi.z),s.push(Pi.x,Pi.y,Pi.z)},addColor:function(t,e,n){let i=this.colors,s=this.object.geometry.colors;i[t]!==void 0&&s.push(i[t+0],i[t+1],i[t+2]),i[e]!==void 0&&s.push(i[e+0],i[e+1],i[e+2]),i[n]!==void 0&&s.push(i[n+0],i[n+1],i[n+2])},addUV:function(t,e,n){let i=this.uvs,s=this.object.geometry.uvs;s.push(i[t+0],i[t+1]),s.push(i[e+0],i[e+1]),s.push(i[n+0],i[n+1])},addDefaultUV:function(){let t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){let e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,n,i,s,o,a,c,l){let h=this.vertices.length,u=this.parseVertexIndex(t,h),d=this.parseVertexIndex(e,h),f=this.parseVertexIndex(n,h);if(this.addVertex(u,d,f),this.addColor(u,d,f),a!==void 0&&a!==""){let m=this.normals.length;u=this.parseNormalIndex(a,m),d=this.parseNormalIndex(c,m),f=this.parseNormalIndex(l,m),this.addNormal(u,d,f)}else this.addFaceNormal(u,d,f);if(i!==void 0&&i!==""){let m=this.uvs.length;u=this.parseUVIndex(i,m),d=this.parseUVIndex(s,m),f=this.parseUVIndex(o,m),this.addUV(u,d,f),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";let e=this.vertices.length;for(let n=0,i=t.length;n=7?($u.setRGB(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6])).convertSRGBToLinear(),e.colors.push($u.r,$u.g,$u.b)):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":e.uvs.push(parseFloat(u[1]),parseFloat(u[2]));break}}else if(h==="f"){let d=l.slice(1).trim().split(y5),f=[];for(let g=0,x=d.length;g0){let C=p.split("/");f.push(C)}}let m=f[0];for(let g=1,x=f.length-1;g1){let d=i[1].trim().toLowerCase();e.object.smooth=d!=="0"&&d!=="off"}else e.object.smooth=!0;let u=e.object.currentMaterial();u&&(u.smooth=e.object.smooth)}else{if(l==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+l+'"')}}e.finalize();let s=new lr;if(s.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let a=0,c=e.objects.length;a0&&g.setAttribute("normal",new mn(h.normals,3)),h.colors.length>0&&(m=!0,g.setAttribute("color",new mn(h.colors,3))),h.hasUVIndices===!0&&g.setAttribute("uv",new mn(h.uvs,2));let x=[];for(let C=0,v=u.length;C1){for(let C=0,v=u.length;C0){let a=new ds({size:1,sizeAttenuation:!1}),c=new An;c.setAttribute("position",new mn(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(c.setAttribute("color",new mn(e.colors,3)),a.vertexColors=!0);let l=new ma(c,a);s.add(l)}return s}};function w5(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),e.push.apply(e,n)}return e}function G(r){for(var t=1;t=0||(h[c]=o[c]);return h}(r,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(r,e)&&(i[e]=r[e])}return i}function vr(r,t){return t||(t=r.slice(0)),Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(t)}}))}function iv(r){var t=function(e,n){if(typeof e!="object"||e===null)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var s=i.call(e,n||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(r,"string");return typeof t=="symbol"?t:String(t)}var r0=class{constructor(){W(this,"browserShadowBlurConstant",1),W(this,"DPI",96),W(this,"devicePixelRatio",typeof window<"u"?window.devicePixelRatio:1),W(this,"perfLimitSizeTotal",2097152),W(this,"maxCacheSideLimit",4096),W(this,"minCacheSideLimit",256),W(this,"disableStyleCopyPaste",!1),W(this,"enableGLFiltering",!0),W(this,"textureSize",4096),W(this,"forceGLPutImageData",!1),W(this,"cachesBoundsOfCurve",!0),W(this,"fontPaths",{}),W(this,"NUM_FRACTION_DIGITS",4)}},Me=new class extends r0{constructor(r){super(),this.configure(r)}configure(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Object.assign(this,r)}addFonts(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fontPaths=G(G({},this.fontPaths),r)}removeFonts(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>{delete this.fontPaths[r]})}clearFonts(){this.fontPaths={}}restoreDefaults(r){let t=new r0,e=r?.reduce((n,i)=>(n[i]=t[i],n),{})||t;this.configure(e)}},As=function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;nthis.testPrecision(e,n)),e.getExtension("WEBGL_lose_context").loseContext(),As("log","WebGL: max texture size ".concat(this.maxTextureSize)))}isSupported(t){return!!this.maxTextureSize&&this.maxTextureSize>=t}},TT={},M5;var gr=()=>M5||(M5={document,window,isTouchSupported:"ontouchstart"in window||"ontouchstart"in document||window&&window.navigator&&window.navigator.maxTouchPoints>0,WebGLProbe:new Mp,dispose(){},copyPasteData:TT}),Ja=()=>gr().document,B0=()=>gr().window,rv=()=>{var r;return Math.max((r=Me.devicePixelRatio)!==null&&r!==void 0?r:B0().devicePixelRatio,1)},El=new class{constructor(){W(this,"charWidthsCache",{}),W(this,"boundsOfCurveCache",{})}getFontCache(r){let{fontFamily:t,fontStyle:e,fontWeight:n}=r;t=t.toLowerCase(),this.charWidthsCache[t]||(this.charWidthsCache[t]={});let i=this.charWidthsCache[t],s="".concat(e.toLowerCase(),"_").concat((n+"").toLowerCase());return i[s]||(i[s]={}),i[s]}clearFontCache(r){(r=(r||"").toLowerCase())?this.charWidthsCache[r]&&delete this.charWidthsCache[r]:this.charWidthsCache={}}limitDimsByArea(r){let{perfLimitSizeTotal:t}=Me,e=Math.sqrt(t*r);return[Math.floor(e),Math.floor(t/e)]}},Dp="6.0.0-rc1";function oo(){}var Ss=Math.PI/2,Nr=2*Math.PI,rm=Math.PI/180,$n=Object.freeze([1,0,0,1,0,0]),sm=16,ps=.4477152502,_e="center",Fe="left",Vn="top",Bp="bottom",cn="right",ii="none",om=/\r?\n/,gl="json",xp="svg",It=new class{constructor(){this[gl]=new Map,this[xp]=new Map}getClass(r){let t=this[gl].get(r);if(!t)throw new Oi("No class registered for ".concat(r));return t}setClass(r,t){t?this[gl].set(t,r):(this[gl].set(r.type,r),this[gl].set(r.type.toLowerCase(),r))}getSVGClass(r){return this[xp].get(r)}setSVGClass(r,t){this[xp].set(t??r.type.toLowerCase(),r)}},o0=new class extends Array{remove(r){let t=this.indexOf(r);t>-1&&this.splice(t,1)}cancelAll(){let r=this.splice(0);return r.forEach(t=>t.abort()),r}cancelByCanvas(r){if(!r)return[];let t=this.filter(e=>{var n;return e.target===r||typeof e.target=="object"&&((n=e.target)===null||n===void 0?void 0:n.canvas)===r});return t.forEach(e=>e.abort()),t}cancelByTarget(r){if(!r)return[];let t=this.filter(e=>e.target===r);return t.forEach(e=>e.abort()),t}},Tp=class{constructor(){W(this,"__eventListeners",{})}on(t,e){if(this.__eventListeners||(this.__eventListeners={}),typeof t=="object")return Object.entries(t).forEach(n=>{let[i,s]=n;this.on(i,s)}),()=>this.off(t);if(e){let n=t;return this.__eventListeners[n]||(this.__eventListeners[n]=[]),this.__eventListeners[n].push(e),()=>this.off(n,e)}return()=>!1}once(t,e){if(typeof t=="object"){let n=[];return Object.entries(t).forEach(i=>{let[s,o]=i;n.push(this.once(s,o))}),()=>n.forEach(i=>i())}if(e){let n=this.on(t,function(){for(var i=arguments.length,s=new Array(i),o=0;o!1}_removeEventListener(t,e){if(this.__eventListeners[t])if(e){let n=this.__eventListeners[t],i=n.indexOf(e);i>-1&&n.splice(i,1)}else this.__eventListeners[t]=[]}off(t,e){if(this.__eventListeners)if(t===void 0)for(let n in this.__eventListeners)this._removeEventListener(n);else typeof t=="object"?Object.entries(t).forEach(n=>{let[i,s]=n;this._removeEventListener(i,s)}):this._removeEventListener(t,e)}fire(t,e){var n;if(!this.__eventListeners)return;let i=(n=this.__eventListeners[t])===null||n===void 0?void 0:n.concat();if(i)for(let s=0;sMath.floor(Math.random()*(t-r+1))+r,ba=(r,t)=>isNaN(r)&&typeof t=="number"?t:r,io=(r,t)=>{let e=r.indexOf(t);return e!==-1&&r.splice(e,1),r},Zi=r=>{if(r===0)return 1;switch(Math.abs(r)/Ss){case 1:case 3:return 0;case 2:return-1}return Math.cos(r)},Ki=r=>{if(r===0)return 0;let t=r/Ss,e=Math.sign(r);switch(t){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(r)},nt=class r{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;typeof t=="object"?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e)}add(t){return new r(this.x+t.x,this.y+t.y)}addEquals(t){return this.x+=t.x,this.y+=t.y,this}scalarAdd(t){return new r(this.x+t,this.y+t)}scalarAddEquals(t){return this.x+=t,this.y+=t,this}subtract(t){return new r(this.x-t.x,this.y-t.y)}subtractEquals(t){return this.x-=t.x,this.y-=t.y,this}scalarSubtract(t){return new r(this.x-t,this.y-t)}scalarSubtractEquals(t){return this.x-=t,this.y-=t,this}multiply(t){return new r(this.x*t.x,this.y*t.y)}scalarMultiply(t){return new r(this.x*t,this.y*t)}scalarMultiplyEquals(t){return this.x*=t,this.y*=t,this}divide(t){return new r(this.x/t.x,this.y/t.y)}scalarDivide(t){return new r(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&&arguments[1]!==void 0?arguments[1]:.5;return e=Math.max(Math.min(1,e),0),new r(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)}distanceFrom(t){let e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}midPointFrom(t){return this.lerp(t)}min(t){return new r(Math.min(this.x,t.x),Math.min(this.y,t.y))}max(t){return new r(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,n=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=n}clone(){return new r(this.x,this.y)}rotate(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:am,n=Ki(t),i=Zi(t),s=this.subtract(e);return new r(s.x*i-s.y*n,s.x*n+s.y*i).add(e)}transform(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return new r(t[0]*this.x+t[2]*this.y+(e?0:t[4]),t[1]*this.x+t[3]*this.y+(e?0:t[5]))}},am=new nt(0,0),i0=r=>!!r&&Array.isArray(r._objects);function sv(r){class t extends r{constructor(){super(...arguments),W(this,"_objects",[])}_onObjectAdded(n){}_onObjectRemoved(n){}_onStackOrderChanged(n){}add(){for(var n=arguments.length,i=new Array(n),s=0;sthis._onObjectAdded(a)),o}insertAt(n){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;othis._onObjectAdded(a)),this._objects.length}remove(){let n=this._objects,i=[];for(var s=arguments.length,o=new Array(s),a=0;a{let l=n.indexOf(c);l!==-1&&(n.splice(l,1),i.push(c),this._onObjectRemoved(c))}),i}forEachObject(n){this.getObjects().forEach((i,s,o)=>n(i,s,o))}getObjects(){for(var n=arguments.length,i=new Array(n),s=0;so.isType(...i))}item(n){return this._objects[n]}isEmpty(){return this._objects.length===0}size(){return this._objects.length}contains(n,i){return!!this._objects.includes(n)||!!i&&this._objects.some(s=>s instanceof t&&s.contains(n,!0))}complexity(){return this._objects.reduce((n,i)=>n+=i.complexity?i.complexity():0,0)}sendObjectToBack(n){return!(!n||n===this._objects[0])&&(io(this._objects,n),this._objects.unshift(n),this._onStackOrderChanged(n),!0)}bringObjectToFront(n){return!(!n||n===this._objects[this._objects.length-1])&&(io(this._objects,n),this._objects.push(n),this._onStackOrderChanged(n),!0)}sendObjectBackwards(n,i){if(!n)return!1;let s=this._objects.indexOf(n);if(s!==0){let o=this.findNewLowerIndex(n,s,i);return io(this._objects,n),this._objects.splice(o,0,n),this._onStackOrderChanged(n),!0}return!1}bringObjectForward(n,i){if(!n)return!1;let s=this._objects.indexOf(n);if(s!==this._objects.length-1){let o=this.findNewUpperIndex(n,s,i);return io(this._objects,n),this._objects.splice(o,0,n),this._onStackOrderChanged(n),!0}return!1}moveObjectTo(n,i){return n!==this._objects[i]&&(io(this._objects,n),this._objects.splice(i,0,n),this._onStackOrderChanged(n),!0)}findNewLowerIndex(n,i,s){let o;if(s){o=i;for(let a=i-1;a>=0;--a)if(n.isOverlapping(this._objects[a])){o=a;break}}else o=i-1;return o}findNewUpperIndex(n,i,s){let o;if(s){o=i;for(let a=i+1;a1&&arguments[1]!==void 0?arguments[1]:{},l=[],h=new nt(i,s),u=h.add(new nt(o,a));for(let d=this._objects.length-1;d>=0;d--){let f=this._objects[d];f.selectable&&f.visible&&(c&&f.intersectsWithRect(h,u)||f.isContainedWithinRect(h,u)||c&&f.containsPoint(h)||c&&f.containsPoint(u))&&l.push(f)}return l}}return t}var a0=class extends Tp{_setOptions(){let t=arguments.length>0&&arguments[0]!==void 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 typeof t=="object"?this._setObject(t):this._set(t,e),this}_set(t,e){this[t]=e}toggle(t){let e=this.get(t);return typeof e=="boolean"&&this.set(t,!e),this}get(t){return this[t]}};function _l(r){return B0().requestAnimationFrame(r)}function ov(r){return B0().cancelAnimationFrame(r)}var PT=0,ws=()=>PT++,ln=()=>{let r=Ja().createElement("canvas");if(!r||r.getContext===void 0)throw new Oi("Failed to create `canvas` element");return r},av=()=>Ja().createElement("img"),cm=(r,t,e)=>r.toDataURL("image/".concat(t),e),nn=r=>r*rm,ho=r=>r/rm,kT=["translateX","translateY","angle"],Un=(r,t,e)=>new nt(r).transform(t,e),fi=r=>{let t=1/(r[0]*r[3]-r[1]*r[2]),e=[t*r[3],-t*r[1],-t*r[2],t*r[0],0,0],{x:n,y:i}=new nt(r[4],r[5]).transform(e,!0);return e[4]=-n,e[5]=-i,e},Dn=(r,t,e)=>[r[0]*t[0]+r[2]*t[1],r[1]*t[0]+r[3]*t[1],r[0]*t[2]+r[2]*t[3],r[1]*t[2]+r[3]*t[3],e?0:r[0]*t[4]+r[2]*t[5]+r[4],e?0:r[1]*t[4]+r[3]*t[5]+r[5]],Qa=(r,t)=>r.reduceRight((e,n)=>n?Dn(n,e,t):e,$n),cv=r=>{let[t,e]=r;return Math.atan2(e,t)},qa=r=>{let t=cv(r),e=Math.pow(r[0],2)+Math.pow(r[1],2),n=Math.sqrt(e),i=(r[0]*r[3]-r[2]*r[1])/n,s=Math.atan2(r[0]*r[2]+r[1]*r[3],e);return{angle:ho(t),scaleX:n,scaleY:i,skewX:ho(s),skewY:0,translateX:r[4]||0,translateY:r[5]||0}},tc=function(r){return[1,0,0,1,r,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0]};function ec(){let{angle:r=0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{x:t=0,y:e=0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=nn(r),i=Zi(n),s=Ki(n);return[i,s,-s,i,t?t-(i*t-s*e):0,e?e-(s*t+i*e):0]}var T0=function(r){return[r,0,0,arguments.length>1&&arguments[1]!==void 0?arguments[1]:r,0,0]},lv=r=>Math.tan(nn(r)),lm=r=>[1,0,lv(r),1,0,0],hm=r=>[1,lv(r),0,1,0,0],kl=r=>{let{scaleX:t=1,scaleY:e=1,flipX:n=!1,flipY:i=!1,skewX:s=0,skewY:o=0}=r;return Qa([T0(n?-t:t,i?-e:e),s&&lm(s),o&&hm(o)],!0)},hv=r=>{let{translateX:t=0,translateY:e=0,angle:n=0}=r,i=Oe(r,kT);return Qa([tc(t,e),n&&ec({angle:n}),kl(i)])},yl=function(r){let{signal:t,crossOrigin:e=null}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(n,i){if(t&&t.aborted)return i(new s0("loadImage"));let s=av(),o;t&&(o=function(c){s.src="",i(c)},t.addEventListener("abort",o,{once:!0}));let a=function(){s.onload=s.onerror=null,o&&t?.removeEventListener("abort",o),n(s)};r?(s.onload=a,s.onerror=function(){o&&t?.removeEventListener("abort",o),i(new Oi("Error loading ".concat(s.src)))},e&&(s.crossOrigin=e),s.src=r):a()})},$a=function(r){let{signal:t,reviver:e=oo}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise((n,i)=>{let s=[];t&&t.addEventListener("abort",i,{once:!0}),Promise.all(r.map(o=>It.getClass(o.type).fromObject(o,{signal:t}).then(a=>(e(o,a),s.push(a),a)))).then(n).catch(o=>{s.forEach(a=>{a.dispose&&a.dispose()}),i(o)}).finally(()=>{t&&t.removeEventListener("abort",i)})})},Rl=function(r){let{signal:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise((e,n)=>{let i=[];t&&t.addEventListener("abort",n,{once:!0});let s=Object.values(r).map(a=>a&&(a.type?$a([a],{signal:t}).then(c=>{let[l]=c;return i.push(l),l}):a.source?It.getClass("pattern").fromObject(a,{signal:t}).then(c=>(i.push(c),c)):a)),o=Object.keys(r);Promise.all(s).then(a=>a.reduce((c,l,h)=>(c[o[h]]=l,c),{})).then(e).catch(a=>{i.forEach(c=>{c.dispose&&c.dispose()}),n(a)}).finally(()=>{t&&t.removeEventListener("abort",n)})})},xo=function(r){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:[]).reduce((t,e)=>(e in r&&(t[e]=r[e]),t),{})},um=(r,t)=>Object.keys(r).reduce((e,n)=>(t(r[n],n,r)&&(e[n]=r[n]),e),{}),D5={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"},pp=(r,t,e)=>(e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+6*(t-r)*e:e<.5?t:e<2/3?r+(t-r)*(2/3-e)*6:r),B5=(r,t,e,n)=>{r/=255,t/=255,e/=255;let i=Math.max(r,t,e),s=Math.min(r,t,e),o,a,c=(i+s)/2;if(i===s)o=a=0;else{let l=i-s;switch(a=c>.5?l/(2-i-s):l/(i+s),i){case r:o=(t-e)/l+(t0&&arguments[0]!==void 0?arguments[0]:"1";return parseFloat(r)/(r.endsWith("%")?100:1)},Ku=r=>Math.min(Math.round(r),255).toString(16).toUpperCase().padStart(2,"0"),F5=r=>{let[t,e,n,i=1]=r,s=Math.round(.3*t+.59*e+.11*n);return[s,s,s,i]},Zn=class r{constructor(t){if(t)if(t instanceof r)this.setSource([...t._source]);else if(Array.isArray(t)){let[e,n,i,s=1]=t;this.setSource([e,n,i,s])}else this.setSource(this._tryParsingColor(t));else this.setSource([0,0,0,1])}_tryParsingColor(t){return t in D5&&(t=D5[t]),t==="transparent"?[255,255,255,0]:r.sourceFromHex(t)||r.sourceFromRgb(t)||r.sourceFromHsl(t)||[0,0,0,1]}getSource(){return this._source}setSource(t){this._source=t}toRgb(){let[t,e,n]=this.getSource();return"rgb(".concat(t,",").concat(e,",").concat(n,")")}toRgba(){return"rgba(".concat(this.getSource().join(","),")")}toHsl(){let[t,e,n]=B5(...this.getSource());return"hsl(".concat(t,",").concat(e,"%,").concat(n,"%)")}toHsla(){let[t,e,n,i]=B5(...this.getSource());return"hsla(".concat(t,",").concat(e,"%,").concat(n,"%,").concat(i,")")}toHex(){return this.toHexa().slice(0,6)}toHexa(){let[t,e,n,i]=this.getSource();return"".concat(Ku(t)).concat(Ku(e)).concat(Ku(n)).concat(Ku(Math.round(255*i)))}getAlpha(){return this.getSource()[3]}setAlpha(t){return this._source[3]=t,this}toGrayscale(){return this.setSource(F5(this.getSource())),this}toBlackWhite(t){let[e,,,n]=F5(this.getSource()),i=e<(t||127)?0:255;return this.setSource([i,i,i,n]),this}overlayWith(t){t instanceof r||(t=new r(t));let e=this.getSource(),n=t.getSource(),[i,s,o]=e.map((a,c)=>Math.round(.5*a+.5*n[c]));return this.setSource([i,s,o,e[3]]),this}static fromRgb(t){return r.fromRgba(t)}static fromRgba(t){return new r(r.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[n,i,s]=e.slice(1,4).map(o=>{let a=parseFloat(o);return o.endsWith("%")?Math.round(2.55*a):a});return[n,i,s,T5(e[4])]}}static fromHsl(t){return r.fromHsla(t)}static fromHsla(t){return new r(r.sourceFromHsl(t))}static sourceFromHsl(t){let e=t.match(/^hsla?\(\s*([+-]?\d{1,3})\s*[\s|,]\s*(\d{1,3}%)\s*[\s|,]\s*(\d{1,3}%)\s*(?:\s*[,/]\s*(\d*(?:\.\d+)?%?)\s*)?\)$/i);if(!e)return;let n=(parseFloat(e[1])%360+360)%360/360,i=parseFloat(e[2])/100,s=parseFloat(e[3])/100,o,a,c;if(i===0)o=a=c=s;else{let l=s<=.5?s*(i+1):s+i-s*i,h=2*s-l;o=pp(h,l,n+1/3),a=pp(h,l,n),c=pp(h,l,n-1/3)}return[Math.round(255*o),Math.round(255*a),Math.round(255*c),T5(e[4])]}static fromHex(t){return new r(r.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),n;n=e.length<=4?e.split("").map(c=>c+c):e.match(/.{2}/g);let[i,s,o,a=255]=n.map(c=>parseInt(c,16));return[i,s,o,a/255]}}},we=(r,t)=>parseFloat(Number(r).toFixed(t)),ao=function(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sm,e=/\D{0,2}$/.exec(r),n=parseFloat(r),i=Me.DPI;switch(e?.[0]){case"mm":return n*i/25.4;case"cm":return n*i/2.54;case"in":return n*i;case"pt":return n*i/72;case"pc":return n*i/72*12;case"em":return n*t;default:return n}},uv=r=>{let[t,e]=r.trim().split(" "),[n,i]=(s=t)&&s!==ii?[s.slice(1,4),s.slice(5,8)]:s===ii?[s,s]:["Mid","Mid"];var s;return{meetOrSlice:e||"meet",alignX:n,alignY:i}},Ml=r=>"matrix("+r.map(t=>we(t,Me.NUM_FRACTION_DIGITS)).join(" ")+")",Dl=function(r,t){let e,n,i=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(t)if(t.toLive)e="url(#SVGID_".concat(t.id,")");else{let s=new Zn(t),o=s.getAlpha();e=s.toRgb(),o!==1&&(n=o.toString())}else e="none";return i?"".concat(r,": ").concat(e,"; ").concat(n?"".concat(r,"-opacity: ").concat(n,"; "):""):"".concat(r,'="').concat(e,'" ').concat(n?"".concat(r,'-opacity="').concat(n,'" '):"")},Ii=r=>!!r&&r.toLive!==void 0,P5=r=>!!r&&typeof r.toObject=="function",k5=r=>!!r&&r.offsetX!==void 0&&Object.hasOwn(r,"source"),dv=r=>!!r&&typeof r._renderText=="function",Aa=r=>!!r&&Object.hasOwn(r,"multiSelectionStacking");function fv(r){let t=r&&qi(r),e=0,n=0;if(!r||!t)return{left:e,top:n};let i=t.documentElement,s=t.body||{scrollLeft:0,scrollTop:0};for(;r&&(r.parentNode||r.host)&&((r=r.parentNode||r.host)===t?(e=s.scrollLeft||i.scrollLeft||0,n=s.scrollTop||i.scrollTop||0):(e+=r.scrollLeft||0,n+=r.scrollTop||0),r.nodeType!==1||r.style.position!=="fixed"););return{left:e,top:n}}var qi=r=>r.ownerDocument||null,xv=r=>{var t;return((t=r.ownerDocument)===null||t===void 0?void 0:t.defaultView)||null};function bl(r,t){let e=r.style;e&&(typeof t=="string"?r.style.cssText+=";"+t:Object.entries(t).forEach(n=>{let[i,s]=n;return e.setProperty(i,s)}))}var pv=function(r,t,e){let{width:n,height:i}=e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;r.width=n,r.height=i,s>1&&(r.setAttribute("width",(n*s).toString()),r.setAttribute("height",(i*s).toString()),t.scale(s,s))},Fp=(r,t)=>{let{width:e,height:n}=t;e&&(r.style.width=typeof e=="number"?"".concat(e,"px"):e),n&&(r.style.height=typeof n=="number"?"".concat(n,"px"):n)};function R5(r){return r.onselectstart!==void 0&&(r.onselectstart=()=>!1),r.style.userSelect=ii,r}var c0=class{constructor(t){W(this,"_originalCanvasStyle",void 0),W(this,"lower",void 0);let e=this.createLowerCanvas(t);this.lower={el:e,ctx:e.getContext("2d")}}createLowerCanvas(t){let e=(n=t)&&n.getContext!==void 0?t:t&&Ja().getElementById(t)||ln();var n;if(e.hasAttribute("data-fabric"))throw new Oi("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:n}=t,{el:i}=this.lower;i.classList.remove("lower-canvas"),i.removeAttribute("data-fabric"),i.setAttribute("width","".concat(e)),i.setAttribute("height","".concat(n)),i.style.cssText=this._originalCanvasStyle||"",this._originalCanvasStyle=void 0}setDimensions(t,e){let{el:n,ctx:i}=this.lower;pv(n,i,t,e)}setCSSDimensions(t){Fp(this.lower.el,t)}calcOffset(){return function(t){var e;let n={left:0,top:0},i=t&&qi(t),s={left:0,top:0},o={borderLeftWidth:Fe,borderTopWidth:Vn,paddingLeft:Fe,paddingTop:Vn};if(!i)return s;let a=((e=xv(t))===null||e===void 0?void 0:e.getComputedStyle(t,null))||{};for(let h in o)s[o[h]]+=parseInt(a[h],10)||0;let c=i.documentElement;t.getBoundingClientRect!==void 0&&(n=t.getBoundingClientRect());let l=fv(t);return{left:n.left+l.left-(c.clientLeft||0)+s.left,top:n.top+l.top-(c.clientTop||0)+s.top}}(this.lower.el)}dispose(){gr().dispose(this.lower.el),delete this.lower}},RT={backgroundVpt:!0,backgroundColor:"",overlayVpt:!0,overlayColor:"",includeDefaultValues:!0,svgViewportTransformation:!0,renderOnAddRemove:!0,skipOffscreen:!0,enableRetinaScaling:!0,imageSmoothingEnabled:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,viewportTransform:[...$n]},Bl=class r extends sv(a0){get lowerCanvasEl(){var t;return(t=this.elements.lower)===null||t===void 0?void 0:t.el}get contextContainer(){var t;return(t=this.elements.lower)===null||t===void 0?void 0:t.ctx}static getDefaults(){return r.ownDefaults}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?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.viewportTransform=[...this.viewportTransform],this.calcViewportBoundaries()}initElements(t){this.elements=new c0(t)}add(){let t=super.add(...arguments);return arguments.length>0&&this.renderOnAddRemove&&this.requestRenderAll(),t}insertAt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i0&&this.renderOnAddRemove&&this.requestRenderAll(),s}remove(){let t=super.remove(...arguments);return t.length>0&&this.renderOnAddRemove&&this.requestRenderAll(),t}_onObjectAdded(t){t.canvas&&t.canvas!==this&&(As("warn",`Canvas is trying to add an object that belongs to a different canvas. +Resulting 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?rv():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:n=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e){let i=G({width:this.width,height:this.height},t);this.elements.setDimensions(i,this.getRetinaScaling()),this.hasLostContext=!0,this.width=i.width,this.height=i.height}n||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){let e=this.backgroundImage,n=this.overlayImage,i=this._objects.length;this.viewportTransform=t;for(let s=0;sthis.renderAndReset()))}calcViewportBoundaries(){let t=this.width,e=this.height,n=fi(this.viewportTransform),i=Un({x:0,y:0},n),s=Un({x:t,y:e},n),o=i.min(s),a=i.max(s);return this.vptCoords={tl:o,tr:new nt(a.x,o.y),bl:new nt(o.x,a.y),br:a}}cancelRequestedRender(){this.nextRenderHandle&&(ov(this.nextRenderHandle),this.nextRenderHandle=0)}drawControls(t){}renderCanvas(t,e){if(this.destroyed)return;let n=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(n[0],n[1],n[2],n[3],n[4],n[5]),this._renderObjects(t,e),t.restore(),this.controlsAboveOverlay||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.drawControls(t),this.fire("after:render",{ctx:t}),this.__cleanupTask&&(this.__cleanupTask(),this.__cleanupTask=void 0)}drawClipPathOnCanvas(t,e){let n=this.viewportTransform;t.save(),t.transform(...n),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 n=0,i=e.length;n!s.excludeFromExport).map(s=>this._toObject(s,t,e))},this.__serializeBgOverlay(t,e)),i?{clipPath:i}:null)}_toObject(t,e,n){let i;this.includeDefaultValues||(i=t.includeDefaultValues,t.includeDefaultValues=!1);let s=t[e](n);return this.includeDefaultValues||(t.includeDefaultValues=!!i),s}__serializeBgOverlay(t,e){let n={},i=this.backgroundImage,s=this.overlayImage,o=this.backgroundColor,a=this.overlayColor;return Ii(o)?o.excludeFromExport||(n.background=o.toObject(e)):o&&(n.background=o),Ii(a)?a.excludeFromExport||(n.overlay=a.toObject(e)):a&&(n.overlay=a),i&&!i.excludeFromExport&&(n.backgroundImage=this._toObject(i,t,e)),s&&!s.excludeFromExport&&(n.overlayImage=this._toObject(s,t,e)),n}toSVG(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;t.reviver=e;let n=[];return this._setSVGPreamble(n,t),this._setSVGHeader(n,t),this.clipPath&&n.push(' +`)),this._setSVGBgOverlayColor(n,"background"),this._setSVGBgOverlayImage(n,"backgroundImage",e),this._setSVGObjects(n,e),this.clipPath&&n.push(` +`),this._setSVGBgOverlayColor(n,"overlay"),this._setSVGBgOverlayImage(n,"overlayImage",e),n.push(""),n.join("")}_setSVGPreamble(t,e){e.suppressPreamble||t.push(' +`,' +`)}_setSVGHeader(t,e){let n=e.width||"".concat(this.width),i=e.height||"".concat(this.height),s=Me.NUM_FRACTION_DIGITS,o=e.viewBox,a;if(o)a='viewBox="'.concat(o.x," ").concat(o.y," ").concat(o.width," ").concat(o.height,'" ');else if(this.svgViewportTransformation){let c=this.viewportTransform;a='viewBox="'.concat(we(-c[4]/c[0],s)," ").concat(we(-c[5]/c[3],s)," ").concat(we(this.width/c[0],s)," ").concat(we(this.height/c[3],s),'" ')}else a='viewBox="0 0 '.concat(this.width," ").concat(this.height,'" ');t.push(" +`,"Created with Fabric.js ",Dp,` +`,` +`,this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),` +`)}createSVGClipPathMarkup(t){let e=this.clipPath;return e?(e.clipPathId="CLIPPATH_".concat(ws()),' +`).concat(e.toClipPathSVG(t.reviver),` +`)):""}createSVGRefElementsMarkup(){return["background","overlay"].map(t=>{let e=this["".concat(t,"Color")];if(Ii(e)){let n=this["".concat(t,"Vpt")],i=this.viewportTransform,s={isType:()=>!1,width:this.width/(n?i[0]:1),height:this.height/(n?i[3]:1)};return e.toSVG(s,{additionalTransform:n?Ml(i):""})}}).join("")}createSVGFontFacesMarkup(){let t=[],e={},n=Me.fontPaths;this._objects.forEach(function s(o){t.push(o),i0(o)&&o._objects.forEach(s)}),t.forEach(s=>{if(!dv(s))return;let{styles:o,fontFamily:a}=s;!e[a]&&n[a]&&(e[a]=!0,o&&Object.values(o).forEach(c=>{Object.values(c).forEach(l=>{let{fontFamily:h=""}=l;!e[h]&&n[h]&&(e[h]=!0)})}))});let i=Object.keys(e).map(s=>` @font-face { + font-family: '`.concat(s,`'; + src: url('`).concat(n[s],`'); + } +`)).join("");return i?` +`):""}_setSVGObjects(t,e){this.forEachObject(n=>{n.excludeFromExport||this._setSVGObject(t,n,e)})}_setSVGObject(t,e,n){t.push(e.toSVG(n))}_setSVGBgOverlayImage(t,e,n){let i=this[e];i&&!i.excludeFromExport&&i.toSVG&&t.push(i.toSVG(n))}_setSVGBgOverlayColor(t,e){let n=this["".concat(e,"Color")];if(n)if(Ii(n)){let i=n.repeat||"",s=this.width,o=this.height,a=this["".concat(e,"Vpt")]?Ml(fi(this.viewportTransform)):"";t.push(' +`))}else t.push(' +`)}loadFromJSON(t,e){let{signal:n}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t)return Promise.reject(new Oi("`json` is undefined"));let i=typeof t=="string"?JSON.parse(t):t,{objects:s=[],backgroundImage:o,background:a,overlayImage:c,overlay:l,clipPath:h}=i,u=this.renderOnAddRemove;return this.renderOnAddRemove=!1,Promise.all([$a(s,{reviver:e,signal:n}),Rl({backgroundImage:o,backgroundColor:a,overlayImage:c,overlayColor:l,clipPath:h},{signal:n})]).then(d=>{let[f,m]=d;return this.clear(),this.add(...f),this.set(i),this.set(m),this.renderOnAddRemove=u,this})}clone(t){let e=this.toObject(t);return this.cloneWithoutData().loadFromJSON(e)}cloneWithoutData(){let t=ln();return t.width=this.width,t.height=this.height,new this.constructor(t)}toDataURL(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{format:e="png",quality:n=1,multiplier:i=1,enableRetinaScaling:s=!1}=t,o=i*(s?this.getRetinaScaling():1);return cm(this.toCanvasElement(o,t),e,n)}toCanvasElement(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,{width:e,height:n,left:i,top:s,filter:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=(e||this.width)*t,c=(n||this.height)*t,l=this.getZoom(),h=this.width,u=this.height,d=l*t,f=this.viewportTransform,m=[d,0,0,d,(f[4]-(i||0))*t,(f[5]-(s||0))*t],g=this.enableRetinaScaling,x=ln(),p=o?this._objects.filter(C=>o(C)):this._objects;return x.width=a,x.height=c,this.enableRetinaScaling=!1,this.viewportTransform=m,this.width=a,this.height=c,this.calcViewportBoundaries(),this.renderCanvas(x.getContext("2d"),p),this.viewportTransform=f,this.width=h,this.height=u,this.calcViewportBoundaries(),this.enableRetinaScaling=g,x}dispose(){return!this.disposed&&this.elements.cleanupDOM({width:this.width,height:this.height}),o0.cancelByCanvas(this),this.disposed=!0,new Promise((t,e)=>{let n=()=>{this.destroy(),t(!0)};n.kill=e,this.__cleanupTask&&this.__cleanupTask.kill("aborted"),this.destroyed?t(!1):this.nextRenderHandle?this.__cleanupTask=n:n()})}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"#")}};W(Bl,"ownDefaults",RT);var IT=["touchstart","touchmove","touchend"],mv=r=>{let t=fv(r.target),e=function(n){let i=n.changedTouches;return i&&i[0]?i[0]:n}(r);return new nt(e.clientX+t.left,e.clientY+t.top)},l0=r=>IT.includes(r.type)||r.pointerType==="touch",Pp=r=>{r.preventDefault(),r.stopPropagation()},mr=r=>{if(r.length===0)return{left:0,top:0,width:0,height:0};let{min:t,max:e}=r.reduce((i,s)=>{let{min:o,max:a}=i;return{min:o.min(s),max:a.max(s)}},{min:new nt(r[0]),max:new nt(r[0])}),n=e.subtract(t);return{left:t.x,top:t.y,width:n.x,height:n.y}},OT=["translateX","translateY","scaleX","scaleY"],gv=(r,t)=>Za(r,Dn(t,r.calcOwnMatrix())),Za=(r,t)=>{let e=qa(t),{translateX:n,translateY:i,scaleX:s,scaleY:o}=e,a=Oe(e,OT),c=new nt(n,i);r.flipX=!1,r.flipY=!1,Object.assign(r,a),r.set({scaleX:s,scaleY:o}),r.setPositionByOrigin(c,_e,_e)},Cv=r=>{r.scaleX=1,r.scaleY=1,r.skewX=0,r.skewY=0,r.flipX=!1,r.flipY=!1,r.rotate(0)},dm=r=>({scaleX:r.scaleX,scaleY:r.scaleY,skewX:r.skewX,skewY:r.skewY,angle:r.angle,left:r.left,flipX:r.flipX,flipY:r.flipY,top:r.top}),F0=(r,t,e)=>{let n=r/2,i=t/2,s=[new nt(-n,-i),new nt(n,-i),new nt(-n,i),new nt(n,i)].map(a=>a.transform(e)),o=mr(s);return new nt(o.width,o.height)},Il=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$n;return Dn(fi(arguments.length>1&&arguments[1]!==void 0?arguments[1]:$n),r)},_s=function(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$n,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$n;return r.transform(Il(t,e))},vv=function(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$n,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$n;return r.transform(Il(t,e),!0)},kp=(r,t,e)=>{let n=Il(t,e);return Za(r,Dn(n,r.calcOwnMatrix())),n},Ev=(r,t)=>{var e;let{transform:{target:n}}=t;(e=n.canvas)===null||e===void 0||e.fire("object:".concat(r),G(G({},t),{},{target:n})),n.fire(r,t)},LT={left:-.5,top:-.5,center:0,bottom:.5,right:.5},vs=r=>typeof r=="string"?LT[r]:r-.5,h0="not-allowed";function _v(r){return r.originX===_e&&r.originY===_e}function I5(r){return .5-vs(r)}var $i=(r,t)=>r[t],yv=(r,t,e,n)=>({e:r,transform:t,pointer:new nt(e,n)});function bv(r,t){let e=r.getTotalAngle()+ho(Math.atan2(t.y,t.x))+360;return Math.round(e%360/45)}function P0(r,t,e,n,i){var s;let{target:o,corner:a}=r,c=o.controls[a],l=((s=o.canvas)===null||s===void 0?void 0:s.getZoom())||1,h=o.padding/l,u=function(d,f,m,g){let x=d.getRelativeCenterPoint(),p=m!==void 0&&g!==void 0?d.translateToGivenOrigin(x,_e,_e,m,g):new nt(d.left,d.top);return(d.angle?f.rotate(-nn(d.angle),x):f).subtract(p)}(o,new nt(n,i),t,e);return u.x>=h&&(u.x-=h),u.x<=-h&&(u.x+=h),u.y>=h&&(u.y-=h),u.y<=h&&(u.y+=h),u.x-=c.offsetX,u.y-=c.offsetY,u}var Av=(r,t,e,n)=>{let{target:i,offsetX:s,offsetY:o}=t,a=e-s,c=n-o,l=!$i(i,"lockMovementX")&&i.left!==a,h=!$i(i,"lockMovementY")&&i.top!==c;return l&&i.set(Fe,a),h&&i.set(Vn,c),(l||h)&&Ev("moving",yv(r,t,e,n)),l||h},u0=class{getSvgStyles(t){let e=this.fillRule?this.fillRule:"nonzero",n=this.strokeWidth?this.strokeWidth:"0",i=this.strokeDashArray?this.strokeDashArray.join(" "):ii,s=this.strokeDashOffset?this.strokeDashOffset:"0",o=this.strokeLineCap?this.strokeLineCap:"butt",a=this.strokeLineJoin?this.strokeLineJoin:"miter",c=this.strokeMiterLimit?this.strokeMiterLimit:"4",l=this.opacity!==void 0?this.opacity:"1",h=this.visible?"":" visibility: hidden;",u=t?"":this.getSvgFilter(),d=Dl("fill",this.fill);return[Dl("stroke",this.stroke),"stroke-width: ",n,"; ","stroke-dasharray: ",i,"; ","stroke-linecap: ",o,"; ","stroke-dashoffset: ",s,"; ","stroke-linejoin: ",a,"; ","stroke-miterlimit: ",c,"; ",d,"fill-rule: ",e,"; ","opacity: ",l,";",u,h].join("")}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&&arguments[1]!==void 0?arguments[1]:"",n=t?this.calcTransformMatrix():this.calcOwnMatrix(),i='transform="'.concat(Ml(n));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:n=""}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=[this.getSvgTransform(!0,n),this.getSvgCommons()].join(""),s=t.indexOf("COMMON_PARTS");return t[s]=i,e?e(t.join("")):t.join("")}_createBaseSVGMarkup(t){let{noStyle:e,reviver:n,withShadow:i,additionalTransform:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=e?"":'style="'.concat(this.getSvgStyles(),'" '),a=i?'style="'.concat(this.getSvgFilter(),'" '):"",c=this.clipPath,l=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",h=c&&c.absolutePositioned,u=this.stroke,d=this.fill,f=this.shadow,m=[],g=t.indexOf("COMMON_PARTS"),x;c&&(c.clipPathId="CLIPPATH_".concat(ws()),x=' +`).concat(c.toClipPathSVG(n),` +`)),h&&m.push(" +`),m.push(" +`);let p=[o,l,e?"":this.addPaintOrder()," ",s?'transform="'.concat(s,'" '):""].join("");return t[g]=p,Ii(d)&&m.push(d.toSVG(this)),Ii(u)&&m.push(u.toSVG(this)),f&&m.push(f.toSVG(this)),c&&m.push(x),m.push(t.join("")),m.push(` +`),h&&m.push(` +`),n?n(m.join("")):m.join("")}addPaintOrder(){return this.paintFirst!=="fill"?' paint-order="'.concat(this.paintFirst,'" '):""}},mp=(r,t,e,n)=>(rr*Math.pow(2,10*(n-=1))*Math.sin((n*i-t)*Nr/e),Sv=(r,t,e,n)=>-e*Math.cos(r/n*Ss)+e+t,Rp=(r,t,e,n)=>(r/=n)<1/2.75?e*(7.5625*r*r)+t:r<2/2.75?e*(7.5625*(r-=1.5/2.75)*r+.75)+t:r<2.5/2.75?e*(7.5625*(r-=2.25/2.75)*r+.9375)+t:e*(7.5625*(r-=2.625/2.75)*r+.984375)+t,L5=(r,t,e,n)=>e-Rp(n-r,0,e,n)+t,NT=Object.freeze({__proto__:null,defaultEasing:Sv,easeInBack:function(r,t,e,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1.70158;return e*(r/=n)*r*((i+1)*r-i)+t},easeInBounce:L5,easeInCirc:(r,t,e,n)=>-e*(Math.sqrt(1-(r/=n)*r)-1)+t,easeInCubic:(r,t,e,n)=>e*(r/n)**3+t,easeInElastic:(r,t,e,n)=>{let i=e,s=0;if(r===0)return t;if((r/=n)===1)return t+e;s||(s=.3*n);let{a:o,s:a,p:c}=mp(i,e,s,1.70158);return-O5(o,a,c,r,n)+t},easeInExpo:(r,t,e,n)=>r===0?t:e*2**(10*(r/n-1))+t,easeInOutBack:function(r,t,e,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1.70158;return(r/=n/2)<1?e/2*(r*r*((1+(i*=1.525))*r-i))+t:e/2*((r-=2)*r*((1+(i*=1.525))*r+i)+2)+t},easeInOutBounce:(r,t,e,n)=>r(r/=n/2)<1?-e/2*(Math.sqrt(1-r**2)-1)+t:e/2*(Math.sqrt(1-(r-=2)*r)+1)+t,easeInOutCubic:(r,t,e,n)=>(r/=n/2)<1?e/2*r**3+t:e/2*((r-2)**3+2)+t,easeInOutElastic:(r,t,e,n)=>{let i=e,s=0;if(r===0)return t;if((r/=n/2)===2)return t+e;s||(s=n*(.3*1.5));let{a:o,s:a,p:c,c:l}=mp(i,e,s,1.70158);return r<1?-.5*O5(o,a,c,r,n)+t:o*Math.pow(2,-10*(r-=1))*Math.sin((r*n-a)*Nr/c)*.5+l+t},easeInOutExpo:(r,t,e,n)=>r===0?t:r===n?t+e:(r/=n/2)<1?e/2*2**(10*(r-1))+t:e/2*-(2**(-10*--r)+2)+t,easeInOutQuad:(r,t,e,n)=>(r/=n/2)<1?e/2*r**2+t:-e/2*(--r*(r-2)-1)+t,easeInOutQuart:(r,t,e,n)=>(r/=n/2)<1?e/2*r**4+t:-e/2*((r-=2)*r**3-2)+t,easeInOutQuint:(r,t,e,n)=>(r/=n/2)<1?e/2*r**5+t:e/2*((r-2)**5+2)+t,easeInOutSine:(r,t,e,n)=>-e/2*(Math.cos(Math.PI*r/n)-1)+t,easeInQuad:(r,t,e,n)=>e*(r/=n)*r+t,easeInQuart:(r,t,e,n)=>e*(r/=n)*r**3+t,easeInQuint:(r,t,e,n)=>e*(r/n)**5+t,easeInSine:(r,t,e,n)=>-e*Math.cos(r/n*Ss)+e+t,easeOutBack:function(r,t,e,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1.70158;return e*((r=r/n-1)*r*((i+1)*r+i)+1)+t},easeOutBounce:Rp,easeOutCirc:(r,t,e,n)=>e*Math.sqrt(1-(r=r/n-1)*r)+t,easeOutCubic:(r,t,e,n)=>e*((r/n-1)**3+1)+t,easeOutElastic:(r,t,e,n)=>{let i=e,s=0;if(r===0)return t;if((r/=n)===1)return t+e;s||(s=.3*n);let{a:o,s:a,p:c,c:l}=mp(i,e,s,1.70158);return o*2**(-10*r)*Math.sin((r*n-a)*Nr/c)+l+t},easeOutExpo:(r,t,e,n)=>r===n?t+e:e*-(2**(-10*r/n)+1)+t,easeOutQuad:(r,t,e,n)=>-e*(r/=n)*(r-2)+t,easeOutQuart:(r,t,e,n)=>-e*((r=r/n-1)*r**3-1)+t,easeOutQuint:(r,t,e,n)=>e*((r/n-1)**5+1)+t,easeOutSine:(r,t,e,n)=>e*Math.sin(r/n*Ss)+t}),UT=()=>!1,Tl=class{constructor(t){let{startValue:e,byValue:n,duration:i=500,delay:s=0,easing:o=Sv,onStart:a=oo,onChange:c=oo,onComplete:l=oo,abort:h=UT,target:u}=t;W(this,"_state","pending"),W(this,"durationProgress",0),W(this,"valueProgress",0),this.tick=this.tick.bind(this),this.duration=i,this.delay=s,this.easing=o,this._onStart=a,this._onChange=c,this._onComplete=l,this._abort=h,this.target=u,this.startValue=e,this.byValue=n,this.value=this.startValue,this.endValue=Object.freeze(this.calculate(this.duration).value)}get state(){return this._state}isDone(){return this._state==="aborted"||this._state==="completed"}start(){let t=e=>{this._state==="pending"&&(this.startTime=e||+new Date,this._state="running",this._onStart(),this.tick(this.startTime))};this.register(),this.delay>0?setTimeout(()=>_l(t),this.delay):_l(t)}tick(t){let e=(t||+new Date)-this.startTime,n=Math.min(e,this.duration);this.durationProgress=n/this.duration;let{value:i,valueProgress:s}=this.calculate(n);this.value=Object.freeze(i),this.valueProgress=s,this._state!=="aborted"&&(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),_l(this.tick)))}register(){o0.push(this)}unregister(){o0.remove(this)}abort(){this._state="aborted",this.unregister()}},VT=["startValue","endValue"],Ip=class extends Tl{constructor(t){let{startValue:e=0,endValue:n=100}=t;super(G(G({},Oe(t,VT)),{},{startValue:e,byValue:n-e}))}calculate(t){let e=this.easing(t,this.startValue,this.byValue,this.duration);return{value:e,valueProgress:Math.abs((e-this.startValue)/this.byValue)}}},zT=["startValue","endValue"],Op=class extends Tl{constructor(t){let{startValue:e=[0],endValue:n=[100]}=t;super(G(G({},Oe(t,zT)),{},{startValue:e,byValue:n.map((i,s)=>i-e[s])}))}calculate(t){let e=this.startValue.map((n,i)=>this.easing(t,n,this.byValue[i],this.duration,i));return{value:e,valueProgress:Math.abs((e[0]-this.startValue[0])/this.byValue[0])}}},uo=(r,t,e)=>Math.max(r,Math.min(t,e)),HT=["startValue","endValue","easing","onChange","onComplete","abort"],GT=(r,t,e,n)=>t+e*(1-Math.cos(r/n*Ss)),gp=r=>r&&((t,e,n)=>r(new Zn(t).toRgba(),e,n)),Lp=class extends Tl{constructor(t){let{startValue:e,endValue:n,easing:i=GT,onChange:s,onComplete:o,abort:a}=t,c=Oe(t,HT),l=new Zn(e).getSource(),h=new Zn(n).getSource();super(G(G({},c),{},{startValue:l,byValue:h.map((u,d)=>u-l[d]),easing:i,onChange:gp(s),onComplete:gp(o),abort:gp(a)}))}calculate(t){let[e,n,i,s]=this.startValue.map((a,c)=>this.easing(t,a,this.byValue[c],this.duration,c)),o=[...[e,n,i].map(Math.round),uo(0,s,1)];return{value:o,valueProgress:o.map((a,c)=>this.byValue[c]!==0?Math.abs((a-this.startValue[c])/this.byValue[c]):0).find(a=>a!==0)||0}}};function fm(r){let t=(e=>Array.isArray(e.startValue)||Array.isArray(e.endValue))(r)?new Op(r):new Ip(r);return t.start(),t}function wv(r){let t=new Lp(r);return t.start(),t}var WT=new nt(1,0),Mv=new nt,xm=(r,t)=>r.rotate(t),d0=(r,t)=>new nt(t).subtract(r),f0=r=>r.distanceFrom(Mv),x0=(r,t)=>Math.atan2(Fa(r,t),Bv(r,t)),Dv=r=>x0(WT,r),k0=r=>r.eq(Mv)?r:r.scalarDivide(f0(r)),pm=function(r){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return k0(new nt(-r.y,r.x).scalarMultiply(t?1:-1))},Fa=(r,t)=>r.x*t.y-r.y*t.x,Bv=(r,t)=>r.x*t.x+r.y*t.y,Np=(r,t,e)=>{if(r.eq(t)||r.eq(e))return!0;let n=Fa(t,e),i=Fa(t,r),s=Fa(e,r);return n>=0?i>=0&&s<=0:!(i<=0&&s>=0)},co=class r{constructor(t){this.status=t,this.points=[]}includes(t){return this.points.some(e=>e.eq(t))}append(){for(var t=arguments.length,e=new Array(t),n=0;n!this.includes(i))),this}static isPointContained(t,e,n){let i=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(e.eq(n))return t.eq(e);if(e.x===n.x)return t.x===e.x&&(i||t.y>=Math.min(e.y,n.y)&&t.y<=Math.max(e.y,n.y));if(e.y===n.y)return t.y===e.y&&(i||t.x>=Math.min(e.x,n.x)&&t.x<=Math.max(e.x,n.x));{let s=d0(e,n),o=d0(e,t).divide(s);return i?Math.abs(o.x)===Math.abs(o.y):o.x===o.y&&o.x>=0&&o.x<=1}}static isPointInPolygon(t,e){let n=new nt(t).setX(Math.min(t.x-1,...e.map(s=>s.x))),i=0;for(let s=0;s4&&arguments[4]!==void 0)||arguments[4],o=!(arguments.length>5&&arguments[5]!==void 0)||arguments[5],a=e.x-t.x,c=e.y-t.y,l=i.x-n.x,h=i.y-n.y,u=t.x-n.x,d=t.y-n.y,f=l*d-h*u,m=a*d-c*u,g=h*a-l*c;if(g!==0){let x=f/g,p=m/g;return(s||0<=x&&x<=1)&&(o||0<=p&&p<=1)?new r("Intersection").append(new nt(t.x+x*a,t.y+x*c)):new r}if(f===0||m===0){let x=s||o||r.isPointContained(t,n,i)||r.isPointContained(e,n,i)||r.isPointContained(n,t,e)||r.isPointContained(i,t,e);return new r(x?"Coincident":void 0)}return new r("Parallel")}static intersectSegmentLine(t,e,n,i){return r.intersectLineLine(t,e,n,i,!1,!0)}static intersectSegmentSegment(t,e,n,i){return r.intersectLineLine(t,e,n,i,!1,!1)}static intersectLinePolygon(t,e,n){let i=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],s=new r,o=n.length;for(let a,c,l,h=0;h0&&(s.status="Intersection"),s}static intersectSegmentPolygon(t,e,n){return r.intersectLinePolygon(t,e,n,!1)}static intersectPolygonPolygon(t,e){let n=new r,i=t.length,s=[];for(let o=0;o0&&s.length===t.length?new r("Coincident"):(n.points.length>0&&(n.status="Intersection"),n)}static intersectPolygonRectangle(t,e,n){let i=e.min(n),s=e.max(n),o=new nt(s.x,i.y),a=new nt(i.x,s.y);return r.intersectPolygonPolygon(t,[i,o,s,a])}},Up=class extends a0{_getTransformedDimensions(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=G({scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,width:this.width,height:this.height,strokeWidth:this.strokeWidth},t),n=e.strokeWidth,i=n,s=0;this.strokeUniform&&(i=0,s=n);let o=e.width+i,a=e.height+i,c;return c=e.skewX===0&&e.skewY===0?new nt(o*e.scaleX,a*e.scaleY):F0(o,a,kl(e)),c.scalarAdd(s)}translateToGivenOrigin(t,e,n,i,s){let o=t.x,a=t.y,c=vs(i)-vs(e),l=vs(s)-vs(n);if(c||l){let h=this._getTransformedDimensions();o+=c*h.x,a+=l*h.y}return new nt(o,a)}translateToCenterPoint(t,e,n){let i=this.translateToGivenOrigin(t,e,n,_e,_e);return this.angle?i.rotate(nn(this.angle),t):i}translateToOriginPoint(t,e,n){let i=this.translateToGivenOrigin(t,_e,_e,e,n);return this.angle?i.rotate(nn(this.angle),t):i}getCenterPoint(){let t=this.getRelativeCenterPoint();return this.group?Un(t,this.group.calcTransformMatrix()):t}getRelativeCenterPoint(){return this.translateToCenterPoint(new nt(this.left,this.top),this.originX,this.originY)}getPointByOrigin(t,e){return this.translateToOriginPoint(this.getRelativeCenterPoint(),t,e)}setPositionByOrigin(t,e,n){let i=this.translateToCenterPoint(t,e,n),s=this.translateToOriginPoint(i,this.originX,this.originY);this.set({left:s.x,top:s.y})}_getLeftTopCoords(){return this.translateToOriginPoint(this.getRelativeCenterPoint(),Fe,Vn)}},Vp=class extends Up{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?Un(t,this.group.calcTransformMatrix()):t}setXY(t,e,n){this.group&&(t=Un(t,fi(this.group.calcTransformMatrix()))),this.setRelativeXY(t,e,n)}getRelativeXY(){return new nt(this.left,this.top)}setRelativeXY(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.originX,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.originY;this.setPositionByOrigin(t,e,n)}isStrokeAccountedForInDimensions(){return!1}getCoords(){let{tl:t,tr:e,br:n,bl:i}=this.aCoords||(this.aCoords=this.calcACoords()),s=[t,e,n,i];if(this.group){let o=this.group.calcTransformMatrix();return s.map(a=>Un(a,o))}return s}intersectsWithRect(t,e){return co.intersectPolygonRectangle(this.getCoords(),t,e).status==="Intersection"}intersectsWithObject(t){let e=co.intersectPolygonPolygon(this.getCoords(),t.getCoords());return e.status==="Intersection"||e.status==="Coincident"||t.isContainedWithinObject(this)||this.isContainedWithinObject(t)}isContainedWithinObject(t){return this.getCoords().every(e=>t.containsPoint(e))}isContainedWithinRect(t,e){let{left:n,top:i,width:s,height:o}=this.getBoundingRect();return n>=t.x&&n+s<=e.x&&i>=t.y&&i+o<=e.y}isOverlapping(t){return this.intersectsWithObject(t)||this.isContainedWithinObject(t)||t.isContainedWithinObject(this)}containsPoint(t){return co.isPointInPolygon(t,this.getCoords())}isOnScreen(){if(!this.canvas)return!1;let{tl:t,br:e}=this.canvas.vptCoords;return!!this.getCoords().some(n=>n.x<=e.x&&n.x>=t.x&&n.y<=e.y&&n.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)?!0:this.getCoords().every(n=>(n.x>=e.x||n.x<=t.x)&&(n.y>=e.y||n.y<=t.y))&&this.containsPoint(t.midPointFrom(e))}getBoundingRect(){return mr(this.getCoords())}getScaledWidth(){return this._getTransformedDimensions().x}getScaledHeight(){return this._getTransformedDimensions().y}scale(t){this._set("scaleX",t),this._set("scaleY",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((t=this.canvas)===null||t===void 0?void 0:t.getRetinaScaling())||1}getTotalAngle(){return this.group?ho(cv(this.calcTransformMatrix())):this.angle}getViewportTransform(){var t;return((t=this.canvas)===null||t===void 0?void 0:t.viewportTransform)||$n.concat()}calcACoords(){let t=ec({angle:this.angle}),{x:e,y:n}=this.getRelativeCenterPoint(),i=tc(e,n),s=Dn(i,t),o=this._getTransformedDimensions(),a=o.x/2,c=o.y/2;return{tl:Un({x:-a,y:-c},s),tr:Un({x:a,y:-c},s),bl:Un({x:-a,y:c},s),br:Un({x:a,y:c},s)}}setCoords(){this.aCoords=this.calcACoords()}transformMatrixKey(){let t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],e="_",n="";return!t&&this.group&&(n=this.group.transformMatrixKey(t)+e),n+this.top+e+this.left+e+this.scaleX+e+this.scaleY+e+this.skewX+e+this.skewY+e+this.angle+e+this.originX+e+this.originY+e+this.width+e+this.height+e+this.strokeWidth+this.flipX+this.flipY}calcTransformMatrix(){let t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],e=this.calcOwnMatrix();if(t||!this.group)return e;let n=this.transformMatrixKey(t),i=this.matrixCache;return i&&i.key===n?i.value:(this.group&&(e=Dn(this.group.calcTransformMatrix(!1),e)),this.matrixCache={key:n,value:e},e)}calcOwnMatrix(){let t=this.transformMatrixKey(!0),e=this.ownMatrixCache;if(e&&e.key===t)return e.value;let n=this.getRelativeCenterPoint(),i={angle:this.angle,translateX:n.x,translateY:n.y,scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY},s=hv(i);return this.ownMatrixCache={key:t,value:s},s}_getNonTransformedDimensions(){return new nt(this.width,this.height).scalarAdd(this.strokeWidth)}_calculateCurrentDimensions(t){return this._getTransformedDimensions(t).transform(this.getViewportTransform(),!0).scalarAdd(2*this.padding)}},zp=class r extends Vp{isDescendantOf(t){let{parent:e,group:n}=this;return e===t||n===t||this.canvas===t||!!e&&e.isDescendantOf(t)||!!n&&n!==e&&n.isDescendantOf(t)}getAncestors(t){let e=[],n=this;do{var i;n=n instanceof r?(i=n.parent)!==null&&i!==void 0?i:t?void 0:n.canvas:void 0,n&&e.push(n)}while(n);return e}findCommonAncestors(t,e){if(this===t)return{fork:[],otherFork:[],common:[this,...this.getAncestors(e)]};let n=this.getAncestors(e),i=t.getAncestors(e);if(n.length===0&&i.length>0&&this===i[i.length-1])return{fork:[],otherFork:[t,...i.slice(0,i.length-1)],common:[this]};for(let s,o=0;o-1&&o>a}},p0=class extends zp{animate(t,e){return Object.entries(t).reduce((n,i)=>{let[s,o]=i;return n[s]=this._animate(s,o,e),n},{})}_animate(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=t.split("."),s=this.constructor.colorProperties.includes(i[i.length-1]),{easing:o,duration:a,abort:c,startValue:l,onChange:h,onComplete:u}=n,d={target:this,startValue:l??i.reduce((f,m)=>f[m],this),endValue:e,easing:o,duration:a,abort:c?.bind(this),onChange:(f,m,g)=>{i.reduce((x,p,C)=>(C===i.length-1&&(x[p]=f),x[p]),this),h&&h(f,m,g)},onComplete:(f,m,g)=>{this.setCoords(),u&&u(f,m,g)}};return s?wv(d):fm(d)}};function R0(r){return new RegExp("^("+r.join("|")+")\\b","i")}var N5,U5;W(p0,"colorProperties",["fill","stroke","backgroundColor"]);var pr=String.raw(N5||(N5=vr(["(?:[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?)"],["(?:[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?)"])));String.raw(U5||(U5=vr(["(?:s+,?s*|,s*|$)"],["(?:\\s+,?\\s*|,\\s*|$)"])));var jT=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+pr+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+pr+"))?\\s+(.*)"),XT={cx:Fe,x:Fe,r:"radius",cy:Vn,y:Vn,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"},Cp="font-size",vp="clip-path",tO=R0(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),eO=R0(["symbol","image","marker","pattern","view","svg"]),V5=R0(["symbol","g","a","svg","clipPath","defs"]),nO=new RegExp("^\\s*("+pr+"+)\\s*,?\\s*("+pr+"+)\\s*,?\\s*("+pr+"+)\\s*,?\\s*("+pr+"+)\\s*$"),z5="(-?\\d+(?:\\.\\d*)?(?:px)?(?:\\s?|$))?",lo=class r{constructor(t){let e=typeof t=="string"?r.parseShadow(t):t;Object.assign(this,this.constructor.ownDefaults);for(let n in e)this[n]=e[n];this.id=ws()}static parseShadow(t){let e=t.trim(),n=new RegExp("(?:\\s|^)"+z5+z5+"("+pr+"?(?:px)?)?(?:\\s?|$)(?:$|\\s)"),[,i=0,s=0,o=0]=(n.exec(e)||[]).map(a=>parseFloat(a)||0);return{color:(e.replace(n,"")||"rgb(0,0,0)").trim(),offsetX:i,offsetY:s,blur:o}}toString(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")}toSVG(t){let e=xm(new nt(this.offsetX,this.offsetY),nn(-t.angle)),n=new Zn(this.color),i=40,s=40;return t.width&&t.height&&(i=100*we((Math.abs(e.x)+this.blur)/t.width,Me.NUM_FRACTION_DIGITS)+20,s=100*we((Math.abs(e.y)+this.blur)/t.height,Me.NUM_FRACTION_DIGITS)+20),t.flipX&&(e.x*=-1),t.flipY&&(e.y*=-1),' + + + + + + + + + +`)}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=r.ownDefaults;return this.includeDefaultValues?t:um(t,(n,i)=>n!==e[i])}static fromObject(t){return dt(this,null,function*(){return new this(t)})}};W(lo,"ownDefaults",{color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1}),W(lo,"type","shadow"),It.setClass(lo,"shadow");var Ol=r=>JSON.parse(JSON.stringify(r)),YT=[Vn,Fe,"scaleX","scaleY","flipX","flipY","originX","originY","angle","opacity","globalCompositeOperation","shadow","visible","skewX","skewY"],Ur=["fill","stroke","strokeWidth","strokeDashArray","width","height","paintFirst","strokeUniform","strokeLineCap","strokeDashOffset","strokeLineJoin","strokeMiterLimit","backgroundColor","clipPath"],qT={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:Fe,originY:Vn,strokeWidth:1,strokeUniform:!1,padding:0,opacity:1,paintFirst:"fill",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},$T=["type"],ZT=["extraParam"],no=class Tv extends p0{static getDefaults(){return G({},Tv.ownDefaults)}get type(){let t=this.constructor.type;return t==="FabricObject"?"object":t.toLowerCase()}set type(t){As("warn","Setting type has no effect",t)}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),W(this,"_cacheContext",null),Object.assign(this,this.constructor.getDefaults()),this.setOptions(t)}_createCacheCanvas(){this._cacheCanvas=ln(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0}_limitCacheSize(t){let e=t.width,n=t.height,i=Me.maxCacheSideLimit,s=Me.minCacheSideLimit;if(e<=i&&n<=i&&e*n<=Me.perfLimitSizeTotal)return el&&(t.zoomX/=e/l,t.width=l,t.capped=!0),n>h&&(t.zoomY/=n/h,t.height=h,t.capped=!0),t}_getCacheCanvasDimensions(){let t=this.getTotalObjectScaling(),e=this._getTransformedDimensions({skewX:0,skewY:0}),n=e.x*t.x/this.scaleX,i=e.y*t.y/this.scaleY;return{width:n+2,height:i+2,zoomX:t.x,zoomY:t.y,x:n,y:i}}_updateCacheCanvas(){let t=this._cacheCanvas,e=this._cacheContext,n=this._limitCacheSize(this._getCacheCanvasDimensions()),i=Me.minCacheSideLimit,s=n.width,o=n.height,a=n.zoomX,c=n.zoomY,l=s!==this.cacheWidth||o!==this.cacheHeight,h=this.zoomX!==a||this.zoomY!==c;if(!t||!e)return!1;let u,d,f=l||h,m=0,g=0,x=!1;if(l){let p=this._cacheCanvas.width,C=this._cacheCanvas.height,v=s>p||o>C;x=v||(s<.9*p||o<.9*C)&&p>i&&C>i,v&&!n.capped&&(s>i||o>i)&&(m=.1*s,g=.1*o)}return dv(this)&&this.path&&(f=!0,x=!0,m+=this.getHeightOfLine(0)*this.zoomX,g+=this.getHeightOfLine(0)*this.zoomY),!!f&&(x?(t.width=Math.ceil(s+m),t.height=Math.ceil(o+g)):(e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height)),u=n.x/2,d=n.y/2,this.cacheTranslationX=Math.round(t.width/2-u)+u,this.cacheTranslationY=Math.round(t.height/2-d)+d,this.cacheWidth=s,this.cacheHeight=o,e.translate(this.cacheTranslationX,this.cacheTranslationY),e.scale(a,c),this.zoomX=a,this.zoomY=c,!0)}setOptions(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._setOptions(t)}transform(t){let e=this.group&&!this.group._transformDone||this.group&&this.canvas&&t===this.canvas.contextTop,n=this.calcTransformMatrix(!e);t.transform(n[0],n[1],n[2],n[3],n[4],n[5])}toObject(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=Me.NUM_FRACTION_DIGITS,n=this.clipPath&&!this.clipPath.excludeFromExport?G(G({},this.clipPath.toObject(t)),{},{inverted:this.clipPath.inverted,absolutePositioned:this.clipPath.absolutePositioned}):null,i=G(G({},xo(this,t)),{},{type:this.constructor.type,version:Dp,originX:this.originX,originY:this.originY,left:we(this.left,e),top:we(this.top,e),width:we(this.width,e),height:we(this.height,e),fill:P5(this.fill)?this.fill.toObject():this.fill,stroke:P5(this.stroke)?this.stroke.toObject():this.stroke,strokeWidth:we(this.strokeWidth,e),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:we(this.strokeMiterLimit,e),scaleX:we(this.scaleX,e),scaleY:we(this.scaleY,e),angle:we(this.angle,e),flipX:this.flipX,flipY:this.flipY,opacity:we(this.opacity,e),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:we(this.skewX,e),skewY:we(this.skewY,e)},n?{clipPath:n}:null);return this.includeDefaultValues?i:this._removeDefaultValues(i)}toDatalessObject(t){return this.toObject(t)}_removeDefaultValues(t){let e=this.constructor.getDefaults(),n=Object.keys(e).length>0?e:Object.getPrototypeOf(this);return um(t,(i,s)=>{if(s===Fe||s===Vn||s==="type")return!0;let o=n[s];return i!==o&&!(Array.isArray(i)&&Array.isArray(o)&&i.length===0&&o.length===0)})}toString(){return"#<".concat(this.constructor.type,">")}getObjectScaling(){if(!this.group)return new nt(Math.abs(this.scaleX),Math.abs(this.scaleY));let t=qa(this.calcTransformMatrix());return new nt(Math.abs(t.scaleX),Math.abs(t.scaleY))}getTotalObjectScaling(){let t=this.getObjectScaling();if(this.canvas){let e=this.canvas.getZoom(),n=this.getCanvasRetinaScaling();return t.scalarMultiply(e*n)}return t}getObjectOpacity(){let t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t}_constrainScale(t){return Math.abs(t)0&&arguments[0]!==void 0&&arguments[0];if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!t&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned){if(this._cacheCanvas&&this._cacheContext&&!t){let e=this.cacheWidth/this.zoomX,n=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-e/2,-n/2,e,n)}return!0}return!1}_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 n=e.stroke;n&&(t.lineWidth=e.strokeWidth,t.lineCap=e.strokeLineCap,t.lineDashOffset=e.strokeDashOffset,t.lineJoin=e.strokeLineJoin,t.miterLimit=e.strokeMiterLimit,Ii(n)?n.gradientUnits==="percentage"||n.gradientTransform||n.patternTransform?this._applyPatternForTransformedGradient(t,n):(t.strokeStyle=n.toLive(t),this._applyPatternGradientTransform(t,n)):t.strokeStyle=e.stroke)}_setFillStyles(t,e){let{fill:n}=e;n&&(Ii(n)?(t.fillStyle=n.toLive(t),this._applyPatternGradientTransform(t,n)):t.fillStyle=n)}_setClippingProperties(t){t.globalAlpha=1,t.strokeStyle="transparent",t.fillStyle="#000000"}_setLineDash(t,e){e&&e.length!==0&&(1&e.length&&e.push(...e),t.setLineDash(e))}_setShadow(t){if(!this.shadow)return;let e=this.shadow,n=this.canvas,i=this.getCanvasRetinaScaling(),[s,,,o]=n?.viewportTransform||$n,a=s*i,c=o*i,l=e.nonScaling?new nt(1,1):this.getObjectScaling();t.shadowColor=e.color,t.shadowBlur=e.blur*Me.browserShadowBlurConstant*(a+c)*(l.x+l.y)/4,t.shadowOffsetX=e.offsetX*a*l.x,t.shadowOffsetY=e.offsetY*c*l.y}_removeShadow(t){this.shadow&&(t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0)}_applyPatternGradientTransform(t,e){if(!Ii(e))return{offsetX:0,offsetY:0};let n=e.gradientTransform||e.patternTransform,i=-this.width/2+e.offsetX||0,s=-this.height/2+e.offsetY||0;return e.gradientUnits==="percentage"?t.transform(this.width,0,0,this.height,i,s):t.transform(1,0,0,1,i,s),n&&t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),{offsetX:i,offsetY:s}}_renderPaintInOrder(t){this.paintFirst==="stroke"?(this._renderStroke(t),this._renderFill(t)):(this._renderFill(t),this._renderStroke(t))}_render(t){}_renderFill(t){this.fill&&(t.save(),this._setFillStyles(t,this),this.fillRule==="evenodd"?t.fill("evenodd"):t.fill(),t.restore())}_renderStroke(t){if(this.stroke&&this.strokeWidth!==0){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 n;let i=this._limitCacheSize(this._getCacheCanvasDimensions()),s=ln(),o=this.getCanvasRetinaScaling(),a=i.x/this.scaleX/o,c=i.y/this.scaleY/o;s.width=Math.ceil(a),s.height=Math.ceil(c);let l=s.getContext("2d");l&&(l.beginPath(),l.moveTo(0,0),l.lineTo(a,0),l.lineTo(a,c),l.lineTo(0,c),l.closePath(),l.translate(a/2,c/2),l.scale(i.zoomX/this.scaleX/o,i.zoomY/this.scaleY/o),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(o*this.scaleX/i.zoomX,o*this.scaleY/i.zoomY),t.strokeStyle=(n=l.createPattern(s,"no-repeat"))!==null&&n!==void 0?n:"")}_findCenterFromElement(){return new nt(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(It.getClass("image"))(e)}toCanvasElement(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=dm(this),n=this.group,i=this.shadow,s=Math.abs,o=t.enableRetinaScaling?rv():1,a=(t.multiplier||1)*o,c=t.canvasProvider||(C=>new Bl(C,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1}));delete this.group,t.withoutTransform&&Cv(this),t.withoutShadow&&(this.shadow=null),t.viewportTransform&&kp(this,this.getViewportTransform()),this.setCoords();let l=ln(),h=this.getBoundingRect(),u=this.shadow,d=new nt;if(u){let C=u.blur,v=u.nonScaling?new nt(1,1):this.getObjectScaling();d.x=2*Math.round(s(u.offsetX)+C)*s(v.x),d.y=2*Math.round(s(u.offsetY)+C)*s(v.y)}let f=h.width+d.x,m=h.height+d.y;l.width=Math.ceil(f),l.height=Math.ceil(m);let g=c(l);t.format==="jpeg"&&(g.backgroundColor="#fff"),this.setPositionByOrigin(new nt(g.width/2,g.height/2),_e,_e);let x=this.canvas;g._objects=[this],this.set("canvas",g),this.setCoords();let p=g.toCanvasElement(a||1,t);return this.set("canvas",x),this.shadow=i,n&&(this.group=n),this.set(e),this.setCoords(),g._objects=[],g.destroy(),p}toDataURL(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return cm(this.toCanvasElement(t),t.format||"png",t.quality||1)}isType(){for(var t=arguments.length,e=new Array(t),n=0;n1&&arguments[1]!==void 0?arguments[1]:{},{extraParam:i}=n,s=Oe(n,ZT);return Rl(Ol(e),s).then(o=>{let a=G(G({},s),o);if(i){let{[i]:c}=a;return new this(c,Oe(a,[i].map(iv)))}return new this(a)})}static fromObject(t,e){return this._fromObject(t,e)}};W(no,"stateProperties",YT),W(no,"cacheProperties",Ur),W(no,"ownDefaults",qT),W(no,"type","FabricObject"),It.setClass(no),It.setClass(no,"object");var Ms=(r,t)=>(e,n,i,s)=>{let o=t(e,n,i,s);return o&&Ev(r,yv(e,n,i,s)),o};function po(r){return(t,e,n,i)=>{let{target:s,originX:o,originY:a}=e,c=s.getRelativeCenterPoint(),l=s.translateToOriginPoint(c,o,a),h=r(t,e,n,i);return s.setPositionByOrigin(l,e.originX,e.originY),h}}var Hp=Ms("resizing",po((r,t,e,n)=>{let i=P0(t,t.originX,t.originY,e,n);if(t.originX===_e||t.originX===cn&&i.x<0||t.originX===Fe&&i.x>0){let{target:s}=t,o=s.strokeWidth/(s.strokeUniform?s.scaleX:1),a=_v(t)?2:1,c=s.width,l=Math.ceil(Math.abs(i.x*a/s.scaleX)-o);return s.set("width",Math.max(l,0)),c!==s.width}return!1}));function Fv(r,t,e,n,i){n=n||{};let s=this.sizeX||n.cornerSize||i.cornerSize,o=this.sizeY||n.cornerSize||i.cornerSize,a=n.transparentCorners!==void 0?n.transparentCorners:i.transparentCorners,c=a?"stroke":"fill",l=!a&&(n.cornerStrokeColor||i.cornerStrokeColor),h,u=t,d=e;r.save(),r.fillStyle=n.cornerColor||i.cornerColor||"",r.strokeStyle=n.cornerStrokeColor||i.cornerStrokeColor||"",s>o?(h=s,r.scale(1,o/s),d=e*s/o):o>s?(h=o,r.scale(s/o,1),u=t*o/s):h=s,r.lineWidth=1,r.beginPath(),r.arc(u,d,h/2,0,Nr,!1),r[c](),l&&r.stroke(),r.restore()}function Pv(r,t,e,n,i){n=n||{};let s=this.sizeX||n.cornerSize||i.cornerSize,o=this.sizeY||n.cornerSize||i.cornerSize,a=n.transparentCorners!==void 0?n.transparentCorners:i.transparentCorners,c=a?"stroke":"fill",l=!a&&(n.cornerStrokeColor||i.cornerStrokeColor),h=s/2,u=o/2;r.save(),r.fillStyle=n.cornerColor||i.cornerColor||"",r.strokeStyle=n.cornerStrokeColor||i.cornerStrokeColor||"",r.lineWidth=1,r.translate(t,e);let d=i.getTotalAngle();r.rotate(nn(d)),r["".concat(c,"Rect")](-h,-u,s,o),l&&r.strokeRect(-h,-u,s,o),r.restore()}var Nn=class{constructor(t){W(this,"visible",!0),W(this,"actionName","scale"),W(this,"angle",0),W(this,"x",0),W(this,"y",0),W(this,"offsetX",0),W(this,"offsetY",0),W(this,"sizeX",0),W(this,"sizeY",0),W(this,"touchSizeX",0),W(this,"touchSizeY",0),W(this,"cursorStyle","crosshair"),W(this,"withConnection",!1),Object.assign(this,t)}shouldActivate(t,e,n,i){var s;let{tl:o,tr:a,br:c,bl:l}=i;return((s=e.canvas)===null||s===void 0?void 0:s.getActiveObject())===e&&e.isControlVisible(t)&&co.isPointInPolygon(n,[o,a,c,l])}getActionHandler(t,e,n){return this.actionHandler}getMouseDownHandler(t,e,n){return this.mouseDownHandler}getMouseUpHandler(t,e,n){return this.mouseUpHandler}cursorStyleHandler(t,e,n){return e.cursorStyle}getActionName(t,e,n){return e.actionName}getVisibility(t,e){var n,i;return(n=(i=t._controlsVisibility)===null||i===void 0?void 0:i[e])!==null&&n!==void 0?n:this.visible}setVisibility(t,e,n){this.visible=t}positionHandler(t,e,n,i){return new nt(this.x*t.x+this.offsetX,this.y*t.y+this.offsetY).transform(e)}calcCornerCoords(t,e,n,i,s,o){let a=Qa([tc(n,i),ec({angle:t}),T0((s?this.touchSizeX:this.sizeX)||e,(s?this.touchSizeY:this.sizeY)||e)]);return{tl:new nt(-.5,-.5).transform(a),tr:new nt(.5,-.5).transform(a),bl:new nt(-.5,.5).transform(a),br:new nt(.5,.5).transform(a)}}render(t,e,n,i,s){((i=i||{}).cornerStyle||s.cornerStyle)==="circle"?Fv.call(this,t,e,n,i,s):Pv.call(this,t,e,n,i,s)}},kv=(r,t,e)=>e.lockRotation?h0:t.cursorStyle,Rv=Ms("rotating",po((r,t,e,n)=>{let{target:i,ex:s,ey:o,theta:a,originX:c,originY:l}=t,h=i.translateToOriginPoint(i.getRelativeCenterPoint(),c,l);if($i(i,"lockRotation"))return!1;let u=Math.atan2(o-h.y,s-h.x),d=Math.atan2(n-h.y,e-h.x),f=ho(d-u+a);if(i.snapAngle&&i.snapAngle>0){let g=i.snapAngle,x=i.snapThreshold||g,p=Math.ceil(f/g)*g,C=Math.floor(f/g)*g;Math.abs(f-C){let n=Iv(r,e);if(Ov(e,t.x!==0&&t.y===0?"x":t.x===0&&t.y!==0?"y":"",n))return h0;let i=bv(e,t);return"".concat(KT[i],"-resize")};function mm(r,t,e,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{},s=t.target,o=i.by,a=Iv(r,s),c,l,h,u,d,f;if(Ov(s,o,a))return!1;if(t.gestureScale)l=t.scaleX*t.gestureScale,h=t.scaleY*t.gestureScale;else{if(c=P0(t,t.originX,t.originY,e,n),d=o!=="y"?Math.sign(c.x||t.signX||1):1,f=o!=="x"?Math.sign(c.y||t.signY||1):1,t.signX||(t.signX=d),t.signY||(t.signY=f),$i(s,"lockScalingFlip")&&(t.signX!==d||t.signY!==f))return!1;if(u=s._getTransformedDimensions(),a&&!o){let x=Math.abs(c.x)+Math.abs(c.y),{original:p}=t,C=x/(Math.abs(u.x*p.scaleX/s.scaleX)+Math.abs(u.y*p.scaleY/s.scaleY));l=p.scaleX*C,h=p.scaleY*C}else l=Math.abs(c.x*s.scaleX/u.x),h=Math.abs(c.y*s.scaleY/u.y);_v(t)&&(l*=2,h*=2),t.signX!==d&&o!=="y"&&(t.originX=I5(t.originX),l*=-1,t.signX=d),t.signY!==f&&o!=="x"&&(t.originY=I5(t.originY),h*=-1,t.signY=f)}let m=s.scaleX,g=s.scaleY;return o?(o==="x"&&s.set("scaleX",l),o==="y"&&s.set("scaleY",h)):(!$i(s,"lockScalingX")&&s.set("scaleX",l),!$i(s,"lockScalingY")&&s.set("scaleY",h)),m!==s.scaleX||g!==s.scaleY}var Cl=Ms("scaling",po((r,t,e,n)=>mm(r,t,e,n))),Lv=Ms("scaling",po((r,t,e,n)=>mm(r,t,e,n,{by:"x"}))),Nv=Ms("scaling",po((r,t,e,n)=>mm(r,t,e,n,{by:"y"}))),JT=["target","ex","ey","skewingSide"],Ep={x:{counterAxis:"y",scale:"scaleX",skew:"skewX",lockSkewing:"lockSkewingX",origin:"originX",flip:"flipX"},y:{counterAxis:"x",scale:"scaleY",skew:"skewY",lockSkewing:"lockSkewingY",origin:"originY",flip:"flipY"}},QT=["ns","nesw","ew","nwse"],Uv=(r,t,e)=>{if(t.x!==0&&$i(e,"lockSkewingY")||t.y!==0&&$i(e,"lockSkewingX"))return h0;let n=bv(e,t)%4;return"".concat(QT[n],"-resize")};function Vv(r,t,e,n,i){let{target:s}=e,{counterAxis:o,origin:a,lockSkewing:c,skew:l,flip:h}=Ep[r];if($i(s,c))return!1;let{origin:u,flip:d}=Ep[o],f=vs(e[u])*(s[d]?-1:1),m=-Math.sign(f)*(s[h]?-1:1),g=.5*-((s[l]===0&&P0(e,_e,_e,n,i)[r]>0||s[l]>0?1:-1)*m)+.5;return Ms("skewing",po((p,C,v,_)=>function(A,b,S){let{target:w,ex:E,ey:y,skewingSide:D}=b,F=Oe(b,JT),{skew:T}=Ep[A],z=S.subtract(new nt(E,y)).divide(new nt(w.scaleX,w.scaleY))[A],H=w[T],tt=F[T],it=Math.tan(nn(tt)),Y=A==="y"?w._getTransformedDimensions({scaleX:1,scaleY:1,skewX:0}).x:w._getTransformedDimensions({scaleX:1,scaleY:1}).y,$=2*z*D/Math.max(Y,1)+it,ct=ho(Math.atan($));w.set(T,ct);let _t=H!==w[T];if(_t&&A==="y"){let{skewX:bt,scaleX:se}=w,K=w._getTransformedDimensions({skewY:H}),L=w._getTransformedDimensions(),j=bt!==0?K.x/L.x:1;j!==1&&w.set("scaleX",j*se)}return _t}(r,C,new nt(v,_))))(t,G(G({},e),{},{[a]:g,skewingSide:m}),n,i)}var zv=(r,t,e,n)=>Vv("x",r,t,e,n),Hv=(r,t,e,n)=>Vv("y",r,t,e,n);function I0(r,t){return r[t.canvas.altActionKey]}var vl=(r,t,e)=>{let n=I0(r,e);return t.x===0?n?"skewX":"scaleY":t.y===0?n?"skewY":"scaleX":""},so=(r,t,e)=>I0(r,e)?Uv(0,t,e):Sa(r,t,e),Gp=(r,t,e,n)=>I0(r,t.target)?Hv(r,t,e,n):Lv(r,t,e,n),Wp=(r,t,e,n)=>I0(r,t.target)?zv(r,t,e,n):Nv(r,t,e,n),gm=()=>({ml:new Nn({x:-.5,y:0,cursorStyleHandler:so,actionHandler:Gp,getActionName:vl}),mr:new Nn({x:.5,y:0,cursorStyleHandler:so,actionHandler:Gp,getActionName:vl}),mb:new Nn({x:0,y:.5,cursorStyleHandler:so,actionHandler:Wp,getActionName:vl}),mt:new Nn({x:0,y:-.5,cursorStyleHandler:so,actionHandler:Wp,getActionName:vl}),tl:new Nn({x:-.5,y:-.5,cursorStyleHandler:Sa,actionHandler:Cl}),tr:new Nn({x:.5,y:-.5,cursorStyleHandler:Sa,actionHandler:Cl}),bl:new Nn({x:-.5,y:.5,cursorStyleHandler:Sa,actionHandler:Cl}),br:new Nn({x:.5,y:.5,cursorStyleHandler:Sa,actionHandler:Cl}),mtr:new Nn({x:0,y:-.5,actionHandler:Rv,cursorStyleHandler:kv,offsetY:-40,withConnection:!0,actionName:"rotate"})}),Gv=()=>({mr:new Nn({x:.5,y:0,actionHandler:Hp,cursorStyleHandler:so,actionName:"resizing"}),ml:new Nn({x:-.5,y:0,actionHandler:Hp,cursorStyleHandler:so,actionName:"resizing"})}),Wv=()=>G(G({},gm()),Gv()),m0=class r extends no{static getDefaults(){return G(G({},super.getDefaults()),{},{controls:gm()},r.ownDefaults)}_updateCacheCanvas(){let t=this.canvas;if(this.noScaleCache&&t&&t._currentTransform){let e=t._currentTransform,n=e.target,i=e.action;if(this===n&&i&&i.startsWith("scale"))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&&arguments[1]!==void 0&&arguments[1];if(!this.hasControls||!this.canvas)return;this.__corner=void 0;let n=Object.entries(this.oCoords);for(let i=n.length-1;i>=0;i--){let[s,o]=n[i],a=this.controls[s];if(a.shouldActivate(s,this,t,e?o.touchCorner:o.corner))return this.__corner=s,{key:s,control:a,coord:this.oCoords[s]}}}calcOCoords(){let t=this.getViewportTransform(),e=this.getCenterPoint(),n=tc(e.x,e.y),i=ec({angle:this.getTotalAngle()-(this.group&&this.flipX?180:0)}),s=Dn(n,i),o=Dn(t,s),a=Dn(o,[1/t[0],0,0,1/t[3],0,0]),c=this.group?qa(this.calcTransformMatrix()):void 0,l=this._calculateCurrentDimensions(c),h={};return this.forEachControl((u,d)=>{let f=u.positionHandler(l,a,this,u);h[d]=Object.assign(f,this._calcCornerCoords(u,f))}),h}_calcCornerCoords(t,e){let n=this.getTotalAngle();return{corner:t.calcCornerCoords(n,this.cornerSize,e.x,e.y,!1,this),touchCorner:t.calcCornerCoords(n,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(),n=this._calculateCurrentDimensions(),i=this.getViewportTransform();t.translate(e.x,e.y),t.scale(1/i[0],1/i[3]),t.rotate(nn(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-n.x/2,-n.y/2,n.x,n.y),t.restore()}strokeBorders(t,e){t.strokeRect(-e.x/2,-e.y/2,e.x,e.y)}_drawBorders(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=G({hasControls:this.hasControls,borderColor:this.borderColor,borderDashArray:this.borderDashArray},n);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&&arguments[1]!==void 0?arguments[1]:{},{hasBorders:n,hasControls:i}=this,s=G({hasBorders:n,hasControls:i},e),o=this.getViewportTransform(),a=s.hasBorders,c=s.hasControls,l=Dn(o,this.calcTransformMatrix()),h=qa(l);t.save(),t.translate(h.translateX,h.translateY),t.lineWidth=1*this.borderScaleFactor,this.group===this.parent&&(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(h.angle-=180),t.rotate(nn(this.group?h.angle:this.angle)),a&&this.drawBorders(t,h,e),c&&this.drawControls(t,e),t.restore()}drawBorders(t,e,n){let i;if(n&&n.forActiveSelection||this.group){let s=F0(this.width,this.height,kl(e)),o=this.isStrokeAccountedForInDimensions()?am:(this.strokeUniform?new nt().scalarAdd(this.canvas?this.canvas.getZoom():1):new nt(e.scaleX,e.scaleY)).scalarMultiply(this.strokeWidth);i=s.add(o).scalarAdd(this.borderScaleFactor).scalarAdd(2*this.padding)}else i=this._calculateCurrentDimensions().scalarAdd(this.borderScaleFactor);this._drawBorders(t,i,n)}drawControlsConnectingLines(t,e){let n=!1;t.beginPath(),this.forEachControl((i,s)=>{i.withConnection&&i.getVisibility(this,s)&&(n=!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))}),n&&t.stroke()}drawControls(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};t.save();let n=this.getCanvasRetinaScaling(),{cornerStrokeColor:i,cornerDashArray:s,cornerColor:o}=this,a=G({cornerStrokeColor:i,cornerDashArray:s,cornerColor:o},e);t.setTransform(n,0,0,n,0,0),t.strokeStyle=t.fillStyle=a.cornerColor,this.transparentCorners||(t.strokeStyle=a.cornerStrokeColor),this._setLineDash(t,a.cornerDashArray),this.setCoords(),this.forEachControl((c,l)=>{if(c.getVisibility(this,l)){let h=this.oCoords[l];c.render(t,h.x,h.y,a,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&&arguments[0]!==void 0?arguments[0]:{};Object.entries(t).forEach(e=>{let[n,i]=e;return this.setControlVisible(n,i)})}clearContextTop(t){if(!this.canvas)return;let e=this.canvas.contextTop;if(!e)return;let n=this.canvas.viewportTransform;e.save(),e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this.transform(e);let i=this.width+4,s=this.height+4;return e.clearRect(-i/2,-s/2,i,s),t||e.restore(),e}onDeselect(t){return!1}onSelect(t){return!1}shouldStartDragging(){return!1}onDragStart(t){return!1}canDrop(t){return!1}renderDragSourceEffect(t){}renderDropTargetEffect(t){}};function jv(r,t){return t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(n=>{n!=="constructor"&&Object.defineProperty(r.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n)||Object.create(null))})}),r}W(m0,"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});var hn=class extends m0{};jv(hn,[u0]),It.setClass(hn),It.setClass(hn,"object");var Xv=(r,t,e,n)=>{let i=2*(n=Math.round(n))+1,{data:s}=r.getImageData(t-n,e-n,i,i);for(let o=3;o0)return!1;return!0},g0=class{constructor(t){this.options=t,this.strokeProjectionMagnitude=this.options.strokeWidth/2,this.scale=new nt(this.options.scaleX,this.options.scaleY),this.strokeUniformScalar=this.options.strokeUniform?new nt(1/this.options.scaleX,1/this.options.scaleY):new nt(1,1)}createSideVector(t,e){let n=d0(t,e);return this.options.strokeUniform?n.multiply(this.scale):n}projectOrthogonally(t,e,n){return this.applySkew(t.add(this.calcOrthogonalProjection(t,e,n)))}isSkewed(){return this.options.skewX!==0||this.options.skewY!==0}applySkew(t){let e=new nt(t);return e.y+=e.x*Math.tan(nn(this.options.skewY)),e.x+=e.y*Math.tan(nn(this.options.skewX)),e}scaleUnitVector(t,e){return t.multiply(this.strokeUniformScalar).scalarMultiply(e)}},t3=new nt,C0=class r extends g0{static getOrthogonalRotationFactor(t,e){let n=e?x0(t,e):Dv(t);return Math.abs(n)2&&arguments[2]!==void 0?arguments[2]:this.strokeProjectionMagnitude,i=this.createSideVector(t,e),s=pm(i),o=r.getOrthogonalRotationFactor(s,this.bisector);return this.scaleUnitVector(s,n*o)}projectBevel(){let t=[];return(this.alpha%Nr==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=Math.abs(this.alpha),n=1/Math.sin(e/2),i=this.scaleUnitVector(this.bisector,-this.strokeProjectionMagnitude*n),s=this.options.strokeUniform?f0(this.scaleUnitVector(this.bisector,this.options.strokeMiterLimit)):this.options.strokeMiterLimit;return f0(i)/this.strokeProjectionMagnitude<=s&&t.push(this.applySkew(this.A.add(i))),t.push(...this.projectBevel()),t}projectRoundNoSkew(t,e){let n=[],i=new nt(r.getOrthogonalRotationFactor(this.bisector),r.getOrthogonalRotationFactor(new nt(this.bisector.y,this.bisector.x)));return[new nt(1,0).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i),new nt(0,1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i)].forEach(s=>{Np(s,t,e)&&n.push(this.A.add(s))}),n}projectRoundWithSkew(t,e){let n=[],{skewX:i,skewY:s,scaleX:o,scaleY:a,strokeUniform:c}=this.options,l=new nt(Math.tan(nn(i)),Math.tan(nn(s))),h=this.strokeProjectionMagnitude,u=c?h/a/Math.sqrt(1/a**2+1/o**2*l.y**2):h/Math.sqrt(1+l.y**2),d=new nt(Math.sqrt(Math.max(h**2-u**2,0)),u),f=c?h/Math.sqrt(1+l.x**2*(1/a)**2/(1/o+1/o*l.x*l.y)**2):h/Math.sqrt(1+l.x**2/(1+l.x*l.y)**2),m=new nt(f,Math.sqrt(Math.max(h**2-f**2,0)));return[m,m.scalarMultiply(-1),d,d.scalarMultiply(-1)].map(g=>this.applySkew(c?g.multiply(this.strokeUniformScalar):g)).forEach(g=>{Np(g,t,e)&&n.push(this.applySkew(this.A).add(g))}),n}projectRound(){let t=[];t.push(...this.projectBevel());let e=this.alpha%Nr==0,n=this.applySkew(this.A),i=t[e?0:2].subtract(n),s=t[e?1:0].subtract(n),o=e?this.applySkew(this.AB.scalarMultiply(-1)):this.applySkew(this.bisector.multiply(this.strokeUniformScalar).scalarMultiply(-1)),a=Fa(i,o)>0,c=a?i:s,l=a?s:i;return this.isSkewed()?t.push(...this.projectRoundWithSkew(c,l)):t.push(...this.projectRoundNoSkew(c,l)),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}))}},v0=class extends g0{constructor(t,e,n){super(n),this.A=new nt(t),this.T=new nt(e)}calcOrthogonalProjection(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.strokeProjectionMagnitude,i=this.createSideVector(t,e);return this.scaleUnitVector(pm(i),n)}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 nt(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 C0(this.A,this.T,this.T,this.options).projectRound());return t}projectSquare(){let t=[];if(this.A.eq(this.T)){let e=new nt(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),n=this.scaleUnitVector(k0(this.createSideVector(this.A,this.T)),-this.strokeProjectionMagnitude),i=this.A.add(n);t.push(i.add(e),i.subtract(e))}return t.map(e=>this.applySkew(e))}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}))}},Yv=function(r,t){let e=arguments.length>2&&arguments[2]!==void 0&&arguments[2],n=[];if(r.length===0)return n;let i=r.reduce((s,o)=>(s[s.length-1].eq(o)||s.push(new nt(o)),s),[new nt(r[0])]);if(i.length===1)e=!0;else if(!e){let s=i[0],o=((a,c)=>{for(let l=a.length-1;l>=0;l--)if(c(a[l],l,a))return l;return-1})(i,a=>!a.eq(s));i.splice(o+1)}return i.forEach((s,o,a)=>{let c,l;o===0?(l=a[1],c=e?s:a[a.length-1]):o===a.length-1?(c=a[o-1],l=e?s:a[0]):(c=a[o-1],l=a[o+1]),e&&a.length===1?n.push(...new v0(s,s,t).project()):!e||o!==0&&o!==a.length-1?n.push(...new C0(s,c,l,t).project()):n.push(...new v0(s,o===0?l:c,t).project())}),n},qv=r=>r.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"),O0=r=>{let t=[];for(let e,n=0;n{let e=r.charCodeAt(t);if(isNaN(e))return"";if(e<55296||e>57343)return r.charAt(t);if(55296<=e&&e<=56319){if(r.length<=t+1)throw"High surrogate without following low surrogate";let i=r.charCodeAt(t+1);if(56320>i||i>57343)throw"High surrogate without following low surrogate";return r.charAt(t)+r.charAt(t+1)}if(t===0)throw"Low surrogate without preceding high surrogate";let n=r.charCodeAt(t-1);if(55296>n||n>56319)throw"Low surrogate without preceding high surrogate";return!1},n3=Object.freeze({__proto__:null,capitalize:function(r){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return"".concat(r.charAt(0).toUpperCase()).concat(t?r.slice(1):r.slice(1).toLowerCase())},escapeXml:qv,graphemeSplit:O0}),L0=function(r,t){let e=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return r.fill!==t.fill||r.stroke!==t.stroke||r.strokeWidth!==t.strokeWidth||r.fontSize!==t.fontSize||r.fontFamily!==t.fontFamily||r.fontWeight!==t.fontWeight||r.fontStyle!==t.fontStyle||r.textBackgroundColor!==t.textBackgroundColor||r.deltaY!==t.deltaY||e&&(r.overline!==t.overline||r.underline!==t.underline||r.linethrough!==t.linethrough)},$v=(r,t)=>{let e=t.split(` +`),n=[],i=-1,s={};r=Ol(r);for(let o=0;o0&&(L0(s,l,!0)?n.push({start:i,end:i+1,style:l}):n[n.length-1].end++),s=l||{}}else i+=a.length,s={}}return n},Zv=(r,t)=>{if(!Array.isArray(r))return Ol(r);let e=t.split(om),n={},i=-1,s=0;for(let o=0;o{var t;return(t=XT[r])!==null&&t!==void 0?t:r},Kv=r=>r.replace(new RegExp("(".concat(pr,")"),"gi")," $1 ").replace(/,/gi," ").replace(/\s+/gi," "),G5,W5,j5,X5,Y5,q5,$5,qn="(".concat(pr,")"),s3=String.raw(G5||(G5=vr(["(skewX)(",")"],["(skewX)\\(","\\)"])),qn),o3=String.raw(W5||(W5=vr(["(skewY)(",")"],["(skewY)\\(","\\)"])),qn),a3=String.raw(j5||(j5=vr(["(rotate)(","(?: "," ",")?)"],["(rotate)\\(","(?: "," ",")?\\)"])),qn,qn,qn),c3=String.raw(X5||(X5=vr(["(scale)(","(?: ",")?)"],["(scale)\\(","(?: ",")?\\)"])),qn,qn),l3=String.raw(Y5||(Y5=vr(["(translate)(","(?: ",")?)"],["(translate)\\(","(?: ",")?\\)"])),qn,qn),h3=String.raw(q5||(q5=vr(["(matrix)("," "," "," "," "," ",")"],["(matrix)\\("," "," "," "," "," ","\\)"])),qn,qn,qn,qn,qn,qn),Cm="(?:".concat(h3,"|").concat(l3,"|").concat(a3,"|").concat(c3,"|").concat(s3,"|").concat(o3,")"),u3="(?:".concat(Cm,"*)"),d3=String.raw($5||($5=vr(["^s*(?:","?)s*$"],["^\\s*(?:","?)\\s*$"])),u3),f3=new RegExp(d3),x3=new RegExp(Cm,"g");function jp(r){let t=[];if(!(r=Kv(r).replace(/\s*([()])\s*/gi,"$1"))||r&&!f3.test(r))return[...$n];for(let e of r.matchAll(x3)){let n=new RegExp(Cm).exec(e[0]);if(!n)continue;let i=$n,s=n.filter(m=>!!m),[,o,...a]=s,[c,l,h,u,d,f]=a.map(m=>parseFloat(m));switch(o){case"translate":i=tc(c,l);break;case"rotate":i=ec({angle:c},{x:l,y:h});break;case"scale":i=T0(c,l);break;case"skewX":i=lm(c);break;case"skewY":i=hm(c);break;case"matrix":i=[c,l,h,u,d,f]}t.push(i)}return Qa(t)}function p3(r,t,e,n){let i=Array.isArray(t),s,o=t;if(r!=="fill"&&r!=="stroke"||t!==ii){if(r==="strokeUniform")return t==="non-scaling-stroke";if(r==="strokeDashArray")o=t===ii?null:t.replace(/,/g," ").split(/\s+/).map(parseFloat);else if(r==="transformMatrix")o=e&&e.transformMatrix?Dn(e.transformMatrix,jp(t)):jp(t);else if(r==="visible")o=t!==ii&&t!=="hidden",e&&e.visible===!1&&(o=!1);else if(r==="opacity")o=parseFloat(t),e&&e.opacity!==void 0&&(o*=e.opacity);else if(r==="textAnchor")o=t==="start"?Fe:t==="end"?cn:_e;else if(r==="charSpacing")s=ao(t,n)/n*1e3;else if(r==="paintFirst"){let a=t.indexOf("fill"),c=t.indexOf("stroke");o="fill",(a>-1&&c>-1&&c-1)&&(o="stroke")}else{if(r==="href"||r==="xlink:href"||r==="font")return t;if(r==="imageSmoothing")return t==="optimizeQuality";s=i?t.map(ao):ao(t,n)}}else o="";return!i&&isNaN(s)?o:s}function m3(r,t){let e=r.match(jT);if(!e)return;let n=e[1],i=e[3],s=e[4],o=e[5],a=e[6];n&&(t.fontStyle=n),i&&(t.fontWeight=isNaN(parseFloat(i))?i:parseFloat(i)),s&&(t.fontSize=ao(s)),a&&(t.fontFamily=a),o&&(t.lineHeight=o==="normal"?1:o)}function g3(r){let t={},e=r.getAttribute("style");return e&&(typeof e=="string"?function(n,i){n.replace(/;\s*$/,"").split(";").forEach(s=>{let[o,a]=s.split(":");i[o.trim().toLowerCase()]=a.trim()})}(e,t):function(n,i){Object.entries(n).forEach(s=>{let[o,a]=s;a!==void 0&&(i[o.toLowerCase()]=a)})}(e,t)),t}var C3={stroke:"strokeOpacity",fill:"fillOpacity"};function Vr(r,t,e){if(!r)return{};let n,i={},s=sm;r.parentNode&&V5.test(r.parentNode.nodeName)&&(i=Vr(r.parentElement,t,e),i.fontSize&&(n=s=ao(i.fontSize)));let o=G(G(G({},t.reduce((l,h)=>{let u=r.getAttribute(h);return u&&(l[h]=u),l},{})),function(l){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u={};for(let d in h)i3(l,d.split(" "))&&(u=G(G({},u),h[d]));return u}(r,e)),g3(r));o[vp]&&r.setAttribute(vp,o[vp]),o[Cp]&&(n=ao(o[Cp],s),o[Cp]="".concat(n));let a={};for(let l in o){let h=r3(l),u=p3(h,o[l],i,n);a[h]=u}a&&a.font&&m3(a.font,a);let c=G(G({},i),a);return V5.test(r.nodeName)?c:function(l){let h=hn.getDefaults();return Object.entries(C3).forEach(u=>{let[d,f]=u;if(l[f]===void 0||l[d]==="")return;if(l[d]===void 0){if(!h[d])return;l[d]=h[d]}if(l[d].indexOf("url(")===0)return;let m=new Zn(l[d]);l[d]=m.setAlpha(we(m.getAlpha()*l[f],2)).toRgba()}),l}(c)}var v3=["left","top","width","height","visible"],Jv=["rx","ry"],Ir=class r extends hn{static getDefaults(){return G(G({},super.getDefaults()),r.ownDefaults)}constructor(t){super(t),this._initRxRy()}_initRxRy(){let{rx:t,ry:e}=this;t&&!e?this.ry=t:e&&!t&&(this.rx=e)}_render(t){let{width:e,height:n}=this,i=-e/2,s=-n/2,o=this.rx?Math.min(this.rx,e/2):0,a=this.ry?Math.min(this.ry,n/2):0,c=o!==0||a!==0;t.beginPath(),t.moveTo(i+o,s),t.lineTo(i+e-o,s),c&&t.bezierCurveTo(i+e-ps*o,s,i+e,s+ps*a,i+e,s+a),t.lineTo(i+e,s+n-a),c&&t.bezierCurveTo(i+e,s+n-ps*a,i+e-ps*o,s+n,i+e-o,s+n),t.lineTo(i+o,s+n),c&&t.bezierCurveTo(i+ps*o,s+n,i,s+n-ps*a,i,s+n-a),t.lineTo(i,s+a),c&&t.bezierCurveTo(i,s+ps*a,i+ps*o,s,i+o,s),t.closePath(),this._renderPaintInOrder(t)}toObject(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return super.toObject([...Jv,...t])}_toSVG(){let{width:t,height:e,rx:n,ry:i}=this;return[" +`)]}static fromElement(t,e,n){return dt(this,null,function*(){let i=Vr(t,this.ATTRIBUTE_NAMES,n),{left:s=0,top:o=0,width:a=0,height:c=0,visible:l=!0}=i,h=Oe(i,v3);return new this(G(G(G({},e),h),{},{left:s,top:o,width:a,height:c,visible:!!(l&&a&&c)}))})}};W(Ir,"type","Rect"),W(Ir,"cacheProperties",[...Ur,...Jv]),W(Ir,"ownDefaults",{rx:0,ry:0}),W(Ir,"ATTRIBUTE_NAMES",[...Ds,"x","y","rx","ry","width","height"]),It.setClass(Ir),It.setSVGClass(Ir);var Lr="initialization",E0="added",vm="removed",_0="imperative",Qv=(r,t)=>{let{strokeUniform:e,strokeWidth:n,width:i,height:s,group:o}=t,a=o&&o!==r?Il(o.calcTransformMatrix(),r.calcTransformMatrix()):null,c=a?t.getRelativeCenterPoint().transform(a):t.getRelativeCenterPoint(),l=!t.isStrokeAccountedForInDimensions(),h=e&&l?vv(new nt(n,n),void 0,r.calcTransformMatrix()):am,u=!e&&l?n:0,d=F0(i+u,s+u,Qa([a,t.calcOwnMatrix()],!0)).add(h).scalarDivide(2);return[c.subtract(d),c.add(d)]},Ka=class{calcLayoutResult(t,e){if(this.shouldPerformLayout(t))return this.calcBoundingBox(e,t)}shouldPerformLayout(t){return t.type===Lr||t.type===_0||!!t.prevStrategy&&t.strategy!==t.prevStrategy}shouldLayoutClipPath(t){let{type:e,target:{clipPath:n}}=t;return e!==Lr&&n&&!n.absolutePositioned}getInitialSize(t,e){return e.size}calcBoundingBox(t,e){if(e.type===_0&&e.overrides)return e.overrides;if(t.length===0)return;let{target:n}=e,{left:i,top:s,width:o,height:a}=mr(t.map(h=>Qv(n,h)).reduce((h,u)=>h.concat(u),[])),c=new nt(o,a),l=new nt(i,s).add(c.scalarDivide(2));if(e.type===Lr){let h=this.getInitialSize(e,{size:c,center:l});return{center:l,relativeCorrection:new nt(0,0),size:h}}return{center:l.transform(n.calcOwnMatrix()),size:c}}};W(Ka,"type","strategy");var Fl=class extends Ka{shouldPerformLayout(t){return!0}};W(Fl,"type","fit-content"),It.setClass(Fl);var E3=["strategy"],_3=["target","strategy","bubbles","prevStrategy"],tE="layoutManager",fo=class{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Fl;W(this,"strategy",void 0),this.strategy=t,this._subscriptions=new Map}performLayout(t){let e=G(G({bubbles:!0,strategy:this.strategy},t),{},{prevStrategy:this._prevLayoutStrategy,stopPropagation(){this.bubbles=!1}});this.onBeforeLayout(e);let n=this.getLayoutResult(e);n&&this.commitLayout(e,n),this.onAfterLayout(e,n),this._prevLayoutStrategy=e.strategy}attachHandlers(t,e){let{target:n}=e;return["modified","moving","resizing","rotating","scaling","skewing","changed","modifyPoly"].map(i=>t.on(i,s=>this.performLayout(i==="modified"?{type:"object_modified",trigger:i,e:s,target:n}:{type:"object_modifying",trigger:i,e:s,target:n})))}subscribe(t,e){this.unsubscribe(t,e);let n=this.attachHandlers(t,e);this._subscriptions.set(t,n)}unsubscribe(t,e){(this._subscriptions.get(t)||[]).forEach(n=>n()),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:n}=t,{canvas:i}=e;if(n===Lr||n===E0?this.subscribeTargets(t):n===vm&&this.unsubscribeTargets(t),e.fire("layout:before",{context:t}),i&&i.fire("object:layout:before",{target:e,context:t}),n===_0&&t.deep){let s=Oe(t,E3);e.forEachObject(o=>o.layoutManager&&o.layoutManager.performLayout(G(G({},s),{},{bubbles:!1,target:o})))}}getLayoutResult(t){let{target:e}=t,n=t.strategy.calcLayoutResult(t,e.getObjects());if(!n)return;let i=t.type===Lr?new nt:e.getRelativeCenterPoint(),{center:s,correction:o=new nt,relativeCorrection:a=new nt}=n,c=i.subtract(s).add(o).transform(t.type===Lr?$n:fi(e.calcOwnMatrix()),!0).add(a);return{result:n,prevCenter:i,nextCenter:s,offset:c}}commitLayout(t,e){let{target:n}=t,{result:{size:i},nextCenter:s}=e;var o,a;n.set({width:i.x,height:i.y}),this.layoutObjects(t,e),t.type===Lr?n.set({left:(o=t.x)!==null&&o!==void 0?o:s.x+i.x*vs(n.originX),top:(a=t.y)!==null&&a!==void 0?a:s.y+i.y*vs(n.originY)}):(n.setPositionByOrigin(s,_e,_e),n.setCoords(),n.set("dirty",!0))}layoutObjects(t,e){let{target:n}=t;n.forEachObject(i=>{i.group===n&&this.layoutObject(t,e,i)}),t.strategy.shouldLayoutClipPath(t)&&this.layoutObject(t,e,n.clipPath)}layoutObject(t,e,n){let{offset:i}=e;n.set({left:n.left+i.x,top:n.top+i.y})}onAfterLayout(t,e){let{target:n,strategy:i,bubbles:s,prevStrategy:o}=t,a=Oe(t,_3),{canvas:c}=n;n.fire("layout:after",{context:t,result:e}),c&&c.fire("object:layout:after",{context:t,result:e,target:n});let l=n.parent;s&&l!=null&&l.layoutManager&&((a.path||(a.path=[])).push(n),l.layoutManager.performLayout(G(G({},a),{},{target:l}))),n.set("dirty",!0)}dispose(){this._subscriptions.forEach(t=>t.forEach(e=>e())),this._subscriptions.clear()}toObject(){return{type:tE,strategy:this.strategy.constructor.type}}toJSON(){return this.toObject()}};It.setClass(fo,tE);var y3=["type","objects","layoutManager"],Xp=class extends fo{performLayout(){}},ys=class r extends sv(hn){static getDefaults(){return G(G({},super.getDefaults()),r.ownDefaults)}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e),W(this,"_activeObjects",[]),W(this,"__objectSelectionTracker",void 0),W(this,"__objectSelectionDisposer",void 0),this._objects=[...t],this.__objectSelectionTracker=this.__objectSelectionMonitor.bind(this,!0),this.__objectSelectionDisposer=this.__objectSelectionMonitor.bind(this,!1),this.forEachObject(n=>{this.enterGroup(n,!1)}),this.layoutManager=e.layoutManager||new fo,this.layoutManager.performLayout({type:Lr,target:this,targets:[...t],x:e.left,y:e.top})}canEnterGroup(t){return t===this||this.isDescendantOf(t)?(As("error","Group: circular object trees are not supported, this call has no effect"),!1):this._objects.indexOf(t)===-1||(As("error","Group: duplicate objects are not supported inside group, this call has no effect"),!1)}_filterObjectsBeforeEnteringGroup(t){return t.filter((e,n,i)=>this.canEnterGroup(e)&&i.indexOf(e)===n)}add(){for(var t=arguments.length,e=new Array(t),n=0;n1?e-1:0),i=1;i{i._set(t,e)}),this}_shouldSetNestedCoords(){return this.subTargetCheck}removeAll(){return this._activeObjects=[],this.remove(...this._objects)}__objectSelectionMonitor(t,e){let{target:n}=e,i=this._activeObjects;if(t)i.push(n),this._set("dirty",!0);else if(i.length>0){let s=i.indexOf(n);s>-1&&(i.splice(s,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&&Za(t,Dn(fi(this.calcTransformMatrix()),t.calcTransformMatrix())),this._shouldSetNestedCoords()&&t.setCoords(),t._set("group",this),t._set("canvas",this.canvas),this._watchObject(!0,t);let n=this.canvas&&this.canvas.getActiveObject&&this.canvas.getActiveObject();n&&(n===t||t.isDescendantOf(n))&&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||(Za(t,Dn(this.calcTransformMatrix(),t.calcTransformMatrix())),t.setCoords()),this._watchObject(!1,t);let n=this._activeObjects.length>0?this._activeObjects.indexOf(t):-1;n>-1&&this._activeObjects.splice(n,1)}shouldCache(){let t=hn.prototype.shouldCache.call(this);if(t){for(let e=0;et.setCoords())}triggerLayout(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.layoutManager.performLayout(G({target:this,type:_0},t))}render(t){this._transformDone=!0,super.render(t),this._transformDone=!1}__serializeObjects(t,e){let n=this.includeDefaultValues;return this._objects.filter(function(i){return!i.excludeFromExport}).map(function(i){let s=i.includeDefaultValues;i.includeDefaultValues=n;let o=i[t||"toObject"](e);return i.includeDefaultValues=s,o})}toObject(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=this.layoutManager.toObject();return G(G(G({},super.toObject(["subTargetCheck","interactive",...t])),e.strategy!=="fit-content"||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=Ir.prototype._toSVG.call(this),n=e.indexOf("COMMON_PARTS");e[n]='for="group" ';let i=e.join("");return t?t(i):i}_toSVG(t){let e=[" +`],n=this._createSVGBgRect(t);n&&e.push(" ",n);for(let i=0;i +`),e}getSvgStyles(){let t=this.opacity!==void 0&&this.opacity!==1?"opacity: ".concat(this.opacity,";"):"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")}toClipPathSVG(t){let e=[],n=this._createSVGBgRect(t);n&&e.push(" ",n);for(let i=0;i{let[a,c]=o,l=new this(a,G(G(G({},s),c),{},{layoutManager:new Xp}));if(i){let h=It.getClass(i.type),u=It.getClass(i.strategy);l.layoutManager=new h(new u)}else l.layoutManager=new fo;return l.layoutManager.subscribeTargets({type:Lr,target:l,targets:l.getObjects()}),l.setCoords(),l})}};W(ys,"type","Group"),W(ys,"ownDefaults",{strokeWidth:0,subTargetCheck:!1,interactive:!1}),It.setClass(ys);var eE=(r,t)=>Math.min(t.width/r.width,t.height/r.height),nE=(r,t)=>Math.max(t.width/r.width,t.height/r.height),Z5,He="(".concat(pr,")"),b3="(M) (?:".concat(He," ").concat(He," ?)+"),A3="(L) (?:".concat(He," ").concat(He," ?)+"),S3="(H) (?:".concat(He," ?)+"),w3="(V) (?:".concat(He," ?)+"),M3=String.raw(Z5||(Z5=vr(["(Z)s*"],["(Z)\\s*"]))),D3="(C) (?:".concat(He," ").concat(He," ").concat(He," ").concat(He," ").concat(He," ").concat(He," ?)+"),B3="(S) (?:".concat(He," ").concat(He," ").concat(He," ").concat(He," ?)+"),T3="(Q) (?:".concat(He," ").concat(He," ").concat(He," ").concat(He," ?)+"),F3="(T) (?:".concat(He," ").concat(He," ?)+"),P3="(A) (?:".concat(He," ").concat(He," ").concat(He," ([01]) ?([01]) ").concat(He," ").concat(He," ?)+"),K5="(?:(?:".concat(b3,")")+"|(?:".concat(A3,")")+"|(?:".concat(S3,")")+"|(?:".concat(w3,")")+"|(?:".concat(M3,")")+"|(?:".concat(D3,")")+"|(?:".concat(B3,")")+"|(?:".concat(T3,")")+"|(?:".concat(F3,")")+"|(?:".concat(P3,"))"),k3={m:"l",M:"L"},R3=(r,t,e,n,i,s,o,a,c,l,h)=>{let u=Zi(r),d=Ki(r),f=Zi(t),m=Ki(t),g=e*i*f-n*s*m+o,x=n*i*f+e*s*m+a;return["C",l+c*(-e*i*d-n*s*u),h+c*(-n*i*d+e*s*u),g+c*(e*i*m+n*s*f),x+c*(n*i*m-e*s*f),g,x]},J5=(r,t,e,n)=>{let i=Math.atan2(t,r),s=Math.atan2(n,e);return s>=i?s-i:2*Math.PI-(i-s)};function Yp(r,t,e,n,i,s,o,a){let c;if(Me.cachesBoundsOfCurve&&(c=[...arguments].join(),El.boundsOfCurveCache[c]))return El.boundsOfCurveCache[c];let l=Math.sqrt,h=Math.abs,u=[],d=[[0,0],[0,0]],f=6*r-12*e+6*i,m=-3*r+9*e-9*i+3*o,g=3*e-3*r;for(let _=0;_<2;++_){if(_>0&&(f=6*t-12*n+6*s,m=-3*t+9*n-9*s+3*a,g=3*n-3*t),h(m)<1e-12){if(h(f)<1e-12)continue;let E=-g/f;0{let[n,i,s,o,a,c,l,h]=e,u=((d,f,m,g,x,p,C)=>{if(m===0||g===0)return[];let v=0,_=0,A=0,b=Math.PI,S=C*rm,w=Ki(S),E=Zi(S),y=.5*(-E*d-w*f),D=.5*(-E*f+w*d),F=m**2,T=g**2,z=D**2,H=y**2,tt=F*T-F*z-T*H,it=Math.abs(m),Y=Math.abs(g);if(tt<0){let R=Math.sqrt(1-tt/(F*T));it*=R,Y*=R}else A=(x===p?-1:1)*Math.sqrt(tt/(F*z+T*H));let $=A*it*D/Y,ct=-A*Y*y/it,_t=E*$-w*ct+.5*d,bt=w*$+E*ct+.5*f,se=J5(1,0,(y-$)/it,(D-ct)/Y),K=J5((y-$)/it,(D-ct)/Y,(-y-$)/it,(-D-ct)/Y);p===0&&K>0?K-=2*b:p===1&&K<0&&(K+=2*b);let L=Math.ceil(Math.abs(K/b*2)),j=new Array(L),O=K/L,et=8/3*Math.sin(O/4)*Math.sin(O/4)/Math.sin(O/2),Z=se+O;for(let R=0;R{let t=0,e=0,n=0,i=0,s=[],o,a=0,c=0;for(let l of r){let h=[...l],u;switch(h[0]){case"l":h[1]+=t,h[2]+=e;case"L":t=h[1],e=h[2],u=["L",t,e];break;case"h":h[1]+=t;case"H":t=h[1],u=["L",t,e];break;case"v":h[1]+=e;case"V":e=h[1],u=["L",t,e];break;case"m":h[1]+=t,h[2]+=e;case"M":t=h[1],e=h[2],n=h[1],i=h[2],u=["M",t,e];break;case"c":h[1]+=t,h[2]+=e,h[3]+=t,h[4]+=e,h[5]+=t,h[6]+=e;case"C":a=h[3],c=h[4],t=h[5],e=h[6],u=["C",h[1],h[2],a,c,t,e];break;case"s":h[1]+=t,h[2]+=e,h[3]+=t,h[4]+=e;case"S":o==="C"?(a=2*t-a,c=2*e-c):(a=t,c=e),t=h[3],e=h[4],u=["C",a,c,h[1],h[2],t,e],a=u[3],c=u[4];break;case"q":h[1]+=t,h[2]+=e,h[3]+=t,h[4]+=e;case"Q":a=h[1],c=h[2],t=h[3],e=h[4],u=["Q",a,c,t,e];break;case"t":h[1]+=t,h[2]+=e;case"T":o==="Q"?(a=2*t-a,c=2*e-c):(a=t,c=e),t=h[1],e=h[2],u=["Q",a,c,t,e];break;case"a":h[6]+=t,h[7]+=e;case"A":I3(t,e,h).forEach(d=>s.push(d)),t=h[6],e=h[7];break;case"z":case"Z":t=n,e=i,u=["Z"]}u?(s.push(u),o=u[0]):o=""}return s},y0=(r,t,e,n)=>Math.sqrt((e-r)**2+(n-t)**2),rE=(r,t,e,n,i,s,o,a)=>c=>{let l=c**3,h=(f=>3*f**2*(1-f))(c),u=(f=>3*f*(1-f)**2)(c),d=(f=>(1-f)**3)(c);return new nt(o*l+i*h+e*u+r*d,a*l+s*h+n*u+t*d)},sE=r=>r**2,oE=r=>2*r*(1-r),aE=r=>(1-r)**2,O3=(r,t,e,n,i,s,o,a)=>c=>{let l=sE(c),h=oE(c),u=aE(c),d=3*(u*(e-r)+h*(i-e)+l*(o-i)),f=3*(u*(n-t)+h*(s-n)+l*(a-s));return Math.atan2(f,d)},L3=(r,t,e,n,i,s)=>o=>{let a=sE(o),c=oE(o),l=aE(o);return new nt(i*a+e*c+r*l,s*a+n*c+t*l)},N3=(r,t,e,n,i,s)=>o=>{let a=1-o,c=2*(a*(e-r)+o*(i-e)),l=2*(a*(n-t)+o*(s-n));return Math.atan2(l,c)},Q5=(r,t,e)=>{let n=new nt(t,e),i=0;for(let s=1;s<=100;s+=1){let o=r(s/100);i+=y0(n.x,n.y,o.x,o.y),n=o}return i},U3=(r,t)=>{let e,n=0,i=0,s={x:r.x,y:r.y},o=G({},s),a=.01,c=0,l=r.iterator,h=r.angleFinder;for(;i1e-4;)o=l(n),c=n,e=y0(s.x,s.y,o.x,o.y),e+i>t?(n-=a,a/=2):(s=o,n+=a,i+=e);return G(G({},o),{},{angle:h(c)})},Em=r=>{let t,e,n=0,i=0,s=0,o=0,a=0,c=[];for(let l of r){let h={x:i,y:s,command:l[0],length:0};switch(l[0]){case"M":e=h,e.x=o=i=l[1],e.y=a=s=l[2];break;case"L":e=h,e.length=y0(i,s,l[1],l[2]),i=l[1],s=l[2];break;case"C":t=rE(i,s,l[1],l[2],l[3],l[4],l[5],l[6]),e=h,e.iterator=t,e.angleFinder=O3(i,s,l[1],l[2],l[3],l[4],l[5],l[6]),e.length=Q5(t,i,s),i=l[5],s=l[6];break;case"Q":t=L3(i,s,l[1],l[2],l[3],l[4]),e=h,e.iterator=t,e.angleFinder=N3(i,s,l[1],l[2],l[3],l[4]),e.length=Q5(t,i,s),i=l[3],s=l[4];break;case"Z":e=h,e.destX=o,e.destY=a,e.length=y0(i,s,o,a),i=o,s=a}n+=e.length,c.push(e)}return c.push({length:n,x:i,y:s}),c},cE=function(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Em(r),n=0;for(;t-e[n].length>0&&n{r=Kv(r);let t=[];for(let e of r.matchAll(new RegExp(K5,"gi"))){let n=e[0],i=[],s;do{if(s=new RegExp(K5,"i").exec(n),!s)break;let o=s.filter(c=>c);o.shift();let a=o.map(c=>{let l=Number.parseFloat(c);return Number.isNaN(l)?c:l});if(i.push(a),o.length<=1)break;o.shift(),n=n.replace(new RegExp("".concat(o.join(" ?")," ?$")),"")}while(s);i.reverse().forEach((o,a)=>{let c=k3[o[0]];a>0&&(c=="l"||c=="L")&&(o[0]=c),t.push(o)})}return t},V3=function(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=new nt(r[0]),n=new nt(r[1]),i=1,s=0,o=[],a=r.length,c=a>2,l;for(c&&(i=r[2].xr[l-2].x?1:e.x===r[l-2].x?0:-1,s=e.y>r[l-2].y?1:e.y===r[l-2].y?0:-1),o.push(["L",e.x+i*t,e.y+s*t]),o},hE=(r,t)=>r.map(e=>e.map((n,i)=>i===0||t===void 0?n:we(n,t)).join(" ")).join(" ");function z3(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.onComplete||oo,n=new(B0()).XMLHttpRequest,i=t.signal,s=function(){n.abort()},o=function(){i&&i.removeEventListener("abort",s),n.onerror=n.ontimeout=oo};if(i&&i.aborted)throw new s0("request");return i&&i.addEventListener("abort",s,{once:!0}),n.onreadystatechange=function(){n.readyState===4&&(o(),e(n),n.onreadystatechange=oo)},n.onerror=n.ontimeout=o,n.open("get",r,!0),n.send(),n}var H3=(r,t)=>{let e=r._findCenterFromElement();r.transformMatrix&&((n=>{if(n.transformMatrix){let{scaleX:i,scaleY:s,angle:o,skewX:a}=qa(n.transformMatrix);n.flipX=!1,n.flipY=!1,n.set("scaleX",i),n.set("scaleY",s),n.angle=o,n.skewX=a,n.skewY=0}})(r),e=e.transform(r.transformMatrix)),delete r.transformMatrix,t&&(r.scaleX*=t.scaleX,r.scaleY*=t.scaleY,r.cropX=t.cropX,r.cropY=t.cropY,e.x+=t.offsetLeft,e.y+=t.offsetTop,r.width=t.width,r.height=t.height),r.setPositionByOrigin(e,_e,_e)},iO=Object.freeze({__proto__:null,addTransformToObject:gv,animate:fm,animateColor:wv,applyTransformToObject:Za,calcAngleBetweenVectors:x0,calcDimensionsMatrix:kl,calcPlaneChangeMatrix:Il,calcVectorRotation:Dv,cancelAnimFrame:ov,capValue:uo,composeMatrix:hv,copyCanvasElement:r=>{var t;let e=ln();return e.width=r.width,e.height=r.height,(t=e.getContext("2d"))===null||t===void 0||t.drawImage(r,0,0),e},cos:Zi,createCanvasElement:ln,createImage:av,createRotateMatrix:ec,createScaleMatrix:T0,createSkewXMatrix:lm,createSkewYMatrix:hm,createTranslateMatrix:tc,createVector:d0,crossProduct:Fa,degreesToRadians:nn,dotProduct:Bv,ease:NT,enlivenObjectEnlivables:Rl,enlivenObjects:$a,findScaleToCover:nE,findScaleToFit:eE,getBoundsOfCurve:Yp,getOrthonormalVector:pm,getPathSegmentsInfo:Em,getPointOnPath:cE,getPointer:mv,getRandomInt:FT,getRegularPolygonPath:(r,t)=>{let e=2*Math.PI/r,n=-Ss;r%2==0&&(n+=e/2);let i=new Array(r+1);for(let s=0;s{let t=["instantiated_by_use","style","id","class"];switch(r){case"linearGradient":return t.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);case"radialGradient":return t.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);case"stop":return t.concat(["offset","stop-color","stop-opacity"])}return t},getUnitVector:k0,groupSVGElements:(r,t)=>r&&r.length===1?r[0]:new ys(r,t),hasStyleChanged:L0,invertTransform:fi,isBetweenVectors:Np,isIdentityMatrix:r=>r.every((t,e)=>t===$n[e]),isTouchEvent:l0,isTransparent:Xv,joinPath:hE,loadImage:yl,magnitude:f0,makeBoundingBoxFromPoints:mr,makePathSimpler:iE,matrixToSVG:Ml,mergeClipPaths:(r,t)=>{var e;let n=r,i=t;n.inverted&&!i.inverted&&(n=t,i=r),kp(i,(e=i.group)===null||e===void 0?void 0:e.calcTransformMatrix(),n.calcTransformMatrix());let s=n.inverted&&i.inverted;return s&&(n.inverted=i.inverted=!1),new ys([n],{clipPath:i,inverted:s})},multiplyTransformMatrices:Dn,multiplyTransformMatrixArray:Qa,parsePath:lE,parsePreserveAspectRatioAttribute:uv,parseUnit:ao,pick:xo,projectStrokeOnPoints:Yv,qrDecompose:qa,radiansToDegrees:ho,removeFromArray:io,removeTransformFromObject:(r,t)=>{let e=fi(t),n=Dn(e,r.calcOwnMatrix());Za(r,n)},removeTransformMatrixForSvgParsing:H3,request:z3,requestAnimFrame:_l,resetObjectTransform:Cv,rotatePoint:(r,t,e)=>r.rotate(e,t),rotateVector:xm,saveObjectTransform:dm,sendObjectToPlane:kp,sendPointToPlane:_s,sendVectorToPlane:vv,setStyle:bl,sin:Ki,sizeAfterTransform:F0,string:n3,stylesFromArray:Zv,stylesToArray:$v,toDataURL:cm,toFixed:we,transformPath:(r,t,e)=>(e&&(t=Dn(t,[1,0,0,1,-e.x,-e.y])),r.map(n=>{let i=[...n];for(let s=1;s1&&arguments[1]!==void 0?arguments[1]:{};super(t),W(this,"upper",void 0),W(this,"container",void 0);let{el:i}=this.lower,s=this.createUpperCanvas();this.upper={el:s,ctx:s.getContext("2d")},this.applyCanvasStyle(i,{allowTouchScrolling:e}),this.applyCanvasStyle(s,{allowTouchScrolling:e});let o=this.createContainerElement();o.classList.add(n),i.parentNode&&i.parentNode.replaceChild(o,i),o.append(i,s),this.container=o}createUpperCanvas(){let{el:t}=this.lower,e=ln();return e.className=t.className,e.classList.remove("lower-canvas"),e.classList.add("upper-canvas"),e.setAttribute("data-fabric","top"),e.style.cssText=t.style.cssText,e.setAttribute("draggable","true"),e}createContainerElement(){let t=Ja().createElement("div");return t.setAttribute("data-fabric","wrapper"),bl(t,{position:"relative"}),R5(t),t}applyCanvasStyle(t,e){let{allowTouchScrolling:n}=e;bl(t,{position:"absolute",left:"0",top:"0"}),function(i,s){let o=s?"manipulation":ii;bl(i,{"touch-action":o,"-ms-touch-action":o})}(t,n),R5(t)}setDimensions(t,e){super.setDimensions(t,e);let{el:n,ctx:i}=this.upper;pv(n,i,t,e)}setCSSDimensions(t){super.setCSSDimensions(t),Fp(this.upper.el,t),Fp(this.container,t)}cleanupDOM(t){let e=this.container,{el:n}=this.lower,{el:i}=this.upper;super.cleanupDOM(t),e.removeChild(i),e.removeChild(n),e.parentNode&&e.parentNode.replaceChild(n,e)}dispose(){super.dispose(),gr().dispose(this.upper.el),delete this.upper,delete this.container}},b0=class r extends Bl{constructor(){super(...arguments),W(this,"targets",[]),W(this,"_hoveredTargets",[]),W(this,"_objectsToRender",void 0),W(this,"_currentTransform",null),W(this,"_groupSelector",null),W(this,"contextTopDirty",!1)}static getDefaults(){return G(G({},super.getDefaults()),r.ownDefaults)}get upperCanvasEl(){var t;return(t=this.elements.upper)===null||t===void 0?void 0:t.el}get contextTop(){var t;return(t=this.elements.upper)===null||t===void 0?void 0:t.ctx}get wrapperEl(){return this.elements.container}initElements(t){this.elements=new qp(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(),n=Math.ceil((2*t+1)*e);this.pixelFindCanvasEl.width=this.pixelFindCanvasEl.height=n,this.pixelFindContext.scale(e,e)}isTargetTransparent(t,e,n){let i=this.targetFindTolerance,s=this.pixelFindContext;this.clearContext(s),s.save(),s.translate(-e+i,-n+i),s.transform(...this.viewportTransform);let o=t.selectionBackgroundColor;t.selectionBackgroundColor="",t.render(s),t.selectionBackgroundColor=o,s.restore();let a=Math.round(i*this.getRetinaScaling());return Xv(s,a,a,a)}_isSelectionKeyPressed(t){let e=this.selectionKey;return!!e&&(Array.isArray(e)?!!e.find(n=>!!n&&t[n]===!0):t[e])}_shouldClearSelection(t,e){let n=this.getActiveObjects(),i=this._activeObject;return!!(!e||e&&i&&n.length>1&&n.indexOf(e)===-1&&i!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&i&&i!==e)}_shouldCenterTransform(t,e,n){if(!t)return;let i;return e==="scale"||e==="scaleX"||e==="scaleY"||e==="resizing"?i=this.centeredScaling||t.centeredScaling:e==="rotate"&&(i=this.centeredRotation||t.centeredRotation),i?!n:n}_getOriginFromCorner(t,e){let n={x:t.originX,y:t.originY};return e&&(["ml","tl","bl"].includes(e)?n.x=cn:["mr","tr","br"].includes(e)&&(n.x=Fe),["tl","mt","tr"].includes(e)?n.y=Bp:["bl","mb","br"].includes(e)&&(n.y=Vn)),n}_setupCurrentTransform(t,e,n){var i;let s=e.group?_s(this.getScenePoint(t),void 0,e.group.calcTransformMatrix()):this.getScenePoint(t),{key:o="",control:a}=e.getActiveControl()||{},c=n&&a?(i=a.getActionHandler(t,e,a))===null||i===void 0?void 0:i.bind(a):Av,l=((f,m,g,x)=>{if(!m||!f)return"drag";let p=x.controls[m];return p.getActionName(g,p,x)})(n,o,t,e),h=t[this.centeredKey],u=this._shouldCenterTransform(e,l,h)?{x:_e,y:_e}:this._getOriginFromCorner(e,o),d={target:e,action:l,actionHandler:c,actionPerformed:!1,corner:o,scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,offsetX:s.x-e.left,offsetY:s.y-e.top,originX:u.x,originY:u.y,ex:s.x,ey:s.y,lastX:s.x,lastY:s.y,theta:nn(e.angle),width:e.width,height:e.height,shiftKey:t.shiftKey,altKey:h,original:G(G({},dm(e)),{},{originX:u.x,originY:u.y})};this._currentTransform=d,this.fire("before:transform",{e:t,transform:d})}setCursor(t){this.upperCanvasEl.style.cursor=t}_drawSelection(t){let{x:e,y:n,deltaX:i,deltaY:s}=this._groupSelector,o=new nt(e,n).transform(this.viewportTransform),a=new nt(e+i,n+s).transform(this.viewportTransform),c=this.selectionLineWidth/2,l=Math.min(o.x,a.x),h=Math.min(o.y,a.y),u=Math.max(o.x,a.x),d=Math.max(o.y,a.y);this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(l,h,u-l,d-h)),this.selectionLineWidth&&this.selectionBorderColor&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,l+=c,h+=c,u-=c,d-=c,hn.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(l,h,u-l,d-h))}findTarget(t){if(this.skipTargetFind)return;let e=this.getViewportPoint(t),n=this._activeObject,i=this.getActiveObjects();if(this.targets=[],n&&i.length>=1){if(n.findControl(e,l0(t))||i.length>1&&this.searchPossibleTargets([n],e))return n;if(n===this.searchPossibleTargets([n],e)){if(this.preserveObjectStacking){let s=this.targets;this.targets=[];let o=this.searchPossibleTargets(this._objects,e);return t[this.altSelectionKey]&&o&&o!==n?(this.targets=s,n):o}return n}}return this.searchPossibleTargets(this._objects,e)}_pointIsInObjectSelectionArea(t,e){let n=t.getCoords(),i=this.getZoom(),s=t.padding/i;if(s){let[o,a,c,l]=n,h=Math.atan2(a.y-o.y,a.x-o.x),u=Zi(h)*s,d=Ki(h)*s,f=u+d,m=u-d;n=[new nt(o.x-m,o.y-f),new nt(a.x+f,a.y-m),new nt(c.x+m,c.y+f),new nt(l.x-f,l.y+m)]}return co.isPointInPolygon(e,n)}_checkTarget(t,e){return!!(t&&t.visible&&t.evented&&this._pointIsInObjectSelectionArea(t,_s(e,void 0,this.viewportTransform))&&(!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing||!this.isTargetTransparent(t,e.x,e.y)))}_searchPossibleTargets(t,e){let n=t.length;for(;n--;){let i=t[n];if(this._checkTarget(i,e)){if(i0(i)&&i.subTargetCheck){let s=this._searchPossibleTargets(i._objects,e);s&&this.targets.push(s)}return i}}}searchPossibleTargets(t,e){let n=this._searchPossibleTargets(t,e);if(n&&i0(n)&&n.interactive&&this.targets[0]){let i=this.targets;for(let s=i.length-1;s>0;s--){let o=i[s];if(!i0(o)||!o.interactive)return o}return i[0]}return n}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&&arguments[1]!==void 0&&arguments[1],n=this.upperCanvasEl,i=n.getBoundingClientRect(),s=mv(t),o=i.width||0,a=i.height||0;o&&a||(Vn in i&&Bp in i&&(a=Math.abs(i.top-i.bottom)),cn in i&&Fe in i&&(o=Math.abs(i.right-i.left))),this.calcOffset(),s.x=s.x-this._offset.left,s.y=s.y-this._offset.top,e||(s=_s(s,void 0,this.viewportTransform));let c=this.getRetinaScaling();c!==1&&(s.x/=c,s.y/=c);let l=o===0||a===0?new nt(1,1):new nt(n.width/o,n.height/a);return s.multiply(l)}_setDimensionsImpl(t,e){this._resetTransformEventData(),super._setDimensionsImpl(t,e),this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop)}_createCacheCanvas(){this.pixelFindCanvasEl=ln(),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 Aa(t)?t.getObjects():t?[t]:[]}_fireSelectionEvents(t,e){let n=!1,i=!1,s=this.getActiveObjects(),o=[],a=[];t.forEach(c=>{s.includes(c)||(n=!0,c.fire("deselected",{e,target:c}),a.push(c))}),s.forEach(c=>{t.includes(c)||(n=!0,c.fire("selected",{e,target:c}),o.push(c))}),t.length>0&&s.length>0?(i=!0,n&&this.fire("selection:updated",{e,selected:o,deselected:a})):s.length>0?(i=!0,this.fire("selection:created",{e,selected:o})):t.length>0&&(i=!0,this.fire("selection:cleared",{e,deselected:a})),i&&(this._objectsToRender=void 0)}setActiveObject(t,e){let n=this.getActiveObjects(),i=this._setActiveObject(t,e);return this._fireSelectionEvents(n,e),i}_setActiveObject(t,e){let n=this._activeObject;return n!==t&&!(!this._discardActiveObject(e,t)&&this._activeObject)&&!t.onSelect({e})&&(this._activeObject=t,Aa(t)&&n!==t&&(t.set("canvas",this),t.setCoords()),!0)}_discardActiveObject(t,e){let n=this._activeObject;return!!n&&!n.onDeselect({e:t,object:e})&&(this._currentTransform&&this._currentTransform.target===n&&this.endCurrentTransform(t),this._activeObject=void 0,!0)}discardActiveObject(t){let e=this.getActiveObjects(),n=this.getActiveObject();e.length&&this.fire("before:selection:cleared",{e:t,deselected:[n]});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,n=e.target,i={e:t,target:n,transform:e,action:e.action};n._scaling&&(n._scaling=!1),n.setCoords(),e.actionPerformed&&(this.fire("object:modified",i),n.fire("modified",i))}setViewportTransform(t){super.setViewportTransform(t);let e=this._activeObject;e&&e.setCoords()}destroy(){let t=this._activeObject;Aa(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,n){let i=this._realizeGroupTransformOnObject(t),s=super._toObject(t,e,n);return t.set(i),s}_realizeGroupTransformOnObject(t){let{group:e}=t;if(e&&Aa(e)&&this._activeObject===e){let n=xo(t,["angle","flipX","flipY",Fe,"scaleX","scaleY","skewX","skewY",Vn]);return gv(t,e.calcOwnMatrix()),n}return{}}_setSVGObject(t,e,n){let i=this._realizeGroupTransformOnObject(e);super._setSVGObject(t,e,n),e.set(i)}};W(b0,"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});var $p=class{constructor(t){W(this,"targets",[]),W(this,"__disposer",void 0);let e=()=>{let{hiddenTextarea:i}=t.getActiveObject()||{};i&&i.focus()},n=t.upperCanvasEl;n.addEventListener("click",e),this.__disposer=()=>n.removeEventListener("click",e)}exitTextEditing(){this.target=void 0,this.targets.forEach(t=>{t.isEditing&&t.exitEditing()})}add(t){this.targets.push(t)}remove(t){this.unregister(t),io(this.targets,t)}register(t){this.target=t}unregister(t){t===this.target&&(this.target=void 0)}onMouseMove(t){var e;!((e=this.target)===null||e===void 0)&&e.isEditing&&this.target.updateSelectionOnMouseMove(t)}clear(){this.targets=[],this.target=void 0}dispose(){this.clear(),this.__disposer(),delete this.__disposer}},G3=["target","oldTarget","fireCanvas","e"],di={passive:!1},ya=(r,t)=>{let e=r.getViewportPoint(t),n=r.getScenePoint(t);return{viewportPoint:e,scenePoint:n,pointer:e,absolutePointer:n}},ms=function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n1&&arguments[1]!==void 0?arguments[1]:{}),W(this,"_isClick",void 0),W(this,"textEditingManager",new $p(this)),["_onMouseDown","_onTouchStart","_onMouseMove","_onMouseUp","_onTouchEnd","_onResize","_onMouseWheel","_onMouseOut","_onMouseEnter","_onContextMenu","_onDoubleClick","_onDragStart","_onDragEnd","_onDragProgress","_onDragOver","_onDragEnter","_onDragLeave","_onDrop"].forEach(e=>{this[e]=this[e].bind(this)}),this.addOrRemove(ms,"add")}_getEventPrefix(){return this.enablePointerEvents?"pointer":"mouse"}addOrRemove(t,e){let n=this.upperCanvasEl,i=this._getEventPrefix();t(xv(n),"resize",this._onResize),t(n,i+"down",this._onMouseDown),t(n,"".concat(i,"move"),this._onMouseMove,di),t(n,"".concat(i,"out"),this._onMouseOut),t(n,"".concat(i,"enter"),this._onMouseEnter),t(n,"wheel",this._onMouseWheel),t(n,"contextmenu",this._onContextMenu),t(n,"dblclick",this._onDoubleClick),t(n,"dragstart",this._onDragStart),t(n,"dragend",this._onDragEnd),t(n,"dragover",this._onDragOver),t(n,"dragenter",this._onDragEnter),t(n,"dragleave",this._onDragLeave),t(n,"drop",this._onDrop),this.enablePointerEvents||t(n,"touchstart",this._onTouchStart,di)}removeListeners(){this.addOrRemove(ki,"remove");let t=this._getEventPrefix(),e=qi(this.upperCanvasEl);ki(e,"".concat(t,"up"),this._onMouseUp),ki(e,"touchend",this._onTouchEnd,di),ki(e,"".concat(t,"move"),this._onMouseMove,di),ki(e,"touchmove",this._onMouseMove,di)}_onMouseWheel(t){this.__onMouseWheel(t)}_onMouseOut(t){let e=this._hoveredTarget,n=G({e:t},ya(this,t));this.fire("mouse:out",G(G({},n),{},{target:e})),this._hoveredTarget=void 0,e&&e.fire("mouseout",G({},n)),this._hoveredTargets.forEach(i=>{this.fire("mouse:out",G(G({},n),{},{target:i})),i&&i.fire("mouseout",G({},n))}),this._hoveredTargets=[]}_onMouseEnter(t){this._currentTransform||this.findTarget(t)||(this.fire("mouse:over",G({e:t},ya(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 n={e:t,target:e};return this.fire("dragstart",n),e.fire("dragstart",n),void ms(this.upperCanvasEl,"drag",this._onDragProgress)}Pp(t)}_renderDragEffects(t,e,n){let i=!1,s=this._dropTarget;s&&s!==e&&s!==n&&(s.clearContextTop(),i=!0),e?.clearContextTop(),n!==e&&n?.clearContextTop();let o=this.contextTop;o.save(),o.transform(...this.viewportTransform),e&&(o.save(),e.transform(o),e.renderDragSourceEffect(t),o.restore(),i=!0),n&&(o.save(),n.transform(o),n.renderDropTargetEffect(t),o.restore(),i=!0),o.restore(),i&&(this.contextTopDirty=!0)}_onDragEnd(t){let e=!!t.dataTransfer&&t.dataTransfer.dropEffect!==ii,n=e?this._activeObject:void 0,i={e:t,target:this._dragSource,subTargets:this.targets,dragSource:this._dragSource,didDrop:e,dropTarget:n};ki(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="dragover",{target:n,targets:i}=this.findDragTargets(t),s=this._dragSource,o={e:t,target:n,subTargets:i,dragSource:s,canDrop:!1,dropTarget:void 0},a;this.fire(e,o),this._fireEnterLeaveEvents(n,o),n&&(n.canDrop(t)&&(a=n),n.fire(e,o));for(let c=0;c0)return;this.__onMouseUp(t),this._resetTransformEventData(),delete this.mainTouchId;let e=this._getEventPrefix(),n=qi(this.upperCanvasEl);ki(n,"touchend",this._onTouchEnd,di),ki(n,"touchmove",this._onMouseMove,di),this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(()=>{ms(this.upperCanvasEl,"".concat(e,"down"),this._onMouseDown),this._willAddMouseDown=0},400)}_onMouseUp(t){this.__onMouseUp(t),this._resetTransformEventData();let e=this.upperCanvasEl,n=this._getEventPrefix();if(this._isMainEvent(t)){let i=qi(this.upperCanvasEl);ki(i,"".concat(n,"up"),this._onMouseUp),ki(i,"".concat(n,"move"),this._onMouseMove,di),ms(e,"".concat(n,"move"),this._onMouseMove,di)}}_onMouseMove(t){let e=this.getActiveObject();!this.allowTouchScrolling&&(!e||!e.shouldStartDragging())&&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 n=this._currentTransform,i=this._isClick,s=this._target,{button:o}=t;if(o)return(this.fireMiddleClick&&o===1||this.fireRightClick&&o===2)&&this._handleEvent(t,"up"),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)return void this._onMouseUpInDrawingMode(t);if(!this._isMainEvent(t))return;let a,c,l=!1;if(n&&(this._finalizeCurrentTransform(t),l=n.actionPerformed),!i){let h=s===this._activeObject;this.handleSelection(t),l||(l=this._shouldRender(s)||!h&&s===this._activeObject)}if(s){let h=s.findControl(this.getViewportPoint(t),l0(t)),{key:u,control:d}=h||{};if(c=u,s.selectable&&s!==this._activeObject&&s.activeOn==="up")this.setActiveObject(s,t),l=!0;else if(d){let f=d.getMouseUpHandler(t,s,d);f&&(a=this.getScenePoint(t),f.call(d,t,n,a.x,a.y))}s.isMoving=!1}if(n&&(n.target!==s||n.corner!==c)){let h=n.target&&n.target.controls[n.corner],u=h&&h.getMouseUpHandler(t,n.target,h);a=a||this.getScenePoint(t),u&&u.call(h,t,n,a.x,a.y)}this._setCursorFromEvent(t,s),this._handleEvent(t,"up"),this._groupSelector=null,this._currentTransform=null,s&&(s.__corner=void 0),l?this.requestRenderAll():i||(e=this._activeObject)!==null&&e!==void 0&&e.isEditing||this.renderTop()}_basicEventHandler(t,e){let{target:n,subTargets:i=[]}=e;this.fire(t,e),n&&n.fire(t,e);for(let s=0;s{n=o.hoverCursor||n}),this.setCursor(n)}handleMultiSelection(t,e){let n=this._activeObject,i=Aa(n);if(n&&this._isSelectionKeyPressed(t)&&this.selection&&e&&e.selectable&&(n!==e||i)&&(i||!e.isDescendantOf(n)&&!n.isDescendantOf(e))&&!e.onSelect({e:t})&&!n.getActiveControl()){if(i){let s=n.getObjects();if(e===n){let o=this.getViewportPoint(t);if(!(e=this.searchPossibleTargets(s,o)||this.searchPossibleTargets(this._objects,o))||!e.selectable)return!1}e.group===n?(n.remove(e),this._hoveredTarget=e,this._hoveredTargets=[...this.targets],n.size()===1&&this._setActiveObject(n.item(0),t)):(n.multiSelectAdd(e),this._hoveredTarget=n,this._hoveredTargets=[...this.targets]),this._fireSelectionEvents(s,t)}else{n.exitEditing&&n.exitEditing();let s=new(It.getClass("ActiveSelection"))([],{canvas:this});s.multiSelectAdd(n,e),this._hoveredTarget=s,this._setActiveObject(s,t),this._fireSelectionEvents([n],t)}return!0}return!1}handleSelection(t){if(!this.selection||!this._groupSelector)return!1;let{x:e,y:n,deltaX:i,deltaY:s}=this._groupSelector,o=new nt(e,n),a=o.add(new nt(i,s)),c=o.min(a),l=o.max(a).subtract(c),h=this.collectObjects({left:c.x,top:c.y,width:l.x,height:l.y},{includeIntersecting:!this.selectionFullyContained}),u=o.eq(a)?h[0]?[h[0]]:[]:h.length>1?h.filter(d=>!d.onSelect({e:t})).reverse():h;if(u.length===1)this.setActiveObject(u[0],t);else if(u.length>1){let d=It.getClass("ActiveSelection");this.setActiveObject(new d(u,{canvas:this}),t)}return this._groupSelector=null,!0}clear(){this.textEditingManager.clear(),super.clear()}destroy(){this.removeListeners(),this.textEditingManager.dispose(),super.destroy()}},uE={x1:0,y1:0,x2:0,y2:0},j3=G(G({},uE),{},{r1:0,r2:0}),X3=/^(\d+\.\d+)%|(\d+)%$/;function dE(r){return r&&X3.test(r)}function fE(r,t){let e=typeof r=="number"?r:typeof r=="string"?parseFloat(r)/(dE(r)?100:1):NaN;return uo(0,ba(e,t),1)}var Y3=/\s*;\s*/,q3=/\s*:\s*/;function $3(r,t){let e,n,i=r.getAttribute("style");if(i){let o=i.split(Y3);o[o.length-1]===""&&o.pop();for(let a=o.length;a--;){let[c,l]=o[a].split(q3).map(h=>h.trim());c==="stop-color"?e=l:c==="stop-opacity"&&(n=l)}}let s=new Zn(e||r.getAttribute("stop-color")||"rgb(0,0,0)");return{offset:fE(r.getAttribute("offset"),0),color:s.toRgb(),opacity:ba(parseFloat(n||r.getAttribute("stop-opacity")||""),1)*s.getAlpha()*t}}function Z3(r,t){let e=[],n=r.getElementsByTagName("stop"),i=fE(t,1);for(let s=n.length;s--;)e.push($3(n[s],i));return e}function xE(r){return r.nodeName==="linearGradient"||r.nodeName==="LINEARGRADIENT"?"linear":"radial"}function pE(r){return r.getAttribute("gradientUnits")==="userSpaceOnUse"?"pixels":"percentage"}function Xi(r,t){return r.getAttribute(t)}function K3(r,t){return function(e,n){let i,{width:s,height:o,gradientUnits:a}=n;return Object.keys(e).reduce((c,l)=>{let h=e[l];return h==="Infinity"?i=1:h==="-Infinity"?i=0:(i=typeof h=="string"?parseFloat(h):h,typeof h=="string"&&dE(h)&&(i*=.01,a==="pixels"&&(l!=="x1"&&l!=="x2"&&l!=="r2"||(i*=s),l!=="y1"&&l!=="y2"||(i*=o)))),c[l]=i,c},{})}(xE(r)==="linear"?function(e){return{x1:Xi(e,"x1")||0,y1:Xi(e,"y1")||0,x2:Xi(e,"x2")||"100%",y2:Xi(e,"y2")||0}}(r):function(e){return{x1:Xi(e,"fx")||Xi(e,"cx")||"50%",y1:Xi(e,"fy")||Xi(e,"cy")||"50%",r1:0,x2:Xi(e,"cx")||"50%",y2:Xi(e,"cy")||"50%",r2:Xi(e,"r")||"50%"}}(r),G(G({},t),{},{gradientUnits:pE(r)}))}var wa=class{constructor(t){let{type:e="linear",gradientUnits:n="pixels",coords:i={},colorStops:s=[],offsetX:o=0,offsetY:a=0,gradientTransform:c,id:l}=t;this.id=l?"".concat(l,"_").concat(ws()):ws(),this.type=e,this.gradientUnits=n,this.gradientTransform=c,this.offsetX=o,this.offsetY=a,this.coords=G(G({},this.type==="radial"?j3:uE),i),this.colorStops=s.slice()}addColorStop(t){for(let e in t){let n=new Zn(t[e]);this.colorStops.push({offset:parseFloat(e),color:n.toRgb(),opacity:n.getAlpha()})}return this}toObject(t){return G(G({},xo(this,t)),{},{type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?[...this.gradientTransform]:void 0})}toSVG(t){let{additionalTransform:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],i=this.gradientTransform?this.gradientTransform.concat():$n.concat(),s=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox",o=this.colorStops.map(u=>G({},u)).sort((u,d)=>u.offset-d.offset),a=-this.offsetX,c=-this.offsetY;var l;s==="objectBoundingBox"?(a/=t.width,c/=t.height):(a+=t.width/2,c+=t.height/2),(l=t)&&typeof l._renderPathCommands=="function"&&this.gradientUnits!=="percentage"&&(a-=t.pathOffset.x,c-=t.pathOffset.y),i[4]-=a,i[5]-=c;let h=['id="SVGID_'.concat(this.id,'"'),'gradientUnits="'.concat(s,'"'),'gradientTransform="'.concat(e?e+" ":"").concat(Ml(i),'"'),""].join(" ");if(this.type==="linear"){let{x1:u,y1:d,x2:f,y2:m}=this.coords;n.push(" +`)}else if(this.type==="radial"){let{x1:u,y1:d,x2:f,y2:m,r1:g,r2:x}=this.coords,p=g>x;n.push(" +`),p&&(o.reverse(),o.forEach(v=>{v.offset=1-v.offset}));let C=Math.min(g,x);if(C>0){let v=C/Math.max(g,x);o.forEach(_=>{_.offset+=v*(1-_.offset)})}}return o.forEach(u=>{let{color:d,offset:f,opacity:m}=u;n.push(" +`)}),n.push(this.type==="linear"?"":"",` +`),n.join("")}toLive(t){let e=this.coords,n=this.type==="linear"?t.createLinearGradient(e.x1,e.y1,e.x2,e.y2):t.createRadialGradient(e.x1,e.y1,e.r1,e.x2,e.y2,e.r2);return this.colorStops.forEach(i=>{let{color:s,opacity:o,offset:a}=i;n.addColorStop(a,o!==void 0?new Zn(s).setAlpha(o).toRgba():s)}),n}static fromObject(t){return dt(this,null,function*(){return new this(t)})}static fromElement(t,e,n){let i=pE(t),s=e._findCenterFromElement();return new this(G({id:t.getAttribute("id")||void 0,type:xE(t),coords:K3(t,{width:n.viewBoxWidth||n.width,height:n.viewBoxHeight||n.height}),colorStops:Z3(t,n.opacity),gradientUnits:i,gradientTransform:jp(t.getAttribute("gradientTransform")||"")},i==="pixels"?{offsetX:e.width/2-s.x,offsetY:e.height/2-s.y}:{offsetX:0,offsetY:0}))}};W(wa,"type","Gradient"),It.setClass(wa,"gradient"),It.setClass(wa,"linear"),It.setClass(wa,"radial");var J3=["type","source"],Al=class{get type(){return"pattern"}set type(t){As("warn","Setting type has no effect",t)}constructor(t){W(this,"repeat","repeat"),W(this,"offsetX",0),W(this,"offsetY",0),W(this,"crossOrigin",""),W(this,"patternTransform",null),this.id=ws(),Object.assign(this,t)}isImageSource(){return!!this.source&&typeof this.source.src=="string"}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&&this.source.naturalWidth!==0&&this.source.naturalHeight!==0)?t.createPattern(this.source,this.repeat):null}toObject(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{repeat:e,crossOrigin:n}=this;return G(G({},xo(this,t)),{},{type:"pattern",source:this.sourceToString(),repeat:e,crossOrigin:n,offsetX:we(this.offsetX,Me.NUM_FRACTION_DIGITS),offsetY:we(this.offsetY,Me.NUM_FRACTION_DIGITS),patternTransform:this.patternTransform?[...this.patternTransform]:null})}toSVG(t){let{width:e,height:n}=t,{source:i,repeat:s,id:o}=this,a=ba(this.offsetX/e,0),c=ba(this.offsetY/n,0),l=s==="repeat-y"||s==="no-repeat"?1+Math.abs(a||0):ba(i.width/e,0),h=s==="repeat-x"||s==="no-repeat"?1+Math.abs(c||0):ba(i.height/n,0);return[''),''),"",""].join(` +`)}static fromObject(t,e){return dt(this,null,function*(){let{type:n,source:i}=t,s=Oe(t,J3),o=yield yl(i,G(G({},e),{},{crossOrigin:s.crossOrigin}));return new this(G(G({},s),{},{source:o}))})}};W(Al,"type","Pattern"),It.setClass(Al),It.setClass(Al,"pattern");var Q3=["path","left","top"],tF=["d"],Or=class extends hn{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{path:n,left:i,top:s}=e;super(Oe(e,Q3)),this._setPath(t||[],!0),typeof i=="number"&&this.set(Fe,i),typeof s=="number"&&this.set(Vn,s)}_setPath(t,e){this.path=iE(Array.isArray(t)?t:lE(t)),this.setBoundingBox(e)}_findCenterFromElement(){let t=this._calcBoundsFromPath();return new nt(t.left+t.width/2,t.top+t.height/2)}_renderPathCommands(t){let e=-this.pathOffset.x,n=-this.pathOffset.y;t.beginPath();for(let i of this.path)switch(i[0]){case"L":t.lineTo(i[1]+e,i[2]+n);break;case"M":t.moveTo(i[1]+e,i[2]+n);break;case"C":t.bezierCurveTo(i[1]+e,i[2]+n,i[3]+e,i[4]+n,i[5]+e,i[6]+n);break;case"Q":t.quadraticCurveTo(i[1]+e,i[2]+n,i[3]+e,i[4]+n);break;case"Z":t.closePath()}}_render(t){this._renderPathCommands(t),this._renderPaintInOrder(t)}toString(){return"#")}toObject(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return G(G({},super.toObject(t)),{},{path:this.path.map(e=>e.slice())})}toDatalessObject(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=this.toObject(t);return this.sourcePath&&(delete e.path,e.sourcePath=this.sourcePath),e}_toSVG(){let t=hE(this.path,Me.NUM_FRACTION_DIGITS);return[" +`)]}_getOffsetTransform(){let t=Me.NUM_FRACTION_DIGITS;return" translate(".concat(we(-this.pathOffset.x,t),", ").concat(we(-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:n,pathOffset:i}=this._calcDimensions();this.set({width:e,height:n,pathOffset:i}),t&&this.setPositionByOrigin(i,_e,_e)}_calcBoundsFromPath(){let t=[],e=0,n=0,i=0,s=0;for(let o of this.path)switch(o[0]){case"L":i=o[1],s=o[2],t.push(new nt(e,n),new nt(i,s));break;case"M":i=o[1],s=o[2],e=i,n=s;break;case"C":t.push(...Yp(i,s,o[1],o[2],o[3],o[4],o[5],o[6])),i=o[5],s=o[6];break;case"Q":t.push(...Yp(i,s,o[1],o[2],o[1],o[2],o[3],o[4])),i=o[3],s=o[4];break;case"Z":i=e,s=n}return mr(t)}_calcDimensions(){let t=this._calcBoundsFromPath();return G(G({},t),{},{pathOffset:new nt(t.left+t.width/2,t.top+t.height/2)})}static fromObject(t){return this._fromObject(t,{extraParam:"path"})}static fromElement(t,e,n){return dt(this,null,function*(){let i=Vr(t,this.ATTRIBUTE_NAMES,n),{d:s}=i;return new this(s,G(G(G({},Oe(i,tF)),e),{},{left:void 0,top:void 0}))})}};W(Or,"type","Path"),W(Or,"cacheProperties",[...Ur,"path","fillRule"]),W(Or,"ATTRIBUTE_NAMES",[...Ds,"d"]),It.setClass(Or),It.setSVGClass(Or);var eF=["left","top","radius"],mE=["radius","startAngle","endAngle","counterClockwise"],gs=class r extends hn{static getDefaults(){return G(G({},super.getDefaults()),r.ownDefaults)}_set(t,e){return super._set(t,e),t==="radius"&&this.setRadius(e),this}_render(t){t.beginPath(),t.arc(0,0,this.radius,nn(this.startAngle),nn(this.endAngle),this.counterClockwise),this._renderPaintInOrder(t)}getRadiusX(){return this.get("radius")*this.get("scaleX")}getRadiusY(){return this.get("radius")*this.get("scaleY")}setRadius(t){this.radius=t,this.set({width:2*t,height:2*t})}toObject(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return super.toObject([...mE,...t])}_toSVG(){let t=(this.endAngle-this.startAngle)%360;if(t===0)return[" +`];{let{radius:e}=this,n=nn(this.startAngle),i=nn(this.endAngle),s=Zi(n)*e,o=Ki(n)*e,a=Zi(i)*e,c=Ki(i)*e,l=t>180?1:0,h=this.counterClockwise?0:1;return[' +`]}}static fromElement(t,e,n){return dt(this,null,function*(){let i=Vr(t,this.ATTRIBUTE_NAMES,n),{left:s=0,top:o=0,radius:a=0}=i;return new this(G(G({},Oe(i,eF)),{},{radius:a,left:s-a,top:o-a}))})}static fromObject(t){return super._fromObject(t)}};W(gs,"type","Circle"),W(gs,"cacheProperties",[...Ur,...mE]),W(gs,"ownDefaults",{radius:0,startAngle:0,endAngle:360,counterClockwise:!1}),W(gs,"ATTRIBUTE_NAMES",["cx","cy","r",...Ds]),It.setClass(gs),It.setSVGClass(gs);var nF=["x1","y1","x2","y2"],iF=["x1","y1","x2","y2"],Zp=["x1","x2","y1","y2"],ro=class extends hn{constructor(){let[t,e,n,i]=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0,0],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(G(G({},s),{},{x1:t,y1:e,x2:n,y2:i})),this._setWidthHeight();let{left:o,top:a}=s;typeof o=="number"&&this.set(Fe,o),typeof a=="number"&&this.set(Vn,a)}_setWidthHeight(){let{x1:t,y1:e,x2:n,y2:i}=this;this.width=Math.abs(n-t),this.height=Math.abs(i-e);let{left:s,top:o,width:a,height:c}=mr([{x:t,y:e},{x:n,y:i}]),l=new nt(s+a/2,o+c/2);this.setPositionByOrigin(l,_e,_e)}_set(t,e){return super._set(t,e),Zp.includes(t)&&this._setWidthHeight(),this}_render(t){t.beginPath();let e=this.calcLinePoints();t.moveTo(e.x1,e.y1),t.lineTo(e.x2,e.y2),t.lineWidth=this.strokeWidth;let n=t.strokeStyle;var i;Ii(this.stroke)?t.strokeStyle=this.stroke.toLive(t):t.strokeStyle=(i=this.stroke)!==null&&i!==void 0?i:t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=n}_findCenterFromElement(){return new nt((this.x1+this.x2)/2,(this.y1+this.y2)/2)}toObject(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return G(G({},super.toObject(t)),this.calcLinePoints())}_getNonTransformedDimensions(){let t=super._getNonTransformedDimensions();return this.strokeLineCap==="butt"&&(this.width===0&&(t.y-=this.strokeWidth),this.height===0&&(t.x-=this.strokeWidth)),t}calcLinePoints(){let{x1:t,x2:e,y1:n,y2:i,width:s,height:o}=this,a=t<=e?-1:1,c=n<=i?-1:1;return{x1:a*s/2,x2:a*-s/2,y1:c*o/2,y2:c*-o/2}}_toSVG(){let{x1:t,x2:e,y1:n,y2:i}=this.calcLinePoints();return[" +`)]}static fromElement(t,e,n){return dt(this,null,function*(){let i=Vr(t,this.ATTRIBUTE_NAMES,n),{x1:s=0,y1:o=0,x2:a=0,y2:c=0}=i;return new this([s,o,a,c],Oe(i,nF))})}static fromObject(t){let{x1:e,y1:n,x2:i,y2:s}=t,o=Oe(t,iF);return this._fromObject(G(G({},o),{},{points:[e,n,i,s]}),{extraParam:"points"})}};W(ro,"type","Line"),W(ro,"cacheProperties",[...Ur,...Zp]),W(ro,"ATTRIBUTE_NAMES",Ds.concat(Zp)),It.setClass(ro),It.setSVGClass(ro);var Ma=class r extends hn{static getDefaults(){return G(G({},super.getDefaults()),r.ownDefaults)}_render(t){let e=this.width/2,n=this.height/2;t.beginPath(),t.moveTo(-e,n),t.lineTo(0,-n),t.lineTo(e,n),t.closePath(),this._renderPaintInOrder(t)}_toSVG(){let t=this.width/2,e=this.height/2;return["']}};W(Ma,"type","Triangle"),W(Ma,"ownDefaults",{width:100,height:100}),It.setClass(Ma),It.setSVGClass(Ma);var gE=["rx","ry"],Cs=class r extends hn{static getDefaults(){return G(G({},super.getDefaults()),r.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("scaleX")}getRy(){return this.get("ry")*this.get("scaleY")}toObject(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return super.toObject([...gE,...t])}_toSVG(){return[" +`)]}_render(t){t.beginPath(),t.save(),t.transform(1,0,0,this.ry/this.rx,0,0),t.arc(0,0,this.rx,0,Nr,!1),t.restore(),this._renderPaintInOrder(t)}static fromElement(t,e,n){return dt(this,null,function*(){let i=Vr(t,this.ATTRIBUTE_NAMES,n);return i.left=(i.left||0)-i.rx,i.top=(i.top||0)-i.ry,new this(i)})}};function rF(r){if(!r)return[];let t=r.replace(/,/g," ").trim().split(/\s+/),e=[];for(let n=0;n1&&arguments[1]!==void 0?arguments[1]:{};super(G({points:arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]},t)),W(this,"strokeDiff",void 0);let{left:e,top:n}=t;this.initialized=!0,this.setBoundingBox(!0),typeof e=="number"&&this.set(Fe,e),typeof n=="number"&&this.set(Vn,n)}isOpen(){return!0}_projectStrokeOnPoints(t){return Yv(this.points,t,this.isOpen())}_calcDimensions(t){t=G({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(l=>l.projectedPoint):this.points;if(e.length===0)return{left:0,top:0,width:0,height:0,pathOffset:new nt,strokeOffset:new nt,strokeDiff:new nt};let n=mr(e),i=kl(G(G({},t),{},{scaleX:1,scaleY:1})),s=mr(this.points.map(l=>Un(l,i,!0))),o=new nt(this.scaleX,this.scaleY),a=n.left+n.width/2,c=n.top+n.height/2;return this.exactBoundingBox&&(a-=c*Math.tan(nn(this.skewX)),c-=a*Math.tan(nn(this.skewY))),G(G({},n),{},{pathOffset:new nt(a,c),strokeOffset:new nt(s.left,s.top).subtract(new nt(n.left,n.top)).multiply(o),strokeDiff:new nt(n.width,n.height).subtract(new nt(s.width,s.height)).multiply(o)})}_findCenterFromElement(){let t=mr(this.points);return new nt(t.left+t.width/2,t.top+t.height/2)}setDimensions(){this.setBoundingBox()}setBoundingBox(t){let{left:e,top:n,width:i,height:s,pathOffset:o,strokeOffset:a,strokeDiff:c}=this._calcDimensions();this.set({width:i,height:s,pathOffset:o,strokeOffset:a,strokeDiff:c}),t&&this.setPositionByOrigin(new nt(e+i/2,n+s/2),_e,_e)}isStrokeAccountedForInDimensions(){return this.exactBoundingBox}_getNonTransformedDimensions(){return this.exactBoundingBox?new nt(this.width,this.height):super._getNonTransformedDimensions()}_getTransformedDimensions(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.exactBoundingBox){let o;if(Object.keys(t).some(a=>this.strokeUniform||this.constructor.layoutProperties.includes(a))){var e,n;let{width:a,height:c}=this._calcDimensions(t);o=new nt((e=t.width)!==null&&e!==void 0?e:a,(n=t.height)!==null&&n!==void 0?n:c)}else{var i,s;o=new nt((i=t.width)!==null&&i!==void 0?i:this.width,(s=t.height)!==null&&s!==void 0?s:this.height)}return o.multiply(new nt(t.scaleX||this.scaleX,t.scaleY||this.scaleY))}return super._getTransformedDimensions(t)}_set(t,e){let n=this.initialized&&this[t]!==e,i=super._set(t,e);return this.exactBoundingBox&&n&&((t==="scaleX"||t==="scaleY")&&this.strokeUniform&&this.constructor.layoutProperties.includes("strokeUniform")||this.constructor.layoutProperties.includes(t))&&this.setDimensions(),i}toObject(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return G(G({},super.toObject(t)),{},{points:Ol(this.points)})}_toSVG(){let t=[],e=this.pathOffset.x,n=this.pathOffset.y,i=Me.NUM_FRACTION_DIGITS;for(let s=0,o=this.points.length;s +`)]}_render(t){let e=this.points.length,n=this.pathOffset.x,i=this.pathOffset.y;if(e&&!isNaN(this.points[e-1].y)){t.beginPath(),t.moveTo(this.points[0].x-n,this.points[0].y-i);for(let s=0;so!==void 0);this._setStyleDeclaration(n,i,s)}getSelectionStyles(t,e,n){let i=[];for(let s=t;s<(e||t);s++)i.push(this.getStyleAtPosition(s,n));return i}getStyleAtPosition(t,e){let{lineIndex:n,charIndex:i}=this.get2DCursorLocation(t);return e?this.getCompleteStyleDeclaration(n,i):this._getStyleDeclaration(n,i)}setSelectionStyles(t,e,n){for(let i=e;i<(n||e);i++)this._extendStyles(i,t);this._forceClearCache=!0}_getStyleDeclaration(t,e){var n;let i=this.styles&&this.styles[t];return i&&(n=i[e])!==null&&n!==void 0?n:{}}getCompleteStyleDeclaration(t,e){return G(G({},xo(this,this.constructor._styleProperties)),this._getStyleDeclaration(t,e))}_setStyleDeclaration(t,e,n){this.styles[t][e]=n}_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]}};W(S0,"_styleProperties",oF);var cF=/ +/g,lF=/"/g;function _p(r,t,e,n,i){return" ".concat(function(s,o){let{left:a,top:c,width:l,height:h}=o,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Me.NUM_FRACTION_DIGITS,d=Dl("fill",s,!1),[f,m,g,x]=[a,c,l,h].map(p=>we(p,u));return"')}(r,{left:t,top:e,width:n,height:i}),` +`)}var hF=["textAnchor","textDecoration","dx","dy","top","left","fontSize","strokeWidth"],yp,Mn=class r extends S0{static getDefaults(){return G(G({},super.getDefaults()),r.ownDefaults)}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(G(G({},e),{},{text:t,styles:e?.styles||{}})),W(this,"__charBounds",[]),this.initialized=!0,this.path&&this.setPathInfo(),this.initDimensions(),this.setCoords()}setPathInfo(){let t=this.path;t&&(t.segmentsInfo=Em(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(xr)&&this.enlargeSpaces()}enlargeSpaces(){let t,e,n,i,s,o,a;for(let c=0,l=this._textLines.length;c')}_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==="stroke"?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))}_setTextStyles(t,e,n){if(t.textBaseline="alphabetic",this.path)switch(this.pathAlign){case _e:t.textBaseline="middle";break;case"ascender":t.textBaseline=Vn;break;case"descender":t.textBaseline=Bp}t.font=this._getFontDeclaration(e,n)}calcTextWidth(){let t=this.getLineWidth(0);for(let e=1,n=this._textLines.length;et&&(t=i)}return t}_renderTextLine(t,e,n,i,s,o){this._renderChars(t,e,n,i,s,o)}_renderTextLinesBackground(t){if(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))return;let e=t.fillStyle,n=this._getLeftOffset(),i=this._getTopOffset();for(let s=0,o=this._textLines.length;s=0:du?h%=u:h<0&&(h+=u),this._setGraphemeOnPath(h,n),h+=n.kernedWidth}return{width:i,numOfSpaces:0}}_setGraphemeOnPath(t,e){let n=t+e.kernedWidth/2,i=this.path,s=cE(i.path,n,i.segmentsInfo);e.renderLeft=s.x-i.pathOffset.x,e.renderTop=s.y-i.pathOffset.y,e.angle=s.angle+(this.pathSide===cn?Math.PI:0)}_getGraphemeBox(t,e,n,i,s){let o=this.getCompleteStyleDeclaration(e,n),a=i?this.getCompleteStyleDeclaration(e,n-1):{},c=this._measureChar(t,o,i,a),l,h=c.kernedWidth,u=c.width;this.charSpacing!==0&&(l=this._getWidthOfCharSpacing(),u+=l,h+=l);let d={width:u,left:0,height:o.fontSize,kernedWidth:h,deltaY:o.deltaY};if(n>0&&!s){let f=this.__charBounds[e][n-1];d.left=f.left+f.width+c.kernedWidth-c.width}return d}getHeightOfLine(t){if(this.__lineHeights[t])return this.__lineHeights[t];let e=this.getHeightOfChar(t,0);for(let n=1,i=this._textLines[t].length;n0){let T=i+f+x;this.direction==="rtl"&&(T=this.width-T-p),C&&v&&(t.fillStyle=v,t.fillRect(T,_+a*A+b,p,this.fontSize/15)),x=y.left,p=y.width,C=m,v=g,A=D,b=F}else p+=y.kernedWidth}let S=i+f+x;this.direction==="rtl"&&(S=this.width-S-p),t.fillStyle=g,m&&g&&t.fillRect(S,_+a*A+b,p-o,this.fontSize/15),n+=h}this._removeShadow(t)}_getFontDeclaration(){let{fontFamily:t=this.fontFamily,fontStyle:e=this.fontStyle,fontWeight:n=this.fontWeight,fontSize:i=this.fontSize}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0,o=t.includes("'")||t.includes('"')||t.includes(",")||r.genericFonts.includes(t.toLowerCase())?t:'"'.concat(t,'"');return[e,n,"".concat(s?this.CACHE_FONT_SIZE:i,"px"),o].join(" ")}render(t){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._forceClearCache&&this.initDimensions(),super.render(t)))}graphemeSplit(t){return O0(t)}_splitTextIntoLines(t){let e=t.split(this._reNewline),n=new Array(e.length),i=[` +`],s=[];for(let o=0;o0&&arguments[0]!==void 0?arguments[0]:[];return G(G({},super.toObject([...yE,...t])),{},{styles:$v(this.styles,this.text)},this.path?{path:this.path.toObject()}:{})}set(t,e){let{textLayoutProperties:n}=this.constructor;super.set(t,e);let i=!1,s=!1;if(typeof t=="object")for(let o in t)o==="path"&&this.setPathInfo(),i=i||n.includes(o),s=s||o==="path";else i=n.includes(t),s=t==="path";return s&&this.setPathInfo(),i&&this.initialized&&(this.initDimensions(),this.setCoords()),this}complexity(){return 1}static fromElement(t,e,n){return dt(this,null,function*(){let i=Vr(t,r.ATTRIBUTE_NAMES,n),s=G(G({},e),i),{textAnchor:o=Fe,textDecoration:a="",dx:c=0,dy:l=0,top:h=0,left:u=0,fontSize:d=sm,strokeWidth:f=1}=s,m=Oe(s,hF),g=new this((t.textContent||"").replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," "),G({left:u+c,top:h+l,underline:a.includes("underline"),overline:a.includes("overline"),linethrough:a.includes("line-through"),strokeWidth:0,fontSize:d},m)),x=g.getScaledHeight()/g.height,p=((g.height+g.strokeWidth)*g.lineHeight-g.height)*x,C=g.getScaledHeight()+p,v=0;return o===_e&&(v=g.getScaledWidth()/2),o===cn&&(v=g.getScaledWidth()),g.set({left:g.left-v,top:g.top-(C-g.fontSize*(.07+g._fontSizeFraction))/g.lineHeight,strokeWidth:f}),g})}static fromObject(t){return this._fromObject(G(G({},t),{},{styles:Zv(t.styles||{},t.text)}),{extraParam:"text"})}};W(Mn,"textLayoutProperties",_E),W(Mn,"cacheProperties",[...Ur,...yE]),W(Mn,"ownDefaults",aF),W(Mn,"type","Text"),W(Mn,"genericFonts",["sans-serif","serif","cursive","fantasy","monospace"]),W(Mn,"ATTRIBUTE_NAMES",Ds.concat("x","y","dx","dy","font-family","font-style","font-weight","font-size","letter-spacing","text-decoration","text-anchor")),jv(Mn,[class extends u0{_toSVG(){let r=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(r.textTop,r.textLeft);return this._wrapSVGTextAndBg(t)}toSVG(r){return this._createBaseSVGMarkup(this._toSVG(),{reviver:r,noStyle:!0,withShadow:!0})}_getSVGLeftTopOffsets(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}}_wrapSVGTextAndBg(r){let{textBgRects:t,textSpans:e}=r,n=this.getSvgTextDecoration(this);return[t.join(""),' ",e.join(""),` +`]}_getSVGTextAndBg(r,t){let e=[],n=[],i,s=r;this.backgroundColor&&n.push(..._p(this.backgroundColor,-this.width/2,-this.height/2,this.width,this.height));for(let o=0,a=this._textLines.length;o").concat(qv(r),"")}_setSVGTextLineText(r,t,e,n){let i=this.getHeightOfLine(t),s=this.textAlign.includes(xr),o=this._textLines[t],a,c,l,h,u,d="",f=0;n+=i*(1-this._fontSizeFraction)/this.lineHeight;for(let m=0,g=o.length-1;m<=g;m++)u=m===g||this.charSpacing,d+=o[m],l=this.__charBounds[t][m],f===0?(e+=l.kernedWidth-l.width,f+=l.width):f+=l.kernedWidth,s&&!u&&this._reSpaceAndTab.test(o[m])&&(u=!0),u||(a=a||this.getCompleteStyleDeclaration(t,m),c=this.getCompleteStyleDeclaration(t,m+1),u=L0(a,c,!0)),u&&(h=this._getStyleDeclaration(t,m),r.push(this._createTextCharSpan(d,h,e,n)),d="",a=c,this.direction==="rtl"?e-=f:e+=f,f=0)}_setSVGTextLineBg(r,t,e,n){let i=this._textLines[t],s=this.getHeightOfLine(t)/this.lineHeight,o,a=0,c=0,l=this.getValueOfPropertyAt(t,0,"textBackgroundColor");for(let h=0;hr[t.replace("-","")]).join(" ")}}]),It.setClass(Mn),It.setSVGClass(Mn);var Kp=class{constructor(t){W(this,"target",void 0),W(this,"__mouseDownInPlace",!1),W(this,"__dragStartFired",!1),W(this,"__isDraggingOver",!1),W(this,"__dragStartSelection",void 0),W(this,"__dragImageDisposer",void 0),W(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(n=>n()),this._dispose=void 0}}isPointerOverSelection(t){let e=this.target,n=e.getSelectionStartFromPointer(t);return e.isEditing&&n>=e.selectionStart&&n<=e.selectionEnd&&e.selectionStart{_.remove()},qi(t.target||this.target.hiddenTextarea).body.appendChild(_),(n=t.dataTransfer)===null||n===void 0||n.setDragImage(_,x.x,x.y)}onDragStart(t){this.__dragStartFired=!0;let e=this.target,n=this.isActive();if(n&&t.dataTransfer){let i=this.__dragStartSelection={selectionStart:e.selectionStart,selectionEnd:e.selectionEnd},s=e._text.slice(i.selectionStart,i.selectionEnd).join(""),o=G({text:e.text,value:s},i);t.dataTransfer.setData("text/plain",s),t.dataTransfer.setData("application/fabric",JSON.stringify({value:s,styles:e.getSelectionStyles(i.selectionStart,i.selectionEnd,!0)})),t.dataTransfer.effectAllowed="copyMove",this.setDragImage(t,o)}return e.abortCursorAnimation(),n}canDrop(t){if(this.target.editable&&!this.target.getActiveControl()&&!t.defaultPrevented){if(this.isActive()&&this.__dragStartSelection){let e=this.target.getSelectionStartFromPointer(t),n=this.__dragStartSelection;return en.selectionEnd}return!0}return!1}targetCanDrop(t){return this.target.canDrop(t)}dragEnterHandler(t){let{e}=t,n=this.targetCanDrop(e);!this.__isDraggingOver&&n&&(this.__isDraggingOver=!0)}dragOverHandler(t){let{e}=t,n=this.targetCanDrop(e);!this.__isDraggingOver&&n?this.__isDraggingOver=!0:this.__isDraggingOver&&!n&&(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:n}=t,i=n.defaultPrevented;this.__isDraggingOver=!1,n.preventDefault();let s=(e=n.dataTransfer)===null||e===void 0?void 0:e.getData("text/plain");if(s&&!i){let o=this.target,a=o.canvas,c=o.getSelectionStartFromPointer(n),{styles:l}=n.dataTransfer.types.includes("application/fabric")?JSON.parse(n.dataTransfer.getData("application/fabric")):{},h=s[Math.max(0,s.length-1)],u=0;if(this.__dragStartSelection){let d=this.__dragStartSelection.selectionStart,f=this.__dragStartSelection.selectionEnd;c>d&&c<=f?c=d:c>f&&(c-=f-d),o.removeChars(d,f),delete this.__dragStartSelection}o._reNewline.test(h)&&(o._reNewline.test(o._text[c])||c===o._text.length)&&(s=s.trimEnd()),t.didDrop=!0,t.dropTarget=o,o.insertChars(s,l,c),a.setActiveObject(o),o.enterEditing(n),o.selectionStart=Math.min(c+u,o._text.length),o.selectionEnd=Math.min(o.selectionStart+s.length,o._text.length),o.hiddenTextarea.value=o.text,o._updateTextarea(),o.hiddenTextarea.focus(),o.fire("changed",{index:c+u,action:"drop"}),a.fire("text:changed",{target:o}),a.contextTopDirty=!0,a.requestRenderAll()}}dragEndHandler(t){let{e}=t;if(this.isActive()&&this.__dragStartFired&&this.__dragStartSelection){var n;let i=this.target,s=this.target.canvas,{selectionStart:o,selectionEnd:a}=this.__dragStartSelection,c=((n=e.dataTransfer)===null||n===void 0?void 0:n.dropEffect)||ii;c===ii?(i.selectionStart=o,i.selectionEnd=a,i._updateTextarea(),i.hiddenTextarea.focus()):(i.clearContextTop(),c==="move"&&(i.removeChars(o,a),i.selectionStart=i.selectionEnd=o,i.hiddenTextarea&&(i.hiddenTextarea.value=i.text),i._updateTextarea(),i.fire("changed",{index:o,action:"dragend"}),s.fire("text:changed",{target:i}),s.requestRenderAll()),i.exitEditing())}this.__dragImageDisposer&&this.__dragImageDisposer(),delete this.__dragImageDisposer,delete this.__dragStartSelection,this.__isDraggingOver=!1}dispose(){this._dispose&&this._dispose()}},tv=/[ \n\.,;!\?\-]/,Jp=class extends Mn{constructor(){super(...arguments),W(this,"_currentCursorOpacity",1)}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:n,delay:i,onComplete:s}=t;return fm({startValue:this._currentCursorOpacity,endValue:e,duration:n,delay:i,onComplete:s,abort:()=>!this.canvas||this.selectionStart!==this.selectionEnd,onChange:o=>{this._currentCursorOpacity=o,this.renderCursorOrSelection()}})}_tick(t){this._currentTickState=this._animateCursor({toValue:1,duration:this.cursorDuration,delay:t,onComplete:this._onTickComplete})}_onTickComplete(){var t;(t=this._currentTickCompleteState)===null||t===void 0||t.abort(),this._currentTickCompleteState=this._animateCursor({toValue:0,duration:this.cursorDuration/2,delay:100,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}getSelectedText(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")}findWordBoundaryLeft(t){let e=0,n=t-1;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)e++,n--;for(;/\S/.test(this._text[n])&&n>-1;)e++,n--;return t-e}findWordBoundaryRight(t){let e=0,n=t;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)e++,n++;for(;/\S/.test(this._text[n])&&n-1;)e++,n--;return t-e}findLineBoundaryRight(t){let e=0,n=t;for(;!/\n/.test(this._text[n])&&n0&&this._reSpace.test(n[t])&&(e===-1||!om.test(n[t-1]))?t-1:t,s=n[i];for(;i>0&&ithis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=n):(this.selectionStart=n,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===s||(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,n){let i=n.slice(0,t),s=this.graphemeSplit(i).length;if(t===e)return{selectionStart:s,selectionEnd:s};let o=n.slice(t,e);return{selectionStart:s,selectionEnd:s+this.graphemeSplit(o).length}}fromGraphemeToStringSelection(t,e,n){let i=n.slice(0,t).join("").length;return t===e?{selectionStart:i,selectionEnd:i}:{selectionStart:i,selectionEnd:i+n.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),n=this.get2DCursorLocation(t),i=n.lineIndex,s=n.charIndex,o=this.getValueOfPropertyAt(i,s,"fontSize")*this.lineHeight,a=e.leftOffset,c=this.getCanvasRetinaScaling(),l=this.canvas.upperCanvasEl,h=l.width/c,u=l.height/c,d=h-o,f=u-o,m=new nt(e.left+a,e.top+e.topOffset+o).transform(this.calcTransformMatrix()).transform(this.canvas.viewportTransform).multiply(new nt(l.clientWidth/h,l.clientHeight/u));return m.x<0&&(m.x=0),m.x>d&&(m.x=d),m.y<0&&(m.y=0),m.y>f&&(m.y=f),m.x+=this.canvas._offset.left,m.y+=this.canvas._offset.top,{left:"".concat(m.x,"px"),top:"".concat(m.y,"px"),fontSize:"".concat(o,"px"),charHeight:o}}_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()}exitEditing(){let t=this._textBeforeEdit!==this.text;return this._exitEditing(),this.selectionEnd=this.selectionStart,this._restoreEditingProps(),this._forceClearCache&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),t&&this.fire("modified"),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:n,charIndex:i}=this.get2DCursorLocation(t,!0),{lineIndex:s,charIndex:o}=this.get2DCursorLocation(e,!0);if(n!==s){if(this.styles[n])for(let a=i;a=o&&(a[h-c]=a[l],delete a[l])}}}shiftLineStyles(t,e){let n=Object.assign({},this.styles);for(let i in this.styles){let s=parseInt(i,10);s>t&&(this.styles[s+e]=n[s],n[s-e]||delete this.styles[s])}}insertNewlineStyleObject(t,e,n,i){let s={},o=this._unwrappedTextLines[t].length,a=o===e,c=!1;n||(n=1),this.shiftLineStyles(t,n);let l=this.styles[t]?this.styles[t][e===0?e:e-1]:void 0;for(let u in this.styles[t]){let d=parseInt(u,10);d>=e&&(c=!0,s[d-e]=this.styles[t][u],a&&e===0||delete this.styles[t][u])}let h=!1;for(c&&!a&&(this.styles[t+n]=s,h=!0),(h||o>e)&&n--;n>0;)i&&i[n-1]?this.styles[t+n]={0:G({},i[n-1])}:l?this.styles[t+n]={0:G({},l)}:delete this.styles[t+n],n--;this._forceClearCache=!0}insertCharStyleObject(t,e,n,i){this.styles||(this.styles={});let s=this.styles[t],o=s?G({},s):{};n||(n=1);for(let c in o){let l=parseInt(c,10);l>=e&&(s[l+n]=o[l],o[l-n]||delete s[l])}if(this._forceClearCache=!0,i){for(;n--;)Object.keys(i[n]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][e+n]=G({},i[n]));return}if(!s)return;let a=s[e?e-1:1];for(;a&&n--;)this.styles[t][e+n]=G({},a)}insertNewStyleBlock(t,e,n){let i=this.get2DCursorLocation(e,!0),s=[0],o,a=0;for(let c=0;c0&&(this.insertCharStyleObject(i.lineIndex,i.charIndex,s[0],n),n=n&&n.slice(s[0]+1)),a&&this.insertNewlineStyleObject(i.lineIndex,i.charIndex+s[0],a),o=1;o0?this.insertCharStyleObject(i.lineIndex+o,0,s[o],n):n&&this.styles[i.lineIndex+o]&&n[0]&&(this.styles[i.lineIndex+o][0]=n[0]),n=n&&n.slice(s[o]+1);s[o]>0&&this.insertCharStyleObject(i.lineIndex+o,0,s[o],n)}removeChars(t){let e=arguments.length>1&&arguments[1]!==void 0?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,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;i>n&&this.removeStyleFromTo(n,i);let s=this.graphemeSplit(t);this.insertNewStyleBlock(s,n,e),this._text=[...this._text.slice(0,n),...s,...this._text.slice(i)],this.text=this._text.join(""),this.set("dirty",!0),this.initDimensions(),this.setCoords(),this._removeExtraneousStyles()}setSelectionStartEndWithShift(t,e,n){n<=t?(e===t?this._selectionDirection=Fe:this._selectionDirection===cn&&(this._selectionDirection=Fe,this.selectionEnd=t),this.selectionStart=n):n>t&&n{let[a,c]=o;return e.setAttribute(a,c)});let{top:n,left:i,fontSize:s}=this._calcTextareaPosition();e.style.cssText="position: absolute; top: ".concat(n,"; left: ").concat(i,"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: ").concat(s,";"),(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(o=>{let[a,c]=o;return e.addEventListener(a,this[c].bind(this))}),this.hiddenTextarea=e}blur(){this.abortCursorAnimation()}onKeyDown(t){if(!this.isEditing)return;let e=this.direction==="rtl"?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;if(this.fromPaste=!1,t&&t.stopPropagation(),!this.isEditing)return;let n=()=>{this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())};if(this.hiddenTextarea.value==="")return this.styles={},void n();let i=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,s=this._text.length,o=i.length,a=this.selectionStart,c=this.selectionEnd,l=a!==c,h,u,d,f,m=o-s,g=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),x=a>g.selectionStart;l?(u=this._text.slice(a,c),m+=c-a):oh[0])),l?(d=a,f=c):x?(d=c-u.length,f=c):(d=c,f=c+u.length),this.removeStyleFromTo(d,f)),p.length){let{copyPasteData:C}=gr();e&&p.join("")===C.copiedText&&!Me.disableStyleCopyPaste&&(h=C.copiedTextStyle),this.insertNewStyleBlock(p,a,h)}n()}onCompositionStart(){this.inCompositionMode=!0}onCompositionEnd(){this.inCompositionMode=!1}onCompositionUpdate(t){let{target:e}=t,{selectionStart:n,selectionEnd:i}=e;this.compositionStart=n,this.compositionEnd=i,this.updateTextareaPosition()}copy(){if(this.selectionStart===this.selectionEnd)return;let{copyPasteData:t}=gr();t.copiedText=this.getSelectedText(),Me.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 n,i=this._getLineLeftOffset(t);return e>0&&(n=this.__charBounds[t][e-1],i+=n.left+n.width),i}getDownCursorOffset(t,e){let n=this._getSelectionForOffset(t,e),i=this.get2DCursorLocation(n),s=i.lineIndex;if(s===this._textLines.length-1||t.metaKey||t.keyCode===34)return this._text.length-n;let o=i.charIndex,a=this._getWidthBeforeCursor(s,o),c=this._getIndexOnLine(s+1,a);return this._textLines[s].slice(o).length+c+1+this.missingNewlineOffset(s)}_getSelectionForOffset(t,e){return t.shiftKey&&this.selectionStart!==this.selectionEnd&&e?this.selectionEnd:this.selectionStart}getUpCursorOffset(t,e){let n=this._getSelectionForOffset(t,e),i=this.get2DCursorLocation(n),s=i.lineIndex;if(s===0||t.metaKey||t.keyCode===33)return-n;let o=i.charIndex,a=this._getWidthBeforeCursor(s,o),c=this._getIndexOnLine(s-1,a),l=this._textLines[s].slice(0,o),h=this.missingNewlineOffset(s-1);return-this._textLines[s-1].length+c-l.length+(1-h)}_getIndexOnLine(t,e){let n=this._textLines[t],i,s,o=this._getLineLeftOffset(t),a=0;for(let c=0,l=n.length;ce){s=!0;let h=o-i,u=o,d=Math.abs(h-e);a=Math.abs(u-e)=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",t)}moveCursorUp(t){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorUpOrDown("Up",t)}_moveCursorUpOrDown(t,e){let n=this["get".concat(t,"CursorOffset")](e,this._selectionDirection===cn);if(e.shiftKey?this.moveCursorWithShift(n):this.moveCursorWithoutShift(n),n!==0){let i=this.text.length;this.selectionStart=uo(0,this.selectionStart,i),this.selectionEnd=uo(0,this.selectionEnd,i),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea()}}moveCursorWithShift(t){let e=this._selectionDirection===Fe?this.selectionStart+t:this.selectionEnd+t;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,e),t!==0}moveCursorWithoutShift(t){return t<0?(this.selectionStart+=t,this.selectionEnd=this.selectionStart):(this.selectionEnd+=t,this.selectionStart=this.selectionEnd),t!==0}moveCursorLeft(t){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorLeftOrRight("Left",t)}_move(t,e,n){let i;if(t.altKey)i=this["findWordBoundary".concat(n)](this[e]);else{if(!t.metaKey&&t.keyCode!==35&&t.keyCode!==36)return this[e]+=n==="Left"?-1:1,!0;i=this["findLineBoundary".concat(n)](this[e])}return i!==void 0&&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=Fe,this.selectionEnd===this.selectionStart&&this.selectionStart!==0&&(e=this._moveLeft(t,"selectionStart")),this.selectionEnd=this.selectionStart,e}moveCursorLeftWithShift(t){return this._selectionDirection===cn&&this.selectionStart!==this.selectionEnd?this._moveLeft(t,"selectionEnd"):this.selectionStart!==0?(this._selectionDirection=Fe,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 n="moveCursor".concat(t).concat(e.shiftKey?"WithShift":"WithoutShift");this._currentCursorOpacity=1,this[n](e)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())}moveCursorRightWithShift(t){return this._selectionDirection===Fe&&this.selectionStart!==this.selectionEnd?this._moveRight(t,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection=cn,this._moveRight(t,"selectionEnd")):void 0}moveCursorRightWithoutShift(t){let e=!0;return this._selectionDirection=cn,this.selectionStart===this.selectionEnd?(e=this._moveRight(t,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,e}},bp=r=>!!r.button,tm=class extends Qp{constructor(){super(...arguments),W(this,"draggableTextDelegate",void 0)}initBehavior(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore),this.on("mouseup",this.mouseUpHandler),this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler),this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown),this.draggableTextDelegate=new Kp(this),super.initBehavior()}shouldStartDragging(){return this.draggableTextDelegate.isActive()}onDragStart(t){return this.draggableTextDelegate.onDragStart(t)}canDrop(t){return this.draggableTextDelegate.canDrop(t)}onMouseDown(t){if(!this.canvas)return;this.__newClickTime=+new Date;let e=t.pointer;this.isTripleClick(e)&&(this.fire("tripleclick",t),Pp(t.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=e,this.__lastSelected=this.selected&&!this.getActiveControl()}isTripleClick(t){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===t.x&&this.__lastPointer.y===t.y}doubleClickHandler(t){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(t.e))}tripleClickHandler(t){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(t.e))}_mouseDownHandler(t){let{e}=t;this.canvas&&this.editable&&!bp(e)&&!this.getActiveControl()&&(this.draggableTextDelegate.start(e)||(this.canvas.textEditingManager.register(this),this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection())))}_mouseDownHandlerBefore(t){let{e}=t;this.canvas&&this.editable&&!bp(e)&&(this.selected=this===this.canvas._activeObject)}mouseUpHandler(t){let{e,transform:n}=t,i=this.draggableTextDelegate.end(e);if(this.canvas){this.canvas.textEditingManager.unregister(this);let s=this.canvas._activeObject;if(s&&s!==this)return}!this.editable||this.group&&!this.group.interactive||n&&n.actionPerformed||bp(e)||i||(this.__lastSelected&&!this.getActiveControl()?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0)}setCursorByClick(t){let e=this.getSelectionStartFromPointer(t),n=this.selectionStart,i=this.selectionEnd;t.shiftKey?this.setSelectionStartEndWithShift(n,i,e):(this.selectionStart=e,this.selectionEnd=e),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())}getSelectionStartFromPointer(t){let e=this.canvas.getScenePoint(t).transform(fi(this.calcTransformMatrix())).add(new nt(-this._getLeftOffset(),-this._getTopOffset())),n=0,i=0,s=0;for(let l=0;l0&&(i+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));let o=Math.abs(this._getLineLeftOffset(s)),a=this._textLines[s].length,c=this.__charBounds[s];for(let l=0;l0&&arguments[0]!==void 0?arguments[0]:this.selectionStart||0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selectionEnd,n=arguments.length>2?arguments[2]:void 0;return super.getSelectionStyles(t,e,n)}setSelectionStyles(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selectionStart||0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.selectionEnd;return super.setSelectionStyles(t,e,n)}get2DCursorLocation(){let t=arguments.length>0&&arguments[0]!==void 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 n=super.toCanvasElement(t);return this.isEditing=e,n}renderCursorOrSelection(){if(!this.isEditing)return;let t=this.clearContextTop(!0);if(!t)return;let e=this._getCursorBoundaries();this.selectionStart===this.selectionEnd?this.renderCursor(t,e):this.renderSelection(t,e),this.canvas.contextTopDirty=!0,t.restore()}_getCursorBoundaries(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.selectionStart,e=arguments.length>1?arguments[1]:void 0,n=this._getLeftOffset(),i=this._getTopOffset(),s=this._getCursorBoundariesOffsets(t,e);return{left:n,top:i,leftOffset:s.left,topOffset:s.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,n=0,{charIndex:i,lineIndex:s}=this.get2DCursorLocation(t);for(let l=0;l0?n:0)};return this.direction==="rtl"&&(this.textAlign===cn||this.textAlign===xr||this.textAlign===Sl?c.left*=-1:this.textAlign===Fe||this.textAlign===A0?c.left=o-(n>0?n:0):this.textAlign!==_e&&this.textAlign!==wl||(c.left=o-(n>0?n:0))),c}renderCursorAt(t){let e=this._getCursorBoundaries(t,!0);this._renderCursor(this.canvas.contextTop,e,t)}renderCursor(t,e){this._renderCursor(t,e,this.selectionStart)}_renderCursor(t,e,n){let i=this.get2DCursorLocation(n),s=i.lineIndex,o=i.charIndex>0?i.charIndex-1:0,a=this.getValueOfPropertyAt(s,o,"fontSize"),c=this.getObjectScaling().x*this.canvas.getZoom(),l=this.cursorWidth/c,h=this.getValueOfPropertyAt(s,o,"deltaY"),u=e.topOffset+(1-this._fontSizeFraction)*this.getHeightOfLine(s)/this.lineHeight-a*(1-this._fontSizeFraction);this.inCompositionMode&&this.renderSelection(t,e),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(s,o,"fill"),t.globalAlpha=this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-l/2,u+e.top+h,l,a)}renderSelection(t,e){let n={selectionStart:this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,selectionEnd:this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd};this._renderSelection(t,n,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,n){let i=e.selectionStart,s=e.selectionEnd,o=this.textAlign.includes(xr),a=this.get2DCursorLocation(i),c=this.get2DCursorLocation(s),l=a.lineIndex,h=c.lineIndex,u=a.charIndex<0?0:a.charIndex,d=c.charIndex<0?0:c.charIndex;for(let f=l;f<=h;f++){let m=this._getLineLeftOffset(f)||0,g=this.getHeightOfLine(f),x=0,p=0,C=0;if(f===l&&(p=this.__charBounds[l][u].left),f>=l&&f1)&&(g/=this.lineHeight);let v=n.left+m+p,_=g,A=0,b=C-p;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",_=1,A=g):t.fillStyle=this.selectionColor,this.direction==="rtl"&&(this.textAlign===cn||this.textAlign===xr||this.textAlign===Sl?v=this.width-v-b:this.textAlign===Fe||this.textAlign===A0?v=n.left+m-C:this.textAlign!==_e&&this.textAlign!==wl||(v=n.left+m-C)),t.fillRect(v,n.top+n.topOffset+A,b,_),n.topOffset+=x}}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,"fill")}_getCurrentCharIndex(){let t=this.get2DCursorLocation(this.selectionStart,!0),e=t.charIndex>0?t.charIndex-1:0;return{l:t.lineIndex,c:e}}dispose(){this._exitEditing(),this.draggableTextDelegate.dispose(),super.dispose()}};W(Es,"ownDefaults",uF),W(Es,"type","IText"),It.setClass(Es),It.setClass(Es,"i-text");var Ba=class r extends Es{static getDefaults(){return G(G({},super.getDefaults()),{},{controls:Wv()},r.ownDefaults)}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(xr)&&this.enlargeSpaces(),this.height=this.calcTextHeight())}_generateStyleMap(t){let e=0,n=0,i=0,s={};for(let o=0;o0?(n=0,i++,e++):!this.splitByGrapheme&&this._reSpaceAndTab.test(t.graphemeText[i])&&o>0&&(n++,i++),s[o]={line:e,offset:n},i+=t.graphemeLines[o].length,n+=t.graphemeLines[o].length;return s}styleHas(t,e){if(this._styleMap&&!this.isWrapping){let n=this._styleMap[e];n&&(e=n.line)}return super.styleHas(t,e)}isEmptyStyles(t){if(!this.styles)return!0;let e,n=0,i=t+1,s=!1,o=this._styleMap[t],a=this._styleMap[t+1];o&&(t=o.line,n=o.offset),a&&(i=a.line,s=i===t,e=a.offset);let c=t===void 0?this.styles:{line:this.styles[t]};for(let l in c)for(let h in c[l]){let u=parseInt(h,10);if(u>=n&&(!s||u{let a=0,c=e?this.graphemeSplit(s):this.wordSplit(s);return c.length===0?[{word:[],width:0}]:c.map(l=>{let h=e?[l]:this.graphemeSplit(l),u=this._measureWord(h,o,a);return i=Math.max(u,i),a+=h.length+n.length,{word:h,width:u}})}),largestWordWidth:i}}_measureWord(t,e){let n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=0;for(let o=0,a=t.length;o3&&arguments[3]!==void 0?arguments[3]:0,a=this._getWidthOfCharSpacing(),c=this.splitByGrapheme,l=[],h=c?"":" ",u=0,d=[],f=0,m=0,g=!0;e-=o;let x=Math.max(e,i,this.dynamicMinWidth),p=s[t],C;for(f=0,C=0;Cx&&!g?(l.push(d),d=[],u=_,g=!0):u+=a,g||c||d.push(h),d=d.concat(v),m=c?0:this._measureWord([h],t,f),f++,g=!1}return C&&l.push(d),i+o>this.dynamicMinWidth&&(this.dynamicMinWidth=i-a+o),l}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:0:1}_splitTextIntoLines(t){let e=super._splitTextIntoLines(t),n=this._wrapText(e.lines,this.width),i=new Array(n.length);for(let s=0;s0&&arguments[0]!==void 0?arguments[0]:[];return super.toObject(["minWidth","splitByGrapheme",...t])}};W(Ba,"type","Textbox"),W(Ba,"textLayoutProperties",[...Es.textLayoutProperties,"width"]),W(Ba,"ownDefaults",{minWidth:20,dynamicMinWidth:2,lockScalingFlip:!0,noScaleCache:!1,_wordJoiners:/[ \t\r]/,splitByGrapheme:!1}),It.setClass(Ba);var w0=class extends Ka{shouldPerformLayout(t){return!!t.target.clipPath&&super.shouldPerformLayout(t)}shouldLayoutClipPath(){return!1}calcLayoutResult(t,e){let{target:n}=t,{clipPath:i}=n;if(!i||!this.shouldPerformLayout(t))return;let{width:s,height:o}=mr(Qv(n,i)),a=new nt(s,o);if(i.absolutePositioned){var c;return{center:_s(i.getRelativeCenterPoint(),void 0,(c=n.group)===null||c===void 0?void 0:c.calcTransformMatrix()),size:a}}{let l=i.getRelativeCenterPoint().transform(n.calcOwnMatrix(),!0);if(this.shouldPerformLayout(t)){let{center:h=new nt,correction:u=new nt}=this.calcBoundingBox(e,t)||{};return{center:h.add(l),correction:u.subtract(l),size:a}}return{center:n.getRelativeCenterPoint().add(l),size:a}}}};W(w0,"type","clip-path"),It.setClass(w0);var M0=class extends Ka{getInitialSize(t,e){let{target:n}=t,{size:i}=e;return new nt(n.width||i.x,n.height||i.y)}};W(M0,"type","fixed"),It.setClass(M0);var em=class extends fo{subscribeTargets(t){let e=t.target;t.targets.reduce((n,i)=>(i.parent&&n.add(i.parent),n),new Set).forEach(n=>{n.layoutManager.subscribeTargets({target:n,targets:[e]})})}unsubscribeTargets(t){let e=t.target,n=e.getObjects();t.targets.reduce((i,s)=>(s.parent&&i.add(s.parent),i),new Set).forEach(i=>{!n.some(s=>s.parent===i)&&i.layoutManager.unsubscribeTargets({target:i,targets:[e]})})}},Ta=class r extends ys{static getDefaults(){return G(G({},super.getDefaults()),r.ownDefaults)}constructor(){var t;let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],G(G({},e),{},{layoutManager:(t=e.layoutManager)!==null&&t!==void 0?t:new em}))}_shouldSetNestedCoords(){return!0}__objectSelectionMonitor(){}multiSelectAdd(){for(var t=arguments.length,e=new Array(t),n=0;n{let s=this._objects.findIndex(a=>a.isInFrontOf(i)),o=s===-1?this.size():s;this.insertAt(o,i)})}canEnterGroup(t){return this.getObjects().some(e=>e.isDescendantOf(t)||t.isDescendantOf(e))?(As("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 n=new Set;e.forEach(i=>{let{parent:s}=i;s&&n.add(s)}),t===vm?n.forEach(i=>{i._onAfterObjectsChange(E0,e)}):n.forEach(i=>{i._set("dirty",!0)})}onDeselect(){return this.removeAll(),!1}toString(){return"#")}shouldCache(){return!1}isOnACache(){return!1}_renderControls(t,e,n){t.save(),t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,super._renderControls(t,e);let i=G(G({hasControls:!1},n),{},{forActiveSelection:!0});for(let s=0;s{l.applyTo(a)});let{imageData:c}=a;return c.width===n&&c.height===i||(s.width=c.width,s.height=c.height),o.putImageData(c,0,0),a}},D0=class{constructor(){let{tileSize:t=Me.textureSize}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};W(this,"aPosition",new Float32Array([0,0,0,1,1,0,1,1])),W(this,"resources",{}),this.tileSize=t,this.setupGLContext(t,t),this.captureGPUInfo()}setupGLContext(t,e){this.dispose(),this.createWebGLCanvas(t,e)}createWebGLCanvas(t,e){let n=ln();n.width=t,n.height=e;let i=n.getContext("webgl",{alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1});i&&(i.clearColor(0,0,0,0),this.canvas=n,this.gl=i)}applyFilters(t,e,n,i,s,o){let a=this.gl,c=s.getContext("2d");if(!a||!c)return;let l;o&&(l=this.getCachedTexture(o,e));let h={originalWidth:e.width||e.originalWidth||0,originalHeight:e.height||e.originalHeight||0,sourceWidth:n,sourceHeight:i,destinationWidth:n,destinationHeight:i,context:a,sourceTexture:this.createTexture(a,n,i,l?void 0:e),targetTexture:this.createTexture(a,n,i),originalTexture:l||this.createTexture(a,n,i,l?void 0:e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:s},u=a.createFramebuffer();return a.bindFramebuffer(a.FRAMEBUFFER,u),t.forEach(d=>{d&&d.applyTo(h)}),function(d){let f=d.targetCanvas,m=f.width,g=f.height,x=d.destinationWidth,p=d.destinationHeight;m===x&&g===p||(f.width=x,f.height=p)}(h),this.copyGLTo2D(a,h),a.bindTexture(a.TEXTURE_2D,null),a.deleteTexture(h.sourceTexture),a.deleteTexture(h.targetTexture),a.deleteFramebuffer(u),c.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,n,i,s){let{NEAREST:o,TEXTURE_2D:a,RGBA:c,UNSIGNED_BYTE:l,CLAMP_TO_EDGE:h,TEXTURE_MAG_FILTER:u,TEXTURE_MIN_FILTER:d,TEXTURE_WRAP_S:f,TEXTURE_WRAP_T:m}=t,g=t.createTexture();return t.bindTexture(a,g),t.texParameteri(a,u,s||o),t.texParameteri(a,d,s||o),t.texParameteri(a,f,h),t.texParameteri(a,m,h),i?t.texImage2D(a,0,c,c,l,i):t.texImage2D(a,0,c,e,n,0,c,l,null),g}getCachedTexture(t,e,n){let{textureCache:i}=this;if(i[t])return i[t];{let s=this.createTexture(this.gl,e.width,e.height,e,n);return s&&(i[t]=s),s}}evictCachesForKey(t){this.textureCache[t]&&(this.gl.deleteTexture(this.textureCache[t]),delete this.textureCache[t])}copyGLTo2D(t,e){let n=t.canvas,i=e.targetCanvas,s=i.getContext("2d");if(!s)return;s.translate(0,i.height),s.scale(1,-1);let o=n.height-i.height;s.drawImage(n,0,o,i.width,i.height,0,0,i.width,i.height)}copyGLTo2DPutImageData(t,e){let n=e.targetCanvas.getContext("2d"),i=e.destinationWidth,s=e.destinationHeight,o=i*s*4;if(!n)return;let a=new Uint8Array(this.imageBuffer,0,o),c=new Uint8ClampedArray(this.imageBuffer,0,o);t.readPixels(0,0,i,s,t.RGBA,t.UNSIGNED_BYTE,a);let l=new ImageData(c,i,s);n.putImageData(l,0,0)}captureGPUInfo(){if(this.gpuInfo)return this.gpuInfo;let t=this.gl,e={renderer:"",vendor:""};if(!t)return e;let n=t.getExtension("WEBGL_debug_renderer_info");if(n){let i=t.getParameter(n.UNMASKED_RENDERER_WEBGL),s=t.getParameter(n.UNMASKED_VENDOR_WEBGL);i&&(e.renderer=i.toLowerCase()),s&&(e.vendor=s.toLowerCase())}return this.gpuInfo=e,e}},Ap;function dF(){let{WebGLProbe:r}=gr();return r.queryWebGL(ln()),Me.enableGLFiltering&&r.isSupported(Me.textureSize)?new D0({tileSize:Me.textureSize}):new nm}function Sp(){return!Ap&&(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0])&&(Ap=dF()),Ap}var fF=["filters","resizeFilter","src","crossOrigin","type"],bE=["cropX","cropY"],Ri=class r extends hn{static getDefaults(){return G(G({},super.getDefaults()),r.ownDefaults)}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(G({filters:[]},e)),W(this,"_lastScaleX",1),W(this,"_lastScaleY",1),W(this,"_filterScalingX",1),W(this,"_filterScalingY",1),this.cacheKey="texture".concat(ws()),this.setElement(typeof t=="string"?(this.canvas&&qi(this.canvas.getElement())||Ja()).getElementById(t):t,e)}getElement(){return this._element}setElement(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.removeTexture(this.cacheKey),this.removeTexture("".concat(this.cacheKey,"_filtered")),this._element=t,this._originalElement=t,this._setWidthHeight(e),t.classList.add(r.CSS_CANVAS),this.filters.length!==0&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters()}removeTexture(t){let e=Sp(!1);e instanceof D0&&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&&gr().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||this.strokeWidth===0)return;let e=this.width/2,n=this.height/2;t.beginPath(),t.moveTo(-e,-n),t.lineTo(e,-n),t.lineTo(e,n),t.lineTo(-e,n),t.lineTo(-e,-n),t.closePath()}toObject(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=[];return this.filters.forEach(n=>{n&&e.push(n.toObject())}),G(G({},super.toObject([...bE,...t])),{},{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:e},this.resizeFilter?{resizeFilter:this.resizeFilter.toObject()}:{})}hasCrop(){return!!this.cropX||!!this.cropY||this.width +`,' +`,` +`),a=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(c=' image-rendering="optimizeSpeed"'),t.push(" +`)),this.stroke||this.strokeDashArray){let l=this.fill;this.fill=null,o=[' +`)],this.fill=l}return s=this.paintFirst!=="fill"?s.concat(o,t):s.concat(t,o),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:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return yl(t,{crossOrigin:e,signal:n}).then(i=>{e!==void 0&&this.set({crossOrigin:e}),this.setElement(i)})}toString(){return'#')}applyResizeFilters(){let t=this.resizeFilter,e=this.minimumScaleTrigger,n=this.getTotalObjectScaling(),i=n.x,s=n.y,o=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||i>e&&s>e)return this._element=o,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=i,void(this._lastScaleY=s);let a=ln(),c=o.width,l=o.height;a.width=c,a.height=l,this._element=a,this._lastScaleX=t.scaleX=i,this._lastScaleY=t.scaleY=s,Sp().applyFilters([t],o,c,l,this._element),this._filterScalingX=a.width/this._originalElement.width,this._filterScalingY=a.height/this._originalElement.height}applyFilters(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.filters||[];if(t=t.filter(s=>s&&!s.isNeutralState()),this.set("dirty",!0),this.removeTexture("".concat(this.cacheKey,"_filtered")),t.length===0)return this._element=this._originalElement,this._filteredEl=void 0,this._filterScalingX=1,void(this._filterScalingY=1);let e=this._originalElement,n=e.naturalWidth||e.width,i=e.naturalHeight||e.height;if(this._element===this._originalElement){let s=ln();s.width=n,s.height=i,this._element=s,this._filteredEl=s}else this._filteredEl&&(this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,n,i),this._lastScaleX=1,this._lastScaleY=1);Sp().applyFilters(t,this._originalElement,n,i,this._element),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,this.isMoving!==!0&&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 n=this._filterScalingX,i=this._filterScalingY,s=this.width,o=this.height,a=Math.max(this.cropX,0),c=Math.max(this.cropY,0),l=e.naturalWidth||e.width,h=e.naturalHeight||e.height,u=a*n,d=c*i,f=Math.min(s*n,l-u),m=Math.min(o*i,h-d),g=-s/2,x=-o/2,p=Math.min(s,l/n-a),C=Math.min(o,h/i-c);e&&t.drawImage(e,u,d,f,m,g,x,p,C)}_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&&arguments[0]!==void 0?arguments[0]:{},n=this.getOriginalSize();this.width=t||n.width,this.height=e||n.height}parsePreserveAspectRatioAttribute(){let t=uv(this.preserveAspectRatio||""),e=this.width,n=this.height,i={width:e,height:n},s,o=this._element.width,a=this._element.height,c=1,l=1,h=0,u=0,d=0,f=0;return!t||t.alignX===ii&&t.alignY===ii?(c=e/o,l=n/a):(t.meetOrSlice==="meet"&&(c=l=eE(this._element,i),s=(e-o*c)/2,t.alignX==="Min"&&(h=-s),t.alignX==="Max"&&(h=s),s=(n-a*l)/2,t.alignY==="Min"&&(u=-s),t.alignY==="Max"&&(u=s)),t.meetOrSlice==="slice"&&(c=l=nE(this._element,i),s=o-e/c,t.alignX==="Mid"&&(d=s/2),t.alignX==="Max"&&(d=s),s=a-n/l,t.alignY==="Mid"&&(f=s/2),t.alignY==="Max"&&(f=s),o=e/c,a=n/l)),{width:o,height:a,scaleX:c,scaleY:l,offsetLeft:h,offsetTop:u,cropX:d,cropY:f}}static fromObject(t){let{filters:e,resizeFilter:n,src:i,crossOrigin:s,type:o}=t,a=Oe(t,fF),c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Promise.all([yl(i,G(G({},c),{},{crossOrigin:s})),e&&$a(e,c),n&&$a([n],c),Rl(a,c)]).then(l=>{let[h,u=[],[d]=[],f={}]=l;return new this(h,G(G({},a),{},{src:i,filters:u,resizeFilter:d},f))})}static fromURL(t){let{crossOrigin:e=null,signal:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return yl(t,{crossOrigin:e,signal:n}).then(s=>new this(s,i))}static fromElement(e){return dt(this,arguments,function*(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,s=Vr(t,this.ATTRIBUTE_NAMES,i);return this.fromURL(s["xlink:href"],n,s).catch(o=>(As("log","Unable to parse Image",o),null))})}};W(Ri,"type","Image"),W(Ri,"cacheProperties",[...Ur,...bE]),W(Ri,"ownDefaults",{strokeWidth:0,srcFromAttribute:!1,minimumScaleTrigger:.5,cropX:0,cropY:0,imageSmoothing:!0}),W(Ri,"CSS_CANVAS","canvas-img"),W(Ri,"ATTRIBUTE_NAMES",[...Ds,"x","y","width","height","preserveAspectRatio","xlink:href","crossOrigin","image-rendering"]),It.setClass(Ri),It.setSVGClass(Ri);var rO=R0(["pattern","defs","symbol","metadata","clipPath","mask","desc"]);var AE="modifyPoly",ev=r=>function(t,e,n){let{points:i,pathOffset:s}=n;return new nt(i[r]).subtract(s).transform(Dn(n.getViewportTransform(),n.calcTransformMatrix()))},SE=(r,t,e,n)=>{let{target:i,pointIndex:s}=t,o=i,a=_s(new nt(e,n),void 0,o.calcOwnMatrix());return o.points[s]=a.add(o.pathOffset),o.setDimensions(),!0},wE=(r,t)=>function(e,n,i,s){let o=n.target,a=new nt(o.points[(r>0?r:o.points.length)-1]),c=a.subtract(o.pathOffset).transform(o.calcOwnMatrix()),l=t(e,G(G({},n),{},{pointIndex:r}),i,s),h=a.subtract(o.pathOffset).transform(o.calcOwnMatrix()).subtract(c);return o.left-=h.x,o.top-=h.y,l},nv=r=>Ms(AE,wE(r,SE)),sO=Object.freeze({__proto__:null,changeWidth:Hp,createObjectDefaultControls:gm,createPolyActionHandler:nv,createPolyControls:function(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e={};for(let n=0;n<(typeof r=="number"?r:r.points.length);n++)e["p".concat(n)]=new Nn(G({actionName:AE,positionHandler:ev(n),actionHandler:nv(n)},t));return e},createPolyPositionHandler:ev,createResizeControls:Gv,createTextboxDefaultControls:Wv,dragHandler:Av,factoryPolyActionHandler:wE,getLocalPoint:P0,polyActionHandler:SE,renderCircleControl:Fv,renderSquareControl:Pv,rotationStyleHandler:kv,rotationWithSnapping:Rv,scaleCursorStyleHandler:Sa,scaleOrSkewActionName:vl,scaleSkewCursorStyleHandler:so,scalingEqually:Cl,scalingX:Lv,scalingXOrSkewingY:Gp,scalingY:Nv,scalingYOrSkewingX:Wp,skewCursorStyleHandler:Uv,skewHandlerX:zv,skewHandlerY:Hv,wrapWithFireEvent:Ms,wrapWithFixedAnchor:po}),N0=r=>r.webgl!==void 0;var im="precision highp float",xF=` + `.concat(im,`; + varying vec2 vTexCoord; + uniform sampler2D uTexture; + void main() { + gl_FragColor = texture2D(uTexture, vTexCoord); + }`),pF=["type"],mF=["type"],un=class{get type(){return this.constructor.type}constructor(){let t=Oe(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},pF);W(this,"vertexSource",` + attribute vec2 aPosition; + varying vec2 vTexCoord; + void main() { + vTexCoord = aPosition; + gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0); + }`),Object.assign(this,this.constructor.defaults,t)}getFragmentSource(){return xF}createProgram(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFragmentSource(),n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.vertexSource,{WebGLProbe:{GLPrecision:i="highp"}}=gr();i!=="highp"&&(e=e.replace(new RegExp(im,"g"),im.replace("highp",i)));let s=t.createShader(t.VERTEX_SHADER),o=t.createShader(t.FRAGMENT_SHADER),a=t.createProgram();if(!s||!o||!a)throw new Oi("Vertex, fragment shader or program creation error");if(t.shaderSource(s,n),t.compileShader(s),!t.getShaderParameter(s,t.COMPILE_STATUS))throw new Oi("Vertex shader compile error for ".concat(this.type,": ").concat(t.getShaderInfoLog(s)));if(t.shaderSource(o,e),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS))throw new Oi("Fragment shader compile error for ".concat(this.type,": ").concat(t.getShaderInfoLog(o)));if(t.attachShader(a,s),t.attachShader(a,o),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Oi('Shader link error for "'.concat(this.type,'" ').concat(t.getProgramInfoLog(a)));let c=this.getUniformLocations(t,a)||{};return c.uStepW=t.getUniformLocation(a,"uStepW"),c.uStepH=t.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:this.getAttributeLocations(t,a),uniformLocations:c}}getAttributeLocations(t,e){return{aPosition:t.getAttribLocation(e,"aPosition")}}getUniformLocations(t,e){return{}}sendAttributeData(t,e,n){let i=e.aPosition,s=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,s),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,2,t.FLOAT,!1,0,0),t.bufferData(t.ARRAY_BUFFER,n,t.STATIC_DRAW)}_setupFrameBuffer(t){let e=t.context;if(t.passes>1){let n=t.destinationWidth,i=t.destinationHeight;t.sourceWidth===n&&t.sourceHeight===i||(e.deleteTexture(t.targetTexture),t.targetTexture=t.filterBackend.createTexture(e,n,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){let e=this.mainParameter,n=this.constructor.defaults[e];if(e){let i=this[e];return Array.isArray(n)&&Array.isArray(i)?n.every((s,o)=>s===i[o]):n===i}return!1}applyTo(t){N0(t)?(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,n=this.retrieveShader(t);t.pass===0&&t.originalTexture?e.bindTexture(e.TEXTURE_2D,t.originalTexture):e.bindTexture(e.TEXTURE_2D,t.sourceTexture),e.useProgram(n.program),this.sendAttributeData(e,n.attributeLocations,t.aPosition),e.uniform1f(n.uniformLocations.uStepW,1/t.sourceWidth),e.uniform1f(n.uniformLocations.uStepH,1/t.sourceHeight),this.sendUniformData(e,n.uniformLocations),e.viewport(0,0,t.destinationWidth,t.destinationHeight),e.drawArrays(e.TRIANGLE_STRIP,0,4)}bindAdditionalTexture(t,e,n){t.activeTexture(n),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)}getMainParameter(){return this.mainParameter?this[this.mainParameter]:void 0}setMainParameter(t){this.mainParameter&&(this[this.mainParameter]=t)}sendUniformData(t,e){}createHelpLayer(t){if(!t.helpLayer){let e=ln();e.width=t.sourceWidth,e.height=t.sourceHeight,t.helpLayer=e}}toObject(){let t=this.mainParameter;return G({type:this.type},t?{[t]:this[t]}:{})}toJSON(){return this.toObject()}static fromObject(t,e){return dt(this,null,function*(){return new this(Oe(t,mF))})}};W(un,"type","BaseFilter");var gF={multiply:`gl_FragColor.rgb *= uColor.rgb; +`,screen:`gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb); +`,add:`gl_FragColor.rgb += uColor.rgb; +`,difference:`gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb); +`,subtract:`gl_FragColor.rgb -= uColor.rgb; +`,lighten:`gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb); +`,darken:`gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb); +`,exclusion:`gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb); +`,overlay:` + if (uColor.r < 0.5) { + gl_FragColor.r *= 2.0 * uColor.r; + } else { + gl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r); + } + if (uColor.g < 0.5) { + gl_FragColor.g *= 2.0 * uColor.g; + } else { + gl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g); + } + if (uColor.b < 0.5) { + gl_FragColor.b *= 2.0 * uColor.b; + } else { + gl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b); + } + `,tint:` + gl_FragColor.rgb *= (1.0 - uColor.a); + gl_FragColor.rgb += uColor.rgb; + `},Pa=class extends un{getCacheKey(){return"".concat(this.type,"_").concat(this.mode)}getFragmentSource(){return` + precision highp float; + uniform sampler2D uTexture; + uniform vec4 uColor; + varying vec2 vTexCoord; + void main() { + vec4 color = texture2D(uTexture, vTexCoord); + gl_FragColor = color; + if (color.a > 0.0) { + `.concat(gF[this.mode],` + } + } + `)}applyTo2d(t){let{imageData:{data:e}}=t,n=new Zn(this.color).getSource(),i=n[0]*this.alpha,s=n[1]*this.alpha,o=n[2]*this.alpha,a=1-this.alpha;for(let c=0;cnew this(G(G({},s),{},{image:o})))}};W(ka,"type","BlendImage"),W(ka,"defaults",{mode:"multiply",alpha:1,vertexSource:` + attribute vec2 aPosition; + varying vec2 vTexCoord; + varying vec2 vTexCoord2; + uniform mat3 uTransformMatrix; + void main() { + vTexCoord = aPosition; + vTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy; + gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0); + } + `}),It.setClass(ka);var Ra=class extends un{getFragmentSource(){return` + precision highp float; + uniform sampler2D uTexture; + uniform vec2 uDelta; + varying vec2 vTexCoord; + const float nSamples = 15.0; + vec3 v3offset = vec3(12.9898, 78.233, 151.7182); + float random(vec3 scale) { + /* use the fragment position for a different seed per-pixel */ + return fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453); + } + void main() { + vec4 color = vec4(0.0); + float total = 0.0; + float offset = random(v3offset); + for (float t = -nSamples; t <= nSamples; t++) { + float percent = (t + offset - 0.5) / nSamples; + float weight = 1.0 - abs(percent); + color += texture2D(uTexture, vTexCoord + uDelta * percent) * weight; + total += weight; + } + gl_FragColor = color / total; + } + `}applyTo(t){N0(t)?(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){t.imageData=this.simpleBlur(t)}simpleBlur(t){let{ctx:e,imageData:n,filterBackend:{resources:i}}=t,{width:s,height:o}=n;i.blurLayer1||(i.blurLayer1=ln(),i.blurLayer2=ln());let a=i.blurLayer1,c=i.blurLayer2;a.width===s&&a.height===o||(c.width=a.width=s,c.height=a.height=o);let l=a.getContext("2d"),h=c.getContext("2d"),u=15,d=.06*this.blur*.5,f,m,g,x;for(l.putImageData(n,0,0),h.clearRect(0,0,s,o),x=-15;x<=u;x++)f=(Math.random()-.5)/4,m=x/u,g=d*m*s+f,h.globalAlpha=1-Math.abs(m),h.drawImage(a,g,f),l.drawImage(c,0,0),h.globalAlpha=1,h.clearRect(0,0,c.width,c.height);for(x=-15;x<=u;x++)f=(Math.random()-.5)/4,m=x/u,g=d*m*o+f,h.globalAlpha=1-Math.abs(m),h.drawImage(a,f,g),l.drawImage(c,0,0),h.globalAlpha=1,h.clearRect(0,0,c.width,c.height);e.drawImage(a,0,0);let p=e.getImageData(0,0,a.width,a.height);return l.globalAlpha=1,l.clearRect(0,0,a.width,a.height),p}getUniformLocations(t,e){return{delta:t.getUniformLocation(e,"uDelta")}}sendUniformData(t,e){let n=this.chooseRightDelta();t.uniform2fv(e.delta,n)}chooseRightDelta(){let t=1,e=[0,0];this.horizontal?this.aspectRatio>1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio);let n=t*this.blur*.12;return this.horizontal?e[0]=n:e[1]=n,e}};W(Ra,"type","Blur"),W(Ra,"defaults",{blur:0,mainParameter:"blur"}),It.setClass(Ra);var Ia=class extends un{getFragmentSource(){return` + precision highp float; + uniform sampler2D uTexture; + uniform float uBrightness; + varying vec2 vTexCoord; + void main() { + vec4 color = texture2D(uTexture, vTexCoord); + color.rgb += uBrightness; + gl_FragColor = color; + } +`}applyTo2d(t){let{imageData:{data:e}}=t;if(this.brightness===0)return;let n=Math.round(255*this.brightness);for(let i=0;i0&&arguments[0]!==void 0?arguments[0]:{},{subFilters:e=[]}=t;super(Oe(t,DF)),this.subFilters=e}applyTo(t){N0(t)&&(t.passes+=this.subFilters.length-1),this.subFilters.forEach(e=>{e.applyTo(t)})}toObject(){return G(G({},super.toObject()),{},{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(n=>It.getClass(n.type).fromObject(n,e))).then(n=>new this({subFilters:n}))}};W(Pl,"type","Composed"),It.setClass(Pl);var Oa=class extends un{getFragmentSource(){return` + precision highp float; + uniform sampler2D uTexture; + uniform float uContrast; + varying vec2 vTexCoord; + void main() { + vec4 color = texture2D(uTexture, vTexCoord); + float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast)); + color.rgb = contrastF * (color.rgb - 0.5) + 0.5; + gl_FragColor = color; + }`}applyTo2d(t){let{imageData:{data:e}}=t;if(this.contrast===0)return;let n=Math.floor(255*this.contrast),i=259*(n+255)/(255*(259-n));for(let s=0;s=c||p<0||p>=a||(v=4*(C*a+p),_=i[w*s+S],d+=n[v]*_,f+=n[v+1]*_,m+=n[v+2]*_,u||(g+=n[v+3]*_));h[x]=d,h[x+1]=f,h[x+2]=m,h[x+3]=u?n[x+3]:g}t.imageData=l}getUniformLocations(t,e){return{uMatrix:t.getUniformLocation(e,"uMatrix"),uOpaque:t.getUniformLocation(e,"uOpaque"),uHalfSize:t.getUniformLocation(e,"uHalfSize"),uSize:t.getUniformLocation(e,"uSize")}}sendUniformData(t,e){t.uniform1fv(e.uMatrix,this.matrix)}toObject(){return G(G({},super.toObject()),{},{opaque:this.opaque,matrix:[...this.matrix]})}};W(La,"type","Convolute"),W(La,"defaults",{opaque:!1,matrix:[0,0,0,0,1,0,0,0,0]}),It.setClass(La);var TF=["gamma"],Na=class extends un{getFragmentSource(){return` + precision highp float; + uniform sampler2D uTexture; + uniform vec3 uGamma; + varying vec2 vTexCoord; + void main() { + vec4 color = texture2D(uTexture, vTexCoord); + vec3 correction = (1.0 / uGamma); + color.r = pow(color.r, correction.r); + color.g = pow(color.g, correction.g); + color.b = pow(color.b, correction.b); + gl_FragColor = color; + gl_FragColor.rgb *= color.a; + } +`}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{gamma:e=[1,1,1]}=t;super(Oe(t,TF)),this.gamma=e}applyTo2d(t){let{imageData:{data:e}}=t,n=this.gamma,i=1/n[0],s=1/n[1],o=1/n[2];this.rgbValues||(this.rgbValues={r:new Uint8Array(256),g:new Uint8Array(256),b:new Uint8Array(256)});let a=this.rgbValues;for(let c=0;c<256;c++)a.r[c]=255*Math.pow(c/255,i),a.g[c]=255*Math.pow(c/255,s),a.b[c]=255*Math.pow(c/255,o);for(let c=0;cs[0]&&l>s[1]&&h>s[2]&&c` + color += texture2D(uTexture, vTexCoord + `.concat(n,") * uTaps[").concat(i,"] + texture2D(uTexture, vTexCoord - ").concat(n,") * uTaps[").concat(i,`]; + sum += 2.0 * uTaps[`).concat(i,`]; + `)).join(` +`),` + gl_FragColor = color / sum; + } + `)}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){N0(t)?this.applyToForWebgl(t):this.applyTo2d(t)}isNeutralState(){return this.scaleX===1&&this.scaleY===1}lanczosCreate(t){return e=>{if(e>=t||e<=-t)return 0;if(e<11920929e-14&&e>-11920929e-14)return 1;let n=(e*=Math.PI)/t;return Math.sin(e)/e*Math.sin(n)/n}}applyTo2d(t){let e=t.imageData,n=this.scaleX,i=this.scaleY;this.rcpScaleX=1/n,this.rcpScaleY=1/i;let s=e.width,o=e.height,a=Math.round(s*n),c=Math.round(o*i),l;l=this.resizeType==="sliceHack"?this.sliceByTwo(t,s,o,a,c):this.resizeType==="hermite"?this.hermiteFastResize(t,s,o,a,c):this.resizeType==="bilinear"?this.bilinearFiltering(t,s,o,a,c):this.resizeType==="lanczos"?this.lanczosResize(t,s,o,a,c):new ImageData(a,c),t.imageData=l}sliceByTwo(t,e,n,i,s){let o=t.imageData,a=.5,c=!1,l=!1,h=e*a,u=n*a,d=t.filterBackend.resources,f=0,m=0,g=e,x=0;d.sliceByTwo||(d.sliceByTwo=ln());let p=d.sliceByTwo;(p.width<1.5*e||p.height=e)){z=Math.floor(1e3*Math.abs(b-p.x)),x[z]||(x[z]={});for(let tt=C.y-g;tt<=C.y+g;tt++)tt<0||tt>=n||(H=Math.floor(1e3*Math.abs(tt-p.y)),x[z][H]||(x[z][H]=l(Math.sqrt(Math.pow(z*d,2)+Math.pow(H*f,2))/1e3)),S=x[z][H],S>0&&(w=4*(tt*e+b),E+=S,y+=S*o[w],D+=S*o[w+1],F+=S*o[w+2],T+=S*o[w+3]))}w=4*(A*i+_),c[w]=y/E,c[w+1]=D/E,c[w+2]=F/E,c[w+3]=T/E}return++_1&&z<-1||(x=2*z*z*z-3*z*z+1,x>0&&(T=4*(F+w*e),b+=x*h[T+3],C+=x,h[T+3]<255&&(x=x*h[T+3]/250),v+=x*h[T],_+=x*h[T+1],A+=x*h[T+2],p+=x))}}d[g]=v/p,d[g+1]=_/p,d[g+2]=A/p,d[g+3]=b/C}return u}toObject(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}};W(ja,"type","Resize"),W(ja,"defaults",{resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,fragmentSourceTOP:` + precision highp float; + uniform sampler2D uTexture; + uniform vec2 uDelta; + varying vec2 vTexCoord; + `}),It.setClass(ja);var Xa=class extends un{getFragmentSource(){return` + precision highp float; + uniform sampler2D uTexture; + uniform float uSaturation; + varying vec2 vTexCoord; + void main() { + vec4 color = texture2D(uTexture, vTexCoord); + float rgMax = max(color.r, color.g); + float rgbMax = max(rgMax, color.b); + color.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00; + color.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00; + color.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00; + gl_FragColor = color; + } +`}applyTo2d(t){let{imageData:{data:e}}=t;if(this.saturation===0)return;let n=-this.saturation;for(let i=0;i{e.preload(),this.loadObject(e)})}loadObject(t){let e=new Zu;e.setMaterials(t),e.load("assets/untitled.obj",n=>{this.initCardObject(n)})}initCardObject(t){this.mobileTicket=t.children[0],this.mobileTicket.scale.multiplyScalar(5);let e=this.frontDecorationInfo.backgroundColor;this.mobileTicket.material.color.set(parseInt(e?.slice(1),16)),this.mobileTicket.rotateOnAxis(new U(0,0,1),Math.PI/2),this.mobileTicket.rotateX(Math.PI/8),this.mobileTicket.rotateY(Math.PI/8),this._sceneGraphService.scene.add(this.mobileTicket),this.initSide("front"),this.initSide("back"),this.checkFaceVisible()}initSide(t){t==="front"?(this.frontSide=new Ll(new re(350,600),"front",this.frontDecorationInfo.fabric),this.frontSide.rotateZ(-Math.PI/2),this.frontSide.position.add(new U(0,0,2.05)),this.mobileTicket?.add(this.frontSide),this.frontSide.scale.multiplyScalar(.205)):t==="back"&&(this.backSide=new Ll(new re(350,600),"back",this.backDecorationinfo.fabric),this.backSide.rotateZ(-Math.PI/2),this.backSide.rotateY(-Math.PI),this.mobileTicket?.add(this.backSide),this.backSide.scale.multiplyScalar(.205))}checkFaceVisible(){let t=this._sceneGraphService.camera?.getWorldDirection(new U(0,0,0)),e=this.frontSide===null?new U(0,0,1):new U(0,0,1).applyQuaternion(this.frontSide.quaternion);t.dot(e)>=0?(this.frontSide.visible=!1,this.backSide.visible=!0):(this.frontSide.visible=!0,this.backSide.visible=!1)}};var Bs=(()=>{let t=class t{constructor(n,i,s){this._route=n,this._apiExecutorService=i,this._ssalonConfigService=s,this.scene=null,this.camera=null,this.lights={},this.nativeElement=null,this.webGLRenderer=null,this.css3dRenderer=null,this.arcballControls=null,this.mobileTicket=null,this.mobileTicketAutoRotate=!1}initThree(n){let i=this.nativeElement.clientWidth,s=this.nativeElement.clientHeight;this.scene=new Fu,this.scene.background=new ie(16777215),this.camera=new Ln(75,i/s,.1,2e3),this.camera.position.z=600,this.createLight("pointLight1",new U(0,0,300)),this.createLight("pointLight2",new U(0,0,-300)),this.createLight("pointLight3",new U(0,400,300)),this.initCss3dRenderer(i,s),this.initWebGLRenderer(i,s),this.createArcballControls(),this.mobileTicket=new U0(this._apiExecutorService,this),this.mobileTicket.initMobileTicket(n),PF(this)}createLight(n,i){this.lights[n]=new Ou(16777215),this.lights[n].position.copy(i),this.lights[n].intensity=10,this.lights[n].decay=.3,this.lights[n].lookAt(0,0,0),this.scene.add(this.lights[n])}initWebGLRenderer(n,i){this.webGLRenderer=new Tu({antialias:!0}),this.webGLRenderer.setPixelRatio(window.devicePixelRatio),this.webGLRenderer.autoClear=!1,this.webGLRenderer.domElement.style.touchAction="none",this.webGLRenderer.setSize(n,i),this.nativeElement.appendChild(this.webGLRenderer.domElement)}initCss3dRenderer(n,i){this.css3dRenderer=new Xu,this.css3dRenderer.domElement.style.touchAction="none",this.css3dRenderer.domElement.style.position="absolute",this.css3dRenderer.setSize(n,i),this.nativeElement.appendChild(this.css3dRenderer.domElement)}destroy(){this.nativeElement.removeChild(this.webGLRenderer.domElement),this.nativeElement.removeChild(this.css3dRenderer.domElement)}createArcballControls(){this.arcballControls=new Yu(this.camera,this.css3dRenderer.domElement,this.scene),this.arcballControls.setGizmosVisible(!1),this.arcballControls.enableAnimations=!0,this.arcballControls.dampingFactor=2,this.arcballControls.addEventListener("change",()=>{this.css3dRenderer.render(this.scene,this.camera),this.mobileTicket?.checkFaceVisible()}),this.arcballControls.enabled=!0}onRender(){this.webGLRenderer.render(this.scene,this.camera),this.css3dRenderer.render(this.scene,this.camera)}focusFront(){this.arcballControls.reset()}rotateCard(){this.mobileTicket.mobileTicket?.rotateX(.001),this.mobileTicket.mobileTicket?.rotateY(.001),this.mobileTicket.mobileTicket?.rotateZ(.001),this.mobileTicket?.frontSide!==null&&this.mobileTicket?.backSide!==null&&this.mobileTicket?.checkFaceVisible()}};t.\u0275fac=function(i){return new(i||t)(Le(Rn),Le(pe),Le(Jr))},t.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})(),PF=function(r){let t=new Nu,e=function(){r.mobileTicketAutoRotate&&r.rotateCard(),r.onRender(),requestAnimationFrame(e)};e()};var kF=["rendererContainer"],DE=(()=>{let t=class t{constructor(n){this._sceneGraphService=n,this.rendererContainer=null,this.moimId="",this.majorFace="front",this.isEditing=!1}ngOnInit(){}ngAfterViewInit(){this._sceneGraphService.nativeElement=this.rendererContainer.nativeElement,this._sceneGraphService.initThree(this.moimId)}ngOnDestroy(){this._sceneGraphService.destroy()}};t.\u0275fac=function(i){return new(i||t)(ft(Bs))},t.\u0275cmp=vt({type:t,selectors:[["app-mobile-ticket-viewer"]],viewQuery:function(i,s){if(i&1&&te(kF,5),i&2){let o;Kt(o=Jt())&&(s.rendererContainer=o.first)}},inputs:{moimId:"moimId"},standalone:!0,features:[Et],decls:2,vars:0,consts:[["rendererContainer",""],["id","viewport"]],template:function(i,s){i&1&&Ct(0,"div",1,0)},styles:["#viewport[_ngcontent-%COMP%]{width:100%;height:100%}"]});let r=t;return r})();var RF=["toggleButton"];function IF(r,t){if(r&1){let e=qt();I(0,"div",8,1),xt("click",function(){Mt(e);let i=at().$implicit,s=at(2);return Dt(s.onClickToggleButton(i.value))}),Ct(2,"img",9),N()}if(r&2){let e=at().$implicit,n=at(2);Lt("width",n.outerSize)("height",n.outerSize),P(2),V("src",n.getImgSrc(e.imgSrc,e.value),Cn)("width",n.innerSize)("height",n.innerSize)}}function OF(r,t){if(r&1&&(I(0,"h4"),Xt(1),N()),r&2){let e=at().$implicit,n=at(2);Lt("width",n.innerSize+10,"px"),P(),Ge(e.label)}}function LF(r,t){if(r&1&&(sn(0,5),I(1,"div"),At(2,IF,3,7,"div",6)(3,OF,2,3,"h4",7),N(),on()),r&2){let e=t.$implicit,n=at(2);P(2),V("ngIf",e.value!==n.noneStatusValue),P(),V("ngIf",!1)}}function NF(r,t){if(r&1&&(sn(0),At(1,LF,4,2,"ng-container",4),on()),r&2){let e=t.$implicit;P(),V("ngForOf",e)}}var BE=(()=>{let t=class t{constructor(){this.buttons=null,this.elements=[],this.selectedValues=[],this.noneStatusValue=-1,this.outerSize="40px",this.innerSize=20,this.enableMultipleSelection=!1,this.columnNum=10,this.isLabelVisible=!0,this.onClickToggleButtonEvent=new jt,this.modifiedElements=[]}ngOnInit(){let n=[];for(let i=0;ie.value===t).color}getSsalonColorObjectByValue(t){return this.SsalonColors.find(e=>e.value===t)}getSsalonColorObjectByColor(t){return this.SsalonColors.find(e=>e.color===t)}},Bn=function(r){return r[r.BLACK=0]="BLACK",r[r.WHITE=1]="WHITE",r[r.RED=2]="RED",r[r.GREEN=3]="GREEN",r[r.BLUE=4]="BLUE",r[r.YELLOW=5]="YELLOW",r[r.CYAN=6]="CYAN",r[r.MAGENTA=7]="MAGENTA",r[r.GRAY=8]="GRAY",r[r.LIGHT_GRAY=9]="LIGHT_GRAY",r[r.DARK_GRAY=10]="DARK_GRAY",r[r.ORANGE=11]="ORANGE",r[r.PINK=12]="PINK",r[r.PURPLE=13]="PURPLE",r[r.BROWN=14]="BROWN",r[r.SSALON=15]="SSALON",r}(Bn||{}),TE=(()=>{let t=class t{constructor(){this.buttons=null,this.selectedValue=0,this.noneStatusValue=0,this.outerSize="30px",this.innerSize="20px",this.columnNum=10,this.onClickToggleButtonEvent=new jt,this.ssalonColor=new Nl,this.modifiedSsalonColors=[]}ngOnInit(){for(var n=[],i=0;i{let t=class t{constructor(){this.buttons=null,this.elements=[],this.selectedValue=0,this.onClickToggleButtonEvent=new jt,this.buttonWidth="30%"}ngOnInit(){this.buttonWidth=`${100/this.elements.length}%`}ngAfterViewInit(){this.buttons.toArray()[this.selectedValue].nativeElement.classList.add("selected")}onClickToggleButton(n){if(this.selectedValue===n)return;let i=this.buttons.toArray();for(let s in i)Number(s)!==n?i[Number(s)].nativeElement.classList.remove("selected"):i[n].nativeElement.classList.add("selected");this.selectedValue=n,this.onClickToggleButtonEvent.emit(this.elements[n].imgSrc)}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-simple-toggle-button-group"]],viewQuery:function(i,s){if(i&1&&te(HF,5),i&2){let o;Kt(o=Jt())&&(s.buttons=o)}},inputs:{elements:"elements",selectedValue:"selectedValue"},outputs:{onClickToggleButtonEvent:"onClickToggleButtonEvent"},standalone:!0,features:[Et],decls:3,vars:1,consts:[["toggleButtonContainer",""],["toggleButton",""],[1,"container"],["class","toggle-button",3,"width","font-family","click",4,"ngFor","ngForOf"],[1,"toggle-button",3,"click"]],template:function(i,s){i&1&&(I(0,"div",2,0),At(2,GF,3,5,"div",3),N()),i&2&&(P(2),V("ngForOf",s.elements))},dependencies:[en],styles:[".container[_ngcontent-%COMP%]{width:auto;display:flex;flex-direction:row;overflow-x:auto}.toggle-button[_ngcontent-%COMP%]{height:100%;min-width:50px;display:flex;justify-content:center;align-items:center;border-radius:5px;margin:5px;color:#efefef;background-color:transparent}.toggle-button[_ngcontent-%COMP%]:hover{cursor:pointer}.selected[_ngcontent-%COMP%]{background-color:#0090f2}"]});let r=t;return r})();var WF=["editFeatureButtons"],jF=["backgroundPath"],XF=["textEditInput"],YF=["drawCanvas"],qF=["selectedPhotoContainer"],$F=r=>[r];function ZF(r,t){if(r&1){let e=qt();I(0,"div"),Jn(),I(1,"svg",19),Ct(2,"path",20,2),N(),Ci(),I(4,"app-color-board",21),xt("onClickToggleButtonEvent",function(i){Mt(e);let s=at();return Dt(s.changeBackgroundColor(i))}),N()()}if(r&2){let e=at();P(4),V("outerSize","30px")("innerSize","24px")("selectedValue",e.backgroundColor.value)}}function KF(r,t){if(r&1){let e=qt();I(0,"div")(1,"div",22,3)(3,"textarea",23,4),xt("input",function(i){Mt(e);let s=at();return Dt(s.onChangeSsalonTextAttribute("text",i))}),N()(),I(5,"div",24)(6,"app-circle-toggle-button-group",25),xt("onClickToggleButtonEvent",function(i){Mt(e);let s=at();return Dt(s.onChangeSsalonTextAttribute("textAlign",i))}),N()(),I(7,"app-simple-toggle-button-group",26),xt("onClickToggleButtonEvent",function(i){Mt(e);let s=at();return Dt(s.onChangeSsalonTextAttribute("fontFamily",i))}),N(),I(8,"app-color-board",21),xt("onClickToggleButtonEvent",function(i){Mt(e);let s=at();return Dt(s.onChangeSsalonTextAttribute("color",i))}),N()()}if(r&2){let e=at();P(3),Lt("text-align",e.ssalonTextAttribute.textAlign)("color",e.ssalonTextAttribute.color)("font-family",e.ssalonTextAttribute.fontFamily),P(2),Lt("justify-content","center"),P(),V("elements",e.textAlignButtons)("outerSize","30px")("selectedValues",h1(15,$F,e.getSsalonTextEnumByString(e.ssalonTextAttribute.textAlign))),P(),V("elements",e.fonts),P(),V("outerSize","30px")("innerSize","24px")("selectedValue",e.ssalonColor.getSsalonColorObjectByColor(e.ssalonTextAttribute.color).value)}}function JF(r,t){if(r&1&&(I(0,"div",27)(1,"div",28),Xt(2),N(),Ct(3,"img",29,5),N()),r&2){let e=at();P(2),Ge(e.uploadPhotoNum)}}function QF(r,t){r&1&&Ct(0,"div",36)}function t4(r,t){if(r&1){let e=qt();I(0,"div")(1,"div",33),xt("click",function(){let i=Mt(e).$implicit,s=at(3);return Dt(s.selectSticker(i.value))}),Ct(2,"img",34),At(3,QF,1,0,"div",35),N()()}if(r&2){let e=t.$implicit;P(),Lt("width","100px")("height","150px"),P(),V("src",e.imgSrc,Cn),P(),V("ngIf",e.selected)}}function e4(r,t){if(r&1&&(I(0,"div"),At(1,t4,4,6,"div",32),N()),r&2){let e=t.$implicit;Lt("display","flex")("justify-content","space-evenly")("margin-bottom","20px"),P(),V("ngForOf",e)}}function n4(r,t){if(r&1&&(I(0,"div",30,6),At(2,e4,2,7,"div",31),N()),r&2){let e=at();P(2),V("ngForOf",e.getStickerArray())}}function i4(r,t){if(r&1){let e=qt();I(0,"div"),Jn(),I(1,"svg",19),Ct(2,"path",20,2),I(4,"foreignObject",37),Ci(),Ct(5,"canvas",38,7),N()(),I(7,"app-color-board",39),xt("onClickToggleButtonEvent",function(i){Mt(e);let s=at();return Dt(s.onChangeSsalonTextAttribute("color",i))}),N()()}r&2&&(P(7),V("outerSize","30px")("innerSize","24px"))}var De=function(r){return r[r.BACKGROUND_COLOR_CHANGE=0]="BACKGROUND_COLOR_CHANGE",r[r.PHOTO=1]="PHOTO",r[r.STICKER=2]="STICKER",r[r.TEXT=3]="TEXT",r[r.DRAW=4]="DRAW",r[r.NONE=5]="NONE",r}(De||{}),Ji=function(r){return r[r.LEFT=0]="LEFT",r[r.CENTER=1]="CENTER",r[r.RIGHT=2]="RIGHT",r}(Ji||{}),PE=(()=>{let t=class t{constructor(n,i,s,o){this._apiExecutorService=n,this._router=i,this._sceneGraphService=s,this._buttonElementsService=o,this.editFeatureButtons=null,this.backgroundPath=null,this.textEditInput=null,this.drawCanvas=null,this.selectedPhotoContainer=null,this.moimId="",this.face="front",this.onChangeViewer=new jt,this.onObjectEditEnded=new jt,this.onBackgroundColorEditEnded=new jt,this.onClickPreview=new jt,this.editMode=De.NONE,this.ssalonColor=new Nl,this.mobileTicketEditMode=De,this.goBackButtonElement={selected:!1,imgSrc:"assets/icons/go-back.png",label:"\uB4A4\uB85C\uAC00\uAE30",value:0},this.previewButtonElement={selected:!1,imgSrc:"assets/icons/view.png",label:"\uC800\uC7A5 \uBC0F \uBBF8\uB9AC\uBCF4\uAE30",value:0},this.completeButtonElement={selected:!1,imgSrc:"",label:"\uC644\uB8CC",value:0},this.editFeatures=[{imgSrc:"assets/icons/color-board.png",label:"\uBBF8\uB9AC\uBCF4\uAE30 \uBDF0",value:De.BACKGROUND_COLOR_CHANGE},{imgSrc:"assets/icons/photo.png",label:"\uC0AC\uC9C4",value:De.PHOTO},{imgSrc:"assets/icons/sticker.png",label:"\uC2A4\uD2F0\uCEE4",value:De.STICKER},{imgSrc:"assets/icons/text.png",label:"\uD14D\uC2A4\uD2B8",value:De.TEXT},{imgSrc:"assets/icons/draw.png",label:"\uADF8\uB9AC\uAE30",value:De.DRAW},{imgSrc:"assets/icons/view.png",label:"\uADF8\uB9AC\uAE30",value:De.NONE}],this._backgroundColorViewLoaded=!1,this.uploadPhotoNum=0,this.stickers=[],this.editingSticker=null,this.editingStickerSrc="",this.textFocused=!1,this.textAlign="left",this.textAlignButtons=[{imgSrc:"assets/text-aligns/textalign-left.png",label:"\uC88C",value:Ji.LEFT},{imgSrc:"assets/text-aligns/textalign-center.png",label:"\uC911",value:Ji.CENTER},{imgSrc:"assets/text-aligns/textalign-right.png",label:"\uC6B0",value:Ji.RIGHT}],this.fonts=[{imgSrc:"Ariel",label:"Aa",value:0},{imgSrc:"Josefin Sans",label:"Aa",value:1},{imgSrc:"Jersey 15",label:"Aa",value:2},{imgSrc:"Roboto",label:"Aa",value:3},{imgSrc:"Jacquarda Bastarda 9 Charted",label:"Aa",value:4}],this.fontFamily="Josefin Sans",this.isTextAddMode=!0,this.textColor=this.ssalonColor.WHITE,this.editingText=null,this.colorBoard=[],this.drawingFabricCanvas=null,this._isDrawing=!1,this._drawingPoints=[],this._isDrawingFabricCanvasLoaded=!1,this.drawingFabricPaths=[],this.backgroundColor=this.ssalonColor.LIGHT_GRAY,this.ssalonTextAttribute={text:"",fontFamily:"Josefin Sans",color:"#FFFFFF",textAlign:"left"},this.ssalonPhotoAttribute={src:[]},this.ssalonStickerAttribute={src:[]},this.ssalonPathAttribute={color:"#FFFFFF",strokeWidth:1},this.fabricObjects=[],this.lastUsedFeature=De.NONE}ngAfterViewInit(){this.loadDecorationInfo(),this.getStickers()}ngAfterViewChecked(){this.backgroundPath&&!this._backgroundColorViewLoaded&&(this.backgroundPath.nativeElement.setAttribute("fill",this.backgroundColor.color),this._backgroundColorViewLoaded=!0),this.textEditInput&&!this.textFocused&&(this.fabricObjects.length===1&&(this.textEditInput.nativeElement.value=this.ssalonTextAttribute.text),this.textEditInput.nativeElement.focus(),this.textFocused=!0),this.drawCanvas&&!this._isDrawingFabricCanvasLoaded&&(this.initDrawingCanvas(),this._isDrawingFabricCanvasLoaded=!0)}loadDecorationInfo(){return dt(this,null,function*(){let n=yield this._apiExecutorService.getTicket(this.moimId);this.backgroundColor=this.ssalonColor.getSsalonColorObjectByColor(n.backgroundColor),this.onBackgroundColorEditEnded.emit(this.backgroundColor.color)})}onClickChangeEditMode(n){return dt(this,null,function*(){switch(n){case De.BACKGROUND_COLOR_CHANGE:break;case De.PHOTO:let i=document.createElement("input");i.type="file",i.accept="image/*",i.multiple=!0;let s=[];i.onchange=(function(){return dt(this,null,function*(){if(s=[],i.files&&i.files.length>0){let o=Array.from(i.files),a=0;o.forEach((c,l)=>{let h=new FileReader;h.onload=(function(u){return dt(this,null,function*(){if(s.push(u.target.result),l===0){let d=document.getElementById("selected-photo-container");d||(d=document.createElement("img"),d.id="selected-photo-container",document.body.appendChild(d)),d.src=u.target.result,d.width=80}a++,a===o.length&&(this.uploadPhotoNum=o.length,yield this.getImageUrl(s))})}).bind(this),h.readAsDataURL(c)})}})}).bind(this),i.click();break;case De.STICKER:break;case De.TEXT:this.textFocused=!1;break;case De.DRAW:break;case De.NONE:break}this.editMode=n,this.onChangeViewer.emit(n)})}onClickPreviewButton(){this.onClickPreview.emit()}onClickEndDetailedEditViewer(){this.lastUsedFeature=this.editMode,this.editMode=De.NONE,this.editFeatureButtons.setUnselectedStatus(),this.onChangeViewer.emit(De.NONE),this.onEndEditObject()}changeBackgroundColor(n){this.backgroundPath?.nativeElement.setAttribute("fill",this.ssalonColor.getSsalonColorObjectByValue(n).color),this.backgroundColor=this.ssalonColor.getSsalonColorObjectByValue(n)}getStickers(){let n=50;for(let i=0;i{i.append("files",s(c),`${l}.png`)});try{let c=this.face==="front"?yield this._apiExecutorService.uploadTicketImages(this.moimId,i):yield this._apiExecutorService.uploadDiaryImages(this.moimId,i),l=Object.keys(c.mapURI);for(var o=0;o{h="https://dokcohci6rkid.cloudfront.net"+h.substring(58)})}catch(c){console.log(c)}})}onEndEditObject(){return dt(this,null,function*(){if(this.lastUsedFeature===De.BACKGROUND_COLOR_CHANGE)this.onBackgroundColorEditEnded.emit(this.backgroundColor.color);else{switch(this.lastUsedFeature){case De.PHOTO:this.loadImageRecursive(0);return;case De.STICKER:this.loadImageRecursive(0);return;case De.TEXT:this.fabricObjects.length===0?this.fabricObjects.push(new Mn(this.ssalonTextAttribute.text,{top:100,left:100,fill:this.ssalonTextAttribute.color,textAlign:this.ssalonTextAttribute.textAlign,fontFamily:this.ssalonTextAttribute.fontFamily})):(this.fabricObjects[0].set("text",this.ssalonTextAttribute.text),this.fabricObjects[0].set("fill",this.ssalonTextAttribute.color),this.fabricObjects[0].set("textAlign",this.ssalonTextAttribute.textAlign),this.fabricObjects[0].set("fontFamily",this.ssalonTextAttribute.fontFamily),this.lastUsedFeature=De.NONE);break;case De.DRAW:break;case De.NONE:break}this.onObjectEditEnded.emit(this.lastUsedFeature===De.NONE?null:this.fabricObjects),this.lastUsedFeature=De.NONE}this.fabricObjects=[],this.drawingFabricCanvas?.destroy()})}onClickCompletedEditing(){}initDrawingCanvas(){this.drawingFabricCanvas=new Cr(this.drawCanvas.nativeElement),this.drawingFabricCanvas.renderAll(),this.drawingFabricCanvas.on("mouse:down",n=>{this._isDrawing=!0,this.addPoint(n.e),this.drawPath()}),this.drawingFabricCanvas.on("mouse:move",n=>{this._isDrawing&&(this.addPoint(n.e),this.drawPath())}),this.drawingFabricCanvas.on("mouse:up",()=>{this._isDrawing=!1,this._drawingPoints.length=0})}addPoint(n){let i=this.drawingFabricCanvas.getPointer(n);this._drawingPoints.push(new re(i.x,i.y))}drawPath(){let n=this._drawingPoints.map(s=>`${s.x} ${s.y}`).join(" "),i=new Or(`M ${n}`,{fill:"transparent",stroke:"white",strokeWidth:2});this.fabricObjects.length=0,this.fabricObjects.push(i),this.drawingFabricCanvas.clear(),this.drawingFabricCanvas.renderAll(),this.drawingFabricCanvas.add(i)}endTicketWebView(){this._router.navigate(["/web/main"])}};t.\u0275fac=function(i){return new(i||t)(ft(pe),ft(We),ft(Bs),ft(Ue))},t.\u0275cmp=vt({type:t,selectors:[["app-mobile-ticket-editor"]],viewQuery:function(i,s){if(i&1&&(te(WF,5),te(jF,5),te(XF,5),te(YF,5),te(qF,5)),i&2){let o;Kt(o=Jt())&&(s.editFeatureButtons=o.first),Kt(o=Jt())&&(s.backgroundPath=o.first),Kt(o=Jt())&&(s.textEditInput=o.first),Kt(o=Jt())&&(s.drawCanvas=o.first),Kt(o=Jt())&&(s.selectedPhotoContainer=o.first)}},inputs:{moimId:"moimId",face:"face"},outputs:{onChangeViewer:"onChangeViewer",onObjectEditEnded:"onObjectEditEnded",onBackgroundColorEditEnded:"onBackgroundColorEditEnded",onClickPreview:"onClickPreview"},standalone:!0,features:[Et],decls:19,vars:21,consts:[["editFeatureButtons",""],["detailedEditor",""],["backgroundPath",""],["textEditFeatureContainer",""],["textEditInput",""],["selectedPhotoContainer",""],["stickerEditFeatureContainer",""],["drawCanvas",""],[1,"container"],[1,"horizontal-container"],["id","edit-feature-buttons"],[3,"onClickToggleButtonEvent","elements","innerSize","outerSize","noneStatusValue"],[1,"complete-button",3,"onClickEvent","buttonElement","heightSize","type"],["id","detail-editor",3,"hidden"],[1,"back-button",3,"onClickEvent","buttonElement","heightSize"],[1,"complete-button",3,"onClickEvent","buttonElement","heightSize","type","highContrast"],[4,"ngIf"],["id","photo-edit-feature-container",4,"ngIf"],["id","sticker-edit-feature-container",4,"ngIf"],["width","350","height","600","viewBox","-87.5 -150 525 900","fill","none","xmlns","http://www.w3.org/2000/svg",1,"ticket-background"],["fill-rule","evenodd","clip-rule","evenodd","d","M9.53674e-06 40C9.53674e-06 17.9086 17.9086 0 40 0H310C332.091 0 350 17.9086 350 40L350 451.714C333.431 451.714 320 463.227 320 477.429C320 491.63 333.431 503.143 350 503.143L350 560C350 582.091 332.091 600 310 600H40C17.9086 600 9.53674e-06 582.091 9.53674e-06 560L0 503.143C16.5685 503.143 30 491.63 30 477.429C30 463.227 16.5685 451.714 0 451.714L9.53674e-06 40Z","fill","#D9D9D9"],[1,"color-board",3,"onClickToggleButtonEvent","outerSize","innerSize","selectedValue"],["id","text-edit-feature-container"],["id","text-edit-input","autocomplete","off","type","text",3,"input"],["id","text-align",1,"horizontal-container"],[3,"onClickToggleButtonEvent","elements","outerSize","selectedValues"],[1,"fonts",3,"onClickToggleButtonEvent","elements"],["id","photo-edit-feature-container"],["id","upload-photo-num"],["id","selected-photo-container"],["id","sticker-edit-feature-container"],[3,"display","justify-content","margin-bottom",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"sticker",3,"click"],["width","80px",3,"src"],["class","selected-status",4,"ngIf"],[1,"selected-status"],["width","350","height","600"],["id","draw-canvas","width","350","height","600"],[1,"color-board",3,"onClickToggleButtonEvent","outerSize","innerSize"]],template:function(i,s){if(i&1){let o=qt();I(0,"div",8)(1,"div",9)(2,"div",10)(3,"app-circle-toggle-button-group",11,0),xt("onClickToggleButtonEvent",function(c){return Mt(o),Dt(s.onClickChangeEditMode(c))}),N()(),I(5,"div")(6,"app-simple-button",12),xt("onClickEvent",function(){return Mt(o),Dt(s.onClickPreviewButton())}),N()()(),I(7,"div",13,1)(9,"div",9)(10,"div")(11,"app-simple-button",14),xt("onClickEvent",function(){return Mt(o),Dt(s.onClickEndDetailedEditViewer())}),N()(),I(12,"div")(13,"app-simple-button",15),xt("onClickEvent",function(){return Mt(o),Dt(s.onClickEndDetailedEditViewer())}),N()()(),At(14,ZF,5,3,"div",16)(15,KF,9,17,"div",16)(16,JF,5,1,"div",17)(17,n4,3,1,"div",18)(18,i4,8,2,"div",16),N()()}i&2&&(P(),Lt("justify-content","right"),P(2),V("elements",s.editFeatures)("innerSize",20)("outerSize","36px")("noneStatusValue",s.mobileTicketEditMode.NONE),P(3),V("buttonElement",s.previewButtonElement)("heightSize",15)("type","text"),P(),V("hidden",s.editMode===s.mobileTicketEditMode.NONE),P(4),V("buttonElement",s.goBackButtonElement)("heightSize",40),P(2),V("buttonElement",s.completeButtonElement)("heightSize",15)("type","text")("highContrast",!0),P(),V("ngIf",s.editMode===s.mobileTicketEditMode.BACKGROUND_COLOR_CHANGE),P(),V("ngIf",s.editMode===s.mobileTicketEditMode.TEXT),P(),V("ngIf",s.editMode===s.mobileTicketEditMode.PHOTO),P(),V("ngIf",s.editMode===s.mobileTicketEditMode.STICKER),P(),V("ngIf",s.editMode===s.mobileTicketEditMode.DRAW))},dependencies:[Ah,FE,BE,TE,en,he],styles:[".editor-button[_ngcontent-%COMP%]{width:50px;height:50px;margin:10px}.feature-button-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;width:100%}.container[_ngcontent-%COMP%]{width:100%;height:100%;position:relative}.horizontal-container[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:row;justify-content:space-between;align-items:center}#detail-editor[_ngcontent-%COMP%]{position:fixed;top:0;left:0;background-color:#000000e6;width:100%;height:100%}#text-edit-input[_ngcontent-%COMP%]{font-size:30px;font-family:Courier New,Courier,monospace;-webkit-text-size-adjust:100%;background-color:transparent;caret-color:#006bff;color:#efefef;width:70%;height:400px;border:none;outline:none;text-align:center}#text-edit-feature-container[_ngcontent-%COMP%]{position:absolute;width:100%;top:30%;left:50%;transform:translate(-50%,-30%);display:flex;justify-content:center}.fonts[_ngcontent-%COMP%]{position:absolute;bottom:120px;left:0;width:100%;height:20px}.color-board[_ngcontent-%COMP%]{position:absolute;width:100%;bottom:20px}#text-align[_ngcontent-%COMP%]{position:absolute;bottom:180px;left:0;width:100%}#preview[_ngcontent-%COMP%]{position:absolute;top:0;right:0}.sticker[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;position:relative}.sticker[_ngcontent-%COMP%]:hover{cursor:pointer}.selected[_ngcontent-%COMP%]{border:2px solid #006BFF}.ticket-background[_ngcontent-%COMP%]{position:absolute;top:0;left:50%;transform:translate(-50%)}#sticker-edit-feature-container[_ngcontent-%COMP%]{overflow-y:auto;height:100%}#selected-photo-container[_ngcontent-%COMP%]{position:absolute;width:200px;top:40%;left:50%;transform:translate(-50%,-30%);display:flex;justify-content:center}#upload-photo-num[_ngcontent-%COMP%]{position:absolute;height:20px;width:20px;top:calc(40% - 100px);left:calc(50% - 100px);display:flex;justify-content:center;background-color:#fff;color:#000;border-radius:50%}.selected-status[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:50%;position:absolute;top:0;left:0;background-color:green}#edit-feature-buttons[_ngcontent-%COMP%]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}"]});let r=t;return r})();var r4=Math.PI/180,dL=180/Math.PI;function kE(r){return r*r4}var s4=["backgroundPath"],o4=["editCanvas"],RE=(()=>{let t=class t{constructor(n){this._apiExecutorService=n,this.backgroundPath=null,this.editCanvas=null,this.moimId=void 0,this.createTemplate=void 0,this.face=void 0,this.onClickText=new jt,this.canvas=null,this.isCursorDown=!1}ngOnInit(){}ngAfterViewInit(){this.initFabric()}initFabric(){return dt(this,null,function*(){this.canvas=new Cr(this.editCanvas?.nativeElement),this.canvas.selection=!1,this.canvas.on("mouse:down",n=>{n.target!==null&&n.target instanceof Mn&&(this.isCursorDown=!0)}),this.canvas.on("mouse:up",n=>{n.target!==null&&n.target instanceof Mn&&(this.isCursorDown&&this.onClickText?.emit(n.target),this.isCursorDown=!1)}),this.canvas.on("object:moving",n=>{this.isCursorDown=!1}),this.canvas.on("object:scaling",n=>{this.isCursorDown=!1}),this.canvas.on("object:rotating",n=>{this.isCursorDown=!1}),yield this.loadDecorationInfo()})}addRemoveIconToControl(){var n="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Ebene_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='595.275px' height='595.275px' viewBox='200 215 230 470' xml:space='preserve'%3E%3Ccircle style='fill:%23F44336;' cx='299.76' cy='439.067' r='218.516'/%3E%3Cg%3E%3Crect x='267.162' y='307.978' transform='matrix(0.7071 -0.7071 0.7071 0.7071 -222.6202 340.6915)' style='fill:white;' width='65.545' height='262.18'/%3E%3Crect x='266.988' y='308.153' transform='matrix(0.7071 0.7071 -0.7071 0.7071 398.3889 -83.3116)' style='fill:white;' width='65.544' height='262.179'/%3E%3C/g%3E%3C/svg%3E",i=document.createElement("img");i.src=n,console.log(hn.prototype),hn.prototype.controls.deleteControl=new Nn({x:.5,y:-.5,offsetY:16,cursorStyle:"pointer",mouseUpHandler:s,render:o});function s(a,c){var l=c.target,h=l.canvas;h.remove(l),h.requestRenderAll()}function o(a,c,l,h,u){var d=20;a.save(),a.translate(c,l),a.rotate(kE(u.angle)),a.drawImage(i,-d/2,-d/2,d,d),a.restore()}}loadDecorationInfo(){return dt(this,null,function*(){let n=null;this.createTemplate!==void 0&&(this.face==="front"?(yield this._apiExecutorService.createTicket(this.moimId,this.createTemplate),n=yield this._apiExecutorService.getTicket(this.moimId)):this.face==="back"&&(yield this._apiExecutorService.createDiary(this.moimId,this.createTemplate),n=yield this._apiExecutorService.getDiary(this.moimId))),console.log(n),yield this.canvas?.loadFromJSON(n.fabric),this.canvas?.renderAll()})}updateCanvas(n){if(console.log(this.canvas?.toJSON()),n!==null)for(let i=0;i{let t=class t{constructor(){this.buttons=null,this.elements=[],this.outerSize=40,this.columnNum=10,this.isLabelVisible=!0,this.onClickToggleButtonEvent=new jt,this.modifiedElements=[]}ngOnInit(){let n=[];for(let i=0;is.value===n).status=i}getBorderColor(n){return n?"#4DAF50":"#F44336"}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-circle-toggle-status-group"]],viewQuery:function(i,s){if(i&1&&te(a4,5),i&2){let o;Kt(o=Jt())&&(s.buttons=o)}},inputs:{elements:"elements",outerSize:"outerSize",columnNum:"columnNum",isLabelVisible:"isLabelVisible"},outputs:{onClickToggleButtonEvent:"onClickToggleButtonEvent"},standalone:!0,features:[Et],decls:3,vars:1,consts:[["toggleButtonContainer",""],["circleStatus",""],["id","container"],[4,"ngFor","ngForOf"],["class","color-row",4,"ngFor","ngForOf"],[1,"color-row"],[1,"status-container"],[1,"img-container"],[1,"circle-status",3,"src","width","height"],["class","nickname-container",3,"width",4,"ngIf"],[1,"nickname-container"]],template:function(i,s){i&1&&(I(0,"div",2,0),At(2,h4,2,1,"ng-container",3),N()),i&2&&(P(2),V("ngForOf",s.modifiedElements))},dependencies:[en,he],styles:["#container[_ngcontent-%COMP%]{display:flex}#container[_ngcontent-%COMP%]::-webkil-scrollbar{display:none}#feature-buttons[_ngcontent-%COMP%]{position:absolute;display:flex;right:0}.status-container[_ngcontent-%COMP%]{margin:5px;display:flex;flex-direction:column;align-items:center}.circle-status[_ngcontent-%COMP%]{border-radius:50%}.img-container[_ngcontent-%COMP%]{border-radius:50%;background-color:#efefef;border-width:2px;display:flex;justify-content:center;align-items:center;margin:8px;flex:0 0 auto}.nickname-container[_ngcontent-%COMP%]{text-align:center;text-overflow:ellipsis;font-weight:500}.toggle-button[_ngcontent-%COMP%]:hover{cursor:pointer}.selected[_ngcontent-%COMP%]{background-color:#000!important}.color-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:10px}"]});let r=t;return r})();var nc=(()=>{let t=class t{constructor(n){this._location=n,this.title="",this.shareButton=!1,this.defaultBack=!0,this.backButtonClickEvent=new jt,this.shareButtonClickEvent=new jt,this.comeFrom=""}onClickBackButton(){this.defaultBack===!0?this._location.back():this.backButtonClickEvent.emit()}onClickShareButton(){this.shareButtonClickEvent.emit()}};t.\u0275fac=function(i){return new(i||t)(ft(Ei))},t.\u0275cmp=vt({type:t,selectors:[["app-top-navigator"]],inputs:{title:"title",shareButton:"shareButton",defaultBack:"defaultBack"},outputs:{backButtonClickEvent:"backButtonClickEvent",shareButtonClickEvent:"shareButtonClickEvent"},standalone:!0,features:[Et],decls:5,vars:3,consts:[[1,"container"],["id","back-container","src","assets/icons/go-back.png","height","40",3,"click"],["id","title-container"],["id","share-container","src","assets/icons/share.svg","height","24",3,"click"]],template:function(i,s){i&1&&(I(0,"div",0)(1,"img",1),xt("click",function(){return s.onClickBackButton()}),N(),I(2,"div",2),Xt(3),N(),I(4,"img",3),xt("click",function(){return s.onClickShareButton()}),N()()),i&2&&(P(3),Ge(s.title),P(),Lt("visibility",s.shareButton?"visible":"hidden"))},styles:['.container[_ngcontent-%COMP%]{width:100%;height:60px;display:flex;flex-direction:row;justify-content:space-between;align-items:center;background-color:#fff}#back-container[_ngcontent-%COMP%]{margin-left:10px;cursor:pointer}#title-container[_ngcontent-%COMP%]{font-size:18px;font-weight:600;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif}#share-container[_ngcontent-%COMP%]{margin-right:10px}']});let r=t;return r})();var u4=["mobileTicketEditViewer"],d4=["mobileTicketEditor"],f4=["barcodeContainer"],x4=["qrVideo"],p4=["qrCanvas"],m4=["joiningUsersComponent"];function g4(r,t){if(r&1){let e=qt();I(0,"div",12)(1,"app-simple-button",13),xt("onClickEvent",function(){Mt(e);let i=at();return Dt(i.onClickBackButton())}),N(),I(2,"app-simple-button",14),xt("onClickEvent",function(){Mt(e);let i=at();return Dt(i.onClickQuitButton())}),N()()}if(r&2){let e=at();P(),V("buttonElement",e.topNavigatorButton)("heightSize",40),P(),V("buttonElement",e.quitFeatureButton)("heightSize",15)("type","text")}}function C4(r,t){if(r&1&&(I(0,"div",15,3)(2,"div"),Ct(3,"app-mobile-ticket-viewer",16),N()()),r&2){let e=at();P(2),Lt("height","100%"),P(),V("moimId",e.moimId)}}function v4(r,t){if(r&1&&(I(0,"div",15,4)(2,"div"),Ct(3,"app-mobile-ticket-viewer",16),N(),I(4,"div"),Ct(5,"app-simple-button",17),N()()),r&2){let e=at();P(2),Lt("height","100%"),P(),V("moimId",e.moimId),P(2),V("buttonElement",e.joinButtonElement)}}var Qi=function(r){return r[r.APPVIEW=0]="APPVIEW",r[r.APPEDITVIEW=1]="APPEDITVIEW",r[r.WEBVIEW=2]="WEBVIEW",r}(Qi||{}),ic=(()=>{let t=class t{constructor(n,i,s,o,a,c){this._apiExecutorService=n,this._ssalonConfigService=i,this._sceneGraphService=s,this._route=o,this._router=a,this._location=c,this.mobileTicketEditViewer=null,this.mobileTicketEditor=null,this.barcodeContainer=null,this.qrVideo=null,this.qrCanvas=null,this.joiningUsersComponent=null,this.topNavigatorButton={selected:!1,label:"\uC800\uC7A5 \uBC0F \uBBF8\uB9AC\uBCF4\uAE30",imgSrc:"assets/icons/go-back.png",value:0},this.quitFeatureButton={selected:!1,label:"\uC0DD\uC131 \uC644\uB8CC",value:0},this.mobileTicketViewMode=Qi,this.mode=Qi.APPEDITVIEW,this.mobileTicketEditMode=De,this.editMode=De.NONE,this.goBackButtonElement={imgSrc:"assets/icons/go-back.png",label:"\uB4A4\uB85C\uAC00\uAE30",value:0},this.joinButtonElement={selected:!1,imgSrc:"assets/icons/view.png",label:"\uCC38\uC5EC\uD558\uAE30",value:0},this.isDetectingQRCode=!1,this.isCameraLoaded=!1,this.qrStream=null,this.qrCodeSrc="",this.joiningUsers=[],this.checkStatus={checkStatus:null,color:"#006BFF",text:"QR\uCF54\uB4DC\uB97C \uC778\uC2DD\uD574\uC8FC\uC138\uC694."},this.moimId=void 0,this.viewType=void 0,this.createTemplate=void 0,this.face="front",this.isFromUrl=!1}ngOnInit(){this.viewType===void 0?this._route.queryParams.subscribe(n=>{this.moimId=n.moimId,this.viewType=n.viewType,this.createTemplate=n.createTemplate,this.face=n.face,this.isFromUrl=!0,this.setFirstPage()}):(this.isFromUrl=!1,this.setFirstPage())}setFirstPage(){this.viewType==="edit"?this.changeViewMode(Qi.APPEDITVIEW):this.viewType==="view"?this.changeViewMode(Qi.APPVIEW):this.changeViewMode(Qi.WEBVIEW)}changeEditMode(n){this.editMode=n}changeViewMode(n){return dt(this,null,function*(){this.mode=n})}onClickBackButton(){this.mode===Qi.APPVIEW&&this.isFromUrl===!0&&this.changeViewMode(Qi.APPEDITVIEW)}getBackButtonVisibility(){return!this.isFromUrl&&this.mode===Qi.APPVIEW?!1:this.mode!==Qi.APPEDITVIEW}applyEdit(n){this.mobileTicketEditViewer?.updateCanvas(n)}applyBackgroundColorEdit(n){this.mobileTicketEditViewer?.updateBackgroundColor(n)}onClickPreviewButton(){return dt(this,null,function*(){yield this.updateServer(),this.changeViewMode(Qi.APPVIEW)})}onClickQuitButton(){return dt(this,null,function*(){this._router.navigate(["/web/main"])})}updateServer(){return dt(this,null,function*(){if(this.mobileTicketEditViewer!==null&&this.mobileTicketEditor!==null){let o=function(c){for(var l=atob(c.split(",")[1]),h=c.split(",")[0].split(":")[1].split(";")[0],u=new ArrayBuffer(l.length),d=new Uint8Array(u),f=0;f{let t=class t{constructor(){this.title="",this.content="",this.images=[]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-simple-content"]],inputs:{title:"title",content:"content",images:"images"},standalone:!0,features:[Et],decls:6,vars:3,consts:[[1,"container"],["id","title-container"],[3,"margin-top",4,"ngIf"],["id","content-container"],[3,"images","imageHeight","isTicketContainer"]],template:function(i,s){i&1&&(I(0,"div",0)(1,"div",1),Xt(2),N(),At(3,E4,2,5,"div",2),I(4,"div",3),Xt(5),N()()),i&2&&(P(2),Ne(" ",s.title," "),P(),V("ngIf",s.images.length>0),P(2),Ne(" ",s.content," "))},dependencies:[he,Qr],styles:['.container[_ngcontent-%COMP%]{width:350px;display:flex;flex-direction:column}#title-container[_ngcontent-%COMP%]{width:100%;font-size:18px;font-weight:600;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif}#content-container[_ngcontent-%COMP%]{width:100%;height:auto;word-wrap:break-word;margin-top:16px;font-size:16px;font-weight:400;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;margin-bottom:16px}']});let r=t;return r})();var OE=(()=>{let t=class t{constructor(n){this._apiExecutorService=n,this.moimId="",this.moimInfo={}}ngOnInit(){return dt(this,null,function*(){})}getDate(){let n=new Date(this.moimInfo.meetingDate),i=n.getFullYear(),s=n.getMonth()+1,o=n.getDate(),a=n.getHours(),c=n.getMinutes();return`${`${i}\uB144 ${s}\uC6D4 ${o}\uC77C ${a}\uC2DC ${c}\uBD84`}`}getBill(){let n=this.moimInfo.payment!==void 0?this.moimInfo.payment:"1000";return`${Number(n).toLocaleString("en-US")} \uC6D0`}};t.\u0275fac=function(i){return new(i||t)(ft(pe))},t.\u0275cmp=vt({type:t,selectors:[["app-moim-info"]],inputs:{moimId:"moimId",moimInfo:"moimInfo"},standalone:!0,features:[Et],decls:6,vars:10,consts:[[1,"container"],[3,"title","content"]],template:function(i,s){i&1&&(I(0,"div",0),Ct(1,"app-simple-content",1)(2,"app-simple-content",1)(3,"app-simple-content",1)(4,"app-simple-content",1)(5,"app-simple-content",1),N()),i&2&&(P(),V("title","\uAC1C\uCD5C\uC790")("content",s.moimInfo.creator),P(),V("title","\uBAA8\uC784 \uB0A0\uC9DC")("content",s.getDate()),P(),V("title","\uBAA8\uC784 \uC7A5\uC18C")("content",s.moimInfo.location),P(),V("title","\uBAA8\uC784\uC18C\uAC1C")("content",s.moimInfo.description),P(),V("title","\uCC38\uAC00\uBE44")("content",s.getBill()))},dependencies:[z0],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;overflow-y:scroll;height:100%;width:100%;position:relative}.container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}"]});let r=t;return r})();var go={LF:` +`,NULL:"\0"};var Ul=class r{constructor(t){let{command:e,headers:n,body:i,binaryBody:s,escapeHeaderValues:o,skipContentLengthHeader:a}=t;this.command=e,this.headers=Object.assign({},n||{}),s?(this._binaryBody=s,this.isBinaryBody=!0):(this._body=i||"",this.isBinaryBody=!1),this.escapeHeaderValues=o||!1,this.skipContentLengthHeader=a||!1}get body(){return!this._body&&this.isBinaryBody&&(this._body=new TextDecoder().decode(this._binaryBody)),this._body||""}get binaryBody(){return!this._binaryBody&&!this.isBinaryBody&&(this._binaryBody=new TextEncoder().encode(this._body)),this._binaryBody}static fromRawFrame(t,e){let n={},i=s=>s.replace(/^\s+|\s+$/g,"");for(let s of t.headers.reverse()){let o=s.indexOf(":"),a=i(s[0]),c=i(s[1]);e&&t.command!=="CONNECT"&&t.command!=="CONNECTED"&&(c=r.hdrValueUnEscape(c)),n[a]=c}return new r({command:t.command,headers:n,binaryBody:t.binaryBody,escapeHeaderValues:e})}toString(){return this.serializeCmdAndHeaders()}serialize(){let t=this.serializeCmdAndHeaders();return this.isBinaryBody?r.toUnit8Array(t,this._binaryBody).buffer:t+this._body+go.NULL}serializeCmdAndHeaders(){let t=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(let e of Object.keys(this.headers||{})){let n=this.headers[e];this.escapeHeaderValues&&this.command!=="CONNECT"&&this.command!=="CONNECTED"?t.push(`${e}:${r.hdrValueEscape(`${n}`)}`):t.push(`${e}:${n}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&t.push(`content-length:${this.bodyLength()}`),t.join(go.LF)+go.LF+go.LF}isBodyEmpty(){return this.bodyLength()===0}bodyLength(){let t=this.binaryBody;return t?t.length:0}static sizeOfUTF8(t){return t?new TextEncoder().encode(t).length:0}static toUnit8Array(t,e){let n=new TextEncoder().encode(t),i=new Uint8Array([0]),s=new Uint8Array(n.length+e.length+i.length);return s.set(n),s.set(e,n.length),s.set(i,n.length+e.length),s}static marshall(t){return new r(t).serialize()}static hdrValueEscape(t){return t.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(t){return t.replace(/\\r/g,"\r").replace(/\\n/g,` +`).replace(/\\c/g,":").replace(/\\\\/g,"\\")}};var H0=class{constructor(t,e){this.onFrame=t,this.onIncomingPing=e,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(t,e=!1){let n;if(typeof t=="string"?n=this._encoder.encode(t):n=new Uint8Array(t),e&&n[n.length-1]!==0){let i=new Uint8Array(n.length+1);i.set(n,0),i[n.length]=0,n=i}for(let i=0;ie[0]==="content-length")[0];t?(this._bodyBytesRemaining=parseInt(t[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(t){if(t===0){this._retrievedBody();return}this._consumeByte(t)}_collectBodyFixedSize(t){if(this._bodyBytesRemaining--===0){this._retrievedBody();return}this._consumeByte(t)}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw();try{this.onFrame(this._results)}catch(t){console.log("Ignoring an exception thrown by a frame handler. Original exception: ",t)}this._initState()}_consumeByte(t){this._token.push(t)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){let t=new Uint8Array(this._token);return this._token=[],t}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}};var tr;(function(r){r[r.CONNECTING=0]="CONNECTING",r[r.OPEN=1]="OPEN",r[r.CLOSING=2]="CLOSING",r[r.CLOSED=3]="CLOSED"})(tr=tr||(tr={}));var xi;(function(r){r[r.ACTIVE=0]="ACTIVE",r[r.DEACTIVATING=1]="DEACTIVATING",r[r.INACTIVE=2]="INACTIVE"})(xi=xi||(xi={}));var _n=class{constructor(t){this.versions=t}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map(t=>`v${t.replace(".","")}.stomp`)}};_n.V1_0="1.0";_n.V1_1="1.1";_n.V1_2="1.2";_n.default=new _n([_n.V1_2,_n.V1_1,_n.V1_0]);function LE(r,t){r.terminate=function(){let e=()=>{};this.onerror=e,this.onmessage=e,this.onopen=e;let n=new Date,i=Math.random().toString().substring(2,8),s=this.onclose;this.onclose=o=>{let a=new Date().getTime()-n.getTime();t(`Discarded socket (#${i}) closed after ${a}ms, with code/reason: ${o.code}/${o.reason}`)},this.close(),s?.call(r,{code:4001,reason:`Quick discarding socket (#${i}) without waiting for the shutdown sequence.`,wasClean:!1})}}var G0=class{constructor(t,e,n){this._client=t,this._webSocket=e,this._connected=!1,this._serverFrameHandlers={CONNECTED:i=>{this.debug(`connected to server ${i.headers.server}`),this._connected=!0,this._connectedVersion=i.headers.version,this._connectedVersion===_n.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(i.headers),this.onConnect(i)},MESSAGE:i=>{let s=i.headers.subscription,o=this._subscriptions[s]||this.onUnhandledMessage,a=i,c=this,l=this._connectedVersion===_n.V1_2?a.headers.ack:a.headers["message-id"];a.ack=(h={})=>c.ack(l,s,h),a.nack=(h={})=>c.nack(l,s,h),o(a)},RECEIPT:i=>{let s=this._receiptWatchers[i.headers["receipt-id"]];s?(s(i),delete this._receiptWatchers[i.headers["receipt-id"]]):this.onUnhandledReceipt(i)},ERROR:i=>{this.onStompError(i)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.debug=n.debug,this.stompVersions=n.stompVersions,this.connectHeaders=n.connectHeaders,this.disconnectHeaders=n.disconnectHeaders,this.heartbeatIncoming=n.heartbeatIncoming,this.heartbeatOutgoing=n.heartbeatOutgoing,this.splitLargeFrames=n.splitLargeFrames,this.maxWebSocketChunkSize=n.maxWebSocketChunkSize,this.forceBinaryWSFrames=n.forceBinaryWSFrames,this.logRawCommunication=n.logRawCommunication,this.appendMissingNULLonIncoming=n.appendMissingNULLonIncoming,this.discardWebsocketOnCommFailure=n.discardWebsocketOnCommFailure,this.onConnect=n.onConnect,this.onDisconnect=n.onDisconnect,this.onStompError=n.onStompError,this.onWebSocketClose=n.onWebSocketClose,this.onWebSocketError=n.onWebSocketError,this.onUnhandledMessage=n.onUnhandledMessage,this.onUnhandledReceipt=n.onUnhandledReceipt,this.onUnhandledFrame=n.onUnhandledFrame}get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}start(){let t=new H0(e=>{let n=Ul.fromRawFrame(e,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${n}`),(this._serverFrameHandlers[n.command]||this.onUnhandledFrame)(n)},()=>{this.debug("<<< PONG")});this._webSocket.onmessage=e=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){let n=e.data instanceof ArrayBuffer?new TextDecoder().decode(e.data):e.data;this.debug(`<<< ${n}`)}t.parseChunk(e.data,this.appendMissingNULLonIncoming)},this._webSocket.onclose=e=>{this.debug(`Connection closed to ${this._webSocket.url}`),this._cleanUp(),this.onWebSocketClose(e)},this._webSocket.onerror=e=>{this.onWebSocketError(e)},this._webSocket.onopen=()=>{let e=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),e["accept-version"]=this.stompVersions.supportedVersions(),e["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:e})}}_setupHeartbeat(t){if(t.version!==_n.V1_1&&t.version!==_n.V1_2||!t["heart-beat"])return;let[e,n]=t["heart-beat"].split(",").map(i=>parseInt(i,10));if(this.heartbeatOutgoing!==0&&n!==0){let i=Math.max(this.heartbeatOutgoing,n);this.debug(`send PING every ${i}ms`),this._pinger=setInterval(()=>{this._webSocket.readyState===tr.OPEN&&(this._webSocket.send(go.LF),this.debug(">>> PING"))},i)}if(this.heartbeatIncoming!==0&&e!==0){let i=Math.max(this.heartbeatIncoming,e);this.debug(`check PONG every ${i}ms`),this._ponger=setInterval(()=>{let s=Date.now()-this._lastServerActivityTS;s>i*2&&(this.debug(`did not receive server activity for the last ${s}ms`),this._closeOrDiscardWebsocket())},i)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this.discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState===tr.CONNECTING||this._webSocket.readyState===tr.OPEN)&&this._closeOrDiscardWebsocket()}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}discardWebsocket(){typeof this._webSocket.terminate!="function"&&LE(this._webSocket,t=>this.debug(t)),this._webSocket.terminate()}_transmit(t){let{command:e,headers:n,body:i,binaryBody:s,skipContentLengthHeader:o}=t,a=new Ul({command:e,headers:n,body:i,binaryBody:s,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:o}),c=a.serialize();if(this.logRawCommunication?this.debug(`>>> ${c}`):this.debug(`>>> ${a}`),this.forceBinaryWSFrames&&typeof c=="string"&&(c=new TextEncoder().encode(c)),typeof c!="string"||!this.splitLargeFrames)this._webSocket.send(c);else{let l=c;for(;l.length>0;){let h=l.substring(0,this.maxWebSocketChunkSize);l=l.substring(this.maxWebSocketChunkSize),this._webSocket.send(h),this.debug(`chunk sent = ${h.length}, remaining = ${l.length}`)}}}dispose(){if(this.connected)try{let t=Object.assign({},this.disconnectHeaders);t.receipt||(t.receipt=`close-${this._counter++}`),this.watchForReceipt(t.receipt,e=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(e)}),this._transmit({command:"DISCONNECT",headers:t})}catch(t){this.debug(`Ignoring error during disconnect ${t}`)}else(this._webSocket.readyState===tr.CONNECTING||this._webSocket.readyState===tr.OPEN)&&this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&(clearInterval(this._pinger),this._pinger=void 0),this._ponger&&(clearInterval(this._ponger),this._ponger=void 0)}publish(t){let{destination:e,headers:n,body:i,binaryBody:s,skipContentLengthHeader:o}=t,a=Object.assign({destination:e},n);this._transmit({command:"SEND",headers:a,body:i,binaryBody:s,skipContentLengthHeader:o})}watchForReceipt(t,e){this._receiptWatchers[t]=e}subscribe(t,e,n={}){n=Object.assign({},n),n.id||(n.id=`sub-${this._counter++}`),n.destination=t,this._subscriptions[n.id]=e,this._transmit({command:"SUBSCRIBE",headers:n});let i=this;return{id:n.id,unsubscribe(s){return i.unsubscribe(n.id,s)}}}unsubscribe(t,e={}){e=Object.assign({},e),delete this._subscriptions[t],e.id=t,this._transmit({command:"UNSUBSCRIBE",headers:e})}begin(t){let e=t||`tx-${this._counter++}`;this._transmit({command:"BEGIN",headers:{transaction:e}});let n=this;return{id:e,commit(){n.commit(e)},abort(){n.abort(e)}}}commit(t){this._transmit({command:"COMMIT",headers:{transaction:t}})}abort(t){this._transmit({command:"ABORT",headers:{transaction:t}})}ack(t,e,n={}){n=Object.assign({},n),this._connectedVersion===_n.V1_2?n.id=t:n["message-id"]=t,n.subscription=e,this._transmit({command:"ACK",headers:n})}nack(t,e,n={}){return n=Object.assign({},n),this._connectedVersion===_n.V1_2?n.id=t:n["message-id"]=t,n.subscription=e,this._transmit({command:"NACK",headers:n})}};var Vl=class{constructor(t={}){this.stompVersions=_n.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8*1024,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.discardWebsocketOnCommFailure=!1,this.state=xi.INACTIVE;let e=()=>{};this.debug=e,this.beforeConnect=e,this.onConnect=e,this.onDisconnect=e,this.onUnhandledMessage=e,this.onUnhandledReceipt=e,this.onUnhandledFrame=e,this.onStompError=e,this.onWebSocketClose=e,this.onWebSocketError=e,this.logRawCommunication=!1,this.onChangeState=e,this.connectHeaders={},this._disconnectHeaders={},this.configure(t)}get webSocket(){return this._stompHandler?._webSocket}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(t){this._disconnectHeaders=t,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===xi.ACTIVE}_changeState(t){this.state=t,this.onChangeState(t)}configure(t){Object.assign(this,t)}activate(){let t=()=>{if(this.active){this.debug("Already ACTIVE, ignoring request to activate");return}this._changeState(xi.ACTIVE),this._connect()};this.state===xi.DEACTIVATING?(this.debug("Waiting for deactivation to finish before activating"),this.deactivate().then(()=>{t()})):t()}_connect(){return dt(this,null,function*(){if(yield this.beforeConnect(),this._stompHandler){this.debug("There is already a stompHandler, skipping the call to connect");return}if(!this.active){this.debug("Client has been marked inactive, will not attempt to connect");return}this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout(()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())},this.connectionTimeout)),this.debug("Opening Web Socket...");let t=this._createWebSocket();this._stompHandler=new G0(this,t,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:e=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active){this.debug("STOMP got connected while deactivate was issued, will disconnect now"),this._disposeStompHandler();return}this.onConnect(e)},onDisconnect:e=>{this.onDisconnect(e)},onStompError:e=>{this.onStompError(e)},onWebSocketClose:e=>{this._stompHandler=void 0,this.state===xi.DEACTIVATING&&this._changeState(xi.INACTIVE),this.onWebSocketClose(e),this.active&&this._schedule_reconnect()},onWebSocketError:e=>{this.onWebSocketError(e)},onUnhandledMessage:e=>{this.onUnhandledMessage(e)},onUnhandledReceipt:e=>{this.onUnhandledReceipt(e)},onUnhandledFrame:e=>{this.onUnhandledFrame(e)}}),this._stompHandler.start()})}_createWebSocket(){let t;if(this.webSocketFactory)t=this.webSocketFactory();else if(this.brokerURL)t=new WebSocket(this.brokerURL,this.stompVersions.protocolVersions());else throw new Error("Either brokerURL or webSocketFactory must be provided");return t.binaryType="arraybuffer",t}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout(()=>{this._connect()},this.reconnectDelay))}deactivate(){return dt(this,arguments,function*(t={}){let e=t.force||!1,n=this.active,i;if(this.state===xi.INACTIVE)return this.debug("Already INACTIVE, nothing more to do"),Promise.resolve();if(this._changeState(xi.DEACTIVATING),this._reconnector&&(clearTimeout(this._reconnector),this._reconnector=void 0),this._stompHandler&&this.webSocket.readyState!==tr.CLOSED){let s=this._stompHandler.onWebSocketClose;i=new Promise((o,a)=>{this._stompHandler.onWebSocketClose=c=>{s(c),o()}})}else return this._changeState(xi.INACTIVE),Promise.resolve();return e?this._stompHandler?.discardWebsocket():n&&this._disposeStompHandler(),i})}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&this._stompHandler.dispose()}publish(t){this._checkConnection(),this._stompHandler.publish(t)}_checkConnection(){if(!this.connected)throw new TypeError("There is no underlying STOMP connection")}watchForReceipt(t,e){this._checkConnection(),this._stompHandler.watchForReceipt(t,e)}subscribe(t,e,n={}){return this._checkConnection(),this._stompHandler.subscribe(t,e,n)}unsubscribe(t,e={}){this._checkConnection(),this._stompHandler.unsubscribe(t,e)}begin(t){return this._checkConnection(),this._stompHandler.begin(t)}commit(t){this._checkConnection(),this._stompHandler.commit(t)}abort(t){this._checkConnection(),this._stompHandler.abort(t)}ack(t,e,n={}){this._checkConnection(),this._stompHandler.ack(t,e,n)}nack(t,e,n={}){this._checkConnection(),this._stompHandler.nack(t,e,n)}};function _4(r,t){r&1&&Ct(0,"img",9)}function y4(r,t){r&1&&Ct(0,"img",9)}function b4(r,t){if(r&1&&(I(0,"div",6),At(1,_4,1,0,"img",7),I(2,"div",8),Xt(3),N(),At(4,y4,1,0,"img",7),N()),r&2){let e=at();Lt("justify-content",e.align),P(),V("ngIf",e.align==="left"),P(2),Ge(e.message.nickname),P(),V("ngIf",e.align==="right")}}function A4(r,t){if(r&1&&(I(0,"div",10),Xt(1),N()),r&2){let e=at();Lt("margin-right",5,"px"),P(),Ne(" ",e.getTime(e.message.date),"")}}function S4(r,t){if(r&1&&(I(0,"div",10),Xt(1),N()),r&2){let e=at();Lt("margin-left",5,"px"),P(),Ne(" ",e.getTime(e.message.date),"")}}var NE=(()=>{let t=class t{constructor(n){this._apiExecutorService=n,this.contentOnly=!1,this.content=void 0,this.message=void 0,this.align="left"}ngOnInit(){}getTime(n){let i=new Date(n),s=9*60,o=new Date(i.getTime()+s*60*1e3),a=o.getHours().toString().padStart(2,"0"),c=o.getMinutes().toString().padStart(2,"0");return`${a} : ${c}`}};t.\u0275fac=function(i){return new(i||t)(ft(pe))},t.\u0275cmp=vt({type:t,selectors:[["app-chat-container"]],inputs:{contentOnly:"contentOnly",content:"content",message:"message",align:"align"},standalone:!0,features:[Et],decls:7,vars:10,consts:[[1,"container"],["id","profile-container",3,"justify-content",4,"ngIf"],["id","content-container"],["id","date-container",3,"margin-right",4,"ngIf"],["id","text-container"],["id","date-container",3,"margin-left",4,"ngIf"],["id","profile-container"],["id","profile-img-container","src","assets/add_photo.png",4,"ngIf"],["id","name-container"],["id","profile-img-container","src","assets/add_photo.png"],["id","date-container"]],template:function(i,s){i&1&&(I(0,"div",0),At(1,b4,5,5,"div",1),I(2,"div",2),At(3,A4,2,3,"div",3),I(4,"div",4),Xt(5),N(),At(6,S4,2,3,"div",5),N()()),i&2&&(P(),V("ngIf",!s.contentOnly),P(),Lt("justify-content",s.align)("margin-left",s.align==="left"?45:0,"px")("margin-right",s.align==="right"?30:0,"px"),P(),V("ngIf",s.align==="right"),P(2),Ge(s.message.message),P(),V("ngIf",s.align==="left"))},dependencies:[he,Ro],styles:['.container[_ngcontent-%COMP%]{width:100%;margin-top:8px}#profile-container[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:left;align-items:center}#profile-img-container[_ngcontent-%COMP%]{width:36px;height:36px;border-radius:50%}#name-container[_ngcontent-%COMP%]{margin-left:12px;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:14px;font-weight:500}#content-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:flex-end}#text-container[_ngcontent-%COMP%]{border-radius:10px;padding:8px;max-width:300px;border:solid #D8D8DA 1px;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:14px;font-weight:400;box-sizing:border-box;word-break:break-word}#date-container[_ngcontent-%COMP%]{font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:11px;font-weight:500}']});let r=t;return r})();var w4=["simpleInput"],M4=["msgContainer"];function D4(r,t){if(r&1&&(sn(0),Ct(1,"app-chat-container",7),on()),r&2){let e=t.$implicit,n=t.index,i=at();P(),V("message",e)("contentOnly",i.isSameSender(e,n))("align",i.isMyMsg(e))}}var UE=(()=>{let t=class t{constructor(n){this._apiExecutorService=n,this.simpleInput=null,this.msgContainer=null,this.moimId=void 0,this.myProfile=void 0,this.stompClient=new Vl,this.message="",this.isConnected=!1,this.messages=[],this.notice="\uC548\uB155\uD558\uC138\uC694"}ngOnInit(){return dt(this,null,function*(){this.myProfile=this._apiExecutorService.myProfile,this.messages=yield this._apiExecutorService.getLastMessages(this.moimId),this.stompClient=new Vl({brokerURL:"wss://ssalon.co.kr/ws-stomp",connectHeaders:{Authorization:`Bearer ${this._apiExecutorService.token}`,moimId:this.moimId}}),this.stompClient.onConnect=n=>{console.log("Connected: "+n),this.isConnected=!0,this.stompClient.subscribe(`/room/${this.moimId}`,i=>{let s=JSON.parse(i.body);console.log(s),s.messageType==="TALK"?this.messages.push(JSON.parse(i.body)):s.messageType==="ENTER"?this.notice+="new person entered":this.notice+="someone left"}),this.stompClient.publish({destination:`/send/${this.moimId}`,body:JSON.stringify({message:this.simpleInput.innerText}),headers:{Authorization:`Bearer ${this._apiExecutorService.token}`,MessageType:"ENTER"}})},this.stompClient.onStompError=n=>{console.error("Broker reported error: "+n.headers.message),console.error("Additional details: "+n.body)},this.connect()})}ngAfterViewChecked(){this.msgContainer.nativeElement.scrollTop=this.msgContainer.nativeElement.scrollHeight}ngOnDestroy(){this.disconnect()}connect(){this.stompClient.activate()}disconnect(){this.stompClient&&(this.stompClient.publish({destination:`/send/${this.moimId}`,body:JSON.stringify({message:this.simpleInput.innerText}),headers:{Authorization:`Bearer ${this._apiExecutorService.token}`,MessageType:"LEAVE"}}),this.stompClient.deactivate(),this.isConnected=!1,this.messages=[])}sendMessage(){this.stompClient&&this.stompClient.connected&&(this.stompClient.publish({destination:`/send/${this.moimId}`,body:JSON.stringify({message:this.simpleInput.innerText}),headers:{Authorization:`Bearer ${this._apiExecutorService.token}`,MessageType:"TALK"}}),this.simpleInput.innerText="")}isMyMsg(n){return this.myProfile.nickname===n.nickname&&this.myProfile.email===n.email?"right":"left"}isSameSender(n,i){return i===0?!1:this.messages[i-1].nickname===n.nickname}onKeyUpEnter(n){this.simpleInput?.innerText!==""&&this.sendMessage()}};t.\u0275fac=function(i){return new(i||t)(ft(pe))},t.\u0275cmp=vt({type:t,selectors:[["app-chatting"]],viewQuery:function(i,s){if(i&1&&(te(w4,5),te(M4,5)),i&2){let o;Kt(o=Jt())&&(s.simpleInput=o.first),Kt(o=Jt())&&(s.msgContainer=o.first)}},hostBindings:function(i,s){i&1&&xt("keyup.enter",function(a){return s.onKeyUpEnter(a)})},inputs:{moimId:"moimId"},standalone:!0,features:[Et],decls:8,vars:3,consts:[["msgContainer",""],["simpleInput",""],[1,"container"],["id","msg-container"],[4,"ngFor","ngForOf"],["id","send-input"],[3,"onClickChatSendButtonEvent","type"],[3,"message","contentOnly","align"]],template:function(i,s){if(i&1){let o=qt();I(0,"div",2),Xt(1),I(2,"div",3,0),At(4,D4,2,3,"ng-container",4),N(),I(5,"div",5)(6,"app-simple-input",6,1),xt("onClickChatSendButtonEvent",function(){return Mt(o),Dt(s.sendMessage())}),N()()()}i&2&&(P(),Ne(" ",s.notice," "),P(3),V("ngForOf",s.messages),P(2),V("type","chat-input"))},dependencies:[en,Ro,qr,NE],styles:[".container[_ngcontent-%COMP%]{width:100%;height:100%;position:relative}#msg-container[_ngcontent-%COMP%]{width:100%;height:calc(100% - 100px);overflow:scroll}#msg-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}#send-input[_ngcontent-%COMP%]{position:absolute;width:350px;left:50%;bottom:0;transform:translate(-50%)}"]});let r=t;return r})();var zE=Pm(VE());var B4=["barcodeContainer"],T4=["qrVideo"],F4=["qrCanvas"],P4=["joiningUsersComponent"],HE=(()=>{let t=class t{constructor(n){this._apiExecutorService=n,this.barcodeContainer=null,this.qrVideo=null,this.qrCanvas=null,this.joiningUsersComponent=null,this.moimId="",this.isDetectingQRCode=!1,this.isCameraLoaded=!1,this.qrStream=null,this.qrCodeSrc="",this.joiningUsers=[],this.checkStatus={checkStatus:null,color:"#006BFF",text:"QR\uCF54\uB4DC\uB97C \uC778\uC2DD\uD574\uC8FC\uC138\uC694."}}ngOnInit(){}ngAfterViewChecked(){return dt(this,null,function*(){this.startQRCodeDetection()})}ngOnDestroy(){this.stopDetectQRCode()}startQRCodeDetection(){return dt(this,null,function*(){if(this.qrVideo&&this.qrCanvas&&!this.isCameraLoaded)try{this.isCameraLoaded=!0,this.qrCanvas.nativeElement.setAttribute("willReadFrequently","true"),this.qrStream=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}),this.qrVideo.nativeElement.srcObject=this.qrStream,this.qrVideo.nativeElement.play(),this.detectQRCode()}catch(n){console.error(n)}})}detectQRCode(){return dt(this,null,function*(){if(this.qrVideo&&this.qrCanvas)for(;;){if(this.qrVideo.nativeElement.readyState===this.qrVideo.nativeElement.HAVE_ENOUGH_DATA){let n=this.qrCanvas.nativeElement.getContext("2d");this.qrCanvas.nativeElement.height=this.qrVideo.nativeElement.videoHeight,this.qrCanvas.nativeElement.width=this.qrVideo.nativeElement.videoWidth,n?.drawImage(this.qrVideo?.nativeElement,0,0,this.qrCanvas.nativeElement?.width,this.qrCanvas.nativeElement?.height);let i=n?.getImageData(0,0,this.qrCanvas.nativeElement?.width,this.qrCanvas.nativeElement?.height),s=(0,zE.default)(i.data,i.width,i.height);if(s){try{let o=yield this._apiExecutorService.checkQR(this.moimId,s.data);this.checkStatus={checkStatus:o.attendance,checkingUser:{nickname:o.nickname,profilePictureUrl:o.profilePictureUrl,attendance:o.attendance,userId:o.userId},color:"#4DAF50",text:"\uD658\uC601\uD569\uB2C8\uB2E4."},this.checkStatus.checkingUser.attendance&&this.joiningUsersComponent?.changeStatus(this.checkStatus.checkingUser.userId,!0)}catch{this.checkStatus={checkStatus:!1,color:"#F44336",text:"\uCC38\uAC00\uC790\uAC00 \uC544\uB2D9\uB2C8\uB2E4."}}yield new Promise(o=>setTimeout(o,1e3)),this.checkStatus={checkStatus:null,color:"#006BFF",text:"QR\uCF54\uB4DC\uB97C \uC778\uC2DD\uD574\uC8FC\uC138\uC694."}}}yield new Promise(n=>setTimeout(n,100))}})}stopDetectQRCode(){this.qrStream&&(this.qrStream.getTracks().forEach(n=>{n.stop()}),this.isDetectingQRCode=!1,this.isCameraLoaded=!1)}};t.\u0275fac=function(i){return new(i||t)(ft(pe))},t.\u0275cmp=vt({type:t,selectors:[["app-qr-check"]],viewQuery:function(i,s){if(i&1&&(te(B4,5),te(T4,5),te(F4,5),te(P4,5)),i&2){let o;Kt(o=Jt())&&(s.barcodeContainer=o.first),Kt(o=Jt())&&(s.qrVideo=o.first),Kt(o=Jt())&&(s.qrCanvas=o.first),Kt(o=Jt())&&(s.joiningUsersComponent=o.first)}},inputs:{moimId:"moimId",joiningUsers:"joiningUsers"},standalone:!0,features:[Et],decls:22,vars:24,consts:[["qrCheckView",""],["qrVideo",""],["qrCanvas",""],["joiningUsersComponent",""],[1,"container"],["id","qr-detector"],["autoplay","","playsInline",""],["id","qr-canvas"],["id","qr-guide-container"],["id","qr-guide","src","assets/qr-guide.png","height","300px"],["id","join-user-container"],[1,"horizontal-container"],["id","qr-checking-user-container"],["id","qr-checking-user-profile-container"],["id","qr-checking-user-profile-img","height","50px",3,"src"],["id","qr-check-info-container"],[1,"qr-check-info"],["id","join-user-list"],[3,"elements"]],template:function(i,s){i&1&&(I(0,"div",4,0)(2,"div",5),Ct(3,"video",6,1)(5,"canvas",7,2),I(7,"div",8),Ct(8,"img",9),N()(),I(9,"div",10)(10,"div",11)(11,"div",12)(12,"div",13),Ct(13,"img",14),N(),I(14,"div",15)(15,"div",16),Xt(16),N(),I(17,"div",16),Xt(18),N()()()(),I(19,"div",17),Ct(20,"app-circle-toggle-status-group",18,3),N()()()),i&2&&(P(3),Lt("width","100%")("height","100%")("object-fit","cover"),P(2),Lt("display","none"),P(4),Lt("margin-top","30px"),P(),Lt("justify-content","center"),P(2),Lt("width",52,"px")("height",52,"px"),P(),V("src",s.checkStatus.checkingUser?s.checkStatus.checkingUser.profilePictureUrl:"assets/data_error.png",Cn),P(2),Lt("font-size","20px"),P(),Ne(" ",s.checkStatus.checkingUser?s.checkStatus.checkingUser.nickname:"\uC54C\uC218\uC5C6\uC74C",""),P(),Lt("color",s.checkStatus.color),P(),Ge(s.checkStatus.text),P(2),V("elements",s.joiningUsers))},dependencies:[IE],styles:['.container[_ngcontent-%COMP%]{height:100%;width:100%;display:flex;flex-direction:column;position:relative}.horizontal-container[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}#qrcode-overay[_ngcontent-%COMP%]{width:100%;height:100%;position:absolute;top:0;left:0;background-color:#000c;display:flex;justify-content:center;align-items:center}#qrcode-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;width:150px;height:150px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:#fff;border-radius:10px}#qrcode[_ngcontent-%COMP%]{width:130px;height:130px}#qr-detector[_ngcontent-%COMP%]{width:100%;height:300px;position:relative}#qr-guide-container[_ngcontent-%COMP%]{position:absolute;top:0;width:100%}#qr-guide[_ngcontent-%COMP%]{position:absolute;top:0;left:50%;transform:translate(-50%)}#qr-checking-user-container[_ngcontent-%COMP%]{display:flex;align-items:center}#qr-checking-user-profile-container[_ngcontent-%COMP%]{margin:5px;border-radius:50%;display:flex;justify-content:center;align-items:center}#qr-checking-user-profile-img[_ngcontent-%COMP%]{border-radius:50%}#qr-check-info-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex-direction:column;margin-left:20px}.qr-check-info[_ngcontent-%COMP%]{font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:17px;margin:5px}#join-user-list[_ngcontent-%COMP%]{margin-top:50px;height:100px}']});let r=t;return r})();var YE=Pm(XE());var qE=(()=>{let t=class t{constructor(n,i,s){this._sceneGraphService=n,this._apiExecutorService=i,this.sanitizer=s,this.moimId="",this.qrCodeSrc="",this.ticketViewerSrc=""}ngOnInit(){return dt(this,null,function*(){let n=`https://ssalon.co.kr/web/ticket?moimId=${this.moimId}&viewType=view`;this.ticketViewerSrc=this.sanitizer.bypassSecurityTrustResourceUrl(n),yield this.setQrCodeImgSrc(),this._sceneGraphService.mobileTicketAutoRotate=!0})}setQrCodeImgSrc(){return dt(this,null,function*(){let n=(0,YE.default)(0,"L");n.addData(yield this._apiExecutorService.getBarcode(this.moimId)),n.make(),this.qrCodeSrc=n.createDataURL(5,0)})}};t.\u0275fac=function(i){return new(i||t)(ft(Bs),ft(pe),ft(bd))},t.\u0275cmp=vt({type:t,selectors:[["app-qr-show"]],inputs:{moimId:"moimId"},standalone:!0,features:[Et],decls:7,vars:3,consts:[["qrShowView",""],[1,"container"],["id","ticket-viewer-container"],[3,"moimId","viewType"],["id","qrcode-overay"],["id","qrcode-container"],["id","qrcode","alt","\uC774\uBBF8\uC9C0",3,"src"]],template:function(i,s){i&1&&(I(0,"div",1,0)(2,"div",2),Ct(3,"app-ticket",3),N(),I(4,"div",4)(5,"div",5),Ct(6,"img",6),N()()()),i&2&&(P(3),V("moimId",s.moimId)("viewType","view"),P(3),V("src",s.qrCodeSrc,Cn))},dependencies:[ic],styles:[".container[_ngcontent-%COMP%]{height:100%;width:100%;display:flex;flex-direction:column;position:relative}.horizontal-container[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}#qr-show-container[_ngcontent-%COMP%]{width:350px;height:calc(100% - 20px)}#qr-show[_ngcontent-%COMP%]{border:none;padding:0;margin:0;outline:none;width:100%;height:100%}#qrcode-overay[_ngcontent-%COMP%]{width:100%;height:calc(100% - 20px);position:absolute;top:0;left:0;background-color:#000c;display:flex;justify-content:center;align-items:center}#qrcode-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;width:150px;height:150px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:#fff;border-radius:10px}#ticket-viewer-container[_ngcontent-%COMP%]{width:100%;height:calc(100% - 20px)}"]});let r=t;return r})();var $E=(()=>{let t=class t{constructor(n,i){this.buttonElementsService=n,this._apiExecutorService=i,this.reviewInfo={description:"",diaryPictureUrls:[""]},this.moimId=void 0,this.photos=[{imgSrc:"assets/add_photo.png",value:-1,label:"\uC0AC\uC9C4\uCD94\uAC00",selected:!1}],this.onCreateButtonReadyEvent=new jt}ngAfterViewChecked(){this.isAllTyped()&&this.onCreateButtonReadyEvent.emit(!0)}onInput(n,i){this.reviewInfo[n]=i}isAllTyped(){return this.reviewInfo.description!==""}onClickImage(n){if(n===-1){let i=document.createElement("input");i.type="file",i.accept="image/*",i.multiple=!0;let s=[];i.onchange=(function(){return dt(this,null,function*(){if(s=[],i.files&&i.files.length>0){let o=Array.from(i.files),a=0;o.forEach((c,l)=>{let h=new FileReader;h.onload=(function(u){return dt(this,null,function*(){s.push(u.target.result),a++,a===o.length&&(yield this.getImageUrl(s))})}).bind(this),h.readAsDataURL(c)})}})}).bind(this),i.click()}}getImageUrl(n){return dt(this,null,function*(){let i=new FormData;function s(c){for(var l=atob(c.split(",")[1]),h=c.split(",")[0].split(":")[1].split(";")[0],u=new ArrayBuffer(l.length),d=new Uint8Array(u),f=0;f{i.append("files",s(c),`${l}.png`)});try{let c=yield this._apiExecutorService.uploadGeneralImage(i),l=Object.keys(c.mapURI);console.log(l);for(var o=0;o{let t=class t{constructor(n){this.buttonElementsService=n,this.onClickToggleButtonEvent=new jt}onClickToggleButton(){let n=this.buttonElementsService.createTicketTypeButtons.find(i=>i.selected===!0);n!==void 0?this.onClickToggleButtonEvent.emit(n.value):this.onClickToggleButtonEvent.emit(!1)}};t.\u0275fac=function(i){return new(i||t)(ft(Ue))},t.\u0275cmp=vt({type:t,selectors:[["app-create-diary"]],outputs:{onClickToggleButtonEvent:"onClickToggleButtonEvent"},standalone:!0,features:[Et],decls:1,vars:3,consts:[[3,"onClickToggleButtonEvent","buttonElements","columnNum","multiSelection"]],template:function(i,s){i&1&&(I(0,"app-simple-toggle",0),xt("onClickToggleButtonEvent",function(){return s.onClickToggleButton()}),N()),i&2&&V("buttonElements",s.buttonElementsService.createTicketTypeButtons)("columnNum",1)("multiSelection",!1)},dependencies:[yi]});let r=t;return r})();var k4=["createMoimReviewInfoComponent"];function R4(r,t){if(r&1){let e=qt();I(0,"div")(1,"app-create-moim-review-info",7,0),xt("onCreateButtonReadyEvent",function(){Mt(e);let i=at();return Dt(i.changeCreateDiaryTypeButtonState(!0))}),N()()}if(r&2){let e=at();P(),V("reviewInfo",e.reviewInfo)("moimId",e.moimId)}}function I4(r,t){if(r&1){let e=qt();I(0,"div")(1,"app-create-diary",8),xt("onClickToggleButtonEvent",function(i){Mt(e);let s=at();return Dt(s.changeCreateTicketButtonState(i))}),N()()}}var rc=function(r){return r[r.INFO=0]="INFO",r[r.DIARY=1]="DIARY",r}(rc||{}),W0=function(r){return r[r.EMPTY=0]="EMPTY",r[r.TEMPLATE=1]="TEMPLATE",r[r.AI=2]="AI",r}(W0||{}),KE=(()=>{let t=class t{constructor(n,i,s,o,a){this._apiExecutorService=n,this.buttonElementsService=i,this._location=s,this._router=o,this._route=a,this.createMoimReviewInfoComponent=null,this.moimId="",this.moimTitle="",this.createDiaryStep=rc,this.nowStep=rc.INFO,this.reviewInfo={description:"",reviewPictureUrls:[""]},this.resultMeetingInfo={},this.createDiaryMode=W0.EMPTY}ngOnInit(){this._route.queryParams.subscribe(n=>{this.moimId=n.moimId,this.moimTitle=n.title})}onClickBackButton(){this.nowStep===rc.DIARY?this.nowStep=rc.INFO:(this.reviewInfo={description:""},this._location.back())}changeCreateDiaryTypeButtonState(n){this.buttonElementsService.nextButtons[0].selected=n}changeCreateTicketButtonState(n){n===0?this.createDiaryMode=W0.EMPTY:n===1&&(this.createDiaryMode=W0.TEMPLATE),this.buttonElementsService.createTicketButtons[0].selected=!0}onClickCreateTicketButton(){this._router.navigate(["/web/ticket"],{queryParams:{moimId:this.moimId,viewType:"edit",createTemplate:this.createDiaryMode===0?"N":"A",face:"back"}})}onClickNextButton(){return dt(this,null,function*(){this.reviewInfo=this.createMoimReviewInfoComponent.reviewInfo,this.buttonElementsService.nextButtons[0].selected&&(yield this._apiExecutorService.createMoimReview(this.moimId,this.reviewInfo),this.buttonElementsService.createTicketTypeButtons.every(n=>n.selected=!1),this.nowStep=rc.DIARY)})}};t.\u0275fac=function(i){return new(i||t)(ft(pe),ft(Ue),ft(Ei),ft(We),ft(Rn))},t.\u0275cmp=vt({type:t,selectors:[["app-moim-review-create"]],viewQuery:function(i,s){if(i&1&&te(k4,5),i&2){let o;Kt(o=Jt())&&(s.createMoimReviewInfoComponent=o.first)}},standalone:!0,features:[Et],decls:7,vars:8,consts:[["createMoimReviewInfoComponent",""],[1,"container"],[3,"backButtonClickEvent","title","shareButton","defaultBack"],[1,"content-container"],[4,"ngIf"],[1,"bottom-button"],[3,"onClickEvent","buttonElements"],[3,"onCreateButtonReadyEvent","reviewInfo","moimId"],[3,"onClickToggleButtonEvent"]],template:function(i,s){i&1&&(I(0,"div",1)(1,"app-top-navigator",2),xt("backButtonClickEvent",function(){return s.onClickBackButton()}),N(),I(2,"div",3),At(3,R4,3,2,"div",4)(4,I4,2,0,"div",4),N(),I(5,"div",5)(6,"app-square-button",6),xt("onClickEvent",function(){return s.nowStep===s.createDiaryStep.INFO?s.onClickNextButton():s.onClickCreateTicketButton()}),N()()()),i&2&&(P(),Lt("width","100%"),V("title",s.moimTitle)("shareButton",!1)("defaultBack",!1),P(2),V("ngIf",s.nowStep===s.createDiaryStep.INFO),P(),V("ngIf",s.nowStep===s.createDiaryStep.DIARY),P(2),V("buttonElements",s.nowStep===s.createDiaryStep.INFO?s.buttonElementsService.nextButtons:s.buttonElementsService.createTicketButtons))},dependencies:[he,nc,$E,ZE,sr],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;height:100%;width:100%}.content-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;height:calc(100% - 140px);width:100%;position:relative;overflow:scroll}.content-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}"]});let r=t;return r})();var JE=(()=>{let t=class t{constructor(n){this._apiExecutorService=n,this.moimId=void 0,this.reviewInfo={}}ngOnInit(){this.reviewInfo=this._apiExecutorService.getMoimReview(this.moimId),console.log(this.reviewInfo)}};t.\u0275fac=function(i){return new(i||t)(ft(pe))},t.\u0275cmp=vt({type:t,selectors:[["app-moim-review-info"]],inputs:{moimId:"moimId"},standalone:!0,features:[Et],decls:2,vars:2,consts:[[1,"container"],[3,"title","content"]],template:function(i,s){i&1&&(I(0,"div",0),Ct(1,"app-simple-content",1),N()),i&2&&(P(),V("title","\uD6C4\uAE30")("content",s.reviewInfo.description))},dependencies:[z0],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;overflow-y:scroll;height:100%;width:100%;position:relative}.container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}"]});let r=t;return r})();function O4(r,t){if(r&1&&(I(0,"div",1),Ct(1,"app-moim-review-info",2),N()),r&2){let e=at();P(),V("moimId",e.moimId)}}function L4(r,t){if(r&1){let e=qt();I(0,"div",1)(1,"div",3),Xt(2),Ct(3,"br"),Xt(4,"\uD6C4\uAE30\uB97C \uC791\uC131\uD558\uC9C0 \uC54A\uC558\uC5B4\uC694! "),N(),I(5,"div"),Ct(6,"img",4),N(),I(7,"app-square-button",5),xt("onClickEvent",function(){Mt(e);let i=at();return Dt(i.onClickCreateDiaryButton())}),N()()}if(r&2){let e=at();P(2),Ne(" \uC544\uC9C1 '",e.moimTitle,"'\uC758 "),P(5),V("buttonElements",e.buttonElementService.createDiaryButtonElements)}}var QE=(()=>{let t=class t{constructor(n,i,s){this._apiExecutorService=n,this._router=i,this.buttonElementService=s,this.moimId="",this.moimTitle="",this.isReviewCreated=!1}ngOnInit(){this.checkDiaryCreated()}checkDiaryCreated(){return dt(this,null,function*(){(yield this._apiExecutorService.getMoimReview(this.moimId))===!1?this.isReviewCreated=!1:this.isReviewCreated=!0})}onClickCreateDiaryButton(){this._router.navigate(["/web/meeting-review-create"],{queryParams:{moimId:this.moimId,title:this.moimTitle}})}};t.\u0275fac=function(i){return new(i||t)(ft(pe),ft(We),ft(Ue))},t.\u0275cmp=vt({type:t,selectors:[["app-moim-review"]],inputs:{moimId:"moimId",moimTitle:"moimTitle"},standalone:!0,features:[Et],decls:2,vars:2,consts:[["class","container",4,"ngIf"],[1,"container"],[3,"moimId"],["id","explanation"],["src","assets/create_diary.png","width","150px"],[3,"onClickEvent","buttonElements"]],template:function(i,s){i&1&&At(0,O4,2,1,"div",0)(1,L4,8,2,"div",0),i&2&&(V("ngIf",s.isReviewCreated),P(),V("ngIf",!s.isReviewCreated))},dependencies:[he,JE,sr],styles:['.container[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;align-items:center}#explanation[_ngcontent-%COMP%]{margin-top:150px;width:300px;text-align:center;font-weight:600;font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:24px}']});let r=t;return r})();var N4=["ticket"];function U4(r,t){if(r&1&&(I(0,"div",7),Ct(1,"app-qr-check",8),N()),r&2){let e=at();P(),V("moimId",e.moimId)("joiningUsers",e.joiningUsers)}}function V4(r,t){if(r&1&&(I(0,"div",7),Ct(1,"app-qr-show",9),N()),r&2){let e=at();P(),V("moimId",e.moimId)}}function z4(r,t){if(r&1&&(I(0,"div",7),Ct(1,"app-ticket",10),N()),r&2){let e=at();P(),V("moimId",e.moimId)("viewType","view")}}function H4(r,t){if(r&1&&(I(0,"div",7),Ct(1,"app-moim-info",11),N()),r&2){let e=at();Lt("margin-top",20,"px"),P(),V("moimId",e.moimId)("moimInfo",e.moimInfo)}}function G4(r,t){if(r&1&&(I(0,"div",7),Ct(1,"app-chatting",9),N()),r&2){let e=at();P(),V("moimId",e.moimId)}}function W4(r,t){if(r&1&&(I(0,"div",7),Ct(1,"app-moim-review",12),N()),r&2){let e=at();P(),V("moimId",e.moimId)("moimTitle",e.moimInfo.title)}}function j4(r,t){if(r&1){let e=qt();I(0,"div",13)(1,"app-square-button",14),xt("onClickEvent",function(){Mt(e);let i=at();return Dt(i.onClickJoinButton())}),N()()}if(r&2){let e=at();P(),V("buttonElements",e.buttonElementsService.joinButtonElements)}}var Kn=function(r){return r[r.TICKET=0]="TICKET",r[r.INFO=1]="INFO",r[r.CHATTING=2]="CHATTING",r[r.DIARY=3]="DIARY",r[r.QRCHECK=4]="QRCHECK",r[r.QRSHOW=5]="QRSHOW",r}(Kn||{}),t_=(()=>{let t=class t{constructor(n,i,s,o){this._route=n,this._router=i,this._apiExecutorService=s,this.buttonElementsService=o,this.ticket=null,this.moimId="",this.moimInfo={},this.ticketInfo={},this.joined=!1,this.meetingInfoTabEnum=Kn,this.tabs=[],this.nowTab=Kn.INFO,this.isCreator=!1,this.isParticipant=!1,this.joiningUsers=[],this._route.queryParams.subscribe(a=>{this.moimId=a.moimId})}ngOnInit(){return dt(this,null,function*(){this.moimInfo=yield this._apiExecutorService.getMoimInfo(this.moimId),this.ticketInfo=yield this._apiExecutorService.getTicket(this.moimId),this.tabs=yield this.getTabs(),this.nowTab=this.tabs.find(i=>i.selected).value,this.isParticipant?(this.buttonElementsService.joinButtonElements[0].selected=!1,this.buttonElementsService.joinButtonElements[0].label=this.isCreator?"\uC815\uBCF4 \uBC0F \uC99D\uD45C \uC218\uC815\uD558\uAE30(\uAC1C\uCD5C\uC790\uC785\uB2C8\uB2E4)":"\uCC38\uAC00\uC790\uC785\uB2C8\uB2E4."):(this.buttonElementsService.joinButtonElements[0].selected=!0,this.buttonElementsService.joinButtonElements[0].label="\uCC38\uAC00\uD558\uAE30"),(yield this._apiExecutorService.getJoiningUsers(this.moimId)).forEach((i,s)=>{this.joiningUsers.push({imgSrc:i.profilePictureUrl,label:i.nickname,value:i.userId,status:i.attendance})})})}onClickTab(n){this.nowTab=n}getTabs(){return dt(this,null,function*(){return this.isCreator=yield this._apiExecutorService.checkCreator(this.moimId),this.isParticipant=yield this._apiExecutorService.checkParticipant(this.moimId),this.isCreator?[{selected:!1,value:Kn.QRCHECK,label:"QR\uAC80\uC99D"},{selected:!1,value:Kn.TICKET,label:"\uC99D\uD45C \uBCF4\uAE30"},{selected:!0,value:Kn.INFO,label:"\uBAA8\uC784 \uC815\uBCF4"},{selected:!1,value:Kn.CHATTING,label:"\uCC44\uD305"},{selected:!1,value:Kn.DIARY,label:"\uBAA8\uC784 \uD6C4\uAE30"}]:this.isParticipant?[{selected:!1,value:Kn.QRSHOW,label:"QR"},{selected:!1,value:Kn.TICKET,label:"\uC99D\uD45C \uBCF4\uAE30"},{selected:!0,value:Kn.INFO,label:"\uBAA8\uC784 \uC815\uBCF4"},{selected:!1,value:Kn.CHATTING,label:"\uCC44\uD305"},{selected:!1,value:Kn.DIARY,label:"\uBAA8\uC784 \uD6C4\uAE30"}]:[{selected:!1,value:Kn.TICKET,label:"\uC99D\uD45C \uBCF4\uAE30"},{selected:!0,value:Kn.INFO,label:"\uBAA8\uC784 \uC815\uBCF4"}]})}onClickTicket(){this._router.navigate(["/web/ticket"],{queryParams:{moimId:this.moimId,viewType:"view"}})}onClickJoinButton(){return dt(this,null,function*(){this.buttonElementsService.joinButtonElements[0].selected&&(yield this._apiExecutorService.joinMoim(this.moimId),location.reload())})}getThumbSrc(n){return"https://test-bukkit-240415.s3.ap-northeast-2.amazonaws.com/Thumbnails/"+n+"/Thumb-"+n+".png"}};t.\u0275fac=function(i){return new(i||t)(ft(Rn),ft(We),ft(pe),ft(Ue))},t.\u0275cmp=vt({type:t,selectors:[["app-meeting-info"]],viewQuery:function(i,s){if(i&1&&te(N4,5),i&2){let o;Kt(o=Jt())&&(s.ticket=o.first)}},standalone:!0,features:[Et],decls:11,vars:12,consts:[[1,"container"],[3,"title","shareButton"],[3,"onClickTabEvent","tabs"],["id","tab-container"],["class","content",4,"ngIf"],["class","content",3,"margin-top",4,"ngIf"],["id","join-button-container",4,"ngIf"],[1,"content"],[3,"moimId","joiningUsers"],[3,"moimId"],[3,"moimId","viewType"],[3,"moimId","moimInfo"],[3,"moimId","moimTitle"],["id","join-button-container"],[3,"onClickEvent","buttonElements"]],template:function(i,s){i&1&&(I(0,"div",0),Ct(1,"app-top-navigator",1),I(2,"app-tab-group",2),xt("onClickTabEvent",function(a){return s.onClickTab(a)}),N(),I(3,"div",3),At(4,U4,2,2,"div",4)(5,V4,2,1,"div",4)(6,z4,2,2,"div",4)(7,H4,2,4,"div",5)(8,G4,2,1,"div",4)(9,W4,2,2,"div",4),N(),At(10,j4,2,1,"div",6),N()),i&2&&(P(),Lt("width","100%"),V("title",s.moimInfo.title)("shareButton",!0),P(),V("tabs",s.tabs),P(2),V("ngIf",s.nowTab===s.meetingInfoTabEnum.QRCHECK),P(),V("ngIf",s.nowTab===s.meetingInfoTabEnum.QRSHOW),P(),V("ngIf",s.nowTab===s.meetingInfoTabEnum.TICKET),P(),V("ngIf",s.nowTab===s.meetingInfoTabEnum.INFO),P(),V("ngIf",s.nowTab===s.meetingInfoTabEnum.CHATTING),P(),V("ngIf",s.nowTab===s.meetingInfoTabEnum.DIARY),P(),V("ngIf",s.nowTab===s.meetingInfoTabEnum.INFO))},dependencies:[he,nc,Uh,OE,UE,sr,HE,qE,ic,QE],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;height:100%;width:100%;position:relative}.container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}#tab-container[_ngcontent-%COMP%]{height:100%;width:100%;display:flex;flex-direction:row;justify-content:center;overflow-y:scroll}#tab-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.image-container[_ngcontent-%COMP%]{position:relative;display:flex;justify-content:center}.deco-container[_ngcontent-%COMP%]{position:absolute;left:0;top:0}svg[_ngcontent-%COMP%]{filter:drop-shadow(2px 2px 1px rgba(0,0,0,.4))}#join-button-container[_ngcontent-%COMP%]{margin-bottom:20px}.content[_ngcontent-%COMP%]{width:100%;height:100%}"]});let r=t;return r})();var e_=(()=>{let t=class t{constructor(n,i){this._router=n,this.buttonElementsService=i,this.defaultUrl="https://ssalon.co.kr/oauth2/authorization"}onClickLoginButton(n){let i;n===0?i=this.defaultUrl+"/google":n===1?i=this.defaultUrl+"/kakao":i=this.defaultUrl+"/naver",window.location.href=i}};t.\u0275fac=function(i){return new(i||t)(ft(We),ft(Ue))},t.\u0275cmp=vt({type:t,selectors:[["app-ssalon-login"]],standalone:!0,features:[Et],decls:4,vars:3,consts:[[1,"container"],["id","logo-container","src","assets/ssalon_logo_hand.svg","height","65"],["id","login-buttons-container"],[3,"onClickToggleButtonEvent","align","columnNum","buttonElements"]],template:function(i,s){i&1&&(I(0,"div",0),Ct(1,"img",1),I(2,"div",2)(3,"app-simple-toggle",3),xt("onClickToggleButtonEvent",function(a){return s.onClickLoginButton(a)}),N()()()),i&2&&(P(3),V("align","center")("columnNum",1)("buttonElements",s.buttonElementsService.loginButtonElements))},dependencies:[yi],styles:[".container[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;position:relative}#logo-container[_ngcontent-%COMP%]{position:absolute;top:120px;width:350px}#login-buttons-container[_ngcontent-%COMP%]{position:absolute;top:450px;width:350px}.login-button-container[_ngcontent-%COMP%]{margin-bottom:10px}"]});let r=t;return r})();var n_=(()=>{let t=class t{constructor(n,i){this._apiExecutorService=n,this._router=i,this.ts="";let o=`; ${document.cookie}`.split("; access=");this._apiExecutorService.setToken(o.pop().split(";").shift())}ngOnInit(){return dt(this,null,function*(){let n=yield this._apiExecutorService.getIsRegister();console.log(n),setTimeout(()=>{},3e3),n!==!1?this._router.navigate(["/web/main"]):this._router.navigate(["/web/onboarding"])})}};t.\u0275fac=function(i){return new(i||t)(ft(pe),ft(We))},t.\u0275cmp=vt({type:t,selectors:[["app-ssalon-login-redirect"]],standalone:!0,features:[Et],decls:3,vars:1,template:function(i,s){i&1&&(I(0,"p"),Xt(1,"ssalon-login-redirect works!"),N(),Xt(2)),i&2&&(P(2),Ne(` +`,s.ts,""))}});let r=t;return r})();var i_=(()=>{let t=class t{constructor(n){this.buttonElementsService=n,this.onCategorySelectedEvent=new jt,this.interestSelectionButtons=[{selected:!1,value:0,label:"\uC6B4\uB3D9",imgSrc:"assets/interest-icons/excersize.png"},{selected:!1,value:1,label:"\uAC8C\uC784",imgSrc:"assets/interest-icons/game.png"},{selected:!1,value:2,label:"\uC74C\uC545",imgSrc:"assets/interest-icons/music.png"},{selected:!1,value:3,label:"\uC694\uB9AC",imgSrc:"assets/interest-icons/food.png"},{selected:!1,value:4,label:"\uB3C5\uC11C",imgSrc:"assets/interest-icons/book.png"}]}onClilckButton(n){this.onCategorySelectedEvent.emit(n)}};t.\u0275fac=function(i){return new(i||t)(ft(Ue))},t.\u0275cmp=vt({type:t,selectors:[["app-meeting-category"]],outputs:{onCategorySelectedEvent:"onCategorySelectedEvent"},standalone:!0,features:[Et],decls:4,vars:4,consts:[[1,"content-container"],["id","title"],[3,"onClickToggleButtonEvent","buttonElements","columnNum","align"]],template:function(i,s){i&1&&(I(0,"div",0)(1,"div",1),Xt(2),N(),I(3,"app-simple-toggle",2),xt("onClickToggleButtonEvent",function(a){return s.onClilckButton(a)}),N()()),i&2&&(P(2),Ne(" ","\uBAA8\uC784 \uCE74\uD14C\uACE0\uB9AC"," "),P(),V("buttonElements",s.buttonElementsService.interestSelectionButtons)("columnNum",1)("align","left"))},dependencies:[yi],styles:['#title[_ngcontent-%COMP%]{font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:18px;font-weight:600;margin-top:24px;margin-bottom:24px}.content-container[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;align-items:center;overflow-y:scroll}.content-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}']});let r=t;return r})();function X4(r,t){if(r&1){let e=qt();I(0,"div")(1,"app-meeting-category",4),xt("onCategorySelectedEvent",function(i){Mt(e);let s=at();return Dt(s.onClickButton(i))}),N()()}}var Hl=function(r){return r[r.MEETING_CATEGORY=0]="MEETING_CATEGORY",r[r.MEETING_JOIN_CANCEL=1]="MEETING_JOIN_CANCEL",r[r.MEETING_JOIN=2]="MEETING_JOIN",r[r.MEETING_EDIT_COMPLETE=3]="MEETING_EDIT_COMPLETE",r[r.MEETING_KICKOUT=4]="MEETING_KICKOUT",r[r.TICKET_MAKE_COMPLETE=5]="TICKET_MAKE_COMPLETE",r[r.TICKET_EDIT_COMPLETE=6]="TICKET_EDIT_COMPLETE",r[r.DIARY_MAKE_COMPLETE=7]="DIARY_MAKE_COMPLETE",r}(Hl||{}),r_=(()=>{let t=class t{constructor(){this.title="",this.buttonElements=[],this.content=Hl.MEETING_CATEGORY,this.onClickEvent=new jt,this.bottomNavigatorType=Hl}onClickButton(n){this.onClickEvent.emit({contentType:this.content,value:n})}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=vt({type:t,selectors:[["app-bottom-dialog"]],inputs:{title:"title",buttonElements:"buttonElements",content:"content"},outputs:{onClickEvent:"onClickEvent"},standalone:!0,features:[Et],decls:4,vars:1,consts:[[1,"container"],["id","bottom-container"],[1,"content-container"],[4,"ngIf"],[3,"onCategorySelectedEvent"]],template:function(i,s){i&1&&(I(0,"div",0)(1,"div",1)(2,"div",2),At(3,X4,2,0,"div",3),N()()()),i&2&&(P(3),V("ngIf",s.content===s.bottomNavigatorType.MEETING_CATEGORY))},dependencies:[he,i_],styles:['.container[_ngcontent-%COMP%]{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:#000c}#bottom-container[_ngcontent-%COMP%]{position:absolute;bottom:0;left:0;width:100%;height:420px;border-top-left-radius:40px;border-top-right-radius:40px;background-color:#fff;display:flex;flex-direction:column;align-items:center}#title[_ngcontent-%COMP%]{font-family:Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,sans-serif;font-size:18px;font-weight:600;margin-top:24px;margin-bottom:24px}.content-container[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;align-items:center;overflow-y:scroll}.content-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}']});let r=t;return r})();var Y4=["capacity"],q4=["fee"];function $4(r,t){if(r&1){let e=qt();I(0,"div")(1,"app-bottom-dialog",8),xt("onClickEvent",function(i){Mt(e);let s=at();return Dt(s.onCategorySelectedEvent(i))}),N()()}if(r&2){let e=at();P(),V("content",e.bottomNavigatorType.MEETING_CATEGORY)}}var s_=(()=>{let t=class t{constructor(n){this.buttonElementsService=n,this.capacity=null,this.fee=null,this.bottomNavigatorType=Hl,this.isPopUpBottomNavigator=!1,this.meetingInfo={title:"",description:"",category:"",capacity:0,location:"",meetingDate:"",payment:-1,meetingPictureUrls:[""],isSharable:!0},this.onCreateButtonReadyEvent=new jt}ngAfterViewChecked(){this.isAllTyped()&&this.onCreateButtonReadyEvent.emit(!0)}popUpBottomNavigator(){this.isPopUpBottomNavigator=!0}onCategorySelectedEvent(n){this.meetingInfo.category=this.buttonElementsService.getLabelByValue(this.buttonElementsService.interestSelectionButtons,n.value),this.isPopUpBottomNavigator=!1}onClickNoLimitCapacity(){this.capacity.innerText=1/0,this.meetingInfo.maxMember=1e5}onClickFree(){this.fee.innerText=0,this.meetingInfo.payment=0}onInput(n,i){this.meetingInfo[n]=i}isAllTyped(){return this.meetingInfo.title!==""&&this.meetingInfo.description!==""&&this.meetingInfo.category!==""&&this.meetingInfo.capacity!==0&&this.meetingInfo.location!==""&&this.meetingInfo.meetingDate!==""&&this.meetingInfo.payment!==-1}};t.\u0275fac=function(i){return new(i||t)(ft(Ue))},t.\u0275cmp=vt({type:t,selectors:[["app-create-meeting-info"]],viewQuery:function(i,s){if(i&1&&(te(Y4,7),te(q4,7)),i&2){let o;Kt(o=Jt())&&(s.capacity=o.first),Kt(o=Jt())&&(s.fee=o.first)}},inputs:{meetingInfo:"meetingInfo"},outputs:{onCreateButtonReadyEvent:"onCreateButtonReadyEvent"},standalone:!0,features:[Et],decls:11,vars:24,consts:[["capacity",""],["fee",""],["id","meeting-info-conatiner"],[3,"onClickEvent","label","placeholder","innerText"],[3,"onChangeEvent","label","placeholder"],[3,"onChangeEvent","type","label","placeholder"],[3,"onClickCheckboxEvent","onChangeEvent","type","checkBoxLabel","enableCheckbox","label","placeholder"],[4,"ngIf"],[3,"onClickEvent","content"]],template:function(i,s){if(i&1){let o=qt();I(0,"div",2)(1,"app-simple-input",3),xt("onClickEvent",function(){return Mt(o),Dt(s.popUpBottomNavigator())}),N(),I(2,"app-simple-input",4),xt("onChangeEvent",function(c){return Mt(o),Dt(s.onInput("title",c))}),N(),I(3,"app-simple-input",5),xt("onChangeEvent",function(c){return Mt(o),Dt(s.onInput("meetingDate",c))}),N(),I(4,"app-simple-input",4),xt("onChangeEvent",function(c){return Mt(o),Dt(s.onInput("location",c))}),N(),I(5,"app-simple-input",5),xt("onChangeEvent",function(c){return Mt(o),Dt(s.onInput("description",c))}),N(),I(6,"app-simple-input",6,0),xt("onClickCheckboxEvent",function(){return Mt(o),Dt(s.onClickNoLimitCapacity())})("onChangeEvent",function(c){return Mt(o),Dt(s.onInput("capacity",c))}),N(),I(8,"app-simple-input",6,1),xt("onClickCheckboxEvent",function(){return Mt(o),Dt(s.onClickFree())})("onChangeEvent",function(c){return Mt(o),Dt(s.onInput("payment",c))}),N()(),At(10,$4,2,1,"div",7)}i&2&&(P(),V("label","\uBAA8\uC784 \uCE74\uD14C\uACE0\uB9AC")("placeholder","\uBAA8\uC784 \uCE74\uD14C\uACE0\uB9AC\uB97C \uC124\uC815\uD574\uC8FC\uC138\uC694")("innerText",s.meetingInfo.category),P(),V("label","\uBAA8\uC784 \uC774\uB984")("placeholder","\uBAA8\uC784\uBA85\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694"),P(),V("type","datetime-local")("label","\uB0A0\uC9DC")("placeholder","\uBAA8\uC784\uC774 \uC9C4\uD589\uB420 \uB0A0\uC9DC\uB97C \uC120\uD0DD\uD574\uC8FC\uC138\uC694"),P(),V("label","\uC7A5\uC18C")("placeholder","\uBAA8\uC784\uC774 \uC9C4\uD589\uB420 \uC790\uC138\uD55C \uC7A5\uC18C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694"),P(),V("type","longText")("label","\uBAA8\uC784 \uC18C\uAC1C")("placeholder","\uC5B4\uB5A4 \uD65C\uB3D9\uC744 \uD558\uB294\uC9C0 \uBAA8\uC784\uC5D0 \uB300\uD574 \uC18C\uAC1C\uD574\uC8FC\uC138\uC694"),P(),V("type","number")("checkBoxLabel","\uC778\uC6D0 \uC81C\uD55C \uC5C6\uC74C")("enableCheckbox",!0)("label","\uCD5C\uB300 \uC778\uC6D0\uC218")("placeholder","\uC6D0\uD558\uB294 \uCD5C\uB300 \uC778\uC6D0 \uC218\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694"),P(2),V("type","number")("checkBoxLabel","\uBB34\uB8CC")("enableCheckbox",!0)("label","\uCC38\uAC00\uBE44")("placeholder","\uCC38\uAC00\uBE44\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694"),P(2),V("ngIf",s.isPopUpBottomNavigator))},dependencies:[he,qr,r_],styles:[".bottom-button[_ngcontent-%COMP%]{position:absolute;background-color:#fff;bottom:0;left:0;width:100%;height:80px;display:flex;justify-content:center;align-items:center}"]});let r=t;return r})();var o_=(()=>{let t=class t{constructor(n){this.buttonElementsService=n,this.onClickToggleButtonEvent=new jt}onClickToggleButton(){let n=this.buttonElementsService.createTicketTypeButtons.find(i=>i.selected===!0);console.log(n),n!==void 0?this.onClickToggleButtonEvent.emit(n.value):this.onClickToggleButtonEvent.emit(!1)}};t.\u0275fac=function(i){return new(i||t)(ft(Ue))},t.\u0275cmp=vt({type:t,selectors:[["app-create-ticket"]],outputs:{onClickToggleButtonEvent:"onClickToggleButtonEvent"},standalone:!0,features:[Et],decls:1,vars:3,consts:[[3,"onClickToggleButtonEvent","buttonElements","columnNum","multiSelection"]],template:function(i,s){i&1&&(I(0,"app-simple-toggle",0),xt("onClickToggleButtonEvent",function(){return s.onClickToggleButton()}),N()),i&2&&V("buttonElements",s.buttonElementsService.createTicketTypeButtons)("columnNum",1)("multiSelection",!1)},dependencies:[yi]});let r=t;return r})();var Z4=["createMeetingInfoComponent"];function K4(r,t){if(r&1){let e=qt();I(0,"div")(1,"app-create-meeting-info",7,0),xt("onCreateButtonReadyEvent",function(i){Mt(e);let s=at();return Dt(s.changeCreateTicketTypeButtonState(i))}),N()()}if(r&2){let e=at();P(),V("meetingInfo",e.meetingInfo)}}function J4(r,t){if(r&1){let e=qt();I(0,"div")(1,"app-create-ticket",8),xt("onClickToggleButtonEvent",function(i){Mt(e);let s=at();return Dt(s.changeCreateTicketButtonState(i))}),N()()}}var sc=function(r){return r[r.INFO=0]="INFO",r[r.TICKET=1]="TICKET",r}(sc||{}),j0=function(r){return r[r.EMPTY=0]="EMPTY",r[r.TEMPLATE=1]="TEMPLATE",r[r.AI=2]="AI",r}(j0||{}),a_=(()=>{let t=class t{constructor(n,i,s,o){this._apiExecutorService=n,this.buttonElementsService=i,this._location=s,this._router=o,this.createMeetingInfoComponent=null,this.createMeetingStep=sc,this.nowStep=sc.INFO,this.meetingInfo={title:"",description:"",category:"",capacity:0,location:"",meetingDate:"",payment:-1,meetingPictureUrls:[""],isSharable:!0},this.resultMeetingInfo={},this.createTicketMode=j0.EMPTY}onClickBackButton(){this.nowStep===sc.TICKET?this.nowStep=sc.INFO:(this.meetingInfo={title:"",description:"",category:"",capacity:0,location:"",meetingDate:"",payment:-1,meetingPictureUrls:[""],isSharable:!0},this._location.back())}changeCreateTicketTypeButtonState(n){this.buttonElementsService.nextButtons[0].selected=n}changeCreateTicketButtonState(n){n===0?this.createTicketMode=j0.EMPTY:n===1&&(this.createTicketMode=j0.TEMPLATE),this.buttonElementsService.createTicketButtons[0].selected=!0}onClickCreateTicketButton(){this._router.navigate(["/web/ticket"],{queryParams:{moimId:this.resultMeetingInfo.id,viewType:"edit",createTemplate:this.createTicketMode===0?"N":"A",face:"front"}})}onClickNextButton(){return dt(this,null,function*(){this.meetingInfo=this.createMeetingInfoComponent.meetingInfo,this.buttonElementsService.nextButtons[0].selected&&(this.resultMeetingInfo=yield this._apiExecutorService.createMeeting(this.meetingInfo),this.nowStep=sc.TICKET)})}};t.\u0275fac=function(i){return new(i||t)(ft(pe),ft(Ue),ft(Ei),ft(We))},t.\u0275cmp=vt({type:t,selectors:[["app-meeting-create"]],viewQuery:function(i,s){if(i&1&&te(Z4,5),i&2){let o;Kt(o=Jt())&&(s.createMeetingInfoComponent=o.first)}},standalone:!0,features:[Et],decls:7,vars:8,consts:[["createMeetingInfoComponent",""],[1,"container"],[3,"backButtonClickEvent","title","shareButton","defaultBack"],[1,"content-container"],[4,"ngIf"],[1,"bottom-button"],[3,"onClickEvent","buttonElements"],[3,"onCreateButtonReadyEvent","meetingInfo"],[3,"onClickToggleButtonEvent"]],template:function(i,s){i&1&&(I(0,"div",1)(1,"app-top-navigator",2),xt("backButtonClickEvent",function(){return s.onClickBackButton()}),N(),I(2,"div",3),At(3,K4,3,1,"div",4)(4,J4,2,0,"div",4),N(),I(5,"div",5)(6,"app-square-button",6),xt("onClickEvent",function(){return s.nowStep===s.createMeetingStep.INFO?s.onClickNextButton():s.onClickCreateTicketButton()}),N()()()),i&2&&(P(),Lt("width","100%"),V("title","\uBAA8\uC784\uB9CC\uB4E4\uAE30")("shareButton",!1)("defaultBack",!1),P(2),V("ngIf",s.nowStep===s.createMeetingStep.INFO),P(),V("ngIf",s.nowStep===s.createMeetingStep.TICKET),P(2),V("buttonElements",s.nowStep===s.createMeetingStep.INFO?s.buttonElementsService.nextButtons:s.buttonElementsService.createTicketButtons))},dependencies:[he,nc,sr,s_,o_],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;height:100%;width:100%}.content-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;height:calc(100% - 140px);width:100%;position:relative;overflow:scroll}.content-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}"],data:{animation:[]}});let r=t;return r})();var c_=[{path:"web/ssalon-login",component:e_},{path:"web/ssalon-login-redirect",component:n_},{path:"web/onboarding",component:l2},{path:"web/main",component:m2},{path:"web/meeting-info",component:t_},{path:"web/meeting-create",component:a_},{path:"web/ticket",component:ic},{path:"web/meeting-review-create",component:KE}];var Q4="@",t6=(()=>{let t=class t{constructor(n,i,s,o,a){this.doc=n,this.delegate=i,this.zone=s,this.animationType=o,this.moduleImpl=a,this._rendererFactoryPromise=null,this.scheduler=le(i1,{optional:!0})}ngOnDestroy(){this._engine?.flush()}loadImpl(){return(this.moduleImpl??import("./chunk-RQL6HNTA.js")).catch(i=>{throw new Ke(5300,!1)}).then(({\u0275createEngine:i,\u0275AnimationRendererFactory:s})=>{this._engine=i(this.animationType,this.doc,this.scheduler);let o=new s(this.delegate,this._engine,this.zone);return this.delegate=o,o})}createRenderer(n,i){let s=this.delegate.createRenderer(n,i);if(s.\u0275type===0)return s;typeof s.throwOnSyntheticProps=="boolean"&&(s.throwOnSyntheticProps=!1);let o=new ym(s);return i?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(a=>{let c=a.createRenderer(n,i);o.use(c)}).catch(a=>{o.use(s)}),o}begin(){this.delegate.begin?.()}end(){this.delegate.end?.()}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}};t.\u0275fac=function(i){ad()},t.\u0275prov=be({token:t,factory:t.\u0275fac});let r=t;return r})(),ym=class{constructor(t){this.delegate=t,this.replay=[],this.\u0275type=1}use(t){if(this.delegate=t,this.replay!==null){for(let e of this.replay)e(t);this.replay=null}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}get destroyNode(){return this.delegate.destroyNode}appendChild(t,e){this.delegate.appendChild(t,e)}insertBefore(t,e,n,i){this.delegate.insertBefore(t,e,n,i)}removeChild(t,e,n){this.delegate.removeChild(t,e,n)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,i){this.delegate.setAttribute(t,e,n,i)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,i){this.delegate.setStyle(t,e,n,i)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){this.shouldReplay(e)&&this.replay.push(i=>i.setProperty(t,e,n)),this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n){return this.shouldReplay(e)&&this.replay.push(i=>i.listen(t,e,n)),this.delegate.listen(t,e,n)}shouldReplay(t){return this.replay!==null&&t.startsWith(Q4)}};function l_(r="animations"){return r1("NgAsyncAnimations"),xc([{provide:$l,useFactory:(t,e,n)=>new t6(t,e,n,r),deps:[oi,th,Li]},{provide:qm,useValue:r==="noop"?"NoopAnimations":"BrowserAnimations"}])}var h_={providers:[ag(c_),l_()]};var u_=(()=>{let t=class t{constructor(n,i,s){this._route=n,this._ssalonConfigService=i,this._apiExecutorService=s}ngOnInit(){this._apiExecutorService.getMyProfile()}};t.\u0275fac=function(i){return new(i||t)(ft(Rn),ft(Jr),ft(pe))},t.\u0275cmp=vt({type:t,selectors:[["app-root"]],standalone:!0,features:[Et],decls:1,vars:0,consts:[["id","page-container"]],template:function(i,s){i&1&&Ct(0,"router-outlet",0)},dependencies:[sf,vc]});let r=t;return r})();S1(u_,h_).catch(r=>console.error(r));