1__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.SensorManagementScreen=function(){const e=(0,D.useSeoMeta)('SensorManagement'),s=(0,M.useToast)(),c=(0,k.useAppNavigation)(),E=(0,k.useSensorManagementParams)(),{isAdmin:R}=(0,u.useAuth)(),{submittedSearchText:I,writeSubmittedSearchText:K}=(0,C.useSensorSearchFragment)(),H=(0,n.useRef)(null),F=(0,n.useRef)(0),W=(0,n.useRef)(0),$=(0,n.useRef)(null),{sensors:X,loading:B,error:Y,refresh:z,reconcile:Z}=(0,_.useMySensors)(),q=j(I??''),[J,Q]=(0,n.useState)(q.canonicalText),[ee,ne]=(0,n.useState)(!1),[se,re]=(0,n.useReducer)(T.sensorManagementSearchReducer,T.EMPTY_SENSOR_MANAGEMENT_SEARCH_STATE),[te,ae]=(0,n.useState)(!1),{clearSearchSelection:oe,ownedSelection:ie,reconcileSearchResults:ce,searchSelection:le}=(0,v.usePartitionedSensorSelection)({ownedSensors:X,publicSearchSensors:se.publicSensors,searchSensors:se.sensors}),ue=(0,n.useRef)(0),de=(0,n.useRef)(null),Se=(0,n.useRef)(I),he=(0,n.useRef)(null),[ge,fe]=(0,n.useState)('landing'),[pe,be]=(0,n.useState)(null),[ye,me]=(0,n.use
1State)(null),[we,Te]=(0,n.useState)(!1);(0,n.useLayoutEffect)(()=>{const e=$.current;null!==e&&($.current=null,H.current?.scrollTo({animated:!1,y:e}))});const xe=(0,n.useRef)({disabledMutationKeys:new Set,pendingSensorIndices:new Set}),[ve,Ce]=(0,n.useState)(()=>xe.current),Me=(0,n.useRef)(new Map),Ae=ve.pendingSensorIndices,Ee=ve.disabledMutationKeys,Re=(0,n.useCallback)(e=>{xe.current=e,Ce(e)},[]);(0,n.useEffect)(()=>{const e=Me.current;return()=>{e.forEach(e=>{clearTimeout(e)}),e.clear()}},[]);const Ie=(0,n.useCallback)((e,n)=>{const s=xe.current;if(s.pendingSensorIndices.has(e)||s.disabledMutationKeys.has(n))return!1;const t=new Set(s.pendingSensorIndices);t.add(e);const o=new Set(s.disabledMutationKeys);return o.add(n),Re({disabledMutationKeys:o,pendingSensorIndices:t}),!0},[Re]),De=(0,n.useCallback)((e,n)=>{const s=Me.current.get(n);void 0!==s&&clearTimeout(s);const t=xe.current,o=new Set(t.pendingSensorIndices);o.delete(e),Re({disabledMutationKeys:t.disabledMutationKeys,pendingSensorIndices:o});const c=setTimeout(()=>{Me.current.delete(n);const e=xe.current;if(!e.disabledMutationKeys.has(n))return;const s=new Set(e.disabledMutationKeys);s.delete(n),Re({disabledMutationKeys:s,pendingSensorIndices:e.pendingSensorIndices})},V);Me.current.set(n,c)},[Re]),ke=(0,n.useCallback)((e,n,s)=>Ee.has(L(e,n,s??null)),[Ee]),Oe=(0,n.useCallback)(e=>Ee.has(`${e}:archive`),[Ee]),Pe=(0,n.useCallback)(async e=>{const n=ue.current+1;ue.current=n,de.current=e.canonicalText,ae(!0);try{const s=await l.sensorManagementApi.search([...e.terms]);if(ue.current!==n)return;ce(s.sensors,s.publicSensors),re({publicSensors:s.publicSensors,sensors:s.sensors,totalResults:s.totalResults,type:'searchCompleted'})}catch(e){ue.current===n&&s.error((0,O.errorMessage)(e,'Search failed. Please try again.'))}finally{ue.current===n&&ae(!1)}},[ce,s]);(0,n.useEffect)(()=>{const e=Se.current;if(Se.current=I,null===I){if(null===e)return;return ue.current+=1,de.current=null,ae(!1),Q(''),oe(),void re({type:'searchCleared'})}const n=j(I);if(0===n.terms.length)return ue.current+=1,ae(!1),Q(''),oe(),void re({type:'searchCleared'});e!==I&&Q(n.canonicalText),de.current!==n.canonicalText&&Pe(n)},[oe,I,Pe]),(0,n.useEffect)(()=>()=>{ue.current+=1},[]);const Ne=(0,n.useCallback)(()=>{const e=j(J);0!==e.terms.length?(Q(e.canonicalText),K(e.canonicalText),Pe(e)):s.warning('Enter at least one search term.',{id:'sensor-mgmt-empty-search'})},[Pe,J,s,K]),Ve=(0,n.useCallback)(e=>{(0,p.exportSensorTable)(e,{download:S.downloadColumnsCsv,filenamePrefix:'sensor-search',recordAudit:(e,n)=>l.sensorManagementApi.exportAudit(e,n),onUnsupported:()=>{s.info('CSV export is not available on this platform yet.')},onAuditError:e=>{P.logger.warn('Failed to record sensor export audit',e)}})},[s]),je=(0,n.useCallback)(e=>{(0,p.exportSensorTable)(e,{download:S.downloadColumnsCsv,filenamePrefix:'my-sensors',onUnsupported:()=>{s.info('CSV export is not available on this platform yet.')}})},[s]),Le=(0,n.useCallback)(async e=>{W.current=F.current,Te(!0);try{const n=await l.sensorManagementApi.getDetail(e);be(n),$.current=0,fe('detail')}catch(e){s.error((0,O.errorMessage)(e,'Failed to load sensor details.'))}finally{Te(!1)}},[s]);(0,n.useEffect)(()=>{const e=E?.sensorIndex;if(void 0===e)return void(he.current=null);const n=Number(e);!Number.isSafeInteger(n)||n<=0?s.error('The sensor detail link contains an invalid sensor index.'):he.current!==n&&(he.current=n,Le(n))},[Le,E?.sensorIndex,s]);const Ue=(0,n.useCallback)(async e=>{W.current=F.current,Te(!0);try{const n=await l.sensorManagementApi.getPublicDetail(e);me(n),$.current=0,fe('public-detail')}catch(e){s.error((0,O.errorMessage)(e,'Failed to load sensor details.'))}finally{Te(!1)}},[s]),Ge=(0,n.useCallback)(async e=>{try{const n=await l.sensorManagementApi.getDetail(e);be(n)}catch(e){s.error((0,O.errorMessage)(e,'Update applied, but failed to refresh history.'))}},[s]),Ke=(0,n.useCallback)(async(e,n,t,o)=>{const c=L(e,n,o??null);if(Ie(e,c))try{const c=await l.sensorManagementApi.update(Object.assign({sensorIndex:e,action:n,channel:o??null},void 0!==t&&{value:t}));if(!c.success)return void s.error(c.message??'Update failed. Please try again.');s.success(c.message??'Update applied.');const u=c.sensor??null;re({sensorIndex:e,type:'sensorUpdated',updatedSensor:u}),Z(e,u);if(pe?.sensor.sensorIndex===e){const n=(0,x.applySensorUpdateToDetail)(pe,e,u);null===n?(be(null),fe('landing')):(be(n),Ge(e))}}catch(e){s.error((0,O.errorMessage)(e,'Update failed. Please try again.'))}finally{De(e,c)}},[Ie,pe,De,Ge,Z,s]),He=(0,n.useCallback)(async(e,n)=>{if(!await U(n))return;const t=`${e}:archive`;if(Ie(e,t))try{const n=await l.sensorManagementApi.archive(e);
1if(!n.success)return void s.error(n.message);s.success(n.message),re({sensorIndex:e,type:'sensorUpdated',updatedSensor:null});const t=X.find(n=>n.sensorIndex===e);void 0!==t&&null!==n.archivedMac&&Z(e,Object.assign({},t,{archived:!0,mac:n.archivedMac})),pe?.sensor.sensorIndex===e&&(be(null),fe('landing'))}catch(e){s.error((0,O.errorMessage)(e,'Archive failed. Please try again.'))}finally{De(e,t)}},[Ie,pe,De,X,Z,s]),Fe=(0,n.useCallback)((e,n)=>{He(e,n)},[He]),We=(0,n.useCallback)(e=>{c.navigate('Register',{mac:e})},[c]),$e=(0,n.useCallback)(()=>{$.current=W.current,fe('landing'),be(null),me(null),void 0!==E?.sensorIndex&&c.navigate('SensorManagement')},[c,E?.sensorIndex]),Xe=(0,n.useCallback)(e=>{'landing'===ge&&(F.current=e.nativeEvent.contentOffset.y)},[ge]);return(0,N.jsxs)(h.PageLayout,{scrollRef:H,scrollViewTestID:"sensor-management-scroll-view",onScroll:Xe,scrollEventThrottle:16,children:[(0,N.jsx)(A.WebMeta,Object.assign({},e)),(0,N.jsxs)(o.default,{style:G.container,children:['landing'===ge&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(b.OwnedSensorsSection,{sensors:X,loading:B,error:Y,onRetry:()=>{z()},onViewDetail:e=>{Le(e)},detailLoading:we,pendingSensorIndices:Ae,onExportTable:je,selection:ie,selectionModeVisible:ee,onSelectionModeChange:ne}),(0,N.jsx)(o.default,{style:G.searchSectionHeader,children:(0,N.jsx)(t.default,{style:G.searchSectionTitle,children:"Search Other Sensors"})}),(0,N.jsx)(w.SearchView,{searchText:J,onSearchTextChange:Q,onSearch:Ne,loading:te,sensors:se.sensors,publicSensors:se.publicSensors,totalResults:se.totalResults,hasSearched:se.hasSearched,onViewDetail:e=>{Le(e)},onViewPublicDetail:e=>{Ue(e)},detailLoading:we,onUpdate:(e,n,s,t)=>{Ke(e,n,s,t)},onArchive:Fe,pendingSensorIndices:Ae,isActionCoolingDown:ke,isArchiveCoolingDown:Oe,canModifyOwner:R,canArchive:R,canViewArchiveHistory:R,canUseTableView:R,showUnregisteredNotice:R,onExportTable:Ve,selection:le,selectionModeVisible:ee,onSelectionModeChange:ne})]}),'detail'===ge&&null!==pe&&(0,N.jsx)(f.DetailView,{detail:pe,onBack:$e,onUpdate:(e,n,s,t)=>{Ke(e,n,s,t)},onArchive:Fe,onReRegister:We,isPending:Ae.has(pe.sensor.sensorIndex),isActionCoolingDown:(e,n)=>ke(pe.sensor.sensorIndex,e,n),isArchiveCoolingDown:Oe(pe.sensor.sensorIndex),canModifyOwner:R,canArchive:R}),'public-detail'===ge&&null!==ye&&(0,N.jsx)(y.PublicDetailView,{detail:ye,onBack:$e})]})]})};var n=r(d[0]),s=e(r(d[1]));r(d[2]);var t=e(r(d[3])),o=e(r(d[4])),c=r(d[5]),l=r(d[6]),u=r(d[7]),S=r(d[8]),h=r(d[9]),f=r(d[10]),p=r(d[11]),b=r(d[12]),y=r(d[13]),w=r(d[14]),T=r(d[15]),x=r(d[16]),v=r(d[17]),C=r(d[18]),M=r(d[19]),A=r(d[20]),E=r(d[21]),R=r(d[22]),I=r(d[23]),_=r(d[24]),D=r(d[25]),k=r(d[26]),O=r(d[27]),P=r(d[28]),N=r(d[29]);const V=500;function j(e){const n=e.split('\n').map(e=>e.trim()).filter(e=>e.length>0);return{canonicalText:n.join('\n'),terms:n}}function L(e,n,s){switch(n){case'SET_SHARE_KEYS':case'CLEAR_SHARE_KEYS':return`${e}:share-keys`;case'SET_DOWNGRADED':case'CLEAR_DOWNGRADED':return`${e}:downgrade-${s??'A'}`;case'SET_ACTIVE_FIRMWARE_TARGET':case'SET_OWNER':case'SET_BRIGHTNESS':case'SET_LED_MODE':case'VERIFY_LOCATION':return`${e}:${n}`;default:return n}}async function U(e){const n=e?.trim()??'',t=`Archive ${''!==n?n:'this sensor'}? Historical details remain available to the current owner, but this record will no longer receive new reports from the device.`;return'undefined'!=typeof window?window.confirm(t):new Promise(e=>{s.default.alert('Archive sensor?',t,[{onPress:()=>{e(!1)},style:'cancel',text:'Cancel'},{onPress:()=>{e(!0)},style:'destructive',text:'Archive'}])})}const G=(0,c.createStyles)({container:{alignSelf:'center',maxWidth:1080,paddingHorizontal:R.SPACING.XXL,paddingVertical:R.SPACING.XL,width:'100%'},searchSectionHeader:{borderTopColor:E.COLORS.BORDER,borderTopWidth:1,marginTop:R.SPACING.XL,paddingTop:R.SPACING.LG},searchSectionTitle:{color:E.COLORS.TEXT_HEADING,fontSize:I.FONT_SIZE.LG,fontWeight:'600'}})},1113,[34,520,95,222,276,489,1187,411,680,568,1132,1148,1149,1178,1179,1181,1182,1183,1184,496,565,490,493,494,1188,562,505,468,469,104]); 2__d(function(g,r,i,a,m,_e,d){"use strict";
2function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DetailView=function({detail:e,onBack:l,onUpdate:c,onArchive:h,onReRegister:_,isPending:M,isActionCoolingDown:L=()=>!1,isArchiveCoolingDown:N=!1,canModifyOwner:P,canArchive:G=!1}){const{sensor:B,history:H}=e,{isPhone:F}=(0,S.useResponsive)(),[W,k]=(0,f.useServerReconciledTextInput)(B.configuredFirmwareTarget??''),[V,K]=(0,f.useServerReconciledTextInput)(B.ownerEmail??''),[z,X]=(0,f.useServerReconciledTextInput)(null!=B.brightness?String(B.brightness):''),Y=B.ownerEmail?.trim()??'',U=B.firmwareVersion?.trim()??'',Z=B.readKey?.trim()??'',$=B.mac?.trim()??'',q=''!==Z?' using the sensor index below. Accessing any data reported while the sensor was private also requires the sensor read key.':' using the sensor index below.';return(0,j.jsxs)(E.SensorDetailCard,{sensorLabel:B.label,sensorModel:B.model,sensorIndex:B.sensorIndex,onlineStatus:B.onlineStatus,badges:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(E.HeaderBadge,{label:(0,D.formatVisibility)(B.hidden),variant:B.hidden?'neutral':'success'}),B.archived&&(0,j.jsx)(E.HeaderBadge,{label:"Archived",variant:"warning"})]}),onBack:l,headline:(0,j.jsx)(b.SensorAqiHeadline,{pm25:B.pm25,size:"lg",offline:!B.archived&&(0,D.isSensorOffline)(B.onlineStatus)}),headerActions:(0,j.jsxs)(j.Fragment,{children:[void 0!==_&&!B.archived&&''!==$&&(0,j.jsx)(T.ActionButton,{label:"Re-register Sensor",variant:"primary",onPress:()=>{_($)},disabled:M}),(0,j.jsx)(y.SensorMapLink,{sensor:B})]}),children:[B.archived&&(0,j.jsx)(v,{isPhone:F}),(0,j.jsxs)(T.DetailSection,{title:"Readings",children:[(0,j.jsx)(A.ChannelReadingsBand,{sensor:B,isPending:M,isChannelCoolingDown:e=>{const n='A'===e?B.downgraded:!0===B.channelB?.downgraded;return L(n?'CLEAR_DOWNGRADED':'SET_DOWNGRADED',e)},edgeToEdge:!0,onToggleDowngrade:B.archived&&!P?null:e=>{const n='A'===e?B.downgraded:!0===B.channelB?.downgraded;c(B.sensorIndex,n?'CLEAR_DOWNGRADED':'SET_DOWNGRADED',void 0,e)}}),(0,j.jsx)(C.ReadingsSupplement,{gas:B.gas,confidencePercent:B.confidencePercent,particleRatioHigh:B.particleRatioHigh})]}),(0,j.jsxs)(E.DetailInfoGrid,{children:[(0,j.jsx)(T.DetailSection,{title:"Status",children:(0,j.jsx)(T.DetailFieldList,{children:(0,p.buildManagedDetailStatusRows)(B,{lastModifiedMinutesAgo:e.lastModifiedMinutesAgo,lastUpdateCheckMinutesAgo:e.lastUpdateCheckMinutesAgo}).map(e=>(0,j.jsx)(T.DetailField,{label:e.label,value:e.value},e.label))})}),(0,j.jsx)(T.DetailSection,{title:"Hardware",children:(0,j.jsx)(T.DetailFieldList,{children:(0,p.buildManagedDetailHardwareRows)(B).map(e=>(0,j.jsx)(T.DetailField,{label:e.label,value:e.value},e.label))})}),(0,j.jsx)(T.DetailSection,{title:"Location",children:(0,j.jsx)(T.DetailFieldList,{children:(0,p.buildManagedDetailLocationRows)(B,e.positionCheckedMinutesAgo).map(e=>(0,j.jsx)(T.DetailField,{label:e.label,value:e.value},e.label))})})]}),(0,j.jsxs)(T.DetailSection,{title:"API Access",children:[(0,j.jsxs)(t.default,{style:w.apiAccessHint,selectable:!0,children:["Read this sensor's data from the ",(0,j.jsx)(x.AppLink,{to:"API",inline:!0,accessibilityLabel:"PurpleAir API documentation",testID:"api-page-link",textStyle:w.apiPageLink,children:"PurpleAir API"}),q]}),(0,j.jsxs)(s.default,{style:T.sharedStyles.cardRow,children:[(0,j.jsx)(T.InfoItem,{label:"Sensor Index",value:String(B.sensorIndex)}),''!==Z&&(0,j.jsx)(T.InfoItem,{label:"Sensor Read Key",value:Z})]})]}),!B.archived&&(0,j.jsxs)(T.DetailSection,{title:"Management Actions",children:[M&&(0,j.jsxs)(s.default,{style:w.pendingBanner,children:[(0,j.jsx)(n.default,{color:o.COLORS.TEXT_MUTED,size:"small"}),(0,j.jsx)(t.default,{style:w.pendingBannerText,selectable:!0,children:"Updating sensor..."})]}),(0,j.jsxs)(s.default,{style:w.managementStack,children:[(0,j.jsx)(s.default,{style:w.managementFields,children:(0,j.jsxs)(O.ManagementInputGrid,{children:[P?(0,j.jsx)(O.ManagementInputRow,{label:"Owner",value:V,onChangeText:K,placeholder:"[email protected]",isPending:M,setDisabled:L('SET_OWNER'),onSet:()=>{c(B.sensorIndex,'SET_OWNER',V)},setVariant:"default",width:"wide"}):(0,j.jsx)(O.ReadOnlyManagementRow,{label:"Owner",value:''!==Y?Y:'N/A',width:"wide"}),P?(0,j.jsx)(O.ManagementInputRow,{label:"Firmware",value:W,onChangeText:k,placeholder:"e.g. 7.04",isPending:M,setDisabled:L('SET_ACTIVE_FIRMWARE_TARGET'),onSet:()=>{c(B.sensorIndex,'SET_ACTIVE_FIRMWARE_TARGET',W.trim())},setVariant:"admin",width:"medium"}):(0,j.jsx)(O.ReadOnlyManagementRow,{label:"Firmware",value:''!==U?U:'N/A',width:"medium"}),(0,j.jsx)(O.ManagementInputRow,{label:"Brightness",value:z,onChangeText:X,placeholder:"0-100",keyboardType:"numeric",isPending:M,setDisabled:L('SET_BRIGHTNESS'),onSet:()=>{c(B.sensorIndex,'SET_BRIGHTNESS',z)},setVariant:"default",width:"narrow"}),(0,j.jsx)(s.default,{style:w.ledModeInputRow,children:(0,j.jsx)(I.LedModeManagementControl,{ledMode:B.ledMode,isPending:M,isSetCoolingDown:L('SET_LED_MODE'),onSet:e=>{c(B.sensorIndex,'SET_LED_MODE',e)}})})]})}),(0,j.jsxs)(s.default,{style:w.managementActionRow,children:[(0,j.jsx)(T.ActionButton,{label:B.shareKeys?'Disable Share Keys':'Enable Share Keys',onPress:()=>{c(B.sensorIndex,B.shareKeys?'CLEAR_SHARE_KEYS':'SET_SHARE_KEYS')},disabled:M||L(B.shareKeys?'CLEAR_SHARE_KEYS':'SET_SHARE_KEYS')}),P&&(0,j.jsx)(T.ActionButton,{label:"Verify Location",variant:"admin",onPress:()=>{c(B.sensorIndex,'VERIFY_LOCATION')},disabled:M||L('VERIFY_LOCATION')}),G&&void 0!==h&&(0,j.jsx)(T.ActionButton,{label:"Archive Sensor",variant:"danger",onPress:()=>{h(B.sensorIndex,B.label)},disabled:M||N})]})]})]}),B.archiveHistory.length>0&&(0,j.jsx)(R.ArchiveHistoryGrid,{archiveHistory:B.archiveHistory}),H.length>0&&(0,j.jsx)(T.DetailSection,{title:"Sensor History",children:(0,j.jsx)(s.default,{style:w.historyList,children:H.map(e=>(0,j.jsxs)(s.default,{style:[w.historyItem,e.isCurrent&&w.historyItemCurrent],children:[(0,j.jsx)(t.default,{style:[w.historyLabel,e.isCurrent&&w.historyLabelCurrent],selectable:!0,children:e.label}),(0,j.jsxs)(t.default,{style:w.historyMeta,selectable:!0,children:["Sensor index: ",e.sensorIndex,null!=e.created&&''!==e.created?` | Created: ${(0,u.formatIsoDateShort)(e.created)}`:'']})]},String(e.sensorIndex)))})}),e.auditLog.length>0&&(0,j.jsx)(T.DetailSection,{title:"Change History",children:(0,j.jsx)(s.default,{style:w.auditList,children:e.auditLog.map((e,n)=>(0,j.jsx)(T.AuditEntryRow,{entry:e},`${e.createdAt}-${e.actorIdentifier??'system'}-${String(n)}`))})})]})},r(d[0]);var n=e(r(d[1])),t=e(r(d[2])),s=e(r(d[3])),l=r(d[4]),o=r(d[5]),c=r(d[6]),h=r(d[7]),S=r(d[8]),u=r(d[9]),x=r(d[10]),R=r(d[11]),A=r(d[12]),I=r(d[13]),C=r(d[14]),b=r(d[15]),E=r(
2d[16]),p=r(d[17]),D=r(d[18]),O=r(d[19]),y=r(d[20]),T=r(d[21]),f=r(d[22]),j=r(d[23]);function v({isPhone:e}){return(0,j.jsxs)(s.default,{style:[w.archivedNotice,e&&w.archivedNoticePhone],children:[(0,j.jsx)(t.default,{style:w.archivedNoticeTitle,selectable:!0,children:"Archived"}),(0,j.jsx)(t.default,{style:w.archivedNoticeText,selectable:!0,children:"This archived sensor no longer receives new readings."})]})}const w=(0,l.createStyles)({apiAccessHint:{color:o.COLORS.TEXT_BODY,fontSize:h.FONT_SIZE.SM,lineHeight:20,marginBottom:c.SPACING.LG},apiPageLink:{color:o.COLORS.BRAND_PRIMARY,fontWeight:'600'},archivedNotice:{backgroundColor:o.COLORS.WARNING_BG,borderBottomColor:o.COLORS.BORDER,borderBottomWidth:1,gap:c.SPACING.MICRO,paddingHorizontal:c.SPACING.XXL,paddingVertical:c.SPACING.MD},archivedNoticePhone:{paddingHorizontal:c.SPACING.LG},archivedNoticeText:{color:o.COLORS.TEXT_BODY,fontSize:h.FONT_SIZE.SM},archivedNoticeTitle:{color:o.COLORS.WARNING_DARK,fontSize:h.FONT_SIZE.MD,fontWeight:'700'},auditList:{gap:c.SPACING.SM},historyItem:{backgroundColor:o.COLORS.BG_WASH,borderRadius:6,paddingHorizontal:c.SPACING.MD,paddingVertical:c.SPACING.SM},historyItemCurrent:{backgroundColor:o.COLORS.SUCCESS_BG,borderColor:o.COLORS.GREEN_300,borderWidth:1},historyLabel:{color:o.COLORS.TEXT_HEADING,fontSize:h.FONT_SIZE.MD},historyLabelCurrent:{fontWeight:'600'},historyList:{gap:c.SPACING.XS},historyMeta:{color:o.COLORS.TEXT_MUTED,fontSize:h.FONT_SIZE.XS,marginTop:c.SPACING.MICRO},ledModeInputRow:{flexBasis:520,flexGrow:1,flexShrink:1,minWidth:0},managementActionRow:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:c.SPACING.SM},managementFields:{backgroundColor:o.COLORS.BG_WASH,borderColor:o.COLORS.BORDER,borderRadius:10,borderWidth:1,padding:c.SPACING.LG},managementStack:{gap:c.SPACING.LG},pendingBanner:{alignItems:'center',backgroundColor:o.COLORS.BG_WASH,borderRadius:6,flexDirection:'row',gap:c.SPACING.SM,marginBottom:c.SPACING.MD,padding:c.SPACING.SM},pendingBannerText:{color:o.COLORS.TEXT_MUTED,fontSize:h.FONT_SIZE.SM,fontStyle:'italic'}})},1132,[34,410,222,276,489,490,493,494,553,685,516,1133,1136,1138,1139,1142,1144,1145,1140,1146,1079,1081,1147,104]); 3__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ArchiveHistoryGrid=function({archiveHistory:e,selection:s}){const[c,h]=(0,l.useState)(!1),{isPhone:S}=(0,v.useResponsive)();if(0===e.length)return null;const u=c?e:e.slice(0,T),f=e.length-T,x=(0,O.buildExternalMultiSensorMapPath)(e.map(y.toArchiveHistoryMapTarget)),I=`${String(e.length)} archived sensor location`+(1===e.length?'':'s');return(0,M.jsxs)(o.default,{style:w.archiveHistoryBand,children:[(0,M.jsxs)(o.default,{style:w.archiveHistoryHeader,children:[(0,M.jsx)(t.default,{style:w.sectionTitle,selectable:!0,children:"Archive History"}),'ready'===x.status&&(0,M.jsx)(C.ServiceExternalLink,{service:"mapBaseUrl",path:x.path,accessibilityLabel:`View all ${I} on map`,style:w.historyMapLink,textStyle:w.historyMapLinkText,children:"View history on map"})]}),(0,M.jsxs)(o.default,{style:w.archiveHistoryList,children:[!S&&(0,M.jsxs)(o.default,{style:w.archiveGridHeader,children:[null!=s&&(0,M.jsx)(t.default,{style:[w.archiveColumnHeader,w.archiveSelectionCell],selectable:!0,children:"Select"}),(0,M.jsx)(t.default,{style:[w.archiveColumnHeader,w.archiveIndexCell],selectable:!0,children:"Index"}),(0,M.jsx)(t.default,{style:[w.archiveColumnHeader,w.archiveVisibilityCell],selectable:!0,children:"Visibility"}),(0,M.jsx)(t.default,{style:[w.archiveColumnHeader,w.archiveNameCell],selectable:!0,children:"Name"}),(0,M.jsx)(t.default,{style:[w.archiveColumnHeader,w.archiveOwnerCell],selectable:!0,children:"Owner"}),(0,M.jsx)(t.default,{style:[w.archiveColumnHeader,w.archiveDateCell],selectable:!0,children:"Active dates"}),(0,M.jsx)(t.default,{style:[w.archiveColumnHeader,w.archiveAgoCell],selectable:!0,children:"Archived"}),(0,M.jsx)(t.default,{style:[w.archiveColumnHeader,w.archiveMapCell,w.archiveMapColumnText],selectable:!0,children:"Map"})]}),u.map(e=>S?(0,M.jsx)(p,Object.assign({entry:e},null!=s?{selection:s}:{}),`${String(e.sensorIndex)}-${e.mac??''}`):(0,M.jsx)(b,Object.assign({entry:e},null!=s?{selection:s}:{}),`${String(e.sensorIndex)}-${e.mac??''}`))]}),f>0&&(0,M.jsx)(n.default,{style:w.archiveHistoryToggle,onPress:()=>{h(e=>!e)},children:(0,M.jsx)(t.default,{style:w.archiveHistoryToggleText,children:c?'Show fewer':`Show ${String(f)} more`})})]})};var l=r(d[0]);r(d[1]);var t=e(r(d[2])),n=e(r(d[3])),o=e(r(d[4])),s=r(d[5]),c=r(d[6]),h=r(d[7]),S=r(d[8]),u=r(d[9]),v=r(d[10]),f=r(d[11]),x=r(d[12]),C=r(d[13]),y=r(d[14]),O=r(d[15]),M=r(d[16]);const T=3;function b({entry:e,selection:l}){return(0,M.jsxs)(o.default,{style:w.archiveRow,children:[null!=l&&(0,M.jsx)(A,{entry:e,selection:l}),(0,M.jsx)(E,{value:String(e.sensorIndex),style:[w.archiveSensorIndex,w.archiveIndexCell]}),(0,M.jsx)(E,{value:_(e.hidden),style:[w.archiveVisibility,w.archiveVisibilityCell]}),(0,M.jsx)(E,{value:H(e),style:[w.archiveSensorLabel,w.archiveNameCell],numberOfLines:2}),(0,M.jsx)(E,{value:P(e.ownerEmail),style:[w.archiveOwnerEmail,w.archiveOwnerCell],numberOfLines:2}),(0,M.jsx)(E,{value:L(e),style:[w.archiveDateRange,w.archiveDateCell]}),(0,M.jsx)(E,{value:R(e.archivedAt),style:[w.archiveRelativeTime,w.archiveAgoCell]}),(0,M.jsx)(I,{entry:e})]})}function p({entry:e,selection:l}){return(0,M.jsxs)(o.default,{style:w.archiveCardPhone,children:[(0,M.jsxs)(o.default,{style:w.archiveCardHeaderPhone,children:[null!=l&&(0,M.jsx)(A,{entry:e,selection:l}),(0,M.jsx)(t.default,{style:[w.archiveSensorLabel,w.archiveCardLabelPhone],numberOfLines:2,selectable:!0,children:H(e)}),(0,M.jsx)(t.default,{style:w.archiveRelativeTime,selectable:!0,children:R(e.archivedAt)})]}),(0,M.jsx)(j,{label:"Sensor index",value:String(e.sensorIndex),valueIsMonospace:!0}),(0,M.jsx)(j,{label:"Visibility",value:_(e.hidden)}),(0,M.jsx)(j,{label:"Owner",value:P(e.ownerEmail),numberOfLines:2}),(0,M.jsx)(j,{label:"Active",value:L(e)}),(0,M.jsx)(I,{entry:e})]})}function I({entry:e}){const l=(0,O.buildExternalMultiSensorMapPath)([(0,y.toArchiveHistoryMapTarget)(e)]);if('ready'!==l.status)return(0,M.jsx)(t.default,{style:[w.archiveMapUnavailable,w.archiveMapCell,w.archiveMapColumnText],children:"Map unavailable"});const n=`View ${H(e)} archived location on map`;return(0,M.jsx)(C.ServiceExternalLink,{service:"mapBaseUrl",path:l.path,accessibilityLabel:n,style:[w.archiveMapCell,w.archiveMapAction],textStyle:w.archiveMapLinkText,children:"Map"})}function A({entry:e,selection:l}){const t=(0,y.isArchiveHistoryMapTargetSelectable)(e);return(0,M.jsx)(o.default,{style:w.archiveSelectionCell,children:(0,M.jsx)(s.SelectionCheckbox,{checked:l.selectedMapTargetIndices.has(e.sensorIndex),accessibilityLabel:`Select ${H(e)} archived location (sensor ${String(e.sensorIndex)})`,disabled:!t,onPress:()=>{l.onToggle(e)}})})}function j({label:e,value:l,numberOfLines:n=1,valueIsMonospace:s=!1}){return(0,M.jsxs)(o.default,{style:w.archiveCardMetaRowPhone,children:[(0,M.jsx)(t.default,{style:w.archiveCardMetaLabelPhone,selectable:!0,children:e}),(0,M.jsx)(t.default,{style:[w.archiveCardMetaValuePhone,s&&w.archiveCardMetaValueMonoPhone],numberOfLines:n,selectable:!0,children:l})]})}function E({value:e,style:l,numberOfLines:n=1}){return(0,M.jsx)(x.HoverTooltip,{text:e,children:(0,M.jsx)(t.default,{style:l,numberOfLines:n,selectable:!0,children:e})})}function L(e){const l=N(e.created),t=N(e.archivedAt);return null!==l&&null!==t?`${l} - ${t}`:null!==t?`Archived ${t}`:null!==l?`Created ${l}`:'Archive dates unavailable'}
3function N(e){return null==e||''===e.trim()?null:(0,f.formatIsoDateShort)(e)}function R(e){return null==e||''===e.trim()?'Time unavailable':(0,f.formatTimeAgo)(e)}function P(e){const l=e?.trim()??'';return''!==l?l:'Owner unknown'}function H(e){const l=e.label?.trim()??'';return''!==l?l:'Unnamed archived sensor'}function _(e){return e?'Private':'Public'}const w=(0,c.createStyles)({archiveAgoCell:{flexBasis:116,flexGrow:0,flexShrink:0},archiveCardHeaderPhone:{alignItems:'center',flexDirection:'row',gap:S.SPACING.SM,justifyContent:'space-between',marginBottom:S.SPACING.XS},archiveCardLabelPhone:{flexShrink:1,minWidth:0},archiveCardMetaLabelPhone:{color:h.COLORS.TEXT_MUTED,flexBasis:96,flexGrow:0,flexShrink:0,fontSize:u.FONT_SIZE.XS,fontWeight:'600',letterSpacing:.3,textTransform:'uppercase'},archiveCardMetaRowPhone:{alignItems:'baseline',flexDirection:'row',gap:S.SPACING.SM,paddingVertical:S.SPACING.MICRO},archiveCardMetaValueMonoPhone:{fontFamily:u.FONT_FAMILY.WEB_MONOSPACE},archiveCardMetaValuePhone:{color:h.COLORS.TEXT_BODY,flexShrink:1,fontSize:u.FONT_SIZE.SM,fontWeight:'500',minWidth:0},archiveCardPhone:{backgroundColor:h.COLORS.TEXT_INVERSE,borderColor:h.COLORS.BORDER,borderRadius:6,borderWidth:1,paddingHorizontal:S.SPACING.MD,paddingVertical:S.SPACING.SM},archiveColumnHeader:{color:h.COLORS.TEXT_MUTED,fontSize:u.FONT_SIZE.XS,fontWeight:'700',letterSpacing:.4,textTransform:'uppercase'},archiveDateCell:{flexBasis:190,flexGrow:0,flexShrink:0},archiveDateRange:{color:h.COLORS.TEXT_BODY,fontSize:u.FONT_SIZE.SM,fontWeight:'500'},archiveGridHeader:{alignItems:'center',flexDirection:'row',gap:S.SPACING.MD,paddingHorizontal:S.SPACING.MD},archiveHistoryBand:{backgroundColor:h.COLORS.BG_WASH,gap:S.SPACING.SM,paddingHorizontal:S.SPACING.LG,paddingVertical:S.SPACING.MD},archiveHistoryHeader:{alignItems:'center',flexDirection:'row',gap:S.SPACING.MD,justifyContent:'space-between'},archiveHistoryList:{gap:S.SPACING.XS},archiveHistoryToggle:Object.assign({alignSelf:'center',flexShrink:0,paddingHorizontal:S.SPACING.SM,paddingVertical:S.SPACING.XS},{cursor:'pointer'}),archiveHistoryToggleText:{color:h.COLORS.ACTION_PRIMARY,fontSize:u.FONT_SIZE.SM,fontWeight:'700'},archiveIndexCell:{flexBasis:64,flexGrow:0,flexShrink:0},archiveMapAction:{alignItems:'center',justifyContent:'center',minHeight:44},archiveMapCell:{flexBasis:76,flexGrow:0,flexShrink:0},archiveMapColumnText:{textAlign:'center'},archiveMapLinkText:{color:h.COLORS.BRAND_PRIMARY_DARK,fontSize:u.FONT_SIZE.SM,fontWeight:'600',textAlign:'center'},archiveMapUnavailable:{color:h.COLORS.TEXT_MUTED,fontSize:u.FONT_SIZE.XS},archiveNameCell:{flexBasis:170,flexGrow:2,flexShrink:1,minWidth:0},archiveOwnerCell:{flexBasis:210,flexGrow:2,flexShrink:1,minWidth:0},archiveOwnerEmail:{color:h.COLORS.TEXT_BODY,fontSize:u.FONT_SIZE.SM},archiveRelativeTime:{color:h.COLORS.TEXT_MUTED,flexShrink:0,fontSize:u.FONT_SIZE.SM},archiveSelectionCell:{alignItems:'center',flexBasis:48,flexGrow:0,flexShrink:0,justifyContent:'center'},archiveRow:{alignItems:'center',backgroundColor:h.COLORS.TEXT_INVERSE,borderColor:h.COLORS.BORDER,borderRadius:6,borderWidth:1,flexDirection:'row',gap:S.SPACING.MD,paddingHorizontal:S.SPACING.MD,paddingVertical:S.SPACING.SM},archiveSensorIndex:{color:h.COLORS.TEXT_HEADING,flexShrink:0,fontFamily:u.FONT_FAMILY.WEB_MONOSPACE,fontSize:u.FONT_SIZE.SM,fontWeight:'700'},archiveSensorLabel:{color:h.COLORS.TEXT_HEADING,fontSize:u.FONT_SIZE.SM,fontWeight:'700'},archiveVisibility:{color:h.COLORS.TEXT_BODY,flexShrink:0,fontSize:u.FONT_SIZE.SM,fontWeight:'600'},archiveVisibilityCell:{flexBasis:76,flexGrow:0,flexShrink:0},historyMapLink:{alignItems:'center',flexShrink:0,justifyContent:'center',minHeight:44,paddingHorizontal:S.SPACING.XS,paddingVertical:S.SPACING.MICRO},historyMapLinkText:{color:h.COLORS.BRAND_PRIMARY_DARK,fontSize:u.FONT_SIZE.SM,fontWeight:'600'},sectionTitle:{color:h.COLORS.TEXT_BODY,fontSize:u.FONT_SIZE.XS,fontWeight:'700',letterSpacing:.5,marginBottom:S.SPACING.XS,textTransform:'uppercase'}})},1133,[34,95,222,488,276,1134,489,490,493,494,553,685,686,522,1135,1080,104]); 4__d(function(g,r,i,a,m,_e,d){"use strict";
4function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.SelectionCheckbox=function({checked:e,accessibilityLabel:n,onPress:c,visibleLabel:s,disabled:b=!1}){const h=!0===e||'mixed'===e;return(0,u.jsxs)(l.default,{accessibilityRole:"checkbox",accessibilityLabel:n,accessibilityState:{checked:e,disabled:b},disabled:b,onPress:c,style:[S.control,b&&S.controlDisabled],children:[(0,u.jsx)(o.default,{style:[S.box,h&&S.boxActive],children:h&&(0,u.jsx)(t.default,{style:S.mark,children:'mixed'===e?'\u2212':'\u2713'})}),null!=s&&(0,u.jsx)(t.default,{style:S.label,children:s})]})},r(d[0]);var t=e(r(d[1])),l=e(r(d[2])),o=e(r(d[3])),n=r(d[4]),c=r(d[5]),s=r(d[6]),b=r(d[7]),u=r(d[8]);const S=(0,b.createStyles)({box:{alignItems:'center',borderColor:n.COLORS.BORDER_DEFAULT,borderRadius:4,borderWidth:2,height:20,justifyContent:'center',width:20},boxActive:{backgroundColor:n.COLORS.ACTION_PRIMARY,borderColor:n.COLORS.ACTION_PRIMARY},control:{alignItems:'center',flexDirection:'row',gap:c.SPACING.XS,justifyContent:'center',minHeight:44,minWidth:44,paddingHorizontal:c.SPACING.XS},controlDisabled:{opacity:.45},label:{color:n.COLORS.TEXT_BODY,fontSize:s.FONT_SIZE.SM,fontWeight:'600'},mark:{color:n.COLORS.TEXT_INVERSE,fontSize:s.FONT_SIZE.SM,fontWeight:'700',lineHeight:16}})},1134,[34,222,488,276,490,493,494,489,104]); 5__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.toArchiveHistoryMapTarget=n,e.isArchiveHistoryMapTargetSelectable=function(o){return'ready'===(0,t.buildExternalMultiSensorMapPath)([n(o)]).status};var t=r(d[0]);function n(t){return{archived:!0,hidden:t.hidden,lat:t.lat,locationType:t.locationType,lon:t.lon,readKey:t.readKey,sensorIndex:t.sensorIndex}}},1135,[1080]); 6__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ChannelReadingsBand=function({sensor:e,isPending:n,isChannelCoolingDown:t,onToggleDowngrade:o,edgeToEdge:c=!1}){const h=e.channelB,s=O(h),u=B(e.pm25),f=s&&null!==h?B(h.pm25):null,p=I(null===f?[u]:[u,f]),R=null===o?null:()=>{o('A')},T=null===o?null:()=>{o('B')};return(0,S.jsxs)(l.default,{style:[w.readingsBand,c&&w.readingsBandEdgeToEdge],children:[(0,S.jsx)(C,{label:"Channel A",pm25:e.pm25,pm25Reading:u,pm25ColumnWidth:p,temperature:e.temperature,humidity:e.humidity,downgraded:e.downgraded,isPending:n,isCoolingDown:t?.('A')??!1,onToggleDowngrade:R,edgeToEdge:c}),s&&null!==h&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(x,{}),(0,S.jsx)(C,{label:"Channel B",pm25:h.pm25,pm25Reading:f??B(h.pm25),pm25ColumnWidth:p,temperature:h.temperature,humidity:h.humidity,downgraded:h.downgraded,isPending:n,isCoolingDown:t?.('B')??!1,onToggleDowngrade:T,edgeToEdge:c})]})]})};var n=e(r(d[0])),l=e(r(d[1])),t=r(d[2]),o=r(d[3]),c=r(d[4]),h=r(d[5]),s=r(d[6]),u=r(d[7]),f=r(d[8]),p=r(d[9]),S=r(d[10]);function x(){return(0,S.jsx)(l.default,{style:w.channelSeparator})}function C({label:e,pm25:t,pm25Reading:o,pm25ColumnWidth:c,temperature:h,humidity:u,downgraded:x,isPending:C,isCoolingDown:P,onToggleDowngrade:y,edgeToEdge:A}){const{isPhone:B}=(0,s.useResponsive)(),I=(0,f.pm25ToAqi)(t);return(0,S.jsxs)(l.default,{style:[w.channelRow,A&&w.channelRowEdgeToEdge,B&&w.channelRowPhone],children:[(0,S.jsxs)(l.default,{style:[w.channelIdentity,B&&w.channelIdentityPhone],children:[(0,S.jsx)(n.default,{style:w.channelLabel,selectable:!0,children:e}),(0,S.jsx)(R,{aqi:I})]}),(0,S.jsxs)(l.default,{style:[w.channelBody,B&&w.channelBodyPhone],children:[(0,S.jsxs)(l.default,{style:[w.channelReadings,B&&w.channelReadingsPhone],children:[(0,S.jsx)(n.default,{style:[w.channelReadingCell,w.channelPmReading,B?w.channelPmReadingPhone:{flexBasis:c}],numberOfLines:1,selectable:!0,children:o}),(0,S.jsx)(n.default,{style:[w.channelReadingCell,w.channelTemperatureReading,B&&w.channelTemperatureReadingPhone],numberOfLines:1,selectable:!0,children:null===h?'':`${String(h)}\xb0F`}),(0,S.jsx)(n.default,{style:[w.channelReadingCell,w.channelHumidityReading,B&&w.channelHumidityReadingPhone],numberOfLines:1,selectable:!0,children:null===u?'':`${String(u)}%`})]}),x&&(0,S.jsx)(T,{}),null!==y&&(0,S.jsx)(l.default,{style:w.channelAction,children:(0,S.jsx)(p.ActionButton,{label:
6x?'Restore Channel':'Downgrade Channel',onPress:y,variant:x?'neutralStrong':'warning',disabled:C||P,style:w.channelActionButton})})]})]})}function R({aqi:e}){if(null===e)return(0,S.jsx)(u.HoverTooltip,{text:f.AQI_TOOLTIP_TEXT,children:(0,S.jsx)(l.default,{style:[w.channelAqiBadge,w.channelAqiBadgeEmpty],children:(0,S.jsx)(n.default,{style:w.channelAqiBadgeEmptyText,selectable:!0,children:"-"})})});const t=(0,f.getAqiColor)(e),o=(0,f.getAqiOnColor)(e);return(0,S.jsx)(u.HoverTooltip,{text:f.AQI_TOOLTIP_TEXT,children:(0,S.jsx)(l.default,{style:[w.channelAqiBadge,{backgroundColor:t}],children:(0,S.jsx)(n.default,{style:[w.channelAqiBadgeText,{color:o}],selectable:!0,children:String(e)})})})}function T(){return(0,S.jsx)(l.default,{style:w.chipWarning,children:(0,S.jsx)(n.default,{style:w.chipTextWarning,selectable:!0,children:"Downgraded"})})}function P(e){return null===e?'N/A':String(e)}const y=124,A=8;function B(e){return`PM2.5: ${P(e)} \xb5g/m\xb3`}function I(e){const n=Math.max(...e.map(e=>e.length));return Math.max(y,Math.ceil(n*A))}function O(e){return null!==e&&(null!==e.pm25||null!==e.temperature||null!==e.humidity||e.downgraded)}const w=(0,t.createStyles)({channelAction:{marginLeft:'auto'},channelActionButton:{alignItems:'center',width:144},channelAqiBadge:{alignItems:'center',borderRadius:4,justifyContent:'center',minWidth:44,paddingHorizontal:c.SPACING.SM,paddingVertical:c.SPACING.MICRO},channelAqiBadgeEmpty:{backgroundColor:o.COLORS.BG_SUBTLE_100},channelAqiBadgeEmptyText:{color:o.COLORS.TEXT_MUTED,fontSize:h.FONT_SIZE.SM,fontWeight:'600'},channelAqiBadgeText:{fontSize:h.FONT_SIZE.SM,fontVariant:['tabular-nums'],fontWeight:'700'},channelLabel:{color:o.COLORS.TEXT_MUTED,fontSize:h.FONT_SIZE.XS,fontWeight:'700',letterSpacing:.5,textTransform:'uppercase'},channelBody:{alignItems:'center',flex:1,flexDirection:'row',flexWrap:'wrap',gap:c.SPACING.MD,minWidth:0},channelBodyPhone:{flexBasis:'100%'},channelHumidityReading:{flexBasis:36,flexGrow:0,flexShrink:0,marginLeft:c.SPACING.XS},channelHumidityReadingPhone:{flexBasis:'auto',marginLeft:0},channelIdentity:{alignItems:'center',flexDirection:'row',gap:c.SPACING.MD,minWidth:152},channelIdentityPhone:{minWidth:0},channelPmReading:{flexGrow:0,flexShrink:0},channelPmReadingPhone:{flexBasis:'auto'},channelReadingCell:{color:o.COLORS.TEXT_BODY,fontSize:h.FONT_SIZE.SM,fontVariant:['tabular-nums'],fontWeight:'500'},channelReadings:{alignItems:'center',flex:1,flexDirection:'row',gap:c.SPACING.XS,minWidth:0},channelReadingsPhone:{columnGap:c.SPACING.MD,flexWrap:'wrap',rowGap:c.SPACING.XS},channelTemperatureReading:{flexBasis:36,flexGrow:0,flexShrink:0},channelTemperatureReadingPhone:{flexBasis:'auto'},channelRow:{alignItems:'center',backgroundColor:o.COLORS.TEXT_INVERSE,flexDirection:'row',flexWrap:'wrap',gap:c.SPACING.MD,paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.SM},channelRowEdgeToEdge:{paddingHorizontal:c.SPACING.XL},channelRowPhone:{gap:c.SPACING.SM,paddingHorizontal:c.SPACING.MD},channelSeparator:{backgroundColor:o.COLORS.BORDER,height:1},chipTextWarning:{color:o.COLORS.WARNING_DARK,fontSize:h.FONT_SIZE.XS,fontWeight:'600',letterSpacing:.3,textTransform:'uppercase'},chipWarning:{backgroundColor:o.COLORS.WARNING_BG,borderRadius:3,paddingHorizontal:c.SPACING.SM,paddingVertical:c.SPACING.MICRO},readingsBand:{borderBottomColor:o.COLORS.BORDER,borderBottomWidth:1,borderTopColor:o.COLORS.BORDER,borderTopWidth:1},readingsBandEdgeToEdge:{marginHorizontal:-c.SPACING.XL}})},1136,[222,276,489,490,493,494,553,686,1137,1081,104]); 7__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AQI_TOOLTIP_TEXT",{enumerable:!0,get:function(){return O}}),e.pm25ToAqi=function(o){if(null==o||!Number.isFinite(o)||o<0)return null;const O=Math.floor(10*o)/10,n=A(O),t=(n.aqiHigh-n.aqiLow)/(n.cHigh-n.cLow)*(O-n.cLow)+n.aqiLow;return Math.min(500,Math.round(t))},e.getAqiCategory=function(o){if(null===o)return'Good';return(n.find(O=>o<=O.aqiHigh)??t).category},e.getAqiColor=function(O){if(null===O)return o.COLORS.TEXT_PLACEHOLDER;return(n.find(o=>O<=o.aqiHigh)??t).color},e.getAqiWashColor=function(O){if(null===O)return o.COLORS.BG_WASH;return(n.find(o=>O<=o.aqiHigh)??t).wash},e.getAqiMidColor=function(O){if(null===O)return o.COLORS.BG_WASH;return(n.find(o=>O<=o.aqiHigh)??t).mid},e.getAqiOnColor=function(O){if(null===O)return o.COLORS.TEXT_BODY;if(O<=200)return o.COLORS.TEXT_PRIMARY;return o.COLORS.TEXT_INVERSE};var o=r(d[0]);const O='US EPA PM2.5 AQI',n=[{cLow:0,cHigh:9,aqiLow:0,aqiHigh:50,category:'Good',color:o.COLORS.AQI_GOOD,wash:o.COLORS.AQI_WASH_GOOD,mid:o.COLORS.AQI_MID_GOOD}
7,{cLow:9.1,cHigh:35.4,aqiLow:51,aqiHigh:100,category:'Moderate',color:o.COLORS.AQI_MODERATE,wash:o.COLORS.AQI_WASH_MODERATE,mid:o.COLORS.AQI_MID_MODERATE},{cLow:35.5,cHigh:55.4,aqiLow:101,aqiHigh:150,category:'Unhealthy for Sensitive Groups',color:o.COLORS.AQI_UNHEALTHY_SENSITIVE,wash:o.COLORS.AQI_WASH_UNHEALTHY_SENSITIVE,mid:o.COLORS.AQI_MID_UNHEALTHY_SENSITIVE},{cLow:55.5,cHigh:125.4,aqiLow:151,aqiHigh:200,category:'Unhealthy',color:o.COLORS.AQI_UNHEALTHY,wash:o.COLORS.AQI_WASH_UNHEALTHY,mid:o.COLORS.AQI_MID_UNHEALTHY},{cLow:125.5,cHigh:225.4,aqiLow:201,aqiHigh:300,category:'Very Unhealthy',color:o.COLORS.AQI_VERY_UNHEALTHY,wash:o.COLORS.AQI_WASH_VERY_UNHEALTHY,mid:o.COLORS.AQI_MID_VERY_UNHEALTHY},{cLow:225.5,cHigh:500.4,aqiLow:301,aqiHigh:500,category:'Hazardous',color:o.COLORS.AQI_HAZARDOUS,wash:o.COLORS.AQI_WASH_HAZARDOUS,mid:o.COLORS.AQI_MID_HAZARDOUS}],t=(()=>{const o=n.at(-1);if(void 0===o)throw new Error('AQI_BANDS must define at least one band');return o})();function A(o){for(const O of n)if(o<=O.cHigh)return O;return t}},1137,[490]); 8__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.LedModeManagementControl=function({ledMode:e,isPending:t,isSetCoolingDown:s=!1,onSet:c}){const b=f(e),[S,p]=(0,o.useState)(b.baseMode),[L,_]=(0,o.useState)(b.tapEnabled),[I,M]=(0,o.useState)(e);if(I!==e){const o=f(e);M(e),p(o.baseMode),_(o.tapEnabled)}const{isPhone:P}=(0,u.useResponsive)(),N=''===S?null:(0,O.composeLedMode)(S,L),B='0'===S,A=(0,o.useMemo)(()=>''===S?[C,...O.LED_MODE_OPTIONS]:O.LED_MODE_OPTIONS,[S]),j=t||B||''===S;return(0,T.jsxs)(n.default,{style:R.container,children:[(0,T.jsx)(l.default,{style:R.groupLabel,selectable:!0,children:"LED Settings"}),(0,T.jsxs)(n.default,{style:[R.controlsRow,P&&R.controlsRowPhone],children:[(0,T.jsxs)(n.default,{style:[R.modeField,P&&R.fieldPhone],children:[(0,T.jsx)(l.default,{style:R.label,selectable:!0,children:"Mode"}),(0,T.jsx)(x,{testID:"led-management-select",value:S,options:A,disabled:t,onChange:e=>{p(e),'0'===e&&_(!0)}})]}),(0,T.jsxs)(n.default,{style:[R.tapField,P&&R.fieldPhone],children:[(0,T.jsx)(l.default,{style:R.label,selectable:!0,children:"Tap brightness"}),(0,T.jsx)(D,{value:L&&!B&&''!==S,disabled:j,unavailableLabel:E(S,L),onToggle:()=>{_(e=>!e)}})]}),(0,T.jsx)(n.default,{style:[R.actions,P&&R.actionsPhone],children:(0,T.jsx)(h.ActionButton,{label:"Set LED Settings",onPress:()=>{null!==N&&c(String(N))},variant:"neutralStrong",disabled:t||s||null===N,style:P?R.setButtonPhone:void 0})})]})]})};var o=r(d[0]);r(d[1]);var l=e(r(d[2])),t=e(r(d[3])),n=e(r(d[4])),s=r(d[5]),c=r(d[6]),b=r(d[7]),S=r(d[8]),u=r(d[9]),O=r(d[10]),h=r(d[11]),T=r(d[12]);const C={value:'',label:'N/A'};function f(e){return(0,O.parseLedMode)(e??null)??{baseMode:'',tapEnabled:!0}}function E(e,o){return''===e?'N/A':'0'===e?'Not applied (LEDs off)':o?'Enabled':'Disabled'}function D({value:e,disabled:o,unavailableLabel:s,onToggle:c}){return(0,T.jsxs)(t.default,{testID:"tap-brightness-toggle",style:[R.booleanToggle,o&&R.booleanToggleDisabled],disabled:o,accessibilityRole:"checkbox",accessibilityState:{checked:e,disabled:o},onPress:c,children:[(0,T.jsx)(n.default,{style:[R.booleanBox,e&&R.booleanBoxChecked],children:e&&(0,T.jsx)(n.default,{style:R.booleanCheckmark})}),(0,T.jsx)(l.default,{style:[R.booleanToggleText,o&&R.booleanToggleTextDisabled],selectable:!0,children:o?s:e?'Enabled':'Disabled'})]})}function x({testID:e,value:o,options:l,disabled:t,onChange:n}){l.find(e=>e.value===o);return(0,T.jsx)("select",{"data-testid":e,style:R.select,value:o,disabled:t,onChange:e=>{n(e.target.value)},children:l.map(e=>(0,T.jsx)("option",{value:e.value,children:e.label},e.value))})}const R=(0,s.createStyles)({actions:{alignItems:'flex-start',flexShrink:0,justifyContent:'flex-end'},actionsPhone:{alignItems:'stretch',alignSelf:'stretch'},booleanBox:{alignItems:'center',backgroundColor:c.COLORS.TEXT_INVERSE,borderColor:c.COLORS.BORDER_DEFAULT,borderRadius:4,borderWidth:1,height:18,justifyContent:'center',width:18},booleanBoxChecked:{borderColor:c.COLORS.TEXT_BODY},booleanCheckmark:{borderBottomColor:c.COLORS.TEXT_BODY,borderBottomWidth:2,borderRightColor:c.COLORS.TEXT_BODY,borderRightWidth:2,height:10,marginTop:-2,transform:[{rotate:'45deg'}],width:5},booleanToggle:Object.assign({alignItems:'center',backgroundColor:c.COLORS.TEXT_INVERSE,borderColor:c.COLORS.BORDER_DEFAULT,borderRadius:6,borderWidth:1,flexDirection:'row',gap:b.SPACING.SM,minHeight:38,minWidth:116,paddingHorizontal:b.SPACING.MD,paddingVertical:b.SPACING.SM},{cursor:'pointer'}),booleanToggleDisabled:{backgroundColor:c.COLORS.BG_SUBTLE_100},booleanToggleText:{color:c.COLORS.TEXT_BODY,fontSize:S.FONT_SIZE.MD},booleanToggleTextDisabled:{color:c.COLORS.TEXT_MUTED},container:{backgroundColor:c.COLORS.BG_WASH,borderColor:c.COLORS.BORDER_DEFAULT,borderRadius:8,borderWidth:1,gap:b.SPACING.XS,minWidth:0,paddingHorizontal:b.SPACING.MD,paddingVertical:b.SPACING.SM},controlsRow:{alignItems:'flex-end',flexDirection:'row',flexWrap:'wrap',gap:b.SPACING.SM,minWidth:0},controlsRowPhone:{alignItems:'stretch',flexDirection:'column',flexWrap:'nowrap',gap:b.SPACING.MD},fieldPhone:{flexBasis:'auto',flexGrow:0},setButtonPhone:{alignItems:'center',alignSelf:'stretch',paddingVertical:b.SPACING.MD},groupLabel:{color:c.COLORS.TEXT_HEADING,fontSize:S.FONT_SIZE.SM,fontWeight:'700'},label:{color:c.COLORS.TEXT_BODY,fontSize:S.FONT_SIZE.SM,fontWeight:'600'},modeField:{flexBasis:250,flexGrow:1,gap:b.SPACING.XS,minWidth:0},select:Object.assign({backgroundColor:c.COLORS.TEXT_INVERSE,borderColor:c.COLORS.BORDER_DEFAULT,borderRadius:6,borderWidth:1,color:c.COLORS.TEXT_HEADING,fontSize:S.FONT_SIZE.MD,minHeight:38,minWidth:0,paddingHorizontal:b.SPACING.MD,paddingVertical:b.SPACING.SM,width:'100%'},{cursor:'pointer'}),selectDisabled:{backgroundColor:c.COLORS.BG_SUBTLE_100},selectText:{color:c.COLORS.TEXT_BODY,fontSize:S.FONT_SIZE.MD},selectTextDisabled:{color:c.COLORS.TEXT_MUTED},tapField:{flexBasis:140,flexGrow:0,gap:b.SPACING.XS}})},1138,[34,95,222,488,276,489,490,493,494,553,1064,1081,104]); 9__d(function(g,r,i,a,m,_e,d){"use strict";
9function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ReadingsSupplement=function({gas:e,confidencePercent:n,particleRatioHigh:o=null}){return(0,f.jsxs)(t.default,{style:R.readingSupplement,children:[(0,f.jsx)(c.InfoItem,{label:"Gas",value:(0,u.formatMeasurement)(e)}),n>=0&&(0,f.jsx)(c.InfoItem,{label:"Confidence",value:`${n}%`}),null!=o&&(0,f.jsxs)(t.default,{style:c.sharedStyles.infoItem,children:[(0,f.jsx)(l.default,{style:c.sharedStyles.infoLabel,selectable:!0,children:"Particle Ratio"}),(0,f.jsx)(l.default,{style:[c.sharedStyles.infoValue,!o&&R.particleRatioLowValue],selectable:!0,children:o?'HIGH':'LOW'})]})]})};var l=e(r(d[0])),t=e(r(d[1])),n=r(d[2]),o=r(d[3]),s=r(d[4]),u=r(d[5]),c=r(d[6]),f=r(d[7]);const R=(0,n.createStyles)({particleRatioLowValue:{alignSelf:'flex-start',backgroundColor:o.COLORS.ERROR_BG,borderColor:o.COLORS.ERROR_BORDER,borderRadius:4,borderWidth:1,color:o.COLORS.ERROR,fontWeight:'700',paddingHorizontal:s.SPACING.SM,paddingVertical:2},readingSupplement:{flexDirection:'row',flexWrap:'wrap',gap:s.SPACING.LG,marginTop:s.SPACING.MD}})},1139,[222,276,489,490,493,1140,1081,104]); 10__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.formatMeasurement=function(n){return null==n?'N/A':String(n)},e.formatRssi=function(n,t){if(null==n)return'N/A';if(null==t||''===t)return`${String(n)} dBm`;return`${String(n)} dBm (${t})`},e.formatFirmwareWithConfiguredTarget=function(n,t){const u=null==n||''===n?'N/A':n;if(null==t||''===t||t===n)return u;return`${u} \u2192 ${t}`},e.resolveSensorDisplayName=function(n,t){const o=null==n?'':(0,u.collapseToSingleLine)(n);return''!==o?o:`Sensor ${String(t)}`},e.formatCoordinates=function(n,t){if(null==n||null==t)return'';return`${n.toFixed(2)}, ${t.toFixed(2)}`},e.formatCoordinatesPrecise=function(n,u){const o=(0,t.toCoord)(n??null,u??null);return null===o?'N/A':(0,t.formatCoord)(o,6)},e.formatPositionRating=function(n){if(null==n||n<=0)return'N/A';const t=Math.min(5,Math.floor(n));return'\u2605'.repeat(t)+'\u2606'.repeat(5-t)},e.formatLocationType=function(n){switch(n){case'inside':return'Inside';case'outside':return'Outside';default:return''}},e.formatVisibility=function(n){return n?'Private':'Public'},e.formatMinutesAgo=function(n){if(null==n)return'N/A';if(n<1)return'Just now';if(n<60)return`${n} min ago`;const t=Math.floor(n/60);if(t<24)return`${t} hr${t>1?'s':''} ago`;const u=Math.floor(t/24);return`${u} day${u>1?'s':''} ago`},e.formatDurationMinutes=function(n){if(null==n)return'N/A';if(n<1)return'Less than 1 min';if(n<60)return`${n} min`;const t=Math.floor(n/60);if(t<24)return`${t} hr${t>1?'s':''}`;const u=Math.floor(t/24);return`${u} day${u>1?'s':''}`},e.getUptimeLabel=function(n){return'online'===n?'Current uptime':'Last uptime'},e.isSensorOffline=function(n){return'offline'===n},e.getStatusColor=function(t){switch(t){case'online':return n.COLORS.GREEN_500;case'delayed':return n.COLORS.YELLOW_500;case'slow':return n.COLORS.ORANGE_500;case'stale':return n.COLORS.RED_500;case'offline':return n.COLORS.TEXT_PLACEHOLDER;default:return n.COLORS.BORDER_DEFAULT}},e.getConfidenceColor=function(t){if(t<0)return n.COLORS.TEXT_PLACEHOLDER;if(t<=50)return n.COLORS.ERROR;if(t<=75)return n.COLORS.WARNING;if(t<=90)return n.COLORS.YELLOW_500;return n.COLORS.GREEN_500};var n=r(d[0]),t=r(d[1]),u=r(d[2])},1140,[490,1058,1141]); 11__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.collapseToSingleLine=function(n){return n.replace(/\s+/gu,' ').trim()}},1141,[]); 12__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.SensorAqiHeadline=function({pm25:e,size:n="sm",offline:o=!1}){const S=(0,f.pm25ToAqi)(e),s=o?'offline':'online',O=(0,u.getOwnedSensorAqiColor)(s,S),T=(0,u.getOwnedSensorAqiOnColor)(s,S),_=o?'Offline':null===S?'No data':(0,f.getAqiCategory)(S),L=null===S?'\u2014':String(S),P=null!=e&&Number.isFinite(e)?`PM2.5 ${Number(e).toFixed(1)} \xb5g/m\xb3`:'PM2.5 \u2014',N='lg'===n;return(0,p.jsx)(c.HoverTooltip,{text:f.AQI_TOOLTIP_TEXT,children:(0,p.jsx)(t.default,{style:[I.panelFilled,N?I.panelLargePad:I.panelSmallPad,{backgroundColor:O}],children:(0,p.jsxs)(t.default,{style:I.row,children:[(0,p.jsx)(l.default,{style:[N?I.numberLg:I.numberSm,{color:T}],selectable:!0,children:L}),(0,p.jsxs)(t.default,{style:I.textColumn,children:[(0,p.jsx)(l.default,{style:[N?I.categoryLg:I.categorySm,{color:T}],numberOfLines:1,selectable:!0,children:_}),(0,p.jsx)(l.default,{style:[N?I.pmLg:I.pmSm,I.pmFilledOverlay,{color:T}],selectable:!0,children:P})]})]})})})},r(d[0]);var l=e(r(d[1])),t=e(r(d[2])),n=r(d[3]),o=r(d[4]),S=r(d[5]),s=r(d[6]),c=r(d[7]),f=r(d[8]),u=r(d[9]),p=r(d[10]);const I=(0,n.createStyles)({categoryLg:{fontSize:s.FONT_SIZE.LG,fontWeight:'700'},categorySm:{fontSize:s.FONT_SIZE.SM,fontWeight:'700',letterSpacing:.3,textTransform:'uppercase'},numberLg:{fontSize:s.FONT_SIZE.DISPLAY_XL,fontWeight:'800',lineHeight:s.FONT_SIZE.DISPLAY_XL},numberSm:{fontSize:s.FONT_SIZE.DISPLAY_SM,fontWeight:'800',lineHeight:s.FONT_SIZE.DISPLAY_SM},panelFilled:{borderRadius:10},panelLargePad:{paddingHorizontal:S.SPACING.LG,paddingVertical:S.SPACING.MD},panelSmallPad:{paddingHorizontal:S.SPACING.MD,paddingVertical:S.SPACING.SM},pmFilledOverlay:{opacity:.85},pmLg:{color:o.COLORS.TEXT_MUTED,fontSize:s.FONT_SIZE.SM,marginTop:S.SPACING.MICRO},pmSm:{color:o.COLORS.TEXT_MUTED,fontSize:s.FONT_SIZE.XS,marginTop:S.SPACING.MICRO},row:{alignItems:'center',flexDirection:'row',gap:S.SPACING.MD},textColumn:{flex:1,minWidth:0}})},1142,[34,222,276,489,490,493,494,686,1137,1143,104]); 13__d(function(g,r,i,a,m,e,d){"use strict";
13Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"OFFLINE_SENSOR_AQI_COLOR",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"OFFLINE_SENSOR_AQI_ON_COLOR",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"OFFLINE_SENSOR_AQI_WASH_COLOR",{enumerable:!0,get:function(){return f}}),e.getOwnedSensorAqiColor=function(n,u){return(0,t.isSensorOffline)(n)?O:(0,o.getAqiColor)(u)},e.getOwnedSensorAqiOnColor=function(n,O){return(0,t.isSensorOffline)(n)?u:(0,o.getAqiOnColor)(O)},e.getOwnedSensorAqiWashColor=function(n,O){return(0,t.isSensorOffline)(n)?f:(0,o.getAqiWashColor)(O)},e.getOwnedSensorAqiMidColor=function(n,u){return(0,t.isSensorOffline)(n)?O:(0,o.getAqiMidColor)(u)},e.getSearchResultStripeColor=function(n,u){return(0,t.isSensorOffline)(n)?O:(0,o.getAqiColor)(u)};var n=r(d[0]),o=r(d[1]),t=r(d[2]);const O=n.COLORS.TEXT_PLACEHOLDER,u=n.COLORS.TEXT_INVERSE,f=n.COLORS.BG_MUTED},1143,[490,1137,1140]); 14__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.HeaderBadge=function({label:e,variant:o="neutral"}){const l='success'===o?s.COLORS.SUCCESS_BG:'warning'===o?s.COLORS.WARNING_BG:s.COLORS.BG_SUBTLE_100,c='success'===o?s.COLORS.SUCCESS:'warning'===o?s.COLORS.WARNING_DARK:s.COLORS.TEXT_MUTED;return(0,C.jsx)(t.default,{style:[x.headerBadge,{backgroundColor:l}],children:(0,C.jsx)(n.default,{style:[x.headerBadgeText,{color:c}],selectable:!0,children:e})})},_e.SensorDetailCard=function({sensorLabel:e,sensorModel:l,sensorIndex:s,onlineStatus:c,badges:h,backLabel:f="Back to Search Results",onBack:G,children:O,headline:R,headerActions:I}){const{isPhone:p}=(0,S.useResponsive)(),L=(0,u.getStatusColor)(c);return(0,C.jsxs)(t.default,{children:[(0,C.jsx)(o.default,{style:x.backButton,onPress:G,children:(0,C.jsx)(n.default,{style:x.backButtonText,children:f})}),(0,C.jsxs)(t.default,{style:x.card,children:[(0,C.jsxs)(t.default,{style:[x.header,p&&x.headerPhone],children:[(0,C.jsxs)(t.default,{style:x.headerTopRow,children:[(0,C.jsxs)(t.default,{style:x.headerMain,children:[(0,C.jsxs)(t.default,{style:x.headerTitleRow,children:[(0,C.jsx)(t.default,{style:[x.statusDot,{backgroundColor:L}]}),(0,C.jsx)(n.default,{style:[x.title,p&&x.titlePhone],selectable:!0,children:e??`Sensor ${s}`}),h]}),(0,C.jsxs)(n.default,{style:x.subtitle,selectable:!0,children:[l," \u2014 Sensor index: ",s]})]}),null!=I&&(0,C.jsx)(t.default,{style:[x.headerActions,p&&x.headerActionsPhone],children:I})]}),null!=R&&(0,C.jsx)(t.default,{style:x.headerHeadline,children:R})]}),O]})]})},_e.DetailInfoGrid=function({children:e}){const{isPhone:n}=(0,S.useResponsive)();return(0,C.jsx)(f.DetailGridProvider,{children:(0,C.jsx)(t.default,{style:[x.infoGrid,n&&x.infoGridPhone],children:e})})},r(d[0]);var t=e(r(d[1])),n=e(r(d[2])),o=e(r(d[3])),l=r(d[4]),s=r(d[5]),c=r(d[6]),h=r(d[7]),S=r(d[8]),u=r(d[9]),f=r(d[10]),C=r(d[11]);const x=(0,l.createStyles)({backButton:{alignSelf:'flex-start',marginBottom:c.SPACING.XL},backButtonText:{color:s.COLORS.ACTION_PRIMARY,fontSize:h.FONT_SIZE.LG,fontWeight:'500'},card:{backgroundColor:s.COLORS.TEXT_INVERSE,borderColor:s.COLORS.BORDER,borderRadius:12,borderWidth:1,overflow:'hidden'},header:{backgroundColor:s.COLORS.TEXT_INVERSE,borderBottomColor:s.COLORS.BORDER,borderBottomWidth:1,gap:c.SPACING.LG,paddingHorizontal:c.SPACING.XXL,paddingVertical:c.SPACING.XL},headerActions:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:c.SPACING.SM},headerActionsPhone:{width:'100%'},headerHeadline:{alignSelf:'stretch'},headerMain:{flexGrow:1,flexShrink:1,minWidth:0},headerPhone:{paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.LG},headerTopRow:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:c.SPACING.LG,justifyContent:'space-between'},headerBadge:{borderRadius:4,paddingHorizontal:c.SPACING.SM,paddingVertical:2},headerBadgeText:{fontSize:h.FONT_SIZE.XS,fontWeight:'600',textTransform:'uppercase'},headerTitleRow:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:c.SPACING.MD},infoGrid:{alignItems:'stretch',flexDirection:'row',flexWrap:'wrap',gap:c.SPACING.LG,padding:c.SPACING.XL},infoGridPhone:{gap:c.SPACING.MD,padding:c.SPACING.LG},statusDot:{borderRadius:5,height:10,width:10},subtitle:{color:s.COLORS.TEXT_MUTED,fontSize:h.FONT_SIZE.MD,marginTop:c.SPACING.XS},title:{color:s.COLORS.TEXT_HEADING,fontSize:h.FONT_SIZE.XXXL,fontWeight:'bold'},titlePhone:{fontSize:h.FONT_SIZE.XXL}})},1144,[34,276,222,488,489,490,493,494,553,1140,1081,104]); 15__d(function(g,r,i,a,m,e,d){"use strict";
15Object.defineProperty(e,'__esModule',{value:!0}),e.buildCoreDetailStatusRows=l,e.buildManagedDetailStatusRows=function(o,n){return[...l(o),{label:'Last Update Check',value:(0,t.formatMinutesAgo)(n.lastUpdateCheckMinutesAgo)},{label:'Last Modified',value:(0,t.formatMinutesAgo)(n.lastModifiedMinutesAgo)}]},e.buildPublicDetailStatusRows=function(o){return[...l(o),{label:'RSSI',value:(0,t.formatRssi)(o.rssi,o.rssiQuality)}]},e.buildCoreDetailLocationRows=o,e.buildManagedDetailLocationRows=function(l,n){const u=o(l);return[{label:'Type',value:(0,t.formatLocationType)(l.locationType)||'N/A'},{label:'Visibility',value:(0,t.formatVisibility)(l.hidden)},...u.filter(t=>'Type'!==t.label),{label:'Position Checked',value:(0,t.formatMinutesAgo)(n)}]},e.buildPublicDetailLocationRows=function(t){return o(t)},e.buildManagedDetailHardwareRows=function(l){return[{label:'Device ID',value:l.mac??'N/A'},...n(l,(0,t.formatFirmwareWithConfiguredTarget)(l.firmwareVersion,l.configuredFirmwareTarget)),{label:'RSSI',value:(0,t.formatRssi)(l.rssi,l.rssiQuality)}]},e.buildPublicDetailHardwareRows=function(t){const l=null==t.firmwareVersion||''===t.firmwareVersion?'N/A':t.firmwareVersion;return n(t,l)};var t=r(d[0]);function l(l){return[{label:'Online Status',value:l.onlineStatus},{label:'Last Seen',value:(0,t.formatMinutesAgo)(l.lastSeenMinutesAgo)},{label:(0,t.getUptimeLabel)(l.onlineStatus),value:(0,t.formatDurationMinutes)(l.uptimeMinutes)}]}function o(l){return[{label:'Type',value:(0,t.formatLocationType)(l.locationType)||'N/A'},{label:'Coordinates',value:(0,t.formatCoordinatesPrecise)(l.lat,l.lon)},{label:'Elevation',value:(0,t.formatMeasurement)(l.elevation)},{label:'Position Rating',value:(0,t.formatPositionRating)(l.positionRating)}]}function n(t,l){return[{label:'Model',value:t.model},{label:'Firmware',value:l},{label:'Hardware',value:t.hardwareDiscovered??'N/A'}]}},1145,[1140]); 16__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ManagementInputGrid=function({children:e}){return(0,h.jsx)(t.default,{style:S.managementInputGrid,children:e})},_e.ManagementInputRow=function({label:e,value:l,onChangeText:o,placeholder:u,isPending:s,setDisabled:w=!1,onSet:y,setVariant:R,keyboardType:O,width:C}){const{isPhone:I}=(0,p.useResponsive)(),P=x(C),T=b(C);if(I)return(0,h.jsxs)(t.default,{style:S.inputColumnPhone,children:[(0,h.jsx)(n.default,{style:S.inputLabel,selectable:!0,children:e}),(0,h.jsxs)(t.default,{style:S.inputControlRowPhone,children:[(0,h.jsx)(c.AppTextInput,Object.assign({style:[S.input,S.inputPhone],value:l,onChangeText:o,placeholder:u,editable:!s},void 0!==O?{keyboardType:O}:{})),(0,h.jsx)(f.ActionButton,{label:"Set",accessibilityLabel:`Set ${e}`,onPress:y,variant:R,disabled:s||w})]})]});return(0,h.jsxs)(t.default,{style:[S.inputRow,P],children:[(0,h.jsx)(n.default,{style:S.inputLabel,selectable:!0,children:e}),(0,h.jsx)(c.AppTextInput,Object.assign({style:[S.input,T],value:l,onChangeText:o,placeholder:u,editable:!s},void 0!==O?{keyboardType:O}:{})),(0,h.jsx)(f.ActionButton,{label:"Set",accessibilityLabel:`Set ${e}`,onPress:y,variant:R,disabled:s||w})]})},_e.ReadOnlyManagementRow=function({label:e,value:l,width:o}){const{isPhone:u}=(0,p.useResponsive)(),s=x(o);if(u)return(0,h.jsxs)(t.default,{style:S.inputColumnPhone,children:[(0,h.jsx)(n.default,{style:S.inputLabel,selectable:!0,children:e}),(0,h.jsx)(n.default,{style:S.readOnlyManagementValue,selectable:!0,children:l})]});return(0,h.jsxs)(t.default,{style:[S.inputRow,s],children:[(0,h.jsx)(n.default,{style:S.inputLabel,selectable:!0,children:e}),(0,h.jsx)(n.default,{style:S.readOnlyManagementValue,selectable:!0,children:l})]})},r(d[0]);var n=e(r(d[1])),t=e(r(d[2])),l=r(d[3]),o=r(d[4]),u=r(d[5]),s=r(d[6]),p=r(d[7]),c=r(d[8]),f=r(d[9]),h=r(d[10]);function x(e){return'wide'===e?S.inputRowWide:'medium'===e?S.inputRowMedium:S.inputRowNarrow}function b(e){return'wide'===e?S.inputWide:'medium'===e?S.inputMedium:S.inputNarrow}const S=(0,l.createStyles)({input:Object.assign({backgroundColor:o.COLORS.TEXT_INVERSE,borderColor:o.COLORS.BORDER_DEFAULT,borderRadius:6,borderWidth:1,color:o.COLORS.TEXT_HEADING,flex:1,fontSize:s.FONT_SIZE.MD,minWidth:0,paddingHorizontal:u.SPACING.MD,paddingVertical:u.SPACING.SM},{outlineColor:o.COLORS.ACTION_PRIMARY}),inputColumnPhone:{flexBasis:'100%',gap:u.SPACING.XS,minWidth:0},inputControlRowPhone:{alignItems:'center',flexDirection:'row',gap:u.SPACING.SM,minWidth:0},inputLabel:{color:o.COLORS.TEXT_BODY,flexShrink:0,fontSize:s.FONT_SIZE.SM,fontWeight:'500'},inputMedium:{minWidth:92},inputNarrow:{minWidth:64},inputPhone:{flexBasis:0,flexGrow:1,minWidth:0},inputRow:{alignItems:'center',flexDirection:'row',flexGrow:1,flexShrink:1,gap:u.SPACING.XS,minWidth:0},inputRowMedium:{flexBasis:220},inputRowNarrow:{flexBasis:180},inputRowWide:{flexBasis:360,flexGrow:2}
16,inputWide:{minWidth:170},managementInputGrid:{columnGap:u.SPACING.XL,flexDirection:'row',flexWrap:'wrap',rowGap:u.SPACING.SM},readOnlyManagementValue:{color:o.COLORS.TEXT_HEADING,flex:1,fontSize:s.FONT_SIZE.MD,fontWeight:'500',minWidth:0}})},1146,[95,222,276,489,490,493,494,553,711,1081,104]); 17__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useServerReconciledTextInput=function(u){const[n,c]=(0,t.useState)(u),[s,o]=(0,t.useState)(u);s!==u&&(o(u),c(u));return[n,c]};var t=r(d[0])},1147,[34]); 18__d(function(g,r,i,a,m,e,d){"use strict";function n(n,o){return`${n}-${o().toISOString().slice(0,10)}.csv`}Object.defineProperty(e,'__esModule',{value:!0}),e.exportSensorTable=async function(o,t){const s=t.now??(()=>new Date),u=await t.download(n(t.filenamePrefix??'sensors',s),o.columns,o.rows);if('unsupported'===u.status)return void t.onUnsupported(u.reason);if(void 0===t.recordAudit)return;try{await t.recordAudit(o.rows.length,o.columns.map(n=>n.id))}catch(n){t.onAuditError?.(n)}}},1148,[]); 19__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.partitionOwnedSensorsByArchiveState=G,_e.OwnedSensorsSection=function({sensors:e,loading:S,error:I,onRetry:x,onViewDetail:N,detailLoading:b,pendingSensorIndices:v,onExportTable:D,selection:P,selectionModeVisible:w,onSelectionModeChange:B}){const[W,X]=(0,t.useState)('cards'),{activeSensors:V,archivedSensors:k}=G(e),z=(0,c.useColumnVisibility)(y.SENSOR_OWNED_COLUMNS,{storageKey:y.SENSOR_OWNED_COLUMN_VISIBILITY_KEY});if(S&&0===e.length)return(0,A.jsxs)(l.default,{style:_.loadingContainer,children:[(0,A.jsx)(n.default,{color:h.COLORS.ACTION_PRIMARY,size:"small"}),(0,A.jsx)(o.default,{style:_.loadingText,children:"Loading your sensors..."})]});if(null!==I&&0===e.length)return(0,A.jsxs)(l.default,{style:_.errorContainer,children:[(0,A.jsxs)(o.default,{style:_.errorTitle,children:["Couldn",'\u2019',"t load your sensors"]}),(0,A.jsx)(o.default,{style:_.errorMessage,children:I}),(0,A.jsx)(s.default,{style:_.retryButton,onPress:x,children:(0,A.jsx)(o.default,{style:_.retryButtonText,children:"Try again"})})]});if(0===e.length)return(0,A.jsx)(T.EmptyOwnedState,{});const F=1===V.length?'sensor':'sensors',H=0===V.length?'No active sensors registered to your account':`${String(V.length)} active ${F} registered to your account`,U=V[0],Z='table'===W?D:void 0;return(0,A.jsxs)(l.default,{style:_.container,children:[(0,A.jsxs)(l.default,{style:[_.headerRow,(w||P.selectedMapTargets.length>0)&&_.headerRowWithSelectionActions],testID:"owned-header-row",children:[(0,A.jsxs)(l.default,{style:_.headerTextBlock,children:[(0,A.jsx)(o.default,{style:_.title,children:"My Sensors"}),(0,A.jsx)(o.default,{style:_.subtitle,children:H})]}),(0,A.jsxs)(l.default,{style:_.headerControls,children:['cards'===W&&(0,A.jsx)(L.SensorSelectionModeControl,{availableSensorCount:e.length,visible:w,onShow:()=>{B(!0)},onHide:()=>{B(!1)}}),null!=D&&(0,A.jsx)(f.ResultLayoutToggle,{layout:W,onChange:e=>{X(e),'cards'===e&&P.selectedMapTargets.length>0&&B(!0)},testID:"owned-layout-toggle"}),(0,A.jsx)(C.AppLink,{to:"Register",style:_.registerLink,children:(0,A.jsx)(o.default,{style:_.registerLinkText,children:"+ Register another"})})]})]}),(0,A.jsx)(L.SensorSelectionActions,{availableSensors:e,selectedSensors:P.selectedMapTargets,onSelectAll:P.selectSensors,onDeselectAll:P.deselectSensors,onClear:P.clearSelection,showBulkSelector:'cards'===W&&w,testID:"owned-selection-actions"}),null!=Z?V.length>0?(0,A.jsx)(R.SensorTable,{sensors:V,columns:y.SENSOR_OWNED_COLUMNS,columnVisibility:z,onExport:Z,selection:P,filterPlaceholder:"Filter your sensors",emptyMessage:"No active sensors match the current filter.",testID:"owned-active-table"}):null:1===V.length&&void 0!==U?(0,A.jsx)(p.SensorHeroCard,Object.assign({sensor:U},w?{selection:{selected:P.selectedMapTargetIndices.has(U.sensorIndex),onToggle:P.toggleSensor}}:{},{onViewDetail:N,detailLoading:b,isPending:v.has(U.sensorIndex),treatment:j})):V.length>1?(0,A.jsx)(O.ResponsiveGrid,{minItemWidth:M,gap:u.SPACING.LG,children:V.map(e=>(0,A.jsx)(E,Object.assign({sensor:e},w?{selection:{selected:P.selectedMapTargetIndices.has(e.sensorIndex),onToggle:P.toggleSensor}}:{}
19,{onViewDetail:N,detailLoading:b,pendingSensorIndices:v}),`owned-${String(e.sensorIndex)}`))}):null,k.length>0&&(0,A.jsxs)(l.default,{style:_.archivedSection,children:[(0,A.jsxs)(l.default,{style:_.archivedHeaderTextBlock,children:[(0,A.jsx)(o.default,{style:_.archivedTitle,children:"Archived Sensors"}),(0,A.jsxs)(o.default,{style:_.subtitle,children:[k.length," archived",' ',1===k.length?'sensor':'sensors'," retained for historical details"]})]}),null!=Z?(0,A.jsx)(R.SensorTable,{sensors:k,columns:y.SENSOR_OWNED_COLUMNS,columnVisibility:z,onExport:Z,filterPlaceholder:"Filter archived sensors",emptyMessage:"No archived sensors match the current filter.",selection:P,testID:"owned-archived-table"}):(0,A.jsx)(O.ResponsiveGrid,{minItemWidth:M,gap:u.SPACING.LG,children:k.map(e=>(0,A.jsx)(E,Object.assign({sensor:e,onViewDetail:N,detailLoading:b,pendingSensorIndices:v},w?{selection:{selected:P.selectedMapTargetIndices.has(e.sensorIndex),onToggle:P.toggleSensor}}:{},{archived:!0}),`owned-archived-${String(e.sensorIndex)}`))})]})]})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),s=e(r(d[3])),l=e(r(d[4])),c=r(d[5]),S=r(d[6]),h=r(d[7]),u=r(d[8]),I=r(d[9]),C=r(d[10]),O=r(d[11]),T=r(d[12]),x=r(d[13]),f=r(d[14]),N=r(d[15]),p=r(d[16]),L=r(d[17]),R=r(d[18]),y=r(d[19]),A=r(d[20]);const M=300,j='glass';
19function E({sensor:e,onViewDetail:t,detailLoading:n,pendingSensorIndices:o,selection:s,archived:l=!1}){return(0,A.jsx)(x.OwnedSensorCard,Object.assign({sensor:e,onViewDetail:t,detailLoading:n,isPending:o.has(e.sensorIndex),treatment:j},null!=s?{selection:s}:{},{archived:l}))}function G(e){const t=[],n=[];return e.forEach(e=>{(0,N.isArchivedSensor)(e)?n.push(e):t.push(e)}),{activeSensors:t,archivedSensors:n}}const _=(0,S.createStyles)({archivedHeaderTextBlock:{gap:u.SPACING.MICRO,marginBottom:u.SPACING.MD},archivedSection:{borderTopColor:h.COLORS.BORDER,borderTopWidth:1,marginTop:u.SPACING.XL,paddingTop:u.SPACING.LG},archivedTitle:{color:h.COLORS.TEXT_BODY,fontSize:I.FONT_SIZE.XL,fontWeight:'700'},container:{marginBottom:u.SPACING.XL},errorContainer:{alignItems:'flex-start',backgroundColor:h.COLORS.BG_WASH,borderColor:h.COLORS.BORDER,borderRadius:12,borderWidth:1,gap:u.SPACING.SM,marginBottom:u.SPACING.XL,padding:u.SPACING.LG},errorMessage:{color:h.COLORS.TEXT_MUTED,fontSize:I.FONT_SIZE.SM},errorTitle:{color:h.COLORS.TEXT_HEADING,fontSize:I.FONT_SIZE.LG,fontWeight:'600'},headerControls:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.MD,justifyContent:'flex-end'},headerRow:{alignItems:'flex-end',flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.MD,justifyContent:'space-between',marginBottom:u.SPACING.LG},headerRowWithSelectionActions:{marginBottom:u.SPACING.SM},headerTextBlock:{flexGrow:1},loadingContainer:{alignItems:'center',flexDirection:'row',gap:u.SPACING.SM,marginBottom:u.SPACING.XL,padding:u.SPACING.LG},loadingText:{color:h.COLORS.TEXT_MUTED,fontSize:I.FONT_SIZE.MD},registerLink:{backgroundColor:h.COLORS.BG_SURFACE,borderColor:h.COLORS.ACTION_PRIMARY,borderRadius:8,borderWidth:1,paddingHorizontal:u.SPACING.LG,paddingVertical:u.SPACING.SM},registerLinkText:{color:h.COLORS.ACTION_PRIMARY,fontSize:I.FONT_SIZE.SM,fontWeight:'600'},retryButton:{alignSelf:'flex-start',backgroundColor:h.COLORS.ACTION_PRIMARY,borderRadius:6,marginTop:u.SPACING.XS,paddingHorizontal:u.SPACING.MD,paddingVertical:u.SPACING.SM},retryButtonText:{color:h.COLORS.TEXT_INVERSE,fontSize:I.FONT_SIZE.SM,fontWeight:'600'},subtitle:{color:h.COLORS.TEXT_MUTED,fontSize:I.FONT_SIZE.SM},title:{color:h.COLORS.TEXT_HEADING,fontSize:I.FONT_SIZE.XXL,fontWeight:'700'}})},1149,[34,410,222,488,276,680,489,490,493,494,516,965,1150,1152,1172,1167,1173,1174,1176,1177,104]); 20__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.EmptyOwnedState=function(){return(0,R.jsxs)(o.default,{style:x.container,children:[(0,R.jsx)(t.default,{style:x.title,children:"Start your air-quality journey"}),(0,R.jsx)(t.default,{style:x.subtitle,children:"You can explore PurpleAir without owning a sensor. Pick where to begin."}),(0,R.jsxs)(p.ResponsiveGrid,{minItemWidth:C,gap:l.SPACING.MD,children:[(0,R.jsx)(u.ActionCard,{icon:(0,R.jsx)(j,{children:(0,R.jsx)(A.ShoppingBagIcon,{size:f,color:s.COLORS.BRAND_PRIMARY})}),label:"Shop sensors",description:"Buy a PurpleAir sensor for your home, school, or office.",to:"Store"}),(0,R.jsx)(u.ActionCard,{icon:(0,R.jsx)(j,{children:(0,R.jsx)(S.MapIcon,{size:f,color:s.COLORS.BRAND_PRIMARY})}),label:"Explore the map",description:"See real-time air quality from sensors around the world.",service:"mapBaseUrl"}),(0,R.jsx)(u.ActionCard,{icon:(0,R.jsx)(j,{children:(0,R.jsx)(h.ChatIcon,{size:f,color:s.COLORS.BRAND_PRIMARY})}),label:"Join the community",description:"Ask questions, share tips, and talk with other members.",to:"Community"})]})]})},r(d[0]);var t=e(r(d[1])),o=e(r(d[2])),n=r(d[3]),s=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]),h=r(d[8]),S=r(d[9]),A=r(d[10]),p=r(d[11]),R=r(d[12]);const C=260,f=26;function j({children:e}){return(0,R.jsx)(o.default,{style:x.iconChip,children:e})}const x=(0,n.createStyles)({container:{marginBottom:l.SPACING.XL},iconChip:{alignItems:'center',backgroundColor:s.COLORS.BRAND_PRIMARY_ALPHA_14,borderRadius:26,height:52,justifyContent:'center',width:52},subtitle:{color:s.COLORS.TEXT_MUTED,fontSize:c.FONT_SIZE.MD,marginBottom:l.SPACING.LG},title:{color:s.COLORS.TEXT_HEADING,fontSize:c.FONT_SIZE.XXL,fontWeight:'700',marginBottom:l.SPACING.SM}})},1150,[34,222,276,489,490,493,494,964,1151,621,624,965,104]); 21__d(function(g,r,i,a,m,_e,d){"use strict";
21function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ChatIcon=function(e){const{size:c=22,color:l}=e,s=l??h.COLORS.WHITE;return(0,n.jsx)(t.default,{style:{width:c,height:c},children:(0,n.jsx)("svg",{width:c,height:c,viewBox:"0 0 24 24",fill:s,xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 12H7v-2h6v2zm4-3H7V9h10v2zm0-3H7V6h10v2z"})})})},r(d[0]),r(d[1]);e(r(d[2]));var t=e(r(d[3])),h=r(d[4]),n=r(d[5])},1151,[34,95,222,276,490,104]); 22__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OwnedSensorCard=function({sensor:t,onViewDetail:s,detailLoading:o,isPending:l,treatment:c,selection:u,archived:v=!1}){return(0,n.renderCardTreatment)(c,Object.assign({sensor:t,size:'grid',onViewDetail:s,detailLoading:o,isPending:l},null!=u?{selection:u}:{},{archived:v}))};var n=r(d[0])},1152,[1153]); 23__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SECONDARY_ACTIONS_TEST_ID",{enumerable:!0,get:function(){return D}}),_e.renderCardTreatment=function(e,t){const n=Object.assign({},t,{archived:t.archived??(0,y.isArchivedSensor)(t.sensor)});switch(e){case'glass':return(0,j.jsx)(Y,Object.assign({},n));case'stacked':return(0,j.jsx)(q,Object.assign({},n));default:throw new Error(`Unhandled CardLevelTreatment: ${String(e)}`)}},_e.resolveDowngradeScope=W,_e.resolveOwnerNoticeKind=B,_e.OwnerNoticeLane=H,r(d[0]);var t=e(r(d[1]));r(d[2]);var n=e(r(d[3])),o=e(r(d[4])),l=e(r(d[5])),s=r(d[6]),c=r(d[7]),S=r(d[8]),u=r(d[9]),f=r(d[10]),h=r(d[11]),O=r(d[12]),C=r(d[13]),x=r(d[14]),R=r(d[15]),y=r(d[16]),T=r(d[17]),p=r(d[18]),I=r(d[19]),A=r(d[20]),b=r(d[21]),E=r(d[22]),L=r(d[23]),j=r(d[24]);const N='https://community.purpleair.com/t/sensor-maintenance/1531',_='https://community.purpleair.com/t/sensor-wifi-and-registration/182',w='https://community.purpleair.com/t/what-does-it-mean-to-archive-a-purpleair-sensor/1332',D='owned-card-secondary-actions';function v({sensor:e,size:o,tint:s}){const c='lg'===o?140:'md'===o?96:72,S=(0,A.sensorImageUrl)(e.model,'lg'===o?200:100);return(0,j.jsx)(l.default,{style:[$.imageWrap,{height:c,width:c},void 0!==s?{backgroundColor:s}:null],children:null!==S?(0,j.jsx)(t.default,{source:{uri:S},style:{height:c-12,width:c-12},accessibilityIgnoresInvertColors:!0,resizeMode:"contain"}):(0,j.jsx)(n.default,{style:$.imagePlaceholder,numberOfLines:2,children:''!==e.model?e.model:'Sensor'})})}function M({sensor:e,isHero:t,inverted:o,aqiOnColor:s}){const c=t?$.labelLg:$.labelSm,S=t?$.modelLg:$.modelSm,u=o?[S,{color:s},$.onColorSecondary]:[S,$.modelDefault],f=e.mac?.trim()??'',O=(0,I.resolveSensorDisplayName)(e.label,e.sensorIndex);return(0,j.jsxs)(l.default,{style:$.identityTextBlock,children:[(0,j.jsx)(h.CopyableValue,{value:O,description:"sensor name",successMessage:"Sensor name copied",children:(0,j.jsx)(n.default,{style:[c,o?{color:s}:$.labelDefault],children:O})}),(0,j.jsxs)(l.default,{style:$.identityCopyRow,children:[(0,j.jsxs)(n.default,{style:[u,$.identityCopyText],numberOfLines:1,children:[''!==e.model?e.model:'Unknown model',' \xb7 ']}),(0,j.jsx)(h.CopyableValue,{value:String(e.sensorIndex),description:"sensor index",successMessage:"Sensor index copied",shrinkable:!1,children:(0,j.jsx)(n.default,{style:u,numberOfLines:1,children:`Sensor index: ${String(e.sensorIndex)}`})})]}),''!==f?(0,j.jsx)(h.CopyableValue,{value:f,description:"Device ID",successMessage:"Device ID copied",children:(0,j.jsx)(n.default,{style:[u,$.identityCopyText],numberOfLines:1,children:`Device ID: ${f}`})}):null]})}function G({sensor:e,inverted:t,archived:o=!1}){const s=(0,I.getStatusColor)(e.onlineStatus),c=(0,I.formatVisibility)(e.hidden),S=t?$.chipOnColor:$.chipNeutral,u=t?$.chipTextInverse:$.chipTextBody;return(0,j.jsxs)(l.default,{style:$.chipRow,children:[(0,j.jsxs)(l.default,{style:[$.statusPill,o?$.archivedChip:S],children:[(0,j.jsx)(l.default,{style:[$.statusDot,o?$.archivedStatusDot:{backgroundColor:s}]}),(0,j.jsx)(n.default,{style:[$.statusText,u],children:o?'Archived':''!==e.onlineStatus?e.onlineStatus:'unknown'})]}),(0,j.jsx)(l.default,{style:[$.chip,S],children:(0,j.jsx)(n.default,{style:[$.chipText,u],children:c})})]})}function W(e){const t=e.downgraded,n=e.channelB;return null===n?t?'single':'none':t&&n.downgraded?'both':t?'a-only':n.downgraded?'b-only':'none'}function B(e,t=(0,y.isArchivedSensor)(e)){return t?'archived':(0,I.isSensorOffline)(e.onlineStatus)?'offline':'none'===W(e)?null:'downgrade'}function P(e){switch(e){case'both':return'Both channels on your sensor are downgraded';case'a-only':return"Your sensor's Channel A is downgraded";case'b-only':return"Your sensor's Channel B is downgraded";case'single':return'Your sensor is downgraded';default:throw new Error(`Unhandled DowngradeScope: ${String(e)}`)}}function F({sensor:e}){const t=W(e);
23if('none'===t)return null;const o=P(t);return(0,j.jsxs)(C.ExternalLink,{href:N,style:K.notice,accessibilityLabel:`${o}. Opens the sensor maintenance article in a new window.`,children:[(0,j.jsx)(l.default,{style:K.iconBadge,children:(0,j.jsx)(n.default,{style:K.iconText,children:"!"})}),(0,j.jsxs)(l.default,{style:K.body,children:[(0,j.jsx)(n.default,{style:K.title,children:o}),(0,j.jsxs)(n.default,{style:K.link,children:["Learn how to clean and maintain your sensor",' \u2192']})]})]})}function k({sensor:e}){return(0,I.isSensorOffline)(e.onlineStatus)?(0,j.jsxs)(C.ExternalLink,{href:_,style:Q.notice,accessibilityLabel:"Sensor is offline. Opens the Sensor WiFi and Registration guide in a new window.",children:[(0,j.jsx)(l.default,{style:Q.iconBadge,children:(0,j.jsx)(n.default,{style:Q.iconText,children:"i"})}),(0,j.jsxs)(l.default,{style:Q.body,children:[(0,j.jsx)(n.default,{style:Q.title,children:"Your sensor is offline"}),(0,j.jsxs)(n.default,{style:Q.helpText,children:["Use the",' ',(0,j.jsx)(n.default,{style:Q.link,children:"Sensor WiFi and Registration guide"}),' ',"to reconnect it to Wi-Fi."]}),(0,j.jsx)(n.default,{style:Q.helpText,children:"Once it reconnects, give it a few minutes to report in. Then refresh this page to see it marked as connected."})]})]}):null}function z(){return(0,j.jsxs)(C.ExternalLink,{href:w,style:J.notice,accessibilityLabel:"Archived sensor record. Opens the article explaining what it means to archive a PurpleAir sensor.",children:[(0,j.jsx)(l.default,{style:J.iconBadge,children:(0,j.jsx)(n.default,{style:J.iconText,children:"i"})}),(0,j.jsxs)(l.default,{style:J.body,children:[(0,j.jsx)(n.default,{style:J.title,children:"Archived sensor record"}),(0,j.jsxs)(n.default,{style:J.helpText,children:["Historical details remain available here.",' ',(0,j.jsx)(n.default,{style:J.link,children:"Learn what archiving means"}),"."]})]})]})}function H({sensor:e,archived:t=!1}){const n=B(e,t);return'archived'===n?(0,j.jsx)(z,{}):'offline'===n?(0,j.jsx)(k,{sensor:e}):'downgrade'===n?(0,j.jsx)(F,{sensor:e}):null}function X({sensor:e,isHero:t,inverted:o,tileStyle:s="tile"}){const c=null==e.temperature?'\u2014':`${String(Math.round(e.temperature))}\xb0F`,S=null==e.humidity?'\u2014':`${String(Math.round(e.humidity))}%`,u=e.confidencePercent<0?'\u2014':`${String(Math.round(e.confidencePercent))}%`,f='tile'===s?$.telRowTile:$.telRowFlat,h='tile'===s?[$.telItemTile,t?$.telItemTileHero:null]:$.telItemFlat,O=o?$.telLabelInverse:$.telLabelDefault,C=o?$.telValueInverse:$.telValueDefault;return(0,j.jsxs)(l.default,{style:f,children:[(0,j.jsxs)(l.default,{style:h,children:[(0,j.jsx)(n.default,{style:O,children:"Temp"}),(0,j.jsx)(n.default,{style:C,children:c})]}),(0,j.jsxs)(l.default,{style:h,children:[(0,j.jsx)(n.default,{style:O,children:"Humidity"}),(0,j.jsx)(n.default,{style:C,children:S})]}),(0,j.jsxs)(l.default,{style:h,children:[(0,j.jsx)(n.default,{style:O,children:"Wi-Fi"}),(0,j.jsx)(l.default,{style:$.wifiHolder,children:(0,j.jsx)(L.WifiSignal,{rssiQuality:e.rssiQuality,rssiDbm:e.rssi,disconnected:(0,I.isSensorOffline)(e.onlineStatus)})})]}),t&&(0,j.jsxs)(l.default,{style:h,children:[(0,j.jsx)(n.default,{style:O,children:"Confidence"}),(0,j.jsx)(n.default,{style:C,children:u})]})]})}function V({sensor:e,inverted:t,aqiOnColor:o}){const l=e.ownerEmail?.trim()??'',s=[(0,I.formatLocationType)(e.locationType),(0,I.formatCoordinates)(e.lat,e.lon),''!==l?`Owner ${l}`:'',`Last seen ${(0,I.formatMinutesAgo)(e.lastSeenMinutesAgo)}`,null!==e.firmwareVersion&&''!==e.firmwareVersion||null!==e.configuredFirmwareTarget&&''!==e.configuredFirmwareTarget?`Firmware ${(0,I.formatFirmwareWithConfiguredTarget)(e.firmwareVersion,e.configuredFirmwareTarget)}`:''].filter(e=>''!==e);return 0===s.length?null:(0,j.jsx)(n.default,{style:t?[$.metaStrip,{color:o},$.onColorMuted]:[$.metaStrip,$.metaDefault],numberOfLines:2,children:s.join(' \xb7 ')})}function U({sensor:e,onViewDetail:t,onArchive:s,detailLoading:S,isPending:u,inverted:f}){const h=$.primaryAction,C=$.primaryActionText,x=f?[$.secondaryAction,$.secondaryActionInverse]:$.secondaryAction,R=f?$.secondaryActionTextInverse:$.secondaryActionText,y=f?[$.archiveAction,$.archiveActionInverse]:$.archiveAction,p=f?$.archiveActionTextInverse:$.archiveActionText;return(0,j.jsxs)(l.default,{style:$.actionsStack,children:[(0,j.jsxs)(l.default,{style:$.actionsRow,testID:D,children:[(0,j.jsx)(l.default,{style:$.detailsActionSlot,children:(0,j.jsx)(o.default,{style:x,onPress:()=>{t(e.sensorIndex)},disabled:S||u,children:(0,j.jsx)(n.default,{style:R,children:"Details"})})}),(0,j.jsx)(l.default,{style:$.copyActionSlot,children:(0,j.jsx)(O.CopyButton,{value:(0,T.formatSensorClipboardSummary)(e),accessibilityLabel:"Copy sensor details",successMessage:"All sensor details copied",label:"Copy details",copiedLabel:"Copied",variant:"action",color:f?c.COLORS.TEXT_INVERSE:void 0})}),void 0!==s&&(0,j.jsx)(l.default,{style:$.archiveActionSlot,children:(0,j.jsx)(o.default,{style:[y,u&&$.actionDisabled],onPress:()=>{s(e.sensorIndex,e.label)},disabled:u,accessibilityRole:"button",children:(0,j.jsx)(n.default,{style:p,children:"Archive"})})})]}),(0,j.jsx)(b.SensorMapLink,{sensor:e,style:h,textStyle:C})]})}function Z({sensor:e,size:t,onViewDetail:n,onArchive:o,detailLoa
23ding:s,isPending:c,selection:S,imageSize:u,archived:f=!1}){const h='hero'===t,O=(0,x.pm25ToAqi)(e.pm25),C=(0,x.getAqiOnColor)(O),y=!f&&(0,I.isSensorOffline)(e.onlineStatus);return(0,j.jsxs)(l.default,{style:$.body,children:[(0,j.jsxs)(l.default,{style:h?$.topRowHero:$.topRowGrid,children:[null!=S&&(0,j.jsx)(E.SensorSelectionCheckbox,{sensor:e,selected:S.selected,onToggle:S.onToggle}),(0,j.jsx)(v,{sensor:e,size:u}),(0,j.jsxs)(l.default,{style:$.identityCol,children:[(0,j.jsx)(M,{sensor:e,isHero:h,inverted:!1,aqiOnColor:C}),(0,j.jsx)(G,{sensor:e,inverted:!1,archived:f})]})]}),(0,j.jsx)(R.SensorAqiHeadline,{pm25:e.pm25,size:h?'lg':'sm',offline:y}),(0,j.jsx)(H,{sensor:e,archived:f}),(0,j.jsx)(X,{sensor:e,isHero:h,inverted:!1,tileStyle:"tile"}),(0,j.jsx)(V,{sensor:e,inverted:!1,aqiOnColor:C}),(0,j.jsx)(U,Object.assign({sensor:e,onViewDetail:n},void 0!==o?{onArchive:o}:{},{detailLoading:s,isPending:c,inverted:!1}))]})}function Y(e){const{sensor:t,size:n,onViewDetail:o,onArchive:s,detailLoading:u,isPending:f,selection:h,archived:O=!1}=e,C='hero'===n,y=(0,x.pm25ToAqi)(t.pm25),T=(0,x.getAqiOnColor)(y),A=!O&&(0,I.isSensorOffline)(t.onlineStatus),b=(0,p.getOwnedSensorAqiWashColor)(t.onlineStatus,y),L=O?`linear-gradient(180deg, ${c.COLORS.BG_WASH} 0%, ${c.COLORS.BG_SURFACE} 85%)`:`linear-gradient(180deg, ${b} 0%, ${c.COLORS.BG_SURFACE} 85%)`;return(0,j.jsx)(l.default,{style:[$.card,ee.card,O?te.card:null,!0===h?.selected?$.cardSelected:null,(N=L,{backgroundImage:N}),null,S.ELEVATION.RAISED],children:(0,j.jsxs)(l.default,{style:$.body,children:[(0,j.jsxs)(l.default,{style:C?$.topRowHero:$.topRowGrid,children:[null!=h&&(0,j.jsx)(E.SensorSelectionCheckbox,{sensor:t,selected:h.selected,onToggle:h.onToggle}),(0,j.jsx)(v,{sensor:t,size:C?'lg':'md'}),(0,j.jsxs)(l.default,{style:$.identityCol,children:[(0,j.jsx)(M,{sensor:t,isHero:C,inverted:!1,aqiOnColor:T}),(0,j.jsx)(G,{sensor:t,inverted:!1,archived:O})]})]}),(0,j.jsx)(l.default,{style:[ee.floatingPanel,S.ELEVATION.MEDIUM],children:(0,j.jsx)(R.SensorAqiHeadline,{pm25:t.pm25,size:C?'lg':'sm',offline:A})}),(0,j.jsx)(H,{sensor:t,archived:O}),(0,j.jsx)(X,{sensor:t,isHero:C,inverted:!1,tileStyle:"tile"}),(0,j.jsx)(V,{sensor:t,inverted:!1,aqiOnColor:T}),(0,j.jsx)(U,Object.assign({sensor:t,onViewDetail:o},void 0!==s?{onArchive:s}:{},{detailLoading:u,isPending:f,inverted:!1}))]})});var N}function q(e){const t=(0,x.pm25ToAqi)(e.sensor.pm25),n=(0,p.getOwnedSensorAqiWashColor)(e.sensor.onlineStatus,t),o=(0,p.getOwnedSensorAqiMidColor)(e.sensor.onlineStatus,t),s=e.archived??!1;return(0,j.jsxs)(l.default,{style:ne.wrap,children:[(0,j.jsx)(l.default,{style:[ne.layer,ne.layerBack,{backgroundColor:o}]}),(0,j.jsx)(l.default,{style:[ne.layer,ne.layerMid,{backgroundColor:n}]}),(0,j.jsx)(l.default,{style:[$.card,ne.front,s?te.card:null,!0===e.selection?.selected?$.cardSelected:null,S.ELEVATION.MEDIUM],children:(0,j.jsx)(Z,Object.assign({},e,{imageSize:"md"}))})]})}const $=(0,s.createStyles)({actionsRow:{flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.XS},actionsStack:{gap:u.SPACING.XS},actionDisabled:{opacity:.6},archiveAction:{alignItems:'center',backgroundColor:c.COLORS.ERROR_BG,borderColor:c.COLORS.ERROR_BORDER,borderRadius:8,borderWidth:1,justifyContent:'center',minHeight:42,paddingHorizontal:u.SPACING.MD,paddingVertical:u.SPACING.SM},archiveActionInverse:{backgroundColor:c.COLORS.OVERLAY_LIGHT_20,borderColor:c.COLORS.OVERLAY_LIGHT_40},archiveActionSlot:{flexBasis:110,flexGrow:1,flexShrink:1,minWidth:100},archiveActionText:{color:c.COLORS.ERROR,fontSize:f.FONT_SIZE.SM,fontWeight:'700'},archiveActionTextInverse:{color:c.COLORS.TEXT_INVERSE,fontSize:f.FONT_SIZE.SM,fontWeight:'700'},archivedChip:{backgroundColor:c.COLORS.BG_SUBTLE_100,borderColor:c.COLORS.BORDER_DEFAULT,borderWidth:1},archivedStatusDot:{backgroundColor:c.COLORS.TEXT_MUTED},copyActionSlot:{flexBasis:130,flexGrow:1,flexShrink:1,minWidth:120},detailsActionSlot:{flexBasis:120,flexGrow:1,flexShrink:1,minWidth:110},body:{gap:u.SPACING.MD,padding:u.SPACING.MD},card:{backgroundColor:c.COLORS.BG_SURFACE,borderColor:c.COLORS.BORDER,borderRadius:12,borderWidth:1,minWidth:0,overflow:'hidden'},cardSelected:{borderColor:c.COLORS.ACTION_PRIMARY,borderWidth:2},chip:{alignItems:'center',borderRadius:999,flexDirection:'row',paddingHorizontal:u.SPACING.SM,paddingVertical:u.SPACING.MICRO},chipNeutral:{backgroundColor:c.COLORS.BG_CHIP},chipOnColor:{backgroundColor:c.COLORS.OVERLAY_LIGHT_20},chipRow:{flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.XS,marginTop:u.SPACING.MICRO},chipText:{fontSize:f.FONT_SIZE.MICRO,fontWeight:'700',letterSpacing:.4,textTransform:'uppercase'},chipTextBody:{color:c.COLORS.TEXT_BODY},chipTextInverse:{color:c.COLORS.TEXT_INVERSE},identityCol:{flex:1,gap:u.SPACING.MICRO,minWidth:0},identityCopyRow:{alignItems:'center',flexDirection:'row',gap:u.SPACING.MICRO},identityCopyText:{flexShrink:1},identityTextBlock:{gap:u.SPACING.MICRO},imagePlaceholder:{color:c.COLORS.TEXT_MUTED,fontSize:f.FONT_SIZE.MICRO,fontWeight:'700',textAlign:'center'},imageWrap:{alignItems:'center',backgroundColor:c.COLORS.BG_WASH,borderColor:c.COLORS.BORDER,borderRadius:10,borderWidth:1,justifyContent:'center'},onColorMuted:{opacity:.75},onColorSecondary:{opacity:.85},labelDefault:{color:c.COLORS.TEXT_HEADING},labelLg:{fontSize:f.FONT_SIZE.XL,fontWeight:'700'},labelSm:{fontSize:f.FONT_SIZE.LG,fontWeight:'700'},metaDefault:{color:c.COLORS.TEXT_MUTED},metaStrip:{fontSize:f.FONT_SIZE.XS,lineHeight:18},modelDefault:{color:c.COLORS.TEXT_MUTED},modelLg:{fontSize:f.FONT_SIZE.SM},modelSm:{fontSize:f.FONT_SIZE.XS},primaryAction:Object.assign({alignItems:'center',backgroundColor:c.COLORS.ACTION_PRIMARY,borderRadius:6,paddingHorizontal:u.SPACING.MD,paddingVertical:u.SPACING.SM,width:'100%'},{cursor:'pointer'}),primaryActionText:{color:c.COLORS.TEXT_INVERSE,fontSize:f.FONT_SIZE.SM,fontWeight:'700'},secondaryAction:Object.assign({alignItems:'center',borderColor:c.COLORS.BORDER,borderRadius:6,borderWidth:1,paddingHorizontal:u.SPACING.MD,paddingVertical:u.SPACING.SM,width:'100%'},{cursor:'pointer'}),secondaryActionInverse:{backgroundColor:c.COLORS.OVERLAY_LIGHT_20,borderColor:c.COLORS.OVERLAY_LIGHT_40},secondaryActionText:{color:c.COLORS.TEXT_BODY,fontSize:f.FONT_SIZE.SM,fontWeight:'600'},secondaryActionTextInverse:{color:c.COLORS.TEXT_INVERSE,fontSize:f.FONT_SIZE.SM,fontWeight:'600'},statusDot:{borderRadius:4,height:8,width:8},statusPill:{alignItems:'center',backgroundColor:c.COLORS.BG_WASH,borderRadius:999,flexDirection:'row',gap:u.SPACING.XS,paddingHorizontal:u.SPACING.SM,paddingVertical:u.SPACING.MICRO},statusText:{color:c.COLORS.TEXT_BODY,fontSize:f.FONT_SIZE.MICRO,fontWeight:'700',letterSpacing:.4,textTransform:'uppercase'},telItemFlat:{flex:1,minWidth:0},telItemTile:{backgroundColor:c.COLORS.BG_WASH,borderRadius:8,flexBasis:100,flexGrow:1,flexShrink:1,padding:u.SPACING.SM},telItemTileHero:{flexBasis:140,padding:u.SPACING.MD},telLabelDefault:{color:c.COLORS.TEXT_MUTED,fontSize:f.FONT_SIZE.MICRO,fontWeight:'700',letterSpacing:.3,textTransform:'uppercase'},telLabelInverse:{color:c.COLORS.TEXT_INVERSE,fontSize:f.FONT_SIZE.MICRO,fontWeight:'700',letterSpacing:.3,opacity:.75,textTransform:'uppercase'},telRowFlat:{flexDirection:'row',gap:u.SPACING.MD},telRowTile:{flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.XS},telValueDefault:{color:c.COLORS.TEXT_HEADING,fontSize:f.FONT_SIZE.MD,fontWeight:'700',marginTop:u.SPACING.MICRO},telValueInverse:{color:c.COLORS.TEXT_INVERSE,fontSize:f.FONT_SIZE.MD,fontWeight:'700',marginTop:u.SPACING.MICRO},topRowGrid:{flexDirection:'row',gap:u.SPACING.MD},topRowHero:{flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.LG},wifiHolder:{marginTop:u.SPACING.MICRO}}),K=(0,s.createStyles)({body:{flex:1,gap:u.SPACING.MICRO,minWidth:0},iconBadge:{alignItems:'center',backgroundColor:c.COLORS.WARNING_BANNER_BORDER,borderRadius:14,height:28,justifyContent:'center',width:28},iconText:{color:c.COLORS.WARNING_BANNER_TEXT,fontSize:f.FONT_SIZE.MD,fontWeight:'700'},link:{color:c.COLORS.WARNING_BANNER_LINK,fontSize:f.FONT_SIZE.XS,fontWeight:'600',textDecorationLine:'underline'},notice:{alignItems:'center',backgroundColor:c.COLORS.WARNING_BANNER_BG,borderColor:c.COLORS.WARNING_BANNER_BORDER,borderRadius:10,borderWidth:1,flexDirection:'row',gap:u.SPACING.SM,padding:u.SPACING.SM},title:{color:c.COLORS.WARNING_BANNER_TEXT,fontSize:f.FONT_SIZE.SM,fontWeight:'700'}}),Q=(0,s.createStyles)({body:{flex:1,gap:u.SPACING.MICRO,minWidth:0},helpText:{color:c.COLORS.TEXT_MUTED,fontSize:f.FONT_SIZE.XS,lineHeight:17},iconBadge:{alignItems:'center',backgroundColor:c.COLORS.BG_SUBTLE_100,borderColor:c.COLORS.BORDER_DEFAULT,borderRadius:14,borderWidth:1,height:28,justifyContent:'center',width:28},iconText:{color:c.COLORS.TEXT_MUTED,fontSize:f.FONT_SIZE.SM,fontWeight:'700'},link:{color:c.COLORS.BRAND_PRIMARY,fontSize:f.FONT_SIZE.XS,fontWeight:'600',textDecorationLine:'underline'},notice:{alignItems:'flex-start',backgroundColor:c.COLORS.BG_WASH,borderColor:c.COLORS.BORDER_DEFAULT,borderRadius:10,borderWidth:1,flexDirection:'row',gap:u.SPACING.SM,padding:u.SPACING.SM},title:{color:c.COLORS.TEXT_BODY,fontSize:f.FONT_SIZE.SM,fontWeight:'700'}}),J=(0,s.createStyles)({body:{flex:1,gap:u.SPACING.MICRO,minWidth:0},helpText:{color:c.COLORS.TEXT_MUTED,fontSize:f.FONT_SIZE.XS,lineHeight:17},iconBadge:{alignItems:'center',backgroundColor:c.COLORS.BG_SUBTLE_100,borderColor:c.COLORS.BORDER_DEFAULT,borderRadius:14,borderWidth:1,height:28,justifyContent:'center',width:28},iconText:{color:c.COLORS.TEXT_MUTED,fontSize:f.FONT_SIZE.SM,fontWeight:'700'},link:{color:c.COLORS.BRAND_PRIMARY,fontSize:f.FONT_SIZE.XS,fontWeight:'600',textDecorationLine:'underline'},notice:{alignItems:'flex-start',backgroundColor:c.COLORS.BG_WASH,borderColor:c.COLORS.BORDER_DEFAULT,borderRadius:10,borderWidth:1,flexDirection:'row',gap:u.SPACING.SM,padding:u.SPACING.SM},title:{color:c.COLORS.TEXT_BODY,fontSize:f.FONT_SIZE.SM,fontWeight:'700'}}),ee=(0,s.createStyles)({card:{borderColor:c.COLORS.BORDER_FAINT},floatingPanel:{borderRadius:12,overflow:'hidden'}}),te=(0,s.createStyles)({card:{borderColor:c.COLORS.BORDER_DEFAULT}}),ne=(0,s.createStyles)({front:{position:'relative',zIndex:3},layer:{borderRadius:12,bottom:0,position:'absolute',right:0},layerBack:{left:14,top:14,zIndex:1},layerMid:{left:7,top:7,zIndex:2},wrap:{flex:1,marginBottom:14,marginRight:14,minWidth:0,position:'relative'}})},1153,[34,328,95,222,488,276,489,490,503,493,494,1154,1166,519,1137,1142,1167,1168,1143,1140,1169,1079,1170,1171,104]); 24__d(function(g,r,i,a,m,_e,d){"use strict";
24function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"COPYABLE_VALUE_ICON_TEST_ID",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"COPYABLE_VALUE_ICON_SLOT_TEST_ID",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"COPYABLE_VALUE_HOVER_TARGET_TEST_ID",{enumerable:!0,get:function(){return _}}),_e.CopyableValue=function({value:e,description:s,successMessage:c,shrinkable:x=!0,children:O}){const{copy:T}=(0,o.useClipboardCopy)({value:e,successMessage:c}),{hovered:j,webHoverProps:C}=(0,l.useWebHover)(),E=void 0!==C.onMouseEnter;return(0,f.jsx)(u.HoverTooltip,{text:`Click to copy ${s}`,children:(0,f.jsx)(n.default,Object.assign({style:x?S.hoverTarget:S.hoverTargetFixed,testID:_},C,{children:(0,f.jsxs)(t.default,{accessibilityRole:"button",accessibilityLabel:`Copy ${s}`,onPress:T,style:[x?S.pressable:S.pressableFixed,E&&v],children:[O,E?(0,f.jsx)(n.default,{style:S.iconSlot,testID:y,children:j?(0,f.jsx)(b.CopyIcon,{size:h,testID:p}):null}):null]})}))})};var t=e(r(d[0])),n=e(r(d[1])),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]),b=r(d[7]),f=r(d[8]);const p='copyable-value-icon',y='copyable-value-icon-slot',_='copyable-value-hover-target',h=14;const v={cursor:'pointer',userSelect:'text'},x={alignItems:'center',flexDirection:'row'},S=(0,c.createStyles)({hoverTarget:{flexShrink:1},hoverTargetFixed:{flexShrink:0},pressable:Object.assign({},x,{flexShrink:1}),pressableFixed:Object.assign({},x,{flexShrink:0}),iconSlot:{alignItems:'center',flexShrink:0,justifyContent:'center',marginLeft:s.SPACING.XS,width:h}})},1154,[488,276,493,1155,609,489,686,1165,104]); 25__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"COPY_FEEDBACK_DURATION_MS",{enumerable:!0,get:function(){return n}}),e.useClipboardCopy=function({value:p,successMessage:b}){const y=(0,c.useToast)(),[C,f]=(0,t.useState)(!1),T=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{null!==T.current&&clearTimeout(T.current)},[]);const _=(0,t.useCallback)(()=>{f(!0),null!==T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{T.current=null,f(!1)},n)},[]),v=(0,t.useCallback)(async()=>{try{await(0,u.writeTextToClipboard)(p)}catch(t){return l.logger.warn('Clipboard write failed',t),void y.error(s,{id:o})}_(),y.success(b,{id:o})},[_,b,y,p]),w=(0,t.useCallback)(()=>{''!==p.trim()&&v()},[v,p]);return{copied:C,copy:w}};var t=r(d[0]),c=r(d[1]),u=r(d[2]),l=r(d[3]);const n=2e3,o='clipboard-copy',s="Couldn't copy to the clipboard. Select the text and copy it manually."},1155,[34,496,1156,469]); 26__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.writeTextToClipboard=async function(t){if(!await e.setStringAsync(t))throw new Error('The system clipboard rejected the write.')};var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0]))},1156,[1157]); 27__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getStringAsync=async function(t={}){if(!c.default.getStringAsync)throw new n.UnavailabilityError('Clipboard','getStringAsync');return await c.default.getStringAsync(t)},_e.setStringAsync=async function(t,e={}){if(!c.default.setStringAsync)throw new n.UnavailabilityError('Clipboard','setStringAsync');return c.default.setStringAsync(t,e)},_e.setString=function(t){return c.default.setString(t)},_e.hasStringAsync=function(){if(!c.default.hasStringAsync)throw new n.UnavailabilityError('Clipboard','hasStringAsync');return c.default.hasStringAsync()},_e.getUrlAsync=async function(){if(!c.default.getUrlAsync)throw new n.UnavailabilityError('Clipboard','getUrlAsync');return await c.default.getUrlAsync()},_e.setUrlAsync=async function(t){if(!c.default.setUrlAsync)throw new n.UnavailabilityError('Clipboard','setUrlAsync');return c.default.setUrlAsync(t)},_e.hasUrlAsync=async function(){if(!c.default.hasUrlAsync)throw new n.UnavailabilityError('Clipboard','hasUrlAsync');return await c.default.hasUrlAsync()},_e.getImageAsync=async function(t){if(!c.default.getImageAsync)throw new n.UnavailabilityError('Clipboard','getImageAsync');return await c.default.getImageAsync(t)},_e.setImageAsync=async function(t){if(!c.default.setImageAsync)throw new n.UnavailabilityError('Clipboard','setImageAsync');return c.default.setImageAsync(t)},_e.hasImageAsync=async function(){if(!c.default.hasImageAsync)throw new n.UnavailabilityError('Clipboard','hasImageAsync');return c.default.hasImageAsync()},_e.addClipboardListener=function(t){return c.default.addListener(o,n=>{const e=Object.assign({},n,{get content(){return console.warn("The 'content' property of the clipboard event is deprecated. Use 'getStringAsync()' instead to get clipboard content"),''}});t(e)})},_e.removeClipboardListener=function(t){t.remove()},Object.defineProperty(_e,"isPasteButtonAvailable",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"ClipboardPasteButton",{enumerable:!0,get:function(){return e.ClipboardPasteButton}});var t,n=r(d[0]),e=r(d[1]),s=r(d[2]),c=(t=s)&&t.__esModule?t:{default:t},l=r(d[3]);Object.keys(l).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(_e,t)||Object.defineProperty(_e,t,{enumerable:!0,get:function(){return l[t]}})});const o='onClipboardChanged';const u=!1},1157,[890,1158,1160,1164]); 28__d(function(g,r,i,a,m,_e,d){"use strict";const e=["onPress"];
28function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ClipboardPasteButton=function(t){let{onPress:o}=t,l=(0,n.default)(t,e);if(!s.default)return null;return(0,u.jsx)(s.default,Object.assign({onPastePressed:({nativeEvent:e})=>{o(e)}},l))};var n=t(r(d[0]));r(d[1]);var s=t(r(d[2])),u=r(d[3])},1158,[109,34,1159,104]); 29__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});r(d[0]);r(d[1]);var t=void 0},1159,[890,95]); 30__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},1160,[1161]); 31__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),c={async getStringAsync(c){if(!navigator.clipboard)throw new t.ClipboardUnavailableException;try{if(c.preferredFormat===o.StringFormat.HTML){const t=await navigator.clipboard.read(),o=await(0,n.findHtmlInClipboardAsync)(t);return o?await new Response(o).text():await navigator.clipboard.readText()}{let t=await navigator.clipboard.readText();if(!t||''===t){const o=await navigator.clipboard.read(),c=await(0,n.findHtmlInClipboardAsync)(o),l=await(c?.text());t=(0,n.htmlToPlainText)(l??'')}return t}}catch(o){if('object'==typeof o&&'NotAllowedError'===o?.name||await(0,n.isClipboardPermissionDeniedAsync)())throw new t.NoPermissionException;try{return window.clipboardData.getData('Text')}catch{return Promise.reject(new Error('Unable to retrieve item from clipboard'))}}},setString(t){const n=document.createElement('textarea');n.textContent=t,document.body.appendChild(n),n.select();try{return document.execCommand('copy'),!0}catch{return!1}finally{document.body.removeChild(n)}},async setStringAsync(c,l){if(l.inputFormat===o.StringFormat.HTML){if(!navigator.clipboard)throw new t.ClipboardUnavailableException;try{const t=(s=c,new ClipboardItem({'text/html':new Blob([s],{type:'text/html'}),'text/plain':new Blob([(0,n.htmlToPlainText)(s)],{type:'text/plain'})}));return await navigator.clipboard.write([t]),!0}catch(o){if('object'==typeof o&&'NotAllowedError'===o?.name||await(0,n.isClipboardPermissionDeniedAsync)())throw new t.NoPermissionException;throw new t.CopyFailureException(o.message)}}try{if(!navigator.clipboard)throw new Error;return await navigator.clipboard.writeText(c),!0}catch{return this.setString(c)}var s},hasStringAsync:async()=>await l(['text/plain','text/html']),async getImageAsync(o){if(!navigator.clipboard)throw new t.ClipboardUnavailableException;try{const t=await navigator.clipboard.read(),o=await(0,n.findImageInClipboardAsync)(t);if(!o)return null;const[c,l]=await Promise.all([(0,n.blobToBase64Async)(o),(0,n.getImageSizeFromBlobAsync)(o)]);return{data:c,size:l}}catch(o){if('object'==typeof o&&'NotAllowedError'===o?.name||await(0,n.isClipboardPermissionDeniedAsync)())throw new t.NoPermissionException;throw new t.PasteFailureException(o.message)}},async setImageAsync(o){if(!navigator.clipboard)throw new t.ClipboardUnavailableException;try{const t=(0,n.base64toBlob)(o,'image/png');await navigator.clipboard.write([new ClipboardItem({[t.type]:t})])}catch(n){throw new t.CopyFailureException(n.message)}},hasImageAsync:async()=>await l(['image/png','image/jpeg']),addClipboardListener(){},removeClipboardListener(){}};async function l(o){if(!navigator.clipboard)throw new t.ClipboardUnavailableException;try{return(await navigator.clipboard.read()).flatMap(t=>t.types).some(t=>o.includes(t))}catch(o){if('object'==typeof o&&'NotAllowedError'===o?.name||await(0,n.isClipboardPermissionDeniedAsync)())throw new t.NoPermissionException;throw o}}},1161,[1162,1163,1164]); 32__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ClipboardUnavailableException",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"CopyFailureException",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PasteFailureException",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"NoPermissionException",{enumerable:!0,get:function(){return c}});var o=r(d[0]);class t extends o.CodedError{constructor(){super('ERR_CLIPBOARD_UNAVAILABLE',"The 'AsyncCl
32ipboard' API is not available on this browser")}}class n extends o.CodedError{constructor(o){super('ERR_COPY_FAILURE',`Failed to copy to clipboard: ${o}`)}}class s extends o.CodedError{constructor(o){super('ERR_COPY_FAILURE',`Failed to paste from clipboard: ${o}`)}}class c extends o.CodedError{constructor(){super('ERR_NO_PERMISSION','User denied permission to access clipboard')}}},1162,[890]); 33__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.base64toBlob=function(n,t){t=t||'';const o=1024,i=atob(n),s=i.length,c=Math.ceil(s/o),l=new Array(c);for(let n=0;n<c;++n){const t=n*o,c=Math.min(t+o,s),u=new Array(c-t);for(let n=t,o=0;n<c;++o,++n)u[o]=i[n].charCodeAt(0);l[n]=new Uint8Array(u)}return new Blob(l,{type:t})},e.blobToBase64Async=function(n){return new Promise((t,o)=>{const i=new FileReader;i.onloadend=()=>t(i.result),i.readAsDataURL(n)})},e.htmlToPlainText=function(n){const t=document.createElement('div');return t.innerHTML=n,t.textContent||t.innerText||''},e.getImageSizeFromBlobAsync=function(n){return new Promise((t,o)=>{const i=URL.createObjectURL(n),s=document.createElement('img');s.src=i,s.onload=function(){t({width:s.width,height:s.height})}})},e.findImageInClipboardAsync=async function(n){for(const t of n){if(t.types.some(n=>'image/png'===n))return await t.getType('image/png');if(t.types.some(n=>'image/jpeg'===n))return await t.getType('image/jpeg')}return null},e.findHtmlInClipboardAsync=async function(n){for(const t of n)if(t.types.some(n=>'text/html'===n))return await t.getType('text/html');return null},e.isClipboardPermissionDeniedAsync=async function(){return'denied'===(await navigator.permissions.query({name:'clipboard-read'})).state}},1163,[]); 34__d(function(g,r,i,a,m,e,d){"use strict";var t,n;Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ContentType",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"StringFormat",{enumerable:!0,get:function(){return n}}),(function(t){t.PLAIN_TEXT="plain-text",t.HTML="html",t.IMAGE="image",t.URL="url"})(t||(t={})),(function(t){t.PLAIN_TEXT="plainText",t.HTML="html"})(n||(n={}))},1164,[]); 35__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.CopyIcon=function(e){const{size:t=o.ICON_VIEWBOX_SIZE,color:c,testID:f}=e,I=c??n.COLORS.ACTION_PRIMARY,S=t/o.ICON_VIEWBOX_SIZE;return(0,l.jsxs)(s.default,{accessibilityElementsHidden:!0,style:O(t),testID:f,children:[(0,l.jsx)(s.default,{style:(0,o.strokeSegmentStyle)(y,_,t,I,u)}),(0,l.jsx)(s.default,{style:(0,o.strokeSegmentStyle)(_,h,t,I,u)}),(0,l.jsx)(s.default,{style:C(S,I)})]})},r(d[0]);var e,t=r(d[1]),s=(e=t)&&e.__esModule?e:{default:e},n=r(d[2]),o=r(d[3]),l=r(d[4]);const u=2,c=8,f=13,I=2.5,_=[3.5,3.5],y=[3.5,15],h=[15,3.5];function O(e){return{alignItems:'center',height:e,justifyContent:'center',width:e}}function C(e,t){return{borderColor:t,borderRadius:I*e,borderWidth:Math.max(1,u*e),height:f*e,left:c*e,position:'absolute',top:c*e,width:f*e}}},1165,[34,276,490,1189,104]); 36__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"COPY_FEEDBACK_DURATION_MS",{enumerable:!0,get:function(){return u.COPY_FEEDBACK_DURATION_MS}}),Object.defineProperty(_e,"COPY_ICON_TEST_ID",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"COPY_CHECK_TEST_ID",{enumerable:!0,get:function(){return f}}),_e.CopyButton=function({value:e,accessibilityLabel:l,successMessage:s,label:C="Copy",copiedLabel:S="Copied",variant:A="inline",color:R}){const{copied:P,copy:j}=(0,u.useClipboardCopy)({value:e,successMessage:s}),D='action'===A;return(0,b.jsxs)(n.default,{accessibilityRole:"button",accessibilityLabel:l,onPress:j,style:D?p.controlAction:p.controlInline,children:[(0,b.jsx)(o.default,{style:p.iconSlot,children:P?(0,b.jsx)(O.CheckIcon,{size:y,color:R??c.COLORS.GREEN_500,testID:f}):(0,b.jsx)(_.CopyIcon,{size:y,color:R??c.COLORS.ACTION_PRIMARY,testID:I})}),D?(0,b.jsx)(t.default,{numberOfLines:1,style:[p.captionAction,void 0!==R&&{color:R}],children:P?S:C}):null]})};var t=e(r(d[0])),n=e(r(d[1])),o=e(r(d[2])),c=r(d[3]),l=r(d[4]),s=r(
36d[5]),u=r(d[6]),C=r(d[7]),O=r(d[8]),_=r(d[9]),b=r(d[10]);const I='copy-button-icon',f='copy-button-check',y=16;const p=(0,C.createStyles)({captionAction:{color:c.COLORS.ACTION_PRIMARY,fontSize:s.FONT_SIZE.SM,fontWeight:'600'},controlAction:{alignItems:'center',borderColor:c.COLORS.BORDER_DEFAULT,borderRadius:6,borderWidth:1,flexDirection:'row',gap:l.SPACING.XS,justifyContent:'center',minHeight:32,paddingHorizontal:l.SPACING.MD,paddingVertical:l.SPACING.XS},controlInline:{alignItems:'center',justifyContent:'center',minHeight:24,minWidth:24},iconSlot:{alignItems:'center',justifyContent:'center'}})},1166,[222,488,276,490,493,494,1155,489,1190,1165,104]); 37__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isArchivedSensorMac=n,e.isArchivedSensor=function(t){if(!0===t.archived)return!0;return n(t.mac)};const t=/_old(?:_\d+)?$/iu;function n(n){return'string'==typeof n&&t.test(n)}},1167,[]); 38__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.formatSensorClipboardSummary=function(l){const t=[{label:'Name',value:(0,u.resolveSensorDisplayName)(l.label,l.sensorIndex)},{label:'Sensor index',value:String(l.sensorIndex)}],f=l.mac?.trim()??'';''!==f&&t.push({label:'Device ID',value:f});const v=l.model.trim();''!==v&&t.push({label:'Model',value:v});!0===l.archived&&t.push({label:'Archived',value:'Yes'});const b=(0,o.pm25ToAqi)(l.pm25);null!==b&&t.push({label:'Channel A US EPA PM2.5 AQI',value:String(b)});const h=(0,o.pm25ToAqi)(l.channelB?.pm25);null!==h&&t.push({label:'Channel B US EPA PM2.5 AQI',value:String(h)});l.confidencePercent>=0&&t.push({label:'Confidence',value:`${String(l.confidencePercent)}%`});const S=p(l.lastSeen,l.lastSeenMinutesAgo);null!==S&&t.push({label:'Last seen',value:S});null!=l.uptimeMinutes&&t.push({label:(0,u.getUptimeLabel)(l.onlineStatus),value:(0,u.formatDurationMinutes)(l.uptimeMinutes)});const M=p(l.lastModified,l.lastModifiedMinutesAgo);null!==M&&t.push({label:'Last modified',value:M});const A=l.firmwareVersion?.trim()??'',T=l.configuredFirmwareTarget?.trim()??'';''===A&&''===T||t.push({label:'Firmware',value:(0,u.formatFirmwareWithConfiguredTarget)(l.firmwareVersion,l.configuredFirmwareTarget)});const y=(0,u.formatLocationType)(l.locationType);''!==y&&t.push({label:'Location type',value:y});void 0!==l.hidden&&t.push({label:'Visibility',value:(0,u.formatVisibility)(l.hidden)});const C=(0,n.toCoord)(l.lat,l.lon);null!==C&&t.push({label:'Coordinates',value:(0,n.formatCoord)(C,s)});return t.map(c).join('\n')};var l=r(d[0]),n=r(d[1]),t=r(d[2]),o=r(d[3]),u=r(d[4]);const s=6;function c(l){return`${l.label}: ${(0,t.collapseToSingleLine)(l.value)}`}function p(n,t){const o=(0,l.formatIsoDateTime)(n,''),s=null==t?'':(0,u.formatMinutesAgo)(t);return''===o?''===s?null:s:''===s?o:`${o} (${s})`}},1168,[685,1058,1141,1137,1140]); 39__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.sensorImageUrl=function(t,s=100){if(null==t||!n.has(t))return null;return`https://static.purpleair.com/images/sensors/${t}/${s}x${s}.png`};const n=new Set(['PA-I','PA-I-TOUCH','PA-II','PA-II-FLEX','PA-II-SD','PA-II-ZEN'])},1169,[]); 40__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SensorSelectionCheckbox=function({sensor:t,selected:c,onToggle:l}){return(0,s.jsx)(n.SelectionCheckbox,{checked:c,accessibilityLabel:`Select ${o(t)} (sensor ${String(t.sensorIndex)})`,onPress:()=>{l(t)}})},r(d[0]);var n=r(d[1]),s=r(d[2]);function o(n){const s=n.label?.trim();return null!=s&&''!==s?s:`Sensor ${String(n.sensorIndex)}`}},1170,[34,1134,104]); 41__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.WifiSignal=function({rssiQuality:e,rssiDbm:n,disconnected:c=!1}){if(c)return(0,f.jsx)(t.default,{style:S.row,accessibilityLabel:"Wi-Fi: not connected",children:(0,f.jsx)(l.default,{style:S.disconnectedLabel,children:"Not connected"})});const{filled:o,label:O}=u(e),h=null==n?'':` ${String(n)} dBm`,y=0===o?s.COLORS.TEXT_PLACEHOLDER:s.COLORS.BRAND_PRIMARY;return(0,f.jsxs)(t.default,{style:S.row,children:[(0,f.jsx)(t.default,{style:S.bars,accessibilityLabel:`Wi-Fi: ${O}${h}`,children:b.map((e,l)=>{const n=l<o;return(0,f.jsx)(t.default,{style:[S.bar,{height:e,backgroundColor:n?y:s.COLORS.BORDER}]},`bar-${String(l)}`)})}),(0,f.jsx)(l.default,{style:S.label,children:O})]})},r(d[0]);var l=e(r(d[1])),t=e(r(d[2])),n=r(d[3]),s=r(d[4]),c=r(d[5]),o=r(d[6]),f=r(d[7
41]);function u(e){switch(e){case'excellent':return{filled:4,label:'Excellent'};case'good':return{filled:3,label:'Good'};case'fair':return{filled:2,label:'Fair'};case'weak':return{filled:1,label:'Weak'};case'very weak':return{filled:0,label:'Very weak'};case'no signal':return{filled:0,label:'No signal'};default:return{filled:0,label:'Unknown'}}}const b=[4,7,10,13];const S=(0,n.createStyles)({bar:{borderRadius:1,width:3},bars:{alignItems:'flex-end',flexDirection:'row',gap:2,height:14},label:{color:s.COLORS.TEXT_BODY,fontSize:o.FONT_SIZE.XS,fontWeight:'600'},disconnectedLabel:{color:s.COLORS.TEXT_MUTED,fontSize:o.FONT_SIZE.XS,fontWeight:'700'},row:{alignItems:'center',flexDirection:'row',gap:c.SPACING.XS}})},1171,[34,222,276,489,490,493,494,104]); 42__d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ResultLayoutToggle=function({layout:t,onChange:n,testID:s}){return(0,b.jsx)(l.default,Object.assign({style:S.toggle},null!=s?{testID:s}:{},{children:O.map(l=>{const s=t===l;return(0,b.jsx)(o.default,{style:[S.button,s&&S.buttonActive],onPress:()=>{n(l)},accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:'cards'===l?'Card view':'Table view',children:(0,b.jsx)(e.default,{style:[S.text,s&&S.textActive],children:f[l]})},l)})}))},r(d[0]);var e=t(r(d[1])),o=t(r(d[2])),l=t(r(d[3])),n=r(d[4]),s=r(d[5]),c=r(d[6]),u=r(d[7]),b=r(d[8]);const O=['cards','table'],f={cards:'Cards',table:'Table'};const S=(0,n.createStyles)({button:{paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.SM},buttonActive:{backgroundColor:s.COLORS.ACTION_PRIMARY},text:{color:s.COLORS.TEXT_BODY,fontSize:u.FONT_SIZE.SM,fontWeight:'500'},textActive:{color:s.COLORS.TEXT_INVERSE,fontWeight:'600'},toggle:{borderColor:s.COLORS.BORDER_DEFAULT,borderRadius:8,borderWidth:1,flexDirection:'row',overflow:'hidden'}})},1172,[34,222,488,276,489,490,493,494,104]); 43__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SensorHeroCard=function({sensor:t,onViewDetail:o,detailLoading:s,isPending:l,treatment:c,selection:u,archived:v=!1}){return(0,n.renderCardTreatment)(c,Object.assign({sensor:t,size:'hero',onViewDetail:o,detailLoading:s,isPending:l},null!=u?{selection:u}:{},{archived:v}))};var n=r(d[0])},1173,[1153]); 44__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.SensorSelectionModeControl=function({availableSensorCount:e,visible:n,onShow:l,onHide:o}){if(0===e)return null;return(0,f.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:n?'Finish selecting sensors':'Select sensors',onPress:n?o:l,style:p.modeButton,children:(0,f.jsx)(t.default,{style:p.modeButtonText,children:n?'Done':'Select'})})},_e.SensorSelectionActions=function({availableSensors:e,selectedSensors:c,onSelectAll:u,onDeselectAll:S,onClear:h,showBulkSelector:x,testID:C}){if(0===e.length||!x&&0===c.length)return null;const w=(0,b.buildExternalMultiSensorMapPath)(c),M=(0,b.buildExternalMultiSensorMapPath)(c,'selected-with-all'),O=y(w),T=new Set(c.map(e=>e.sensorIndex)),B=e.reduce((e,t)=>e+(T.has(t.sensorIndex)?1:0),0),I=e.length>0&&B===e.length,_=!!I||B>0&&'mixed',v=`${String(e.length)} sensor card${1===e.length?'':'s'}`;return(0,f.jsxs)(n.default,{style:p.controls,testID:C,children:[x&&(0,f.jsx)(o.SelectionCheckbox,{checked:_,accessibilityLabel:I?`Clear selection for all ${v}`:`Select all ${v}`,onPress:()=>{I?S(e):u(e)},visibleLabel:I?'All sensor cards selected':'Select all sensor cards'}),c.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(t.default,{style:p.count,children:[c.length," selected"]}),'ready'===w.status&&null===O&&(0,f.jsx)(l.ActionMenuButton,{label:"View on map",accessibilityLabel:`Choose how to view ${String(w.sensorCount)} selected sensor${1===w.sensorCount?'':'s'} on map`,items:[{id:'selected-only',label:'View selected only',accessibilityLabel:`View ${String(w.sensorCount)} selected sensor${1===w.sensorCount?'':'s'} only on map`,service:'mapBaseUrl',path:w.path},...'ready'===M.status?[{id:'selected-with-all',label:'View selected with all sensors',accessibilityLabel:`View ${String(M.sensorCount)} selected sensor${1===M.sensorCount?'':'s'} with all sensors on map`,service:'mapBaseUrl',path:M.path}]:[]]}),(0,f.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Clear selected sensors",onPress:h,style:p.textButton,children:(0,f.jsx)(t.default,{style:p.textButtonText,children:"Clear"})})]}),null!==O&&(0,f.jsx)(t.default,{style:p.message,children:O})]})},r(d[0]);var t=e(r(d[1])),s=e(r(d[2])),n=e(r(d[3])),l=r(d[4]),o=r(d[5]),c=r(d[6]),u=r(d[7]),S=r(d[8]),h=r(d[9]),b=r(d[10]),f=r(d[11]);function y(e){switch(e.status){case'ready':case'empty':return null;case'too-many-sensors':return'Map supports up to 100 selected sensors.';case'path-too-long':return'Select fewer sensors to view them on the map.';
44case'invalid-private-read-key':return'A selected private sensor has no usable map read key.';case'invalid-sensor':return'A selected sensor has an invalid map identity.';default:return e}}const p=(0,c.createStyles)({controls:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:S.SPACING.SM,justifyContent:'flex-end',marginBottom:S.SPACING.LG},count:{color:u.COLORS.TEXT_MUTED,fontSize:h.FONT_SIZE.SM},message:{color:u.COLORS.TEXT_MUTED,fontSize:h.FONT_SIZE.XS},modeButton:{alignItems:'center',borderColor:u.COLORS.BORDER_DEFAULT,borderRadius:7,borderWidth:1,justifyContent:'center',minHeight:32,paddingHorizontal:S.SPACING.MD},modeButtonText:{color:u.COLORS.TEXT_BODY,fontSize:h.FONT_SIZE.SM,fontWeight:'600'},textButton:{alignItems:'center',justifyContent:'center',minHeight:32,paddingHorizontal:S.SPACING.XS},textButtonText:{color:u.COLORS.BRAND_PRIMARY_DARK,fontSize:h.FONT_SIZE.SM,fontWeight:'600'}})},1174,[34,222,488,276,1175,1134,489,490,493,494,1080,104]); 45__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.computeActionMenuPosition=L,_e.ActionMenuButton=function({label:e,accessibilityLabel:u,items:h,testID:b="action-menu-trigger"}){const[y,f]=(0,t.useState)(!1),[x,P]=(0,t.useState)(null),[M,A]=(0,t.useState)(0),[j,v]=(0,t.useState)(null),_=(0,t.useRef)(null),E=(0,s.default)();if(0===h.length)return null;const T=()=>{f(!1),v(null)},w=L(x??{x:E.width-O-C,y:O,width:C,height:p},E,M);return(0,R.jsxs)(c.default,{children:[(0,R.jsxs)(l.default,{ref:_,accessibilityRole:"button",accessibilityLabel:u,accessibilityState:{expanded:y},"aria-haspopup":"menu",hitSlop:6,onPress:()=>{f(!0);const e=_.current;null!=e&&'function'==typeof e.measureInWindow&&e.measureInWindow((e,t,n,l)=>{P({x:e,y:t,width:n,height:l})})},style:({pressed:e})=>[I.trigger,e&&I.triggerPressed],testID:b,children:[(0,R.jsx)(o.default,{style:I.triggerLabel,testID:"action-menu-label",children:e}),(0,R.jsx)(c.default,{style:I.chevronFrame,children:(0,R.jsx)(c.default,{style:I.chevron,testID:"action-menu-chevron"})})]}),(0,R.jsx)(n.default,{visible:y,transparent:!0,animationType:"none",onRequestClose:T,children:(0,R.jsx)(l.default,{accessibilityLabel:"Close options menu",onPress:T,style:I.backdrop,children:(0,R.jsx)(l.default,{accessibilityRole:"menu",accessibilityViewIsModal:!0,onLayout:e=>{A(e.nativeEvent.layout.height)},style:[I.menu,w],children:h.map(e=>null==e.service?(0,R.jsx)(l.default,{accessibilityRole:"menuitem",accessibilityLabel:e.accessibilityLabel??e.label,onPointerEnter:()=>{v(e.id)},onPointerLeave:()=>{v(null)},onPress:()=>{T(),e.onSelect()},style:({pressed:t})=>[I.item,(t||j===e.id)&&I.itemHighlighted],children:(0,R.jsx)(o.default,{style:I.itemText,children:e.label})},e.id):(0,R.jsx)(c.default,{onPointerEnter:()=>{v(e.id)},onPointerLeave:()=>{v(null)},style:j===e.id&&I.itemHighlighted,children:(0,R.jsx)(S.ServiceExternalLink,{service:e.service,path:e.path,accessibilityLabel:e.accessibilityLabel??e.label,accessibilityRole:"menuitem",onPress:T,style:I.item,textStyle:I.itemText,children:e.label})},e.id))})})})]})};var t=r(d[0]),n=e(r(d[1])),l=e(r(d[2])),o=e(r(d[3])),s=e(r(d[4])),c=e(r(d[5])),u=r(d[6]),h=r(d[7]),b=r(d[8]),y=r(d[9]),f=r(d[10]),S=r(d[11]),R=r(d[12]);const C=240,O=8,x=0,p=32;function L(e,t,n){const l=Math.min(C,Math.max(0,t.width-16)),o=Math.min(Math.max(O,e.x),t.width-O-l),s=e.y+e.height+x;return{left:o,top:s+n<=t.height-O?s:Math.max(O,e.y-x-n),width:l}}const I=(0,f.createStyles)({backdrop:{flex:1},chevron:{borderBottomColor:u.COLORS.ACTION_PRIMARY,borderBottomWidth:2,borderRightColor:u.COLORS.ACTION_PRIMARY,borderRightWidth:2,height:7,transform:[{rotate:'45deg'}],width:7},chevronFrame:{alignItems:'center',height:16,justifyContent:'center',width:16},item:{justifyContent:'center',minHeight:36,paddingHorizontal:b.SPACING.MD,paddingVertical:b.SPACING.XS},itemHighlighted:{backgroundColor:u.COLORS.BRAND_BG_HOVER},itemText:{color:u.COLORS.TEXT_BODY,fontSize:y.FONT_SIZE.SM,fontWeight:'500'},menu:Object.assign({backgroundColor:u.COLORS.BG_SURFACE,borderColor:u.COLORS.BORDER_DEFAULT,borderRadius:7,borderWidth:1,overflow:'hidden',paddingVertical:0,position:'absolute'},h.ELEVATION.MEDIUM),trigger:{alignItems:'center',backgroundColor:u.COLORS.TRANSPARENT,borderRadius:7,borderWidth:0,flexDirection:'row',gap:b.SPACING.XS,justifyContent:'center',minHeight:p,paddingHorizontal:b.SPACING.SM},triggerLabel:{color:u.COLORS.ACTION_PRIMARY,fontSize:y.FONT_SIZE.SM,fontWeight:'500'},triggerPressed:{backgroundColor:u.COLORS.BLUE_50}})},1175,[34,544,369,222,552,276,490,503,493,494,489,522,104]); 46__d(function(g,r,i,a,m,_e,d){"use strict";
46function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.SensorTable=function({sensors:e,columns:u,columnVisibilityStorageKey:S,columnVisibility:h,onExport:b,filterPlaceholder:y="Filter results",emptyMessage:O="No sensors match the current filter.",selection:R,testID:w}){const[E,M]=(0,t.useState)(''),{width:A}=(0,x.useResponsive)(),[N,_]=(0,t.useState)(0),L=(0,s.useColumnVisibility)(u,null==h&&null!=S?{storageKey:S}:{}),{visibleColumns:j,hiddenIds:G,toggle:D,toggleAll:P}=h??L,k=(0,t.useMemo)(()=>(0,s.filterRows)(j,e,E),[j,e,E]),{sort:v,onSort:B,sortedRows:V}=(0,s.useTableSort)(k,j),X=V.reduce((e,t)=>e+(!0===R?.selectedMapTargetIndices.has(t.sensorIndex)?1:0),0),W=V.length>0&&X===V.length,z=!!W||X>0&&'mixed',F=`${String(V.length)} visible sensor row${1===V.length?'':'s'}`,H=(0,t.useMemo)(()=>({id:'selection',header:'Select',renderHeader:(0,f.jsx)(c.SelectionCheckbox,{checked:z,accessibilityLabel:W?`Clear selection for ${F}`:`Select all ${F}`,disabled:0===V.length,onPress:()=>{W?R?.deselectSensors(V):R?.selectSensors(V)}}),accessor:e=>e.sensorIndex,enableHiding:!1,enableSort:!1,width:64,render:e=>(0,f.jsx)(C.SensorSelectionCheckbox,{sensor:e,selected:!0===R?.selectedMapTargetIndices.has(e.sensorIndex),onToggle:()=>{R?.toggleSensor(e)}})}),[W,R,V,z,F]),$=(0,t.useMemo)(()=>null!=R?[H,...j]:j,[R,H,j]),Z=(0,t.useMemo)(()=>(0,s.tableContentWidth)($),[$]),K=(0,t.useMemo)(()=>{if(N<=0)return null;const e=A-2*p,t=Math.min(Z,e);if(t<=N)return null;return{width:t,marginHorizontal:-(t-N)/2}},[N,A,Z]),U=(0,t.useCallback)(()=>{b({columns:j,rows:V})},[b,j,V]),Y=(0,t.useCallback)(e=>{_(e.nativeEvent.layout.width)},[]),q=(0,t.useCallback)(e=>!0===R?.selectedMapTargetIndices.has(e.sensorIndex)?T.rowSelected:void 0,[R]);return(0,f.jsx)(n.default,{style:T.container,testID:w,onLayout:Y,children:(0,f.jsxs)(n.default,{style:K??void 0,children:[(0,f.jsxs)(n.default,{style:T.toolbar,children:[(0,f.jsx)(I.AppTextInput,{style:T.filterInput,value:E,onChangeText:M,placeholder:y,accessibilityLabel:"Filter results"}),(0,f.jsxs)(n.default,{style:T.toolbarActions,children:[(0,f.jsxs)(o.default,{style:T.rowCount,children:[V.length," row",1!==V.length?'s':'']}),(0,f.jsx)(s.ColumnSelector,{columns:u,hiddenIds:G,onToggle:D,onToggleAll:P}),(0,f.jsxs)(l.default,{style:T.exportButton,onPress:U,accessibilityRole:"button",accessibilityLabel:"Export CSV",children:[(0,f.jsx)(o.default,{style:T.exportButtonIcon,children:'\u2913'}),(0,f.jsx)(o.default,{style:T.exportButtonText,children:"Export CSV"})]})]})]}),(0,f.jsx)(s.ColumnTable,Object.assign({columns:$,rows:V,getRowKey:e=>String(e.sensorIndex),sort:v,onSort:B,getRowStyle:q,emptyMessage:O},null!=w?{testID:`${w}-table`}:{}))]})})};var t=r(d[0]),o=e(r(d[1])),l=e(r(d[2])),n=e(r(d[3])),s=r(d[4]),c=r(d[5]),u=r(d[6]),S=r(d[7]),h=r(d[8]),x=r(d[9]),b=r(d[10]),I=r(d[11]),C=r(d[12]),f=r(d[13]);const p=S.SPACING.XXL,T=(0,b.createStyles)({container:{marginTop:S.SPACING.LG},exportButton:{alignItems:'center',backgroundColor:u.COLORS.ACTION_PRIMARY,borderRadius:8,flexDirection:'row',gap:S.SPACING.XS,height:38,paddingHorizontal:S.SPACING.LG},exportButtonIcon:{color:u.COLORS.TEXT_INVERSE,fontSize:h.FONT_SIZE.MD,fontWeight:'700'},exportButtonText:{color:u.COLORS.TEXT_INVERSE,fontSize:h.FONT_SIZE.SM,fontWeight:'600'},filterInput:{backgroundColor:u.COLORS.TEXT_INVERSE,borderColor:u.COLORS.BORDER_DEFAULT,borderRadius:8,borderWidth:1,color:u.COLORS.TEXT_HEADING,flexGrow:1,flexShrink:1,fontSize:h.FONT_SIZE.MD,height:38,maxWidth:320,paddingHorizontal:S.SPACING.LG,paddingVertical:0},rowCount:{color:u.COLORS.TEXT_MUTED,fontSize:h.FONT_SIZE.SM,marginRight:S.SPACING.XS},rowSelected:{backgroundColor:u.COLORS.BG_WASH},toolbar:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:S.SPACING.MD,justifyContent:'space-between',marginBottom:S.SPACING.MD},toolbarActions:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:S.SPACING.SM}})},1176,[34,222,488,276,680,1134,490,493,494,553,489,711,1170,104]); 47__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SENSOR_SEARCH_COLUMN_VISIBILITY_KEY",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"SENSOR_SEARCH_COLUMNS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"SENSOR_OWNED_COLUMN_VISIBILITY_KEY",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"SENSOR_OWNED_COLUMNS",{enumerable:!0,get:function(){return l}}),r(d[0]);
47var t=r(d[1]),n=r(d[2]),s=r(d[3]);const o='sensor-search-table-columns';const c=[{id:'sensorIndex',header:'Sensor Index',type:'number',accessor:t=>t.sensorIndex,enableHiding:!1,render:n=>{return o=n.sensorIndex,(0,s.jsx)(t.ResponsiveTableText,{numberOfLines:1,children:String(o)});var o},exportValue:t=>String(t.sensorIndex),width:110},{id:'label',header:'Name',type:'string',accessor:t=>t.label,width:200},{id:'ownerEmail',header:'Owner Email',type:'string',accessor:t=>t.ownerEmail,width:230},{id:'mac',header:'Device ID',type:'string',accessor:t=>t.mac,width:160},{id:'model',header:'Model',type:'string',accessor:t=>t.model,width:120},{id:'onlineStatus',header:'Status',type:'string',accessor:t=>t.onlineStatus,width:100},{id:'lastSeenMinutesAgo',header:'Last Seen (min ago)',type:'number',accessor:t=>t.lastSeenMinutesAgo,width:150},{id:'firmwareVersion',header:'Firmware',type:'string',accessor:t=>(0,n.formatFirmwareWithConfiguredTarget)(t.firmwareVersion,t.configuredFirmwareTarget),width:150},{id:'readKey',header:'Read Key',type:'string',accessor:t=>t.readKey,defaultHidden:!0,width:170},{id:'locationType',header:'Location',type:'string',accessor:t=>(0,n.formatLocationType)(t.locationType)||'N/A',defaultHidden:!0,width:110},{id:'lat',header:'Latitude',type:'number',accessor:t=>t.lat,defaultHidden:!0,width:110},{id:'lon',header:'Longitude',type:'number',accessor:t=>t.lon,defaultHidden:!0,width:110},{id:'elevation',header:'Elevation (m)',type:'number',accessor:t=>t.elevation,defaultHidden:!0,width:120},{id:'pm25',header:'PM2.5',type:'number',accessor:t=>t.pm25,defaultHidden:!0,width:90},{id:'confidencePercent',header:'Confidence (%)',type:'number',accessor:t=>t.confidencePercent,defaultHidden:!0,width:130},{id:'temperature',header:'Temperature',type:'number',accessor:t=>t.temperature,defaultHidden:!0,width:120},{id:'humidity',header:'Humidity',type:'number',accessor:t=>t.humidity,defaultHidden:!0,width:110},{id:'rssi',header:'RSSI (dBm)',type:'number',accessor:t=>t.rssi,defaultHidden:!0,width:110},{id:'rssiQuality',header:'Signal Quality',type:'string',accessor:t=>t.rssiQuality,defaultHidden:!0,width:130},{id:'uptimeMinutes',header:'Uptime (min)',type:'number',accessor:t=>t.uptimeMinutes,defaultHidden:!0,width:120},{id:'hardwareDiscovered',header:'Hardware',type:'string',accessor:t=>t.hardwareDiscovered,defaultHidden:!0,width:140},{id:'hidden',header:'Visibility',type:'string',accessor:t=>(0,n.formatVisibility)(!0===t.hidden),defaultHidden:!0,width:100},{id:'archived',header:'Archived',type:'boolean',accessor:t=>t.archived,defaultHidden:!0,width:100},{id:'downgraded',header:'Downgraded',type:'boolean',accessor:t=>t.downgraded,defaultHidden:!0,width:120},{id:'lastModified',header:'Last Modified',type:'datetime',accessor:t=>t.lastModified,defaultHidden:!0,width:180},{id:'created',header:'Created',type:'datetime',accessor:t=>t.created,defaultHidden:!0,width:170}],u='my-sensors-table-columns',l=c.filter(t=>'ownerEmail'!==t.id)},1177,[34,687,1140,104]); 48__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.PublicDetailView=function({detail:x,onBack:j}){const{sensor:D}=x;return(0,b.jsxs)(t.SensorDetailCard,{sensorLabel:D.label,sensorModel:D.model,sensorIndex:D.sensorIndex,onlineStatus:D.onlineStatus,badges:(0,b.jsx)(t.HeaderBadge,{label:"Public"}),onBack:j,headline:(0,b.jsx)(s.SensorAqiHeadline,{pm25:D.pm25,size:"lg",offline:(0,c.isSensorOffline)(D.onlineStatus)}),children:[(0,b.jsxs)(u.DetailSection,{title:"Readings",children:[(0,b.jsx)(l.ChannelReadingsBand,{sensor:D,isPending:!1,edgeToEdge:!0,onToggleDowngrade:null}),(0,b.jsx)(n.ReadingsSupplement,{gas:D.gas,confidencePercent:D.confidencePercent})]}),(0,b.jsxs)(t.DetailInfoGrid,{children:[(0,b.jsx)(u.DetailSection,{title:"Status",children:(0,b.jsx)(u.DetailFieldList,{children:(0,o.buildPublicDetailStatusRows)(D).map(l=>(0,b.jsx)(u.DetailField,{label:l.label,value:l.value},l.label))})}),(0,b.jsx)(u.DetailSection,{title:"Hardware",children:(0,b.jsx)(u.DetailFieldList,{children:(0,o.buildPublicDetailHardwareRows)(D).map(l=>(0,b.jsx)(u.DetailField,{label:l.label,value:l.value},l.label))})}),(0,b.jsx)(u.DetailSection,{title:"Location",children:(0,b.jsx)(u.DetailFieldList,{children:(0,o.buildPublicDetailLocationRows)(D).map(l=>(0,b.jsx)(u.DetailField,{label:l.label,value:l.value},l.label))})})]})]})},r(d[0]);
48var l=r(d[1]),n=r(d[2]),s=r(d[3]),t=r(d[4]),o=r(d[5]),c=r(d[6]),u=r(d[7]),b=r(d[8])},1178,[34,1136,1139,1142,1144,1145,1140,1081,104]); 49__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.SearchView=function({searchText:e,onSearchTextChange:c,onSearch:u,loading:h,sensors:E,publicSensors:N,totalResults:_,hasSearched:R,onViewDetail:M,onViewPublicDetail:j,detailLoading:D,onUpdate:w,onArchive:G,pendingSensorIndices:P,isActionCoolingDown:X=()=>!1,isArchiveCoolingDown:v=()=>!1,canModifyOwner:H,canArchive:V,canViewArchiveHistory:B,canUseTableView:W=!1,showUnregisteredNotice:F=!1,onExportTable:k,selection:z,selectionModeVisible:U,onSelectionModeChange:Y}){const[Z,K]=(0,n.useState)('cards'),$=[...E,...N],q=W&&'table'===Z;return(0,A.jsxs)(t.default,{style:O.sharedStyles.section,children:[(0,A.jsxs)(t.default,{style:L.searchContainer,children:[(0,A.jsxs)(s.default,{style:L.searchLabel,children:["Search public sensors by sensor name or",' ',(0,A.jsx)(I.ExternalLink,{href:y,textStyle:L.searchLabelLink,inline:!0,children:"sensor index"}),' ',"(one per line)"]}),(0,A.jsx)(C.AppTextInput,{style:L.searchInput,value:e,onChangeText:c,placeholder:'e.g.\nMy Sensor\n1234',multiline:!0,numberOfLines:6,textAlignVertical:"top"}),(0,A.jsx)(o.default,{style:[L.searchButton,h&&L.buttonDisabled],onPress:()=>{u()},disabled:h,children:h?(0,A.jsx)(l.default,{color:S.COLORS.TEXT_INVERSE,size:"small"}):(0,A.jsx)(s.default,{style:L.searchButtonText,children:"Search"})})]}),_>0&&(0,A.jsxs)(t.default,{style:L.resultsContainer,children:[(0,A.jsxs)(t.default,{style:[L.resultsHeader,(U||z.selectedMapTargets.length>0)&&L.resultsHeaderWithSelectionActions],children:[(0,A.jsxs)(s.default,{style:L.resultsCount,children:[_," sensor",1!==_?'s':''," found"]}),(0,A.jsxs)(t.default,{style:L.resultsHeaderControls,children:[!q&&(0,A.jsx)(p.SensorSelectionModeControl,{availableSensorCount:$.length,visible:U,onShow:()=>{Y(!0)},onHide:()=>{Y(!1)}}),W&&E.length>0&&(0,A.jsx)(T.ResultLayoutToggle,{layout:Z,onChange:e=>{K(e),'cards'===e&&z.selectedMapTargets.length>0&&Y(!0)}})]})]}),(0,A.jsx)(p.SensorSelectionActions,{availableSensors:$,selectedSensors:z.selectedMapTargets,onSelectAll:z.selectSensors,onDeselectAll:z.deselectSensors,onClear:z.clearSelection,showBulkSelector:!q&&U}),q&&null!=k?(0,A.jsx)(b.SensorTable,{sensors:E,columns:f.SENSOR_SEARCH_COLUMNS,columnVisibilityStorageKey:f.SENSOR_SEARCH_COLUMN_VISIBILITY_KEY,onExport:k,selection:z,testID:"sensor-search-table"}):E.length>0&&E.map(e=>(0,A.jsx)(x.SensorResultCard,Object.assign({sensor:e},U?{selection:{selected:z.selectedMapTargetIndices.has(e.sensorIndex),onToggle:z.toggleSensor}}:{},{isPending:P.has(e.sensorIndex),isActionCoolingDown:(n,t)=>X(e.sensorIndex,n,t),isArchiveCoolingDown:v(e.sensorIndex),canModifyOwner:H,canArchive:V,canViewArchiveHistory:B},U?{archiveHistorySelection:{selectedMapTargetIndices:z.selectedMapTargetIndices,onToggle:z.toggleArchiveHistory}}:{},{showUnregisteredNotice:F,onApplyAction:(n,t,s)=>{w(e.sensorIndex,n,t,s)},onArchive:()=>{G(e.sensorIndex,e.label)},onViewDetail:()=>{M(e.sensorIndex)}}),`owner-${String(e.sensorIndex)}`)),N.length>0&&(0,A.jsxs)(t.default,{style:L.publicSection,children:[(0,A.jsx)(s.default,{style:L.publicSectionLabel,children:"Public sensors (not yours)"}),N.map(e=>(0,A.jsx)(x.PublicSensorResultCard,Object.assign({sensor:e},U?{selection:{selected:z.selectedMapTargetIndices.has(e.sensorIndex),onToggle:z.toggleSensor}}:{},{onViewDetail:()=>{j(e.sensorIndex)},detailLoading:D}),`public-${String(e.sensorIndex)}`))]})]}),R&&0===_&&!h&&(0,A.jsx)(t.default,{style:L.emptyState,children:(0,A.jsx)(s.default,{style:L.emptyStateText,children:"No sensors found."})})]})};var n=r(d[0]),t=e(r(d[1])),s=e(r(d[2])),o=e(r(d[3])),l=e(r(d[4]));r(d[5]);var c=r(d[6]),S=r(d[7]),u=r(d[8]),h=r(d[9]),C=r(d[10]),I=r(d[11]),T=r(d[12]),x=r(d[13]),p=r(d[14]),O=r(d[15]),b=r(d[16]),f=r(d[17]),A=r(d[18]);const y='https://community.purpleair.com/t/sensor-indexes-and-read-keys/4000/1';const L=(0,c.createStyles)({buttonDisabled:{opacity:.6},emptyState:{alignItems:'center',marginTop:u.SPACING.XXXL,padding:u.SPACING.XXL},emptyStateText:{color:S.COLORS.TEXT_MUTED,fontSize:h.FONT_SIZE.LG},publicSection:{marginTop:u.SPACING.XL},publicSectionLabel:{color:S.COLORS.TEXT_HEADING,fontSize:h.FONT_SIZE.MD,fontWeight:'600',marginBottom:u.SPACING.XS},resultsContainer:{marginTop:u.SPACING.XXXL},resultsCount:{color:S.COLORS.TEXT_BODY,fontSize:h.FONT_SIZE.LG,fontWeight:'600'},resultsHeader:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.SM,justifyContent:'space-between',marginBottom:u.SPACING.LG},resultsHeaderWithSelectionActions:{marginBottom:u.SPACING.SM},resultsHeaderControls:{alignItems:'center',flexDirection:'row',flexShrink:1,flexWrap:'wrap',gap:u.SPACING.SM,justifyContent:'flex-end'},searchButton:{alignItems:'center',backgroundColor:S.COLORS.ACTION_PRIMARY,borderRadius:8,marginTop:u.SPACING.MD,paddingVertical:u.SPACING.LG},searchButtonText:{color:S.COLORS.TEXT_INVERSE,fontSize:h.FONT_SIZE.LG,fontWeight:'600'},searchContainer:{},searchInput:Object.assign({backgroundColor:S.COLORS.TEXT_INVERSE,borderColor:S.COLORS.BORDER_DEFAULT,borderRadius:8,borderWidth:1,color:S.COLORS.TEXT_HEADING,fontFamily:h.FONT_FAMILY.W
49EB_MONOSPACE,fontSize:h.FONT_SIZE.MD,minHeight:140,paddingHorizontal:u.SPACING.LG,paddingVertical:u.SPACING.MD},{outlineColor:S.COLORS.ACTION_PRIMARY}),searchLabel:{color:S.COLORS.TEXT_BODY,fontSize:h.FONT_SIZE.LG,fontWeight:'500',marginBottom:u.SPACING.SM},searchLabelLink:{color:S.COLORS.TEXT_BODY,fontWeight:'500',textDecorationLine:'underline'}})},1179,[34,276,222,488,410,95,489,490,493,494,711,519,1172,1180,1174,1081,1176,1177,104]); 50__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"FOOTER_COPY_SLOT_TEST_ID",{enumerable:!0,get:function(){return G}}),_e.SensorResultCard=function({sensor:e,isPending:n,isActionCoolingDown:t=()=>!1,isArchiveCoolingDown:o=!1,canModifyOwner:l,canArchive:s=!1,canViewArchiveHistory:c=!1,archiveHistorySelection:u,showUnregisteredNotice:S=!1,selection:h,onApplyAction:p,onArchive:f,onViewDetail:C}){return(0,v.jsxs)(_,{sensor:e,selected:!0===h?.selected,children:[(0,v.jsx)(W,Object.assign({sensor:e,privacyLabel:(0,P.formatVisibility)(e.hidden)},null!=h?{selectionControl:(0,v.jsx)(j.SensorSelectionCheckbox,{sensor:e,selected:h.selected,onToggle:h.onToggle})}:{})),e.archived&&(0,v.jsx)(F,{}),S&&'unregistered'===e.locationType&&(0,v.jsx)(k,{}),(0,v.jsx)(b.ChannelReadingsBand,{sensor:e,isPending:n,isChannelCoolingDown:n=>{const o='A'===n?e.downgraded:!0===e.channelB?.downgraded;return t(o?'CLEAR_DOWNGRADED':'SET_DOWNGRADED',n)},onToggleDowngrade:e.archived&&!l?null:n=>{const t='A'===n?e.downgraded:!0===e.channelB?.downgraded;p(t?'CLEAR_DOWNGRADED':'SET_DOWNGRADED',void 0,n)}}),(0,v.jsx)(B,{sensor:e,isPublic:!1}),(0,v.jsx)(w,{}),(0,v.jsx)(V,Object.assign({sensor:e,isPending:n,isActionCoolingDown:t,isArchiveCoolingDown:o,canModifyOwner:l,canArchive:s,onApplyAction:p},void 0!==f?{onArchive:f}:{},{onViewDetail:C})),c&&e.archiveHistory.length>0&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(w,{}),(0,v.jsx)(T.ArchiveHistoryGrid,Object.assign({archiveHistory:e.archiveHistory},null!=u?{selection:u}:{}))]})]})},_e.PublicSensorResultCard=function({sensor:e,selection:n,onViewDetail:s,detailLoading:c}){const{isPhone:u}=(0,h.useResponsive)();return(0,v.jsxs)(_,{sensor:e,selected:!0===n?.selected,children:[(0,v.jsx)(W,Object.assign({sensor:e,privacyLabel:"Public"},null!=n?{selectionControl:(0,v.jsx)(j.SensorSelectionCheckbox,{sensor:e,selected:n.selected,onToggle:n.onToggle})}:{})),(0,v.jsx)(b.ChannelReadingsBand,{sensor:e,isPending:!1,onToggleDowngrade:null}),(0,v.jsx)(B,{sensor:e,isPublic:!0}),(0,v.jsx)(w,{}),(0,v.jsxs)(l.default,{style:[U.publicFooter,u&&U.publicFooterPhone],children:[(0,v.jsx)(E.SensorMapLink,{sensor:e,style:U.linkButton,textStyle:U.linkButtonText}),(0,v.jsx)(o.default,{style:U.detailsLinkButton,onPress:s,disabled:c,children:(0,v.jsx)(t.default,{style:U.detailsLinkText,children:"Details \u2192"})}),(0,v.jsx)(l.default,{style:U.footerTrailingAction,testID:G,children:(0,v.jsx)(C.CopyButton,{value:(0,R.formatSensorClipboardSummary)(e),accessibilityLabel:"Copy sensor details",successMessage:"All sensor details copied",label:"Copy details",variant:"action"})})]})]})};var n=e(r(d[0]));r(d[1]);var t=e(r(d[2])),o=e(r(d[3])),l=e(r(d[4])),s=r(d[5]),c=r(d[6]),u=r(d[7]),S=r(d[8]),h=r(d[9]),p=r(d[10]),f=r(d[11]),C=r(d[12]),x=r(d[13]),O=r(d[14]),T=r(d[15]),b=r(d[16]),A=r(d[17]),I=r(d[18]),R=r(d[19]),N=r(d[20]),P=r(d[21]),y=r(d[22]),M=r(d[23]),E=r(d[24]),j=r(d[25]),D=r(d[26]),L=r(d[27]),v=r(d[28]);const G='sensor-card-footer-copy-slot';function _({sensor:e,children:n,selected:t=!1}){const o=(0,O.pm25ToAqi)(e.pm25),s=(0,N.getSearchResultStripeColor)(e.onlineStatus,o);return(0,v.jsxs)(l.default,{style:[U.card,t&&U.cardSelected],children:[(0,v.jsx)(l.default,{style:[U.aqiStripe,{backgroundColor:s}]}),(0,v.jsx)(l.default,{style:U.cardContent,children:n})]})}function w(){return(0,v.jsx)(l.default,{style:U.divider})}function W({sensor:e,privacyLabel:n,selectionControl:o}){const{isPhone:s}=(0,h.useResponsive)(),c=(0,P.getStatusColor)(e.onlineStatus),u=(0,y.sensorImageUrl)(e.model,100),S=(0,P.resolveSensorDisplayName)(e.label,e.sensorIndex),p=(0,O.pm25ToAqi)(e.pm25),C=(0,O.getAqiColor)(p),x=(0,O.getAqiOnColor)(p),T=(0,O.getAqiCategory)(p),b=e.mac?.trim()??'',A='none'!==(0,I.resolveDowngradeScope)(e),R=(0,P.formatLocationType)(e.locationType);return(0,v.jsxs)(l.default,{style:[U.headerBand,s&&U.headerBandPhone],children:[o,(0,v.jsx)(z,{imageUrl:u,model:e.model,isPhone:s}),(0,v.jsxs)(l.default,{style:U.headerContent,children:[(0,v.jsxs)(l.default,{style:U.headerTitleLine,children:[(0,v.jsx)(l.default,{style:[U.statusDot,{backgroundColor:c}]}),(0,v.jsx)(f.CopyableValue,{value:S,description:"sensor name",successMessage:"Sensor name copied",children:(0,v.jsx)(t.default,{style:[U.label,s&&U.labelPhone],numberOfLines:s?2:void 0,children:S})}),(0,v.jsx)(q,{status:e.onlineStatus}),(0,v.jsx)(Z,{label:n,tone:"muted",testID:"sensor-privacy-chip"}),(0,v.jsx)(Z,{label:R,tone:"muted",testID:"sensor-location-chip"}),A&&(0,v.jsx)(Z,{label:"Downgraded",tone:"warning"})]}),(0,v.jsxs)(l.default,{style:U.headerMetaLine,children:[(0,v.jsx)(t.default,{style:U.model,numberOfLines:1,children:e.model}),(0,v.jsx)(f.CopyableValue,{value:String(e.sensorIndex),description:"sensor index",successMessage:"Sensor index copied",children:(0,v.jsx)(t.default,{style:U.sensorId,numberOfLines:1,children:`Sensor index: ${String(e.sensorIndex)}`})})]}),s&&''!==b&&(0,v.jsx)(f.CopyableValue,{value:b,description:"Device ID",successMessage:"Device ID copied",children:(0,v.jsx)(t.default,{style:U.headerMacValuePhone,numberOfLines:1,children:`Device ID: ${b}`})})]}),!s&&''!==b&&(0,v.jsxs)(l.default,{style:U.headerMacSlot,children:[(0,v.jsx)(t.default,{style:U.headerMacLabel,numberOfLines:1,children:"Device ID"}),(0,v.jsx)(f.CopyableValue,{value:b,description:"Device ID",successMessage:"Device ID copied",children:(0,v.jsx)(t.default,{style:U.headerMacValue,numberOfLines:1,children:b})})]}),(0,v.jsx)(X,{aqi:p,category:T,bandColor:C,onColor:x,isPhone:s})]})}function B({sensor:e,isPublic:n}){const{isPhone:t}=(0,h.useResponsive)(),o=[{label:'Last seen',value:(0,P.formatMinutesAgo)(e.lastSeenMinutesAgo)},{label:'Last modified',value:(0,P.formatMinutesAgo)(e.lastModifiedMinutesAgo)}];n||o.push({label:'Last update check',value:(0,P.formatMinutesAgo)(e.lastUpdateCheckMinutesAgo??null)}),o.push({label:(0,P.getUptimeLabel)(e.onlineStatus),value:(0,P.formatDurationMinutes)(e.uptimeMinutes)},{label:'RSSI',value:(0,P.formatRssi)(e.rssi,e.rssiQuality)}),e.confidencePercent>=0&&o.push({label:'Confidence',value:`${String(e.confidencePercent)}%`});const s=[{label:'Firmware',value:(0,P.formatFirmwareWithConfiguredTarget)(e.firmwareVersion,e.configuredFirmwareTarget)},{label:'Hardware',value:e.hardwareDiscovered??'N/A',wrap:!0}];null!=e.particleRatioHigh&&s.push(Object.assign({label:'Particle ratio',value:e.particleRatioHigh?'HIGH':'LOW'},e.particleRatioHigh?{}:{tone:'alert'})),s.push({label:'Gas',value:(0,P.formatMeasurement)(e.gas)});const c=(0,p.toCoord)(e.lat,e.lon),u=[{label:'Type',value:(0,P.formatLocationType)(e.locationType)||'N/A'}];return n||void 0===e.hidden||u.push({label:'Visibility',value:(0,P.formatVisibility)(e.hidden)}),u.push({label:'Coordinates',value:null===c?'N/A':(0,p.formatCoord)(c,5),monospace:!0},{label:'Elevation',value:null==e.elevation?'N/A':`${String(e.elevation)} m`},{label:'Position',value:(0,P.formatPositionRating)(e.positionRating)}),(0,v.jsxs)(l.default,{style:[U.dataGrid,t&&U.dataGridPhone],children:[(0,v.jsx)(H,{title:"Activity",fields:o}
50),(0,v.jsx)(H,{title:"Hardware",fields:s}),(0,v.jsx)(H,{title:"Location",fields:u})]})}function V({sensor:e,isPending:n,isActionCoolingDown:s=()=>!1,isArchiveCoolingDown:c=!1,canModifyOwner:u,canArchive:S,onApplyAction:p,onArchive:f,onViewDetail:x}){const{isPhone:O}=(0,h.useResponsive)(),[T,b]=(0,L.useServerReconciledTextInput)(e.ownerEmail??''),[I,N]=(0,L.useServerReconciledTextInput)(e.configuredFirmwareTarget??''),[P,y]=(0,L.useServerReconciledTextInput)(null!=e.brightness?String(e.brightness):''),j=e.ownerEmail?.trim()??'',_=e.firmwareVersion?.trim()??'';return e.archived?(0,v.jsx)(l.default,{style:[U.managementBand,O&&U.managementBandPhone],children:(0,v.jsxs)(l.default,{style:U.managementActions,children:[(0,v.jsx)(E.SensorMapLink,{sensor:e}),(0,v.jsx)(o.default,{style:U.detailsLinkButton,onPress:x,children:(0,v.jsx)(t.default,{style:U.detailsLinkText,children:"Details \u2192"})}),(0,v.jsx)(l.default,{style:U.footerTrailingAction,testID:G,children:(0,v.jsx)(C.CopyButton,{value:(0,R.formatSensorClipboardSummary)(e),accessibilityLabel:"Copy sensor details",successMessage:"All sensor details copied",label:"Copy details",variant:"action"})})]})}):(0,v.jsxs)(l.default,{style:[U.managementBand,O&&U.managementBandPhone],children:[(0,v.jsx)(t.default,{style:U.sectionTitle,children:"Management"}),(0,v.jsxs)(M.ManagementInputGrid,{children:[u?(0,v.jsx)(M.ManagementInputRow,{label:"Owner",value:T,onChangeText:b,placeholder:"[email protected]",isPending:n,setDisabled:s('SET_OWNER'),onSet:()=>{p('SET_OWNER',T)},setVariant:"neutralStrong",width:"wide"}):(0,v.jsx)(M.ReadOnlyManagementRow,{label:"Owner",value:''!==j?j:'N/A',width:"wide"}),u?(0,v.jsx)(M.ManagementInputRow,{label:"Firmware",value:I,onChangeText:N,placeholder:"e.g. 7.04",isPending:n,setDisabled:s('SET_ACTIVE_FIRMWARE_TARGET'),onSet:()=>{p('SET_ACTIVE_FIRMWARE_TARGET',I.trim())},setVariant:"neutralStrong",width:"medium"}):(0,v.jsx)(M.ReadOnlyManagementRow,{label:"Firmware",value:''!==_?_:'N/A',width:"medium"}),(0,v.jsx)(M.ManagementInputRow,{label:"Brightness",value:P,onChangeText:y,placeholder:"0-100",keyboardType:"numeric",isPending:n,setDisabled:s('SET_BRIGHTNESS'),onSet:()=>{p('SET_BRIGHTNESS',P)},setVariant:"neutralStrong",width:"narrow"}),(0,v.jsx)(l.default,{style:U.ledModeInputRow,children:(0,v.jsx)(A.LedModeManagementControl,{ledMode:e.ledMode,isPending:n,isSetCoolingDown:s('SET_LED_MODE'),onSet:e=>{p('SET_LED_MODE',e)}})})]}),(0,v.jsxs)(l.default,{style:U.managementActions,children:[(0,v.jsx)(D.ActionButton,{label:e.shareKeys?'Disable Share Keys':'Enable Share Keys',onPress:()=>{p(e.shareKeys?'CLEAR_SHARE_KEYS':'SET_SHARE_KEYS')},variant:"neutralStrong",disabled:n||s(e.shareKeys?'CLEAR_SHARE_KEYS':'SET_SHARE_KEYS')}),u&&(0,v.jsx)(D.ActionButton,{label:"Request Location Verification",onPress:()=>{p('VERIFY_LOCATION')},variant:"neutralStrong",disabled:n||s('VERIFY_LOCATION')}),S&&void 0!==f&&(0,v.jsx)(D.ActionButton,{label:"Archive Sensor",onPress:f,variant:"danger",disabled:n||c}),(0,v.jsx)(E.SensorMapLink,{sensor:e}),(0,v.jsx)(o.default,{style:U.detailsLinkButton,onPress:x,children:(0,v.jsx)(t.default,{style:U.detailsLinkText,children:"Details \u2192"})}),(0,v.jsx)(l.default,{style:U.footerTrailingAction,testID:G,children:(0,v.jsx)(C.CopyButton,{value:(0,R.formatSensorClipboardSummary)(e),accessibilityLabel:"Copy sensor details",successMessage:"All sensor details copied",label:"Copy details",variant:"action"})})]})]})}function F(){const{isPhone:e}=(0,h.useResponsive)();return(0,v.jsxs)(l.default,{style:[U.archivedNotice,e&&U.archivedNoticePhone],children:[(0,v.jsx)(t.default,{style:U.archivedNoticeTitle,children:"Archived"}),(0,v.jsx)(t.default,{style:U.archivedNoticeText,children:"This archived sensor no longer receives new readings."})]})}function k(){const{isPhone:e}=(0,h.useResponsive)();return(0,v.jsxs)(l.default,{style:[U.unregisteredNotice,e&&U.unregisteredNoticePhone],children:[(0,v.jsx)(t.default,{style:U.unregisteredNoticeTitle,children:"Unregistered"}),(0,v.jsx)(t.default,{style:U.unregisteredNoticeText,children:"This sensor has not been registered."})]})}
50function H({title:e,fields:n}){const{isPhone:o}=(0,h.useResponsive)();return(0,v.jsxs)(l.default,{style:[U.dataColumn,o&&U.dataColumnPhone],children:[(0,v.jsx)(t.default,{style:[U.sectionTitle,U.dataColumnTitle],children:e}),n.map(e=>(0,v.jsxs)(l.default,{style:U.dataField,children:[(0,v.jsx)(t.default,{style:U.dataLabel,children:e.label}),(0,v.jsx)(t.default,{style:[U.dataValue,!0===e.monospace&&U.dataValueMono,!0===e.wrap&&U.dataValueWrap,'alert'===e.tone&&U.dataValueAlert],numberOfLines:!0===e.wrap?void 0:1,children:e.value})]},e.label))]})}function z({imageUrl:e,model:o,isPhone:s}){const c=s?U.thumbnailPhone:null;return null===e?(0,v.jsx)(l.default,{style:[U.thumbnail,U.thumbnailFallback,c],children:(0,v.jsx)(t.default,{style:U.thumbnailFallbackText,numberOfLines:1,children:o})}):(0,v.jsx)(n.default,{source:{uri:e},style:[U.thumbnail,c],resizeMode:"contain",accessibilityIgnoresInvertColors:!0})}function X({aqi:e,category:n,bandColor:o,onColor:s,isPhone:c}){return(0,v.jsx)(x.HoverTooltip,{text:O.AQI_TOOLTIP_TEXT,children:(0,v.jsxs)(l.default,{style:[U.aqiPill,c&&U.aqiPillPhone,{backgroundColor:o}],children:[(0,v.jsx)(t.default,{style:[U.aqiPillValue,c&&U.aqiPillValuePhone,{color:s}],children:null===e?'\u2014':String(e)}),!c&&(0,v.jsx)(t.default,{style:[U.aqiPillCategory,{color:s}],children:null===e?'No data':n})]})})}function Z({label:e,tone:n,testID:o}){const s='warning'===n?U.chipWarning:'update'===n?U.chipUpdate:U.chipMuted,c='warning'===n?U.chipTextWarning:'update'===n?U.chipTextUpdate:U.chipTextMuted;return(0,v.jsx)(l.default,{style:[U.chip,s],testID:o,children:(0,v.jsx)(t.default,{style:[U.chipText,c],children:e})})}function q({status:e}){return'online'===e?null:(0,v.jsx)(Z,{label:e,tone:"muted"})}const U=(0,s.createStyles)({aqiPill:{alignItems:'center',borderRadius:6,flexDirection:'row',flexShrink:0,gap:u.SPACING.SM,paddingHorizontal:u.SPACING.MD,paddingVertical:u.SPACING.SM},aqiPillCategory:{fontSize:S.FONT_SIZE.SM,fontWeight:'600'},aqiPillPhone:{height:44,justifyContent:'center',minWidth:44,paddingHorizontal:u.SPACING.SM,paddingVertical:0},aqiPillValue:{fontSize:S.FONT_SIZE.XXL,fontVariant:['tabular-nums'],fontWeight:'700'},aqiPillValuePhone:{fontSize:S.FONT_SIZE.LG},aqiStripe:{alignSelf:'stretch',width:4},archivedNotice:{backgroundColor:c.COLORS.WARNING_BG,borderTopColor:c.COLORS.BORDER,borderTopWidth:1,gap:u.SPACING.MICRO,paddingHorizontal:u.SPACING.LG,paddingVertical:u.SPACING.SM},archivedNoticePhone:{paddingHorizontal:u.SPACING.MD},archivedNoticeText:{color:c.COLORS.TEXT_BODY,fontSize:S.FONT_SIZE.SM},archivedNoticeTitle:{color:c.COLORS.WARNING_DARK,fontSize:S.FONT_SIZE.SM,fontWeight:'700'},unregisteredNotice:{backgroundColor:c.COLORS.ERROR_BG,borderTopColor:c.COLORS.BORDER,borderTopWidth:1,gap:u.SPACING.MICRO,paddingHorizontal:u.SPACING.LG,paddingVertical:u.SPACING.SM},unregisteredNoticePhone:{paddingHorizontal:u.SPACING.MD},unregisteredNoticeText:{color:c.COLORS.TEXT_BODY,fontSize:S.FONT_SIZE.SM},unregisteredNoticeTitle:{color:c.COLORS.ERROR,fontSize:S.FONT_SIZE.SM,fontWeight:'700'},card:{backgroundColor:c.COLORS.TEXT_INVERSE,borderColor:c.COLORS.BORDER,borderRadius:10,borderWidth:1,flexDirection:'row',marginBottom:u.SPACING.LG,overflow:'hidden'},cardSelected:{borderColor:c.COLORS.ACTION_PRIMARY,borderWidth:2},cardContent:{flex:1,minWidth:0},chip:{borderRadius:3,paddingHorizontal:u.SPACING.SM,paddingVertical:u.SPACING.MICRO},chipMuted:{backgroundColor:c.COLORS.BG_SUBTLE_100},chipText:{fontSize:S.FONT_SIZE.XS,fontWeight:'600',letterSpacing:.3,textTransform:'uppercase'},chipTextMuted:{color:c.COLORS.TEXT_MUTED},chipTextUpdate:{color:c.COLORS.WARNING_DARK},chipTextWarning:{color:c.COLORS.WARNING_DARK},chipUpdate:{backgroundColor:c.COLORS.WARNING_BG},chipWarning:{backgroundColor:c.COLORS.WARNING_BG},dataColumn:Object.assign({flexBasis:200,flexGrow:1,flexShrink:1,gap:u.SPACING.XS,minWidth:0},{columnGap:u.SPACING.MD,display:'grid',gridTemplateColumns:'max-content minmax(0, 1fr)'}),dataColumnPhone:Object.assign({gap:u.SPACING.MICRO},{columnGap:u.SPACING.SM,rowGap:u.SPACING.MICRO}),dataColumnTitle:Object.assign({},{gridColumn:'1 / -1'}),dataField:Object.assign({alignItems:'baseline',flexDirection:'row',gap:u.SPACING.SM},{display:'contents'}),dataGrid:{flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.XL,paddingHorizontal:u.SPACING.LG,paddingVertical:u.SPACING.MD},dataGridPhone:{gap:u.SPACING.LG,paddingHorizontal:u.SPACING.MD},dataLabel:{color:c.COLORS.TEXT_MUTED,fontSize:S.FONT_SIZE.XS,letterSpacing:.3,textTransform:'uppercase'},dataValue:{color:c.COLORS.TEXT_BODY,flex:1,fontSize:S.FONT_SIZE.SM,fontWeight:'500',minWidth:0},dataValueAlert:{alignSelf:'flex-start',backgroundColor:c.COLORS.ERROR_BG,borderColor:c.COLORS.ERROR_BORDER,borderRadius:4,borderWidth:1,color:c.COLORS.ERROR,flex:0,fontWeight:'700',paddingHorizontal:u.SPACING.SM,paddingVertical:1}
50,dataValueMono:{fontFamily:S.FONT_FAMILY.WEB_MONOSPACE,fontWeight:'400'},dataValueWrap:Object.assign({},{wordBreak:'break-word'}),detailsLinkButton:Object.assign({paddingHorizontal:u.SPACING.MD,paddingVertical:u.SPACING.SM},{cursor:'pointer'}),detailsLinkText:{color:c.COLORS.BRAND_PRIMARY,fontSize:S.FONT_SIZE.SM,fontWeight:'600'},divider:{backgroundColor:c.COLORS.BORDER,height:1},footerTrailingAction:{marginLeft:'auto'},headerBand:{alignItems:'center',flexDirection:'row',gap:u.SPACING.MD,paddingHorizontal:u.SPACING.LG,paddingVertical:u.SPACING.MD},headerBandPhone:{gap:u.SPACING.SM,paddingHorizontal:u.SPACING.MD},headerContent:{flex:1,gap:u.SPACING.XS,minWidth:0},headerMacValuePhone:{color:c.COLORS.TEXT_HEADING,flexShrink:1,fontFamily:S.FONT_FAMILY.WEB_MONOSPACE,fontSize:S.FONT_SIZE.SM,fontWeight:'700'},identityLine:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.SM},headerMacSlot:{alignItems:'flex-start',flexShrink:1,maxWidth:270,minWidth:190},headerMacLabel:{color:c.COLORS.TEXT_MUTED,fontSize:S.FONT_SIZE.XS,fontWeight:'600',letterSpacing:.2,marginBottom:2,textTransform:'uppercase'},headerMacValue:{color:c.COLORS.TEXT_HEADING,flexShrink:1,fontFamily:S.FONT_FAMILY.WEB_MONOSPACE,fontSize:S.FONT_SIZE.LG,fontWeight:'800',maxWidth:'100%'},headerMetaLine:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.SM},headerTitleLine:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.SM},ledModeInputRow:{flexBasis:520,flexGrow:1,flexShrink:1,minWidth:0},label:{color:c.COLORS.TEXT_HEADING,flexShrink:1,fontSize:S.FONT_SIZE.LG,fontWeight:'600'},labelPhone:{fontSize:S.FONT_SIZE.MD},linkButton:Object.assign({backgroundColor:c.COLORS.ACTION_PRIMARY,borderRadius:6,paddingHorizontal:u.SPACING.MD,paddingVertical:u.SPACING.SM},{cursor:'pointer'}),linkButtonText:{color:c.COLORS.TEXT_INVERSE,fontSize:S.FONT_SIZE.XS,fontWeight:'600'},managementActions:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.SM,marginTop:u.SPACING.SM},managementBand:{gap:u.SPACING.SM,paddingHorizontal:u.SPACING.LG,paddingVertical:u.SPACING.MD},managementBandPhone:{paddingHorizontal:u.SPACING.MD},model:{color:c.COLORS.TEXT_MUTED,flexShrink:0,fontSize:S.FONT_SIZE.XS,fontWeight:'500',letterSpacing:.3,textTransform:'uppercase'},publicFooter:{alignItems:'center',flexDirection:'row',flexWrap:'wrap',gap:u.SPACING.MD,paddingHorizontal:u.SPACING.LG,paddingVertical:u.SPACING.MD},publicFooterPhone:{paddingHorizontal:u.SPACING.MD},sectionTitle:{color:c.COLORS.TEXT_BODY,fontSize:S.FONT_SIZE.XS,fontWeight:'700',letterSpacing:.5,marginBottom:u.SPACING.XS,textTransform:'uppercase'},sensorId:{color:c.COLORS.TEXT_MUTED,flexShrink:0,fontSize:S.FONT_SIZE.XS,fontWeight:'500'},statusDot:{borderRadius:5,flexShrink:0,height:10,width:10},thumbnail:{borderRadius:6,flexShrink:0,height:64,width:64},thumbnailPhone:{height:44,width:44},thumbnailFallback:{alignItems:'center',backgroundColor:c.COLORS.BG_SUBTLE_100,justifyContent:'center'},thumbnailFallbackText:{color:c.COLORS.TEXT_MUTED,fontSize:S.FONT_SIZE.MICRO,fontWeight:'600',letterSpacing:.3,paddingHorizontal:u.SPACING.XS}})},1180,[328,95,222,488,276,489,490,493,494,553,1058,1154,1166,686,1137,1133,1136,1138,1153,1168,1143,1140,1169,1146,1079,1170,1081,1147,104]); 51__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"EMPTY_SENSOR_MANAGEMENT_SEARCH_STATE",{enumerable:!0,get:function(){return t}}),e.sensorManagementSearchReducer=function(n,o){switch(o.type){case'searchCompleted':return{hasSearched:!0,publicSensors:o.publicSensors,sensors:o.sensors,totalResults:o.totalResults};case'searchCleared':return t;case'sensorUpdated':{const t=n.sensors.some(s=>s.sensorIndex===o.sensorIndex),l=(0,s.applySensorUpdateToList)(n.sensors,o.sensorIndex,o.updatedSensor),u=null===o.updatedSensor&&t?Math.max(0,n.totalResults-1):n.totalResults;return l===n.sensors&&u===n.totalResults?n:Object.assign({},n,{sensors:l,totalResults:u})}default:throw new Error(`Unhandled SensorManagementSearchAction: ${String(o)}`)}};var s=r(d[0]);const t={hasSearched:!1,publicSensors:[],sensors:[],totalResults:0}},1181,[1182]); 52__d(function(g,r,i,a,m,e,d){"use strict";
52Object.defineProperty(e,'__esModule',{value:!0}),e.applySensorUpdateToList=function(n,s,t){const l=n.findIndex(n=>n.sensorIndex===s);if(-1===l)return n;if(null===t){const s=n.slice();return s.splice(l,1),s}const u=n.slice();return u[l]=t,u},e.applySensorUpdateToDetail=function(n,s,t){if(null===n)return null;if(n.sensor.sensorIndex!==s)return n;if(null===t)return null;return Object.assign({},n,{sensor:t})}},1182,[]); 53__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.usePartitionedSensorSelection=function({ownedSensors:t,searchSensors:S,publicSearchSensors:l}){const[I,h]=(0,s.useState)(o),w=(0,s.useMemo)(()=>new Map(t.map(s=>[s.sensorIndex,s])),[t]),u=(0,s.useMemo)(()=>c(S,l),[l,S]),x=(0,s.useMemo)(()=>{const s=new Map(u);return w.forEach((n,o)=>{s.set(o,n)}),s},[u,w]),M=(0,s.useMemo)(()=>new Set([...[...I.ownedSensorIndices].filter(s=>w.has(s)),...[...I.searchSensorIndices].filter(s=>!w.has(s)&&u.has(s))]),[u,w,I]),p=(0,s.useMemo)(()=>{const s=[],n=new Set;return w.forEach((o,c)=>{M.has(c)&&(s.push(o),n.add(c))}),u.forEach((o,c)=>{M.has(c)&&!n.has(c)&&s.push(o)}),s},[u,w,M]),f=(0,s.useCallback)(()=>{h(o())},[]),b=(0,s.useCallback)(()=>{h(s=>({ownedSensorIndices:s.ownedSensorIndices,searchSensorIndices:new Set}))},[]),k=(0,s.useCallback)(s=>{h(n=>{const o=new Set(n.ownedSensorIndices),c=new Set(n.searchSensorIndices);return c.delete(s.sensorIndex),o.has(s.sensorIndex)?o.delete(s.sensorIndex):w.has(s.sensorIndex)&&o.add(s.sensorIndex),{ownedSensorIndices:o,searchSensorIndices:c}})},[w]),C=(0,s.useCallback)(s=>{h(n=>{const o=w.has(s.sensorIndex),c=new Set(n.ownedSensorIndices),t=new Set(n.searchSensorIndices),S=o?c:t;return(o?t:c).delete(s.sensorIndex),S.has(s.sensorIndex)?S.delete(s.sensorIndex):x.has(s.sensorIndex)&&S.add(s.sensorIndex),{ownedSensorIndices:c,searchSensorIndices:t}})},[x,w]),v=(0,s.useCallback)(s=>{(0,n.isArchiveHistoryMapTargetSelectable)(s)&&C((0,n.toArchiveHistoryMapTarget)(s))},[C]),y=(0,s.useCallback)(s=>{h(n=>{const o=new Set(n.ownedSensorIndices),c=new Set(n.searchSensorIndices);return s.forEach(s=>{w.has(s.sensorIndex)&&(o.add(s.sensorIndex),c.delete(s.sensorIndex))}),{ownedSensorIndices:o,searchSensorIndices:c}})},[w]),T=(0,s.useCallback)(s=>{h(n=>{const o=new Set(n.ownedSensorIndices),c=new Set(n.searchSensorIndices);return s.forEach(s=>{x.has(s.sensorIndex)&&(w.has(s.sensorIndex)?(o.add(s.sensorIndex),c.delete(s.sensorIndex)):c.add(s.sensorIndex))}),{ownedSensorIndices:o,searchSensorIndices:c}})},[x,w]),E=(0,s.useCallback)(s=>{const n=new Set(s.map(s=>s.sensorIndex));h(s=>({ownedSensorIndices:new Set([...s.ownedSensorIndices].filter(s=>!n.has(s))),searchSensorIndices:new Set([...s.searchSensorIndices].filter(s=>!n.has(s)))}))},[]),H=(0,s.useCallback)((s,n)=>{const o=new Set(c(s,n).keys());h(s=>({ownedSensorIndices:s.ownedSensorIndices,searchSensorIndices:new Set([...s.searchSensorIndices].filter(s=>o.has(s)))}))},[]),A=(0,s.useMemo)(()=>({clearSelection:f,deselectSensors:E,selectedMapTargetIndices:M,selectedMapTargets:p,selectSensors:y,toggleSensor:k}),[f,E,y,M,p,k]),_=(0,s.useMemo)(()=>({clearSelection:f,deselectSensors:E,selectedMapTargetIndices:M,selectedMapTargets:p,selectSensors:T,toggleArchiveHistory:v,toggleSensor:C}),[f,E,T,M,p,v,C]);return{clearSearchSelection:b,ownedSelection:A,reconcileSearchResults:H,searchSelection:_}};var s=r(d[0]),n=r(d[1]);function o(){return{ownedSensorIndices:new Set,searchSensorIndices:new Set}}function c(s,o){const c=new Map(o.map(s=>[s.sensorIndex,s]));return s.forEach(s=>
53{c.set(s.sensorIndex,s),s.archiveHistory.forEach(s=>{!c.has(s.sensorIndex)&&(0,n.isArchiveHistoryMapTargetSelectable)(s)&&c.set(s.sensorIndex,(0,n.toArchiveHistoryMapTarget)(s))})}),c}},1183,[34,1135]); 54__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useSensorSearchFragment=function(){const[s,l]=(0,t.useState)(()=>o((0,c.resolveSensorSearchUrl)(window.location.href)));(0,t.useEffect)(()=>{const n=()=>{const n=(0,c.resolveSensorSearchUrl)(window.location.href);'canonical-search'!==n.kind&&'legacy-search'!==n.kind||window.location.href===n.canonicalUrl||window.history.replaceState(window.history.state,'',n.canonicalUrl),l(o(n))};return n(),window.addEventListener('popstate',n),window.addEventListener('hashchange',n),()=>{window.removeEventListener('popstate',n),window.removeEventListener('hashchange',n)}},[]);const h=(0,t.useCallback)(t=>{const c=(0,n.buildSensorSearchUrl)(window.location.href,t);window.location.href!==c&&window.history.replaceState(window.history.state,'',c),l(t)},[]);return{submittedSearchText:s,writeSubmittedSearchText:h}};var n=r(d[0]),t=r(d[1]),c=r(d[2]);function o(n){switch(n.kind){case'canonical-search':case'legacy-search':return n.searchText;
54case'invalid-canonical-search':case'invalid-legacy-search':case'no-search':return null;default:return n}}},1184,[1185,34,1186]); 55__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.resolveSensorSearchFragment=function(n){const s=new URLSearchParams(n.startsWith('#')?n.slice(1):n).getAll(t);if(0===s.length)return{kind:'absent'};if(1!==s.length||''===s[0])return{kind:'invalid'};return{kind:'search',searchText:s[0]??''}},e.buildSensorSearchFragment=s,e.buildSensorSearchUrl=function(t,c){const o=new URL(n,t);return o.search='',o.hash=s(c),o.toString()};const n='/my-sensors',t='search';function s(n){const s=new URLSearchParams;return s.set(t,n),`#${s.toString()}`}},1185,[]); 56__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.resolveSensorSearchUrl=function(t){const s=new URL(t),o=(0,n.resolveSensorSearchFragment)(s.hash);if('search'===o.kind)return{canonicalUrl:(0,n.buildSensorSearchUrl)(s.toString(),o.searchText),kind:'canonical-search',searchText:o.searchText};if('invalid'===o.kind)return{kind:'invalid-canonical-search'};const h=c(s.searchParams);if('absent'===h.kind)return{kind:'no-search'};if('invalid'===h.kind)return{kind:'invalid-legacy-search'};const u=l(h.value);if(null===u)return{kind:'invalid-legacy-search'};return{canonicalUrl:(0,n.buildSensorSearchUrl)(s.toString(),u),kind:'legacy-search',searchText:u}};var n=r(d[0]);const t='ids';function c(n){const c=n.getAll(t);return 0===c.length?{kind:'absent'}:1!==c.length||''===c[0]?{kind:'invalid'}:{kind:'present',value:c[0]??''}}function l(n){const t=n.split(/\r?\n/).map(n=>n.trim()).filter(n=>n.length>0).join('\n');return''===t?null:t}},1186,[1185]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.