agentroam-runtime-darwin-arm64 0.2.0-preview.39 → 0.2.0-preview.41
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/manifest.json +1 -1
- package/package.json +1 -1
- package/runtime/.next/BUILD_ID +1 -1
- package/runtime/.next/app-build-manifest.json +8 -8
- package/runtime/.next/app-path-routes-manifest.json +1 -1
- package/runtime/.next/build-manifest.json +3 -3
- package/runtime/.next/prerender-manifest.json +1 -1
- package/runtime/.next/required-server-files.json +1 -1
- package/runtime/.next/server/app/_not-found/page.js +1 -1
- package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app/_not-found.html +1 -1
- package/runtime/.next/server/app/_not-found.rsc +1 -1
- package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
- package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
- package/runtime/.next/server/app/api/agent/model/route.js +1 -1
- package/runtime/.next/server/app/api/agent/models/route.js +1 -1
- package/runtime/.next/server/app/api/agent/run/route.js +2 -2
- package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
- package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/stream/route.js +3 -3
- package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
- package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
- package/runtime/.next/server/app/api/business/route.js +1 -1
- package/runtime/.next/server/app/api/client-logs/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +2 -2
- package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
- package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
- package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
- package/runtime/.next/server/app/api/memory/route.js +1 -1
- package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
- package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/projects/check/route.js +1 -1
- package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
- package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
- package/runtime/.next/server/app/api/projects/route.js +1 -1
- package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
- package/runtime/.next/server/app/api/push/unsubscribe/route.js +2 -2
- package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
- package/runtime/.next/server/app/api/push/vapid.body +1 -1
- package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
- package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/settings/route.js +1 -1
- package/runtime/.next/server/app/api/skills/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
- package/runtime/.next/server/app/api/tools/route.js +1 -1
- package/runtime/.next/server/app/api/update/check/route.js +1 -1
- package/runtime/.next/server/app/api/update/install/route.js +1 -1
- package/runtime/.next/server/app/api/update/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
- package/runtime/.next/server/app/web/page.js +2 -2
- package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app-paths-manifest.json +28 -28
- package/runtime/.next/server/chunks/1322.js +1 -1
- package/runtime/.next/server/chunks/1773.js +1 -1
- package/runtime/.next/server/chunks/5303.js +1 -1
- package/runtime/.next/server/middleware-build-manifest.js +1 -1
- package/runtime/.next/server/pages/404.html +1 -1
- package/runtime/.next/server/pages/500.html +1 -1
- package/runtime/.next/server/server-reference-manifest.json +1 -1
- package/runtime/.next/static/chunks/app/web/{error-f69dbd3718cb2107.js → error-eea6b6c270ef86cb.js} +1 -1
- package/runtime/.next/static/chunks/app/web/layout-0991128047cc5e14.js +1 -0
- package/runtime/.next/static/chunks/app/web/{page-f9926cbf4c1badd4.js → page-d615bce909fdda0b.js} +1 -1
- package/runtime/.next/static/chunks/{main-app-d527fa0b25a0c755.js → main-app-9aaee005b4835e70.js} +1 -1
- package/runtime/server.js +1 -1
- package/runtime/webapp/dist/assets/{App-COIcZZvf.js → App-Bnv7-jUZ.js} +16 -16
- package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-d4urtMQU.js → abnfDiagram-VCTEODGH-CyHhjdFC.js} +1 -1
- package/runtime/webapp/dist/assets/{arc-DiQEpEJQ.js → arc-YykeV-yA.js} +1 -1
- package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-CWYKGqND.js → architectureDiagram-5GKGNRK7-CPXGrnO0.js} +1 -1
- package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-J2I0b5Zn.js → blockDiagram-I7D4REHJ-DY5fPlHV.js} +1 -1
- package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-C-0xWeN3.js → c4Diagram-7LVT6UL2-D9IqQaEZ.js} +1 -1
- package/runtime/webapp/dist/assets/channel-DQNFzknQ.js +1 -0
- package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-CqodmK6L.js → chunk-2Q5K7J3B-Dq03q8Ff.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-DClUnQcr.js → chunk-5VM5RSS4-V40WX1nt.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-F27PBJKO-CpaDg7Bg.js → chunk-F27PBJKO-CiCQWcQf.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-CTIf9EjK.js → chunk-IMKFNOWR-EJT0DATb.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-DKalSWMm.js → chunk-JWPE2WC7-B0T3KRl6.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-69MmeyRW.js → chunk-POPQ4Y6H-CBoqnL3A.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-SVP7TREG-DCXWXzhU.js → chunk-SVP7TREG-vc6mvklc.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-TICWLB2K-B5nbTEng.js → chunk-TICWLB2K-Co7ACWND.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-DsJvkUuN.js → chunk-XXDRQBXY-CvByXr6J.js} +1 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-DjmQeVYo.js +1 -0
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-DjmQeVYo.js +1 -0
- package/runtime/webapp/dist/assets/{codeSyntax-DJH88FPL.js → codeSyntax-CEVVRDzr.js} +1 -1
- package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-BamzQ_e_.js → cose-bilkent-JH36ORCC-B6ijVOa6.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-BI_j1tbW.js → cynefin-OW5HDTMX-DNC_aald.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-DuxMrVM2.js → cynefinDiagram-5FMLGOSQ-DMwAVRmf.js} +1 -1
- package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-Y9_ne36w.js → dagre-GXQ25YYZ-DtA0NmZw.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-DIIjO29m.js → diagram-S7CK7UJ4-B7SEmc9A.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-C4m2VMIy.js → diagram-UQ7AKVKN-CP_Xy1AP.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-Cw5aPZ0o.js → diagram-VSXAHHWV-CMq6cPW9.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VX7I27RA-W8nmVcOl.js → diagram-VX7I27RA-KIUvVPO4.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-TksnHlQo.js → diagram-Z3DM3KII-UiMEplzj.js} +1 -1
- package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-B3WM1b4a.js → ebnfDiagram-PWID7BFC-D221JIeM.js} +1 -1
- package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-BWctPuya.js → erDiagram-RLTQ6QDP-XKInLFA3.js} +1 -1
- package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-BG5RMrLN.js → flowDiagram-HODETNUW-BeT9GYtM.js} +1 -1
- package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-CPcR7Kn_.js → ganttDiagram-EL5Y4UJY-Dk8Uwf7E.js} +1 -1
- package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-Sg6KChEd.js → gitGraphDiagram-WWUBYQGX-DiVf0w01.js} +1 -1
- package/runtime/webapp/dist/assets/{index-tQnPGo1_.js → index-D1I5RKVk.js} +3 -3
- package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-BvrtvnrY.js → infoDiagram-27XIBGKW-DpVFXIO9.js} +1 -1
- package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-Bz-dZQLJ.js → ishikawaDiagram-5VMMS53U-ChWOHTzh.js} +1 -1
- package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-Cb4s9jRE.js → journeyDiagram-3NMN7TZE-CTm0xDi4.js} +1 -1
- package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-IjMPUHg9.js → kanban-definition-UXKFOSKX-zVtWbTTX.js} +1 -1
- package/runtime/webapp/dist/assets/{layout-DHjqr0PJ.js → layout-C8tlpprW.js} +1 -1
- package/runtime/webapp/dist/assets/{linear-COctZkFy.js → linear-CArf8t7h.js} +1 -1
- package/runtime/webapp/dist/assets/{mermaid.core-BnonXfHT.js → mermaid.core-BVUH1a8m.js} +5 -5
- package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-hxBlXJJE.js → mindmap-definition-YA3MSWOX-Cx7RFt-X.js} +1 -1
- package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-D6KJ8Ftm.js → pegDiagram-XKGWAZYB-BvEhVZgX.js} +1 -1
- package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-BzKWZmHN.js → pieDiagram-E7YTZNPT-U0qmhh14.js} +1 -1
- package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-ZhiPKt96.js → quadrantDiagram-AXDQQJYC-BbUHWejy.js} +1 -1
- package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-BtKhiOPG.js → railroadDiagram-O6MQD6OU-SXZBMND2.js} +1 -1
- package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-OFr_TA8V.js → requirementDiagram-BXWQKSXE-Cv9h1clg.js} +1 -1
- package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-qNTDFxAX.js → sankeyDiagram-P5KCCOFB-CSWUhEDJ.js} +1 -1
- package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-B7s5-R4s.js → sequenceDiagram-WJ2MYXX4-Cy7gfOPU.js} +1 -1
- package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-DdFabbN6.js → sizeCapture-INFHLROL-DEJ8653D.js} +1 -1
- package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-CmAN4pX7.js → stateDiagram-D77RDMKH-C9znHj1A.js} +1 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-D4PTr_9g.js +1 -0
- package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-BQlIJAhf.js → swimlanes-42K2YHIH-D-1OGDuC.js} +1 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-BnGs6oif.js +8 -0
- package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA--Y1zJ9mc.js → timeline-definition-24CTP7MA-fmk9SWID.js} +1 -1
- package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-CUn6FScx.js → vennDiagram-4TSXK5OY-CoJrdpIF.js} +1 -1
- package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-Bbz-WBd5.js → wardleyDiagram-VM6X3IG4-CQd2ig95.js} +1 -1
- package/runtime/webapp/dist/assets/{web-DzBEnE5q.js → web-CICIlrjx.js} +1 -1
- package/runtime/webapp/dist/assets/{web-harvpkJj.js → web-DdNvGACS.js} +1 -1
- package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-RA9edGdQ.js → xychartDiagram-S5SC5T6Z-Slg0Vzat.js} +1 -1
- package/runtime/webapp/dist/index.html +1 -1
- package/runtime/.next/static/chunks/app/web/layout-e0dd41d18df8ee9e.js +0 -1
- package/runtime/webapp/dist/assets/channel-B6S3kcST.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-CyUA2YaV.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-CyUA2YaV.js +0 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-DsxpCqde.js +0 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-tji3GZVz.js +0 -8
- /package/runtime/.next/static/{BmUH3xLHQfGkG3yzEK37i → rwWTikOeChITsRklIaUDw}/_buildManifest.js +0 -0
- /package/runtime/.next/static/{BmUH3xLHQfGkG3yzEK37i → rwWTikOeChITsRklIaUDw}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./App-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./App-Bnv7-jUZ.js","./App-iUeP1CBo.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const g of f.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&o(g)}).observe(document,{childList:!0,subtree:!0});function n(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(c){if(c.ep)return;c.ep=!0;const f=n(c);fetch(c.href,f)}})();const Yv="modulepreload",Kv=function(e,t){return new URL(e,t).href},Gd={},Y1=function(t,n,o){let c=Promise.resolve();if(n&&n.length>0){const g=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),v=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));c=Promise.allSettled(n.map(x=>{if(x=Kv(x,o),x in Gd)return;Gd[x]=!0;const C=x.endsWith(".css"),A=C?'[rel="stylesheet"]':"";if(o)for(let O=g.length-1;O>=0;O--){const k=g[O];if(k.href===x&&(!C||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${A}`))return;const I=document.createElement("link");if(I.rel=C?"stylesheet":Yv,C||(I.as="script"),I.crossOrigin="",I.href=x,v&&I.setAttribute("nonce",v),document.head.appendChild(I),C)return new Promise((O,k)=>{I.addEventListener("load",O),I.addEventListener("error",()=>k(Error(`Unable to preload CSS for ${x}`)))})}))}function f(g){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=g,window.dispatchEvent(m),!m.defaultPrevented)throw g}return c.then(g=>{for(const m of g||[])m.status==="rejected"&&f(m.reason);return t().catch(f)})};var dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function o2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a2={exports:{}},au={},l2={exports:{}},Ce={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -78,7 +78,7 @@ Error generating stack: `+f.message+`
|
|
|
78
78
|
`),r.append(`>>
|
|
79
79
|
`),r.toString()}setMode(r){this.mode=r}setECLevel(r){this.ecLevel=r}setVersion(r){this.version=r}setMaskPattern(r){this.maskPattern=r}setMatrix(r){this.matrix=r}static isValidMaskPattern(r){return r>=0&&r<li.NUM_MASK_PATTERNS}}li.NUM_MASK_PATTERNS=8;class Le extends x{}Le.kind="WriterException";class fe{constructor(){}static clearMatrix(r){r.clear(255)}static buildMatrix(r,i,s,a,l){fe.clearMatrix(l),fe.embedBasicPatterns(s,l),fe.embedTypeInfo(i,a,l),fe.maybeEmbedVersionInfo(s,l),fe.embedDataBits(r,a,l)}static embedBasicPatterns(r,i){fe.embedPositionDetectionPatternsAndSeparators(i),fe.embedDarkDotAtLeftBottomCorner(i),fe.maybeEmbedPositionAdjustmentPatterns(r,i),fe.embedTimingPatterns(i)}static embedTypeInfo(r,i,s){const a=new U;fe.makeTypeInfoBits(r,i,a);for(let l=0,u=a.getSize();l<u;++l){const d=a.get(a.getSize()-1-l),h=fe.TYPE_INFO_COORDINATES[l],p=h[0],w=h[1];if(s.setBoolean(p,w,d),l<8){const E=s.getWidth()-l-1;s.setBoolean(E,8,d)}else{const S=s.getHeight()-7+(l-8);s.setBoolean(8,S,d)}}}static maybeEmbedVersionInfo(r,i){if(r.getVersionNumber()<7)return;const s=new U;fe.makeVersionInfoBits(r,s);let a=6*3-1;for(let l=0;l<6;++l)for(let u=0;u<3;++u){const d=s.get(a);a--,i.setBoolean(l,i.getHeight()-11+u,d),i.setBoolean(i.getHeight()-11+u,l,d)}}static embedDataBits(r,i,s){let a=0,l=-1,u=s.getWidth()-1,d=s.getHeight()-1;for(;u>0;){for(u===6&&(u-=1);d>=0&&d<s.getHeight();){for(let h=0;h<2;++h){const p=u-h;if(!fe.isEmpty(s.get(p,d)))continue;let w;a<r.getSize()?(w=r.get(a),++a):w=!1,i!==255&&it.getDataMaskBit(i,p,d)&&(w=!w),s.setBoolean(p,d,w)}d+=l}l=-l,d+=l,u-=2}if(a!==r.getSize())throw new Le("Not all bits consumed: "+a+"/"+r.getSize())}static findMSBSet(r){return 32-_.numberOfLeadingZeros(r)}static calculateBCHCode(r,i){if(i===0)throw new A("0 polynomial");const s=fe.findMSBSet(i);for(r<<=s-1;fe.findMSBSet(r)>=s;)r^=i<<fe.findMSBSet(r)-s;return r}static makeTypeInfoBits(r,i,s){if(!li.isValidMaskPattern(i))throw new Le("Invalid mask pattern");const a=r.getBits()<<3|i;s.appendBits(a,5);const l=fe.calculateBCHCode(a,fe.TYPE_INFO_POLY);s.appendBits(l,10);const u=new U;if(u.appendBits(fe.TYPE_INFO_MASK_PATTERN,15),s.xor(u),s.getSize()!==15)throw new Le("should not happen but we got: "+s.getSize())}static makeVersionInfoBits(r,i){i.appendBits(r.getVersionNumber(),6);const s=fe.calculateBCHCode(r.getVersionNumber(),fe.VERSION_INFO_POLY);if(i.appendBits(s,12),i.getSize()!==18)throw new Le("should not happen but we got: "+i.getSize())}static isEmpty(r){return r===255}static embedTimingPatterns(r){for(let i=8;i<r.getWidth()-8;++i){const s=(i+1)%2;fe.isEmpty(r.get(i,6))&&r.setNumber(i,6,s),fe.isEmpty(r.get(6,i))&&r.setNumber(6,i,s)}}static embedDarkDotAtLeftBottomCorner(r){if(r.get(8,r.getHeight()-8)===0)throw new Le;r.setNumber(8,r.getHeight()-8,1)}static embedHorizontalSeparationPattern(r,i,s){for(let a=0;a<8;++a){if(!fe.isEmpty(s.get(r+a,i)))throw new Le;s.setNumber(r+a,i,0)}}static embedVerticalSeparationPattern(r,i,s){for(let a=0;a<7;++a){if(!fe.isEmpty(s.get(r,i+a)))throw new Le;s.setNumber(r,i+a,0)}}static embedPositionAdjustmentPattern(r,i,s){for(let a=0;a<5;++a){const l=fe.POSITION_ADJUSTMENT_PATTERN[a];for(let u=0;u<5;++u)s.setNumber(r+u,i+a,l[u])}}static embedPositionDetectionPattern(r,i,s){for(let a=0;a<7;++a){const l=fe.POSITION_DETECTION_PATTERN[a];for(let u=0;u<7;++u)s.setNumber(r+u,i+a,l[u])}}static embedPositionDetectionPatternsAndSeparators(r){const i=fe.POSITION_DETECTION_PATTERN[0].length;fe.embedPositionDetectionPattern(0,0,r),fe.embedPositionDetectionPattern(r.getWidth()-i,0,r),fe.embedPositionDetectionPattern(0,r.getWidth()-i,r);const s=8;fe.embedHorizontalSeparationPattern(0,s-1,r),fe.embedHorizontalSeparationPattern(r.getWidth()-s,s-1,r),fe.embedHorizontalSeparationPattern(0,r.getWidth()-s,r);const a=7;fe.embedVerticalSeparationPattern(a,0,r),fe.embedVerticalSeparationPattern(r.getHeight()-a-1,0,r),fe.embedVerticalSeparationPattern(a,r.getHeight()-a,r)}static maybeEmbedPositionAdjustmentPatterns(r,i){if(r.getVersionNumber()<2)return;const s=r.getVersionNumber()-1,a=fe.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[s];for(let l=0,u=a.length;l!==u;l++){const d=a[l];if(d>=0)for(let h=0;h!==u;h++){const p=a[h];p>=0&&fe.isEmpty(i.get(p,d))&&fe.embedPositionAdjustmentPattern(p-2,d-2,i)}}}}fe.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),fe.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),fe.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),fe.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),fe.VERSION_INFO_POLY=7973,fe.TYPE_INFO_POLY=1335,fe.TYPE_INFO_MASK_PATTERN=21522;class Fv{constructor(r,i){this.dataBytes=r,this.errorCorrectionBytes=i}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class $e{constructor(){}static calculateMaskPenalty(r){return it.applyMaskPenaltyRule1(r)+it.applyMaskPenaltyRule2(r)+it.applyMaskPenaltyRule3(r)+it.applyMaskPenaltyRule4(r)}static encode(r,i,s=null){let a=$e.DEFAULT_BYTE_MODE_ENCODING;const l=s!==null&&s.get(mt.CHARACTER_SET)!==void 0;l&&(a=s.get(mt.CHARACTER_SET).toString());const u=this.chooseMode(r,a),d=new U;if(u===ce.BYTE&&(l||$e.DEFAULT_BYTE_MODE_ENCODING!==a)){const q=V.getCharacterSetECIByName(a);q!==void 0&&this.appendECI(q,d)}this.appendModeInfo(u,d);const h=new U;this.appendBytes(r,u,h,a);let p;if(s!==null&&s.get(mt.QR_VERSION)!==void 0){const q=Number.parseInt(s.get(mt.QR_VERSION).toString(),10);p=ue.getVersionForNumber(q);const K=this.calculateBitsNeeded(u,d,h,p);if(!this.willFit(K,p,i))throw new Le("Data too big for requested version")}else p=this.recommendVersion(i,u,d,h);const w=new U;w.appendBitArray(d);const E=u===ce.BYTE?h.getSizeInBytes():r.length;this.appendLengthInfo(E,p,u,w),w.appendBitArray(h);const S=p.getECBlocksForLevel(i),b=p.getTotalCodewords()-S.getTotalECCodewords();this.terminateBits(b,w);const D=this.interleaveWithECBytes(w,p.getTotalCodewords(),b,S.getNumBlocks()),P=new li;P.setECLevel(i),P.setMode(u),P.setVersion(p);const L=p.getDimensionForVersion(),$=new xa(L,L),Q=this.chooseMaskPattern(D,i,p,$);return P.setMaskPattern(Q),fe.buildMatrix(D,i,p,Q,$),P.setMatrix($),P}static recommendVersion(r,i,s,a){const l=this.calculateBitsNeeded(i,s,a,ue.getVersionForNumber(1)),u=this.chooseVersion(l,r),d=this.calculateBitsNeeded(i,s,a,u);return this.chooseVersion(d,r)}static calculateBitsNeeded(r,i,s,a){return i.getSize()+r.getCharacterCountBits(a)+s.getSize()}static getAlphanumericCode(r){return r<$e.ALPHANUMERIC_TABLE.length?$e.ALPHANUMERIC_TABLE[r]:-1}static chooseMode(r,i=null){if(V.SJIS.getName()===i&&this.isOnlyDoubleByteKanji(r))return ce.KANJI;let s=!1,a=!1;for(let l=0,u=r.length;l<u;++l){const d=r.charAt(l);if($e.isDigit(d))s=!0;else if(this.getAlphanumericCode(d.charCodeAt(0))!==-1)a=!0;else return ce.BYTE}return a?ce.ALPHANUMERIC:s?ce.NUMERIC:ce.BYTE}static isOnlyDoubleByteKanji(r){let i;try{i=ye.encode(r,V.SJIS)}catch{return!1}const s=i.length;if(s%2!==0)return!1;for(let a=0;a<s;a+=2){const l=i[a]&255;if((l<129||l>159)&&(l<224||l>235))return!1}return!0}static chooseMaskPattern(r,i,s,a){let l=Number.MAX_SAFE_INTEGER,u=-1;for(let d=0;d<li.NUM_MASK_PATTERNS;d++){fe.buildMatrix(r,i,s,d,a);let h=this.calculateMaskPenalty(a);h<l&&(l=h,u=d)}return u}static chooseVersion(r,i){for(let s=1;s<=40;s++){const a=ue.getVersionForNumber(s);if($e.willFit(r,a,i))return a}throw new Le("Data too big")}static willFit(r,i,s){const a=i.getTotalCodewords(),u=i.getECBlocksForLevel(s).getTotalECCodewords(),d=a-u,h=(r+7)/8;return d>=h}static terminateBits(r,i){const s=r*8;if(i.getSize()>s)throw new Le("data bits cannot fit in the QR Code"+i.getSize()+" > "+s);for(let u=0;u<4&&i.getSize()<s;++u)i.appendBit(!1);const a=i.getSize()&7;if(a>0)for(let u=a;u<8;u++)i.appendBit(!1);const l=r-i.getSizeInBytes();for(let u=0;u<l;++u)i.appendBits(u&1?17:236,8);if(i.getSize()!==s)throw new Le("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(r,i,s,a,l,u){if(a>=s)throw new Le("Block ID too large");const d=r%s,h=s-d,p=Math.floor(r/s),w=p+1,E=Math.floor(i/s),S=E+1,b=p-E,D=w-S;if(b!==D)throw new Le("EC bytes mismatch");if(s!==h+d)throw new Le("RS blocks mismatch");if(r!==(E+b)*h+(S+D)*d)throw new Le("Total bytes mismatch");a<h?(l[0]=E,u[0]=b):(l[0]=S,u[0]=D)}static interleaveWithECBytes(r,i,s,a){if(r.getSizeInBytes()!==s)throw new Le("Number of bits and data bytes does not match");let l=0,u=0,d=0;const h=new Array;for(let w=0;w<a;++w){const E=new Int32Array(1),S=new Int32Array(1);$e.getNumDataBytesAndNumECBytesForBlockID(i,s,a,w,E,S);const b=E[0],D=new Uint8Array(b);r.toBytes(8*l,D,0,b);const P=$e.generateECBytes(D,S[0]);h.push(new Fv(D,P)),u=Math.max(u,b),d=Math.max(d,P.length),l+=E[0]}if(s!==l)throw new Le("Data bytes does not match offset");const p=new U;for(let w=0;w<u;++w)for(const E of h){const S=E.getDataBytes();w<S.length&&p.appendBits(S[w],8)}for(let w=0;w<d;++w)for(const E of h){const S=E.getErrorCorrectionBytes();w<S.length&&p.appendBits(S[w],8)}if(i!==p.getSizeInBytes())throw new Le("Interleaving error: "+i+" and "+p.getSizeInBytes()+" differ.");return p}static generateECBytes(r,i){const s=r.length,a=new Int32Array(s+i);for(let u=0;u<s;u++)a[u]=r[u]&255;new tc(Oe.QR_CODE_FIELD_256).encode(a,i);const l=new Uint8Array(i);for(let u=0;u<i;u++)l[u]=a[s+u];return l}static appendModeInfo(r,i){i.appendBits(r.getBits(),4)}static appendLengthInfo(r,i,s,a){const l=s.getCharacterCountBits(i);if(r>=1<<l)throw new Le(r+" is bigger than "+((1<<l)-1));a.appendBits(r,l)}static appendBytes(r,i,s,a){switch(i){case ce.NUMERIC:$e.appendNumericBytes(r,s);break;case ce.ALPHANUMERIC:$e.appendAlphanumericBytes(r,s);break;case ce.BYTE:$e.append8BitBytes(r,s,a);break;case ce.KANJI:$e.appendKanjiBytes(r,s);break;default:throw new Le("Invalid mode: "+i)}}static getDigit(r){return r.charCodeAt(0)-48}static isDigit(r){const i=$e.getDigit(r);return i>=0&&i<=9}static appendNumericBytes(r,i){const s=r.length;let a=0;for(;a<s;){const l=$e.getDigit(r.charAt(a));if(a+2<s){const u=$e.getDigit(r.charAt(a+1)),d=$e.getDigit(r.charAt(a+2));i.appendBits(l*100+u*10+d,10),a+=3}else if(a+1<s){const u=$e.getDigit(r.charAt(a+1));i.appendBits(l*10+u,7),a+=2}else i.appendBits(l,4),a++}}static appendAlphanumericBytes(r,i){const s=r.length;let a=0;for(;a<s;){const l=$e.getAlphanumericCode(r.charCodeAt(a));if(l===-1)throw new Le;if(a+1<s){const u=$e.getAlphanumericCode(r.charCodeAt(a+1));if(u===-1)throw new Le;i.appendBits(l*45+u,11),a+=2}else i.appendBits(l,6),a++}}static append8BitBytes(r,i,s){let a;try{a=ye.encode(r,s)}catch(l){throw new Le(l)}for(let l=0,u=a.length;l!==u;l++){const d=a[l];i.appendBits(d,8)}}static appendKanjiBytes(r,i){let s;try{s=ye.encode(r,V.SJIS)}catch(l){throw new Le(l)}const a=s.length;for(let l=0;l<a;l+=2){const u=s[l]&255,d=s[l+1]&255,h=u<<8&4294967295|d;let p=-1;if(h>=33088&&h<=40956?p=h-33088:h>=57408&&h<=60351&&(p=h-49472),p===-1)throw new Le("Invalid byte sequence");const w=(p>>8)*192+(p&255);i.appendBits(w,13)}}static appendECI(r,i){i.appendBits(ce.ECI.getBits(),4),i.appendBits(r.getValue(),8)}}$e.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),$e.DEFAULT_BYTE_MODE_ENCODING=V.UTF8.getName();class ui{write(r,i,s,a=null){if(r.length===0)throw new A("Found empty contents");if(i<0||s<0)throw new A("Requested dimensions are too small: "+i+"x"+s);let l=je.L,u=ui.QUIET_ZONE_SIZE;a!==null&&(a.get(mt.ERROR_CORRECTION)!==void 0&&(l=je.fromString(a.get(mt.ERROR_CORRECTION).toString())),a.get(mt.MARGIN)!==void 0&&(u=Number.parseInt(a.get(mt.MARGIN).toString(),10)));const d=$e.encode(r,l,a);return this.renderResult(d,i,s,u)}writeToDom(r,i,s,a,l=null){typeof r=="string"&&(r=document.querySelector(r));const u=this.write(i,s,a,l);r&&r.appendChild(u)}renderResult(r,i,s,a){const l=r.getMatrix();if(l===null)throw new Hr;const u=l.getWidth(),d=l.getHeight(),h=u+a*2,p=d+a*2,w=Math.max(i,h),E=Math.max(s,p),S=Math.min(Math.floor(w/h),Math.floor(E/p)),b=Math.floor((w-u*S)/2),D=Math.floor((E-d*S)/2),P=this.createSVGElement(w,E);for(let L=0,$=D;L<d;L++,$+=S)for(let Q=0,q=b;Q<u;Q++,q+=S)if(l.get(Q,L)===1){const K=this.createSvgRectElement(q,$,S,S);P.appendChild(K)}return P}createSVGElement(r,i){const s=document.createElementNS(ui.SVG_NS,"svg");return s.setAttributeNS(null,"height",r.toString()),s.setAttributeNS(null,"width",i.toString()),s}createSvgRectElement(r,i,s,a){const l=document.createElementNS(ui.SVG_NS,"rect");return l.setAttributeNS(null,"x",r.toString()),l.setAttributeNS(null,"y",i.toString()),l.setAttributeNS(null,"height",s.toString()),l.setAttributeNS(null,"width",a.toString()),l.setAttributeNS(null,"fill","#000000"),l}}ui.QUIET_ZONE_SIZE=4,ui.SVG_NS="http://www.w3.org/2000/svg";class Li{encode(r,i,s,a,l){if(r.length===0)throw new A("Found empty contents");if(i!==le.QR_CODE)throw new A("Can only encode QR_CODE, but got "+i);if(s<0||a<0)throw new A(`Requested dimensions are too small: ${s}x${a}`);let u=je.L,d=Li.QUIET_ZONE_SIZE;l!==null&&(l.get(mt.ERROR_CORRECTION)!==void 0&&(u=je.fromString(l.get(mt.ERROR_CORRECTION).toString())),l.get(mt.MARGIN)!==void 0&&(d=Number.parseInt(l.get(mt.MARGIN).toString(),10)));const h=$e.encode(r,u,l);return Li.renderResult(h,s,a,d)}static renderResult(r,i,s,a){const l=r.getMatrix();if(l===null)throw new Hr;const u=l.getWidth(),d=l.getHeight(),h=u+a*2,p=d+a*2,w=Math.max(i,h),E=Math.max(s,p),S=Math.min(Math.floor(w/h),Math.floor(E/p)),b=Math.floor((w-u*S)/2),D=Math.floor((E-d*S)/2),P=new Te(w,E);for(let L=0,$=D;L<d;L++,$+=S)for(let Q=0,q=b;Q<u;Q++,q+=S)l.get(Q,L)===1&&P.setRegion(q,$,S,S);return P}}Li.QUIET_ZONE_SIZE=4;class Uv{encode(r,i,s,a,l){let u;switch(i){case le.QR_CODE:u=new Li;break;default:throw new A("No encoder available for format "+i)}return u.encode(r,i,s,a,l)}}class Kr extends te{constructor(r,i,s,a,l,u,d,h){if(super(u,d),this.yuvData=r,this.dataWidth=i,this.dataHeight=s,this.left=a,this.top=l,a+u>i||l+d>s)throw new A("Crop rectangle does not fit within image data.");h&&this.reverseHorizontal(u,d)}getRow(r,i){if(r<0||r>=this.getHeight())throw new A("Requested row is outside the image: "+r);const s=this.getWidth();(i==null||i.length<s)&&(i=new Uint8ClampedArray(s));const a=(r+this.top)*this.dataWidth+this.left;return M.arraycopy(this.yuvData,a,i,0,s),i}getMatrix(){const r=this.getWidth(),i=this.getHeight();if(r===this.dataWidth&&i===this.dataHeight)return this.yuvData;const s=r*i,a=new Uint8ClampedArray(s);let l=this.top*this.dataWidth+this.left;if(r===this.dataWidth)return M.arraycopy(this.yuvData,l,a,0,s),a;for(let u=0;u<i;u++){const d=u*r;M.arraycopy(this.yuvData,l,a,d,r),l+=this.dataWidth}return a}isCropSupported(){return!0}crop(r,i,s,a){return new Kr(this.yuvData,this.dataWidth,this.dataHeight,this.left+r,this.top+i,s,a,!1)}renderThumbnail(){const r=this.getWidth()/Kr.THUMBNAIL_SCALE_FACTOR,i=this.getHeight()/Kr.THUMBNAIL_SCALE_FACTOR,s=new Int32Array(r*i),a=this.yuvData;let l=this.top*this.dataWidth+this.left;for(let u=0;u<i;u++){const d=u*r;for(let h=0;h<r;h++){const p=a[l+h*Kr.THUMBNAIL_SCALE_FACTOR]&255;s[d+h]=4278190080|p*65793}l+=this.dataWidth*Kr.THUMBNAIL_SCALE_FACTOR}return s}getThumbnailWidth(){return this.getWidth()/Kr.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/Kr.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(r,i){const s=this.yuvData;for(let a=0,l=this.top*this.dataWidth+this.left;a<i;a++,l+=this.dataWidth){const u=l+r/2;for(let d=l,h=l+r-1;d<u;d++,h--){const p=s[d];s[d]=s[h],s[h]=p}}}invert(){return new de(this)}}Kr.THUMBNAIL_SCALE_FACTOR=2;class rc extends te{constructor(r,i,s,a,l,u,d){if(super(i,s),this.dataWidth=a,this.dataHeight=l,this.left=u,this.top=d,r.BYTES_PER_ELEMENT===4){const h=i*s,p=new Uint8ClampedArray(h);for(let w=0;w<h;w++){const E=r[w],S=E>>16&255,b=E>>7&510,D=E&255;p[w]=(S+b+D)/4&255}this.luminances=p}else this.luminances=r;if(a===void 0&&(this.dataWidth=i),l===void 0&&(this.dataHeight=s),u===void 0&&(this.left=0),d===void 0&&(this.top=0),this.left+i>this.dataWidth||this.top+s>this.dataHeight)throw new A("Crop rectangle does not fit within image data.")}getRow(r,i){if(r<0||r>=this.getHeight())throw new A("Requested row is outside the image: "+r);const s=this.getWidth();(i==null||i.length<s)&&(i=new Uint8ClampedArray(s));const a=(r+this.top)*this.dataWidth+this.left;return M.arraycopy(this.luminances,a,i,0,s),i}getMatrix(){const r=this.getWidth(),i=this.getHeight();if(r===this.dataWidth&&i===this.dataHeight)return this.luminances;const s=r*i,a=new Uint8ClampedArray(s);let l=this.top*this.dataWidth+this.left;if(r===this.dataWidth)return M.arraycopy(this.luminances,l,a,0,s),a;for(let u=0;u<i;u++){const d=u*r;M.arraycopy(this.luminances,l,a,d,r),l+=this.dataWidth}return a}isCropSupported(){return!0}crop(r,i,s,a){return new rc(this.luminances,s,a,this.dataWidth,this.dataHeight,this.left+r,this.top+i)}invert(){return new de(this)}}class Wd extends V{static forName(r){return this.getCharacterSetECIByName(r)}}class nc{}nc.ISO_8859_1=V.ISO8859_1;class $d{isCompact(){return this.compact}setCompact(r){this.compact=r}getSize(){return this.size}setSize(r){this.size=r}getLayers(){return this.layers}setLayers(r){this.layers=r}getCodeWords(){return this.codeWords}setCodeWords(r){this.codeWords=r}getMatrix(){return this.matrix}setMatrix(r){this.matrix=r}}class Vd{static singletonList(r){return[r]}static min(r,i){return r.sort(i)[0]}}class jv{constructor(r){this.previous=r}getPrevious(){return this.previous}}class Fi extends jv{constructor(r,i,s){super(r),this.value=i,this.bitCount=s}appendTo(r,i){r.appendBits(this.value,this.bitCount)}add(r,i){return new Fi(this,r,i)}addBinaryShift(r,i){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new Fi(this,r,i)}toString(){let r=this.value&(1<<this.bitCount)-1;return r|=1<<this.bitCount,"<"+_.toBinaryString(r|1<<this.bitCount).substring(1)+">"}}class ic extends Fi{constructor(r,i,s){super(r,0,0),this.binaryShiftStart=i,this.binaryShiftByteCount=s}appendTo(r,i){for(let s=0;s<this.binaryShiftByteCount;s++)(s===0||s===31&&this.binaryShiftByteCount<=62)&&(r.appendBits(31,5),this.binaryShiftByteCount>62?r.appendBits(this.binaryShiftByteCount-31,16):s===0?r.appendBits(Math.min(this.binaryShiftByteCount,31),5):r.appendBits(this.binaryShiftByteCount-31,5)),r.appendBits(i[this.binaryShiftStart+s],8)}addBinaryShift(r,i){return new ic(this,r,i)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function Wv(y,r,i){return new ic(y,r,i)}function $s(y,r,i){return new Fi(y,r,i)}const $v=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Dn=0,ma=1,Sr=2,zd=3,Zr=4,Vv=new Fi(null,0,0),sc=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function zv(y){for(let r of y)T.fill(r,-1);return y[Dn][Zr]=0,y[ma][Zr]=0,y[ma][Dn]=28,y[zd][Zr]=0,y[Sr][Zr]=0,y[Sr][Dn]=15,y}const Hd=zv(T.createInt32Array(6,6));class Qr{constructor(r,i,s,a){this.token=r,this.mode=i,this.binaryShiftByteCount=s,this.bitCount=a}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(r,i){let s=this.bitCount,a=this.token;if(r!==this.mode){let u=sc[this.mode][r];a=$s(a,u&65535,u>>16),s+=u>>16}let l=r===Sr?4:5;return a=$s(a,i,l),new Qr(a,r,0,s+l)}shiftAndAppend(r,i){let s=this.token,a=this.mode===Sr?4:5;return s=$s(s,Hd[this.mode][r],a),s=$s(s,i,5),new Qr(s,this.mode,0,this.bitCount+a+5)}addBinaryShiftChar(r){let i=this.token,s=this.mode,a=this.bitCount;if(this.mode===Zr||this.mode===Sr){let d=sc[s][Dn];i=$s(i,d&65535,d>>16),a+=d>>16,s=Dn}let l=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,u=new Qr(i,s,this.binaryShiftByteCount+1,a+l);return u.binaryShiftByteCount===2078&&(u=u.endBinaryShift(r+1)),u}endBinaryShift(r){if(this.binaryShiftByteCount===0)return this;let i=this.token;return i=Wv(i,r-this.binaryShiftByteCount,this.binaryShiftByteCount),new Qr(i,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(r){let i=this.bitCount+(sc[this.mode][r.mode]>>16);return this.binaryShiftByteCount<r.binaryShiftByteCount?i+=Qr.calculateBinaryShiftCost(r)-Qr.calculateBinaryShiftCost(this):this.binaryShiftByteCount>r.binaryShiftByteCount&&r.binaryShiftByteCount>0&&(i+=10),i<=r.bitCount}toBitArray(r){let i=[];for(let a=this.endBinaryShift(r.length).token;a!==null;a=a.getPrevious())i.unshift(a);let s=new U;for(const a of i)a.appendTo(s,r);return s}toString(){return se.format("%s bits=%d bytes=%d",$v[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(r){return r.binaryShiftByteCount>62?21:r.binaryShiftByteCount>31?20:r.binaryShiftByteCount>0?10:0}}Qr.INITIAL_STATE=new Qr(Vv,Dn,0,0);function Hv(y){const r=se.getCharCode(" "),i=se.getCharCode("."),s=se.getCharCode(",");y[Dn][r]=1;const a=se.getCharCode("Z"),l=se.getCharCode("A");for(let S=l;S<=a;S++)y[Dn][S]=S-l+2;y[ma][r]=1;const u=se.getCharCode("z"),d=se.getCharCode("a");for(let S=d;S<=u;S++)y[ma][S]=S-d+2;y[Sr][r]=1;const h=se.getCharCode("9"),p=se.getCharCode("0");for(let S=p;S<=h;S++)y[Sr][S]=S-p+2;y[Sr][s]=12,y[Sr][i]=13;const w=["\0"," ","","","","","","","\x07","\b"," ",`
|
|
80
80
|
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let S=0;S<w.length;S++)y[zd][se.getCharCode(w[S])]=S;const E=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let S=0;S<E.length;S++)se.getCharCode(E[S])>0&&(y[Zr][se.getCharCode(E[S])]=S);return y}const oc=Hv(T.createInt32Array(5,256));class Vs{constructor(r){this.text=r}encode(){const r=se.getCharCode(" "),i=se.getCharCode(`
|
|
81
|
-
`);let s=Vd.singletonList(Qr.INITIAL_STATE);for(let l=0;l<this.text.length;l++){let u,d=l+1<this.text.length?this.text[l+1]:0;switch(this.text[l]){case se.getCharCode("\r"):u=d===i?2:0;break;case se.getCharCode("."):u=d===r?3:0;break;case se.getCharCode(","):u=d===r?4:0;break;case se.getCharCode(":"):u=d===r?5:0;break;default:u=0}u>0?(s=Vs.updateStateListForPair(s,l,u),l++):s=this.updateStateListForChar(s,l)}return Vd.min(s,(l,u)=>l.getBitCount()-u.getBitCount()).toBitArray(this.text)}updateStateListForChar(r,i){const s=[];for(let a of r)this.updateStateForChar(a,i,s);return Vs.simplifyStates(s)}updateStateForChar(r,i,s){let a=this.text[i]&255,l=oc[r.getMode()][a]>0,u=null;for(let d=0;d<=Zr;d++){let h=oc[d][a];if(h>0){if(u==null&&(u=r.endBinaryShift(i)),!l||d===r.getMode()||d===Sr){const p=u.latchAndAppend(d,h);s.push(p)}if(!l&&Hd[r.getMode()][d]>=0){const p=u.shiftAndAppend(d,h);s.push(p)}}}if(r.getBinaryShiftByteCount()>0||oc[r.getMode()][a]===0){let d=r.addBinaryShiftChar(i);s.push(d)}}static updateStateListForPair(r,i,s){const a=[];for(let l of r)this.updateStateForPair(l,i,s,a);return this.simplifyStates(a)}static updateStateForPair(r,i,s,a){let l=r.endBinaryShift(i);if(a.push(l.latchAndAppend(Zr,s)),r.getMode()!==Zr&&a.push(l.shiftAndAppend(Zr,s)),s===3||s===4){let u=l.latchAndAppend(Sr,16-s).latchAndAppend(Sr,1);a.push(u)}if(r.getBinaryShiftByteCount()>0){let u=r.addBinaryShiftChar(i).addBinaryShiftChar(i+1);a.push(u)}}static simplifyStates(r){let i=[];for(const s of r){let a=!0;for(const l of i){if(l.isBetterThanOrEqualTo(s)){a=!1;break}s.isBetterThanOrEqualTo(l)&&(i=i.filter(u=>u!==l))}a&&i.push(s)}return i}}class be{constructor(){}static encodeBytes(r){return be.encode(r,be.DEFAULT_EC_PERCENT,be.DEFAULT_AZTEC_LAYERS)}static encode(r,i,s){let a=new Vs(r).encode(),l=_.truncDivision(a.getSize()*i,100)+11,u=a.getSize()+l,d,h,p,w,E;if(s!==be.DEFAULT_AZTEC_LAYERS){if(d=s<0,h=Math.abs(s),h>(d?be.MAX_NB_BITS_COMPACT:be.MAX_NB_BITS))throw new A(se.format("Illegal value %s for layers",s));p=be.totalBitsInLayer(h,d),w=be.WORD_SIZE[h];let K=p-p%w;if(E=be.stuffBits(a,w),E.getSize()+l>K)throw new A("Data to large for user specified layer");if(d&&E.getSize()>w*64)throw new A("Data to large for user specified layer")}else{w=0,E=null;for(let K=0;;K++){if(K>be.MAX_NB_BITS)throw new A("Data too large for an Aztec code");if(d=K<=3,h=d?K+1:K,p=be.totalBitsInLayer(h,d),u>p)continue;(E==null||w!==be.WORD_SIZE[h])&&(w=be.WORD_SIZE[h],E=be.stuffBits(a,w));let Ae=p-p%w;if(!(d&&E.getSize()>w*64)&&E.getSize()+l<=Ae)break}}let S=be.generateCheckWords(E,p,w),b=E.getSize()/w,D=be.generateModeMessage(d,h,b),P=(d?11:14)+h*4,L=new Int32Array(P),$;if(d){$=P;for(let K=0;K<L.length;K++)L[K]=K}else{$=P+1+2*_.truncDivision(_.truncDivision(P,2)-1,15);let K=_.truncDivision(P,2),Ae=_.truncDivision($,2);for(let me=0;me<K;me++){let er=me+_.truncDivision(me,15);L[K-me-1]=Ae-er-1,L[K+me]=Ae+er+1}}let Q=new Te($);for(let K=0,Ae=0;K<h;K++){let me=(h-K)*4+(d?9:12);for(let er=0;er<me;er++){let Mr=er*2;for(let tr=0;tr<2;tr++)S.get(Ae+Mr+tr)&&Q.set(L[K*2+tr],L[K*2+er]),S.get(Ae+me*2+Mr+tr)&&Q.set(L[K*2+er],L[P-1-K*2-tr]),S.get(Ae+me*4+Mr+tr)&&Q.set(L[P-1-K*2-tr],L[P-1-K*2-er]),S.get(Ae+me*6+Mr+tr)&&Q.set(L[P-1-K*2-er],L[K*2+tr])}Ae+=me*8}if(be.drawModeMessage(Q,d,$,D),d)be.drawBullsEye(Q,_.truncDivision($,2),5);else{be.drawBullsEye(Q,_.truncDivision($,2),7);for(let K=0,Ae=0;K<_.truncDivision(P,2)-1;K+=15,Ae+=16)for(let me=_.truncDivision($,2)&1;me<$;me+=2)Q.set(_.truncDivision($,2)-Ae,me),Q.set(_.truncDivision($,2)+Ae,me),Q.set(me,_.truncDivision($,2)-Ae),Q.set(me,_.truncDivision($,2)+Ae)}let q=new $d;return q.setCompact(d),q.setSize($),q.setLayers(h),q.setCodeWords(b),q.setMatrix(Q),q}static drawBullsEye(r,i,s){for(let a=0;a<s;a+=2)for(let l=i-a;l<=i+a;l++)r.set(l,i-a),r.set(l,i+a),r.set(i-a,l),r.set(i+a,l);r.set(i-s,i-s),r.set(i-s+1,i-s),r.set(i-s,i-s+1),r.set(i+s,i-s),r.set(i+s,i-s+1),r.set(i+s,i+s-1)}static generateModeMessage(r,i,s){let a=new U;return r?(a.appendBits(i-1,2),a.appendBits(s-1,6),a=be.generateCheckWords(a,28,4)):(a.appendBits(i-1,5),a.appendBits(s-1,11),a=be.generateCheckWords(a,40,4)),a}static drawModeMessage(r,i,s,a){let l=_.truncDivision(s,2);if(i)for(let u=0;u<7;u++){let d=l-3+u;a.get(u)&&r.set(d,l-5),a.get(u+7)&&r.set(l+5,d),a.get(20-u)&&r.set(d,l+5),a.get(27-u)&&r.set(l-5,d)}else for(let u=0;u<10;u++){let d=l-5+u+_.truncDivision(u,5);a.get(u)&&r.set(d,l-7),a.get(u+10)&&r.set(l+7,d),a.get(29-u)&&r.set(d,l+7),a.get(39-u)&&r.set(l-7,d)}}static generateCheckWords(r,i,s){let a=r.getSize()/s,l=new tc(be.getGF(s)),u=_.truncDivision(i,s),d=be.bitsToWords(r,s,u);l.encode(d,u-a);let h=i%s,p=new U;p.appendBits(0,h);for(const w of Array.from(d))p.appendBits(w,s);return p}static bitsToWords(r,i,s){let a=new Int32Array(s),l,u;for(l=0,u=r.getSize()/i;l<u;l++){let d=0;for(let h=0;h<i;h++)d|=r.get(l*i+h)?1<<i-h-1:0;a[l]=d}return a}static getGF(r){switch(r){case 4:return Oe.AZTEC_PARAM;case 6:return Oe.AZTEC_DATA_6;case 8:return Oe.AZTEC_DATA_8;case 10:return Oe.AZTEC_DATA_10;case 12:return Oe.AZTEC_DATA_12;default:throw new A("Unsupported word size "+r)}}static stuffBits(r,i){let s=new U,a=r.getSize(),l=(1<<i)-2;for(let u=0;u<a;u+=i){let d=0;for(let h=0;h<i;h++)(u+h>=a||r.get(u+h))&&(d|=1<<i-1-h);(d&l)===l?(s.appendBits(d&l,i),u--):d&l?s.appendBits(d,i):(s.appendBits(d|1,i),u--)}return s}static totalBitsInLayer(r,i){return((i?88:112)+16*r)*r}}be.DEFAULT_EC_PERCENT=33,be.DEFAULT_AZTEC_LAYERS=0,be.MAX_NB_BITS=32,be.MAX_NB_BITS_COMPACT=4,be.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class wa{encode(r,i,s,a){return this.encodeWithHints(r,i,s,a,null)}encodeWithHints(r,i,s,a,l){let u=nc.ISO_8859_1,d=be.DEFAULT_EC_PERCENT,h=be.DEFAULT_AZTEC_LAYERS;return l!=null&&(l.has(mt.CHARACTER_SET)&&(u=Wd.forName(l.get(mt.CHARACTER_SET).toString())),l.has(mt.ERROR_CORRECTION)&&(d=_.parseInt(l.get(mt.ERROR_CORRECTION).toString())),l.has(mt.AZTEC_LAYERS)&&(h=_.parseInt(l.get(mt.AZTEC_LAYERS).toString()))),wa.encodeLayers(r,i,s,a,u,d,h)}static encodeLayers(r,i,s,a,l,u,d){if(i!==le.AZTEC)throw new A("Can only encode AZTEC, but got "+i);let h=be.encode(se.getBytes(r,l),u,d);return wa.renderResult(h,s,a)}static renderResult(r,i,s){let a=r.getMatrix();if(a==null)throw new Hr;let l=a.getWidth(),u=a.getHeight(),d=Math.max(i,l),h=Math.max(s,u),p=Math.min(d/l,h/u),w=(d-l*p)/2,E=(h-u*p)/2,S=new Te(d,h);for(let b=0,D=E;b<u;b++,D+=p)for(let P=0,L=w;P<l;P++,L+=p)a.get(P,b)&&S.setRegion(L,D,p,p);return S}}n.AbstractExpandedDecoder=Hu,n.ArgumentException=C,n.ArithmeticException=oa,n.AztecCode=$d,n.AztecCodeReader=ua,n.AztecCodeWriter=wa,n.AztecDecoder=Ue,n.AztecDetector=bd,n.AztecDetectorResult=Td,n.AztecEncoder=be,n.AztecHighLevelEncoder=Vs,n.AztecPoint=Vt,n.BarcodeFormat=le,n.Binarizer=k,n.BinaryBitmap=I,n.BitArray=U,n.BitMatrix=Te,n.BitSource=Ku,n.BrowserAztecCodeReader=mv,n.BrowserBarcodeReader=Cv,n.BrowserCodeReader=yr,n.BrowserDatamatrixCodeReader=Sv,n.BrowserMultiFormatReader=kv,n.BrowserPDF417Reader=Bv,n.BrowserQRCodeReader=Lv,n.BrowserQRCodeSvgWriter=ui,n.CharacterSetECI=V,n.ChecksumException=O,n.Code128Reader=J,n.Code39Reader=pt,n.DataMatrixDecodedBitStreamParser=bn,n.DataMatrixReader=_n,n.DecodeHintType=j,n.DecoderResult=Ds,n.DefaultGridSampler=Rd,n.DetectorResult=la,n.EAN13Reader=ii,n.EncodeHintType=mt,n.Exception=x,n.FormatException=B,n.GenericGF=Oe,n.GenericGFPoly=Zt,n.GlobalHistogramBinarizer=tt,n.GridSampler=Wu,n.GridSamplerInstance=Tn,n.HTMLCanvasElementLuminanceSource=pe,n.HybridBinarizer=xe,n.ITFReader=Be,n.IllegalArgumentException=A,n.IllegalStateException=Hr,n.InvertedLuminanceSource=de,n.LuminanceSource=te,n.MathUtils=Re,n.MultiFormatOneDReader=ki,n.MultiFormatReader=jd,n.MultiFormatWriter=Uv,n.NotFoundException=H,n.OneDReader=dt,n.PDF417DecodedBitStreamParser=W,n.PDF417DecoderErrorCorrection=Pd,n.PDF417Reader=_t,n.PDF417ResultMetadata=Bd,n.PerspectiveTransform=Nr,n.PlanarYUVLuminanceSource=Kr,n.QRCodeByteMatrix=xa,n.QRCodeDataMask=Cr,n.QRCodeDecodedBitStreamParser=Ze,n.QRCodeDecoderErrorCorrectionLevel=je,n.QRCodeDecoderFormatInformation=Ft,n.QRCodeEncoder=$e,n.QRCodeEncoderQRCode=li,n.QRCodeMaskUtil=it,n.QRCodeMatrixUtil=fe,n.QRCodeMode=ce,n.QRCodeReader=On,n.QRCodeVersion=ue,n.QRCodeWriter=Li,n.RGBLuminanceSource=rc,n.RSS14Reader=nt,n.RSSExpandedReader=Y,n.ReaderException=pa,n.ReedSolomonDecoder=Ps,n.ReedSolomonEncoder=tc,n.ReedSolomonException=Ni,n.Result=Ke,n.ResultMetadataType=Ct,n.ResultPoint=ae,n.StringUtils=se,n.UnsupportedOperationException=oe,n.VideoInputDevice=He,n.WhiteRectangleDetector=an,n.WriterException=Le,n.ZXingArrays=T,n.ZXingCharset=Wd,n.ZXingInteger=_,n.ZXingStandardCharsets=nc,n.ZXingStringBuilder=ge,n.ZXingStringEncoding=ye,n.ZXingSystem=M,n.createAbstractExpandedDecoder=Dd,Object.defineProperty(n,"__esModule",{value:!0})})})(P1,P1.exports);var Qe=P1.exports;const F_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var $p=function(){function e(t,n,o){if(this.formatMap=new Map([[re.QR_CODE,Qe.BarcodeFormat.QR_CODE],[re.AZTEC,Qe.BarcodeFormat.AZTEC],[re.CODABAR,Qe.BarcodeFormat.CODABAR],[re.CODE_39,Qe.BarcodeFormat.CODE_39],[re.CODE_93,Qe.BarcodeFormat.CODE_93],[re.CODE_128,Qe.BarcodeFormat.CODE_128],[re.DATA_MATRIX,Qe.BarcodeFormat.DATA_MATRIX],[re.MAXICODE,Qe.BarcodeFormat.MAXICODE],[re.ITF,Qe.BarcodeFormat.ITF],[re.EAN_13,Qe.BarcodeFormat.EAN_13],[re.EAN_8,Qe.BarcodeFormat.EAN_8],[re.PDF_417,Qe.BarcodeFormat.PDF_417],[re.RSS_14,Qe.BarcodeFormat.RSS_14],[re.RSS_EXPANDED,Qe.BarcodeFormat.RSS_EXPANDED],[re.UPC_A,Qe.BarcodeFormat.UPC_A],[re.UPC_E,Qe.BarcodeFormat.UPC_E],[re.UPC_EAN_EXTENSION,Qe.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!F_)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=n,this.logger=o;var c=this.createZXingFormats(t),f=new Map;f.set(Qe.DecodeHintType.POSSIBLE_FORMATS,c),f.set(Qe.DecodeHintType.TRY_HARDER,!1),this.hints=f}return e.prototype.decodeAsync=function(t){var n=this;return new Promise(function(o,c){try{o(n.decode(t))}catch(f){c(f)}})},e.prototype.decode=function(t){var n=new Qe.MultiFormatReader(this.verbose,this.hints),o=new Qe.HTMLCanvasElementLuminanceSource(t),c=new Qe.BinaryBitmap(new Qe.HybridBinarizer(o)),f=n.decode(c);return{text:f.text,format:dv.create(this.toHtml5QrcodeSupportedFormats(f.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createZXingFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.logError("".concat(f," is not supported by")+"ZXingHtml5QrcodeShim")}return n},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),U_=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function m(C){try{x(o.next(C))}catch(A){g(A)}}function v(C){try{x(o.throw(C))}catch(A){g(A)}}function x(C){C.done?f(C.value):c(C.value).then(m,v)}x((o=o.apply(e,t||[])).next())})},j_=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(C){return v([x,C])}}function v(x){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(n=0)),n;)try{if(o=1,c&&(f=x[0]&2?c.return:x[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,x[1])).done)return f;switch(c=0,f&&(x=[x[0]&2,f.value]),x[0]){case 0:case 1:f=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!f||x[1]>f[0]&&x[1]<f[3])){n.label=x[1];break}if(x[0]===6&&n.label<f[1]){n.label=f[1],f=x;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(x);break}f[2]&&n.ops.pop(),n.trys.pop();continue}x=t.call(e,n)}catch(C){x=[6,C],c=0}finally{o=f=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},Vp=function(){function e(t,n,o){if(this.formatMap=new Map([[re.QR_CODE,"qr_code"],[re.AZTEC,"aztec"],[re.CODABAR,"codabar"],[re.CODE_39,"code_39"],[re.CODE_93,"code_93"],[re.CODE_128,"code_128"],[re.DATA_MATRIX,"data_matrix"],[re.ITF,"itf"],[re.EAN_13,"ean_13"],[re.EAN_8,"ean_8"],[re.PDF_417,"pdf417"],[re.UPC_A,"upc_a"],[re.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=o;var c=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(c),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var t=new BarcodeDetector({formats:["qr_code"]});return typeof t<"u"},e.prototype.decodeAsync=function(t){return U_(this,void 0,void 0,function(){var n,o;return j_(this,function(c){switch(c.label){case 0:return[4,this.detector.detect(t)];case 1:if(n=c.sent(),!n||n.length===0)throw"No barcode or QR code detected.";return o=this.selectLargestBarcode(n),[2,{text:o.rawValue,format:dv.create(this.toHtml5QrcodeSupportedFormats(o.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(t){for(var n=null,o=0,c=0,f=t;c<f.length;c++){var g=f[c],m=g.boundingBox.width*g.boundingBox.height;m>o&&(o=m,n=g)}if(!n)throw"No largest barcode found";return n},e.prototype.createBarcodeDetectorFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.warn("".concat(f," is not supported by")+"BarcodeDetectorDelegate")}return{formats:n}},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),zp=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function m(C){try{x(o.next(C))}catch(A){g(A)}}function v(C){try{x(o.throw(C))}catch(A){g(A)}}function x(C){C.done?f(C.value):c(C.value).then(m,v)}x((o=o.apply(e,t||[])).next())})},Hp=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(C){return v([x,C])}}function v(x){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(n=0)),n;)try{if(o=1,c&&(f=x[0]&2?c.return:x[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,x[1])).done)return f;switch(c=0,f&&(x=[x[0]&2,f.value]),x[0]){case 0:case 1:f=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!f||x[1]>f[0]&&x[1]<f[3])){n.label=x[1];break}if(x[0]===6&&n.label<f[1]){n.label=f[1],f=x;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(x);break}f[2]&&n.ops.pop(),n.trys.pop();continue}x=t.call(e,n)}catch(C){x=[6,C],c=0}finally{o=f=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},W_=function(){function e(t,n,o,c){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=o,n&&Vp.isSupported()?(this.primaryDecoder=new Vp(t,o,c),this.secondaryDecoder=new $p(t,o,c)):this.primaryDecoder=new $p(t,o,c)}return e.prototype.decodeAsync=function(t){return zp(this,void 0,void 0,function(){var n;return Hp(this,function(o){switch(o.label){case 0:n=performance.now(),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(t)];case 2:return[2,o.sent()];case 3:return this.possiblyLogPerformance(n),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(t){return zp(this,void 0,void 0,function(){var n,o;return Hp(this,function(c){switch(c.label){case 0:n=performance.now(),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(t)];case 2:return[2,c.sent()];case 3:if(o=c.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(t)];throw o;case 4:return this.possiblyLogPerformance(n),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(t){if(this.verbose){var n=performance.now()-t;this.executionResults.push(n),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,n=0,o=this.executionResults;n<o.length;n++){var c=o[n];t+=c}var f=t/this.executionResults.length;console.log("".concat(f," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),Sd=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),ru=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function m(C){try{x(o.next(C))}catch(A){g(A)}}function v(C){try{x(o.throw(C))}catch(A){g(A)}}function x(C){C.done?f(C.value):c(C.value).then(m,v)}x((o=o.apply(e,t||[])).next())})},nu=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(C){return v([x,C])}}function v(x){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(n=0)),n;)try{if(o=1,c&&(f=x[0]&2?c.return:x[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,x[1])).done)return f;switch(c=0,f&&(x=[x[0]&2,f.value]),x[0]){case 0:case 1:f=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!f||x[1]>f[0]&&x[1]<f[3])){n.label=x[1];break}if(x[0]===6&&n.label<f[1]){n.label=f[1],f=x;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(x);break}f[2]&&n.ops.pop(),n.trys.pop();continue}x=t.call(e,n)}catch(C){x=[6,C],c=0}finally{o=f=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},gv=function(){function e(t,n){this.name=t,this.track=n}return e.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},e.prototype.apply=function(t){var n={};n[this.name]=t;var o={advanced:[n]};return this.track.applyConstraints(o)},e.prototype.value=function(){var t=this.track.getSettings();if(this.name in t){var n=t[this.name];return n}return null},e}(),$_=function(e){Sd(t,e);function t(n,o){return e.call(this,n,o)||this}return t.prototype.min=function(){return this.getCapabilities().min},t.prototype.max=function(){return this.getCapabilities().max},t.prototype.step=function(){return this.getCapabilities().step},t.prototype.apply=function(n){var o={};o[this.name]=n;var c={advanced:[o]};return this.track.applyConstraints(c)},t.prototype.getCapabilities=function(){this.failIfNotSupported();var n=this.track.getCapabilities(),o=n[this.name];return{min:o.min,max:o.max,step:o.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},t}(gv),V_=function(e){Sd(t,e);function t(n){return e.call(this,"zoom",n)||this}return t}($_),z_=function(e){Sd(t,e);function t(n){return e.call(this,"torch",n)||this}return t}(gv),H_=function(){function e(t){this.track=t}return e.prototype.zoomFeature=function(){return new V_(this.track)},e.prototype.torchFeature=function(){return new z_(this.track)},e}(),G_=function(){function e(t,n,o){this.isClosed=!1,this.parentElement=t,this.mediaStream=n,this.callbacks=o,this.surface=this.createVideoElement(this.parentElement.clientWidth),t.append(this.surface)}return e.prototype.createVideoElement=function(t){var n=document.createElement("video");return n.style.width="".concat(t,"px"),n.style.display="block",n.muted=!0,n.setAttribute("muted","true"),n.playsInline=!0,n},e.prototype.setupSurface=function(){var t=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var n=function(){var o=t.surface.clientWidth,c=t.surface.clientHeight;t.callbacks.onRenderSurfaceReady(o,c),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,o,c){return ru(this,void 0,void 0,function(){var f,g;return nu(this,function(m){switch(m.label){case 0:return f=new e(t,n,c),o.aspectRatio?(g={aspectRatio:o.aspectRatio},[4,f.getFirstTrackOrFail().applyConstraints(g)]):[3,2];case 1:m.sent(),m.label=2;case 2:return f.setupSurface(),[2,f]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(t){this.failIfClosed();var n=this,o=function(){setTimeout(t,200),n.surface.removeEventListener("playing",o)};this.surface.addEventListener("playing",o),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(t){return ru(this,void 0,void 0,function(){return nu(this,function(n){if("aspectRatio"in t)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(t)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var t=this;return new Promise(function(n,o){var c=t.mediaStream.getVideoTracks(),f=c.length,g=0;t.mediaStream.getVideoTracks().forEach(function(m){t.mediaStream.removeTrack(m),m.stop(),++g,g>=f&&(t.isClosed=!0,t.parentElement.removeChild(t.surface),n())})})},e.prototype.getCapabilities=function(){return new H_(this.getFirstTrackOrFail())},e}(),X_=function(){function e(t){this.mediaStream=t}return e.prototype.render=function(t,n,o){return ru(this,void 0,void 0,function(){return nu(this,function(c){return[2,G_.create(t,this.mediaStream,n,o)]})})},e.create=function(t){return ru(this,void 0,void 0,function(){var n,o;return nu(this,function(c){switch(c.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:t},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return o=c.sent(),[2,new e(o)]}})})},e}(),Gp=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function m(C){try{x(o.next(C))}catch(A){g(A)}}function v(C){try{x(o.throw(C))}catch(A){g(A)}}function x(C){C.done?f(C.value):c(C.value).then(m,v)}x((o=o.apply(e,t||[])).next())})},Xp=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(C){return v([x,C])}}function v(x){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(n=0)),n;)try{if(o=1,c&&(f=x[0]&2?c.return:x[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,x[1])).done)return f;switch(c=0,f&&(x=[x[0]&2,f.value]),x[0]){case 0:case 1:f=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!f||x[1]>f[0]&&x[1]<f[3])){n.label=x[1];break}if(x[0]===6&&n.label<f[1]){n.label=f[1],f=x;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(x);break}f[2]&&n.ops.pop(),n.trys.pop();continue}x=t.call(e,n)}catch(C){x=[6,C],c=0}finally{o=f=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},Y_=function(){function e(){}return e.failIfNotSupported=function(){return Gp(this,void 0,void 0,function(){return Xp(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(t){return Gp(this,void 0,void 0,function(){return Xp(this,function(n){return[2,X_.create(t)]})})},e}(),K_=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function m(C){try{x(o.next(C))}catch(A){g(A)}}function v(C){try{x(o.throw(C))}catch(A){g(A)}}function x(C){C.done?f(C.value):c(C.value).then(m,v)}x((o=o.apply(e,t||[])).next())})},Z_=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(C){return v([x,C])}}function v(x){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(n=0)),n;)try{if(o=1,c&&(f=x[0]&2?c.return:x[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,x[1])).done)return f;switch(c=0,f&&(x=[x[0]&2,f.value]),x[0]){case 0:case 1:f=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!f||x[1]>f[0]&&x[1]<f[3])){n.label=x[1];break}if(x[0]===6&&n.label<f[1]){n.label=f[1],f=x;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(x);break}f[2]&&n.ops.pop(),n.trys.pop();continue}x=t.call(e,n)}catch(C){x=[6,C],c=0}finally{o=f=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},Q_=function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;return MediaStreamTrack&&t.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var t=ss.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=ss.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var t=location.host.split(":")[0];return t==="127.0.0.1"||t==="localhost"},e.getCamerasFromMediaDevices=function(){return K_(this,void 0,void 0,function(){var t,n,o,c,f,g,m;return Z_(this,function(v){switch(v.label){case 0:return t=function(x){for(var C=x.getVideoTracks(),A=0,I=C;A<I.length;A++){var O=I[A];O.enabled=!1,O.stop(),x.removeTrack(O)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return n=v.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(o=v.sent(),c=[],f=0,g=o;f<g.length;f++)m=g[f],m.kind==="videoinput"&&c.push({id:m.deviceId,label:m.label});return t(n),[2,c]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,n){var o=function(f){for(var g=[],m=0,v=f;m<v.length;m++){var x=v[m];x.kind==="video"&&g.push({id:x.id,label:x.label})}t(g)},c=MediaStreamTrack;c.getSources(o)})},e}(),st;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(st||(st={}));var q_=function(){function e(){this.state=st.NOT_STARTED,this.onGoingTransactionNewState=st.UNKNOWN}return e.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},e.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===st.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=st.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===st.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=st.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==st.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case st.UNKNOWN:throw"Transition from unknown is not allowed";case st.NOT_STARTED:this.failIfNewStateIs(t,[st.PAUSED]);break;case st.SCANNING:break;case st.PAUSED:break}},e.prototype.failIfNewStateIs=function(t,n){for(var o=0,c=n;o<c.length;o++){var f=c[o];if(t===f)throw"Cannot transition from ".concat(this.state," to ").concat(t)}},e}(),J_=function(){function e(t){this.stateManager=t}return e.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},e.prototype.directTransition=function(t){this.stateManager.directTransition(t)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===st.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==st.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===st.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===st.PAUSED},e}(),eO=function(){function e(){}return e.create=function(){return new J_(new q_)},e}(),tO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),fr=function(e){tO(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(k_),rO=function(){function e(t,n){this.logger=n,this.fps=fr.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=t.disableFlip===!0,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=fr.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?hv.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!ln(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),bO=function(){function e(t,n){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(t))throw"HTML Element with id=".concat(t," not found");this.elementId=t,this.verbose=!1;var o;typeof n=="boolean"?this.verbose=n===!0:n&&(o=n,this.verbose=o.verbose===!0,o.experimentalFeatures),this.logger=new L_(this.verbose),this.qrcode=new W_(this.getSupportedFormats(n),this.getUseBarCodeDetectorIfSupported(o),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=eO.create()}return e.prototype.start=function(t,n,o,c){var f=this;if(!t)throw"cameraIdOrConfig is required";if(!o||typeof o!="function")throw"qrCodeSuccessCallback is required and should be a function.";var g;c?g=c:g=this.verbose?this.logger.log:function(){};var m=rO.create(n,this.logger);this.clearElement();var v=!1;m.videoConstraints&&(m.isMediaStreamConstraintsValid()?v=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var x=v,C=document.getElementById(this.elementId);C.clientWidth?C.clientWidth:fr.DEFAULT_WIDTH,C.style.position="relative",this.shouldScan=!0,this.element=C;var A=this,I=this.stateManagerProxy.startTransition(st.SCANNING);return new Promise(function(O,k){var M=x?m.videoConstraints:A.createVideoConstraints(t);if(!M){I.cancel(),k("videoConstraints should be defined");return}var G={};(!x||m.aspectRatio)&&(G.aspectRatio=m.aspectRatio);var N={onRenderSurfaceReady:function(T,_){A.setupUi(T,_,m),A.isScanning=!0,A.foreverScan(m,o,g)}};Y_.failIfNotSupported().then(function(T){T.create(M).then(function(_){return _.render(f.element,G,N).then(function(U){A.renderedCamera=U,I.execute(),O(null)}).catch(function(U){I.cancel(),k(U)})}).catch(function(_){I.cancel(),k(ss.errorGettingUserMedia(_))})}).catch(function(T){I.cancel(),k(ss.cameraStreamingNotSupported())})})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(st.PAUSED),this.showPausedState(),(ln(t)||t!==!0)&&(t=!1),t&&this.renderedCamera&&this.renderedCamera.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var t=this,n=function(){t.stateManagerProxy.directTransition(st.SCANNING),t.hidePausedState()};if(!this.renderedCamera.isPaused()){n();return}this.renderedCamera.resume(function(){n()})},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var n=this.stateManagerProxy.startTransition(st.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var o=function(){if(t.element){var f=document.getElementById(fr.SHADED_REGION_ELEMENT_ID);f&&t.element.removeChild(f)}},c=this;return this.renderedCamera.close().then(function(){return c.renderedCamera=null,c.element&&(c.element.removeChild(c.canvasElement),c.canvasElement=null),o(),c.qrRegion&&(c.qrRegion=null),c.context&&(c.context=null),n.execute(),c.hidePausedState(),c.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(t,n){return this.scanFileV2(t,n).then(function(o){return o.decodedText})},e.prototype.scanFileV2=function(t,n){var o=this;if(!t||!(t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(ln(n)&&(n=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(c,f){o.possiblyCloseLastScanImageFile(),o.clearElement(),o.lastScanImageFile=URL.createObjectURL(t);var g=new Image;g.onload=function(){var m=g.width,v=g.height,x=document.getElementById(o.elementId),C=x.clientWidth?x.clientWidth:fr.DEFAULT_WIDTH,A=Math.max(x.clientHeight?x.clientHeight:v,fr.FILE_SCAN_MIN_HEIGHT),I=o.computeCanvasDrawConfig(m,v,C,A);if(n){var O=o.createCanvasElement(C,A,"qr-canvas-visible");O.style.display="inline-block",x.appendChild(O);var k=O.getContext("2d");if(!k)throw"Unable to get 2d context from canvas";k.canvas.width=C,k.canvas.height=A,k.drawImage(g,0,0,m,v,I.x,I.y,I.width,I.height)}var M=fr.FILE_SCAN_HIDDEN_CANVAS_PADDING,G=Math.max(g.width,I.width),N=Math.max(g.height,I.height),T=G+2*M,_=N+2*M,U=o.createCanvasElement(T,_);x.appendChild(U);var z=U.getContext("2d");if(!z)throw"Unable to get 2d context from canvas";z.canvas.width=T,z.canvas.height=_,z.drawImage(g,0,0,m,v,M,M,G,N);try{o.qrcode.decodeRobustlyAsync(U).then(function(j){c(Wp.createFromQrcodeResult(j))}).catch(f)}catch(j){f("QR code parse error, error = ".concat(j))}},g.onerror=f,g.onabort=f,g.onstalled=f,g.onsuspend=f,g.src=URL.createObjectURL(t)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return Q_.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(t){if(t){if(!hv.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(t)},e.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},e.prototype.getSupportedFormats=function(t){var n=[re.QR_CODE,re.AZTEC,re.CODABAR,re.CODE_39,re.CODE_93,re.CODE_128,re.DATA_MATRIX,re.MAXICODE,re.ITF,re.EAN_13,re.EAN_8,re.PDF_417,re.RSS_14,re.RSS_EXPANDED,re.UPC_A,re.UPC_E,re.UPC_EAN_EXTENSION];if(!t||typeof t=="boolean"||!t.formatsToSupport)return n;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(t.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var o=[],c=0,f=t.formatsToSupport;c<f.length;c++){var g=f[c];P_(g)?o.push(g):this.logger.warn("Invalid format: ".concat(g," passed in config, ignoring."))}if(o.length===0)throw"None of formatsToSupport match supported values.";return o},e.prototype.getUseBarCodeDetectorIfSupported=function(t){if(ln(t))return!0;if(!ln(t.useBarCodeDetectorIfSupported))return t.useBarCodeDetectorIfSupported!==!1;if(ln(t.experimentalFeatures))return!0;var n=t.experimentalFeatures;return ln(n.useBarCodeDetectorIfSupported)?!0:n.useBarCodeDetectorIfSupported!==!1},e.prototype.validateQrboxSize=function(t,n,o){var c=this,f=o.qrbox;this.validateQrboxConfig(f);var g=this.toQrdimensions(t,n,f),m=function(x){if(x<fr.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(fr.MIN_QR_BOX_SIZE,"px.")},v=function(x){return x>t&&(c.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),x=t),x};m(g.width),m(g.height),g.width=v(g.width)},e.prototype.validateQrboxConfig=function(t){if(typeof t!="number"&&typeof t!="function"&&(t.width===void 0||t.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(t,n,o){if(typeof o=="number")return{width:o,height:o};if(typeof o=="function")try{return o(t,n)}catch(c){throw new Error("qrbox config was passed as a function but it failed with unknown error"+c)}return o},e.prototype.setupUi=function(t,n,o){o.isShadedBoxEnabled()&&this.validateQrboxSize(t,n,o);var c=ln(o.qrbox)?{width:t,height:n}:o.qrbox;this.validateQrboxConfig(c);var f=this.toQrdimensions(t,n,c);f.height>n&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var g=o.isShadedBoxEnabled()&&f.height<=n,m={x:0,y:0,width:t,height:n},v=g?this.getShadedRegionBounds(t,n,f):m,x=this.createCanvasElement(v.width,v.height),C={willReadFrequently:!0},A=x.getContext("2d",C);A.canvas.width=v.width,A.canvas.height=v.height,this.element.append(x),g&&this.possiblyInsertShadingElement(this.element,t,n,f),this.createScannerPausedUiElement(this.element),this.qrRegion=v,this.context=A,this.canvasElement=x},e.prototype.createScannerPausedUiElement=function(t){var n=document.createElement("div");n.innerText=ss.scannerPaused(),n.style.display="none",n.style.position="absolute",n.style.top="0px",n.style.zIndex="1",n.style.background="rgba(9, 9, 9, 0.46)",n.style.color="#FFECEC",n.style.textAlign="center",n.style.width="100%",t.appendChild(n),this.scannerPausedUiElement=n},e.prototype.scanContext=function(t,n){var o=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(c){return t(c.text,Wp.createFromQrcodeResult(c)),o.possiblyUpdateShaders(!0),!0}).catch(function(c){o.possiblyUpdateShaders(!1);var f=ss.codeParseError(c);return n(f,B_.createFrom(f)),!1})},e.prototype.foreverScan=function(t,n,o){var c=this;if(this.shouldScan&&this.renderedCamera){var f=this.renderedCamera.getSurface(),g=f.videoWidth/f.clientWidth,m=f.videoHeight/f.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var v=this.qrRegion.width*g,x=this.qrRegion.height*m,C=this.qrRegion.x*g,A=this.qrRegion.y*m;this.context.drawImage(f,C,A,v,x,0,0,this.qrRegion.width,this.qrRegion.height);var I=function(){c.foreverScanTimeout=setTimeout(function(){c.foreverScan(t,n,o)},c.getTimeoutFps(t.fps))};this.scanContext(n,o).then(function(O){!O&&t.disableFlip!==!0?(c.context.translate(c.context.canvas.width,0),c.context.scale(-1,1),c.scanContext(n,o).finally(function(){I()})):I()}).catch(function(O){c.logger.logError("Error happend while scanning context",O),I()})}},e.prototype.createVideoConstraints=function(t){if(typeof t=="string")return{deviceId:{exact:t}};if(typeof t=="object"){var n="facingMode",o="deviceId",c={user:!0,environment:!0},f="exact",g=function(k){if(k in c)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(k,"'")},m=Object.keys(t);if(m.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(m.length," keys");var v=Object.keys(t)[0];if(v!==n&&v!==o)throw"Only '".concat(n,"' and '").concat(o,"' ")+" are supported for 'cameraIdOrConfig'";if(v===n){var x=t.facingMode;if(typeof x=="string"){if(g(x))return{facingMode:x}}else if(typeof x=="object")if(f in x){if(g(x["".concat(f)]))return{facingMode:{exact:x["".concat(f)]}}}else throw"'facingMode' should be string or object with"+" ".concat(f," as key.");else{var C=typeof x;throw"Invalid type of 'facingMode' = ".concat(C)}}else{var A=t.deviceId;if(typeof A=="string")return{deviceId:A};if(typeof A=="object"){if(f in A)return{deviceId:{exact:A["".concat(f)]}};throw"'deviceId' should be string or object with"+" ".concat(f," as key.")}else{var I=typeof A;throw"Invalid type of 'deviceId' = ".concat(I)}}}var O=typeof t;throw"Invalid type of 'cameraIdOrConfig' = ".concat(O)},e.prototype.computeCanvasDrawConfig=function(t,n,o,c){if(t<=o&&n<=c){var f=(o-t)/2,g=(c-n)/2;return{x:f,y:g,width:t,height:n}}else{var m=t,v=n;return t>o&&(n=o/t*n,t=o),n>c&&(t=c/n*t,n=c),this.logger.log("Image downsampled from "+"".concat(m,"X").concat(v)+" to ".concat(t,"X").concat(n,".")),this.computeCanvasDrawConfig(t,n,o,c)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},e.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(n){n.style.backgroundColor=t?fr.BORDER_SHADER_MATCH_COLOR:fr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(t,n,o){var c=t,f=n,g=document.createElement("canvas");return g.style.width="".concat(c,"px"),g.style.height="".concat(f,"px"),g.style.display="none",g.id=ln(o)?"qr-canvas":o,g},e.prototype.getShadedRegionBounds=function(t,n,o){if(o.width>t||o.height>n)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-o.width)/2,y:(n-o.height)/2,width:o.width,height:o.height}},e.prototype.possiblyInsertShadingElement=function(t,n,o,c){if(!(n-c.width<1||o-c.height<1)){var f=document.createElement("div");f.style.position="absolute";var g=(n-c.width)/2,m=(o-c.height)/2;if(f.style.borderLeft="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderRight="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderTop="".concat(m,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderBottom="".concat(m,"px solid rgba(0, 0, 0, 0.48)"),f.style.boxSizing="border-box",f.style.top="0px",f.style.bottom="0px",f.style.left="0px",f.style.right="0px",f.id="".concat(fr.SHADED_REGION_ELEMENT_ID),n-c.width<11||o-c.height<11)this.hasBorderShaders=!1;else{var v=5,x=40;this.insertShaderBorders(f,x,v,-v,null,0,!0),this.insertShaderBorders(f,x,v,-v,null,0,!1),this.insertShaderBorders(f,x,v,null,-v,0,!0),this.insertShaderBorders(f,x,v,null,-v,0,!1),this.insertShaderBorders(f,v,x+v,-v,null,-v,!0),this.insertShaderBorders(f,v,x+v,null,-v,-v,!0),this.insertShaderBorders(f,v,x+v,-v,null,-v,!1),this.insertShaderBorders(f,v,x+v,null,-v,-v,!1),this.hasBorderShaders=!0}t.append(f)}},e.prototype.insertShaderBorders=function(t,n,o,c,f,g,m){var v=document.createElement("div");v.style.position="absolute",v.style.backgroundColor=fr.BORDER_SHADER_DEFAULT_COLOR,v.style.width="".concat(n,"px"),v.style.height="".concat(o,"px"),c!==null&&(v.style.top="".concat(c,"px")),f!==null&&(v.style.bottom="".concat(f,"px")),m?v.style.left="".concat(g,"px"):v.style.right="".concat(g,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(v),t.appendChild(v)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(t){return 1e3/t},e}(),Yp;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(Yp||(Yp={}));var k1;(function(e){e[e.BACK=1]="BACK",e[e.FRONT=2]="FRONT"})(k1||(k1={}));var B1;(function(e){e[e.PORTRAIT=1]="PORTRAIT",e[e.LANDSCAPE=2]="LANDSCAPE",e[e.ADAPTIVE=3]="ADAPTIVE"})(B1||(B1={}));var L1;(function(e){e[e.ALL=17]="ALL"})(L1||(L1={}));const nO=Object.assign(Object.assign({},re),L1);var Kp;(function(e){e.ZXING="zxing",e.MLKIT="mlkit"})(Kp||(Kp={}));const iO=[{selector:".scanner-container-display",css:"display: block;"},{selector:".scanner-dialog",css:"display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4);"},{selector:".scanner-dialog-inner",css:"background-color: #fefefe; margin: 2% auto; padding: 20px; border: 1px solid #888; width: 96%;"},{selector:".close-button",css:"color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer;"},{selector:".close-button:hover",css:"color: #222;"},{selector:".scanner-container-full-width",css:"width: 100%;"}];function sO(e){const t="custom-style-os-cap-barcode";let n=document.getElementById(t);if(n||(n=document.createElement("style"),n.type="text/css",n.id=t,document.head.appendChild(n)),n.sheet){for(;n.sheet.cssRules.length;)n.sheet.deleteRule(0);for(const{selector:o,css:c}of e)n.sheet.insertRule(`${o} { ${c} }`)}else{n.textContent="";for(const{selector:o,css:c}of e)n.textContent+=`${o} { ${c} }`}}const oO=sa("CapacitorBarcodeScanner",{web:()=>(sO(iO),Y1(()=>import("./web-DzBEnE5q.js"),[],import.meta.url).then(e=>new e.CapacitorBarcodeScannerWeb))});class aO{static async scanBarcode(t){return t.scanInstructions=t.scanInstructions||" ",t.scanButton=t.scanButton||!1,t.scanText=t.scanText||" ",t.cameraDirection=t.cameraDirection||k1.BACK,t.scanOrientation=t.scanOrientation||B1.ADAPTIVE,oO.scanBarcode(t)}}const vf=sa("SecureStoragePlugin",{web:()=>Y1(()=>import("./web-harvpkJj.js"),[],import.meta.url).then(e=>new e.SecureStoragePluginWeb)});function lO(e){try{if(e.length>2048)throw new Error;if(!e.startsWith("{")){const c=new URL(e);if(!["http:","https:"].includes(c.protocol)||c.username||c.password||c.pathname!=="/pair"||c.search||!/^#pair=[A-Za-z0-9_-]{43}$/.test(c.hash))throw new Error;const f=qn.parse(c.origin);if(!f)throw new Error;return{endpoint:f,grant:c.hash.slice(6)}}const t=JSON.parse(e);if(t.type!=="agentroam-pair"||t.version!==1||typeof t.server!="string"||typeof t.grant!="string"||!/^[A-Za-z0-9_-]{43}$/.test(t.grant))throw new Error;const n=new URL(t.server);if(n.username||n.password||n.search||n.hash||n.pathname!=="/")throw new Error;const o=qn.parse(t.server);if(!o)throw new Error;return{endpoint:o,grant:t.grant}}catch{throw new Error("这不是 AgentRoam 授权二维码,请扫描电脑终端上新生成的二维码。")}}class uO{ready(){if(!Ts.isNativePlatform())throw new Error("请在 AgentRoam App 中扫码连接。")}async get(t){this.ready();try{return(await vf.get({key:`agentroam-device:${t}`})).value}catch(n){if(String(n).includes("does not exist"))return null;throw new Error("无法读取设备凭证,请重试。")}}async set(t,n){this.ready(),await vf.set({key:`agentroam-device:${t}`,value:n})}async remove(t){this.ready();try{await vf.remove({key:`agentroam-device:${t}`})}catch(n){if(!String(n).includes("does not exist"))throw n}}}async function cO(){if(!Ts.isNativePlatform())throw new Error("请在 AgentRoam App 中使用相机扫码。");try{return(await aO.scanBarcode({hint:nO.QR_CODE,scanInstructions:"扫描电脑上的 AgentRoam 授权二维码",cameraDirection:1})).ScanResult||null}catch(e){if(/cancel/i.test(String(e)))return null;throw new Error("无法打开相机,请在系统设置中允许 AgentRoam 使用相机后重试。")}}class fO{constructor(t,n=(...c)=>fetch(...c),o=()=>window.dispatchEvent(new CustomEvent("webapp:unauthorized"))){this.storage=t,this.transport=n,this.onRevoked=o,this.session=null,this.fetch=async(c,f={})=>{const g=this.session,m=new URL(typeof c=="string"?c:c instanceof URL?c.href:c.url),v=new Headers(f.headers??(c instanceof Request?c.headers:void 0));g&&m.origin===g.origin&&v.set("authorization",`Bearer ${g.token}`);const x=await this.transport(c,{...f,headers:v,credentials:"omit",redirect:"error"});if(g&&this.session===g&&m.origin===g.origin&&(x.status===401||x.status===423)){this.session=null;try{await this.storage.remove(g.origin)}finally{this.onRevoked()}}return x}}async resume(t){const n=await this.storage.get(t.url);this.session=n?{origin:t.url,token:n}:null}async pair(t){const{endpoint:n,grant:o}=lO(t),c=await this.transport(n.api("/api/pairing/qr-exchange"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant:o,name:"我的 App"}),credentials:"omit",redirect:"error",signal:AbortSignal.timeout(1e4)});if(!c.ok)throw new Error(c.status===423?"电脑已锁定远程访问,请先在电脑上解锁。":c.status===410?"二维码已使用或已过期,请在电脑上重新生成。":"扫码连接失败,请检查服务器地址和网络后重试。");const f=await c.json();if(typeof f.token!="string"||!/^[A-Za-z0-9_-]{43}$/.test(f.token))throw new Error("服务器返回了无效的设备凭证。");try{await this.storage.set(n.url,f.token)}catch{throw await this.transport(n.api("/api/pairing/logout"),{method:"POST",headers:{authorization:`Bearer ${f.token}`},credentials:"omit",redirect:"error",signal:AbortSignal.timeout(5e3)}).catch(()=>{}),new Error("无法安全保存设备凭证,请在电脑上重新生成二维码后重试。")}return this.session={origin:n.url,token:f.token},n}async checkAuthorization(){const t=this.session;if(!t)return;const n=await this.fetch(`${t.origin}/api/web-auth/status`,{signal:AbortSignal.timeout(5e3)});if(!n.ok)return;const o=await n.json();if(this.session===t&&(o.locked||o.authenticated===!1)){this.session=null;try{await this.storage.remove(t.origin)}finally{this.onRevoked()}}}}var iu;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(iu||(iu={}));var Zp;(function(e){e.None="NONE",e.Slide="SLIDE",e.Fade="FADE"})(Zp||(Zp={}));const yf=sa("StatusBar");function dO(e){const t=/^#([a-f\d]{6})$/i.exec(e.trim());if(!t)return null;const n=[0,2,4].map(c=>{const f=parseInt(t[1].slice(c,c+2),16)/255;return f<=.04045?f/12.92:((f+.055)/1.055)**2.4}),o=.2126*n[0]+.7152*n[1]+.0722*n[2];return{color:`#${t[1]}`,style:o>.179?iu.Light:iu.Dark}}function hO(){if(Ts.getPlatform()!=="android")return()=>{};const e=document.documentElement;e.dataset.skin=Ol.getState().skin;let t=!1,n=yf.setOverlaysWebView({overlay:!1}).catch(()=>{});const o=()=>{const g=dO(getComputedStyle(e).getPropertyValue("--bg-deepest"));g&&(n=n.then(async()=>{t||(await yf.setBackgroundColor({color:g.color}),await yf.setStyle({style:g.style}))}).catch(()=>{console.warn("Unable to update the Android status bar.")}))},c=new MutationObserver(o);c.observe(e,{attributes:!0,attributeFilter:["data-skin"]});const f=()=>{document.hidden||o()};return document.addEventListener("visibilitychange",f),window.addEventListener("focus",o),o(),()=>{t=!0,c.disconnect(),document.removeEventListener("visibilitychange",f),window.removeEventListener("focus",o)}}const gO="/service-worker.js";function pO(){return typeof window<"u"&&window.isSecureContext===!0&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function xO(e){const t="=".repeat((4-e.length%4)%4),n=`${e}${t}`.replace(/-/g,"+").replace(/_/g,"/"),o=atob(n),c=new Uint8Array(new ArrayBuffer(o.length));for(let f=0;f<o.length;f+=1)c[f]=o.charCodeAt(f);return c}async function Qp(e){const{publicKey:t}=await e.get("/api/push/vapid");if(!t)return;const n=await navigator.serviceWorker.register(gO),c=await n.pushManager.getSubscription()??await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:xO(t)});await e.post("/api/push/subscribe",c.toJSON())}function mO(e){pO()&&(async()=>{try{if(Notification.permission==="granted"){await Qp(e);return}if(Notification.permission!=="default")return;const t=()=>{(async()=>{try{await Notification.requestPermission()==="granted"&&await Qp(e)}catch{}})()};document.addEventListener("pointerdown",t,{once:!0})}catch{}})()}class Ef extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}const qp=10,wO=13,ci=32;function Cf(e){}function vO(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");const{onEvent:t=Cf,onError:n=Cf,onRetry:o=Cf,onComment:c,maxBufferSize:f}=e,g=[];let m=0,v=!0,x,C="",A=0,I,O=!1;function k(z){if(O)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(v&&(v=!1,z.charCodeAt(0)===239&&z.charCodeAt(1)===187&&z.charCodeAt(2)===191&&(z=z.slice(3))),g.length===0){const X=G(z);X!==""&&(g.push(X),m=X.length),M();return}if(z.indexOf(`
|
|
81
|
+
`);let s=Vd.singletonList(Qr.INITIAL_STATE);for(let l=0;l<this.text.length;l++){let u,d=l+1<this.text.length?this.text[l+1]:0;switch(this.text[l]){case se.getCharCode("\r"):u=d===i?2:0;break;case se.getCharCode("."):u=d===r?3:0;break;case se.getCharCode(","):u=d===r?4:0;break;case se.getCharCode(":"):u=d===r?5:0;break;default:u=0}u>0?(s=Vs.updateStateListForPair(s,l,u),l++):s=this.updateStateListForChar(s,l)}return Vd.min(s,(l,u)=>l.getBitCount()-u.getBitCount()).toBitArray(this.text)}updateStateListForChar(r,i){const s=[];for(let a of r)this.updateStateForChar(a,i,s);return Vs.simplifyStates(s)}updateStateForChar(r,i,s){let a=this.text[i]&255,l=oc[r.getMode()][a]>0,u=null;for(let d=0;d<=Zr;d++){let h=oc[d][a];if(h>0){if(u==null&&(u=r.endBinaryShift(i)),!l||d===r.getMode()||d===Sr){const p=u.latchAndAppend(d,h);s.push(p)}if(!l&&Hd[r.getMode()][d]>=0){const p=u.shiftAndAppend(d,h);s.push(p)}}}if(r.getBinaryShiftByteCount()>0||oc[r.getMode()][a]===0){let d=r.addBinaryShiftChar(i);s.push(d)}}static updateStateListForPair(r,i,s){const a=[];for(let l of r)this.updateStateForPair(l,i,s,a);return this.simplifyStates(a)}static updateStateForPair(r,i,s,a){let l=r.endBinaryShift(i);if(a.push(l.latchAndAppend(Zr,s)),r.getMode()!==Zr&&a.push(l.shiftAndAppend(Zr,s)),s===3||s===4){let u=l.latchAndAppend(Sr,16-s).latchAndAppend(Sr,1);a.push(u)}if(r.getBinaryShiftByteCount()>0){let u=r.addBinaryShiftChar(i).addBinaryShiftChar(i+1);a.push(u)}}static simplifyStates(r){let i=[];for(const s of r){let a=!0;for(const l of i){if(l.isBetterThanOrEqualTo(s)){a=!1;break}s.isBetterThanOrEqualTo(l)&&(i=i.filter(u=>u!==l))}a&&i.push(s)}return i}}class be{constructor(){}static encodeBytes(r){return be.encode(r,be.DEFAULT_EC_PERCENT,be.DEFAULT_AZTEC_LAYERS)}static encode(r,i,s){let a=new Vs(r).encode(),l=_.truncDivision(a.getSize()*i,100)+11,u=a.getSize()+l,d,h,p,w,E;if(s!==be.DEFAULT_AZTEC_LAYERS){if(d=s<0,h=Math.abs(s),h>(d?be.MAX_NB_BITS_COMPACT:be.MAX_NB_BITS))throw new A(se.format("Illegal value %s for layers",s));p=be.totalBitsInLayer(h,d),w=be.WORD_SIZE[h];let K=p-p%w;if(E=be.stuffBits(a,w),E.getSize()+l>K)throw new A("Data to large for user specified layer");if(d&&E.getSize()>w*64)throw new A("Data to large for user specified layer")}else{w=0,E=null;for(let K=0;;K++){if(K>be.MAX_NB_BITS)throw new A("Data too large for an Aztec code");if(d=K<=3,h=d?K+1:K,p=be.totalBitsInLayer(h,d),u>p)continue;(E==null||w!==be.WORD_SIZE[h])&&(w=be.WORD_SIZE[h],E=be.stuffBits(a,w));let Ae=p-p%w;if(!(d&&E.getSize()>w*64)&&E.getSize()+l<=Ae)break}}let S=be.generateCheckWords(E,p,w),b=E.getSize()/w,D=be.generateModeMessage(d,h,b),P=(d?11:14)+h*4,L=new Int32Array(P),$;if(d){$=P;for(let K=0;K<L.length;K++)L[K]=K}else{$=P+1+2*_.truncDivision(_.truncDivision(P,2)-1,15);let K=_.truncDivision(P,2),Ae=_.truncDivision($,2);for(let me=0;me<K;me++){let er=me+_.truncDivision(me,15);L[K-me-1]=Ae-er-1,L[K+me]=Ae+er+1}}let Q=new Te($);for(let K=0,Ae=0;K<h;K++){let me=(h-K)*4+(d?9:12);for(let er=0;er<me;er++){let Mr=er*2;for(let tr=0;tr<2;tr++)S.get(Ae+Mr+tr)&&Q.set(L[K*2+tr],L[K*2+er]),S.get(Ae+me*2+Mr+tr)&&Q.set(L[K*2+er],L[P-1-K*2-tr]),S.get(Ae+me*4+Mr+tr)&&Q.set(L[P-1-K*2-tr],L[P-1-K*2-er]),S.get(Ae+me*6+Mr+tr)&&Q.set(L[P-1-K*2-er],L[K*2+tr])}Ae+=me*8}if(be.drawModeMessage(Q,d,$,D),d)be.drawBullsEye(Q,_.truncDivision($,2),5);else{be.drawBullsEye(Q,_.truncDivision($,2),7);for(let K=0,Ae=0;K<_.truncDivision(P,2)-1;K+=15,Ae+=16)for(let me=_.truncDivision($,2)&1;me<$;me+=2)Q.set(_.truncDivision($,2)-Ae,me),Q.set(_.truncDivision($,2)+Ae,me),Q.set(me,_.truncDivision($,2)-Ae),Q.set(me,_.truncDivision($,2)+Ae)}let q=new $d;return q.setCompact(d),q.setSize($),q.setLayers(h),q.setCodeWords(b),q.setMatrix(Q),q}static drawBullsEye(r,i,s){for(let a=0;a<s;a+=2)for(let l=i-a;l<=i+a;l++)r.set(l,i-a),r.set(l,i+a),r.set(i-a,l),r.set(i+a,l);r.set(i-s,i-s),r.set(i-s+1,i-s),r.set(i-s,i-s+1),r.set(i+s,i-s),r.set(i+s,i-s+1),r.set(i+s,i+s-1)}static generateModeMessage(r,i,s){let a=new U;return r?(a.appendBits(i-1,2),a.appendBits(s-1,6),a=be.generateCheckWords(a,28,4)):(a.appendBits(i-1,5),a.appendBits(s-1,11),a=be.generateCheckWords(a,40,4)),a}static drawModeMessage(r,i,s,a){let l=_.truncDivision(s,2);if(i)for(let u=0;u<7;u++){let d=l-3+u;a.get(u)&&r.set(d,l-5),a.get(u+7)&&r.set(l+5,d),a.get(20-u)&&r.set(d,l+5),a.get(27-u)&&r.set(l-5,d)}else for(let u=0;u<10;u++){let d=l-5+u+_.truncDivision(u,5);a.get(u)&&r.set(d,l-7),a.get(u+10)&&r.set(l+7,d),a.get(29-u)&&r.set(d,l+7),a.get(39-u)&&r.set(l-7,d)}}static generateCheckWords(r,i,s){let a=r.getSize()/s,l=new tc(be.getGF(s)),u=_.truncDivision(i,s),d=be.bitsToWords(r,s,u);l.encode(d,u-a);let h=i%s,p=new U;p.appendBits(0,h);for(const w of Array.from(d))p.appendBits(w,s);return p}static bitsToWords(r,i,s){let a=new Int32Array(s),l,u;for(l=0,u=r.getSize()/i;l<u;l++){let d=0;for(let h=0;h<i;h++)d|=r.get(l*i+h)?1<<i-h-1:0;a[l]=d}return a}static getGF(r){switch(r){case 4:return Oe.AZTEC_PARAM;case 6:return Oe.AZTEC_DATA_6;case 8:return Oe.AZTEC_DATA_8;case 10:return Oe.AZTEC_DATA_10;case 12:return Oe.AZTEC_DATA_12;default:throw new A("Unsupported word size "+r)}}static stuffBits(r,i){let s=new U,a=r.getSize(),l=(1<<i)-2;for(let u=0;u<a;u+=i){let d=0;for(let h=0;h<i;h++)(u+h>=a||r.get(u+h))&&(d|=1<<i-1-h);(d&l)===l?(s.appendBits(d&l,i),u--):d&l?s.appendBits(d,i):(s.appendBits(d|1,i),u--)}return s}static totalBitsInLayer(r,i){return((i?88:112)+16*r)*r}}be.DEFAULT_EC_PERCENT=33,be.DEFAULT_AZTEC_LAYERS=0,be.MAX_NB_BITS=32,be.MAX_NB_BITS_COMPACT=4,be.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class wa{encode(r,i,s,a){return this.encodeWithHints(r,i,s,a,null)}encodeWithHints(r,i,s,a,l){let u=nc.ISO_8859_1,d=be.DEFAULT_EC_PERCENT,h=be.DEFAULT_AZTEC_LAYERS;return l!=null&&(l.has(mt.CHARACTER_SET)&&(u=Wd.forName(l.get(mt.CHARACTER_SET).toString())),l.has(mt.ERROR_CORRECTION)&&(d=_.parseInt(l.get(mt.ERROR_CORRECTION).toString())),l.has(mt.AZTEC_LAYERS)&&(h=_.parseInt(l.get(mt.AZTEC_LAYERS).toString()))),wa.encodeLayers(r,i,s,a,u,d,h)}static encodeLayers(r,i,s,a,l,u,d){if(i!==le.AZTEC)throw new A("Can only encode AZTEC, but got "+i);let h=be.encode(se.getBytes(r,l),u,d);return wa.renderResult(h,s,a)}static renderResult(r,i,s){let a=r.getMatrix();if(a==null)throw new Hr;let l=a.getWidth(),u=a.getHeight(),d=Math.max(i,l),h=Math.max(s,u),p=Math.min(d/l,h/u),w=(d-l*p)/2,E=(h-u*p)/2,S=new Te(d,h);for(let b=0,D=E;b<u;b++,D+=p)for(let P=0,L=w;P<l;P++,L+=p)a.get(P,b)&&S.setRegion(L,D,p,p);return S}}n.AbstractExpandedDecoder=Hu,n.ArgumentException=C,n.ArithmeticException=oa,n.AztecCode=$d,n.AztecCodeReader=ua,n.AztecCodeWriter=wa,n.AztecDecoder=Ue,n.AztecDetector=bd,n.AztecDetectorResult=Td,n.AztecEncoder=be,n.AztecHighLevelEncoder=Vs,n.AztecPoint=Vt,n.BarcodeFormat=le,n.Binarizer=k,n.BinaryBitmap=I,n.BitArray=U,n.BitMatrix=Te,n.BitSource=Ku,n.BrowserAztecCodeReader=mv,n.BrowserBarcodeReader=Cv,n.BrowserCodeReader=yr,n.BrowserDatamatrixCodeReader=Sv,n.BrowserMultiFormatReader=kv,n.BrowserPDF417Reader=Bv,n.BrowserQRCodeReader=Lv,n.BrowserQRCodeSvgWriter=ui,n.CharacterSetECI=V,n.ChecksumException=O,n.Code128Reader=J,n.Code39Reader=pt,n.DataMatrixDecodedBitStreamParser=bn,n.DataMatrixReader=_n,n.DecodeHintType=j,n.DecoderResult=Ds,n.DefaultGridSampler=Rd,n.DetectorResult=la,n.EAN13Reader=ii,n.EncodeHintType=mt,n.Exception=x,n.FormatException=B,n.GenericGF=Oe,n.GenericGFPoly=Zt,n.GlobalHistogramBinarizer=tt,n.GridSampler=Wu,n.GridSamplerInstance=Tn,n.HTMLCanvasElementLuminanceSource=pe,n.HybridBinarizer=xe,n.ITFReader=Be,n.IllegalArgumentException=A,n.IllegalStateException=Hr,n.InvertedLuminanceSource=de,n.LuminanceSource=te,n.MathUtils=Re,n.MultiFormatOneDReader=ki,n.MultiFormatReader=jd,n.MultiFormatWriter=Uv,n.NotFoundException=H,n.OneDReader=dt,n.PDF417DecodedBitStreamParser=W,n.PDF417DecoderErrorCorrection=Pd,n.PDF417Reader=_t,n.PDF417ResultMetadata=Bd,n.PerspectiveTransform=Nr,n.PlanarYUVLuminanceSource=Kr,n.QRCodeByteMatrix=xa,n.QRCodeDataMask=Cr,n.QRCodeDecodedBitStreamParser=Ze,n.QRCodeDecoderErrorCorrectionLevel=je,n.QRCodeDecoderFormatInformation=Ft,n.QRCodeEncoder=$e,n.QRCodeEncoderQRCode=li,n.QRCodeMaskUtil=it,n.QRCodeMatrixUtil=fe,n.QRCodeMode=ce,n.QRCodeReader=On,n.QRCodeVersion=ue,n.QRCodeWriter=Li,n.RGBLuminanceSource=rc,n.RSS14Reader=nt,n.RSSExpandedReader=Y,n.ReaderException=pa,n.ReedSolomonDecoder=Ps,n.ReedSolomonEncoder=tc,n.ReedSolomonException=Ni,n.Result=Ke,n.ResultMetadataType=Ct,n.ResultPoint=ae,n.StringUtils=se,n.UnsupportedOperationException=oe,n.VideoInputDevice=He,n.WhiteRectangleDetector=an,n.WriterException=Le,n.ZXingArrays=T,n.ZXingCharset=Wd,n.ZXingInteger=_,n.ZXingStandardCharsets=nc,n.ZXingStringBuilder=ge,n.ZXingStringEncoding=ye,n.ZXingSystem=M,n.createAbstractExpandedDecoder=Dd,Object.defineProperty(n,"__esModule",{value:!0})})})(P1,P1.exports);var Qe=P1.exports;const F_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var $p=function(){function e(t,n,o){if(this.formatMap=new Map([[re.QR_CODE,Qe.BarcodeFormat.QR_CODE],[re.AZTEC,Qe.BarcodeFormat.AZTEC],[re.CODABAR,Qe.BarcodeFormat.CODABAR],[re.CODE_39,Qe.BarcodeFormat.CODE_39],[re.CODE_93,Qe.BarcodeFormat.CODE_93],[re.CODE_128,Qe.BarcodeFormat.CODE_128],[re.DATA_MATRIX,Qe.BarcodeFormat.DATA_MATRIX],[re.MAXICODE,Qe.BarcodeFormat.MAXICODE],[re.ITF,Qe.BarcodeFormat.ITF],[re.EAN_13,Qe.BarcodeFormat.EAN_13],[re.EAN_8,Qe.BarcodeFormat.EAN_8],[re.PDF_417,Qe.BarcodeFormat.PDF_417],[re.RSS_14,Qe.BarcodeFormat.RSS_14],[re.RSS_EXPANDED,Qe.BarcodeFormat.RSS_EXPANDED],[re.UPC_A,Qe.BarcodeFormat.UPC_A],[re.UPC_E,Qe.BarcodeFormat.UPC_E],[re.UPC_EAN_EXTENSION,Qe.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!F_)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=n,this.logger=o;var c=this.createZXingFormats(t),f=new Map;f.set(Qe.DecodeHintType.POSSIBLE_FORMATS,c),f.set(Qe.DecodeHintType.TRY_HARDER,!1),this.hints=f}return e.prototype.decodeAsync=function(t){var n=this;return new Promise(function(o,c){try{o(n.decode(t))}catch(f){c(f)}})},e.prototype.decode=function(t){var n=new Qe.MultiFormatReader(this.verbose,this.hints),o=new Qe.HTMLCanvasElementLuminanceSource(t),c=new Qe.BinaryBitmap(new Qe.HybridBinarizer(o)),f=n.decode(c);return{text:f.text,format:dv.create(this.toHtml5QrcodeSupportedFormats(f.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createZXingFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.logError("".concat(f," is not supported by")+"ZXingHtml5QrcodeShim")}return n},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),U_=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function m(C){try{x(o.next(C))}catch(A){g(A)}}function v(C){try{x(o.throw(C))}catch(A){g(A)}}function x(C){C.done?f(C.value):c(C.value).then(m,v)}x((o=o.apply(e,t||[])).next())})},j_=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(C){return v([x,C])}}function v(x){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(n=0)),n;)try{if(o=1,c&&(f=x[0]&2?c.return:x[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,x[1])).done)return f;switch(c=0,f&&(x=[x[0]&2,f.value]),x[0]){case 0:case 1:f=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!f||x[1]>f[0]&&x[1]<f[3])){n.label=x[1];break}if(x[0]===6&&n.label<f[1]){n.label=f[1],f=x;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(x);break}f[2]&&n.ops.pop(),n.trys.pop();continue}x=t.call(e,n)}catch(C){x=[6,C],c=0}finally{o=f=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},Vp=function(){function e(t,n,o){if(this.formatMap=new Map([[re.QR_CODE,"qr_code"],[re.AZTEC,"aztec"],[re.CODABAR,"codabar"],[re.CODE_39,"code_39"],[re.CODE_93,"code_93"],[re.CODE_128,"code_128"],[re.DATA_MATRIX,"data_matrix"],[re.ITF,"itf"],[re.EAN_13,"ean_13"],[re.EAN_8,"ean_8"],[re.PDF_417,"pdf417"],[re.UPC_A,"upc_a"],[re.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=o;var c=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(c),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var t=new BarcodeDetector({formats:["qr_code"]});return typeof t<"u"},e.prototype.decodeAsync=function(t){return U_(this,void 0,void 0,function(){var n,o;return j_(this,function(c){switch(c.label){case 0:return[4,this.detector.detect(t)];case 1:if(n=c.sent(),!n||n.length===0)throw"No barcode or QR code detected.";return o=this.selectLargestBarcode(n),[2,{text:o.rawValue,format:dv.create(this.toHtml5QrcodeSupportedFormats(o.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(t){for(var n=null,o=0,c=0,f=t;c<f.length;c++){var g=f[c],m=g.boundingBox.width*g.boundingBox.height;m>o&&(o=m,n=g)}if(!n)throw"No largest barcode found";return n},e.prototype.createBarcodeDetectorFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.warn("".concat(f," is not supported by")+"BarcodeDetectorDelegate")}return{formats:n}},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),zp=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function m(C){try{x(o.next(C))}catch(A){g(A)}}function v(C){try{x(o.throw(C))}catch(A){g(A)}}function x(C){C.done?f(C.value):c(C.value).then(m,v)}x((o=o.apply(e,t||[])).next())})},Hp=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(C){return v([x,C])}}function v(x){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(n=0)),n;)try{if(o=1,c&&(f=x[0]&2?c.return:x[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,x[1])).done)return f;switch(c=0,f&&(x=[x[0]&2,f.value]),x[0]){case 0:case 1:f=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!f||x[1]>f[0]&&x[1]<f[3])){n.label=x[1];break}if(x[0]===6&&n.label<f[1]){n.label=f[1],f=x;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(x);break}f[2]&&n.ops.pop(),n.trys.pop();continue}x=t.call(e,n)}catch(C){x=[6,C],c=0}finally{o=f=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},W_=function(){function e(t,n,o,c){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=o,n&&Vp.isSupported()?(this.primaryDecoder=new Vp(t,o,c),this.secondaryDecoder=new $p(t,o,c)):this.primaryDecoder=new $p(t,o,c)}return e.prototype.decodeAsync=function(t){return zp(this,void 0,void 0,function(){var n;return Hp(this,function(o){switch(o.label){case 0:n=performance.now(),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(t)];case 2:return[2,o.sent()];case 3:return this.possiblyLogPerformance(n),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(t){return zp(this,void 0,void 0,function(){var n,o;return Hp(this,function(c){switch(c.label){case 0:n=performance.now(),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(t)];case 2:return[2,c.sent()];case 3:if(o=c.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(t)];throw o;case 4:return this.possiblyLogPerformance(n),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(t){if(this.verbose){var n=performance.now()-t;this.executionResults.push(n),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,n=0,o=this.executionResults;n<o.length;n++){var c=o[n];t+=c}var f=t/this.executionResults.length;console.log("".concat(f," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),Sd=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),ru=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function m(C){try{x(o.next(C))}catch(A){g(A)}}function v(C){try{x(o.throw(C))}catch(A){g(A)}}function x(C){C.done?f(C.value):c(C.value).then(m,v)}x((o=o.apply(e,t||[])).next())})},nu=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(C){return v([x,C])}}function v(x){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(n=0)),n;)try{if(o=1,c&&(f=x[0]&2?c.return:x[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,x[1])).done)return f;switch(c=0,f&&(x=[x[0]&2,f.value]),x[0]){case 0:case 1:f=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!f||x[1]>f[0]&&x[1]<f[3])){n.label=x[1];break}if(x[0]===6&&n.label<f[1]){n.label=f[1],f=x;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(x);break}f[2]&&n.ops.pop(),n.trys.pop();continue}x=t.call(e,n)}catch(C){x=[6,C],c=0}finally{o=f=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},gv=function(){function e(t,n){this.name=t,this.track=n}return e.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},e.prototype.apply=function(t){var n={};n[this.name]=t;var o={advanced:[n]};return this.track.applyConstraints(o)},e.prototype.value=function(){var t=this.track.getSettings();if(this.name in t){var n=t[this.name];return n}return null},e}(),$_=function(e){Sd(t,e);function t(n,o){return e.call(this,n,o)||this}return t.prototype.min=function(){return this.getCapabilities().min},t.prototype.max=function(){return this.getCapabilities().max},t.prototype.step=function(){return this.getCapabilities().step},t.prototype.apply=function(n){var o={};o[this.name]=n;var c={advanced:[o]};return this.track.applyConstraints(c)},t.prototype.getCapabilities=function(){this.failIfNotSupported();var n=this.track.getCapabilities(),o=n[this.name];return{min:o.min,max:o.max,step:o.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},t}(gv),V_=function(e){Sd(t,e);function t(n){return e.call(this,"zoom",n)||this}return t}($_),z_=function(e){Sd(t,e);function t(n){return e.call(this,"torch",n)||this}return t}(gv),H_=function(){function e(t){this.track=t}return e.prototype.zoomFeature=function(){return new V_(this.track)},e.prototype.torchFeature=function(){return new z_(this.track)},e}(),G_=function(){function e(t,n,o){this.isClosed=!1,this.parentElement=t,this.mediaStream=n,this.callbacks=o,this.surface=this.createVideoElement(this.parentElement.clientWidth),t.append(this.surface)}return e.prototype.createVideoElement=function(t){var n=document.createElement("video");return n.style.width="".concat(t,"px"),n.style.display="block",n.muted=!0,n.setAttribute("muted","true"),n.playsInline=!0,n},e.prototype.setupSurface=function(){var t=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var n=function(){var o=t.surface.clientWidth,c=t.surface.clientHeight;t.callbacks.onRenderSurfaceReady(o,c),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,o,c){return ru(this,void 0,void 0,function(){var f,g;return nu(this,function(m){switch(m.label){case 0:return f=new e(t,n,c),o.aspectRatio?(g={aspectRatio:o.aspectRatio},[4,f.getFirstTrackOrFail().applyConstraints(g)]):[3,2];case 1:m.sent(),m.label=2;case 2:return f.setupSurface(),[2,f]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(t){this.failIfClosed();var n=this,o=function(){setTimeout(t,200),n.surface.removeEventListener("playing",o)};this.surface.addEventListener("playing",o),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(t){return ru(this,void 0,void 0,function(){return nu(this,function(n){if("aspectRatio"in t)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(t)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var t=this;return new Promise(function(n,o){var c=t.mediaStream.getVideoTracks(),f=c.length,g=0;t.mediaStream.getVideoTracks().forEach(function(m){t.mediaStream.removeTrack(m),m.stop(),++g,g>=f&&(t.isClosed=!0,t.parentElement.removeChild(t.surface),n())})})},e.prototype.getCapabilities=function(){return new H_(this.getFirstTrackOrFail())},e}(),X_=function(){function e(t){this.mediaStream=t}return e.prototype.render=function(t,n,o){return ru(this,void 0,void 0,function(){return nu(this,function(c){return[2,G_.create(t,this.mediaStream,n,o)]})})},e.create=function(t){return ru(this,void 0,void 0,function(){var n,o;return nu(this,function(c){switch(c.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:t},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return o=c.sent(),[2,new e(o)]}})})},e}(),Gp=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function m(C){try{x(o.next(C))}catch(A){g(A)}}function v(C){try{x(o.throw(C))}catch(A){g(A)}}function x(C){C.done?f(C.value):c(C.value).then(m,v)}x((o=o.apply(e,t||[])).next())})},Xp=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(C){return v([x,C])}}function v(x){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(n=0)),n;)try{if(o=1,c&&(f=x[0]&2?c.return:x[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,x[1])).done)return f;switch(c=0,f&&(x=[x[0]&2,f.value]),x[0]){case 0:case 1:f=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!f||x[1]>f[0]&&x[1]<f[3])){n.label=x[1];break}if(x[0]===6&&n.label<f[1]){n.label=f[1],f=x;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(x);break}f[2]&&n.ops.pop(),n.trys.pop();continue}x=t.call(e,n)}catch(C){x=[6,C],c=0}finally{o=f=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},Y_=function(){function e(){}return e.failIfNotSupported=function(){return Gp(this,void 0,void 0,function(){return Xp(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(t){return Gp(this,void 0,void 0,function(){return Xp(this,function(n){return[2,X_.create(t)]})})},e}(),K_=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function m(C){try{x(o.next(C))}catch(A){g(A)}}function v(C){try{x(o.throw(C))}catch(A){g(A)}}function x(C){C.done?f(C.value):c(C.value).then(m,v)}x((o=o.apply(e,t||[])).next())})},Z_=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(C){return v([x,C])}}function v(x){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(n=0)),n;)try{if(o=1,c&&(f=x[0]&2?c.return:x[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,x[1])).done)return f;switch(c=0,f&&(x=[x[0]&2,f.value]),x[0]){case 0:case 1:f=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!f||x[1]>f[0]&&x[1]<f[3])){n.label=x[1];break}if(x[0]===6&&n.label<f[1]){n.label=f[1],f=x;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(x);break}f[2]&&n.ops.pop(),n.trys.pop();continue}x=t.call(e,n)}catch(C){x=[6,C],c=0}finally{o=f=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},Q_=function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;return MediaStreamTrack&&t.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var t=ss.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=ss.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var t=location.host.split(":")[0];return t==="127.0.0.1"||t==="localhost"},e.getCamerasFromMediaDevices=function(){return K_(this,void 0,void 0,function(){var t,n,o,c,f,g,m;return Z_(this,function(v){switch(v.label){case 0:return t=function(x){for(var C=x.getVideoTracks(),A=0,I=C;A<I.length;A++){var O=I[A];O.enabled=!1,O.stop(),x.removeTrack(O)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return n=v.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(o=v.sent(),c=[],f=0,g=o;f<g.length;f++)m=g[f],m.kind==="videoinput"&&c.push({id:m.deviceId,label:m.label});return t(n),[2,c]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,n){var o=function(f){for(var g=[],m=0,v=f;m<v.length;m++){var x=v[m];x.kind==="video"&&g.push({id:x.id,label:x.label})}t(g)},c=MediaStreamTrack;c.getSources(o)})},e}(),st;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(st||(st={}));var q_=function(){function e(){this.state=st.NOT_STARTED,this.onGoingTransactionNewState=st.UNKNOWN}return e.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},e.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===st.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=st.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===st.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=st.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==st.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case st.UNKNOWN:throw"Transition from unknown is not allowed";case st.NOT_STARTED:this.failIfNewStateIs(t,[st.PAUSED]);break;case st.SCANNING:break;case st.PAUSED:break}},e.prototype.failIfNewStateIs=function(t,n){for(var o=0,c=n;o<c.length;o++){var f=c[o];if(t===f)throw"Cannot transition from ".concat(this.state," to ").concat(t)}},e}(),J_=function(){function e(t){this.stateManager=t}return e.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},e.prototype.directTransition=function(t){this.stateManager.directTransition(t)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===st.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==st.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===st.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===st.PAUSED},e}(),eO=function(){function e(){}return e.create=function(){return new J_(new q_)},e}(),tO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),fr=function(e){tO(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(k_),rO=function(){function e(t,n){this.logger=n,this.fps=fr.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=t.disableFlip===!0,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=fr.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?hv.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!ln(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),bO=function(){function e(t,n){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(t))throw"HTML Element with id=".concat(t," not found");this.elementId=t,this.verbose=!1;var o;typeof n=="boolean"?this.verbose=n===!0:n&&(o=n,this.verbose=o.verbose===!0,o.experimentalFeatures),this.logger=new L_(this.verbose),this.qrcode=new W_(this.getSupportedFormats(n),this.getUseBarCodeDetectorIfSupported(o),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=eO.create()}return e.prototype.start=function(t,n,o,c){var f=this;if(!t)throw"cameraIdOrConfig is required";if(!o||typeof o!="function")throw"qrCodeSuccessCallback is required and should be a function.";var g;c?g=c:g=this.verbose?this.logger.log:function(){};var m=rO.create(n,this.logger);this.clearElement();var v=!1;m.videoConstraints&&(m.isMediaStreamConstraintsValid()?v=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var x=v,C=document.getElementById(this.elementId);C.clientWidth?C.clientWidth:fr.DEFAULT_WIDTH,C.style.position="relative",this.shouldScan=!0,this.element=C;var A=this,I=this.stateManagerProxy.startTransition(st.SCANNING);return new Promise(function(O,k){var M=x?m.videoConstraints:A.createVideoConstraints(t);if(!M){I.cancel(),k("videoConstraints should be defined");return}var G={};(!x||m.aspectRatio)&&(G.aspectRatio=m.aspectRatio);var N={onRenderSurfaceReady:function(T,_){A.setupUi(T,_,m),A.isScanning=!0,A.foreverScan(m,o,g)}};Y_.failIfNotSupported().then(function(T){T.create(M).then(function(_){return _.render(f.element,G,N).then(function(U){A.renderedCamera=U,I.execute(),O(null)}).catch(function(U){I.cancel(),k(U)})}).catch(function(_){I.cancel(),k(ss.errorGettingUserMedia(_))})}).catch(function(T){I.cancel(),k(ss.cameraStreamingNotSupported())})})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(st.PAUSED),this.showPausedState(),(ln(t)||t!==!0)&&(t=!1),t&&this.renderedCamera&&this.renderedCamera.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var t=this,n=function(){t.stateManagerProxy.directTransition(st.SCANNING),t.hidePausedState()};if(!this.renderedCamera.isPaused()){n();return}this.renderedCamera.resume(function(){n()})},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var n=this.stateManagerProxy.startTransition(st.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var o=function(){if(t.element){var f=document.getElementById(fr.SHADED_REGION_ELEMENT_ID);f&&t.element.removeChild(f)}},c=this;return this.renderedCamera.close().then(function(){return c.renderedCamera=null,c.element&&(c.element.removeChild(c.canvasElement),c.canvasElement=null),o(),c.qrRegion&&(c.qrRegion=null),c.context&&(c.context=null),n.execute(),c.hidePausedState(),c.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(t,n){return this.scanFileV2(t,n).then(function(o){return o.decodedText})},e.prototype.scanFileV2=function(t,n){var o=this;if(!t||!(t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(ln(n)&&(n=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(c,f){o.possiblyCloseLastScanImageFile(),o.clearElement(),o.lastScanImageFile=URL.createObjectURL(t);var g=new Image;g.onload=function(){var m=g.width,v=g.height,x=document.getElementById(o.elementId),C=x.clientWidth?x.clientWidth:fr.DEFAULT_WIDTH,A=Math.max(x.clientHeight?x.clientHeight:v,fr.FILE_SCAN_MIN_HEIGHT),I=o.computeCanvasDrawConfig(m,v,C,A);if(n){var O=o.createCanvasElement(C,A,"qr-canvas-visible");O.style.display="inline-block",x.appendChild(O);var k=O.getContext("2d");if(!k)throw"Unable to get 2d context from canvas";k.canvas.width=C,k.canvas.height=A,k.drawImage(g,0,0,m,v,I.x,I.y,I.width,I.height)}var M=fr.FILE_SCAN_HIDDEN_CANVAS_PADDING,G=Math.max(g.width,I.width),N=Math.max(g.height,I.height),T=G+2*M,_=N+2*M,U=o.createCanvasElement(T,_);x.appendChild(U);var z=U.getContext("2d");if(!z)throw"Unable to get 2d context from canvas";z.canvas.width=T,z.canvas.height=_,z.drawImage(g,0,0,m,v,M,M,G,N);try{o.qrcode.decodeRobustlyAsync(U).then(function(j){c(Wp.createFromQrcodeResult(j))}).catch(f)}catch(j){f("QR code parse error, error = ".concat(j))}},g.onerror=f,g.onabort=f,g.onstalled=f,g.onsuspend=f,g.src=URL.createObjectURL(t)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return Q_.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(t){if(t){if(!hv.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(t)},e.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},e.prototype.getSupportedFormats=function(t){var n=[re.QR_CODE,re.AZTEC,re.CODABAR,re.CODE_39,re.CODE_93,re.CODE_128,re.DATA_MATRIX,re.MAXICODE,re.ITF,re.EAN_13,re.EAN_8,re.PDF_417,re.RSS_14,re.RSS_EXPANDED,re.UPC_A,re.UPC_E,re.UPC_EAN_EXTENSION];if(!t||typeof t=="boolean"||!t.formatsToSupport)return n;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(t.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var o=[],c=0,f=t.formatsToSupport;c<f.length;c++){var g=f[c];P_(g)?o.push(g):this.logger.warn("Invalid format: ".concat(g," passed in config, ignoring."))}if(o.length===0)throw"None of formatsToSupport match supported values.";return o},e.prototype.getUseBarCodeDetectorIfSupported=function(t){if(ln(t))return!0;if(!ln(t.useBarCodeDetectorIfSupported))return t.useBarCodeDetectorIfSupported!==!1;if(ln(t.experimentalFeatures))return!0;var n=t.experimentalFeatures;return ln(n.useBarCodeDetectorIfSupported)?!0:n.useBarCodeDetectorIfSupported!==!1},e.prototype.validateQrboxSize=function(t,n,o){var c=this,f=o.qrbox;this.validateQrboxConfig(f);var g=this.toQrdimensions(t,n,f),m=function(x){if(x<fr.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(fr.MIN_QR_BOX_SIZE,"px.")},v=function(x){return x>t&&(c.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),x=t),x};m(g.width),m(g.height),g.width=v(g.width)},e.prototype.validateQrboxConfig=function(t){if(typeof t!="number"&&typeof t!="function"&&(t.width===void 0||t.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(t,n,o){if(typeof o=="number")return{width:o,height:o};if(typeof o=="function")try{return o(t,n)}catch(c){throw new Error("qrbox config was passed as a function but it failed with unknown error"+c)}return o},e.prototype.setupUi=function(t,n,o){o.isShadedBoxEnabled()&&this.validateQrboxSize(t,n,o);var c=ln(o.qrbox)?{width:t,height:n}:o.qrbox;this.validateQrboxConfig(c);var f=this.toQrdimensions(t,n,c);f.height>n&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var g=o.isShadedBoxEnabled()&&f.height<=n,m={x:0,y:0,width:t,height:n},v=g?this.getShadedRegionBounds(t,n,f):m,x=this.createCanvasElement(v.width,v.height),C={willReadFrequently:!0},A=x.getContext("2d",C);A.canvas.width=v.width,A.canvas.height=v.height,this.element.append(x),g&&this.possiblyInsertShadingElement(this.element,t,n,f),this.createScannerPausedUiElement(this.element),this.qrRegion=v,this.context=A,this.canvasElement=x},e.prototype.createScannerPausedUiElement=function(t){var n=document.createElement("div");n.innerText=ss.scannerPaused(),n.style.display="none",n.style.position="absolute",n.style.top="0px",n.style.zIndex="1",n.style.background="rgba(9, 9, 9, 0.46)",n.style.color="#FFECEC",n.style.textAlign="center",n.style.width="100%",t.appendChild(n),this.scannerPausedUiElement=n},e.prototype.scanContext=function(t,n){var o=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(c){return t(c.text,Wp.createFromQrcodeResult(c)),o.possiblyUpdateShaders(!0),!0}).catch(function(c){o.possiblyUpdateShaders(!1);var f=ss.codeParseError(c);return n(f,B_.createFrom(f)),!1})},e.prototype.foreverScan=function(t,n,o){var c=this;if(this.shouldScan&&this.renderedCamera){var f=this.renderedCamera.getSurface(),g=f.videoWidth/f.clientWidth,m=f.videoHeight/f.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var v=this.qrRegion.width*g,x=this.qrRegion.height*m,C=this.qrRegion.x*g,A=this.qrRegion.y*m;this.context.drawImage(f,C,A,v,x,0,0,this.qrRegion.width,this.qrRegion.height);var I=function(){c.foreverScanTimeout=setTimeout(function(){c.foreverScan(t,n,o)},c.getTimeoutFps(t.fps))};this.scanContext(n,o).then(function(O){!O&&t.disableFlip!==!0?(c.context.translate(c.context.canvas.width,0),c.context.scale(-1,1),c.scanContext(n,o).finally(function(){I()})):I()}).catch(function(O){c.logger.logError("Error happend while scanning context",O),I()})}},e.prototype.createVideoConstraints=function(t){if(typeof t=="string")return{deviceId:{exact:t}};if(typeof t=="object"){var n="facingMode",o="deviceId",c={user:!0,environment:!0},f="exact",g=function(k){if(k in c)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(k,"'")},m=Object.keys(t);if(m.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(m.length," keys");var v=Object.keys(t)[0];if(v!==n&&v!==o)throw"Only '".concat(n,"' and '").concat(o,"' ")+" are supported for 'cameraIdOrConfig'";if(v===n){var x=t.facingMode;if(typeof x=="string"){if(g(x))return{facingMode:x}}else if(typeof x=="object")if(f in x){if(g(x["".concat(f)]))return{facingMode:{exact:x["".concat(f)]}}}else throw"'facingMode' should be string or object with"+" ".concat(f," as key.");else{var C=typeof x;throw"Invalid type of 'facingMode' = ".concat(C)}}else{var A=t.deviceId;if(typeof A=="string")return{deviceId:A};if(typeof A=="object"){if(f in A)return{deviceId:{exact:A["".concat(f)]}};throw"'deviceId' should be string or object with"+" ".concat(f," as key.")}else{var I=typeof A;throw"Invalid type of 'deviceId' = ".concat(I)}}}var O=typeof t;throw"Invalid type of 'cameraIdOrConfig' = ".concat(O)},e.prototype.computeCanvasDrawConfig=function(t,n,o,c){if(t<=o&&n<=c){var f=(o-t)/2,g=(c-n)/2;return{x:f,y:g,width:t,height:n}}else{var m=t,v=n;return t>o&&(n=o/t*n,t=o),n>c&&(t=c/n*t,n=c),this.logger.log("Image downsampled from "+"".concat(m,"X").concat(v)+" to ".concat(t,"X").concat(n,".")),this.computeCanvasDrawConfig(t,n,o,c)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},e.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(n){n.style.backgroundColor=t?fr.BORDER_SHADER_MATCH_COLOR:fr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(t,n,o){var c=t,f=n,g=document.createElement("canvas");return g.style.width="".concat(c,"px"),g.style.height="".concat(f,"px"),g.style.display="none",g.id=ln(o)?"qr-canvas":o,g},e.prototype.getShadedRegionBounds=function(t,n,o){if(o.width>t||o.height>n)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-o.width)/2,y:(n-o.height)/2,width:o.width,height:o.height}},e.prototype.possiblyInsertShadingElement=function(t,n,o,c){if(!(n-c.width<1||o-c.height<1)){var f=document.createElement("div");f.style.position="absolute";var g=(n-c.width)/2,m=(o-c.height)/2;if(f.style.borderLeft="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderRight="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderTop="".concat(m,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderBottom="".concat(m,"px solid rgba(0, 0, 0, 0.48)"),f.style.boxSizing="border-box",f.style.top="0px",f.style.bottom="0px",f.style.left="0px",f.style.right="0px",f.id="".concat(fr.SHADED_REGION_ELEMENT_ID),n-c.width<11||o-c.height<11)this.hasBorderShaders=!1;else{var v=5,x=40;this.insertShaderBorders(f,x,v,-v,null,0,!0),this.insertShaderBorders(f,x,v,-v,null,0,!1),this.insertShaderBorders(f,x,v,null,-v,0,!0),this.insertShaderBorders(f,x,v,null,-v,0,!1),this.insertShaderBorders(f,v,x+v,-v,null,-v,!0),this.insertShaderBorders(f,v,x+v,null,-v,-v,!0),this.insertShaderBorders(f,v,x+v,-v,null,-v,!1),this.insertShaderBorders(f,v,x+v,null,-v,-v,!1),this.hasBorderShaders=!0}t.append(f)}},e.prototype.insertShaderBorders=function(t,n,o,c,f,g,m){var v=document.createElement("div");v.style.position="absolute",v.style.backgroundColor=fr.BORDER_SHADER_DEFAULT_COLOR,v.style.width="".concat(n,"px"),v.style.height="".concat(o,"px"),c!==null&&(v.style.top="".concat(c,"px")),f!==null&&(v.style.bottom="".concat(f,"px")),m?v.style.left="".concat(g,"px"):v.style.right="".concat(g,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(v),t.appendChild(v)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(t){return 1e3/t},e}(),Yp;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(Yp||(Yp={}));var k1;(function(e){e[e.BACK=1]="BACK",e[e.FRONT=2]="FRONT"})(k1||(k1={}));var B1;(function(e){e[e.PORTRAIT=1]="PORTRAIT",e[e.LANDSCAPE=2]="LANDSCAPE",e[e.ADAPTIVE=3]="ADAPTIVE"})(B1||(B1={}));var L1;(function(e){e[e.ALL=17]="ALL"})(L1||(L1={}));const nO=Object.assign(Object.assign({},re),L1);var Kp;(function(e){e.ZXING="zxing",e.MLKIT="mlkit"})(Kp||(Kp={}));const iO=[{selector:".scanner-container-display",css:"display: block;"},{selector:".scanner-dialog",css:"display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4);"},{selector:".scanner-dialog-inner",css:"background-color: #fefefe; margin: 2% auto; padding: 20px; border: 1px solid #888; width: 96%;"},{selector:".close-button",css:"color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer;"},{selector:".close-button:hover",css:"color: #222;"},{selector:".scanner-container-full-width",css:"width: 100%;"}];function sO(e){const t="custom-style-os-cap-barcode";let n=document.getElementById(t);if(n||(n=document.createElement("style"),n.type="text/css",n.id=t,document.head.appendChild(n)),n.sheet){for(;n.sheet.cssRules.length;)n.sheet.deleteRule(0);for(const{selector:o,css:c}of e)n.sheet.insertRule(`${o} { ${c} }`)}else{n.textContent="";for(const{selector:o,css:c}of e)n.textContent+=`${o} { ${c} }`}}const oO=sa("CapacitorBarcodeScanner",{web:()=>(sO(iO),Y1(()=>import("./web-CICIlrjx.js"),[],import.meta.url).then(e=>new e.CapacitorBarcodeScannerWeb))});class aO{static async scanBarcode(t){return t.scanInstructions=t.scanInstructions||" ",t.scanButton=t.scanButton||!1,t.scanText=t.scanText||" ",t.cameraDirection=t.cameraDirection||k1.BACK,t.scanOrientation=t.scanOrientation||B1.ADAPTIVE,oO.scanBarcode(t)}}const vf=sa("SecureStoragePlugin",{web:()=>Y1(()=>import("./web-DdNvGACS.js"),[],import.meta.url).then(e=>new e.SecureStoragePluginWeb)});function lO(e){try{if(e.length>2048)throw new Error;if(!e.startsWith("{")){const c=new URL(e);if(!["http:","https:"].includes(c.protocol)||c.username||c.password||c.pathname!=="/pair"||c.search||!/^#pair=[A-Za-z0-9_-]{43}$/.test(c.hash))throw new Error;const f=qn.parse(c.origin);if(!f)throw new Error;return{endpoint:f,grant:c.hash.slice(6)}}const t=JSON.parse(e);if(t.type!=="agentroam-pair"||t.version!==1||typeof t.server!="string"||typeof t.grant!="string"||!/^[A-Za-z0-9_-]{43}$/.test(t.grant))throw new Error;const n=new URL(t.server);if(n.username||n.password||n.search||n.hash||n.pathname!=="/")throw new Error;const o=qn.parse(t.server);if(!o)throw new Error;return{endpoint:o,grant:t.grant}}catch{throw new Error("这不是 AgentRoam 授权二维码,请扫描电脑终端上新生成的二维码。")}}class uO{ready(){if(!Ts.isNativePlatform())throw new Error("请在 AgentRoam App 中扫码连接。")}async get(t){this.ready();try{return(await vf.get({key:`agentroam-device:${t}`})).value}catch(n){if(String(n).includes("does not exist"))return null;throw new Error("无法读取设备凭证,请重试。")}}async set(t,n){this.ready(),await vf.set({key:`agentroam-device:${t}`,value:n})}async remove(t){this.ready();try{await vf.remove({key:`agentroam-device:${t}`})}catch(n){if(!String(n).includes("does not exist"))throw n}}}async function cO(){if(!Ts.isNativePlatform())throw new Error("请在 AgentRoam App 中使用相机扫码。");try{return(await aO.scanBarcode({hint:nO.QR_CODE,scanInstructions:"扫描电脑上的 AgentRoam 授权二维码",cameraDirection:1})).ScanResult||null}catch(e){if(/cancel/i.test(String(e)))return null;throw new Error("无法打开相机,请在系统设置中允许 AgentRoam 使用相机后重试。")}}class fO{constructor(t,n=(...c)=>fetch(...c),o=()=>window.dispatchEvent(new CustomEvent("webapp:unauthorized"))){this.storage=t,this.transport=n,this.onRevoked=o,this.session=null,this.fetch=async(c,f={})=>{const g=this.session,m=new URL(typeof c=="string"?c:c instanceof URL?c.href:c.url),v=new Headers(f.headers??(c instanceof Request?c.headers:void 0));g&&m.origin===g.origin&&v.set("authorization",`Bearer ${g.token}`);const x=await this.transport(c,{...f,headers:v,credentials:"omit",redirect:"error"});if(g&&this.session===g&&m.origin===g.origin&&(x.status===401||x.status===423)){this.session=null;try{await this.storage.remove(g.origin)}finally{this.onRevoked()}}return x}}async resume(t){const n=await this.storage.get(t.url);this.session=n?{origin:t.url,token:n}:null}async pair(t){const{endpoint:n,grant:o}=lO(t),c=await this.transport(n.api("/api/pairing/qr-exchange"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant:o,name:"我的 App"}),credentials:"omit",redirect:"error",signal:AbortSignal.timeout(1e4)});if(!c.ok)throw new Error(c.status===423?"电脑已锁定远程访问,请先在电脑上解锁。":c.status===410?"二维码已使用或已过期,请在电脑上重新生成。":"扫码连接失败,请检查服务器地址和网络后重试。");const f=await c.json();if(typeof f.token!="string"||!/^[A-Za-z0-9_-]{43}$/.test(f.token))throw new Error("服务器返回了无效的设备凭证。");try{await this.storage.set(n.url,f.token)}catch{throw await this.transport(n.api("/api/pairing/logout"),{method:"POST",headers:{authorization:`Bearer ${f.token}`},credentials:"omit",redirect:"error",signal:AbortSignal.timeout(5e3)}).catch(()=>{}),new Error("无法安全保存设备凭证,请在电脑上重新生成二维码后重试。")}return this.session={origin:n.url,token:f.token},n}async checkAuthorization(){const t=this.session;if(!t)return;const n=await this.fetch(`${t.origin}/api/web-auth/status`,{signal:AbortSignal.timeout(5e3)});if(!n.ok)return;const o=await n.json();if(this.session===t&&(o.locked||o.authenticated===!1)){this.session=null;try{await this.storage.remove(t.origin)}finally{this.onRevoked()}}}}var iu;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(iu||(iu={}));var Zp;(function(e){e.None="NONE",e.Slide="SLIDE",e.Fade="FADE"})(Zp||(Zp={}));const yf=sa("StatusBar");function dO(e){const t=/^#([a-f\d]{6})$/i.exec(e.trim());if(!t)return null;const n=[0,2,4].map(c=>{const f=parseInt(t[1].slice(c,c+2),16)/255;return f<=.04045?f/12.92:((f+.055)/1.055)**2.4}),o=.2126*n[0]+.7152*n[1]+.0722*n[2];return{color:`#${t[1]}`,style:o>.179?iu.Light:iu.Dark}}function hO(){if(Ts.getPlatform()!=="android")return()=>{};const e=document.documentElement;e.dataset.skin=Ol.getState().skin;let t=!1,n=yf.setOverlaysWebView({overlay:!1}).catch(()=>{});const o=()=>{const g=dO(getComputedStyle(e).getPropertyValue("--bg-deepest"));g&&(n=n.then(async()=>{t||(await yf.setBackgroundColor({color:g.color}),await yf.setStyle({style:g.style}))}).catch(()=>{console.warn("Unable to update the Android status bar.")}))},c=new MutationObserver(o);c.observe(e,{attributes:!0,attributeFilter:["data-skin"]});const f=()=>{document.hidden||o()};return document.addEventListener("visibilitychange",f),window.addEventListener("focus",o),o(),()=>{t=!0,c.disconnect(),document.removeEventListener("visibilitychange",f),window.removeEventListener("focus",o)}}const gO="/service-worker.js";function pO(){return typeof window<"u"&&window.isSecureContext===!0&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function xO(e){const t="=".repeat((4-e.length%4)%4),n=`${e}${t}`.replace(/-/g,"+").replace(/_/g,"/"),o=atob(n),c=new Uint8Array(new ArrayBuffer(o.length));for(let f=0;f<o.length;f+=1)c[f]=o.charCodeAt(f);return c}async function Qp(e){const{publicKey:t}=await e.get("/api/push/vapid");if(!t)return;const n=await navigator.serviceWorker.register(gO),c=await n.pushManager.getSubscription()??await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:xO(t)});await e.post("/api/push/subscribe",c.toJSON())}function mO(e){pO()&&(async()=>{try{if(Notification.permission==="granted"){await Qp(e);return}if(Notification.permission!=="default")return;const t=()=>{(async()=>{try{await Notification.requestPermission()==="granted"&&await Qp(e)}catch{}})()};document.addEventListener("pointerdown",t,{once:!0})}catch{}})()}class Ef extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}const qp=10,wO=13,ci=32;function Cf(e){}function vO(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");const{onEvent:t=Cf,onError:n=Cf,onRetry:o=Cf,onComment:c,maxBufferSize:f}=e,g=[];let m=0,v=!0,x,C="",A=0,I,O=!1;function k(z){if(O)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(v&&(v=!1,z.charCodeAt(0)===239&&z.charCodeAt(1)===187&&z.charCodeAt(2)===191&&(z=z.slice(3))),g.length===0){const X=G(z);X!==""&&(g.push(X),m=X.length),M();return}if(z.indexOf(`
|
|
82
82
|
`)===-1&&z.indexOf("\r")===-1){g.push(z),m+=z.length,M();return}g.push(z);const j=g.join("");g.length=0,m=0;const B=G(j);B!==""&&(g.push(B),m=B.length),M()}function M(){f!==void 0&&(m+C.length<=f||(O=!0,g.length=0,m=0,x=void 0,C="",A=0,I=void 0,n(new Ef(`Buffered data exceeded max buffer size of ${f} characters`,{type:"max-buffer-size-exceeded"}))))}function G(z){let j=0;if(z.indexOf("\r")===-1){let B=z.indexOf(`
|
|
83
83
|
`,j);for(;B!==-1;){if(j===B){A>0&&t({id:x,event:I,data:C}),x=void 0,C="",A=0,I=void 0,j=B+1,B=z.indexOf(`
|
|
84
84
|
`,j);continue}const X=z.charCodeAt(j);if(Jp(z,j,X)){const V=z.charCodeAt(j+5)===ci?j+6:j+5,oe=z.slice(V,B);if(A===0&&z.charCodeAt(B+1)===qp){t({id:x,event:I,data:oe}),x=void 0,C="",I=void 0,j=B+2,B=z.indexOf(`
|
|
@@ -87,4 +87,4 @@ ${oe}`,A++}else e2(z,j,X)?I=z.slice(z.charCodeAt(j+6)===ci?j+7:j+6,B)||void 0:N(
|
|
|
87
87
|
`,j)}return z.slice(j)}for(;j<z.length;){const B=z.indexOf("\r",j),X=z.indexOf(`
|
|
88
88
|
`,j);let V=-1;if(B!==-1&&X!==-1?V=B<X?B:X:B!==-1?B===z.length-1?V=-1:V=B:X!==-1&&(V=X),V===-1)break;N(z,j,V),j=V+1,z.charCodeAt(j-1)===wO&&z.charCodeAt(j)===qp&&j++}return z.slice(j)}function N(z,j,B){if(j===B){_();return}const X=z.charCodeAt(j);if(Jp(z,j,X)){const Te=z.charCodeAt(j+5)===ci?j+6:j+5,H=z.slice(Te,B);C=A===0?H:`${C}
|
|
89
89
|
${H}`,A++;return}if(e2(z,j,X)){I=z.slice(z.charCodeAt(j+6)===ci?j+7:j+6,B)||void 0;return}if(X===105&&z.charCodeAt(j+1)===100&&z.charCodeAt(j+2)===58){const Te=z.slice(z.charCodeAt(j+3)===ci?j+4:j+3,B);Te.includes("\0")||(x=Te);return}if(X===58){if(c){const Te=z.slice(j,B);c(Te.slice(z.charCodeAt(j+1)===ci?2:1))}return}const V=z.slice(j,B),oe=V.indexOf(":");if(oe===-1){T(V,"",V);return}const ye=V.slice(0,oe),se=V.charCodeAt(oe+1)===ci?2:1,ge=V.slice(oe+se);T(ye,ge,V)}function T(z,j,B){switch(z){case"event":I=j||void 0;break;case"data":C=A===0?j:`${C}
|
|
90
|
-
${j}`,A++;break;case"id":j.includes("\0")||(x=j);break;case"retry":/^\d+$/.test(j)?o(parseInt(j,10)):n(new Ef(`Invalid \`retry\` value: "${j}"`,{type:"invalid-retry",value:j,line:B}));break;default:n(new Ef(`Unknown field "${z.length>20?`${z.slice(0,20)}…`:z}"`,{type:"unknown-field",field:z,value:j,line:B}));break}}function _(){A>0&&t({id:x,event:I,data:C}),x=void 0,C="",A=0,I=void 0}function U(z={}){if(z.consume&&g.length>0){const j=g.join("");N(j,0,j.length)}v=!0,x=void 0,C="",A=0,I=void 0,g.length=0,m=0,O=!1}return{feed:k,reset:U}}function Jp(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function e2(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}class t2 extends Event{constructor(t,n){var o,c;super(t),this.code=(o=n==null?void 0:n.code)!=null?o:void 0,this.message=(c=n==null?void 0:n.message)!=null?c:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,o){return o(r2(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(r2(this),n)}}function yO(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function F1(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(F1).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${F1(e.cause)}`:e.message:`${e}`}function r2(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var pv=e=>{throw TypeError(e)},Id=(e,t,n)=>t.has(e)||pv("Cannot "+n),Ee=(e,t,n)=>(Id(e,t,"read from private field"),n?n.call(e):t.get(e)),wt=(e,t,n)=>t.has(e)?pv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Xe=(e,t,n,o)=>(Id(e,t,"write to private field"),t.set(e,n),n),un=(e,t,n)=>(Id(e,t,"access private method"),n),rr,hi,Vi,yl,su,Io,os,To,Fn,zi,gs,Hi,fo,kr,U1,j1,W1,n2,$1,V1,ho,z1,H1;let El=class extends EventTarget{constructor(t,n){var o,c;super(),wt(this,kr),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,wt(this,rr),wt(this,hi),wt(this,Vi),wt(this,yl),wt(this,su),wt(this,Io),wt(this,os),wt(this,To,null),wt(this,Fn),wt(this,zi),wt(this,gs,null),wt(this,Hi,null),wt(this,fo,null),wt(this,j1,async f=>{var g;Ee(this,zi).reset();const{body:m,redirected:v,status:x,headers:C}=f;if(x===204){un(this,kr,ho).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(v?Xe(this,Vi,new URL(f.url)):Xe(this,Vi,void 0),x!==200){un(this,kr,ho).call(this,`Non-200 status code (${x})`,x);return}if(!(C.get("content-type")||"").startsWith("text/event-stream")){un(this,kr,ho).call(this,'Invalid content type, expected "text/event-stream"',x);return}if(Ee(this,rr)===this.CLOSED)return;Xe(this,rr,this.OPEN);const A=new Event("open");if((g=Ee(this,fo))==null||g.call(this,A),this.dispatchEvent(A),typeof m!="object"||!m||!("getReader"in m)){un(this,kr,ho).call(this,"Invalid response body, expected a web ReadableStream",x),this.close();return}const I=new TextDecoder,O=m.getReader();let k=!0;do{const{done:M,value:G}=await O.read();G&&Ee(this,zi).feed(I.decode(G,{stream:!M})),M&&(k=!1,Ee(this,zi).reset(),un(this,kr,z1).call(this))}while(k)}),wt(this,W1,f=>{Xe(this,Fn,void 0),!(f.name==="AbortError"||f.type==="aborted")&&un(this,kr,z1).call(this,F1(f))}),wt(this,$1,f=>{typeof f.id=="string"&&Xe(this,To,f.id);const g=new MessageEvent(f.event||"message",{data:f.data,origin:Ee(this,Vi)?Ee(this,Vi).origin:Ee(this,hi).origin,lastEventId:f.id||""});Ee(this,Hi)&&(!f.event||f.event==="message")&&Ee(this,Hi).call(this,g),this.dispatchEvent(g)}),wt(this,V1,f=>{Xe(this,Io,f)}),wt(this,H1,()=>{Xe(this,os,void 0),Ee(this,rr)===this.CONNECTING&&un(this,kr,U1).call(this)});try{if(t instanceof URL)Xe(this,hi,t);else if(typeof t=="string")Xe(this,hi,new URL(t,EO()));else throw new Error("Invalid URL")}catch{throw yO("An invalid or illegal string was specified")}Xe(this,zi,vO({onEvent:Ee(this,$1),onRetry:Ee(this,V1)})),Xe(this,rr,this.CONNECTING),Xe(this,Io,3e3),Xe(this,su,(o=n==null?void 0:n.fetch)!=null?o:globalThis.fetch),Xe(this,yl,(c=n==null?void 0:n.withCredentials)!=null?c:!1),un(this,kr,U1).call(this)}get readyState(){return Ee(this,rr)}get url(){return Ee(this,hi).href}get withCredentials(){return Ee(this,yl)}get onerror(){return Ee(this,gs)}set onerror(t){Xe(this,gs,t)}get onmessage(){return Ee(this,Hi)}set onmessage(t){Xe(this,Hi,t)}get onopen(){return Ee(this,fo)}set onopen(t){Xe(this,fo,t)}addEventListener(t,n,o){const c=n;super.addEventListener(t,c,o)}removeEventListener(t,n,o){const c=n;super.removeEventListener(t,c,o)}close(){Ee(this,os)&&clearTimeout(Ee(this,os)),Ee(this,rr)!==this.CLOSED&&(Ee(this,Fn)&&Ee(this,Fn).abort(),Xe(this,rr,this.CLOSED),Xe(this,Fn,void 0))}};rr=new WeakMap,hi=new WeakMap,Vi=new WeakMap,yl=new WeakMap,su=new WeakMap,Io=new WeakMap,os=new WeakMap,To=new WeakMap,Fn=new WeakMap,zi=new WeakMap,gs=new WeakMap,Hi=new WeakMap,fo=new WeakMap,kr=new WeakSet,U1=function(){Xe(this,rr,this.CONNECTING),Xe(this,Fn,new AbortController),Ee(this,su)(Ee(this,hi),un(this,kr,n2).call(this)).then(Ee(this,j1)).catch(Ee(this,W1))},j1=new WeakMap,W1=new WeakMap,n2=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Ee(this,To)?{"Last-Event-ID":Ee(this,To)}:void 0},cache:"no-store",signal:(e=Ee(this,Fn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},$1=new WeakMap,V1=new WeakMap,ho=function(e,t){var n;Ee(this,rr)!==this.CLOSED&&Xe(this,rr,this.CLOSED);const o=new t2("error",{code:t,message:e});(n=Ee(this,gs))==null||n.call(this,o),this.dispatchEvent(o)},z1=function(e,t){var n;if(Ee(this,rr)===this.CLOSED)return;Xe(this,rr,this.CONNECTING);const o=new t2("error",{code:t,message:e});(n=Ee(this,gs))==null||n.call(this,o),this.dispatchEvent(o),Xe(this,os,setTimeout(Ee(this,H1),Ee(this,Io)))},H1=new WeakMap,El.CONNECTING=0,El.OPEN=1,El.CLOSED=2;function EO(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}j6();Gb();Zb();Jb();r_();Bb({baseUrl:()=>ou,source:"webapp"});document.body.dataset.webShell="1";const ju=new y_;ju.isNativeApp()&&(document.body.dataset.nativeApp="1");hO();if(!ju.isNativeApp()&&window.parent===window){const e=document.createElement("link");e.rel="manifest",e.href="/manifest.webmanifest",document.head.append(e);const t=document.querySelector('link[rel="apple-touch-icon"]');t&&(t.href="/pwa/icon-192.png");const n=document.createElement("script");n.src="/pwa/install.js",document.head.append(n)}if(window.parent===window){const e=()=>{const t=Sg.find(o=>o.id===Ol.getState().skin)??Sg[0];document.body.style.background=t.preview[0];let n=document.querySelector('meta[name="theme-color"]');n||(n=document.createElement("meta"),n.name="theme-color",document.head.append(n)),n.content=t.preview[0]};e(),Ol.subscribe(e)}const Mt=ju.isNativeApp()?new fO(new uO):null,G1=new Db(Mt==null?void 0:Mt.fetch),CO=window.parent===window?void 0:new u_,AO=window.parent===window?void 0:new w_;let ou="";const i2=new $b(G1,new Vb,CO,e=>Mt?new El(ou+e,{fetch:Mt.fetch}):new EventSource(ou+e));window.browserLiveApi=AO;const xv=document.getElementById("root");if(!xv)throw new Error("#root missing");const X1=cv(xv);function SO(){return ht.useEffect(()=>{i_()},[]),null}(async()=>{Mt&&window.addEventListener("webapp:unauthorized",()=>location.reload());const e=new v_(ju,new Bp,new C_(Mt?async(n,o)=>{const c=qn.parse(String(n));return c&&await Mt.resume(c),Mt.fetch(n,o)}:void 0)),t=await e.planStartup();if(t.mode==="setup"){X1.render(ee.jsx(S_,{service:e,savedEndpoint:t.endpoint,initialFailure:t.failure,onScan:Mt?async()=>{const n=await cO();if(!n)return null;const o=await Mt.pair(n);return new Bp().save(o),o}:void 0,onConnected:n=>void s2(n)}));return}await s2(t.mode==="ready"?t.endpoint:null)})();async function s2(e){try{e&&(await(Mt==null?void 0:Mt.resume(e)),G1.setBaseUrl(e.url),ou=e.url),window.agentApi=i2,await i2.refreshServerModel(),!Mt&&window.parent===window&&mO(G1);const{default:t}=await Y1(async()=>{const{default:n}=await import("./App-
|
|
90
|
+
${j}`,A++;break;case"id":j.includes("\0")||(x=j);break;case"retry":/^\d+$/.test(j)?o(parseInt(j,10)):n(new Ef(`Invalid \`retry\` value: "${j}"`,{type:"invalid-retry",value:j,line:B}));break;default:n(new Ef(`Unknown field "${z.length>20?`${z.slice(0,20)}…`:z}"`,{type:"unknown-field",field:z,value:j,line:B}));break}}function _(){A>0&&t({id:x,event:I,data:C}),x=void 0,C="",A=0,I=void 0}function U(z={}){if(z.consume&&g.length>0){const j=g.join("");N(j,0,j.length)}v=!0,x=void 0,C="",A=0,I=void 0,g.length=0,m=0,O=!1}return{feed:k,reset:U}}function Jp(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function e2(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}class t2 extends Event{constructor(t,n){var o,c;super(t),this.code=(o=n==null?void 0:n.code)!=null?o:void 0,this.message=(c=n==null?void 0:n.message)!=null?c:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,o){return o(r2(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(r2(this),n)}}function yO(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function F1(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(F1).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${F1(e.cause)}`:e.message:`${e}`}function r2(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var pv=e=>{throw TypeError(e)},Id=(e,t,n)=>t.has(e)||pv("Cannot "+n),Ee=(e,t,n)=>(Id(e,t,"read from private field"),n?n.call(e):t.get(e)),wt=(e,t,n)=>t.has(e)?pv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Xe=(e,t,n,o)=>(Id(e,t,"write to private field"),t.set(e,n),n),un=(e,t,n)=>(Id(e,t,"access private method"),n),rr,hi,Vi,yl,su,Io,os,To,Fn,zi,gs,Hi,fo,kr,U1,j1,W1,n2,$1,V1,ho,z1,H1;let El=class extends EventTarget{constructor(t,n){var o,c;super(),wt(this,kr),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,wt(this,rr),wt(this,hi),wt(this,Vi),wt(this,yl),wt(this,su),wt(this,Io),wt(this,os),wt(this,To,null),wt(this,Fn),wt(this,zi),wt(this,gs,null),wt(this,Hi,null),wt(this,fo,null),wt(this,j1,async f=>{var g;Ee(this,zi).reset();const{body:m,redirected:v,status:x,headers:C}=f;if(x===204){un(this,kr,ho).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(v?Xe(this,Vi,new URL(f.url)):Xe(this,Vi,void 0),x!==200){un(this,kr,ho).call(this,`Non-200 status code (${x})`,x);return}if(!(C.get("content-type")||"").startsWith("text/event-stream")){un(this,kr,ho).call(this,'Invalid content type, expected "text/event-stream"',x);return}if(Ee(this,rr)===this.CLOSED)return;Xe(this,rr,this.OPEN);const A=new Event("open");if((g=Ee(this,fo))==null||g.call(this,A),this.dispatchEvent(A),typeof m!="object"||!m||!("getReader"in m)){un(this,kr,ho).call(this,"Invalid response body, expected a web ReadableStream",x),this.close();return}const I=new TextDecoder,O=m.getReader();let k=!0;do{const{done:M,value:G}=await O.read();G&&Ee(this,zi).feed(I.decode(G,{stream:!M})),M&&(k=!1,Ee(this,zi).reset(),un(this,kr,z1).call(this))}while(k)}),wt(this,W1,f=>{Xe(this,Fn,void 0),!(f.name==="AbortError"||f.type==="aborted")&&un(this,kr,z1).call(this,F1(f))}),wt(this,$1,f=>{typeof f.id=="string"&&Xe(this,To,f.id);const g=new MessageEvent(f.event||"message",{data:f.data,origin:Ee(this,Vi)?Ee(this,Vi).origin:Ee(this,hi).origin,lastEventId:f.id||""});Ee(this,Hi)&&(!f.event||f.event==="message")&&Ee(this,Hi).call(this,g),this.dispatchEvent(g)}),wt(this,V1,f=>{Xe(this,Io,f)}),wt(this,H1,()=>{Xe(this,os,void 0),Ee(this,rr)===this.CONNECTING&&un(this,kr,U1).call(this)});try{if(t instanceof URL)Xe(this,hi,t);else if(typeof t=="string")Xe(this,hi,new URL(t,EO()));else throw new Error("Invalid URL")}catch{throw yO("An invalid or illegal string was specified")}Xe(this,zi,vO({onEvent:Ee(this,$1),onRetry:Ee(this,V1)})),Xe(this,rr,this.CONNECTING),Xe(this,Io,3e3),Xe(this,su,(o=n==null?void 0:n.fetch)!=null?o:globalThis.fetch),Xe(this,yl,(c=n==null?void 0:n.withCredentials)!=null?c:!1),un(this,kr,U1).call(this)}get readyState(){return Ee(this,rr)}get url(){return Ee(this,hi).href}get withCredentials(){return Ee(this,yl)}get onerror(){return Ee(this,gs)}set onerror(t){Xe(this,gs,t)}get onmessage(){return Ee(this,Hi)}set onmessage(t){Xe(this,Hi,t)}get onopen(){return Ee(this,fo)}set onopen(t){Xe(this,fo,t)}addEventListener(t,n,o){const c=n;super.addEventListener(t,c,o)}removeEventListener(t,n,o){const c=n;super.removeEventListener(t,c,o)}close(){Ee(this,os)&&clearTimeout(Ee(this,os)),Ee(this,rr)!==this.CLOSED&&(Ee(this,Fn)&&Ee(this,Fn).abort(),Xe(this,rr,this.CLOSED),Xe(this,Fn,void 0))}};rr=new WeakMap,hi=new WeakMap,Vi=new WeakMap,yl=new WeakMap,su=new WeakMap,Io=new WeakMap,os=new WeakMap,To=new WeakMap,Fn=new WeakMap,zi=new WeakMap,gs=new WeakMap,Hi=new WeakMap,fo=new WeakMap,kr=new WeakSet,U1=function(){Xe(this,rr,this.CONNECTING),Xe(this,Fn,new AbortController),Ee(this,su)(Ee(this,hi),un(this,kr,n2).call(this)).then(Ee(this,j1)).catch(Ee(this,W1))},j1=new WeakMap,W1=new WeakMap,n2=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Ee(this,To)?{"Last-Event-ID":Ee(this,To)}:void 0},cache:"no-store",signal:(e=Ee(this,Fn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},$1=new WeakMap,V1=new WeakMap,ho=function(e,t){var n;Ee(this,rr)!==this.CLOSED&&Xe(this,rr,this.CLOSED);const o=new t2("error",{code:t,message:e});(n=Ee(this,gs))==null||n.call(this,o),this.dispatchEvent(o)},z1=function(e,t){var n;if(Ee(this,rr)===this.CLOSED)return;Xe(this,rr,this.CONNECTING);const o=new t2("error",{code:t,message:e});(n=Ee(this,gs))==null||n.call(this,o),this.dispatchEvent(o),Xe(this,os,setTimeout(Ee(this,H1),Ee(this,Io)))},H1=new WeakMap,El.CONNECTING=0,El.OPEN=1,El.CLOSED=2;function EO(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}j6();Gb();Zb();Jb();r_();Bb({baseUrl:()=>ou,source:"webapp"});document.body.dataset.webShell="1";const ju=new y_;ju.isNativeApp()&&(document.body.dataset.nativeApp="1");hO();if(!ju.isNativeApp()&&window.parent===window){const e=document.createElement("link");e.rel="manifest",e.href="/manifest.webmanifest",document.head.append(e);const t=document.querySelector('link[rel="apple-touch-icon"]');t&&(t.href="/pwa/icon-192.png");const n=document.createElement("script");n.src="/pwa/install.js",document.head.append(n)}if(window.parent===window){const e=()=>{const t=Sg.find(o=>o.id===Ol.getState().skin)??Sg[0];document.body.style.background=t.preview[0];let n=document.querySelector('meta[name="theme-color"]');n||(n=document.createElement("meta"),n.name="theme-color",document.head.append(n)),n.content=t.preview[0]};e(),Ol.subscribe(e)}const Mt=ju.isNativeApp()?new fO(new uO):null,G1=new Db(Mt==null?void 0:Mt.fetch),CO=window.parent===window?void 0:new u_,AO=window.parent===window?void 0:new w_;let ou="";const i2=new $b(G1,new Vb,CO,e=>Mt?new El(ou+e,{fetch:Mt.fetch}):new EventSource(ou+e));window.browserLiveApi=AO;const xv=document.getElementById("root");if(!xv)throw new Error("#root missing");const X1=cv(xv);function SO(){return ht.useEffect(()=>{i_()},[]),null}(async()=>{Mt&&window.addEventListener("webapp:unauthorized",()=>location.reload());const e=new v_(ju,new Bp,new C_(Mt?async(n,o)=>{const c=qn.parse(String(n));return c&&await Mt.resume(c),Mt.fetch(n,o)}:void 0)),t=await e.planStartup();if(t.mode==="setup"){X1.render(ee.jsx(S_,{service:e,savedEndpoint:t.endpoint,initialFailure:t.failure,onScan:Mt?async()=>{const n=await cO();if(!n)return null;const o=await Mt.pair(n);return new Bp().save(o),o}:void 0,onConnected:n=>void s2(n)}));return}await s2(t.mode==="ready"?t.endpoint:null)})();async function s2(e){try{e&&(await(Mt==null?void 0:Mt.resume(e)),G1.setBaseUrl(e.url),ou=e.url),window.agentApi=i2,await i2.refreshServerModel(),!Mt&&window.parent===window&&mO(G1);const{default:t}=await Y1(async()=>{const{default:n}=await import("./App-Bnv7-jUZ.js").then(o=>o.A);return{default:n}},__vite__mapDeps([0,1]),import.meta.url);X1.render(ee.jsxs(ht.StrictMode,{children:[ee.jsx(W6.Provider,{value:ee.jsx(_b,{}),children:ee.jsx(t,{})}),ee.jsx(SO,{})]})),Mt&&setInterval(()=>{Mt.checkAuthorization().catch(()=>{})},1e4),e||(window.addEventListener("webapp:unauthorized",()=>location.reload()),IO())}catch(t){X1.render(ee.jsx("div",{style:{minHeight:"100dvh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"#f5f6fa",boxSizing:"border-box"},children:ee.jsxs("div",{style:{maxWidth:560,background:"#fff",borderRadius:12,padding:20,boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},children:[ee.jsx("h2",{style:{margin:"0 0 8px",fontSize:16,color:"#dc2626"},children:"界面启动失败"}),ee.jsx("p",{style:{margin:"0 0 12px",fontSize:13,color:"#374151",wordBreak:"break-all"},children:t instanceof Error?`${t.name}: ${t.message}`:String(t)}),ee.jsx("button",{type:"button",onClick:()=>location.reload(),style:{padding:"8px 20px",fontSize:14,borderRadius:8,border:"1px solid #d6d9e0",background:"#fff",cursor:"pointer"},children:"重试"})]})}))}}function IO(){const e=[...document.scripts].map(n=>n.src).join(",").match(/index-([^/]+)\.js/),t=e?e[1]:null;t&&setInterval(async()=>{try{const n=await fetch("/api/agent/model",{credentials:"same-origin",cache:"no-store"});if(n.status===401||n.status===423){location.reload();return}const c=((await n.json()).buildId||"").replace(/^index-|\.js$/g,"");c&&c!==t&&location.reload()}catch{}},6e4)}export{W6 as B,B1 as C,bO as H,RO as L,e_ as O,fy as R,Sg as S,fv as W,Y1 as _,nO as a,uv as b,dn as c,gT as d,TO as e,o2 as g,ET as i,ee as j,ht as r,Ol as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,l as s,D as o,d as i}from"./mermaid.core-
|
|
1
|
+
import{_ as e,l as s,D as o,d as i}from"./mermaid.core-BVUH1a8m.js";import{p as g}from"./cynefin-OW5HDTMX-DNC_aald.js";import"./index-D1I5RKVk.js";var p={parse:e(async r=>{const a=await g("info",r);s.debug(a)},"parse")},d={version:"11.17.2"},v=e(()=>d.version,"getVersion"),m={getVersion:v},c=e((r,a,n)=>{s.debug(`rendering info diagram
|
|
2
2
|
`+r);const t=o(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),l={draw:c},b={parser:p,db:m,renderer:l};export{b as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as o,c as ot,L as ut,D as dt,an as yt,p as ft,k as pt,n as it,a as gt,b as kt,g as mt,s as wt,o as _t,d as bt}from"./mermaid.core-
|
|
1
|
+
import{_ as o,c as ot,L as ut,D as dt,an as yt,p as ft,k as pt,n as it,a as gt,b as kt,g as mt,s as wt,o as _t,d as bt}from"./mermaid.core-BVUH1a8m.js";import"./index-D1I5RKVk.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,q,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
3
|
Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(B[0]){case 1:i.push(A),p.push(b.yytext),n.push(b.yylloc),i.push(B[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),q=this.performAction.apply(H,[w,S,I,C.yy,B[1],p,n].concat(R)),typeof q<"u")return q;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[B[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as gt}from"./chunk-5VM5RSS4-
|
|
1
|
+
import{g as gt}from"./chunk-5VM5RSS4-V40WX1nt.js";import{a as mt,b as lt,h as xt,d as kt}from"./chunk-F27PBJKO-CiCQWcQf.js";import{g as _t,s as vt,a as bt,b as wt,o as Tt,n as St,_ as s,c as R,j as G,d as $t,p as Mt}from"./mermaid.core-BVUH1a8m.js";import{d as it}from"./arc-YykeV-yA.js";import"./index-D1I5RKVk.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
3
|
Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as c,l as te,c as W,D as fe,af as ye,ag as be,ah as me,Y as _e,B as K,i as G,H as ke,J as Ee,V as Se,W as le,X as ce}from"./mermaid.core-
|
|
1
|
+
import{_ as c,l as te,c as W,D as fe,af as ye,ag as be,ah as me,Y as _e,B as K,i as G,H as ke,J as Ee,V as Se,W as le,X as ce}from"./mermaid.core-BVUH1a8m.js";import{g as Ne}from"./chunk-5VM5RSS4-V40WX1nt.js";import"./index-D1I5RKVk.js";var $=function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],H=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],j=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:H}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:H}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:j}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:j}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,F={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
|
|
2
2
|
`+m.showPosition()+`
|
|
3
3
|
Expecting `+Y.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:Y})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],F.$=u[u.length-I],F._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(F._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(F,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(F.$),e.push(F._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|