import{o as d,c as u,a as e,b as E,d as C,e as a,s as xe,w as G,f as _e,g as Te,n as ee,h as y,r as j,t as o,i as K,u as f,F as I,j as L,k as Y,l as N,m as H,v as X,p as te,q as se,x as Se,y as $e,z as ae,A as Pe,B as Ae}from"./bootstrap.min-z2h-5aUQ.js";const Le={class:"app-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.65","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},De=["d"],D={__name:"AppIcon",props:{name:{type:String,default:"grid"}},setup(b){const s={shield:"M12 2 3 6v6c0 5 9 10 9 10s9-5 9-10V6Z M8 12l3 3 5-6",location:"M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0 M15 10a3 3 0 1 1-6 0 3 3 0 0 1 6 0",home:"m3 10 9-7 9 7v10H3Z M9 20v-7h6v7",journal:"M5 3h14v18H5Z M8 7h8 M8 11h8 M8 15h5",grid:"M3 3h7v7H3Z M14 3h7v7h-7Z M3 14h7v7H3Z M14 14h7v7h-7Z",devices:"M3 4h18v12H3Z M8 20h8 M12 16v4",tree:"M9 2h6v6H9Z M2 16h6v6H2Z M16 16h6v6h-6Z M12 8v4 M5 16v-4h14v4",users:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2 M22 21v-2a4 4 0 0 0-3-3.8 M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8 M17 3a4 4 0 0 1 0 8",settings:"M9 3h6l1 4 4 1v8l-4 1-1 4H9l-1-4-4-1V8l4-1Z M15 12a3 3 0 1 0-6 0 3 3 0 0 0 6 0",database:"M3 6c0-5 18-5 18 0s-18 5-18 0V18c0 5 18 5 18 0V6 M3 12c0 5 18 5 18 0",network:"M9 2h6v6H9Z M2 16h6v6H2Z M16 16h6v6h-6Z M12 8v4 M5 16v-4h14v4",arrow:"M5 12h14 M14 7l5 5-5 5",router:"M3 13h18v8H3Z M6 13V5 M18 13V5 M7 17h.01 M11 17h.01 M15 17h3",camera:"M3 6h12v12H3Z M15 10l6-4v12l-6-4"};return(l,c)=>(d(),u("svg",Le,[e("path",{d:s[b.name]||s.grid},null,8,De)]))}},Ne={class:"sidebar"},Re={class:"nav flex-column",id:"main-navigation","aria-label":"主导航"},ze={"data-page":"households",class:"active"},He={id:"scope-navigation",hidden:""},Ue={"data-page":"journal"},Ve={"data-page":"overview"},Be={"data-page":"objects"},Oe={"data-page":"heritage"},Ee={"data-page":"users","data-admin":""},Ze={"data-page":"settings"},Fe={"data-page":"storage"},We={__name:"AppSidebar",setup(b){return(s,l)=>(d(),u("aside",Ne,[l[17]||(l[17]=E('
赵府智能数字管家
家宅 · 起居
',3)),e("nav",Re,[e("button",ze,[C(D,{name:"home"}),l[0]||(l[0]=a()),l[1]||(l[1]=e("span",null,"我的家庭与场所",-1))]),e("div",He,[l[12]||(l[12]=e("div",{id:"scope-nav-name",class:"nav-label"},null,-1)),e("button",Ue,[C(D,{name:"journal"}),l[2]||(l[2]=a()),l[3]||(l[3]=e("span",null,"记事与阅历",-1))]),e("button",Ve,[C(D,{name:"grid"}),l[4]||(l[4]=a()),l[5]||(l[5]=e("span",null,"场所总览",-1))]),e("button",Be,[C(D,{name:"devices"}),l[6]||(l[6]=a()),l[7]||(l[7]=e("span",null,"区域与设备",-1))]),e("button",Oe,[C(D,{name:"tree"}),l[8]||(l[8]=a()),l[9]||(l[9]=e("span",null,"家庭传承",-1))]),e("button",Ee,[C(D,{name:"users"}),l[10]||(l[10]=a()),l[11]||(l[11]=e("span",null,"成员与权限",-1))])]),e("button",Ze,[C(D,{name:"settings"}),l[13]||(l[13]=a()),l[14]||(l[14]=e("span",null,"设置中心",-1))]),e("button",Fe,[C(D,{name:"database"}),l[15]||(l[15]=a()),l[16]||(l[16]=e("span",null,"平台存储与审计",-1))])]),l[18]||(l[18]=E(' 独立部署 · 数据自有
按空间组织画面
让每一段记录有处可寻
',4))]))}},ie=(b,s)=>{const l=b.__vccOpts||b;for(const[c,m]of s)l[c]=m;return l},Ye={};function Ge(b,s){return d(),u("header",null,[...s[0]||(s[0]=[E('赵氏家宅 · 起居有序
我的家庭与场所
从一个空间,看到每一个位置。
',2)])])}const Ke=ie(Ye,[["render",Ge]]),h=xe({state:{households:[],sites:[],cameras:[]},admin:!1,loggedIn:!1,page:"households",session:0,device:null}),U=xe({devices:[],groups:[],rows:[]});window.ZhaoVue={enabled:!0,accept(b){h.value=b},setDevices(b){U.value=b},clear(){U.value={devices:[],groups:[],rows:[]}}};const A=()=>window.ZhaoVue,ne=b=>({lan:"局域网",tailscale:"Tailscale",public:"公网",unknown:"接入待确认"})[b]||"接入待确认";function Je(b=[]){const s=[{key:"home",label:"家庭",color:"#258b76",count:0},{key:"office",label:"办公",color:"#5c83cb",count:0},{key:"factory",label:"工厂",color:"#c69a52",count:0},{key:"other",label:"其他",color:"#8997a9",count:0}];let l=0,c=0;for(const t of b)(s.find(n=>n.key===(t.kind||"home"))||s[3]).count++,l+=Math.max(0,Number(t.deviceCount)||0),c+=Math.max(0,Number(t.sites)||0);let m=0;return{total:b.length,devices:l,areas:c,kinds:s.filter(t=>t.count).map(t=>{const n={...t,share:t.count/b.length*100,offset:m};return m+=n.share,n})}}const Q=["#268575","#648bcc","#c49b5b","#8e82b5","#899aa5"],le=b=>Math.max(0,Math.floor(Number(b)||0));function qe(b=[]){return{series:[{type:"pie",radius:["62%","84%"],center:["50%","50%"],avoidLabelOverlap:!0,label:{show:!1},emphasis:{scale:!1},data:b.map((s,l)=>({name:s.label,value:le(s.count),itemStyle:{color:s.color||Q[l%Q.length],borderRadius:4}}))}]}}function je(b=[]){return{grid:{left:12,right:35,top:10,bottom:12,containLabel:!0},xAxis:{type:"value",minInterval:1,axisTick:{show:!1}},yAxis:{type:"category",inverse:!0,axisTick:{show:!1},axisLine:{show:!1},axisLabel:{width:90,overflow:"truncate"},data:b.map(s=>s.label)},series:[{type:"bar",barMaxWidth:20,label:{show:!0,position:"right"},data:b.map((s,l)=>({value:le(s.count),itemStyle:{color:s.color||Q[l%Q.length],borderRadius:[0,5,5,0]}}))}]}}function Xe(b={}){const s=[...(b.assets||[]).map(n=>({...n,deviceType:"摄像机"})),...(b.recorders||[]).map(n=>({...n,deviceType:"录像机"})),...b.devices||[]],l=new Map,c=new Map,m={lan:"局域网",tailscale:"Tailscale",public:"公网",unknown:"待登记"};for(const n of s){const r=n.deviceType||"其他",x=m[n.networkAccess]||m.unknown;l.set(r,(l.get(r)||0)+1),c.set(x,(c.get(x)||0)+1)}const t=n=>[...n].map(([r,x])=>({label:r,count:x})).sort((r,x)=>x.count-r.count||r.label.localeCompare(x.label));return{total:s.length,types:t(l),networks:t(c)}}function Ce(b,s){return{tooltip:{formatter:l=>l.dataType==="edge"?"已登记的上级连接":l.data.detail||l.name},series:[{type:"graph",layout:"none",roam:!0,draggable:!1,scaleLimit:{min:.2,max:4},symbol:"roundRect",symbolSize:[145,60],edgeSymbol:["none","arrow"],edgeSymbolSize:6,label:{show:!0,fontSize:11,width:128,overflow:"truncate",formatter:l=>l.data.caption||l.name},lineStyle:{color:"#8aa99f",width:2,curveness:.08},emphasis:{focus:"adjacency",lineStyle:{width:3}},data:b,links:s}]}}function Qe(b=[],s=()=>""){const l=new Map(b.map(t=>[t.device.id,t])),c=b.map((t,n)=>({id:t.device.id,targetId:t.device.id,name:t.device.name,caption:t.device.name+`
`+((t.device.networkHosts||[])[0]||"IP 待填写"),detail:[t.device.name,t.device.deviceType,s(t.device.siteId)||"位置待登记",(t.device.networkHosts||[]).join(" / ")||"IP 待填写",{lan:"局域网",tailscale:"Tailscale",public:"公网"}[t.device.networkAccess]||"接入待确认"].join(`
`),x:Math.max(0,t.depth||0)*280,y:n*105,itemStyle:{color:t.device.source==="camera"?"#e1ebfb":"#dceddf",borderColor:t.device.source==="camera"?"#648bcc":"#468b73",borderWidth:1},label:{color:"#213f48"}})),m=b.flatMap(t=>{const n=l.get(t.device.uplinkId);return n&&n.depth+1===t.depth?[{source:n.device.id,target:t.device.id}]:[]});return Ce(c,m)}function el(b=[],s="赵府"){return Ce([{id:"platform",name:s,x:0,y:0,symbolSize:[160,65],itemStyle:{color:"#286d5d"},label:{color:"#fff"}},...b.map((l,c)=>({id:"home:"+l.id,targetId:l.id,name:l.name,caption:l.name+`
`+le(l.deviceCount)+" 台设备",detail:[l.name,{home:"家庭",office:"办公",factory:"工厂"}[l.kind||"home"]||"场所",[l.province,l.city,l.district].filter(Boolean).join(" · "),le(l.deviceCount)+" 台已授权设备"].filter(Boolean).join(`
`),x:300,y:(c-(b.length-1)/2)*120,itemStyle:{color:"#e3efe8",borderColor:"#8ebaa6",borderWidth:1},label:{color:"#213f48"}}))],b.map(l=>({source:"platform",target:"home:"+l.id})))}const ll="modulepreload",al=function(b){return"/ui/"+b},ke={},tl=function(s,l,c){let m=Promise.resolve();if(l&&l.length>0){let x=function(_){return Promise.all(_.map(k=>Promise.resolve(k).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const n=document.querySelector("meta[property=csp-nonce]"),r=(n==null?void 0:n.nonce)||(n==null?void 0:n.getAttribute("nonce"));m=x(l.map(_=>{if(_=al(_),_ in ke)return;ke[_]=!0;const k=_.endsWith(".css"),g=k?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${_}"]${g}`))return;const w=document.createElement("link");if(w.rel=k?"stylesheet":ll,k||(w.as="script"),w.crossOrigin="",w.href=_,r&&w.setAttribute("nonce",r),document.head.appendChild(w),k)return new Promise((z,R)=>{w.addEventListener("load",z),w.addEventListener("error",()=>R(new Error(`Unable to preload CSS for ${_}`)))})}))}function t(n){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=n,window.dispatchEvent(r),!r.defaultPrevented)throw n}return m.then(n=>{for(const r of n||[])r.status==="rejected"&&t(r.reason);return s().catch(t)})},sl={class:"local-chart-wrap"},il=["aria-label"],nl={key:0,class:"small text-secondary px-3",role:"status"},J={__name:"LocalChart",props:{option:{type:Object,required:!0},label:String,active:{type:Boolean,default:!0},height:{type:Number,default:260}},emits:["select"],setup(b,{emit:s}){const l=b,c=s,m=j(null),t=j(!1);let n,r,x,_,k=!0,g=!1,w="",z="";function R(){n==null||n.dispose(),n=null,w="",z=""}function T(){!_&&k&&(_=requestAnimationFrame(()=>{_=null,W()}))}async function W(){if(!k||!m.value||!l.active){R();return}const V=Math.floor(m.value.clientWidth),B=Math.floor(m.value.clientHeight);if(!V||!B)return;if(!n){if(g)return;g=!0;try{const i=await tl(()=>import("./charts-runtime-1VWs_AXF.js"),[]);if(!k||!l.active||!m.value)return;n=i.init(m.value,null,{renderer:"canvas",devicePixelRatio:Math.min(window.devicePixelRatio||1,2)}),n.on("click",$=>{var P;(P=$.data)!=null&&P.targetId&&c("select",$.data.targetId)}),t.value=!1}catch(i){t.value=!0,console.error("Local chart unavailable",i);return}finally{g=!1}}const S=getComputedStyle(document.documentElement),Z=S.getPropertyValue("--ink").trim()||"#253b46",F=S.getPropertyValue("--ui-muted").trim()||"#627485",q=S.getPropertyValue("--ui-line").trim()||"#e3e9ef",p=JSON.stringify(l.option)+Z+F+q;if(p!==w){const i={...l.option,animation:!1,backgroundColor:"transparent",textStyle:{color:Z,fontFamily:"system-ui, Microsoft YaHei, sans-serif"},aria:{enabled:!0,description:l.label},tooltip:{trigger:"item",renderMode:"richText",confine:!0,...l.option.tooltip}};for(const $ of["xAxis","yAxis"])i[$]&&(i[$]={...i[$],axisLabel:{color:F,...i[$].axisLabel},splitLine:{lineStyle:{color:q}}});i.series=(i.series||[]).map($=>({...$,label:{color:Z,...$.label}})),n.setOption(i,{notMerge:!0,lazyUpdate:!1}),w=p}const v=V+":"+B;v!==z&&(n.resize({width:V,height:B}),z=v)}return G(()=>[l.option,l.active],T,{deep:!0,flush:"post"}),_e(()=>{r=new ResizeObserver(T),r.observe(m.value),x=new MutationObserver(T),x.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-density"]}),T()}),Te(()=>{k=!1,cancelAnimationFrame(_),r==null||r.disconnect(),x==null||x.disconnect(),R()}),(V,B)=>(d(),u("div",sl,[e("div",{ref_key:"host",ref:m,class:"local-chart",role:"img","aria-label":b.label,style:ee({height:b.height+"px"})},null,12,il),t.value?(d(),u("p",nl,"图表暂未加载,可查看下方数据。")):y("",!0)]))}},ol={class:"col-12 col-xl-4"},dl={class:"dashboard-welcome h-100"},rl={class:"dashboard-totals"},ul={class:"insight-scope"},cl={class:"col-12 d-md-none"},pl=["aria-expanded"],vl={class:"col-12 col-md-5 col-xl-3 dashboard-chart-column"},ml={class:"chart-card h-100"},bl={class:"chart-heading"},hl={class:"badge"},gl={key:1,class:"chart-empty"},fl={class:"chart-legend"},yl={class:"col-12 col-md-7 col-xl-5 dashboard-chart-column"},kl={class:"chart-card h-100"},wl={key:1,class:"chart-empty"},xl={key:2,class:"chart-data"},_l={__name:"HomeInsights",setup(b){const s=N(()=>Je(h.value.state.households)),l=j(!1),c=N(()=>h.value.loggedIn&&h.value.page==="households"),m=N(()=>(h.value.state.households||[]).map(t=>({label:t.name,count:t.deviceCount||0})).sort((t,n)=>n.count-t.count).slice(0,8));return(t,n)=>(d(),u("section",{class:Y(["dashboard-grid row g-3 mb-4",{"charts-expanded":l.value}]),"aria-label":"已授权场所概览"},[e("div",ol,[e("article",dl,[n[5]||(n[5]=e("span",{class:"insight-kicker"},"一处相连 · 各有归属",-1)),n[6]||(n[6]=e("h2",null,"家与日常,尽在掌握",-1)),n[7]||(n[7]=e("p",null,"从一处灯火,连接生活的每个空间。",-1)),e("div",rl,[e("div",null,[e("strong",null,o(s.value.total),1),n[1]||(n[1]=e("span",null,"家庭与场所",-1))]),e("div",null,[e("strong",null,o(s.value.devices),1),n[2]||(n[2]=e("span",null,"已登记设备",-1))]),e("div",null,[e("strong",null,o(s.value.areas),1),n[3]||(n[3]=e("span",null,"区域空间",-1))])]),e("div",ul,[C(D,{name:"shield"}),n[4]||(n[4]=a(" 仅汇总你有权访问的家庭与场所",-1))])])]),e("div",cl,[e("button",{class:"btn btn-outline-secondary w-100","aria-expanded":l.value,onClick:n[0]||(n[0]=r=>l.value=!l.value)},o(l.value?"收起图表统计":"展开图表统计"),9,pl)]),e("div",vl,[e("article",ml,[e("div",bl,[n[8]||(n[8]=e("h3",null,"空间分布",-1)),e("span",hl,o(s.value.total)+" 处",1)]),s.value.total?(d(),K(J,{key:0,option:f(qe)(s.value.kinds),active:c.value,height:160,label:"场所分布:"+s.value.kinds.map(r=>r.label+r.count+"个").join(",")},null,8,["option","active","label"])):(d(),u("p",gl,"添加家庭或场所后显示分布")),e("div",fl,[(d(!0),u(I,null,L(s.value.kinds,r=>(d(),u("span",{key:r.key},[e("i",{style:ee({background:r.color})},null,4),a(o(r.label)+" ",1),e("b",null,o(r.count),1)]))),128))])])]),e("div",yl,[e("article",kl,[n[10]||(n[10]=e("div",{class:"chart-heading"},[e("h3",null,"设备分布"),e("span",{class:"small text-secondary"},"按场所 · 最多显示 8 处")],-1)),m.value.length?(d(),K(J,{key:0,option:f(je)(m.value),active:c.value,height:190,label:"各场所已登记设备:"+m.value.map(r=>r.label+r.count+"台").join(",")},null,8,["option","active","label"])):(d(),u("p",wl,"暂无已授权场所")),m.value.length?(d(),u("details",xl,[n[9]||(n[9]=e("summary",null,"查看统计数字",-1)),e("ul",null,[(d(!0),u(I,null,L(m.value,r=>(d(),u("li",{key:r.label},o(r.label)+":"+o(r.count)+" 台",1))),128))])])):y("",!0)])])],2))}},$l={id:"page-households",class:"page"},ql={class:"section-head"},jl={class:"count-pill"},Cl=["hidden"],Ml={class:"btn-group",role:"group","aria-label":"场所显示方式"},Il=["aria-pressed"],Tl=["aria-pressed"],Sl=["aria-expanded"],Pl={id:"home-layout-options",class:"home-layout-controls"},Al=["disabled"],Ll=["value"],Dl=["disabled"],Nl=["value"],Rl={class:"inline-check"},zl=["disabled"],Hl={class:"inline-check"},Ul=["disabled"],Vl=["disabled"],Bl=["disabled"],Ol={id:"home-layout-status",role:"status",class:"small text-secondary"},El={key:0,class:"group-title"},Zl={class:"home-card-grid"},Fl=["draggable","onDragstart","onDrop"],Wl={class:"home-cover"},Yl=["src","alt"],Gl={class:"home-cover-content"},Kl={class:"site-heading"},Jl={class:"badge"},Xl=["data-edit-household"],Ql={class:"home-location"},ea={class:"card-body"},la={key:0,class:"home-order-actions"},aa=["disabled","aria-label","onClick"],ta=["disabled","aria-label","onClick"],sa={class:"home-summary"},ia={class:"home-numbers"},na={class:"compact-details"},oa={class:"home-card-actions"},da=["onClick"],ra=["data-leadership"],ua={key:0,class:"empty"},ca={id:"home-global-topology",class:"network-overview"},pa={class:"network-platform"},va={key:0,class:"chart-network-surface mb-3"},ma={class:"platform-place-grid"},ba=["onClick"],ha={class:"badge"},ga={class:"home-pagination"},fa={id:"home-page-info"},ya=["disabled"],ka=["disabled"],wa={__name:"HomeExplorer",setup(b){const s=j({revision:0,columns:2,rows:2,groupCity:!1,order:[]}),l=j(!1),c=j(!1),m=j(0),t=j(!1),n=j("cards"),r=j(!1),x=j(""),_=j("");let k="";G(h,q=>{var v;const p=((v=q.user)==null?void 0:v.id)+":"+q.session;k!==p&&(k=p,l.value=!1,c.value=!1,m.value=0,t.value=!1,n.value="cards",r.value=!1,x.value="",_.value=""),!l.value&&!c.value&&(s.value={revision:0,columns:2,rows:2,groupCity:!1,order:[],...q.state.householdLayout})},{immediate:!0});const g=N(()=>{const q=h.value.state.households||[],p=new Map(q.map(v=>[v.id,v]));return[...new Set([...s.value.order,...q.map(v=>v.id)])].filter(v=>p.has(v)).map(v=>p.get(v))}),w=N(()=>s.value.columns*s.value.rows),z=N(()=>Math.max(1,Math.ceil(g.value.length/w.value)));G(z,q=>m.value=Math.min(m.value,q-1));const R=N(()=>{var v;const q=g.value.slice(m.value*w.value,(m.value+1)*w.value);if(!s.value.groupCity)return[{name:"",items:q}];const p=new Map;for(const i of q){const $=[((v=i.geography)==null?void 0:v.country)||i.country,i.province,i.city||"地区待填写"].filter(Boolean).join(" / ");p.has($)||p.set($,[]),p.get($).push(i)}return[...p].map(([i,$])=>({name:i,items:$}))}),T=q=>({home:"家庭",office:"办公场所",factory:"工厂"})[q.kind||"home"]||"场所",W=q=>{var p,v;return((v=(p=A()).address)==null?void 0:v.call(p,q))||[q.province,q.city,q.district].filter(Boolean).join(" · ")||"地区待填写"};function V(){l.value=!0,m.value=0,s.value.groupCity&&(t.value=!1),_.value="布局已调整,保存后下次登录会沿用。"}function B(q,p,v){if(c.value)return;const i=g.value.map(O=>O.id),$=i.indexOf(q),P=v?i.indexOf(v):$+p;$<0||P<0||P>=i.length||$===P||(i.splice($,1),i.splice(P,0,q),s.value.order=i,l.value=!0,m.value=Math.floor(P/w.value))}function S(){l.value=!1,s.value={...h.value.state.householdLayout},m.value=0,_.value=""}async function Z(){const q=k;c.value=!0;try{const p=await A().saveLayout({...s.value});if(q!==k)return;s.value=p,l.value=!1,_.value="布局与卡片顺序已保存"}catch(p){!p.stale&&q===k&&(_.value=p.message)}finally{q===k&&(c.value=!1)}}async function F(q,p=!1){await A().enterHome(q.id,p)}return(q,p)=>(d(),u("section",$l,[e("div",ql,[e("div",null,[e("h2",null,[p[12]||(p[12]=a(" 我的空间 ",-1)),e("span",jl,o(g.value.length),1)]),p[13]||(p[13]=e("p",{class:"description mb-0"}," 家庭、办公与工厂,各自管理成员、区域和设备。 ",-1))]),e("button",{id:"new-household",class:"btn btn-primary",hidden:!f(h).platformAdmin}," + 新建家庭或场所 ",8,Cl)]),C(_l),e("div",{class:Y(["home-toolbar",{"home-options-open":r.value}])},[e("div",Ml,[e("button",{id:"home-card-view",class:Y(["btn btn-outline-secondary",{active:n.value==="cards"}]),"aria-pressed":n.value==="cards",onClick:p[0]||(p[0]=v=>n.value="cards")},[C(D,{name:"grid"}),p[14]||(p[14]=a(" 卡片",-1))],10,Il),e("button",{id:"home-topology-view",class:Y(["btn btn-outline-secondary",{active:n.value==="topology"}]),"aria-pressed":n.value==="topology",onClick:p[1]||(p[1]=v=>n.value="topology")},[C(D,{name:"network"}),p[15]||(p[15]=a(" 整体拓扑 ",-1))],10,Tl)]),H(e("button",{class:"btn btn-outline-secondary home-layout-toggle","aria-expanded":r.value,"aria-controls":"home-layout-options",onClick:p[2]||(p[2]=v=>r.value=!r.value)},o(r.value?"收起设置":"布局设置"),9,Sl),[[X,n.value==="cards"]]),H(e("div",Pl,[e("label",null,[p[16]||(p[16]=a("每页 ",-1)),H(e("select",{id:"home-columns","onUpdate:modelValue":p[3]||(p[3]=v=>s.value.columns=v),class:"form-select",disabled:c.value,onChange:V},[(d(),u(I,null,L(4,v=>e("option",{key:v,value:v},o(v)+" 列",9,Ll)),64))],40,Al),[[te,s.value.columns,void 0,{number:!0}]])]),p[19]||(p[19]=e("span",null,"×",-1)),H(e("select",{id:"home-rows","onUpdate:modelValue":p[4]||(p[4]=v=>s.value.rows=v),"aria-label":"每页行数",class:"form-select",disabled:c.value,onChange:V},[(d(),u(I,null,L(4,v=>e("option",{key:v,value:v},o(v)+" 行",9,Nl)),64))],40,Dl),[[te,s.value.rows,void 0,{number:!0}]]),e("label",Rl,[H(e("input",{id:"home-group-city","onUpdate:modelValue":p[5]||(p[5]=v=>s.value.groupCity=v),type:"checkbox",class:"form-check-input",disabled:c.value,onChange:V},null,40,zl),[[se,s.value.groupCity]]),p[17]||(p[17]=a("按城市分组",-1))]),e("label",Hl,[H(e("input",{id:"home-arrange","onUpdate:modelValue":p[6]||(p[6]=v=>t.value=v),type:"checkbox",class:"form-check-input",disabled:s.value.groupCity||c.value},null,8,Ul),[[se,t.value]]),p[18]||(p[18]=a("调整顺序",-1))]),e("button",{id:"home-layout-save",class:"btn btn-primary",disabled:!l.value||c.value,onClick:Z},o(c.value?"保存中…":"保存布局"),9,Vl),e("button",{id:"home-layout-reset",class:"btn btn-outline-secondary",disabled:!l.value||c.value,onClick:S}," 撤销 ",8,Bl)],512),[[X,n.value==="cards"]])],2),e("p",Ol,o(_.value||"布局仅影响你的账号;手机端自动适配为单列。"),1),H(e("div",{id:"household-list",style:ee({"--home-columns":s.value.columns})},[(d(!0),u(I,null,L(R.value,v=>(d(),u("section",{key:v.name,class:"home-city-group"},[v.name?(d(),u("h3",El,o(v.name),1)):y("",!0),e("div",Zl,[(d(!0),u(I,null,L(v.items,i=>{var $,P;return d(),u("article",{key:i.id,class:"card home-card",draggable:t.value&&!c.value,onDragstart:O=>{x.value=i.id,O.dataTransfer.setData("text/plain",i.id)},onDragend:p[7]||(p[7]=O=>x.value=""),onDragover:p[8]||(p[8]=O=>t.value&&x.value&&O.preventDefault()),onDrop:Se(O=>{t.value&&x.value&&B(x.value,0,i.id),x.value=""},["prevent"])},[e("div",Wl,[i.coverUrl?(d(),u("img",{key:0,src:i.coverUrl,alt:i.name+"封面",loading:"lazy"},null,8,Yl)):y("",!0),p[20]||(p[20]=e("div",{class:"cover-shade"},null,-1)),e("div",Gl,[e("div",Kl,[e("span",Jl,[a(o(T(i)),1),i.id===f(h).state.familyId?(d(),u(I,{key:0},[a(" · 当前")],64)):y("",!0)]),f(h).admin?(d(),u("button",{key:0,class:"btn btn-sm cover-edit","data-edit-household":i.id}," 编辑 ",8,Xl)):y("",!0)]),e("div",null,[e("h3",null,o(i.name),1),e("p",Ql,o(W(i)),1)])])]),e("div",ea,[t.value?(d(),u("div",la,[p[21]||(p[21]=e("span",null,"拖动排序",-1)),e("button",{class:"btn btn-sm btn-outline-secondary",disabled:(($=g.value[0])==null?void 0:$.id)===i.id||c.value,"aria-label":i.name+"前移",onClick:O=>B(i.id,-1)}," ←",8,aa),e("button",{class:"btn btn-sm btn-outline-secondary",disabled:((P=g.value.at(-1))==null?void 0:P.id)===i.id||c.value,"aria-label":i.name+"后移",onClick:O=>B(i.id,1)}," → ",8,ta)])):y("",!0),e("p",sa,o(i.note||"成员、空间与设备,独立管理。"),1),e("div",ia,[e("span",null,[e("b",null,o(i.deviceCount||0),1),p[22]||(p[22]=a("设备",-1))]),e("span",null,[e("b",null,o(i.sites||0),1),p[23]||(p[23]=a("区域",-1))]),e("span",null,[e("b",null,o(i.members||0),1),p[24]||(p[24]=a("成员",-1))])]),e("dl",na,[e("div",null,[e("dt",null,o(i.kind==="office"||i.kind==="factory"?"主要负责人":"一家之主"),1),e("dd",null,o(i.ownerName||"待指定"),1)]),e("div",null,[p[25]||(p[25]=e("dt",null,"备用负责人",-1)),e("dd",null,o(i.successorName||"待指定"),1)])]),e("div",oa,[e("button",{class:"btn btn-primary",onClick:O=>F(i)},[p[26]||(p[26]=a(" 进入空间 ",-1)),C(D,{name:"arrow"})],8,da),i.canAssignOwner?(d(),u("button",{key:0,class:"btn btn-link","data-leadership":i.id}," 负责人安排 ",8,ra)):y("",!0)])])],40,Fl)}),128))])]))),128)),g.value.length?y("",!0):(d(),u("div",ua," 登录后查看已授权的家庭与场所。 "))],4),[[X,n.value==="cards"]]),H(e("div",ca,[e("div",pa,[C(D,{name:"network"}),e("div",null,[e("h3",null,o(f(h).brandName||"赵府")+" · 数字管家",1),e("p",null,o(g.value.length)+" 个已授权空间",1)])]),p[28]||(p[28]=e("p",{class:"description"}," 平台与场所的管理关系;进入场所查看内部设备及网络。 ",-1)),g.value.length?(d(),u("div",va,[C(J,{option:f(el)(g.value,f(h).brandName||"赵府"),active:f(h).loggedIn&&f(h).page==="households"&&n.value==="topology",height:340,label:"平台及已授权场所关系图;点击场所进入内部网络,下面也可通过卡片进入。",onSelect:p[9]||(p[9]=v=>F({id:v},!0))},null,8,["option","active"])])):y("",!0),e("div",ma,[(d(!0),u(I,null,L(g.value,v=>(d(),u("button",{key:v.id,class:"card platform-place-node",onClick:i=>F(v,!0)},[e("span",ha,o(T(v)),1),e("h3",null,o(v.name),1),e("p",null,o(W(v)),1),e("span",null,o(v.deviceCount||0)+" 台设备",1),e("small",null,o((v.networkAccesses||[]).map(f(ne)).join(" · ")||"网络待登记"),1),p[27]||(p[27]=e("span",{class:"network-open"},"查看网络拓扑 →",-1))],8,ba))),128))])],512),[[X,n.value==="topology"]]),H(e("div",ga,[e("span",fa,"第 "+o(m.value+1)+" / "+o(z.value)+" 页 · 每页最多 "+o(w.value)+" 张",1),e("button",{id:"home-prev",class:"btn btn-outline-secondary",disabled:!m.value,onClick:p[10]||(p[10]=v=>m.value--)}," 上一页",8,ya),e("button",{id:"home-next",class:"btn btn-outline-secondary",disabled:m.value>=z.value-1,onClick:p[11]||(p[11]=v=>m.value++)}," 下一页 ",8,ka)],512),[[X,n.value==="cards"]])]))}},xa={key:0,class:"network-status-block"},_a={class:"network-status-title"},$a=["disabled"],qa={key:0,class:"text-danger small",role:"status"},ja={key:0,class:"small text-secondary"},Ca={key:1,class:"small text-secondary"},Ma={key:2,class:"small text-secondary"},Ia={class:"management-links"},Ta=["href"],Sa={key:0},Pa={class:"network-check-time"},oe={__name:"NetworkStatus",props:{device:{type:Object,required:!0},active:{type:Boolean,default:!0}},setup(b){const s=b,l=j(null),c=j(!1),m=j("");let t=0,n;const r=N(()=>[s.device.id,s.device.source,s.device.managementHost,s.device.tailscaleHost,s.device.networkCidr,h.value.state.familyId,h.value.session,h.value.admin,s.active].join("|"));async function x(){const g=t;if(!(c.value||!h.value.admin||!s.active)){c.value=!0,m.value="";try{const w=await A().api("/api/devices/network?source="+encodeURIComponent(s.device.source)+"&id="+encodeURIComponent(s.device.id));g===t&&(l.value=w)}catch(w){g===t&&!w.stale&&(m.value=w.message)}finally{g===t&&(c.value=!1,n=setTimeout(x,35e3))}}}G(r,()=>{t++,clearTimeout(n),c.value=!1,l.value=null,m.value="",h.value.admin&&s.active&&x()},{immediate:!0}),$e(()=>{t++,clearTimeout(n)});const _=N(()=>l.value?l.value.targets.some(g=>g.reachable)?"网络可达":"未连通":"等待检查");function k(){clearTimeout(n),x()}return(g,w)=>{var z,R;return f(h).admin?(d(),u("div",xa,[e("div",_a,[e("span",null,[e("i",{class:Y(["status-dot",{online:(z=l.value)==null?void 0:z.targets.some(T=>T.reachable)}])},null,2),a(o(c.value?"正在检查…":_.value),1)]),e("button",{class:"btn btn-sm btn-link",disabled:c.value,onClick:k},"检查网络",8,$a)]),m.value?(d(),u("p",qa,o(m.value),1)):y("",!0),l.value?(d(),u(I,{key:1},[(d(!0),u(I,null,L(l.value.targets,T=>(d(),u("div",{key:T.kind,class:"network-target"},[e("span",null,o(T.kind==="tailscale"?"Tailscale":"设备地址"),1),e("code",null,o(T.host),1),e("span",{class:Y(T.reachable?"text-success":"text-secondary")},o(T.reachable?"服务可达":"未响应"),3)]))),128)),l.value.targets.length?y("",!0):(d(),u("p",ja,"请编辑设备档案,填写 IP 或域名。")),(R=l.value.tailscale)!=null&&R.available?(d(),u("p",Ca,[a("Tailscale 节点"+o(l.value.tailscale.online?"在线":"离线"),1),l.value.tailscale.subnet?(d(),u(I,{key:0},[a(" · "+o(l.value.tailscale.subnetAvailable?"已发布":"未检测到")+" "+o(l.value.tailscale.subnet)+" 路由",1)],64)):y("",!0)])):l.value.tailscale?(d(),u("p",Ma,o(l.value.tailscale.note),1)):y("",!0),e("div",Ia,[(d(!0),u(I,null,L(l.value.links,T=>(d(),u("a",{key:T.kind,href:T.url,target:"_blank",rel:"noopener noreferrer",class:"btn btn-sm btn-outline-secondary"},[a("打开管理后台 · "+o(T.kind==="tailscale"?"Tailscale":"局域网")+" ↗",1),T.verified?y("",!0):(d(),u("span",Sa,"(待连通)"))],8,Ta))),128))]),e("small",Pa,"检查于 "+o(new Date(l.value.checkedAt*1e3).toLocaleTimeString("zh-CN"))+" · 从服务器探测,打开后台需当前浏览器也能到达。",1)],64)):y("",!0)])):y("",!0)}}},Aa={key:0,class:"display-manager mt-3"},La={key:0,class:"border rounded-3 p-3 mt-3"},Da={class:"d-flex justify-content-between align-items-center gap-2 mb-3"},Na={class:"small text-secondary"},Ra={class:"row g-2 hardware-grid"},za={class:"col-6"},Ha={class:"col-6"},Ua={class:"col-6"},Va={class:"col-6"},Ba={class:"small text-secondary mt-3"},Oa={key:0},Ea={key:0,class:"small text-secondary"},Za={class:"small mb-3"},Fa=["disabled"],Wa={key:1,class:"tv-remote-preview"},Ya=["src"],Ga={class:"small text-secondary"},Ka={class:"mt-3"},Ja={class:"row g-2 my-2"},Xa={class:"col-12"},Qa={class:"col-6"},et={class:"col-6"},lt=["disabled"],at={key:0,class:"my-3"},tt=["value"],st=["href"],it=["disabled","onClick"],nt={key:2,class:"alert alert-success mt-3"},ot={class:"fs-3 font-monospace"},dt={key:3,class:"text-danger mt-2",role:"alert"},rt={__name:"DisplayManager",props:{device:Object},setup(b){const s=b,l=j(!1),c=j(null),m=j([]),t=j(""),n=j(!1),r=j(""),x=j(""),_=j(0);let k,g=0,w="";const z=N(()=>{var v;return(v=h.value.state.households)==null?void 0:v.find(i=>i.id===h.value.state.familyId)}),R=j(""),T=j(""),W=j(""),V=j(""),B=v=>v+"?deviceId="+encodeURIComponent(s.device.id),S=N(()=>{var v;return((v=c.value)==null?void 0:v.hardware)||{}}),Z=(v,i=1)=>typeof v=="number"?v.toFixed(i):"未提供",F=v=>v?new Date(v*1e3).toLocaleString("zh-CN"):"尚未上报";async function q(){const v=g;if(l.value)try{const i=await A().api(B("/api/displays/hardware"));if(v!==g)return;if(c.value=i,Date.now()<_.value&&i.previewAt){const $=await fetch(B("/api/displays/preview"),{headers:{"X-Household-Id":h.value.state.familyId},cache:"no-store"});if($.ok){const P=await $.blob();if(v!==g)return;w&&URL.revokeObjectURL(w),w=URL.createObjectURL(P),x.value=w}}}catch(i){v===g&&(t.value=i.message)}finally{v===g&&l.value&&(k=setTimeout(q,5e3))}}async function p(v,i){n.value=!0,t.value="";const $=g;try{const P=await A().api("/api/displays",{action:v,deviceId:s.device.id,id:i,city:R.value,latitude:T.value,longitude:W.value});if($!==g)return;P.path&&(r.value=location.origin+P.path),P.pairingCode&&(V.value=P.pairingCode),v==="preview"&&(_.value=Date.now()+6e4),v==="revoke"&&(r.value="",V.value="",x.value="",_.value=0),m.value=(await A().api(B("/api/displays"))).items,clearTimeout(k),q()}catch(P){$===g&&(t.value=P.message)}finally{$===g&&(n.value=!1)}}return G(l,async v=>{var i;if(g++,clearTimeout(k),r.value="",t.value="",x.value="",_.value=0,w&&(URL.revokeObjectURL(w),w=""),v){R.value=((i=z.value)==null?void 0:i.city)||"",T.value=R.value==="济南市"?"36.67":"",W.value=R.value==="济南市"?"116.99":"",q();try{m.value=(await A().api(B("/api/displays"))).items}catch($){t.value=$.message}}}),G(()=>[h.value.state.familyId,h.value.session,h.value.page,s.device.id].join("|"),()=>l.value=!1),$e(()=>{g++,clearTimeout(k),w&&URL.revokeObjectURL(w)}),(v,i)=>{var $,P,O,de,re,ue,ce,pe,ve,me,be,he,ge,fe;return f(h).admin?(d(),u("div",Aa,[e("button",{class:"btn btn-outline-primary btn-sm",onClick:i[0]||(i[0]=M=>l.value=!l.value)},o(l.value?"收起电视管理":"电视管理 · 状态与模拟屏"),1),l.value?(d(),u("section",La,[e("div",Da,[e("strong",null,o(b.device.name),1),e("span",{class:Y(["badge",($=c.value)!=null&&$.online?"text-bg-success":"text-bg-secondary"])},o((P=c.value)!=null&&P.online?"在线 · 心跳正常":(O=c.value)!=null&&O.paired?"未收到心跳":"尚未绑定"),3)]),e("p",Na,"所属:"+o((de=z.value)==null?void 0:de.name)+" · 最后心跳 "+o(F((re=c.value)==null?void 0:re.lastSeen)),1),e("div",Ra,[e("div",za,[i[7]||(i[7]=e("span",null,"处理器温度",-1)),e("strong",null,o(Z(S.value.temperatureC))+o(S.value.temperatureC!=null?" °C":""),1),e("small",null,o(S.value.temperatureSource||"等待传感器上报"),1)]),e("div",Ha,[i[8]||(i[8]=e("span",null,"整机功率",-1)),e("strong",null,o(Z(S.value.powerW))+o(S.value.powerW!=null?" W":""),1),e("small",null,o(S.value.powerSource||"需设备传感器或计量插座"),1)]),e("div",Ua,[i[9]||(i[9]=e("span",null,"可用内存",-1)),e("strong",null,o(Z(S.value.memoryAvailableMB,0))+" / "+o(Z(S.value.memoryTotalMB,0))+" MB",1)]),e("div",Va,[i[10]||(i[10]=e("span",null,"可用存储",-1)),e("strong",null,o(Z(S.value.storageAvailableGB))+" / "+o(Z(S.value.storageTotalGB))+" GB",1)])]),e("p",Ba,[a(o(S.value.model||b.device.model)+" · Android "+o(S.value.osVersion||"—")+" · IP "+o(S.value.ip||b.device.managementHost||"—"),1),i[11]||(i[11]=e("br",null,null,-1)),a(o(S.value.screenWidth||"—")+" × "+o(S.value.screenHeight||"—")+" · "+o(S.value.foreground?"看板在前台":"看板未在前台")+" · "+o(S.value.screenOn?"屏幕亮":"屏幕状态待确认"),1),(ue=c.value)!=null&&ue.online?y("",!0):(d(),u("span",Oa," · 当前数值为最后一次上报"))]),i[22]||(i[22]=e("h4",{class:"fs-6"},"异常与报警",-1)),(pe=(ce=c.value)==null?void 0:ce.alerts)!=null&&pe.some(M=>!M.cleared)?y("",!0):(d(),u("p",Ea,o((ve=c.value)!=null&&ve.online?"当前无活动报警":"连接恢复后继续检查硬件状态"),1)),(d(!0),u(I,null,L((be=(me=c.value)==null?void 0:me.alerts)==null?void 0:be.filter(M=>!M.cleared),M=>(d(),u("div",{key:M.code,class:Y(["alert py-2 small",M.severity==="critical"?"alert-danger":"alert-warning"])},o(M.message)+" · "+o(F(M.opened)),3))),128)),e("details",Za,[i[12]||(i[12]=e("summary",null,"报警记录与规则",-1)),i[13]||(i[13]=e("p",null,"心跳中断超过 100 秒;处理器 ≥75°C 提醒、≥85°C 严重;可用内存低于 5%;可用存储低于 0.5 GB;看板退出前台。数值来自电视上报。",-1)),(d(!0),u(I,null,L((he=c.value)==null?void 0:he.alerts,(M,ye)=>(d(),u("div",{key:ye},o(M.cleared?"已恢复":"处理中")+" · "+o(M.message)+" · "+o(F(M.opened)),1))),128))]),e("button",{class:"btn btn-primary btn-sm",disabled:n.value||!((ge=c.value)!=null&&ge.online),onClick:i[1]||(i[1]=M=>p("preview"))},"查看模拟屏 · 60 秒",8,Fa),i[23]||(i[23]=e("p",{class:"small text-secondary mt-2"},"显示电视当前家庭看板的应用画面,约 20 秒更新一次;退出看板后不显示其他应用。预览仅短时保存在内存。",-1)),x.value?(d(),u("figure",Wa,[e("img",{src:x.value,alt:"电视家庭看板的真实应用画面"},null,8,Ya),e("figcaption",Ga,"画面时间:"+o(F((fe=c.value)==null?void 0:fe.previewAt)),1)])):y("",!0),e("details",Ka,[i[18]||(i[18]=e("summary",null,"展示授权与天气设置",-1)),e("div",Ja,[e("label",Xa,[i[14]||(i[14]=a("天气城市",-1)),H(e("input",{"onUpdate:modelValue":i[2]||(i[2]=M=>R.value=M),class:"form-control",maxlength:"60"},null,512),[[ae,R.value]])]),e("label",Qa,[i[15]||(i[15]=a("纬度",-1)),H(e("input",{"onUpdate:modelValue":i[3]||(i[3]=M=>T.value=M),class:"form-control",type:"number",step:"0.0001",min:"-90",max:"90"},null,512),[[ae,T.value]])]),e("label",et,[i[16]||(i[16]=a("经度",-1)),H(e("input",{"onUpdate:modelValue":i[4]||(i[4]=M=>W.value=M),class:"form-control",type:"number",step:"0.0001",min:"-180",max:"180"},null,512),[[ae,W.value]])])]),i[19]||(i[19]=e("p",{class:"small text-secondary"},"链接有效期一年,仅可展示本家庭概况、设备状态与已发布日程。重新生成会停用旧链接。",-1)),e("button",{class:"btn btn-outline-primary btn-sm",disabled:n.value,onClick:i[5]||(i[5]=M=>p("create"))},"生成新的电视展示链接",8,lt),r.value?(d(),u("div",at,[e("label",null,[i[17]||(i[17]=a("本次展示链接(请仅交给这台电视)",-1)),e("input",{class:"form-control",value:r.value,readonly:"",onFocus:i[6]||(i[6]=M=>M.target.select())},null,40,tt)]),e("a",{class:"btn btn-sm btn-outline-secondary mt-2",href:r.value,target:"_blank",rel:"noreferrer"},"打开看板",8,st)])):y("",!0),(d(!0),u(I,null,L(m.value.filter(M=>!M.revoked),M=>(d(),u("div",{key:M.id,class:"d-flex gap-2 align-items-center small mt-2"},[e("span",null,"授权至 "+o(F(M.expires_at)),1),e("button",{class:"btn btn-sm btn-outline-danger",disabled:n.value,onClick:ye=>p("revoke",M.id)},"停用展示权限",8,it)]))),128))]),V.value&&r.value?(d(),u("div",nt,[i[20]||(i[20]=a("App 配对码:",-1)),e("strong",ot,o(V.value),1),i[21]||(i[21]=e("div",{class:"small"},"在“赵府家庭屏”App 输入,10 分钟内有效,使用一次即失效。App 摄像头画面在本地网络直接播放。",-1))])):y("",!0),t.value?(d(),u("p",dt,o(t.value),1)):y("",!0)])):y("",!0)])):y("",!0)}}},Me=ie(rt,[["__scopeId","data-v-732e737e"]]),ut={key:0,class:"mt-3"},ct={key:0,class:"border rounded p-3 mt-2"},pt={class:"w-100"},vt=["value"],mt={class:"d-flex gap-2 small mb-2"},bt=["disabled"],ht={key:1,class:"small mt-2",role:"status"},Ie={__name:"DeviceTransfer",props:{device:Object},setup(b){const s=b,l=j(!1),c=j(""),m=j(!1),t=j(!1),n=j(""),r=N(()=>(h.value.state.households||[]).filter(_=>_.id!==h.value.state.familyId));G(()=>h.value.state.familyId,()=>{l.value=!1,c.value="",m.value=!1,n.value=""});async function x(){if(!(!m.value||!c.value)){t.value=!0,n.value="";try{await A().api("/api/devices/transfer",{source:s.device.source,id:s.device.id,targetFamilyId:c.value}),A().notify("设备已转移,电视需在新家庭重新授权。"),l.value=!1,await A().refresh()}catch(_){n.value=_.message}finally{t.value=!1}}}return(_,k)=>{var g;return((g=f(h).user)==null?void 0:g.role)==="admin"?(d(),u("div",ut,[e("button",{class:"btn btn-sm btn-outline-secondary",onClick:k[0]||(k[0]=w=>l.value=!l.value)},"转移到其他家庭"),l.value?(d(),u("div",ct,[e("label",pt,[k[4]||(k[4]=a("目标家庭 / 公司 / 工厂",-1)),H(e("select",{"onUpdate:modelValue":k[1]||(k[1]=w=>c.value=w),class:"form-select mt-2"},[k[3]||(k[3]=e("option",{value:""},"请选择",-1)),(d(!0),u(I,null,L(r.value,w=>(d(),u("option",{key:w.id,value:w.id},o(w.name),9,vt))),128))],512),[[te,c.value]])]),k[6]||(k[6]=e("p",{class:"small text-secondary mt-2"},"保留设备编号与基本档案。所属区域、负责人和上级设备需重新设置;电视旧展示授权会停用。关联录像机的摄像头需先解除关联。",-1)),e("label",mt,[H(e("input",{"onUpdate:modelValue":k[2]||(k[2]=w=>m.value=w),type:"checkbox"},null,512),[[se,m.value]]),k[5]||(k[5]=a("确认将这台设备转移给目标家庭管理",-1))]),e("button",{class:"btn btn-primary btn-sm",disabled:t.value||!m.value||!c.value,onClick:x},"确认转移",8,bt)])):y("",!0),n.value?(d(),u("p",ht,o(n.value),1)):y("",!0)])):y("",!0)}}},gt={id:"asset-list"},ft={class:"group-title"},yt={class:"count-pill"},kt={class:"device-card-grid"},wt={class:"card-body"},xt={class:"device-card-heading"},_t={class:"device-symbol"},$t={class:"flex-grow-1"},qt={class:"small text-secondary"},jt=["onClick"],Ct={class:"device-location"},Mt={class:"compact-details"},It={class:"font-monospace"},Tt={key:0},St={key:0,class:"device-tags"},Pt={class:"card-footer device-card-actions"},At=["onClick"],Lt=["onClick"],Dt=["onClick"],Nt={key:0,class:"empty"},Rt={__name:"DeviceCollection",setup(b){const s=m=>(h.value.state.cameras||[]).filter(t=>m.source==="camera"?t.assetId===m.id:t.recorderId===m.id||t.archiveRecorderId===m.id),l=m=>({["data-"+(m.source==="camera"?"edit-asset":m.source==="recorder"?"edit-recorder":"edit-device")]:m.id}),c=m=>/路由|网关|服务器/.test(m.deviceType)||/gl\.inet/i.test(m.brand||"");return(m,t)=>(d(),u("div",gt,[(d(!0),u(I,null,L(f(U).groups,n=>(d(),u("section",{key:n.key,class:"device-group"},[e("h3",ft,[a(o(n.labels.join(" / ")||"全部设备")+" ",1),e("span",yt,o(n.items.length),1)]),e("div",kt,[(d(!0),u(I,null,L(n.items,r=>{var x,_,k;return d(),u("article",{key:r.source+r.id,class:"card device-card"},[e("div",wt,[e("div",xt,[e("div",_t,[C(D,{name:r.source==="camera"?"camera":c(r)?"router":"devices"},null,8,["name"])]),e("div",$t,[e("span",qt,o(r.deviceType),1),e("h3",null,[e("button",{class:"device-title",onClick:g=>f(A)().enterDevice(r.source,r.id)},o(r.name),9,jt)])]),f(h).admin?(d(),u("button",Pe({key:0,class:"btn btn-sm btn-outline-secondary"},{ref_for:!0},l(r))," 编辑 ",16)):y("",!0)]),e("p",Ct,[a(o(((_=(x=f(A)()).location)==null?void 0:_.call(x,r.siteId))||"区域待填写"),1),r.point?(d(),u(I,{key:0},[a(" · "+o(r.point),1)],64)):y("",!0)]),e("dl",Mt,[e("div",null,[t[0]||(t[0]=e("dt",null,"品牌型号",-1)),e("dd",null,o([r.brand,r.model].filter(Boolean).join(" / ")||"未填写"),1)]),e("div",null,[t[1]||(t[1]=e("dt",null,"设备地址",-1)),e("dd",It,o(r.networkHosts.join(" / ")||"未填写"),1)]),e("div",null,[t[2]||(t[2]=e("dt",null,"网络",-1)),e("dd",null,o(f(ne)(r.networkAccess)),1)]),e("div",null,[t[3]||(t[3]=e("dt",null,"所有人 / 负责人",-1)),e("dd",null,o(r.ownerName||"待指定")+" / "+o(r.managerName||"待指定"),1)]),r.source!=="device"?(d(),u("div",Tt,[t[4]||(t[4]=e("dt",null,"镜头通道",-1)),e("dd",null,o(s(r).length)+" 个已配置",1)])):y("",!0)]),(k=r.tags)!=null&&k.length?(d(),u("div",St,[(d(!0),u(I,null,L(r.tags,g=>(d(),u("span",{key:g},o(g),1))),128))])):y("",!0),c(r)?(d(),K(oe,{key:1,device:r,active:f(h).page==="objects"&&f(U).mode==="cards"},null,8,["device","active"])):y("",!0),r.source==="device"&&/电视|显示|大屏/.test(r.deviceType)?(d(),K(Me,{key:2,device:r},null,8,["device"])):y("",!0),C(Ie,{device:r},null,8,["device"])]),e("div",Pt,[e("button",{class:"btn btn-sm btn-outline-secondary",onClick:g=>f(A)().enterDevice(r.source,r.id,"device")}," 设备详情",8,At),r.source!=="device"?(d(),u(I,{key:0},[f(h).admin?(d(),u("button",{key:0,class:"btn btn-sm btn-outline-secondary",onClick:g=>f(A)().enterDevice(r.source,r.id,"cameras")}," 配置镜头",8,Lt)):y("",!0),s(r).length?(d(),u("button",{key:1,class:"btn btn-sm btn-primary",onClick:g=>f(A)().enterDevice(r.source,r.id,"live")}," 实时画面 ",8,Dt)):y("",!0)],64)):y("",!0)])])}),128))])]))),128)),f(U).devices.length?y("",!0):(d(),u("div",Nt,[C(D,{name:"devices"}),t[5]||(t[5]=e("h3",null,"当前范围没有设备",-1)),t[6]||(t[6]=e("p",null,"调整筛选条件,或添加摄像机、路由器、灯等设备。",-1))]))]))}},zt={key:0,class:"network-diagram"},Ht={class:"diagram-toolbar"},Ut={class:"small text-secondary"},Vt={class:"chart-network-surface"},Bt={__name:"NetworkDiagram",setup(b){const s=j(0),l=N(()=>Qe(U.value.rows,A().location)),c=N(()=>h.value.loggedIn&&h.value.page==="objects"&&U.value.mode==="topology");G(()=>h.value.session+":"+h.value.state.familyId,()=>s.value++);function m(t){const n=U.value.rows.find(r=>r.device.id===t);n&&A().enterDevice(n.device.source,t,"device")}return(t,n)=>f(U).rows.length?(d(),u("div",zt,[e("div",Ht,[e("div",null,[n[1]||(n[1]=e("span",{class:"diagram-dot"},null,-1)),n[2]||(n[2]=e("strong",null,"设备连接图",-1)),e("span",Ut,o(f(U).rows.length)+" 台设备 · "+o(l.value.series[0].links.length)+" 条已登记连接",1)]),e("button",{class:"btn btn-sm btn-outline-secondary",onClick:n[0]||(n[0]=r=>s.value++)},"重置视图")]),e("div",Vt,[(d(),K(J,{key:s.value,option:l.value,active:c.value,height:400,label:"已登记设备连接图,可拖动缩放;下方设备详情提供相同信息及操作。",onSelect:m},null,8,["option","active"]))]),n[3]||(n[3]=e("p",{class:"diagram-note"},"拖动平移、滚轮或双指缩放;点击节点打开档案。未登记上级的设备独立显示;接入方式不代表在线状态。",-1))])):y("",!0)}},Ot={id:"device-topology",hidden:""},Et={class:"panel network-map"},Zt={class:"network-platform"},Ft={class:"topology-nodes"},Wt={class:"card-body"},Yt={class:"device-card-heading"},Gt={class:"flex-grow-1"},Kt={class:"small text-secondary"},Jt=["onClick"],Xt=["onClick"],Qt={class:"device-location"},es={class:"network-facts"},ls={key:0},as={key:1},ts={key:2},ss={key:3},is={key:0,class:"empty"},ns={__name:"NetworkMap",setup(b){const s=N(()=>(h.value.state.households||[]).find(l=>l.id===h.value.state.familyId));return(l,c)=>{var m;return d(),u("div",Ot,[e("section",Et,[e("div",Zt,[C(D,{name:"network"}),e("div",null,[e("h3",null,o(((m=s.value)==null?void 0:m.name)||"当前场所"),1),e("p",null,o(f(U).devices.length)+" 台设备 · 随设备档案自动更新",1)])]),c[7]||(c[7]=e("p",{class:"description"}," 连线来自已确认的上级设备关系。上级未填写时单独列出;不代表已自动发现所有交换机或布线。 ",-1)),C(Bt),c[8]||(c[8]=e("h3",{class:"network-details-heading"},"设备与连接详情",-1)),e("div",Ft,[(d(!0),u(I,null,L(f(U).rows,t=>{var n,r;return d(),u("article",{key:t.device.id,class:Y(["network-node card",{nested:t.depth>0}]),style:ee({"--depth":Math.min(t.depth,5)})},[e("div",Wt,[e("div",Yt,[C(D,{name:t.device.source==="camera"?"camera":"router"},null,8,["name"]),e("div",Gt,[e("span",Kt,o(t.device.deviceType)+" · "+o(f(ne)(t.device.networkAccess)),1),e("h3",null,[e("button",{class:"device-title",onClick:x=>f(A)().enterDevice(t.device.source,t.device.id)},o(t.device.name),9,Jt)])]),e("button",{class:"btn btn-sm btn-outline-secondary",onClick:x=>f(A)().enterDevice(t.device.source,t.device.id,"device")}," 详情 → ",8,Xt)]),e("p",Qt,[a(o(((r=(n=f(A)()).location)==null?void 0:r.call(n,t.device.siteId))||"未指定区域")+" ",1),t.device.point?(d(),u(I,{key:0},[a(" · "+o(t.device.point),1)],64)):y("",!0)]),e("div",es,[e("span",null,[c[0]||(c[0]=a("IP ",-1)),e("b",null,o(t.device.networkHosts.join(" / ")||"待填写"),1)]),t.device.tailscaleHost?(d(),u("span",ls,[c[1]||(c[1]=a("Tailscale ",-1)),e("b",null,o(t.device.tailscaleHost),1)])):y("",!0),t.device.networkCidr?(d(),u("span",as,[c[2]||(c[2]=a("网段 ",-1)),e("b",null,o(t.device.networkCidr),1)])):y("",!0),e("span",null,[c[3]||(c[3]=a("上级 ",-1)),e("b",null,o(t.parentName||"待确认 / 直接接入"),1)]),e("span",null,[c[4]||(c[4]=a("连接 ",-1)),e("b",null,o({wired:"网线",wifi:"Wi-Fi"}[t.device.connectionType]||"待确认"),1)]),t.via.length?(d(),u("span",ts,[c[5]||(c[5]=a("取流经录像机 ",-1)),e("b",null,o(t.via.join("、")),1)])):y("",!0),t.archiveVia.length?(d(),u("span",ss,[c[6]||(c[6]=a("录像归档 ",-1)),e("b",null,o(t.archiveVia.join("、")),1)])):y("",!0)]),/路由|网关|服务器/.test(t.device.deviceType)?(d(),K(oe,{key:0,device:t.device,active:f(h).page==="objects"&&f(U).mode==="topology"},null,8,["device","active"])):y("",!0)])],6)}),128)),f(U).rows.length?y("",!0):(d(),u("p",is," 当前范围尚未登记设备。 "))])])])}}},os={key:0,class:"panel"},ds={__name:"DeviceNetworkPanel",setup(b){return(s,l)=>f(h).admin&&f(h).device&&f(h).page==="device"?(d(),u("section",os,[l[0]||(l[0]=e("h3",null,"网络状态与管理入口",-1)),f(h).device.source==="device"&&/电视|显示|大屏/.test(f(h).device.deviceType)?(d(),K(Me,{key:0,device:f(h).device},null,8,["device"])):(d(),K(oe,{key:1,device:f(h).device},null,8,["device"])),C(Ie,{device:f(h).device},null,8,["device"])])):y("",!0)}},rs={key:0,class:"row g-3 mb-4","aria-label":"当前场所设备统计"},us={class:"col-12 col-lg-7"},cs={class:"chart-card h-100"},ps={class:"chart-heading"},vs={class:"small text-secondary"},ms={class:"chart-data"},bs={class:"col-12 col-lg-5"},hs={class:"chart-card h-100"},gs={class:"chart-legend"},fs={__name:"ScopeInsights",setup(b){const s=N(()=>Xe(h.value.state)),l=N(()=>h.value.loggedIn&&h.value.page==="overview");return(c,m)=>l.value&&s.value.total?(d(),u("section",rs,[e("div",us,[e("article",cs,[e("div",ps,[m[0]||(m[0]=e("h3",null,"设备类型",-1)),e("span",vs,o(s.value.total)+" 台已授权设备",1)]),C(J,{option:f(je)(s.value.types.slice(0,8)),height:220,label:"设备类型:"+s.value.types.map(t=>t.label+t.count+"台").join(",")},null,8,["option","label"]),e("details",ms,[m[1]||(m[1]=e("summary",null,"查看全部类型",-1)),e("ul",null,[(d(!0),u(I,null,L(s.value.types,t=>(d(),u("li",{key:t.label},o(t.label)+":"+o(t.count)+" 台",1))),128))])])])]),e("div",bs,[e("article",hs,[m[2]||(m[2]=e("div",{class:"chart-heading"},[e("h3",null,"网络接入"),e("span",{class:"small text-secondary"},"来自设备档案")],-1)),C(J,{option:f(qe)(s.value.networks),height:190,label:"登记的网络接入方式:"+s.value.networks.map(t=>t.label+t.count+"台").join(",")},null,8,["option","label"]),e("div",gs,[(d(!0),u(I,null,L(s.value.networks,(t,n)=>(d(),u("span",{key:t.label},[e("i",{style:ee({background:f(Q)[n]})},null,4),a(o(t.label)+" ",1),e("b",null,o(t.count),1)]))),128))]),m[3]||(m[3]=e("p",{class:"small text-secondary mt-2 mb-0"},"接入方式不代表设备在线状态。",-1))])])])):y("",!0)}},ys={id:"page-overview",class:"page",hidden:""},ks={id:"page-device",class:"page",hidden:""},ws={id:"page-objects",class:"page",hidden:""},xs={__name:"Workspace",setup(b){return(s,l)=>(d(),u(I,null,[l[5]||(l[5]=e("div",{id:"household-context",class:"household-context",hidden:""},[e("label",null,[a("当前归属 "),e("select",{id:"household-filter","aria-label":"当前归属"})]),e("span",{id:"household-context-note"}),e("button",{id:"scope-back",class:"quiet"},"返回场所")],-1)),l[6]||(l[6]=e("div",{id:"device-context",class:"device-context",hidden:""},[e("p",{id:"device-breadcrumb"}),e("div",{role:"group","aria-label":"设备功能"},[e("button",{class:"quiet","data-device-tab":"device"},"设备档案"),e("button",{class:"quiet","data-device-tab":"live"},"实时画面"),e("button",{class:"quiet","data-device-tab":"playback"},"录像回放"),e("button",{class:"quiet","data-device-tab":"cameras"},"镜头与设置")])],-1)),l[7]||(l[7]=E('可选择任意区域,包含其下级区域
',3)),l[8]||(l[8]=e("section",{id:"page-settings",class:"page",hidden:""},[e("div",{class:"section-head"},[e("h2",null,"把这里布置成你习惯的样子"),e("button",{id:"settings-reload",class:"quiet"},"重新读取设置")]),e("p",{id:"settings-error",role:"status"}),e("div",{class:"settings-sections",role:"group","aria-label":"设置分类"},[e("button",{class:"quiet","data-settings-section":"preferences","aria-pressed":"true"},"我的偏好"),e("button",{class:"quiet","data-settings-section":"baidu","data-platform-setting":"",hidden:""},"网盘连接"),e("button",{class:"quiet","data-settings-section":"brand","data-platform-setting":"",hidden:""},"品牌与外观"),e("button",{class:"quiet","data-settings-section":"backup","data-platform-setting":"",hidden:""},"数据库备份")]),e("form",{id:"preferences-form",class:"panel"},[e("h3",null,"我的偏好"),e("p",{class:"description"},"只影响当前账号,保存后换电脑或手机登录也会沿用。切换选项可以预览,离开未保存的预览会撤销。"),e("div",{id:"personal-choices",class:"form-grid"}),e("p",{id:"preferences-status",role:"status"}),e("div",{class:"device-actions"},[e("button",{type:"submit"},"保存我的偏好"),e("button",{type:"button",id:"personal-follow",class:"quiet"},"全部跟随平台"),e("button",{type:"button",id:"personal-cancel",class:"quiet"},"撤销预览")])]),e("section",{id:"baidu-admin",class:"panel",hidden:""},[e("div",{class:"section-head"},[e("h3",null,"百度网盘 · 统一存储"),e("span",{class:"badge"},"仅超级管理员配置")]),e("p",{class:"description"},"连接一个网盘账号,统一保存封面、Logo、图标及各用户上传的照片、视频和语音。系统按用户、家庭和记事可见范围授权;网盘账号持有人本身可以管理网盘中的文件。服务器仅转发分片,不保存媒体原文件。"),e("details",{id:"baidu-storage-guide"},[e("summary",null,"文件存在哪里?"),e("ul",null,[e("li",null,"家庭与场所:按家庭或场所保存封面。"),e("li",null,"平台外观:保存 Logo 和图标。"),e("li",null,"个人记事:按家庭、用户分组,再分照片、视频、语音。"),e("li",null,"数据库备份:单独存放;新备份上传并校验成功后,清理超过一个自然月的旧云备份。")]),e("p",{class:"description"},"文字、权限和文件引用保存在本机数据库;个人媒体原文件保存在百度网盘。封面和品牌图片仅做有限的内存缓存。更换封面、移除附件或删除记事不会删除网盘原文件。")]),e("form",{id:"baidu-config"},[e("div",{class:"form-grid"},[e("label",null,[a("AppKey"),e("input",{name:"appKey",autocomplete:"off",maxlength:"150",required:""})]),e("label",null,[a("SecretKey"),e("input",{name:"secretKey",type:"password",autocomplete:"new-password",maxlength:"150"})]),e("label",null,[a("百度后台应用名称"),e("input",{name:"appFolder",value:"智家",required:"",maxlength:"40"})]),e("label",null,[a("OAuth 回调地址"),e("input",{name:"redirectUri",type:"url",placeholder:"https://你的域名/api/baidu/callback",required:"",maxlength:"400"})])]),e("p",{class:"description"},"回调地址须与百度后台完全一致。SecretKey 留空保持已保存值,SignKey 不需要填写。当前开发者应用仅限个人场景,适用范围以百度后台为准。"),e("p",{id:"baidu-config-status",role:"status"}),e("button",{type:"submit"},"保存网盘应用配置")]),e("hr"),e("p",{id:"baidu-status",role:"status"}),e("div",{class:"device-actions"},[e("button",{id:"baidu-connect"},"连接/重新授权百度网盘"),e("button",{id:"baidu-disconnect",class:"quiet"},"解除本机连接")]),e("p",{class:"description"},"解除连接不会删除云端文件。临时媒体地址由后台按需获取,令牌不发送给浏览器。网盘授权凭据单独保存在服务器受限目录,不包含在数据库备份或公开源码中。")]),e("div",{id:"settings-private",hidden:""},[e("form",{id:"brand-form",class:"panel"},[e("h3",null,"发布与品牌配置"),e("p",{class:"description"},"仅超级管理员可修改。名称、Logo、浏览器图标及登录文案会公开显示;适用于整套系统。已有个人偏好优先于平台默认。"),e("div",{class:"form-grid"},[e("label",null,[a("系统名称"),e("input",{name:"name",required:"",maxlength:"40"})]),e("label",null,[a("系统副标题"),e("input",{name:"subtitle",required:"",maxlength:"60"})]),e("label",{class:"full"},[a("页首题词"),e("input",{name:"motto",maxlength:"100"})]),e("label",null,[a("登录标题"),e("input",{name:"loginTitle",required:"",maxlength:"40"})]),e("label",null,[a("登录说明"),e("input",{name:"loginNote",maxlength:"160"})]),e("label",{class:"full"},[a("页脚说明"),e("input",{name:"footer",maxlength:"120"})])]),e("div",{class:"brand-image-grid"},[e("div",null,[e("img",{id:"brand-logo-preview",alt:"Logo 预览",src:"/zhao-icon.png"}),e("label",null,[a("更换系统 Logo"),e("input",{id:"brand-logo-file",type:"file",accept:"image/png,image/jpeg,image/webp"})]),e("button",{type:"button",id:"brand-logo-reset",class:"quiet"},"使用默认 Logo")]),e("div",null,[e("img",{id:"brand-icon-preview",alt:"浏览器图标预览",src:"/zhao-icon.png"}),e("label",null,[a("更换浏览器图标"),e("input",{id:"brand-icon-file",type:"file",accept:"image/png,image/jpeg,image/webp"})]),e("button",{type:"button",id:"brand-icon-reset",class:"quiet"},"使用默认图标")])]),e("p",{class:"description"},"支持 PNG、JPEG、WebP,原图最多 5 MB;上传时自动缩小,图片随系统数据库保存。"),e("h3",null,"新账号与跟随平台账号的默认外观"),e("div",{id:"brand-defaults",class:"form-grid"}),e("p",{id:"brand-status",role:"status"}),e("div",{class:"device-actions"},[e("button",{type:"submit"},"保存发布配置"),e("button",{type:"button",id:"brand-export",class:"quiet"},"导出发布配置"),e("label",{class:"config-import"},[a("导入配置到表单"),e("input",{id:"brand-import",type:"file",accept:"application/json,.json"})])]),e("p",{class:"description"},"导入后先核对再保存。导出的配置只含品牌与默认外观,不含账号、设备凭据、家庭资料和网络备份目录。")]),e("section",{id:"backup-panel",class:"panel"},[e("h3",null,"数据库备份"),e("p",{class:"description"},"整台服务的数据库包含所有家庭、账号、设备连接配置和网盘文件引用,因此仅超级管理员可操作。网盘中的照片、视频、语音及录像文件不包含在新数据库副本中;旧版备份可能仍含历史内嵌图片。恢复后所有账号需要重新登录。"),e("form",{id:"backup-form"},[e("div",{class:"form-grid"},[e("label",{class:"check full"},[e("input",{name:"enabled",type:"checkbox"}),a("启用每日定时备份")]),e("label",{class:"check full"},[e("input",{name:"baidu",type:"checkbox"}),a("同时上传到已连接的百度网盘")]),e("label",null,[a("每日时间(北京时间)"),e("input",{name:"time",type:"time",required:"",value:"03:00"})]),e("label",null,[a("本机/挂载目录保留份数"),e("input",{name:"keep",type:"number",min:"1",max:"90",required:"",value:"14"})]),e("label",{class:"full"},[a("网络备份目录(可留空)"),e("input",{name:"networkPath",maxlength:"500",placeholder:"/var/lib/zhaovision/network-backup"})])]),e("p",{class:"description"},"填写本服务器已挂载的网络盘目录。使用百度接口备份只需勾选上方选项;此路径用于其他已挂载的网络存储,不能填网页地址或分享链接。写入网络目录成功不等于已确认百度云端同步完成。"),e("p",{class:"description"},"默认部署允许写入 /var/lib/zhaovision 下的目录。挂载和目录权限须由主机管理员配置;本页不会保存网盘登录密码。保留份数只清理本机和挂载目录中本系统生成的旧备份,百度网盘保留最近一个自然月;新备份上传并校验成功后才清理本应用的过期副本。"),e("p",{id:"backup-local-path",class:"description"}),e("p",{id:"backup-save-status",role:"status"}),e("button",{type:"submit"},"保存备份设置")]),e("div",{class:"section-head"},[e("h3",null,"备份记录"),e("button",{id:"backup-run"},"立即备份数据库")]),e("p",{id:"backup-result",role:"status"}),e("div",{id:"backup-history"})])])],-1)),l[9]||(l[9]=e("section",{id:"page-journal",class:"page",hidden:""},[e("div",{class:"scope-intro"},[e("span",{class:"eyebrow"},"岁月有迹 · 日常成章"),e("h2",null,"把生活,写成自己的来时路"),e("p",null,"与家人分享近况,也为自己留下一份阅历。")]),e("form",{id:"journal-form",class:"panel journal-compose"},[e("input",{type:"hidden",name:"id"}),e("input",{type:"hidden",name:"revision",value:"0"}),e("input",{type:"hidden",name:"clientId"}),e("label",null,[a("此刻想记下什么?"),e("textarea",{name:"text",rows:"4",maxlength:"5000",placeholder:"今天的心情、一段往事,或一个值得记住的时刻…"})]),e("div",{class:"form-grid"},[e("label",null,[a("记事日期"),e("input",{name:"occurredOn",type:"date",required:""})]),e("label",null,[a("阅历分类"),e("select",{name:"category"},[e("option",null,"日常"),e("option",null,"成长"),e("option",null,"家庭"),e("option",null,"旅行"),e("option",null,"工作"),e("option",null,"其他")])]),e("label",null,[a("谁可以看到"),e("select",{name:"visibility"},[e("option",{value:"private"},"仅自己可见"),e("option",{value:"household"},"当前家庭/场所成员")])])]),e("div",{class:"journal-add-media"},[e("label",{class:"quiet"},[a("+ 照片、视频或语音"),e("input",{id:"journal-files",disabled:"",type:"file",accept:"image/jpeg,image/png,image/webp,video/mp4,video/quicktime,video/webm,audio/mpeg,audio/mp4,audio/aac,audio/wav,audio/ogg,audio/webm,.m4a"})]),e("button",{id:"journal-record",disabled:"",type:"button",class:"quiet"},"● 直接录音"),e("button",{id:"journal-stop-record",type:"button",hidden:""},"结束录音并上传"),e("button",{id:"journal-cancel-upload",type:"button",class:"quiet",hidden:""},"暂停上传")]),e("p",{id:"journal-cloud-note",class:"description"}),e("p",{class:"description"},"每条最多 9 个附件,单个文件最多 256 MB;一次上传一个文件。录音须通过 HTTPS 并允许麦克风,最长 5 分钟。上传完成后默认选中。保存后清空本次输入;再次使用可展开“我的附件库”。"),e("div",{id:"journal-upload-list",class:"journal-upload-grid"}),e("details",{id:"journal-library",class:"journal-library"},[e("summary",null,[a("我的附件库("),e("span",{id:"journal-library-count"},"0"),a(")")]),e("p",{class:"description"},"已上传的附件可预览、删除或再次用于记事。"),e("div",{id:"journal-library-list",class:"journal-upload-grid"})]),e("details",{id:"journal-trash",class:"journal-trash",hidden:""},[e("summary",null,[a("已删除附件("),e("span",{id:"journal-trash-count"},"0"),a(")")]),e("p",{class:"description"},"删除仅整理附件库,已发布的记事与网盘原文件保留。恢复后可再次使用。"),e("div",{id:"journal-trash-list"})]),e("p",{id:"journal-status",role:"status","aria-live":"polite"}),e("div",{class:"device-actions"},[e("button",{id:"journal-save",type:"submit"},"保存记事"),e("button",{id:"journal-new",type:"button",class:"quiet"},"另写一条")])]),e("form",{id:"journal-filter",class:"panel journal-filters"},[e("label",null,[a("查看方式"),e("select",{id:"journal-mode"},[e("option",{value:"feed"},"家庭/场所动态"),e("option",{value:"mine"},"我的个人阅历"),e("option",{value:"person"},"某个人的阅历")])]),e("label",{id:"journal-person-label",hidden:""},[a("人物"),e("select",{id:"journal-person"})]),e("label",null,[a("分类"),e("select",{id:"journal-category"},[e("option",{value:""},"全部分类"),e("option",null,"日常"),e("option",null,"成长"),e("option",null,"家庭"),e("option",null,"旅行"),e("option",null,"工作"),e("option",null,"其他")])]),e("label",null,[a("关键词"),e("input",{id:"journal-search",type:"search",maxlength:"120",placeholder:"在文字中查找"})]),e("label",null,[a("开始日期"),e("input",{id:"journal-from",type:"date"})]),e("label",null,[a("结束日期"),e("input",{id:"journal-to",type:"date"})]),e("button",{type:"submit"},"查询阅历"),e("button",{id:"journal-filter-clear",type:"button",class:"quiet"},"清除筛选")]),e("p",{class:"description"},"个人阅历保留同一条记事的文字、附件和互动;查看他人时只展示其分享给当前家庭/场所的内容。删除记事或移出附件列表不会删除网盘原文件。"),e("div",{class:"section-head"},[e("p",{id:"journal-query-status",role:"status"}),e("div",null,[e("button",{id:"journal-prev",class:"quiet"},"上一页"),e("button",{id:"journal-next",class:"quiet"},"下一页")])]),e("div",{id:"journal-list",class:"journal-feed"})],-1)),e("section",ys,[C(fs),l[0]||(l[0]=e("div",{id:"scope-overview"},null,-1))]),e("section",ks,[C(ds),l[1]||(l[1]=e("div",{id:"device-detail"},null,-1))]),l[10]||(l[10]=e("section",{id:"page-heritage",class:"page",hidden:""},[e("div",{id:"heritage-home"})],-1)),l[11]||(l[11]=e("section",{id:"page-live",class:"page"},[e("div",{class:"section-head"},[e("h2",{id:"live-heading"},"本场所监控墙"),e("div",null,[e("label",null,[a("清晰度 "),e("select",{id:"quality"},[e("option",{value:"hd"},"主码流"),e("option",{value:"compat"},"子码流")])])])]),e("details",{class:"live-help"},[e("summary",null,"画面与清晰度说明"),e("p",{id:"wall-context",class:"description"},"这里汇总当前场所内已授权的镜头;点击摄像头详情可进入单台设备。"),e("p",{class:"description",id:"quality-note"},"主码流画面更清晰,最高 1920×1080;子码流更流畅,最高 768×432,适合网络较慢时使用。")]),e("div",{class:"wall-toolbar"},[e("label",null,[a("分屏 "),e("select",{id:"wall-layout"},[e("option",{value:"auto"},"自适应"),e("option",{value:"1"},"1 画面"),e("option",{value:"2"},"2 画面"),e("option",{value:"4"},"4 画面"),e("option",{value:"6"},"6 画面"),e("option",{value:"9"},"9 画面"),e("option",{value:"16"},"16 画面")])]),e("label",{class:"check"},[e("input",{id:"wall-arrange",type:"checkbox"}),a("调整顺序")]),e("div",{class:"wall-paging"},[e("button",{id:"wall-prev",class:"quiet","aria-label":"上一组画面"},"‹"),e("span",{id:"wall-page"}),e("button",{id:"wall-next",class:"quiet","aria-label":"下一组画面"},"›")]),e("span",{id:"wall-clock"}),e("button",{id:"wall-fullscreen"},"全屏监控")]),e("div",{id:"live-grid",class:"live-grid"}),e("section",{id:"ptz-panel",class:"ptz-panel",hidden:""},[e("div",null,[e("strong",{id:"ptz-title"},"云台"),e("p",{id:"ptz-status",role:"status"})]),e("div",{class:"ptz-pad"},[e("button",{"data-ptz-action":"up","aria-label":"云台向上"},"↑"),e("button",{"data-ptz-action":"left","aria-label":"云台向左"},"←"),e("button",{"data-ptz-action":"stop"},"停止"),e("button",{"data-ptz-action":"right","aria-label":"云台向右"},"→"),e("button",{"data-ptz-action":"down","aria-label":"云台向下"},"↓")]),e("div",{id:"ptz-presets"},[e("div",{class:"section-head"},[e("strong",null,[a("常用位置 "),e("small",{id:"preset-count"})]),e("button",{id:"preset-reload",class:"quiet"},"重新读取")]),e("p",{id:"preset-status",role:"status"}),e("div",{id:"preset-list"}),e("p",{class:"description"},"调整位置后可另存为新预置位。本版不覆盖已有位置,避免设备固件拒绝或误改。"),e("form",{id:"preset-form",hidden:""},[e("label",null,[a("当前位置名称"),e("input",{id:"preset-name",required:"",maxlength:"40",placeholder:"例如:大门、院子"})]),e("button",{type:"submit"},"保存当前位置")]),e("div",{id:"preset-confirmation",hidden:""},[e("p",{id:"preset-confirm-text"}),e("button",{id:"preset-confirm-yes"},"确认"),e("button",{id:"preset-confirm-cancel",class:"quiet"},"取消")])]),e("button",{id:"ptz-close",class:"quiet"},"收起云台")])],-1)),l[12]||(l[12]=e("section",{id:"page-playback",class:"page",hidden:""},[e("div",{class:"section-head"},[e("h2",null,[a("回到那一刻 "),e("small",null,"光阴")])]),e("div",{class:"panel playback-controls"},[e("label",null,[a("镜头 / 通道"),e("select",{id:"play-camera"})]),e("label",null,[a("录像来源"),e("select",{id:"archive-source"},[e("option",{value:"recorder"},"录像机原有录像(待接入)"),e("option",{value:"local"},"小电脑本机录像")])]),e("label",null,[a("日期"),e("input",{id:"play-date",type:"date"})]),e("button",{id:"query-recordings"},"查找录像"),e("span",{id:"play-info"},"选择日期,查看实际录像时段")]),e("aside",{id:"recording-health",class:"panel","aria-label":"本机录像状态",hidden:""},[e("div",{class:"section-head"},[e("strong",{id:"recording-health-text",role:"status"}),e("button",{id:"recording-configure",class:"quiet",hidden:""},"录像设置")]),e("p",{id:"recording-policy-note",class:"description"}),e("p",{id:"recording-start-note",class:"description"})]),e("div",{class:"video-panel"},[e("video",{id:"play-video",controls:"",playsinline:""}),e("div",{id:"play-empty",class:"video-empty"},"选择一个有录像的时间段")]),e("div",{class:"panel"},[e("div",{class:"timeline-head"},[e("strong",null,"当日时间轴"),e("span",null,[e("i",{class:"legend"}),a(" 有录像的时段 · 点击定位")])]),e("canvas",{id:"timeline",height:"76","aria-label":"录像时间轴"}),e("div",{class:"time-labels"},[e("span",null,"00:00"),e("span",null,"06:00"),e("span",null,"12:00"),e("span",null,"18:00"),e("span",null,"24:00")]),e("div",{class:"seek-row"},[e("label",null,[a("定位时间 "),e("input",{id:"seek-time",type:"time",step:"1",value:"12:00:00"})]),e("button",{id:"seek-button",class:"secondary"},"定位播放"),e("a",{id:"download",class:"button secondary",hidden:""},"下载原始片段")])]),e("div",{class:"panel"},[e("div",{class:"playback-tools"},[e("label",{class:"check"},[e("input",{id:"play-autonext",type:"checkbox",checked:""}),a("自动续播下一时段(跳过空档)")]),e("button",{id:"play-snapshot",class:"quiet"},"回放截图"),e("span",{id:"play-position",role:"status"})]),e("details",{class:"clip-editor"},[e("summary",null,"选取并下载指定片段"),e("form",{id:"clip-form"},[e("div",{class:"form-grid"},[e("label",null,[a("开始时间"),e("input",{id:"clip-start",type:"datetime-local",step:"1",required:""})]),e("label",null,[a("结束时间"),e("input",{id:"clip-end",type:"datetime-local",step:"1",required:""})])]),e("div",{class:"playback-tools"},[e("button",{type:"button",class:"quiet","data-clip-mark":"start"},"当前位置作起点"),e("button",{type:"button",class:"quiet","data-clip-mark":"end"},"当前位置作终点"),e("button",{type:"submit"},"生成下载链接"),e("a",{id:"clip-download",class:"button secondary",hidden:""},"下载所选片段")]),e("p",{id:"clip-status",role:"status",class:"description"}),e("p",{class:"description"},"每段最多一小时,不可跨越无录像时段。下载保留原始编码,剪辑边界可能受设备关键帧影响。")])])]),e("div",{id:"recording-list",class:"recording-list"})],-1)),l[13]||(l[13]=E('',1)),e("section",ws,[l[2]||(l[2]=E('一物一档 设备 · 归属
同一设备可同时记录类型、区域、所有人、负责人和标签。分组顺序可自由组合,例如“灯 → 卧室”或“负责人 → 类型 → 区域”。人员归属不自动授予访问权限。
',2)),l[3]||(l[3]=e("div",{class:"panel device-view-controls"},[e("div",{class:"device-search-row"},[e("label",null,[a("设备类型"),e("select",{id:"device-type"},[e("option",{value:""},"所有类型")])]),e("label",null,[a("搜索设备或人员"),e("input",{id:"device-search",type:"search",placeholder:"例如:卧室 灯;也可查 IP、品牌、型号、人员"})]),e("button",{id:"device-clear",type:"button",class:"quiet",hidden:""},"清除设备筛选")]),e("div",{class:"device-actions view-presets",role:"group","aria-label":"设备分组方式"},[e("button",{type:"button",class:"quiet","data-group-preset":"space,type"},"按区域查看"),e("button",{type:"button",class:"quiet","data-group-preset":"type,space"},"按类型查看"),e("button",{type:"button",class:"quiet","data-group-preset":"manager,type,space"},"按负责人查看")]),e("details",{class:"group-custom"},[e("summary",null,"自定义分组顺序"),e("p",{class:"description"},"依次分组(前面的维度优先,区域按你定义的完整层级展示)"),e("div",{id:"device-group-order",class:"device-group-order"}),e("div",{class:"device-actions"},[e("button",{id:"device-group-add",class:"quiet"},"+ 增加分组维度"),e("button",{"data-admin":"",id:"device-view-save",class:"secondary"},"保存为本归属的默认视图")])]),e("p",{id:"device-count",class:"description"})],-1)),l[4]||(l[4]=e("div",{class:"device-actions",role:"group","aria-label":"设备展示方式"},[e("button",{id:"devices-card-view",class:"quiet","aria-pressed":"true"},"设备卡片"),e("button",{id:"devices-topology-view",class:"quiet","aria-pressed":"false"},"网络拓扑")],-1)),C(Rt),C(ns)]),l[14]||(l[14]=E('录像机 存影
统一保存录像机地址与账号,镜头通道关联录像机。实时取流使用 RTSP;读取录像机已有历史录像,需要该型号的回放接口适配。
区域与空间 自定层级
在当前家庭或场所下自行划分区域,不限定层级数量。例如“一楼 → 卧室”或“厂区 → 车间 → 产线”。名称和区域类别均由你定义,地址信息按需填写。
录像与存储 留存
运行状态
开启摄像头的“持续录像”后,服务会保存主码流。预览默认使用主码流高清画面(最高 1920×1080、15 帧/秒),也可切换子码流流畅画面(最高 768×432、10 帧/秒)。本机录像保留设备原始编码。
最近操作
',3)),l[15]||(l[15]=e("section",{id:"page-heritage-records",class:"page",hidden:""},[e("div",{class:"section-head"},[e("h2",{id:"heritage-records-title"},"文化与家风"),e("div",null,[e("button",{class:"quiet","data-page":"heritage"},"返回家庭传承"),e("button",{id:"heritage-new"},"+ 新建档案")])]),e("div",{class:"panel heritage-controls"},[e("label",null,[a("查找档案"),e("input",{id:"heritage-search",type:"search",placeholder:"名称、内容、相关人员"})]),e("label",{class:"check"},[e("input",{id:"heritage-archived",type:"checkbox"}),a("包含归档资料")]),e("button",{id:"heritage-reload",class:"quiet"},"重新载入")]),e("p",{id:"heritage-error",class:"form-error",role:"status"}),e("div",{id:"heritage-list",class:"site-grid"}),e("aside",{id:"heritage-detail",class:"panel",hidden:""})],-1)),l[16]||(l[16]=e("section",{id:"page-family",class:"page",hidden:""},[e("div",{class:"section-head"},[e("h2",null,[a("家族的来处与延续 "),e("small",null,"世系 · 传承")]),e("div",null,[e("button",{id:"family-reload",class:"quiet"},"重新载入"),e("button",{id:"family-export",class:"quiet"},"导出家谱"),e("button",{id:"new-person"},"+ 录入人物")])]),e("p",{class:"description"},"从祖辈到后辈,一张图看全家。点击人物查看档案,暖金色卡片是当前账号关联的本人。"),e("p",{id:"family-edit-note",class:"alert alert-info",role:"status"}),e("div",{class:"panel family-toolbar"},[e("label",null,[a("关系参照人物"),e("select",{id:"family-reference"})]),e("label",null,[a("查找人物"),e("input",{id:"family-search",type:"search",placeholder:"姓名、别名或籍贯"})]),e("button",{id:"family-find",class:"quiet",hidden:""},"定位搜索结果"),e("label",{class:"check"},[e("input",{id:"family-archived",type:"checkbox"}),a("显示归档人物")]),e("span",{id:"family-count"})]),e("div",{id:"family-error",class:"form-error",role:"status"}),e("div",{id:"family-workspace",class:"family-workspace"},[e("section",{id:"family-canvas-panel",class:"family-canvas-panel","aria-label":"全家关系图"},[e("div",{class:"family-map-heading"},[e("div",null,[e("span",{class:"eyebrow"},"枝叶相连 · 世代相承"),e("h2",{id:"family-view-title"},"全家关系图")]),e("div",{class:"family-view-tabs",role:"group","aria-label":"家谱显示方式"},[e("button",{id:"family-view-tree",class:"quiet","aria-pressed":"true"},"关系图"),e("button",{id:"family-view-list",class:"quiet","aria-pressed":"false"},"人物名册"),e("button",{id:"family-view-timeline",class:"quiet","aria-pressed":"false"},"家族时间线")])]),e("div",{id:"family-map-controls",class:"family-map-controls"},[e("div",{class:"family-zoom-controls"},[e("button",{id:"family-zoom-out",class:"quiet","aria-label":"缩小家谱"},"−"),e("output",{id:"family-zoom-value","aria-live":"polite"},"100%"),e("button",{id:"family-zoom-in",class:"quiet","aria-label":"放大家谱"},"+"),e("button",{id:"family-fit",class:"quiet"},"查看全谱")]),e("button",{id:"family-locate-self",class:"quiet"},"◎ 定位本人"),e("button",{id:"family-fullscreen",class:"quiet"},"全屏家谱")]),e("div",{id:"family-tree",class:"family-map-viewport",tabindex:"0",role:"region","aria-label":"家谱关系图,可拖动空白处或使用滚动条浏览"}),e("div",{id:"family-people",class:"family-people family-register",hidden:""}),e("section",{id:"family-events",hidden:"","aria-label":"家族重大记事"},[e("div",{class:"family-event-intro"},[e("div",null,[e("h3",null,"把值得记住的事,留给后来的人"),e("p",{class:"description"},"按事情发生的日期排列,可关联多位亲人,并附上详细记载或报道链接。")]),e("button",{id:"family-new-event"},"+ 写一则记事")]),e("div",{class:"family-event-filters"},[e("label",null,[a("关联人物"),e("select",{id:"family-event-person"},[e("option",{value:""},"全家")])]),e("label",null,[a("年份"),e("select",{id:"family-event-year"},[e("option",{value:""},"所有年份")])]),e("label",null,[a("排列"),e("select",{id:"family-event-order"},[e("option",{value:"desc"},"从近到远"),e("option",{value:"asc"},"从远到近")])]),e("label",null,[a("搜索记事"),e("input",{id:"family-event-search",type:"search",placeholder:"标题、摘要或正文"})]),e("label",{class:"check"},[e("input",{id:"family-event-relatives",type:"checkbox"}),a("包括此人的父母、配偶和子女")]),e("label",{id:"family-event-state-label"},[a("状态"),e("select",{id:"family-event-state"},[e("option",{value:"published"},"已发布"),e("option",{value:"draft"},"草稿箱"),e("option",{value:"archived"},"已归档"),e("option",{value:"all"},"全部")])]),e("button",{id:"family-event-clear",class:"quiet"},"清除筛选")]),e("p",{id:"family-event-count",class:"description",role:"status"}),e("div",{id:"family-timeline",class:"family-timeline"})]),e("div",{id:"family-map-footer",class:"family-map-footer"},[e("div",{class:"family-map-legend"},[e("span",null,[e("i",{class:"legend-self"}),a("本人")]),e("span",null,[e("i",{class:"legend-selected"}),a("正在查看")]),e("span",null,[e("i",{class:"legend-parent"}),a("父母 → 子女")]),e("span",null,[e("i",{class:"legend-spouse"}),a("配偶")]),e("span",null,[e("i",{class:"legend-adoptive"}),a("收养 / 继亲")])]),e("p",{id:"family-map-note",class:"description",role:"status"}),e("span",{class:"description"},"拖动空白处移动 · 点击人物查看档案 · 关系称谓按参照人物计算")])]),e("aside",{id:"family-detail",class:"panel family-inspector","aria-label":"人物档案"})])],-1)),C(wa),l[17]||(l[17]=E('账号与人物关系 ACCOUNTS
这里只管理当前家庭或场所的账号。新账号默认没有摄像头或家谱访问权限;可按需授权。亲属称呼与管理权限分别设置,无需为每位家谱人物创建账号。
',2))],64))}},_s={};function $s(b,s){return d(),u(I,null,[s[0]||(s[0]=E('',7)),s[1]||(s[1]=e("dialog",{id:"leadership-dialog"},[e("form",{id:"leadership-form"},[e("div",{class:"dialog-heading"},[e("h2",null,"负责人安排与交接"),e("button",{type:"button",class:"quiet","data-close":"leadership-dialog"},"关闭")]),e("input",{name:"id",type:"hidden"}),e("input",{name:"revision",type:"hidden"}),e("p",{class:"description"},"选择本家庭 / 场所的成员,分别指定主要和备用负责人。主要负责人即一家之主;选择普通成员时,需明确确认授予其本家庭管理权限。备用负责人可稍后安排。"),e("p",{id:"leadership-scope",class:"fw-semibold"}),e("div",{id:"leadership-empty",class:"alert alert-info",role:"status",hidden:""},"本家庭 / 场所还没有可选成员。请先添加本家庭管理员,保存账号后会自动返回这里。其他家庭的账号不会混入此列表。"),e("div",{class:"leadership-member-actions d-flex flex-wrap gap-2 mb-3"},[e("button",{type:"button",id:"leadership-new",class:"secondary"},"+ 添加本家庭管理员"),e("button",{type:"button",id:"leadership-members",class:"quiet"},"管理本家庭成员")]),e("div",{class:"form-grid"},[e("label",null,[a("主要负责人 *"),e("select",{name:"ownerId",required:""})]),e("label",null,[a("备用负责人"),e("select",{name:"successorId"})]),e("label",{id:"leadership-grant",class:"check full alert alert-warning",hidden:""},[e("input",{type:"checkbox",name:"grantManagement"}),e("span",{id:"leadership-grant-note"})]),e("label",{class:"full"},[a("安排 / 交接说明 *"),e("textarea",{name:"reason",required:"",maxlength:"300",rows:"3",placeholder:"说明负责人安排或本次交接原因"})])]),e("p",{class:"description"},"交接后原负责人仍保留本归属的管理员权限。系统不会依据未登录或家谱去世日期自动转移权限;交接记录可追溯。"),e("p",{class:"form-error",role:"status"}),e("div",{class:"dialog-footer"},[e("button",{type:"submit"},"确认保存负责人安排")])])],-1)),s[2]||(s[2]=e("dialog",{id:"household-dialog"},[e("form",{id:"household-form"},[e("div",{class:"dialog-heading"},[e("h2",null,"家庭 / 场所档案"),e("button",{type:"button",class:"quiet","data-close":"household-dialog"},"关闭")]),e("input",{name:"id",type:"hidden"}),e("input",{name:"profileRevision",type:"hidden",value:"0"}),e("div",{class:"form-grid"},[e("label",{class:"full"},[a("归属名称 *"),e("input",{name:"name",maxlength:"80",required:"",placeholder:"例如:赵府、济南办公室、莱阳工厂"})]),e("label",{class:"full"},[a("归属类型"),e("select",{name:"kind"},[e("option",{value:"home"},"家庭"),e("option",{value:"office"},"办公场所"),e("option",{value:"factory"},"工厂")])]),e("fieldset",{class:"full geo-picker","data-geography":"","data-geo-title":"所在地"}),e("div",{class:"full cover-editor"},[e("img",{id:"household-cover-preview",alt:"场所封面预览",hidden:""}),e("label",null,[a("卡片封面照片"),e("input",{id:"household-cover-file",type:"file",accept:"image/png,image/jpeg,image/webp"})]),e("button",{type:"button",id:"household-cover-cancel",class:"quiet"},"取消本次图片选择"),e("button",{type:"button",id:"household-cover-reset",class:"quiet"},"使用默认封面"),e("p",{id:"household-cover-status",class:"description",role:"status","aria-live":"polite"},"照片仅向有权进入该家庭或场所的账号开放。")]),e("label",{class:"full"},[a("备注"),e("textarea",{name:"note",maxlength:"300",rows:"3"})])]),e("p",{class:"description"},"创建后进入该归属,建立管理员,再自行划分区域和登记设备。"),e("p",{class:"form-error"}),e("div",{class:"dialog-footer"},[e("button",{type:"submit"},"保存家庭")])])],-1)),s[3]||(s[3]=E('',2)),s[4]||(s[4]=e("dialog",{id:"person-dialog"},[e("form",{id:"person-form"},[e("div",{class:"dialog-heading"},[e("h2",null,"家谱人物"),e("button",{type:"button",class:"quiet","data-close":"person-dialog"},"关闭")]),e("input",{name:"id",type:"hidden"}),e("input",{name:"revision",type:"hidden"}),e("p",{id:"person-self-note",class:"alert alert-info",hidden:""},"这将建立并固定关联为您本人,用于确定上下五代维护范围。如族谱已有您的人物,请关闭此窗口并请管理员关联,避免重复建档。"),e("fieldset",{id:"person-relative-fields"},[e("legend",null,"新人物与已有亲属的关系"),e("div",{class:"form-grid"},[e("label",null,[a("已有亲属"),e("select",{name:"relativeId"})]),e("label",null,[a("新人物是其"),e("select",{name:"relativeKind"},[e("option",{value:"parent"},"父母一方(上一代)"),e("option",{value:"child"},"子女(下一代)"),e("option",{value:"spouse"},"配偶(同代)")])])]),e("p",{class:"description"},"人物与关系一起保存,无需为亲属开设登录账号;超出五代时不会写入。")]),e("div",{class:"form-grid"},[e("label",null,[a("姓名 / 称呼 *"),e("input",{name:"name",required:"",maxlength:"80",placeholder:"姓名暂不知时可先填称呼"})]),e("label",null,[a("别名 / 字 / 号"),e("input",{name:"alias",maxlength:"120"})]),e("label",null,[a("性别"),e("select",{name:"gender"},[e("option",{value:"unknown"},"待确认"),e("option",{value:"male"},"男"),e("option",{value:"female"},"女")])]),e("label",null,[a("在世情况"),e("select",{name:"lifeStatus"},[e("option",{value:"alive"},"在世"),e("option",{value:"deceased"},"不在世"),e("option",{value:"unknown"},"待确认")])]),e("fieldset",{class:"family-date","data-date-field":"birthDate"},[e("legend",null,"出生日期"),e("input",{name:"birthDate",type:"hidden"}),e("label",null,[a("历法"),e("select",{"data-calendar":"","aria-label":"出生日期历法"},[e("option",{value:"solar"},"公历"),e("option",{value:"lunar"},"农历")])]),e("label",null,[a("日期"),e("input",{"data-date-value":"","aria-label":"出生日期",type:"text",inputmode:"numeric",placeholder:"YYYY-MM-DD",maxlength:"10"})]),e("label",{"data-leap-label":"",class:"check",hidden:""},[e("input",{"data-date-leap":"",type:"checkbox"}),a("闰月")]),e("output",{"data-date-hint":"","aria-live":"polite"},"日期不详可留空")]),e("fieldset",{class:"family-date","data-date-field":"deathDate",hidden:""},[e("legend",null,"去世日期"),e("input",{name:"deathDate",type:"hidden"}),e("label",null,[a("历法"),e("select",{"data-calendar":"","aria-label":"去世日期历法"},[e("option",{value:"solar"},"公历"),e("option",{value:"lunar"},"农历")])]),e("label",null,[a("日期"),e("input",{"data-date-value":"","aria-label":"去世日期",type:"text",inputmode:"numeric",placeholder:"YYYY-MM-DD",maxlength:"10"})]),e("label",{"data-leap-label":"",class:"check",hidden:""},[e("input",{"data-date-leap":"",type:"checkbox"}),a("闰月")]),e("output",{"data-date-hint":"","aria-live":"polite"},"日期不详可留空")]),e("label",{class:"full",id:"person-legacy-place"},[a("原籍贯/出生地记录"),e("input",{name:"birthplace",maxlength:"160"}),e("small",null,"历史填写内容保留,可在下方分别补充。")]),e("fieldset",{class:"full person-location"},[e("legend",null,"籍贯(祖籍)"),e("div",{class:"form-grid"},[e("fieldset",{class:"full geo-picker","data-geography":"native","data-geo-title":"籍贯(祖籍)"}),e("label",null,[a("乡镇/街道"),e("input",{name:"nativeTown",maxlength:"80",placeholder:"","aria-label":"籍贯(祖籍) · 乡镇/街道"})]),e("label",null,[a("村/社区"),e("input",{name:"nativeCommunity",maxlength:"80",placeholder:"","aria-label":"籍贯(祖籍) · 村/社区"})]),e("label",{class:"full"},[a("详细地址/历史地名"),e("input",{name:"nativeAddress",maxlength:"200",placeholder:"楼栋、门牌或旧称,可按已知信息填写","aria-label":"籍贯(祖籍) · 详细地址/历史地名"})])])]),e("fieldset",{class:"full person-location"},[e("legend",null,"出生地"),e("div",{class:"form-grid"},[e("fieldset",{class:"full geo-picker","data-geography":"birth","data-geo-title":"出生地"}),e("label",null,[a("乡镇/街道"),e("input",{name:"birthTown",maxlength:"80",placeholder:"","aria-label":"出生地 · 乡镇/街道"})]),e("label",null,[a("村/社区"),e("input",{name:"birthCommunity",maxlength:"80",placeholder:"","aria-label":"出生地 · 村/社区"})]),e("label",{class:"full"},[a("详细地址/历史地名"),e("input",{name:"birthAddress",maxlength:"200",placeholder:"楼栋、门牌或旧称,可按已知信息填写","aria-label":"出生地 · 详细地址/历史地名"})])])]),e("p",{class:"description full"},"籍贯与出生地可不同;选择中国、世界或自定义地域,不详的层级可留空。"),e("label",{class:"full"},[a("生平简介"),e("textarea",{name:"biography",rows:"4",maxlength:"2000"})]),e("label",{class:"full"},[a("备注 / 信息来源"),e("textarea",{name:"note",rows:"3",maxlength:"500",placeholder:"例如:长辈口述、族谱记载、待考证信息"})]),e("label",{class:"check"},[e("input",{name:"archived",type:"checkbox"}),a("归档人物(保留关系,可恢复)")])]),e("p",{class:"form-error"}),e("div",{class:"dialog-footer"},[e("button",{type:"submit"},"保存人物")])])],-1)),s[5]||(s[5]=E('',1)),s[6]||(s[6]=e("dialog",{id:"event-dialog","aria-labelledby":"event-editor-title"},[e("form",{id:"event-form"},[e("div",{class:"dialog-heading"},[e("h2",{id:"event-editor-title"},"写一则家族记事"),e("button",{type:"button",class:"quiet","data-close":"event-dialog"},"关闭")]),e("input",{name:"id",type:"hidden"}),e("input",{name:"revision",type:"hidden"}),e("div",{class:"form-grid"},[e("label",{class:"full"},[a("记事标题 *"),e("input",{name:"title",required:"",maxlength:"160",placeholder:"用一句话概括这件事"})]),e("fieldset",{class:"family-date full","data-date-field":"eventDate"},[e("legend",null,"事情发生的日期 *"),e("input",{name:"eventDate",type:"hidden"}),e("label",null,[a("历法"),e("select",{"data-calendar":"","aria-label":"记事日期历法"},[e("option",{value:"solar"},"公历"),e("option",{value:"lunar"},"农历")])]),e("label",null,[a("日期"),e("input",{"data-date-value":"","aria-label":"记事日期",required:"",type:"text",inputmode:"numeric",placeholder:"YYYY-MM-DD",maxlength:"10"})]),e("label",{"data-leap-label":"",class:"check",hidden:""},[e("input",{"data-date-leap":"",type:"checkbox"}),a("闰月")]),e("output",{"data-date-hint":"","aria-live":"polite"})]),e("fieldset",{class:"full"},[e("legend",null,"关联人物(可多选)"),e("input",{id:"event-person-search",type:"search",placeholder:"查找要关联的亲人","aria-label":"查找关联人物"}),e("div",{id:"event-person-choices"}),e("p",{class:"description"},"未选择人物时记为全家记事。每位关联人物的档案都可以追溯到这条记事。")]),e("label",{class:"full"},[a("摘要"),e("textarea",{name:"summary",maxlength:"400",rows:"2",placeholder:"简要说明这件事"})]),e("label",{class:"full"},[a("详细记载"),e("textarea",{name:"body",maxlength:"12000",rows:"7",placeholder:"记录经过、意义、长辈口述或资料出处。可分段书写。"})]),e("label",null,[a("报道 / 资料来源"),e("input",{name:"sourceName",maxlength:"160",placeholder:"例如:报刊名称、个人博客"})]),e("label",null,[a("原始报道链接"),e("input",{name:"sourceUrl",type:"url",maxlength:"2000",placeholder:"https://…"})]),e("label",{class:"check full"},[e("input",{name:"archived",type:"checkbox"}),a("归档记事(保留内容,可恢复)")])]),e("p",{class:"description"},"正式发布后,有家谱查看权限的账号即可在时间线看到;草稿只对有编辑权限的人可见。"),e("p",{class:"form-error",role:"status"}),e("div",{class:"dialog-footer event-editor-actions"},[e("button",{type:"submit","data-save-event":"",value:"draft",class:"secondary"},"保存草稿"),e("button",{type:"submit","data-publish-event":"",value:"published"},"发布记事"),e("button",{type:"submit","data-withdraw-event":"",value:"draft",class:"secondary",hidden:""},"撤回为草稿")])])],-1)),s[7]||(s[7]=E('',1)),s[8]||(s[8]=e("dialog",{id:"history-dialog","aria-labelledby":"history-title"},[e("div",{class:"dialog-heading"},[e("h2",{id:"history-title"},"修改记录"),e("button",{type:"button",class:"quiet","data-close":"history-dialog"},"关闭")]),e("p",{class:"description"},"人物、关系与记事每次保存都会留存版本。仅有家谱编辑权限的账号可查阅和恢复。"),e("p",{id:"history-error",class:"form-error",role:"status"}),e("div",{id:"history-list"}),e("button",{id:"history-more",class:"quiet",hidden:""},"加载更早记录"),e("article",{id:"history-detail"})],-1)),s[9]||(s[9]=e("dialog",{id:"password-dialog","aria-labelledby":"password-title"},[e("form",{id:"password-form"},[e("div",{class:"dialog-heading"},[e("h2",{id:"password-title"},"修改我的密码"),e("button",{type:"button",class:"quiet","data-close":"password-dialog"},"关闭")]),e("p",{id:"password-account",class:"description"}),e("label",null,[a("当前密码"),e("input",{name:"currentPassword",type:"password",required:"",maxlength:"128",autocomplete:"current-password"})]),e("label",null,[a("新密码"),e("input",{name:"newPassword",type:"password",required:"",minlength:"8",maxlength:"128",autocomplete:"new-password"})]),e("label",null,[a("再次输入新密码"),e("input",{name:"confirmPassword",type:"password",required:"",minlength:"8",maxlength:"128",autocomplete:"new-password"})]),e("p",{class:"description"},"保存后,这个账号在所有设备上都需要用新密码重新登录。"),e("p",{class:"form-error",role:"status"}),e("div",{class:"dialog-footer"},[e("button",{type:"submit"},"保存新密码")])])],-1)),s[10]||(s[10]=e("dialog",{id:"camera-settings-dialog","aria-labelledby":"camera-settings-title"},[e("div",{class:"dialog-heading"},[e("h2",{id:"camera-settings-title"},"摄像机参数"),e("button",{class:"quiet","data-close":"camera-settings-dialog"},"关闭")]),e("div",{class:"section-head"},[e("label",null,[a("设置码流"),e("select",{id:"camera-settings-quality"},[e("option",{value:"main"},"主码流"),e("option",{value:"sub"},"子码流")])]),e("button",{id:"camera-settings-reload",class:"quiet"},"重新读取")]),e("div",{id:"camera-settings-info"}),e("p",{id:"camera-settings-status",class:"form-error",role:"status"}),e("form",{id:"camera-image-form"},[e("h3",null,"图像与日夜模式"),e("p",{class:"description"},"作用于当前物理镜头,主、子码流共用这些图像参数。"),e("div",{id:"camera-image-fields",class:"form-grid"}),e("div",{class:"dialog-footer"},[e("button",{type:"submit",disabled:""},"保存图像参数")])]),e("form",{id:"camera-video-form"},[e("h3",null,"码流与清晰度"),e("p",{class:"description"},"作用于上方选定的码流。保存后画面可能短暂重连,录像机也会使用调整后的码流。本页保留原有视频编码。"),e("div",{id:"camera-video-fields",class:"form-grid"}),e("div",{class:"dialog-footer"},[e("button",{type:"submit",disabled:""},"保存码流参数")])]),e("details",null,[e("summary",null,"其他萤石功能的接入情况"),e("ul",null,[e("li",null,"云台方向微调与预置位:在实时画面的“云台”中使用,按设备能力启用。"),e("li",null,"实时声音与全屏:通过画面播放器控制。"),e("li",null,"双向对讲、智能追踪、声光告警、隐私遮蔽、设备翻转、云录像和消息推送:当前尚未接入,请使用萤石 App。"),e("li",null,"录像机原有录像:仍通过录像机或原厂 App 查看;本系统已支持本机额外录像的回放。")]),e("p",{class:"description"},"功能按设备实际开放能力逐项接入,型号与固件不同可能有差异。")])],-1)),s[11]||(s[11]=e("div",{id:"toast",role:"status",hidden:""},null,-1)),s[12]||(s[12]=E('',2))],64)}const qs=ie(_s,[["render",$s]]),js=["/vendor/hls.min.js","/live-player.js","/kinship.js","/family-graph.js","/calendar.js","/device-model.js","/data/geography-data.js","/geography.js","/app.js","/monitor.js","/date-fields.js","/family-map.js","/family.js","/family-events.js","/family-history.js","/camera-settings.js","/recording-ranges.js","/recording-ui.js","/snapshot.js","/households.js","/devices.js","/steward.js","/heritage.js","/personalization.js","/file-hash.js","/journal.js"];function we(b){if(!(b instanceof Element))return;const s=[b,...b.querySelectorAll("button,input,select,textarea,table")];for(const l of s)l.matches("button")&&!l.closest(".family-map-viewport")&&!l.classList.contains("btn")&&l.classList.add("btn",l.matches(".quiet,.secondary")?"btn-outline-secondary":"btn-primary"),l.matches("select")&&l.classList.add("form-select"),l.matches("textarea,input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden])")&&l.classList.add("form-control"),l.matches("input[type=checkbox],input[type=radio]")&&l.classList.add("form-check-input"),l.matches("table")&&l.classList.add("table","align-middle")}async function Cs(){we(document.getElementById("app")),new MutationObserver(b=>{for(const s of b)for(const l of s.addedNodes)we(l)}).observe(document.getElementById("app"),{childList:!0,subtree:!0});for(const b of[...js,"/vue-bridge.js"])await new Promise((s,l)=>{const c=document.createElement("script");c.src=b+"?ui=0.1.44",c.onload=s,c.onerror=()=>l(new Error("Could not load "+b)),document.head.append(c)});await window.ZhaoVue.boot()}const Ms=["data-page"],Is={key:0,class:"alert alert-danger",role:"alert"},Ts={__name:"App",setup(b){const s=j(!1);return _e(async()=>{try{await Cs()}catch(l){console.error("Application startup failed",l),s.value=!0}}),(l,c)=>(d(),u(I,null,[C(We),e("main",{"data-page":f(h).page},[C(Ke),s.value?(d(),u("div",Is,"页面组件加载失败,请检查网络后重新打开页面。")):y("",!0),C(xs)],8,Ms),C(qs)],64))}};Ae(Ts).mount("#app");