@gkd-kit/inspect 0.0.1730106886536 → 0.0.1730364350444
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-wnrf8nZS.js → ActionCard.vue_vue_type_script_setup_true_lang-Cduchqw3.js} +3 -3
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-wnrf8nZS.js.map → ActionCard.vue_vue_type_script_setup_true_lang-Cduchqw3.js.map} +1 -1
- package/dist/assets/DevicePage-D_UlTzDi.js +49 -0
- package/dist/assets/{DevicePage-D2SN3ocZ.js.map → DevicePage-D_UlTzDi.js.map} +1 -1
- package/dist/assets/HomePage-BsFOBPcv.js +112 -0
- package/dist/assets/HomePage-BsFOBPcv.js.map +1 -0
- package/dist/assets/ImportPage-DAPsiuvi.js +2 -0
- package/dist/assets/{ImportPage-CiWpvMoI.js.map → ImportPage-DAPsiuvi.js.map} +1 -1
- package/dist/assets/{SelectorPage-BdTTfkoW.js → SelectorPage-BGph5fpn.js} +2 -2
- package/dist/assets/SelectorPage-BGph5fpn.js.map +1 -0
- package/dist/assets/{SnapshotPage-D7aaWkZS.js → SnapshotPage-CoZl4sW6.js} +15 -15
- package/dist/assets/SnapshotPage-CoZl4sW6.js.map +1 -0
- package/dist/assets/{TrackGraph-TPYwm5Gr.js → TrackGraph-DZzkKMix.js} +3 -3
- package/dist/assets/{TrackGraph-TPYwm5Gr.js.map → TrackGraph-DZzkKMix.js.map} +1 -1
- package/dist/assets/{_404Page-DW38E7Zt.js → _404Page-BjaQ7tx0.js} +2 -2
- package/dist/assets/{_404Page-DW38E7Zt.js.map → _404Page-BjaQ7tx0.js.map} +1 -1
- package/dist/assets/dayjs.min-M0mwU4kF.js +628 -0
- package/dist/assets/dayjs.min-M0mwU4kF.js.map +1 -0
- package/dist/assets/export-Ceck75Bf.js +11 -0
- package/dist/assets/export-Ceck75Bf.js.map +1 -0
- package/dist/assets/import-DLvA29hL.js +2 -0
- package/dist/assets/import-DLvA29hL.js.map +1 -0
- package/dist/assets/index-Ctdu8eom.js +15 -0
- package/dist/assets/index-Ctdu8eom.js.map +1 -0
- package/dist/assets/index-DUQQ8E9s.js +904 -0
- package/dist/assets/index-DUQQ8E9s.js.map +1 -0
- package/dist/assets/index-dmZxunQ9.css +1 -0
- package/dist/assets/jszip.min-HR1HqKwk.js +13 -0
- package/dist/assets/jszip.min-HR1HqKwk.js.map +1 -0
- package/dist/assets/{polyfills-DqeL3OL8.js → polyfills-5mw5RPb8.js} +1 -1
- package/dist/assets/snapshot-D-6ehJ9k.js +3 -0
- package/dist/assets/snapshot-D-6ehJ9k.js.map +1 -0
- package/dist/assets/{table-9NhH7buH.js → table-i2BLyO9g.js} +23 -23
- package/dist/assets/{table-9NhH7buH.js.map → table-i2BLyO9g.js.map} +1 -1
- package/dist/index.html +3 -3
- package/package.json +2 -6
- package/dist/assets/DevicePage-D2SN3ocZ.js +0 -49
- package/dist/assets/HomePage-CT1l0ReT.js +0 -119
- package/dist/assets/HomePage-CT1l0ReT.js.map +0 -1
- package/dist/assets/ImportPage-CiWpvMoI.js +0 -2
- package/dist/assets/PreviewSharePage-CI7Wsjz3.js +0 -2
- package/dist/assets/PreviewSharePage-CI7Wsjz3.js.map +0 -1
- package/dist/assets/SelectorPage-BdTTfkoW.js.map +0 -1
- package/dist/assets/SnapshotPage-D7aaWkZS.js.map +0 -1
- package/dist/assets/dayjs.min-DRnS9uYx.js +0 -362
- package/dist/assets/dayjs.min-DRnS9uYx.js.map +0 -1
- package/dist/assets/error-Bj72uYaR.js +0 -2
- package/dist/assets/error-Bj72uYaR.js.map +0 -1
- package/dist/assets/export-BqEF0Nd9.js +0 -21
- package/dist/assets/export-BqEF0Nd9.js.map +0 -1
- package/dist/assets/fetch-BDVD2tTn.js +0 -3
- package/dist/assets/fetch-BDVD2tTn.js.map +0 -1
- package/dist/assets/import-Dj5vaOSP.js +0 -2
- package/dist/assets/import-Dj5vaOSP.js.map +0 -1
- package/dist/assets/index-BTujmM1z.js +0 -2
- package/dist/assets/index-BTujmM1z.js.map +0 -1
- package/dist/assets/index-C21AA2f9.js +0 -904
- package/dist/assets/index-C21AA2f9.js.map +0 -1
- package/dist/assets/index-DlhjoJf3.css +0 -1
- package/dist/assets/index-DmbD2I_C.js +0 -281
- package/dist/assets/index-DmbD2I_C.js.map +0 -1
- package/dist/assets/snapshot-CI3vERif.js +0 -2
- package/dist/assets/snapshot-CI3vERif.js.map +0 -1
package/dist/index.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="zh">
|
|
3
3
|
<head>
|
|
4
|
-
<script type="module" crossorigin src="https://registry.npmmirror.com/@gkd-kit/inspect/0.0.
|
|
4
|
+
<script type="module" crossorigin src="https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1730364350444/files/dist/assets/polyfills-5mw5RPb8.js"></script>
|
|
5
5
|
|
|
6
6
|
<meta charset="UTF-8" />
|
|
7
7
|
<link
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
13
13
|
<meta name="referrer" content="no-referrer" />
|
|
14
14
|
<title>GKD</title>
|
|
15
|
-
<script type="module" crossorigin src="https://registry.npmmirror.com/@gkd-kit/inspect/0.0.
|
|
16
|
-
<link rel="stylesheet" crossorigin href="https://registry.npmmirror.com/@gkd-kit/inspect/0.0.
|
|
15
|
+
<script type="module" crossorigin src="https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1730364350444/files/dist/assets/index-DUQQ8E9s.js"></script>
|
|
16
|
+
<link rel="stylesheet" crossorigin href="https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1730364350444/files/dist/assets/index-dmZxunQ9.css">
|
|
17
17
|
</head>
|
|
18
18
|
|
|
19
19
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gkd-kit/inspect",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1730364350444",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -14,12 +14,10 @@
|
|
|
14
14
|
"@gkd-kit/api": "0.5.0",
|
|
15
15
|
"@gkd-kit/selector": "0.4.2",
|
|
16
16
|
"@gkd-kit/wasm_matches": "0.0.1",
|
|
17
|
-
"@rushstack/eslint-patch": "1.10.4",
|
|
18
17
|
"@tsconfig/node20": "20.1.4",
|
|
19
18
|
"@types/file-saver": "2.0.7",
|
|
20
19
|
"@types/fs-extra": "11.0.4",
|
|
21
20
|
"@types/node": "22.7.5",
|
|
22
|
-
"@types/qrcode": "1.5.5",
|
|
23
21
|
"@vitejs/plugin-legacy": "5.4.2",
|
|
24
22
|
"@vitejs/plugin-vue": "5.1.4",
|
|
25
23
|
"@vitejs/plugin-vue-jsx": "4.0.1",
|
|
@@ -37,7 +35,6 @@
|
|
|
37
35
|
"eslint-plugin-unused-imports": "4.1.4",
|
|
38
36
|
"eslint-plugin-vue": "9.28.0",
|
|
39
37
|
"file-saver": "2.0.5",
|
|
40
|
-
"fs-extra": "11.2.0",
|
|
41
38
|
"json5": "2.2.3",
|
|
42
39
|
"jszip": "3.10.1",
|
|
43
40
|
"lint-staged": "15.2.10",
|
|
@@ -47,7 +44,6 @@
|
|
|
47
44
|
"p-limit": "6.1.0",
|
|
48
45
|
"pinia": "2.2.4",
|
|
49
46
|
"prettier": "3.3.3",
|
|
50
|
-
"qrcode": "1.5.4",
|
|
51
47
|
"sass": "1.79.4",
|
|
52
48
|
"simple-git": "3.27.0",
|
|
53
49
|
"simple-git-hooks": "2.11.1",
|
|
@@ -56,7 +52,7 @@
|
|
|
56
52
|
"universal-base64url": "1.1.0",
|
|
57
53
|
"unocss": "0.63.4",
|
|
58
54
|
"unplugin-auto-import": "0.18.3",
|
|
59
|
-
"unplugin-data": "0.1.
|
|
55
|
+
"unplugin-data": "0.1.1",
|
|
60
56
|
"unplugin-vue-components": "0.27.4",
|
|
61
57
|
"user-attachments": "1.1.2",
|
|
62
58
|
"vite": "5.4.8",
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import{A as b,aG as c,h as ie,S as le,aJ as re,W as pe,B as ue,T as J,V as ce,C as $,D,E as a,F as r,G as s,H as O,L as u,I as K,O as de,P as me,J as fe,Q as H,M as k,_ as ge,Z as ve,$ as we}from"./index-C21AA2f9.js";import{e as he}from"./fetch-BDVD2tTn.js";import{e as W}from"./error-Bj72uYaR.js";import{a as L,b as R,p as ke}from"./snapshot-CI3vERif.js";import{u as ye,_ as be,a as Se}from"./table-9NhH7buH.js";import{u as B,w as _e,_ as Q,b as xe}from"./dayjs.min-DRnS9uYx.js";import{b as Ce,c as Ne}from"./index-BTujmM1z.js";import{l as Ie,_ as Pe,N as Re}from"./index-DmbD2I_C.js";const Be=q=>{const S=b(q),_=async(n,f={})=>{var z;if(!S.value)throw new Error("origin must exist");const C=new URL("/api/"+n,S.value);Object.entries(f.query||{}).forEach(([g,T])=>{T!==void 0&&C.searchParams.set(g,String(T))});const d=await he(C,f.init).catch(g=>{throw c.error("网络错误:/"+n),g});if(!d.ok)throw c.error("接口错误:/"+n+":"+d.status),d;if((z=d.headers.get("Content-Type"))!=null&&z.includes("application/json")){const g=await d.clone().json();if(g.__error)throw c.error(g.message),d}return d},o=async(...n)=>await(await _(...n)).json(),x=async(...n)=>await(await _(...n)).blob(),m=async(...n)=>await(await _(...n)).arrayBuffer();return{origin:S,api:{device:async()=>o("device"),snapshot:async n=>o("snapshot",{query:n}),screenshot:async n=>m("screenshot",{query:n}),captureSnapshot:async()=>o("captureSnapshot"),snapshots:async()=>o("snapshots"),updateSubsApps:async n=>x("updateSubsApps",{init:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}),updateSubscription:async n=>x("updateSubscription",{init:{method:"POST",body:JSON.stringify({...n,id:-1,name:"内存订阅",version:0}),headers:{"Content-Type":"application/json"}}}),execSelector:async n=>o("execSelector",{init:{method:"POST",body:JSON.stringify({...n,value:n.selector}),headers:{"Content-Type":"application/json"}}})}}},ze={flex:"","gap-10px":"","flex-items-center":""},Te={flex:"","flex-col":"","p-10px":"","gap-10px":"","h-full":""},Ue={flex:"","items-center":"","gap-24px":""},Ve={href:"/",flex:"","ml-12px":"",title:"首页"},Ae={"whitespace-nowrap":""},Je=ie({__name:"DevicePage",setup(q){const S=fe(),_=Ce("新设备"),{api:o,origin:x}=Be(),m=Ne("device_link",""),w=b(),n=B(async()=>{m.value&&(x.value=W(()=>new URL(m.value.trim()),()=>"非法设备地址").origin,m.value=x.value,w.value=await o.device())});le(async()=>{await re(500),pe(m.value)&&n.invoke()});const f=b([]);ue(async()=>{if(!w.value)return;_.value="已连接 "+w.value.manufacturer;const e=await o.snapshots();e.sort((t,p)=>p.id-t.id),f.value=e,I.value=""});const C=B(async()=>{const e=await o.captureSnapshot(),t=await o.screenshot({id:e.id});await L.setItem(e.id,e),await R.setItem(e.id,t),c.success("保存快照成功");const p=await o.snapshots();p.sort((h,P)=>P.id-h.id),f.value=p}),d=B(async()=>{const e=(await o.snapshots()).map(l=>l.id),t=new Set((await R.keys()).map(l=>parseInt(l))),p=e.filter(l=>!t.has(l));if(p.length==0){c.success("没有新记录可导入");return}let h=0;const P=ke(3);await Promise.all(p.map(l=>P(async()=>{const[A,M]=await Promise.all([o.snapshot({id:l}),o.screenshot({id:l})]);A.nodes&&(await Promise.all([L.setItem(l,A),R.setItem(l,M)]),h++)}))),c.success(`导入${h}条新记录`)}),{activityIdCol:z,appIdCol:g,appNameCol:T,ctimeCol:j,appVersionCodeCol:X,appVersionNameCol:Z,resetColWidth:Y}=ye(),ee=e=>{e.columnKey==j.key&&(j.sortOrder=e.order)},E=_e(async e=>{if(await L.hasItem(e.id)||await L.setItem(e.id,await o.snapshot({id:e.id})),!await R.hasItem(e.id)){const t=await o.screenshot({id:e.id});await R.setItem(e.id,t)}window.open(S.resolve({name:"snapshot",params:{snapshotId:e.id}}).href)},e=>e.id),te=[j,T,g,X,Z,z,{key:"actions",title:"操作",fixed:"right",width:"120px",render(e){return a(Q,{size:"small"},{default:()=>[a(H,{size:"small",loading:E.loading[e.id],onClick:()=>E.invoke(e)},{default:()=>[k("查看")]})]})}}],N=J({page:1,pageSize:50,showSizePicker:!0,pageSizes:[50,100],onChange:e=>{N.page=e},onUpdatePageSize:e=>{N.pageSize=e,N.page=1}});ce(N,Y);const U=b(!1),I=b(""),F=B(async()=>{const e=W(()=>Ie.parse(I.value.trim()));if(e){if(e.categories||e.globalGroups||e.apps)await o.updateSubscription(e);else if(typeof e.id=="string")await o.updateSubscription({apps:[e]});else if(Array.isArray(e)&&typeof e[0].id=="string")await o.updateSubscription({apps:e});else if(typeof e.key=="number")await o.updateSubscription({globalGroups:[e]});else if(Array.isArray(e)&&typeof e[0].key=="number")await o.updateSubscription({globalGroups:e});else{c.error("无法识别的订阅文本");return}c.success("修改成功")}}),V=b(!1),se=[{label:"仅查询",value:void 0},{value:"click",label:"click"},{value:"clickNode",label:"clickNode"},{value:"clickCenter",label:"clickCenter"},{value:"back",label:"back"},{value:"longClick",label:"longClick"},{value:"longClickNode",label:"longClickNode"},{value:"longClickCenter",label:"longClickCenter"}],v=J({selector:"",action:"click",quickFind:!1}),G=B(async()=>{const e=await o.execSelector({...v,fastQuery:v.quickFind});if(e.message){c.success("操作成功:"+e.message);return}e.action?c.success((e.result?"操作成功:":"操作失败")+e.action):!e.action&&e.result&&c.success("查询成功")}),ne=`
|
|
2
|
-
请输入订阅文本(JSON5语法):
|
|
3
|
-
示例1-更新单个应用的规则:
|
|
4
|
-
{
|
|
5
|
-
id: 'appId',
|
|
6
|
-
groups: []
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
示例2-更新多个应用的规则:
|
|
10
|
-
[
|
|
11
|
-
{
|
|
12
|
-
id: 'appId1',
|
|
13
|
-
groups: []
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
id: 'appId2',
|
|
17
|
-
groups: []
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
示例3-更新全局规则(1.7.0):
|
|
22
|
-
{
|
|
23
|
-
name: '全局规则-1',
|
|
24
|
-
key: 0,
|
|
25
|
-
rules: []
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
示例3-更新多个全局规则(1.7.0):
|
|
29
|
-
[
|
|
30
|
-
{
|
|
31
|
-
name: '全局规则-1',
|
|
32
|
-
key: 0,
|
|
33
|
-
rules: []
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: '全局规则-2',
|
|
37
|
-
key: 1,
|
|
38
|
-
rules: []
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
|
|
42
|
-
示例4-更新整个订阅(1.7.0):
|
|
43
|
-
{
|
|
44
|
-
apps: [],
|
|
45
|
-
globalGroups: [],
|
|
46
|
-
categories: [],
|
|
47
|
-
}
|
|
48
|
-
`.trim();return(e,t)=>{const p=Pe,h=ge,P=we,l=Q,A=Se,M=Re,y=H,oe=xe,ae=be;return $(),D(K,null,[a(h,{show:s(U),"onUpdate:show":t[1]||(t[1]=i=>O(U)?U.value=i:null),preset:"dialog",style:{width:"800px"},title:"修改内存订阅","positive-text":"确认",positiveButtonProps:{loading:s(F).loading,onClick(){s(F).invoke()}}},{default:r(()=>[a(p,{value:s(I),"onUpdate:value":t[0]||(t[0]=i=>O(I)?I.value=i:null),disabled:s(F).loading,type:"textarea",class:"gkd_code",autosize:{minRows:20,maxRows:25},placeholder:s(ne)},null,8,["value","disabled","placeholder"])]),_:1},8,["show","positiveButtonProps"]),a(h,{show:s(V),"onUpdate:show":t[5]||(t[5]=i=>O(V)?V.value=i:null),preset:"dialog",style:{width:"800px"},title:"执行选择器","positive-text":"确认",positiveButtonProps:{loading:s(G).loading,onClick(){s(G).invoke()}}},{default:r(()=>[a(p,{value:s(v).selector,"onUpdate:value":t[2]||(t[2]=i=>s(v).selector=i),disabled:s(G).loading,type:"textarea",class:"gkd_code",autosize:{minRows:4,maxRows:10},placeholder:"请输入合法的选择器"},null,8,["value","disabled"]),t[12]||(t[12]=u("div",{"h-15px":""},null,-1)),a(l,null,{default:r(()=>[a(P,{checked:s(v).quickFind,"onUpdate:checked":t[3]||(t[3]=i=>s(v).quickFind=i)},{default:r(()=>t[9]||(t[9]=[k(" 快速查找 ")])),_:1},8,["checked"]),t[10]||(t[10]=u("a",{href:"https://gkd.li/api/interfaces/RawCommonProps.html#quickfind",target:"_blank",rel:"noopener noreferrer"}," 查找说明 ",-1))]),_:1}),t[13]||(t[13]=u("div",{"h-10px":""},null,-1)),u("div",ze,[a(A,{value:s(v).action,"onUpdate:value":t[4]||(t[4]=i=>s(v).action=i),options:se,class:"w-150px"},null,8,["value"]),t[11]||(t[11]=u("a",{href:"https://gkd.li/api/interfaces/RawRuleProps#action",target:"_blank",rel:"noopener noreferrer"}," 操作说明 ",-1))])]),_:1},8,["show","positiveButtonProps"]),u("div",Te,[u("div",Ue,[u("a",Ve,[a(y,{text:""},{icon:r(()=>[a(M,{size:24},{default:r(()=>t[14]||(t[14]=[u("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},[u("path",{d:"M16.612 2.214a1.01 1.01 0 0 0-1.242 0L1 13.419l1.243 1.572L4 13.621V26a2.004 2.004 0 0 0 2 2h20a2.004 2.004 0 0 0 2-2V13.63L29.757 15L31 13.428zM18 26h-4v-8h4zm2 0v-8a2.002 2.002 0 0 0-2-2h-4a2.002 2.002 0 0 0-2 2v8H6V12.062l10-7.79l10 7.8V26z",fill:"currentColor"})],-1)])),_:1})]),_:1})]),a(oe,null,{default:r(()=>[a(p,{value:s(m),"onUpdate:value":t[6]||(t[6]=i=>O(m)?m.value=i:null),placeholder:"请输入设备地址",style:{width:"200px"},onKeyup:ve(s(n).invoke,["enter"])},null,8,["value","onKeyup"]),a(y,{onClick:s(n).invoke,loading:s(n).loading},{default:r(()=>t[15]||(t[15]=[k(" 刷新连接 ")])),_:1},8,["onClick","loading"])]),_:1}),s(w)?($(),D(K,{key:0},[u("div",Ae,de(`已连接 ${s(w).manufacturer} Android ${s(w).release}`),1),a(y,{onClick:s(C).invoke,loading:s(C).loading},{default:r(()=>t[16]||(t[16]=[k(" 快照 ")])),_:1},8,["onClick","loading"]),a(y,{onClick:s(d).invoke,loading:s(d).loading},{default:r(()=>t[17]||(t[17]=[k(" 下载设备所有快照 ")])),_:1},8,["onClick","loading"]),a(y,{onClick:t[7]||(t[7]=i=>U.value=!0)},{default:r(()=>t[18]||(t[18]=[k(" 修改内存订阅 ")])),_:1}),a(y,{onClick:t[8]||(t[8]=i=>V.value=!0)},{default:r(()=>t[19]||(t[19]=[k(" 执行选择器 ")])),_:1})],64)):me("",!0)]),a(ae,{striped:"",flexHeight:"",data:s(f),columns:te,pagination:s(N),"onUpdate:sorter":ee,size:"small",class:"flex-1",scrollX:1200},null,8,["data","pagination"])])],64)}}});export{Je as default};
|
|
49
|
-
//# sourceMappingURL=DevicePage-D2SN3ocZ.js.map
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import{d as Ae,c as Re,a as Zt,b as A,i as Xt,e as Mt,f as Y,g as te,h as Wt,u as Pe,j as ue,k as xe,r as At,t as Le,l as ze,m as dt,n as tt,p as Rt,o as j,q as Ue,s as Pt,v as D,w as et,N as De,x as Fe,y as xt,z as Ve,A as H,B as ht,C as Ct,D as Bt,E as B,F as S,G as w,H as ft,I as $t,J as $e,K as He,_ as ce,L as R,M as $,O as de,P as fe,Q as he,R as Ke,S as Oe,T as ee,U as Je,V as We,W as Ye,X as je,Y as qe,Z as Qe,$ as Ge}from"./index-C21AA2f9.js";import{_ as Ze,w as ne,s as oe}from"./ActionCard.vue_vue_type_script_setup_true_lang-wnrf8nZS.js";import{u as Xe,b as tn,a as en,c as nn,d as on}from"./export-BqEF0Nd9.js";import{i as rn,a as an}from"./import-Dj5vaOSP.js";import{u as q,g as ie,_ as ln,a as sn,b as un}from"./dayjs.min-DRnS9uYx.js";import{s as cn,a as re}from"./snapshot-CI3vERif.js";import{u as dn,_ as fn,r as hn}from"./table-9NhH7buH.js";import{u as gn,l as Lt,_ as ge,N as pn}from"./index-DmbD2I_C.js";import"./fetch-BDVD2tTn.js";const mn={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"};function wn(t){const{primaryColor:e,opacityDisabled:r,borderRadius:o,textColor3:n}=t;return Object.assign(Object.assign({},mn),{iconColor:n,textColor:"white",loadingColor:e,opacityDisabled:r,railColor:"rgba(0, 0, 0, .14)",railColorActive:e,buttonBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",buttonColor:"#FFF",railBorderRadiusSmall:o,railBorderRadiusMedium:o,railBorderRadiusLarge:o,buttonBorderRadiusSmall:o,buttonBorderRadiusMedium:o,buttonBorderRadiusLarge:o,boxShadowFocus:`0 0 0 2px ${Re(e,{alpha:.2})}`})}const vn={name:"Switch",common:Ae,self:wn},yn=Zt("switch",`
|
|
2
|
-
height: var(--n-height);
|
|
3
|
-
min-width: var(--n-width);
|
|
4
|
-
vertical-align: middle;
|
|
5
|
-
user-select: none;
|
|
6
|
-
-webkit-user-select: none;
|
|
7
|
-
display: inline-flex;
|
|
8
|
-
outline: none;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
align-items: center;
|
|
11
|
-
`,[A("children-placeholder",`
|
|
12
|
-
height: var(--n-rail-height);
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
pointer-events: none;
|
|
17
|
-
visibility: hidden;
|
|
18
|
-
`),A("rail-placeholder",`
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-wrap: none;
|
|
21
|
-
`),A("button-placeholder",`
|
|
22
|
-
width: calc(1.75 * var(--n-rail-height));
|
|
23
|
-
height: var(--n-rail-height);
|
|
24
|
-
`),Zt("base-loading",`
|
|
25
|
-
position: absolute;
|
|
26
|
-
top: 50%;
|
|
27
|
-
left: 50%;
|
|
28
|
-
transform: translateX(-50%) translateY(-50%);
|
|
29
|
-
font-size: calc(var(--n-button-width) - 4px);
|
|
30
|
-
color: var(--n-loading-color);
|
|
31
|
-
transition: color .3s var(--n-bezier);
|
|
32
|
-
`,[Xt({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),A("checked, unchecked",`
|
|
33
|
-
transition: color .3s var(--n-bezier);
|
|
34
|
-
color: var(--n-text-color);
|
|
35
|
-
box-sizing: border-box;
|
|
36
|
-
position: absolute;
|
|
37
|
-
white-space: nowrap;
|
|
38
|
-
top: 0;
|
|
39
|
-
bottom: 0;
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
line-height: 1;
|
|
43
|
-
`),A("checked",`
|
|
44
|
-
right: 0;
|
|
45
|
-
padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset));
|
|
46
|
-
`),A("unchecked",`
|
|
47
|
-
left: 0;
|
|
48
|
-
justify-content: flex-end;
|
|
49
|
-
padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset));
|
|
50
|
-
`),Mt("&:focus",[A("rail",`
|
|
51
|
-
box-shadow: var(--n-box-shadow-focus);
|
|
52
|
-
`)]),Y("round",[A("rail","border-radius: calc(var(--n-rail-height) / 2);",[A("button","border-radius: calc(var(--n-button-height) / 2);")])]),te("disabled",[te("icon",[Y("rubber-band",[Y("pressed",[A("rail",[A("button","max-width: var(--n-button-width-pressed);")])]),A("rail",[Mt("&:active",[A("button","max-width: var(--n-button-width-pressed);")])]),Y("active",[Y("pressed",[A("rail",[A("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),A("rail",[Mt("&:active",[A("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),Y("active",[A("rail",[A("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),A("rail",`
|
|
53
|
-
overflow: hidden;
|
|
54
|
-
height: var(--n-rail-height);
|
|
55
|
-
min-width: var(--n-rail-width);
|
|
56
|
-
border-radius: var(--n-rail-border-radius);
|
|
57
|
-
cursor: pointer;
|
|
58
|
-
position: relative;
|
|
59
|
-
transition:
|
|
60
|
-
opacity .3s var(--n-bezier),
|
|
61
|
-
background .3s var(--n-bezier),
|
|
62
|
-
box-shadow .3s var(--n-bezier);
|
|
63
|
-
background-color: var(--n-rail-color);
|
|
64
|
-
`,[A("button-icon",`
|
|
65
|
-
color: var(--n-icon-color);
|
|
66
|
-
transition: color .3s var(--n-bezier);
|
|
67
|
-
font-size: calc(var(--n-button-height) - 4px);
|
|
68
|
-
position: absolute;
|
|
69
|
-
left: 0;
|
|
70
|
-
right: 0;
|
|
71
|
-
top: 0;
|
|
72
|
-
bottom: 0;
|
|
73
|
-
display: flex;
|
|
74
|
-
justify-content: center;
|
|
75
|
-
align-items: center;
|
|
76
|
-
line-height: 1;
|
|
77
|
-
`,[Xt()]),A("button",`
|
|
78
|
-
align-items: center;
|
|
79
|
-
top: var(--n-offset);
|
|
80
|
-
left: var(--n-offset);
|
|
81
|
-
height: var(--n-button-height);
|
|
82
|
-
width: var(--n-button-width-pressed);
|
|
83
|
-
max-width: var(--n-button-width);
|
|
84
|
-
border-radius: var(--n-button-border-radius);
|
|
85
|
-
background-color: var(--n-button-color);
|
|
86
|
-
box-shadow: var(--n-button-box-shadow);
|
|
87
|
-
box-sizing: border-box;
|
|
88
|
-
cursor: inherit;
|
|
89
|
-
content: "";
|
|
90
|
-
position: absolute;
|
|
91
|
-
transition:
|
|
92
|
-
background-color .3s var(--n-bezier),
|
|
93
|
-
left .3s var(--n-bezier),
|
|
94
|
-
opacity .3s var(--n-bezier),
|
|
95
|
-
max-width .3s var(--n-bezier),
|
|
96
|
-
box-shadow .3s var(--n-bezier);
|
|
97
|
-
`)]),Y("active",[A("rail","background-color: var(--n-rail-color-active);")]),Y("loading",[A("rail",`
|
|
98
|
-
cursor: wait;
|
|
99
|
-
`)]),Y("disabled",[A("rail",`
|
|
100
|
-
cursor: not-allowed;
|
|
101
|
-
opacity: .5;
|
|
102
|
-
`)])]),bn=Object.assign(Object.assign({},ue.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]});let ct;const Cn=Wt({name:"Switch",props:bn,setup(t){ct===void 0&&(typeof CSS<"u"?typeof CSS.supports<"u"?ct=CSS.supports("width","max(1px)"):ct=!1:ct=!0);const{mergedClsPrefixRef:e,inlineThemeDisabled:r}=Pe(t),o=ue("Switch","-switch",yn,vn,t,e),n=xe(t),{mergedSizeRef:i,mergedDisabledRef:a}=n,l=At(t.defaultValue),s=Le(t,"value"),f=ze(s,l),d=dt(()=>f.value===t.checkedValue),k=At(!1),c=At(!1),h=dt(()=>{const{railStyle:C}=t;if(C)return C({focused:c.value,checked:d.value})});function p(C){const{"onUpdate:value":U,onChange:P,onUpdateValue:F}=t,{nTriggerFormInput:K,nTriggerFormChange:L}=n;U&&xt(U,C),F&&xt(F,C),P&&xt(P,C),l.value=C,K(),L()}function b(){const{nTriggerFormFocus:C}=n;C()}function _(){const{nTriggerFormBlur:C}=n;C()}function v(){t.loading||a.value||(f.value!==t.checkedValue?p(t.checkedValue):p(t.uncheckedValue))}function y(){c.value=!0,b()}function m(){c.value=!1,_(),k.value=!1}function g(C){t.loading||a.value||C.key===" "&&(f.value!==t.checkedValue?p(t.checkedValue):p(t.uncheckedValue),k.value=!1)}function N(C){t.loading||a.value||C.key===" "&&(C.preventDefault(),k.value=!0)}const I=dt(()=>{const{value:C}=i,{self:{opacityDisabled:U,railColor:P,railColorActive:F,buttonBoxShadow:K,buttonColor:L,boxShadowFocus:lt,loadingColor:Z,textColor:E,iconColor:u,[tt("buttonHeight",C)]:x,[tt("buttonWidth",C)]:X,[tt("buttonWidthPressed",C)]:z,[tt("railHeight",C)]:O,[tt("railWidth",C)]:J,[tt("railBorderRadius",C)]:st,[tt("buttonBorderRadius",C)]:It},common:{cubicBezierEaseInOut:vt}}=o.value;let nt,ut,M;return ct?(nt=`calc((${O} - ${x}) / 2)`,ut=`max(${O}, ${x})`,M=`max(${J}, calc(${J} + ${x} - ${O}))`):(nt=Rt((j(O)-j(x))/2),ut=Rt(Math.max(j(O),j(x))),M=j(O)>j(x)?J:Rt(j(J)+j(x)-j(O))),{"--n-bezier":vt,"--n-button-border-radius":It,"--n-button-box-shadow":K,"--n-button-color":L,"--n-button-width":X,"--n-button-width-pressed":z,"--n-button-height":x,"--n-height":ut,"--n-offset":nt,"--n-opacity-disabled":U,"--n-rail-border-radius":st,"--n-rail-color":P,"--n-rail-color-active":F,"--n-rail-height":O,"--n-rail-width":J,"--n-width":M,"--n-box-shadow-focus":lt,"--n-loading-color":Z,"--n-text-color":E,"--n-icon-color":u}}),T=r?Ue("switch",dt(()=>i.value[0]),I,t):void 0;return{handleClick:v,handleBlur:m,handleFocus:y,handleKeyup:g,handleKeydown:N,mergedRailStyle:h,pressed:k,mergedClsPrefix:e,mergedValue:f,checked:d,mergedDisabled:a,cssVars:r?void 0:I,themeClass:T==null?void 0:T.themeClass,onRender:T==null?void 0:T.onRender}},render(){const{mergedClsPrefix:t,mergedDisabled:e,checked:r,mergedRailStyle:o,onRender:n,$slots:i}=this;n==null||n();const{checked:a,unchecked:l,icon:s,"checked-icon":f,"unchecked-icon":d}=i,k=!(Pt(s)&&Pt(f)&&Pt(d));return D("div",{role:"switch","aria-checked":r,class:[`${t}-switch`,this.themeClass,k&&`${t}-switch--icon`,r&&`${t}-switch--active`,e&&`${t}-switch--disabled`,this.round&&`${t}-switch--round`,this.loading&&`${t}-switch--loading`,this.pressed&&`${t}-switch--pressed`,this.rubberBand&&`${t}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},D("div",{class:`${t}-switch__rail`,"aria-hidden":"true",style:o},et(a,c=>et(l,h=>c||h?D("div",{"aria-hidden":!0,class:`${t}-switch__children-placeholder`},D("div",{class:`${t}-switch__rail-placeholder`},D("div",{class:`${t}-switch__button-placeholder`}),c),D("div",{class:`${t}-switch__rail-placeholder`},D("div",{class:`${t}-switch__button-placeholder`}),h)):null)),D("div",{class:`${t}-switch__button`},et(s,c=>et(f,h=>et(d,p=>D(De,null,{default:()=>this.loading?D(Fe,{key:"loading",clsPrefix:t,strokeWidth:20}):this.checked&&(h||c)?D("div",{class:`${t}-switch__button-icon`,key:h?"checked-icon":"icon"},h||c):!this.checked&&(p||c)?D("div",{class:`${t}-switch__button-icon`,key:p?"unchecked-icon":"icon"},p||c):null})))),et(a,c=>c&&D("div",{key:"checked",class:`${t}-switch__checked`},c)),et(l,c=>c&&D("div",{key:"unchecked",class:`${t}-switch__unchecked`},c)))))}});var mt={},Bn=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},pe={},V={};let Yt;const kn=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];V.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};V.getSymbolTotalCodewords=function(e){return kn[e]};V.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};V.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Yt=e};V.isKanjiModeEnabled=function(){return typeof Yt<"u"};V.toSJIS=function(e){return Yt(e)};var St={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},t.from=function(o,n){if(t.isValid(o))return o;try{return e(o)}catch{return n}}})(St);function me(){this.buffer=[],this.length=0}me.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var En=me;function wt(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}wt.prototype.set=function(t,e,r,o){const n=t*this.size+e;this.data[n]=r,o&&(this.reservedBit[n]=!0)};wt.prototype.get=function(t,e){return this.data[t*this.size+e]};wt.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};wt.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var Sn=wt,we={};(function(t){const e=V.getSymbolSize;t.getRowColCoords=function(o){if(o===1)return[];const n=Math.floor(o/7)+2,i=e(o),a=i===145?26:Math.ceil((i-13)/(2*n-2))*2,l=[i-7];for(let s=1;s<n-1;s++)l[s]=l[s-1]-a;return l.push(6),l.reverse()},t.getPositions=function(o){const n=[],i=t.getRowColCoords(o),a=i.length;for(let l=0;l<a;l++)for(let s=0;s<a;s++)l===0&&s===0||l===0&&s===a-1||l===a-1&&s===0||n.push([i[l],i[s]]);return n}})(we);var ve={};const Tn=V.getSymbolSize,ae=7;ve.getPositions=function(e){const r=Tn(e);return[[0,0],[r-ae,0],[0,r-ae]]};var ye={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){const i=n.size;let a=0,l=0,s=0,f=null,d=null;for(let k=0;k<i;k++){l=s=0,f=d=null;for(let c=0;c<i;c++){let h=n.get(k,c);h===f?l++:(l>=5&&(a+=e.N1+(l-5)),f=h,l=1),h=n.get(c,k),h===d?s++:(s>=5&&(a+=e.N1+(s-5)),d=h,s=1)}l>=5&&(a+=e.N1+(l-5)),s>=5&&(a+=e.N1+(s-5))}return a},t.getPenaltyN2=function(n){const i=n.size;let a=0;for(let l=0;l<i-1;l++)for(let s=0;s<i-1;s++){const f=n.get(l,s)+n.get(l,s+1)+n.get(l+1,s)+n.get(l+1,s+1);(f===4||f===0)&&a++}return a*e.N2},t.getPenaltyN3=function(n){const i=n.size;let a=0,l=0,s=0;for(let f=0;f<i;f++){l=s=0;for(let d=0;d<i;d++)l=l<<1&2047|n.get(f,d),d>=10&&(l===1488||l===93)&&a++,s=s<<1&2047|n.get(d,f),d>=10&&(s===1488||s===93)&&a++}return a*e.N3},t.getPenaltyN4=function(n){let i=0;const a=n.data.length;for(let s=0;s<a;s++)i+=n.data[s];return Math.abs(Math.ceil(i*100/a/5)-10)*e.N4};function r(o,n,i){switch(o){case t.Patterns.PATTERN000:return(n+i)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return i%3===0;case t.Patterns.PATTERN011:return(n+i)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(i/3))%2===0;case t.Patterns.PATTERN101:return n*i%2+n*i%3===0;case t.Patterns.PATTERN110:return(n*i%2+n*i%3)%2===0;case t.Patterns.PATTERN111:return(n*i%3+(n+i)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}t.applyMask=function(n,i){const a=i.size;for(let l=0;l<a;l++)for(let s=0;s<a;s++)i.isReserved(s,l)||i.xor(s,l,r(n,s,l))},t.getBestMask=function(n,i){const a=Object.keys(t.Patterns).length;let l=0,s=1/0;for(let f=0;f<a;f++){i(f),t.applyMask(f,n);const d=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(f,n),d<s&&(s=d,l=f)}return l}})(ye);var Tt={};const Q=St,yt=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],bt=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Tt.getBlocksCount=function(e,r){switch(r){case Q.L:return yt[(e-1)*4+0];case Q.M:return yt[(e-1)*4+1];case Q.Q:return yt[(e-1)*4+2];case Q.H:return yt[(e-1)*4+3];default:return}};Tt.getTotalCodewordsCount=function(e,r){switch(r){case Q.L:return bt[(e-1)*4+0];case Q.M:return bt[(e-1)*4+1];case Q.Q:return bt[(e-1)*4+2];case Q.H:return bt[(e-1)*4+3];default:return}};var be={},Nt={};const gt=new Uint8Array(512),kt=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)gt[r]=e,kt[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)gt[r]=gt[r-255]})();Nt.log=function(e){if(e<1)throw new Error("log("+e+")");return kt[e]};Nt.exp=function(e){return gt[e]};Nt.mul=function(e,r){return e===0||r===0?0:gt[kt[e]+kt[r]]};(function(t){const e=Nt;t.mul=function(o,n){const i=new Uint8Array(o.length+n.length-1);for(let a=0;a<o.length;a++)for(let l=0;l<n.length;l++)i[a+l]^=e.mul(o[a],n[l]);return i},t.mod=function(o,n){let i=new Uint8Array(o);for(;i.length-n.length>=0;){const a=i[0];for(let s=0;s<n.length;s++)i[s]^=e.mul(n[s],a);let l=0;for(;l<i.length&&i[l]===0;)l++;i=i.slice(l)}return i},t.generateECPolynomial=function(o){let n=new Uint8Array([1]);for(let i=0;i<o;i++)n=t.mul(n,new Uint8Array([1,e.exp(i)]));return n}})(be);const Ce=be;function jt(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}jt.prototype.initialize=function(e){this.degree=e,this.genPoly=Ce.generateECPolynomial(this.degree)};jt.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const o=Ce.mod(r,this.genPoly),n=this.degree-o.length;if(n>0){const i=new Uint8Array(this.degree);return i.set(o,n),i}return o};var Nn=jt,Be={},G={},qt={};qt.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var W={};const ke="[0-9]+",_n="[A-Z $%*+\\-./:]+";let pt="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";pt=pt.replace(/u/g,"\\u");const In="(?:(?![A-Z0-9 $%*+\\-./:]|"+pt+`)(?:.|[\r
|
|
103
|
-
]))+`;W.KANJI=new RegExp(pt,"g");W.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");W.BYTE=new RegExp(In,"g");W.NUMERIC=new RegExp(ke,"g");W.ALPHANUMERIC=new RegExp(_n,"g");const Mn=new RegExp("^"+pt+"$"),An=new RegExp("^"+ke+"$"),Rn=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");W.testKanji=function(e){return Mn.test(e)};W.testNumeric=function(e){return An.test(e)};W.testAlphanumeric=function(e){return Rn.test(e)};(function(t){const e=qt,r=W;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(i,a){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!e.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?i.ccBits[0]:a<27?i.ccBits[1]:i.ccBits[2]},t.getBestModeForData=function(i){return r.testNumeric(i)?t.NUMERIC:r.testAlphanumeric(i)?t.ALPHANUMERIC:r.testKanji(i)?t.KANJI:t.BYTE},t.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},t.isValid=function(i){return i&&i.bit&&i.ccBits};function o(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}t.from=function(i,a){if(t.isValid(i))return i;try{return o(i)}catch{return a}}})(G);(function(t){const e=V,r=Tt,o=St,n=G,i=qt,a=7973,l=e.getBCHDigit(a);function s(c,h,p){for(let b=1;b<=40;b++)if(h<=t.getCapacity(b,p,c))return b}function f(c,h){return n.getCharCountIndicator(c,h)+4}function d(c,h){let p=0;return c.forEach(function(b){const _=f(b.mode,h);p+=_+b.getBitsLength()}),p}function k(c,h){for(let p=1;p<=40;p++)if(d(c,p)<=t.getCapacity(p,h,n.MIXED))return p}t.from=function(h,p){return i.isValid(h)?parseInt(h,10):p},t.getCapacity=function(h,p,b){if(!i.isValid(h))throw new Error("Invalid QR Code version");typeof b>"u"&&(b=n.BYTE);const _=e.getSymbolTotalCodewords(h),v=r.getTotalCodewordsCount(h,p),y=(_-v)*8;if(b===n.MIXED)return y;const m=y-f(b,h);switch(b){case n.NUMERIC:return Math.floor(m/10*3);case n.ALPHANUMERIC:return Math.floor(m/11*2);case n.KANJI:return Math.floor(m/13);case n.BYTE:default:return Math.floor(m/8)}},t.getBestVersionForData=function(h,p){let b;const _=o.from(p,o.M);if(Array.isArray(h)){if(h.length>1)return k(h,_);if(h.length===0)return 1;b=h[0]}else b=h;return s(b.mode,b.getLength(),_)},t.getEncodedBits=function(h){if(!i.isValid(h)||h<7)throw new Error("Invalid QR Code version");let p=h<<12;for(;e.getBCHDigit(p)-l>=0;)p^=a<<e.getBCHDigit(p)-l;return h<<12|p}})(Be);var Ee={};const Ht=V,Se=1335,Pn=21522,le=Ht.getBCHDigit(Se);Ee.getEncodedBits=function(e,r){const o=e.bit<<3|r;let n=o<<10;for(;Ht.getBCHDigit(n)-le>=0;)n^=Se<<Ht.getBCHDigit(n)-le;return(o<<10|n)^Pn};var Te={};const xn=G;function ot(t){this.mode=xn.NUMERIC,this.data=t.toString()}ot.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};ot.prototype.getLength=function(){return this.data.length};ot.prototype.getBitsLength=function(){return ot.getBitsLength(this.data.length)};ot.prototype.write=function(e){let r,o,n;for(r=0;r+3<=this.data.length;r+=3)o=this.data.substr(r,3),n=parseInt(o,10),e.put(n,10);const i=this.data.length-r;i>0&&(o=this.data.substr(r),n=parseInt(o,10),e.put(n,i*3+1))};var Ln=ot;const zn=G,zt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function it(t){this.mode=zn.ALPHANUMERIC,this.data=t}it.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};it.prototype.getLength=function(){return this.data.length};it.prototype.getBitsLength=function(){return it.getBitsLength(this.data.length)};it.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let o=zt.indexOf(this.data[r])*45;o+=zt.indexOf(this.data[r+1]),e.put(o,11)}this.data.length%2&&e.put(zt.indexOf(this.data[r]),6)};var Un=it;const Dn=G;function rt(t){this.mode=Dn.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}rt.getBitsLength=function(e){return e*8};rt.prototype.getLength=function(){return this.data.length};rt.prototype.getBitsLength=function(){return rt.getBitsLength(this.data.length)};rt.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var Fn=rt;const Vn=G,$n=V;function at(t){this.mode=Vn.KANJI,this.data=t}at.getBitsLength=function(e){return e*13};at.prototype.getLength=function(){return this.data.length};at.prototype.getBitsLength=function(){return at.getBitsLength(this.data.length)};at.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=$n.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
104
|
-
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var Hn=at,Ne={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,o,n){var i={},a={};a[o]=0;var l=e.PriorityQueue.make();l.push(o,0);for(var s,f,d,k,c,h,p,b,_;!l.empty();){s=l.pop(),f=s.value,k=s.cost,c=r[f]||{};for(d in c)c.hasOwnProperty(d)&&(h=c[d],p=k+h,b=a[d],_=typeof a[d]>"u",(_||b>p)&&(a[d]=p,l.push(d,p),i[d]=f))}if(typeof n<"u"&&typeof a[n]>"u"){var v=["Could not find a path from ",o," to ",n,"."].join("");throw new Error(v)}return i},extract_shortest_path_from_predecessor_list:function(r,o){for(var n=[],i=o;i;)n.push(i),r[i],i=r[i];return n.reverse(),n},find_path:function(r,o,n){var i=e.single_source_shortest_paths(r,o,n);return e.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(r){var o=e.PriorityQueue,n={},i;r=r||{};for(i in o)o.hasOwnProperty(i)&&(n[i]=o[i]);return n.queue=[],n.sorter=r.sorter||o.default_sorter,n},default_sorter:function(r,o){return r.cost-o.cost},push:function(r,o){var n={value:r,cost:o};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Ne);var Kn=Ne.exports;(function(t){const e=G,r=Ln,o=Un,n=Fn,i=Hn,a=W,l=V,s=Kn;function f(v){return unescape(encodeURIComponent(v)).length}function d(v,y,m){const g=[];let N;for(;(N=v.exec(m))!==null;)g.push({data:N[0],index:N.index,mode:y,length:N[0].length});return g}function k(v){const y=d(a.NUMERIC,e.NUMERIC,v),m=d(a.ALPHANUMERIC,e.ALPHANUMERIC,v);let g,N;return l.isKanjiModeEnabled()?(g=d(a.BYTE,e.BYTE,v),N=d(a.KANJI,e.KANJI,v)):(g=d(a.BYTE_KANJI,e.BYTE,v),N=[]),y.concat(m,g,N).sort(function(T,C){return T.index-C.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function c(v,y){switch(y){case e.NUMERIC:return r.getBitsLength(v);case e.ALPHANUMERIC:return o.getBitsLength(v);case e.KANJI:return i.getBitsLength(v);case e.BYTE:return n.getBitsLength(v)}}function h(v){return v.reduce(function(y,m){const g=y.length-1>=0?y[y.length-1]:null;return g&&g.mode===m.mode?(y[y.length-1].data+=m.data,y):(y.push(m),y)},[])}function p(v){const y=[];for(let m=0;m<v.length;m++){const g=v[m];switch(g.mode){case e.NUMERIC:y.push([g,{data:g.data,mode:e.ALPHANUMERIC,length:g.length},{data:g.data,mode:e.BYTE,length:g.length}]);break;case e.ALPHANUMERIC:y.push([g,{data:g.data,mode:e.BYTE,length:g.length}]);break;case e.KANJI:y.push([g,{data:g.data,mode:e.BYTE,length:f(g.data)}]);break;case e.BYTE:y.push([{data:g.data,mode:e.BYTE,length:f(g.data)}])}}return y}function b(v,y){const m={},g={start:{}};let N=["start"];for(let I=0;I<v.length;I++){const T=v[I],C=[];for(let U=0;U<T.length;U++){const P=T[U],F=""+I+U;C.push(F),m[F]={node:P,lastCount:0},g[F]={};for(let K=0;K<N.length;K++){const L=N[K];m[L]&&m[L].node.mode===P.mode?(g[L][F]=c(m[L].lastCount+P.length,P.mode)-c(m[L].lastCount,P.mode),m[L].lastCount+=P.length):(m[L]&&(m[L].lastCount=P.length),g[L][F]=c(P.length,P.mode)+4+e.getCharCountIndicator(P.mode,y))}}N=C}for(let I=0;I<N.length;I++)g[N[I]].end=0;return{map:g,table:m}}function _(v,y){let m;const g=e.getBestModeForData(v);if(m=e.from(y,g),m!==e.BYTE&&m.bit<g.bit)throw new Error('"'+v+'" cannot be encoded with mode '+e.toString(m)+`.
|
|
105
|
-
Suggested mode is: `+e.toString(g));switch(m===e.KANJI&&!l.isKanjiModeEnabled()&&(m=e.BYTE),m){case e.NUMERIC:return new r(v);case e.ALPHANUMERIC:return new o(v);case e.KANJI:return new i(v);case e.BYTE:return new n(v)}}t.fromArray=function(y){return y.reduce(function(m,g){return typeof g=="string"?m.push(_(g,null)):g.data&&m.push(_(g.data,g.mode)),m},[])},t.fromString=function(y,m){const g=k(y,l.isKanjiModeEnabled()),N=p(g),I=b(N,m),T=s.find_path(I.map,"start","end"),C=[];for(let U=1;U<T.length-1;U++)C.push(I.table[T[U]].node);return t.fromArray(h(C))},t.rawSplit=function(y){return t.fromArray(k(y,l.isKanjiModeEnabled()))}})(Te);const _t=V,Ut=St,On=En,Jn=Sn,Wn=we,Yn=ve,Kt=ye,Ot=Tt,jn=Nn,Et=Be,qn=Ee,Qn=G,Dt=Te;function Gn(t,e){const r=t.size,o=Yn.getPositions(e);for(let n=0;n<o.length;n++){const i=o[n][0],a=o[n][1];for(let l=-1;l<=7;l++)if(!(i+l<=-1||r<=i+l))for(let s=-1;s<=7;s++)a+s<=-1||r<=a+s||(l>=0&&l<=6&&(s===0||s===6)||s>=0&&s<=6&&(l===0||l===6)||l>=2&&l<=4&&s>=2&&s<=4?t.set(i+l,a+s,!0,!0):t.set(i+l,a+s,!1,!0))}}function Zn(t){const e=t.size;for(let r=8;r<e-8;r++){const o=r%2===0;t.set(r,6,o,!0),t.set(6,r,o,!0)}}function Xn(t,e){const r=Wn.getPositions(e);for(let o=0;o<r.length;o++){const n=r[o][0],i=r[o][1];for(let a=-2;a<=2;a++)for(let l=-2;l<=2;l++)a===-2||a===2||l===-2||l===2||a===0&&l===0?t.set(n+a,i+l,!0,!0):t.set(n+a,i+l,!1,!0)}}function to(t,e){const r=t.size,o=Et.getEncodedBits(e);let n,i,a;for(let l=0;l<18;l++)n=Math.floor(l/3),i=l%3+r-8-3,a=(o>>l&1)===1,t.set(n,i,a,!0),t.set(i,n,a,!0)}function Ft(t,e,r){const o=t.size,n=qn.getEncodedBits(e,r);let i,a;for(i=0;i<15;i++)a=(n>>i&1)===1,i<6?t.set(i,8,a,!0):i<8?t.set(i+1,8,a,!0):t.set(o-15+i,8,a,!0),i<8?t.set(8,o-i-1,a,!0):i<9?t.set(8,15-i-1+1,a,!0):t.set(8,15-i-1,a,!0);t.set(o-8,8,1,!0)}function eo(t,e){const r=t.size;let o=-1,n=r-1,i=7,a=0;for(let l=r-1;l>0;l-=2)for(l===6&&l--;;){for(let s=0;s<2;s++)if(!t.isReserved(n,l-s)){let f=!1;a<e.length&&(f=(e[a]>>>i&1)===1),t.set(n,l-s,f),i--,i===-1&&(a++,i=7)}if(n+=o,n<0||r<=n){n-=o,o=-o;break}}}function no(t,e,r){const o=new On;r.forEach(function(s){o.put(s.mode.bit,4),o.put(s.getLength(),Qn.getCharCountIndicator(s.mode,t)),s.write(o)});const n=_t.getSymbolTotalCodewords(t),i=Ot.getTotalCodewordsCount(t,e),a=(n-i)*8;for(o.getLengthInBits()+4<=a&&o.put(0,4);o.getLengthInBits()%8!==0;)o.putBit(0);const l=(a-o.getLengthInBits())/8;for(let s=0;s<l;s++)o.put(s%2?17:236,8);return oo(o,t,e)}function oo(t,e,r){const o=_t.getSymbolTotalCodewords(e),n=Ot.getTotalCodewordsCount(e,r),i=o-n,a=Ot.getBlocksCount(e,r),l=o%a,s=a-l,f=Math.floor(o/a),d=Math.floor(i/a),k=d+1,c=f-d,h=new jn(c);let p=0;const b=new Array(a),_=new Array(a);let v=0;const y=new Uint8Array(t.buffer);for(let T=0;T<a;T++){const C=T<s?d:k;b[T]=y.slice(p,p+C),_[T]=h.encode(b[T]),p+=C,v=Math.max(v,C)}const m=new Uint8Array(o);let g=0,N,I;for(N=0;N<v;N++)for(I=0;I<a;I++)N<b[I].length&&(m[g++]=b[I][N]);for(N=0;N<c;N++)for(I=0;I<a;I++)m[g++]=_[I][N];return m}function io(t,e,r,o){let n;if(Array.isArray(t))n=Dt.fromArray(t);else if(typeof t=="string"){let f=e;if(!f){const d=Dt.rawSplit(t);f=Et.getBestVersionForData(d,r)}n=Dt.fromString(t,f||40)}else throw new Error("Invalid data");const i=Et.getBestVersionForData(n,r);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=i;else if(e<i)throw new Error(`
|
|
106
|
-
The chosen QR Code version cannot contain this amount of data.
|
|
107
|
-
Minimum version required to store current data is: `+i+`.
|
|
108
|
-
`);const a=no(e,r,n),l=_t.getSymbolSize(e),s=new Jn(l);return Gn(s,e),Zn(s),Xn(s,e),Ft(s,r,0),e>=7&&to(s,e),eo(s,a),isNaN(o)&&(o=Kt.getBestMask(s,Ft.bind(null,s,r))),Kt.applyMask(o,s),Ft(s,r,o),{modules:s,version:e,errorCorrectionLevel:r,maskPattern:o,segments:n}}pe.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let o=Ut.M,n,i;return typeof r<"u"&&(o=Ut.from(r.errorCorrectionLevel,Ut.M),n=Et.from(r.version),i=Kt.from(r.maskPattern),r.toSJISFunc&&_t.setToSJISFunction(r.toSJISFunc)),io(e,n,o,i)};var _e={},Qt={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let o=r.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+r);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(i){return[i,i]}))),o.length===6&&o.push("F","F");const n=parseInt(o.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+o.slice(0,6).join("")}}t.getOptions=function(o){o||(o={}),o.color||(o.color={});const n=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,i=o.width&&o.width>=21?o.width:void 0,a=o.scale||4;return{width:i,scale:i?4:a,margin:n,color:{dark:e(o.color.dark||"#000000ff"),light:e(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},t.getScale=function(o,n){return n.width&&n.width>=o+n.margin*2?n.width/(o+n.margin*2):n.scale},t.getImageWidth=function(o,n){const i=t.getScale(o,n);return Math.floor((o+n.margin*2)*i)},t.qrToImageData=function(o,n,i){const a=n.modules.size,l=n.modules.data,s=t.getScale(a,i),f=Math.floor((a+i.margin*2)*s),d=i.margin*s,k=[i.color.light,i.color.dark];for(let c=0;c<f;c++)for(let h=0;h<f;h++){let p=(c*f+h)*4,b=i.color.light;if(c>=d&&h>=d&&c<f-d&&h<f-d){const _=Math.floor((c-d)/s),v=Math.floor((h-d)/s);b=k[l[_*a+v]?1:0]}o[p++]=b.r,o[p++]=b.g,o[p++]=b.b,o[p]=b.a}}})(Qt);(function(t){const e=Qt;function r(n,i,a){n.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=a,i.width=a,i.style.height=a+"px",i.style.width=a+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(i,a,l){let s=l,f=a;typeof s>"u"&&(!a||!a.getContext)&&(s=a,a=void 0),a||(f=o()),s=e.getOptions(s);const d=e.getImageWidth(i.modules.size,s),k=f.getContext("2d"),c=k.createImageData(d,d);return e.qrToImageData(c.data,i,s),r(k,f,d),k.putImageData(c,0,0),f},t.renderToDataURL=function(i,a,l){let s=l;typeof s>"u"&&(!a||!a.getContext)&&(s=a,a=void 0),s||(s={});const f=t.render(i,a,s),d=s.type||"image/png",k=s.rendererOpts||{};return f.toDataURL(d,k.quality)}})(_e);var Ie={};const ro=Qt;function se(t,e){const r=t.a/255,o=e+'="'+t.hex+'"';return r<1?o+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':o}function Vt(t,e,r){let o=t+e;return typeof r<"u"&&(o+=" "+r),o}function ao(t,e,r){let o="",n=0,i=!1,a=0;for(let l=0;l<t.length;l++){const s=Math.floor(l%e),f=Math.floor(l/e);!s&&!i&&(i=!0),t[l]?(a++,l>0&&s>0&&t[l-1]||(o+=i?Vt("M",s+r,.5+f+r):Vt("m",n,0),n=0,i=!1),s+1<e&&t[l+1]||(o+=Vt("h",a),a=0)):n++}return o}Ie.render=function(e,r,o){const n=ro.getOptions(r),i=e.modules.size,a=e.modules.data,l=i+n.margin*2,s=n.color.light.a?"<path "+se(n.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",f="<path "+se(n.color.dark,"stroke")+' d="'+ao(a,i,n.margin)+'"/>',d='viewBox="0 0 '+l+" "+l+'"',c='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+d+' shape-rendering="crispEdges">'+s+f+`</svg>
|
|
109
|
-
`;return typeof o=="function"&&o(null,c),c};const lo=Bn,Jt=pe,Me=_e,so=Ie;function Gt(t,e,r,o,n){const i=[].slice.call(arguments,1),a=i.length,l=typeof i[a-1]=="function";if(!l&&!lo())throw new Error("Callback required as last argument");if(l){if(a<2)throw new Error("Too few arguments provided");a===2?(n=r,r=e,e=o=void 0):a===3&&(e.getContext&&typeof n>"u"?(n=o,o=void 0):(n=o,o=r,r=e,e=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(r=e,e=o=void 0):a===2&&!e.getContext&&(o=r,r=e,e=void 0),new Promise(function(s,f){try{const d=Jt.create(r,o);s(t(d,e,o))}catch(d){f(d)}})}try{const s=Jt.create(r,o);n(null,t(s,e,o))}catch(s){n(s)}}mt.create=Jt.create;mt.toCanvas=Gt.bind(null,Me.render);mt.toDataURL=Gt.bind(null,Me.renderToDataURL);mt.toString=Gt.bind(null,function(t,e,r){return so.render(t,r)});const uo=["src"],co=Wt({__name:"BuildShareDlg",props:{show:{default:!1},showModifiers:{}},emits:["update:show"],setup(t){const e=$e(),r=Ve(t,"show"),o=H(""),n=H(!1),i=gn(()=>{try{Lt.parse(o.value),n.value=!1}catch{n.value=!0}},500);ht(()=>{o.value.trim()?i():n.value=!0});const a=H(!1),l=H(""),s=H("");ht(()=>{l.value?mt.toDataURL(l.value,{width:256,margin:2}).then(k=>{s.value=k}):s.value=""});const f=()=>{He(l.value),a.value=!1},d=q(async()=>{const k=Lt.parse(o.value),c=await Xe(new TextEncoder().encode(Lt.stringify({data:k,ctime:Date.now(),type:"share"})),"file.txt"),h=location.origin+e.resolve(`/s/${c.id}`).href;l.value=h,a.value=!0});return(k,c)=>{const h=ge,p=ce,b=he;return Ct(),Bt($t,null,[B(p,{show:r.value,"onUpdate:show":c[1]||(c[1]=_=>r.value=_),preset:"dialog",title:"分享规则",positiveText:w(d).loading?"分享中...":"分享",onPositiveClick:w(d).invoke,loading:w(d).loading,positiveButtonProps:{disabled:w(n)},style:{width:"800px"},onAfterLeave:c[2]||(c[2]=_=>o.value="")},{default:S(()=>[B(h,{class:"gkd_code h-[calc(var(--gkd-height)*0.6)]",type:"textarea","show-count":"",value:w(o),"onUpdate:value":c[0]||(c[0]=_=>{w(d).loading||(o.value=_)}),placeholder:"请输入需要分享的规则"},null,8,["value"])]),_:1},8,["show","positiveText","onPositiveClick","loading","positiveButtonProps"]),B(p,{show:w(a),"onUpdate:show":c[3]||(c[3]=_=>ft(a)?a.value=_:null),preset:"dialog",title:"分享成功",positiveText:"复制并关闭",negativeText:"重新分享",onPositiveClick:f,onNegativeClick:c[4]||(c[4]=_=>{a.value=!1,o.value="",r.value=!0}),onAfterLeave:c[5]||(c[5]=_=>l.value=""),maskClosable:!1},{default:S(()=>[R("div",null,[B(b,{text:"",tag:"a",href:w(l),target:"_blank",type:"primary"},{default:S(()=>[$(de(w(l)),1)]),_:1},8,["href"]),w(s)?(Ct(),Bt("img",{key:0,src:w(s),"size-200px":"",block:""},null,8,uo)):fe("",!0)])]),_:1},8,["show"])],64)}}}),fo={flex:"","flex-col":"","p-10px":"","gap-10px":"","h-full":""},ho={flex:""},go={"h-full":"",flex:"","flex-items-center":""},po={flex:"","gap-24px":"","items-center":"","pr-8px":""},mo={flex:"",href:"/device",title:"连接设备"},wo={flex:"",href:"https://github.com/gkd-kit/inspect",target:"_blank",rel:"noopener noreferrer"},vo={flex:"","gap-10px":""},_o=Wt({__name:"HomePage",setup(t){const e=Ke(),r=H([]),o=H(!0),n=async()=>{o.value=!0,r.value=(await cn.getAllItems()).reverse(),T.value=[],o.value=!1};Oe(n);const i=ee({query:"",actualQuery:"",updateQuery:()=>{i.actualQuery=i.query.trim(),T.value=[]}}),a=dt(()=>{const E=i.actualQuery;return E?r.value.filter(u=>(ie(u).name||"").includes(E)||(u.appId||"").includes(E)||(u.activityId||"").includes(E)):r.value}),l=q(async()=>{await rn(),await n()}),{activityIdCol:s,appIdCol:f,appNameCol:d,ctimeCol:k,mtimeCol:c,deviceCol:h,appVersionCodeCol:p,appVersionNameCol:b,resetColWidth:_}=dn();ht(()=>{const E=a.value.reduce((u,x)=>(u.add(hn(x)),u),new Set);if(E.size<=1){h.filterOptions=void 0;return}h.filterOptions=[...E.values()].map(u=>({value:u,label:u}))}),ht(()=>{const E=a.value.reduce((u,x)=>(u.add(ie(x).name),u),new Set);if(E.size<=1){d.filterOptions=void 0;return}d.filterOptions=[...E.values()].map(u=>({value:u,label:u}))}),ht(()=>{const E=a.value.reduce((u,x)=>(u.add(x.activityId),u),new Set);if(E.size<=1){s.filterOptions=void 0;return}s.filterOptions=[...E.values()].map(u=>({value:u,label:u}))});const v=Je([{type:"selection"},k,c,h,d,f,p,b,s,{key:"actions",title:"操作",fixed:"right",width:"160px",render(E){return B(Ze,{snapshot:E,onDelete:n},null)}}]),y=ee({page:1,pageSize:50,showSizePicker:!0,pageSizes:[50,100],onChange:E=>{y.page=E},onUpdatePageSize:E=>{y.pageSize=E,y.page=1}});We(y,_);const m=E=>{[k,c].forEach(u=>{E.columnKey!=u.key?u.sortOrder=void 0:u.sortOrder=E.order})};c.sortOrder="descend";const g=H(!1),N=H(""),I=q(async()=>{const E=N.value.trim().split(`
|
|
110
|
-
`).map(u=>u.trim()).filter(u=>Ye(u));E.length!=0&&(await an(E),await n(),N.value="")}),T=H([]),C=()=>Promise.all(T.value.map(E=>re.getItem(E))),U=q(async()=>{await new Promise((E,u)=>{je.warning({title:"删除",content:`是否批量删除 ${T.value.length} 个快照`,negativeText:"取消",positiveText:"确认",onClose:u,onEsc:u,onMaskClick:u,onNegativeClick:u,onPositiveClick:E})}),await Promise.all(T.value.map(E=>re.removeItem(E))),await n()}),P=q(async()=>{await tn(await C())}),F=q(async()=>{await en(await C())}),K=q(async()=>{await ne();const E=await nn(await C());oe({content:E.map(u=>qe(u)).join(`
|
|
111
|
-
`)+`
|
|
112
|
-
`})}),L=q(async()=>{await ne();const E=await on(await C());oe({content:E.map(u=>location.origin+"/i/"+u).join(`
|
|
113
|
-
`)+`
|
|
114
|
-
`})}),lt=H(!1),Z=H(!1);return(E,u)=>{const x=ge,X=pn,z=he,O=un,J=ln,st=sn,It=fn,vt=ce,nt=Ge,ut=Cn;return Ct(),Bt($t,null,[R("div",fo,[R("div",ho,[B(J,null,{default:S(()=>[B(O,null,{default:S(()=>[B(x,{placeholder:"请输入应用名称/应用ID/界面ID",clearable:"",class:"min-w-320px",value:w(i).query,"onUpdate:value":u[0]||(u[0]=M=>w(i).query=M),onKeyup:Qe(w(i).updateQuery,["enter"]),onChange:w(i).updateQuery},null,8,["value","onKeyup","onChange"]),B(z,{onClick:w(i).updateQuery},{icon:S(()=>[B(X,null,{default:S(()=>u[13]||(u[13]=[R("svg",{viewBox:"0 0 32 32"},[R("path",{d:"M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9z",fill:"currentColor"})],-1)])),_:1})]),_:1},8,["onClick"])]),_:1}),w(T).length?(Ct(),Bt($t,{key:0},[B(st,null,{trigger:S(()=>[B(z,null,{default:S(()=>u[14]||(u[14]=[$(" 批量下载 ")])),_:1})]),default:S(()=>[B(J,{vertical:""},{default:S(()=>[B(z,{onClick:w(F).invoke,loading:w(F).loading},{default:S(()=>u[15]||(u[15]=[$(" 批量下载-快照 ")])),_:1},8,["onClick","loading"]),B(z,{onClick:w(P).invoke,loading:w(P).loading},{default:S(()=>u[16]||(u[16]=[$(" 批量下载-图片 ")])),_:1},8,["onClick","loading"])]),_:1})]),_:1}),B(st,null,{trigger:S(()=>[B(z,null,{default:S(()=>u[17]||(u[17]=[$(" 批量分享 ")])),_:1})]),default:S(()=>[B(J,{vertical:""},{default:S(()=>[B(z,{onClick:w(L).invoke,loading:w(L).loading},{default:S(()=>u[18]||(u[18]=[$(" 批量生成链接-快照 ")])),_:1},8,["onClick","loading"]),B(z,{onClick:w(K).invoke,loading:w(K).loading},{default:S(()=>u[19]||(u[19]=[$(" 批量生成链接-图片 ")])),_:1},8,["onClick","loading"])]),_:1})]),_:1}),B(z,{onClick:w(U).invoke},{default:S(()=>u[20]||(u[20]=[$(" 批量删除 ")])),_:1},8,["onClick"]),R("div",go,de(`已选中 ${w(T).length} 个快照`),1)],64)):fe("",!0)]),_:1}),u[27]||(u[27]=R("div",{"flex-1":""},null,-1)),R("div",po,[B(z,{text:"",title:"设置",onClick:u[1]||(u[1]=M=>Z.value=!0)},{icon:S(()=>[B(X,{size:24},{default:S(()=>u[21]||(u[21]=[R("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},[R("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98c0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46a.5.5 0 0 0-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1a.566.566 0 0 0-.18-.03c-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98c0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46a.5.5 0 0 0 .61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03c.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-1.98-1.71c.04.31.05.52.05.73c0 .21-.02.43-.05.73l-.14 1.13l.89.7l1.08.84l-.7 1.21l-1.27-.51l-1.04-.42l-.9.68c-.43.32-.84.56-1.25.73l-1.06.43l-.16 1.13l-.2 1.35h-1.4l-.19-1.35l-.16-1.13l-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7l-1.06.43l-1.27.51l-.7-1.21l1.08-.84l.89-.7l-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13l-.89-.7l-1.08-.84l.7-1.21l1.27.51l1.04.42l.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43l.16-1.13l.2-1.35h1.39l.19 1.35l.16 1.13l1.06.43c.43.18.83.41 1.23.71l.91.7l1.06-.43l1.27-.51l.7 1.21l-1.07.85l-.89.7l.14 1.13zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4s4-1.79 4-4s-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2z",fill:"currentColor"})],-1)])),_:1})]),_:1}),B(st,null,{trigger:S(()=>[B(z,{text:""},{icon:S(()=>[B(X,{size:24},{default:S(()=>u[22]||(u[22]=[R("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},[R("path",{fill:"currentColor",d:"M28 19H14.83l2.58-2.59L16 15l-5 5l5 5l1.41-1.41L14.83 21H28z"}),R("path",{fill:"currentColor",d:"M24 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 16 2H6a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H6V4h8v6a2 2 0 0 0 2 2h6v2Zm-8-4V4.41L21.59 10Z"})],-1)])),_:1})]),_:1})]),default:S(()=>[B(J,{vertical:""},{default:S(()=>[B(z,{onClick:w(l).invoke,loading:w(l).loading},{default:S(()=>u[23]||(u[23]=[$(" 导入本地文件 ")])),_:1},8,["onClick","loading"]),B(z,{onClick:u[2]||(u[2]=M=>g.value=!0),loading:w(I).loading},{default:S(()=>u[24]||(u[24]=[$(" 导入网络文件 ")])),_:1},8,["loading"])]),_:1})]),_:1}),R("a",mo,[B(z,{text:""},{icon:S(()=>[B(X,{size:24},{default:S(()=>u[25]||(u[25]=[R("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[R("path",{fill:"currentColor",d:"M18.35 14.85L16.9 13.4q.3-.275.463-.637t.162-.763t-.162-.763t-.463-.637l1.45-1.45q.575.575.875 1.313t.3 1.537t-.3 1.538t-.875 1.312m2.45 2.45l-1.4-1.4q.775-.775 1.2-1.775T21.025 12T20.6 9.875T19.4 8.1l1.4-1.4q1.075 1.05 1.65 2.425T23.025 12t-.575 2.875T20.8 17.3M7 23q-.825 0-1.412-.587T5 21V3q0-.825.588-1.412T7 1h10q.825 0 1.413.588T19 3v4h-2V6H7v12h10v-1h2v4q0 .825-.587 1.413T17 23zm0-3v1h10v-1zM7 4h10V3H7zm0 0V3zm0 16v1z"})],-1)])),_:1})]),_:1})]),R("a",wo,[B(z,{text:""},{icon:S(()=>[B(X,{size:24},{default:S(()=>u[26]||(u[26]=[R("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 496 512"},[R("path",{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6c-3.3.3-5.6-1.3-5.6-3.6c0-2 2.3-3.6 5.2-3.6c3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9c2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9c.3 2 2.9 3.3 5.9 2.6c2.9-.7 4.9-2.6 4.6-4.6c-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2c12.8 2.3 17.3-5.6 17.3-12.1c0-6.2-.3-40.4-.3-61.4c0 0-70 15-84.7-29.8c0 0-11.4-29.1-27.8-36.6c0 0-22.9-15.7 1.6-15.4c0 0 24.9 2 38.6 25.8c21.9 38.6 58.6 27.5 72.9 20.9c2.3-16 8.8-27.1 16-33.7c-55.9-6.2-112.3-14.3-112.3-110.5c0-27.5 7.6-41.3 23.6-58.9c-2.6-6.5-11.1-33.3 2.6-67.9c20.9-6.5 69 27 69 27c20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27c13.7 34.7 5.2 61.4 2.6 67.9c16 17.7 25.8 31.5 25.8 58.9c0 96.5-58.9 104.2-114.8 110.5c9.2 7.9 17 22.9 17 46.4c0 33.7-.3 75.4-.3 83.6c0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252C496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2c1.6 1.6 3.9 2.3 5.2 1c1.3-1 1-3.3-.7-5.2c-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9c1.6 1 3.6.7 4.3-.7c.7-1.3-.3-2.9-2.3-3.9c-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2c2.3 2.3 5.2 2.6 6.5 1c1.3-1.3.7-4.3-1.3-6.2c-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9c1.6 2.3 4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2c-1.4-2.3-4-3.3-5.6-2z",fill:"currentColor"})],-1)])),_:1})]),_:1})])])]),B(It,{striped:"",data:w(a),columns:w(v),scrollX:1800,pagination:w(y),checkedRowKeys:w(T),"onUpdate:checkedRowKeys":u[3]||(u[3]=M=>ft(T)?T.value=M:null),rowKey:M=>M.id,"onUpdate:sorter":m,size:"small",class:"flex-1",flexHeight:"",loading:w(o)},null,8,["data","columns","pagination","checkedRowKeys","rowKey","loading"])]),B(vt,{show:w(g),"onUpdate:show":u[5]||(u[5]=M=>ft(g)?g.value=M:null),preset:"dialog",title:"导入网络文件",showIcon:!1,positiveText:"确认",negativeText:"取消",style:{width:"800px"},onPositiveClick:w(I).invoke,loading:w(I).loading,onAfterLeave:u[6]||(u[6]=M=>N.value="")},{default:S(()=>[B(x,{value:w(N),"onUpdate:value":u[4]||(u[4]=M=>{w(I).loading||(N.value=M)}),type:"textarea",placeholder:`1.支持ZIP文件链接
|
|
115
|
-
2.支持快照链接
|
|
116
|
-
每行一个
|
|
117
|
-
空白行自动忽略
|
|
118
|
-
非法链接行自动忽略`,autosize:{minRows:8,maxRows:16},inputProps:{style:"white-space: nowrap;"}},null,8,["value"])]),_:1},8,["show","onPositiveClick","loading"]),B(co,{show:w(lt),"onUpdate:show":u[7]||(u[7]=M=>ft(lt)?lt.value=M:null)},null,8,["show"]),B(vt,{show:w(Z),"onUpdate:show":u[11]||(u[11]=M=>ft(Z)?Z.value=M:null),preset:"dialog",title:"设置",showIcon:!1,positiveText:"关闭",style:{width:"600px"},onPositiveClick:u[12]||(u[12]=M=>Z.value=!1)},{default:S(()=>[B(nt,{checked:w(e).ignoreUploadWarn,"onUpdate:checked":u[8]||(u[8]=M=>w(e).ignoreUploadWarn=M)},{default:S(()=>u[28]||(u[28]=[$(" 关闭生成分享链接弹窗提醒 ")])),_:1},8,["checked"]),u[31]||(u[31]=R("div",{"h-1px":"","my-10px":"",bg:"#eee"},null,-1)),B(nt,{checked:w(e).ignoreWasmWarn,"onUpdate:checked":u[9]||(u[9]=M=>w(e).ignoreWasmWarn=M)},{default:S(()=>u[29]||(u[29]=[$(" 关闭浏览器版本正则表达式 WASM(GC) 提醒 ")])),_:1},8,["checked"]),u[32]||(u[32]=R("div",{"h-1px":"","my-10px":"",bg:"#eee"},null,-1)),R("div",vo,[B(ut,{value:w(e).autoUploadImport,"onUpdate:value":u[10]||(u[10]=M=>w(e).autoUploadImport=M)},null,8,["value"]),u[30]||(u[30]=R("div",null,"打开快照页面自动生成分享链接(请确保不含隐私)",-1))])]),_:1},8,["show"])],64)}}});export{_o as default};
|
|
119
|
-
//# sourceMappingURL=HomePage-CT1l0ReT.js.map
|