diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm
index ee5ad4f324b..d9319fb6ebd 100644
--- a/code/game/machinery/computer/prisoner.dm
+++ b/code/game/machinery/computer/prisoner.dm
@@ -1,3 +1,5 @@
+#define IMPLANT_WARN_COOLDOWN (30 SECONDS)
+
/obj/machinery/computer/prisoner
name = "labor camp points manager"
icon = 'icons/obj/computer.dmi'
@@ -5,17 +7,12 @@
icon_screen = "explosive"
req_access = list(ACCESS_ARMORY)
circuit = /obj/item/circuitboard/prisoner
- var/id = 0.0
- var/temp = null
- var/timeleft = 60
+
var/authenticated = FALSE // FALSE - No Access Denied, TRUE - Access allowed
var/obj/item/card/id/prisoner/inserted_id
light_color = LIGHT_COLOR_DARKRED
-/obj/machinery/computer/prisoner/attack_ai(mob/user as mob)
- return src.attack_hand(user)
-
/obj/machinery/computer/prisoner/Initialize(mapload)
. = ..()
GLOB.prisoncomputer_list += src
@@ -24,118 +21,153 @@
GLOB.prisoncomputer_list -= src
return ..()
-/obj/machinery/computer/prisoner/attack_hand(mob/user as mob)
+/obj/machinery/computer/prisoner/attack_ai(mob/user)
+ ui_interact(user)
+
+/obj/machinery/computer/prisoner/attack_hand(mob/user)
if(..())
- return 1
- user.set_machine(src)
- var/dat
- dat += "Prisoner Implant Manager System
"
- if(!authenticated)
- dat += "
Unlock Console"
- else
- if(istype(inserted_id))
- var/p = inserted_id:points
- var/g = inserted_id:goal
- dat += text("[inserted_id]
")
- dat += text("Collected points: [p]. Reset.
")
- dat += text("Card goal: [g]. Set
")
- dat += text("Space Law recommends sentences of 150 points per minute they would normally serve in the brig.
")
- else
- dat += text("Insert Prisoner ID
")
- var/turf/Tr = null
- dat += "
Chemical Implants
"
- for(var/obj/item/implant/chem/C in GLOB.tracked_implants)
- Tr = get_turf(C)
- if((Tr) && (Tr.z != src.z)) continue//Out of range
- if(!C.implanted) continue
- // AUTOFIXED BY fix_string_idiocy.py
- // C:\Users\Rob\Documents\Projects\vgstation13\code\game\machinery\computer\prisoner.dm:41: dat += "[C.imp_in.name] | Remaining Units: [C.reagents.total_volume] | Inject: "
- dat += {"[C.imp_in.name] | Remaining Units: [C.reagents.total_volume] | Inject:
- ((1))
- ((5))
- ((10))
- ********************************
"}
- // END AUTOFIX
- dat += "
Tracking Implants
"
- for(var/obj/item/implant/tracking/T in GLOB.tracked_implants)
- Tr = get_turf(T)
- if((Tr) && (Tr.z != src.z)) continue//Out of range
- if(!T.implanted) continue
- var/mob/living/carbon/M = T.imp_in
- var/loc_display = "Unknown"
- var/health_display = "OK"
- var/total_loss = (M.maxHealth - M.health)
- if(M.stat == DEAD)
- health_display = "DEAD"
- else if(total_loss)
- health_display = "HURT ([total_loss])"
- if(is_station_level(Tr.z) && !istype(Tr.loc, /turf/space))
- loc_display = "[get_area(Tr)]"
- dat += "ID: [T.id]
Subject: [M]
Location: [loc_display]
Health: [health_display]
"
- dat += "(Message Holder) |
"
- dat += "********************************
"
- dat += "
Lock Console"
+ return TRUE
- user << browse(dat, "window=computer;size=400x500")
- onclose(user, "computer")
- return
+ ui_interact(user)
-/obj/machinery/computer/prisoner/process()
- if(!..())
- src.updateDialog()
- return
+/obj/machinery/computer/prisoner/proc/check_implant(obj/item/implant/I)
+ var/turf/implant_location = get_turf(I)
+ if(!implant_location || implant_location.z != z)
+ return FALSE
+ if(!I.implanted)
+ return FALSE
+ return TRUE
-/obj/machinery/computer/prisoner/Topic(href, href_list)
+/obj/machinery/computer/prisoner/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
+ if(!ui)
+ ui = new(user, src, ui_key, "PrisonerImplantManager", name, 475, 500, master_ui, state)
+ ui.open()
+
+/obj/machinery/computer/prisoner/ui_data(mob/user)
+ var/list/data = list()
+ ui_login_data(data, user)
+ data["prisonerInfo"] = list(
+ "name" = inserted_id?.name,
+ "points" = inserted_id?.points,
+ "goal" = inserted_id?.goal,
+ )
+
+ data["chemicalInfo"] = list()
+ for(var/obj/item/implant/chem/C in GLOB.tracked_implants)
+ if(!check_implant(C))
+ continue
+ var/list/implant_info = list(
+ "name" = C.imp_in.name,
+ "volume" = C.reagents.total_volume,
+ "uid" = C.UID(),
+ )
+ data["chemicalInfo"] += list(implant_info)
+
+ data["trackingInfo"] = list()
+ for(var/obj/item/implant/tracking/T in GLOB.tracked_implants)
+ if(!check_implant(T))
+ continue
+ var/mob/living/carbon/M = T.imp_in
+ var/loc_display = "Unknown"
+ var/health_display = "OK"
+ var/total_loss = (M.maxHealth - M.health)
+ if(M.stat == DEAD)
+ health_display = "DEAD"
+ else if(total_loss)
+ health_display = "HURT ([total_loss])"
+ var/turf/implant_location = get_turf(T)
+ if(!istype(implant_location, /turf/space))
+ loc_display = "[get_area(implant_location)]"
+
+ var/list/implant_info = list(
+ "id" = T.id,
+ "subject" = M.name,
+ "location" = loc_display,
+ "health" = health_display,
+ "uid" = T.UID()
+ )
+ data["trackingInfo"] += list(implant_info)
+
+ data["modal"] = ui_modal_data(src)
+
+ return data
+
+/obj/machinery/computer/prisoner/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
if(..())
- return 1
+ return
- usr.set_machine(src)
+ add_fingerprint(usr)
- if(href_list["id"])
- switch(href_list["id"])
- if("0")
- var/obj/item/card/id/prisoner/I = usr.get_active_hand()
- if(istype(I))
- usr.drop_item()
- I.loc = src
- inserted_id = I
- else
- to_chat(usr, "No valid ID.")
- if("1")
- inserted_id.loc = get_step(src,get_turf(usr))
+ if(ui_act_modal(action, params, ui))
+ return
+ if(ui_login_act(action, params))
+ return
+
+ var/mob/living/user = ui.user
+
+
+
+ switch(action)
+ if("id_card")
+ if(inserted_id)
+ inserted_id.forceMove(loc)
inserted_id = null
- if("2")
- inserted_id.mining_points = 0
- if("3")
- var/num = round(input(usr, "Choose prisoner's goal:", "Input an Integer", null) as num|null)
- if(num >= 0)
- inserted_id.goal = num
- if(href_list["inject1"])
- var/obj/item/implant/I = locate(href_list["inject1"])
- if(I) I.activate(1)
+ return
+ var/obj/item/card/id/prisoner/I = user.get_active_hand()
+ if(istype(I) && user.drop_item())
+ I.forceMove(src)
+ inserted_id = I
+ else
+ to_chat(user, "No valid ID.")
+ if("inject")
+ var/obj/item/implant/chem/implant = locateUID(params["uid"])
+ if(!implant)
+ return
+ implant.activate(text2num(params["amount"]))
+ if("reset_points")
+ if(inserted_id)
+ inserted_id.points = 0
- else if(href_list["inject5"])
- var/obj/item/implant/I = locate(href_list["inject5"])
- if(I) I.activate(5)
- else if(href_list["inject10"])
- var/obj/item/implant/I = locate(href_list["inject10"])
- if(I) I.activate(10)
-
- else if(href_list["lock"])
- if(src.allowed(usr))
- authenticated = !authenticated
+/obj/machinery/computer/prisoner/proc/ui_act_modal(action, list/params, datum/tgui/ui)
+ if(!ui_login_get().logged_in)
+ return
+ . = TRUE
+ var/id = params["id"]
+ var/mob/living/user = ui.user
+ var/list/arguments = istext(params["arguments"]) ? json_decode(params["arguments"]) : params["arguments"]
+ switch(ui_modal_act(src, action, params))
+ if(UI_MODAL_OPEN)
+ switch(id)
+ if("warn")
+ ui_modal_input(src, id, "Please enter your message:", null, arguments = list(
+ "uid" = arguments["uid"],
+ ))
+ if("set_points")
+ ui_modal_input(src, id, "Please enter the new point goal:", null, arguments)
+ else
+ return FALSE
+ if(UI_MODAL_ANSWER)
+ var/answer = params["answer"]
+ switch(id)
+ if("warn")
+ var/obj/item/implant/tracking/implant = locateUID(arguments["uid"])
+ if(!implant)
+ return
+ if(implant.warn_cooldown >= world.time)
+ to_chat(user, "The warning system for that implant is still cooling down.")
+ return
+ implant.warn_cooldown = world.time + IMPLANT_WARN_COOLDOWN
+ if(implant.imp_in)
+ var/mob/living/carbon/implantee = implant.imp_in
+ var/warning = copytext(sanitize(text2num(answer)), 1, MAX_MESSAGE_LEN)
+ to_chat(implantee, "Your skull vibrates violently as a loud announcement is broadcasted to you: '[warning]'")
+ if("set_points")
+ if(isnull(text2num(answer)))
+ return
+ inserted_id.goal = max(text2num(answer), 0)
+ else
+ return FALSE
else
- to_chat(usr, "Unauthorized access.")
-
- else if(href_list["warn"])
- var/warning = sanitize(copytext(input(usr,"Message:","Enter your message here!",""),1,MAX_MESSAGE_LEN))
- if(!warning) return
- var/obj/item/implant/I = locate(href_list["warn"])
- if((I)&&(I.imp_in))
- var/mob/living/carbon/R = I.imp_in
- to_chat(R, "You hear a voice in your head saying: '[warning]'")
-
- src.add_fingerprint(usr)
- src.updateUsrDialog()
- return
+ return FALSE
diff --git a/code/game/objects/items/weapons/implants/implant_track.dm b/code/game/objects/items/weapons/implants/implant_track.dm
index f5b9d0a4747..94e6e6c872c 100644
--- a/code/game/objects/items/weapons/implants/implant_track.dm
+++ b/code/game/objects/items/weapons/implants/implant_track.dm
@@ -4,6 +4,7 @@
activated = IMPLANT_ACTIVATED_PASSIVE
origin_tech = "materials=2;magnets=2;programming=2;biotech=2"
var/id = 1
+ var/warn_cooldown = 0
/obj/item/implant/tracking/New()
diff --git a/tgui/packages/tgui/interfaces/PrisonerImplantManager.js b/tgui/packages/tgui/interfaces/PrisonerImplantManager.js
new file mode 100644
index 00000000000..e75133e55c5
--- /dev/null
+++ b/tgui/packages/tgui/interfaces/PrisonerImplantManager.js
@@ -0,0 +1,121 @@
+import { useBackend } from '../backend';
+import { Button, Section, Box, Flex } from '../components';
+import { LabeledList, LabeledListItem } from '../components/LabeledList';
+import { ComplexModal, modalOpen } from './common/ComplexModal';
+import { LoginInfo } from './common/LoginInfo';
+import { LoginScreen } from './common/LoginScreen';
+import { Window } from '../layouts';
+
+export const PrisonerImplantManager = (props, context) => {
+ const { act, data } = useBackend(context);
+ const {
+ loginState,
+ prisonerInfo,
+ chemicalInfo,
+ trackingInfo,
+ } = data;
+
+ let body;
+ if (!loginState.logged_in) {
+ return (
+
+
+
+
+
+ );
+ }
+
+ let injectionAmount = [1, 5, 10] // used for auto generating chemical implant inject buttons
+
+ return (
+
+
+
+
+
+
+
+
+
+ {prisonerInfo.points !== null ? prisonerInfo.points : "-/-"}
+ {prisonerInfo.goal !== null &&
+
+
+
+
+
+
+ {trackingInfo
+ .map(implant => (
+ <>
+ Subject: {implant.subject}
+
+ {implant.location}
+ {implant.health}
+
+
+
+
+
+ >
+ ))}
+
+
+ {chemicalInfo
+ .map(implant => (
+ <>
+ Subject: {implant.name}
+
+
+ {implant.volume}
+
+ {injectionAmount.map(amount => (
+
+
+ >
+ ))}
+
+
+
+ );
+};
diff --git a/tgui/packages/tgui/public/tgui.bundle.js b/tgui/packages/tgui/public/tgui.bundle.js
index 0b61455a49d..e5c687a7f49 100644
--- a/tgui/packages/tgui/public/tgui.bundle.js
+++ b/tgui/packages/tgui/public/tgui.bundle.js
@@ -1,5 +1,5 @@
-!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=230)}([function(e,t,n){"use strict";t.__esModule=!0;var o=n(232);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||(t[e]=o[e]))}))},function(e,t,n){"use strict";t.__esModule=!0,t.useSharedState=t.useLocalState=t.useBackend=t.deleteLocalState=t.backendUpdate=t.backendSetSharedState=t.backendReducer=t.backendDeleteSharedState=void 0;var o=n(31),r=n(45);t.backendUpdate=function(e){return{type:"backend/update",payload:e}};var a=function(e,t){return{type:"backend/setSharedState",payload:{key:e,nextState:t}}};t.backendSetSharedState=a;var c=function(e){return{type:"backend/deleteSharedState",payload:e}};t.backendDeleteSharedState=c;t.backendReducer=function(e,t){var n=t.type,o=t.payload;if("backend/update"===n){var a=Object.assign({},e.config,o.config),c=Object.assign({},e.data,o.static_data,o.data),i=Object.assign({},e.shared);if(o.shared)for(var l=0,d=Object.keys(o.shared);l1?n-1:0),r=1;rn?n:e};t.clamp01=function(e){return e<0?0:e>1?1:e};t.scale=function(e,t,n){return(e-t)/(n-t)};t.round=function(e,t){return!e||isNaN(e)?e:(t|=0,a=(e*=n=Math.pow(10,t))>0|-(e<0),r=Math.abs(e%1)>=.4999999999854481,o=Math.floor(e),r&&(e=o+(a>0)),(r?e:Math.round(e))/n);var n,o,r,a};t.toFixed=function(e,t){return void 0===t&&(t=0),Number(e).toFixed(Math.max(t,0))};var o=function(e,t){return t&&e>=t[0]&&e<=t[1]};t.inRange=o;t.keyOfMatchingRange=function(e,t){for(var n=0,r=Object.keys(t);n0&&(t.style=l),t};t.computeBoxProps=N;var b=function(e){var t=e.textColor||e.color,n=e.backgroundColor;return(0,o.classes)([u(t)&&"color-"+t,u(n)&&"color-bg-"+n])};t.computeBoxClassName=b;var V=function(e){var t=e.as,n=void 0===t?"div":t,o=e.className,c=e.children,l=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}(e,i);if("function"==typeof c)return c(N(e));var d="string"==typeof o?o+" "+b(l):b(l),u=N(l);return(0,r.createVNode)(a.VNodeFlags.HtmlElement,n,d,c,a.ChildFlags.UnknownChildren,u)};t.Box=V,V.defaultHooks=o.pureComponentHooks},function(e,t,n){"use strict";var o=n(39);e.exports=function(e){return o(e.length)}},function(e,t,n){"use strict";var o=n(5),r=n(12),a=n(47),c=n(127),i=n(125);e.exports=function(e,t,n,l){var d=!!l&&!!l.unsafe,u=!!l&&!!l.enumerable,s=!!l&&!!l.noTargetGet,m=l&&l.name!==undefined?l.name:t;return r(n)&&c(n,m,l),e===o?(u?e[t]=n:i(t,n),e):(d?!s&&e[t]&&(u=!0):delete e[t],u?e[t]=n:a(e,t,n),e)}},function(e,t,n){"use strict";function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n",apos:"'"};return e.replace(/
/gi,"\n").replace(/<\/?[a-z0-9-_]+[^>]*>/gi,"").replace(/&(nbsp|amp|quot|lt|gt|apos);/g,(function(e,n){return t[n]})).replace(/?([0-9]+);/gi,(function(e,t){var n=parseInt(t,10);return String.fromCharCode(n)})).replace(/?([0-9a-f]+);/gi,(function(e,t){var n=parseInt(t,16);return String.fromCharCode(n)}))};t.buildQueryString=function(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}},function(e,t,n){"use strict";var o=n(58),r=n(7),a=n(84),c=n(18),i=n(22),l=n(90),d=r([].push),u=function(e){var t=1==e,n=2==e,r=3==e,u=4==e,s=6==e,m=7==e,p=5==e||s;return function(f,h,C,N){for(var b,V,g=c(f),v=a(g),y=o(h,C),x=i(v),_=0,k=N||l,L=t?k(f,x):n||m?k(f,0):undefined;x>_;_++)if((p||_ in v)&&(V=y(b=v[_],_,g),e))if(t)L[_]=V;else if(V)switch(e){case 3:return!0;case 5:return b;case 6:return _;case 2:d(L,b)}else switch(e){case 4:return!1;case 7:d(L,b)}return s?-1:r||u?u:L}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},function(e,t,n){"use strict";var o=n(8),r=n(14),a=n(100),c=n(62),i=n(29),l=n(54),d=n(17),u=n(171),s=Object.getOwnPropertyDescriptor;t.f=o?s:function(e,t){if(e=i(e),t=l(t),u)try{return s(e,t)}catch(n){}if(d(e,t))return c(!r(a.f,e,t),e[t])}},function(e,t,n){"use strict";var o=n(5),r=n(12),a=n(69),c=o.TypeError;e.exports=function(e){if(r(e))return e;throw c(a(e)+" is not a function")}},function(e,t,n){"use strict";var o=n(5),r=n(12),a=function(e){return r(e)?e:undefined};e.exports=function(e,t){return arguments.length<2?a(o[e]):o[e]&&o[e][t]}},function(e,t,n){"use strict";var o=n(84),r=n(30);e.exports=function(e){return o(r(e))}},function(e,t,n){"use strict";var o=n(5).TypeError;e.exports=function(e){if(e==undefined)throw o("Can't call method on "+e);return e}},function(e,t,n){"use strict";function o(e,t,n,o,r,a,c){try{var i=e[a](c),l=i.value}catch(d){return void n(d)}i.done?t(l):Promise.resolve(l).then(o,r)}t.__esModule=!0,t.winset=t.winget=t.runCommand=t.callByondAsync=t.callByond=t.IS_IE8=void 0;var r=window.Byond,a=function(){var e=navigator.userAgent.match(/Trident\/(\d+).+?;/i);if(!e)return null;var t=e[1];return t?parseInt(t,10):null}(),c=null!==a&&a<=6;t.IS_IE8=c;var i=function(e,t){void 0===t&&(t={}),r.call(e,t)};t.callByond=i;var l=function(e,t){void 0===t&&(t={}),window.__callbacks__=window.__callbacks__||[];var n=window.__callbacks__.length,o=new Promise((function(e){window.__callbacks__.push(e)}));return r.call(e,Object.assign({},t,{callback:"__callbacks__["+n+"]"})),o};t.callByondAsync=l;t.runCommand=function(e){return i("winset",{command:e})};var d=function(){var e,t=(e=regeneratorRuntime.mark((function n(e,t){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l("winget",{id:e,property:t});case 2:return o=n.sent,n.abrupt("return",o[t]);case 4:case"end":return n.stop()}}),n)})),function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function i(e){o(c,r,a,i,l,"next",e)}function l(e){o(c,r,a,i,l,"throw",e)}i(undefined)}))});return function(e,n){return t.apply(this,arguments)}}();t.winget=d;t.winset=function(e,t,n){var o;return i("winset",((o={})[e+"."+t]=n,o))}},function(e,t,n){"use strict";t.__esModule=!0,t.zipWith=t.zip=t.uniqBy=t.toKeyedArray=t.toArray=t.sortBy=t.reduce=t.map=t.filter=void 0;t.toArray=function(e){if(Array.isArray(e))return e;if("object"==typeof e){var t=Object.prototype.hasOwnProperty,n=[];for(var o in e)t.call(e,o)&&n.push(e[o]);return n}return[]};t.toKeyedArray=function(e,t){return void 0===t&&(t="key"),o((function(e,n){var o;return Object.assign(((o={})[t]=n,o),e)}))(e)};t.filter=function(e){return function(t){if(null===t&&t===undefined)return t;if(Array.isArray(t)){for(var n=[],o=0;oi)return 1}return 0};t.sortBy=function(){for(var e=arguments.length,t=new Array(e),n=0;n"+l+""+t+">"}},function(e,t,n){"use strict";var o=n(6);e.exports=function(e){return o((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},function(e,t,n){"use strict";var o,r,a,c=n(173),i=n(5),l=n(7),d=n(11),u=n(47),s=n(17),m=n(124),p=n(102),f=n(86),h=i.TypeError,C=i.WeakMap;if(c||m.state){var N=m.state||(m.state=new C),b=l(N.get),V=l(N.has),g=l(N.set);o=function(e,t){if(V(N,e))throw new h("Object already initialized");return t.facade=e,g(N,e,t),t},r=function(e){return b(N,e)||{}},a=function(e){return V(N,e)}}else{var v=p("state");f[v]=!0,o=function(e,t){if(s(e,v))throw new h("Object already initialized");return t.facade=e,u(e,v,t),t},r=function(e){return s(e,v)?e[v]:{}},a=function(e){return s(e,v)}}e.exports={set:o,get:r,has:a,enforce:function(e){return a(e)?r(e):o(e,{})},getterFor:function(e){return function(t){var n;if(!d(t)||(n=r(t)).type!==e)throw h("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){"use strict";var o=Math.ceil,r=Math.floor;e.exports=function(e){var t=+e;return t!=t||0===t?0:(t>0?r:o)(t)}},function(e,t,n){"use strict";var o=n(38),r=Math.min;e.exports=function(e){return e>0?r(o(e),9007199254740991):0}},function(e,t,n){"use strict";var o=n(5),r=n(17),a=n(12),c=n(18),i=n(102),l=n(137),d=i("IE_PROTO"),u=o.Object,s=u.prototype;e.exports=l?u.getPrototypeOf:function(e){var t=c(e);if(r(t,d))return t[d];var n=t.constructor;return a(n)&&t instanceof n?n.prototype:t instanceof u?s:null}},function(e,t,n){"use strict";t.__esModule=!0,t.modalRegisterBodyOverride=t.modalOpen=t.modalClose=t.modalAnswer=t.ComplexModal=void 0;var o=n(0),r=n(1),a=n(2),c={};t.modalOpen=function(e,t,n){var o=(0,r.useBackend)(e),a=o.act,c=o.data,i=Object.assign(c.modal?c.modal.args:{},n||{});a("modal_open",{id:t,arguments:JSON.stringify(i)})};t.modalRegisterBodyOverride=function(e,t){c[e]=t};var i=function(e,t,n,o){var a=(0,r.useBackend)(e),c=a.act,i=a.data;if(i.modal){var l=Object.assign(i.modal.args||{},o||{});c("modal_answer",{id:t,answer:n,arguments:JSON.stringify(l)})}};t.modalAnswer=i;var l=function(e,t){(0,(0,r.useBackend)(e).act)("modal_close",{id:t})};t.modalClose=l;t.ComplexModal=function(e,t){var n=(0,r.useBackend)(t).data;if(n.modal){var d,u,s=n.modal,m=s.id,p=s.text,f=s.type,h=(0,o.createComponentVNode)(2,a.Button,{icon:"arrow-left",content:"Cancel",color:"grey",onClick:function(){return l(t)}}),C="auto";if(c[m])u=c[m](n.modal,t);else if("input"===f){var N=n.modal.value;d=function(e){return i(t,m,N)},u=(0,o.createComponentVNode)(2,a.Input,{value:n.modal.value,placeholder:"ENTER to submit",width:"100%",my:"0.5rem",autofocus:!0,onChange:function(e,t){N=t}}),h=(0,o.createComponentVNode)(2,a.Box,{mt:"0.5rem",children:[(0,o.createComponentVNode)(2,a.Button,{icon:"arrow-left",content:"Cancel",color:"grey",onClick:function(){return l(t)}}),(0,o.createComponentVNode)(2,a.Button,{icon:"check",content:"Confirm",color:"good",float:"right",m:"0",onClick:function(){return i(t,m,N)}}),(0,o.createComponentVNode)(2,a.Box,{clear:"both"})]})}else if("choice"===f){var b="object"==typeof n.modal.choices?Object.values(n.modal.choices):n.modal.choices;u=(0,o.createComponentVNode)(2,a.Dropdown,{options:b,selected:n.modal.value,width:"100%",my:"0.5rem",onSelected:function(e){return i(t,m,e)}}),C="initial"}else"bento"===f?u=(0,o.createComponentVNode)(2,a.Flex,{spacingPrecise:"1",wrap:"wrap",my:"0.5rem",maxHeight:"1%",children:n.modal.choices.map((function(e,r){return(0,o.createComponentVNode)(2,a.Flex.Item,{flex:"1 1 auto",children:(0,o.createComponentVNode)(2,a.Button,{selected:r+1===parseInt(n.modal.value,10),onClick:function(){return i(t,m,r+1)},children:(0,o.createVNode)(1,"img",null,null,1,{src:e})})},r)}))}):"boolean"===f&&(h=(0,o.createComponentVNode)(2,a.Box,{mt:"0.5rem",children:[(0,o.createComponentVNode)(2,a.Button,{icon:"times",content:n.modal.no_text,color:"bad",float:"left",mb:"0",onClick:function(){return i(t,m,0)}}),(0,o.createComponentVNode)(2,a.Button,{icon:"check",content:n.modal.yes_text,color:"good",float:"right",m:"0",onClick:function(){return i(t,m,1)}}),(0,o.createComponentVNode)(2,a.Box,{clear:"both"})]}));return(0,o.createComponentVNode)(2,a.Modal,{maxWidth:e.maxWidth||window.innerWidth/2+"px",maxHeight:e.maxHeight||window.innerHeight/2+"px",onEnter:d,mx:"auto",overflowY:C,children:[(0,o.createComponentVNode)(2,a.Box,{display:"inline",children:p}),u,h]})}}},function(e,t,n){"use strict";var o=n(7),r=o({}.toString),a=o("".slice);e.exports=function(e){return a(r(e),8,-1)}},function(e,t,n){"use strict";var o=n(7);e.exports=o({}.isPrototypeOf)},function(e,t,n){"use strict";var o=n(83),r=Function.prototype,a=r.apply,c=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(o?c.bind(a):function(){return c.apply(a,arguments)})},function(e,t,n){"use strict";t.__esModule=!0,t.timeAgo=t.getGasLabel=t.getGasColor=t.UI_UPDATE=t.UI_INTERACTIVE=t.UI_DISABLED=t.UI_CLOSE=t.RADIO_CHANNELS=t.CSS_COLORS=t.COLORS=void 0;t.UI_INTERACTIVE=2;t.UI_UPDATE=1;t.UI_DISABLED=0;t.UI_CLOSE=-1;t.COLORS={department:{command:"#526aff",security:"#CF0000",medical:"#009190",science:"#993399",engineering:"#A66300",supply:"#9F8545",service:"#80A000",centcom:"#78789B",other:"#C38312"},damageType:{oxy:"#3498db",toxin:"#2ecc71",burn:"#e67e22",brute:"#e74c3c"}};t.CSS_COLORS=["black","white","red","orange","yellow","olive","green","teal","blue","violet","purple","pink","brown","grey","good","average","bad","label"];t.RADIO_CHANNELS=[{name:"Syndicate",freq:1213,color:"#a52a2a"},{name:"SyndTeam",freq:1244,color:"#a52a2a"},{name:"Red Team",freq:1215,color:"#ff4444"},{name:"Blue Team",freq:1217,color:"#3434fd"},{name:"Response Team",freq:1345,color:"#2681a5"},{name:"Special Ops",freq:1341,color:"#2681a5"},{name:"Supply",freq:1347,color:"#b88646"},{name:"Service",freq:1349,color:"#6ca729"},{name:"Science",freq:1351,color:"#c68cfa"},{name:"Command",freq:1353,color:"#5177ff"},{name:"Procedure",freq:1339,color:"#F70285"},{name:"Medical",freq:1355,color:"#57b8f0"},{name:"Medical(I)",freq:1485,color:"#57b8f0"},{name:"Engineering",freq:1357,color:"#f37746"},{name:"Security",freq:1359,color:"#dd3535"},{name:"Security(I)",freq:1475,color:"#dd3535"},{name:"AI Private",freq:1343,color:"#d65d95"},{name:"Common",freq:1459,color:"#1ecc43"}];var o=[{id:"o2",name:"Oxygen",label:"O\u2082",color:"blue"},{id:"n2",name:"Nitrogen",label:"N\u2082",color:"red"},{id:"co2",name:"Carbon Dioxide",label:"CO\u2082",color:"grey"},{id:"plasma",name:"Plasma",label:"Plasma",color:"pink"},{id:"water_vapor",name:"Water Vapor",label:"H\u2082O",color:"grey"},{id:"nob",name:"Hyper-noblium",label:"Hyper-nob",color:"teal"},{id:"n2o",name:"Nitrous Oxide",label:"N\u2082O",color:"red"},{id:"no2",name:"Nitryl",label:"NO\u2082",color:"brown"},{id:"tritium",name:"Tritium",label:"Tritium",color:"green"},{id:"bz",name:"BZ",label:"BZ",color:"purple"},{id:"stim",name:"Stimulum",label:"Stimulum",color:"purple"},{id:"pluox",name:"Pluoxium",label:"Pluoxium",color:"blue"},{id:"miasma",name:"Miasma",label:"Miasma",color:"olive"},{id:"hydrogen",name:"Hydrogen",label:"H\u2082",color:"white"},{id:"ab",name:"Agent B",label:"Agent B",color:"purple"}];t.getGasLabel=function(e,t){var n=String(e).toLowerCase(),r=o.find((function(e){return e.id===n||e.name.toLowerCase()===n}));return r&&r.label||t||e};t.getGasColor=function(e){var t=String(e).toLowerCase(),n=o.find((function(e){return e.id===t||e.name.toLowerCase()===t}));return n&&n.color};t.timeAgo=function(e,t){if(e>t)return"in the future";var n=(t/=10)-(e/=10);if(n>3600){var o=Math.round(n/3600);return o+" hour"+(1===o?"":"s")+" ago"}if(n>60){var r=Math.round(n/60);return r+" minute"+(1===r?"":"s")+" ago"}var a=Math.round(n);return a+" second"+(1===a?"":"s")+" ago"}},function(e,t,n){"use strict";var o=n(28);e.exports=o("navigator","userAgent")||""},function(e,t,n){"use strict";var o=n(8),r=n(16),a=n(62);e.exports=o?function(e,t,n){return r.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var o=n(38),r=Math.max,a=Math.min;e.exports=function(e,t){var n=o(e);return n<0?r(n+t,0):a(n,t)}},function(e,t,n){"use strict";var o,r=n(9),a=n(131),c=n(129),i=n(86),l=n(176),d=n(126),u=n(102),s=u("IE_PROTO"),m=function(){},p=function(e){return"