forked from lalafellsleep/Samhain.FFXIV-CleaveORE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCleave-ore.min.js
1 lines (1 loc) · 24.7 KB
/
Cleave-ore.min.js
1
function getLog(t){for(var e in CombatLog)if(CombatLog[e].combatKey==t&&"Encounter"!=lastCombat.encounter.title)return lastCombat=CombatLog[e],document.dispatchEvent(new CustomEvent("onSuccessGetLog",{detail:{combatant:CombatLog[e]}})),!1;return!0}function safeAdd(t,e){var i=(65535&t)+(65535&e),s=(t>>16)+(e>>16)+(i>>16);return s<<16|65535&i}function hexColor(t){var t=t.replace("#","");return 6==t.length||3==t.length?6==t.length?[parseInt(t.substr(0,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(4,2),16)]:[parseInt(t.substr(0,1),16),parseInt(t.substr(1,1),16),parseInt(t.substr(2,1),16)]:[0,0,0]}function oHexColor(t){var e=hexColor(t);return{r:e[0],g:e[1],b:e[2]}}function oHexArgb(t){if(t.length<8)return{a:0,r:0,g:0,b:0};var e=oHexColor(t.replace("#","").substr(2,6)),i=t.replace("#","");return{a:parseFloat((parseInt(i.substr(0,2),16)/255).toFixed(2)),r:e.r,g:e.g,b:e.b}}function saveLog(t){var e=!0;for(var i in CombatLog)CombatLog[i].combatKey==t.combatKey&&(e=!1);e||(CombatLog.push(t),document.dispatchEvent(new CustomEvent("onSuccessSaveLog",{detail:{combatant:t}})))}function pFloat(t){return parseFloat(t.nanFix().toFixed(underDot))}function loadSetting(t){var e="";try{e=localStorage.getItem(t),e=JSON.parse(e)}catch(i){return e}return e}function saveSetting(t,e){localStorage.setItem(t,JSON.stringify(e))}function Capture(){onACTWebSocket&&webs.overlayAPI("Capture")}function EndEncounter(){onACTWebSocket?webs.overlayAPI("RequestEnd"):window.OverlayPluginApi.endEncounter&&window.OverlayPluginApi.endEncounter()}function dbg(t){this.debug=t,this.log=function(t){this.debug&&console.log(t)}}function domReady(){try{webs=new ActWebsocketInterface(wsUri),webs.connect()}catch(t){}try{document.addEventListener("beforeLogLineRead",beforeLogLineRead)}catch(t){}try{document.addEventListener("onLogLineRead",onLogLineRead)}catch(t){}try{document.addEventListener("onOverlayDataUpdate",onOverlayDataUpdate)}catch(t){console.log("Core Error : onOverlayUpdate is not defined.")}try{document.addEventListener("onOverlayStateUpdate",onOverlayStateUpdate)}catch(t){}try{onDocumentLoad()}catch(t){}}function onRecvMessage(t){"Chat"==t.detail.msgtype?document.dispatchEvent(new CustomEvent("onChatting",{detail:t.detail.msg})):console.log(t.detail.msgtype+":"+t.detail.msg)}function onBroadcastMessage(t){if("CombatData"==t.detail.msgtype)lastCombatRaw=t.detail.msg,lastCombat=new Combatant({detail:lastCombatRaw},sortKey),null!=lastCombat&&""!=myName&&void 0!=myName&&null!=myName&&(lastCombat.Combatant.YOU.displayName=myName),document.dispatchEvent(new CustomEvent("onOverlayDataUpdate",{detail:lastCombatRaw}));else switch(t.detail.msgtype){case"SendCharName":document.dispatchEvent(new CustomEvent("onCharacterNameRecive",{detail:t.detail.msg})),myName=t.detail.msg.charName;break;case"Chat":document.dispatchEvent(new CustomEvent("onChatting",{detail:t.detail.msg}));break;case"ChangeZone":curzone=t.detail.msg.zoneID;break;default:try{document.dispatchEvent(new CustomEvent("onMessage"),t)}catch(e){}}}function getsortKey(t){return void 0!=managedKeys[activeSort(t)]?managedKeys[activeSort(t)]:activeSort(t)}function activeSort(t,e){return t.indexOf("merged")>-1&&(t.indexOf("Last")>-1?t=t.replace(/merged/gi,""):(t=t.replace(/merged/gi,""),t=t.substr(0,1).toLowerCase()+t.substr(1))),"dmgPct"==t&&(t="damage%"),t.indexOf("Pct")>-1&&-1==t.indexOf("overHealPct")&&(t=t.replace(/Pct/gi,"%")),("encdps"==t||"dps"==t)&&(t="damage"),("enchps"==t||"hps"==t)&&(t="healed"),"maxhit"==t&&(t="maxhitval"),"maxheal"==t&&(t="maxhealval"),t}String.prototype.format=function(t){var e=/(\{([^}]+)\})/im,i=(this.match(e),this);for(var s in t)i=i.replace("{"+s+"}",t[s]);return i},String.prototype.contains=function(t){return this.indexOf(t)>-1?!0:!1},String.prototype.replaceArray=function(t){var e=this;for(var i in t)for(;e.contains(t[i].target);)e=e.replace(t[i].target,t[i].replacement);return e},Number.prototype.nanFix=function(){return parseFloat(isNaN(this)?0:this)},Number.prototype.numFormat=new function(){var t=0;try{if(t!=1/0&&0!=t&&NaN!=t){for(var e=/(^[+-]?\d+)(\d{3})/,i=this+"";e.test(i);)i=i.replace(e,"$1,$2");return i}return"0"}catch(s){return"0"}};var Lib=new function(){this.getJobUrl=function(t,e){return void 0==e&&(e="Glow"),void 0==t&&(e="PLD"),"https://github.com/laiglinne-ff/FFXIV_Chamsucript/blob/master/images/job/"+e+"/"+t+".png?raw=true"},this.jobs={ADV:{code:0},GLA:{code:1},GLD:{code:1},PGL:{code:2},MRD:{code:3},LNC:{code:4},ARC:{code:5},CNJ:{code:6},THM:{code:7},CRP:{code:8},BSM:{code:9},ARM:{code:10},GSM:{code:11},LTW:{code:12},WVR:{code:13},ALC:{code:14},CUL:{code:15},MIN:{code:16},BTN:{code:17},FSH:{code:18},PLD:{code:19},MNK:{code:20},WAR:{code:21},DRG:{code:22},BRD:{code:23},WHM:{code:24},BLM:{code:25},ACN:{code:26},SMN:{code:27},PLD:{code:28},ROG:{code:29},NIN:{code:30},MCH:{code:31},DRK:{code:32},AST:{code:33},SAM:{code:34},RDM:{code:35}}},QueryString=function(){for(var t={},e=window.location.search.substring(1),i=e.split("&"),s=0;s<i.length;s++){var a=i[s].split("=");if("undefined"==typeof t[a[0]])t[a[0]]=decodeURIComponent(a[1]);else if("string"==typeof t[a[0]]){var o=[t[a[0]],decodeURIComponent(a[1])];t[a[0]]=o}else t[a[0]].push(decodeURIComponent(a[1]))}return t}(),Language=function(t){this.get=function(t){var e=this.getPriv(t);return void 0!=e?e:t},this.getPriv=function(t){this.userdic=JSON.parse(localStorage.getItem("claveore-dic"));try{if(void 0!=this.dictionary.dots[t]&&"ko"==this.lang)return this.dictionary.dots[t];if(null!=this.userdic){if(void 0!=this.userdic.skills[t]&&shorter)return this.userdic.skills[t]}else{if(void 0!=this.dictionary.skills[t]&&shorter)return this.dictionary.skills[t];if(void 0==this.dictionary.display[t])return t;if(void 0!=this.dictionary.display[t][this.lang])return this.dictionary.display[t][this.lang]}}catch(e){return console.log(e),t}},this.setLangDefine=function(t){void 0!=t&&(this.languageDefine=!0,this.lang=b)},this.getUserDic=function(){try{this.userdic=JSON.parse(localStorage.getItem("claveore-dic")),(null==this.userdic||void 0==this.userdic)&&(this.userdic=this.dictionary,this.setUserDic())}catch(t){}},this.setUserDic=function(){localStorage.setItem("claveore-dic",JSON.stringify(this.userdic))},this.deleteUserSkillItem=function(t){void 0!=this.userdic.skills[t]&&delete this.userdic.skills[t]},this.setUserSkillItem=function(t,e){this.userdic.skills[t]=e},this.languageDefine=!1,this.lang=void 0==t?"ko":t,this.userdic=null,this.dictionary={display:{PLD:{ko:"나",jp:"ナイト"},GLD:{ko:"검술사",jp:"剣術士"},WAR:{ko:"전",jp:"戦"},MRD:{ko:"도끼술사",jp:"斧術士"},DRK:{ko:"암",jp:"暗"},MNK:{ko:"몽",jp:"モンク"},PGL:{ko:"격투사",jp:"格闘士"},DRG:{ko:"용",jp:"竜"},LNC:{ko:"창술사",jp:"槍術士"},NIN:{ko:"닌",jp:"忍"},ROG:{ko:"쌍검사",jp:"双剣士"},BRD:{ko:"음",jp:"吟"},ARC:{ko:"궁술사",jp:"弓術士"},MCH:{ko:"기",jp:"機"},SMN:{ko:"솬",jp:"召"},BLM:{ko:"흑",jp:"黒"},THM:{ko:"주술사",jp:"呪術士"},WHM:{ko:"백",jp:"白"},CNJ:{ko:"환술사",jp:"幻術士"},SCH:{ko:"학",jp:"学"},ACN:{ko:"비술사",jp:"巴術士"},AST:{ko:"점",jp:"占"},LMB:{ko:"리밋",jp:"リミット"},FAIRY:{ko:"요정",jp:"FAIRY"},AUTOTURRET:{ko:"포탑",jp:"オートタレット"},EGI:{ko:"에기",jp:"エギ"},CARBUNCLE:{ko:"카벙클",jp:"カーバンクル"},CHOCOBO:{ko:"초코보",jp:"チョコ"}},skills:{"재빠른 검격":"재빠른","야성의 검격":"야성","방패 던지기":"방던","폭도의 검격":"폭도","방패 후려치기":"방.후","할로네의 분노":"할로네","내면의 기개":"내면","꿰뚫는 검격":"꿰뚫","제왕의 권위":"제왕","육중한 일격":"육중","두개골 절단":"절단","잔혹한 일격":"잔혹","도끼 던지기":"도.던","최후의 일격":"최후","휘도는 도끼":"휘도","강철 회오리":"강철","강렬한 참격":"강렬","비열한 기습":"비열","흡수의 일격":"흡수","심연의 갈증":"심.갈","어둠의 여행자":"여행자","정권 지르기":"정권","혈도 찌르기":"혈도","직선 찌르기":"직선","눈속임 공격":"눈속임","사선 찌르기":"사선","다리 쳐내기":"다리","꿰뚫는 발톱":"창던지기","올려 찌르기":"올.찌","이단 찌르기":"이단","몸통 가르기":"몸.가","악몽의 쇄기":"악몽","가시 소용돌이":"소용돌이","게이르스코굴":"코굴","쌍검 회전베기":"회전","마무리 일격":"마.격","춤추는 칼날":"춤.칼","풍마의 수리검":"풍마","그림자 송곳니":"그.송","육중한 사격":"육중","재빠른 활시위":"재빠른","침묵의 화살":"침묵","죽음의 화살비":"죽.비","천상의 화살":"천상","강렬한 사격":"강렬","생명력 흡수":"생.흡","미아즈마 버스트":"버스트"},dots:{"Goring Blade (*)":"*꿰뚫","Circle of Scorn (*)":"*파멸의 진","Fracture (*)":"*골절","Scourge (*)":"*재앙","Aero (*)":"*에어로","Aero II (*)":"*에어로라","Aero Iii (*)":"*에어로가","Medica II (*)":"*메디카라","Regen (*)":"*리제네","Combust (*)":"*컴버스","Combust II (*)":"*컴버라","Touch Of Death (*)":"*혈도","Phlebotomize (*)":"*이단","Chaos Thrust (*)":"*꽃잎","Shadow Fang (*)":"*그.송","Mutilation (*)":"*무쌍","Venomous Bite (*)":"*독화살","Windbite (*)":"*바람","Lead Shot (*)":"*산탄","Bio (*)":"*바이오","Bio II (*)":"*바이오라","Miasma (*)":"*미아즈마","Miasma II (*)":"*미아즈라","Thunder (*)":"*선더"}},this.getUserDic()},Person=function(t,e){if(this.recalculate=function(){var t=this.DURATION;0==t&&(t=1),this.dps=pFloat(this.mergedDamage/t),this.encdps=pFloat(this.mergedDamage/this.parent.DURATION),this.hps=pFloat(this.mergedHealed/t),this.enchps=pFloat(this.mergedHealed/this.parent.DURATION),this["DAMAGE-k"]=Math.floor(this.mergedDamage/1e3),this["DAMAGE-m"]=Math.floor(this.mergedDamage/1e6),this.DPS=Math.floor(this.dps),this["DPS-k"]=Math.floor(this.dps/1e3),this.ENCDPS=Math.floor(this.encdps),this.ENCHPS=Math.floor(this.enchps),this["ENCDPS-k"]=Math.floor(this.encdps/1e3),this["ENCHPS-k"]=Math.floor(this.enchps/1e3),this["damage%"]=pFloat(this.mergedDamage/this.parent.Encounter.damage*100),this["healed%"]=pFloat(this.mergedHealed/this.parent.Encounter.healed*100),this["crithit%"]=pFloat(this.mergedCrithits/this.mergedHits*100),this["critheal%"]=pFloat(this.mergedCritheals/this.mergedHeals*100),this["DirectHit%"]=pFloat(this.mergedDirectHitCount/this.mergedHits*100),this["CritDirectHit%"]=pFloat(this.mergedCritDirectHitCount/this.mergedHeals*100),this.tohit=pFloat(this.mergedHits/this.mergedSwings*100),this.effectiveHeal=pFloat(this.mergedHealed-this.mergedOverHeal),this["overHeal%"]=pFloat(this.mergedOverHeal/this.mergedHealed*100)},this.returnOrigin=function(){for(var t in this.original)t.indexOf("Last")>-1?this["merged"+t]=this[t]:"CritDirectHitCount"==t||"DirectHitCount"==t?this["merged"+t]=this[t]:this["merged"+t]=this[t.substr(0,1).toLowerCase()+t.substr(1)]},this.merge=function(t){if(this.returnOrigin(),"Chocobo_Persons"!=t.petType){this.pets[t.name]=t;for(var e in this.pets)for(var i in this.original)i.indexOf("Last")>-1?this["merged"+i]+=this.pets[e].original[i]:this["merged"+i]+=this.pets[e].original[i]}this.recalculate()},this.recalc=function(){this.recalculate()},this.get=function(t){return this.parent.summonerMerge&&void 0!=managedKeys[t]?this[managedKeys[t]]:this[t]},void 0!=t){for(var i in t)if(!(i.indexOf("NAME")>-1)&&"t"!=i&&"n"!=i){var s=t[i].replace(/[0-9.,%]+/gi,"");if(""!=s)"---"==s||"--"==s?this[i]=0:this[i]=t[i];else{var a=parseFloat(t[i].replace(/[,%]+/gi,"")).nanFix().toFixed(underDot);t[i].indexOf("%")>0?this[i]=parseFloat(a):Math.floor(a)!=a||t[i].indexOf(".")>0?this[i]=parseFloat(a):this[i]=parseInt(a).nanFix()}}this.pets={},this.parent=e,this.Class="Unknown",this.PetType="Unknown",this.role="DPS",this.isPet=!1,this.isLower=!1,this.visible=!0,this.rank=0,this.maxdamage=0,this.displayName=this.name,this.displayNameWithInitial={original:this.name,firstinit:this.name,lastinit:this.name,fullinit:this.name},this.effectiveHeal=this.healed-this.overHeal,this["overHeal%"]=Math.floor(this.overHeal/this.healed*1e4)/100,this.original={Damage:this.damage,Hits:this.hits,Misses:this.misses,Swings:this.swings,Crithits:this.crithits,DirectHitCount:this.DirectHitCount,CritDirectHitCount:this.CritDirectHitCount,Damagetaken:this.damagetaken,Heals:this.heals,Healed:this.healed,Critheals:this.critheals,Healstaken:this.healstaken,DamageShield:this.damageShield,OverHeal:this.overHeal,AbsorbHeal:this.absorbHeal,Last10DPS:this.Last10DPS,Last30DPS:this.Last30DPS,Last60DPS:this.Last60DPS,Last180DPS:this.Last180DPS,effectiveheal:this.effectiveHeal},this.maxhitstr="",this.maxhitval=0,this.maxhealstr="",this.maxhealval=0;try{this.maxhitstr=parent.langpack.get(this.maxhit.substring(0,this.maxhit.indexOf("-"))),this.maxhitval=parseInt(this.maxhit.substring(this.maxhit.indexOf("-")+1).replace(/[,.]/,"")).nanFix()}catch(o){this.maxhit="?-0"}try{this.maxhealstr=parent.langpack.get(this.maxheal.substring(0,this.maxheal.indexOf("-"))),this.maxhealval=parseInt(this.maxheal.substring(this.maxheal.indexOf("-")+1).replace(/[,.]/,"")).nanFix()}catch(o){this.maxheal="?-0"}if(this.name.indexOf(" ")>-1)try{var n=this.name.split(" ");this.displayNameWithInitial.firstinit=n[0].substring(0,1)+". "+n[1],this.displayNameWithInitial.lastinit=n[0]+" "+n[1].substring(0,1)+".",this.displayNameWithInitial.fullinit=n[0].substring(0,1)+". "+n[1].substring(0,1)+"."}catch(o){}if(this.DURATION<=0){this.dps=parseFloat((this.damage/this.parent.DURATION).nanFix().toFixed(underDot)),this.hps=parseFloat((this.healed/this.parent.DURATION).nanFix().toFixed(underDot)),this.DPS=Math.floor(this.dps),this.HPS=Math.floor(this.hps),this["DPS-k"]=Math.floor(this.dps/1e3),this["HPS-k"]=Math.floor(this.hps/1e3);for(var i in this)("∞"==this[i]||"infinity"==this[i])&&(this[i]=0)}if(""!=this.Job&&null!=this.Job&&void 0!=this.Job&&(this.Class=this.Job.toUpperCase(),advclass.indexOf(this.Class)>-1&&(this.Class=advjob[advclass.indexOf(this.Class)],this.isLower=!0),tanker.indexOf(this.Class)>-1?this.role="Tanker":healer.indexOf(this.Class)>-1&&(this.role="Healer")),""==this.Job)for(var i in specialist)for(var r in specialist[i])this.name.toUpperCase().indexOf(specialist[i][r])>-1&&(this.Class=i,"SMN"==i?this.petType="Egi":"SCH"==i?this.petType="Fairy":"MCH"==i&&(this.petType="AutoTurret"),"LMB"!=i?(this.isPet=!0,this.Job="AVA"):this.Job=i);if(""!=this.petOwner&&""==this.Class&&(this.isPet=!1,this.Job="CBO",this.Class="CBO",this.petType="Chocobo_Persons"),(chocoboskill.indexOf(this.maxhitstr)>-1||chocoboskill.indexOf(this.maxhealstr)>-1)&&(this.isPet=!1,this.petType="Chocobo_Persons",this.Class="CBO",this.Job="CBO"),this.isPet){var h=/(?:.*?)\((.*?)\)/im,c=this.name.match(h);h.test(this.name)&&(this.petOwner=c[1])}this.isPet&&""!=this.Class&&void 0==this.parent.users[this.petOwner]&&(this.petOwner="YOU");for(var i in this.original)i.indexOf("Last")>-1?this["merged"+i]=this[i]:"CritDirectHitCount"==i||"DirectHitCount"==i?this["merged"+i]=this[i]:this["merged"+i]=this[i.substr(0,1).toLowerCase()+i.substr(1)]}},Combatant=function(t,e,i){if(this.indexOf=function(t){var e=-1;for(var i in this.Combatant)if(e++,i==t)return e;return e},this.sort=function(t){void 0!=t&&(this.sortvector=t),this.summonerMerge&&void 0!=managedKeys[this.sortkey]&&(this.sortkey=managedKeys[this.sortkey]);for(var e in this.Combatant)this.Combatant[e].isPet&&this.summonerMerge?(this.Combatant[this.Combatant[e].petOwner].pets[e]=this.Combatant[e],this.Combatant[this.Combatant[e].petOwner].merge(this.Combatant[e]),this.Combatant[e].visible=!1):this.Combatant[e].visible=!0;var i=new Array,s=0;for(var e in this.Combatant)i.push({key:this.Combatant[e][this.sortkey],val:this.Combatant[e]});this.Combatant={},this.sortvector?i.sort(function(t,e){return e.key-t.key}):i.sort(function(t,e){return t.key-e.key}),this.maxValue=i[0].key,this.maxdamage=i[0].key;for(var e in i)this.Combatant[i[e].val.name]=i[e].val;for(var e in this.Combatant)this.Combatant[e].visible&&(this.Combatant[e].rank=s++,this.Combatant[e].maxdamage=this.maxdamage);this.persons=this.Combatant},this.rerank=function(t){this.sort(t)},this.AttachPets=function(){this.summonerMerge=!0;for(var t in this.Combatant)this.Combatant[t].returnOrigin(),this.Combatant[t].recalculate(),this.Combatant[t].parent=this;this.rerank()},this.DetachPets=function(){this.summonerMerge=!1;for(var t in this.Combatant)this.Combatant[t].returnOrigin(),this.Combatant[t].recalculate(),this.Combatant[t].parent=this;this.rerank()},this.resort=function(t,e){void 0==t?this.sortkey=activeSort(this.sortkey):this.sortkey=activeSort(t),void 0==e&&(e=this.sortvector),this.sort(e)},this.sortkeyChange=function(t){this.resort(t,!0)},this.sortkeyChangeDesc=function(t){this.resort(t,!1)},void 0==e)var e="encdps";if(void 0!=t){if(!langpack.languageDefine)if(void 0==i){var i="ko";langpack=new Language(i)}else langpack=new Language(i),langpack.setLangDefine(i);this.Encounter={},this.Combatant={},this.users={},this.raw={detail:t.detail};for(var s in t.detail.Combatant)this.users[s]=!0;for(var s in t.detail.Encounter)if("t"!=s&&"n"!=s){var a=t.detail.Encounter[s].replace(/[0-9.,%]+/gi,"");if(""!=a)"---"==a||"--"==a?this.Encounter[s]=0:this.Encounter[s]=t.detail.Encounter[s];else{var o=parseFloat(t.detail.Encounter[s].replace(/[,%]+/gi,"")).nanFix().toFixed(underDot);t.detail.Encounter[s].indexOf("%")>0?this.Encounter[s]=parseFloat(o):Math.floor(o)!=o||t.detail.Encounter[s].indexOf(".")>0?this.Encounter[s]=parseFloat(o):this.Encounter[s]=parseInt(o).nanFix()}}for(var s in t.detail.Combatant)this.Combatant[s]=new Person(t.detail.Combatant[s],this);for(var s in t.detail.Combatant)this.Combatant[s].parent=this;var o={};for(var s in this.Combatant)""!=this.Combatant[s].Class&&(o[s]=this.Combatant[s]);this.Combatant=o,this.maxdamage=0,this.maxValue=0,this.zone=this.Encounter.CurrentZoneName,this.title=this.Encounter.title,this.sortvector=!0,this.duration=this.Encounter.duration,this.DURATION=this.Encounter.DURATION,this.summonerMerge=!0,this.sortkey=e,this.isActive=t.detail.isActive,this.combatKey=this.Encounter.title.concat(this.Encounter.damage).concat(this.Encounter.healed),this.persons=this.Combatant,this.resort()}},ActWebsocketInterface=function(t,e){this.connect=function(){"undefined"!=typeof this.websocket&&null!=this.websocket&&this.close(),this.activate=!0;var t=this;this.websocket=new WebSocket(this.uri),this.websocket.onopen=function(e){t.onopen(e)},this.websocket.onmessage=function(e){t.onmessage(e)},this.websocket.onclose=function(e){t.onclose(e)},this.websocket.onerror=function(e){t.onerror(e)}},this.close=function(){this.activate=!1,null!=this.websocket&&"undefined"!=typeof this.websocket&&this.websocket.close()},this.onopen=function(t){if(null!=this.id&&"undefined"!=typeof this.id)this.set_id(this.id);else if("undefined"!=typeof overlayWindowId)this.set_id(overlayWindowId);else{var e=new RegExp("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"),i=e.exec(navigator.userAgent);null!=i&&1==i.length&&this.set_id(i[0])}},this.onclose=function(){if(this.websocket=null,this.activate){var t=this;setTimeout(function(){t.connect()},5e3)}},this.onmessage=function(t){if("."==t.data)this.websocket.send(".");else try{var e=JSON.parse(t.data),i=e.type;if("broadcast"==i){var i=(e.from,e.msgtype);e.msg;document.dispatchEvent(new CustomEvent("onBroadcastMessage",{detail:e}))}if("send"==i){var i=(e.from,e.msgtype);e.msg;document.dispatchEvent(new CustomEvent("onRecvMessage",{detail:e}))}}catch(s){}},this.onerror=function(t){this.websocket.close(),console.log(t)},this.getQuerySet=function(){for(var t={},e=window.location.search.substring(1),i=e.split("&"),s=0;s<i.length;s++)try{var a=i[s].split("=");querieSet[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}catch(o){}return t},this.broadcast=function(t,e){"undefined"!=typeof overlayWindowId&&this.id!=overlayWindowId&&this.set_id(overlayWindowId);var i={};i.type="broadcast",i.msgtype=t,i.msg=e,this.websocket.send(JSON.stringify(i))},this.send=function(t,e,i){"undefined"!=typeof overlayWindowId&&this.id!=overlayWindowId&&this.set_id(overlayWindowId);var s={};s.type="send",s.to=t,s.msgtype=e,s.msg=i,this.websocket.send(JSON.stringify(s))},this.overlayAPI=function(t,e){var i={};"undefined"!=typeof overlayWindowId&&this.id!=overlayWindowId&&this.set_id(overlayWindowId),i.type="overlayAPI",i.to=overlayWindowId,i.msgtype=t,i.msg=e,this.websocket.send(JSON.stringify(i))},this.set_id=function(t){var e={};e.type="set_id",e.id=t,this.id=overlayWindowId,this.websocket.send(JSON.stringify(e))},this.onRecvMessage=function(t){onRecvMessage(t)},this.onBroadcastMessage=function(t){onBroadcastMessage(t)},void 0==e&&(e="MiniParse");var i=this.getQuerySet(),s=this;"undefined"!=typeof i.HOST_PORT&&(t=i.HOST_PORT+e),this.uri=t,this.id=null,this.active=!1,document.addEventListener("onBroadcastMessage",function(t){s.onBroadcastMessage(t)}),document.addEventListener("onRecvMessage",function(t){s.onRecvMessage(t)}),window.addEventListener("message",function(t){"onBroadcastMessage"===t.data.type&&s.onBroadcastMessage(t.data),"onRecvMessage"===t.data.type&&s.onRecvMessage(t.data)})},langpack=new Language("ko");onACTWebSocket=!1,combatLog=[],combatants=[],curhp=100,curzone=0,lastCombatRaw=null,lastCombat=null,maxhp=100,myID=0,underDot=2,myName="",sortKey="encdps",delayOK=!0,diffcolor=!1,shorter=!1,Debug=new dbg(!1),chocoboskill=["초코 강타","초코 방어","초코 발차기","초코 내려찍기","초코 돌풍","초코 돌격","초코 쪼기","초코 때리기","초코 메디카","초코 쇄도","초코 케알","초코 리제네","チョコストライク","チョコガード","チョコキック","チョコドロップ","チョコブラスト","チョコラッシュ","チョコビーク","チョコスラッシュ","チョコメディカ","チョコサージ","チョコケアル","チョコリジェネ","Choco-frappe","Choco-garde","Choco-serres","Choco-saut","Choco-explosion","Choco-ruée","Choco-bec","Choco-taillade","Choco-médica","Choco-ardeur","Choco-soin","Choco-récup","Chocobo-Schlag","Chocobo-Block","Chocobo-Tritt","Chocobo-Faller","Chocobo-Knall","Chocobo-Rausch","Chocobo-Schnabel","Chocobo-Hieb","Chocobo-Reseda","Chocobo-Quelle","Chocobo-Vita","Chocobo-Regena","Choco Strike","Choco Guard","Choco Kick","Choco Drop","Choco Blast","Choco Rush","Choco Beak","Choco Slash","Choco Medica","Choco Surge","Choco Cure","Choco Regen"],advclass=["GLD","GLA","MRD","PGL","LNC","ROG","ARC","THM","ACN","CNJ"],advjob=["PLD","PLD","WAR","MNK","DRG","NIN","BRD","BLM","SMN","WHM","SCH","MCH","DRK","AST","SAM","RDM"],tanker=["PLD","WAR","DRK"],healer=["WHM","SCH","AST"],specialist={SMN:["에기","카벙클","EGI","CARBUNCLE","エギ","カーバンクル"],SCH:["요정","EOS","SELENE","フェアリー"],MCH:["포탑","AUTOTURRET","オートタレット"],LMB:["LIMIT BREAK","リミット"]},managedKeys={damage:"mergedDamage",hits:"mergedHits",misses:"mergedMisses",swings:"mergedSwings",crithits:"mergedCrithits",DirectHitCount:"mergedDirectHitCount",CritDirectHitCount:"mergedCritDirectHitCount",damagetaken:"mergedDamagetaken",heals:"mergedHeals",healed:"mergedHealed",critheals:"mergedCritheals",healstaken:"mergedHealstaken",damageShield:"mergedDamageShield",overHeal:"mergedOverHeal",absorbHeal:"mergedAbsorbHeal",Last10DPS:"mergedLast10DPS",Last30DPS:"mergedLast30DPS",Last60DPS:"mergedLast60DPS",Last180DPS:"mergedLast180DPS"},host_port=QueryString.HOST_PORT;try{if(window.navigator.userAgent.indexOf("OverlayWindow")>-1&&window.navigator.userAgent.indexOf("QtWebEngine")>-1?(onACTWebSocket=!0,console.warn("Running on ACTWebSocket Overlay Process"),console.log("%cHello! <"+document.title+" is with Cleave-ORE.js>\nversion 2.0","font-size:24px; color:#FFF; text-shadow:0px 0px 3px black, 0px 0px 3px black; background:url(https://github.com/laiglinne-ff/FFXIV_Chamsucript/blob/master/fell-cleave.png?raw=true);")):onACTWebSocket=!1,document.addEventListener?(document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,!1),domReady()},!1),window.onbeforeunload=function(){webs.close()},window.addEventListener("unload",function(){webs.close()},!1)):document.attachEvent&&document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",arguments.callee),domReady())}),"undefined"==typeof host_port)document.location.href.indexOf("file")>-1&&(wsUri="ws://127.0.0.1:10501/MiniParse");else{for(;host_port.endsWith("/");)host_port=host_port.substring(0,host_port.length-1);0==wsUri.indexOf("//")&&(wsUri=wsUri.substring(2)),0==wsUri.indexOf("ws://")||0==wsUri.indexOf("wss://")?0==host_port.indexOf("ws://")||0==host_port.indexOf("wss://")?wsUri=wsUri.replace(/(ws|wss):\/\/@HOST_PORT@/im,host_port):wsUri=wsUri.replace(/@HOST_PORT@/im,host_port):0==host_port.indexOf("ws://")||0==host_port.indexOf("wss://")?wsUri=wsUri.replace(/@HOST_PORT@/im,host_port):wsUri="ws://"+wsUri.replace(/@HOST_PORT@/im,host_port)}}catch(ex){}window.addEventListener("message",function(t){"onBroadcastMessage"===t.data.type&&onBroadcastMessage(t.data),"onRecvMessage"===t.data.type&&onRecvMessage(t.data)});