live2d.js 193 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231
  1. !
  2. function(t) {
  3. function i(r) {
  4. if (e[r]) return e[r].exports;
  5. var o = e[r] = {
  6. i: r,
  7. l: !1,
  8. exports: {}
  9. };
  10. return t[r].call(o.exports, o, o.exports, i), o.l = !0, o.exports
  11. }
  12. var e = {};
  13. i.m = t, i.c = e, i.d = function(t, e, r) {
  14. i.o(t, e) || Object.defineProperty(t, e, {
  15. configurable: !1,
  16. enumerable: !0,
  17. get: r
  18. })
  19. }, i.n = function(t) {
  20. var e = t && t.__esModule ?
  21. function() {
  22. return t.
  23. default
  24. } : function() {
  25. return t
  26. };
  27. return i.d(e, "a", e), e
  28. }, i.o = function(t, i) {
  29. return Object.prototype.hasOwnProperty.call(t, i)
  30. }, i.p = "", i(i.s = 4)
  31. }([function(t, i, e) {
  32. "use strict";
  33. function r() {
  34. this.live2DModel = null, this.modelMatrix = null, this.eyeBlink = null, this.physics = null, this.pose = null, this.debugMode = !1, this.initialized = !1, this.updating = !1, this.alpha = 1, this.accAlpha = 0, this.lipSync = !1, this.lipSyncValue = 0, this.accelX = 0, this.accelY = 0, this.accelZ = 0, this.dragX = 0, this.dragY = 0, this.startTimeMSec = null, this.mainMotionManager = new h, this.expressionManager = new h, this.motions = {}, this.expressions = {}, this.isTexLoaded = !1
  35. }
  36. function o() {
  37. AMotion.prototype.constructor.call(this), this.paramList = new Array
  38. }
  39. function n() {
  40. this.id = "", this.type = -1, this.value = null
  41. }
  42. function s() {
  43. this.nextBlinkTime = null, this.stateStartTime = null, this.blinkIntervalMsec = null, this.eyeState = g.STATE_FIRST, this.blinkIntervalMsec = 4e3, this.closingMotionMsec = 100, this.closedMotionMsec = 50, this.openingMotionMsec = 150, this.closeIfZero = !0, this.eyeID_L = "PARAM_EYE_L_OPEN", this.eyeID_R = "PARAM_EYE_R_OPEN"
  44. }
  45. function _() {
  46. this.tr = new Float32Array(16), this.identity()
  47. }
  48. function a(t, i) {
  49. _.prototype.constructor.call(this), this.width = t, this.height = i
  50. }
  51. function h() {
  52. MotionQueueManager.prototype.constructor.call(this), this.currentPriority = null, this.reservePriority = null, this.super = MotionQueueManager.prototype
  53. }
  54. function l() {
  55. this.physicsList = new Array, this.startTimeMSec = UtSystem.getUserTimeMSec()
  56. }
  57. function $() {
  58. this.lastTime = 0, this.lastModel = null, this.partsGroups = new Array
  59. }
  60. function u(t) {
  61. this.paramIndex = -1, this.partsIndex = -1, this.link = null, this.id = t
  62. }
  63. function p() {
  64. this.EPSILON = .01, this.faceTargetX = 0, this.faceTargetY = 0, this.faceX = 0, this.faceY = 0, this.faceVX = 0, this.faceVY = 0, this.lastTimeSec = 0
  65. }
  66. function f() {
  67. _.prototype.constructor.call(this), this.screenLeft = null, this.screenRight = null, this.screenTop = null, this.screenBottom = null, this.maxLeft = null, this.maxRight = null, this.maxTop = null, this.maxBottom = null, this.max = Number.MAX_VALUE, this.min = 0
  68. }
  69. function c() {}
  70. var d = 0;
  71. r.prototype.getModelMatrix = function() {
  72. return this.modelMatrix
  73. }, r.prototype.setAlpha = function(t) {
  74. t > .999 && (t = 1), t < .001 && (t = 0), this.alpha = t
  75. }, r.prototype.getAlpha = function() {
  76. return this.alpha
  77. }, r.prototype.isInitialized = function() {
  78. return this.initialized
  79. }, r.prototype.setInitialized = function(t) {
  80. this.initialized = t
  81. }, r.prototype.isUpdating = function() {
  82. return this.updating
  83. }, r.prototype.setUpdating = function(t) {
  84. this.updating = t
  85. }, r.prototype.getLive2DModel = function() {
  86. return this.live2DModel
  87. }, r.prototype.setLipSync = function(t) {
  88. this.lipSync = t
  89. }, r.prototype.setLipSyncValue = function(t) {
  90. this.lipSyncValue = t
  91. }, r.prototype.setAccel = function(t, i, e) {
  92. this.accelX = t, this.accelY = i, this.accelZ = e
  93. }, r.prototype.setDrag = function(t, i) {
  94. this.dragX = t, this.dragY = i
  95. }, r.prototype.getMainMotionManager = function() {
  96. return this.mainMotionManager
  97. }, r.prototype.getExpressionManager = function() {
  98. return this.expressionManager
  99. }, r.prototype.loadModelData = function(t, i) {
  100. var e = c.getPlatformManager();
  101. this.debugMode && e.log("Load model : " + t);
  102. var r = this;
  103. e.loadLive2DModel(t, function(t) {
  104. if (r.live2DModel = t, r.live2DModel.saveParam(), 0 != Live2D.getError()) return void console.error("Error : Failed to loadModelData().");
  105. r.modelMatrix = new a(r.live2DModel.getCanvasWidth(), r.live2DModel.getCanvasHeight()), r.modelMatrix.setWidth(2), r.modelMatrix.setCenterPosition(0, 0), i(r.live2DModel)
  106. })
  107. }, r.prototype.loadTexture = function(t, i, e) {
  108. d++;
  109. var r = c.getPlatformManager();
  110. this.debugMode && r.log("Load Texture : " + i);
  111. var o = this;
  112. r.loadTexture(this.live2DModel, t, i, function() {
  113. d--, 0 == d && (o.isTexLoaded = !0), "function" == typeof e && e()
  114. })
  115. }, r.prototype.loadMotion = function(t, i, e) {
  116. var r = c.getPlatformManager();
  117. this.debugMode && r.log("Load Motion : " + i);
  118. var o = null,
  119. n = this;
  120. r.loadBytes(i, function(i) {
  121. o = Live2DMotion.loadMotion(i), null != t && (n.motions[t] = o), e(o)
  122. })
  123. }, r.prototype.loadExpression = function(t, i, e) {
  124. var r = c.getPlatformManager();
  125. this.debugMode && r.log("Load Expression : " + i);
  126. var n = this;
  127. r.loadBytes(i, function(i) {
  128. null != t && (n.expressions[t] = o.loadJson(i)), "function" == typeof e && e()
  129. })
  130. }, r.prototype.loadPose = function(t, i) {
  131. var e = c.getPlatformManager();
  132. this.debugMode && e.log("Load Pose : " + t);
  133. var r = this;
  134. try {
  135. e.loadBytes(t, function(t) {
  136. r.pose = $.load(t), "function" == typeof i && i()
  137. })
  138. } catch (t) {
  139. console.warn(t)
  140. }
  141. }, r.prototype.loadPhysics = function(t) {
  142. var i = c.getPlatformManager();
  143. this.debugMode && i.log("Load Physics : " + t);
  144. var e = this;
  145. try {
  146. i.loadBytes(t, function(t) {
  147. e.physics = l.load(t)
  148. })
  149. } catch (t) {
  150. console.warn(t)
  151. }
  152. }, r.prototype.hitTestSimple = function(t, i, e) {
  153. if (null === this.live2DModel) return !1;
  154. var r = this.live2DModel.getDrawDataIndex(t);
  155. if (r < 0) return !1;
  156. for (var o = this.live2DModel.getTransformedPoints(r), n = this.live2DModel.getCanvasWidth(), s = 0, _ = this.live2DModel.getCanvasHeight(), a = 0, h = 0; h < o.length; h += 2) {
  157. var l = o[h],
  158. $ = o[h + 1];
  159. l < n && (n = l), l > s && (s = l), $ < _ && (_ = $), $ > a && (a = $)
  160. }
  161. var u = this.modelMatrix.invertTransformX(i),
  162. p = this.modelMatrix.invertTransformY(e);
  163. return n <= u && u <= s && _ <= p && p <= a
  164. }, r.prototype.hitTestSimpleCustom = function(t, i, e, r) {
  165. return null !== this.live2DModel && (e >= t[0] && e <= i[0] && r <= t[1] && r >= i[1])
  166. }, o.prototype = new AMotion, o.EXPRESSION_DEFAULT = "DEFAULT", o.TYPE_SET = 0, o.TYPE_ADD = 1, o.TYPE_MULT = 2, o.loadJson = function(t) {
  167. var i = new o,
  168. e = c.getPlatformManager(),
  169. r = e.jsonParseFromBytes(t);
  170. if (i.setFadeIn(parseInt(r.fade_in) > 0 ? parseInt(r.fade_in) : 1e3), i.setFadeOut(parseInt(r.fade_out) > 0 ? parseInt(r.fade_out) : 1e3), null == r.params) return i;
  171. var s = r.params,
  172. _ = s.length;
  173. i.paramList = [];
  174. for (var a = 0; a < _; a++) {
  175. var h = s[a],
  176. l = h.id.toString(),
  177. $ = parseFloat(h.val),
  178. u = o.TYPE_ADD,
  179. p = null != h.calc ? h.calc.toString() : "add";
  180. if ((u = "add" === p ? o.TYPE_ADD : "mult" === p ? o.TYPE_MULT : "set" === p ? o.TYPE_SET : o.TYPE_ADD) == o.TYPE_ADD) {
  181. var f = null == h.def ? 0 : parseFloat(h.def);
  182. $ -= f
  183. } else if (u == o.TYPE_MULT) {
  184. var f = null == h.def ? 1 : parseFloat(h.def);
  185. 0 == f && (f = 1), $ /= f
  186. }
  187. var d = new n;
  188. d.id = l, d.type = u, d.value = $, i.paramList.push(d)
  189. }
  190. return i
  191. }, o.prototype.updateParamExe = function(t, i, e, r) {
  192. for (var n = this.paramList.length - 1; n >= 0; --n) {
  193. var s = this.paramList[n];
  194. s.type == o.TYPE_ADD ? t.addToParamFloat(s.id, s.value, e) : s.type == o.TYPE_MULT ? t.multParamFloat(s.id, s.value, e) : s.type == o.TYPE_SET && t.setParamFloat(s.id, s.value, e)
  195. }
  196. }, s.prototype.calcNextBlink = function() {
  197. return UtSystem.getUserTimeMSec() + Math.random() * (2 * this.blinkIntervalMsec - 1)
  198. }, s.prototype.setInterval = function(t) {
  199. this.blinkIntervalMsec = t
  200. }, s.prototype.setEyeMotion = function(t, i, e) {
  201. this.closingMotionMsec = t, this.closedMotionMsec = i, this.openingMotionMsec = e
  202. }, s.prototype.updateParam = function(t) {
  203. var i, e = UtSystem.getUserTimeMSec(),
  204. r = 0;
  205. switch (this.eyeState) {
  206. case g.STATE_CLOSING:
  207. r = (e - this.stateStartTime) / this.closingMotionMsec, r >= 1 && (r = 1, this.eyeState = g.STATE_CLOSED, this.stateStartTime = e), i = 1 - r;
  208. break;
  209. case g.STATE_CLOSED:
  210. r = (e - this.stateStartTime) / this.closedMotionMsec, r >= 1 && (this.eyeState = g.STATE_OPENING, this.stateStartTime = e), i = 0;
  211. break;
  212. case g.STATE_OPENING:
  213. r = (e - this.stateStartTime) / this.openingMotionMsec, r >= 1 && (r = 1, this.eyeState = g.STATE_INTERVAL, this.nextBlinkTime = this.calcNextBlink()), i = r;
  214. break;
  215. case g.STATE_INTERVAL:
  216. this.nextBlinkTime < e && (this.eyeState = g.STATE_CLOSING, this.stateStartTime = e), i = 1;
  217. break;
  218. case g.STATE_FIRST:
  219. default:
  220. this.eyeState = g.STATE_INTERVAL, this.nextBlinkTime = this.calcNextBlink(), i = 1
  221. }
  222. this.closeIfZero || (i = -i), t.setParamFloat(this.eyeID_L, i), t.setParamFloat(this.eyeID_R, i)
  223. };
  224. var g = function() {};
  225. g.STATE_FIRST = "STATE_FIRST", g.STATE_INTERVAL = "STATE_INTERVAL", g.STATE_CLOSING = "STATE_CLOSING", g.STATE_CLOSED = "STATE_CLOSED", g.STATE_OPENING = "STATE_OPENING", _.mul = function(t, i, e) {
  226. var r, o, n, s = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  227. for (r = 0; r < 4; r++) for (o = 0; o < 4; o++) for (n = 0; n < 4; n++) s[r + 4 * o] += t[r + 4 * n] * i[n + 4 * o];
  228. for (r = 0; r < 16; r++) e[r] = s[r]
  229. }, _.prototype.identity = function() {
  230. for (var t = 0; t < 16; t++) this.tr[t] = t % 5 == 0 ? 1 : 0
  231. }, _.prototype.getArray = function() {
  232. return this.tr
  233. }, _.prototype.getCopyMatrix = function() {
  234. return new Float32Array(this.tr)
  235. }, _.prototype.setMatrix = function(t) {
  236. if (null != this.tr && this.tr.length == this.tr.length) for (var i = 0; i < 16; i++) this.tr[i] = t[i]
  237. }, _.prototype.getScaleX = function() {
  238. return this.tr[0]
  239. }, _.prototype.getScaleY = function() {
  240. return this.tr[5]
  241. }, _.prototype.transformX = function(t) {
  242. return this.tr[0] * t + this.tr[12]
  243. }, _.prototype.transformY = function(t) {
  244. return this.tr[5] * t + this.tr[13]
  245. }, _.prototype.invertTransformX = function(t) {
  246. return (t - this.tr[12]) / this.tr[0]
  247. }, _.prototype.invertTransformY = function(t) {
  248. return (t - this.tr[13]) / this.tr[5]
  249. }, _.prototype.multTranslate = function(t, i) {
  250. var e = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t, i, 0, 1];
  251. _.mul(e, this.tr, this.tr)
  252. }, _.prototype.translate = function(t, i) {
  253. this.tr[12] = t, this.tr[13] = i
  254. }, _.prototype.translateX = function(t) {
  255. this.tr[12] = t
  256. }, _.prototype.translateY = function(t) {
  257. this.tr[13] = t
  258. }, _.prototype.multScale = function(t, i) {
  259. var e = [t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
  260. _.mul(e, this.tr, this.tr)
  261. }, _.prototype.scale = function(t, i) {
  262. this.tr[0] = t, this.tr[5] = i
  263. }, a.prototype = new _, a.prototype.setPosition = function(t, i) {
  264. this.translate(t, i)
  265. }, a.prototype.setCenterPosition = function(t, i) {
  266. var e = this.width * this.getScaleX(),
  267. r = this.height * this.getScaleY();
  268. this.translate(t - e / 2, i - r / 2)
  269. }, a.prototype.top = function(t) {
  270. this.setY(t)
  271. }, a.prototype.bottom = function(t) {
  272. var i = this.height * this.getScaleY();
  273. this.translateY(t - i)
  274. }, a.prototype.left = function(t) {
  275. this.setX(t)
  276. }, a.prototype.right = function(t) {
  277. var i = this.width * this.getScaleX();
  278. this.translateX(t - i)
  279. }, a.prototype.centerX = function(t) {
  280. var i = this.width * this.getScaleX();
  281. this.translateX(t - i / 2)
  282. }, a.prototype.centerY = function(t) {
  283. var i = this.height * this.getScaleY();
  284. this.translateY(t - i / 2)
  285. }, a.prototype.setX = function(t) {
  286. this.translateX(t)
  287. }, a.prototype.setY = function(t) {
  288. this.translateY(t)
  289. }, a.prototype.setHeight = function(t) {
  290. var i = t / this.height,
  291. e = -i;
  292. this.scale(i, e)
  293. }, a.prototype.setWidth = function(t) {
  294. var i = t / this.width,
  295. e = -i;
  296. this.scale(i, e)
  297. }, h.prototype = new MotionQueueManager, h.prototype.getCurrentPriority = function() {
  298. return this.currentPriority
  299. }, h.prototype.getReservePriority = function() {
  300. return this.reservePriority
  301. }, h.prototype.reserveMotion = function(t) {
  302. return !(this.reservePriority >= t) && (!(this.currentPriority >= t) && (this.reservePriority = t, !0))
  303. }, h.prototype.setReservePriority = function(t) {
  304. this.reservePriority = t
  305. }, h.prototype.updateParam = function(t) {
  306. var i = MotionQueueManager.prototype.updateParam.call(this, t);
  307. return this.isFinished() && (this.currentPriority = 0), i
  308. }, h.prototype.startMotionPrio = function(t, i) {
  309. return i == this.reservePriority && (this.reservePriority = 0), this.currentPriority = i, this.startMotion(t, !1)
  310. }, l.load = function(t) {
  311. for (var i = new l, e = c.getPlatformManager(), r = e.jsonParseFromBytes(t), o = r.physics_hair, n = o.length, s = 0; s < n; s++) {
  312. var _ = o[s],
  313. a = new PhysicsHair,
  314. h = _.setup,
  315. $ = parseFloat(h.length),
  316. u = parseFloat(h.regist),
  317. p = parseFloat(h.mass);
  318. a.setup($, u, p);
  319. for (var f = _.src, d = f.length, g = 0; g < d; g++) {
  320. var y = f[g],
  321. m = y.id,
  322. T = PhysicsHair.Src.SRC_TO_X,
  323. P = y.ptype;
  324. "x" === P ? T = PhysicsHair.Src.SRC_TO_X : "y" === P ? T = PhysicsHair.Src.SRC_TO_Y : "angle" === P ? T = PhysicsHair.Src.SRC_TO_G_ANGLE : UtDebug.error("live2d", "Invalid parameter:PhysicsHair.Src");
  325. var S = parseFloat(y.scale),
  326. v = parseFloat(y.weight);
  327. a.addSrcParam(T, m, S, v)
  328. }
  329. for (var L = _.targets, M = L.length, g = 0; g < M; g++) {
  330. var E = L[g],
  331. m = E.id,
  332. T = PhysicsHair.Target.TARGET_FROM_ANGLE,
  333. P = E.ptype;
  334. "angle" === P ? T = PhysicsHair.Target.TARGET_FROM_ANGLE : "angle_v" === P ? T = PhysicsHair.Target.TARGET_FROM_ANGLE_V : UtDebug.error("live2d", "Invalid parameter:PhysicsHair.Target");
  335. var S = parseFloat(E.scale),
  336. v = parseFloat(E.weight);
  337. a.addTargetParam(T, m, S, v)
  338. }
  339. i.physicsList.push(a)
  340. }
  341. return i
  342. }, l.prototype.updateParam = function(t) {
  343. for (var i = UtSystem.getUserTimeMSec() - this.startTimeMSec, e = 0; e < this.physicsList.length; e++) this.physicsList[e].update(t, i)
  344. }, $.load = function(t) {
  345. for (var i = new $, e = c.getPlatformManager(), r = e.jsonParseFromBytes(t), o = r.parts_visible, n = o.length, s = 0; s < n; s++) {
  346. for (var _ = o[s], a = _.group, h = a.length, l = new Array, p = 0; p < h; p++) {
  347. var f = a[p],
  348. d = new u(f.id);
  349. if (l[p] = d, null != f.link) {
  350. var g = f.link,
  351. y = g.length;
  352. d.link = new Array;
  353. for (var m = 0; m < y; m++) {
  354. var T = new u(g[m]);
  355. d.link.push(T)
  356. }
  357. }
  358. }
  359. i.partsGroups.push(l)
  360. }
  361. return i
  362. }, $.prototype.updateParam = function(t) {
  363. if (null != t) {
  364. t != this.lastModel && this.initParam(t), this.lastModel = t;
  365. var i = UtSystem.getUserTimeMSec(),
  366. e = 0 == this.lastTime ? 0 : (i - this.lastTime) / 1e3;
  367. this.lastTime = i, e < 0 && (e = 0);
  368. for (var r = 0; r < this.partsGroups.length; r++) this.normalizePartsOpacityGroup(t, this.partsGroups[r], e), this.copyOpacityOtherParts(t, this.partsGroups[r])
  369. }
  370. }, $.prototype.initParam = function(t) {
  371. if (null != t) for (var i = 0; i < this.partsGroups.length; i++) for (var e = this.partsGroups[i], r = 0; r < e.length; r++) {
  372. e[r].initIndex(t);
  373. var o = e[r].partsIndex,
  374. n = e[r].paramIndex;
  375. if (!(o < 0)) {
  376. var s = 0 != t.getParamFloat(n);
  377. if (t.setPartsOpacity(o, s ? 1 : 0), t.setParamFloat(n, s ? 1 : 0), null != e[r].link) for (var _ = 0; _ < e[r].link.length; _++) e[r].link[_].initIndex(t)
  378. }
  379. }
  380. }, $.prototype.normalizePartsOpacityGroup = function(t, i, e) {
  381. for (var r = -1, o = 1, n = 0; n < i.length; n++) {
  382. var s = i[n].partsIndex,
  383. _ = i[n].paramIndex;
  384. if (!(s < 0) && 0 != t.getParamFloat(_)) {
  385. if (r >= 0) break;
  386. r = n, o = t.getPartsOpacity(s), o += e / .5, o > 1 && (o = 1)
  387. }
  388. }
  389. r < 0 && (r = 0, o = 1);
  390. for (var n = 0; n < i.length; n++) {
  391. var s = i[n].partsIndex;
  392. if (!(s < 0)) if (r == n) t.setPartsOpacity(s, o);
  393. else {
  394. var a, h = t.getPartsOpacity(s);
  395. a = o < .5 ? -.5 * o / .5 + 1 : .5 * (1 - o) / .5;
  396. var l = (1 - a) * (1 - o);
  397. l > .15 && (a = 1 - .15 / (1 - o)), h > a && (h = a), t.setPartsOpacity(s, h)
  398. }
  399. }
  400. }, $.prototype.copyOpacityOtherParts = function(t, i) {
  401. for (var e = 0; e < i.length; e++) {
  402. var r = i[e];
  403. if (null != r.link && !(r.partsIndex < 0)) for (var o = t.getPartsOpacity(r.partsIndex), n = 0; n < r.link.length; n++) {
  404. var s = r.link[n];
  405. s.partsIndex < 0 || t.setPartsOpacity(s.partsIndex, o)
  406. }
  407. }
  408. }, u.prototype.initIndex = function(t) {
  409. this.paramIndex = t.getParamIndex("VISIBLE:" + this.id), this.partsIndex = t.getPartsDataIndex(PartsDataID.getID(this.id)), t.setParamFloat(this.paramIndex, 1)
  410. }, p.FRAME_RATE = 30, p.prototype.setPoint = function(t, i) {
  411. this.faceTargetX = t, this.faceTargetY = i
  412. }, p.prototype.getX = function() {
  413. return this.faceX
  414. }, p.prototype.getY = function() {
  415. return this.faceY
  416. }, p.prototype.update = function() {
  417. var t = 40 / 7.5 / p.FRAME_RATE;
  418. if (0 == this.lastTimeSec) return void(this.lastTimeSec = UtSystem.getUserTimeMSec());
  419. var i = UtSystem.getUserTimeMSec(),
  420. e = (i - this.lastTimeSec) * p.FRAME_RATE / 1e3;
  421. this.lastTimeSec = i;
  422. var r = .15 * p.FRAME_RATE,
  423. o = e * t / r,
  424. n = this.faceTargetX - this.faceX,
  425. s = this.faceTargetY - this.faceY;
  426. if (!(Math.abs(n) <= this.EPSILON && Math.abs(s) <= this.EPSILON)) {
  427. var _ = Math.sqrt(n * n + s * s),
  428. a = t * n / _,
  429. h = t * s / _,
  430. l = a - this.faceVX,
  431. $ = h - this.faceVY,
  432. u = Math.sqrt(l * l + $ * $);
  433. (u < -o || u > o) && (l *= o / u, $ *= o / u, u = o), this.faceVX += l, this.faceVY += $;
  434. var f = .5 * (Math.sqrt(o * o + 16 * o * _ - 8 * o * _) - o),
  435. c = Math.sqrt(this.faceVX * this.faceVX + this.faceVY * this.faceVY);
  436. c > f && (this.faceVX *= f / c, this.faceVY *= f / c), this.faceX += this.faceVX, this.faceY += this.faceVY
  437. }
  438. }, f.prototype = new _, f.prototype.getMaxScale = function() {
  439. return this.max
  440. }, f.prototype.getMinScale = function() {
  441. return this.min
  442. }, f.prototype.setMaxScale = function(t) {
  443. this.max = t
  444. }, f.prototype.setMinScale = function(t) {
  445. this.min = t
  446. }, f.prototype.isMaxScale = function() {
  447. return this.getScaleX() == this.max
  448. }, f.prototype.isMinScale = function() {
  449. return this.getScaleX() == this.min
  450. }, f.prototype.adjustTranslate = function(t, i) {
  451. this.tr[0] * this.maxLeft + (this.tr[12] + t) > this.screenLeft && (t = this.screenLeft - this.tr[0] * this.maxLeft - this.tr[12]), this.tr[0] * this.maxRight + (this.tr[12] + t) < this.screenRight && (t = this.screenRight - this.tr[0] * this.maxRight - this.tr[12]), this.tr[5] * this.maxTop + (this.tr[13] + i) < this.screenTop && (i = this.screenTop - this.tr[5] * this.maxTop - this.tr[13]), this.tr[5] * this.maxBottom + (this.tr[13] + i) > this.screenBottom && (i = this.screenBottom - this.tr[5] * this.maxBottom - this.tr[13]);
  452. var e = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t, i, 0, 1];
  453. _.mul(e, this.tr, this.tr)
  454. }, f.prototype.adjustScale = function(t, i, e) {
  455. var r = e * this.tr[0];
  456. r < this.min ? this.tr[0] > 0 && (e = this.min / this.tr[0]) : r > this.max && this.tr[0] > 0 && (e = this.max / this.tr[0]);
  457. var o = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t, i, 0, 1],
  458. n = [e, 0, 0, 0, 0, e, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
  459. s = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -t, -i, 0, 1];
  460. _.mul(s, this.tr, this.tr), _.mul(n, this.tr, this.tr), _.mul(o, this.tr, this.tr)
  461. }, f.prototype.setScreenRect = function(t, i, e, r) {
  462. this.screenLeft = t, this.screenRight = i, this.screenTop = r, this.screenBottom = e
  463. }, f.prototype.setMaxScreenRect = function(t, i, e, r) {
  464. this.maxLeft = t, this.maxRight = i, this.maxTop = r, this.maxBottom = e
  465. }, f.prototype.getScreenLeft = function() {
  466. return this.screenLeft
  467. }, f.prototype.getScreenRight = function() {
  468. return this.screenRight
  469. }, f.prototype.getScreenBottom = function() {
  470. return this.screenBottom
  471. }, f.prototype.getScreenTop = function() {
  472. return this.screenTop
  473. }, f.prototype.getMaxLeft = function() {
  474. return this.maxLeft
  475. }, f.prototype.getMaxRight = function() {
  476. return this.maxRight
  477. }, f.prototype.getMaxBottom = function() {
  478. return this.maxBottom
  479. }, f.prototype.getMaxTop = function() {
  480. return this.maxTop
  481. }, c.platformManager = null, c.getPlatformManager = function() {
  482. return c.platformManager
  483. }, c.setPlatformManager = function(t) {
  484. c.platformManager = t
  485. }, t.exports = {
  486. L2DTargetPoint: p,
  487. Live2DFramework: c,
  488. L2DViewMatrix: f,
  489. L2DPose: $,
  490. L2DPartsParam: u,
  491. L2DPhysics: l,
  492. L2DMotionManager: h,
  493. L2DModelMatrix: a,
  494. L2DMatrix44: _,
  495. EYE_STATE: g,
  496. L2DEyeBlink: s,
  497. L2DExpressionParam: n,
  498. L2DExpressionMotion: o,
  499. L2DBaseModel: r
  500. }
  501. }, function(t, i, e) {
  502. "use strict";
  503. var r = {
  504. DEBUG_LOG: !1,
  505. DEBUG_MOUSE_LOG: !1,
  506. DEBUG_DRAW_HIT_AREA: !1,
  507. DEBUG_DRAW_ALPHA_MODEL: !1,
  508. VIEW_MAX_SCALE: 2,
  509. VIEW_MIN_SCALE: .8,
  510. VIEW_LOGICAL_LEFT: -1,
  511. VIEW_LOGICAL_RIGHT: 1,
  512. VIEW_LOGICAL_MAX_LEFT: -2,
  513. VIEW_LOGICAL_MAX_RIGHT: 2,
  514. VIEW_LOGICAL_MAX_BOTTOM: -2,
  515. VIEW_LOGICAL_MAX_TOP: 2,
  516. PRIORITY_NONE: 0,
  517. PRIORITY_IDLE: 1,
  518. PRIORITY_SLEEPY: 2,
  519. PRIORITY_NORMAL: 3,
  520. PRIORITY_FORCE: 4,
  521. MOTION_GROUP_IDLE: "idle",
  522. MOTION_GROUP_SLEEPY: "sleepy",
  523. MOTION_GROUP_TAP_BODY: "tap_body",
  524. MOTION_GROUP_FLICK_HEAD: "flick_head",
  525. MOTION_GROUP_PINCH_IN: "pinch_in",
  526. MOTION_GROUP_PINCH_OUT: "pinch_out",
  527. MOTION_GROUP_SHAKE: "shake",
  528. HIT_AREA_HEAD: "head",
  529. HIT_AREA_BODY: "body"
  530. };
  531. t.exports = r
  532. }, function(t, i, e) {
  533. "use strict";
  534. function r(t) {
  535. n = t
  536. }
  537. function o() {
  538. return n
  539. }
  540. Object.defineProperty(i, "__esModule", {
  541. value: !0
  542. }), i.setContext = r, i.getContext = o;
  543. var n = void 0
  544. }, function(t, i, e) {
  545. "use strict";
  546. function r() {}
  547. r.matrixStack = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], r.depth = 0, r.currentMatrix = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], r.tmp = new Array(16), r.reset = function() {
  548. this.depth = 0
  549. }, r.loadIdentity = function() {
  550. for (var t = 0; t < 16; t++) this.currentMatrix[t] = t % 5 == 0 ? 1 : 0
  551. }, r.push = function() {
  552. var t = (this.depth, 16 * (this.depth + 1));
  553. this.matrixStack.length < t + 16 && (this.matrixStack.length = t + 16);
  554. for (var i = 0; i < 16; i++) this.matrixStack[t + i] = this.currentMatrix[i];
  555. this.depth++
  556. }, r.pop = function() {
  557. --this.depth < 0 && (myError("Invalid matrix stack."), this.depth = 0);
  558. for (var t = 16 * this.depth, i = 0; i < 16; i++) this.currentMatrix[i] = this.matrixStack[t + i]
  559. }, r.getMatrix = function() {
  560. return this.currentMatrix
  561. }, r.multMatrix = function(t) {
  562. var i, e, r;
  563. for (i = 0; i < 16; i++) this.tmp[i] = 0;
  564. for (i = 0; i < 4; i++) for (e = 0; e < 4; e++) for (r = 0; r < 4; r++) this.tmp[i + 4 * e] += this.currentMatrix[i + 4 * r] * t[r + 4 * e];
  565. for (i = 0; i < 16; i++) this.currentMatrix[i] = this.tmp[i]
  566. }, t.exports = r
  567. }, function(t, i, e) {
  568. t.exports = e(5)
  569. }, function(t, i, e) {
  570. "use strict";
  571. function r(t) {
  572. return t && t.__esModule ? t : {
  573. default:
  574. t
  575. }
  576. }
  577. function o(t) {
  578. C = document.getElementById(t), C.addEventListener && (window.addEventListener("click", g), window.addEventListener("mousedown", g), window.addEventListener("mousemove", g), window.addEventListener("mouseup", g), document.addEventListener("mouseout", g), window.addEventListener("touchstart", y), window.addEventListener("touchend", y), window.addEventListener("touchmove", y))
  579. }
  580. function n(t) {
  581. var i = C.width,
  582. e = C.height;
  583. N = new M.L2DTargetPoint;
  584. var r = e / i,
  585. o = w.
  586. default.VIEW_LOGICAL_LEFT,
  587. n = w.
  588. default.VIEW_LOGICAL_RIGHT,
  589. _ = -r,
  590. h = r;
  591. if (window.Live2D.captureFrame = !1, B = new M.L2DViewMatrix, B.setScreenRect(o, n, _, h), B.setMaxScreenRect(w.
  592. default.VIEW_LOGICAL_MAX_LEFT, w.
  593. default.VIEW_LOGICAL_MAX_RIGHT, w.
  594. default.VIEW_LOGICAL_MAX_BOTTOM, w.
  595. default.VIEW_LOGICAL_MAX_TOP), B.setMaxScale(w.
  596. default.VIEW_MAX_SCALE), B.setMinScale(w.
  597. default.VIEW_MIN_SCALE), U = new M.L2DMatrix44, U.multScale(1, i / e), G = new M.L2DMatrix44, G.multTranslate(-i / 2, -e / 2), G.multScale(2 / i, -2 / i), F = v(), (0, D.setContext)(F), !F) return console.error("Failed to create WebGL context."), void(window.WebGLRenderingContext && console.error("Your browser don't support WebGL, check https://get.webgl.org/ for futher information."));
  598. window.Live2D.setGL(F), F.clearColor(0, 0, 0, 0), a(t), s()
  599. }
  600. function s() {
  601. b || (b = !0, function t() {
  602. _();
  603. var i = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
  604. if (window.Live2D.captureFrame) {
  605. window.Live2D.captureFrame = !1;
  606. var e = document.createElement("a");
  607. document.body.appendChild(e), e.setAttribute("type", "hidden"), e.href = C.toDataURL(), e.download = window.Live2D.captureName || "live2d.png", e.click()
  608. }
  609. i(t, C)
  610. }())
  611. }
  612. function _() {
  613. O.
  614. default.reset(), O.
  615. default.loadIdentity(), N.update(), R.setDrag(N.getX(), N.getY()), F.clear(F.COLOR_BUFFER_BIT), O.
  616. default.multMatrix(U.getArray()), O.
  617. default.multMatrix(B.getArray()), O.
  618. default.push();
  619. for (var t = 0; t < R.numModels(); t++) {
  620. var i = R.getModel(t);
  621. if (null == i) return;
  622. i.initialized && !i.updating && (i.update(), i.draw(F))
  623. }
  624. O.
  625. default.pop()
  626. }
  627. function a(t) {
  628. R.reloadFlg = !0, R.count++, R.changeModel(F, t)
  629. }
  630. function h(t, i) {
  631. return t.x * i.x + t.y * i.y
  632. }
  633. function l(t, i) {
  634. var e = Math.sqrt(t * t + i * i);
  635. return {
  636. x: t / e,
  637. y: i / e
  638. }
  639. }
  640. function $(t, i, e) {
  641. function r(t, i) {
  642. return 180 * Math.acos(h({
  643. x: 0,
  644. y: 1
  645. }, l(t, i))) / Math.PI
  646. }
  647. if (i.x < e.left + e.width && i.y < e.top + e.height && i.x > e.left && i.y > e.top) return i;
  648. var o = t.x - i.x,
  649. n = t.y - i.y,
  650. s = r(o, n);
  651. i.x < t.x && (s = 360 - s);
  652. var _ = 360 - r(e.left - t.x, -1 * (e.top - t.y)),
  653. a = 360 - r(e.left - t.x, -1 * (e.top + e.height - t.y)),
  654. $ = r(e.left + e.width - t.x, -1 * (e.top - t.y)),
  655. u = r(e.left + e.width - t.x, -1 * (e.top + e.height - t.y)),
  656. p = n / o,
  657. f = {};
  658. if (s < $) {
  659. var c = e.top - t.y,
  660. d = c / p;
  661. f = {
  662. y: t.y + c,
  663. x: t.x + d
  664. }
  665. } else if (s < u) {
  666. var g = e.left + e.width - t.x,
  667. y = g * p;
  668. f = {
  669. y: t.y + y,
  670. x: t.x + g
  671. }
  672. } else if (s < a) {
  673. var m = e.top + e.height - t.y,
  674. T = m / p;
  675. f = {
  676. y: t.y + m,
  677. x: t.x + T
  678. }
  679. } else if (s < _) {
  680. var P = t.x - e.left,
  681. S = P * p;
  682. f = {
  683. y: t.y - S,
  684. x: t.x - P
  685. }
  686. } else {
  687. var v = e.top - t.y,
  688. L = v / p;
  689. f = {
  690. y: t.y + v,
  691. x: t.x + L
  692. }
  693. }
  694. return f
  695. }
  696. function u(t) {
  697. Y = !0;
  698. var i = C.getBoundingClientRect(),
  699. e = P(t.clientX - i.left),
  700. r = S(t.clientY - i.top),
  701. o = $({
  702. x: i.left + i.width / 2,
  703. y: i.top + i.height * X
  704. }, {
  705. x: t.clientX,
  706. y: t.clientY
  707. }, i),
  708. n = m(o.x - i.left),
  709. s = T(o.y - i.top);
  710. w.
  711. default.DEBUG_MOUSE_LOG && console.log("onMouseMove device( x:" + t.clientX + " y:" + t.clientY + " ) view( x:" + n + " y:" + s + ")"), k = e, V = r, N.setPoint(n, s)
  712. }
  713. function p(t) {
  714. Y = !0;
  715. var i = C.getBoundingClientRect(),
  716. e = P(t.clientX - i.left),
  717. r = S(t.clientY - i.top),
  718. o = $({
  719. x: i.left + i.width / 2,
  720. y: i.top + i.height * X
  721. }, {
  722. x: t.clientX,
  723. y: t.clientY
  724. }, i),
  725. n = m(o.x - i.left),
  726. s = T(o.y - i.top);
  727. w.
  728. default.DEBUG_MOUSE_LOG && console.log("onMouseDown device( x:" + t.clientX + " y:" + t.clientY + " ) view( x:" + n + " y:" + s + ")"), k = e, V = r, R.tapEvent(n, s)
  729. }
  730. function f(t) {
  731. var i = C.getBoundingClientRect(),
  732. e = P(t.clientX - i.left),
  733. r = S(t.clientY - i.top),
  734. o = $({
  735. x: i.left + i.width / 2,
  736. y: i.top + i.height * X
  737. }, {
  738. x: t.clientX,
  739. y: t.clientY
  740. }, i),
  741. n = m(o.x - i.left),
  742. s = T(o.y - i.top);
  743. w.
  744. default.DEBUG_MOUSE_LOG && console.log("onMouseMove device( x:" + t.clientX + " y:" + t.clientY + " ) view( x:" + n + " y:" + s + ")"), Y && (k = e, V = r, N.setPoint(n, s))
  745. }
  746. function c() {
  747. Y && (Y = !1), N.setPoint(0, 0)
  748. }
  749. function d() {
  750. w.
  751. default.DEBUG_LOG && console.log("Set Session Storage."), sessionStorage.setItem("Sleepy", "1")
  752. }
  753. function g(t) {
  754. if ("mousewheel" == t.type);
  755. else if ("mousedown" == t.type) p(t);
  756. else if ("mousemove" == t.type) {
  757. var i = sessionStorage.getItem("Sleepy");
  758. "1" === i && sessionStorage.setItem("Sleepy", "0"), u(t)
  759. } else if ("mouseup" == t.type) {
  760. if ("button" in t && 0 != t.button) return
  761. } else if ("mouseout" == t.type) {
  762. w.
  763. default.DEBUG_LOG && console.log("Mouse out Window."), c();
  764. var e = sessionStorage.getItem("SleepyTimer");
  765. window.clearTimeout(e), e = window.setTimeout(d, 5e4), sessionStorage.setItem("SleepyTimer", e)
  766. }
  767. }
  768. function y(t) {
  769. var i = t.touches[0];
  770. "touchstart" == t.type ? 1 == t.touches.length && u(i) : "touchmove" == t.type ? f(i) : "touchend" == t.type && c()
  771. }
  772. function m(t) {
  773. var i = G.transformX(t);
  774. return B.invertTransformX(i)
  775. }
  776. function T(t) {
  777. var i = G.transformY(t);
  778. return B.invertTransformY(i)
  779. }
  780. function P(t) {
  781. return G.transformX(t)
  782. }
  783. function S(t) {
  784. return G.transformY(t)
  785. }
  786. function v() {
  787. for (var t = ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"], i = 0; i < t.length; i++) try {
  788. var e = C.getContext(t[i], {
  789. premultipliedAlpha: !0
  790. });
  791. if (e) return e
  792. } catch (t) {}
  793. return null
  794. }
  795. function L(t, i, e) {
  796. X = void 0 === e ? .5 : e, o(t), n(i)
  797. }
  798. e(6);
  799. var M = e(0),
  800. E = e(8),
  801. A = r(E),
  802. I = e(1),
  803. w = r(I),
  804. x = e(3),
  805. O = r(x),
  806. D = e(2),
  807. R = (window.navigator.platform.toLowerCase(), new A.
  808. default),
  809. b = !1,
  810. F = null,
  811. C = null,
  812. N = null,
  813. B = null,
  814. U = null,
  815. G = null,
  816. Y = !1,
  817. k = 0,
  818. V = 0,
  819. X = .5;
  820. window.loadlive2d = L
  821. }, function(t, i, e) {
  822. "use strict";
  823. (function(t) {
  824. !
  825. function() {
  826. function i() {
  827. At || (this._$MT = null, this._$5S = null, this._$NP = 0, i._$42++, this._$5S = new Y(this))
  828. }
  829. function e(t) {
  830. if (!At) {
  831. this.clipContextList = new Array, this.glcontext = t.gl, this.dp_webgl = t, this.curFrameNo = 0, this.firstError_clipInNotUpdate = !0, this.colorBuffer = 0, this.isInitGLFBFunc = !1, this.tmpBoundsOnModel = new S, at.glContext.length > at.frameBuffers.length && (this.curFrameNo = this.getMaskRenderTexture()), this.tmpModelToViewMatrix = new R, this.tmpMatrix2 = new R, this.tmpMatrixForMask = new R, this.tmpMatrixForDraw = new R, this.CHANNEL_COLORS = new Array;
  832. var i = new A;
  833. i = new A, i.r = 0, i.g = 0, i.b = 0, i.a = 1, this.CHANNEL_COLORS.push(i), i = new A, i.r = 1, i.g = 0, i.b = 0, i.a = 0, this.CHANNEL_COLORS.push(i), i = new A, i.r = 0, i.g = 1, i.b = 0, i.a = 0, this.CHANNEL_COLORS.push(i), i = new A, i.r = 0, i.g = 0, i.b = 1, i.a = 0, this.CHANNEL_COLORS.push(i);
  834. for (var e = 0; e < this.CHANNEL_COLORS.length; e++) this.dp_webgl.setChannelFlagAsColor(e, this.CHANNEL_COLORS[e])
  835. }
  836. }
  837. function r(t, i, e) {
  838. this.clipIDList = new Array, this.clipIDList = e, this.clippingMaskDrawIndexList = new Array;
  839. for (var r = 0; r < e.length; r++) this.clippingMaskDrawIndexList.push(i.getDrawDataIndex(e[r]));
  840. this.clippedDrawContextList = new Array, this.isUsing = !0, this.layoutChannelNo = 0, this.layoutBounds = new S, this.allClippedDrawRect = new S, this.matrixForMask = new Float32Array(16), this.matrixForDraw = new Float32Array(16), this.owner = t
  841. }
  842. function o(t, i) {
  843. this._$gP = t, this.drawDataIndex = i
  844. }
  845. function n() {
  846. At || (this.color = null)
  847. }
  848. function s() {
  849. At || (this._$dP = null, this._$eo = null, this._$V0 = null, this._$dP = 1e3, this._$eo = 1e3, this._$V0 = 1, this._$a0())
  850. }
  851. function _() {}
  852. function a() {
  853. this._$r = null, this._$0S = null
  854. }
  855. function h() {
  856. At || (this.x = null, this.y = null, this.width = null, this.height = null)
  857. }
  858. function l(t) {
  859. At || et.prototype.constructor.call(this, t)
  860. }
  861. function $() {}
  862. function u(t) {
  863. At || et.prototype.constructor.call(this, t)
  864. }
  865. function p() {
  866. At || (this._$vo = null, this._$F2 = null, this._$ao = 400, this._$1S = 400, p._$42++)
  867. }
  868. function f() {
  869. At || (this.p1 = new c, this.p2 = new c, this._$Fo = 0, this._$Db = 0, this._$L2 = 0, this._$M2 = 0, this._$ks = 0, this._$9b = 0, this._$iP = 0, this._$iT = 0, this._$lL = new Array, this._$qP = new Array, this.setup(.3, .5, .1))
  870. }
  871. function c() {
  872. this._$p = 1, this.x = 0, this.y = 0, this.vx = 0, this.vy = 0, this.ax = 0, this.ay = 0, this.fx = 0, this.fy = 0, this._$s0 = 0, this._$70 = 0, this._$7L = 0, this._$HL = 0
  873. }
  874. function d(t, i, e) {
  875. this._$wL = null, this.scale = null, this._$V0 = null, this._$wL = t, this.scale = i, this._$V0 = e
  876. }
  877. function g(t, i, e, r) {
  878. d.prototype.constructor.call(this, i, e, r), this._$tL = null, this._$tL = t
  879. }
  880. function y(t, i, e) {
  881. this._$wL = null, this.scale = null, this._$V0 = null, this._$wL = t, this.scale = i, this._$V0 = e
  882. }
  883. function T(t, i, e, r) {
  884. y.prototype.constructor.call(this, i, e, r), this._$YP = null, this._$YP = t
  885. }
  886. function P() {
  887. At || (this._$fL = 0, this._$gL = 0, this._$B0 = 1, this._$z0 = 1, this._$qT = 0, this.reflectX = !1, this.reflectY = !1)
  888. }
  889. function S() {
  890. At || (this.x = null, this.y = null, this.width = null, this.height = null)
  891. }
  892. function v() {}
  893. function L() {
  894. At || (this.x = null, this.y = null)
  895. }
  896. function M() {
  897. At || (this._$gP = null, this._$dr = null, this._$GS = null, this._$qb = null, this._$Lb = null, this._$mS = null, this.clipID = null, this.clipIDList = new Array)
  898. }
  899. function E() {
  900. At || (this._$Eb = E._$ps, this._$lT = 1, this._$C0 = 1, this._$tT = 1, this._$WL = 1, this.culling = !1, this.matrix4x4 = new Float32Array(16), this.premultipliedAlpha = !1, this.anisotropy = 0, this.clippingProcess = E.CLIPPING_PROCESS_NONE, this.clipBufPre_clipContextMask = null, this.clipBufPre_clipContextDraw = null, this.CHANNEL_COLORS = new Array)
  901. }
  902. function A() {
  903. At || (this.a = 1, this.r = 1, this.g = 1, this.b = 1, this.scale = 1, this._$ho = 1, this.blendMode = at.L2D_COLOR_BLEND_MODE_MULT)
  904. }
  905. function I() {
  906. At || (this._$kP = null, this._$dr = null, this._$Ai = !0, this._$mS = null)
  907. }
  908. function w() {}
  909. function x() {
  910. At || (this._$VP = 0, this._$wL = null, this._$GP = null, this._$8o = x._$ds, this._$2r = -1, this._$O2 = 0, this._$ri = 0)
  911. }
  912. function O() {}
  913. function D() {
  914. At || (this._$Ob = null)
  915. }
  916. function R() {
  917. this.m = new Float32Array(16), this.identity()
  918. }
  919. function b(t) {
  920. At || et.prototype.constructor.call(this, t)
  921. }
  922. function F() {
  923. At || (this._$7 = 1, this._$f = 0, this._$H = 0, this._$g = 1, this._$k = 0, this._$w = 0, this._$hi = STATE_IDENTITY, this._$Z = _$pS)
  924. }
  925. function C() {
  926. At || (s.prototype.constructor.call(this), this.motions = new Array, this._$7r = null, this._$7r = C._$Co++, this._$D0 = 30, this._$yT = 0, this._$E = !0, this.loopFadeIn = !0, this._$AS = -1, _$a0())
  927. }
  928. function N() {
  929. this._$P = new Float32Array(100), this.size = 0
  930. }
  931. function B() {
  932. this._$4P = null, this._$I0 = null, this._$RP = null
  933. }
  934. function U() {}
  935. function G() {}
  936. function Y(t) {
  937. At || (this._$QT = !0, this._$co = -1, this._$qo = 0, this._$pb = new Array(Y._$is), this._$_2 = new Float32Array(Y._$is), this._$vr = new Float32Array(Y._$is), this._$Rr = new Float32Array(Y._$is), this._$Or = new Float32Array(Y._$is), this._$fs = new Float32Array(Y._$is), this._$Js = new Array(Y._$is), this._$3S = new Array, this._$aS = new Array, this._$Bo = null, this._$F2 = new Array, this._$db = new Array, this._$8b = new Array, this._$Hr = new Array, this._$Ws = null, this._$Vs = null, this._$Er = null, this._$Es = new Int16Array(U._$Qb), this._$ZP = new Float32Array(2 * U._$1r), this._$Ri = t, this._$b0 = Y._$HP++, this.clipManager = null, this.dp_webgl = null)
  938. }
  939. function k() {}
  940. function V() {
  941. At || (this._$12 = null, this._$bb = null, this._$_L = null, this._$jo = null, this._$iL = null, this._$0L = null, this._$Br = null, this._$Dr = null, this._$Cb = null, this._$mr = null, this._$_L = wt.STATE_FIRST, this._$Br = 4e3, this._$Dr = 100, this._$Cb = 50, this._$mr = 150, this._$jo = !0, this._$iL = "PARAM_EYE_L_OPEN", this._$0L = "PARAM_EYE_R_OPEN")
  942. }
  943. function X() {
  944. At || (E.prototype.constructor.call(this), this._$sb = new Int32Array(X._$As), this._$U2 = new Array, this.transform = null, this.gl = null, null == X._$NT && (X._$NT = X._$9r(256), X._$vS = X._$9r(256), X._$no = X._$vb(256)))
  945. }
  946. function z() {
  947. At || (I.prototype.constructor.call(this), this._$GS = null, this._$Y0 = null)
  948. }
  949. function H(t) {
  950. _t.prototype.constructor.call(this, t), this._$8r = I._$ur, this._$Yr = null, this._$Wr = null
  951. }
  952. function W() {
  953. At || (M.prototype.constructor.call(this), this._$gP = null, this._$dr = null, this._$GS = null, this._$qb = null, this._$Lb = null, this._$mS = null)
  954. }
  955. function j() {
  956. At || (this._$NL = null, this._$3S = null, this._$aS = null, j._$42++)
  957. }
  958. function q() {
  959. At || (i.prototype.constructor.call(this), this._$zo = new X)
  960. }
  961. function J() {
  962. At || (s.prototype.constructor.call(this), this.motions = new Array, this._$o2 = null, this._$7r = J._$Co++, this._$D0 = 30, this._$yT = 0, this._$E = !1, this.loopFadeIn = !0, this._$rr = -1, this._$eP = 0)
  963. }
  964. function Q(t, i) {
  965. return String.fromCharCode(t.getUint8(i))
  966. }
  967. function N() {
  968. this._$P = new Float32Array(100), this.size = 0
  969. }
  970. function B() {
  971. this._$4P = null, this._$I0 = null, this._$RP = null
  972. }
  973. function Z() {
  974. At || (I.prototype.constructor.call(this), this._$o = 0, this._$A = 0, this._$GS = null, this._$Eo = null)
  975. }
  976. function K(t) {
  977. _t.prototype.constructor.call(this, t), this._$8r = I._$ur, this._$Cr = null, this._$hr = null
  978. }
  979. function tt() {
  980. At || (this.visible = !0, this._$g0 = !1, this._$NL = null, this._$3S = null, this._$aS = null, tt._$42++)
  981. }
  982. function it(t) {
  983. this._$VS = null, this._$e0 = null, this._$e0 = t
  984. }
  985. function et(t) {
  986. At || (this.id = t)
  987. }
  988. function rt() {}
  989. function ot() {
  990. At || (this._$4S = null)
  991. }
  992. function nt(t, i) {
  993. this.canvas = t, this.context = i, this.viewport = new Array(0, 0, t.width, t.height), this._$6r = 1, this._$xP = 0, this._$3r = 1, this._$uP = 0, this._$Qo = -1, this.cacheImages = {}
  994. }
  995. function st() {
  996. At || (this._$TT = null, this._$LT = null, this._$FS = null, this._$wL = null)
  997. }
  998. function _t(t) {
  999. At || (this._$e0 = null, this._$IP = null, this._$JS = !1, this._$AT = !0, this._$e0 = t, this.totalScale = 1, this._$7s = 1, this.totalOpacity = 1)
  1000. }
  1001. function at() {}
  1002. function ht() {}
  1003. function lt(t) {
  1004. At || (this._$ib = t)
  1005. }
  1006. function $t() {
  1007. At || (W.prototype.constructor.call(this), this._$LP = -1, this._$d0 = 0, this._$Yo = 0, this._$JP = null, this._$5P = null, this._$BP = null, this._$Eo = null, this._$Qi = null, this._$6s = $t._$ms, this.culling = !0, this.gl_cacheImage = null, this.instanceNo = $t._$42++)
  1008. }
  1009. function ut(t) {
  1010. Mt.prototype.constructor.call(this, t), this._$8r = W._$ur, this._$Cr = null, this._$hr = null
  1011. }
  1012. function pt() {
  1013. At || (this.x = null, this.y = null)
  1014. }
  1015. function ft(t) {
  1016. At || (i.prototype.constructor.call(this), this.drawParamWebGL = new mt(t), this.drawParamWebGL.setGL(at.getGL(t)))
  1017. }
  1018. function ct() {
  1019. At || (this.motions = null, this._$eb = !1, this.motions = new Array)
  1020. }
  1021. function dt() {
  1022. this._$w0 = null, this._$AT = !0, this._$9L = !1, this._$z2 = -1, this._$bs = -1, this._$Do = -1, this._$sr = null, this._$sr = dt._$Gs++
  1023. }
  1024. function gt() {
  1025. this.m = new Array(1, 0, 0, 0, 1, 0, 0, 0, 1)
  1026. }
  1027. function yt(t) {
  1028. At || et.prototype.constructor.call(this, t)
  1029. }
  1030. function mt(t) {
  1031. At || (E.prototype.constructor.call(this), this.textures = new Array, this.transform = null, this.gl = null, this.glno = t, this.firstDraw = !0, this.anisotropyExt = null, this.maxAnisotropy = 0, this._$As = 32, this._$Gr = !1, this._$NT = null, this._$vS = null, this._$no = null, this.vertShader = null, this.fragShader = null, this.vertShaderOff = null, this.fragShaderOff = null)
  1032. }
  1033. function Tt(t, i, e) {
  1034. return null == i && (i = t.createBuffer()), t.bindBuffer(t.ARRAY_BUFFER, i), t.bufferData(t.ARRAY_BUFFER, e, t.DYNAMIC_DRAW), i
  1035. }
  1036. function Pt(t, i, e) {
  1037. return null == i && (i = t.createBuffer()), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, i), t.bufferData(t.ELEMENT_ARRAY_BUFFER, e, t.DYNAMIC_DRAW), i
  1038. }
  1039. function St(t) {
  1040. At || (this._$P = new Int8Array(8), this._$R0 = new DataView(this._$P.buffer), this._$3i = new Int8Array(1e3), this._$hL = 0, this._$v0 = 0, this._$S2 = 0, this._$Ko = new Array, this._$T = t, this._$F = 0)
  1041. }
  1042. function vt() {}
  1043. function Lt() {}
  1044. function Mt(t) {
  1045. At || (this._$e0 = null, this._$IP = null, this._$Us = null, this._$7s = null, this._$IS = [!1], this._$VS = null, this._$AT = !0, this.baseOpacity = 1, this.clipBufPre_clipContext = null, this._$e0 = t)
  1046. }
  1047. function Et() {}
  1048. var At = !0;
  1049. i._$0s = 1, i._$4s = 2, i._$42 = 0, i._$62 = function(t, e) {
  1050. try {
  1051. if (e instanceof ArrayBuffer && (e = new DataView(e)), !(e instanceof DataView)) throw new lt("_$SS#loadModel(b) / b _$x be DataView or ArrayBuffer");
  1052. var r, o = new St(e),
  1053. n = o._$ST(),
  1054. s = o._$ST(),
  1055. a = o._$ST();
  1056. if (109 != n || 111 != s || 99 != a) throw new lt("_$gi _$C _$li , _$Q0 _$P0.");
  1057. if (r = o._$ST(), o._$gr(r), r > G._$T7) {
  1058. t._$NP |= i._$4s;
  1059. throw new lt("_$gi _$C _$li , _$n0 _$_ version _$li ( SDK : " + G._$T7 + " < _$f0 : " + r + " )@_$SS#loadModel()\n")
  1060. }
  1061. var h = o._$nP();
  1062. if (r >= G._$s7) {
  1063. var l = o._$9T(),
  1064. $ = o._$9T();
  1065. if (-30584 != l || -30584 != $) throw t._$NP |= i._$0s, new lt("_$gi _$C _$li , _$0 _$6 _$Ui.")
  1066. }
  1067. t._$KS(h);
  1068. var u = t.getModelContext();
  1069. u.setDrawParam(t.getDrawParam()), u.init()
  1070. } catch (t) {
  1071. _._$Rb(t)
  1072. }
  1073. }, i.prototype._$KS = function(t) {
  1074. this._$MT = t
  1075. }, i.prototype.getModelImpl = function() {
  1076. return null == this._$MT && (this._$MT = new p, this._$MT._$zP()), this._$MT
  1077. }, i.prototype.getCanvasWidth = function() {
  1078. return null == this._$MT ? 0 : this._$MT.getCanvasWidth()
  1079. }, i.prototype.getCanvasHeight = function() {
  1080. return null == this._$MT ? 0 : this._$MT.getCanvasHeight()
  1081. }, i.prototype.getParamFloat = function(t) {
  1082. return "number" != typeof t && (t = this._$5S.getParamIndex(u.getID(t))), this._$5S.getParamFloat(t)
  1083. }, i.prototype.setParamFloat = function(t, i, e) {
  1084. "number" != typeof t && (t = this._$5S.getParamIndex(u.getID(t))), arguments.length < 3 && (e = 1), this._$5S.setParamFloat(t, this._$5S.getParamFloat(t) * (1 - e) + i * e)
  1085. }, i.prototype.addToParamFloat = function(t, i, e) {
  1086. "number" != typeof t && (t = this._$5S.getParamIndex(u.getID(t))), arguments.length < 3 && (e = 1), this._$5S.setParamFloat(t, this._$5S.getParamFloat(t) + i * e)
  1087. }, i.prototype.multParamFloat = function(t, i, e) {
  1088. "number" != typeof t && (t = this._$5S.getParamIndex(u.getID(t))), arguments.length < 3 && (e = 1), this._$5S.setParamFloat(t, this._$5S.getParamFloat(t) * (1 + (i - 1) * e))
  1089. }, i.prototype.getParamIndex = function(t) {
  1090. return this._$5S.getParamIndex(u.getID(t))
  1091. }, i.prototype.loadParam = function() {
  1092. this._$5S.loadParam()
  1093. }, i.prototype.saveParam = function() {
  1094. this._$5S.saveParam()
  1095. }, i.prototype.init = function() {
  1096. this._$5S.init()
  1097. }, i.prototype.update = function() {
  1098. this._$5S.update()
  1099. }, i.prototype._$Rs = function() {
  1100. return _._$li("_$60 _$PT _$Rs()"), -1
  1101. }, i.prototype._$Ds = function(t) {
  1102. _._$li("_$60 _$PT _$SS#_$Ds() \n")
  1103. }, i.prototype._$K2 = function() {}, i.prototype.draw = function() {}, i.prototype.getModelContext = function() {
  1104. return this._$5S
  1105. }, i.prototype._$s2 = function() {
  1106. return this._$NP
  1107. }, i.prototype._$P7 = function(t, i, e, r) {
  1108. var o = -1,
  1109. n = 0,
  1110. s = this;
  1111. if (0 != e) if (1 == t.length) {
  1112. var _ = t[0],
  1113. a = 0 != s.getParamFloat(_),
  1114. h = i[0],
  1115. l = s.getPartsOpacity(h),
  1116. $ = e / r;
  1117. a ? (l += $) > 1 && (l = 1) : (l -= $) < 0 && (l = 0), s.setPartsOpacity(h, l)
  1118. } else {
  1119. for (var u = 0; u < t.length; u++) {
  1120. var _ = t[u],
  1121. p = 0 != s.getParamFloat(_);
  1122. if (p) {
  1123. if (o >= 0) break;
  1124. o = u;
  1125. var h = i[u];
  1126. n = s.getPartsOpacity(h), n += e / r, n > 1 && (n = 1)
  1127. }
  1128. }
  1129. o < 0 && (console.log("No _$wi _$q0/ _$U default[%s]", t[0]), o = 0, n = 1, s.loadParam(), s.setParamFloat(t[o], n), s.saveParam());
  1130. for (var u = 0; u < t.length; u++) {
  1131. var h = i[u];
  1132. if (o == u) s.setPartsOpacity(h, n);
  1133. else {
  1134. var f, c = s.getPartsOpacity(h);
  1135. f = n < .5 ? -.5 * n / .5 + 1 : .5 * (1 - n) / .5;
  1136. var d = (1 - f) * (1 - n);
  1137. d > .15 && (f = 1 - .15 / (1 - n)), c > f && (c = f), s.setPartsOpacity(h, c)
  1138. }
  1139. }
  1140. } else for (var u = 0; u < t.length; u++) {
  1141. var _ = t[u],
  1142. h = i[u],
  1143. p = 0 != s.getParamFloat(_);
  1144. s.setPartsOpacity(h, p ? 1 : 0)
  1145. }
  1146. }, i.prototype.setPartsOpacity = function(t, i) {
  1147. "number" != typeof t && (t = this._$5S.getPartsDataIndex(l.getID(t))), this._$5S.setPartsOpacity(t, i)
  1148. }, i.prototype.getPartsDataIndex = function(t) {
  1149. return t instanceof l || (t = l.getID(t)), this._$5S.getPartsDataIndex(t)
  1150. }, i.prototype.getPartsOpacity = function(t) {
  1151. return "number" != typeof t && (t = this._$5S.getPartsDataIndex(l.getID(t))), t < 0 ? 0 : this._$5S.getPartsOpacity(t)
  1152. }, i.prototype.getDrawParam = function() {}, i.prototype.getDrawDataIndex = function(t) {
  1153. return this._$5S.getDrawDataIndex(b.getID(t))
  1154. }, i.prototype.getDrawData = function(t) {
  1155. return this._$5S.getDrawData(t)
  1156. }, i.prototype.getTransformedPoints = function(t) {
  1157. var i = this._$5S._$C2(t);
  1158. return i instanceof ut ? i.getTransformedPoints() : null
  1159. }, i.prototype.getIndexArray = function(t) {
  1160. if (t < 0 || t >= this._$5S._$aS.length) return null;
  1161. var i = this._$5S._$aS[t];
  1162. return null != i && i.getType() == W._$wb && i instanceof $t ? i.getIndexArray() : null
  1163. }, e.CHANNEL_COUNT = 4, e.RENDER_TEXTURE_USE_MIPMAP = !1, e.NOT_USED_FRAME = -100, e.prototype._$L7 = function() {
  1164. if (this.tmpModelToViewMatrix && (this.tmpModelToViewMatrix = null), this.tmpMatrix2 && (this.tmpMatrix2 = null), this.tmpMatrixForMask && (this.tmpMatrixForMask = null), this.tmpMatrixForDraw && (this.tmpMatrixForDraw = null), this.tmpBoundsOnModel && (this.tmpBoundsOnModel = null), this.CHANNEL_COLORS) {
  1165. for (var t = this.CHANNEL_COLORS.length - 1; t >= 0; --t) this.CHANNEL_COLORS.splice(t, 1);
  1166. this.CHANNEL_COLORS = []
  1167. }
  1168. this.releaseShader()
  1169. }, e.prototype.releaseShader = function() {
  1170. for (var t = at.frameBuffers.length, i = 0; i < t; i++) this.gl.deleteFramebuffer(at.frameBuffers[i].framebuffer);
  1171. at.frameBuffers = [], at.glContext = []
  1172. }, e.prototype.init = function(t, i, e) {
  1173. for (var o = 0; o < i.length; o++) {
  1174. var n = i[o].getClipIDList();
  1175. if (null != n) {
  1176. var s = this.findSameClip(n);
  1177. null == s && (s = new r(this, t, n), this.clipContextList.push(s));
  1178. var _ = i[o].getDrawDataID(),
  1179. a = t.getDrawDataIndex(_);
  1180. s.addClippedDrawData(_, a);
  1181. e[o].clipBufPre_clipContext = s
  1182. }
  1183. }
  1184. }, e.prototype.getMaskRenderTexture = function() {
  1185. var t = null;
  1186. return t = this.dp_webgl.createFramebuffer(), at.frameBuffers[this.dp_webgl.glno] = t, this.dp_webgl.glno
  1187. }, e.prototype.setupClip = function(t, i) {
  1188. for (var e = 0, r = 0; r < this.clipContextList.length; r++) {
  1189. var o = this.clipContextList[r];
  1190. this.calcClippedDrawTotalBounds(t, o), o.isUsing && e++
  1191. }
  1192. if (e > 0) {
  1193. var n = i.gl.getParameter(i.gl.FRAMEBUFFER_BINDING),
  1194. s = new Array(4);
  1195. s[0] = 0, s[1] = 0, s[2] = i.gl.canvas.width, s[3] = i.gl.canvas.height, i.gl.viewport(0, 0, at.clippingMaskBufferSize, at.clippingMaskBufferSize), this.setupLayoutBounds(e), i.gl.bindFramebuffer(i.gl.FRAMEBUFFER, at.frameBuffers[this.curFrameNo].framebuffer), i.gl.clearColor(0, 0, 0, 0), i.gl.clear(i.gl.COLOR_BUFFER_BIT);
  1196. for (var r = 0; r < this.clipContextList.length; r++) {
  1197. var o = this.clipContextList[r],
  1198. _ = o.allClippedDrawRect,
  1199. a = (o.layoutChannelNo, o.layoutBounds);
  1200. this.tmpBoundsOnModel._$jL(_), this.tmpBoundsOnModel.expand(.05 * _.width, .05 * _.height);
  1201. var h = a.width / this.tmpBoundsOnModel.width,
  1202. l = a.height / this.tmpBoundsOnModel.height;
  1203. this.tmpMatrix2.identity(), this.tmpMatrix2.translate(-1, -1, 0), this.tmpMatrix2.scale(2, 2, 1), this.tmpMatrix2.translate(a.x, a.y, 0), this.tmpMatrix2.scale(h, l, 1), this.tmpMatrix2.translate(-this.tmpBoundsOnModel.x, -this.tmpBoundsOnModel.y, 0), this.tmpMatrixForMask.setMatrix(this.tmpMatrix2.m), this.tmpMatrix2.identity(), this.tmpMatrix2.translate(a.x, a.y, 0), this.tmpMatrix2.scale(h, l, 1), this.tmpMatrix2.translate(-this.tmpBoundsOnModel.x, -this.tmpBoundsOnModel.y, 0), this.tmpMatrixForDraw.setMatrix(this.tmpMatrix2.m);
  1204. for (var $ = this.tmpMatrixForMask.getArray(), u = 0; u < 16; u++) o.matrixForMask[u] = $[u];
  1205. for (var p = this.tmpMatrixForDraw.getArray(), u = 0; u < 16; u++) o.matrixForDraw[u] = p[u];
  1206. for (var f = o.clippingMaskDrawIndexList.length, c = 0; c < f; c++) {
  1207. var d = o.clippingMaskDrawIndexList[c],
  1208. g = t.getDrawData(d),
  1209. y = t._$C2(d);
  1210. i.setClipBufPre_clipContextForMask(o), g.draw(i, t, y)
  1211. }
  1212. }
  1213. i.gl.bindFramebuffer(i.gl.FRAMEBUFFER, n), i.setClipBufPre_clipContextForMask(null), i.gl.viewport(s[0], s[1], s[2], s[3])
  1214. }
  1215. }, e.prototype.getColorBuffer = function() {
  1216. return this.colorBuffer
  1217. }, e.prototype.findSameClip = function(t) {
  1218. for (var i = 0; i < this.clipContextList.length; i++) {
  1219. var e = this.clipContextList[i],
  1220. r = e.clipIDList.length;
  1221. if (r == t.length) {
  1222. for (var o = 0, n = 0; n < r; n++) for (var s = e.clipIDList[n], _ = 0; _ < r; _++) if (t[_] == s) {
  1223. o++;
  1224. break
  1225. }
  1226. if (o == r) return e
  1227. }
  1228. }
  1229. return null
  1230. }, e.prototype.calcClippedDrawTotalBounds = function(t, i) {
  1231. for (var e = t._$Ri.getModelImpl().getCanvasWidth(), r = t._$Ri.getModelImpl().getCanvasHeight(), o = e > r ? e : r, n = o, s = o, _ = 0, a = 0, h = i.clippedDrawContextList.length, l = 0; l < h; l++) {
  1232. var $ = i.clippedDrawContextList[l],
  1233. u = $.drawDataIndex,
  1234. p = t._$C2(u);
  1235. if (p._$yo()) {
  1236. for (var f = p.getTransformedPoints(), c = f.length, d = [], g = [], y = 0, m = U._$i2; m < c; m += U._$No) d[y] = f[m], g[y] = f[m + 1], y++;
  1237. var T = Math.min.apply(null, d),
  1238. P = Math.min.apply(null, g),
  1239. S = Math.max.apply(null, d),
  1240. v = Math.max.apply(null, g);
  1241. T < n && (n = T), P < s && (s = P), S > _ && (_ = S), v > a && (a = v)
  1242. }
  1243. }
  1244. if (n == o) i.allClippedDrawRect.x = 0, i.allClippedDrawRect.y = 0, i.allClippedDrawRect.width = 0, i.allClippedDrawRect.height = 0, i.isUsing = !1;
  1245. else {
  1246. var L = _ - n,
  1247. M = a - s;
  1248. i.allClippedDrawRect.x = n, i.allClippedDrawRect.y = s, i.allClippedDrawRect.width = L, i.allClippedDrawRect.height = M, i.isUsing = !0
  1249. }
  1250. }, e.prototype.setupLayoutBounds = function(t) {
  1251. var i = t / e.CHANNEL_COUNT,
  1252. r = t % e.CHANNEL_COUNT;
  1253. i = ~~i, r = ~~r;
  1254. for (var o = 0, n = 0; n < e.CHANNEL_COUNT; n++) {
  1255. var s = i + (n < r ? 1 : 0);
  1256. if (0 == s);
  1257. else if (1 == s) {
  1258. var a = this.clipContextList[o++];
  1259. a.layoutChannelNo = n, a.layoutBounds.x = 0, a.layoutBounds.y = 0, a.layoutBounds.width = 1, a.layoutBounds.height = 1
  1260. } else if (2 == s) for (var h = 0; h < s; h++) {
  1261. var l = h % 2,
  1262. $ = 0;
  1263. l = ~~l;
  1264. var a = this.clipContextList[o++];
  1265. a.layoutChannelNo = n, a.layoutBounds.x = .5 * l, a.layoutBounds.y = 0, a.layoutBounds.width = .5, a.layoutBounds.height = 1
  1266. } else if (s <= 4) for (var h = 0; h < s; h++) {
  1267. var l = h % 2,
  1268. $ = h / 2;
  1269. l = ~~l, $ = ~~$;
  1270. var a = this.clipContextList[o++];
  1271. a.layoutChannelNo = n, a.layoutBounds.x = .5 * l, a.layoutBounds.y = .5 * $, a.layoutBounds.width = .5, a.layoutBounds.height = .5
  1272. } else if (s <= 9) for (var h = 0; h < s; h++) {
  1273. var l = h % 3,
  1274. $ = h / 3;
  1275. l = ~~l, $ = ~~$;
  1276. var a = this.clipContextList[o++];
  1277. a.layoutChannelNo = n, a.layoutBounds.x = l / 3, a.layoutBounds.y = $ / 3, a.layoutBounds.width = 1 / 3, a.layoutBounds.height = 1 / 3
  1278. } else _._$li("_$6 _$0P mask count : %d", s)
  1279. }
  1280. }, r.prototype.addClippedDrawData = function(t, i) {
  1281. var e = new o(t, i);
  1282. this.clippedDrawContextList.push(e)
  1283. }, s._$JT = function(t, i, e) {
  1284. var r = t / i,
  1285. o = e / i,
  1286. n = o,
  1287. s = 1 - (1 - o) * (1 - o),
  1288. _ = 1 - (1 - n) * (1 - n),
  1289. a = 1 / 3 * (1 - o) * s + (n * (2 / 3) + 1 / 3 * (1 - n)) * (1 - s),
  1290. h = (n + 2 / 3 * (1 - n)) * _ + (o * (1 / 3) + 2 / 3 * (1 - o)) * (1 - _),
  1291. l = 1 - 3 * h + 3 * a - 0,
  1292. $ = 3 * h - 6 * a + 0,
  1293. u = 3 * a - 0;
  1294. if (r <= 0) return 0;
  1295. if (r >= 1) return 1;
  1296. var p = r,
  1297. f = p * p;
  1298. return l * (p * f) + $ * f + u * p + 0
  1299. }, s.prototype._$a0 = function() {}, s.prototype.setFadeIn = function(t) {
  1300. this._$dP = t
  1301. }, s.prototype.setFadeOut = function(t) {
  1302. this._$eo = t
  1303. }, s.prototype._$pT = function(t) {
  1304. this._$V0 = t
  1305. }, s.prototype.getFadeOut = function() {
  1306. return this._$eo
  1307. }, s.prototype._$4T = function() {
  1308. return this._$eo
  1309. }, s.prototype._$mT = function() {
  1310. return this._$V0
  1311. }, s.prototype.getDurationMSec = function() {
  1312. return -1
  1313. }, s.prototype.getLoopDurationMSec = function() {
  1314. return -1
  1315. }, s.prototype.updateParam = function(t, i) {
  1316. if (i._$AT && !i._$9L) {
  1317. var e = w.getUserTimeMSec();
  1318. if (i._$z2 < 0) {
  1319. i._$z2 = e, i._$bs = e;
  1320. var r = this.getDurationMSec();
  1321. i._$Do < 0 && (i._$Do = r <= 0 ? -1 : i._$z2 + r)
  1322. }
  1323. var o = this._$V0;
  1324. o = o * (0 == this._$dP ? 1 : ht._$r2((e - i._$bs) / this._$dP)) * (0 == this._$eo || i._$Do < 0 ? 1 : ht._$r2((i._$Do - e) / this._$eo)), 0 <= o && o <= 1 || console.log("### assert!! ### "), this.updateParamExe(t, e, o, i), i._$Do > 0 && i._$Do < e && (i._$9L = !0)
  1325. }
  1326. }, s.prototype.updateParamExe = function(t, i, e, r) {}, _._$8s = 0, _._$fT = new Object, _.start = function(t) {
  1327. var i = _._$fT[t];
  1328. null == i && (i = new a, i._$r = t, _._$fT[t] = i), i._$0S = w.getSystemTimeMSec()
  1329. }, _.dump = function(t) {
  1330. var i = _._$fT[t];
  1331. if (null != i) {
  1332. var e = w.getSystemTimeMSec(),
  1333. r = e - i._$0S;
  1334. return console.log(t + " : " + r + "ms"), r
  1335. }
  1336. return -1
  1337. }, _.end = function(t) {
  1338. var i = _._$fT[t];
  1339. if (null != i) {
  1340. return w.getSystemTimeMSec() - i._$0S
  1341. }
  1342. return -1
  1343. }, _._$li = function(t, i) {
  1344. console.log("_$li : " + t + "\n", i)
  1345. }, _._$Ji = function(t, i) {
  1346. console.log(t, i)
  1347. }, _._$dL = function(t, i) {
  1348. console.log(t, i), console.log("\n")
  1349. }, _._$KL = function(t, i) {
  1350. for (var e = 0; e < i; e++) e % 16 == 0 && e > 0 ? console.log("\n") : e % 8 == 0 && e > 0 && console.log(" "), console.log("%02X ", 255 & t[e]);
  1351. console.log("\n")
  1352. }, _._$nr = function(t, i, e) {
  1353. console.log("%s\n", t);
  1354. for (var r = i.length, o = 0; o < r; ++o) console.log("%5d", i[o]), console.log("%s\n", e), console.log(",");
  1355. console.log("\n")
  1356. }, _._$Rb = function(t) {
  1357. console.log("dump exception : " + t), console.log("stack :: " + t.stack)
  1358. }, h.prototype._$8P = function() {
  1359. return .5 * (this.x + this.x + this.width)
  1360. }, h.prototype._$6P = function() {
  1361. return .5 * (this.y + this.y + this.height)
  1362. }, h.prototype._$EL = function() {
  1363. return this.x + this.width
  1364. }, h.prototype._$5T = function() {
  1365. return this.y + this.height
  1366. }, h.prototype._$jL = function(t, i, e, r) {
  1367. this.x = t, this.y = i, this.width = e, this.height = r
  1368. }, h.prototype._$jL = function(t) {
  1369. this.x = t.x, this.y = t.y, this.width = t.width, this.height = t.height
  1370. }, l.prototype = new et, l._$tP = new Object, l._$27 = function() {
  1371. l._$tP.clear()
  1372. }, l.getID = function(t) {
  1373. var i = l._$tP[t];
  1374. return null == i && (i = new l(t), l._$tP[t] = i), i
  1375. }, l.prototype._$3s = function() {
  1376. return new l
  1377. }, u.prototype = new et, u._$tP = new Object, u._$27 = function() {
  1378. u._$tP.clear()
  1379. }, u.getID = function(t) {
  1380. var i = u._$tP[t];
  1381. return null == i && (i = new u(t), u._$tP[t] = i), i
  1382. }, u.prototype._$3s = function() {
  1383. return new u
  1384. }, p._$42 = 0, p.prototype._$zP = function() {
  1385. null == this._$vo && (this._$vo = new ot), null == this._$F2 && (this._$F2 = new Array)
  1386. }, p.prototype.getCanvasWidth = function() {
  1387. return this._$ao
  1388. }, p.prototype.getCanvasHeight = function() {
  1389. return this._$1S
  1390. }, p.prototype._$F0 = function(t) {
  1391. this._$vo = t._$nP(), this._$F2 = t._$nP(), this._$ao = t._$6L(), this._$1S = t._$6L()
  1392. }, p.prototype._$6S = function(t) {
  1393. this._$F2.push(t)
  1394. }, p.prototype._$Xr = function() {
  1395. return this._$F2
  1396. }, p.prototype._$E2 = function() {
  1397. return this._$vo
  1398. }, f.prototype.setup = function(t, i, e) {
  1399. this._$ks = this._$Yb(), this.p2._$xT(), 3 == arguments.length && (this._$Fo = t, this._$L2 = i, this.p1._$p = e, this.p2._$p = e, this.p2.y = t, this.setup())
  1400. }, f.prototype.getPhysicsPoint1 = function() {
  1401. return this.p1
  1402. }, f.prototype.getPhysicsPoint2 = function() {
  1403. return this.p2
  1404. }, f.prototype._$qr = function() {
  1405. return this._$Db
  1406. }, f.prototype._$pr = function(t) {
  1407. this._$Db = t
  1408. }, f.prototype._$5r = function() {
  1409. return this._$M2
  1410. }, f.prototype._$Cs = function() {
  1411. return this._$9b
  1412. }, f.prototype._$Yb = function() {
  1413. return -180 * Math.atan2(this.p1.x - this.p2.x, -(this.p1.y - this.p2.y)) / Math.PI
  1414. }, f.prototype.addSrcParam = function(t, i, e, r) {
  1415. var o = new g(t, i, e, r);
  1416. this._$lL.push(o)
  1417. }, f.prototype.addTargetParam = function(t, i, e, r) {
  1418. var o = new T(t, i, e, r);
  1419. this._$qP.push(o)
  1420. }, f.prototype.update = function(t, i) {
  1421. if (0 == this._$iP) return this._$iP = this._$iT = i, void(this._$Fo = Math.sqrt((this.p1.x - this.p2.x) * (this.p1.x - this.p2.x) + (this.p1.y - this.p2.y) * (this.p1.y - this.p2.y)));
  1422. var e = (i - this._$iT) / 1e3;
  1423. if (0 != e) {
  1424. for (var r = this._$lL.length - 1; r >= 0; --r) {
  1425. this._$lL[r]._$oP(t, this)
  1426. }
  1427. this._$oo(t, e), this._$M2 = this._$Yb(), this._$9b = (this._$M2 - this._$ks) / e, this._$ks = this._$M2
  1428. }
  1429. for (var r = this._$qP.length - 1; r >= 0; --r) {
  1430. this._$qP[r]._$YS(t, this)
  1431. }
  1432. this._$iT = i
  1433. }, f.prototype._$oo = function(t, i) {
  1434. i < .033 && (i = .033);
  1435. var e = 1 / i;
  1436. this.p1.vx = (this.p1.x - this.p1._$s0) * e, this.p1.vy = (this.p1.y - this.p1._$70) * e, this.p1.ax = (this.p1.vx - this.p1._$7L) * e, this.p1.ay = (this.p1.vy - this.p1._$HL) * e, this.p1.fx = this.p1.ax * this.p1._$p, this.p1.fy = this.p1.ay * this.p1._$p, this.p1._$xT();
  1437. var r, o, n = -Math.atan2(this.p1.y - this.p2.y, this.p1.x - this.p2.x),
  1438. s = Math.cos(n),
  1439. _ = Math.sin(n),
  1440. a = 9.8 * this.p2._$p,
  1441. h = this._$Db * Lt._$bS,
  1442. l = a * Math.cos(n - h);
  1443. r = l * _, o = l * s;
  1444. var $ = -this.p1.fx * _ * _,
  1445. u = -this.p1.fy * _ * s,
  1446. p = -this.p2.vx * this._$L2,
  1447. f = -this.p2.vy * this._$L2;
  1448. this.p2.fx = r + $ + p, this.p2.fy = o + u + f, this.p2.ax = this.p2.fx / this.p2._$p, this.p2.ay = this.p2.fy / this.p2._$p, this.p2.vx += this.p2.ax * i, this.p2.vy += this.p2.ay * i, this.p2.x += this.p2.vx * i, this.p2.y += this.p2.vy * i;
  1449. var c = Math.sqrt((this.p1.x - this.p2.x) * (this.p1.x - this.p2.x) + (this.p1.y - this.p2.y) * (this.p1.y - this.p2.y));
  1450. this.p2.x = this.p1.x + this._$Fo * (this.p2.x - this.p1.x) / c, this.p2.y = this.p1.y + this._$Fo * (this.p2.y - this.p1.y) / c, this.p2.vx = (this.p2.x - this.p2._$s0) * e, this.p2.vy = (this.p2.y - this.p2._$70) * e, this.p2._$xT()
  1451. }, c.prototype._$xT = function() {
  1452. this._$s0 = this.x, this._$70 = this.y, this._$7L = this.vx, this._$HL = this.vy
  1453. }, d.prototype._$oP = function(t, i) {}, g.prototype = new d, g.prototype._$oP = function(t, i) {
  1454. var e = this.scale * t.getParamFloat(this._$wL),
  1455. r = i.getPhysicsPoint1();
  1456. switch (this._$tL) {
  1457. default:
  1458. case f.Src.SRC_TO_X:
  1459. r.x = r.x + (e - r.x) * this._$V0;
  1460. break;
  1461. case f.Src.SRC_TO_Y:
  1462. r.y = r.y + (e - r.y) * this._$V0;
  1463. break;
  1464. case f.Src.SRC_TO_G_ANGLE:
  1465. var o = i._$qr();
  1466. o += (e - o) * this._$V0, i._$pr(o)
  1467. }
  1468. }, y.prototype._$YS = function(t, i) {}, T.prototype = new y, T.prototype._$YS = function(t, i) {
  1469. switch (this._$YP) {
  1470. default:
  1471. case f.Target.TARGET_FROM_ANGLE:
  1472. t.setParamFloat(this._$wL, this.scale * i._$5r(), this._$V0);
  1473. break;
  1474. case f.Target.TARGET_FROM_ANGLE_V:
  1475. t.setParamFloat(this._$wL, this.scale * i._$Cs(), this._$V0)
  1476. }
  1477. }, f.Src = function() {}, f.Src.SRC_TO_X = "SRC_TO_X", f.Src.SRC_TO_Y = "SRC_TO_Y", f.Src.SRC_TO_G_ANGLE = "SRC_TO_G_ANGLE", f.Target = function() {}, f.Target.TARGET_FROM_ANGLE = "TARGET_FROM_ANGLE", f.Target.TARGET_FROM_ANGLE_V = "TARGET_FROM_ANGLE_V", P.prototype.init = function(t) {
  1478. this._$fL = t._$fL, this._$gL = t._$gL, this._$B0 = t._$B0, this._$z0 = t._$z0, this._$qT = t._$qT, this.reflectX = t.reflectX, this.reflectY = t.reflectY
  1479. }, P.prototype._$F0 = function(t) {
  1480. this._$fL = t._$_T(), this._$gL = t._$_T(), this._$B0 = t._$_T(), this._$z0 = t._$_T(), this._$qT = t._$_T(), t.getFormatVersion() >= G.LIVE2D_FORMAT_VERSION_V2_10_SDK2 && (this.reflectX = t._$po(), this.reflectY = t._$po())
  1481. }, P.prototype._$e = function() {};
  1482. var It = function() {};
  1483. It._$ni = function(t, i, e, r, o, n, s, _, a) {
  1484. var h = s * n - _ * o;
  1485. if (0 == h) return null;
  1486. var l, $ = ((t - e) * n - (i - r) * o) / h;
  1487. return l = 0 != o ? (t - e - $ * s) / o : (i - r - $ * _) / n, isNaN(l) && (l = (t - e - $ * s) / o, isNaN(l) && (l = (i - r - $ * _) / n), isNaN(l) && (console.log("a is NaN @UtVector#_$ni() "), console.log("v1x : " + o), console.log("v1x != 0 ? " + (0 != o)))), null == a ? new Array(l, $) : (a[0] = l, a[1] = $, a)
  1488. }, S.prototype._$8P = function() {
  1489. return this.x + .5 * this.width
  1490. }, S.prototype._$6P = function() {
  1491. return this.y + .5 * this.height
  1492. }, S.prototype._$EL = function() {
  1493. return this.x + this.width
  1494. }, S.prototype._$5T = function() {
  1495. return this.y + this.height
  1496. }, S.prototype._$jL = function(t, i, e, r) {
  1497. this.x = t, this.y = i, this.width = e, this.height = r
  1498. }, S.prototype._$jL = function(t) {
  1499. this.x = t.x, this.y = t.y, this.width = t.width, this.height = t.height
  1500. }, S.prototype.contains = function(t, i) {
  1501. return this.x <= this.x && this.y <= this.y && this.x <= this.x + this.width && this.y <= this.y + this.height
  1502. }, S.prototype.expand = function(t, i) {
  1503. this.x -= t, this.y -= i, this.width += 2 * t, this.height += 2 * i
  1504. }, v._$Z2 = function(t, i, e, r) {
  1505. var o = i._$Q2(t, e),
  1506. n = t._$vs(),
  1507. s = t._$Tr();
  1508. if (i._$zr(n, s, o), o <= 0) return r[n[0]];
  1509. if (1 == o) {
  1510. var _ = r[n[0]],
  1511. a = r[n[1]],
  1512. h = s[0];
  1513. return _ + (a - _) * h | 0
  1514. }
  1515. if (2 == o) {
  1516. var _ = r[n[0]],
  1517. a = r[n[1]],
  1518. l = r[n[2]],
  1519. $ = r[n[3]],
  1520. h = s[0],
  1521. u = s[1],
  1522. p = _ + (a - _) * h | 0,
  1523. f = l + ($ - l) * h | 0;
  1524. return p + (f - p) * u | 0
  1525. }
  1526. if (3 == o) {
  1527. var c = r[n[0]],
  1528. d = r[n[1]],
  1529. g = r[n[2]],
  1530. y = r[n[3]],
  1531. m = r[n[4]],
  1532. T = r[n[5]],
  1533. P = r[n[6]],
  1534. S = r[n[7]],
  1535. h = s[0],
  1536. u = s[1],
  1537. v = s[2],
  1538. _ = c + (d - c) * h | 0,
  1539. a = g + (y - g) * h | 0,
  1540. l = m + (T - m) * h | 0,
  1541. $ = P + (S - P) * h | 0,
  1542. p = _ + (a - _) * u | 0,
  1543. f = l + ($ - l) * u | 0;
  1544. return p + (f - p) * v | 0
  1545. }
  1546. if (4 == o) {
  1547. var L = r[n[0]],
  1548. M = r[n[1]],
  1549. E = r[n[2]],
  1550. A = r[n[3]],
  1551. I = r[n[4]],
  1552. w = r[n[5]],
  1553. x = r[n[6]],
  1554. O = r[n[7]],
  1555. D = r[n[8]],
  1556. R = r[n[9]],
  1557. b = r[n[10]],
  1558. F = r[n[11]],
  1559. C = r[n[12]],
  1560. N = r[n[13]],
  1561. B = r[n[14]],
  1562. U = r[n[15]],
  1563. h = s[0],
  1564. u = s[1],
  1565. v = s[2],
  1566. G = s[3],
  1567. c = L + (M - L) * h | 0,
  1568. d = E + (A - E) * h | 0,
  1569. g = I + (w - I) * h | 0,
  1570. y = x + (O - x) * h | 0,
  1571. m = D + (R - D) * h | 0,
  1572. T = b + (F - b) * h | 0,
  1573. P = C + (N - C) * h | 0,
  1574. S = B + (U - B) * h | 0,
  1575. _ = c + (d - c) * u | 0,
  1576. a = g + (y - g) * u | 0,
  1577. l = m + (T - m) * u | 0,
  1578. $ = P + (S - P) * u | 0,
  1579. p = _ + (a - _) * v | 0,
  1580. f = l + ($ - l) * v | 0;
  1581. return p + (f - p) * G | 0
  1582. }
  1583. for (var Y = 1 << o, k = new Float32Array(Y), V = 0; V < Y; V++) {
  1584. for (var X = V, z = 1, H = 0; H < o; H++) z *= X % 2 == 0 ? 1 - s[H] : s[H], X /= 2;
  1585. k[V] = z
  1586. }
  1587. for (var W = new Float32Array(Y), j = 0; j < Y; j++) W[j] = r[n[j]];
  1588. for (var q = 0, j = 0; j < Y; j++) q += k[j] * W[j];
  1589. return q + .5 | 0
  1590. }, v._$br = function(t, i, e, r) {
  1591. var o = i._$Q2(t, e),
  1592. n = t._$vs(),
  1593. s = t._$Tr();
  1594. if (i._$zr(n, s, o), o <= 0) return r[n[0]];
  1595. if (1 == o) {
  1596. var _ = r[n[0]],
  1597. a = r[n[1]],
  1598. h = s[0];
  1599. return _ + (a - _) * h
  1600. }
  1601. if (2 == o) {
  1602. var _ = r[n[0]],
  1603. a = r[n[1]],
  1604. l = r[n[2]],
  1605. $ = r[n[3]],
  1606. h = s[0],
  1607. u = s[1];
  1608. return (1 - u) * (_ + (a - _) * h) + u * (l + ($ - l) * h)
  1609. }
  1610. if (3 == o) {
  1611. var p = r[n[0]],
  1612. f = r[n[1]],
  1613. c = r[n[2]],
  1614. d = r[n[3]],
  1615. g = r[n[4]],
  1616. y = r[n[5]],
  1617. m = r[n[6]],
  1618. T = r[n[7]],
  1619. h = s[0],
  1620. u = s[1],
  1621. P = s[2];
  1622. return (1 - P) * ((1 - u) * (p + (f - p) * h) + u * (c + (d - c) * h)) + P * ((1 - u) * (g + (y - g) * h) + u * (m + (T - m) * h))
  1623. }
  1624. if (4 == o) {
  1625. var S = r[n[0]],
  1626. v = r[n[1]],
  1627. L = r[n[2]],
  1628. M = r[n[3]],
  1629. E = r[n[4]],
  1630. A = r[n[5]],
  1631. I = r[n[6]],
  1632. w = r[n[7]],
  1633. x = r[n[8]],
  1634. O = r[n[9]],
  1635. D = r[n[10]],
  1636. R = r[n[11]],
  1637. b = r[n[12]],
  1638. F = r[n[13]],
  1639. C = r[n[14]],
  1640. N = r[n[15]],
  1641. h = s[0],
  1642. u = s[1],
  1643. P = s[2],
  1644. B = s[3];
  1645. return (1 - B) * ((1 - P) * ((1 - u) * (S + (v - S) * h) + u * (L + (M - L) * h)) + P * ((1 - u) * (E + (A - E) * h) + u * (I + (w - I) * h))) + B * ((1 - P) * ((1 - u) * (x + (O - x) * h) + u * (D + (R - D) * h)) + P * ((1 - u) * (b + (F - b) * h) + u * (C + (N - C) * h)))
  1646. }
  1647. for (var U = 1 << o, G = new Float32Array(U), Y = 0; Y < U; Y++) {
  1648. for (var k = Y, V = 1, X = 0; X < o; X++) V *= k % 2 == 0 ? 1 - s[X] : s[X], k /= 2;
  1649. G[Y] = V
  1650. }
  1651. for (var z = new Float32Array(U), H = 0; H < U; H++) z[H] = r[n[H]];
  1652. for (var W = 0, H = 0; H < U; H++) W += G[H] * z[H];
  1653. return W
  1654. }, v._$Vr = function(t, i, e, r, o, n, s, _) {
  1655. var a = i._$Q2(t, e),
  1656. h = t._$vs(),
  1657. l = t._$Tr();
  1658. i._$zr(h, l, a);
  1659. var $ = 2 * r,
  1660. u = s;
  1661. if (a <= 0) {
  1662. var p = h[0],
  1663. f = o[p];
  1664. if (2 == _ && 0 == s) w._$jT(f, 0, n, 0, $);
  1665. else for (var c = 0; c < $;) n[u] = f[c++], n[u + 1] = f[c++], u += _
  1666. } else if (1 == a) for (var f = o[h[0]], d = o[h[1]], g = l[0], y = 1 - g, c = 0; c < $;) n[u] = f[c] * y + d[c] * g, ++c, n[u + 1] = f[c] * y + d[c] * g, ++c, u += _;
  1667. else if (2 == a) for (var f = o[h[0]], d = o[h[1]], m = o[h[2]], T = o[h[3]], g = l[0], P = l[1], y = 1 - g, S = 1 - P, v = S * y, L = S * g, M = P * y, E = P * g, c = 0; c < $;) n[u] = v * f[c] + L * d[c] + M * m[c] + E * T[c], ++c, n[u + 1] = v * f[c] + L * d[c] + M * m[c] + E * T[c], ++c, u += _;
  1668. else if (3 == a) for (var A = o[h[0]], I = o[h[1]], x = o[h[2]], O = o[h[3]], D = o[h[4]], R = o[h[5]], b = o[h[6]], F = o[h[7]], g = l[0], P = l[1], C = l[2], y = 1 - g, S = 1 - P, N = 1 - C, B = N * S * y, U = N * S * g, G = N * P * y, Y = N * P * g, k = C * S * y, V = C * S * g, X = C * P * y, z = C * P * g, c = 0; c < $;) n[u] = B * A[c] + U * I[c] + G * x[c] + Y * O[c] + k * D[c] + V * R[c] + X * b[c] + z * F[c], ++c, n[u + 1] = B * A[c] + U * I[c] + G * x[c] + Y * O[c] + k * D[c] + V * R[c] + X * b[c] + z * F[c], ++c, u += _;
  1669. else if (4 == a) for (var H = o[h[0]], W = o[h[1]], j = o[h[2]], q = o[h[3]], J = o[h[4]], Q = o[h[5]], Z = o[h[6]], K = o[h[7]], tt = o[h[8]], it = o[h[9]], et = o[h[10]], rt = o[h[11]], ot = o[h[12]], nt = o[h[13]], st = o[h[14]], _t = o[h[15]], g = l[0], P = l[1], C = l[2], at = l[3], y = 1 - g, S = 1 - P, N = 1 - C, ht = 1 - at, lt = ht * N * S * y, $t = ht * N * S * g, ut = ht * N * P * y, pt = ht * N * P * g, ft = ht * C * S * y, ct = ht * C * S * g, dt = ht * C * P * y, gt = ht * C * P * g, yt = at * N * S * y, mt = at * N * S * g, Tt = at * N * P * y, Pt = at * N * P * g, St = at * C * S * y, vt = at * C * S * g, Lt = at * C * P * y, Mt = at * C * P * g, c = 0; c < $;) n[u] = lt * H[c] + $t * W[c] + ut * j[c] + pt * q[c] + ft * J[c] + ct * Q[c] + dt * Z[c] + gt * K[c] + yt * tt[c] + mt * it[c] + Tt * et[c] + Pt * rt[c] + St * ot[c] + vt * nt[c] + Lt * st[c] + Mt * _t[c], ++c, n[u + 1] = lt * H[c] + $t * W[c] + ut * j[c] + pt * q[c] + ft * J[c] + ct * Q[c] + dt * Z[c] + gt * K[c] + yt * tt[c] + mt * it[c] + Tt * et[c] + Pt * rt[c] + St * ot[c] + vt * nt[c] + Lt * st[c] + Mt * _t[c], ++c, u += _;
  1670. else {
  1671. for (var Et = 1 << a, At = new Float32Array(Et), It = 0; It < Et; It++) {
  1672. for (var wt = It, xt = 1, Ot = 0; Ot < a; Ot++) xt *= wt % 2 == 0 ? 1 - l[Ot] : l[Ot], wt /= 2;
  1673. At[It] = xt
  1674. }
  1675. for (var Dt = new Float32Array(Et), Rt = 0; Rt < Et; Rt++) Dt[Rt] = o[h[Rt]];
  1676. for (var c = 0; c < $;) {
  1677. for (var bt = 0, Ft = 0, Ct = c + 1, Rt = 0; Rt < Et; Rt++) bt += At[Rt] * Dt[Rt][c], Ft += At[Rt] * Dt[Rt][Ct];
  1678. c += 2, n[u] = bt, n[u + 1] = Ft, u += _
  1679. }
  1680. }
  1681. }, L.prototype._$HT = function(t, i) {
  1682. this.x = t, this.y = i
  1683. }, L.prototype._$HT = function(t) {
  1684. this.x = t.x, this.y = t.y
  1685. }, M._$ur = -2, M._$ES = 500, M._$wb = 2, M._$8S = 3, M._$52 = M._$ES, M._$R2 = M._$ES, M._$or = function() {
  1686. return M._$52
  1687. }, M._$Pr = function() {
  1688. return M._$R2
  1689. }, M.prototype.convertClipIDForV2_11 = function(t) {
  1690. var i = [];
  1691. return null == t ? null : 0 == t.length ? null : /,/.test(t) ? i = t.id.split(",") : (i.push(t.id), i)
  1692. }, M.prototype._$F0 = function(t) {
  1693. this._$gP = t._$nP(), this._$dr = t._$nP(), this._$GS = t._$nP(), this._$qb = t._$6L(), this._$Lb = t._$cS(), this._$mS = t._$Tb(), t.getFormatVersion() >= G._$T7 ? (this.clipID = t._$nP(), this.clipIDList = this.convertClipIDForV2_11(this.clipID)) : this.clipIDList = [], this._$MS(this._$Lb)
  1694. }, M.prototype.getClipIDList = function() {
  1695. return this.clipIDList
  1696. }, M.prototype.init = function(t) {}, M.prototype._$Nr = function(t, i) {
  1697. if (i._$IS[0] = !1, i._$Us = v._$Z2(t, this._$GS, i._$IS, this._$Lb), at._$Zs);
  1698. else if (i._$IS[0]) return;
  1699. i._$7s = v._$br(t, this._$GS, i._$IS, this._$mS)
  1700. }, M.prototype._$2b = function(t, i) {}, M.prototype.getDrawDataID = function() {
  1701. return this._$gP
  1702. }, M.prototype._$j2 = function(t) {
  1703. this._$gP = t
  1704. }, M.prototype.getOpacity = function(t, i) {
  1705. return i._$7s
  1706. }, M.prototype._$zS = function(t, i) {
  1707. return i._$Us
  1708. }, M.prototype._$MS = function(t) {
  1709. for (var i = t.length - 1; i >= 0; --i) {
  1710. var e = t[i];
  1711. e < M._$52 ? M._$52 = e : e > M._$R2 && (M._$R2 = e)
  1712. }
  1713. }, M.prototype.getTargetBaseDataID = function() {
  1714. return this._$dr
  1715. }, M.prototype._$gs = function(t) {
  1716. this._$dr = t
  1717. }, M.prototype._$32 = function() {
  1718. return null != this._$dr && this._$dr != yt._$2o()
  1719. }, M.prototype.preDraw = function(t, i, e) {}, M.prototype.draw = function(t, i, e) {}, M.prototype.getType = function() {}, M.prototype._$B2 = function(t, i, e) {}, E._$ps = 32, E.CLIPPING_PROCESS_NONE = 0, E.CLIPPING_PROCESS_OVERWRITE_ALPHA = 1, E.CLIPPING_PROCESS_MULTIPLY_ALPHA = 2, E.CLIPPING_PROCESS_DRAW = 3, E.CLIPPING_PROCESS_CLEAR_ALPHA = 4, E.prototype.setChannelFlagAsColor = function(t, i) {
  1720. this.CHANNEL_COLORS[t] = i
  1721. }, E.prototype.getChannelFlagAsColor = function(t) {
  1722. return this.CHANNEL_COLORS[t]
  1723. }, E.prototype._$ZT = function() {}, E.prototype._$Uo = function(t, i, e, r, o, n, s) {}, E.prototype._$Rs = function() {
  1724. return -1
  1725. }, E.prototype._$Ds = function(t) {}, E.prototype.setBaseColor = function(t, i, e, r) {
  1726. t < 0 ? t = 0 : t > 1 && (t = 1), i < 0 ? i = 0 : i > 1 && (i = 1), e < 0 ? e = 0 : e > 1 && (e = 1), r < 0 ? r = 0 : r > 1 && (r = 1), this._$lT = t, this._$C0 = i, this._$tT = e, this._$WL = r
  1727. }, E.prototype._$WP = function(t) {
  1728. this.culling = t
  1729. }, E.prototype.setMatrix = function(t) {
  1730. for (var i = 0; i < 16; i++) this.matrix4x4[i] = t[i]
  1731. }, E.prototype._$IT = function() {
  1732. return this.matrix4x4
  1733. }, E.prototype.setPremultipliedAlpha = function(t) {
  1734. this.premultipliedAlpha = t
  1735. }, E.prototype.isPremultipliedAlpha = function() {
  1736. return this.premultipliedAlpha
  1737. }, E.prototype.setAnisotropy = function(t) {
  1738. this.anisotropy = t
  1739. }, E.prototype.getAnisotropy = function() {
  1740. return this.anisotropy
  1741. }, E.prototype.getClippingProcess = function() {
  1742. return this.clippingProcess
  1743. }, E.prototype.setClippingProcess = function(t) {
  1744. this.clippingProcess = t
  1745. }, E.prototype.setClipBufPre_clipContextForMask = function(t) {
  1746. this.clipBufPre_clipContextMask = t
  1747. }, E.prototype.getClipBufPre_clipContextMask = function() {
  1748. return this.clipBufPre_clipContextMask
  1749. }, E.prototype.setClipBufPre_clipContextForDraw = function(t) {
  1750. this.clipBufPre_clipContextDraw = t
  1751. }, E.prototype.getClipBufPre_clipContextDraw = function() {
  1752. return this.clipBufPre_clipContextDraw
  1753. }, I._$ur = -2, I._$c2 = 1, I._$_b = 2, I.prototype._$F0 = function(t) {
  1754. this._$kP = t._$nP(), this._$dr = t._$nP()
  1755. }, I.prototype.readV2_opacity = function(t) {
  1756. t.getFormatVersion() >= G.LIVE2D_FORMAT_VERSION_V2_10_SDK2 && (this._$mS = t._$Tb())
  1757. }, I.prototype.init = function(t) {}, I.prototype._$Nr = function(t, i) {}, I.prototype.interpolateOpacity = function(t, i, e, r) {
  1758. null == this._$mS ? e.setInterpolatedOpacity(1) : e.setInterpolatedOpacity(v._$br(t, i, r, this._$mS))
  1759. }, I.prototype._$2b = function(t, i) {}, I.prototype._$nb = function(t, i, e, r, o, n, s) {}, I.prototype.getType = function() {}, I.prototype._$gs = function(t) {
  1760. this._$dr = t
  1761. }, I.prototype._$a2 = function(t) {
  1762. this._$kP = t
  1763. }, I.prototype.getTargetBaseDataID = function() {
  1764. return this._$dr
  1765. }, I.prototype.getBaseDataID = function() {
  1766. return this._$kP
  1767. }, I.prototype._$32 = function() {
  1768. return null != this._$dr && this._$dr != yt._$2o()
  1769. }, w._$W2 = 0, w._$CS = w._$W2, w._$Mo = function() {
  1770. return !0
  1771. }, w._$XP = function(t) {
  1772. try {
  1773. for (var i = getTimeMSec(); getTimeMSec() - i < t;);
  1774. } catch (t) {
  1775. t._$Rb()
  1776. }
  1777. }, w.getUserTimeMSec = function() {
  1778. return w._$CS == w._$W2 ? w.getSystemTimeMSec() : w._$CS
  1779. }, w.setUserTimeMSec = function(t) {
  1780. w._$CS = t
  1781. }, w.updateUserTimeMSec = function() {
  1782. return w._$CS = w.getSystemTimeMSec()
  1783. }, w.getTimeMSec = function() {
  1784. return (new Date).getTime()
  1785. }, w.getSystemTimeMSec = function() {
  1786. return (new Date).getTime()
  1787. }, w._$Q = function(t) {}, w._$jT = function(t, i, e, r, o) {
  1788. for (var n = 0; n < o; n++) e[r + n] = t[i + n]
  1789. }, x._$ds = -2, x.prototype._$F0 = function(t) {
  1790. this._$wL = t._$nP(), this._$VP = t._$6L(), this._$GP = t._$nP()
  1791. }, x.prototype.getParamIndex = function(t) {
  1792. return this._$2r != t && (this._$8o = x._$ds), this._$8o
  1793. }, x.prototype._$Pb = function(t, i) {
  1794. this._$8o = t, this._$2r = i
  1795. }, x.prototype.getParamID = function() {
  1796. return this._$wL
  1797. }, x.prototype._$yP = function(t) {
  1798. this._$wL = t
  1799. }, x.prototype._$N2 = function() {
  1800. return this._$VP
  1801. }, x.prototype._$d2 = function() {
  1802. return this._$GP
  1803. }, x.prototype._$t2 = function(t, i) {
  1804. this._$VP = t, this._$GP = i
  1805. }, x.prototype._$Lr = function() {
  1806. return this._$O2
  1807. }, x.prototype._$wr = function(t) {
  1808. this._$O2 = t
  1809. }, x.prototype._$SL = function() {
  1810. return this._$ri
  1811. }, x.prototype._$AL = function(t) {
  1812. this._$ri = t
  1813. }, O.startsWith = function(t, i, e) {
  1814. var r = i + e.length;
  1815. if (r >= t.length) return !1;
  1816. for (var o = i; o < r; o++) if (O.getChar(t, o) != e.charAt(o - i)) return !1;
  1817. return !0
  1818. }, O.getChar = function(t, i) {
  1819. return String.fromCharCode(t.getUint8(i))
  1820. }, O.createString = function(t, i, e) {
  1821. for (var r = new ArrayBuffer(2 * e), o = new Uint16Array(r), n = 0; n < e; n++) o[n] = t.getUint8(i + n);
  1822. return String.fromCharCode.apply(null, o)
  1823. }, O._$LS = function(t, i, e, r) {
  1824. t instanceof ArrayBuffer && (t = new DataView(t));
  1825. var o = e,
  1826. n = !1,
  1827. s = !1,
  1828. _ = 0,
  1829. a = O.getChar(t, o);
  1830. "-" == a && (n = !0, o++);
  1831. for (var h = !1; o < i; o++) {
  1832. switch (a = O.getChar(t, o)) {
  1833. case "0":
  1834. _ *= 10;
  1835. break;
  1836. case "1":
  1837. _ = 10 * _ + 1;
  1838. break;
  1839. case "2":
  1840. _ = 10 * _ + 2;
  1841. break;
  1842. case "3":
  1843. _ = 10 * _ + 3;
  1844. break;
  1845. case "4":
  1846. _ = 10 * _ + 4;
  1847. break;
  1848. case "5":
  1849. _ = 10 * _ + 5;
  1850. break;
  1851. case "6":
  1852. _ = 10 * _ + 6;
  1853. break;
  1854. case "7":
  1855. _ = 10 * _ + 7;
  1856. break;
  1857. case "8":
  1858. _ = 10 * _ + 8;
  1859. break;
  1860. case "9":
  1861. _ = 10 * _ + 9;
  1862. break;
  1863. case ".":
  1864. s = !0, o++, h = !0;
  1865. break;
  1866. default:
  1867. h = !0
  1868. }
  1869. if (h) break
  1870. }
  1871. if (s) for (var l = .1, $ = !1; o < i; o++) {
  1872. switch (a = O.getChar(t, o)) {
  1873. case "0":
  1874. break;
  1875. case "1":
  1876. _ += 1 * l;
  1877. break;
  1878. case "2":
  1879. _ += 2 * l;
  1880. break;
  1881. case "3":
  1882. _ += 3 * l;
  1883. break;
  1884. case "4":
  1885. _ += 4 * l;
  1886. break;
  1887. case "5":
  1888. _ += 5 * l;
  1889. break;
  1890. case "6":
  1891. _ += 6 * l;
  1892. break;
  1893. case "7":
  1894. _ += 7 * l;
  1895. break;
  1896. case "8":
  1897. _ += 8 * l;
  1898. break;
  1899. case "9":
  1900. _ += 9 * l;
  1901. break;
  1902. default:
  1903. $ = !0
  1904. }
  1905. if (l *= .1, $) break
  1906. }
  1907. return n && (_ = -_), r[0] = o, _
  1908. }, D.prototype._$zP = function() {
  1909. this._$Ob = new Array
  1910. }, D.prototype._$F0 = function(t) {
  1911. this._$Ob = t._$nP()
  1912. }, D.prototype._$Ur = function(t) {
  1913. if (t._$WS()) return !0;
  1914. for (var i = t._$v2(), e = this._$Ob.length - 1; e >= 0; --e) {
  1915. var r = this._$Ob[e].getParamIndex(i);
  1916. if (r == x._$ds && (r = t.getParamIndex(this._$Ob[e].getParamID())), t._$Xb(r)) return !0
  1917. }
  1918. return !1
  1919. }, D.prototype._$Q2 = function(t, i) {
  1920. for (var e, r, o = this._$Ob.length, n = t._$v2(), s = 0, _ = 0; _ < o; _++) {
  1921. var a = this._$Ob[_];
  1922. if (e = a.getParamIndex(n), e == x._$ds && (e = t.getParamIndex(a.getParamID()), a._$Pb(e, n)), e < 0) throw new Exception("err 23242 : " + a.getParamID());
  1923. var h = e < 0 ? 0 : t.getParamFloat(e);
  1924. r = a._$N2();
  1925. var l, $, u = a._$d2(),
  1926. p = -1,
  1927. f = 0;
  1928. if (r < 1);
  1929. else if (1 == r) l = u[0], l - U._$J < h && h < l + U._$J ? (p = 0, f = 0) : (p = 0, i[0] = !0);
  1930. else if (l = u[0], h < l - U._$J) p = 0, i[0] = !0;
  1931. else if (h < l + U._$J) p = 0;
  1932. else {
  1933. for (var c = !1, d = 1; d < r; ++d) {
  1934. if ($ = u[d], h < $ + U._$J) {
  1935. $ - U._$J < h ? p = d : (p = d - 1, f = (h - l) / ($ - l), s++), c = !0;
  1936. break
  1937. }
  1938. l = $
  1939. }
  1940. c || (p = r - 1, f = 0, i[0] = !0)
  1941. }
  1942. a._$wr(p), a._$AL(f)
  1943. }
  1944. return s
  1945. }, D.prototype._$zr = function(t, i, e) {
  1946. var r = 1 << e;
  1947. r + 1 > U._$Qb && console.log("err 23245\n");
  1948. for (var o = this._$Ob.length, n = 1, s = 1, _ = 0, a = 0; a < r; ++a) t[a] = 0;
  1949. for (var h = 0; h < o; ++h) {
  1950. var l = this._$Ob[h];
  1951. if (0 == l._$SL()) {
  1952. var $ = l._$Lr() * n;
  1953. if ($ < 0 && at._$3T) throw new Exception("err 23246");
  1954. for (var a = 0; a < r; ++a) t[a] += $
  1955. } else {
  1956. for (var $ = n * l._$Lr(), u = n * (l._$Lr() + 1), a = 0; a < r; ++a) t[a] += (a / s | 0) % 2 == 0 ? $ : u;
  1957. i[_++] = l._$SL(), s *= 2
  1958. }
  1959. n *= l._$N2()
  1960. }
  1961. t[r] = 65535, i[_] = -1
  1962. }, D.prototype._$h2 = function(t, i, e) {
  1963. for (var r = new Float32Array(i), o = 0; o < i; ++o) r[o] = e[o];
  1964. var n = new x;
  1965. n._$yP(t), n._$t2(i, r), this._$Ob.push(n)
  1966. }, D.prototype._$J2 = function(t) {
  1967. for (var i = t, e = this._$Ob.length, r = 0; r < e; ++r) {
  1968. var o = this._$Ob[r],
  1969. n = o._$N2(),
  1970. s = i % o._$N2(),
  1971. _ = o._$d2()[s];
  1972. console.log("%s[%d]=%7.2f / ", o.getParamID(), s, _), i /= n
  1973. }
  1974. console.log("\n")
  1975. }, D.prototype.getParamCount = function() {
  1976. return this._$Ob.length
  1977. }, D.prototype._$zs = function() {
  1978. return this._$Ob
  1979. }, R.prototype.identity = function() {
  1980. for (var t = 0; t < 16; t++) this.m[t] = t % 5 == 0 ? 1 : 0
  1981. }, R.prototype.getArray = function() {
  1982. return this.m
  1983. }, R.prototype.getCopyMatrix = function() {
  1984. return new Float32Array(this.m)
  1985. }, R.prototype.setMatrix = function(t) {
  1986. if (null != t && 16 == t.length) for (var i = 0; i < 16; i++) this.m[i] = t[i]
  1987. }, R.prototype.mult = function(t, i, e) {
  1988. return null == i ? null : (this == i ? this.mult_safe(this.m, t.m, i.m, e) : this.mult_fast(this.m, t.m, i.m, e), i)
  1989. }, R.prototype.mult_safe = function(t, i, e, r) {
  1990. if (t == e) {
  1991. var o = new Array(16);
  1992. this.mult_fast(t, i, o, r);
  1993. for (var n = 15; n >= 0; --n) e[n] = o[n]
  1994. } else this.mult_fast(t, i, e, r)
  1995. }, R.prototype.mult_fast = function(t, i, e, r) {
  1996. r ? (e[0] = t[0] * i[0] + t[4] * i[1] + t[8] * i[2], e[4] = t[0] * i[4] + t[4] * i[5] + t[8] * i[6], e[8] = t[0] * i[8] + t[4] * i[9] + t[8] * i[10], e[12] = t[0] * i[12] + t[4] * i[13] + t[8] * i[14] + t[12], e[1] = t[1] * i[0] + t[5] * i[1] + t[9] * i[2], e[5] = t[1] * i[4] + t[5] * i[5] + t[9] * i[6], e[9] = t[1] * i[8] + t[5] * i[9] + t[9] * i[10], e[13] = t[1] * i[12] + t[5] * i[13] + t[9] * i[14] + t[13], e[2] = t[2] * i[0] + t[6] * i[1] + t[10] * i[2], e[6] = t[2] * i[4] + t[6] * i[5] + t[10] * i[6], e[10] = t[2] * i[8] + t[6] * i[9] + t[10] * i[10], e[14] = t[2] * i[12] + t[6] * i[13] + t[10] * i[14] + t[14], e[3] = e[7] = e[11] = 0, e[15] = 1) : (e[0] = t[0] * i[0] + t[4] * i[1] + t[8] * i[2] + t[12] * i[3], e[4] = t[0] * i[4] + t[4] * i[5] + t[8] * i[6] + t[12] * i[7], e[8] = t[0] * i[8] + t[4] * i[9] + t[8] * i[10] + t[12] * i[11], e[12] = t[0] * i[12] + t[4] * i[13] + t[8] * i[14] + t[12] * i[15], e[1] = t[1] * i[0] + t[5] * i[1] + t[9] * i[2] + t[13] * i[3], e[5] = t[1] * i[4] + t[5] * i[5] + t[9] * i[6] + t[13] * i[7], e[9] = t[1] * i[8] + t[5] * i[9] + t[9] * i[10] + t[13] * i[11], e[13] = t[1] * i[12] + t[5] * i[13] + t[9] * i[14] + t[13] * i[15], e[2] = t[2] * i[0] + t[6] * i[1] + t[10] * i[2] + t[14] * i[3], e[6] = t[2] * i[4] + t[6] * i[5] + t[10] * i[6] + t[14] * i[7], e[10] = t[2] * i[8] + t[6] * i[9] + t[10] * i[10] + t[14] * i[11], e[14] = t[2] * i[12] + t[6] * i[13] + t[10] * i[14] + t[14] * i[15], e[3] = t[3] * i[0] + t[7] * i[1] + t[11] * i[2] + t[15] * i[3], e[7] = t[3] * i[4] + t[7] * i[5] + t[11] * i[6] + t[15] * i[7], e[11] = t[3] * i[8] + t[7] * i[9] + t[11] * i[10] + t[15] * i[11], e[15] = t[3] * i[12] + t[7] * i[13] + t[11] * i[14] + t[15] * i[15])
  1997. }, R.prototype.translate = function(t, i, e) {
  1998. this.m[12] = this.m[0] * t + this.m[4] * i + this.m[8] * e + this.m[12], this.m[13] = this.m[1] * t + this.m[5] * i + this.m[9] * e + this.m[13], this.m[14] = this.m[2] * t + this.m[6] * i + this.m[10] * e + this.m[14], this.m[15] = this.m[3] * t + this.m[7] * i + this.m[11] * e + this.m[15]
  1999. }, R.prototype.scale = function(t, i, e) {
  2000. this.m[0] *= t, this.m[4] *= i, this.m[8] *= e, this.m[1] *= t, this.m[5] *= i, this.m[9] *= e, this.m[2] *= t, this.m[6] *= i, this.m[10] *= e, this.m[3] *= t, this.m[7] *= i, this.m[11] *= e
  2001. }, R.prototype.rotateX = function(t) {
  2002. var i = Lt.fcos(t),
  2003. e = Lt._$9(t),
  2004. r = this.m[4];
  2005. this.m[4] = r * i + this.m[8] * e, this.m[8] = r * -e + this.m[8] * i, r = this.m[5], this.m[5] = r * i + this.m[9] * e, this.m[9] = r * -e + this.m[9] * i, r = this.m[6], this.m[6] = r * i + this.m[10] * e, this.m[10] = r * -e + this.m[10] * i, r = this.m[7], this.m[7] = r * i + this.m[11] * e, this.m[11] = r * -e + this.m[11] * i
  2006. }, R.prototype.rotateY = function(t) {
  2007. var i = Lt.fcos(t),
  2008. e = Lt._$9(t),
  2009. r = this.m[0];
  2010. this.m[0] = r * i + this.m[8] * -e, this.m[8] = r * e + this.m[8] * i, r = this.m[1], this.m[1] = r * i + this.m[9] * -e, this.m[9] = r * e + this.m[9] * i, r = m[2], this.m[2] = r * i + this.m[10] * -e, this.m[10] = r * e + this.m[10] * i, r = m[3], this.m[3] = r * i + this.m[11] * -e, this.m[11] = r * e + this.m[11] * i
  2011. }, R.prototype.rotateZ = function(t) {
  2012. var i = Lt.fcos(t),
  2013. e = Lt._$9(t),
  2014. r = this.m[0];
  2015. this.m[0] = r * i + this.m[4] * e, this.m[4] = r * -e + this.m[4] * i, r = this.m[1], this.m[1] = r * i + this.m[5] * e, this.m[5] = r * -e + this.m[5] * i, r = this.m[2], this.m[2] = r * i + this.m[6] * e, this.m[6] = r * -e + this.m[6] * i, r = this.m[3], this.m[3] = r * i + this.m[7] * e, this.m[7] = r * -e + this.m[7] * i
  2016. }, b.prototype = new et, b._$tP = new Object, b._$27 = function() {
  2017. b._$tP.clear()
  2018. }, b.getID = function(t) {
  2019. var i = b._$tP[t];
  2020. return null == i && (i = new b(t), b._$tP[t] = i), i
  2021. }, b.prototype._$3s = function() {
  2022. return new b
  2023. }, F._$kS = -1, F._$pS = 0, F._$hb = 1, F.STATE_IDENTITY = 0, F._$gb = 1, F._$fo = 2, F._$go = 4, F.prototype.transform = function(t, i, e) {
  2024. var r, o, n, s, _, a, h = 0,
  2025. l = 0;
  2026. switch (this._$hi) {
  2027. default:
  2028. return;
  2029. case F._$go | F._$fo | F._$gb:
  2030. for (r = this._$7, o = this._$H, n = this._$k, s = this._$f, _ = this._$g, a = this._$w; --e >= 0;) {
  2031. var $ = t[h++],
  2032. u = t[h++];
  2033. i[l++] = r * $ + o * u + n, i[l++] = s * $ + _ * u + a
  2034. }
  2035. return;
  2036. case F._$go | F._$fo:
  2037. for (r = this._$7, o = this._$H, s = this._$f, _ = this._$g; --e >= 0;) {
  2038. var $ = t[h++],
  2039. u = t[h++];
  2040. i[l++] = r * $ + o * u, i[l++] = s * $ + _ * u
  2041. }
  2042. return;
  2043. case F._$go | F._$gb:
  2044. for (o = this._$H, n = this._$k, s = this._$f, a = this._$w; --e >= 0;) {
  2045. var $ = t[h++];
  2046. i[l++] = o * t[h++] + n, i[l++] = s * $ + a
  2047. }
  2048. return;
  2049. case F._$go:
  2050. for (o = this._$H, s = this._$f; --e >= 0;) {
  2051. var $ = t[h++];
  2052. i[l++] = o * t[h++], i[l++] = s * $
  2053. }
  2054. return;
  2055. case F._$fo | F._$gb:
  2056. for (r = this._$7, n = this._$k, _ = this._$g, a = this._$w; --e >= 0;) i[l++] = r * t[h++] + n, i[l++] = _ * t[h++] + a;
  2057. return;
  2058. case F._$fo:
  2059. for (r = this._$7, _ = this._$g; --e >= 0;) i[l++] = r * t[h++], i[l++] = _ * t[h++];
  2060. return;
  2061. case F._$gb:
  2062. for (n = this._$k, a = this._$w; --e >= 0;) i[l++] = t[h++] + n, i[l++] = t[h++] + a;
  2063. return;
  2064. case F.STATE_IDENTITY:
  2065. return void(t == i && h == l || w._$jT(t, h, i, l, 2 * e))
  2066. }
  2067. }, F.prototype.update = function() {
  2068. 0 == this._$H && 0 == this._$f ? 1 == this._$7 && 1 == this._$g ? 0 == this._$k && 0 == this._$w ? (this._$hi = F.STATE_IDENTITY, this._$Z = F._$pS) : (this._$hi = F._$gb, this._$Z = F._$hb) : 0 == this._$k && 0 == this._$w ? (this._$hi = F._$fo, this._$Z = F._$kS) : (this._$hi = F._$fo | F._$gb, this._$Z = F._$kS) : 0 == this._$7 && 0 == this._$g ? 0 == this._$k && 0 == this._$w ? (this._$hi = F._$go, this._$Z = F._$kS) : (this._$hi = F._$go | F._$gb, this._$Z = F._$kS) : 0 == this._$k && 0 == this._$w ? (this._$hi = F._$go | F._$fo, this._$Z = F._$kS) : (this._$hi = F._$go | F._$fo | F._$gb, this._$Z = F._$kS)
  2069. }, F.prototype._$RT = function(t) {
  2070. this._$IT(t);
  2071. var i = t[0],
  2072. e = t[2],
  2073. r = t[1],
  2074. o = t[3],
  2075. n = Math.sqrt(i * i + r * r),
  2076. s = i * o - e * r;
  2077. 0 == n ? at._$so && console.log("affine._$RT() / rt==0") : (t[0] = n, t[1] = s / n, t[2] = (r * o + i * e) / s, t[3] = Math.atan2(r, i))
  2078. }, F.prototype._$ho = function(t, i, e, r) {
  2079. var o = new Float32Array(6),
  2080. n = new Float32Array(6);
  2081. t._$RT(o), i._$RT(n);
  2082. var s = new Float32Array(6);
  2083. s[0] = o[0] + (n[0] - o[0]) * e, s[1] = o[1] + (n[1] - o[1]) * e, s[2] = o[2] + (n[2] - o[2]) * e, s[3] = o[3] + (n[3] - o[3]) * e, s[4] = o[4] + (n[4] - o[4]) * e, s[5] = o[5] + (n[5] - o[5]) * e, r._$CT(s)
  2084. }, F.prototype._$CT = function(t) {
  2085. var i = Math.cos(t[3]),
  2086. e = Math.sin(t[3]);
  2087. this._$7 = t[0] * i, this._$f = t[0] * e, this._$H = t[1] * (t[2] * i - e), this._$g = t[1] * (t[2] * e + i), this._$k = t[4], this._$w = t[5], this.update()
  2088. }, F.prototype._$IT = function(t) {
  2089. t[0] = this._$7, t[1] = this._$f, t[2] = this._$H, t[3] = this._$g, t[4] = this._$k, t[5] = this._$w
  2090. }, C.prototype = new s, C._$cs = "VISIBLE:", C._$ar = "LAYOUT:", C._$Co = 0, C._$D2 = [], C._$1T = 1, C.loadMotion = function(t) {
  2091. var i = new C,
  2092. e = [0],
  2093. r = t.length;
  2094. i._$yT = 0;
  2095. for (var o = 0; o < r; ++o) {
  2096. var n = 255 & t[o];
  2097. if ("\n" != n && "\r" != n) if ("#" != n) if ("$" != n) {
  2098. if ("a" <= n && n <= "z" || "A" <= n && n <= "Z" || "_" == n) {
  2099. for (var s = o, _ = -1; o < r && ("\r" != (n = 255 & t[o]) && "\n" != n); ++o) if ("=" == n) {
  2100. _ = o;
  2101. break
  2102. }
  2103. if (_ >= 0) {
  2104. var a = new B;
  2105. O.startsWith(t, s, C._$cs) ? (a._$RP = B._$hs, a._$4P = new String(t, s, _ - s)) : O.startsWith(t, s, C._$ar) ? (a._$4P = new String(t, s + 7, _ - s - 7), O.startsWith(t, s + 7, "ANCHOR_X") ? a._$RP = B._$xs : O.startsWith(t, s + 7, "ANCHOR_Y") ? a._$RP = B._$us : O.startsWith(t, s + 7, "SCALE_X") ? a._$RP = B._$qs : O.startsWith(t, s + 7, "SCALE_Y") ? a._$RP = B._$Ys : O.startsWith(t, s + 7, "X") ? a._$RP = B._$ws : O.startsWith(t, s + 7, "Y") && (a._$RP = B._$Ns)) : (a._$RP = B._$Fr, a._$4P = new String(t, s, _ - s)), i.motions.push(a);
  2106. var h = 0;
  2107. for (C._$D2.clear(), o = _ + 1; o < r && ("\r" != (n = 255 & t[o]) && "\n" != n); ++o) if ("," != n && " " != n && "\t" != n) {
  2108. var l = O._$LS(t, r, o, e);
  2109. if (e[0] > 0) {
  2110. C._$D2.push(l), h++;
  2111. var $ = e[0];
  2112. if ($ < o) {
  2113. console.log("_$n0 _$hi . @Live2DMotion loadMotion()\n");
  2114. break
  2115. }
  2116. o = $
  2117. }
  2118. }
  2119. a._$I0 = C._$D2._$BL(), h > i._$yT && (i._$yT = h)
  2120. }
  2121. }
  2122. } else {
  2123. for (var s = o, _ = -1; o < r && ("\r" != (n = 255 & t[o]) && "\n" != n); ++o) if ("=" == n) {
  2124. _ = o;
  2125. break
  2126. }
  2127. var u = !1;
  2128. if (_ >= 0) for (_ == s + 4 && "f" == t[s + 1] && "p" == t[s + 2] && "s" == t[s + 3] && (u = !0), o = _ + 1; o < r && ("\r" != (n = 255 & t[o]) && "\n" != n); ++o) if ("," != n && " " != n && "\t" != n) {
  2129. var l = O._$LS(t, r, o, e);
  2130. e[0] > 0 && u && 5 < l && l < 121 && (i._$D0 = l), o = e[0]
  2131. }
  2132. for (; o < r && ("\n" != t[o] && "\r" != t[o]); ++o);
  2133. } else for (; o < r && ("\n" != t[o] && "\r" != t[o]); ++o);
  2134. }
  2135. return i._$AS = 1e3 * i._$yT / i._$D0 | 0, i
  2136. }, C.prototype.getDurationMSec = function() {
  2137. return this._$AS
  2138. }, C.prototype.dump = function() {
  2139. for (var t = 0; t < this.motions.length; t++) {
  2140. var i = this.motions[t];
  2141. console.log("_$wL[%s] [%d]. ", i._$4P, i._$I0.length);
  2142. for (var e = 0; e < i._$I0.length && e < 10; e++) console.log("%5.2f ,", i._$I0[e]);
  2143. console.log("\n")
  2144. }
  2145. }, C.prototype.updateParamExe = function(t, i, e, r) {
  2146. for (var o = i - r._$z2, n = o * this._$D0 / 1e3, s = 0 | n, _ = n - s, a = 0; a < this.motions.length; a++) {
  2147. var h = this.motions[a],
  2148. l = h._$I0.length,
  2149. $ = h._$4P;
  2150. if (h._$RP == B._$hs) {
  2151. var u = h._$I0[s >= l ? l - 1 : s];
  2152. t.setParamFloat($, u)
  2153. } else if (B._$ws <= h._$RP && h._$RP <= B._$Ys);
  2154. else {
  2155. var p = t.getParamFloat($),
  2156. f = h._$I0[s >= l ? l - 1 : s],
  2157. c = h._$I0[s + 1 >= l ? l - 1 : s + 1],
  2158. d = f + (c - f) * _,
  2159. g = p + (d - p) * e;
  2160. t.setParamFloat($, g)
  2161. }
  2162. }
  2163. s >= this._$yT && (this._$E ? (r._$z2 = i, this.loopFadeIn && (r._$bs = i)) : r._$9L = !0)
  2164. }, C.prototype._$r0 = function() {
  2165. return this._$E
  2166. }, C.prototype._$aL = function(t) {
  2167. this._$E = t
  2168. }, C.prototype.isLoopFadeIn = function() {
  2169. return this.loopFadeIn
  2170. }, C.prototype.setLoopFadeIn = function(t) {
  2171. this.loopFadeIn = t
  2172. }, N.prototype.clear = function() {
  2173. this.size = 0
  2174. }, N.prototype.add = function(t) {
  2175. if (this._$P.length <= this.size) {
  2176. var i = new Float32Array(2 * this.size);
  2177. w._$jT(this._$P, 0, i, 0, this.size), this._$P = i
  2178. }
  2179. this._$P[this.size++] = t
  2180. }, N.prototype._$BL = function() {
  2181. var t = new Float32Array(this.size);
  2182. return w._$jT(this._$P, 0, t, 0, this.size), t
  2183. }, B._$Fr = 0, B._$hs = 1, B._$ws = 100, B._$Ns = 101, B._$xs = 102, B._$us = 103, B._$qs = 104, B._$Ys = 105, U._$Ms = 1, U._$Qs = 2, U._$i2 = 0, U._$No = 2, U._$do = U._$Ms, U._$Ls = !0, U._$1r = 5, U._$Qb = 65, U._$J = 1e-4, U._$FT = .001, U._$Ss = 3, G._$o7 = 6, G._$S7 = 7, G._$s7 = 8, G._$77 = 9, G.LIVE2D_FORMAT_VERSION_V2_10_SDK2 = 10, G.LIVE2D_FORMAT_VERSION_V2_11_SDK2_1 = 11, G._$T7 = G.LIVE2D_FORMAT_VERSION_V2_11_SDK2_1, G._$Is = -2004318072, G._$h0 = 0, G._$4L = 23, G._$7P = 33, G._$uT = function(t) {
  2184. console.log("_$bo :: _$6 _$mo _$E0 : %d\n", t)
  2185. }, G._$9o = function(t) {
  2186. if (t < 40) return G._$uT(t), null;
  2187. if (t < 50) return G._$uT(t), null;
  2188. if (t < 60) return G._$uT(t), null;
  2189. if (t < 100) switch (t) {
  2190. case 65:
  2191. return new Z;
  2192. case 66:
  2193. return new D;
  2194. case 67:
  2195. return new x;
  2196. case 68:
  2197. return new z;
  2198. case 69:
  2199. return new P;
  2200. case 70:
  2201. return new $t;
  2202. default:
  2203. return G._$uT(t), null
  2204. } else if (t < 150) switch (t) {
  2205. case 131:
  2206. return new st;
  2207. case 133:
  2208. return new tt;
  2209. case 136:
  2210. return new p;
  2211. case 137:
  2212. return new ot;
  2213. case 142:
  2214. return new j
  2215. }
  2216. return G._$uT(t), null
  2217. }, Y._$HP = 0, Y._$_0 = !0;
  2218. Y._$V2 = -1, Y._$W0 = -1, Y._$jr = !1, Y._$ZS = !0, Y._$tr = -1e6, Y._$lr = 1e6, Y._$is = 32, Y._$e = !1, Y.prototype.getDrawDataIndex = function(t) {
  2219. for (var i = this._$aS.length - 1; i >= 0; --i) if (null != this._$aS[i] && this._$aS[i].getDrawDataID() == t) return i;
  2220. return -1
  2221. }, Y.prototype.getDrawData = function(t) {
  2222. if (t instanceof b) {
  2223. if (null == this._$Bo) {
  2224. this._$Bo = new Object;
  2225. for (var i = this._$aS.length, e = 0; e < i; e++) {
  2226. var r = this._$aS[e],
  2227. o = r.getDrawDataID();
  2228. null != o && (this._$Bo[o] = r)
  2229. }
  2230. }
  2231. return this._$Bo[id]
  2232. }
  2233. return t < this._$aS.length ? this._$aS[t] : null
  2234. }, Y.prototype.release = function() {
  2235. this._$3S.clear(), this._$aS.clear(), this._$F2.clear(), null != this._$Bo && this._$Bo.clear(), this._$db.clear(), this._$8b.clear(), this._$Hr.clear()
  2236. }, Y.prototype.init = function() {
  2237. this._$co++, this._$F2.length > 0 && this.release();
  2238. for (var t = this._$Ri.getModelImpl(), i = t._$Xr(), r = i.length, o = new Array, n = new Array, s = 0; s < r; ++s) {
  2239. var _ = i[s];
  2240. this._$F2.push(_), this._$Hr.push(_.init(this));
  2241. for (var a = _.getBaseData(), h = a.length, l = 0; l < h; ++l) o.push(a[l]);
  2242. for (var l = 0; l < h; ++l) {
  2243. var $ = a[l].init(this);
  2244. $._$l2(s), n.push($)
  2245. }
  2246. for (var u = _.getDrawData(), p = u.length, l = 0; l < p; ++l) {
  2247. var f = u[l],
  2248. c = f.init(this);
  2249. c._$IP = s, this._$aS.push(f), this._$8b.push(c)
  2250. }
  2251. }
  2252. for (var d = o.length, g = yt._$2o();;) {
  2253. for (var y = !1, s = 0; s < d; ++s) {
  2254. var m = o[s];
  2255. if (null != m) {
  2256. var T = m.getTargetBaseDataID();
  2257. (null == T || T == g || this.getBaseDataIndex(T) >= 0) && (this._$3S.push(m), this._$db.push(n[s]), o[s] = null, y = !0)
  2258. }
  2259. }
  2260. if (!y) break
  2261. }
  2262. var P = t._$E2();
  2263. if (null != P) {
  2264. var S = P._$1s();
  2265. if (null != S) for (var v = S.length, s = 0; s < v; ++s) {
  2266. var L = S[s];
  2267. null != L && this._$02(L.getParamID(), L.getDefaultValue(), L.getMinValue(), L.getMaxValue())
  2268. }
  2269. }
  2270. this.clipManager = new e(this.dp_webgl), this.clipManager.init(this, this._$aS, this._$8b), this._$QT = !0
  2271. }, Y.prototype.update = function() {
  2272. Y._$e && _.start("_$zL");
  2273. for (var t = this._$_2.length, i = 0; i < t; i++) this._$_2[i] != this._$vr[i] && (this._$Js[i] = Y._$ZS, this._$vr[i] = this._$_2[i]);
  2274. var e = this._$3S.length,
  2275. r = this._$aS.length,
  2276. o = W._$or(),
  2277. n = W._$Pr(),
  2278. s = n - o + 1;
  2279. (null == this._$Ws || this._$Ws.length < s) && (this._$Ws = new Int16Array(s), this._$Vs = new Int16Array(s));
  2280. for (var i = 0; i < s; i++) this._$Ws[i] = Y._$V2, this._$Vs[i] = Y._$V2;
  2281. (null == this._$Er || this._$Er.length < r) && (this._$Er = new Int16Array(r));
  2282. for (var i = 0; i < r; i++) this._$Er[i] = Y._$W0;
  2283. Y._$e && _.dump("_$zL"), Y._$e && _.start("_$UL");
  2284. for (var a = null, h = 0; h < e; ++h) {
  2285. var l = this._$3S[h],
  2286. $ = this._$db[h];
  2287. try {
  2288. l._$Nr(this, $), l._$2b(this, $)
  2289. } catch (t) {
  2290. null == a && (a = t)
  2291. }
  2292. }
  2293. null != a && Y._$_0 && _._$Rb(a), Y._$e && _.dump("_$UL"), Y._$e && _.start("_$DL");
  2294. for (var u = null, p = 0; p < r; ++p) {
  2295. var f = this._$aS[p],
  2296. c = this._$8b[p];
  2297. try {
  2298. if (f._$Nr(this, c), c._$u2()) continue;
  2299. f._$2b(this, c);
  2300. var d, g = Math.floor(f._$zS(this, c) - o);
  2301. try {
  2302. d = this._$Vs[g]
  2303. } catch (t) {
  2304. console.log("_$li :: %s / %s \t\t\t\t@@_$fS\n", t.toString(), f.getDrawDataID().toString()), g = Math.floor(f._$zS(this, c) - o);
  2305. continue
  2306. }
  2307. d == Y._$V2 ? this._$Ws[g] = p : this._$Er[d] = p, this._$Vs[g] = p
  2308. } catch (t) {
  2309. null == u && (u = t, at._$sT(at._$H7))
  2310. }
  2311. }
  2312. null != u && Y._$_0 && _._$Rb(u), Y._$e && _.dump("_$DL"), Y._$e && _.start("_$eL");
  2313. for (var i = this._$Js.length - 1; i >= 0; i--) this._$Js[i] = Y._$jr;
  2314. return this._$QT = !1, Y._$e && _.dump("_$eL"), !1
  2315. }, Y.prototype.preDraw = function(t) {
  2316. null != this.clipManager && (t._$ZT(), this.clipManager.setupClip(this, t))
  2317. }, Y.prototype.draw = function(t) {
  2318. if (null == this._$Ws) return void _._$li("call _$Ri.update() before _$Ri.draw() ");
  2319. var i = this._$Ws.length;
  2320. t._$ZT();
  2321. for (var e = 0; e < i; ++e) {
  2322. var r = this._$Ws[e];
  2323. if (r != Y._$V2) for (;;) {
  2324. var o = this._$aS[r],
  2325. n = this._$8b[r];
  2326. if (n._$yo()) {
  2327. var s = n._$IP,
  2328. a = this._$Hr[s];
  2329. n._$VS = a.getPartsOpacity(), o.draw(t, this, n)
  2330. }
  2331. var h = this._$Er[r];
  2332. if (h <= r || h == Y._$W0) break;
  2333. r = h
  2334. }
  2335. }
  2336. }, Y.prototype.getParamIndex = function(t) {
  2337. for (var i = this._$pb.length - 1; i >= 0; --i) if (this._$pb[i] == t) return i;
  2338. return this._$02(t, 0, Y._$tr, Y._$lr)
  2339. }, Y.prototype._$BS = function(t) {
  2340. return this.getBaseDataIndex(t)
  2341. }, Y.prototype.getBaseDataIndex = function(t) {
  2342. for (var i = this._$3S.length - 1; i >= 0; --i) if (null != this._$3S[i] && this._$3S[i].getBaseDataID() == t) return i;
  2343. return -1
  2344. }, Y.prototype._$UT = function(t, i) {
  2345. var e = new Float32Array(i);
  2346. return w._$jT(t, 0, e, 0, t.length), e
  2347. }, Y.prototype._$02 = function(t, i, e, r) {
  2348. if (this._$qo >= this._$pb.length) {
  2349. var o = this._$pb.length,
  2350. n = new Array(2 * o);
  2351. w._$jT(this._$pb, 0, n, 0, o), this._$pb = n, this._$_2 = this._$UT(this._$_2, 2 * o), this._$vr = this._$UT(this._$vr, 2 * o), this._$Rr = this._$UT(this._$Rr, 2 * o), this._$Or = this._$UT(this._$Or, 2 * o);
  2352. var s = new Array;
  2353. w._$jT(this._$Js, 0, s, 0, o), this._$Js = s
  2354. }
  2355. return this._$pb[this._$qo] = t, this._$_2[this._$qo] = i, this._$vr[this._$qo] = i, this._$Rr[this._$qo] = e, this._$Or[this._$qo] = r, this._$Js[this._$qo] = Y._$ZS, this._$qo++
  2356. }, Y.prototype._$Zo = function(t, i) {
  2357. this._$3S[t] = i
  2358. }, Y.prototype.setParamFloat = function(t, i) {
  2359. i < this._$Rr[t] && (i = this._$Rr[t]), i > this._$Or[t] && (i = this._$Or[t]), this._$_2[t] = i
  2360. }, Y.prototype.loadParam = function() {
  2361. var t = this._$_2.length;
  2362. t > this._$fs.length && (t = this._$fs.length), w._$jT(this._$fs, 0, this._$_2, 0, t)
  2363. }, Y.prototype.saveParam = function() {
  2364. var t = this._$_2.length;
  2365. t > this._$fs.length && (this._$fs = new Float32Array(t)), w._$jT(this._$_2, 0, this._$fs, 0, t)
  2366. }, Y.prototype._$v2 = function() {
  2367. return this._$co
  2368. }, Y.prototype._$WS = function() {
  2369. return this._$QT
  2370. }, Y.prototype._$Xb = function(t) {
  2371. return this._$Js[t] == Y._$ZS
  2372. }, Y.prototype._$vs = function() {
  2373. return this._$Es
  2374. }, Y.prototype._$Tr = function() {
  2375. return this._$ZP
  2376. }, Y.prototype.getBaseData = function(t) {
  2377. return this._$3S[t]
  2378. }, Y.prototype.getParamFloat = function(t) {
  2379. return this._$_2[t]
  2380. }, Y.prototype.getParamMax = function(t) {
  2381. return this._$Or[t]
  2382. }, Y.prototype.getParamMin = function(t) {
  2383. return this._$Rr[t]
  2384. }, Y.prototype.setPartsOpacity = function(t, i) {
  2385. this._$Hr[t].setPartsOpacity(i)
  2386. }, Y.prototype.getPartsOpacity = function(t) {
  2387. return this._$Hr[t].getPartsOpacity()
  2388. }, Y.prototype.getPartsDataIndex = function(t) {
  2389. for (var i = this._$F2.length - 1; i >= 0; --i) if (null != this._$F2[i] && this._$F2[i]._$p2() == t) return i;
  2390. return -1
  2391. }, Y.prototype._$q2 = function(t) {
  2392. return this._$db[t]
  2393. }, Y.prototype._$C2 = function(t) {
  2394. return this._$8b[t]
  2395. }, Y.prototype._$Bb = function(t) {
  2396. return this._$Hr[t]
  2397. }, Y.prototype._$5s = function(t, i) {
  2398. for (var e = this._$Ws.length, r = t, o = 0; o < e; ++o) {
  2399. var n = this._$Ws[o];
  2400. if (n != Y._$V2) for (;;) {
  2401. var s = this._$8b[n];
  2402. s._$yo() && (s._$GT()._$B2(this, s, r), r += i);
  2403. var _ = this._$Er[n];
  2404. if (_ <= n || _ == Y._$W0) break;
  2405. n = _
  2406. }
  2407. }
  2408. }, Y.prototype.setDrawParam = function(t) {
  2409. this.dp_webgl = t
  2410. }, Y.prototype.getDrawParam = function() {
  2411. return this.dp_webgl
  2412. }, k._$0T = function(t) {
  2413. return k._$0T(new _$5(t))
  2414. }, k._$0T = function(t) {
  2415. if (!t.exists()) throw new _$ls(t._$3b());
  2416. for (var i, e = t.length(), r = new Int8Array(e), o = new _$Xs(new _$kb(t), 8192), n = 0;
  2417. (i = o.read(r, n, e - n)) > 0;) n += i;
  2418. return r
  2419. }, k._$C = function(t) {
  2420. var i = null,
  2421. e = null;
  2422. try {
  2423. i = t instanceof Array ? t : new _$Xs(t, 8192), e = new _$js;
  2424. for (var r, o = new Int8Array(1e3);
  2425. (r = i.read(o)) > 0;) e.write(o, 0, r);
  2426. return e._$TS()
  2427. } finally {
  2428. null != t && t.close(), null != e && (e.flush(), e.close())
  2429. }
  2430. }, V.prototype._$T2 = function() {
  2431. return w.getUserTimeMSec() + Math._$10() * (2 * this._$Br - 1)
  2432. }, V.prototype._$uo = function(t) {
  2433. this._$Br = t
  2434. }, V.prototype._$QS = function(t, i, e) {
  2435. this._$Dr = t, this._$Cb = i, this._$mr = e
  2436. }, V.prototype._$7T = function(t) {
  2437. var i, e = w.getUserTimeMSec(),
  2438. r = 0;
  2439. switch (this._$_L) {
  2440. case STATE_CLOSING:
  2441. r = (e - this._$bb) / this._$Dr, r >= 1 && (r = 1, this._$_L = wt.STATE_CLOSED, this._$bb = e), i = 1 - r;
  2442. break;
  2443. case STATE_CLOSED:
  2444. r = (e - this._$bb) / this._$Cb, r >= 1 && (this._$_L = wt.STATE_OPENING, this._$bb = e), i = 0;
  2445. break;
  2446. case STATE_OPENING:
  2447. r = (e - this._$bb) / this._$mr, r >= 1 && (r = 1, this._$_L = wt.STATE_INTERVAL, this._$12 = this._$T2()), i = r;
  2448. break;
  2449. case STATE_INTERVAL:
  2450. this._$12 < e && (this._$_L = wt.STATE_CLOSING, this._$bb = e), i = 1;
  2451. break;
  2452. case STATE_FIRST:
  2453. default:
  2454. this._$_L = wt.STATE_INTERVAL, this._$12 = this._$T2(), i = 1
  2455. }
  2456. this._$jo || (i = -i), t.setParamFloat(this._$iL, i), t.setParamFloat(this._$0L, i)
  2457. };
  2458. var wt = function() {};
  2459. wt.STATE_FIRST = "STATE_FIRST", wt.STATE_INTERVAL = "STATE_INTERVAL", wt.STATE_CLOSING = "STATE_CLOSING", wt.STATE_CLOSED = "STATE_CLOSED", wt.STATE_OPENING = "STATE_OPENING", X.prototype = new E, X._$As = 32, X._$Gr = !1, X._$NT = null, X._$vS = null, X._$no = null, X._$9r = function(t) {
  2460. return new Float32Array(t)
  2461. }, X._$vb = function(t) {
  2462. return new Int16Array(t)
  2463. }, X._$cr = function(t, i) {
  2464. return null == t || t._$yL() < i.length ? (t = X._$9r(2 * i.length), t.put(i), t._$oT(0)) : (t.clear(), t.put(i), t._$oT(0)), t
  2465. }, X._$mb = function(t, i) {
  2466. return null == t || t._$yL() < i.length ? (t = X._$vb(2 * i.length), t.put(i), t._$oT(0)) : (t.clear(), t.put(i), t._$oT(0)), t
  2467. }, X._$Hs = function() {
  2468. return X._$Gr
  2469. }, X._$as = function(t) {
  2470. X._$Gr = t
  2471. }, X.prototype.setGL = function(t) {
  2472. this.gl = t
  2473. }, X.prototype.setTransform = function(t) {
  2474. this.transform = t
  2475. }, X.prototype._$ZT = function() {}, X.prototype._$Uo = function(t, i, e, r, o, n, s, _) {
  2476. if (!(n < .01)) {
  2477. var a = this._$U2[t],
  2478. h = n > .9 ? at.EXPAND_W : 0;
  2479. this.gl.drawElements(a, e, r, o, n, h, this.transform, _)
  2480. }
  2481. }, X.prototype._$Rs = function() {
  2482. throw new Error("_$Rs")
  2483. }, X.prototype._$Ds = function(t) {
  2484. throw new Error("_$Ds")
  2485. }, X.prototype._$K2 = function() {
  2486. for (var t = 0; t < this._$sb.length; t++) {
  2487. 0 != this._$sb[t] && (this.gl._$Sr(1, this._$sb, t), this._$sb[t] = 0)
  2488. }
  2489. }, X.prototype.setTexture = function(t, i) {
  2490. this._$sb.length < t + 1 && this._$nS(t), this._$sb[t] = i
  2491. }, X.prototype.setTexture = function(t, i) {
  2492. this._$sb.length < t + 1 && this._$nS(t), this._$U2[t] = i
  2493. }, X.prototype._$nS = function(t) {
  2494. var i = Math.max(2 * this._$sb.length, t + 1 + 10),
  2495. e = new Int32Array(i);
  2496. w._$jT(this._$sb, 0, e, 0, this._$sb.length), this._$sb = e;
  2497. var r = new Array;
  2498. w._$jT(this._$U2, 0, r, 0, this._$U2.length), this._$U2 = r
  2499. }, z.prototype = new I, z._$Xo = new Float32Array(2), z._$io = new Float32Array(2), z._$0o = new Float32Array(2), z._$Lo = new Float32Array(2), z._$To = new Float32Array(2), z._$Po = new Float32Array(2), z._$gT = new Array, z.prototype._$zP = function() {
  2500. this._$GS = new D, this._$GS._$zP(), this._$Y0 = new Array
  2501. }, z.prototype.getType = function() {
  2502. return I._$c2
  2503. }, z.prototype._$F0 = function(t) {
  2504. I.prototype._$F0.call(this, t), this._$GS = t._$nP(), this._$Y0 = t._$nP(), I.prototype.readV2_opacity.call(this, t)
  2505. }, z.prototype.init = function(t) {
  2506. var i = new H(this);
  2507. return i._$Yr = new P, this._$32() && (i._$Wr = new P), i
  2508. }, z.prototype._$Nr = function(t, i) {
  2509. this != i._$GT() && console.log("### assert!! ### ");
  2510. var e = i;
  2511. if (this._$GS._$Ur(t)) {
  2512. var r = z._$gT;
  2513. r[0] = !1;
  2514. var o = this._$GS._$Q2(t, r);
  2515. i._$Ib(r[0]), this.interpolateOpacity(t, this._$GS, i, r);
  2516. var n = t._$vs(),
  2517. s = t._$Tr();
  2518. if (this._$GS._$zr(n, s, o), o <= 0) {
  2519. var _ = this._$Y0[n[0]];
  2520. e._$Yr.init(_)
  2521. } else if (1 == o) {
  2522. var _ = this._$Y0[n[0]],
  2523. a = this._$Y0[n[1]],
  2524. h = s[0];
  2525. e._$Yr._$fL = _._$fL + (a._$fL - _._$fL) * h, e._$Yr._$gL = _._$gL + (a._$gL - _._$gL) * h, e._$Yr._$B0 = _._$B0 + (a._$B0 - _._$B0) * h, e._$Yr._$z0 = _._$z0 + (a._$z0 - _._$z0) * h, e._$Yr._$qT = _._$qT + (a._$qT - _._$qT) * h
  2526. } else if (2 == o) {
  2527. var _ = this._$Y0[n[0]],
  2528. a = this._$Y0[n[1]],
  2529. l = this._$Y0[n[2]],
  2530. $ = this._$Y0[n[3]],
  2531. h = s[0],
  2532. u = s[1],
  2533. p = _._$fL + (a._$fL - _._$fL) * h,
  2534. f = l._$fL + ($._$fL - l._$fL) * h;
  2535. e._$Yr._$fL = p + (f - p) * u, p = _._$gL + (a._$gL - _._$gL) * h, f = l._$gL + ($._$gL - l._$gL) * h, e._$Yr._$gL = p + (f - p) * u, p = _._$B0 + (a._$B0 - _._$B0) * h, f = l._$B0 + ($._$B0 - l._$B0) * h, e._$Yr._$B0 = p + (f - p) * u, p = _._$z0 + (a._$z0 - _._$z0) * h, f = l._$z0 + ($._$z0 - l._$z0) * h, e._$Yr._$z0 = p + (f - p) * u, p = _._$qT + (a._$qT - _._$qT) * h, f = l._$qT + ($._$qT - l._$qT) * h, e._$Yr._$qT = p + (f - p) * u
  2536. } else if (3 == o) {
  2537. var c = this._$Y0[n[0]],
  2538. d = this._$Y0[n[1]],
  2539. g = this._$Y0[n[2]],
  2540. y = this._$Y0[n[3]],
  2541. m = this._$Y0[n[4]],
  2542. T = this._$Y0[n[5]],
  2543. P = this._$Y0[n[6]],
  2544. S = this._$Y0[n[7]],
  2545. h = s[0],
  2546. u = s[1],
  2547. v = s[2],
  2548. p = c._$fL + (d._$fL - c._$fL) * h,
  2549. f = g._$fL + (y._$fL - g._$fL) * h,
  2550. L = m._$fL + (T._$fL - m._$fL) * h,
  2551. M = P._$fL + (S._$fL - P._$fL) * h;
  2552. e._$Yr._$fL = (1 - v) * (p + (f - p) * u) + v * (L + (M - L) * u), p = c._$gL + (d._$gL - c._$gL) * h, f = g._$gL + (y._$gL - g._$gL) * h, L = m._$gL + (T._$gL - m._$gL) * h, M = P._$gL + (S._$gL - P._$gL) * h, e._$Yr._$gL = (1 - v) * (p + (f - p) * u) + v * (L + (M - L) * u), p = c._$B0 + (d._$B0 - c._$B0) * h, f = g._$B0 + (y._$B0 - g._$B0) * h, L = m._$B0 + (T._$B0 - m._$B0) * h, M = P._$B0 + (S._$B0 - P._$B0) * h, e._$Yr._$B0 = (1 - v) * (p + (f - p) * u) + v * (L + (M - L) * u), p = c._$z0 + (d._$z0 - c._$z0) * h, f = g._$z0 + (y._$z0 - g._$z0) * h, L = m._$z0 + (T._$z0 - m._$z0) * h, M = P._$z0 + (S._$z0 - P._$z0) * h, e._$Yr._$z0 = (1 - v) * (p + (f - p) * u) + v * (L + (M - L) * u), p = c._$qT + (d._$qT - c._$qT) * h, f = g._$qT + (y._$qT - g._$qT) * h, L = m._$qT + (T._$qT - m._$qT) * h, M = P._$qT + (S._$qT - P._$qT) * h, e._$Yr._$qT = (1 - v) * (p + (f - p) * u) + v * (L + (M - L) * u)
  2553. } else if (4 == o) {
  2554. var E = this._$Y0[n[0]],
  2555. A = this._$Y0[n[1]],
  2556. I = this._$Y0[n[2]],
  2557. w = this._$Y0[n[3]],
  2558. x = this._$Y0[n[4]],
  2559. O = this._$Y0[n[5]],
  2560. D = this._$Y0[n[6]],
  2561. R = this._$Y0[n[7]],
  2562. b = this._$Y0[n[8]],
  2563. F = this._$Y0[n[9]],
  2564. C = this._$Y0[n[10]],
  2565. N = this._$Y0[n[11]],
  2566. B = this._$Y0[n[12]],
  2567. U = this._$Y0[n[13]],
  2568. G = this._$Y0[n[14]],
  2569. Y = this._$Y0[n[15]],
  2570. h = s[0],
  2571. u = s[1],
  2572. v = s[2],
  2573. k = s[3],
  2574. p = E._$fL + (A._$fL - E._$fL) * h,
  2575. f = I._$fL + (w._$fL - I._$fL) * h,
  2576. L = x._$fL + (O._$fL - x._$fL) * h,
  2577. M = D._$fL + (R._$fL - D._$fL) * h,
  2578. V = b._$fL + (F._$fL - b._$fL) * h,
  2579. X = C._$fL + (N._$fL - C._$fL) * h,
  2580. H = B._$fL + (U._$fL - B._$fL) * h,
  2581. W = G._$fL + (Y._$fL - G._$fL) * h;
  2582. e._$Yr._$fL = (1 - k) * ((1 - v) * (p + (f - p) * u) + v * (L + (M - L) * u)) + k * ((1 - v) * (V + (X - V) * u) + v * (H + (W - H) * u)), p = E._$gL + (A._$gL - E._$gL) * h, f = I._$gL + (w._$gL - I._$gL) * h, L = x._$gL + (O._$gL - x._$gL) * h, M = D._$gL + (R._$gL - D._$gL) * h, V = b._$gL + (F._$gL - b._$gL) * h, X = C._$gL + (N._$gL - C._$gL) * h, H = B._$gL + (U._$gL - B._$gL) * h, W = G._$gL + (Y._$gL - G._$gL) * h, e._$Yr._$gL = (1 - k) * ((1 - v) * (p + (f - p) * u) + v * (L + (M - L) * u)) + k * ((1 - v) * (V + (X - V) * u) + v * (H + (W - H) * u)), p = E._$B0 + (A._$B0 - E._$B0) * h, f = I._$B0 + (w._$B0 - I._$B0) * h, L = x._$B0 + (O._$B0 - x._$B0) * h, M = D._$B0 + (R._$B0 - D._$B0) * h, V = b._$B0 + (F._$B0 - b._$B0) * h, X = C._$B0 + (N._$B0 - C._$B0) * h, H = B._$B0 + (U._$B0 - B._$B0) * h, W = G._$B0 + (Y._$B0 - G._$B0) * h, e._$Yr._$B0 = (1 - k) * ((1 - v) * (p + (f - p) * u) + v * (L + (M - L) * u)) + k * ((1 - v) * (V + (X - V) * u) + v * (H + (W - H) * u)), p = E._$z0 + (A._$z0 - E._$z0) * h, f = I._$z0 + (w._$z0 - I._$z0) * h, L = x._$z0 + (O._$z0 - x._$z0) * h, M = D._$z0 + (R._$z0 - D._$z0) * h, V = b._$z0 + (F._$z0 - b._$z0) * h, X = C._$z0 + (N._$z0 - C._$z0) * h, H = B._$z0 + (U._$z0 - B._$z0) * h, W = G._$z0 + (Y._$z0 - G._$z0) * h, e._$Yr._$z0 = (1 - k) * ((1 - v) * (p + (f - p) * u) + v * (L + (M - L) * u)) + k * ((1 - v) * (V + (X - V) * u) + v * (H + (W - H) * u)), p = E._$qT + (A._$qT - E._$qT) * h, f = I._$qT + (w._$qT - I._$qT) * h, L = x._$qT + (O._$qT - x._$qT) * h, M = D._$qT + (R._$qT - D._$qT) * h, V = b._$qT + (F._$qT - b._$qT) * h, X = C._$qT + (N._$qT - C._$qT) * h, H = B._$qT + (U._$qT - B._$qT) * h, W = G._$qT + (Y._$qT - G._$qT) * h, e._$Yr._$qT = (1 - k) * ((1 - v) * (p + (f - p) * u) + v * (L + (M - L) * u)) + k * ((1 - v) * (V + (X - V) * u) + v * (H + (W - H) * u))
  2583. } else {
  2584. for (var j = 0 | Math.pow(2, o), q = new Float32Array(j), J = 0; J < j; J++) {
  2585. for (var Q = J, Z = 1, K = 0; K < o; K++) Z *= Q % 2 == 0 ? 1 - s[K] : s[K], Q /= 2;
  2586. q[J] = Z
  2587. }
  2588. for (var tt = new Array, it = 0; it < j; it++) tt[it] = this._$Y0[n[it]];
  2589. for (var et = 0, rt = 0, ot = 0, nt = 0, st = 0, it = 0; it < j; it++) et += q[it] * tt[it]._$fL, rt += q[it] * tt[it]._$gL, ot += q[it] * tt[it]._$B0, nt += q[it] * tt[it]._$z0, st += q[it] * tt[it]._$qT;
  2590. e._$Yr._$fL = et, e._$Yr._$gL = rt, e._$Yr._$B0 = ot, e._$Yr._$z0 = nt, e._$Yr._$qT = st
  2591. }
  2592. var _ = this._$Y0[n[0]];
  2593. e._$Yr.reflectX = _.reflectX, e._$Yr.reflectY = _.reflectY
  2594. }
  2595. }, z.prototype._$2b = function(t, i) {
  2596. this != i._$GT() && console.log("### assert!! ### ");
  2597. var e = i;
  2598. if (e._$hS(!0), this._$32()) {
  2599. var r = this.getTargetBaseDataID();
  2600. if (e._$8r == I._$ur && (e._$8r = t.getBaseDataIndex(r)), e._$8r < 0) at._$so && _._$li("_$L _$0P _$G :: %s", r), e._$hS(!1);
  2601. else {
  2602. var o = t.getBaseData(e._$8r);
  2603. if (null != o) {
  2604. var n = t._$q2(e._$8r),
  2605. s = z._$Xo;
  2606. s[0] = e._$Yr._$fL, s[1] = e._$Yr._$gL;
  2607. var a = z._$io;
  2608. a[0] = 0, a[1] = -.1;
  2609. n._$GT().getType() == I._$c2 ? a[1] = -10 : a[1] = -.1;
  2610. var h = z._$0o;
  2611. this._$Jr(t, o, n, s, a, h);
  2612. var l = Lt._$92(a, h);
  2613. o._$nb(t, n, s, s, 1, 0, 2), e._$Wr._$fL = s[0], e._$Wr._$gL = s[1], e._$Wr._$B0 = e._$Yr._$B0, e._$Wr._$z0 = e._$Yr._$z0, e._$Wr._$qT = e._$Yr._$qT - l * Lt._$NS;
  2614. var $ = n.getTotalScale();
  2615. e.setTotalScale_notForClient($ * e._$Wr._$B0);
  2616. var u = n.getTotalOpacity();
  2617. e.setTotalOpacity(u * e.getInterpolatedOpacity()), e._$Wr.reflectX = e._$Yr.reflectX, e._$Wr.reflectY = e._$Yr.reflectY, e._$hS(n._$yo())
  2618. } else e._$hS(!1)
  2619. }
  2620. } else e.setTotalScale_notForClient(e._$Yr._$B0), e.setTotalOpacity(e.getInterpolatedOpacity())
  2621. }, z.prototype._$nb = function(t, i, e, r, o, n, s) {
  2622. this != i._$GT() && console.log("### assert!! ### ");
  2623. for (var _, a, h = i, l = null != h._$Wr ? h._$Wr : h._$Yr, $ = Math.sin(Lt._$bS * l._$qT), u = Math.cos(Lt._$bS * l._$qT), p = h.getTotalScale(), f = l.reflectX ? -1 : 1, c = l.reflectY ? -1 : 1, d = u * p * f, g = -$ * p * c, y = $ * p * f, m = u * p * c, T = l._$fL, P = l._$gL, S = o * s, v = n; v < S; v += s) _ = e[v], a = e[v + 1], r[v] = d * _ + g * a + T, r[v + 1] = y * _ + m * a + P
  2624. }, z.prototype._$Jr = function(t, i, e, r, o, n) {
  2625. i != e._$GT() && console.log("### assert!! ### ");
  2626. var s = z._$Lo;
  2627. z._$Lo[0] = r[0], z._$Lo[1] = r[1], i._$nb(t, e, s, s, 1, 0, 2);
  2628. for (var _ = z._$To, a = z._$Po, h = 1, l = 0; l < 10; l++) {
  2629. if (a[0] = r[0] + h * o[0], a[1] = r[1] + h * o[1], i._$nb(t, e, a, _, 1, 0, 2), _[0] -= s[0], _[1] -= s[1], 0 != _[0] || 0 != _[1]) return n[0] = _[0], void(n[1] = _[1]);
  2630. if (a[0] = r[0] - h * o[0], a[1] = r[1] - h * o[1], i._$nb(t, e, a, _, 1, 0, 2), _[0] -= s[0], _[1] -= s[1], 0 != _[0] || 0 != _[1]) return _[0] = -_[0], _[0] = -_[0], n[0] = _[0], void(n[1] = _[1]);
  2631. h *= .1
  2632. }
  2633. at._$so && console.log("_$L0 to transform _$SP\n")
  2634. }, H.prototype = new _t, W.prototype = new M, W._$ur = -2, W._$ES = 500, W._$wb = 2, W._$8S = 3, W._$os = 4, W._$52 = W._$ES, W._$R2 = W._$ES, W._$Sb = function(t) {
  2635. for (var i = t.length - 1; i >= 0; --i) {
  2636. var e = t[i];
  2637. e < W._$52 ? W._$52 = e : e > W._$R2 && (W._$R2 = e)
  2638. }
  2639. }, W._$or = function() {
  2640. return W._$52
  2641. }, W._$Pr = function() {
  2642. return W._$R2
  2643. }, W.prototype._$F0 = function(t) {
  2644. this._$gP = t._$nP(), this._$dr = t._$nP(), this._$GS = t._$nP(), this._$qb = t._$6L(), this._$Lb = t._$cS(), this._$mS = t._$Tb(), t.getFormatVersion() >= G._$T7 ? (this.clipID = t._$nP(), this.clipIDList = this.convertClipIDForV2_11(this.clipID)) : this.clipIDList = null, W._$Sb(this._$Lb)
  2645. }, W.prototype.getClipIDList = function() {
  2646. return this.clipIDList
  2647. }, W.prototype._$Nr = function(t, i) {
  2648. if (i._$IS[0] = !1, i._$Us = v._$Z2(t, this._$GS, i._$IS, this._$Lb), at._$Zs);
  2649. else if (i._$IS[0]) return;
  2650. i._$7s = v._$br(t, this._$GS, i._$IS, this._$mS)
  2651. }, W.prototype._$2b = function(t) {}, W.prototype.getDrawDataID = function() {
  2652. return this._$gP
  2653. }, W.prototype._$j2 = function(t) {
  2654. this._$gP = t
  2655. }, W.prototype.getOpacity = function(t, i) {
  2656. return i._$7s
  2657. }, W.prototype._$zS = function(t, i) {
  2658. return i._$Us
  2659. }, W.prototype.getTargetBaseDataID = function() {
  2660. return this._$dr
  2661. }, W.prototype._$gs = function(t) {
  2662. this._$dr = t
  2663. }, W.prototype._$32 = function() {
  2664. return null != this._$dr && this._$dr != yt._$2o()
  2665. }, W.prototype.getType = function() {}, j._$42 = 0, j.prototype._$1b = function() {
  2666. return this._$3S
  2667. }, j.prototype.getDrawDataList = function() {
  2668. return this._$aS
  2669. }, j.prototype._$F0 = function(t) {
  2670. this._$NL = t._$nP(), this._$aS = t._$nP(), this._$3S = t._$nP()
  2671. }, j.prototype._$kr = function(t) {
  2672. t._$Zo(this._$3S), t._$xo(this._$aS), this._$3S = null, this._$aS = null
  2673. }, q.prototype = new i, q.loadModel = function(t) {
  2674. var e = new q;
  2675. return i._$62(e, t), e
  2676. }, q.loadModel = function(t) {
  2677. var e = new q;
  2678. return i._$62(e, t), e
  2679. }, q._$to = function() {
  2680. return new q
  2681. }, q._$er = function(t) {
  2682. var i = new _$5("../_$_r/_$t0/_$Ri/_$_P._$d");
  2683. if (0 == i.exists()) throw new _$ls("_$t0 _$_ _$6 _$Ui :: " + i._$PL());
  2684. for (var e = ["../_$_r/_$t0/_$Ri/_$_P.512/_$CP._$1", "../_$_r/_$t0/_$Ri/_$_P.512/_$vP._$1", "../_$_r/_$t0/_$Ri/_$_P.512/_$EP._$1", "../_$_r/_$t0/_$Ri/_$_P.512/_$pP._$1"], r = q.loadModel(i._$3b()), o = 0; o < e.length; o++) {
  2685. var n = new _$5(e[o]);
  2686. if (0 == n.exists()) throw new _$ls("_$t0 _$_ _$6 _$Ui :: " + n._$PL());
  2687. r.setTexture(o, _$nL._$_o(t, n._$3b()))
  2688. }
  2689. return r
  2690. }, q.prototype.setGL = function(t) {
  2691. this._$zo.setGL(t)
  2692. }, q.prototype.setTransform = function(t) {
  2693. this._$zo.setTransform(t)
  2694. }, q.prototype.draw = function() {
  2695. this._$5S.draw(this._$zo)
  2696. }, q.prototype._$K2 = function() {
  2697. this._$zo._$K2()
  2698. }, q.prototype.setTexture = function(t, i) {
  2699. null == this._$zo && _._$li("_$Yi for QT _$ki / _$XS() is _$6 _$ui!!"), this._$zo.setTexture(t, i)
  2700. }, q.prototype.setTexture = function(t, i) {
  2701. null == this._$zo && _._$li("_$Yi for QT _$ki / _$XS() is _$6 _$ui!!"), this._$zo.setTexture(t, i)
  2702. }, q.prototype._$Rs = function() {
  2703. return this._$zo._$Rs()
  2704. }, q.prototype._$Ds = function(t) {
  2705. this._$zo._$Ds(t)
  2706. }, q.prototype.getDrawParam = function() {
  2707. return this._$zo
  2708. }, J.prototype = new s, J._$cs = "VISIBLE:", J._$ar = "LAYOUT:", J.MTN_PREFIX_FADEIN = "FADEIN:", J.MTN_PREFIX_FADEOUT = "FADEOUT:", J._$Co = 0, J._$1T = 1, J.loadMotion = function(t) {
  2709. var i = k._$C(t);
  2710. return J.loadMotion(i)
  2711. }, J.loadMotion = function(t) {
  2712. t instanceof ArrayBuffer && (t = new DataView(t));
  2713. var i = new J,
  2714. e = [0],
  2715. r = t.byteLength;
  2716. i._$yT = 0;
  2717. for (var o = 0; o < r; ++o) {
  2718. var n = Q(t, o),
  2719. s = n.charCodeAt(0);
  2720. if ("\n" != n && "\r" != n) if ("#" != n) if ("$" != n) {
  2721. if (97 <= s && s <= 122 || 65 <= s && s <= 90 || "_" == n) {
  2722. for (var _ = o, a = -1; o < r && ("\r" != (n = Q(t, o)) && "\n" != n); ++o) if ("=" == n) {
  2723. a = o;
  2724. break
  2725. }
  2726. if (a >= 0) {
  2727. var h = new B;
  2728. O.startsWith(t, _, J._$cs) ? (h._$RP = B._$hs, h._$4P = O.createString(t, _, a - _)) : O.startsWith(t, _, J._$ar) ? (h._$4P = O.createString(t, _ + 7, a - _ - 7), O.startsWith(t, _ + 7, "ANCHOR_X") ? h._$RP = B._$xs : O.startsWith(t, _ + 7, "ANCHOR_Y") ? h._$RP = B._$us : O.startsWith(t, _ + 7, "SCALE_X") ? h._$RP = B._$qs : O.startsWith(t, _ + 7, "SCALE_Y") ? h._$RP = B._$Ys : O.startsWith(t, _ + 7, "X") ? h._$RP = B._$ws : O.startsWith(t, _ + 7, "Y") && (h._$RP = B._$Ns)) : (h._$RP = B._$Fr, h._$4P = O.createString(t, _, a - _)), i.motions.push(h);
  2729. var l = 0,
  2730. $ = [];
  2731. for (o = a + 1; o < r && ("\r" != (n = Q(t, o)) && "\n" != n); ++o) if ("," != n && " " != n && "\t" != n) {
  2732. var u = O._$LS(t, r, o, e);
  2733. if (e[0] > 0) {
  2734. $.push(u), l++;
  2735. var p = e[0];
  2736. if (p < o) {
  2737. console.log("_$n0 _$hi . @Live2DMotion loadMotion()\n");
  2738. break
  2739. }
  2740. o = p - 1
  2741. }
  2742. }
  2743. h._$I0 = new Float32Array($), l > i._$yT && (i._$yT = l)
  2744. }
  2745. }
  2746. } else {
  2747. for (var _ = o, a = -1; o < r && ("\r" != (n = Q(t, o)) && "\n" != n); ++o) if ("=" == n) {
  2748. a = o;
  2749. break
  2750. }
  2751. var f = !1;
  2752. if (a >= 0) for (a == _ + 4 && "f" == Q(t, _ + 1) && "p" == Q(t, _ + 2) && "s" == Q(t, _ + 3) && (f = !0), o = a + 1; o < r && ("\r" != (n = Q(t, o)) && "\n" != n); ++o) if ("," != n && " " != n && "\t" != n) {
  2753. var u = O._$LS(t, r, o, e);
  2754. e[0] > 0 && f && 5 < u && u < 121 && (i._$D0 = u), o = e[0]
  2755. }
  2756. for (; o < r && ("\n" != Q(t, o) && "\r" != Q(t, o)); ++o);
  2757. } else for (; o < r && ("\n" != Q(t, o) && "\r" != Q(t, o)); ++o);
  2758. }
  2759. return i._$rr = 1e3 * i._$yT / i._$D0 | 0, i
  2760. }, J.prototype.getDurationMSec = function() {
  2761. return this._$E ? -1 : this._$rr
  2762. }, J.prototype.getLoopDurationMSec = function() {
  2763. return this._$rr
  2764. }, J.prototype.dump = function() {
  2765. for (var t = 0; t < this.motions.length; t++) {
  2766. var i = this.motions[t];
  2767. console.log("_$wL[%s] [%d]. ", i._$4P, i._$I0.length);
  2768. for (var e = 0; e < i._$I0.length && e < 10; e++) console.log("%5.2f ,", i._$I0[e]);
  2769. console.log("\n")
  2770. }
  2771. }, J.prototype.updateParamExe = function(t, i, e, r) {
  2772. for (var o = i - r._$z2, n = o * this._$D0 / 1e3, s = 0 | n, _ = n - s, a = 0; a < this.motions.length; a++) {
  2773. var h = this.motions[a],
  2774. l = h._$I0.length,
  2775. $ = h._$4P;
  2776. if (h._$RP == B._$hs) {
  2777. var u = h._$I0[s >= l ? l - 1 : s];
  2778. t.setParamFloat($, u)
  2779. } else if (B._$ws <= h._$RP && h._$RP <= B._$Ys);
  2780. else {
  2781. var p, f = t.getParamIndex($),
  2782. c = t.getModelContext(),
  2783. d = c.getParamMax(f),
  2784. g = c.getParamMin(f),
  2785. y = .4 * (d - g),
  2786. m = c.getParamFloat(f),
  2787. T = h._$I0[s >= l ? l - 1 : s],
  2788. P = h._$I0[s + 1 >= l ? l - 1 : s + 1];
  2789. p = T < P && P - T > y || T > P && T - P > y ? T : T + (P - T) * _;
  2790. var S = m + (p - m) * e;
  2791. t.setParamFloat($, S)
  2792. }
  2793. }
  2794. s >= this._$yT && (this._$E ? (r._$z2 = i, this.loopFadeIn && (r._$bs = i)) : r._$9L = !0), this._$eP = e
  2795. }, J.prototype._$r0 = function() {
  2796. return this._$E
  2797. }, J.prototype._$aL = function(t) {
  2798. this._$E = t
  2799. }, J.prototype._$S0 = function() {
  2800. return this._$D0
  2801. }, J.prototype._$U0 = function(t) {
  2802. this._$D0 = t
  2803. }, J.prototype.isLoopFadeIn = function() {
  2804. return this.loopFadeIn
  2805. }, J.prototype.setLoopFadeIn = function(t) {
  2806. this.loopFadeIn = t
  2807. }, N.prototype.clear = function() {
  2808. this.size = 0
  2809. }, N.prototype.add = function(t) {
  2810. if (this._$P.length <= this.size) {
  2811. var i = new Float32Array(2 * this.size);
  2812. w._$jT(this._$P, 0, i, 0, this.size), this._$P = i
  2813. }
  2814. this._$P[this.size++] = t
  2815. }, N.prototype._$BL = function() {
  2816. var t = new Float32Array(this.size);
  2817. return w._$jT(this._$P, 0, t, 0, this.size), t
  2818. }, B._$Fr = 0, B._$hs = 1, B._$ws = 100, B._$Ns = 101, B._$xs = 102, B._$us = 103, B._$qs = 104, B._$Ys = 105, Z.prototype = new I, Z._$gT = new Array, Z.prototype._$zP = function() {
  2819. this._$GS = new D, this._$GS._$zP()
  2820. }, Z.prototype._$F0 = function(t) {
  2821. I.prototype._$F0.call(this, t), this._$A = t._$6L(), this._$o = t._$6L(), this._$GS = t._$nP(), this._$Eo = t._$nP(), I.prototype.readV2_opacity.call(this, t)
  2822. }, Z.prototype.init = function(t) {
  2823. var i = new K(this),
  2824. e = (this._$o + 1) * (this._$A + 1);
  2825. return null != i._$Cr && (i._$Cr = null), i._$Cr = new Float32Array(2 * e), null != i._$hr && (i._$hr = null), this._$32() ? i._$hr = new Float32Array(2 * e) : i._$hr = null, i
  2826. }, Z.prototype._$Nr = function(t, i) {
  2827. var e = i;
  2828. if (this._$GS._$Ur(t)) {
  2829. var r = this._$VT(),
  2830. o = Z._$gT;
  2831. o[0] = !1, v._$Vr(t, this._$GS, o, r, this._$Eo, e._$Cr, 0, 2), i._$Ib(o[0]), this.interpolateOpacity(t, this._$GS, i, o)
  2832. }
  2833. }, Z.prototype._$2b = function(t, i) {
  2834. var e = i;
  2835. if (e._$hS(!0), this._$32()) {
  2836. var r = this.getTargetBaseDataID();
  2837. if (e._$8r == I._$ur && (e._$8r = t.getBaseDataIndex(r)), e._$8r < 0) at._$so && _._$li("_$L _$0P _$G :: %s", r), e._$hS(!1);
  2838. else {
  2839. var o = t.getBaseData(e._$8r),
  2840. n = t._$q2(e._$8r);
  2841. if (null != o && n._$yo()) {
  2842. var s = n.getTotalScale();
  2843. e.setTotalScale_notForClient(s);
  2844. var a = n.getTotalOpacity();
  2845. e.setTotalOpacity(a * e.getInterpolatedOpacity()), o._$nb(t, n, e._$Cr, e._$hr, this._$VT(), 0, 2), e._$hS(!0)
  2846. } else e._$hS(!1)
  2847. }
  2848. } else e.setTotalOpacity(e.getInterpolatedOpacity())
  2849. }, Z.prototype._$nb = function(t, i, e, r, o, n, s) {
  2850. var _ = i,
  2851. a = null != _._$hr ? _._$hr : _._$Cr;
  2852. Z.transformPoints_sdk2(e, r, o, n, s, a, this._$o, this._$A)
  2853. }, Z.transformPoints_sdk2 = function(i, e, r, o, n, s, _, a) {
  2854. for (var h, l, $, u = r * n, p = 0, f = 0, c = 0, d = 0, g = 0, y = 0, m = !1, T = o; T < u; T += n) {
  2855. var P, S, v, L;
  2856. if (v = i[T], L = i[T + 1], P = v * _, S = L * a, P < 0 || S < 0 || _ <= P || a <= S) {
  2857. var M = _ + 1;
  2858. if (!m) {
  2859. m = !0, p = .25 * (s[2 * (0 + 0 * M)] + s[2 * (_ + 0 * M)] + s[2 * (0 + a * M)] + s[2 * (_ + a * M)]), f = .25 * (s[2 * (0 + 0 * M) + 1] + s[2 * (_ + 0 * M) + 1] + s[2 * (0 + a * M) + 1] + s[2 * (_ + a * M) + 1]);
  2860. var E = s[2 * (_ + a * M)] - s[2 * (0 + 0 * M)],
  2861. A = s[2 * (_ + a * M) + 1] - s[2 * (0 + 0 * M) + 1],
  2862. I = s[2 * (_ + 0 * M)] - s[2 * (0 + a * M)],
  2863. w = s[2 * (_ + 0 * M) + 1] - s[2 * (0 + a * M) + 1];
  2864. c = .5 * (E + I), d = .5 * (A + w), g = .5 * (E - I), y = .5 * (A - w), p -= .5 * (c + g), f -= .5 * (d + y)
  2865. }
  2866. if (-2 < v && v < 3 && -2 < L && L < 3) if (v <= 0) if (L <= 0) {
  2867. var x = s[2 * (0 + 0 * M)],
  2868. O = s[2 * (0 + 0 * M) + 1],
  2869. D = p - 2 * c,
  2870. R = f - 2 * d,
  2871. b = p - 2 * g,
  2872. F = f - 2 * y,
  2873. C = p - 2 * c - 2 * g,
  2874. N = f - 2 * d - 2 * y,
  2875. B = .5 * (v - -2),
  2876. U = .5 * (L - -2);
  2877. B + U <= 1 ? (e[T] = C + (b - C) * B + (D - C) * U, e[T + 1] = N + (F - N) * B + (R - N) * U) : (e[T] = x + (D - x) * (1 - B) + (b - x) * (1 - U), e[T + 1] = O + (R - O) * (1 - B) + (F - O) * (1 - U))
  2878. } else if (L >= 1) {
  2879. var b = s[2 * (0 + a * M)],
  2880. F = s[2 * (0 + a * M) + 1],
  2881. C = p - 2 * c + 1 * g,
  2882. N = f - 2 * d + 1 * y,
  2883. x = p + 3 * g,
  2884. O = f + 3 * y,
  2885. D = p - 2 * c + 3 * g,
  2886. R = f - 2 * d + 3 * y,
  2887. B = .5 * (v - -2),
  2888. U = .5 * (L - 1);
  2889. B + U <= 1 ? (e[T] = C + (b - C) * B + (D - C) * U, e[T + 1] = N + (F - N) * B + (R - N) * U) : (e[T] = x + (D - x) * (1 - B) + (b - x) * (1 - U), e[T + 1] = O + (R - O) * (1 - B) + (F - O) * (1 - U))
  2890. } else {
  2891. var G = 0 | S;
  2892. G == a && (G = a - 1);
  2893. var B = .5 * (v - -2),
  2894. U = S - G,
  2895. Y = G / a,
  2896. k = (G + 1) / a,
  2897. b = s[2 * (0 + G * M)],
  2898. F = s[2 * (0 + G * M) + 1],
  2899. x = s[2 * (0 + (G + 1) * M)],
  2900. O = s[2 * (0 + (G + 1) * M) + 1],
  2901. C = p - 2 * c + Y * g,
  2902. N = f - 2 * d + Y * y,
  2903. D = p - 2 * c + k * g,
  2904. R = f - 2 * d + k * y;
  2905. B + U <= 1 ? (e[T] = C + (b - C) * B + (D - C) * U, e[T + 1] = N + (F - N) * B + (R - N) * U) : (e[T] = x + (D - x) * (1 - B) + (b - x) * (1 - U), e[T + 1] = O + (R - O) * (1 - B) + (F - O) * (1 - U))
  2906. } else if (1 <= v) if (L <= 0) {
  2907. var D = s[2 * (_ + 0 * M)],
  2908. R = s[2 * (_ + 0 * M) + 1],
  2909. x = p + 3 * c,
  2910. O = f + 3 * d,
  2911. C = p + 1 * c - 2 * g,
  2912. N = f + 1 * d - 2 * y,
  2913. b = p + 3 * c - 2 * g,
  2914. F = f + 3 * d - 2 * y,
  2915. B = .5 * (v - 1),
  2916. U = .5 * (L - -2);
  2917. B + U <= 1 ? (e[T] = C + (b - C) * B + (D - C) * U, e[T + 1] = N + (F - N) * B + (R - N) * U) : (e[T] = x + (D - x) * (1 - B) + (b - x) * (1 - U), e[T + 1] = O + (R - O) * (1 - B) + (F - O) * (1 - U))
  2918. } else if (L >= 1) {
  2919. var C = s[2 * (_ + a * M)],
  2920. N = s[2 * (_ + a * M) + 1],
  2921. b = p + 3 * c + 1 * g,
  2922. F = f + 3 * d + 1 * y,
  2923. D = p + 1 * c + 3 * g,
  2924. R = f + 1 * d + 3 * y,
  2925. x = p + 3 * c + 3 * g,
  2926. O = f + 3 * d + 3 * y,
  2927. B = .5 * (v - 1),
  2928. U = .5 * (L - 1);
  2929. B + U <= 1 ? (e[T] = C + (b - C) * B + (D - C) * U, e[T + 1] = N + (F - N) * B + (R - N) * U) : (e[T] = x + (D - x) * (1 - B) + (b - x) * (1 - U), e[T + 1] = O + (R - O) * (1 - B) + (F - O) * (1 - U))
  2930. } else {
  2931. var G = 0 | S;
  2932. G == a && (G = a - 1);
  2933. var B = .5 * (v - 1),
  2934. U = S - G,
  2935. Y = G / a,
  2936. k = (G + 1) / a,
  2937. C = s[2 * (_ + G * M)],
  2938. N = s[2 * (_ + G * M) + 1],
  2939. D = s[2 * (_ + (G + 1) * M)],
  2940. R = s[2 * (_ + (G + 1) * M) + 1],
  2941. b = p + 3 * c + Y * g,
  2942. F = f + 3 * d + Y * y,
  2943. x = p + 3 * c + k * g,
  2944. O = f + 3 * d + k * y;
  2945. B + U <= 1 ? (e[T] = C + (b - C) * B + (D - C) * U, e[T + 1] = N + (F - N) * B + (R - N) * U) : (e[T] = x + (D - x) * (1 - B) + (b - x) * (1 - U), e[T + 1] = O + (R - O) * (1 - B) + (F - O) * (1 - U))
  2946. } else if (L <= 0) {
  2947. var V = 0 | P;
  2948. V == _ && (V = _ - 1);
  2949. var B = P - V,
  2950. U = .5 * (L - -2),
  2951. X = V / _,
  2952. z = (V + 1) / _,
  2953. D = s[2 * (V + 0 * M)],
  2954. R = s[2 * (V + 0 * M) + 1],
  2955. x = s[2 * (V + 1 + 0 * M)],
  2956. O = s[2 * (V + 1 + 0 * M) + 1],
  2957. C = p + X * c - 2 * g,
  2958. N = f + X * d - 2 * y,
  2959. b = p + z * c - 2 * g,
  2960. F = f + z * d - 2 * y;
  2961. B + U <= 1 ? (e[T] = C + (b - C) * B + (D - C) * U, e[T + 1] = N + (F - N) * B + (R - N) * U) : (e[T] = x + (D - x) * (1 - B) + (b - x) * (1 - U), e[T + 1] = O + (R - O) * (1 - B) + (F - O) * (1 - U))
  2962. } else if (L >= 1) {
  2963. var V = 0 | P;
  2964. V == _ && (V = _ - 1);
  2965. var B = P - V,
  2966. U = .5 * (L - 1),
  2967. X = V / _,
  2968. z = (V + 1) / _,
  2969. C = s[2 * (V + a * M)],
  2970. N = s[2 * (V + a * M) + 1],
  2971. b = s[2 * (V + 1 + a * M)],
  2972. F = s[2 * (V + 1 + a * M) + 1],
  2973. D = p + X * c + 3 * g,
  2974. R = f + X * d + 3 * y,
  2975. x = p + z * c + 3 * g,
  2976. O = f + z * d + 3 * y;
  2977. B + U <= 1 ? (e[T] = C + (b - C) * B + (D - C) * U, e[T + 1] = N + (F - N) * B + (R - N) * U) : (e[T] = x + (D - x) * (1 - B) + (b - x) * (1 - U), e[T + 1] = O + (R - O) * (1 - B) + (F - O) * (1 - U))
  2978. } else t.err.printf("_$li calc : %.4f , %.4f\t\t\t\t\t@@BDBoxGrid\n", v, L);
  2979. else e[T] = p + v * c + L * g, e[T + 1] = f + v * d + L * y
  2980. } else l = P - (0 | P), $ = S - (0 | S), h = 2 * ((0 | P) + (0 | S) * (_ + 1)), l + $ < 1 ? (e[T] = s[h] * (1 - l - $) + s[h + 2] * l + s[h + 2 * (_ + 1)] * $, e[T + 1] = s[h + 1] * (1 - l - $) + s[h + 3] * l + s[h + 2 * (_ + 1) + 1] * $) : (e[T] = s[h + 2 * (_ + 1) + 2] * (l - 1 + $) + s[h + 2 * (_ + 1)] * (1 - l) + s[h + 2] * (1 - $), e[T + 1] = s[h + 2 * (_ + 1) + 3] * (l - 1 + $) + s[h + 2 * (_ + 1) + 1] * (1 - l) + s[h + 3] * (1 - $))
  2981. }
  2982. }, Z.prototype.transformPoints_sdk1 = function(t, i, e, r, o, n, s) {
  2983. for (var _, a, h, l, $, u, p, f = i, c = this._$o, d = this._$A, g = o * s, y = null != f._$hr ? f._$hr : f._$Cr, m = n; m < g; m += s) at._$ts ? (_ = e[m], a = e[m + 1], _ < 0 ? _ = 0 : _ > 1 && (_ = 1), a < 0 ? a = 0 : a > 1 && (a = 1), _ *= c, a *= d, h = 0 | _, l = 0 | a, h > c - 1 && (h = c - 1), l > d - 1 && (l = d - 1), u = _ - h, p = a - l, $ = 2 * (h + l * (c + 1))) : (_ = e[m] * c, a = e[m + 1] * d, u = _ - (0 | _), p = a - (0 | a), $ = 2 * ((0 | _) + (0 | a) * (c + 1))), u + p < 1 ? (r[m] = y[$] * (1 - u - p) + y[$ + 2] * u + y[$ + 2 * (c + 1)] * p, r[m + 1] = y[$ + 1] * (1 - u - p) + y[$ + 3] * u + y[$ + 2 * (c + 1) + 1] * p) : (r[m] = y[$ + 2 * (c + 1) + 2] * (u - 1 + p) + y[$ + 2 * (c + 1)] * (1 - u) + y[$ + 2] * (1 - p), r[m + 1] = y[$ + 2 * (c + 1) + 3] * (u - 1 + p) + y[$ + 2 * (c + 1) + 1] * (1 - u) + y[$ + 3] * (1 - p))
  2984. }, Z.prototype._$VT = function() {
  2985. return (this._$o + 1) * (this._$A + 1)
  2986. }, Z.prototype.getType = function() {
  2987. return I._$_b
  2988. }, K.prototype = new _t, tt._$42 = 0, tt.prototype._$zP = function() {
  2989. this._$3S = new Array, this._$aS = new Array
  2990. }, tt.prototype._$F0 = function(t) {
  2991. this._$g0 = t._$8L(), this.visible = t._$8L(), this._$NL = t._$nP(), this._$3S = t._$nP(), this._$aS = t._$nP()
  2992. }, tt.prototype.init = function(t) {
  2993. var i = new it(this);
  2994. return i.setPartsOpacity(this.isVisible() ? 1 : 0), i
  2995. }, tt.prototype._$6o = function(t) {
  2996. if (null == this._$3S) throw new Error("_$3S _$6 _$Wo@_$6o");
  2997. this._$3S.push(t)
  2998. }, tt.prototype._$3o = function(t) {
  2999. if (null == this._$aS) throw new Error("_$aS _$6 _$Wo@_$3o");
  3000. this._$aS.push(t)
  3001. }, tt.prototype._$Zo = function(t) {
  3002. this._$3S = t
  3003. }, tt.prototype._$xo = function(t) {
  3004. this._$aS = t
  3005. }, tt.prototype.isVisible = function() {
  3006. return this.visible
  3007. }, tt.prototype._$uL = function() {
  3008. return this._$g0
  3009. }, tt.prototype._$KP = function(t) {
  3010. this.visible = t
  3011. }, tt.prototype._$ET = function(t) {
  3012. this._$g0 = t
  3013. }, tt.prototype.getBaseData = function() {
  3014. return this._$3S
  3015. }, tt.prototype.getDrawData = function() {
  3016. return this._$aS
  3017. }, tt.prototype._$p2 = function() {
  3018. return this._$NL
  3019. }, tt.prototype._$ob = function(t) {
  3020. this._$NL = t
  3021. }, tt.prototype.getPartsID = function() {
  3022. return this._$NL
  3023. }, tt.prototype._$MP = function(t) {
  3024. this._$NL = t
  3025. }, it.prototype = new $, it.prototype.getPartsOpacity = function() {
  3026. return this._$VS
  3027. }, it.prototype.setPartsOpacity = function(t) {
  3028. this._$VS = t
  3029. }, et._$L7 = function() {
  3030. u._$27(), yt._$27(), b._$27(), l._$27()
  3031. }, et.prototype.toString = function() {
  3032. return this.id
  3033. }, rt.prototype._$F0 = function(t) {}, ot.prototype._$1s = function() {
  3034. return this._$4S
  3035. }, ot.prototype._$zP = function() {
  3036. this._$4S = new Array
  3037. }, ot.prototype._$F0 = function(t) {
  3038. this._$4S = t._$nP()
  3039. }, ot.prototype._$Ks = function(t) {
  3040. this._$4S.push(t)
  3041. }, nt.tr = new gt, nt._$50 = new gt, nt._$Ti = new Array(0, 0), nt._$Pi = new Array(0, 0), nt._$B = new Array(0, 0), nt.prototype._$lP = function(t, i, e, r) {
  3042. this.viewport = new Array(t, i, e, r)
  3043. }, nt.prototype._$bL = function() {
  3044. this.context.save();
  3045. var t = this.viewport;
  3046. null != t && (this.context.beginPath(), this.context._$Li(t[0], t[1], t[2], t[3]), this.context.clip())
  3047. }, nt.prototype._$ei = function() {
  3048. this.context.restore()
  3049. }, nt.prototype.drawElements = function(t, i, e, r, o, n, s, a) {
  3050. try {
  3051. o != this._$Qo && (this._$Qo = o, this.context.globalAlpha = o);
  3052. for (var h = i.length, l = t.width, $ = t.height, u = this.context, p = this._$xP, f = this._$uP, c = this._$6r, d = this._$3r, g = nt.tr, y = nt._$Ti, m = nt._$Pi, T = nt._$B, P = 0; P < h; P += 3) {
  3053. u.save();
  3054. var S = i[P],
  3055. v = i[P + 1],
  3056. L = i[P + 2],
  3057. M = p + c * e[2 * S],
  3058. E = f + d * e[2 * S + 1],
  3059. A = p + c * e[2 * v],
  3060. I = f + d * e[2 * v + 1],
  3061. w = p + c * e[2 * L],
  3062. x = f + d * e[2 * L + 1];
  3063. s && (s._$PS(M, E, T), M = T[0], E = T[1], s._$PS(A, I, T), A = T[0], I = T[1], s._$PS(w, x, T), w = T[0], x = T[1]);
  3064. var O = l * r[2 * S],
  3065. D = $ - $ * r[2 * S + 1],
  3066. R = l * r[2 * v],
  3067. b = $ - $ * r[2 * v + 1],
  3068. F = l * r[2 * L],
  3069. C = $ - $ * r[2 * L + 1],
  3070. N = Math.atan2(b - D, R - O),
  3071. B = Math.atan2(I - E, A - M),
  3072. U = A - M,
  3073. G = I - E,
  3074. Y = Math.sqrt(U * U + G * G),
  3075. k = R - O,
  3076. V = b - D,
  3077. X = Math.sqrt(k * k + V * V),
  3078. z = Y / X;
  3079. It._$ni(F, C, O, D, R - O, b - D, -(b - D), R - O, y), It._$ni(w, x, M, E, A - M, I - E, -(I - E), A - M, m);
  3080. var H = (m[0] - y[0]) / y[1],
  3081. W = Math.min(O, R, F),
  3082. j = Math.max(O, R, F),
  3083. q = Math.min(D, b, C),
  3084. J = Math.max(D, b, C),
  3085. Q = Math.floor(W),
  3086. Z = Math.floor(q),
  3087. K = Math.ceil(j),
  3088. tt = Math.ceil(J);
  3089. g.identity(), g.translate(M, E), g.rotate(B), g.scale(1, m[1] / y[1]), g.shear(H, 0), g.scale(z, z), g.rotate(-N), g.translate(-O, -D), g.setContext(u);
  3090. if (n || (n = 1.2), at.IGNORE_EXPAND && (n = 0), at.USE_CACHED_POLYGON_IMAGE) {
  3091. var it = a._$e0;
  3092. if (it.gl_cacheImage = it.gl_cacheImage || {}, !it.gl_cacheImage[P]) {
  3093. var et = nt.createCanvas(K - Q, tt - Z);
  3094. at.DEBUG_DATA.LDGL_CANVAS_MB = at.DEBUG_DATA.LDGL_CANVAS_MB || 0, at.DEBUG_DATA.LDGL_CANVAS_MB += (K - Q) * (tt - Z) * 4;
  3095. var rt = et.getContext("2d");
  3096. rt.translate(-Q, -Z), nt.clip(rt, g, n, Y, O, D, R, b, F, C, M, E, A, I, w, x), rt.drawImage(t, 0, 0), it.gl_cacheImage[P] = {
  3097. cacheCanvas: et,
  3098. cacheContext: rt
  3099. }
  3100. }
  3101. u.drawImage(it.gl_cacheImage[P].cacheCanvas, Q, Z)
  3102. } else at.IGNORE_CLIP || nt.clip(u, g, n, Y, O, D, R, b, F, C, M, E, A, I, w, x), at.USE_ADJUST_TRANSLATION && (W = 0, j = l, q = 0, J = $), u.drawImage(t, W, q, j - W, J - q, W, q, j - W, J - q);
  3103. u.restore()
  3104. }
  3105. } catch (t) {
  3106. _._$Rb(t)
  3107. }
  3108. }, nt.clip = function(t, i, e, r, o, n, s, _, a, h, l, $, u, p, f, c) {
  3109. e > .02 ? nt.expandClip(t, i, e, r, l, $, u, p, f, c) : nt.clipWithTransform(t, null, o, n, s, _, a, h)
  3110. }, nt.expandClip = function(t, i, e, r, o, n, s, _, a, h) {
  3111. var l = s - o,
  3112. $ = _ - n,
  3113. u = a - o,
  3114. p = h - n,
  3115. f = l * p - $ * u > 0 ? e : -e,
  3116. c = -$,
  3117. d = l,
  3118. g = a - s,
  3119. y = h - _,
  3120. m = -y,
  3121. T = g,
  3122. P = Math.sqrt(g * g + y * y),
  3123. S = -p,
  3124. v = u,
  3125. L = Math.sqrt(u * u + p * p),
  3126. M = o - f * c / r,
  3127. E = n - f * d / r,
  3128. A = s - f * c / r,
  3129. I = _ - f * d / r,
  3130. w = s - f * m / P,
  3131. x = _ - f * T / P,
  3132. O = a - f * m / P,
  3133. D = h - f * T / P,
  3134. R = o + f * S / L,
  3135. b = n + f * v / L,
  3136. F = a + f * S / L,
  3137. C = h + f * v / L,
  3138. N = nt._$50;
  3139. return null != i._$P2(N) && (nt.clipWithTransform(t, N, M, E, A, I, w, x, O, D, F, C, R, b), !0)
  3140. }, nt.clipWithTransform = function(t, i, e, r, o, n, s, a) {
  3141. if (arguments.length < 7) return void _._$li("err : @LDGL.clip()");
  3142. if (!(arguments[1] instanceof gt)) return void _._$li("err : a[0] is _$6 LDTransform @LDGL.clip()");
  3143. var h = nt._$B,
  3144. l = i,
  3145. $ = arguments;
  3146. if (t.beginPath(), l) {
  3147. l._$PS($[2], $[3], h), t.moveTo(h[0], h[1]);
  3148. for (var u = 4; u < $.length; u += 2) l._$PS($[u], $[u + 1], h), t.lineTo(h[0], h[1])
  3149. } else {
  3150. t.moveTo($[2], $[3]);
  3151. for (var u = 4; u < $.length; u += 2) t.lineTo($[u], $[u + 1])
  3152. }
  3153. t.clip()
  3154. }, nt.createCanvas = function(t, i) {
  3155. var e = document.createElement("canvas");
  3156. return e.setAttribute("width", t), e.setAttribute("height", i), e || _._$li("err : " + e), e
  3157. }, nt.dumpValues = function() {
  3158. for (var t = "", i = 0; i < arguments.length; i++) t += "[" + i + "]= " + arguments[i].toFixed(3) + " , ";
  3159. console.log(t)
  3160. }, st.prototype._$F0 = function(t) {
  3161. this._$TT = t._$_T(), this._$LT = t._$_T(), this._$FS = t._$_T(), this._$wL = t._$nP()
  3162. }, st.prototype.getMinValue = function() {
  3163. return this._$TT
  3164. }, st.prototype.getMaxValue = function() {
  3165. return this._$LT
  3166. }, st.prototype.getDefaultValue = function() {
  3167. return this._$FS
  3168. }, st.prototype.getParamID = function() {
  3169. return this._$wL
  3170. }, _t.prototype._$yo = function() {
  3171. return this._$AT && !this._$JS
  3172. }, _t.prototype._$hS = function(t) {
  3173. this._$AT = t
  3174. }, _t.prototype._$GT = function() {
  3175. return this._$e0
  3176. }, _t.prototype._$l2 = function(t) {
  3177. this._$IP = t
  3178. }, _t.prototype.getPartsIndex = function() {
  3179. return this._$IP
  3180. }, _t.prototype._$x2 = function() {
  3181. return this._$JS
  3182. }, _t.prototype._$Ib = function(t) {
  3183. this._$JS = t
  3184. }, _t.prototype.getTotalScale = function() {
  3185. return this.totalScale
  3186. }, _t.prototype.setTotalScale_notForClient = function(t) {
  3187. this.totalScale = t
  3188. }, _t.prototype.getInterpolatedOpacity = function() {
  3189. return this._$7s
  3190. }, _t.prototype.setInterpolatedOpacity = function(t) {
  3191. this._$7s = t
  3192. }, _t.prototype.getTotalOpacity = function(t) {
  3193. return this.totalOpacity
  3194. }, _t.prototype.setTotalOpacity = function(t) {
  3195. this.totalOpacity = t
  3196. }, at._$2s = "2.1.00_1", at._$Kr = 201001e3, at._$sP = !0, at._$so = !0, at._$cb = !1, at._$3T = !0, at._$Ts = !0, at._$fb = !0, at._$ts = !0, at.L2D_DEFORMER_EXTEND = !0, at._$Wb = !1;
  3197. at._$yr = !1, at._$Zs = !1, at.L2D_NO_ERROR = 0, at._$i7 = 1e3, at._$9s = 1001, at._$es = 1100, at._$r7 = 2e3, at._$07 = 2001, at._$b7 = 2002, at._$H7 = 4e3, at.L2D_COLOR_BLEND_MODE_MULT = 0, at.L2D_COLOR_BLEND_MODE_ADD = 1, at.L2D_COLOR_BLEND_MODE_INTERPOLATE = 2, at._$6b = !0, at._$cT = 0, at.clippingMaskBufferSize = 256, at.glContext = new Array, at.frameBuffers = new Array, at.fTexture = new Array, at.IGNORE_CLIP = !1, at.IGNORE_EXPAND = !1, at.EXPAND_W = 2, at.USE_ADJUST_TRANSLATION = !0, at.USE_CANVAS_TRANSFORM = !0, at.USE_CACHED_POLYGON_IMAGE = !1, at.DEBUG_DATA = {}, at.PROFILE_IOS_SPEED = {
  3198. PROFILE_NAME: "iOS Speed",
  3199. USE_ADJUST_TRANSLATION: !0,
  3200. USE_CACHED_POLYGON_IMAGE: !0,
  3201. EXPAND_W: 4
  3202. }, at.PROFILE_IOS_QUALITY = {
  3203. PROFILE_NAME: "iOS HiQ",
  3204. USE_ADJUST_TRANSLATION: !0,
  3205. USE_CACHED_POLYGON_IMAGE: !1,
  3206. EXPAND_W: 2
  3207. }, at.PROFILE_IOS_DEFAULT = at.PROFILE_IOS_QUALITY, at.PROFILE_ANDROID = {
  3208. PROFILE_NAME: "Android",
  3209. USE_ADJUST_TRANSLATION: !1,
  3210. USE_CACHED_POLYGON_IMAGE: !1,
  3211. EXPAND_W: 2
  3212. }, at.PROFILE_DESKTOP = {
  3213. PROFILE_NAME: "Desktop",
  3214. USE_ADJUST_TRANSLATION: !1,
  3215. USE_CACHED_POLYGON_IMAGE: !1,
  3216. EXPAND_W: 2
  3217. }, at.initProfile = function() {
  3218. Et.isIOS() ? at.setupProfile(at.PROFILE_IOS_DEFAULT) : Et.isAndroid() ? at.setupProfile(at.PROFILE_ANDROID) : at.setupProfile(at.PROFILE_DESKTOP)
  3219. }, at.setupProfile = function(t, i) {
  3220. if ("number" == typeof t) switch (t) {
  3221. case 9901:
  3222. t = at.PROFILE_IOS_SPEED;
  3223. break;
  3224. case 9902:
  3225. t = at.PROFILE_IOS_QUALITY;
  3226. break;
  3227. case 9903:
  3228. t = at.PROFILE_IOS_DEFAULT;
  3229. break;
  3230. case 9904:
  3231. t = at.PROFILE_ANDROID;
  3232. break;
  3233. case 9905:
  3234. t = at.PROFILE_DESKTOP;
  3235. break;
  3236. default:
  3237. alert("profile _$6 _$Ui : " + t)
  3238. }
  3239. arguments.length < 2 && (i = !0), i && console.log("profile : " + t.PROFILE_NAME);
  3240. for (var e in t) at[e] = t[e], i && console.log(" [" + e + "] = " + t[e])
  3241. }, at.init = function() {
  3242. if (at._$6b) {
  3243. console.log("Live2D %s", at._$2s), at._$6b = !1;
  3244. !0, at.initProfile()
  3245. }
  3246. }, at.getVersionStr = function() {
  3247. return at._$2s
  3248. }, at.getVersionNo = function() {
  3249. return at._$Kr
  3250. }, at._$sT = function(t) {
  3251. at._$cT = t
  3252. }, at.getError = function() {
  3253. var t = at._$cT;
  3254. return at._$cT = 0, t
  3255. }, at.dispose = function() {
  3256. at.glContext = [], at.frameBuffers = [], at.fTexture = []
  3257. }, at.setGL = function(t, i) {
  3258. var e = i || 0;
  3259. at.glContext[e] = t
  3260. }, at.getGL = function(t) {
  3261. return at.glContext[t]
  3262. }, at.setClippingMaskBufferSize = function(t) {
  3263. at.clippingMaskBufferSize = t
  3264. }, at.getClippingMaskBufferSize = function() {
  3265. return at.clippingMaskBufferSize
  3266. }, at.deleteBuffer = function(t) {
  3267. at.getGL(t).deleteFramebuffer(at.frameBuffers[t].framebuffer), delete at.frameBuffers[t], delete at.glContext[t]
  3268. }, ht._$r2 = function(t) {
  3269. return t < 0 ? 0 : t > 1 ? 1 : .5 - .5 * Math.cos(t * Lt.PI_F)
  3270. }, lt._$fr = -1, lt.prototype.toString = function() {
  3271. return this._$ib
  3272. }, $t.prototype = new W, $t._$42 = 0, $t._$Os = 30, $t._$ms = 0, $t._$ns = 1, $t._$_s = 2, $t._$gT = new Array, $t.prototype._$_S = function(t) {
  3273. this._$LP = t
  3274. }, $t.prototype.getTextureNo = function() {
  3275. return this._$LP
  3276. }, $t.prototype._$ZL = function() {
  3277. return this._$Qi
  3278. }, $t.prototype._$H2 = function() {
  3279. return this._$JP
  3280. }, $t.prototype.getNumPoints = function() {
  3281. return this._$d0
  3282. }, $t.prototype.getType = function() {
  3283. return W._$wb
  3284. }, $t.prototype._$B2 = function(t, i, e) {
  3285. var r = i,
  3286. o = null != r._$hr ? r._$hr : r._$Cr;
  3287. switch (U._$do) {
  3288. default:
  3289. case U._$Ms:
  3290. throw new Error("_$L _$ro ");
  3291. case U._$Qs:
  3292. for (var n = this._$d0 - 1; n >= 0; --n) o[n * U._$No + 4] = e
  3293. }
  3294. }, $t.prototype._$zP = function() {
  3295. this._$GS = new D, this._$GS._$zP()
  3296. }, $t.prototype._$F0 = function(t) {
  3297. W.prototype._$F0.call(this, t), this._$LP = t._$6L(), this._$d0 = t._$6L(), this._$Yo = t._$6L();
  3298. var i = t._$nP();
  3299. this._$BP = new Int16Array(3 * this._$Yo);
  3300. for (var e = 3 * this._$Yo - 1; e >= 0; --e) this._$BP[e] = i[e];
  3301. if (this._$Eo = t._$nP(), this._$Qi = t._$nP(), t.getFormatVersion() >= G._$s7) {
  3302. if (this._$JP = t._$6L(), 0 != this._$JP) {
  3303. if (0 != (1 & this._$JP)) {
  3304. var r = t._$6L();
  3305. null == this._$5P && (this._$5P = new Object), this._$5P._$Hb = parseInt(r)
  3306. }
  3307. 0 != (this._$JP & $t._$Os) ? this._$6s = (this._$JP & $t._$Os) >> 1 : this._$6s = $t._$ms, 0 != (32 & this._$JP) && (this.culling = !1)
  3308. }
  3309. } else this._$JP = 0
  3310. }, $t.prototype.init = function(t) {
  3311. var i = new ut(this),
  3312. e = this._$d0 * U._$No,
  3313. r = this._$32();
  3314. switch (null != i._$Cr && (i._$Cr = null), i._$Cr = new Float32Array(e), null != i._$hr && (i._$hr = null), i._$hr = r ? new Float32Array(e) : null, U._$do) {
  3315. default:
  3316. case U._$Ms:
  3317. if (U._$Ls) for (var o = this._$d0 - 1; o >= 0; --o) {
  3318. var n = o << 1;
  3319. this._$Qi[n + 1] = 1 - this._$Qi[n + 1]
  3320. }
  3321. break;
  3322. case U._$Qs:
  3323. for (var o = this._$d0 - 1; o >= 0; --o) {
  3324. var n = o << 1,
  3325. s = o * U._$No,
  3326. _ = this._$Qi[n],
  3327. a = this._$Qi[n + 1];
  3328. i._$Cr[s] = _, i._$Cr[s + 1] = a, i._$Cr[s + 4] = 0, r && (i._$hr[s] = _, i._$hr[s + 1] = a, i._$hr[s + 4] = 0)
  3329. }
  3330. }
  3331. return i
  3332. }, $t.prototype._$Nr = function(t, i) {
  3333. var e = i;
  3334. if (this != e._$GT() && console.log("### assert!! ### "), this._$GS._$Ur(t) && (W.prototype._$Nr.call(this, t, e), !e._$IS[0])) {
  3335. var r = $t._$gT;
  3336. r[0] = !1, v._$Vr(t, this._$GS, r, this._$d0, this._$Eo, e._$Cr, U._$i2, U._$No)
  3337. }
  3338. }, $t.prototype._$2b = function(t, i) {
  3339. try {
  3340. this != i._$GT() && console.log("### assert!! ### ");
  3341. var e = !1;
  3342. i._$IS[0] && (e = !0);
  3343. var r = i;
  3344. if (!e && (W.prototype._$2b.call(this, t), this._$32())) {
  3345. var o = this.getTargetBaseDataID();
  3346. if (r._$8r == W._$ur && (r._$8r = t.getBaseDataIndex(o)), r._$8r < 0) at._$so && _._$li("_$L _$0P _$G :: %s", o);
  3347. else {
  3348. var n = t.getBaseData(r._$8r),
  3349. s = t._$q2(r._$8r);
  3350. null == n || s._$x2() ? r._$AT = !1 : (n._$nb(t, s, r._$Cr, r._$hr, this._$d0, U._$i2, U._$No), r._$AT = !0), r.baseOpacity = s.getTotalOpacity()
  3351. }
  3352. }
  3353. } catch (t) {
  3354. throw t
  3355. }
  3356. }, $t.prototype.draw = function(t, i, e) {
  3357. if (this != e._$GT() && console.log("### assert!! ### "), !e._$IS[0]) {
  3358. var r = e,
  3359. o = this._$LP;
  3360. o < 0 && (o = 1);
  3361. var n = this.getOpacity(i, r) * e._$VS * e.baseOpacity,
  3362. s = null != r._$hr ? r._$hr : r._$Cr;
  3363. t.setClipBufPre_clipContextForDraw(e.clipBufPre_clipContext), t._$WP(this.culling), t._$Uo(o, 3 * this._$Yo, this._$BP, s, this._$Qi, n, this._$6s, r)
  3364. }
  3365. }, $t.prototype.dump = function() {
  3366. console.log(" _$yi( %d ) , _$d0( %d ) , _$Yo( %d ) \n", this._$LP, this._$d0, this._$Yo), console.log(" _$Oi _$di = { ");
  3367. for (var t = 0; t < this._$BP.length; t++) console.log("%5d ,", this._$BP[t]);
  3368. console.log("\n _$5i _$30");
  3369. for (var t = 0; t < this._$Eo.length; t++) {
  3370. console.log("\n _$30[%d] = ", t);
  3371. for (var i = this._$Eo[t], e = 0; e < i.length; e++) console.log("%6.2f, ", i[e])
  3372. }
  3373. console.log("\n")
  3374. }, $t.prototype._$72 = function(t) {
  3375. return null == this._$5P ? null : this._$5P[t]
  3376. }, $t.prototype.getIndexArray = function() {
  3377. return this._$BP
  3378. }, ut.prototype = new Mt, ut.prototype.getTransformedPoints = function() {
  3379. return null != this._$hr ? this._$hr : this._$Cr
  3380. }, pt.prototype._$HT = function(t) {
  3381. this.x = t.x, this.y = t.y
  3382. }, pt.prototype._$HT = function(t, i) {
  3383. this.x = t, this.y = i
  3384. }, ft.prototype = new i, ft.loadModel = function(t) {
  3385. var e = new ft;
  3386. return i._$62(e, t), e
  3387. }, ft.loadModel = function(t, e) {
  3388. var r = e || 0,
  3389. o = new ft(r);
  3390. return i._$62(o, t), o
  3391. }, ft._$to = function() {
  3392. return new ft
  3393. }, ft._$er = function(t) {
  3394. var i = new _$5("../_$_r/_$t0/_$Ri/_$_P._$d");
  3395. if (0 == i.exists()) throw new _$ls("_$t0 _$_ _$6 _$Ui :: " + i._$PL());
  3396. for (var e = ["../_$_r/_$t0/_$Ri/_$_P.512/_$CP._$1", "../_$_r/_$t0/_$Ri/_$_P.512/_$vP._$1", "../_$_r/_$t0/_$Ri/_$_P.512/_$EP._$1", "../_$_r/_$t0/_$Ri/_$_P.512/_$pP._$1"], r = ft.loadModel(i._$3b()), o = 0; o < e.length; o++) {
  3397. var n = new _$5(e[o]);
  3398. if (0 == n.exists()) throw new _$ls("_$t0 _$_ _$6 _$Ui :: " + n._$PL());
  3399. r.setTexture(o, _$nL._$_o(t, n._$3b()))
  3400. }
  3401. return r
  3402. }, ft.prototype.setGL = function(t) {
  3403. at.setGL(t)
  3404. }, ft.prototype.setTransform = function(t) {
  3405. this.drawParamWebGL.setTransform(t)
  3406. }, ft.prototype.update = function() {
  3407. this._$5S.update(), this._$5S.preDraw(this.drawParamWebGL)
  3408. }, ft.prototype.draw = function() {
  3409. this._$5S.draw(this.drawParamWebGL)
  3410. }, ft.prototype._$K2 = function() {
  3411. this.drawParamWebGL._$K2()
  3412. }, ft.prototype.setTexture = function(t, i) {
  3413. null == this.drawParamWebGL && _._$li("_$Yi for QT _$ki / _$XS() is _$6 _$ui!!"), this.drawParamWebGL.setTexture(t, i)
  3414. }, ft.prototype.setTexture = function(t, i) {
  3415. null == this.drawParamWebGL && _._$li("_$Yi for QT _$ki / _$XS() is _$6 _$ui!!"), this.drawParamWebGL.setTexture(t, i)
  3416. }, ft.prototype._$Rs = function() {
  3417. return this.drawParamWebGL._$Rs()
  3418. }, ft.prototype._$Ds = function(t) {
  3419. this.drawParamWebGL._$Ds(t)
  3420. }, ft.prototype.getDrawParam = function() {
  3421. return this.drawParamWebGL
  3422. }, ft.prototype.setMatrix = function(t) {
  3423. this.drawParamWebGL.setMatrix(t)
  3424. }, ft.prototype.setPremultipliedAlpha = function(t) {
  3425. this.drawParamWebGL.setPremultipliedAlpha(t)
  3426. }, ft.prototype.isPremultipliedAlpha = function() {
  3427. return this.drawParamWebGL.isPremultipliedAlpha()
  3428. }, ft.prototype.setAnisotropy = function(t) {
  3429. this.drawParamWebGL.setAnisotropy(t)
  3430. }, ft.prototype.getAnisotropy = function() {
  3431. return this.drawParamWebGL.getAnisotropy()
  3432. }, ct.prototype._$tb = function() {
  3433. return this.motions
  3434. }, ct.prototype.startMotion = function(t, i) {
  3435. for (var e = null, r = this.motions.length, o = 0; o < r; ++o) null != (e = this.motions[o]) && (e._$qS(e._$w0.getFadeOut()), this._$eb && _._$Ji("MotionQueueManager[size:%2d]->startMotion() / start _$K _$3 (m%d)\n", r, e._$sr));
  3436. if (null == t) return -1;
  3437. e = new dt, e._$w0 = t, this.motions.push(e);
  3438. var n = e._$sr;
  3439. return this._$eb && _._$Ji("MotionQueueManager[size:%2d]->startMotion() / new _$w0 (m%d)\n", r, n), n
  3440. }, ct.prototype.updateParam = function(t) {
  3441. try {
  3442. for (var i = !1, e = 0; e < this.motions.length; e++) {
  3443. var r = this.motions[e];
  3444. if (null != r) {
  3445. var o = r._$w0;
  3446. null != o ? (o.updateParam(t, r), i = !0, r.isFinished() && (this._$eb && _._$Ji("MotionQueueManager[size:%2d]->updateParam() / _$T0 _$w0 (m%d)\n", this.motions.length - 1, r._$sr), this.motions.splice(e, 1), e--)) : (this.motions = this.motions.splice(e, 1), e--)
  3447. } else this.motions.splice(e, 1), e--
  3448. }
  3449. return i
  3450. } catch (t) {
  3451. return _._$li(t), !0
  3452. }
  3453. }, ct.prototype.isFinished = function(t) {
  3454. if (arguments.length >= 1) {
  3455. for (var i = 0; i < this.motions.length; i++) {
  3456. var e = this.motions[i];
  3457. if (null != e && (e._$sr == t && !e.isFinished())) return !1
  3458. }
  3459. return !0
  3460. }
  3461. for (var i = 0; i < this.motions.length; i++) {
  3462. var e = this.motions[i];
  3463. if (null != e) {
  3464. if (null != e._$w0) {
  3465. if (!e.isFinished()) return !1
  3466. } else this.motions.splice(i, 1), i--
  3467. } else this.motions.splice(i, 1), i--
  3468. }
  3469. return !0
  3470. }, ct.prototype.stopAllMotions = function() {
  3471. for (var t = 0; t < this.motions.length; t++) {
  3472. var i = this.motions[t];
  3473. if (null != i) {
  3474. i._$w0;
  3475. this.motions.splice(t, 1), t--
  3476. } else this.motions.splice(t, 1), t--
  3477. }
  3478. }, ct.prototype._$Zr = function(t) {
  3479. this._$eb = t
  3480. }, ct.prototype._$e = function() {
  3481. console.log("-- _$R --\n");
  3482. for (var t = 0; t < this.motions.length; t++) {
  3483. var i = this.motions[t],
  3484. e = i._$w0;
  3485. console.log("MotionQueueEnt[%d] :: %s\n", this.motions.length, e.toString())
  3486. }
  3487. }, dt._$Gs = 0, dt.prototype.isFinished = function() {
  3488. return this._$9L
  3489. }, dt.prototype._$qS = function(t) {
  3490. var i = w.getUserTimeMSec(),
  3491. e = i + t;
  3492. (this._$Do < 0 || e < this._$Do) && (this._$Do = e)
  3493. }, dt.prototype._$Bs = function() {
  3494. return this._$sr
  3495. }, gt.prototype.setContext = function(t) {
  3496. var i = this.m;
  3497. t.transform(i[0], i[1], i[3], i[4], i[6], i[7])
  3498. }, gt.prototype.toString = function() {
  3499. for (var t = "LDTransform { ", i = 0; i < 9; i++) t += this.m[i].toFixed(2) + " ,";
  3500. return t += " }"
  3501. }, gt.prototype.identity = function() {
  3502. var t = this.m;
  3503. t[0] = t[4] = t[8] = 1, t[1] = t[2] = t[3] = t[5] = t[6] = t[7] = 0
  3504. }, gt.prototype._$PS = function(t, i, e) {
  3505. null == e && (e = new Array(0, 0));
  3506. var r = this.m;
  3507. return e[0] = r[0] * t + r[3] * i + r[6], e[1] = r[1] * t + r[4] * i + r[7], e
  3508. }, gt.prototype._$P2 = function(t) {
  3509. t || (t = new gt);
  3510. var i = this.m,
  3511. e = i[0],
  3512. r = i[1],
  3513. o = i[2],
  3514. n = i[3],
  3515. s = i[4],
  3516. _ = i[5],
  3517. a = i[6],
  3518. h = i[7],
  3519. l = i[8],
  3520. $ = e * s * l + r * _ * a + o * n * h - e * _ * h - o * s * a - r * n * l;
  3521. if (0 == $) return null;
  3522. var u = 1 / $;
  3523. return t.m[0] = u * (s * l - h * _), t.m[1] = u * (h * o - r * l), t.m[2] = u * (r * _ - s * o), t.m[3] = u * (a * _ - n * l), t.m[4] = u * (e * l - a * o), t.m[5] = u * (n * o - e * _), t.m[6] = u * (n * h - a * s), t.m[7] = u * (a * r - e * h), t.m[8] = u * (e * s - n * r), t
  3524. }, gt.prototype.transform = function(t, i, e) {
  3525. null == e && (e = new Array(0, 0));
  3526. var r = this.m;
  3527. return e[0] = r[0] * t + r[3] * i + r[6], e[1] = r[1] * t + r[4] * i + r[7], e
  3528. }, gt.prototype.translate = function(t, i) {
  3529. var e = this.m;
  3530. e[6] = e[0] * t + e[3] * i + e[6], e[7] = e[1] * t + e[4] * i + e[7], e[8] = e[2] * t + e[5] * i + e[8]
  3531. }, gt.prototype.scale = function(t, i) {
  3532. var e = this.m;
  3533. e[0] *= t, e[1] *= t, e[2] *= t, e[3] *= i, e[4] *= i, e[5] *= i
  3534. }, gt.prototype.shear = function(t, i) {
  3535. var e = this.m,
  3536. r = e[0] + e[3] * i,
  3537. o = e[1] + e[4] * i,
  3538. n = e[2] + e[5] * i;
  3539. e[3] = e[0] * t + e[3], e[4] = e[1] * t + e[4], e[5] = e[2] * t + e[5], e[0] = r, e[1] = o, e[2] = n
  3540. }, gt.prototype.rotate = function(t) {
  3541. var i = this.m,
  3542. e = Math.cos(t),
  3543. r = Math.sin(t),
  3544. o = i[0] * e + i[3] * r,
  3545. n = i[1] * e + i[4] * r,
  3546. s = i[2] * e + i[5] * r;
  3547. i[3] = -i[0] * r + i[3] * e, i[4] = -i[1] * r + i[4] * e, i[5] = -i[2] * r + i[5] * e, i[0] = o, i[1] = n, i[2] = s
  3548. }, gt.prototype.concatenate = function(t) {
  3549. var i = this.m,
  3550. e = t.m,
  3551. r = i[0] * e[0] + i[3] * e[1] + i[6] * e[2],
  3552. o = i[1] * e[0] + i[4] * e[1] + i[7] * e[2],
  3553. n = i[2] * e[0] + i[5] * e[1] + i[8] * e[2],
  3554. s = i[0] * e[3] + i[3] * e[4] + i[6] * e[5],
  3555. _ = i[1] * e[3] + i[4] * e[4] + i[7] * e[5],
  3556. a = i[2] * e[3] + i[5] * e[4] + i[8] * e[5],
  3557. h = i[0] * e[6] + i[3] * e[7] + i[6] * e[8],
  3558. l = i[1] * e[6] + i[4] * e[7] + i[7] * e[8],
  3559. $ = i[2] * e[6] + i[5] * e[7] + i[8] * e[8];
  3560. m[0] = r, m[1] = o, m[2] = n, m[3] = s, m[4] = _, m[5] = a, m[6] = h, m[7] = l, m[8] = $
  3561. }, yt.prototype = new et, yt._$eT = null, yt._$tP = new Object, yt._$2o = function() {
  3562. return null == yt._$eT && (yt._$eT = yt.getID("DST_BASE")), yt._$eT
  3563. }, yt._$27 = function() {
  3564. yt._$tP.clear(), yt._$eT = null
  3565. }, yt.getID = function(t) {
  3566. var i = yt._$tP[t];
  3567. return null == i && (i = new yt(t), yt._$tP[t] = i), i
  3568. }, yt.prototype._$3s = function() {
  3569. return new yt
  3570. }, mt.prototype = new E, mt._$9r = function(t) {
  3571. return new Float32Array(t)
  3572. }, mt._$vb = function(t) {
  3573. return new Int16Array(t)
  3574. }, mt._$cr = function(t, i) {
  3575. return null == t || t._$yL() < i.length ? (t = mt._$9r(2 * i.length), t.put(i), t._$oT(0)) : (t.clear(), t.put(i), t._$oT(0)), t
  3576. }, mt._$mb = function(t, i) {
  3577. return null == t || t._$yL() < i.length ? (t = mt._$vb(2 * i.length), t.put(i), t._$oT(0)) : (t.clear(), t.put(i), t._$oT(0)), t
  3578. }, mt._$Hs = function() {
  3579. return this._$Gr
  3580. }, mt._$as = function(t) {
  3581. this._$Gr = t
  3582. }, mt.prototype.getGL = function() {
  3583. return this.gl
  3584. }, mt.prototype.setGL = function(t) {
  3585. this.gl = t
  3586. }, mt.prototype.setTransform = function(t) {
  3587. this.transform = t
  3588. }, mt.prototype._$ZT = function() {
  3589. var t = this.gl;
  3590. this.firstDraw && (this.initShader(), this.firstDraw = !1, this.anisotropyExt = t.getExtension("EXT_texture_filter_anisotropic") || t.getExtension("WEBKIT_EXT_texture_filter_anisotropic") || t.getExtension("MOZ_EXT_texture_filter_anisotropic"), this.anisotropyExt && (this.maxAnisotropy = t.getParameter(this.anisotropyExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT))), t.disable(t.SCISSOR_TEST), t.disable(t.STENCIL_TEST), t.disable(t.DEPTH_TEST), t.frontFace(t.CW), t.enable(t.BLEND), t.colorMask(1, 1, 1, 1), t.bindBuffer(t.ARRAY_BUFFER, null), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, null)
  3591. }, mt.prototype._$Uo = function(t, i, e, r, o, n, s, _) {
  3592. if (!(n < .01 && null == this.clipBufPre_clipContextMask)) {
  3593. var a = (n > .9 && at.EXPAND_W, this.gl);
  3594. if (null == this.gl) throw new Error("gl is null");
  3595. var h = 1 * this._$C0 * n,
  3596. l = 1 * this._$tT * n,
  3597. $ = 1 * this._$WL * n,
  3598. u = this._$lT * n;
  3599. if (null != this.clipBufPre_clipContextMask) {
  3600. a.frontFace(a.CCW), a.useProgram(this.shaderProgram), this._$vS = Tt(a, this._$vS, r), this._$no = Pt(a, this._$no, e), a.enableVertexAttribArray(this.a_position_Loc), a.vertexAttribPointer(this.a_position_Loc, 2, a.FLOAT, !1, 0, 0), this._$NT = Tt(a, this._$NT, o), a.activeTexture(a.TEXTURE1), a.bindTexture(a.TEXTURE_2D, this.textures[t]), a.uniform1i(this.s_texture0_Loc, 1), a.enableVertexAttribArray(this.a_texCoord_Loc), a.vertexAttribPointer(this.a_texCoord_Loc, 2, a.FLOAT, !1, 0, 0), a.uniformMatrix4fv(this.u_matrix_Loc, !1, this.getClipBufPre_clipContextMask().matrixForMask);
  3601. var p = this.getClipBufPre_clipContextMask().layoutChannelNo,
  3602. f = this.getChannelFlagAsColor(p);
  3603. a.uniform4f(this.u_channelFlag, f.r, f.g, f.b, f.a);
  3604. var c = this.getClipBufPre_clipContextMask().layoutBounds;
  3605. a.uniform4f(this.u_baseColor_Loc, 2 * c.x - 1, 2 * c.y - 1, 2 * c._$EL() - 1, 2 * c._$5T() - 1), a.uniform1i(this.u_maskFlag_Loc, !0)
  3606. } else if (null != this.getClipBufPre_clipContextDraw()) {
  3607. a.useProgram(this.shaderProgramOff), this._$vS = Tt(a, this._$vS, r), this._$no = Pt(a, this._$no, e), a.enableVertexAttribArray(this.a_position_Loc_Off), a.vertexAttribPointer(this.a_position_Loc_Off, 2, a.FLOAT, !1, 0, 0), this._$NT = Tt(a, this._$NT, o), a.activeTexture(a.TEXTURE1), a.bindTexture(a.TEXTURE_2D, this.textures[t]), a.uniform1i(this.s_texture0_Loc_Off, 1), a.enableVertexAttribArray(this.a_texCoord_Loc_Off), a.vertexAttribPointer(this.a_texCoord_Loc_Off, 2, a.FLOAT, !1, 0, 0), a.uniformMatrix4fv(this.u_clipMatrix_Loc_Off, !1, this.getClipBufPre_clipContextDraw().matrixForDraw), a.uniformMatrix4fv(this.u_matrix_Loc_Off, !1, this.matrix4x4), a.activeTexture(a.TEXTURE2), a.bindTexture(a.TEXTURE_2D, at.fTexture[this.glno]), a.uniform1i(this.s_texture1_Loc_Off, 2);
  3608. var p = this.getClipBufPre_clipContextDraw().layoutChannelNo,
  3609. f = this.getChannelFlagAsColor(p);
  3610. a.uniform4f(this.u_channelFlag_Loc_Off, f.r, f.g, f.b, f.a), a.uniform4f(this.u_baseColor_Loc_Off, h, l, $, u)
  3611. } else a.useProgram(this.shaderProgram), this._$vS = Tt(a, this._$vS, r), this._$no = Pt(a, this._$no, e), a.enableVertexAttribArray(this.a_position_Loc), a.vertexAttribPointer(this.a_position_Loc, 2, a.FLOAT, !1, 0, 0), this._$NT = Tt(a, this._$NT, o), a.activeTexture(a.TEXTURE1), a.bindTexture(a.TEXTURE_2D, this.textures[t]), a.uniform1i(this.s_texture0_Loc, 1), a.enableVertexAttribArray(this.a_texCoord_Loc), a.vertexAttribPointer(this.a_texCoord_Loc, 2, a.FLOAT, !1, 0, 0), a.uniformMatrix4fv(this.u_matrix_Loc, !1, this.matrix4x4), a.uniform4f(this.u_baseColor_Loc, h, l, $, u), a.uniform1i(this.u_maskFlag_Loc, !1);
  3612. this.culling ? this.gl.enable(a.CULL_FACE) : this.gl.disable(a.CULL_FACE), this.gl.enable(a.BLEND);
  3613. var d, g, y, m;
  3614. if (null != this.clipBufPre_clipContextMask) d = a.ONE, g = a.ONE_MINUS_SRC_ALPHA, y = a.ONE, m = a.ONE_MINUS_SRC_ALPHA;
  3615. else switch (s) {
  3616. case $t._$ms:
  3617. d = a.ONE, g = a.ONE_MINUS_SRC_ALPHA, y = a.ONE, m = a.ONE_MINUS_SRC_ALPHA;
  3618. break;
  3619. case $t._$ns:
  3620. d = a.ONE, g = a.ONE, y = a.ZERO, m = a.ONE;
  3621. break;
  3622. case $t._$_s:
  3623. d = a.DST_COLOR, g = a.ONE_MINUS_SRC_ALPHA, y = a.ZERO, m = a.ONE
  3624. }
  3625. a.blendEquationSeparate(a.FUNC_ADD, a.FUNC_ADD), a.blendFuncSeparate(d, g, y, m), this.anisotropyExt && a.texParameteri(a.TEXTURE_2D, this.anisotropyExt.TEXTURE_MAX_ANISOTROPY_EXT, this.maxAnisotropy);
  3626. var T = e.length;
  3627. a.drawElements(a.TRIANGLES, T, a.UNSIGNED_SHORT, 0), a.bindTexture(a.TEXTURE_2D, null)
  3628. }
  3629. }, mt.prototype._$Rs = function() {
  3630. throw new Error("_$Rs")
  3631. }, mt.prototype._$Ds = function(t) {
  3632. throw new Error("_$Ds")
  3633. }, mt.prototype._$K2 = function() {
  3634. for (var t = 0; t < this.textures.length; t++) {
  3635. 0 != this.textures[t] && (this.gl._$K2(1, this.textures, t), this.textures[t] = null)
  3636. }
  3637. }, mt.prototype.setTexture = function(t, i) {
  3638. this.textures[t] = i
  3639. }, mt.prototype.initShader = function() {
  3640. var t = this.gl;
  3641. this.loadShaders2(), this.a_position_Loc = t.getAttribLocation(this.shaderProgram, "a_position"), this.a_texCoord_Loc = t.getAttribLocation(this.shaderProgram, "a_texCoord"), this.u_matrix_Loc = t.getUniformLocation(this.shaderProgram, "u_mvpMatrix"), this.s_texture0_Loc = t.getUniformLocation(this.shaderProgram, "s_texture0"), this.u_channelFlag = t.getUniformLocation(this.shaderProgram, "u_channelFlag"), this.u_baseColor_Loc = t.getUniformLocation(this.shaderProgram, "u_baseColor"), this.u_maskFlag_Loc = t.getUniformLocation(this.shaderProgram, "u_maskFlag"), this.a_position_Loc_Off = t.getAttribLocation(this.shaderProgramOff, "a_position"), this.a_texCoord_Loc_Off = t.getAttribLocation(this.shaderProgramOff, "a_texCoord"), this.u_matrix_Loc_Off = t.getUniformLocation(this.shaderProgramOff, "u_mvpMatrix"), this.u_clipMatrix_Loc_Off = t.getUniformLocation(this.shaderProgramOff, "u_ClipMatrix"), this.s_texture0_Loc_Off = t.getUniformLocation(this.shaderProgramOff, "s_texture0"), this.s_texture1_Loc_Off = t.getUniformLocation(this.shaderProgramOff, "s_texture1"), this.u_channelFlag_Loc_Off = t.getUniformLocation(this.shaderProgramOff, "u_channelFlag"), this.u_baseColor_Loc_Off = t.getUniformLocation(this.shaderProgramOff, "u_baseColor")
  3642. }, mt.prototype.disposeShader = function() {
  3643. var t = this.gl;
  3644. this.shaderProgram && (t.deleteProgram(this.shaderProgram), this.shaderProgram = null), this.shaderProgramOff && (t.deleteProgram(this.shaderProgramOff), this.shaderProgramOff = null)
  3645. }, mt.prototype.compileShader = function(t, i) {
  3646. var e = this.gl,
  3647. r = i,
  3648. o = e.createShader(t);
  3649. if (null == o) return _._$Ji("_$L0 to create shader"), null;
  3650. if (e.shaderSource(o, r), e.compileShader(o), !e.getShaderParameter(o, e.COMPILE_STATUS)) {
  3651. var n = e.getShaderInfoLog(o);
  3652. return _._$Ji("_$L0 to compile shader : " + n), e.deleteShader(o), null
  3653. }
  3654. return o
  3655. }, mt.prototype.loadShaders2 = function() {
  3656. var t = this.gl;
  3657. if (this.shaderProgram = t.createProgram(), !this.shaderProgram) return !1;
  3658. if (this.shaderProgramOff = t.createProgram(), !this.shaderProgramOff) return !1;
  3659. if (this.vertShader = this.compileShader(t.VERTEX_SHADER, "attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_ClipPos;uniform mat4 u_mvpMatrix;void main(){ gl_Position = u_mvpMatrix * a_position; v_ClipPos = u_mvpMatrix * a_position; v_texCoord = a_texCoord;}"), !this.vertShader) return _._$Ji("Vertex shader compile _$li!"), !1;
  3660. if (this.vertShaderOff = this.compileShader(t.VERTEX_SHADER, "attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_ClipPos;uniform mat4 u_mvpMatrix;uniform mat4 u_ClipMatrix;void main(){ gl_Position = u_mvpMatrix * a_position; v_ClipPos = u_ClipMatrix * a_position; v_texCoord = a_texCoord ;}"), !this.vertShaderOff) return _._$Ji("OffVertex shader compile _$li!"), !1;
  3661. if (this.fragShader = this.compileShader(t.FRAGMENT_SHADER, "precision mediump float;varying vec2 v_texCoord;varying vec4 v_ClipPos;uniform sampler2D s_texture0;uniform vec4 u_channelFlag;uniform vec4 u_baseColor;uniform bool u_maskFlag;void main(){ vec4 smpColor; if(u_maskFlag){ float isInside = step(u_baseColor.x, v_ClipPos.x/v_ClipPos.w) * step(u_baseColor.y, v_ClipPos.y/v_ClipPos.w) * step(v_ClipPos.x/v_ClipPos.w, u_baseColor.z) * step(v_ClipPos.y/v_ClipPos.w, u_baseColor.w); smpColor = u_channelFlag * texture2D(s_texture0 , v_texCoord).a * isInside; }else{ smpColor = texture2D(s_texture0 , v_texCoord) * u_baseColor; } gl_FragColor = smpColor;}"), !this.fragShader) return _._$Ji("Fragment shader compile _$li!"), !1;
  3662. if (this.fragShaderOff = this.compileShader(t.FRAGMENT_SHADER, "precision mediump float ;varying vec2 v_texCoord;varying vec4 v_ClipPos;uniform sampler2D s_texture0;uniform sampler2D s_texture1;uniform vec4 u_channelFlag;uniform vec4 u_baseColor ;void main(){ vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor; vec4 clipMask = texture2D(s_texture1, v_ClipPos.xy / v_ClipPos.w) * u_channelFlag; float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a; col_formask = col_formask * maskVal; gl_FragColor = col_formask;}"), !this.fragShaderOff) return _._$Ji("OffFragment shader compile _$li!"), !1;
  3663. if (t.attachShader(this.shaderProgram, this.vertShader), t.attachShader(this.shaderProgram, this.fragShader), t.attachShader(this.shaderProgramOff, this.vertShaderOff), t.attachShader(this.shaderProgramOff, this.fragShaderOff), t.linkProgram(this.shaderProgram), t.linkProgram(this.shaderProgramOff), !t.getProgramParameter(this.shaderProgram, t.LINK_STATUS)) {
  3664. var i = t.getProgramInfoLog(this.shaderProgram);
  3665. return _._$Ji("_$L0 to link program: " + i), this.vertShader && (t.deleteShader(this.vertShader), this.vertShader = 0), this.fragShader && (t.deleteShader(this.fragShader), this.fragShader = 0), this.shaderProgram && (t.deleteProgram(this.shaderProgram), this.shaderProgram = 0), this.vertShaderOff && (t.deleteShader(this.vertShaderOff), this.vertShaderOff = 0), this.fragShaderOff && (t.deleteShader(this.fragShaderOff), this.fragShaderOff = 0), this.shaderProgramOff && (t.deleteProgram(this.shaderProgramOff), this.shaderProgramOff = 0), !1
  3666. }
  3667. return !0
  3668. }, mt.prototype.createFramebuffer = function() {
  3669. var t = this.gl,
  3670. i = at.clippingMaskBufferSize,
  3671. e = t.createFramebuffer();
  3672. t.bindFramebuffer(t.FRAMEBUFFER, e);
  3673. var r = t.createRenderbuffer();
  3674. t.bindRenderbuffer(t.RENDERBUFFER, r), t.renderbufferStorage(t.RENDERBUFFER, t.RGBA4, i, i), t.framebufferRenderbuffer(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.RENDERBUFFER, r);
  3675. var o = t.createTexture();
  3676. return t.bindTexture(t.TEXTURE_2D, o), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, i, i, 0, t.RGBA, t.UNSIGNED_BYTE, null), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.LINEAR), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.LINEAR), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE), t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, o, 0), t.bindTexture(t.TEXTURE_2D, null), t.bindRenderbuffer(t.RENDERBUFFER, null), t.bindFramebuffer(t.FRAMEBUFFER, null), at.fTexture[this.glno] = o, {
  3677. framebuffer: e,
  3678. renderbuffer: r,
  3679. texture: at.fTexture[this.glno]
  3680. }
  3681. }, St.prototype._$fP = function() {
  3682. var t, i, e, r = this._$ST();
  3683. if (0 == (128 & r)) return 255 & r;
  3684. if (0 == (128 & (t = this._$ST()))) return (127 & r) << 7 | 127 & t;
  3685. if (0 == (128 & (i = this._$ST()))) return (127 & r) << 14 | (127 & t) << 7 | 255 & i;
  3686. if (0 == (128 & (e = this._$ST()))) return (127 & r) << 21 | (127 & t) << 14 | (127 & i) << 7 | 255 & e;
  3687. throw new lt("_$L _$0P _")
  3688. }, St.prototype.getFormatVersion = function() {
  3689. return this._$S2
  3690. }, St.prototype._$gr = function(t) {
  3691. this._$S2 = t
  3692. }, St.prototype._$3L = function() {
  3693. return this._$fP()
  3694. }, St.prototype._$mP = function() {
  3695. return this._$zT(), this._$F += 8, this._$T.getFloat64(this._$F - 8)
  3696. }, St.prototype._$_T = function() {
  3697. return this._$zT(), this._$F += 4, this._$T.getFloat32(this._$F - 4)
  3698. }, St.prototype._$6L = function() {
  3699. return this._$zT(), this._$F += 4, this._$T.getInt32(this._$F - 4)
  3700. }, St.prototype._$ST = function() {
  3701. return this._$zT(), this._$T.getInt8(this._$F++)
  3702. }, St.prototype._$9T = function() {
  3703. return this._$zT(), this._$F += 2, this._$T.getInt16(this._$F - 2)
  3704. }, St.prototype._$2T = function() {
  3705. throw this._$zT(), this._$F += 8, new lt("_$L _$q read long")
  3706. }, St.prototype._$po = function() {
  3707. return this._$zT(), 0 != this._$T.getInt8(this._$F++)
  3708. };
  3709. var xt = !0;
  3710. St.prototype._$bT = function() {
  3711. this._$zT();
  3712. var t = this._$3L(),
  3713. i = null;
  3714. if (xt) try {
  3715. var e = new ArrayBuffer(2 * t);
  3716. i = new Uint16Array(e);
  3717. for (var r = 0; r < t; ++r) i[r] = this._$T.getUint8(this._$F++);
  3718. return String.fromCharCode.apply(null, i)
  3719. } catch (t) {
  3720. xt = !1
  3721. }
  3722. try {
  3723. var o = new Array;
  3724. if (null == i) for (var r = 0; r < t; ++r) o[r] = this._$T.getUint8(this._$F++);
  3725. else for (var r = 0; r < t; ++r) o[r] = i[r];
  3726. return String.fromCharCode.apply(null, o)
  3727. } catch (t) {
  3728. console.log("read utf8 / _$rT _$L0 !! : " + t)
  3729. }
  3730. }, St.prototype._$cS = function() {
  3731. this._$zT();
  3732. for (var t = this._$3L(), i = new Int32Array(t), e = 0; e < t; e++) i[e] = this._$T.getInt32(this._$F), this._$F += 4;
  3733. return i
  3734. }, St.prototype._$Tb = function() {
  3735. this._$zT();
  3736. for (var t = this._$3L(), i = new Float32Array(t), e = 0; e < t; e++) i[e] = this._$T.getFloat32(this._$F), this._$F += 4;
  3737. return i
  3738. }, St.prototype._$5b = function() {
  3739. this._$zT();
  3740. for (var t = this._$3L(), i = new Float64Array(t), e = 0; e < t; e++) i[e] = this._$T.getFloat64(this._$F), this._$F += 8;
  3741. return i
  3742. }, St.prototype._$nP = function() {
  3743. return this._$Jb(-1)
  3744. }, St.prototype._$Jb = function(t) {
  3745. if (this._$zT(), t < 0 && (t = this._$3L()), t == G._$7P) {
  3746. var i = this._$6L();
  3747. if (0 <= i && i < this._$Ko.length) return this._$Ko[i];
  3748. throw new lt("_$sL _$4i @_$m0")
  3749. }
  3750. var e = this._$4b(t);
  3751. return this._$Ko.push(e), e
  3752. }, St.prototype._$4b = function(t) {
  3753. if (0 == t) return null;
  3754. if (50 == t) {
  3755. var i = this._$bT(),
  3756. e = b.getID(i);
  3757. return e
  3758. }
  3759. if (51 == t) {
  3760. var i = this._$bT(),
  3761. e = yt.getID(i);
  3762. return e
  3763. }
  3764. if (134 == t) {
  3765. var i = this._$bT(),
  3766. e = l.getID(i);
  3767. return e
  3768. }
  3769. if (60 == t) {
  3770. var i = this._$bT(),
  3771. e = u.getID(i);
  3772. return e
  3773. }
  3774. if (t >= 48) {
  3775. var r = G._$9o(t);
  3776. return null != r ? (r._$F0(this), r) : null
  3777. }
  3778. switch (t) {
  3779. case 1:
  3780. return this._$bT();
  3781. case 10:
  3782. return new n(this._$6L(), !0);
  3783. case 11:
  3784. return new S(this._$mP(), this._$mP(), this._$mP(), this._$mP());
  3785. case 12:
  3786. return new S(this._$_T(), this._$_T(), this._$_T(), this._$_T());
  3787. case 13:
  3788. return new L(this._$mP(), this._$mP());
  3789. case 14:
  3790. return new L(this._$_T(), this._$_T());
  3791. case 15:
  3792. for (var o = this._$3L(), e = new Array(o), s = 0; s < o; s++) e[s] = this._$nP();
  3793. return e;
  3794. case 17:
  3795. var e = new F(this._$mP(), this._$mP(), this._$mP(), this._$mP(), this._$mP(), this._$mP());
  3796. return e;
  3797. case 21:
  3798. return new h(this._$6L(), this._$6L(), this._$6L(), this._$6L());
  3799. case 22:
  3800. return new pt(this._$6L(), this._$6L());
  3801. case 23:
  3802. throw new Error("_$L _$ro ");
  3803. case 16:
  3804. case 25:
  3805. return this._$cS();
  3806. case 26:
  3807. return this._$5b();
  3808. case 27:
  3809. return this._$Tb();
  3810. case 2:
  3811. case 3:
  3812. case 4:
  3813. case 5:
  3814. case 6:
  3815. case 7:
  3816. case 8:
  3817. case 9:
  3818. case 18:
  3819. case 19:
  3820. case 20:
  3821. case 24:
  3822. case 28:
  3823. throw new lt("_$6 _$q : _$nP() of 2-9 ,18,19,20,24,28 : " + t);
  3824. default:
  3825. throw new lt("_$6 _$q : _$nP() NO _$i : " + t)
  3826. }
  3827. }, St.prototype._$8L = function() {
  3828. return 0 == this._$hL ? this._$v0 = this._$ST() : 8 == this._$hL && (this._$v0 = this._$ST(), this._$hL = 0), 1 == (this._$v0 >> 7 - this._$hL++ & 1)
  3829. }, St.prototype._$zT = function() {
  3830. 0 != this._$hL && (this._$hL = 0)
  3831. }, vt.prototype._$wP = function(t, i, e) {
  3832. for (var r = 0; r < e; r++) {
  3833. for (var o = 0; o < i; o++) {
  3834. var n = 2 * (o + r * i);
  3835. console.log("(% 7.3f , % 7.3f) , ", t[n], t[n + 1])
  3836. }
  3837. console.log("\n")
  3838. }
  3839. console.log("\n")
  3840. }, Lt._$2S = Math.PI / 180, Lt._$bS = Math.PI / 180, Lt._$wS = 180 / Math.PI, Lt._$NS = 180 / Math.PI, Lt.PI_F = Math.PI, Lt._$kT = [0, .012368, .024734, .037097, .049454, .061803, .074143, .086471, .098786, .111087, .12337, .135634, .147877, .160098, .172295, .184465, .196606, .208718, .220798, .232844, .244854, .256827, .268761, .280654, .292503, .304308, .316066, .327776, .339436, .351044, .362598, .374097, .385538, .396921, .408243, .419502, .430697, .441826, .452888, .463881, .474802, .485651, .496425, .507124, .517745, .528287, .538748, .549126, .559421, .56963, .579752, .589785, .599728, .609579, .619337, .629, .638567, .648036, .657406, .666676, .675843, .684908, .693867, .70272, .711466, .720103, .72863, .737045, .745348, .753536, .76161, .769566, .777405, .785125, .792725, .800204, .807561, .814793, .821901, .828884, .835739, .842467, .849066, .855535, .861873, .868079, .874153, .880093, .885898, .891567, .897101, .902497, .907754, .912873, .917853, .922692, .92739, .931946, .936359, .940629, .944755, .948737, .952574, .956265, .959809, .963207, .966457, .96956, .972514, .97532, .977976, .980482, .982839, .985045, .987101, .989006, .990759, .992361, .993811, .995109, .996254, .997248, .998088, .998776, .999312, .999694, .999924, 1], Lt._$92 = function(t, i) {
  3841. var e = Math.atan2(t[1], t[0]),
  3842. r = Math.atan2(i[1], i[0]);
  3843. return Lt._$tS(e, r)
  3844. }, Lt._$tS = function(t, i) {
  3845. for (var e = t - i; e < -Math.PI;) e += 2 * Math.PI;
  3846. for (; e > Math.PI;) e -= 2 * Math.PI;
  3847. return e
  3848. }, Lt._$9 = function(t) {
  3849. return Math.sin(t)
  3850. }, Lt.fcos = function(t) {
  3851. return Math.cos(t)
  3852. }, Mt.prototype._$u2 = function() {
  3853. return this._$IS[0]
  3854. }, Mt.prototype._$yo = function() {
  3855. return this._$AT && !this._$IS[0]
  3856. }, Mt.prototype._$GT = function() {
  3857. return this._$e0
  3858. }, Et._$W2 = 0, Et.SYSTEM_INFO = null, Et.USER_AGENT = navigator.userAgent, Et.isIPhone = function() {
  3859. return Et.SYSTEM_INFO || Et.setup(), Et.SYSTEM_INFO._isIPhone
  3860. }, Et.isIOS = function() {
  3861. return Et.SYSTEM_INFO || Et.setup(), Et.SYSTEM_INFO._isIPhone || Et.SYSTEM_INFO._isIPad
  3862. }, Et.isAndroid = function() {
  3863. return Et.SYSTEM_INFO || Et.setup(), Et.SYSTEM_INFO._isAndroid
  3864. }, Et.getOSVersion = function() {
  3865. return Et.SYSTEM_INFO || Et.setup(), Et.SYSTEM_INFO.version
  3866. }, Et.getOS = function() {
  3867. return Et.SYSTEM_INFO || Et.setup(), Et.SYSTEM_INFO._isIPhone || Et.SYSTEM_INFO._isIPad ? "iOS" : Et.SYSTEM_INFO._isAndroid ? "Android" : "_$Q0 OS"
  3868. }, Et.setup = function() {
  3869. function t(t, i) {
  3870. for (var e = t.substring(i).split(/[ _,;\.]/), r = 0, o = 0; o <= 2 && !isNaN(e[o]); o++) {
  3871. var n = parseInt(e[o]);
  3872. if (n < 0 || n > 999) {
  3873. _._$li("err : " + n + " @UtHtml5.setup()"), r = 0;
  3874. break
  3875. }
  3876. r += n * Math.pow(1e3, 2 - o)
  3877. }
  3878. return r
  3879. }
  3880. var i, e = Et.USER_AGENT,
  3881. r = Et.SYSTEM_INFO = {
  3882. userAgent: e
  3883. };
  3884. if ((i = e.indexOf("iPhone OS ")) >= 0) r.os = "iPhone", r._isIPhone = !0, r.version = t(e, i + "iPhone OS ".length);
  3885. else if ((i = e.indexOf("iPad")) >= 0) {
  3886. if ((i = e.indexOf("CPU OS")) < 0) return void _._$li(" err : " + e + " @UtHtml5.setup()");
  3887. r.os = "iPad", r._isIPad = !0, r.version = t(e, i + "CPU OS ".length)
  3888. } else(i = e.indexOf("Android")) >= 0 ? (r.os = "Android", r._isAndroid = !0, r.version = t(e, i + "Android ".length)) : (r.os = "-", r.version = -1)
  3889. }, window.UtSystem = w, window.UtDebug = _, window.LDTransform = gt, window.LDGL = nt, window.Live2D = at, window.Live2DModelWebGL = ft, window.Live2DModelJS = q, window.Live2DMotion = J, window.MotionQueueManager = ct, window.PhysicsHair = f, window.AMotion = s, window.PartsDataID = l, window.DrawDataID = b, window.BaseDataID = yt, window.ParamID = u, at.init();
  3890. var At = !1
  3891. }()
  3892. }).call(i, e(7))
  3893. }, function(t, i) {
  3894. t.exports = {
  3895. import: function() {
  3896. throw new Error("System.import cannot be used indirectly")
  3897. }
  3898. }
  3899. }, function(t, i, e) {
  3900. "use strict";
  3901. function r(t) {
  3902. return t && t.__esModule ? t : {
  3903. default:
  3904. t
  3905. }
  3906. }
  3907. function o() {
  3908. this.models = [], this.count = -1, this.reloadFlg = !1, Live2D.init(), n.Live2DFramework.setPlatformManager(new _.
  3909. default)
  3910. }
  3911. Object.defineProperty(i, "__esModule", {
  3912. value: !0
  3913. }), i.
  3914. default = o;
  3915. var n = e(0),
  3916. s = e(9),
  3917. _ = r(s),
  3918. a = e(10),
  3919. h = r(a),
  3920. l = e(1),
  3921. $ = r(l);
  3922. o.prototype.createModel = function() {
  3923. var t = new h.
  3924. default;
  3925. return this.models.push(t), t
  3926. }, o.prototype.changeModel = function(t, i) {
  3927. if (this.reloadFlg) {
  3928. this.reloadFlg = !1;
  3929. this.releaseModel(0, t), this.createModel(), this.models[0].load(t, i)
  3930. }
  3931. }, o.prototype.getModel = function(t) {
  3932. return t >= this.models.length ? null : this.models[t]
  3933. }, o.prototype.releaseModel = function(t, i) {
  3934. this.models.length <= t || (this.models[t].release(i), delete this.models[t], this.models.splice(t, 1))
  3935. }, o.prototype.numModels = function() {
  3936. return this.models.length
  3937. }, o.prototype.setDrag = function(t, i) {
  3938. for (var e = 0; e < this.models.length; e++) this.models[e].setDrag(t, i)
  3939. }, o.prototype.maxScaleEvent = function() {
  3940. $.
  3941. default.DEBUG_LOG && console.log("Max scale event.");
  3942. for (var t = 0; t < this.models.length; t++) this.models[t].startRandomMotion($.
  3943. default.MOTION_GROUP_PINCH_IN, $.
  3944. default.PRIORITY_NORMAL)
  3945. }, o.prototype.minScaleEvent = function() {
  3946. $.
  3947. default.DEBUG_LOG && console.log("Min scale event.");
  3948. for (var t = 0; t < this.models.length; t++) this.models[t].startRandomMotion($.
  3949. default.MOTION_GROUP_PINCH_OUT, $.
  3950. default.PRIORITY_NORMAL)
  3951. }, o.prototype.tapEvent = function(t, i) {
  3952. $.
  3953. default.DEBUG_LOG && console.log("tapEvent view x:" + t + " y:" + i);
  3954. for (var e = 0; e < this.models.length; e++) this.models[e].hitTest($.
  3955. default.HIT_AREA_HEAD, t, i) ? ($.
  3956. default.DEBUG_LOG && console.log("Tap face."), this.models[e].setRandomExpression()):
  3957. this.models[e].hitTest($.
  3958. default.HIT_AREA_BODY, t, i) ? ($.
  3959. default.DEBUG_LOG && console.log("Tap body. models[" + e + "]"), this.models[e].startRandomMotion($.
  3960. default.MOTION_GROUP_TAP_BODY, $.
  3961. default.PRIORITY_NORMAL)) : this.models[e].hitTestCustom("head", t, i) ? ($.
  3962. default.DEBUG_LOG && console.log("Tap face."), this.models[e].startRandomMotion($.
  3963. default.MOTION_GROUP_FLICK_HEAD, $.
  3964. default.PRIORITY_NORMAL)) : this.models[e].hitTestCustom("body", t, i) && ($.
  3965. default.DEBUG_LOG && console.log("Tap body. models[" + e + "]"), this.models[e].startRandomMotion($.
  3966. default.MOTION_GROUP_TAP_BODY, $.
  3967. default.PRIORITY_NORMAL));
  3968. return !0
  3969. }
  3970. }, function(t, i, e) {
  3971. "use strict";
  3972. function r() {}
  3973. Object.defineProperty(i, "__esModule", {
  3974. value: !0
  3975. }), i.
  3976. default = r;
  3977. var o = e(2);
  3978. r.prototype.loadBytes = function(t, i) {
  3979. var e = new XMLHttpRequest;
  3980. e.open("GET", t, !0), e.responseType = "arraybuffer", e.onload = function() {
  3981. switch (e.status) {
  3982. case 200:
  3983. i(e.response);
  3984. break;
  3985. default:
  3986. console.error("Failed to load (" + e.status + ") : " + t)
  3987. }
  3988. }, e.send(null)
  3989. }, r.prototype.loadString = function(t) {
  3990. this.loadBytes(t, function(t) {
  3991. return t
  3992. })
  3993. }, r.prototype.loadLive2DModel = function(t, i) {
  3994. var e = null;
  3995. this.loadBytes(t, function(t) {
  3996. e = Live2DModelWebGL.loadModel(t), i(e)
  3997. })
  3998. }, r.prototype.loadTexture = function(t, i, e, r) {
  3999. var n = new Image;
  4000. n.crossOrigin = "Anonymous", n.src = e;
  4001. n.onload = function() {
  4002. var e = (0, o.getContext)(),
  4003. s = e.createTexture();
  4004. if (!s) return console.error("Failed to generate gl texture name."), -1;
  4005. 0 == t.isPremultipliedAlpha() && e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, 1), e.activeTexture(e.TEXTURE0), e.bindTexture(e.TEXTURE_2D, s), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, n), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR_MIPMAP_NEAREST), e.generateMipmap(e.TEXTURE_2D), t.setTexture(i, s), s = null, "function" == typeof r && r()
  4006. }, n.onerror = function() {
  4007. console.error("Failed to load image : " + e)
  4008. }
  4009. }, r.prototype.jsonParseFromBytes = function(t) {
  4010. var i, e = new Uint8Array(t, 0, 3);
  4011. return i = 239 == e[0] && 187 == e[1] && 191 == e[2] ? String.fromCharCode.apply(null, new Uint8Array(t, 3)) : String.fromCharCode.apply(null, new Uint8Array(t)), JSON.parse(i)
  4012. }, r.prototype.log = function(t) {}
  4013. }, function(t, i, e) {
  4014. "use strict";
  4015. function r(t) {
  4016. return t && t.__esModule ? t : {
  4017. default:
  4018. t
  4019. }
  4020. }
  4021. function o() {
  4022. n.L2DBaseModel.prototype.constructor.call(this), this.modelHomeDir = "", this.modelSetting = null, this.tmpMatrix = []
  4023. }
  4024. Object.defineProperty(i, "__esModule", {
  4025. value: !0
  4026. }), i.
  4027. default = o;
  4028. var n = e(0),
  4029. s = e(11),
  4030. _ = r(s),
  4031. a = e(1),
  4032. h = r(a),
  4033. l = e(3),
  4034. $ = r(l);
  4035. o.prototype = new n.L2DBaseModel, o.prototype.load = function(t, i, e) {
  4036. this.setUpdating(!0), this.setInitialized(!1), this.modelHomeDir = i.substring(0, i.lastIndexOf("/") + 1), this.modelSetting = new _.
  4037. default;
  4038. var r = this;
  4039. this.modelSetting.loadModelSetting(i, function() {
  4040. var t = r.modelHomeDir + r.modelSetting.getModelFile();
  4041. r.loadModelData(t, function(t) {
  4042. for (var i = 0; i < r.modelSetting.getTextureNum(); i++) {
  4043. if (/^https?:\/\/|^\/\//i.test(r.modelSetting.getTextureFile(i))) var o = r.modelSetting.getTextureFile(i);
  4044. else var o = r.modelHomeDir + r.modelSetting.getTextureFile(i);
  4045. r.loadTexture(i, o, function() {
  4046. if (r.isTexLoaded) {
  4047. if (r.modelSetting.getExpressionNum() > 0) {
  4048. r.expressions = {};
  4049. for (var t = 0; t < r.modelSetting.getExpressionNum(); t++) {
  4050. var i = r.modelSetting.getExpressionName(t),
  4051. o = r.modelHomeDir + r.modelSetting.getExpressionFile(t);
  4052. r.loadExpression(i, o)
  4053. }
  4054. } else r.expressionManager = null, r.expressions = {};
  4055. if (r.eyeBlink, null != r.modelSetting.getPhysicsFile() ? r.loadPhysics(r.modelHomeDir + r.modelSetting.getPhysicsFile()) : r.physics = null, null != r.modelSetting.getPoseFile() ? r.loadPose(r.modelHomeDir + r.modelSetting.getPoseFile(), function() {
  4056. r.pose.updateParam(r.live2DModel)
  4057. }) : r.pose = null, null != r.modelSetting.getLayout()) {
  4058. var n = r.modelSetting.getLayout();
  4059. null != n.width && r.modelMatrix.setWidth(n.width), null != n.height && r.modelMatrix.setHeight(n.height), null != n.x && r.modelMatrix.setX(n.x), null != n.y && r.modelMatrix.setY(n.y), null != n.center_x && r.modelMatrix.centerX(n.center_x), null != n.center_y && r.modelMatrix.centerY(n.center_y), null != n.top && r.modelMatrix.top(n.top), null != n.bottom && r.modelMatrix.bottom(n.bottom), null != n.left && r.modelMatrix.left(n.left), null != n.right && r.modelMatrix.right(n.right)
  4060. }
  4061. if (null != r.modelSetting.getHitAreasCustom()) {
  4062. var s = r.modelSetting.getHitAreasCustom();
  4063. null != s.head_x && (h.
  4064. default.hit_areas_custom_head_x = s.head_x), null != s.head_y && (h.
  4065. default.hit_areas_custom_head_y = s.head_y), null != s.body_x && (h.
  4066. default.hit_areas_custom_body_x = s.body_x), null != s.body_y && (h.
  4067. default.hit_areas_custom_body_y = s.body_y)
  4068. }
  4069. for (var t = 0; t < r.modelSetting.getInitParamNum(); t++) r.live2DModel.setParamFloat(r.modelSetting.getInitParamID(t), r.modelSetting.getInitParamValue(t));
  4070. for (var t = 0; t < r.modelSetting.getInitPartsVisibleNum(); t++) r.live2DModel.setPartsOpacity(r.modelSetting.getInitPartsVisibleID(t), r.modelSetting.getInitPartsVisibleValue(t));
  4071. r.live2DModel.saveParam(), r.preloadMotionGroup(h.
  4072. default.MOTION_GROUP_IDLE), r.preloadMotionGroup(h.
  4073. default.MOTION_GROUP_SLEEPY), r.mainMotionManager.stopAllMotions(), r.setUpdating(!1), r.setInitialized(!0), "function" == typeof e && e()
  4074. }
  4075. })
  4076. }
  4077. })
  4078. })
  4079. }, o.prototype.release = function(t) {
  4080. var i = n.Live2DFramework.getPlatformManager();
  4081. t.deleteTexture(i.texture)
  4082. }, o.prototype.preloadMotionGroup = function(t) {
  4083. for (var i = this, e = 0; e < this.modelSetting.getMotionNum(t); e++) {
  4084. var r = this.modelSetting.getMotionFile(t, e);
  4085. this.loadMotion(r, this.modelHomeDir + r, function(r) {
  4086. r.setFadeIn(i.modelSetting.getMotionFadeIn(t, e)), r.setFadeOut(i.modelSetting.getMotionFadeOut(t, e))
  4087. })
  4088. }
  4089. }, o.prototype.update = function() {
  4090. if (null == this.live2DModel) return void(h.
  4091. default.DEBUG_LOG && console.error("Failed to update."));
  4092. var t = UtSystem.getUserTimeMSec() - this.startTimeMSec,
  4093. i = t / 1e3,
  4094. e = 2 * i * Math.PI;
  4095. if (this.mainMotionManager.isFinished()) {
  4096. "1" === sessionStorage.getItem("Sleepy") ? this.startRandomMotion(h.
  4097. default.MOTION_GROUP_SLEEPY, h.
  4098. default.PRIORITY_SLEEPY) : this.startRandomMotion(h.
  4099. default.MOTION_GROUP_IDLE, h.
  4100. default.PRIORITY_IDLE)
  4101. }
  4102. this.live2DModel.loadParam(), this.mainMotionManager.updateParam(this.live2DModel) || null != this.eyeBlink && this.eyeBlink.updateParam(this.live2DModel), this.live2DModel.saveParam(), null == this.expressionManager || null == this.expressions || this.expressionManager.isFinished() || this.expressionManager.updateParam(this.live2DModel), this.live2DModel.addToParamFloat("PARAM_ANGLE_X", 30 * this.dragX, 1), this.live2DModel.addToParamFloat("PARAM_ANGLE_Y", 30 * this.dragY, 1), this.live2DModel.addToParamFloat("PARAM_ANGLE_Z", this.dragX * this.dragY * -30, 1), this.live2DModel.addToParamFloat("PARAM_BODY_ANGLE_X", 10 * this.dragX, 1), this.live2DModel.addToParamFloat("PARAM_EYE_BALL_X", this.dragX, 1), this.live2DModel.addToParamFloat("PARAM_EYE_BALL_Y", this.dragY, 1), this.live2DModel.addToParamFloat("PARAM_ANGLE_X", Number(15 * Math.sin(e / 6.5345)), .5), this.live2DModel.addToParamFloat("PARAM_ANGLE_Y", Number(8 * Math.sin(e / 3.5345)), .5), this.live2DModel.addToParamFloat("PARAM_ANGLE_Z", Number(10 * Math.sin(e / 5.5345)), .5), this.live2DModel.addToParamFloat("PARAM_BODY_ANGLE_X", Number(4 * Math.sin(e / 15.5345)), .5), this.live2DModel.setParamFloat("PARAM_BREATH", Number(.5 + .5 * Math.sin(e / 3.2345)), 1), null != this.physics && this.physics.updateParam(this.live2DModel), null == this.lipSync && this.live2DModel.setParamFloat("PARAM_MOUTH_OPEN_Y", this.lipSyncValue), null != this.pose && this.pose.updateParam(this.live2DModel), this.live2DModel.update()
  4103. }, o.prototype.setRandomExpression = function() {
  4104. var t = [];
  4105. for (var i in this.expressions) t.push(i);
  4106. var e = parseInt(Math.random() * t.length);
  4107. this.setExpression(t[e])
  4108. }, o.prototype.startRandomMotion = function(t, i) {
  4109. var e = this.modelSetting.getMotionNum(t),
  4110. r = parseInt(Math.random() * e);
  4111. this.startMotion(t, r, i)
  4112. }, o.prototype.startMotion = function(t, i, e) {
  4113. var r = this.modelSetting.getMotionFile(t, i);
  4114. if (null == r || "" == r) return void(h.
  4115. default.DEBUG_LOG && console.error("Failed to motion."));
  4116. if (e == h.
  4117. default.PRIORITY_FORCE) this.mainMotionManager.setReservePriority(e);
  4118. else if (!this.mainMotionManager.reserveMotion(e)) return void(h.
  4119. default.DEBUG_LOG && console.log("Motion is running."));
  4120. var o, n = this;
  4121. null == this.motions[t] ? this.loadMotion(null, this.modelHomeDir + r, function(r) {
  4122. o = r, n.setFadeInFadeOut(t, i, e, o)
  4123. }) : (o = this.motions[t], n.setFadeInFadeOut(t, i, e, o))
  4124. }, o.prototype.setFadeInFadeOut = function(t, i, e, r) {
  4125. var o = this.modelSetting.getMotionFile(t, i);
  4126. if (r.setFadeIn(this.modelSetting.getMotionFadeIn(t, i)), r.setFadeOut(this.modelSetting.getMotionFadeOut(t, i)), h.
  4127. default.DEBUG_LOG && console.log("Start motion : " + o), null == this.modelSetting.getMotionSound(t, i)) this.mainMotionManager.startMotionPrio(r, e);
  4128. else {
  4129. var n = this.modelSetting.getMotionSound(t, i),
  4130. s = document.createElement("audio");
  4131. s.src = this.modelHomeDir + n, h.
  4132. default.DEBUG_LOG && console.log("Start sound : " + n), s.play(), this.mainMotionManager.startMotionPrio(r, e)
  4133. }
  4134. }, o.prototype.setExpression = function(t) {
  4135. var i = this.expressions[t];
  4136. h.
  4137. default.DEBUG_LOG && console.log("Expression : " + t), this.expressionManager.startMotion(i, !1)
  4138. }, o.prototype.draw = function(t) {
  4139. $.
  4140. default.push(), $.
  4141. default.multMatrix(this.modelMatrix.getArray()), this.tmpMatrix = $.
  4142. default.getMatrix(), this.live2DModel.setMatrix(this.tmpMatrix), this.live2DModel.draw(), $.
  4143. default.pop()
  4144. }, o.prototype.hitTest = function(t, i, e) {
  4145. for (var r = this.modelSetting.getHitAreaNum(), o = 0; o < r; o++) if (t == this.modelSetting.getHitAreaName(o)) {
  4146. var n = this.modelSetting.getHitAreaID(o);
  4147. return this.hitTestSimple(n, i, e)
  4148. }
  4149. return !1
  4150. }, o.prototype.hitTestCustom = function(t, i, e) {
  4151. return "head" == t ? this.hitTestSimpleCustom(h.
  4152. default.hit_areas_custom_head_x, h.
  4153. default.hit_areas_custom_head_y, i, e) : "body" == t && this.hitTestSimpleCustom(h.
  4154. default.hit_areas_custom_body_x, h.
  4155. default.hit_areas_custom_body_y, i, e)
  4156. }
  4157. }, function(t, i, e) {
  4158. "use strict";
  4159. function r() {
  4160. this.NAME = "name", this.ID = "id", this.MODEL = "model", this.TEXTURES = "textures", this.HIT_AREAS = "hit_areas", this.PHYSICS = "physics", this.POSE = "pose", this.EXPRESSIONS = "expressions", this.MOTION_GROUPS = "motions", this.SOUND = "sound", this.FADE_IN = "fade_in", this.FADE_OUT = "fade_out", this.LAYOUT = "layout", this.HIT_AREAS_CUSTOM = "hit_areas_custom", this.INIT_PARAM = "init_param", this.INIT_PARTS_VISIBLE = "init_parts_visible", this.VALUE = "val", this.FILE = "file", this.json = {}
  4161. }
  4162. Object.defineProperty(i, "__esModule", {
  4163. value: !0
  4164. }), i.
  4165. default = r;
  4166. var o = e(0);
  4167. r.prototype.loadModelSetting = function(t, i) {
  4168. var e = this;
  4169. o.Live2DFramework.getPlatformManager().loadBytes(t, function(t) {
  4170. var r = String.fromCharCode.apply(null, new Uint8Array(t));
  4171. e.json = JSON.parse(r), i()
  4172. })
  4173. }, r.prototype.getTextureFile = function(t) {
  4174. return null == this.json[this.TEXTURES] || null == this.json[this.TEXTURES][t] ? null : this.json[this.TEXTURES][t]
  4175. }, r.prototype.getModelFile = function() {
  4176. return this.json[this.MODEL]
  4177. }, r.prototype.getTextureNum = function() {
  4178. return null == this.json[this.TEXTURES] ? 0 : this.json[this.TEXTURES].length
  4179. }, r.prototype.getHitAreaNum = function() {
  4180. return null == this.json[this.HIT_AREAS] ? 0 : this.json[this.HIT_AREAS].length
  4181. }, r.prototype.getHitAreaID = function(t) {
  4182. return null == this.json[this.HIT_AREAS] || null == this.json[this.HIT_AREAS][t] ? null : this.json[this.HIT_AREAS][t][this.ID]
  4183. }, r.prototype.getHitAreaName = function(t) {
  4184. return null == this.json[this.HIT_AREAS] || null == this.json[this.HIT_AREAS][t] ? null : this.json[this.HIT_AREAS][t][this.NAME]
  4185. }, r.prototype.getPhysicsFile = function() {
  4186. return this.json[this.PHYSICS]
  4187. }, r.prototype.getPoseFile = function() {
  4188. return this.json[this.POSE]
  4189. }, r.prototype.getExpressionNum = function() {
  4190. return null == this.json[this.EXPRESSIONS] ? 0 : this.json[this.EXPRESSIONS].length
  4191. }, r.prototype.getExpressionFile = function(t) {
  4192. return null == this.json[this.EXPRESSIONS] ? null : this.json[this.EXPRESSIONS][t][this.FILE]
  4193. }, r.prototype.getExpressionName = function(t) {
  4194. return null == this.json[this.EXPRESSIONS] ? null : this.json[this.EXPRESSIONS][t][this.NAME]
  4195. }, r.prototype.getLayout = function() {
  4196. return this.json[this.LAYOUT]
  4197. }, r.prototype.getHitAreasCustom = function() {
  4198. return this.json[this.HIT_AREAS_CUSTOM]
  4199. }, r.prototype.getInitParamNum = function() {
  4200. return null == this.json[this.INIT_PARAM] ? 0 : this.json[this.INIT_PARAM].length
  4201. }, r.prototype.getMotionNum = function(t) {
  4202. return null == this.json[this.MOTION_GROUPS] || null == this.json[this.MOTION_GROUPS][t] ? 0 : this.json[this.MOTION_GROUPS][t].length
  4203. }, r.prototype.getMotionFile = function(t, i) {
  4204. return null == this.json[this.MOTION_GROUPS] || null == this.json[this.MOTION_GROUPS][t] || null == this.json[this.MOTION_GROUPS][t][i] ? null : this.json[this.MOTION_GROUPS][t][i][this.FILE]
  4205. }, r.prototype.getMotionSound = function(t, i) {
  4206. return null == this.json[this.MOTION_GROUPS] || null == this.json[this.MOTION_GROUPS][t] || null == this.json[this.MOTION_GROUPS][t][i] || null == this.json[this.MOTION_GROUPS][t][i][this.SOUND] ? null : this.json[this.MOTION_GROUPS][t][i][this.SOUND]
  4207. }, r.prototype.getMotionFadeIn = function(t, i) {
  4208. return null == this.json[this.MOTION_GROUPS] || null == this.json[this.MOTION_GROUPS][t] || null == this.json[this.MOTION_GROUPS][t][i] || null == this.json[this.MOTION_GROUPS][t][i][this.FADE_IN] ? 1e3 : this.json[this.MOTION_GROUPS][t][i][this.FADE_IN]
  4209. }, r.prototype.getMotionFadeOut = function(t, i) {
  4210. return null == this.json[this.MOTION_GROUPS] || null == this.json[this.MOTION_GROUPS][t] || null == this.json[this.MOTION_GROUPS][t][i] || null == this.json[this.MOTION_GROUPS][t][i][this.FADE_OUT] ? 1e3 : this.json[this.MOTION_GROUPS][t][i][this.FADE_OUT]
  4211. }, r.prototype.getInitParamID = function(t) {
  4212. return null == this.json[this.INIT_PARAM] || null == this.json[this.INIT_PARAM][t] ? null : this.json[this.INIT_PARAM][t][this.ID]
  4213. }, r.prototype.getInitParamValue = function(t) {
  4214. return null == this.json[this.INIT_PARAM] || null == this.json[this.INIT_PARAM][t] ? NaN : this.json[this.INIT_PARAM][t][this.VALUE]
  4215. }, r.prototype.getInitPartsVisibleNum = function() {
  4216. return null == this.json[this.INIT_PARTS_VISIBLE] ? 0 : this.json[this.INIT_PARTS_VISIBLE].length
  4217. }, r.prototype.getInitPartsVisibleID = function(t) {
  4218. return null == this.json[this.INIT_PARTS_VISIBLE] || null == this.json[this.INIT_PARTS_VISIBLE][t] ? null : this.json[this.INIT_PARTS_VISIBLE][t][this.ID]
  4219. }, r.prototype.getInitPartsVisibleValue = function(t) {
  4220. return null == this.json[this.INIT_PARTS_VISIBLE] || null == this.json[this.INIT_PARTS_VISIBLE][t] ? NaN : this.json[this.INIT_PARTS_VISIBLE][t][this.VALUE]
  4221. }
  4222. }]);
  4223. //# sourceMappingURL=live2d.js.map