diff --git a/3028.703e9966d0e318f5.js b/3028.703e9966d0e318f5.js deleted file mode 100644 index 30e13bea..00000000 --- a/3028.703e9966d0e318f5.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[3028],{73028:(U,F,n)=>{n.r(F),n.d(F,{CommunityComponent:()=>W});var t=n(54438),p=n(88834),o=n(25596),E=n(99213),l=n(96850),h=n(98703),_=n(30046),m=n(3902),u=n(60177),f=n(28741),k=n(55911),g=n(99631),C=n(96084),j=n(36815),d=n(53719);const r=()=>["/profile","did:dht:my6nm5s1n9xmuuh5yixe668k7xbkmmuddzatn1fojzgdg5f5to8y"];function b(a,i){1&a&&(t.j41(0,"mat-icon",2),t.EFF(1,"chat"),t.k0s(),t.j41(2,"span",3),t.EFF(3,"Discussions"),t.k0s())}function v(a,i){1&a&&(t.j41(0,"div",4)(1,"mat-card",5)(2,"mat-card-content")(3,"button",6)(4,"mat-icon"),t.EFF(5,"chat"),t.k0s(),t.EFF(6," Post "),t.k0s(),t.j41(7,"button",6)(8,"mat-icon"),t.EFF(9,"event"),t.k0s(),t.EFF(10," Event "),t.k0s(),t.j41(11,"button",6)(12,"mat-icon"),t.EFF(13,"photo_library"),t.k0s(),t.EFF(14," Media "),t.k0s(),t.j41(15,"button",6)(16,"mat-icon"),t.EFF(17,"attach_file"),t.k0s(),t.EFF(18," File "),t.k0s()()(),t.j41(19,"mat-card",7)(20,"mat-card-header"),t.nrm(21,"img",8),t.j41(22,"mat-card-title"),t.EFF(23,"Sondre"),t.k0s(),t.j41(24,"mat-card-subtitle"),t.EFF(25),t.nI1(26,"ago"),t.k0s()(),t.j41(27,"mat-card-content")(28,"p"),t.EFF(29," Lorem ipsum dolor sit amet consectetur adipisicing elit. Esse cupiditate omnis consectetur facere modi dolore ipsum harum, distinctio corrupti aliquam possimus explicabo! Distinctio, adipisci. Ipsum, repellat! Velit eos consectetur in. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Culpa vero accusantium rem repudiandae velit praesentium explicabo sit! Amet nulla repellat beatae pariatur, velit eius ut sunt, placeat labore, esse saepe? "),t.k0s()(),t.j41(30,"mat-card-actions")(31,"button",9),t.EFF(32,"LIKE"),t.k0s(),t.j41(33,"button",9),t.EFF(34,"COMMENT"),t.k0s()()(),t.j41(35,"mat-card",7)(36,"mat-card-header"),t.nrm(37,"img",10),t.j41(38,"mat-card-title"),t.EFF(39,"Lu"),t.k0s(),t.j41(40,"mat-card-subtitle"),t.EFF(41),t.nI1(42,"ago"),t.k0s()(),t.j41(43,"mat-card-content")(44,"p"),t.EFF(45," Lorem ipsum dolor sit amet consectetur adipisicing elit. Esse cupiditate omnis consectetur facere modi dolore ipsum harum, distinctio corrupti aliquam possimus explicabo! Distinctio, adipisci. Ipsum, repellat! Velit eos consectetur in. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Culpa vero accusantium rem repudiandae velit praesentium explicabo sit! Amet nulla repellat beatae pariatur, velit eius ut sunt, placeat labore, esse saepe? "),t.k0s()(),t.j41(46,"mat-card-actions")(47,"button",9),t.EFF(48,"LIKE"),t.k0s(),t.j41(49,"button",9),t.EFF(50,"COMMENT"),t.k0s()()()()),2&a&&(t.R7$(25),t.JRh(t.bMT(26,2,"2024-07-16 10:00")),t.R7$(16),t.JRh(t.bMT(42,4,"2024-07-16 14:00")))}function M(a,i){1&a&&(t.j41(0,"mat-icon",2),t.EFF(1,"group"),t.k0s(),t.j41(2,"span",3),t.EFF(3,"Members"),t.k0s())}function O(a,i){if(1&a){const e=t.RV6();t.j41(0,"mat-form-field",21)(1,"mat-label"),t.EFF(2,"Search"),t.k0s(),t.nrm(3,"input",22),t.j41(4,"mat-icon",23),t.EFF(5,"search"),t.k0s()(),t.j41(6,"button",24),t.bIt("click",function(){t.eBV(e);const c=t.XpG(2);return t.Njj(c.hideMembersSearch())}),t.j41(7,"mat-icon"),t.EFF(8,"close"),t.k0s()()}}function y(a,i){if(1&a){const e=t.RV6();t.j41(0,"button",6)(1,"mat-icon"),t.EFF(2,"chat"),t.k0s(),t.EFF(3," Add Member "),t.k0s(),t.j41(4,"button",6)(5,"mat-icon"),t.EFF(6,"event"),t.k0s(),t.EFF(7," Invite "),t.k0s(),t.j41(8,"button",25),t.bIt("click",function(){t.eBV(e);const c=t.XpG(2);return t.Njj(c.searchMembers())}),t.j41(9,"mat-icon"),t.EFF(10,"seardh"),t.k0s(),t.EFF(11," Search "),t.k0s()}}function P(a,i){if(1&a&&(t.j41(0,"div",4)(1,"mat-card",5)(2,"mat-card-content",11),t.DNE(3,O,9,0)(4,y,12,0),t.k0s()(),t.j41(5,"div",12)(6,"a",13),t.nrm(7,"img",14),t.k0s(),t.j41(8,"a",15),t.nrm(9,"img",16),t.k0s(),t.j41(10,"a",15),t.nrm(11,"img",17),t.k0s(),t.j41(12,"a",15),t.nrm(13,"img",18),t.k0s(),t.j41(14,"a",15),t.nrm(15,"img",19),t.k0s(),t.j41(16,"a",15),t.nrm(17,"img",20),t.k0s()()()),2&a){const e=t.XpG();t.R7$(3),t.vxM(e.searchingMembers()?3:4),t.R7$(3),t.Y8G("routerLink",t.lJ4(7,r)),t.R7$(2),t.Y8G("routerLink",t.lJ4(8,r)),t.R7$(2),t.Y8G("routerLink",t.lJ4(9,r)),t.R7$(2),t.Y8G("routerLink",t.lJ4(10,r)),t.R7$(2),t.Y8G("routerLink",t.lJ4(11,r)),t.R7$(2),t.Y8G("routerLink",t.lJ4(12,r))}}function T(a,i){1&a&&(t.j41(0,"mat-icon",2),t.EFF(1,"event"),t.k0s(),t.j41(2,"span",3),t.EFF(3,"Events"),t.k0s())}function R(a,i){1&a&&(t.j41(0,"div",4)(1,"mat-card",5)(2,"mat-card-content")(3,"button",6)(4,"mat-icon"),t.EFF(5,"add"),t.k0s(),t.EFF(6," Create event "),t.k0s()()(),t.j41(7,"mat-card",26)(8,"mat-card-header")(9,"mat-card-title"),t.EFF(10,"Upcoming events"),t.k0s()(),t.j41(11,"mat-card-content")(12,"mat-list")(13,"mat-list-item")(14,"mat-icon",27),t.EFF(15,"event"),t.k0s(),t.j41(16,"div",28),t.EFF(17,"Summer Party 2024"),t.k0s(),t.j41(18,"div",29),t.EFF(19),t.nI1(20,"date"),t.k0s()(),t.j41(21,"mat-list-item")(22,"mat-icon",27),t.EFF(23,"event"),t.k0s(),t.j41(24,"div",28),t.EFF(25,"Workshop #5"),t.k0s(),t.j41(26,"div",29),t.EFF(27),t.nI1(28,"date"),t.k0s()()()(),t.j41(29,"mat-card-actions")(30,"button",9),t.EFF(31,"SEE MORE"),t.k0s()()(),t.j41(32,"mat-card",26)(33,"mat-card-header")(34,"mat-card-title"),t.EFF(35,"Past events"),t.k0s()(),t.j41(36,"mat-card-content")(37,"mat-list")(38,"mat-list-item")(39,"mat-icon",27),t.EFF(40,"event"),t.k0s(),t.j41(41,"div",28),t.EFF(42,"Workshop #4"),t.k0s(),t.j41(43,"div",29),t.EFF(44),t.nI1(45,"date"),t.k0s()()()(),t.j41(46,"mat-card-actions")(47,"button",9),t.EFF(48,"SEE MORE"),t.k0s()()()()),2&a&&(t.R7$(19),t.JRh(t.bMT(20,3,"2024-07-16 10:00")),t.R7$(8),t.JRh(t.bMT(28,5,"2024-07-30 10:00")),t.R7$(17),t.JRh(t.bMT(45,7,"2024-07-30 10:00")))}function D(a,i){1&a&&(t.j41(0,"mat-icon",2),t.EFF(1,"photo_library"),t.k0s(),t.j41(2,"span",3),t.EFF(3,"Media"),t.k0s())}function x(a,i){if(1&a&&(t.j41(0,"mat-card"),t.nrm(1,"img",32),t.k0s()),2&a){const e=i.$implicit;t.R7$(),t.Y8G("src",e.thumbnail,t.B4B)}}function I(a,i){if(1&a&&(t.j41(0,"div",4)(1,"div",30),t.DNE(2,x,2,1,"mat-card",31),t.k0s()()),2&a){const e=t.XpG();t.R7$(2),t.Y8G("ngForOf",e.photos())}}function L(a,i){1&a&&(t.j41(0,"mat-icon",2),t.EFF(1,"attach_file"),t.k0s(),t.j41(2,"span",3),t.EFF(3,"Files"),t.k0s())}function A(a,i){if(1&a){const e=t.RV6();t.j41(0,"mat-form-field",21)(1,"mat-label"),t.EFF(2,"Search"),t.k0s(),t.nrm(3,"input",22),t.j41(4,"mat-icon",23),t.EFF(5,"search"),t.k0s()(),t.j41(6,"button",24),t.bIt("click",function(){t.eBV(e);const c=t.XpG(2);return t.Njj(c.hideMembersSearch())}),t.j41(7,"mat-icon"),t.EFF(8,"close"),t.k0s()()}}function $(a,i){1&a&&(t.j41(0,"button",6)(1,"mat-icon"),t.EFF(2,"attach_file"),t.k0s(),t.EFF(3," Upload file "),t.k0s())}function B(a,i){if(1&a&&(t.j41(0,"div",4)(1,"mat-card",5)(2,"mat-card-content",11),t.DNE(3,A,9,0)(4,$,4,0,"button",6),t.k0s()(),t.j41(5,"mat-card",33)(6,"mat-card-content")(7,"mat-list")(8,"mat-list-item")(9,"mat-icon",27),t.EFF(10,"attach_file"),t.k0s(),t.j41(11,"div",28),t.EFF(12,"Community Rules.pdf"),t.k0s(),t.j41(13,"div",29),t.EFF(14),t.nI1(15,"date"),t.nI1(16,"size"),t.k0s()(),t.j41(17,"mat-list-item")(18,"mat-icon",27),t.EFF(19,"attach_file"),t.k0s(),t.j41(20,"div",28),t.EFF(21,"Admin instructions.pdf"),t.k0s(),t.j41(22,"div",29),t.EFF(23),t.nI1(24,"date"),t.nI1(25,"size"),t.k0s()()()()()()),2&a){const e=t.XpG();t.R7$(3),t.vxM(e.searchingMembers()?3:4),t.R7$(11),t.Lme("",t.bMT(15,5,"2024-07-16 10:00")," | ",t.bMT(16,7,"100000"),""),t.R7$(9),t.Lme("",t.bMT(24,9,"2024-07-30 10:00")," | ",t.bMT(25,11,"350000"),"")}}let W=(()=>{class a{constructor(){this.images=["nature","sky","grass","mountains","rivers","glacier","forest","streams","rain","clouds"],this.photos=(0,t.vPA)([]),this.app=(0,t.WQX)(C.d),this.layout=(0,t.WQX)(j.Y),this.searchingMembers=(0,t.vPA)(!1)}ngOnInit(){this.layout.marginOff();const e=[];for(let s=0;s{a.r(g),a.d(g,{CommunityComponent:()=>z});var h=a(10467),t=a(54438),C=a(88834),l=a(25596),M=a(99213),u=a(96850),b=a(98703),F=a(30046),d=a(3902),f=a(60177),E=a(28741),O=a(55911),v=a(99631),y=a(96084),T=a(36815),R=a(85297),j=a(9183),k=a(14823),o=a(60385),p=a(53719);const i=()=>["/profile","did:dht:my6nm5s1n9xmuuh5yixe668k7xbkmmuddzatn1fojzgdg5f5to8y"];function m(n,s){1&n&&(t.j41(0,"mat-icon",2),t.EFF(1,"info"),t.k0s(),t.j41(2,"span",3),t.EFF(3,"About"),t.k0s())}function c(n,s){if(1&n&&(t.j41(0,"div",4)(1,"mat-card",5)(2,"mat-card-header")(3,"mat-card-title"),t.EFF(4,"About this community"),t.k0s(),t.j41(5,"mat-card-subtitle",6),t.EFF(6),t.nI1(7,"ago"),t.k0s()(),t.j41(8,"mat-card-content")(9,"p"),t.EFF(10),t.k0s(),t.j41(11,"p"),t.EFF(12," Tier: "),t.j41(13,"strong",7),t.EFF(14),t.k0s()(),t.j41(15,"p"),t.EFF(16," Type: "),t.j41(17,"strong",7),t.EFF(18),t.k0s()(),t.j41(19,"p"),t.EFF(20," Membership fee: $"),t.j41(21,"strong"),t.EFF(22),t.k0s()(),t.j41(23,"p"),t.EFF(24," Max members: "),t.j41(25,"strong"),t.EFF(26),t.k0s()()()(),t.j41(27,"mat-card",5)(28,"mat-card-header")(29,"mat-card-title"),t.EFF(30,"Owner"),t.k0s()(),t.j41(31,"mat-card-content"),t.nrm(32,"app-profile-header",8),t.k0s()()()),2&n){const e=t.XpG(2);t.R7$(5),t.Y8G("matTooltip",e.community().record.dateCreated),t.R7$(),t.SpI("Created ",t.bMT(7,8,e.community().record.dateCreated),""),t.R7$(4),t.SpI("About: ",e.community().data.bio,""),t.R7$(4),t.JRh(e.community().data.option),t.R7$(4),t.JRh(e.community().data.type),t.R7$(4),t.JRh(e.community().data.fee),t.R7$(4),t.JRh(e.community().data.members),t.R7$(6),t.Y8G("did",e.community().data.owners[0])}}function P(n,s){1&n&&(t.j41(0,"mat-icon",2),t.EFF(1,"chat"),t.k0s(),t.j41(2,"span",3),t.EFF(3,"Discussions"),t.k0s())}function I(n,s){1&n&&(t.j41(0,"div",4)(1,"mat-card",9)(2,"mat-card-content")(3,"button",10)(4,"mat-icon"),t.EFF(5,"chat"),t.k0s(),t.EFF(6," Post "),t.k0s(),t.j41(7,"button",10)(8,"mat-icon"),t.EFF(9,"event"),t.k0s(),t.EFF(10," Event "),t.k0s(),t.j41(11,"button",10)(12,"mat-icon"),t.EFF(13,"photo_library"),t.k0s(),t.EFF(14," Media "),t.k0s(),t.j41(15,"button",10)(16,"mat-icon"),t.EFF(17,"attach_file"),t.k0s(),t.EFF(18," File "),t.k0s()()(),t.j41(19,"mat-card",5)(20,"mat-card-header"),t.nrm(21,"img",11),t.j41(22,"mat-card-title"),t.EFF(23,"Sondre"),t.k0s(),t.j41(24,"mat-card-subtitle"),t.EFF(25),t.nI1(26,"ago"),t.k0s()(),t.j41(27,"mat-card-content")(28,"p"),t.EFF(29," Lorem ipsum dolor sit amet consectetur adipisicing elit. Esse cupiditate omnis consectetur facere modi dolore ipsum harum, distinctio corrupti aliquam possimus explicabo! Distinctio, adipisci. Ipsum, repellat! Velit eos consectetur in. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Culpa vero accusantium rem repudiandae velit praesentium explicabo sit! Amet nulla repellat beatae pariatur, velit eius ut sunt, placeat labore, esse saepe? "),t.k0s()(),t.j41(30,"mat-card-actions")(31,"button",12),t.EFF(32,"LIKE"),t.k0s(),t.j41(33,"button",12),t.EFF(34,"COMMENT"),t.k0s()()(),t.j41(35,"mat-card",5)(36,"mat-card-header"),t.nrm(37,"img",13),t.j41(38,"mat-card-title"),t.EFF(39,"Lu"),t.k0s(),t.j41(40,"mat-card-subtitle"),t.EFF(41),t.nI1(42,"ago"),t.k0s()(),t.j41(43,"mat-card-content")(44,"p"),t.EFF(45," Lorem ipsum dolor sit amet consectetur adipisicing elit. Esse cupiditate omnis consectetur facere modi dolore ipsum harum, distinctio corrupti aliquam possimus explicabo! Distinctio, adipisci. Ipsum, repellat! Velit eos consectetur in. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Culpa vero accusantium rem repudiandae velit praesentium explicabo sit! Amet nulla repellat beatae pariatur, velit eius ut sunt, placeat labore, esse saepe? "),t.k0s()(),t.j41(46,"mat-card-actions")(47,"button",12),t.EFF(48,"LIKE"),t.k0s(),t.j41(49,"button",12),t.EFF(50,"COMMENT"),t.k0s()()()()),2&n&&(t.R7$(25),t.JRh(t.bMT(26,2,"2024-07-16 10:00")),t.R7$(16),t.JRh(t.bMT(42,4,"2024-07-16 14:00")))}function L(n,s){1&n&&(t.j41(0,"mat-icon",2),t.EFF(1,"group"),t.k0s(),t.j41(2,"span",3),t.EFF(3,"Members"),t.k0s())}function x(n,s){if(1&n){const e=t.RV6();t.j41(0,"mat-form-field",24)(1,"mat-label"),t.EFF(2,"Search"),t.k0s(),t.nrm(3,"input",25),t.j41(4,"mat-icon",26),t.EFF(5,"search"),t.k0s()(),t.j41(6,"button",27),t.bIt("click",function(){t.eBV(e);const _=t.XpG(3);return t.Njj(_.hideMembersSearch())}),t.j41(7,"mat-icon"),t.EFF(8,"close"),t.k0s()()}}function A(n,s){if(1&n){const e=t.RV6();t.j41(0,"button",10)(1,"mat-icon"),t.EFF(2,"chat"),t.k0s(),t.EFF(3," Add Member "),t.k0s(),t.j41(4,"button",10)(5,"mat-icon"),t.EFF(6,"event"),t.k0s(),t.EFF(7," Invite "),t.k0s(),t.j41(8,"button",28),t.bIt("click",function(){t.eBV(e);const _=t.XpG(3);return t.Njj(_.searchMembers())}),t.j41(9,"mat-icon"),t.EFF(10,"seardh"),t.k0s(),t.EFF(11," Search "),t.k0s()}}function B(n,s){if(1&n&&(t.j41(0,"div",4)(1,"mat-card",9)(2,"mat-card-content",14),t.DNE(3,x,9,0)(4,A,12,0),t.k0s()(),t.j41(5,"div",15)(6,"a",16),t.nrm(7,"img",17),t.k0s(),t.j41(8,"a",18),t.nrm(9,"img",19),t.k0s(),t.j41(10,"a",18),t.nrm(11,"img",20),t.k0s(),t.j41(12,"a",18),t.nrm(13,"img",21),t.k0s(),t.j41(14,"a",18),t.nrm(15,"img",22),t.k0s(),t.j41(16,"a",18),t.nrm(17,"img",23),t.k0s()()()),2&n){const e=t.XpG(2);t.R7$(3),t.vxM(e.searchingMembers()?3:4),t.R7$(3),t.Y8G("routerLink",t.lJ4(7,i)),t.R7$(2),t.Y8G("routerLink",t.lJ4(8,i)),t.R7$(2),t.Y8G("routerLink",t.lJ4(9,i)),t.R7$(2),t.Y8G("routerLink",t.lJ4(10,i)),t.R7$(2),t.Y8G("routerLink",t.lJ4(11,i)),t.R7$(2),t.Y8G("routerLink",t.lJ4(12,i))}}function W(n,s){1&n&&(t.j41(0,"mat-icon",2),t.EFF(1,"event"),t.k0s(),t.j41(2,"span",3),t.EFF(3,"Events"),t.k0s())}function $(n,s){1&n&&(t.j41(0,"div",4)(1,"mat-card",9)(2,"mat-card-content")(3,"button",10)(4,"mat-icon"),t.EFF(5,"add"),t.k0s(),t.EFF(6," Create event "),t.k0s()()(),t.j41(7,"mat-card",29)(8,"mat-card-header")(9,"mat-card-title"),t.EFF(10,"Upcoming events"),t.k0s()(),t.j41(11,"mat-card-content")(12,"mat-list")(13,"mat-list-item")(14,"mat-icon",30),t.EFF(15,"event"),t.k0s(),t.j41(16,"div",31),t.EFF(17,"Summer Party 2024"),t.k0s(),t.j41(18,"div",32),t.EFF(19),t.nI1(20,"date"),t.k0s()(),t.j41(21,"mat-list-item")(22,"mat-icon",30),t.EFF(23,"event"),t.k0s(),t.j41(24,"div",31),t.EFF(25,"Workshop #5"),t.k0s(),t.j41(26,"div",32),t.EFF(27),t.nI1(28,"date"),t.k0s()()()(),t.j41(29,"mat-card-actions")(30,"button",12),t.EFF(31,"SEE MORE"),t.k0s()()(),t.j41(32,"mat-card",29)(33,"mat-card-header")(34,"mat-card-title"),t.EFF(35,"Past events"),t.k0s()(),t.j41(36,"mat-card-content")(37,"mat-list")(38,"mat-list-item")(39,"mat-icon",30),t.EFF(40,"event"),t.k0s(),t.j41(41,"div",31),t.EFF(42,"Workshop #4"),t.k0s(),t.j41(43,"div",32),t.EFF(44),t.nI1(45,"date"),t.k0s()()()(),t.j41(46,"mat-card-actions")(47,"button",12),t.EFF(48,"SEE MORE"),t.k0s()()()()),2&n&&(t.R7$(19),t.JRh(t.bMT(20,3,"2024-07-16 10:00")),t.R7$(8),t.JRh(t.bMT(28,5,"2024-07-30 10:00")),t.R7$(17),t.JRh(t.bMT(45,7,"2024-07-30 10:00")))}function U(n,s){1&n&&(t.j41(0,"mat-icon",2),t.EFF(1,"photo_library"),t.k0s(),t.j41(2,"span",3),t.EFF(3,"Media"),t.k0s())}function G(n,s){if(1&n&&(t.j41(0,"mat-card"),t.nrm(1,"img",35),t.k0s()),2&n){const e=s.$implicit;t.R7$(),t.Y8G("src",e.thumbnail,t.B4B)}}function K(n,s){if(1&n&&(t.j41(0,"div",4)(1,"div",33),t.DNE(2,G,2,1,"mat-card",34),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(2),t.Y8G("ngForOf",e.photos())}}function N(n,s){1&n&&(t.j41(0,"mat-icon",2),t.EFF(1,"attach_file"),t.k0s(),t.j41(2,"span",3),t.EFF(3,"Files"),t.k0s())}function X(n,s){if(1&n){const e=t.RV6();t.j41(0,"mat-form-field",24)(1,"mat-label"),t.EFF(2,"Search"),t.k0s(),t.nrm(3,"input",25),t.j41(4,"mat-icon",26),t.EFF(5,"search"),t.k0s()(),t.j41(6,"button",27),t.bIt("click",function(){t.eBV(e);const _=t.XpG(3);return t.Njj(_.hideMembersSearch())}),t.j41(7,"mat-icon"),t.EFF(8,"close"),t.k0s()()}}function S(n,s){1&n&&(t.j41(0,"button",10)(1,"mat-icon"),t.EFF(2,"attach_file"),t.k0s(),t.EFF(3," Upload file "),t.k0s())}function Y(n,s){if(1&n&&(t.j41(0,"div",4)(1,"mat-card",9)(2,"mat-card-content",14),t.DNE(3,X,9,0)(4,S,4,0,"button",10),t.k0s()(),t.j41(5,"mat-card",36)(6,"mat-card-content")(7,"mat-list")(8,"mat-list-item")(9,"mat-icon",30),t.EFF(10,"attach_file"),t.k0s(),t.j41(11,"div",31),t.EFF(12,"Community Rules.pdf"),t.k0s(),t.j41(13,"div",32),t.EFF(14),t.nI1(15,"date"),t.nI1(16,"size"),t.k0s()(),t.j41(17,"mat-list-item")(18,"mat-icon",30),t.EFF(19,"attach_file"),t.k0s(),t.j41(20,"div",31),t.EFF(21,"Admin instructions.pdf"),t.k0s(),t.j41(22,"div",32),t.EFF(23),t.nI1(24,"date"),t.nI1(25,"size"),t.k0s()()()()()()),2&n){const e=t.XpG(2);t.R7$(3),t.vxM(e.searchingMembers()?3:4),t.R7$(11),t.Lme("",t.bMT(15,5,"2024-07-16 10:00")," | ",t.bMT(16,7,"100000"),""),t.R7$(9),t.Lme("",t.bMT(24,9,"2024-07-30 10:00")," | ",t.bMT(25,11,"350000"),"")}}function J(n,s){1&n&&(t.j41(0,"mat-tab-group")(1,"mat-tab"),t.DNE(2,m,4,0,"ng-template",0)(3,c,33,10,"ng-template",1),t.k0s(),t.j41(4,"mat-tab"),t.DNE(5,P,4,0,"ng-template",0)(6,I,51,6,"ng-template",1),t.k0s(),t.j41(7,"mat-tab"),t.DNE(8,L,4,0,"ng-template",0)(9,B,18,13,"ng-template",1),t.k0s(),t.j41(10,"mat-tab"),t.DNE(11,W,4,0,"ng-template",0)(12,$,49,9,"ng-template",1),t.k0s(),t.j41(13,"mat-tab"),t.DNE(14,U,4,0,"ng-template",0)(15,K,3,1,"ng-template",1),t.k0s(),t.j41(16,"mat-tab"),t.DNE(17,N,4,0,"ng-template",0)(18,Y,26,13,"ng-template",1),t.k0s()())}function V(n,s){1&n&&t.nrm(0,"mat-spinner")}let z=(()=>{class n{constructor(){var e=this;this.images=["nature","sky","grass","mountains","rivers","glacier","forest","streams","rain","clouds"],this.photos=(0,t.vPA)([]),this.app=(0,t.WQX)(y.d),this.layout=(0,t.WQX)(T.Y),this.route=(0,t.WQX)(F.nX),this.data=(0,t.WQX)(R.u),this.selectedCommunity=(0,t.vPA)(null),this.community=(0,t.vPA)(null),this.searchingMembers=(0,t.vPA)(!1),(0,t.QZP)((0,h.A)(function*(){e.app.initialized()&&e.selectedCommunity()&&(yield e.loadCommunity())}))}ngOnInit(){this.layout.marginOff(),this.route.paramMap.subscribe(r=>{this.layout.resetActions();const _=r.get("id");console.log("Loading community: ",_),this.selectedCommunity.set(_&&":id"!=_&&"home"!=_?r.get("id"):null)});const e=[];for(let r=0;r{a.d(g,{w:()=>k});var h=a(10467),t=a(54438),C=a(34635),l=a(25596),M=a(5794),u=a(345),b=a(78013),F=a(33347),d=a(14823),f=a(30046);const E=o=>["/profile",o];function O(o,p){if(1&o&&(t.nrm(0,"img",0),t.nI1(1,"safeResourceUrl")),2&o){const i=t.XpG();t.Y8G("routerLink",t.eq3(4,E,i.did()))("src",t.bMT(1,2,i.data().avatar),t.B4B)}}function v(o,p){if(1&o&&t.nrm(0,"img",1),2&o){const i=t.XpG();t.Y8G("routerLink",t.eq3(2,E,i.did()))("src","/avatar-placeholder.png",t.B4B)}}function y(o,p){if(1&o&&t.EFF(0),2&o){let i;const m=t.XpG(2);t.SpI(" (",null==(i=m.data().profile)?null:i.title,") ")}}function T(o,p){if(1&o&&(t.j41(0,"a",3),t.EFF(1),t.DNE(2,y,1,1),t.k0s()),2&o){let i,m;const c=t.XpG();t.Y8G("routerLink",t.eq3(3,E,c.did())),t.R7$(),t.SpI("",null==(i=c.data().profile)?null:i.name," "),t.R7$(),t.vxM(null!=(m=c.data().profile)&&m.title?2:-1)}}function R(o,p){if(1&o&&t.EFF(0),2&o){let i;const m=t.XpG(2);t.SpI(" (",null==(i=m.data().profile)?null:i.title,") ")}}function j(o,p){if(1&o&&(t.j41(0,"em")(1,"a",3),t.EFF(2,"No name set "),t.DNE(3,R,1,1),t.k0s()()),2&o){let i;const m=t.XpG();t.R7$(),t.Y8G("routerLink",t.eq3(2,E,m.did())),t.R7$(2),t.vxM(null!=(i=m.data().profile)&&i.title?3:-1)}}let k=(()=>{class o{constructor(){this.identity=(0,t.WQX)(C.K),this.profile=(0,t.WQX)(M.p),this.sanitizer=(0,t.WQX)(u.up),this.did=t.hFB.required(),this.data=(0,t.vPA)({})}ngAfterViewInit(){var i=this;return(0,h.A)(function*(){if(i.did()){let m=yield i.profile.loadProfile(i.did());i.data.set(m)}})()}static{this.\u0275fac=function(m){return new(m||o)}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["app-profile-header"]],inputs:{did:[1,"did"]},standalone:!0,features:[t.aNF],decls:10,vars:9,consts:[["mat-card-avatar","","onerror","this.src='/avatar-placeholder.png';this.onerror='';",1,"profile-thumbnail",3,"routerLink","src"],["mat-card-avatar","",1,"profile-thumbnail",3,"routerLink","src"],[1,"profile-header-title"],[3,"routerLink"],[1,"profile-header-subtitle"],[3,"routerLink","matTooltip"]],template:function(m,c){if(1&m&&(t.DNE(0,O,2,6,"img",0)(1,v,1,4,"img",1),t.j41(2,"div")(3,"div",2),t.DNE(4,T,3,5,"a",3)(5,j,4,4,"em"),t.k0s(),t.j41(6,"div",4)(7,"a",5),t.EFF(8),t.nI1(9,"did"),t.k0s()()()),2&m){let P;t.vxM(c.data().avatar?0:1),t.R7$(4),t.vxM(null!=(P=c.data().profile)&&P.name?4:5),t.R7$(3),t.Y8G("routerLink",t.eq3(7,E,c.did()))("matTooltip",c.did()),t.R7$(),t.JRh(t.bMT(9,5,c.did()))}},dependencies:[f.iI,f.Wk,d.uc,d.oV,l.Hu,l.QG,b.d,F.k],styles:[".profile-thumbnail[_ngcontent-%COMP%]{cursor:pointer;border-radius:50%;margin-right:1em}a[_ngcontent-%COMP%]{text-decoration:none}a[_ngcontent-%COMP%]:hover{text-decoration:underline}[_nghost-%COMP%]{display:flex}.profile-header-title[_ngcontent-%COMP%]{font-size:1.4em}.profile-header-subtitle[_ngcontent-%COMP%]{font-size:1em}"]})}}return o})()}}]); \ No newline at end of file diff --git a/404.html b/404.html index 05925a95..65d0388c 100644 --- a/404.html +++ b/404.html @@ -35,5 +35,5 @@ - + diff --git a/6702.17c7d6c5d0ce9ae3.js b/6702.17c7d6c5d0ce9ae3.js deleted file mode 100644 index 796716e8..00000000 --- a/6702.17c7d6c5d0ce9ae3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[6702],{6702:(U,g,a)=>{a.r(g),a.d(g,{CommunitiesComponent:()=>K});var C=a(10467),t=a(54438),u=a(65571),v=a(99213),F=a(99631),S=a(53719),d=a(89417),x=a(60177),c=a(2042),p=a(96695),r=a(9159),l=a(25596),y=a(88834),R=a(45024),j=a(96354),T=a(57786),D=a(7673);class E extends R.qS{constructor(){super()}connect(){if(this.paginator&&this.sort)return(0,T.h)((0,D.of)(this.data),this.paginator.page,this.sort.sortChange).pipe((0,j.T)(()=>this.getPagedData(this.getSortedData([...this.data]))));throw Error("Please set the paginator and sort on the data source before connecting.")}disconnect(){}getPagedData(o){return this.paginator?o.splice(this.paginator.pageIndex*this.paginator.pageSize,this.paginator.pageSize):o}getSortedData(o){return this.sort&&this.sort.active&&""!==this.sort.direction?o.sort((e,n)=>{const s="asc"===this.sort?.direction;switch(this.sort?.active){case"name":return b(e.name,n.name,s);case"id":return b(+e.id,+n.id,s);default:return 0}}):o}}function b(i,o,e){return(i["/communities","create"],z=i=>["/communities","create",i],N=()=>[5,10,20];function Y(i,o){if(1&i&&(t.j41(0,"a",11),t.EFF(1),t.k0s(),t.nrm(2,"br")),2&i){const e=o.$implicit;t.Y8G("routerLink",t.eq3(2,z,e.id)),t.R7$(),t.SpI("",e.data.name," - Awaiting approval")}}function P(i,o){if(1&i&&(t.j41(0,"mat-card",1)(1,"mat-card-content",2)(2,"strong"),t.EFF(3,"NOTICE"),t.k0s(),t.j41(4,"div"),t.EFF(5," You have communities in draft mode. Please review any status update on their verification status. "),t.nrm(6,"br")(7,"br"),t.Z7z(8,Y,3,4,null,null,t.fX1),t.k0s()()()),2&i){const e=t.XpG();t.R7$(8),t.Dyx(e.drafts())}}function B(i,o){if(1&i){const e=t.RV6();t.j41(0,"mat-card")(1,"mat-card-header")(2,"mat-card-title"),t.EFF(3),t.k0s()(),t.nrm(4,"br")(5,"img",12),t.j41(6,"mat-card-content"),t.nrm(7,"br"),t.j41(8,"p"),t.EFF(9),t.k0s()(),t.j41(10,"mat-card-actions")(11,"button",13),t.bIt("click",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.open("did:dht:my6nm5s1n9xmuuh5yixe668k7xbkmmuddzatn1fojzgdg5f5to8y"))}),t.EFF(12,"JOIN"),t.k0s(),t.j41(13,"button",13),t.bIt("click",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.open("did:dht:my6nm5s1n9xmuuh5yixe668k7xbkmmuddzatn1fojzgdg5f5to8y"))}),t.EFF(14,"PREVIEW"),t.k0s()()()}if(2&i){const e=o.$implicit;t.R7$(3),t.SpI("",e.name," "),t.R7$(2),t.Y8G("src",e.thumbnail,t.B4B),t.R7$(4),t.SpI(" ",e.description," ")}}function V(i,o){if(1&i&&(t.j41(0,"div",9),t.Z7z(1,B,15,3,"mat-card",null,t.fX1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.Dyx(e.cards())}}function X(i,o){1&i&&(t.j41(0,"th",23),t.EFF(1,"Id"),t.k0s())}function L(i,o){if(1&i&&(t.j41(0,"td",24),t.EFF(1),t.k0s()),2&i){const e=o.$implicit;t.R7$(),t.JRh(e.id)}}function O(i,o){1&i&&(t.j41(0,"th",23),t.EFF(1,"Name"),t.k0s())}function A(i,o){if(1&i&&(t.j41(0,"td",24),t.EFF(1),t.k0s()),2&i){const e=o.$implicit;t.R7$(),t.JRh(e.name)}}function J(i,o){1&i&&(t.j41(0,"th",23),t.EFF(1,"Description"),t.k0s())}function Q(i,o){if(1&i&&(t.j41(0,"td",24),t.EFF(1),t.k0s()),2&i){const e=o.$implicit;t.R7$(),t.JRh(e.description)}}function H(i,o){1&i&&t.nrm(0,"tr",25)}function W(i,o){1&i&&t.nrm(0,"tr",26)}function Z(i,o){if(1&i&&(t.j41(0,"div",10)(1,"table",14),t.qex(2,15),t.DNE(3,X,2,0,"th",16)(4,L,2,1,"td",17),t.bVm(),t.qex(5,18),t.DNE(6,O,2,0,"th",16)(7,A,2,1,"td",17),t.bVm(),t.qex(8,19),t.DNE(9,J,2,0,"th",16)(10,Q,2,1,"td",17),t.bVm(),t.DNE(11,H,1,0,"tr",20)(12,W,1,0,"tr",21),t.k0s(),t.nrm(13,"mat-paginator",22,0),t.k0s()),2&i){const e=t.XpG();t.R7$(11),t.Y8G("matHeaderRowDef",e.displayedColumns),t.R7$(),t.Y8G("matRowDefColumns",e.displayedColumns),t.R7$(),t.Y8G("length",e.dataSource.data.length)("pageIndex",0)("pageSize",10)("pageSizeOptions",t.lJ4(6,N))}}let K=(()=>{class i{constructor(e){this.router=e,this.search=new d.MJ(""),this.dataSource=new E,this.cards=(0,t.vPA)([]),this.app=(0,t.WQX)($.d),this.layout=(0,t.WQX)(M.Y),this.images=["nature","sky","grass","mountains","rivers","glacier","forest"],this.viewStyle=(0,t.geq)("card"),this.checked=(0,t.geq)(!1),this.displayedColumns=["name","description"],this.data=(0,t.WQX)(G.u),this.drafts=(0,t.vPA)([]),this.layout.marginOn(),(0,t.QZP)(()=>{this.app.initialized()&&(setTimeout(()=>{this.table&&(this.dataSource.sort=this.sort,this.dataSource.paginator=this.paginator,this.table.dataSource=this.dataSource)}),this.loadDrafts())});const n=[];for(let s=0;s0?13:-1),t.R7$(),t.vxM("card"==s.viewStyle()?14:15))},dependencies:[h.iI,h.Wk,u.Vg,u.ec,u.pc,v.m_,v.An,F.fS,S.RG,d.X1,d.BC,x.MD,y.Hl,y.$z,l.Hu,l.RN,l.YY,l.m2,l.MM,l.kF,l.dh,r.tP,r.Zl,r.tL,r.ji,r.cC,r.YV,r.iL,r.KS,r.$R,r.YZ,r.NB,p.Ou,p.iy,c.NQ,c.B4,c.aE,k.mV,d.YN,d.vS,w.s5],styles:[".search-input[_ngcontent-%COMP%]{width:100%}img[_ngcontent-%COMP%]{width:100%;height:200px;object-fit:cover}.responsive-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:24px}"]})}}return i})()}}]); \ No newline at end of file diff --git a/6702.203c75ec9fca1fea.js b/6702.203c75ec9fca1fea.js new file mode 100644 index 00000000..87bb41ec --- /dev/null +++ b/6702.203c75ec9fca1fea.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[6702],{6702:(q,C,s)=>{s.r(C),s.d(C,{CommunitiesComponent:()=>U});var d=s(10467),t=s(54438),p=s(65571),v=s(99213),F=s(99631),j=s(53719),l=s(89417),R=s(60177),u=s(2042),h=s(96695),m=s(9159),c=s(25596),y=s(88834),S=s(45024),k=s(96354),x=s(57786),E=s(7673);class T extends S.qS{constructor(){super()}connect(){if(this.paginator&&this.sort)return(0,x.h)((0,E.of)(this.data),this.paginator.page,this.sort.sortChange).pipe((0,k.T)(()=>this.getPagedData(this.getSortedData([...this.data]))));throw Error("Please set the paginator and sort on the data source before connecting.")}disconnect(){}getPagedData(a){return this.paginator?a.splice(this.paginator.pageIndex*this.paginator.pageSize,this.paginator.pageSize):a}getSortedData(a){return this.sort&&this.sort.active&&""!==this.sort.direction?a.sort((e,n)=>{const o="asc"===this.sort?.direction;switch(this.sort?.active){case"name":return b(e.name,n.name,o);case"id":return b(+e.id,+n.id,o);default:return 0}}):a}}function b(i,a,e){return(i["/communities","create"],M=i=>["/communities","create",i],z=i=>["/community",i],N=()=>[5,10,20];function B(i,a){if(1&i&&(t.j41(0,"a",11),t.EFF(1),t.k0s(),t.nrm(2,"br")),2&i){const e=a.$implicit;t.Y8G("routerLink",t.eq3(2,M,e.id)),t.R7$(),t.SpI("",e.data.name," - Awaiting approval")}}function V(i,a){if(1&i&&(t.j41(0,"mat-card",1)(1,"mat-card-content",2)(2,"strong"),t.EFF(3,"NOTICE"),t.k0s(),t.j41(4,"div"),t.EFF(5," You have communities in draft mode. Please review any status update on their verification status. "),t.nrm(6,"br")(7,"br"),t.Z7z(8,B,3,4,null,null,t.fX1),t.k0s()()()),2&i){const e=t.XpG();t.R7$(8),t.Dyx(e.drafts())}}function Y(i,a){if(1&i){const e=t.RV6();t.j41(0,"mat-card")(1,"mat-card-header")(2,"mat-card-title")(3,"a",12),t.EFF(4),t.k0s()()(),t.nrm(5,"br")(6,"img",13),t.j41(7,"mat-card-content"),t.nrm(8,"br"),t.j41(9,"p"),t.EFF(10),t.k0s()(),t.j41(11,"mat-card-actions")(12,"button",14),t.bIt("click",function(){const o=t.eBV(e).$implicit,r=t.XpG(2);return t.Njj(r.open(o.id))}),t.EFF(13,"VIEW"),t.k0s(),t.j41(14,"button",14),t.bIt("click",function(){const o=t.eBV(e).$implicit,r=t.XpG(2);return t.Njj(r.join(o.id))}),t.EFF(15,"JOIN"),t.k0s()()()}if(2&i){const e=a.$implicit;t.R7$(3),t.Y8G("routerLink",t.eq3(4,z,e.id)),t.R7$(),t.JRh(e.data.name),t.R7$(2),t.Y8G("src",e.data.avatar,t.B4B),t.R7$(4),t.SpI(" ",e.data.bio," ")}}function P(i,a){if(1&i){const e=t.RV6();t.j41(0,"mat-card")(1,"mat-card-header")(2,"mat-card-title"),t.EFF(3),t.k0s()(),t.nrm(4,"br")(5,"img",13),t.j41(6,"mat-card-content"),t.nrm(7,"br"),t.j41(8,"p"),t.EFF(9),t.k0s()(),t.j41(10,"mat-card-actions")(11,"button",14),t.bIt("click",function(){t.eBV(e);const o=t.XpG(2);return t.Njj(o.open("did:dht:my6nm5s1n9xmuuh5yixe668k7xbkmmuddzatn1fojzgdg5f5to8y"))}),t.EFF(12,"JOIN"),t.k0s(),t.j41(13,"button",14),t.bIt("click",function(){t.eBV(e);const o=t.XpG(2);return t.Njj(o.open("did:dht:my6nm5s1n9xmuuh5yixe668k7xbkmmuddzatn1fojzgdg5f5to8y"))}),t.EFF(14,"PREVIEW"),t.k0s()()()}if(2&i){const e=a.$implicit;t.R7$(3),t.SpI("",e.name," "),t.R7$(2),t.Y8G("src",e.thumbnail,t.B4B),t.R7$(4),t.SpI(" ",e.description," ")}}function X(i,a){if(1&i&&(t.j41(0,"div",9),t.Z7z(1,Y,16,6,"mat-card",null,t.fX1),t.Z7z(3,P,15,3,"mat-card",null,t.fX1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.Dyx(e.communities()),t.R7$(2),t.Dyx(e.cards())}}function A(i,a){1&i&&(t.j41(0,"th",24),t.EFF(1,"Id"),t.k0s())}function L(i,a){if(1&i&&(t.j41(0,"td",25),t.EFF(1),t.k0s()),2&i){const e=a.$implicit;t.R7$(),t.JRh(e.id)}}function J(i,a){1&i&&(t.j41(0,"th",24),t.EFF(1,"Name"),t.k0s())}function O(i,a){if(1&i&&(t.j41(0,"td",25),t.EFF(1),t.k0s()),2&i){const e=a.$implicit;t.R7$(),t.JRh(e.name)}}function Q(i,a){1&i&&(t.j41(0,"th",24),t.EFF(1,"Description"),t.k0s())}function W(i,a){if(1&i&&(t.j41(0,"td",25),t.EFF(1),t.k0s()),2&i){const e=a.$implicit;t.R7$(),t.JRh(e.description)}}function Z(i,a){1&i&&t.nrm(0,"tr",26)}function H(i,a){1&i&&t.nrm(0,"tr",27)}function K(i,a){if(1&i&&(t.j41(0,"div",10)(1,"table",15),t.qex(2,16),t.DNE(3,A,2,0,"th",17)(4,L,2,1,"td",18),t.bVm(),t.qex(5,19),t.DNE(6,J,2,0,"th",17)(7,O,2,1,"td",18),t.bVm(),t.qex(8,20),t.DNE(9,Q,2,0,"th",17)(10,W,2,1,"td",18),t.bVm(),t.DNE(11,Z,1,0,"tr",21)(12,H,1,0,"tr",22),t.k0s(),t.nrm(13,"mat-paginator",23,0),t.k0s()),2&i){const e=t.XpG();t.R7$(11),t.Y8G("matHeaderRowDef",e.displayedColumns),t.R7$(),t.Y8G("matRowDefColumns",e.displayedColumns),t.R7$(),t.Y8G("length",e.dataSource.data.length)("pageIndex",0)("pageSize",10)("pageSizeOptions",t.lJ4(6,N))}}let U=(()=>{class i{constructor(e){var n=this;this.router=e,this.search=new l.MJ(""),this.dataSource=new T,this.cards=(0,t.vPA)([]),this.app=(0,t.WQX)(_.d),this.layout=(0,t.WQX)(I.Y),this.images=["nature","sky","grass","mountains","rivers","glacier","forest"],this.viewStyle=(0,t.geq)("card"),this.checked=(0,t.geq)(!1),this.displayedColumns=["name","description"],this.data=(0,t.WQX)(w.u),this.drafts=(0,t.vPA)([]),this.communities=(0,t.vPA)([]),this.layout.marginOn(),(0,t.QZP)((0,d.A)(function*(){n.app.initialized()&&(setTimeout(()=>{n.table&&(n.dataSource.sort=n.sort,n.dataSource.paginator=n.paginator,n.table.dataSource=n.dataSource)}),yield n.loadCommunities(),yield n.loadDrafts())}));const o=[];for(let r=0;r0?13:-1),t.R7$(),t.vxM("card"==o.viewStyle()?14:15))},dependencies:[f.iI,f.Wk,p.Vg,p.ec,p.pc,v.m_,v.An,F.fS,j.RG,l.X1,l.BC,R.MD,y.Hl,y.$z,c.Hu,c.RN,c.YY,c.m2,c.MM,c.kF,c.dh,m.tP,m.Zl,m.tL,m.ji,m.cC,m.YV,m.iL,m.KS,m.$R,m.YZ,m.NB,h.Ou,h.iy,u.NQ,u.B4,u.aE,$.mV,l.YN,l.vS,D.s5],styles:[".search-input[_ngcontent-%COMP%]{width:100%}img[_ngcontent-%COMP%]{width:100%;height:200px;object-fit:cover}.responsive-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:24px}"]})}}return i})()}}]); \ No newline at end of file diff --git a/9847.0eeb70bef87a6954.js b/9847.dc3a89a6bba25fff.js similarity index 92% rename from 9847.0eeb70bef87a6954.js rename to 9847.dc3a89a6bba25fff.js index 1cea3d05..6d2a18ba 100644 --- a/9847.0eeb70bef87a6954.js +++ b/9847.dc3a89a6bba25fff.js @@ -1 +1 @@ -"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[9847],{99847:(Ce,$,s)=>{s.r($),s.d($,{CreateComponent:()=>be});var d=s(10467),t=s(54438),tt=s(83475),j=s(99631),v=s(88834),P=s(82798),_=s(99213),M=s(5951),u=s(25596),c=s(89417),et=s(34635),nt=s(5794),g=s(30046),ot=s(55619),it=s(22312),F=s(53719),S=s(76939),N=s(18617),T=s(28203),I=s(67336),z=s(36860),R=s(21413),at=s(7673),C=s(99172),b=s(56977);const rt=["*"];function st(o,r){1&o&&t.SdG(0)}let L=(()=>{class o{constructor(e){this._elementRef=e}focus(){this._elementRef.nativeElement.focus()}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(t.aKT))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["","cdkStepHeader",""]],hostAttrs:["role","tab"],standalone:!0})}}return o})(),B=(()=>{class o{constructor(e){this.template=e}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(t.C4Q))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["","cdkStepLabel",""]],standalone:!0})}}return o})(),lt=0;const X=new t.nKC("STEPPER_GLOBAL_OPTIONS");let D=(()=>{class o{get completed(){return null==this._completedOverride?this._getDefaultCompleted():this._completedOverride}set completed(e){this._completedOverride=e}_getDefaultCompleted(){return this.stepControl?this.stepControl.valid&&this.interacted:this.interacted}get hasError(){return null==this._customError?this._getDefaultError():this._customError}set hasError(e){this._customError=e}_getDefaultError(){return this.stepControl&&this.stepControl.invalid&&this.interacted}constructor(e,n){this._stepper=e,this.interacted=!1,this.interactedStream=new t.bkB,this.editable=!0,this.optional=!1,this._completedOverride=null,this._customError=null,this._stepperOptions=n||{},this._displayDefaultIndicatorType=!1!==this._stepperOptions.displayDefaultIndicatorType}select(){this._stepper.selected=this}reset(){this.interacted=!1,null!=this._completedOverride&&(this._completedOverride=!1),null!=this._customError&&(this._customError=!1),this.stepControl&&(this._childForms?.forEach(e=>e.resetForm?.()),this.stepControl.reset())}ngOnChanges(){this._stepper._stateChanged()}_markAsInteracted(){this.interacted||(this.interacted=!0,this.interactedStream.emit(this))}_showError(){return this._stepperOptions.showError??null!=this._customError}static{this.\u0275fac=function(n){return new(n||o)(t.rXU((0,t.Rfq)(()=>y)),t.rXU(X,8))}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["cdk-step"]],contentQueries:function(n,i,a){if(1&n&&(t.wni(a,B,5),t.wni(a,c.ZU,5)),2&n){let l;t.mGM(l=t.lsd())&&(i.stepLabel=l.first),t.mGM(l=t.lsd())&&(i._childForms=l)}},viewQuery:function(n,i){if(1&n&&t.GBs(t.C4Q,7),2&n){let a;t.mGM(a=t.lsd())&&(i.content=a.first)}},inputs:{stepControl:"stepControl",label:"label",errorMessage:"errorMessage",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],state:"state",editable:[2,"editable","editable",t.L39],optional:[2,"optional","optional",t.L39],completed:[2,"completed","completed",t.L39],hasError:[2,"hasError","hasError",t.L39]},outputs:{interactedStream:"interacted"},exportAs:["cdkStep"],standalone:!0,features:[t.GFd,t.OA$,t.aNF],ngContentSelectors:rt,decls:1,vars:0,template:function(n,i){1&n&&(t.NAR(),t.DNE(0,st,1,0,"ng-template"))},encapsulation:2,changeDetection:0})}}return o})(),y=(()=>{class o{get selectedIndex(){return this._selectedIndex}set selectedIndex(e){this.steps&&this._steps?(this._isValidIndex(e),this.selected?._markAsInteracted(),this._selectedIndex!==e&&!this._anyControlsInvalidOrPending(e)&&(e>=this._selectedIndex||this.steps.toArray()[e].editable)&&this._updateSelectedItemIndex(e)):this._selectedIndex=e}get selected(){return this.steps?this.steps.toArray()[this.selectedIndex]:void 0}set selected(e){this.selectedIndex=e&&this.steps?this.steps.toArray().indexOf(e):-1}get orientation(){return this._orientation}set orientation(e){this._orientation=e,this._keyManager&&this._keyManager.withVerticalOrientation("vertical"===e)}constructor(e,n,i){this._dir=e,this._changeDetectorRef=n,this._elementRef=i,this._destroyed=new R.B,this.steps=new t.rOR,this._sortedHeaders=new t.rOR,this.linear=!1,this._selectedIndex=0,this.selectionChange=new t.bkB,this.selectedIndexChange=new t.bkB,this._orientation="horizontal",this._groupId=lt++}ngAfterContentInit(){this._steps.changes.pipe((0,C.Z)(this._steps),(0,b.Q)(this._destroyed)).subscribe(e=>{this.steps.reset(e.filter(n=>n._stepper===this)),this.steps.notifyOnChanges()})}ngAfterViewInit(){this._stepHeader.changes.pipe((0,C.Z)(this._stepHeader),(0,b.Q)(this._destroyed)).subscribe(e=>{this._sortedHeaders.reset(e.toArray().sort((n,i)=>n._elementRef.nativeElement.compareDocumentPosition(i._elementRef.nativeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),this._sortedHeaders.notifyOnChanges()}),this._keyManager=new N.Bu(this._sortedHeaders).withWrap().withHomeAndEnd().withVerticalOrientation("vertical"===this._orientation),(this._dir?this._dir.change:(0,at.of)()).pipe((0,C.Z)(this._layoutDirection()),(0,b.Q)(this._destroyed)).subscribe(e=>this._keyManager.withHorizontalOrientation(e)),this._keyManager.updateActiveItem(this._selectedIndex),this.steps.changes.subscribe(()=>{this.selected||(this._selectedIndex=Math.max(this._selectedIndex-1,0))}),this._isValidIndex(this._selectedIndex)||(this._selectedIndex=0)}ngOnDestroy(){this._keyManager?.destroy(),this.steps.destroy(),this._sortedHeaders.destroy(),this._destroyed.next(),this._destroyed.complete()}next(){this.selectedIndex=Math.min(this._selectedIndex+1,this.steps.length-1)}previous(){this.selectedIndex=Math.max(this._selectedIndex-1,0)}reset(){this._updateSelectedItemIndex(0),this.steps.forEach(e=>e.reset()),this._stateChanged()}_getStepLabelId(e){return`cdk-step-label-${this._groupId}-${e}`}_getStepContentId(e){return`cdk-step-content-${this._groupId}-${e}`}_stateChanged(){this._changeDetectorRef.markForCheck()}_getAnimationDirection(e){const n=e-this._selectedIndex;return n<0?"rtl"===this._layoutDirection()?"next":"previous":n>0?"rtl"===this._layoutDirection()?"previous":"next":"current"}_getIndicatorType(e,n="number"){const i=this.steps.toArray()[e],a=this._isCurrentStep(e);return i._displayDefaultIndicatorType?this._getDefaultIndicatorLogic(i,a):this._getGuidelineLogic(i,a,n)}_getDefaultIndicatorLogic(e,n){return e._showError()&&e.hasError&&!n?"error":!e.completed||n?"number":e.editable?"edit":"done"}_getGuidelineLogic(e,n,i="number"){return e._showError()&&e.hasError&&!n?"error":e.completed&&!n?"done":e.completed&&n?i:e.editable&&n?"edit":i}_isCurrentStep(e){return this._selectedIndex===e}_getFocusIndex(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex}_updateSelectedItemIndex(e){const n=this.steps.toArray();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:this._selectedIndex,selectedStep:n[e],previouslySelectedStep:n[this._selectedIndex]}),this._containsFocus()?this._keyManager.setActiveItem(e):this._keyManager.updateActiveItem(e),this._selectedIndex=e,this.selectedIndexChange.emit(this._selectedIndex),this._stateChanged()}_onKeydown(e){const n=(0,I.rp)(e),i=e.keyCode,a=this._keyManager;null==a.activeItemIndex||n||i!==I.t6&&i!==I.Fm?a.setFocusOrigin("keyboard").onKeydown(e):(this.selectedIndex=a.activeItemIndex,e.preventDefault())}_anyControlsInvalidOrPending(e){return!!(this.linear&&e>=0)&&this.steps.toArray().slice(0,e).some(n=>{const i=n.stepControl;return(i?i.invalid||i.pending||!n.interacted:!n.completed)&&!n.optional&&!n._completedOverride})}_layoutDirection(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"}_containsFocus(){const e=this._elementRef.nativeElement,n=(0,z.vc)();return e===n||e.contains(n)}_isValidIndex(e){return e>-1&&(!this.steps||e{class o{constructor(e){this._stepper=e,this.type="submit"}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(y))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["button","cdkStepperNext",""]],hostVars:1,hostBindings:function(n,i){1&n&&t.bIt("click",function(){return i._stepper.next()}),2&n&&t.Mr5("type",i.type)},inputs:{type:"type"},standalone:!0})}}return o})(),ct=(()=>{class o{constructor(e){this._stepper=e,this.type="button"}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(y))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["button","cdkStepperPrevious",""]],hostVars:1,hostBindings:function(n,i){1&n&&t.bIt("click",function(){return i._stepper.previous()}),2&n&&t.Mr5("type",i.type)},inputs:{type:"type"},standalone:!0})}}return o})(),dt=(()=>{class o{static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275mod=t.$C({type:o})}static{this.\u0275inj=t.G2t({imports:[T.jI]})}}return o})();var k=s(60177),h=s(86600),mt=s(18359),ut=s(25558),ht=s(96354),ft=s(23294),p=s(49969);function vt(o,r){if(1&o&&t.eu8(0,2),2&o){const e=t.XpG();t.Y8G("ngTemplateOutlet",e.iconOverrides[e.state])("ngTemplateOutletContext",e._getIconContext())}}function _t(o,r){if(1&o&&(t.j41(0,"span",7),t.EFF(1),t.k0s()),2&o){const e=t.XpG(2);t.R7$(),t.JRh(e._getDefaultTextForState(e.state))}}function gt(o,r){if(1&o&&(t.j41(0,"span",8),t.EFF(1),t.k0s()),2&o){const e=t.XpG(3);t.R7$(),t.JRh(e._intl.completedLabel)}}function Ft(o,r){if(1&o&&(t.j41(0,"span",8),t.EFF(1),t.k0s()),2&o){const e=t.XpG(3);t.R7$(),t.JRh(e._intl.editableLabel)}}function bt(o,r){if(1&o&&(t.DNE(0,gt,2,1,"span",8)(1,Ft,2,1,"span",8),t.j41(2,"mat-icon",7),t.EFF(3),t.k0s()),2&o){const e=t.XpG(2);t.vxM("done"===e.state?0:"edit"===e.state?1:-1),t.R7$(3),t.JRh(e._getDefaultTextForState(e.state))}}function yt(o,r){if(1&o&&t.DNE(0,_t,2,1,"span",7)(1,bt,4,2,"mat-icon",7),2&o){let e;const n=t.XpG();t.vxM("number"===(e=n.state)?0:1)}}function Ct(o,r){1&o&&(t.j41(0,"div",4),t.eu8(1,9),t.k0s()),2&o&&(t.R7$(),t.Y8G("ngTemplateOutlet",r.template))}function kt(o,r){if(1&o&&(t.j41(0,"div",4),t.EFF(1),t.k0s()),2&o){const e=t.XpG();t.R7$(),t.JRh(e.label)}}function Et(o,r){if(1&o&&(t.j41(0,"div",5),t.EFF(1),t.k0s()),2&o){const e=t.XpG();t.R7$(),t.JRh(e._intl.optionalLabel)}}function xt(o,r){if(1&o&&(t.j41(0,"div",6),t.EFF(1),t.k0s()),2&o){const e=t.XpG();t.R7$(),t.JRh(e.errorMessage)}}const V=["*"];function jt(o,r){}function Mt(o,r){if(1&o&&(t.SdG(0),t.DNE(1,jt,0,0,"ng-template",0)),2&o){const e=t.XpG();t.R7$(),t.Y8G("cdkPortalOutlet",e._portal)}}const H=(o,r)=>({step:o,i:r}),U=o=>({animationDuration:o}),Y=(o,r)=>({value:o,params:r});function St(o,r){1&o&&t.SdG(0)}function Tt(o,r){1&o&&t.nrm(0,"div",6)}function It(o,r){if(1&o&&(t.eu8(0,5),t.DNE(1,Tt,1,0,"div",6)),2&o){const e=r.$implicit,n=r.$index,i=r.$count;t.XpG(2);const a=t.sdS(4);t.Y8G("ngTemplateOutlet",a)("ngTemplateOutletContext",t.l_i(3,H,e,n)),t.R7$(),t.vxM(n!==i-1?1:-1)}}function Rt(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",7),t.bIt("@horizontalStepTransition.done",function(i){t.eBV(e);const a=t.XpG(2);return t.Njj(a._animationDone.next(i))}),t.eu8(1,8),t.k0s()}if(2&o){const e=r.$implicit,n=r.$index,i=t.XpG(2);t.AVh("mat-horizontal-stepper-content-inactive",i.selectedIndex!==n),t.Y8G("@horizontalStepTransition",t.l_i(8,Y,i._getAnimationDirection(n),t.eq3(6,U,i._getAnimationDuration())))("id",i._getStepContentId(n)),t.BMQ("aria-labelledby",i._getStepLabelId(n)),t.R7$(),t.Y8G("ngTemplateOutlet",e.content)}}function Dt(o,r){if(1&o&&(t.j41(0,"div",1)(1,"div",2),t.Z7z(2,It,2,6,null,null,t.fX1),t.k0s(),t.j41(4,"div",3),t.Z7z(5,Rt,2,11,"div",4,t.fX1),t.k0s()()),2&o){const e=t.XpG();t.R7$(2),t.Dyx(e.steps),t.R7$(3),t.Dyx(e.steps)}}function Gt(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",9),t.eu8(1,5),t.j41(2,"div",10)(3,"div",11),t.bIt("@verticalStepTransition.done",function(i){t.eBV(e);const a=t.XpG(2);return t.Njj(a._animationDone.next(i))}),t.j41(4,"div",12),t.eu8(5,8),t.k0s()()()()}if(2&o){const e=r.$implicit,n=r.$index,i=r.$count,a=t.XpG(2),l=t.sdS(4);t.R7$(),t.Y8G("ngTemplateOutlet",l)("ngTemplateOutletContext",t.l_i(10,H,e,n)),t.R7$(),t.AVh("mat-stepper-vertical-line",n!==i-1),t.R7$(),t.AVh("mat-vertical-stepper-content-inactive",a.selectedIndex!==n),t.Y8G("@verticalStepTransition",t.l_i(15,Y,a._getAnimationDirection(n),t.eq3(13,U,a._getAnimationDuration())))("id",a._getStepContentId(n)),t.BMQ("aria-labelledby",a._getStepLabelId(n)),t.R7$(2),t.Y8G("ngTemplateOutlet",e.content)}}function At(o,r){if(1&o&&t.Z7z(0,Gt,6,18,"div",9,t.fX1),2&o){const e=t.XpG();t.Dyx(e.steps)}}function Ot(o,r){if(1&o){const e=t.RV6();t.j41(0,"mat-step-header",13),t.bIt("click",function(){const i=t.eBV(e).step;return t.Njj(i.select())})("keydown",function(i){t.eBV(e);const a=t.XpG();return t.Njj(a._onKeydown(i))}),t.k0s()}if(2&o){const e=r.step,n=r.i,i=t.XpG();t.AVh("mat-horizontal-stepper-header","horizontal"===i.orientation)("mat-vertical-stepper-header","vertical"===i.orientation),t.Y8G("tabIndex",i._getFocusIndex()===n?0:-1)("id",i._getStepLabelId(n))("index",n)("state",i._getIndicatorType(n,e.state))("label",e.stepLabel||e.label)("selected",i.selectedIndex===n)("active",i._stepIsNavigable(n,e))("optional",e.optional)("errorMessage",e.errorMessage)("iconOverrides",i._iconOverrides)("disableRipple",i.disableRipple||!i._stepIsNavigable(n,e))("color",e.color||i.color),t.BMQ("aria-posinset",n+1)("aria-setsize",i.steps.length)("aria-controls",i._getStepContentId(n))("aria-selected",i.selectedIndex==n)("aria-label",e.ariaLabel||null)("aria-labelledby",!e.ariaLabel&&e.ariaLabelledby?e.ariaLabelledby:null)("aria-disabled",!i._stepIsNavigable(n,e)||null)}}let E=(()=>{class o extends B{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=t.xGo(o)))(i||o)}})()}static{this.\u0275dir=t.FsC({type:o,selectors:[["","matStepLabel",""]],standalone:!0,features:[t.Vt3]})}}return o})(),x=(()=>{class o{constructor(){this.changes=new R.B,this.optionalLabel="Optional",this.completedLabel="Completed",this.editableLabel="Editable"}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275prov=t.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const $t={provide:x,deps:[[new t.Xx1,new t.kdw,x]],useFactory:function wt(o){return o||new x}};let G=(()=>{class o extends L{constructor(e,n,i,a){super(i),this._intl=e,this._focusMonitor=n,this._intlSubscription=e.changes.subscribe(()=>a.markForCheck())}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._intlSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._elementRef)}focus(e,n){e?this._focusMonitor.focusVia(this._elementRef,e,n):this._elementRef.nativeElement.focus(n)}_stringLabel(){return this.label instanceof E?null:this.label}_templateLabel(){return this.label instanceof E?this.label:null}_getHostElement(){return this._elementRef.nativeElement}_getIconContext(){return{index:this.index,active:this.active,optional:this.optional}}_getDefaultTextForState(e){return"number"==e?`${this.index+1}`:"edit"==e?"create":"error"==e?"warning":e}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(x),t.rXU(N.FN),t.rXU(t.aKT),t.rXU(t.gRc))}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["mat-step-header"]],hostAttrs:["role","tab",1,"mat-step-header"],hostVars:2,hostBindings:function(n,i){2&n&&t.HbH("mat-"+(i.color||"primary"))},inputs:{state:"state",label:"label",errorMessage:"errorMessage",iconOverrides:"iconOverrides",index:"index",selected:"selected",active:"active",optional:"optional",disableRipple:"disableRipple",color:"color"},standalone:!0,features:[t.Vt3,t.aNF],decls:10,vars:17,consts:[["matRipple","",1,"mat-step-header-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-step-icon-content"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-step-label"],[1,"mat-step-text-label"],[1,"mat-step-optional"],[1,"mat-step-sub-label-error"],["aria-hidden","true"],[1,"cdk-visually-hidden"],[3,"ngTemplateOutlet"]],template:function(n,i){if(1&n&&(t.nrm(0,"div",0),t.j41(1,"div")(2,"div",1),t.DNE(3,vt,1,2,"ng-container",2)(4,yt,2,1),t.k0s()(),t.j41(5,"div",3),t.DNE(6,Ct,2,1,"div",4)(7,kt,2,1,"div",4)(8,Et,2,1,"div",5)(9,xt,2,1,"div",6),t.k0s()),2&n){let a;t.Y8G("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disableRipple),t.R7$(),t.ZvI("mat-step-icon-state-",i.state," mat-step-icon"),t.AVh("mat-step-icon-selected",i.selected),t.R7$(2),t.vxM(i.iconOverrides&&i.iconOverrides[i.state]?3:4),t.R7$(2),t.AVh("mat-step-label-active",i.active)("mat-step-label-selected",i.selected)("mat-step-label-error","error"==i.state),t.R7$(),t.vxM((a=i._templateLabel())?6:i._stringLabel()?7:-1,a),t.R7$(2),t.vxM(i.optional&&"error"!=i.state?8:-1),t.R7$(),t.vxM("error"===i.state?9:-1)}},dependencies:[h.r6,k.T3,_.An],styles:['.mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-step-header:focus .mat-focus-indicator::before{content:""}.mat-step-header:hover[aria-disabled=true]{cursor:default}.mat-step-header:hover:not([aria-disabled]),.mat-step-header:hover[aria-disabled=false]{background-color:var(--mat-stepper-header-hover-state-layer-color);border-radius:var(--mat-stepper-header-hover-state-layer-shape, var(--mat-app-corner-medium))}.mat-step-header.cdk-keyboard-focused,.mat-step-header.cdk-program-focused{background-color:var(--mat-stepper-header-focus-state-layer-color);border-radius:var(--mat-stepper-header-focus-state-layer-shape, var(--mat-app-corner-medium))}@media(hover: none){.mat-step-header:hover{background:none}}.cdk-high-contrast-active .mat-step-header{outline:solid 1px}.cdk-high-contrast-active .mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.cdk-high-contrast-active .mat-step-header[aria-disabled=true]{outline-color:GrayText}.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-label,.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-icon,.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-optional{color:GrayText}.mat-step-optional{font-size:12px;color:var(--mat-stepper-header-optional-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-sub-label-error{font-size:12px;font-weight:normal}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative;color:var(--mat-stepper-header-icon-foreground-color, var(--mat-app-surface));background-color:var(--mat-stepper-header-icon-background-color, var(--mat-app-on-surface-variant))}.mat-step-icon-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:flex}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error{background-color:var(--mat-stepper-header-error-state-icon-background-color);color:var(--mat-stepper-header-error-state-icon-foreground-color, var(--mat-app-error))}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle;font-family:var(--mat-stepper-header-label-text-font, var(--mat-app-title-small-font));font-size:var(--mat-stepper-header-label-text-size, var(--mat-app-title-small-size));font-weight:var(--mat-stepper-header-label-text-weight, var(--mat-app-title-small-weight));color:var(--mat-stepper-header-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-label.mat-step-label-active{color:var(--mat-stepper-header-selected-state-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-label.mat-step-label-error{color:var(--mat-stepper-header-error-state-label-text-color, var(--mat-app-error));font-size:var(--mat-stepper-header-error-state-label-text-size, var(--mat-app-title-small-size))}.mat-step-label.mat-step-label-selected{font-size:var(--mat-stepper-header-selected-state-label-text-size, var(--mat-app-title-small-size));font-weight:var(--mat-stepper-header-selected-state-label-text-weight, var(--mat-app-title-small-weight))}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-step-icon-selected{background-color:var(--mat-stepper-header-selected-state-icon-background-color, var(--mat-app-primary));color:var(--mat-stepper-header-selected-state-icon-foreground-color, var(--mat-app-on-primary))}.mat-step-icon-state-done{background-color:var(--mat-stepper-header-done-state-icon-background-color);color:var(--mat-stepper-header-done-state-icon-foreground-color)}.mat-step-icon-state-edit{background-color:var(--mat-stepper-header-edit-state-icon-background-color, var(--mat-app-primary));color:var(--mat-stepper-header-edit-state-icon-foreground-color, var(--mat-app-on-primary))}'],encapsulation:2,changeDetection:0})}}return o})();const Q="500ms",W="225ms",J={horizontalStepTransition:(0,p.hZ)("horizontalStepTransition",[(0,p.wk)("previous",(0,p.iF)({transform:"translate3d(-100%, 0, 0)",visibility:"hidden"})),(0,p.wk)("current",(0,p.iF)({transform:"none",visibility:"inherit"})),(0,p.wk)("next",(0,p.iF)({transform:"translate3d(100%, 0, 0)",visibility:"hidden"})),(0,p.kY)("* => *",(0,p.Os)([(0,p.i0)("{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)"),(0,p.P)("@*",(0,p.MA)(),{optional:!0})]),{params:{animationDuration:Q}})]),verticalStepTransition:(0,p.hZ)("verticalStepTransition",[(0,p.wk)("previous",(0,p.iF)({height:"0px",visibility:"hidden"})),(0,p.wk)("next",(0,p.iF)({height:"0px",visibility:"hidden"})),(0,p.wk)("current",(0,p.iF)({height:"*",visibility:"inherit"})),(0,p.kY)("* <=> current",(0,p.Os)([(0,p.i0)("{{animationDuration}} cubic-bezier(0.4, 0.0, 0.2, 1)"),(0,p.P)("@*",(0,p.MA)(),{optional:!0})]),{params:{animationDuration:W}})])};let Pt=(()=>{class o{constructor(e){this.templateRef=e}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(t.C4Q))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["ng-template","matStepperIcon",""]],inputs:{name:[0,"matStepperIcon","name"]},standalone:!0})}}return o})(),Nt=(()=>{class o{constructor(e){this._template=e}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(t.C4Q))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["ng-template","matStepContent",""]],standalone:!0})}}return o})(),Z=(()=>{class o extends D{constructor(e,n,i,a){super(e,a),this._errorStateMatcher=n,this._viewContainerRef=i,this._isSelected=mt.yU.EMPTY,this.stepLabel=void 0}ngAfterContentInit(){this._isSelected=this._stepper.steps.changes.pipe((0,ut.n)(()=>this._stepper.selectionChange.pipe((0,ht.T)(e=>e.selectedStep===this),(0,C.Z)(this._stepper.selected===this)))).subscribe(e=>{e&&this._lazyContent&&!this._portal&&(this._portal=new S.VA(this._lazyContent._template,this._viewContainerRef))})}ngOnDestroy(){this._isSelected.unsubscribe()}isErrorState(e,n){return this._errorStateMatcher.isErrorState(e,n)||!!(e&&e.invalid&&this.interacted)}static{this.\u0275fac=function(n){return new(n||o)(t.rXU((0,t.Rfq)(()=>A)),t.rXU(h.es,4),t.rXU(t.c1b),t.rXU(X,8))}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["mat-step"]],contentQueries:function(n,i,a){if(1&n&&(t.wni(a,E,5),t.wni(a,Nt,5)),2&n){let l;t.mGM(l=t.lsd())&&(i.stepLabel=l.first),t.mGM(l=t.lsd())&&(i._lazyContent=l.first)}},hostAttrs:["hidden",""],inputs:{color:"color"},exportAs:["matStep"],standalone:!0,features:[t.Jv_([{provide:h.es,useExisting:o},{provide:D,useExisting:o}]),t.Vt3,t.aNF],ngContentSelectors:V,decls:1,vars:0,consts:[[3,"cdkPortalOutlet"]],template:function(n,i){1&n&&(t.NAR(),t.DNE(0,Mt,2,1,"ng-template"))},dependencies:[S.I3],encapsulation:2,changeDetection:0})}}return o})(),A=(()=>{class o extends y{get animationDuration(){return this._animationDuration}set animationDuration(e){this._animationDuration=/^\d+$/.test(e)?e+"ms":e}constructor(e,n,i){super(e,n,i),this._stepHeader=void 0,this._steps=void 0,this.steps=new t.rOR,this.animationDone=new t.bkB,this.labelPosition="end",this.headerPosition="top",this._iconOverrides={},this._animationDone=new R.B,this._animationDuration="",this._isServer=!(0,t.WQX)(z.OD).isBrowser;const a=i.nativeElement.nodeName.toLowerCase();this.orientation="mat-vertical-stepper"===a?"vertical":"horizontal"}ngAfterContentInit(){super.ngAfterContentInit(),this._icons.forEach(({name:e,templateRef:n})=>this._iconOverrides[e]=n),this.steps.changes.pipe((0,b.Q)(this._destroyed)).subscribe(()=>{this._stateChanged()}),this._animationDone.pipe((0,ft.F)((e,n)=>e.fromState===n.fromState&&e.toState===n.toState),(0,b.Q)(this._destroyed)).subscribe(e=>{"current"===e.toState&&this.animationDone.emit()})}_stepIsNavigable(e,n){return n.completed||this.selectedIndex===e||!this.linear}_getAnimationDuration(){return this.animationDuration?this.animationDuration:"horizontal"===this.orientation?Q:W}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(T.dS,8),t.rXU(t.gRc),t.rXU(t.aKT))}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["mat-stepper"],["mat-vertical-stepper"],["mat-horizontal-stepper"],["","matStepper",""]],contentQueries:function(n,i,a){if(1&n&&(t.wni(a,Z,5),t.wni(a,Pt,5)),2&n){let l;t.mGM(l=t.lsd())&&(i._steps=l),t.mGM(l=t.lsd())&&(i._icons=l)}},viewQuery:function(n,i){if(1&n&&t.GBs(G,5),2&n){let a;t.mGM(a=t.lsd())&&(i._stepHeader=a)}},hostAttrs:["role","tablist"],hostVars:11,hostBindings:function(n,i){2&n&&(t.BMQ("aria-orientation",i.orientation),t.AVh("mat-stepper-horizontal","horizontal"===i.orientation)("mat-stepper-vertical","vertical"===i.orientation)("mat-stepper-label-position-end","horizontal"===i.orientation&&"end"==i.labelPosition)("mat-stepper-label-position-bottom","horizontal"===i.orientation&&"bottom"==i.labelPosition)("mat-stepper-header-position-bottom","bottom"===i.headerPosition))},inputs:{disableRipple:"disableRipple",color:"color",labelPosition:"labelPosition",headerPosition:"headerPosition",animationDuration:"animationDuration"},outputs:{animationDone:"animationDone"},exportAs:["matStepper","matVerticalStepper","matHorizontalStepper"],standalone:!0,features:[t.Jv_([{provide:y,useExisting:o}]),t.Vt3,t.aNF],ngContentSelectors:V,decls:5,vars:2,consts:[["stepTemplate",""],[1,"mat-horizontal-stepper-wrapper"],[1,"mat-horizontal-stepper-header-container"],[1,"mat-horizontal-content-container"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id","mat-horizontal-stepper-content-inactive"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-stepper-horizontal-line"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id"],[3,"ngTemplateOutlet"],[1,"mat-step"],[1,"mat-vertical-content-container"],["role","tabpanel",1,"mat-vertical-stepper-content",3,"id"],[1,"mat-vertical-content"],[3,"click","keydown","tabIndex","id","index","state","label","selected","active","optional","errorMessage","iconOverrides","disableRipple","color"]],template:function(n,i){if(1&n&&(t.NAR(),t.DNE(0,St,1,0)(1,Dt,7,0,"div",1)(2,At,2,0)(3,Ot,1,23,"ng-template",null,0,t.C5r)),2&n){let a;t.vxM(i._isServer?0:-1),t.R7$(),t.vxM("horizontal"===(a=i.orientation)?1:"vertical"===a?2:-1)}},dependencies:[k.T3,G],styles:['.mat-stepper-vertical,.mat-stepper-horizontal{display:block;font-family:var(--mat-stepper-container-text-font, var(--mat-app-body-medium-font));background:var(--mat-stepper-container-color, var(--mat-app-surface))}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-header-position-bottom .mat-horizontal-stepper-header-container{order:1}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px;border-top-color:var(--mat-stepper-line-color, var(--mat-app-outline))}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative;top:calc(calc((var(--mat-stepper-header-height) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{border-top-width:1px;border-top-style:solid;content:"";display:inline-block;height:0;position:absolute;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px;height:var(--mat-stepper-header-height)}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-horizontal-stepper-header::before,.mat-horizontal-stepper-header::after{border-top-color:var(--mat-stepper-line-color, var(--mat-app-outline))}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{padding:calc((var(--mat-stepper-header-height) - 24px) / 2) 24px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::after{top:calc(calc((var(--mat-stepper-header-height) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;height:24px;padding:calc((var(--mat-stepper-header-height) - 24px) / 2) 24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-wrapper{display:flex;flex-direction:column}.mat-horizontal-stepper-content{outline:0}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-inactive{height:0;overflow:hidden}.mat-horizontal-stepper-content:not(.mat-horizontal-stepper-content-inactive){visibility:inherit !important}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.cdk-high-contrast-active .mat-horizontal-content-container{outline:solid 1px}.mat-stepper-header-position-bottom .mat-horizontal-content-container{padding:24px 24px 0 24px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}.cdk-high-contrast-active .mat-vertical-content-container{outline:solid 1px}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:"";position:absolute;left:0;border-left-width:1px;border-left-style:solid;border-left-color:var(--mat-stepper-line-color, var(--mat-app-outline));top:calc(8px - calc((var(--mat-stepper-header-height) - 24px) / 2));bottom:calc(8px - calc((var(--mat-stepper-header-height) - 24px) / 2))}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0}.mat-vertical-stepper-content:not(.mat-vertical-stepper-content-inactive){visibility:inherit !important}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}'],encapsulation:2,data:{animation:[J.horizontalStepTransition,J.verticalStepTransition]},changeDetection:0})}}return o})(),zt=(()=>{class o extends pt{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=t.xGo(o)))(i||o)}})()}static{this.\u0275dir=t.FsC({type:o,selectors:[["button","matStepperNext",""]],hostAttrs:[1,"mat-stepper-next"],hostVars:1,hostBindings:function(n,i){2&n&&t.Mr5("type",i.type)},standalone:!0,features:[t.Vt3]})}}return o})(),Lt=(()=>{class o extends ct{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=t.xGo(o)))(i||o)}})()}static{this.\u0275dir=t.FsC({type:o,selectors:[["button","matStepperPrevious",""]],hostAttrs:[1,"mat-stepper-previous"],hostVars:1,hostBindings:function(n,i){2&n&&t.Mr5("type",i.type)},standalone:!0,features:[t.Vt3]})}}return o})(),Bt=(()=>{class o{static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275mod=t.$C({type:o})}static{this.\u0275inj=t.G2t({providers:[$t,h.es],imports:[h.yE,k.MD,S.jc,dt,_.m_,h.pZ,A,G,h.yE]})}}return o})();var Xt=s(36815),O=s(65571),K=s(82765),f=s(75351),Vt=s(59115),Ht=s(14823);let Ut=(()=>{class o{constructor(e,n){this.dialogRef=e,this.data=n,this.fb=(0,t.WQX)(c.ok),this.form=this.fb.group({name:[null,c.k0.required]})}ngAfterViewInit(){}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(f.CP),t.rXU(f.Vh))}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["app-agreement-dialog"]],standalone:!0,features:[t.aNF],decls:136,vars:1,consts:[["mat-dialog-title",""],[1,"mat-typography"],["align","end"],["mat-button","","cdkFocusInitial","",3,"mat-dialog-close"]],template:function(n,i){1&n&&(t.j41(0,"h2",0),t.EFF(1,"Community Host Agreement"),t.k0s(),t.j41(2,"mat-dialog-content",1)(3,"h3"),t.EFF(4,"General Agreement"),t.k0s(),t.j41(5,"p"),t.EFF(6,"This software is provided with no warranty."),t.k0s(),t.j41(7,"p"),t.EFF(8,"You accept that all human interactions should be voluntary."),t.k0s(),t.j41(9,"p"),t.EFF(10,"You accept that you won't attempt to exploit or abuse the app, server and infrastructure used by Ariton."),t.k0s(),t.j41(11,"p"),t.EFF(12," You accept that all usage of Ariton's apps, servers, infrastructure and software must be the result of peaceful voluntary human interactions. Uploading and sharing content that was the result of involuntary human interactions is not allowed. "),t.k0s(),t.j41(13,"p"),t.EFF(14," Ariton reserves the right to exclude, remove, delete any community, content, user or any other data that is stored on Ariton's servers. Ariton does not have permission or right to access any data that is stored on user's personal data stores, unless the app has given explicit and implicit permission to do so. "),t.k0s(),t.j41(15,"h3"),t.EFF(16,"Responsibilities as a Community Host"),t.k0s(),t.j41(17,"p"),t.EFF(18," As a Community Host, you are responsible for creating a welcoming and inclusive environment for all members. This includes: "),t.k0s(),t.j41(19,"ul")(20,"li"),t.EFF(21,"Ensuring that all interactions are respectful and free from harassment."),t.k0s(),t.j41(22,"li"),t.EFF(23,"Moderating content to ensure it adheres to community guidelines."),t.k0s(),t.j41(24,"li"),t.EFF(25,"Providing timely responses to community inquiries and issues."),t.k0s()(),t.j41(26,"h3"),t.EFF(27,"Ariton's Commitment to Community Hosts"),t.k0s(),t.j41(28,"p"),t.EFF(29,"Ariton is committed to supporting Community Hosts by providing:"),t.k0s(),t.j41(30,"ul")(31,"li"),t.EFF(32,"Access to resources and training materials."),t.k0s(),t.j41(33,"li"),t.EFF(34,"Technical support for platform-related issues."),t.k0s(),t.j41(35,"li"),t.EFF(36,"Regular updates and communication regarding community policies."),t.k0s()(),t.j41(37,"h3"),t.EFF(38,"Rules and Behaviors"),t.k0s(),t.j41(39,"p"),t.EFF(40,"All Community Hosts must adhere to the following rules and behaviors:"),t.k0s(),t.j41(41,"ul")(42,"li"),t.EFF(43,"Maintain a professional and respectful tone in all communications."),t.k0s(),t.j41(44,"li"),t.EFF(45,"Do not engage in or tolerate any form of discrimination or harassment."),t.k0s(),t.j41(46,"li"),t.EFF(47,"Ensure that all content shared is appropriate and relevant to the community."),t.k0s()(),t.j41(48,"h3"),t.EFF(49,"Acceptable Content"),t.k0s(),t.j41(50,"p"),t.EFF(51,"Acceptable content includes:"),t.k0s(),t.j41(52,"ul")(53,"li"),t.EFF(54,"Educational materials and resources."),t.k0s(),t.j41(55,"li"),t.EFF(56,"Community announcements and updates."),t.k0s(),t.j41(57,"li"),t.EFF(58,"Discussions and forums that promote positive engagement."),t.k0s()(),t.j41(59,"p"),t.EFF(60,"Unacceptable content includes:"),t.k0s(),t.j41(61,"ul")(62,"li"),t.EFF(63,"Offensive or discriminatory language."),t.k0s(),t.j41(64,"li"),t.EFF(65,"Spam or irrelevant advertisements."),t.k0s(),t.j41(66,"li"),t.EFF(67,"Content that violates any laws or community guidelines."),t.k0s()(),t.j41(68,"h3"),t.EFF(69,"Basic SLA Agreement"),t.k0s(),t.j41(70,"p"),t.EFF(71,"As part of the Service Level Agreement (SLA), Community Hosts are expected to:"),t.k0s(),t.j41(72,"ul")(73,"li"),t.EFF(74,"Regularly monitor and moderate community interactions."),t.k0s()(),t.j41(75,"p"),t.EFF(76,"Ariton will provide:"),t.k0s(),t.j41(77,"ul")(78,"li"),t.EFF(79,"Technical support for issues through GitHub."),t.k0s(),t.j41(80,"li"),t.EFF(81,"Regular updates and maintenance to ensure platform stability."),t.k0s(),t.j41(82,"li"),t.EFF(83,"Access to a dedicated support team for Community Hosts, which includes:"),t.k0s(),t.j41(84,"ul")(85,"li")(86,"strong"),t.EFF(87,"Basic Support:"),t.k0s(),t.j41(88,"ul")(89,"li"),t.EFF(90,"Access to community forums and knowledge base."),t.k0s(),t.j41(91,"li"),t.EFF(92,"Email support with a response time of up to 72 hours."),t.k0s(),t.j41(93,"li"),t.EFF(94,"Regular updates and bug fixes."),t.k0s()()(),t.j41(95,"li")(96,"strong"),t.EFF(97,"Extended Support:"),t.k0s(),t.j41(98,"ul")(99,"li"),t.EFF(100,"All features of Basic Support."),t.k0s(),t.j41(101,"li"),t.EFF(102,"Priority email support with a response time of up to 48 hours."),t.k0s(),t.j41(103,"li"),t.EFF(104,"Monthly webinars and training sessions."),t.k0s(),t.j41(105,"li"),t.EFF(106,"Access to beta features and early updates."),t.k0s()()(),t.j41(107,"li")(108,"strong"),t.EFF(109,"Premium Support:"),t.k0s(),t.j41(110,"ul")(111,"li"),t.EFF(112,"All features of Extended Support."),t.k0s(),t.j41(113,"li"),t.EFF(114,"Chat support with a response time of up to 24 hour."),t.k0s(),t.j41(115,"li"),t.EFF(116,"Dedicated account manager for personalized assistance."),t.k0s(),t.j41(117,"li"),t.EFF(118,"Customizable support plans and SLAs."),t.k0s(),t.j41(119,"li"),t.EFF(120,"On-site training and support (if applicable)."),t.k0s()()()()(),t.j41(121,"h3"),t.EFF(122,"Payments"),t.k0s(),t.j41(123,"p"),t.EFF(124," The host fee is an monthly or annual up-front free that must be paid for the community to be created and active. "),t.k0s(),t.j41(125,"p"),t.EFF(126,"The membership fee is calculated at the end of the month and paid out to the community host."),t.k0s(),t.j41(127,"h3"),t.EFF(128,"Changes to agreement policies"),t.k0s(),t.j41(129,"p"),t.EFF(130," We reserve the right to update and change our agreement policies at any time, and it is hosts and users responsibility to ensure knowledge and acceptance of the latest revisions. "),t.k0s(),t.j41(131,"p"),t.EFF(132,"Last updated: 2024-10-10"),t.k0s()(),t.j41(133,"mat-dialog-actions",2)(134,"button",3),t.EFF(135,"Close"),t.k0s()()),2&n&&(t.R7$(134),t.Y8G("mat-dialog-close",!0))},dependencies:[k.MD,Ht.uc,Vt.Cn,_.m_,v.Hl,v.$z,j.fS,f.hM,f.tx,f.BI,f.E7,f.Yi,c.YN],styles:["form[_ngcontent-%COMP%]{display:inline}"]})}}return o})();var w=s(43881);let Yt=(()=>{class o{constructor(){this.levels={"annual-premium":{id:"premium",annual:!0,maxFee:1e3,maxMembers:1e4,cost:450,steps:10},"annual-standard":{id:"standard",annual:!0,maxFee:100,maxMembers:1e3,cost:280,steps:10},"annual-basic":{id:"basic",annual:!0,maxFee:10,maxMembers:50,cost:190,steps:1},"monthly-premium":{id:"premium",annual:!1,maxFee:1e3,maxMembers:1e4,cost:500,steps:10},"monthly-standard":{id:"standard",annual:!1,maxFee:100,maxMembers:1e3,cost:300,steps:10},"monthly-basic":{id:"basic",annual:!1,maxFee:10,maxMembers:50,cost:200,steps:1}}}getAnnualLevels(){return Object.values(this.levels).filter(e=>e.annual)}getMonthlyLevels(){return Object.values(this.levels).filter(e=>!e.annual)}getLevel(e){return this.levels[e]}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275prov=t.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var Qt=s(68314),Wt=s(96084),Jt=s(85297);const Zt=["stepper"],Kt=o=>["/community",o];function qt(o,r){if(1&o&&(t.j41(0,"div",5)(1,"h1"),t.EFF(2,"Community created!"),t.k0s(),t.j41(3,"p"),t.EFF(4," Your community has been created and is now active. It is not yet published, but you can start inviting members to it and start using it. "),t.k0s(),t.j41(5,"a",7),t.EFF(6,"Go to community"),t.k0s()()),2&o){const e=t.XpG();t.R7$(5),t.Y8G("routerLink",t.eq3(1,Kt,e.draftEntry.record.id))}}function te(o,r){1&o&&t.EFF(0,"Options")}function ee(o,r){if(1&o){const e=t.RV6();t.j41(0,"mat-card",38)(1,"mat-card-header")(2,"mat-icon",39),t.EFF(3,"cloud"),t.k0s(),t.j41(4,"mat-card-title"),t.EFF(5,"Basic (10 GB)"),t.k0s(),t.j41(6,"mat-card-subtitle"),t.EFF(7,"$200/month"),t.k0s()(),t.j41(8,"mat-card-content")(9,"p"),t.EFF(10,"Ideal for small communities, members pay a monthly fee."),t.k0s(),t.j41(11,"p"),t.EFF(12,"The host can configure membership fee between $1 and $10 per month."),t.k0s(),t.j41(13,"p"),t.EFF(14,"Maximum 50 members."),t.k0s(),t.j41(15,"p"),t.EFF(16,"Basic support."),t.k0s()(),t.j41(17,"mat-card-actions")(18,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("monthly-basic"))}),t.EFF(19,"Choose"),t.k0s()()(),t.j41(20,"mat-card",38)(21,"mat-card-header")(22,"mat-icon",39),t.EFF(23,"cloud_done"),t.k0s(),t.j41(24,"mat-card-title"),t.EFF(25,"Standard (50 GB)"),t.k0s(),t.j41(26,"mat-card-subtitle"),t.EFF(27,"$300/month"),t.k0s()(),t.j41(28,"mat-card-content")(29,"p"),t.EFF(30,"Ideal for medium communities, members pay a monthly fee."),t.k0s(),t.j41(31,"p"),t.EFF(32,"The host can configure membership fee between $1 and $100 per month."),t.k0s(),t.j41(33,"p"),t.EFF(34,"Maximum 1,000 members."),t.k0s(),t.j41(35,"p"),t.EFF(36,"Extended support."),t.k0s()(),t.j41(37,"mat-card-actions")(38,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("monthly-standard"))}),t.EFF(39,"Choose"),t.k0s()()(),t.j41(40,"mat-card",38)(41,"mat-card-header")(42,"mat-icon",39),t.EFF(43,"cloud_done"),t.k0s(),t.j41(44,"mat-card-title"),t.EFF(45,"Premium (100 GB)"),t.k0s(),t.j41(46,"mat-card-subtitle"),t.EFF(47,"$500/month"),t.k0s()(),t.j41(48,"mat-card-content")(49,"p"),t.EFF(50,"Ideal for larger and exclusive communities, members pay a monthly fee."),t.k0s(),t.j41(51,"p"),t.EFF(52,"The host can configure membership fee between $1 and $1000 per month."),t.k0s(),t.j41(53,"p"),t.EFF(54,"Maximum 10,000 members."),t.k0s(),t.j41(55,"p"),t.EFF(56,"Premium support."),t.k0s()(),t.j41(57,"mat-card-actions")(58,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("monthly-premium"))}),t.EFF(59,"Choose"),t.k0s()()()}}function ne(o,r){if(1&o){const e=t.RV6();t.j41(0,"mat-card",38)(1,"mat-card-header")(2,"mat-icon",39),t.EFF(3,"cloud"),t.k0s(),t.j41(4,"mat-card-title"),t.EFF(5,"Basic (10 GB)"),t.k0s(),t.j41(6,"mat-card-subtitle"),t.EFF(7,"$190/month"),t.k0s()(),t.j41(8,"mat-card-content")(9,"p"),t.EFF(10,"Ideal for small communities, members pay a monthly fee."),t.k0s(),t.j41(11,"p"),t.EFF(12,"The host can configure membership fee between $1 and $10 per month."),t.k0s(),t.j41(13,"p"),t.EFF(14,"Maximum 50 members."),t.k0s(),t.j41(15,"p"),t.EFF(16,"Basic support."),t.k0s()(),t.j41(17,"mat-card-actions")(18,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("annual-basic"))}),t.EFF(19,"Choose"),t.k0s()()(),t.j41(20,"mat-card",38)(21,"mat-card-header")(22,"mat-icon",39),t.EFF(23,"cloud_done"),t.k0s(),t.j41(24,"mat-card-title"),t.EFF(25,"Standard (50 GB)"),t.k0s(),t.j41(26,"mat-card-subtitle"),t.EFF(27,"$280/month"),t.k0s()(),t.j41(28,"mat-card-content")(29,"p"),t.EFF(30,"Ideal for medium communities, members pay a monthly fee."),t.k0s(),t.j41(31,"p"),t.EFF(32,"The host can configure membership fee between $1 and $100 per month."),t.k0s(),t.j41(33,"p"),t.EFF(34,"Maximum 1,000 members."),t.k0s(),t.j41(35,"p"),t.EFF(36,"Extended support."),t.k0s()(),t.j41(37,"mat-card-actions")(38,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("annual-standard"))}),t.EFF(39,"Choose"),t.k0s()()(),t.j41(40,"mat-card",38)(41,"mat-card-header")(42,"mat-icon",39),t.EFF(43,"cloud_done"),t.k0s(),t.j41(44,"mat-card-title"),t.EFF(45,"Premium (100 GB)"),t.k0s(),t.j41(46,"mat-card-subtitle"),t.EFF(47,"$450/month"),t.k0s()(),t.j41(48,"mat-card-content")(49,"p"),t.EFF(50,"Ideal for larger and exclusive communities, members pay a monthly fee."),t.k0s(),t.j41(51,"p"),t.EFF(52,"The host can configure membership fee between $1 and $1000 per month."),t.k0s(),t.j41(53,"p"),t.EFF(54,"Maximum 10,000 members."),t.k0s(),t.j41(55,"p"),t.EFF(56,"Premium support."),t.k0s()(),t.j41(57,"mat-card-actions")(58,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("annual-premium"))}),t.EFF(59,"Choose"),t.k0s()()()}}function oe(o,r){if(1&o&&(t.j41(0,"mat-option",24),t.EFF(1),t.k0s()),2&o){const e=r.$implicit;t.Y8G("value",e.type),t.R7$(),t.JRh(e.name)}}function ie(o,r){1&o&&(t.j41(0,"mat-error"),t.EFF(1,"About is "),t.j41(2,"strong"),t.EFF(3,"required"),t.k0s()())}function ae(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",28)(1,"mat-form-field",21),t.nrm(2,"input",41),t.k0s(),t.j41(3,"button",42),t.bIt("click",function(){const i=t.eBV(e).$index,a=t.XpG(2);return t.Njj(a.removeOwner(i))}),t.j41(4,"mat-icon"),t.EFF(5,"clear"),t.k0s()()()}if(2&o){const e=r.$index;t.R7$(2),t.Y8G("formControlName",e)}}function re(o,r){if(1&o&&(t.j41(0,"span"),t.EFF(1,"As the host, you will receive 70% of membership fee."),t.k0s(),t.j41(2,"p",43)(3,"mat-slider",44),t.nrm(4,"input",45,3),t.k0s(),t.j41(6,"span",46),t.EFF(7),t.k0s()(),t.j41(8,"p",43)(9,"mat-slider",44),t.nrm(10,"input",47,3),t.k0s(),t.j41(12,"span",46),t.EFF(13),t.k0s()(),t.j41(14,"span"),t.EFF(15),t.k0s(),t.j41(16,"p"),t.EFF(17," Community Type: "),t.j41(18,"span",31),t.EFF(19),t.k0s(),t.nrm(20,"br"),t.EFF(21),t.nrm(22,"br"),t.EFF(23),t.k0s()),2&o){const e=t.XpG(2);t.R7$(3),t.Y8G("max",e.costLevel.maxFee)("min",1)("step",1)("showTickMarks",!0),t.R7$(4),t.SpI("$",e.secondFormGroup.controls.fee.value," per member"),t.R7$(2),t.Y8G("max",e.costLevel.maxMembers)("min",e.costLevel.steps)("step",e.costLevel.steps)("showTickMarks",!0),t.R7$(4),t.SpI("",e.secondFormGroup.controls.members.value,"/members"),t.R7$(2),t.SpI("Pricing example with ",e.secondFormGroup.controls.members.value," members: "),t.R7$(4),t.JRh(e.costLevel.id),t.R7$(2),t.SpI(" Host costs: -$",e.costLevel.cost,""),t.R7$(2),t.SpI(" Host income: +$",e.earnings," ")}}function se(o,r){if(1&o&&(t.j41(0,"span"),t.EFF(1," As the host, you must approve all membership requests. Members do not pay a fee to join."),t.k0s(),t.j41(2,"p",43)(3,"span",46),t.EFF(4,"$1 per member per month"),t.k0s()(),t.j41(5,"p",43)(6,"mat-slider",44),t.nrm(7,"input",47,3),t.k0s(),t.j41(9,"span",46),t.EFF(10),t.k0s()(),t.j41(11,"span"),t.EFF(12),t.k0s(),t.j41(13,"p"),t.EFF(14," Community Type: "),t.j41(15,"span",31),t.EFF(16),t.k0s(),t.nrm(17,"br"),t.EFF(18),t.k0s()),2&o){const e=t.XpG(2);t.R7$(6),t.Y8G("max",e.costLevel.maxMembers)("min",e.costLevel.steps)("step",e.costLevel.steps)("showTickMarks",!0),t.R7$(4),t.SpI("",e.secondFormGroup.controls.members.value,"/members"),t.R7$(2),t.SpI("Pricing example with ",e.secondFormGroup.controls.members.value," members:"),t.R7$(4),t.JRh(e.costLevel.id),t.R7$(2),t.SpI(" Host costs: -$",e.costLevel.cost+e.costs," ")}}function le(o,r){1&o&&t.EFF(0,"Payment")}function pe(o,r){if(1&o){const e=t.RV6();t.j41(0,"form",10)(1,"h1"),t.EFF(2,"Finalize Payment"),t.k0s(),t.j41(3,"p")(4,"mat-button-toggle-group",48)(5,"mat-button-toggle",49),t.EFF(6,"Bitcoin Lightning"),t.k0s()()(),t.j41(7,"p",50),t.EFF(8," THIS IS JUST A DEMO, NO COMMUNITY IS CREATED. PAYMENT IS REAL. CONSIDER IT A DONATION TO ARITON. "),t.k0s(),t.j41(9,"p",51),t.nrm(10,"canvas",null,4),t.k0s(),t.j41(12,"div"),t.EFF(13),t.k0s(),t.j41(14,"div",52),t.EFF(15),t.k0s(),t.j41(16,"p"),t.EFF(17),t.k0s(),t.j41(18,"p")(19,"button",53),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.deleteRequest())}),t.EFF(20,"Delete the community request"),t.k0s()()()}if(2&o){const e=t.XpG(3);t.Y8G("formGroup",e.fourthFormGroup),t.R7$(13),t.SpI("Amount: ",e.amount," sats"),t.R7$(2),t.JRh(e.invoice),t.R7$(2),t.SpI(" ",e.paymentStatus," ")}}function ce(o,r){1&o&&(t.j41(0,"h1"),t.EFF(1,"Payment completed!"),t.k0s(),t.j41(2,"p",54)(3,"mat-icon",55),t.EFF(4,"verified"),t.k0s()(),t.j41(5,"p"),t.EFF(6," Your payment has been received and your community is now active. You can now invite members to join your community. "),t.k0s(),t.j41(7,"p")(8,"strong",50),t.EFF(9,"WARNING: THIS IS A DEMO. NO COMMUNITY WAS CREATED."),t.k0s()())}function de(o,r){if(1&o&&t.DNE(0,pe,21,4,"form",10)(1,ce,10,0),2&o){const e=t.XpG(2);t.vxM(e.paid?1:0)}}function me(o,r){1&o&&t.EFF(0," Annual ")}function ue(o,r){1&o&&t.EFF(0," Monthly ")}function he(o,r){1&o&&t.EFF(0," Member ")}function fe(o,r){1&o&&t.EFF(0," Host ")}function ve(o,r){if(1&o&&t.EFF(0),2&o){const e=t.XpG(3);t.Lme(" ",12*e.costLevel.cost," / ~",12*e.costLevel.sats," sats ")}}function _e(o,r){if(1&o&&t.EFF(0),2&o){const e=t.XpG(3);t.Lme(" ",e.costLevel.cost," / ~",e.costLevel.sats," sats ")}}function ge(o,r){if(1&o){const e=t.RV6();t.j41(0,"form",10)(1,"h1"),t.EFF(2,"You're almost done!"),t.k0s(),t.j41(3,"p"),t.EFF(4,"Please validate your options before making a payment:"),t.k0s(),t.j41(5,"h3",31),t.EFF(6),t.k0s(),t.j41(7,"p"),t.EFF(8),t.nrm(9,"br"),t.EFF(10," Type: "),t.j41(11,"span",31),t.EFF(12),t.k0s(),t.nrm(13,"br")(14,"br"),t.EFF(15," Payment intervals: "),t.DNE(16,me,1,0)(17,ue,1,0),t.nrm(18,"br"),t.EFF(19," Cost: "),t.j41(20,"strong"),t.EFF(21),t.k0s(),t.nrm(22,"br")(23,"br"),t.EFF(24," Membership cost: "),t.j41(25,"strong"),t.EFF(26),t.k0s(),t.nrm(27,"br"),t.EFF(28," Paid by: "),t.j41(29,"strong"),t.DNE(30,he,1,0)(31,fe,1,0),t.k0s()(),t.j41(32,"div",56)(33,"mat-checkbox",57),t.EFF(34,"I agree with Community Host Agreement"),t.k0s(),t.nrm(35,"br"),t.j41(36,"button",58),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.openAgreement())}),t.EFF(37,"Read Community Host Agreement"),t.k0s()(),t.j41(38,"h3"),t.EFF(39,"Payment due"),t.k0s(),t.j41(40,"div",59),t.EFF(41," $"),t.DNE(42,ve,1,2)(43,_e,1,2),t.k0s(),t.j41(44,"p")(45,"button",60),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.save())}),t.EFF(46,"Approve"),t.k0s()()(),t.j41(47,"div")(48,"button",35),t.EFF(49,"Back"),t.k0s(),t.nrm(50,"br")(51,"br"),t.j41(52,"button",37),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.deleteDraft())}),t.EFF(53," Delete Draft "),t.k0s()()}if(2&o){const e=t.XpG(2);t.Y8G("formGroup",e.thirdFormGroup),t.R7$(6),t.JRh(e.costLevel.id),t.R7$(2),t.SpI(" Name: ",e.secondFormGroup.controls.name.value,""),t.R7$(4),t.JRh(e.secondFormGroup.controls.type.value),t.R7$(4),t.vxM(e.costLevel.annual?16:17),t.R7$(5),t.SpI("$",e.costLevel.cost,"/month"),t.R7$(5),t.SpI("$",e.secondFormGroup.controls.fee.value,"/month"),t.R7$(4),t.vxM("paid"===e.secondFormGroup.controls.membershipType.value?30:31),t.R7$(12),t.vxM(e.costLevel.annual?42:43),t.R7$(3),t.Y8G("disabled",!e.thirdFormGroup.valid),t.R7$(7),t.Y8G("disabled",!e.draftEntry)}}function Fe(o,r){if(1&o){const e=t.RV6();t.j41(0,"mat-stepper",8,0),t.bIt("selectionChange",function(i){t.eBV(e);const a=t.XpG();return t.Njj(a.onStepChange(i))}),t.j41(2,"mat-step",9)(3,"form",10),t.DNE(4,te,1,0,"ng-template",11),t.j41(5,"div")(6,"div",12)(7,"mat-icon",13),t.EFF(8,"diversity_2"),t.k0s(),t.j41(9,"h1"),t.EFF(10,"Choose the feature options"),t.k0s(),t.j41(11,"p"),t.EFF(12,"Choose the features you want to include in your community. You can always change these later on."),t.k0s(),t.j41(13,"p")(14,"mat-button-toggle-group",14)(15,"mat-button-toggle",15),t.EFF(16,"Monthly"),t.k0s(),t.j41(17,"mat-button-toggle",16),t.EFF(18,"Annual"),t.k0s()()()(),t.j41(19,"div",17),t.DNE(20,ee,60,0)(21,ne,60,0),t.k0s()()()(),t.j41(22,"mat-step",18)(23,"form",10)(24,"div"),t.nrm(25,"app-avatar",19),t.j41(26,"mat-card",20)(27,"mat-card-content")(28,"mat-form-field",21)(29,"mat-label"),t.EFF(30,"Community name"),t.k0s(),t.nrm(31,"input",22,1),t.k0s(),t.j41(33,"mat-form-field",21)(34,"mat-label"),t.EFF(35,"Community type"),t.k0s(),t.j41(36,"mat-select",23),t.Z7z(37,oe,2,2,"mat-option",24,t.fX1),t.k0s()(),t.j41(39,"mat-form-field",21)(40,"mat-label"),t.EFF(41,"About"),t.k0s(),t.nrm(42,"textarea",25,2),t.DNE(44,ie,4,0,"mat-error"),t.j41(45,"mat-hint",26),t.EFF(46),t.k0s()(),t.j41(47,"div",27),t.Z7z(48,ae,6,1,"div",28,t.fX1),t.k0s(),t.j41(50,"button",29),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.addOwner())}),t.j41(51,"mat-icon"),t.EFF(52,"add_link"),t.k0s(),t.EFF(53," Add Host "),t.k0s(),t.j41(54,"h3",30),t.EFF(55," Membership Fee: "),t.j41(56,"span",31),t.EFF(57),t.k0s()(),t.j41(58,"p"),t.EFF(59," Set the membership fee for your community. If you want to use Ariton in a corporate setting without user's having to pay fee, you can choose to cover all the expenses for your community members. "),t.k0s(),t.j41(60,"p")(61,"mat-radio-group",32),t.bIt("change",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.resetFee())}),t.j41(62,"mat-radio-button",33),t.EFF(63,"Paid by Member"),t.k0s(),t.j41(64,"mat-radio-button",34),t.EFF(65,"Paid by Host"),t.k0s()()(),t.DNE(66,re,24,14)(67,se,19,8),t.k0s()()()(),t.j41(68,"p")(69,"button",35),t.EFF(70,"Back"),t.k0s(),t.j41(71,"button",36),t.EFF(72,"Next"),t.k0s(),t.nrm(73,"br")(74,"br"),t.j41(75,"button",37),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.deleteDraft())}),t.EFF(76," Delete Draft "),t.k0s()()(),t.j41(77,"mat-step",9),t.DNE(78,le,1,0,"ng-template",11)(79,de,2,1)(80,ge,54,11),t.k0s()()}if(2&o){const e=t.sdS(43),n=t.XpG();t.Y8G("linear",!0),t.R7$(2),t.Y8G("stepControl",n.firstFormGroup),t.R7$(),t.Y8G("formGroup",n.firstFormGroup),t.R7$(17),t.vxM("monthly"===n.firstFormGroup.controls.premiumPeriod.value?20:21),t.R7$(2),t.Y8G("stepControl",n.secondFormGroup),t.R7$(),t.Y8G("formGroup",n.secondFormGroup),t.R7$(14),t.Dyx(n.communityTypes),t.R7$(7),t.vxM(n.secondFormGroup.controls.bio.hasError("required")?44:-1),t.R7$(2),t.SpI("",e.value.length," / 300"),t.R7$(2),t.Dyx(n.owners.controls),t.R7$(9),t.JRh(n.optionLevel),t.R7$(9),t.vxM("paid"===n.secondFormGroup.controls.membershipType.value?66:67),t.R7$(9),t.Y8G("disabled",!n.draftEntry),t.R7$(2),t.Y8G("stepControl",n.thirdFormGroup),t.R7$(2),t.vxM(n.saved?79:80)}}let be=(()=>{class o{constructor(){var e=this;this.fb=(0,t.WQX)(c.ok),this.identity=(0,t.WQX)(et.K),this.profileService=(0,t.WQX)(nt.p),this.navigation=(0,t.WQX)(ot.o),this.pricing=(0,t.WQX)(Yt),this.router=(0,t.WQX)(g.Ix),this.data=(0,t.WQX)(Jt.u),this.route=(0,t.WQX)(g.nX),this.app=(0,t.WQX)(Wt.d),this.bitcoinPriceUsd=0,this._formBuilder=(0,t.WQX)(c.ok),this.firstFormGroup=this._formBuilder.group({premiumPeriod:["monthly"],option:["",c.k0.required]}),this.secondFormGroup=this._formBuilder.group({name:[null,c.k0.required],type:[null,c.k0.required],bio:[null],avatar:[""],owners:this.fb.array([this.fb.control("")]),fee:[1,c.k0.required],members:[20,c.k0.required],membershipType:["paid"]}),this.thirdFormGroup=this._formBuilder.group({acceptTerms:["",c.k0.requiredTrue]}),this.fourthFormGroup=this._formBuilder.group({paymentMethod:["ln"]}),this.draftDeleted=!1,this.paid=!1,this.paymentStatus="Pending...",this.checkPaymentStatus=(0,d.A)(function*(){e.paid?console.log("Payment status is paid."):(yield e.checkPayment(),e.scheduleNextCheck())}),this.scheduleNextCheck=()=>{setTimeout(this.checkPaymentStatus,2e3)},this.amount=0,this.hash="",this.invoice="",this.premiumPeriod="monthly",this.saved=!1,this.layout=(0,t.WQX)(Xt.Y),this.communityTypes=[{type:"general",name:"General"},{type:"power",name:"Power Structure"},{type:"company",name:"Company Structure"}],this.maxFee=10,this.dialog=(0,t.WQX)(f.bZ),this.optionLevel="basic",this.optionAnnual=!1,this.selectedCommunity=(0,t.vPA)(null),this.routerSubscription=this.router.events.subscribe(function(){var n=(0,d.A)(function*(i){i instanceof g.Z&&(console.log("Navigating away from CreateComponent"),yield e.saveDraft())});return function(i){return n.apply(this,arguments)}}()),this.costLevel=this.pricing.levels["monthly-basic"],this.route.paramMap.subscribe(n=>{this.selectedCommunity.set(n.get("id"))}),(0,t.QZP)((0,d.A)(function*(){if(e.selectedCommunity()&&e.app.initialized()){console.log("Selected community and app initialized:",e.selectedCommunity());const n=e.selectedCommunity(),i=yield e.data.get(n);console.log("Community Entry: ",i),e.draftEntry=i,i.data.option="monthly-basic",e.firstFormGroup.patchValue({option:i.data.option}),e.secondFormGroup.patchValue(i.data),e.stepper&&e.stepper.next()}}),{allowSignalWrites:!0}),(0,t.QZP)((0,d.A)(function*(){e.identity.initialized()&&(console.log(e.owners),e.owners.setValue([e.identity.did]))}))}goToNextStep(){this.stepper.next()}updateBitcoinPrice(){var e=this;return(0,d.A)(function*(){const n=yield fetch("https://pay.ariton.app/price");if(n.ok){const i=yield n.json();e.bitcoinPriceUsd=i.usd,console.log("bitcoinPriceUsd",e.bitcoinPriceUsd)}})()}deleteDraft(){var e=this;return(0,d.A)(function*(){console.log("DELETE DRAFT:",e.draftEntry),yield e.data.delete(e.draftEntry.record),e.draftEntry=void 0,e.draftDeleted=!0,e.router.navigate(["/communities"])})()}getPriceInSatoshis(e){return Math.round(e/this.bitcoinPriceUsd*1e8)}checkPayment(){var e=this;return(0,d.A)(function*(){const n=yield fetch(`https://pay.ariton.app/paid?hash=${e.hash}`);if(n.ok){const i=yield n.json();console.log("RESULT FROM PAID:",i),i.paid?(console.log("Payment is paid"),e.paymentStatus="Paid",e.paid=!0,yield e.saveDraft(!0)):(console.log("Payment is not paid"),e.paymentStatus="Not Paid")}else console.error("Failed to validate invoice"),e.paymentStatus=n.statusText})()}onStepChange(e){var n=this;return(0,d.A)(function*(){console.log("Selected step index:",e.selectedIndex),console.log("Previously selected step index:",e.previouslySelectedIndex),yield n.saveDraft()})()}handleUnloadEvent(){var e=this;return(0,d.A)(function*(){yield e.saveDraft()})()}ngOnDestroy(){var e=this;return(0,d.A)(function*(){e.routerSubscription&&e.routerSubscription.unsubscribe()})()}saveDraft(e=!1){var n=this;return(0,d.A)(function*(){if(!n.draftDeleted&&n.secondFormGroup.controls.name.value){if(n.draftEntry){if("active"===n.draftEntry.record.tags.status)return void console.warn("This community is already ACTIVE! Editing not allowed in this UI.");const i={...n.draftEntry.data,...n.firstFormGroup.value,...n.secondFormGroup.value,...n.thirdFormGroup.value};console.log("DRAFT ENTRY UPDATE:",n.draftEntry),n.draftEntry=yield n.data.update(n.draftEntry.record,i,{type:"community",status:n.paid?"active":"draft"},e)}else{const i={...n.firstFormGroup.value,...n.secondFormGroup.value,...n.thirdFormGroup.value};n.draftEntry=yield n.data.save(i,{type:"community",status:"draft"},e)}console.log("SAVE DRAFT DONE!")}})()}generateInvoice(){var e=this;return(0,d.A)(function*(){yield e.updateBitcoinPrice();let n=0;n=e.getPriceInSatoshis(e.costLevel.annual?12*e.costLevel.cost:e.costLevel.cost),n=Math.round(n/30),e.invoice="";const i=`${e.identity.did}|${e.draftEntry.record.id}`,a=yield fetch(`https://pay.ariton.app/invoice?description=Ariton%20Community%20Payment&amount=${n}&id=${i}`);if(a.ok){const l=yield a.json();e.invoice=l.serialized,e.hash=l.paymentHash,e.amount=l.amountSat;const ye=document.querySelector("canvas");Qt.mo(ye,e.invoice,q=>{q&&console.error("Error generating QR code: ",q)}),e.scheduleNextCheck()}else console.error("Failed to generate invoice"),e.invoice=a.statusText})()}resetFee(){"paid"!==this.secondFormGroup.controls.membershipType.value&&this.secondFormGroup.controls.fee.setValue(1)}save(){var e=this;return(0,d.A)(function*(){e.saved=!0,yield e.saveDraft(!0),yield e.generateInvoice()})()}deleteRequest(){}get owners(){return this.secondFormGroup.get("owners")}get fee(){const e=this.secondFormGroup.get("fee");return Math.round(.7*e.value)}get earnings(){const e=this.secondFormGroup.get("fee"),n=this.secondFormGroup.get("members");return Math.round(.7*e.value*n.value)}get costs(){const e=this.secondFormGroup.get("fee"),n=this.secondFormGroup.get("members");return Math.round(e.value*n.value)}back(){this.navigation.back()}openAgreement(){this.dialog.open(Ut).afterClosed().subscribe(n=>{console.log(`Dialog result: ${n}`)})}chooseOption(e){var n=this;return(0,d.A)(function*(){console.log("Option:",e),n.firstFormGroup.patchValue({option:e});const i=e?.split("-");n.optionLevel=i[1],n.optionAnnual="annual"===i[0];const a=n.pricing.levels[e];n.costLevel=a,yield n.updateBitcoinPrice(),n.costLevel.sats=n.getPriceInSatoshis(a.cost),n.goToNextStep()})()}updateForm(e){console.log("Patching form with:",e),this.secondFormGroup.patchValue({name:e.name,bio:e.bio})}addOwner(){this.owners.push(this.fb.control(""))}removeOwner(e){this.owners.removeAt(e)}ngOnInit(){}onSubmit(){var e=this;return(0,d.A)(function*(){e.router.navigate(["/community",e.identity.did])})()}upload(e,n){var i=this;return(0,d.A)(function*(){if(e){if(console.log(n),n){console.log("UPDATING IMAGE!!!!");const{status:a,updatedRecord:l}=yield n.update({published:!0,data:e});return console.log("Update profile status:",a,l),l}{const{record:a}=yield i.identity.web5.dwn.records.create({data:e,message:{protocol:it.ME.uri,protocolPath:"avatar",dataFormat:"image/jpeg",tags:{module:"community"}}});return a}}console.log("No image to upload.")})()}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["app-create"]],viewQuery:function(n,i){if(1&n&&t.GBs(Zt,5),2&n){let a;t.mGM(a=t.lsd())&&(i.stepper=a.first)}},hostBindings:function(n,i){1&n&&t.bIt("beforeunload",function(){return i.handleUnloadEvent()},!1,t.tSv)},standalone:!0,features:[t.aNF],decls:2,vars:1,consts:[["stepper",""],["name",""],["bio",""],["slider",""],["qrCanvas",""],[1,"margin"],[3,"linear"],[3,"routerLink"],[3,"selectionChange","linear"],[3,"stepControl"],[3,"formGroup"],["matStepLabel",""],[1,"storage-container"],["inline","true",1,"storage-icon"],["formControlName","premiumPeriod"],["value","monthly"],["value","annual"],[1,"offers"],["label","Configure",3,"stepControl"],["formControlName","avatar"],[1,"form-card"],[1,"full-width"],["matInput","","placeholder","Community name","maxlength","200","formControlName","name"],["formControlName","type"],[3,"value"],["maxlength","300","matInput","","placeholder","About","formControlName","bio"],["align","end"],["formArrayName","owners"],[1,"link-input"],["mat-stroked-button","","type","button",3,"click"],[1,"h3-membership-fee"],[1,"capitalize"],["formControlName","membershipType","aria-label","Select an option",3,"change"],["value","paid"],["value","free"],["mat-button","","matStepperPrevious",""],["mat-button","","matStepperNext",""],["mat-flat-button","",1,"warning-button",3,"click","disabled"],[1,"offer-card"],["mat-card-avatar",""],["mat-button","","matStepperNext","",3,"click"],["matInput","","type","text","placeholder","Host (DID)",3,"formControlName"],["mat-icon-button","","type","button",3,"click"],[1,"fee-control"],[3,"max","min","step","showTickMarks"],["matSliderThumb","","formControlName","fee"],[1,"price"],["matSliderThumb","","formControlName","members"],["formControlName","paymentMethod"],["value","ln"],[1,"warning"],[1,"qr-code"],[1,"invoice","wrap"],["mat-flat-button","",3,"click"],[1,"large-icon"],["inline","true"],[1,"agreement-selection"],["formControlName","acceptTerms"],["type","button","mat-button","",3,"click"],[1,"payment-total"],["mat-flat-button","",3,"click","disabled"]],template:function(n,i){1&n&&t.DNE(0,qt,7,3,"div",5)(1,Fe,81,13,"mat-stepper",6),2&n&&t.vxM("active"===(null==i.draftEntry||null==i.draftEntry.record?null:i.draftEntry.record.tags.status)?0:1)},dependencies:[P.Ve,F.rl,F.nJ,F.MV,F.TL,P.VO,h.wT,tt.f,j.fS,j.fg,v.Hl,v.$z,v.iY,_.m_,_.An,M.Wk,M.VT,M._g,u.Hu,u.RN,u.YY,u.QG,u.m2,u.MM,u.Lc,u.dh,c.X1,c.qT,c.me,c.BC,c.cb,c.tU,c.j4,c.JD,c.v8,F.RG,c.YN,Bt,Z,E,A,zt,Lt,O.Vg,O.ec,O.pc,g.iI,g.Wk,K.g7,K.So,w.Ez,w.IV,w.OU],styles:[".full-width[_ngcontent-%COMP%]{width:100%}.form-card[_ngcontent-%COMP%]{margin-top:1em}.link-input[_ngcontent-%COMP%]{display:flex;align-items:baseline}.link-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:.4em}mat-card-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:1em}form[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex-direction:column}.storage-container[_ngcontent-%COMP%]{text-align:center}.storage-icon[_ngcontent-%COMP%]{font-size:3em}.offer-card[_ngcontent-%COMP%]{display:inline-block;padding:12px 16px;margin-right:1em;margin-bottom:1em;max-width:340px;font-size:.9em;border:2px solid transparent}.offer-card[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-app-text-color)}.offers[_ngcontent-%COMP%]{display:flex;justify-content:center}mat-stepper[_ngcontent-%COMP%]{border-radius:12px}.fee-control[_ngcontent-%COMP%]{display:flex}.fee-control[_ngcontent-%COMP%] .price[_ngcontent-%COMP%]{font-size:2em}h3[_ngcontent-%COMP%]{margin:.5em 0;padding:0}.large-icon[_ngcontent-%COMP%]{font-size:4em}.agreement-selection[_ngcontent-%COMP%]{margin:1em 0;padding:.5em;text-align:center;border-top:1px solid silver;border-bottom:1px solid silver}.payment-total[_ngcontent-%COMP%]{font-size:2em}.invoice[_ngcontent-%COMP%]{width:100%;font-size:.8em}.h3-membership-fee[_ngcontent-%COMP%]{margin-top:2em}@media (max-width: 1200px){.offers[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center}}"]})}}return o})()}}]); \ No newline at end of file +"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[9847],{99847:(Ce,$,s)=>{s.r($),s.d($,{CreateComponent:()=>be});var d=s(10467),t=s(54438),tt=s(83475),j=s(99631),v=s(88834),P=s(82798),_=s(99213),M=s(5951),u=s(25596),c=s(89417),et=s(34635),nt=s(5794),g=s(30046),ot=s(55619),it=s(22312),F=s(53719),S=s(76939),N=s(18617),T=s(28203),I=s(67336),z=s(36860),R=s(21413),at=s(7673),C=s(99172),b=s(56977);const rt=["*"];function st(o,r){1&o&&t.SdG(0)}let L=(()=>{class o{constructor(e){this._elementRef=e}focus(){this._elementRef.nativeElement.focus()}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(t.aKT))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["","cdkStepHeader",""]],hostAttrs:["role","tab"],standalone:!0})}}return o})(),B=(()=>{class o{constructor(e){this.template=e}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(t.C4Q))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["","cdkStepLabel",""]],standalone:!0})}}return o})(),lt=0;const X=new t.nKC("STEPPER_GLOBAL_OPTIONS");let D=(()=>{class o{get completed(){return null==this._completedOverride?this._getDefaultCompleted():this._completedOverride}set completed(e){this._completedOverride=e}_getDefaultCompleted(){return this.stepControl?this.stepControl.valid&&this.interacted:this.interacted}get hasError(){return null==this._customError?this._getDefaultError():this._customError}set hasError(e){this._customError=e}_getDefaultError(){return this.stepControl&&this.stepControl.invalid&&this.interacted}constructor(e,n){this._stepper=e,this.interacted=!1,this.interactedStream=new t.bkB,this.editable=!0,this.optional=!1,this._completedOverride=null,this._customError=null,this._stepperOptions=n||{},this._displayDefaultIndicatorType=!1!==this._stepperOptions.displayDefaultIndicatorType}select(){this._stepper.selected=this}reset(){this.interacted=!1,null!=this._completedOverride&&(this._completedOverride=!1),null!=this._customError&&(this._customError=!1),this.stepControl&&(this._childForms?.forEach(e=>e.resetForm?.()),this.stepControl.reset())}ngOnChanges(){this._stepper._stateChanged()}_markAsInteracted(){this.interacted||(this.interacted=!0,this.interactedStream.emit(this))}_showError(){return this._stepperOptions.showError??null!=this._customError}static{this.\u0275fac=function(n){return new(n||o)(t.rXU((0,t.Rfq)(()=>y)),t.rXU(X,8))}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["cdk-step"]],contentQueries:function(n,i,a){if(1&n&&(t.wni(a,B,5),t.wni(a,c.ZU,5)),2&n){let l;t.mGM(l=t.lsd())&&(i.stepLabel=l.first),t.mGM(l=t.lsd())&&(i._childForms=l)}},viewQuery:function(n,i){if(1&n&&t.GBs(t.C4Q,7),2&n){let a;t.mGM(a=t.lsd())&&(i.content=a.first)}},inputs:{stepControl:"stepControl",label:"label",errorMessage:"errorMessage",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],state:"state",editable:[2,"editable","editable",t.L39],optional:[2,"optional","optional",t.L39],completed:[2,"completed","completed",t.L39],hasError:[2,"hasError","hasError",t.L39]},outputs:{interactedStream:"interacted"},exportAs:["cdkStep"],standalone:!0,features:[t.GFd,t.OA$,t.aNF],ngContentSelectors:rt,decls:1,vars:0,template:function(n,i){1&n&&(t.NAR(),t.DNE(0,st,1,0,"ng-template"))},encapsulation:2,changeDetection:0})}}return o})(),y=(()=>{class o{get selectedIndex(){return this._selectedIndex}set selectedIndex(e){this.steps&&this._steps?(this._isValidIndex(e),this.selected?._markAsInteracted(),this._selectedIndex!==e&&!this._anyControlsInvalidOrPending(e)&&(e>=this._selectedIndex||this.steps.toArray()[e].editable)&&this._updateSelectedItemIndex(e)):this._selectedIndex=e}get selected(){return this.steps?this.steps.toArray()[this.selectedIndex]:void 0}set selected(e){this.selectedIndex=e&&this.steps?this.steps.toArray().indexOf(e):-1}get orientation(){return this._orientation}set orientation(e){this._orientation=e,this._keyManager&&this._keyManager.withVerticalOrientation("vertical"===e)}constructor(e,n,i){this._dir=e,this._changeDetectorRef=n,this._elementRef=i,this._destroyed=new R.B,this.steps=new t.rOR,this._sortedHeaders=new t.rOR,this.linear=!1,this._selectedIndex=0,this.selectionChange=new t.bkB,this.selectedIndexChange=new t.bkB,this._orientation="horizontal",this._groupId=lt++}ngAfterContentInit(){this._steps.changes.pipe((0,C.Z)(this._steps),(0,b.Q)(this._destroyed)).subscribe(e=>{this.steps.reset(e.filter(n=>n._stepper===this)),this.steps.notifyOnChanges()})}ngAfterViewInit(){this._stepHeader.changes.pipe((0,C.Z)(this._stepHeader),(0,b.Q)(this._destroyed)).subscribe(e=>{this._sortedHeaders.reset(e.toArray().sort((n,i)=>n._elementRef.nativeElement.compareDocumentPosition(i._elementRef.nativeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),this._sortedHeaders.notifyOnChanges()}),this._keyManager=new N.Bu(this._sortedHeaders).withWrap().withHomeAndEnd().withVerticalOrientation("vertical"===this._orientation),(this._dir?this._dir.change:(0,at.of)()).pipe((0,C.Z)(this._layoutDirection()),(0,b.Q)(this._destroyed)).subscribe(e=>this._keyManager.withHorizontalOrientation(e)),this._keyManager.updateActiveItem(this._selectedIndex),this.steps.changes.subscribe(()=>{this.selected||(this._selectedIndex=Math.max(this._selectedIndex-1,0))}),this._isValidIndex(this._selectedIndex)||(this._selectedIndex=0)}ngOnDestroy(){this._keyManager?.destroy(),this.steps.destroy(),this._sortedHeaders.destroy(),this._destroyed.next(),this._destroyed.complete()}next(){this.selectedIndex=Math.min(this._selectedIndex+1,this.steps.length-1)}previous(){this.selectedIndex=Math.max(this._selectedIndex-1,0)}reset(){this._updateSelectedItemIndex(0),this.steps.forEach(e=>e.reset()),this._stateChanged()}_getStepLabelId(e){return`cdk-step-label-${this._groupId}-${e}`}_getStepContentId(e){return`cdk-step-content-${this._groupId}-${e}`}_stateChanged(){this._changeDetectorRef.markForCheck()}_getAnimationDirection(e){const n=e-this._selectedIndex;return n<0?"rtl"===this._layoutDirection()?"next":"previous":n>0?"rtl"===this._layoutDirection()?"previous":"next":"current"}_getIndicatorType(e,n="number"){const i=this.steps.toArray()[e],a=this._isCurrentStep(e);return i._displayDefaultIndicatorType?this._getDefaultIndicatorLogic(i,a):this._getGuidelineLogic(i,a,n)}_getDefaultIndicatorLogic(e,n){return e._showError()&&e.hasError&&!n?"error":!e.completed||n?"number":e.editable?"edit":"done"}_getGuidelineLogic(e,n,i="number"){return e._showError()&&e.hasError&&!n?"error":e.completed&&!n?"done":e.completed&&n?i:e.editable&&n?"edit":i}_isCurrentStep(e){return this._selectedIndex===e}_getFocusIndex(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex}_updateSelectedItemIndex(e){const n=this.steps.toArray();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:this._selectedIndex,selectedStep:n[e],previouslySelectedStep:n[this._selectedIndex]}),this._containsFocus()?this._keyManager.setActiveItem(e):this._keyManager.updateActiveItem(e),this._selectedIndex=e,this.selectedIndexChange.emit(this._selectedIndex),this._stateChanged()}_onKeydown(e){const n=(0,I.rp)(e),i=e.keyCode,a=this._keyManager;null==a.activeItemIndex||n||i!==I.t6&&i!==I.Fm?a.setFocusOrigin("keyboard").onKeydown(e):(this.selectedIndex=a.activeItemIndex,e.preventDefault())}_anyControlsInvalidOrPending(e){return!!(this.linear&&e>=0)&&this.steps.toArray().slice(0,e).some(n=>{const i=n.stepControl;return(i?i.invalid||i.pending||!n.interacted:!n.completed)&&!n.optional&&!n._completedOverride})}_layoutDirection(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"}_containsFocus(){const e=this._elementRef.nativeElement,n=(0,z.vc)();return e===n||e.contains(n)}_isValidIndex(e){return e>-1&&(!this.steps||e{class o{constructor(e){this._stepper=e,this.type="submit"}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(y))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["button","cdkStepperNext",""]],hostVars:1,hostBindings:function(n,i){1&n&&t.bIt("click",function(){return i._stepper.next()}),2&n&&t.Mr5("type",i.type)},inputs:{type:"type"},standalone:!0})}}return o})(),ct=(()=>{class o{constructor(e){this._stepper=e,this.type="button"}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(y))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["button","cdkStepperPrevious",""]],hostVars:1,hostBindings:function(n,i){1&n&&t.bIt("click",function(){return i._stepper.previous()}),2&n&&t.Mr5("type",i.type)},inputs:{type:"type"},standalone:!0})}}return o})(),dt=(()=>{class o{static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275mod=t.$C({type:o})}static{this.\u0275inj=t.G2t({imports:[T.jI]})}}return o})();var k=s(60177),h=s(86600),mt=s(18359),ut=s(25558),ht=s(96354),ft=s(23294),p=s(49969);function vt(o,r){if(1&o&&t.eu8(0,2),2&o){const e=t.XpG();t.Y8G("ngTemplateOutlet",e.iconOverrides[e.state])("ngTemplateOutletContext",e._getIconContext())}}function _t(o,r){if(1&o&&(t.j41(0,"span",7),t.EFF(1),t.k0s()),2&o){const e=t.XpG(2);t.R7$(),t.JRh(e._getDefaultTextForState(e.state))}}function gt(o,r){if(1&o&&(t.j41(0,"span",8),t.EFF(1),t.k0s()),2&o){const e=t.XpG(3);t.R7$(),t.JRh(e._intl.completedLabel)}}function Ft(o,r){if(1&o&&(t.j41(0,"span",8),t.EFF(1),t.k0s()),2&o){const e=t.XpG(3);t.R7$(),t.JRh(e._intl.editableLabel)}}function bt(o,r){if(1&o&&(t.DNE(0,gt,2,1,"span",8)(1,Ft,2,1,"span",8),t.j41(2,"mat-icon",7),t.EFF(3),t.k0s()),2&o){const e=t.XpG(2);t.vxM("done"===e.state?0:"edit"===e.state?1:-1),t.R7$(3),t.JRh(e._getDefaultTextForState(e.state))}}function yt(o,r){if(1&o&&t.DNE(0,_t,2,1,"span",7)(1,bt,4,2,"mat-icon",7),2&o){let e;const n=t.XpG();t.vxM("number"===(e=n.state)?0:1)}}function Ct(o,r){1&o&&(t.j41(0,"div",4),t.eu8(1,9),t.k0s()),2&o&&(t.R7$(),t.Y8G("ngTemplateOutlet",r.template))}function kt(o,r){if(1&o&&(t.j41(0,"div",4),t.EFF(1),t.k0s()),2&o){const e=t.XpG();t.R7$(),t.JRh(e.label)}}function Et(o,r){if(1&o&&(t.j41(0,"div",5),t.EFF(1),t.k0s()),2&o){const e=t.XpG();t.R7$(),t.JRh(e._intl.optionalLabel)}}function xt(o,r){if(1&o&&(t.j41(0,"div",6),t.EFF(1),t.k0s()),2&o){const e=t.XpG();t.R7$(),t.JRh(e.errorMessage)}}const V=["*"];function jt(o,r){}function Mt(o,r){if(1&o&&(t.SdG(0),t.DNE(1,jt,0,0,"ng-template",0)),2&o){const e=t.XpG();t.R7$(),t.Y8G("cdkPortalOutlet",e._portal)}}const H=(o,r)=>({step:o,i:r}),U=o=>({animationDuration:o}),Y=(o,r)=>({value:o,params:r});function St(o,r){1&o&&t.SdG(0)}function Tt(o,r){1&o&&t.nrm(0,"div",6)}function It(o,r){if(1&o&&(t.eu8(0,5),t.DNE(1,Tt,1,0,"div",6)),2&o){const e=r.$implicit,n=r.$index,i=r.$count;t.XpG(2);const a=t.sdS(4);t.Y8G("ngTemplateOutlet",a)("ngTemplateOutletContext",t.l_i(3,H,e,n)),t.R7$(),t.vxM(n!==i-1?1:-1)}}function Rt(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",7),t.bIt("@horizontalStepTransition.done",function(i){t.eBV(e);const a=t.XpG(2);return t.Njj(a._animationDone.next(i))}),t.eu8(1,8),t.k0s()}if(2&o){const e=r.$implicit,n=r.$index,i=t.XpG(2);t.AVh("mat-horizontal-stepper-content-inactive",i.selectedIndex!==n),t.Y8G("@horizontalStepTransition",t.l_i(8,Y,i._getAnimationDirection(n),t.eq3(6,U,i._getAnimationDuration())))("id",i._getStepContentId(n)),t.BMQ("aria-labelledby",i._getStepLabelId(n)),t.R7$(),t.Y8G("ngTemplateOutlet",e.content)}}function Dt(o,r){if(1&o&&(t.j41(0,"div",1)(1,"div",2),t.Z7z(2,It,2,6,null,null,t.fX1),t.k0s(),t.j41(4,"div",3),t.Z7z(5,Rt,2,11,"div",4,t.fX1),t.k0s()()),2&o){const e=t.XpG();t.R7$(2),t.Dyx(e.steps),t.R7$(3),t.Dyx(e.steps)}}function Gt(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",9),t.eu8(1,5),t.j41(2,"div",10)(3,"div",11),t.bIt("@verticalStepTransition.done",function(i){t.eBV(e);const a=t.XpG(2);return t.Njj(a._animationDone.next(i))}),t.j41(4,"div",12),t.eu8(5,8),t.k0s()()()()}if(2&o){const e=r.$implicit,n=r.$index,i=r.$count,a=t.XpG(2),l=t.sdS(4);t.R7$(),t.Y8G("ngTemplateOutlet",l)("ngTemplateOutletContext",t.l_i(10,H,e,n)),t.R7$(),t.AVh("mat-stepper-vertical-line",n!==i-1),t.R7$(),t.AVh("mat-vertical-stepper-content-inactive",a.selectedIndex!==n),t.Y8G("@verticalStepTransition",t.l_i(15,Y,a._getAnimationDirection(n),t.eq3(13,U,a._getAnimationDuration())))("id",a._getStepContentId(n)),t.BMQ("aria-labelledby",a._getStepLabelId(n)),t.R7$(2),t.Y8G("ngTemplateOutlet",e.content)}}function At(o,r){if(1&o&&t.Z7z(0,Gt,6,18,"div",9,t.fX1),2&o){const e=t.XpG();t.Dyx(e.steps)}}function Ot(o,r){if(1&o){const e=t.RV6();t.j41(0,"mat-step-header",13),t.bIt("click",function(){const i=t.eBV(e).step;return t.Njj(i.select())})("keydown",function(i){t.eBV(e);const a=t.XpG();return t.Njj(a._onKeydown(i))}),t.k0s()}if(2&o){const e=r.step,n=r.i,i=t.XpG();t.AVh("mat-horizontal-stepper-header","horizontal"===i.orientation)("mat-vertical-stepper-header","vertical"===i.orientation),t.Y8G("tabIndex",i._getFocusIndex()===n?0:-1)("id",i._getStepLabelId(n))("index",n)("state",i._getIndicatorType(n,e.state))("label",e.stepLabel||e.label)("selected",i.selectedIndex===n)("active",i._stepIsNavigable(n,e))("optional",e.optional)("errorMessage",e.errorMessage)("iconOverrides",i._iconOverrides)("disableRipple",i.disableRipple||!i._stepIsNavigable(n,e))("color",e.color||i.color),t.BMQ("aria-posinset",n+1)("aria-setsize",i.steps.length)("aria-controls",i._getStepContentId(n))("aria-selected",i.selectedIndex==n)("aria-label",e.ariaLabel||null)("aria-labelledby",!e.ariaLabel&&e.ariaLabelledby?e.ariaLabelledby:null)("aria-disabled",!i._stepIsNavigable(n,e)||null)}}let E=(()=>{class o extends B{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=t.xGo(o)))(i||o)}})()}static{this.\u0275dir=t.FsC({type:o,selectors:[["","matStepLabel",""]],standalone:!0,features:[t.Vt3]})}}return o})(),x=(()=>{class o{constructor(){this.changes=new R.B,this.optionalLabel="Optional",this.completedLabel="Completed",this.editableLabel="Editable"}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275prov=t.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const $t={provide:x,deps:[[new t.Xx1,new t.kdw,x]],useFactory:function wt(o){return o||new x}};let G=(()=>{class o extends L{constructor(e,n,i,a){super(i),this._intl=e,this._focusMonitor=n,this._intlSubscription=e.changes.subscribe(()=>a.markForCheck())}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._intlSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._elementRef)}focus(e,n){e?this._focusMonitor.focusVia(this._elementRef,e,n):this._elementRef.nativeElement.focus(n)}_stringLabel(){return this.label instanceof E?null:this.label}_templateLabel(){return this.label instanceof E?this.label:null}_getHostElement(){return this._elementRef.nativeElement}_getIconContext(){return{index:this.index,active:this.active,optional:this.optional}}_getDefaultTextForState(e){return"number"==e?`${this.index+1}`:"edit"==e?"create":"error"==e?"warning":e}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(x),t.rXU(N.FN),t.rXU(t.aKT),t.rXU(t.gRc))}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["mat-step-header"]],hostAttrs:["role","tab",1,"mat-step-header"],hostVars:2,hostBindings:function(n,i){2&n&&t.HbH("mat-"+(i.color||"primary"))},inputs:{state:"state",label:"label",errorMessage:"errorMessage",iconOverrides:"iconOverrides",index:"index",selected:"selected",active:"active",optional:"optional",disableRipple:"disableRipple",color:"color"},standalone:!0,features:[t.Vt3,t.aNF],decls:10,vars:17,consts:[["matRipple","",1,"mat-step-header-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-step-icon-content"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-step-label"],[1,"mat-step-text-label"],[1,"mat-step-optional"],[1,"mat-step-sub-label-error"],["aria-hidden","true"],[1,"cdk-visually-hidden"],[3,"ngTemplateOutlet"]],template:function(n,i){if(1&n&&(t.nrm(0,"div",0),t.j41(1,"div")(2,"div",1),t.DNE(3,vt,1,2,"ng-container",2)(4,yt,2,1),t.k0s()(),t.j41(5,"div",3),t.DNE(6,Ct,2,1,"div",4)(7,kt,2,1,"div",4)(8,Et,2,1,"div",5)(9,xt,2,1,"div",6),t.k0s()),2&n){let a;t.Y8G("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disableRipple),t.R7$(),t.ZvI("mat-step-icon-state-",i.state," mat-step-icon"),t.AVh("mat-step-icon-selected",i.selected),t.R7$(2),t.vxM(i.iconOverrides&&i.iconOverrides[i.state]?3:4),t.R7$(2),t.AVh("mat-step-label-active",i.active)("mat-step-label-selected",i.selected)("mat-step-label-error","error"==i.state),t.R7$(),t.vxM((a=i._templateLabel())?6:i._stringLabel()?7:-1,a),t.R7$(2),t.vxM(i.optional&&"error"!=i.state?8:-1),t.R7$(),t.vxM("error"===i.state?9:-1)}},dependencies:[h.r6,k.T3,_.An],styles:['.mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-step-header:focus .mat-focus-indicator::before{content:""}.mat-step-header:hover[aria-disabled=true]{cursor:default}.mat-step-header:hover:not([aria-disabled]),.mat-step-header:hover[aria-disabled=false]{background-color:var(--mat-stepper-header-hover-state-layer-color);border-radius:var(--mat-stepper-header-hover-state-layer-shape, var(--mat-app-corner-medium))}.mat-step-header.cdk-keyboard-focused,.mat-step-header.cdk-program-focused{background-color:var(--mat-stepper-header-focus-state-layer-color);border-radius:var(--mat-stepper-header-focus-state-layer-shape, var(--mat-app-corner-medium))}@media(hover: none){.mat-step-header:hover{background:none}}.cdk-high-contrast-active .mat-step-header{outline:solid 1px}.cdk-high-contrast-active .mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.cdk-high-contrast-active .mat-step-header[aria-disabled=true]{outline-color:GrayText}.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-label,.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-icon,.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-optional{color:GrayText}.mat-step-optional{font-size:12px;color:var(--mat-stepper-header-optional-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-sub-label-error{font-size:12px;font-weight:normal}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative;color:var(--mat-stepper-header-icon-foreground-color, var(--mat-app-surface));background-color:var(--mat-stepper-header-icon-background-color, var(--mat-app-on-surface-variant))}.mat-step-icon-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:flex}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error{background-color:var(--mat-stepper-header-error-state-icon-background-color);color:var(--mat-stepper-header-error-state-icon-foreground-color, var(--mat-app-error))}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle;font-family:var(--mat-stepper-header-label-text-font, var(--mat-app-title-small-font));font-size:var(--mat-stepper-header-label-text-size, var(--mat-app-title-small-size));font-weight:var(--mat-stepper-header-label-text-weight, var(--mat-app-title-small-weight));color:var(--mat-stepper-header-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-label.mat-step-label-active{color:var(--mat-stepper-header-selected-state-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-label.mat-step-label-error{color:var(--mat-stepper-header-error-state-label-text-color, var(--mat-app-error));font-size:var(--mat-stepper-header-error-state-label-text-size, var(--mat-app-title-small-size))}.mat-step-label.mat-step-label-selected{font-size:var(--mat-stepper-header-selected-state-label-text-size, var(--mat-app-title-small-size));font-weight:var(--mat-stepper-header-selected-state-label-text-weight, var(--mat-app-title-small-weight))}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-step-icon-selected{background-color:var(--mat-stepper-header-selected-state-icon-background-color, var(--mat-app-primary));color:var(--mat-stepper-header-selected-state-icon-foreground-color, var(--mat-app-on-primary))}.mat-step-icon-state-done{background-color:var(--mat-stepper-header-done-state-icon-background-color);color:var(--mat-stepper-header-done-state-icon-foreground-color)}.mat-step-icon-state-edit{background-color:var(--mat-stepper-header-edit-state-icon-background-color, var(--mat-app-primary));color:var(--mat-stepper-header-edit-state-icon-foreground-color, var(--mat-app-on-primary))}'],encapsulation:2,changeDetection:0})}}return o})();const Q="500ms",W="225ms",J={horizontalStepTransition:(0,p.hZ)("horizontalStepTransition",[(0,p.wk)("previous",(0,p.iF)({transform:"translate3d(-100%, 0, 0)",visibility:"hidden"})),(0,p.wk)("current",(0,p.iF)({transform:"none",visibility:"inherit"})),(0,p.wk)("next",(0,p.iF)({transform:"translate3d(100%, 0, 0)",visibility:"hidden"})),(0,p.kY)("* => *",(0,p.Os)([(0,p.i0)("{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)"),(0,p.P)("@*",(0,p.MA)(),{optional:!0})]),{params:{animationDuration:Q}})]),verticalStepTransition:(0,p.hZ)("verticalStepTransition",[(0,p.wk)("previous",(0,p.iF)({height:"0px",visibility:"hidden"})),(0,p.wk)("next",(0,p.iF)({height:"0px",visibility:"hidden"})),(0,p.wk)("current",(0,p.iF)({height:"*",visibility:"inherit"})),(0,p.kY)("* <=> current",(0,p.Os)([(0,p.i0)("{{animationDuration}} cubic-bezier(0.4, 0.0, 0.2, 1)"),(0,p.P)("@*",(0,p.MA)(),{optional:!0})]),{params:{animationDuration:W}})])};let Pt=(()=>{class o{constructor(e){this.templateRef=e}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(t.C4Q))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["ng-template","matStepperIcon",""]],inputs:{name:[0,"matStepperIcon","name"]},standalone:!0})}}return o})(),Nt=(()=>{class o{constructor(e){this._template=e}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(t.C4Q))}}static{this.\u0275dir=t.FsC({type:o,selectors:[["ng-template","matStepContent",""]],standalone:!0})}}return o})(),Z=(()=>{class o extends D{constructor(e,n,i,a){super(e,a),this._errorStateMatcher=n,this._viewContainerRef=i,this._isSelected=mt.yU.EMPTY,this.stepLabel=void 0}ngAfterContentInit(){this._isSelected=this._stepper.steps.changes.pipe((0,ut.n)(()=>this._stepper.selectionChange.pipe((0,ht.T)(e=>e.selectedStep===this),(0,C.Z)(this._stepper.selected===this)))).subscribe(e=>{e&&this._lazyContent&&!this._portal&&(this._portal=new S.VA(this._lazyContent._template,this._viewContainerRef))})}ngOnDestroy(){this._isSelected.unsubscribe()}isErrorState(e,n){return this._errorStateMatcher.isErrorState(e,n)||!!(e&&e.invalid&&this.interacted)}static{this.\u0275fac=function(n){return new(n||o)(t.rXU((0,t.Rfq)(()=>A)),t.rXU(h.es,4),t.rXU(t.c1b),t.rXU(X,8))}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["mat-step"]],contentQueries:function(n,i,a){if(1&n&&(t.wni(a,E,5),t.wni(a,Nt,5)),2&n){let l;t.mGM(l=t.lsd())&&(i.stepLabel=l.first),t.mGM(l=t.lsd())&&(i._lazyContent=l.first)}},hostAttrs:["hidden",""],inputs:{color:"color"},exportAs:["matStep"],standalone:!0,features:[t.Jv_([{provide:h.es,useExisting:o},{provide:D,useExisting:o}]),t.Vt3,t.aNF],ngContentSelectors:V,decls:1,vars:0,consts:[[3,"cdkPortalOutlet"]],template:function(n,i){1&n&&(t.NAR(),t.DNE(0,Mt,2,1,"ng-template"))},dependencies:[S.I3],encapsulation:2,changeDetection:0})}}return o})(),A=(()=>{class o extends y{get animationDuration(){return this._animationDuration}set animationDuration(e){this._animationDuration=/^\d+$/.test(e)?e+"ms":e}constructor(e,n,i){super(e,n,i),this._stepHeader=void 0,this._steps=void 0,this.steps=new t.rOR,this.animationDone=new t.bkB,this.labelPosition="end",this.headerPosition="top",this._iconOverrides={},this._animationDone=new R.B,this._animationDuration="",this._isServer=!(0,t.WQX)(z.OD).isBrowser;const a=i.nativeElement.nodeName.toLowerCase();this.orientation="mat-vertical-stepper"===a?"vertical":"horizontal"}ngAfterContentInit(){super.ngAfterContentInit(),this._icons.forEach(({name:e,templateRef:n})=>this._iconOverrides[e]=n),this.steps.changes.pipe((0,b.Q)(this._destroyed)).subscribe(()=>{this._stateChanged()}),this._animationDone.pipe((0,ft.F)((e,n)=>e.fromState===n.fromState&&e.toState===n.toState),(0,b.Q)(this._destroyed)).subscribe(e=>{"current"===e.toState&&this.animationDone.emit()})}_stepIsNavigable(e,n){return n.completed||this.selectedIndex===e||!this.linear}_getAnimationDuration(){return this.animationDuration?this.animationDuration:"horizontal"===this.orientation?Q:W}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(T.dS,8),t.rXU(t.gRc),t.rXU(t.aKT))}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["mat-stepper"],["mat-vertical-stepper"],["mat-horizontal-stepper"],["","matStepper",""]],contentQueries:function(n,i,a){if(1&n&&(t.wni(a,Z,5),t.wni(a,Pt,5)),2&n){let l;t.mGM(l=t.lsd())&&(i._steps=l),t.mGM(l=t.lsd())&&(i._icons=l)}},viewQuery:function(n,i){if(1&n&&t.GBs(G,5),2&n){let a;t.mGM(a=t.lsd())&&(i._stepHeader=a)}},hostAttrs:["role","tablist"],hostVars:11,hostBindings:function(n,i){2&n&&(t.BMQ("aria-orientation",i.orientation),t.AVh("mat-stepper-horizontal","horizontal"===i.orientation)("mat-stepper-vertical","vertical"===i.orientation)("mat-stepper-label-position-end","horizontal"===i.orientation&&"end"==i.labelPosition)("mat-stepper-label-position-bottom","horizontal"===i.orientation&&"bottom"==i.labelPosition)("mat-stepper-header-position-bottom","bottom"===i.headerPosition))},inputs:{disableRipple:"disableRipple",color:"color",labelPosition:"labelPosition",headerPosition:"headerPosition",animationDuration:"animationDuration"},outputs:{animationDone:"animationDone"},exportAs:["matStepper","matVerticalStepper","matHorizontalStepper"],standalone:!0,features:[t.Jv_([{provide:y,useExisting:o}]),t.Vt3,t.aNF],ngContentSelectors:V,decls:5,vars:2,consts:[["stepTemplate",""],[1,"mat-horizontal-stepper-wrapper"],[1,"mat-horizontal-stepper-header-container"],[1,"mat-horizontal-content-container"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id","mat-horizontal-stepper-content-inactive"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-stepper-horizontal-line"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id"],[3,"ngTemplateOutlet"],[1,"mat-step"],[1,"mat-vertical-content-container"],["role","tabpanel",1,"mat-vertical-stepper-content",3,"id"],[1,"mat-vertical-content"],[3,"click","keydown","tabIndex","id","index","state","label","selected","active","optional","errorMessage","iconOverrides","disableRipple","color"]],template:function(n,i){if(1&n&&(t.NAR(),t.DNE(0,St,1,0)(1,Dt,7,0,"div",1)(2,At,2,0)(3,Ot,1,23,"ng-template",null,0,t.C5r)),2&n){let a;t.vxM(i._isServer?0:-1),t.R7$(),t.vxM("horizontal"===(a=i.orientation)?1:"vertical"===a?2:-1)}},dependencies:[k.T3,G],styles:['.mat-stepper-vertical,.mat-stepper-horizontal{display:block;font-family:var(--mat-stepper-container-text-font, var(--mat-app-body-medium-font));background:var(--mat-stepper-container-color, var(--mat-app-surface))}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-header-position-bottom .mat-horizontal-stepper-header-container{order:1}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px;border-top-color:var(--mat-stepper-line-color, var(--mat-app-outline))}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative;top:calc(calc((var(--mat-stepper-header-height) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{border-top-width:1px;border-top-style:solid;content:"";display:inline-block;height:0;position:absolute;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px;height:var(--mat-stepper-header-height)}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-horizontal-stepper-header::before,.mat-horizontal-stepper-header::after{border-top-color:var(--mat-stepper-line-color, var(--mat-app-outline))}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{padding:calc((var(--mat-stepper-header-height) - 24px) / 2) 24px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::after{top:calc(calc((var(--mat-stepper-header-height) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;height:24px;padding:calc((var(--mat-stepper-header-height) - 24px) / 2) 24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-wrapper{display:flex;flex-direction:column}.mat-horizontal-stepper-content{outline:0}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-inactive{height:0;overflow:hidden}.mat-horizontal-stepper-content:not(.mat-horizontal-stepper-content-inactive){visibility:inherit !important}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.cdk-high-contrast-active .mat-horizontal-content-container{outline:solid 1px}.mat-stepper-header-position-bottom .mat-horizontal-content-container{padding:24px 24px 0 24px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}.cdk-high-contrast-active .mat-vertical-content-container{outline:solid 1px}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:"";position:absolute;left:0;border-left-width:1px;border-left-style:solid;border-left-color:var(--mat-stepper-line-color, var(--mat-app-outline));top:calc(8px - calc((var(--mat-stepper-header-height) - 24px) / 2));bottom:calc(8px - calc((var(--mat-stepper-header-height) - 24px) / 2))}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0}.mat-vertical-stepper-content:not(.mat-vertical-stepper-content-inactive){visibility:inherit !important}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}'],encapsulation:2,data:{animation:[J.horizontalStepTransition,J.verticalStepTransition]},changeDetection:0})}}return o})(),zt=(()=>{class o extends pt{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=t.xGo(o)))(i||o)}})()}static{this.\u0275dir=t.FsC({type:o,selectors:[["button","matStepperNext",""]],hostAttrs:[1,"mat-stepper-next"],hostVars:1,hostBindings:function(n,i){2&n&&t.Mr5("type",i.type)},standalone:!0,features:[t.Vt3]})}}return o})(),Lt=(()=>{class o extends ct{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=t.xGo(o)))(i||o)}})()}static{this.\u0275dir=t.FsC({type:o,selectors:[["button","matStepperPrevious",""]],hostAttrs:[1,"mat-stepper-previous"],hostVars:1,hostBindings:function(n,i){2&n&&t.Mr5("type",i.type)},standalone:!0,features:[t.Vt3]})}}return o})(),Bt=(()=>{class o{static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275mod=t.$C({type:o})}static{this.\u0275inj=t.G2t({providers:[$t,h.es],imports:[h.yE,k.MD,S.jc,dt,_.m_,h.pZ,A,G,h.yE]})}}return o})();var Xt=s(36815),O=s(65571),K=s(82765),f=s(75351),Vt=s(59115),Ht=s(14823);let Ut=(()=>{class o{constructor(e,n){this.dialogRef=e,this.data=n,this.fb=(0,t.WQX)(c.ok),this.form=this.fb.group({name:[null,c.k0.required]})}ngAfterViewInit(){}static{this.\u0275fac=function(n){return new(n||o)(t.rXU(f.CP),t.rXU(f.Vh))}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["app-agreement-dialog"]],standalone:!0,features:[t.aNF],decls:136,vars:1,consts:[["mat-dialog-title",""],[1,"mat-typography"],["align","end"],["mat-button","","cdkFocusInitial","",3,"mat-dialog-close"]],template:function(n,i){1&n&&(t.j41(0,"h2",0),t.EFF(1,"Community Host Agreement"),t.k0s(),t.j41(2,"mat-dialog-content",1)(3,"h3"),t.EFF(4,"General Agreement"),t.k0s(),t.j41(5,"p"),t.EFF(6,"This software is provided with no warranty."),t.k0s(),t.j41(7,"p"),t.EFF(8,"You accept that all human interactions should be voluntary."),t.k0s(),t.j41(9,"p"),t.EFF(10,"You accept that you won't attempt to exploit or abuse the app, server and infrastructure used by Ariton."),t.k0s(),t.j41(11,"p"),t.EFF(12," You accept that all usage of Ariton's apps, servers, infrastructure and software must be the result of peaceful voluntary human interactions. Uploading and sharing content that was the result of involuntary human interactions is not allowed. "),t.k0s(),t.j41(13,"p"),t.EFF(14," Ariton reserves the right to exclude, remove, delete any community, content, user or any other data that is stored on Ariton's servers. Ariton does not have permission or right to access any data that is stored on user's personal data stores, unless the app has given explicit and implicit permission to do so. "),t.k0s(),t.j41(15,"h3"),t.EFF(16,"Responsibilities as a Community Host"),t.k0s(),t.j41(17,"p"),t.EFF(18," As a Community Host, you are responsible for creating a welcoming and inclusive environment for all members. This includes: "),t.k0s(),t.j41(19,"ul")(20,"li"),t.EFF(21,"Ensuring that all interactions are respectful and free from harassment."),t.k0s(),t.j41(22,"li"),t.EFF(23,"Moderating content to ensure it adheres to community guidelines."),t.k0s(),t.j41(24,"li"),t.EFF(25,"Providing timely responses to community inquiries and issues."),t.k0s()(),t.j41(26,"h3"),t.EFF(27,"Ariton's Commitment to Community Hosts"),t.k0s(),t.j41(28,"p"),t.EFF(29,"Ariton is committed to supporting Community Hosts by providing:"),t.k0s(),t.j41(30,"ul")(31,"li"),t.EFF(32,"Access to resources and training materials."),t.k0s(),t.j41(33,"li"),t.EFF(34,"Technical support for platform-related issues."),t.k0s(),t.j41(35,"li"),t.EFF(36,"Regular updates and communication regarding community policies."),t.k0s()(),t.j41(37,"h3"),t.EFF(38,"Rules and Behaviors"),t.k0s(),t.j41(39,"p"),t.EFF(40,"All Community Hosts must adhere to the following rules and behaviors:"),t.k0s(),t.j41(41,"ul")(42,"li"),t.EFF(43,"Maintain a professional and respectful tone in all communications."),t.k0s(),t.j41(44,"li"),t.EFF(45,"Do not engage in or tolerate any form of discrimination or harassment."),t.k0s(),t.j41(46,"li"),t.EFF(47,"Ensure that all content shared is appropriate and relevant to the community."),t.k0s()(),t.j41(48,"h3"),t.EFF(49,"Acceptable Content"),t.k0s(),t.j41(50,"p"),t.EFF(51,"Acceptable content includes:"),t.k0s(),t.j41(52,"ul")(53,"li"),t.EFF(54,"Educational materials and resources."),t.k0s(),t.j41(55,"li"),t.EFF(56,"Community announcements and updates."),t.k0s(),t.j41(57,"li"),t.EFF(58,"Discussions and forums that promote positive engagement."),t.k0s()(),t.j41(59,"p"),t.EFF(60,"Unacceptable content includes:"),t.k0s(),t.j41(61,"ul")(62,"li"),t.EFF(63,"Offensive or discriminatory language."),t.k0s(),t.j41(64,"li"),t.EFF(65,"Spam or irrelevant advertisements."),t.k0s(),t.j41(66,"li"),t.EFF(67,"Content that violates any laws or community guidelines."),t.k0s()(),t.j41(68,"h3"),t.EFF(69,"Basic SLA Agreement"),t.k0s(),t.j41(70,"p"),t.EFF(71,"As part of the Service Level Agreement (SLA), Community Hosts are expected to:"),t.k0s(),t.j41(72,"ul")(73,"li"),t.EFF(74,"Regularly monitor and moderate community interactions."),t.k0s()(),t.j41(75,"p"),t.EFF(76,"Ariton will provide:"),t.k0s(),t.j41(77,"ul")(78,"li"),t.EFF(79,"Technical support for issues through GitHub."),t.k0s(),t.j41(80,"li"),t.EFF(81,"Regular updates and maintenance to ensure platform stability."),t.k0s(),t.j41(82,"li"),t.EFF(83,"Access to a dedicated support team for Community Hosts, which includes:"),t.k0s(),t.j41(84,"ul")(85,"li")(86,"strong"),t.EFF(87,"Basic Support:"),t.k0s(),t.j41(88,"ul")(89,"li"),t.EFF(90,"Access to community forums and knowledge base."),t.k0s(),t.j41(91,"li"),t.EFF(92,"Email support with a response time of up to 72 hours."),t.k0s(),t.j41(93,"li"),t.EFF(94,"Regular updates and bug fixes."),t.k0s()()(),t.j41(95,"li")(96,"strong"),t.EFF(97,"Extended Support:"),t.k0s(),t.j41(98,"ul")(99,"li"),t.EFF(100,"All features of Basic Support."),t.k0s(),t.j41(101,"li"),t.EFF(102,"Priority email support with a response time of up to 48 hours."),t.k0s(),t.j41(103,"li"),t.EFF(104,"Monthly webinars and training sessions."),t.k0s(),t.j41(105,"li"),t.EFF(106,"Access to beta features and early updates."),t.k0s()()(),t.j41(107,"li")(108,"strong"),t.EFF(109,"Premium Support:"),t.k0s(),t.j41(110,"ul")(111,"li"),t.EFF(112,"All features of Extended Support."),t.k0s(),t.j41(113,"li"),t.EFF(114,"Chat support with a response time of up to 24 hour."),t.k0s(),t.j41(115,"li"),t.EFF(116,"Dedicated account manager for personalized assistance."),t.k0s(),t.j41(117,"li"),t.EFF(118,"Customizable support plans and SLAs."),t.k0s(),t.j41(119,"li"),t.EFF(120,"On-site training and support (if applicable)."),t.k0s()()()()(),t.j41(121,"h3"),t.EFF(122,"Payments"),t.k0s(),t.j41(123,"p"),t.EFF(124," The host fee is an monthly or annual up-front free that must be paid for the community to be created and active. "),t.k0s(),t.j41(125,"p"),t.EFF(126,"The membership fee is calculated at the end of the month and paid out to the community host."),t.k0s(),t.j41(127,"h3"),t.EFF(128,"Changes to agreement policies"),t.k0s(),t.j41(129,"p"),t.EFF(130," We reserve the right to update and change our agreement policies at any time, and it is hosts and users responsibility to ensure knowledge and acceptance of the latest revisions. "),t.k0s(),t.j41(131,"p"),t.EFF(132,"Last updated: 2024-10-10"),t.k0s()(),t.j41(133,"mat-dialog-actions",2)(134,"button",3),t.EFF(135,"Close"),t.k0s()()),2&n&&(t.R7$(134),t.Y8G("mat-dialog-close",!0))},dependencies:[k.MD,Ht.uc,Vt.Cn,_.m_,v.Hl,v.$z,j.fS,f.hM,f.tx,f.BI,f.E7,f.Yi,c.YN],styles:["form[_ngcontent-%COMP%]{display:inline}"]})}}return o})();var w=s(43881);let Yt=(()=>{class o{constructor(){this.levels={"annual-premium":{id:"premium",annual:!0,maxFee:1e3,maxMembers:1e4,cost:450,steps:10},"annual-standard":{id:"standard",annual:!0,maxFee:100,maxMembers:1e3,cost:280,steps:10},"annual-basic":{id:"basic",annual:!0,maxFee:10,maxMembers:50,cost:190,steps:1},"monthly-premium":{id:"premium",annual:!1,maxFee:1e3,maxMembers:1e4,cost:500,steps:10},"monthly-standard":{id:"standard",annual:!1,maxFee:100,maxMembers:1e3,cost:300,steps:10},"monthly-basic":{id:"basic",annual:!1,maxFee:10,maxMembers:50,cost:200,steps:1}}}getAnnualLevels(){return Object.values(this.levels).filter(e=>e.annual)}getMonthlyLevels(){return Object.values(this.levels).filter(e=>!e.annual)}getLevel(e){return this.levels[e]}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275prov=t.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var Qt=s(68314),Wt=s(96084),Jt=s(85297);const Zt=["stepper"],Kt=o=>["/community",o];function qt(o,r){if(1&o&&(t.j41(0,"div",5)(1,"h1"),t.EFF(2,"Community created!"),t.k0s(),t.j41(3,"p"),t.EFF(4," Your community has been created and is now active. It is not yet published, but you can start inviting members to it and start using it. "),t.k0s(),t.j41(5,"a",7),t.EFF(6,"Go to community"),t.k0s()()),2&o){const e=t.XpG();t.R7$(5),t.Y8G("routerLink",t.eq3(1,Kt,e.draftEntry.record.id))}}function te(o,r){1&o&&t.EFF(0,"Options")}function ee(o,r){if(1&o){const e=t.RV6();t.j41(0,"mat-card",38)(1,"mat-card-header")(2,"mat-icon",39),t.EFF(3,"cloud"),t.k0s(),t.j41(4,"mat-card-title"),t.EFF(5,"Basic (10 GB)"),t.k0s(),t.j41(6,"mat-card-subtitle"),t.EFF(7,"$200/month"),t.k0s()(),t.j41(8,"mat-card-content")(9,"p"),t.EFF(10,"Ideal for small communities, members pay a monthly fee."),t.k0s(),t.j41(11,"p"),t.EFF(12,"The host can configure membership fee between $1 and $10 per month."),t.k0s(),t.j41(13,"p"),t.EFF(14,"Maximum 50 members."),t.k0s(),t.j41(15,"p"),t.EFF(16,"Basic support."),t.k0s()(),t.j41(17,"mat-card-actions")(18,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("monthly-basic"))}),t.EFF(19,"Choose"),t.k0s()()(),t.j41(20,"mat-card",38)(21,"mat-card-header")(22,"mat-icon",39),t.EFF(23,"cloud_done"),t.k0s(),t.j41(24,"mat-card-title"),t.EFF(25,"Standard (50 GB)"),t.k0s(),t.j41(26,"mat-card-subtitle"),t.EFF(27,"$300/month"),t.k0s()(),t.j41(28,"mat-card-content")(29,"p"),t.EFF(30,"Ideal for medium communities, members pay a monthly fee."),t.k0s(),t.j41(31,"p"),t.EFF(32,"The host can configure membership fee between $1 and $100 per month."),t.k0s(),t.j41(33,"p"),t.EFF(34,"Maximum 1,000 members."),t.k0s(),t.j41(35,"p"),t.EFF(36,"Extended support."),t.k0s()(),t.j41(37,"mat-card-actions")(38,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("monthly-standard"))}),t.EFF(39,"Choose"),t.k0s()()(),t.j41(40,"mat-card",38)(41,"mat-card-header")(42,"mat-icon",39),t.EFF(43,"cloud_done"),t.k0s(),t.j41(44,"mat-card-title"),t.EFF(45,"Premium (100 GB)"),t.k0s(),t.j41(46,"mat-card-subtitle"),t.EFF(47,"$500/month"),t.k0s()(),t.j41(48,"mat-card-content")(49,"p"),t.EFF(50,"Ideal for larger and exclusive communities, members pay a monthly fee."),t.k0s(),t.j41(51,"p"),t.EFF(52,"The host can configure membership fee between $1 and $1000 per month."),t.k0s(),t.j41(53,"p"),t.EFF(54,"Maximum 10,000 members."),t.k0s(),t.j41(55,"p"),t.EFF(56,"Premium support."),t.k0s()(),t.j41(57,"mat-card-actions")(58,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("monthly-premium"))}),t.EFF(59,"Choose"),t.k0s()()()}}function ne(o,r){if(1&o){const e=t.RV6();t.j41(0,"mat-card",38)(1,"mat-card-header")(2,"mat-icon",39),t.EFF(3,"cloud"),t.k0s(),t.j41(4,"mat-card-title"),t.EFF(5,"Basic (10 GB)"),t.k0s(),t.j41(6,"mat-card-subtitle"),t.EFF(7,"$190/month"),t.k0s()(),t.j41(8,"mat-card-content")(9,"p"),t.EFF(10,"Ideal for small communities, members pay a monthly fee."),t.k0s(),t.j41(11,"p"),t.EFF(12,"The host can configure membership fee between $1 and $10 per month."),t.k0s(),t.j41(13,"p"),t.EFF(14,"Maximum 50 members."),t.k0s(),t.j41(15,"p"),t.EFF(16,"Basic support."),t.k0s()(),t.j41(17,"mat-card-actions")(18,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("annual-basic"))}),t.EFF(19,"Choose"),t.k0s()()(),t.j41(20,"mat-card",38)(21,"mat-card-header")(22,"mat-icon",39),t.EFF(23,"cloud_done"),t.k0s(),t.j41(24,"mat-card-title"),t.EFF(25,"Standard (50 GB)"),t.k0s(),t.j41(26,"mat-card-subtitle"),t.EFF(27,"$280/month"),t.k0s()(),t.j41(28,"mat-card-content")(29,"p"),t.EFF(30,"Ideal for medium communities, members pay a monthly fee."),t.k0s(),t.j41(31,"p"),t.EFF(32,"The host can configure membership fee between $1 and $100 per month."),t.k0s(),t.j41(33,"p"),t.EFF(34,"Maximum 1,000 members."),t.k0s(),t.j41(35,"p"),t.EFF(36,"Extended support."),t.k0s()(),t.j41(37,"mat-card-actions")(38,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("annual-standard"))}),t.EFF(39,"Choose"),t.k0s()()(),t.j41(40,"mat-card",38)(41,"mat-card-header")(42,"mat-icon",39),t.EFF(43,"cloud_done"),t.k0s(),t.j41(44,"mat-card-title"),t.EFF(45,"Premium (100 GB)"),t.k0s(),t.j41(46,"mat-card-subtitle"),t.EFF(47,"$450/month"),t.k0s()(),t.j41(48,"mat-card-content")(49,"p"),t.EFF(50,"Ideal for larger and exclusive communities, members pay a monthly fee."),t.k0s(),t.j41(51,"p"),t.EFF(52,"The host can configure membership fee between $1 and $1000 per month."),t.k0s(),t.j41(53,"p"),t.EFF(54,"Maximum 10,000 members."),t.k0s(),t.j41(55,"p"),t.EFF(56,"Premium support."),t.k0s()(),t.j41(57,"mat-card-actions")(58,"button",40),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.chooseOption("annual-premium"))}),t.EFF(59,"Choose"),t.k0s()()()}}function oe(o,r){if(1&o&&(t.j41(0,"mat-option",24),t.EFF(1),t.k0s()),2&o){const e=r.$implicit;t.Y8G("value",e.type),t.R7$(),t.JRh(e.name)}}function ie(o,r){1&o&&(t.j41(0,"mat-error"),t.EFF(1,"About is "),t.j41(2,"strong"),t.EFF(3,"required"),t.k0s()())}function ae(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",28)(1,"mat-form-field",21),t.nrm(2,"input",41),t.k0s(),t.j41(3,"button",42),t.bIt("click",function(){const i=t.eBV(e).$index,a=t.XpG(2);return t.Njj(a.removeOwner(i))}),t.j41(4,"mat-icon"),t.EFF(5,"clear"),t.k0s()()()}if(2&o){const e=r.$index;t.R7$(2),t.Y8G("formControlName",e)}}function re(o,r){if(1&o&&(t.j41(0,"span"),t.EFF(1,"As the host, you will receive 70% of membership fee."),t.k0s(),t.j41(2,"p",43)(3,"mat-slider",44),t.nrm(4,"input",45,3),t.k0s(),t.j41(6,"span",46),t.EFF(7),t.k0s()(),t.j41(8,"p",43)(9,"mat-slider",44),t.nrm(10,"input",47,3),t.k0s(),t.j41(12,"span",46),t.EFF(13),t.k0s()(),t.j41(14,"span"),t.EFF(15),t.k0s(),t.j41(16,"p"),t.EFF(17," Community Type: "),t.j41(18,"span",31),t.EFF(19),t.k0s(),t.nrm(20,"br"),t.EFF(21),t.nrm(22,"br"),t.EFF(23),t.k0s()),2&o){const e=t.XpG(2);t.R7$(3),t.Y8G("max",e.costLevel.maxFee)("min",1)("step",1)("showTickMarks",!0),t.R7$(4),t.SpI("$",e.secondFormGroup.controls.fee.value," per member"),t.R7$(2),t.Y8G("max",e.costLevel.maxMembers)("min",e.costLevel.steps)("step",e.costLevel.steps)("showTickMarks",!0),t.R7$(4),t.SpI("",e.secondFormGroup.controls.members.value,"/members"),t.R7$(2),t.SpI("Pricing example with ",e.secondFormGroup.controls.members.value," members: "),t.R7$(4),t.JRh(e.costLevel.id),t.R7$(2),t.SpI(" Host costs: -$",e.costLevel.cost,""),t.R7$(2),t.SpI(" Host income: +$",e.earnings," ")}}function se(o,r){if(1&o&&(t.j41(0,"span"),t.EFF(1," As the host, you must approve all membership requests. Members do not pay a fee to join."),t.k0s(),t.j41(2,"p",43)(3,"span",46),t.EFF(4,"$1 per member per month"),t.k0s()(),t.j41(5,"p",43)(6,"mat-slider",44),t.nrm(7,"input",47,3),t.k0s(),t.j41(9,"span",46),t.EFF(10),t.k0s()(),t.j41(11,"span"),t.EFF(12),t.k0s(),t.j41(13,"p"),t.EFF(14," Community Type: "),t.j41(15,"span",31),t.EFF(16),t.k0s(),t.nrm(17,"br"),t.EFF(18),t.k0s()),2&o){const e=t.XpG(2);t.R7$(6),t.Y8G("max",e.costLevel.maxMembers)("min",e.costLevel.steps)("step",e.costLevel.steps)("showTickMarks",!0),t.R7$(4),t.SpI("",e.secondFormGroup.controls.members.value,"/members"),t.R7$(2),t.SpI("Pricing example with ",e.secondFormGroup.controls.members.value," members:"),t.R7$(4),t.JRh(e.costLevel.id),t.R7$(2),t.SpI(" Host costs: -$",e.costLevel.cost+e.costs," ")}}function le(o,r){1&o&&t.EFF(0,"Payment")}function pe(o,r){if(1&o){const e=t.RV6();t.j41(0,"form",10)(1,"h1"),t.EFF(2,"Finalize Payment"),t.k0s(),t.j41(3,"p")(4,"mat-button-toggle-group",48)(5,"mat-button-toggle",49),t.EFF(6,"Bitcoin Lightning"),t.k0s()()(),t.j41(7,"p",50),t.EFF(8," THIS IS JUST A DEMO, NO COMMUNITY IS CREATED. PAYMENT IS REAL. CONSIDER IT A DONATION TO ARITON. "),t.k0s(),t.j41(9,"p",51),t.nrm(10,"canvas",null,4),t.k0s(),t.j41(12,"div"),t.EFF(13),t.k0s(),t.j41(14,"div",52),t.EFF(15),t.k0s(),t.j41(16,"p"),t.EFF(17),t.k0s(),t.j41(18,"p")(19,"button",53),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.deleteRequest())}),t.EFF(20,"Delete the community request"),t.k0s()()()}if(2&o){const e=t.XpG(3);t.Y8G("formGroup",e.fourthFormGroup),t.R7$(13),t.SpI("Amount: ",e.amount," sats"),t.R7$(2),t.JRh(e.invoice),t.R7$(2),t.SpI(" ",e.paymentStatus," ")}}function ce(o,r){1&o&&(t.j41(0,"h1"),t.EFF(1,"Payment completed!"),t.k0s(),t.j41(2,"p",54)(3,"mat-icon",55),t.EFF(4,"verified"),t.k0s()(),t.j41(5,"p"),t.EFF(6," Your payment has been received and your community is now active. You can now invite members to join your community. "),t.k0s(),t.j41(7,"p")(8,"strong",50),t.EFF(9,"WARNING: THIS IS A DEMO. NO COMMUNITY WAS CREATED."),t.k0s()())}function de(o,r){if(1&o&&t.DNE(0,pe,21,4,"form",10)(1,ce,10,0),2&o){const e=t.XpG(2);t.vxM(e.paid?1:0)}}function me(o,r){1&o&&t.EFF(0," Annual ")}function ue(o,r){1&o&&t.EFF(0," Monthly ")}function he(o,r){1&o&&t.EFF(0," Member ")}function fe(o,r){1&o&&t.EFF(0," Host ")}function ve(o,r){if(1&o&&t.EFF(0),2&o){const e=t.XpG(3);t.Lme(" ",12*e.costLevel.cost," / ~",12*e.costLevel.sats," sats ")}}function _e(o,r){if(1&o&&t.EFF(0),2&o){const e=t.XpG(3);t.Lme(" ",e.costLevel.cost," / ~",e.costLevel.sats," sats ")}}function ge(o,r){if(1&o){const e=t.RV6();t.j41(0,"form",10)(1,"h1"),t.EFF(2,"You're almost done!"),t.k0s(),t.j41(3,"p"),t.EFF(4,"Please validate your options before making a payment:"),t.k0s(),t.j41(5,"h3",31),t.EFF(6),t.k0s(),t.j41(7,"p"),t.EFF(8),t.nrm(9,"br"),t.EFF(10," Type: "),t.j41(11,"span",31),t.EFF(12),t.k0s(),t.nrm(13,"br")(14,"br"),t.EFF(15," Payment intervals: "),t.DNE(16,me,1,0)(17,ue,1,0),t.nrm(18,"br"),t.EFF(19," Cost: "),t.j41(20,"strong"),t.EFF(21),t.k0s(),t.nrm(22,"br")(23,"br"),t.EFF(24," Membership cost: "),t.j41(25,"strong"),t.EFF(26),t.k0s(),t.nrm(27,"br"),t.EFF(28," Paid by: "),t.j41(29,"strong"),t.DNE(30,he,1,0)(31,fe,1,0),t.k0s()(),t.j41(32,"div",56)(33,"mat-checkbox",57),t.EFF(34,"I agree with Community Host Agreement"),t.k0s(),t.nrm(35,"br"),t.j41(36,"button",58),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.openAgreement())}),t.EFF(37,"Read Community Host Agreement"),t.k0s()(),t.j41(38,"h3"),t.EFF(39,"Payment due"),t.k0s(),t.j41(40,"div",59),t.EFF(41," $"),t.DNE(42,ve,1,2)(43,_e,1,2),t.k0s(),t.j41(44,"p")(45,"button",60),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.save())}),t.EFF(46,"Approve"),t.k0s()()(),t.j41(47,"div")(48,"button",35),t.EFF(49,"Back"),t.k0s(),t.nrm(50,"br")(51,"br"),t.j41(52,"button",37),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.deleteDraft())}),t.EFF(53," Delete Draft "),t.k0s()()}if(2&o){const e=t.XpG(2);t.Y8G("formGroup",e.thirdFormGroup),t.R7$(6),t.JRh(e.costLevel.id),t.R7$(2),t.SpI(" Name: ",e.secondFormGroup.controls.name.value,""),t.R7$(4),t.JRh(e.secondFormGroup.controls.type.value),t.R7$(4),t.vxM(e.costLevel.annual?16:17),t.R7$(5),t.SpI("$",e.costLevel.cost,"/month"),t.R7$(5),t.SpI("$",e.secondFormGroup.controls.fee.value,"/month"),t.R7$(4),t.vxM("paid"===e.secondFormGroup.controls.membershipType.value?30:31),t.R7$(12),t.vxM(e.costLevel.annual?42:43),t.R7$(3),t.Y8G("disabled",!e.thirdFormGroup.valid),t.R7$(7),t.Y8G("disabled",!e.draftEntry)}}function Fe(o,r){if(1&o){const e=t.RV6();t.j41(0,"mat-stepper",8,0),t.bIt("selectionChange",function(i){t.eBV(e);const a=t.XpG();return t.Njj(a.onStepChange(i))}),t.j41(2,"mat-step",9)(3,"form",10),t.DNE(4,te,1,0,"ng-template",11),t.j41(5,"div")(6,"div",12)(7,"mat-icon",13),t.EFF(8,"diversity_2"),t.k0s(),t.j41(9,"h1"),t.EFF(10,"Choose the feature options"),t.k0s(),t.j41(11,"p"),t.EFF(12,"Choose the features you want to include in your community. You can always change these later on."),t.k0s(),t.j41(13,"p")(14,"mat-button-toggle-group",14)(15,"mat-button-toggle",15),t.EFF(16,"Monthly"),t.k0s(),t.j41(17,"mat-button-toggle",16),t.EFF(18,"Annual"),t.k0s()()()(),t.j41(19,"div",17),t.DNE(20,ee,60,0)(21,ne,60,0),t.k0s()()()(),t.j41(22,"mat-step",18)(23,"form",10)(24,"div"),t.nrm(25,"app-avatar",19),t.j41(26,"mat-card",20)(27,"mat-card-content")(28,"mat-form-field",21)(29,"mat-label"),t.EFF(30,"Community name"),t.k0s(),t.nrm(31,"input",22,1),t.k0s(),t.j41(33,"mat-form-field",21)(34,"mat-label"),t.EFF(35,"Community type"),t.k0s(),t.j41(36,"mat-select",23),t.Z7z(37,oe,2,2,"mat-option",24,t.fX1),t.k0s()(),t.j41(39,"mat-form-field",21)(40,"mat-label"),t.EFF(41,"About"),t.k0s(),t.nrm(42,"textarea",25,2),t.DNE(44,ie,4,0,"mat-error"),t.j41(45,"mat-hint",26),t.EFF(46),t.k0s()(),t.j41(47,"div",27),t.Z7z(48,ae,6,1,"div",28,t.fX1),t.k0s(),t.j41(50,"button",29),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.addOwner())}),t.j41(51,"mat-icon"),t.EFF(52,"add_link"),t.k0s(),t.EFF(53," Add Host "),t.k0s(),t.j41(54,"h3",30),t.EFF(55," Membership Fee: "),t.j41(56,"span",31),t.EFF(57),t.k0s()(),t.j41(58,"p"),t.EFF(59," Set the membership fee for your community. If you want to use Ariton in a corporate setting without user's having to pay fee, you can choose to cover all the expenses for your community members. "),t.k0s(),t.j41(60,"p")(61,"mat-radio-group",32),t.bIt("change",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.resetFee())}),t.j41(62,"mat-radio-button",33),t.EFF(63,"Paid by Member"),t.k0s(),t.j41(64,"mat-radio-button",34),t.EFF(65,"Paid by Host"),t.k0s()()(),t.DNE(66,re,24,14)(67,se,19,8),t.k0s()()()(),t.j41(68,"p")(69,"button",35),t.EFF(70,"Back"),t.k0s(),t.j41(71,"button",36),t.EFF(72,"Next"),t.k0s(),t.nrm(73,"br")(74,"br"),t.j41(75,"button",37),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.deleteDraft())}),t.EFF(76," Delete Draft "),t.k0s()()(),t.j41(77,"mat-step",9),t.DNE(78,le,1,0,"ng-template",11)(79,de,2,1)(80,ge,54,11),t.k0s()()}if(2&o){const e=t.sdS(43),n=t.XpG();t.Y8G("linear",!0),t.R7$(2),t.Y8G("stepControl",n.firstFormGroup),t.R7$(),t.Y8G("formGroup",n.firstFormGroup),t.R7$(17),t.vxM("monthly"===n.firstFormGroup.controls.premiumPeriod.value?20:21),t.R7$(2),t.Y8G("stepControl",n.secondFormGroup),t.R7$(),t.Y8G("formGroup",n.secondFormGroup),t.R7$(14),t.Dyx(n.communityTypes),t.R7$(7),t.vxM(n.secondFormGroup.controls.bio.hasError("required")?44:-1),t.R7$(2),t.SpI("",e.value.length," / 300"),t.R7$(2),t.Dyx(n.owners.controls),t.R7$(9),t.JRh(n.optionLevel),t.R7$(9),t.vxM("paid"===n.secondFormGroup.controls.membershipType.value?66:67),t.R7$(9),t.Y8G("disabled",!n.draftEntry),t.R7$(2),t.Y8G("stepControl",n.thirdFormGroup),t.R7$(2),t.vxM(n.saved?79:80)}}let be=(()=>{class o{constructor(){var e=this;this.fb=(0,t.WQX)(c.ok),this.identity=(0,t.WQX)(et.K),this.profileService=(0,t.WQX)(nt.p),this.navigation=(0,t.WQX)(ot.o),this.pricing=(0,t.WQX)(Yt),this.router=(0,t.WQX)(g.Ix),this.data=(0,t.WQX)(Jt.u),this.route=(0,t.WQX)(g.nX),this.app=(0,t.WQX)(Wt.d),this.bitcoinPriceUsd=0,this._formBuilder=(0,t.WQX)(c.ok),this.firstFormGroup=this._formBuilder.group({premiumPeriod:["monthly"],option:["",c.k0.required]}),this.secondFormGroup=this._formBuilder.group({name:[null,c.k0.required],type:[null,c.k0.required],bio:[null],avatar:[""],owners:this.fb.array([this.fb.control("")]),fee:[1,c.k0.required],members:[20,c.k0.required],membershipType:["paid"]}),this.thirdFormGroup=this._formBuilder.group({acceptTerms:["",c.k0.requiredTrue]}),this.fourthFormGroup=this._formBuilder.group({paymentMethod:["ln"]}),this.draftDeleted=!1,this.paid=!1,this.paymentStatus="Pending...",this.checkPaymentStatus=(0,d.A)(function*(){e.paid?console.log("Payment status is paid."):(yield e.checkPayment(),e.scheduleNextCheck())}),this.scheduleNextCheck=()=>{setTimeout(this.checkPaymentStatus,2e3)},this.amount=0,this.hash="",this.invoice="",this.premiumPeriod="monthly",this.saved=!1,this.layout=(0,t.WQX)(Xt.Y),this.communityTypes=[{type:"general",name:"General"},{type:"power",name:"Power Structure"},{type:"company",name:"Company Structure"}],this.maxFee=10,this.dialog=(0,t.WQX)(f.bZ),this.optionLevel="basic",this.optionAnnual=!1,this.selectedCommunity=(0,t.vPA)(null),this.routerSubscription=this.router.events.subscribe(function(){var n=(0,d.A)(function*(i){i instanceof g.Z&&(console.log("Navigating away from CreateComponent"),yield e.saveDraft())});return function(i){return n.apply(this,arguments)}}()),this.costLevel=this.pricing.levels["monthly-basic"],this.route.paramMap.subscribe(n=>{this.selectedCommunity.set(n.get("id"))}),(0,t.QZP)((0,d.A)(function*(){if(e.selectedCommunity()&&e.app.initialized()){console.log("Selected community and app initialized:",e.selectedCommunity());const n=e.selectedCommunity(),i=yield e.data.get(n);console.log("Community Entry: ",i),e.draftEntry=i,i.data.option="monthly-basic",e.firstFormGroup.patchValue({option:i.data.option}),e.secondFormGroup.patchValue(i.data),e.stepper&&e.stepper.next()}}),{allowSignalWrites:!0}),(0,t.QZP)((0,d.A)(function*(){e.identity.initialized()&&(console.log(e.owners),e.owners.setValue([e.identity.did]))}))}goToNextStep(){this.stepper.next()}updateBitcoinPrice(){var e=this;return(0,d.A)(function*(){const n=yield fetch("https://pay.ariton.app/price");if(n.ok){const i=yield n.json();e.bitcoinPriceUsd=i.usd,console.log("bitcoinPriceUsd",e.bitcoinPriceUsd)}})()}deleteDraft(){var e=this;return(0,d.A)(function*(){console.log("DELETE DRAFT:",e.draftEntry),yield e.data.delete(e.draftEntry.record),e.draftEntry=void 0,e.draftDeleted=!0,e.router.navigate(["/communities"])})()}getPriceInSatoshis(e){return Math.round(e/this.bitcoinPriceUsd*1e8)}checkPayment(){var e=this;return(0,d.A)(function*(){const n=yield fetch(`https://pay.ariton.app/paid?hash=${e.hash}`);if(n.ok){const i=yield n.json();console.log("RESULT FROM PAID:",i),i.paid?(console.log("Payment is paid"),e.paymentStatus="Paid",e.paid=!0,yield e.saveDraft(!0)):(console.log("Payment is not paid"),e.paymentStatus="Not Paid")}else console.error("Failed to validate invoice"),e.paymentStatus=n.statusText})()}onStepChange(e){var n=this;return(0,d.A)(function*(){console.log("Selected step index:",e.selectedIndex),console.log("Previously selected step index:",e.previouslySelectedIndex),yield n.saveDraft()})()}handleUnloadEvent(){var e=this;return(0,d.A)(function*(){yield e.saveDraft()})()}ngOnDestroy(){var e=this;return(0,d.A)(function*(){e.routerSubscription&&e.routerSubscription.unsubscribe()})()}saveDraft(e=!1){var n=this;return(0,d.A)(function*(){if(!n.draftDeleted&&n.secondFormGroup.controls.name.value){if(n.draftEntry){if("active"===n.draftEntry.record.tags.status)return void console.warn("This community is already ACTIVE! Editing not allowed in this UI.");const i={...n.draftEntry.data,...n.firstFormGroup.value,...n.secondFormGroup.value,...n.thirdFormGroup.value};console.log("DRAFT ENTRY UPDATE:",n.draftEntry),n.draftEntry=yield n.data.update(n.draftEntry.record,i,{type:"community",status:n.paid?"active":"draft"},e)}else{const i={...n.firstFormGroup.value,...n.secondFormGroup.value,...n.thirdFormGroup.value};n.draftEntry=yield n.data.save(i,{type:"community",status:"draft"},e)}console.log("SAVE DRAFT DONE!")}})()}generateInvoice(){var e=this;return(0,d.A)(function*(){yield e.updateBitcoinPrice();let n=0;n=e.getPriceInSatoshis(e.costLevel.annual?12*e.costLevel.cost:e.costLevel.cost),n=Math.round(n/30),e.invoice="";const i=`${e.identity.did}|${e.draftEntry.record.id}`,a=yield fetch(`https://pay.ariton.app/invoice?description=Ariton%20Community%20Payment&amount=${n}&id=${i}`);if(a.ok){const l=yield a.json();e.invoice=l.serialized,e.hash=l.paymentHash,e.amount=l.amountSat;const ye=document.querySelector("canvas");Qt.mo(ye,e.invoice,q=>{q&&console.error("Error generating QR code: ",q)}),e.scheduleNextCheck()}else console.error("Failed to generate invoice"),e.invoice=a.statusText})()}resetFee(){"paid"!==this.secondFormGroup.controls.membershipType.value&&this.secondFormGroup.controls.fee.setValue(1)}save(){var e=this;return(0,d.A)(function*(){e.saved=!0,yield e.saveDraft(!0),yield e.generateInvoice()})()}deleteRequest(){}get owners(){return this.secondFormGroup.get("owners")}get fee(){const e=this.secondFormGroup.get("fee");return Math.round(.7*e.value)}get earnings(){const e=this.secondFormGroup.get("fee"),n=this.secondFormGroup.get("members");return Math.round(.7*e.value*n.value)}get costs(){const e=this.secondFormGroup.get("fee"),n=this.secondFormGroup.get("members");return Math.round(e.value*n.value)}back(){this.navigation.back()}openAgreement(){this.dialog.open(Ut).afterClosed().subscribe(n=>{console.log(`Dialog result: ${n}`)})}chooseOption(e){var n=this;return(0,d.A)(function*(){console.log("Option:",e),n.firstFormGroup.patchValue({option:e});const i=e?.split("-");n.optionLevel=i[1],n.optionAnnual="annual"===i[0];const a=n.pricing.levels[e];n.costLevel=a,yield n.updateBitcoinPrice(),n.costLevel.sats=n.getPriceInSatoshis(a.cost),n.goToNextStep()})()}updateForm(e){console.log("Patching form with:",e),this.secondFormGroup.patchValue({name:e.name,bio:e.bio,avatar:e.avatar})}addOwner(){this.owners.push(this.fb.control(""))}removeOwner(e){this.owners.removeAt(e)}ngOnInit(){}onSubmit(){var e=this;return(0,d.A)(function*(){e.router.navigate(["/community",e.identity.did])})()}upload(e,n){var i=this;return(0,d.A)(function*(){if(e){if(console.log(n),n){console.log("UPDATING IMAGE!!!!");const{status:a,updatedRecord:l}=yield n.update({published:!0,data:e});return console.log("Update profile status:",a,l),l}{const{record:a}=yield i.identity.web5.dwn.records.create({data:e,message:{protocol:it.ME.uri,protocolPath:"avatar",dataFormat:"image/jpeg",tags:{module:"community"}}});return a}}console.log("No image to upload.")})()}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["app-create"]],viewQuery:function(n,i){if(1&n&&t.GBs(Zt,5),2&n){let a;t.mGM(a=t.lsd())&&(i.stepper=a.first)}},hostBindings:function(n,i){1&n&&t.bIt("beforeunload",function(){return i.handleUnloadEvent()},!1,t.tSv)},standalone:!0,features:[t.aNF],decls:2,vars:1,consts:[["stepper",""],["name",""],["bio",""],["slider",""],["qrCanvas",""],[1,"margin"],[3,"linear"],[3,"routerLink"],[3,"selectionChange","linear"],[3,"stepControl"],[3,"formGroup"],["matStepLabel",""],[1,"storage-container"],["inline","true",1,"storage-icon"],["formControlName","premiumPeriod"],["value","monthly"],["value","annual"],[1,"offers"],["label","Configure",3,"stepControl"],["formControlName","avatar"],[1,"form-card"],[1,"full-width"],["matInput","","placeholder","Community name","maxlength","200","formControlName","name"],["formControlName","type"],[3,"value"],["maxlength","300","matInput","","placeholder","About","formControlName","bio"],["align","end"],["formArrayName","owners"],[1,"link-input"],["mat-stroked-button","","type","button",3,"click"],[1,"h3-membership-fee"],[1,"capitalize"],["formControlName","membershipType","aria-label","Select an option",3,"change"],["value","paid"],["value","free"],["mat-button","","matStepperPrevious",""],["mat-button","","matStepperNext",""],["mat-flat-button","",1,"warning-button",3,"click","disabled"],[1,"offer-card"],["mat-card-avatar",""],["mat-button","","matStepperNext","",3,"click"],["matInput","","type","text","placeholder","Host (DID)",3,"formControlName"],["mat-icon-button","","type","button",3,"click"],[1,"fee-control"],[3,"max","min","step","showTickMarks"],["matSliderThumb","","formControlName","fee"],[1,"price"],["matSliderThumb","","formControlName","members"],["formControlName","paymentMethod"],["value","ln"],[1,"warning"],[1,"qr-code"],[1,"invoice","wrap"],["mat-flat-button","",3,"click"],[1,"large-icon"],["inline","true"],[1,"agreement-selection"],["formControlName","acceptTerms"],["type","button","mat-button","",3,"click"],[1,"payment-total"],["mat-flat-button","",3,"click","disabled"]],template:function(n,i){1&n&&t.DNE(0,qt,7,3,"div",5)(1,Fe,81,13,"mat-stepper",6),2&n&&t.vxM("active"===(null==i.draftEntry||null==i.draftEntry.record?null:i.draftEntry.record.tags.status)?0:1)},dependencies:[P.Ve,F.rl,F.nJ,F.MV,F.TL,P.VO,h.wT,tt.f,j.fS,j.fg,v.Hl,v.$z,v.iY,_.m_,_.An,M.Wk,M.VT,M._g,u.Hu,u.RN,u.YY,u.QG,u.m2,u.MM,u.Lc,u.dh,c.X1,c.qT,c.me,c.BC,c.cb,c.tU,c.j4,c.JD,c.v8,F.RG,c.YN,Bt,Z,E,A,zt,Lt,O.Vg,O.ec,O.pc,g.iI,g.Wk,K.g7,K.So,w.Ez,w.IV,w.OU],styles:[".full-width[_ngcontent-%COMP%]{width:100%}.form-card[_ngcontent-%COMP%]{margin-top:1em}.link-input[_ngcontent-%COMP%]{display:flex;align-items:baseline}.link-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:.4em}mat-card-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:1em}form[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex-direction:column}.storage-container[_ngcontent-%COMP%]{text-align:center}.storage-icon[_ngcontent-%COMP%]{font-size:3em}.offer-card[_ngcontent-%COMP%]{display:inline-block;padding:12px 16px;margin-right:1em;margin-bottom:1em;max-width:340px;font-size:.9em;border:2px solid transparent}.offer-card[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-app-text-color)}.offers[_ngcontent-%COMP%]{display:flex;justify-content:center}mat-stepper[_ngcontent-%COMP%]{border-radius:12px}.fee-control[_ngcontent-%COMP%]{display:flex}.fee-control[_ngcontent-%COMP%] .price[_ngcontent-%COMP%]{font-size:2em}h3[_ngcontent-%COMP%]{margin:.5em 0;padding:0}.large-icon[_ngcontent-%COMP%]{font-size:4em}.agreement-selection[_ngcontent-%COMP%]{margin:1em 0;padding:.5em;text-align:center;border-top:1px solid silver;border-bottom:1px solid silver}.payment-total[_ngcontent-%COMP%]{font-size:2em}.invoice[_ngcontent-%COMP%]{width:100%;font-size:.8em}.h3-membership-fee[_ngcontent-%COMP%]{margin-top:2em}@media (max-width: 1200px){.offers[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center}}"]})}}return o})()}}]); \ No newline at end of file diff --git a/index.html b/index.html index 05925a95..65d0388c 100644 --- a/index.html +++ b/index.html @@ -35,5 +35,5 @@ - + diff --git a/main.d437bdb44eeaa8f0.js b/main.6b5366d1c069f34a.js similarity index 82% rename from main.d437bdb44eeaa8f0.js rename to main.6b5366d1c069f34a.js index 76a0b393..88b8e6c5 100644 --- a/main.d437bdb44eeaa8f0.js +++ b/main.6b5366d1c069f34a.js @@ -1,4 +1,4 @@ -(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8792],{44273:(Me,F,f)=>{"use strict";var i,a,x,B,m,S,g,E,R,M,_,j,P,k,z,W,V;f.r(F),f.d(F,{JSONPath:()=>uc}),(a={})[(i={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9}).BooleanLiteral]="Boolean",a[i.EOF]="",a[i.Identifier]="Identifier",a[i.Keyword]="Keyword",a[i.NullLiteral]="Null",a[i.NumericLiteral]="Numeric",a[i.Punctuator]="Punctuator",a[i.StringLiteral]="String",a[i.RegularExpression]="RegularExpression",x=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="];var Z={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"};function q(yt,kt){if(!yt)throw new Error("ASSERT: "+kt)}function re(yt){return yt>=48&&yt<=57}function te(yt){return"0123456789abcdefABCDEF".indexOf(yt)>=0}function ie(yt){return"01234567".indexOf(yt)>=0}function ae(yt){return 32===yt||9===yt||11===yt||12===yt||160===yt||yt>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(yt)>=0}function me(yt){return 10===yt||13===yt||8232===yt||8233===yt}function ye(yt){return 64==yt||36===yt||95===yt||yt>=65&&yt<=90||yt>=97&&yt<=122||92===yt||yt>=128&&S.NonAsciiIdentifierStart.test(String.fromCharCode(yt))}function ue(yt){return 36===yt||95===yt||yt>=65&&yt<=90||yt>=97&&yt<=122||yt>=48&&yt<=57||92===yt||yt>=128&&S.NonAsciiIdentifierPart.test(String.fromCharCode(yt))}function o(yt){switch(yt){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function h(yt){return"eval"===yt||"arguments"===yt}function I(yt,kt,wr,Jt,hr){var Or;q("number"==typeof wr,"Comment must have valid position"),!(W.lastCommentStart>=wr)&&(W.lastCommentStart=wr,Or={type:yt,value:kt},V.range&&(Or.range=[wr,Jt]),V.loc&&(Or.loc=hr),V.comments.push(Or),V.attachComment&&(V.leadingComments.push(Or),V.trailingComments.push(Or)))}function O(yt){var kt,wr,Jt,hr;for(kt=M-yt,wr={start:{line:_,column:M-j-yt}};M=P&&Qe({},m.UnexpectedToken,"ILLEGAL");else if(42===wr){if(47===E.charCodeAt(M+1))return++M,++M,void(V.comments&&(Jt=E.slice(yt+2,M-2),kt.end={line:_,column:M-j},I("Block",Jt,yt,M,kt)));++M}else++M;Qe({},m.UnexpectedToken,"ILLEGAL")}function H(){var yt,kt;for(kt=0===M;M>>="===(pn=E.substr(M,4))?{type:i.Punctuator,value:pn,lineNumber:_,lineStart:j,start:yt,end:M+=4}:">>>"===(Or=pn.substr(0,3))||"<<="===Or||">>="===Or?{type:i.Punctuator,value:Or,lineNumber:_,lineStart:j,start:yt,end:M+=3}:Jt===(hr=Or.substr(0,2))[1]&&"+-<>&|".indexOf(Jt)>=0||"=>"===hr?{type:i.Punctuator,value:hr,lineNumber:_,lineStart:j,start:yt,end:M+=2}:"<>=!+-*%&|^/".indexOf(Jt)>=0?(++M,{type:i.Punctuator,value:Jt,lineNumber:_,lineStart:j,start:yt,end:M}):void Qe({},m.UnexpectedToken,"ILLEGAL")}function Ae(){var yt,kt,wr;if(q(re((wr=E[M]).charCodeAt(0))||"."===wr,"Numeric literal must start with a decimal digit or a decimal point"),kt=M,yt="","."!==wr){if(yt=E[M++],wr=E[M],"0"===yt){if("x"===wr||"X"===wr)return++M,function oe(yt){for(var kt="";M0&&(Jt=V.tokens[V.tokens.length-1]).range[0]===yt&&"Punctuator"===Jt.type&&("/"===Jt.value||"/="===Jt.value)&&V.tokens.pop(),V.tokens.push({type:"RegularExpression",value:wr.literal,range:[yt,M],loc:kt})),wr}function Ee(){var yt;return H(),M>=P?{type:i.EOF,lineNumber:_,lineStart:j,start:M,end:M}:ye(yt=E.charCodeAt(M))?function Y(){var yt,kt,wr;return yt=M,kt=92===E.charCodeAt(M)?s():function p(){var yt,kt;for(yt=M++;M=0&&M=0?ee():Te()}return Te()}return"Keyword"===yt.type?Te():ee()}():ee()}function ve(){var yt,kt,Jt;return H(),yt={start:{line:_,column:M-j}},kt=Ee(),yt.end={line:_,column:M-j},kt.type!==i.EOF&&(Jt=E.slice(kt.start,kt.end),V.tokens.push({type:a[kt.type],value:Jt,range:[kt.start,kt.end],loc:yt})),kt}function Ce(){var yt;return M=(yt=z).end,_=yt.lineNumber,j=yt.lineStart,z=typeof V.tokens<"u"?ve():Ee(),M=yt.end,_=yt.lineNumber,j=yt.lineStart,yt}function Re(){var yt,kt,wr;yt=M,kt=_,wr=j,z=typeof V.tokens<"u"?ve():Ee(),M=yt,_=kt,j=wr}function Ye(yt,kt){this.line=yt,this.column=kt}function $e(yt,kt,wr,Jt){this.start=new Ye(yt,kt),this.end=new Ye(wr,Jt)}function nt(){var yt,kt,wr,Jt;return yt=M,kt=_,wr=j,H(),Jt=_!==kt,M=yt,_=kt,j=wr,Jt}function Qe(yt,kt){for(var wr=[],Jt=2;Jt":case"<=":case">=":case"instanceof":wr=7;break;case"in":wr=kt?7:0;break;case"<<":case">>":case">>>":wr=8;break;case"+":case"-":wr=9;break;case"*":case"/":case"%":wr=11}return wr}function Ke(){var yt,kt,wr,Jt,hr;return yt=z,hr=z,Jt=kt=function Nr(){var yt,kt,wr,Jt,hr;return hr=z,yt=function jt(){var yt,kt,wr,Jt,hr,Or,pn,bn,_i,Gi;if(yt=z,_i=Pt(),0===(hr=Dt(Jt=z,W.allowIn)))return _i;for(Jt.prec=hr,Ce(),kt=[yt,z],Or=[_i,Jt,pn=Pt()];(hr=Dt(z,W.allowIn))>0;){for(;Or.length>2&&hr<=Or[Or.length-2].prec;)pn=Or.pop(),bn=Or.pop().value,_i=Or.pop(),wr=k.createBinaryExpression(bn,_i,pn),kt.pop(),k.markEnd(wr,yt=kt[kt.length-1]),Or.push(wr);(Jt=Ce()).prec=hr,Or.push(Jt),kt.push(z),wr=Pt(),Or.push(wr)}for(wr=Or[Gi=Or.length-1],kt.pop();Gi>1;)wr=k.createBinaryExpression(Or[Gi-1].value,Or[Gi-2],wr),Gi-=2,yt=kt.pop(),k.markEnd(wr,yt);return wr}(),ne("?")&&(Ce(),kt=W.allowIn,W.allowIn=!0,wr=Ke(),W.allowIn=kt,ze(":"),Jt=Ke(),yt=k.createConditionalExpression(yt,wr,Jt),k.markEnd(yt,hr)),yt}(),function G(){var yt;return z.type===i.Punctuator&&("="===(yt=z.value)||"*="===yt||"/="===yt||"%="===yt||"+="===yt||"-="===yt||"<<="===yt||">>="===yt||">>>="===yt||"&="===yt||"^="===yt||"|="===yt)}()&&(_e(kt)||Tt({},m.InvalidLHSInAssignment),R&&kt.type===Z.Identifier&&h(kt.name)&&Tt(yt,m.StrictLHSAssignment),yt=Ce(),wr=Ke(),Jt=k.markEnd(k.createAssignmentExpression(yt.value,kt,wr),hr)),Jt}function Ze(){var yt,kt=z;if(yt=Ke(),ne(",")){for(yt=k.createSequenceExpression([yt]);M"u"));)yt.push(kt);return yt}(),ze("}"),k.markEnd(k.createBlockStatement(yt),kt)}function mt(){var yt,kt;return kt=z,(yt=Ce()).type!==i.Identifier&&ct(yt),k.markEnd(k.createIdentifier(yt.value),kt)}function Xt(yt){var wr,Jt,kt=null;return Jt=z,wr=mt(),R&&h(wr.name)&&Tt({},m.StrictVarName),"const"===yt?(ze("="),kt=Ke()):ne("=")&&(Ce(),kt=Ke()),k.markEnd(k.createVariableDeclarator(wr,kt),Jt)}function Et(yt){var kt=[];do{if(kt.push(Xt(yt)),!ne(","))break;Ce()}while(M"u"&&ze(";")),typeof Jt>"u"&&(ne(";")||(kt=Ze()),ze(";"),ne(")")||(wr=Ze())),ze(")"),pn=W.inIteration,W.inIteration=!0,Or=ur(),W.inIteration=pn,typeof Jt>"u"?k.createForStatement(yt,kt,wr,Or):k.createForInStatement(Jt,hr,Or)}(),hr);case"function":return k.markEnd(mr(),hr);case"if":return k.markEnd(function mi(){var yt,kt,wr;return St("if"),ze("("),yt=Ze(),ze(")"),kt=ur(),X("else")?(Ce(),wr=ur()):wr=null,k.createIfStatement(yt,kt,wr)}(),hr);case"return":return k.markEnd(function xr(){var yt=null;return St("return"),W.inFunctionBody||Tt({},m.IllegalReturn),32===E.charCodeAt(M)&&ye(E.charCodeAt(M+1))?(yt=Ze(),he(),k.createReturnStatement(yt)):nt()?k.createReturnStatement(null):(ne(";")||!ne("}")&&z.type!==i.EOF&&(yt=Ze()),he(),k.createReturnStatement(yt))}(),hr);case"switch":return k.markEnd(function Xn(){var yt,kt,wr,Jt,hr;if(St("switch"),ze("("),yt=Ze(),ze(")"),ze("{"),kt=[],ne("}"))return Ce(),k.createSwitchStatement(yt,kt);for(Jt=W.inSwitch,W.inSwitch=!0,hr=!1;M"u"));)kt.push(yt);return ze("}"),W.labelSet=Or,W.inIteration=pn,W.inSwitch=bn,W.inFunctionBody=_i,k.markEnd(k.createBlockStatement(kt),Gi)}function qt(yt){var kt,Jt,hr,Or,pn,bn,wr=[];if(ze("("),!ne(")"))for(Or={};M0?1:0,j=0,P=E.length,z=null,W={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},V={},typeof kt<"u"&&(V.range="boolean"==typeof kt.range&&kt.range,V.loc="boolean"==typeof kt.loc&&kt.loc,V.attachComment="boolean"==typeof kt.attachComment&&kt.attachComment,V.loc&&null!=kt.source&&(V.source=Jt(kt.source)),"boolean"==typeof kt.tokens&&kt.tokens&&(V.tokens=[]),"boolean"==typeof kt.comment&&kt.comment&&(V.comments=[]),"boolean"==typeof kt.tolerant&&kt.tolerant&&(V.errors=[]),V.attachComment&&(V.range=!0,V.comments=[],V.bottomRightStack=[],V.trailingComments=[],V.leadingComments=[]));try{wr=function An(){var yt,kt;return H(),Re(),kt=z,R=!1,yt=function gn(){for(var yt,wr,hr,kt=[];M"u");)kt.push(yt);return kt}(),k.markEnd(k.createProgram(yt),kt)}(),typeof V.comments<"u"&&(wr.comments=V.comments),typeof V.tokens<"u"&&(function Pn(){var yt,kt,wr,Jt=[];for(yt=0;yt0?0:Or-1)),wr=hr(0===wr?0:wr||(Jt>0?Or:-1)),kt=Jt>0?Math.max(0,kt):Math.min(Or,kt),wr=Jt>0?Math.min(wr,Or):Math.max(-1,wr),Jt>0&&wr<=kt)return[];if(Jt<0&&kt<=wr)return[];for(var pn=[],bn=kt;bn!=wr&&!(Jt<0&&bn<=wr||Jt>0&&bn>=wr);bn+=Jt)pn.push(yt[bn]);return pn}B={Data:1,Get:2,Set:4},m={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},S={NonAsciiIdentifierStart:new RegExp("[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),NonAsciiIdentifierPart:new RegExp("[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]")},g={name:"SyntaxTree",processComment:function(yt){var kt,wr;if(!(yt.type===Z.Program&&yt.body.length>0)){for(V.trailingComments.length>0?V.trailingComments[0].range[0]>=yt.range[1]?(wr=V.trailingComments,V.trailingComments=[]):V.trailingComments.length=0:V.bottomRightStack.length>0&&V.bottomRightStack[V.bottomRightStack.length-1].trailingComments&&V.bottomRightStack[V.bottomRightStack.length-1].trailingComments[0].range[0]>=yt.range[1]&&(wr=V.bottomRightStack[V.bottomRightStack.length-1].trailingComments,delete V.bottomRightStack[V.bottomRightStack.length-1].trailingComments);V.bottomRightStack.length>0&&V.bottomRightStack[V.bottomRightStack.length-1].range[0]>=yt.range[0];)kt=V.bottomRightStack.pop();kt?kt.leadingComments&&kt.leadingComments[kt.leadingComments.length-1].range[1]<=yt.range[0]&&(yt.leadingComments=kt.leadingComments,delete kt.leadingComments):V.leadingComments.length>0&&V.leadingComments[V.leadingComments.length-1].range[1]<=yt.range[0]&&(yt.leadingComments=V.leadingComments,V.leadingComments=[]),wr&&(yt.trailingComments=wr),V.bottomRightStack.push(yt)}},markEnd:function(yt,kt){return V.range&&(yt.range=[kt.start,M]),V.loc&&(yt.loc=new $e(void 0===kt.startLineNumber?kt.lineNumber:kt.startLineNumber,kt.start-(void 0===kt.startLineStart?kt.lineStart:kt.startLineStart),_,M-j),this.postProcess(yt)),V.attachComment&&this.processComment(yt),yt},postProcess:function(yt){return V.source&&(yt.loc.source=V.source),yt},createArrayExpression:function(yt){return{type:Z.ArrayExpression,elements:yt}},createAssignmentExpression:function(yt,kt,wr){return{type:Z.AssignmentExpression,operator:yt,left:kt,right:wr}},createBinaryExpression:function(yt,kt,wr){return{type:"||"===yt||"&&"===yt?Z.LogicalExpression:Z.BinaryExpression,operator:yt,left:kt,right:wr}},createBlockStatement:function(yt){return{type:Z.BlockStatement,body:yt}},createBreakStatement:function(yt){return{type:Z.BreakStatement,label:yt}},createCallExpression:function(yt,kt){return{type:Z.CallExpression,callee:yt,arguments:kt}},createCatchClause:function(yt,kt){return{type:Z.CatchClause,param:yt,body:kt}},createConditionalExpression:function(yt,kt,wr){return{type:Z.ConditionalExpression,test:yt,consequent:kt,alternate:wr}},createContinueStatement:function(yt){return{type:Z.ContinueStatement,label:yt}},createDebuggerStatement:function(){return{type:Z.DebuggerStatement}},createDoWhileStatement:function(yt,kt){return{type:Z.DoWhileStatement,body:yt,test:kt}},createEmptyStatement:function(){return{type:Z.EmptyStatement}},createExpressionStatement:function(yt){return{type:Z.ExpressionStatement,expression:yt}},createForStatement:function(yt,kt,wr,Jt){return{type:Z.ForStatement,init:yt,test:kt,update:wr,body:Jt}},createForInStatement:function(yt,kt,wr){return{type:Z.ForInStatement,left:yt,right:kt,body:wr,each:!1}},createFunctionDeclaration:function(yt,kt,wr,Jt){return{type:Z.FunctionDeclaration,id:yt,params:kt,defaults:wr,body:Jt,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(yt,kt,wr,Jt){return{type:Z.FunctionExpression,id:yt,params:kt,defaults:wr,body:Jt,rest:null,generator:!1,expression:!1}},createIdentifier:function(yt){return{type:Z.Identifier,name:yt}},createIfStatement:function(yt,kt,wr){return{type:Z.IfStatement,test:yt,consequent:kt,alternate:wr}},createLabeledStatement:function(yt,kt){return{type:Z.LabeledStatement,label:yt,body:kt}},createLiteral:function(yt){return{type:Z.Literal,value:yt.value,raw:E.slice(yt.start,yt.end)}},createMemberExpression:function(yt,kt,wr){return{type:Z.MemberExpression,computed:"["===yt,object:kt,property:wr}},createNewExpression:function(yt,kt){return{type:Z.NewExpression,callee:yt,arguments:kt}},createObjectExpression:function(yt){return{type:Z.ObjectExpression,properties:yt}},createPostfixExpression:function(yt,kt){return{type:Z.UpdateExpression,operator:yt,argument:kt,prefix:!1}},createProgram:function(yt){return{type:Z.Program,body:yt}},createProperty:function(yt,kt,wr){return{type:Z.Property,key:kt,value:wr,kind:yt}},createReturnStatement:function(yt){return{type:Z.ReturnStatement,argument:yt}},createSequenceExpression:function(yt){return{type:Z.SequenceExpression,expressions:yt}},createSwitchCase:function(yt,kt){return{type:Z.SwitchCase,test:yt,consequent:kt}},createSwitchStatement:function(yt,kt){return{type:Z.SwitchStatement,discriminant:yt,cases:kt}},createThisExpression:function(){return{type:Z.ThisExpression}},createThrowStatement:function(yt){return{type:Z.ThrowStatement,argument:yt}},createTryStatement:function(yt,kt,wr,Jt){return{type:Z.TryStatement,block:yt,guardedHandlers:kt,handlers:wr,finalizer:Jt}},createUnaryExpression:function(yt,kt){return"++"===yt||"--"===yt?{type:Z.UpdateExpression,operator:yt,argument:kt,prefix:!0}:{type:Z.UnaryExpression,operator:yt,argument:kt,prefix:!0}},createVariableDeclaration:function(yt,kt){return{type:Z.VariableDeclaration,declarations:yt,kind:kt}},createVariableDeclarator:function(yt,kt){return{type:Z.VariableDeclarator,id:yt,init:kt}},createWhileStatement:function(yt,kt){return{type:Z.WhileStatement,test:yt,body:kt}},createWithStatement:function(yt,kt){return{type:Z.WithStatement,object:yt,body:kt}}};var no=f(18911),Zi=f.n(no);function Ao(yt){return function(kt,wr,Jt,hr){var Or=kt.value,pn=kt.path,bn=[],_i=function(Gi,Io){Yn(Gi)?(Gi.forEach(function(Mo,Ma){bn.length>=hr||Jt(Ma,Mo,wr)&&bn.push({path:Io.concat(Ma),value:Mo})}),Gi.forEach(function(Mo,Ma){bn.length>=hr||yt&&_i(Mo,Io.concat(Ma))})):function Qo(yt){return yt&&!(yt instanceof Array)&&yt instanceof Object}(Gi)&&(Object.keys(Gi).forEach(function(Mo){bn.length>=hr||Jt(Mo,Gi[Mo],wr)&&bn.push({path:Io.concat(Mo),value:Gi[Mo]})}),Object.keys(Gi).forEach(function(Mo){bn.length>=hr||yt&&_i(Gi[Mo],Io.concat(Mo))}))}.bind(this);return _i(Or,pn),bn}}function Fo(yt,kt){try{return Zi()(yt,kt)}catch{}}function Ki(yt){return function(kt,wr,Jt){return this.descend(wr,kt.expression.value,yt,Jt)}}function ro(yt){return function(kt,wr,Jt){return this.traverse(wr,kt.expression.value,yt,Jt)}}function uo(yt){return function Rs(yt,kt){for(var wr=[],Jt=[],hr=0,Or=yt?.length;hr=Jt||kt.expression.value.forEach(function(_i){var Gi={operation:"subscript",scope:"child",expression:_i.expression},Mo=hr.resolve(Gi)(Gi,bn);Or=Or.concat(Mo)})}),uo(Or)},"subscript-child-filter_expression":function(kt,wr,Jt){var Or=oi(kt.expression.value.slice(2,-1)).body[0].expression;return this.descend(wr,null,function(bn,_i){return Fo(Or,{"@":_i})},Jt)},"subscript-descendant-filter_expression":function(kt,wr,Jt){var Or=oi(kt.expression.value.slice(2,-1)).body[0].expression;return this.traverse(wr,null,function(bn,_i){return Fo(Or,{"@":_i})},Jt)},"subscript-child-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$..value")}},this.initialize()}return yt.prototype.initialize=function(){this.traverse=Ao(!0),this.descend=Ao(),this._fns["subscript-child-string_literal"]=this._fns["member-child-identifier"],this._fns["member-descendant-numeric_literal"]=this._fns["subscript-descendant-string_literal"]=this._fns["member-descendant-identifier"]},yt.prototype.resolve=function(kt){var wr=[kt.operation,kt.scope,kt.expression.type].join("-"),Jt=this._fns[wr];if(!Jt)throw new Error("couldn't resolve key: "+wr);return Jt.bind(this)},yt.prototype.register=function(kt,wr){if(!(wr instanceof Function))throw new Error("handler must be a function");this._fns[kt]=wr},yt}(),gs=f(15320);function Yi(){var yt=new gs.iX,kt=yt.parseError;return yt.yy.parseError=function(){yt.yy.ast&&yt.yy.ast.initialize(),kt.apply(yt,arguments)},yt}var ys=function(){function yt(){}return yt.ok=function(kt,wr){if(!kt)throw new Error(wr)},yt.equal=function(kt,wr,Jt){if(kt!==wr)throw new Error(Jt)},yt}(),uc=function(){function yt(){}return yt.parse=function(kt){return ys.ok("string"==typeof kt,"we need a path"),(new Yi).parse(kt)},yt.parent=function(kt,wr){ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path");var Jt=this.nodes(kt,wr)[0];return Jt.path.pop(),this.value(kt,Jt.path)},yt.apply=function(kt,wr,Jt){ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path"),ys.equal(typeof Jt,"function","fn needs to be function");var hr=this.nodes(kt,wr).sort(function(Or,pn){return pn.path.length-Or.path.length});return hr.forEach(function(Or){var pn=Or.path.pop(),bn=this.value(kt,this.stringify(Or.path)),_i=Or.value=Jt.call(kt,bn[pn]);bn[pn]=_i},this),hr},yt.value=function(kt,wr,Jt){if(ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path"),void 0!==Jt){var hr=this.nodes(kt,wr).shift();if(!hr)return this._vivify(kt,wr,Jt);var Or=hr.path.slice(-1).shift();this.parent(kt,this.stringify(hr.path))[Or]=Jt}return this.query(kt,this.stringify(wr),1).shift()},yt._vivify=function(kt,wr,Jt){var hr=this;ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path");var Or=(new Yi).parse(wr).map(function(bn){return bn.expression.value}),pn=function(bn,_i){var Gi=bn.pop(),Io=hr.value(kt,bn);Io||(pn(bn.concat(),"string"==typeof Gi?{}:[]),Io=hr.value(kt,bn)),Io[Gi]=_i};return pn(Or,Jt),this.query(kt,wr)[0]},yt.query=function(kt,wr,Jt){return ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok("string"==typeof wr,"we need a path"),this.nodes(kt,wr,Jt).map(function(Or){return Or.value})},yt.paths=function(kt,wr,Jt){return ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path"),this.nodes(kt,wr,Jt).map(function(Or){return Or.path})},yt.nodes=function(kt,wr,Jt){if(ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path"),0===Jt)return[];var hr=(new Yi).parse(wr),Or=new Ss,pn=[{path:["$"],value:kt}],bn=[];return hr.length&&"root"==hr[0].expression.type&&hr.shift(),hr.length?(hr.forEach(function(_i,Gi){if(!(bn.length>=Jt)){var Io=Or.resolve(_i),Mo=[];pn.forEach(function(Ma){if(!(bn.length>=Jt)){var Os=Io(_i,Ma,Jt);Gi==hr.length-1?bn=bn.concat(Os||[]):Mo=Mo.concat(Os||[])}}),pn=Mo}}),Jt?bn.slice(0,Jt):bn):pn},yt.stringify=function(kt){ys.ok(kt,"we need a path");var wr="$",Jt={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return(kt=this._normalize(kt)).forEach(function(hr){if("root"!=hr.expression.type){var bn,Or=[hr.scope,hr.operation].join("-"),pn=Jt[Or];if(bn="string_literal"==hr.expression.type?JSON.stringify(hr.expression.value):hr.expression.value,!pn)throw new Error("couldn't find template "+Or);wr+=pn.replace(/{{value}}/,bn)}}),wr},yt._normalize=function(kt){if(ys.ok(kt,"we need a path"),"string"==typeof kt)return(new Yi).parse(kt);if(Array.isArray(kt)&&"string"==typeof kt[0]){var wr=[{expression:{type:"root",value:"$"}}];return kt.forEach(function(Jt,hr){"$"==Jt&&0===hr||("string"==typeof Jt&&Jt.match("^[a-zA-Z_]+[a-zA-Z0-9_]*$")?wr.push({operation:"member",scope:"child",expression:{value:Jt,type:"identifier"}}):wr.push({operation:"subscript",scope:"child",expression:{value:Jt,type:"number"==typeof Jt?"numeric_literal":"string_literal"}}))}),wr}if(Array.isArray(kt)&&"object"==typeof kt[0])return kt;throw new Error("couldn't understand path "+kt)},yt}()},15320:(Me,F)=>{var i=function(){var a=function(me,ye,ue,K){for(ue=ue||{},K=me.length;K--;ue[me[K]]=ye);return ue},x=[1,5],B=[1,6],m=[1,7],S=[1,8],g=[1,9],E=[1,18],R=[1,19],M=[1,20],_=[1,12,14,22],j=[1,29],P=[1,30],k=[1,33],z=[1,35],W=[1,31],V=[1,36],Z=[1,37],q=[24,28],re={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(ye,ue,K,o,h,A,I){o.ast||(o.ast=te,te.initialize());var O=A.length-1;switch(h){case 1:return o.ast.set({expression:{type:"root",value:A[O]}}),o.ast.unshift(),o.ast.yield();case 2:return o.ast.set({expression:{type:"root",value:A[O-1]}}),o.ast.unshift(),o.ast.yield();case 3:return o.ast.unshift(),o.ast.yield();case 4:return o.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:A[O-1]}}),o.ast.unshift(),o.ast.yield();case 5:case 6:case 11:case 13:case 18:case 21:case 22:case 23:break;case 7:o.ast.set({operation:"member"}),o.ast.push();break;case 8:o.ast.set({operation:"subscript"}),o.ast.push();break;case 9:case 19:o.ast.set({scope:"child"});break;case 10:case 20:o.ast.set({scope:"descendant"});break;case 12:o.ast.set({scope:"child",operation:"member"});break;case 14:o.ast.set({expression:{type:"wildcard",value:A[O]}});break;case 15:o.ast.set({expression:{type:"identifier",value:A[O]}});break;case 16:o.ast.set({expression:{type:"script_expression",value:A[O]}});break;case 17:o.ast.set({expression:{type:"numeric_literal",value:parseInt(A[O])}});break;case 24:A[O].length>1?o.ast.set({expression:{type:"union",value:A[O]}}):this.$=A[O];break;case 25:this.$=[A[O]];break;case 26:this.$=A[O-2].concat(A[O]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(A[O])}},o.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:A[O]}},o.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:A[O]}},o.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:A[O]}},o.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:A[O]}},o.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:A[O]}},o.ast.set(this.$);break;case 33:case 34:this.$=A[O]}},table:[{3:1,4:[1,2],6:3,13:4,15:x,16:B,17:m,18:S,19:g},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:E,14:R,20:16,21:17,22:M},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:E,14:R,20:16,21:17,22:M},a(_,[2,12]),a(_,[2,14]),a(_,[2,15]),a(_,[2,16]),a(_,[2,17]),a(_,[2,18]),{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:E,14:R,20:16,21:17,22:M},a(_,[2,5]),a(_,[2,7]),a(_,[2,8]),a(_,[2,9]),a(_,[2,10]),a(_,[2,19]),a(_,[2,20]),{13:23,15:x,16:B,17:m,18:S,19:g},{13:24,15:x,16:B,17:m,18:S,19:g,22:[1,25]},{15:j,17:P,18:k,23:26,25:27,26:28,27:32,29:34,30:z,31:W,32:V,33:Z},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:E,14:R,20:16,21:17,22:M},a(_,[2,6]),a(_,[2,11]),a(_,[2,13]),{15:j,17:P,18:k,23:38,25:27,26:28,27:32,29:34,30:z,31:W,32:V,33:Z},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},a(q,[2,25]),a(q,[2,27]),a(q,[2,28]),a(q,[2,29]),a(q,[2,33]),a(q,[2,34]),{24:[1,41]},a(_,[2,21]),{18:k,27:42,29:34,30:z,32:V,33:Z},a(_,[2,22]),a(q,[2,26])],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(ye,ue){if(!ue.recoverable){var K=new Error(ye);throw K.hash=ue,K}this.trace(ye)},parse:function(ye){var K=[0],h=[null],A=[],I=this.table,O="",$=0,H=0,D=0,Y=A.slice.call(arguments,1),ee=Object.create(this.lexer),oe={yy:{}};for(var de in this.yy)Object.prototype.hasOwnProperty.call(this.yy,de)&&(oe.yy[de]=this.yy[de]);ee.setInput(ye,oe.yy),oe.yy.lexer=ee,oe.yy.parser=this,typeof ee.yylloc>"u"&&(ee.yylloc={});var Ae=ee.yylloc;A.push(Ae);var Qe,Ie=ee.options&&ee.options.ranges;this.parseError="function"==typeof oe.yy.parseError?oe.yy.parseError:Object.getPrototypeOf(this).parseError;for(var De,Xe,Te,ke,Ee,Ce,Re,$e,ve={};;){if(this.defaultActions[Te=K[K.length-1]]?ke=this.defaultActions[Te]:((null===De||typeof De>"u")&&(Qe=void 0,"number"!=typeof(Qe=ee.lex()||1)&&(Qe=this.symbols_[Qe]||Qe),De=Qe),ke=I[Te]&&I[Te][De]),typeof ke>"u"||!ke.length||!ke[0]){var nt;for(Ce in $e=[],I[Te])this.terminals_[Ce]&&Ce>2&&$e.push("'"+this.terminals_[Ce]+"'");nt=ee.showPosition?"Parse error on line "+($+1)+":\n"+ee.showPosition()+"\nExpecting "+$e.join(", ")+", got '"+(this.terminals_[De]||De)+"'":"Parse error on line "+($+1)+": Unexpected "+(1==De?"end of input":"'"+(this.terminals_[De]||De)+"'"),this.parseError(nt,{text:ee.match,token:this.terminals_[De]||De,line:ee.yylineno,loc:Ae,expected:$e})}if(ke[0]instanceof Array&&ke.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Te+", token: "+De);switch(ke[0]){case 1:K.push(De),h.push(ee.yytext),A.push(ee.yylloc),K.push(ke[1]),De=null,Xe?(De=Xe,Xe=null):(H=ee.yyleng,O=ee.yytext,$=ee.yylineno,Ae=ee.yylloc,D>0&&D--);break;case 2:if(ve.$=h[h.length-(Re=this.productions_[ke[1]][1])],ve._$={first_line:A[A.length-(Re||1)].first_line,last_line:A[A.length-1].last_line,first_column:A[A.length-(Re||1)].first_column,last_column:A[A.length-1].last_column},Ie&&(ve._$.range=[A[A.length-(Re||1)].range[0],A[A.length-1].range[1]]),typeof(Ee=this.performAction.apply(ve,[O,H,$,oe.yy,ke[1],h,A].concat(Y)))<"u")return Ee;Re&&(K=K.slice(0,-1*Re*2),h=h.slice(0,-1*Re),A=A.slice(0,-1*Re)),K.push(this.productions_[ke[1]][0]),h.push(ve.$),A.push(ve._$),K.push(I[K[K.length-2]][K[K.length-1]]);break;case 3:return!0}}return!0}},te={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(me){for(var ye in me)this._node[ye]=me[ye];return this._node},node:function(me){return arguments.length&&(this._node=me),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var me=this._nodes;return this.initialize(),me}};function ae(){this.yy={}}return re.lexer=function(){return{EOF:1,parseError:function(ue,K){if(!this.yy.parser)throw new Error(ue);this.yy.parser.parseError(ue,K)},setInput:function(ye,ue){return this.yy=ue||this.yy||{},this._input=ye,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},input:function(){var ye=this._input[0];return this.yytext+=ye,this.yyleng++,this.offset++,this.match+=ye,this.matched+=ye,ye.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ye},unput:function(ye){var ue=ye.length,K=ye.split(/(?:\r\n?|\n)/g);this._input=ye+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ue),this.offset-=ue;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),K.length-1&&(this.yylineno-=K.length-1);var h=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:K?(K.length===o.length?this.yylloc.first_column:0)+o[o.length-K.length].length-K[0].length:this.yylloc.first_column-ue},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-ue]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(ye){this.unput(this.match.slice(ye))},pastInput:function(){var ye=this.matched.substr(0,this.matched.length-this.match.length);return(ye.length>20?"...":"")+ye.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var ye=this.match;return ye.length<20&&(ye+=this._input.substr(0,20-ye.length)),(ye.substr(0,20)+(ye.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var ye=this.pastInput(),ue=new Array(ye.length+1).join("-");return ye+this.upcomingInput()+"\n"+ue+"^"},test_match:function(ye,ue){var K,o,h;if(this.options.backtrack_lexer&&(h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(h.yylloc.range=this.yylloc.range.slice(0))),(o=ye[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ye[0].length},this.yytext+=ye[0],this.match+=ye[0],this.matches=ye,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ye[0].length),this.matched+=ye[0],K=this.performAction.call(this,this.yy,this,ue,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),K)return K;if(this._backtrack){for(var A in h)this[A]=h[A];return!1}return!1},next:function(){if(this.done)return this.EOF;var ye,ue,K,o;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),A=0;Aue[0].length)){if(ue=K,o=A,this.options.backtrack_lexer){if(!1!==(ye=this.test_match(K,h[A])))return ye;if(this._backtrack){ue=!1;continue}return!1}if(!this.options.flex)break}return ue?!1!==(ye=this.test_match(ue,h[o]))&&ye:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(ue){this.conditionStack.push(ue)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(ue){return(ue=this.conditionStack.length-1-Math.abs(ue||0))>=0?this.conditionStack[ue]:"INITIAL"},pushState:function(ue){this.begin(ue)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(ue,K,o,h){switch(o){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return K.yytext=K.yytext.substr(1,K.yyleng-2),32;case 11:return K.yytext=K.yytext.substr(1,K.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}(),ae.prototype=re,re.Parser=ae,new ae}();F.iX=i.Parser},52191:(Me,F,f)=>{var i=f(40573);const a="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,x=()=>a.now(),m=g=>g===1/0||(g=>g&&g===Math.floor(g)&&g>0&&isFinite(g))(g);class S{constructor({max:E=1/0,ttl:R,updateAgeOnGet:M=!1,checkAgeOnGet:_=!1,noUpdateTTL:j=!1,dispose:P,noDisposeOnSet:k=!1}={}){if(this.expirations=Object.create(null),this.data=new Map,this.expirationMap=new Map,void 0!==R&&!m(R))throw new TypeError("ttl must be positive integer or Infinity if set");if(!m(E))throw new TypeError("max must be positive integer or Infinity");if(this.ttl=R,this.max=E,this.updateAgeOnGet=!!M,this.checkAgeOnGet=!!_,this.noUpdateTTL=!!j,this.noDisposeOnSet=!!k,void 0!==P){if("function"!=typeof P)throw new TypeError("dispose must be function if set");this.dispose=P}this.timer=void 0,this.timerExpiration=void 0}setTimer(E,R){if(this.timerExpiration{this.timer=void 0,this.timerExpiration=void 0,this.purgeStale();for(const _ in this.expirations){this.setTimer(_,_-x());break}},R);M.unref&&M.unref(),this.timerExpiration=E,this.timer=M}cancelTimer(){this.timer&&(clearTimeout(this.timer),this.timerExpiration=void 0,this.timer=void 0)}cancelTimers(){return i.emitWarning('TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no "s"), and will be removed in the next major version update'),this.cancelTimer()}clear(){const E=this.dispose!==S.prototype.dispose?[...this]:[];this.data.clear(),this.expirationMap.clear(),this.cancelTimer(),this.expirations=Object.create(null);for(const[R,M]of E)this.dispose(M,R,"delete")}setTTL(E,R=this.ttl){const M=this.expirationMap.get(E);if(void 0!==M){const _=this.expirations[M];!_||_.length<=1?delete this.expirations[M]:this.expirations[M]=_.filter(j=>j!==E)}if(R!==1/0){const _=Math.floor(x()+R);this.expirationMap.set(E,_),this.expirations[_]||(this.expirations[_]=[],this.setTimer(_,R)),this.expirations[_].push(E)}else this.expirationMap.set(E,1/0)}set(E,R,{ttl:M=this.ttl,noUpdateTTL:_=this.noUpdateTTL,noDisposeOnSet:j=this.noDisposeOnSet}={}){if(!m(M))throw new TypeError("ttl must be positive integer or Infinity");if(this.expirationMap.has(E)){_||this.setTTL(E,M);const P=this.data.get(E);P!==R&&(this.data.set(E,R),j||this.dispose(P,E,"set"))}else this.setTTL(E,M),this.data.set(E,R);for(;this.size>this.max;)this.purgeToCapacity();return this}has(E){return this.data.has(E)}getRemainingTTL(E){const R=this.expirationMap.get(E);return R===1/0?R:void 0!==R?Math.max(0,Math.ceil(R-x())):0}get(E,{updateAgeOnGet:R=this.updateAgeOnGet,ttl:M=this.ttl,checkAgeOnGet:_=this.checkAgeOnGet}={}){const j=this.data.get(E);if(!_||0!==this.getRemainingTTL(E))return R&&this.setTTL(E,M),j;this.delete(E)}dispose(E,R){}delete(E){const R=this.expirationMap.get(E);if(void 0!==R){const M=this.data.get(E);this.data.delete(E),this.expirationMap.delete(E);const _=this.expirations[R];return _&&(_.length<=1?delete this.expirations[R]:this.expirations[R]=_.filter(j=>j!==E)),this.dispose(M,E,"delete"),0===this.size&&this.cancelTimer(),!0}return!1}purgeToCapacity(){for(const E in this.expirations){const R=this.expirations[E];if(!(this.size-R.length>=this.max)){const M=this.size-this.max,_=[];for(const j of R.splice(0,M))_.push([j,this.data.get(j)]),this.data.delete(j),this.expirationMap.delete(j);for(const[j,P]of _)this.dispose(P,j,"evict");return}{delete this.expirations[E];const M=[];for(const _ of R)M.push([_,this.data.get(_)]),this.data.delete(_),this.expirationMap.delete(_);for(const[_,j]of M)this.dispose(j,_,"evict")}}}get size(){return this.data.size}purgeStale(){const E=Math.ceil(x());for(const R in this.expirations){if("Infinity"===R||R>E)return;const M=[...this.expirations[R]||[]],_=[];delete this.expirations[R];for(const j of M)_.push([j,this.data.get(j)]),this.data.delete(j),this.expirationMap.delete(j);for(const[j,P]of _)this.dispose(P,j,"stale")}0===this.size&&this.cancelTimer()}*entries(){for(const E in this.expirations)for(const R of this.expirations[E])yield[R,this.data.get(R)]}*keys(){for(const E in this.expirations)for(const R of this.expirations[E])yield R}*values(){for(const E in this.expirations)for(const R of this.expirations[E])yield this.data.get(R)}[Symbol.iterator](){return this.entries()}}Me.exports=S},33065:(Me,F,f)=>{"use strict";f.r(F),f.d(F,{RestoreComponent:()=>h});var i=f(10467),a=f(54438),x=f(89417),B=f(88834),m=f(25596),S=f(99213),g=f(99631),E=f(5951),R=f(82798),M=f(34635),_=f(20180),j=f(96084),P=f(65571),k=f(12621),z=f(30046),W=f(88020),V=f(3902),Z=f(9183),q=f(53719);const re=A=>["/account",A];function te(A,I){1&A&&(a.j41(0,"mat-error"),a.EFF(1,"Private key is "),a.j41(2,"strong"),a.EFF(3,"required"),a.k0s()())}function ie(A,I){if(1&A&&(a.j41(0,"mat-card",7)(1,"mat-card-header")(2,"mat-card-title"),a.EFF(3,"Private Key"),a.k0s(),a.j41(4,"mat-card-subtitle"),a.EFF(5,"Enter your Stellar private key (starts with 'S')"),a.k0s()(),a.j41(6,"mat-card-content"),a.nrm(7,"br"),a.j41(8,"mat-form-field",8)(9,"mat-label"),a.EFF(10,"Stellar Private Key"),a.k0s(),a.nrm(11,"textarea",9,0),a.DNE(13,te,4,0,"mat-error"),a.k0s()(),a.j41(14,"mat-card-actions",10)(15,"button",11),a.EFF(16,"Restore"),a.k0s()()()),2&A){const O=a.XpG();a.R7$(13),a.vxM(O.addressForm.controls.recoveryPhrase.hasError("required")?13:-1),a.R7$(2),a.Y8G("disabled",O.app.loading())}}function ae(A,I){1&A&&(a.j41(0,"mat-card",7)(1,"mat-card-header")(2,"mat-card-title"),a.EFF(3,"Importing..."),a.k0s(),a.j41(4,"mat-card-subtitle"),a.EFF(5,"Please wait. App will reload."),a.k0s()(),a.j41(6,"mat-card-content",12),a.nrm(7,"mat-spinner"),a.k0s()())}function me(A,I){if(1&A){const O=a.RV6();a.j41(0,"mat-card",7)(1,"mat-card-header")(2,"mat-card-title"),a.EFF(3,"Portable DID"),a.k0s(),a.j41(4,"mat-card-subtitle"),a.EFF(5,"Choose your backup file (portableIdentity.json)"),a.k0s()(),a.j41(6,"mat-card-content",12)(7,"button",13),a.bIt("click",function(){a.eBV(O);const H=a.XpG(2);return a.Njj(H.editFile({}))}),a.j41(8,"mat-icon"),a.EFF(9,"upload_file"),a.k0s(),a.j41(10,"span"),a.EFF(11,"Choose portable DID file"),a.k0s()(),a.j41(12,"input",14),a.bIt("change",function(H){a.eBV(O);const D=a.XpG(2);return a.Njj(D.onFileSelected(H))}),a.k0s()()()}}function ye(A,I){if(1&A&&(a.j41(0,"a",15)(1,"mat-icon",16),a.EFF(2,"account_circle"),a.k0s(),a.j41(3,"span",17),a.EFF(4),a.k0s(),a.j41(5,"span",18),a.EFF(6),a.k0s()()),2&A){const O=I.$implicit;a.Y8G("routerLink",a.eq3(3,re,O.did.uri)),a.R7$(4),a.JRh(O.metadata.name),a.R7$(2),a.JRh(O.did.uri)}}function ue(A,I){if(1&A&&(a.j41(0,"h1"),a.EFF(1,"Imported Accounts"),a.k0s(),a.j41(2,"mat-list"),a.Z7z(3,ye,7,5,"a",15,a.fX1),a.k0s()),2&A){const O=a.XpG(2);a.R7$(3),a.Dyx(O.importedIdentities)}}function K(A,I){if(1&A&&a.DNE(0,ae,8,0,"mat-card",7)(1,me,13,0,"mat-card",7)(2,ue,5,0),2&A){const O=a.XpG();a.vxM(O.loading?0:1),a.R7$(2),a.vxM(O.importedIdentities.length>0?2:-1)}}function o(A,I){1&A&&(a.j41(0,"mat-card",7)(1,"mat-card-content")(2,"p"),a.EFF(3,"Support for Nostr is coming in the future"),a.k0s()()())}let h=(()=>{class A{constructor(){this.fb=(0,a.WQX)(x.ok),this.crypto=(0,a.WQX)(_.j),this.app=(0,a.WQX)(j.d),this.protocol=(0,a.WQX)(W.w),this.route=(0,a.WQX)(z.Ix),this.identity=(0,a.WQX)(M.K),this.importedIdentities=[],this.addressForm=this.fb.group({recoveryPhrase:[null,x.k0.required],importType:["ariton",x.k0.required]}),this.loading=!1}editFile(O){return(0,i.A)(function*(){document.getElementById("input")?.click()})()}query(){var O=this;return(0,i.A)(function*(){const $={message:{filter:{protocol:"https://schema.ariton.app/note",schema:"https://schema.ariton.app/note/schema/note",dataFormat:"application/json"}}};console.log("Query:",$),console.log(O.identity.web5.agent),console.log(O.identity.web5.dwn),console.log(O.identity.web5.dwn.records),console.log("Object above");var{records:D,status:s}=yield O.identity.web5.dwn.records.query($);console.log("Status:",s),console.log(D);const H={from:O.identity.did,message:{filter:{protocol:"https://schema.ariton.app/note",schema:"https://schema.ariton.app/note/schema/note",dataFormat:"application/json"}}};console.log("Query:",H);var{records:D,status:s}=yield O.identity.web5.dwn.records.query(H);console.log("Status:",s),console.log(D)})()}onFileSelected(O){var $=this;return(0,i.A)(function*(){const H=O.target.files;if(H&&0!==H.length){console.log("Uploading number of files:",H.length);for(let D=0;D{$.app.openSnackBar(`Error reading file ${s.name}: ${p.error}`,3e3),console.error(`Error reading file ${s.name}:`,p.error)},p.readAsText(s)}}})()}onSubmit(){var O=this;return(0,i.A)(function*(){if(console.log(O.addressForm.controls.recoveryPhrase.value),O.addressForm.disable(),O.app.loading.set(!0),"stellar"===O.addressForm.controls.importType.value){const $=O.identity.activeAgent(),H=yield k.hX.fromPrivateKey({privateKey:O.addressForm.controls.recoveryPhrase.value});console.log("Bearer DID: ",H);const D=yield H.export(),s={portableDid:D,metadata:{name:"Stellar Identity",tenant:D.uri,uri:D.uri}};try{console.log("Portable Identity:",s),yield $.identity.import({portableIdentity:s})}catch(ee){console.error(ee)}O.identity.identities=yield $.identity.list();const p=yield O.identity.registerAccount(D.uri,O.app.account().password);console.log(`Register protocols for ${D.uri}`),yield O.protocol.register(p),O.app.account(),O.identity.changeAccount(D.uri),O.route.navigate(["/accounts"])}else{let $=yield O.crypto.createPassword();$="123"}O.app.initialized.set(!0),O.app.loading.set(!1)})()}static{this.\u0275fac=function($){return new($||A)}}static{this.\u0275cmp=a.VBU({type:A,selectors:[["app-restore"]],standalone:!0,features:[a.aNF],decls:16,vars:5,consts:[["recoveryPhrase",""],["novalidate","",3,"ngSubmit","formGroup"],["formControlName","importType"],["value","ariton"],["value","did:is",3,"disabled"],["value","stellar",3,"disabled"],["value","nostr",3,"disabled"],[1,"restore-card"],[1,"full-width"],["matInput","","placeholder","Secret Recovery Phrase","formControlName","recoveryPhrase"],["align","end"],["mat-flat-button","","color","primary","type","submit",3,"disabled"],[1,"restore-card-content"],["type","button","mat-button","",3,"click"],["type","file","id","input",2,"display","none",3,"change"],["mat-list-item","",1,"selectable-list-item",3,"routerLink"],["matListItemIcon",""],["matListItemTitle",""],["matListItemLine",""]],template:function($,H){1&$&&(a.j41(0,"h1"),a.EFF(1,"Restore your account"),a.k0s(),a.j41(2,"form",1),a.bIt("ngSubmit",function(){return H.onSubmit()}),a.j41(3,"p")(4,"mat-button-toggle-group",2)(5,"mat-button-toggle",3),a.EFF(6,"Ariton"),a.k0s(),a.j41(7,"mat-button-toggle",4),a.EFF(8,"FreeID"),a.k0s(),a.j41(9,"mat-button-toggle",5),a.EFF(10,"Stellar"),a.k0s(),a.j41(11,"mat-button-toggle",6),a.EFF(12,"Nostr"),a.k0s()()(),a.DNE(13,ie,17,2,"mat-card",7)(14,K,3,2)(15,o,4,0,"mat-card",7),a.k0s()),2&$&&(a.R7$(2),a.Y8G("formGroup",H.addressForm),a.R7$(5),a.Y8G("disabled",!0),a.R7$(2),a.Y8G("disabled",!0),a.R7$(2),a.Y8G("disabled",!0),a.R7$(2),a.vxM("stellar"==H.addressForm.controls.importType.value?13:"ariton"==H.addressForm.controls.importType.value?14:15))},dependencies:[g.fS,g.fg,q.rl,q.nJ,q.TL,B.Hl,B.$z,P.Vg,P.ec,P.pc,R.Ve,S.m_,S.An,V.Fg,V.jt,V.YE,V.ZV,V.C_,V.yE,z.iI,z.Wk,E.Wk,m.Hu,m.RN,m.YY,m.m2,m.MM,m.Lc,m.dh,x.X1,x.qT,x.me,x.BC,x.cb,x.j4,x.JD,Z.D6,Z.LG],styles:[".restore-card[_ngcontent-%COMP%]{min-width:120px;margin:20px auto}.restore-card-content[_ngcontent-%COMP%]{align-self:center;margin-top:1em}.mat-radio-button[_ngcontent-%COMP%]{display:block;margin:5px 0}.row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.col[_ngcontent-%COMP%]{flex:1;margin-right:20px}.col[_ngcontent-%COMP%]:last-child{margin-right:0}.link-input[_ngcontent-%COMP%]{display:flex;align-items:baseline}.link-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:.4em}.account-action-button[_ngcontent-%COMP%]{padding-top:1.2em}.example-action-buttons[_ngcontent-%COMP%]{padding-bottom:20px}.example-headers-align[_ngcontent-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%]{justify-content:space-between;align-items:center}.example-headers-align[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] + .mat-mdc-form-field[_ngcontent-%COMP%]{margin-left:8px}.selectable-list-item[_ngcontent-%COMP%]{cursor:pointer}.selectable-list-item[_ngcontent-%COMP%]:hover{background-color:var(--mdc-list-list-item-leading-avatar-color)}"]})}}return A})()},59564:(Me,F,f)=>{"use strict";f.d(F,{z:()=>a});var i=f(54438);let a=(()=>{class x{#n=["did:dht:jtubj7jooigmx9y7dz13j9kxhoy3pyo6jzizh3irkmwity3saxko"];#s={registries:"did:dht:jtubj7jooigmx9y7dz13j9kxhoy3pyo6jzizh3irkmwity3saxko"};#l=["did:dht:jtubj7jooigmx9y7dz13j9kxhoy3pyo6jzizh3irkmwity3saxko","did:dht:wfcf3guhgb183rbfx5r4a5u3kh9tgjnmdp75xdphyj6wbaxxym7o"];constructor(){}getAdminDids(){return[...this.#l]}isAdmin(m){return this.#l.includes(m)}getIdentifierForApp(m){return this.#s[m]}getOwnerDids(){return[...this.#n]}isOwner(m){return this.#n.includes(m)}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275prov=i.jDH({token:x,factory:x.\u0275fac,providedIn:"root"})}}return x})()},96084:(Me,F,f)=>{"use strict";f.d(F,{d:()=>Z,f:()=>V});var i=f(10467),a=f(54438),x=f(31948),B=f(20180),m=f(34635),g=f.t(JSON.parse('{"name":"ariton","version":"0.0.3","scripts":{"ng":"ng","start":"ng serve --port 4201","start2":"ng serve --port 4210","build":"ng build","watch":"ng build --watch --configuration development","test":"ng test","deploy":"ng deploy app","i18n":"ng extract-i18n --format=json --output-path src/locale"},"repository":{"type":"git","url":"git+https://github.com/block-core/ariton.git"},"private":true,"dependencies":{"@angular-builders/custom-webpack":"^18.0.0","@angular/animations":"^18.2.8","@angular/cdk":"^18.2.8","@angular/common":"^18.2.8","@angular/compiler":"^18.2.8","@angular/core":"^18.2.8","@angular/forms":"^18.2.8","@angular/material":"^18.2.8","@angular/platform-browser":"^18.2.8","@angular/platform-browser-dynamic":"^18.2.8","@angular/router":"^18.2.8","@angular/service-worker":"^18.2.8","@scure/bip39":"^1.4.0","@web5/agent":"^0.8.1","@web5/api":"^0.12.0","@web5/credentials":"^1.1.3","@web5/crypto":"^1.0.6","@web5/dids":"^1.2.0","@web5/identity-agent":"^0.7.1","@zxing/ngx-scanner":"^18.0.1","base32.js":"^0.1.0","cropperjs":"^1.6.2","crypto-browserify":"^3.12.1","process":"^0.11.10","qrcode":"^1.5.4","rxjs":"~7.8.1","stream":"^0.0.3","stream-browserify":"^3.0.0","tslib":"^2.7.0"},"devDependencies":{"@angular-devkit/build-angular":"^18.2.8","@angular/cli":"^18.2.8","@angular/compiler-cli":"^18.2.8","@angular/localize":"^18.2.8","@types/jasmine":"~5.1.4","@types/qrcode":"^1.5.5","angular-cli-ghpages":"^2.0.3","jasmine-core":"~5.3.0","karma":"~6.4.4","karma-chrome-launcher":"~3.2.0","karma-coverage":"~2.2.1","karma-jasmine":"~5.1.0","karma-jasmine-html-reporter":"~2.1.0","typescript":"~5.5.4"}}'),2),E=f(88020),R=f(5794),M=f(1005),_=f(95416),j=f(21093);let P=(()=>{class q{constructor(){this.connection=(0,a.WQX)(j.K)}start(){var te=this;return(0,i.A)(function*(){const ie=function(){var ae=(0,i.A)(function*(){try{console.log("Processing task..."),console.log("connections count:",te.connection.requests().length),console.log("CONNECTIONS:",te.connection.requests());const me=te.connection.requests().filter(ye=>"credential"===ye.record.tags.type);console.log("credentialRequests:",me);for(const ye of me){console.log("Processing connection:",ye);const ue=yield te.connection.acceptFriendRequest(ye);ye.data.recordId=ue?.id,ye.data.did=ye.record.creator,console.log("REQUEST DATA:",ye.data);const K=yield te.connection.create(ye,j.X.Friend);console.log("Connection Entry that was made: ",K),yield te.connection.deleteRequest(ye)}}catch(me){console.error("Error processing task:",me)}finally{setTimeout(ie,6e4)}});return function(){return ae.apply(this,arguments)}}();yield ie()})()}static{this.\u0275fac=function(ie){return new(ie||q)}}static{this.\u0275prov=a.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})();var k=f(56687),z=f(43794),W=f(30046),V=function(q){return q[q.Initial=0]="Initial",q[q.NewUser=1]="NewUser",q[q.Locked=2]="Locked",q[q.Unlocked=3]="Unlocked",q[q.Error=4]="Error",q}(V||{});let Z=(()=>{class q{constructor(){var te=this;this.onboardingState=(0,a.vPA)(V.Initial),this.initialized=(0,a.vPA)(!1),this.loading=(0,a.vPA)(!1),this.localStorage=(0,a.WQX)(x.s),this.storage=(0,a.WQX)(z.n),this.hash=(0,a.WQX)(M.G),this.worker=(0,a.WQX)(P),this.crypto=(0,a.WQX)(B.j),this.identity=(0,a.WQX)(m.K),this.profile=(0,a.WQX)(R.p),this.connection=(0,a.WQX)(j.K),this.protocol=(0,a.WQX)(E.w),this.snackBar=(0,a.WQX)(_.UG),this.event=(0,a.WQX)(k.U),this.router=(0,a.WQX)(W.Ix),this.state=(0,a.vPA)({loginAction:"/dashboard",selectedIdentity:"",hidden:{}}),this.account=(0,a.vPA)({did:"",recoveryPhrase:"",password:"",passwordHash:"",bundleTimestamp:""}),this.identities=(0,a.vPA)([]),this.agent=(0,a.vPA)(null),this.activeIdentity=(0,a.vPA)(null),this.params=(0,a.vPA)({}),this.package=g,console.log(`Ariton v${this.package.version} (${this.hash.getTimestamp()})`),this.dependencies=Object.entries(this.package.dependencies).map(([ie,ae])=>({name:ie,version:ae})),(0,a.QZP)((0,i.A)(function*(){te.identity.locked()||(yield te.onUnlocked())}))}saveAgent(te){this.localStorage.save("agent",te)}saveIdentities(te){te&&0!=te.length?this.localStorage.save("identities",te):console.log("IDENTITIES ARE EMPTY!!!")}saveAccounts(te){this.localStorage.save("accounts",te)}saveState(te){this.localStorage.save("state",te)}wipe(){var te=this;return(0,i.A)(function*(){te.localStorage.clear(),console.log("Local storage data has been wiped!"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DID_RESOLVERCACHE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_DATASTORE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_EVENTLOG"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_MESSAGEINDEX"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_MESSAGESTORE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/VAULT_STORE"),console.log("Data has been wiped!"),window.location.reload()})()}hasStateBeenSet(){return!!this.localStorage.read("state")}createAccount(){var te=this;return(0,i.A)(function*(){te.localStorage.save("state",{selectedIdentity:"",hidden:{},loginAction:"/introduction"}),yield te.initialize()})()}openSnackBar(te,ie=2e3){this.snackBar.open(te,void 0,{duration:ie})}initialize(){var te=this;return(0,i.A)(function*(){te.loading.set(!0),console.log("Initializing Ariton...");let ie=te.localStorage.read("state");if(!ie)return te.onboardingState.set(V.NewUser),void te.loading.set(!1);let ae=te.localStorage.read("identities");te.identities.set(ae);let ye,me=te.localStorage.read("agent");if(me){let ue;if(ie.selectedIdentity?(ue=ae.find(K=>K.did===ie.selectedIdentity),console.log("!!! IDENTITIES: ",ae),console.log("!!! IDENTITY: ",ue),te.activeIdentity.set(ue),te.agent.set(me)):0===ae.length&&(ue=ae[0],te.activeIdentity.set(ue),console.log("!!! IDENTITY2: ",ue)),me.password){if(ye=yield te.identity.connect(ue.did,me.password),0===ae.length){const o=yield(ye?.web5.agent).identity.list();console.log("IDENTITIES FROM identity.list:",o);const h=o.map(A=>({did:A.metadata.uri,bundleTimestamp:""}));console.log("Mapped identities:",h),te.saveIdentities(h),te.identities.set(h)}console.log("IDENTITIES FOR SAVING: ",ae),console.log("IDENTITIES SET: ",te.identities()),ye?(te.onboardingState.set(V.Unlocked),console.log("LOCKED FALSE, IDENTITIES2",te.identities()),te.identity.locked.set(!1)):te.loading.set(!1)}else console.log("LOCKED TRUE, IDENTITIES3",te.identities()),console.log("LOCKED TRUE, IDENTITIES4",ae),te.identity.locked.set(!0),te.onboardingState.set(V.Locked)}else{console.log("No agent found");const ue=yield te.crypto.createPassword();if(ye=yield te.identity.initialConnect(ue),void 0===ye)return te.localStorage.remove("state"),te.onboardingState.set(V.Error),void te.loading.set(!1);console.log(ye),console.log("Initialize connect finished."),me={did:ye.web5.agent.agentDid.uri,recoveryPhrase:ye.recoveryPhrase,password:ue},te.saveAgent(me);const K={did:ye.did,bundleTimestamp:""};ae=[K],te.saveIdentities(ae),te.identities.set(ae),console.log("Identities saved:",ae),ie.selectedIdentity=ye.did,te.saveState(ie),te.agent.set(me),te.activeIdentity.set(K),te.onboardingState.set(V.Unlocked),console.log("LOCKED FALSE, IDENTITIES1",te.identities()),te.identity.locked.set(!1)}te.state.set(ie)})()}lock(){var te=this;return(0,i.A)(function*(){te.agent()?.passwordHash&&""!==te.agent()?.passwordHash?(console.log("Locking account..."),yield te.identity.lock(),te.onboardingState.set(V.Locked),te.initialized.set(!1)):te.router.navigate(["/account","password"])})()}onUnlocked(){var te=this;return(0,i.A)(function*(){try{yield te.profile.openCurrentUserProfile(te.activeIdentity().did)}catch(ie){console.error("Failed to load user profile:",ie)}yield te.loadAppData(),te.initialized.set(!0),te.loading.set(!1),te.worker.start(),yield te.event.initialize(te.identity),yield te.firstTimeInitialization()})()}loadAppData(){var te=this;return(0,i.A)(function*(){console.log("Loading app data..."),yield te.connection.initialize(),console.log("App data loaded.")})()}firstTimeInitialization(){var te=this;return(0,i.A)(function*(){console.log("First time initialization..."),console.log(te.identities()),console.log(te.activeIdentity()),null==te.hash.getTimestamp()||te.activeIdentity().bundleTimestamp!==te.hash.getTimestamp()?(console.log("Bundle hash is different from the previous one. Re-registering protocols..."),console.log(`Register protocols for ${te.identity.did}`),te.protocol.register(te.identity.web5),te.activeIdentity().bundleTimestamp=te.hash.getTimestamp(),te.saveIdentities(te.identities())):console.log("Bundle hash is the same as the previous one. No need to re-register protocols.")})()}static{this.\u0275fac=function(ie){return new(ie||q)}}static{this.\u0275prov=a.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})()},21093:(Me,F,f)=>{"use strict";f.d(F,{K:()=>_,X:()=>M});var i=f(10467),a=f(54438),x=f(34635),B=f(68530),m=f(77494),S=f(26703),g=f(76336),E=f(22312),R=f(56687),M=function(j){return j.Data="data",j.Friend="friend",j.Credential="credential",j}(M||{});let _=(()=>{class j{constructor(){var k=this;this.identity=(0,a.WQX)(x.K),this.events=(0,a.WQX)(R.U),this.utility=(0,a.WQX)(S.Q),this.blocks=(0,a.vPA)([]),this.connections=(0,a.vPA)([]),this.friends=(0,a.EWP)(()=>this.connections().filter(z=>"friend"==z.record.tags.type)),this.friendRequests=(0,a.EWP)(()=>this.requests().filter(z=>"friend"==z.record.tags.type)),this.requests=(0,a.vPA)([]),this.loading=(0,a.vPA)(!1),(0,a.QZP)((0,i.A)(function*(){k.events.connectionProtocol()&&(yield k.reloadRequests())}),{allowSignalWrites:!0})}create(k,z){var W=this;return(0,i.A)(function*(){const V={type:z};let Z=k.data;console.log("CONNECTION SERVICE ENTRY DATA:",Z);const{record:q,status:re}=yield W.identity.web5.dwn.records.create({data:Z,message:{tags:V,recipient:k.record.creator,protocol:B.Q.protocol,protocolPath:"connection",schema:B.Q.types.connection.schema,dataFormat:B.Q.types.connection.dataFormats[0]}});console.log("Connection created:",re,q);const te={record:q,data:Z,id:q.id};return W.connections.update(ie=>[te,...ie]),W.utility.executeAsyncWithToast(k.record.send(W.identity.did)),te})()}validateAndStoreCredential(k){var z=this;return(0,i.A)(function*(){const W=k.data.vc;if(!W)throw new Error("The incoming VC is missing.");try{yield g.l6.verify({vcJwt:W})}catch(te){return void console.error("Error verifying VC:",te)}const V=g.l6.parseJwt({vcJwt:W});console.log("PARSED INVCOMING VC:",V),console.log("vc.issuer === this.identity.did:",V.issuer===z.identity.did);const{record:q}=yield z.identity.web5.dwn.records.create({data:W,message:{schema:E.eE.friendship,dataFormat:E.eE.format,published:!1}});console.log("TWO WAY VC RECORD:",q);const{status:re}=yield q.send(z.identity.did);console.log("Record sent:",re,q),yield k.record.delete(),k.record.send(z.identity.did),console.log("Friend request validated")})()}removeFriendship(k){return(0,i.A)(function*(){})()}acceptFriendRequest(k){var z=this;return(0,i.A)(function*(){const W=k.data.vc;if(!W)throw new Error("The incoming VC is missing.");if(console.log("signedVcJwt:",W),!W)return;try{yield g.l6.verify({vcJwt:W})}catch(ie){return void console.error("Error verifying VC:",ie)}const V=g.l6.parseJwt({vcJwt:W});if(V.subject!=z.identity.did)return void console.error("VC is not valid.");if(V.issuer!=k.record.creator)return void console.error("VC is not valid.");const q=V.vcDataModel.credentialSubject.vc;console.log("INNER VC JWT:",q);try{yield g.l6.verify({vcJwt:q})}catch(ie){return void console.error("Error verifying VC:",ie)}const re=g.l6.parseJwt({vcJwt:q});if(console.log("VC issuer: ",re.issuer),console.log("this.identity.did",z.identity.did),re.issuer!=z.identity.did)return void console.error("VC is not valid.");if(re.subject!=V.issuer)return void console.error("VC is not valid.");console.log("Friend request validated");const{record:te}=yield z.identity.web5.dwn.records.create({data:W,message:{schema:E.eE.friendship,dataFormat:E.eE.format,published:!1}});return console.log("TWO WAY VC RECORD:",te),te.send(z.identity.did),te})()}approveFriendRequest(k){var z=this;return(0,i.A)(function*(){const W=k.data.vc;if(!W)throw new Error("The incoming VC is missing.");if(console.log("signedVcJwt:",W),!W)return;try{yield g.l6.verify({vcJwt:W})}catch(q){return void console.error("Error verifying VC:",q)}const V=g.l6.parseJwt({vcJwt:W});if(V.subject!=z.identity.did)return void console.error("VC is not valid.");if(V.issuer!=k.record.creator)return void console.error("VC is not valid.");const{record:Z}=yield z.identity.web5.dwn.records.create({data:W,message:{schema:E.eE.friendship,dataFormat:E.eE.format,published:!1}});console.log("TWO WAY VC RECORD:",Z),Z.send(z.identity.did),yield z.deleteRequest(k)})()}initialize(){var k=this;return(0,i.A)(function*(){const z=yield k.loadBlocks();k.blocks.set(z);const W=yield k.loadConnections();k.connections.set(W),yield k.reloadRequests()})()}reloadRequests(){var k=this;return(0,i.A)(function*(){k.loading.set(!0);const z=yield k.loadRequests();k.requests.set(z),k.loading.set(!1)})()}request(k,z,W){var V=this;return(0,i.A)(function*(){const Z=z,q={type:W},{record:re,status:te}=yield V.identity.web5.dwn.records.create({data:Z,message:{tags:q,recipient:k,protocol:B.Q.protocol,protocolPath:"request",schema:B.Q.types.request.schema,dataFormat:B.Q.types.request.dataFormats[0]}});console.log("Notification created:",te,re);const ie={record:re,data:Z,id:re.id,direction:"out"};return V.requests.update(ae=>[ie,...ae]),V.utility.executeAsyncWithToast(ie.record.send(V.identity.did)),V.utility.executeAsyncWithToast(ie.record.send(k)),ie})()}deleteBlock(k){var z=this;return(0,i.A)(function*(){yield k.record.delete(),z.blocks.update(W=>[...W.filter(V=>V.id!==k.id)]),z.utility.executeAsyncWithToast(k.record.send(z.identity.did))})()}deleteConnection(k){var z=this;return(0,i.A)(function*(){yield k.record.delete(),z.connections.update(W=>[...W.filter(V=>V.id!==k.id)]),z.utility.executeAsyncWithToast(k.record.send(z.identity.did))})()}deleteRequest(k){var z=this;return(0,i.A)(function*(){const W=k.record.creator;console.log("Delete requested for this author:"+W),yield k.record.delete(),z.requests.update(V=>[...V.filter(Z=>Z.id!==k.id)]),z.utility.executeAsyncWithToast(k.record.send(z.identity.did)),z.utility.executeAsyncWithToast(k.record.send(W==z.identity.did?k.record.recipient:W))})()}deleteRequests(k){var z=this;return(0,i.A)(function*(){if(!k)return;const W=yield z.loadRequests(k);for(const V of W)console.log("DELETE THIS ENTRY:",V),yield z.deleteRequest(V)})()}deleteConnections(k){var z=this;return(0,i.A)(function*(){if(!k)return;const W=yield z.loadConnections(k);for(const V of W)yield V.record.delete(),yield V.record.send(z.identity.did),z.connections.update(Z=>[...Z.filter(q=>q.id!==V.id)])})()}block(k){var z=this;return(0,i.A)(function*(){if(console.log("BLOCKS THIS DID:",k),!k)return;const W={did:k};console.log("Delete all Requests and Connections before updating block list."),yield z.deleteRequests(k),yield z.deleteConnections(k);let V=z.blocks().find(Z=>Z.data.did==k);if(!V){const{records:Z}=yield z.identity.web5.dwn.records.query({message:{filter:{recipient:k,protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema,dataFormat:B.Q.types.block.dataFormats[0]},dateSort:m.U0.CreatedAscending}});let q;if(0==Z.length){const{record:re}=yield z.identity.web5.dwn.records.create({data:{did:k},message:{protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema,dataFormat:B.Q.types.block.dataFormats[0]}});q=re}else q=Z[0];V={record:q,data:W,id:q.id},z.blocks.update(re=>[...re,V])}return console.log("The Block record",V),V})()}loadRequests(k){var z=this;return(0,i.A)(function*(){const W=[],Z={from:z.identity.did,message:{filter:{author:k||void 0,protocol:B.Q.protocol,protocolPath:"request",schema:B.Q.types.request.schema},dateSort:m.U0.CreatedAscending}};console.log("IDENTITY: ",z.identity),console.log("LOAD REQUESTS:",Z);const{records:q}=yield z.identity.web5.dwn.records.query(Z);for(let re of q){if(z.blocked(re.creator)){re.delete(),re.send(z.identity.did),re.send(re.creator);continue}const te=yield re.data.json();let ie={record:re,data:te,id:re.id};re.creator==z.identity.did&&(ie.direction="out"),W.push(ie)}return console.log("REQUESTS: ",W),W})()}blocked(k){return void 0!==this.blocks().find(z=>z.data.did==k)}loadConnections(k){var z=this;return(0,i.A)(function*(){const W=[],V={recipient:k||void 0,protocol:B.Q.protocol,protocolPath:"connection",schema:B.Q.types.connection.schema},{records:Z}=yield z.identity.web5.dwn.records.query({message:{filter:V,dateSort:m.U0.CreatedDescending}});for(let q of Z){const re=yield q.data.json();W.push({record:q,data:re,id:q.id})}return W})()}loadBlocks(){var k=this;return(0,i.A)(function*(){const z=[],{records:W}=yield k.identity.web5.dwn.records.query({message:{filter:{protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema},dateSort:m.U0.CreatedAscending}});for(let V of W){const Z=yield V.data.json();z.push({record:V,data:Z,id:V.id})}return z})()}static{this.\u0275fac=function(z){return new(z||j)}}static{this.\u0275prov=a.jDH({token:j,factory:j.\u0275fac,providedIn:"root"})}}return j})()},20180:(Me,F,f)=>{"use strict";f.d(F,{j:()=>je});var i=f(10467),a=f(42512);function S(Ne,...ot){if(!function m(Ne){return Ne instanceof Uint8Array||null!=Ne&&"object"==typeof Ne&&"Uint8Array"===Ne.constructor.name}(Ne))throw new Error("Uint8Array expected");if(ot.length>0&&!ot.includes(Ne.length))throw new Error(`Uint8Array expected of length ${ot}, not of length=${Ne.length}`)}function E(Ne,ot=!0){if(Ne.destroyed)throw new Error("Hash instance has been destroyed");if(ot&&Ne.finished)throw new Error("Hash#digest() has already been called")}const j="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,W=Ne=>new DataView(Ne.buffer,Ne.byteOffset,Ne.byteLength),V=(Ne,ot)=>Ne<<32-ot|Ne>>>ot;function O(Ne){return"string"==typeof Ne&&(Ne=function I(Ne){if("string"!=typeof Ne)throw new Error("utf8ToBytes expected string, got "+typeof Ne);return new Uint8Array((new TextEncoder).encode(Ne))}(Ne)),S(Ne),Ne}new Uint8Array(new Uint32Array([287454020]).buffer);class H{clone(){return this._cloneInto()}}function p(Ne){const ot=wt=>Ne().update(O(wt)).digest(),Ft=Ne();return ot.outputLen=Ft.outputLen,ot.blockLen=Ft.blockLen,ot.create=()=>Ne(),ot}const Ae=(Ne,ot,Ft)=>Ne&ot^~Ne&Ft,Ie=(Ne,ot,Ft)=>Ne&ot^Ne&Ft^ot&Ft;class Le extends H{constructor(ot,Ft,wt,zt){super(),this.blockLen=ot,this.outputLen=Ft,this.padOffset=wt,this.isLE=zt,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(ot),this.view=W(this.buffer)}update(ot){E(this);const{view:Ft,buffer:wt,blockLen:zt}=this,rr=(ot=O(ot)).length;for(let ar=0;arzt-ar&&(this.process(wt,0),ar=0);for(let Tr=ar;Tr>zt&rr),lr=Number(Ft&rr),Wr=wt?0:4;Ne.setUint32(ot+(wt?4:0),ar,wt),Ne.setUint32(ot+Wr,lr,wt)})(wt,zt-8,BigInt(8*this.length),rr),this.process(wt,0);const lr=W(ot),hn=this.outputLen;if(hn%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const Wr=hn/4,vr=this.get();if(Wr>vr.length)throw new Error("_sha2: outputLen bigger than state");for(let Tr=0;Tr>>3,Dt=V(lt,17)^V(lt,19)^lt>>>10;Xe[Tr]=Dt+Xe[Tr-7]+Pt+Xe[Tr-16]|0}let{A:wt,B:zt,C:rr,D:ar,E:lr,F:hn,G:Wr,H:vr}=this;for(let Tr=0;Tr<64;Tr++){const lt=vr+(V(lr,6)^V(lr,11)^V(lr,25))+Ae(lr,hn,Wr)+xe[Tr]+Xe[Tr]|0,Dt=(V(wt,2)^V(wt,13)^V(wt,22))+Ie(wt,zt,rr)|0;vr=Wr,Wr=hn,hn=lr,lr=ar+lt|0,ar=rr,rr=zt,zt=wt,wt=lt+Dt|0}wt=wt+this.A|0,zt=zt+this.B|0,rr=rr+this.C|0,ar=ar+this.D|0,lr=lr+this.E|0,hn=hn+this.F|0,Wr=Wr+this.G|0,vr=vr+this.H|0,this.set(wt,zt,rr,ar,lr,hn,Wr,vr)}roundClean(){Xe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Se=p(()=>new Te);var ve=f(53813);function nt(Ne,ot=128){if(function x(Ne){if(!Number.isSafeInteger(Ne)||Ne<0)throw new Error(`positive integer expected, not ${Ne}`)}(ot),ot%32!=0||ot>256)throw new TypeError("Invalid entropy");return function ze(Ne,ot){return function $e(Ne){S(Ne,16,20,24,28,32)}(Ne),function Tt(Ne){if(!Array.isArray(Ne)||2048!==Ne.length||"string"!=typeof Ne[0])throw new Error("Wordlist: expected array of 2048 strings");return Ne.forEach(ot=>{if("string"!=typeof ot)throw new Error(`Wordlist: non-string element: ${ot}`)}),ve.Wp.chain(ve.Wp.checksum(1,Qe),ve.Wp.radix2(11,!0),ve.Wp.alphabet(Ne))}(ot).encode(Ne).join((Ne=>"\u3042\u3044\u3053\u304f\u3057\u3093"===Ne[0])(ot)?"\u3000":" ")}(function oe(Ne=32){if(j&&"function"==typeof j.getRandomValues)return j.getRandomValues(new Uint8Array(Ne));if(j&&"function"==typeof j.randomBytes)return j.randomBytes(Ne);throw new Error("crypto.getRandomValues must be defined")}(ot/8),Ne)}const Qe=Ne=>{const ot=8-Ne.length/4;return new Uint8Array([Se(Ne)[0]>>ot<{class Ne{constructor(){}createPassword(Ft=6,wt=128){return(0,i.A)(function*(){try{const zt=nt(he,wt).split(" "),rr=[];for(let ar=0;ar{"use strict";f.d(F,{U:()=>S});var i=f(10467),a=f(54438),x=f(68530),B=f(62060),m=f(50963);let S=(()=>{class g{#n=(0,a.vPA)(null);get connectionProtocol(){return this.#n}#s=(0,a.vPA)(null);get chatProtocol(){return this.#s}#l=(0,a.vPA)(null);get taskProtocol(){return this.#l}constructor(){}initialize(R){var M=this;return(0,i.A)(function*(){console.log("Event Service initializing..."),yield R.web5.dwn.records.subscribe({message:{filter:{protocol:x.Q.protocol}},subscriptionHandler:z=>{setTimeout(()=>{M.#n.set(z),console.log("!!!! Received local for connection:",z)},1e3)}}),yield R.web5.dwn.records.subscribe({message:{filter:{protocol:B.Q.protocol}},subscriptionHandler:z=>{setTimeout(()=>{M.#s.set(z),console.log("!!!! Received local for chat:",z)},1e3)}}),yield R.web5.dwn.records.subscribe({message:{filter:{protocol:m.Q.protocol}},subscriptionHandler:z=>{setTimeout(()=>{M.#l.set(z),console.log("!!!! Received local for task:",z)},1e3)}}),console.log("Event Service initialized.")})()}static{this.\u0275fac=function(M){return new(M||g)}}static{this.\u0275prov=a.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}}return g})()},1005:(Me,F,f)=>{"use strict";f.d(F,{G:()=>B});var i=f(10467),a=f(54438),x=f(21626);let B=(()=>{class m{constructor(g){this.http=g,this.timestamp=null}load(){var g=this;return(0,i.A)(function*(){const E=yield fetch("/ngsw.json");if(E.ok){const R=yield E.json();console.log("DATA FROM HASH",R),g.timestamp=R.timestamp}})()}getTimestamp(){return this.timestamp}static{this.\u0275fac=function(E){return new(E||m)(a.KVO(x.Qq))}}static{this.\u0275prov=a.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},34635:(Me,F,f)=>{"use strict";f.d(F,{K:()=>M});var i=f(10467),a=f(54438),x=f(25246),B=f(80785),m=f(20180),S=f(77494),g=f(80428),E=f(4080),R=f(12621);let M=(()=>{class _{constructor(P){this.cryptoService=P,this.syncInterval="15s",this.agents=(0,a.vPA)([]),this.identities=[],this.accounts={},this.crypto=(0,a.WQX)(m.j),this.activeAccount=(0,a.vPA)(void 0),this.activeIdentity=(0,a.vPA)(void 0),this.preinitialized=(0,a.vPA)(!1),this.initialized=(0,a.vPA)(!1),this.locked=(0,a.vPA)(!0)}initialConnect(P){var k=this;return(0,i.A)(function*(){try{console.log("Connecting to Web5...");const z=yield x.uW.connect({password:P,sync:k.syncInterval});return k.did=z.did,k.web5=z.web5,k.agent=z.web5.agent,console.log("Web5 Connected.",k.did),k.preinitialized.set(!0),k.initialized.set(!0),z}catch(z){console.error(z)}})()}get identity(){return this.identities.find(P=>P.metadata.uri===this.did)}connectWithIdentity(P){var k=this;return(0,i.A)(function*(){const z=yield k.crypto.createPassword();console.log("Password created");const W=new S.TX({keyDerivationWorkFactor:21e4,store:new E.cG({location:"DATA/AGENT/VAULT_STORE"})});let V;const Z=new S.Bq({didMethods:[B.ES,B.E6,R.hX],resolverCache:new S.Td({location:"DATA/AGENT/DID_RESOLVERCACHE"}),store:new S.QZ});k.store=new S.dk;const q=new S.yc({store:k.store});k.identityApi=q,console.log("Creating user agent...");const re=yield g.s.create({didApi:Z,identityApi:q,agentVault:W}),ie=yield re.firstLaunch();console.log("FIRST LAUNCH???",ie),ie&&(V=yield re.initialize({password:z,recoveryPhrase:V,dwnEndpoints:["https://dwn.tbddev.org/beta"]}),console.log("USER AGENT RECOVERY PHRASE:",V)),yield re.start({password:z});const ae=yield re.identity.import({portableIdentity:P});console.log("IDENTITY MADE IN IMPORT:",ae),yield re.sync.registerIdentity({did:ae.did.uri});const me=new x.uW({agent:re,connectedDid:ae.did.uri});return console.log("WEB5:",me),{password:z,agentDid:me.agent.agentDid.uri,did:ae.did.uri,recoveryPhrase:V,web5:me}})()}connect(P,k){var z=this;return(0,i.A)(function*(){try{console.log("Connecting to Web5...");const W=yield x.uW.connect({connectedDid:P,password:k,sync:z.syncInterval});return z.accounts[P]=W.web5,W.did!=P&&console.error("Connected DID does not match the result DID:",P,W.did),z.did=W.did,z.web5=W.web5,z.agent=W.web5.agent,console.log("Web5 Connected."),z.preinitialized.set(!0),z.initialized.set(!0),z.loadAccounts(k),W}catch(W){console.error("Failed to initialize web5:",W),alert("Failed to initialize Web5:"+W)}})()}changeAccount(P){var k=this;return(0,i.A)(function*(){const z=k.accounts[P];console.log("Changing to this Account:",z),z&&(k.web5=z,k.agent=z.agent,k.did=P,k.activeAccount.set(k.web5))})()}loadAccounts(P){var k=this;return(0,i.A)(function*(){k.identities=yield k.agent.identity.list();for(const z of k.identities){const W=z?.metadata?.uri;yield k.registerAccount(W,P)}})()}registerEndpoints(P,k,z=[]){return(0,i.A)(function*(){try{for(const W of z){const V=yield P.rpc.getServerInfo(W);console.log("SERVER INFO: ",V),0!==V.registrationRequirements.length?(yield S.Vu.registerTenant(W,P.agentDid.uri),yield S.Vu.registerTenant(W,k.did.uri)):console.log("No registration requirements")}}catch(W){console.error("Failed to register DWN endpoints",W)}})()}registerAccount(P,k){var z=this;return(0,i.A)(function*(){const{web5:W}=yield x.uW.connect({connectedDid:P,password:k,sync:z.syncInterval});return z.accounts[P]=W,W})()}activeAgent(){return this.web5.agent}changePassword(P,k){var z=this;return(0,i.A)(function*(){yield z.web5.agent.vault.changePassword({oldPassword:P,newPassword:k})})()}lock(){var P=this;return(0,i.A)(function*(){console.log("Locking account..."),yield P.web5.agent.vault.lock(),console.log("Vault locked"),P.locked.set(!0),P.initialized.set(!1)})()}unlock(P,k){var z=this;return(0,i.A)(function*(){try{console.log("Connecting to Web5...");const{did:W,web5:V}=yield x.uW.connect({connectedDid:P,sync:z.syncInterval,password:k});return z.did=W,z.web5=V,P!=W&&console.error("Connected DID does not match the result DID:",W,P),console.log("UNLOCK WAS CALLED!!"),z.initialized.set(!0),z.locked.set(!1),!0}catch(W){return console.error(W),console.log("Show unlock screen!"),z.locked.set(!0),!1}})()}static{this.\u0275fac=function(k){return new(k||_)(a.KVO(m.j))}}static{this.\u0275prov=a.jDH({token:_,factory:_.\u0275fac,providedIn:"root"})}}return _})()},36815:(Me,F,f)=>{"use strict";f.d(F,{Y:()=>B});var i=f(99327),a=f(54438),x=f(30046);let B=(()=>{class m{constructor(){this.search=(0,a.vPA)(!1),this.searchInput="",this.scrolling=(0,a.vPA)(!0),this.tray=(0,a.vPA)(!1),this.navigation=(0,a.vPA)(!1),this.margin=(0,a.vPA)(!0),this.custom=(0,a.vPA)(!1),this.actions=(0,a.vPA)([]),this.breakpointObserver=(0,a.WQX)(i.QP),this.router=(0,a.WQX)(x.Ix),this.small=(0,a.vPA)(!1),this.tiny=(0,a.vPA)(!1),this.router.events.subscribe(R=>{R instanceof x.Z?this.enableScrolling():R instanceof x.wF&&(this.scrollToTop(),this.countChar("/",R.url)>1?this.enableNavigation():this.disableNavigation())}),this.breakpointObserver.observe(["(max-width: 959.98px)"]).subscribe(R=>{this.small.set(!!R.matches)}),this.breakpointObserver.observe(["(max-width: 600px)"]).subscribe(R=>{this.tiny.set(!!R.matches)}),(0,a.QZP)(()=>{const R=document.querySelector(".sidenav-scroll-wrapper");R&&(R.style.overflow=this.scrolling()?"auto":"hidden");const M=document.getElementById("sidenav-content");M&&(M.style.overflow=this.scrolling()?"auto":"hidden")})}countChar(g,E){return E.split(g).length-1}ngAfterContentInit(){}toggleSearch(){this.search.set(!this.search()),this.searchInput=""}setActions(g){this.actions.set(g)}addAction(g){this.actions.update(E=>[...E,g])}customOff(){this.custom.set(!1)}customOn(){this.custom.set(!0)}marginOff(){this.margin.set(!1)}marginOn(){this.margin.set(!0)}resetActions(){this.actions.set([])}enableScrolling(){this.scrolling.set(!0)}scrollToTop(){const g=document.querySelector(".sidenav-content");g&&(g.scrollTop=0)}disableScrolling(){this.scrolling.set(!1)}enableNavigation(){this.navigation.set(!0)}disableNavigation(){this.navigation.set(!1)}static{this.\u0275fac=function(E){return new(E||m)}}static{this.\u0275prov=a.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},31948:(Me,F,f)=>{"use strict";f.d(F,{s:()=>x});var i=f(54438),a=f(36815);let x=(()=>{class B{constructor(){this.prefix="ariton-",this.layout=(0,i.WQX)(a.Y),this.layout.resetActions()}save(S,g){localStorage.setItem(this.prefix+S,JSON.stringify(g))}read(S){const g=localStorage.getItem(this.prefix+S);return g?JSON.parse(g):null}remove(S){localStorage.removeItem(this.prefix+S)}clear(){Object.keys(localStorage).forEach(S=>{S.startsWith(this.prefix)&&localStorage.removeItem(S)})}static{this.\u0275fac=function(g){return new(g||B)}}static{this.\u0275prov=i.jDH({token:B,factory:B.\u0275fac,providedIn:"root"})}}return B})()},55619:(Me,F,f)=>{"use strict";f.d(F,{o:()=>B});var i=f(30046),a=f(54438),x=f(60177);let B=(()=>{class m{constructor(g,E){this.router=g,this.location=E,this.history=[],this.router.events.subscribe(R=>{R instanceof i.wF&&this.history.push(R.urlAfterRedirects),R instanceof i.OY&&console.log("SCROLL EVENT",R)})}back(){this.history.pop(),this.history.length>0?this.location.back():this.router.navigateByUrl("/")}static{this.\u0275fac=function(E){return new(E||m)(a.KVO(i.Ix),a.KVO(x.aZ))}}static{this.\u0275prov=a.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},82546:(Me,F,f)=>{"use strict";f.d(F,{J:()=>S});var i=f(10467),a=f(54438),x=f(34635),B=f(5397),m=f(77494);let S=(()=>{class g{constructor(){this.identity=(0,a.WQX)(x.K)}create(R){var M=this;return(0,i.A)(function*(){const _=R,{record:j,status:P}=yield M.identity.web5.dwn.records.create({data:_,message:{protocol:B.Q.protocol,protocolPath:"event",schema:B.Q.types.event.schema,dataFormat:B.Q.types.event.dataFormats[0]}});return console.log("Notification created:",P,j),{record:j,data:_,id:j.id}})()}load(){var R=this;return(0,i.A)(function*(){const M=[],{records:_}=yield R.identity.web5.dwn.records.query({message:{filter:{protocol:B.Q.protocol,schema:B.Q.types.event.schema},dateSort:m.U0.CreatedAscending}});for(let j of _){const P=yield j.data.json();M.push({record:j,data:P,id:j.id})}return M})()}static{this.\u0275fac=function(M){return new(M||g)}}static{this.\u0275prov=a.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}}return g})()},63528:(Me,F,f)=>{"use strict";f.d(F,{x:()=>x});var i=f(10467),a=f(54438);let x=(()=>{class B{constructor(){this.title=(0,a.vPA)(""),this.timeUpdateEvent=new a.bkB,this.init()}init(){var S=this;navigator.mediaSession.setActionHandler("play",(0,i.A)(function*(){try{S.audio&&(yield S.audio.play())}catch(g){console.error(g.name,g.message)}})),navigator.mediaSession.setActionHandler("pause",()=>{this.audio&&this.audio.pause()})}previous(){}next(){}onTimeUpdate(S){this.timeUpdateEvent.subscribe(S)}createAudio(S){return this.audio||(this.audio=new Audio(S),this.audio.addEventListener("timeupdate",()=>{this.audio&&this.timeUpdateEvent.emit(this.audio.currentTime)})),this.audio}play(){var S=this;return(0,i.A)(function*(){const g="https://magazine.ariton.app/assets/creative-technology-showreel-241274.mp3";S.setTitle(g),S.audio||(S.audio=S.createAudio(g)),yield S.audio.play()})()}setTitle(S){const E=new URL(S).pathname,R=E.substring(E.lastIndexOf("/")+1);this.title=(0,a.vPA)(R),navigator.mediaSession.metadata=new MediaMetadata({title:R,artist:R,album:"Ariton",artwork:[{src:R}]}),navigator.mediaSession.playbackState="playing"}pause(){this.audio&&this.audio.pause(),navigator.mediaSession.playbackState="paused"}get paused(){return!this.audio||this.audio.paused}get time(){return this.audio?Math.floor(this.audio.currentTime):10}set time(S){this.audio&&(this.audio.currentTime=S)}get duration(){return this.audio?Math.floor(this.audio.duration):100}rate(){this.audio&&(console.log(this.audio.playbackRate),this.audio.playbackRate=2==this.audio.playbackRate?1:2)}static{this.\u0275fac=function(g){return new(g||B)}}static{this.\u0275prov=a.jDH({token:B,factory:B.\u0275fac,providedIn:"root"})}}return B})()},5794:(Me,F,f)=>{"use strict";f.d(F,{p:()=>E});var i=f(10467),a=f(54438),x=f(34635),B=f(22312);class m{constructor(){this.data={}}save(M,_,j){const P=j?Date.now()+j:1/0;this.data[M]={value:_,expiration:P}}read(M){const _=this.data[M];return _?_.expiration{class R{constructor(){var _=this;this.identity=(0,a.WQX)(x.K),this.connection=(0,a.WQX)(g.K),this.current=(0,a.vPA)({did:"",name:"",title:"",bio:"",profileImage:"",profileBanner:"",status:"",location:"",links:[],birthDate:""}),this.selected=(0,a.vPA)({did:"",name:"",title:"",bio:"",profileImage:"",profileBanner:"",status:"",location:"",links:[],birthDate:""}),this.avatar=(0,a.vPA)(null),this.avatarSelected=(0,a.vPA)(null),this.cache=new m,(0,a.QZP)((0,i.A)(function*(){_.identity.initialized()&&_.identity.activeIdentity()&&(console.log("Active account found, loading profile...",_.identity.did),_.openCurrentUserProfile(_.identity.did))}))}loadProfile(_){var j=this;return(0,i.A)(function*(){let P=j.cache.read(_);if(P)return P;const k=yield j.identity.web5.dwn.records.query({message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"profile",dataFormat:"application/json"}}});let z={};k.records&&k.records.length>0?(console.log(`Found local copy of profile. Only picking the first one of ${k.records.length} found.`),z={profile:yield k.records[0].data.json(),record:k.records[0]},j.loadProfileRemote(_)):z=yield j.loadProfileRemote(_);const W=yield j.loadAvatar(_),V=!!j.connection.friends().find(Z=>Z.data.did==_);return P={record:z.record,avatarRecord:W.avatarRecord,avatar:W.avatar,profile:z.profile,did:_,friend:V},j.cache.save(_,P,S.PROFILE),P})()}loadAvatar(_){var j=this;return(0,i.A)(function*(){var P=null,k=null;const z=yield j.identity.web5.dwn.records.query({message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"avatar",dataFormat:"image/jpeg"}}});if(z.records&&z.records.length>0){console.log(`Found avatar for user. Selecting the first of ${z.records.length} found.`);const W=z.records[0];k=yield W.data.text();let Z=j.cache.read(_);Z&&(Z.avatarRecord=W,Z.avatar=k),j.loadAvatarRemote(_)}else{const W=yield j.loadAvatarRemote(_);k=W.avatar,P=W.avatarRecord}return{avatar:k,avatarRecord:P}})()}loadAvatarRemote(_){var j=this;return(0,i.A)(function*(){var P=null,k=null;const z=yield j.identity.web5.dwn.records.query({from:_,message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"avatar",dataFormat:"image/jpeg"}}});if(z.records&&z.records.length>0){const W=z.records[0];W.import(),P=W,k=yield W.data.text();let Z=j.cache.read(_);Z&&(Z.avatar=k,Z.avatarRecord=P)}return{avatar:k,avatarRecord:P}})()}loadProfileRemote(_){var j=this;return(0,i.A)(function*(){console.log("Loading remote profile:",_);const P=yield j.identity.web5.dwn.records.query({from:_,message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"profile",dataFormat:"application/json"}}});let k={},z=null;if(P.records&&P.records.length>0){console.log(`Found a profile remotely. Selecting the first of ${P.records.length} found. Importing it to local DWN.`),z=P.records[0];let W=yield z.data.json();k={profile:W,record:z};let V=j.cache.read(_);V&&(V.profile=W,V.record=z),z.import()}else console.log(`No profile found for user. Returning empty result for ${_}`);return k})()}openCurrentUserProfile(_){var j=this;return(0,i.A)(function*(){console.log("Open current user profile",_);const P=yield j.loadProfile(_);j.avatar.set(P.avatar),j.current.set(P.profile)})()}openProfile(_){var j=this;return(0,i.A)(function*(){console.log("Open profile",_);const P=yield j.loadProfile(_);j.avatarSelected.set(P.avatar),j.selected.set(P.profile),_==j.identity.did&&(j.avatar.set(P.avatar),j.current.set(P.profile))})()}static{this.\u0275fac=function(j){return new(j||R)}}static{this.\u0275prov=a.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}}return R})()},88020:(Me,F,f)=>{"use strict";f.d(F,{w:()=>ye});var i=f(10467),a=f(54438),x=f(4053),B=f(77949),m=f(45189),S=f(49245),g=f(62060),E=f(67136),R=f(1639),M=f(69371),_=f(2685),j=f(69314),P=f(97372),k=f(70669),z=f(50963),W=f(68530),V=f(5397),Z=f(29508),q=f(32794);const re={protocol:"https://vc-to-dwn.tbddev.org/vc-protocol",published:!0,types:{credential:{schema:"https://vc-to-dwn.tbddev.org/vc-protocol/schema/credential",dataFormats:["application/vc+jwt"]},issuer:{schema:"https://vc-to-dwn.tbddev.org/vc-protocol/schema/issuer",dataFormats:["text/plain"]},judge:{schema:"https://vc-to-dwn.tbddev.org/vc-protocol/schema/judge",dataFormats:["text/plain"]}},structure:{issuer:{$role:!0},judge:{$role:!0},credential:{$actions:[{role:"issuer",can:["create"]},{role:"judge",can:["query","read","subscribe"]}]}}},te={published:!0,protocol:"https://schema.ariton.app/name",types:{name:{dataFormats:["application/json"]},admin:{schema:"https://schema.ariton.app/name/admin",dataFormats:["application/json"]}},structure:{name:{admin:{$role:!0},$actions:[{role:"name/admin",can:["create","read","update","query","subscribe","co-update","co-delete"]}]}}};var ie=f(34635),ae=f(95416),me=f(59564);let ye=(()=>{class ue{constructor(){this.identityService=(0,a.WQX)(ie.K),this.admin=(0,a.WQX)(me.z),this.snackBar=(0,a.WQX)(ae.UG)}register(o){var h=this;return(0,i.A)(function*(){let A=[j.Q,x.Q,B.Q,m.Q,S.Q,g.Q,E.Q,R.Q,M.Q,_.Q,P.Q,k.Q,z.Q,W.Q,V.Q,Z.Q,q.Q,re];h.admin.isOwner(h.identityService.did)&&(A=[...A,te]),h.admin.isAdmin(h.identityService.did)&&(A=[...A]);for(const I of A){const{protocol:O,status:$}=yield o.dwn.protocols.configure({message:{definition:I}});202!==$.code&&(console.error("Failed to install protocol:",$,O),h.snackBar.open(`Failed to install protocol. Code: ${$.code}, Protocol: ${I.protocol}`,"Close",{duration:1e3})),yield O?.send(h.identityService.did)}console.log("Protocols installed.")})()}static{this.\u0275fac=function(h){return new(h||ue)}}static{this.\u0275prov=a.jDH({token:ue,factory:ue.\u0275fac,providedIn:"root"})}}return ue})()},51889:(Me,F,f)=>{"use strict";f.d(F,{k:()=>R});var i=f(54438),a=f(89417),x=f(88834),B=f(65571),m=f(75351),S=f(99213),g=f(68314),E=f(26703);let R=(()=>{class M{constructor(j){this.data=j,this.qrStyle="did",this.qrValue="",this.util=(0,i.WQX)(E.Q)}ngAfterViewInit(){this.generateQR(this.data.did)}copyValue(){this.util.copyToClipboard(this.qrValue)}generateQR(j){this.qrValue=j;const P=document.querySelector("canvas");g.mo(P,j,{width:256},k=>{k&&console.error("Error generating QR code: ",k)})}onToggleGroupChange(j){this.generateQR("profile"==this.qrStyle?`https://profile.ariton.app/?did=${this.data.did}`:this.data.did)}static{this.\u0275fac=function(P){return new(P||M)(i.rXU(m.Vh))}}static{this.\u0275cmp=i.VBU({type:M,selectors:[["app-qrcode-dialog"]],standalone:!0,features:[i.aNF],decls:19,vars:3,consts:[["qrCanvas",""],["mat-dialog-title",""],[1,"qr-code-content","centered-dialog-content"],["hideSingleSelectionIndicator","true",3,"ngModelChange","change","ngModel"],["value","did"],["value","profile"],[1,"wrap"],["matTooltip","Copy the identifier","mat-icon-button","",1,"copy-button",3,"click"],["align","end"],["mat-button","","cdkFocusInitial","",3,"mat-dialog-close"]],template:function(P,k){if(1&P){const z=i.RV6();i.j41(0,"h2",1),i.EFF(1,"QR Code"),i.k0s(),i.j41(2,"mat-dialog-content",2),i.nrm(3,"canvas",null,0)(5,"br"),i.j41(6,"mat-button-toggle-group",3),i.mxI("ngModelChange",function(V){return i.eBV(z),i.DH7(k.qrStyle,V)||(k.qrStyle=V),i.Njj(V)}),i.bIt("change",function(V){return i.eBV(z),i.Njj(k.onToggleGroupChange(V))}),i.j41(7,"mat-button-toggle",4),i.EFF(8,"Identifier (in-app)"),i.k0s(),i.j41(9,"mat-button-toggle",5),i.EFF(10,"Profile URL (camera)"),i.k0s()(),i.j41(11,"p",6),i.EFF(12),i.j41(13,"button",7),i.bIt("click",function(){return i.eBV(z),i.Njj(k.copyValue())}),i.j41(14,"mat-icon"),i.EFF(15,"content_copy"),i.k0s()()()(),i.j41(16,"mat-dialog-actions",8)(17,"button",9),i.EFF(18,"Close"),i.k0s()()}2&P&&(i.R7$(6),i.R50("ngModel",k.qrStyle),i.R7$(6),i.SpI(" ",k.qrValue," "),i.R7$(5),i.Y8G("mat-dialog-close",!0))},dependencies:[m.hM,m.tx,m.BI,m.E7,m.Yi,x.Hl,x.$z,x.iY,B.Vg,B.ec,B.pc,a.YN,a.BC,a.vS,S.m_,S.An],styles:[".qr-code-content[_ngcontent-%COMP%]{margin:0;padding:2em}"]})}}return M})()},98703:(Me,F,f)=>{"use strict";f.d(F,{g:()=>a});var i=f(54438);let a=(()=>{class x{transform(m,S){if(m){const g=Math.floor((+new Date-+new Date(m))/1e3);if(g<29)return"Just now";const E={year:31536e3,month:2592e3,week:604800,day:86400,hour:3600,minute:60,second:1};let R;for(const M in E)if(R=Math.floor(g/E[M]),R>0)return 1===R?R+" "+M+" ago":R+" "+M+"s ago"}return m}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"ago",type:x,pure:!0,standalone:!0})}}return x})()},33347:(Me,F,f)=>{"use strict";f.d(F,{k:()=>a});var i=f(54438);let a=(()=>{class x{transform(m,S){if(m){const g=m.lastIndexOf(":");if(-1!==g){const E=m.slice(0,g+1),R=m.slice(g+1);return E+R.slice(0,5)+"..."+R.slice(-5)}return m.slice(0,5)+"..."+m.slice(-5)}return m}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"did",type:x,pure:!0,standalone:!0})}}return x})()},78013:(Me,F,f)=>{"use strict";f.d(F,{d:()=>x});var i=f(54438),a=f(345);let x=(()=>{class B{constructor(S){this.sanitizer=S}transform(S){return this.sanitizer.bypassSecurityTrustResourceUrl(S)}static{this.\u0275fac=function(g){return new(g||B)(i.rXU(a.up,16))}}static{this.\u0275pipe=i.EJ8({name:"safeResourceUrl",type:B,pure:!0,standalone:!0})}}return B})()},28741:(Me,F,f)=>{"use strict";f.d(F,{M:()=>a});var i=f(54438);let a=(()=>{class x{transform(m,S){if(null==m)return"";if(0===m)return"0 Bytes";const R=Math.floor(Math.log(m)/Math.log(1024));return parseFloat((m/Math.pow(1024,R)).toFixed(2))+" "+["Bytes","KB","MB","GB","TB","PB"][R]}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"size",type:x,pure:!0,standalone:!0})}}return x})()},43794:(Me,F,f)=>{"use strict";f.d(F,{n:()=>B});var i=f(10467),a=f(54438),x=f(34635);let B=(()=>{class m{constructor(){this.identity=(0,a.WQX)(x.K)}save(g,E,R,M=!1){var _=this;return(0,i.A)(function*(){const{record:j,status:P}=yield _.identity.web5.dwn.records.create({data:E,message:{published:M,tags:R,protocol:g.protocol,protocolPath:g.protocolPath,schema:g.schema,dataFormat:g.dataFormat}});if(202!==P.code)throw new Error(`Failed to save data (${P.code}): ${P.detail}`);return{data:E,id:j.id,record:j}})()}load(g,E){var R=this;return(0,i.A)(function*(){var{records:M}=yield R.identity.web5.dwn.records.query({message:{filter:{tags:E,protocol:g.protocol,schema:g.schema,dataFormat:g.dataFormat}}});if(!M||0===M.length)return[];const _=[];for(const j of M){let P=yield j.data.json();_.push({record:j,data:P,id:j.id})}return _})()}get(g){var E=this;return(0,i.A)(function*(){var{record:R,status:M}=yield E.identity.web5.dwn.records.read({message:{filter:{recordId:g}}});if(200!==M.code)throw new Error(`Failed to get data (${M.code}): ${M.detail}`);return{data:yield R.data.json(),id:R.id,record:R}})()}update(g,E,R,M=!1){return(0,i.A)(function*(){const{status:_}=yield g.update({published:M,data:E,tags:R});if(202!==_.code)throw new Error(`Failed to save data (${_.code}): ${_.detail}`);return{data:E,id:g.id,record:g}})()}delete(g){return(0,i.A)(function*(){const{status:E}=yield g.delete();if(202!==E.code)throw new Error(`Failed to delete data (${E.code}): ${E.detail}`)})()}static{this.\u0275fac=function(E){return new(E||m)}}static{this.\u0275prov=a.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},26703:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>B});var i=f(10467),a=f(54438),x=f(95416);let B=(()=>{class m{constructor(){this.snackBar=(0,a.WQX)(x.UG)}executeAsyncWithToast(g,E,R){var M=this;return(0,i.A)(function*(){try{yield g,E&&M.openSnackBar(E)}catch(_){M.openSnackBar(R||`Error: ${_}.`)}})()}openSnackBar(g){this.snackBar.open(g,void 0,{duration:2e3})}backupAccount({portableIdentity:g}={}){return(0,i.A)(function*(){if(g){const E=new Blob([JSON.stringify(g)],{type:"application/json"}),R=URL.createObjectURL(E),M=document.createElement("a");M.href=R,M.download="portableIdentity.json",document.body.appendChild(M),M.click(),document.body.removeChild(M),URL.revokeObjectURL(R)}})()}copyToClipboard(g){var E=this;return(0,i.A)(function*(){try{yield navigator.clipboard.writeText(g),E.snackBar.open("Copied to clipboard",void 0,{duration:2e3})}catch(R){console.error("Failed to copy: ",R)}})()}static{this.\u0275fac=function(E){return new(E||m)}}static{this.\u0275prov=a.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},12621:(Me,F,f)=>{"use strict";f.d(F,{hX:()=>Z});var i=f(10467),a=f(4080),x=f(42512),B=f(80785),m=f(70285),S=f(68989);const E={ed25519PublicKey:48,ed25519SecretSeed:144,med25519PublicKey:96,preAuthTx:152,sha256Hash:184,signedPayload:120,contract:16},R={G:"ed25519PublicKey",S:"ed25519SecretSeed",M:"med25519PublicKey",T:"preAuthTx",X:"sha256Hash",P:"signedPayload",C:"contract"};class M{static encodeEd25519PublicKey(te){return P("ed25519PublicKey",te)}static decodeEd25519PublicKey(te){return j("ed25519PublicKey",te)}static isValidEd25519PublicKey(te){return _("ed25519PublicKey",te)}static encodeEd25519SecretSeed(te){return P("ed25519SecretSeed",te)}static decodeEd25519SecretSeed(te){return j("ed25519SecretSeed",te)}static isValidEd25519SecretSeed(te){return _("ed25519SecretSeed",te)}static encodeMed25519PublicKey(te){return P("med25519PublicKey",te)}static decodeMed25519PublicKey(te){return j("med25519PublicKey",te)}static isValidMed25519PublicKey(te){return _("med25519PublicKey",te)}static encodePreAuthTx(te){return P("preAuthTx",te)}static decodePreAuthTx(te){return j("preAuthTx",te)}static encodeSha256Hash(te){return P("sha256Hash",te)}static decodeSha256Hash(te){return j("sha256Hash",te)}static encodeSignedPayload(te){return P("signedPayload",te)}static decodeSignedPayload(te){return j("signedPayload",te)}static isValidSignedPayload(te){return _("signedPayload",te)}static encodeContract(te){return P("contract",te)}static decodeContract(te){return j("contract",te)}static isValidContract(te){return _("contract",te)}static getVersionByteForPrefix(te){return R[te[0]]}}function _(re,te){if("string"!=typeof te)return!1;switch(re){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":if(56!==te.length)return!1;break;case"med25519PublicKey":if(69!==te.length)return!1;break;case"signedPayload":if(te.length<56||te.length>165)return!1;break;default:return!1}let ie="";try{ie=j(re,te).toString()}catch{return!1}switch(re){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":return 32===ie.length;case"med25519PublicKey":return 40===ie.length;case"signedPayload":return ie.length>=40&&ie.length<=100;default:return!1}}function j(re,te){if("string"!=typeof te)throw new TypeError("encoded argument must be of type String");const ie=S.decode(te),ae=ie[0],me=ie.slice(0,-2),ye=me.slice(1),ue=ie.slice(-2);if(te!==S.encode(ie))throw new Error("invalid encoded string");const K=E[re];if(void 0===K)throw new Error(`${re} is not a valid version byte name. Expected one of ${Object.keys(E).join(", ")}`);if(ae!==K)throw new Error(`invalid version byte. expected ${K}, got ${ae}`);if(!function g(re,te){if(re.length!==te.length)return!1;if(0===re.length)return!0;for(let ie=0;ie>8^re[me]],ie&=65535;const ae=new Uint8Array(2);return ae[0]=255&ie,ae[1]=ie>>8&255,ae}const W={Ed25519VerificationKey2020:"https://w3id.org/security/suites/ed25519-2020/v1",JsonWebKey2020:"https://w3id.org/security/suites/jws-2020/v1",X25519KeyAgreementKey2020:"https://w3id.org/security/suites/x25519-2020/v1"};let Z=(()=>{class re extends B.TI{static{this.methodName="stellar"}static create({keyManager:ie=new x.eP,options:ae={}}={}){return(0,i.A)(function*(){if(ae.algorithm&&ae.verificationMethods)throw new Error("The 'algorithm' and 'verificationMethods' options are mutually exclusive");if(ae.verificationMethods&&1!==ae.verificationMethods.length)throw new Error("The 'verificationMethods' option must contain exactly one entry");const me=ae.algorithm??ae.verificationMethods?.[0]?.algorithm??"Ed25519",ye=yield ie.generateKey({algorithm:me}),ue=yield ie.getPublicKey({keyUri:ye}),K=yield x.Mc.publicKeyToBytes({publicKey:ue}),o=M.encodeEd25519PublicKey(K),h=`did:${re.methodName}:${o}`,I=(yield re.resolve(h,ae)).didDocument;return new B.tW({uri:h,document:I,metadata:{},keyManager:ie})})()}static create2({keyManager:ie=new x.eP,options:ae={}}={}){return(0,i.A)(function*(){if(ae.algorithm&&ae.verificationMethods)throw new Error("The 'algorithm' and 'verificationMethods' options are mutually exclusive");if(ae.verificationMethods&&1!==ae.verificationMethods.length)throw new Error("The 'verificationMethods' option must contain exactly one entry");const me=ae.algorithm??ae.verificationMethods?.[0]?.algorithm??"Ed25519",ye=ie,ue=yield ie.generateKey({algorithm:me}),o=(yield ie.getPublicKey({keyUri:ue}),yield ye.exportKey({keyUri:ue}));console.log("privateKey",o);const A="GCFXHS4GXL6BVUCXBWXGTITROWLVYXQKQLF4YH5O5JT3YZXCYPAFBJZB",I=M.decodeEd25519SecretSeed("SAV76USXIJOBMEQXPANUOQM6F5LIOTLPDIDVRJBFFE2MDJXG24TAPUU7"),O=yield x.Mc.bytesToPrivateKey({privateKeyBytes:I});console.log("privateKeyJwk",O);const $=yield x.Mc.getPublicKey({key:O});console.log("publicKeyJwk",$);const H=yield x.Mc.publicKeyToBytes({publicKey:$}),D=M.encodeEd25519PublicKey(H);O.kid=D;const s=yield ye.getKeyUri({key:O});s===(yield ye.getKeyUri({key:$}))&&console.log("Yipppppi!!");const Y=yield ye.importKey({key:O});console.log("Import result: ",Y),(yield ye.exportKey({keyUri:s})).d==O.d&&console.log("Yipppppi!! PRIVATE KEY SAME!"),A==D?console.log("CORRECT!!!!"):console.warn("NO!!!!!!"),O.kid=yield(0,x.BA)({jwk:o}),O.kid=D,console.log("IDENTIFIER3: ",D),A==D?console.log("CORRECT!!!!"):console.warn("NO!!!!!!");let oe=yield q.keyConverter(o.crv).privateKeyToBytes({privateKey:o});console.log("privateKeyBytes",oe),console.log("Secret: ",M.encodeEd25519SecretSeed(oe));const de=`did:${re.methodName}:${D}`,Ie=(yield re.resolve(de,ae)).didDocument;return new B.tW({uri:de,document:Ie,metadata:{},keyManager:ie})})()}static fromPrivateKey({keyManager:ie=new x.eP,privateKey:ae}){return(0,i.A)(function*(){const me=M.decodeEd25519SecretSeed(ae),ye=yield x.Mc.bytesToPrivateKey({privateKeyBytes:me}),ue=yield ie.importKey({key:ye}),K=yield ie.getPublicKey({keyUri:ue}),o=yield x.Mc.publicKeyToBytes({publicKey:K}),h=M.encodeEd25519PublicKey(o),A=`did:${re.methodName}:${h}`,I=yield re.resolve(A,{});return console.log("didResolutionResult",I),new B.tW({uri:A,document:I.didDocument,metadata:{},keyManager:ie})})()}static getSigningMethod({didDocument:ie}){var ae=this;return(0,i.A)(function*(){const me=B.yR.parse(ie.id);if(me&&me.method!==ae.methodName)throw new B.WK(B.F8.MethodNotSupported,`Method not supported: ${me.method}`);const[ye]=ie.assertionMethod||[],ue=ie.verificationMethod?.find(K=>K.id===ye);if(!ue||!ue.publicKeyJwk)throw new B.WK(B.F8.InternalError,"A verification method intended for signing could not be determined from the DID Document");return ue})()}static import({portableDid:ie,keyManager:ae=new x.eP}){return(0,i.A)(function*(){if(B.yR.parse(ie.uri)?.method!==re.methodName)throw new B.WK(B.F8.MethodNotSupported,"Method not supported");const ye=yield B.tW.import({portableDid:ie,keyManager:ae});if(1!==ye.document.verificationMethod.length)throw new B.WK(B.F8.InvalidDidDocument,"DID document must contain exactly one verification method");return ye})()}static resolve(ie,ae){return(0,i.A)(function*(){try{const me=yield re.createDocument({didUri:ie,options:ae});return{...B.zh,didDocument:me}}catch(me){if(!(me instanceof B.WK))throw new Error(me);return{...B.zh,didResolutionMetadata:{error:me.code,...me.message&&{errorMessage:me.message}}}}})()}static createDocument({didUri:ie,options:ae={}}){return(0,i.A)(function*(){const{defaultContext:me="https://www.w3.org/ns/did/v1"}=ae,ye={id:ie},ue=B.yR.parse(ie);if(!ue)throw new B.WK(B.F8.InvalidDid,`Invalid DID URI: ${ie}`);const o=M.decodeEd25519PublicKey(ue.id),h=yield x.Mc.bytesToPublicKey({publicKeyBytes:o});if(ue.method!==re.methodName)throw new B.WK(B.F8.MethodNotSupported,`Method not supported: ${ue.method}`);if(!re.validateIdentifier(ue))throw new B.WK(B.F8.InvalidDid,`Invalid DID URI: ${ie}`);const I={id:`${ye.id}#0`,type:"JsonWebKey",controller:ye.id,publicKeyJwk:h};ye.id=ue.uri,ye.verificationMethod=[I],ye.authentication=[I.id],ye.assertionMethod=[I.id],ye.capabilityInvocation=[I.id],ye.capabilityDelegation=[I.id],ye.keyAgreement=[I.id];const O=[me];return(0,m.getVerificationMethodTypes)({didDocument:ye}).forEach(H=>{O.push(W[H])}),ye["@context"]=O,ye.service=[{id:"dwn",type:"DecentralizedWebNode",serviceEndpoint:["https://dwn.tbddev.org/beta"]}],ye})()}static deriveEncryptionKey({multibaseValue:ie}){return(0,i.A)(function*(){let ae={keyBytes:new Uint8Array,multicodecCode:0};const{keyBytes:me,multicodecCode:ye}=(0,m.multibaseIdToKeyBytes)({multibaseKeyId:ie});if(237===ye){const ue=yield q.keyConverter("Ed25519").bytesToPublicKey({publicKeyBytes:me}),K=yield x.Mc.convertPublicKeyToX25519({publicKey:ue});ae={keyBytes:yield q.keyConverter("Ed25519").publicKeyToBytes({publicKey:K}),multicodecCode:236}}return ae})()}static validateIdentifier(ie){const{method:ae,id:me}=ie,[ye]=ie.uri.split(":",1);return"did"===ye&&"stellar"===ae&&Number("1")>0&&"String"===(0,a.fc)(me)&&me.startsWith("G")}}return re})(),q=(()=>{class re{static{this.JWK_TO_MULTICODEC={"Ed25519:public":"ed25519-pub","Ed25519:private":"ed25519-priv","secp256k1:public":"secp256k1-pub","secp256k1:private":"secp256k1-priv","X25519:public":"x25519-pub","X25519:private":"x25519-priv"}}static{this.MULTICODEC_PUBLIC_KEY_LENGTH={231:33,236:32,237:32}}static{this.MULTICODEC_TO_JWK={"ed25519-pub":{crv:"Ed25519",kty:"OKP",x:""},"ed25519-priv":{crv:"Ed25519",kty:"OKP",x:"",d:""},"secp256k1-pub":{crv:"secp256k1",kty:"EC",x:"",y:""},"secp256k1-priv":{crv:"secp256k1",kty:"EC",x:"",y:"",d:""},"x25519-pub":{crv:"X25519",kty:"OKP",x:""},"x25519-priv":{crv:"X25519",kty:"OKP",x:"",d:""}}}static keyCompressor(ie){const me={"P-256":x.iH.compressPublicKey,secp256k1:x.jg.compressPublicKey}[ie];if(!me)throw new B.WK(B.F8.InvalidPublicKeyType,`Unsupported curve: ${ie}`);return me}static keyConverter(ie){const me={Ed25519:x.Mc,"P-256":x.iH,secp256k1:x.jg,X25519:x.Nx}[ie];if(!me)throw new B.WK(B.F8.InvalidPublicKeyType,`Unsupported curve: ${ie}`);return me}}return re})()},70236:(Me,F,f)=>{"use strict";var i=f(345),a=f(54438),x=f(30046),B=f(10467),m=f(96084),S=f(36815),g=f(34635),E=f(97372),R=f(60177),M=f(89417),_=f(88834),j=f(75351),P=f(99213),k=f(99631),z=f(59115),W=f(14823),V=f(53719);let Z=(()=>{class y{constructor(l,w){this.dialogRef=l,this.data=w,this.fb=(0,a.WQX)(M.ok),this.form=this.fb.group({name:[null,M.k0.required]})}ngAfterViewInit(){}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(j.CP),a.rXU(j.Vh))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-folder-dialog"]],standalone:!0,features:[a.aNF],decls:10,vars:2,consts:[["mat-dialog-title",""],["appearance","outline",1,"full-width"],["matInput","","cdkFocusInitial","","required","true","placeholder","Name","maxlength","200",3,"ngModelChange","ngModel"],["align","end"],["mat-button","","mat-dialog-close",""],["mat-flat-button","","type","submit",3,"mat-dialog-close"]],template:function(w,U){1&w&&(a.j41(0,"h2",0),a.EFF(1,"Folder name"),a.k0s(),a.j41(2,"mat-dialog-content")(3,"mat-form-field",1)(4,"input",2),a.mxI("ngModelChange",function(ce){return a.DH7(U.data.name,ce)||(U.data.name=ce),ce}),a.k0s()()(),a.j41(5,"mat-dialog-actions",3)(6,"button",4),a.EFF(7,"Cancel"),a.k0s(),a.j41(8,"button",5),a.EFF(9,"Save"),a.k0s()()),2&w&&(a.R7$(4),a.R50("ngModel",U.data.name),a.R7$(4),a.Y8G("mat-dialog-close",!0))},dependencies:[R.MD,W.uc,z.Cn,P.m_,_.Hl,_.$z,k.fS,k.fg,V.rl,j.hM,j.tx,j.BI,j.E7,j.Yi,M.YN,M.me,M.BC,M.YS,M.tU,M.vS],styles:["form[_ngcontent-%COMP%]{display:inline}"]})}}return y})();var q=f(3902),re=f(98703),te=f(5964);let ie=(()=>{class y{constructor(l,w){this.router=l,this.activatedRoute=w,this.breadcrumbs=[],this.router.events.pipe((0,te.p)(U=>U instanceof x.wF)).subscribe(()=>{this.breadcrumbs=this.createBreadcrumbs(this.activatedRoute.root)})}createBreadcrumbs(l,w="",U=[]){const J=l.children;if(0===J.length)return U;for(const ce of J){const ge=ce.snapshot.url.map(Pe=>Pe.path).join("/");return""!==ge&&(w+=`/${ge}`),U.push({label:ce.snapshot.data.breadcrumb,url:w}),this.createBreadcrumbs(ce,w,U)}return U}static{this.\u0275fac=function(w){return new(w||y)(a.KVO(x.Ix),a.KVO(x.nX))}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})(),ae=(()=>{class y{constructor(){}registerActions(l){}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();var me=f(28741),ye=f(77494),ue=f(2042),K=f(9159),o=f(25596);function h(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",19),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.up())}),a.j41(1,"mat-icon"),a.EFF(2,"arrow_upward"),a.k0s()()}}function A(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",19),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.editFolder(null))}),a.j41(1,"mat-icon"),a.EFF(2,"create_new_folder"),a.k0s()()}}function I(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",21),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.editFolder(null))}),a.j41(1,"mat-icon"),a.EFF(2,"create_new_folder"),a.k0s(),a.j41(3,"span"),a.EFF(4,"New folder"),a.k0s()()}}function O(y,c){if(1&y&&a.DNE(0,A,3,0,"button",1)(1,I,5,0,"button",20),2&y){const l=a.XpG();a.vxM(l.layout.small()?0:1)}}function $(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",22),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.editFolderById(U.parentId))}),a.j41(1,"mat-icon"),a.EFF(2,"edit"),a.k0s()(),a.j41(3,"button",22),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.deleteFolder())}),a.j41(4,"mat-icon"),a.EFF(5,"delete_forever"),a.k0s()()}}function H(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",2),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.editFolderById(U.parentId))}),a.j41(1,"mat-icon"),a.EFF(2,"edit"),a.k0s(),a.j41(3,"span"),a.EFF(4,"Rename folder"),a.k0s()(),a.j41(5,"button",2),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.deleteFolder())}),a.j41(6,"mat-icon"),a.EFF(7,"delete_forever"),a.k0s(),a.j41(8,"span"),a.EFF(9,"Delete folder"),a.k0s()()}}function D(y,c){if(1&y&&a.DNE(0,$,6,0)(1,H,10,0),2&y){const l=a.XpG();a.vxM(l.layout.small()?0:1)}}function s(y,c){1&y&&a.nrm(0,"th",23)}function p(y,c){if(1&y){const l=a.RV6();a.j41(0,"td",24),a.bIt("click",function(){const U=a.eBV(l).$implicit,J=a.XpG();return a.Njj(J.openEntry(U))}),a.j41(1,"mat-icon",25),a.EFF(2),a.k0s()()}if(2&y){const l=c.$implicit;a.R7$(2),a.JRh(l.icon)}}function Y(y,c){1&y&&(a.j41(0,"th",26),a.EFF(1,"Name"),a.k0s())}function ee(y,c){if(1&y){const l=a.RV6();a.j41(0,"td",27),a.bIt("click",function(){const U=a.eBV(l).$implicit,J=a.XpG();return a.Njj(J.openEntry(U))}),a.EFF(1),a.k0s()}if(2&y){const l=c.$implicit;a.R7$(),a.JRh(l.name)}}function oe(y,c){1&y&&(a.j41(0,"th",28),a.EFF(1," Modified "),a.k0s())}function de(y,c){if(1&y&&(a.j41(0,"td",29),a.EFF(1),a.nI1(2,"ago"),a.k0s()),2&y){const l=c.$implicit;a.R7$(),a.SpI(" ",a.bMT(2,1,l.modified)," ")}}function Ae(y,c){1&y&&(a.j41(0,"th",30),a.EFF(1,"File size"),a.k0s())}function Ie(y,c){if(1&y&&(a.j41(0,"td",31),a.EFF(1),a.nI1(2,"size"),a.k0s()),2&y){const l=c.$implicit;a.R7$(),a.JRh(a.bMT(2,1,l.size))}}function Le(y,c){1&y&&a.nrm(0,"tr",32)}function xe(y,c){1&y&&a.nrm(0,"tr",33)}class De{constructor(c){this.icon="folder"==c.tags.entryType?"folder":"note",this.name=c.tags.name,this.modified="folder"===c.tags.entryType?c.dateModified:c.tags.lastModified,this.size=c.tags.size,this.type=c.tags.type,this.entryType=c.tags.entryType,this.record=c}}let Xe=(()=>{class y{constructor(){var l=this;this.entries=(0,a.vPA)([]),this.app=(0,a.WQX)(m.d),this.breadcrumb=(0,a.WQX)(ie),this.layout=(0,a.WQX)(S.Y),this.identity=(0,a.WQX)(g.K),this.dialog=(0,a.WQX)(j.bZ),this.router=(0,a.WQX)(x.Ix),this.route=(0,a.WQX)(x.nX),this.fileService=(0,a.WQX)(ae),this.uploadProgress=null,this.isUploading=!1,this.file=null,this.uploadSuccess=!1,this.fileError=null,this.protocolPath="entry",this.hasInitialized=!1,this.folderLevel=1,this.displayedColumns=["icon","name","modified","size"],this.dataSource=new K.I6([]),this.changeDetectorRefs=(0,a.WQX)(a.gRc),this.layout.resetActions(),(0,a.QZP)((0,B.A)(function*(){if(l.app.initialized()){if(l.hasInitialized)return;const w=l.getResolvedUrl(l.route.snapshot);yield l.processUrl(w)}}),{allowSignalWrites:!0}),(0,a.QZP)((0,B.A)(function*(){l.updateTable()})),this.routingSub=this.router.events.subscribe(function(){var w=(0,B.A)(function*(U){U instanceof x.wF&&(yield l.processUrl(U.urlAfterRedirects))});return function(U){return w.apply(this,arguments)}}()),this.layout.disableNavigation(),console.log("FOLDER COMPONENT INITIALIZED")}ngAfterViewInit(){this.dataSource.sort=this.sort}updateTable(){this.dataSource.data=this.entries().map(l=>new De(l))}up(){const w=this.router.url.split("/");if(w.length>1){w.pop();const U=w.join("/");this.router.navigate([U])}}sortData(l){}announceSortChange(l){}getValueAfterFolder(l){const w=l.match(/\/folder\/(.+)/);return w?w[1]:null}generateUrl(l){const w=[];for(let U=0;UJ.url.map(ce=>ce.toString()).join("/")).join("/");const U=l.queryParamMap;return U.keys.length>0&&(w+="?"+U.keys.map(J=>U.getAll(J).map(ce=>J+"="+ce).join("&")).join("&")),w}editFile(l){return(0,B.A)(function*(){document.getElementById("input")?.click()})()}ngOnDestroy(){console.log("ON DESTROY!!!);"),this.routingSub.unsubscribe(),this.layout.resetActions()}onFileSelected(l){var w=this;return(0,B.A)(function*(){const U=l.currentTarget.files;if(0!=U.length){console.log("Uploading number of files:",U.length);for(let J=0;J[..._t,ut])}}})()}cancelUpload(){return(0,B.A)(function*(){})()}upload(){var l=this;return(0,B.A)(function*(){console.log("Uploading file");const{status:w,record:U}=yield l.identity.web5.dwn.records.create({data:l.file,message:{schema:E.Q.types.entry.schema}});return console.log("Record created:",U),console.log("Record status:",w),U})()}deleteFolder(){var l=this;return(0,B.A)(function*(){const{record:w}=yield l.identity.web5.dwn.records.read({message:{filter:{recordId:l.parentId}}});if(w){const{status:U}=yield w.delete({prune:!0});console.log("Delete status:",U);const J=l.contextId.split("/").slice(0,-1);console.log("Parent path:",J),l.router.navigate(["app","files","folder",...J])}})()}editFolderById(l){var w=this;return(0,B.A)(function*(){const{record:U}=yield w.identity.web5.dwn.records.read({message:{filter:{recordId:l}}});yield w.editFolder(U)})()}editFolder(l){var w=this;return(0,B.A)(function*(){let U={name:l?l.tags.name:"",entryType:"folder"};const J=JSON.parse(JSON.stringify(U)),ce=w.dialog.open(Z,{maxWidth:"80vw",maxHeight:"80vh",data:U});return ce.afterClosed().subscribe(function(){var ge=(0,B.A)(function*(Pe){Pe?(console.log("data result for saving:",U),yield w.saveFolder(l,U)):U=J});return function(Pe){return ge.apply(this,arguments)}}()),ce.afterClosed()})()}saveFolder(l,w){var U=this;return(0,B.A)(function*(){if(l){const J={name:w.name,entryType:w.entryType},{status:ce}=yield l.update({tags:J,data:{}});console.log("Record status:",ce)}else{const J={tags:{name:w.name,entryType:w.entryType},protocol:E.Q.protocol,protocolPath:U.protocolPath,parentContextId:U.contextId??=void 0,schema:E.Q.types.entry.schema};console.log("Create folder:",J);const{record:ce,status:ge}=yield U.identity.web5.dwn.records.create({data:{},message:J});console.log("Record created:",ce),console.log("Record status:",ge),ce&&U.entries.update(Pe=>[...Pe,ce])}})()}openEntry(l){var w=this;return(0,B.A)(function*(){console.log(l),w.router.navigate("folder"===l.entryType?["/app/files/folder/"+l.record.contextId]:["/app/files/file/"+l.record.id])})()}loadEntries(l){var w=this;return(0,B.A)(function*(){console.log("VALUE OF TAGS:",l),console.log("PARENT ID:",w.parentId),console.log("PARENT CONTEXT ID:",w.contextId);const U={filter:{protocolPath:w.protocolPath,protocol:E.Q.protocol,schema:E.Q.types.entry.schema},dateSort:ye.U0.CreatedDescending};w.parentId&&"root"!==w.parentId&&(U.filter.parentId=w.parentId),console.log(U);var{records:J}=yield w.identity.web5.dwn.records.query({message:U});w.entries.set(J??[]),console.log("All entries:",w.entries())})()}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-folder"]],viewQuery:function(w,U){if(1&w&&a.GBs(ue.B4,5),2&w){let J;a.mGM(J=a.lsd())&&(U.sort=J.first)}},standalone:!0,features:[a.aNF],decls:26,vars:6,consts:[[1,"toolbar-actions","margin-bottom"],["mat-icon-button","",1,"toolbar-icon-button"],["type","button","mat-button","",3,"click"],["type","file","id","input","multiple","",2,"display","none",3,"change"],["mat-table","","matSort","",3,"matSortChange","dataSource"],["matColumnDef","icon"],["mat-header-cell","","mat-sort-header","","class","icon-column",4,"matHeaderCellDef"],["mat-cell","","class","clickable icon-column",3,"click",4,"matCellDef"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by name",4,"matHeaderCellDef"],["mat-cell","","class","clickable",3,"click",4,"matCellDef"],["matColumnDef","modified"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by modified","class","hide-on-small-screen",4,"matHeaderCellDef"],["mat-cell","","class","hide-on-small-screen",4,"matCellDef"],["matColumnDef","size"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by file size",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-icon-button","",1,"toolbar-icon-button",3,"click"],["mat-button",""],["mat-button","",3,"click"],["type","button","mat-icon-button","",1,"toolbar-icon-button",3,"click"],["mat-header-cell","","mat-sort-header","",1,"icon-column"],["mat-cell","",1,"clickable","icon-column",3,"click"],["matListItemIcon",""],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by name"],["mat-cell","",1,"clickable",3,"click"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by modified",1,"hide-on-small-screen"],["mat-cell","",1,"hide-on-small-screen"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by file size"],["mat-cell",""],["mat-header-row",""],["mat-row",""]],template:function(w,U){1&w&&(a.j41(0,"mat-card",0)(1,"mat-card-content"),a.DNE(2,h,3,0,"button",1),a.j41(3,"button",2),a.bIt("click",function(){return U.editFile({})}),a.j41(4,"mat-icon"),a.EFF(5,"upload_file"),a.k0s(),a.j41(6,"span"),a.EFF(7,"Upload files"),a.k0s()(),a.DNE(8,O,2,1)(9,D,2,1),a.k0s()(),a.j41(10,"input",3),a.bIt("change",function(ce){return U.onFileSelected(ce)}),a.k0s(),a.j41(11,"table",4),a.bIt("matSortChange",function(ce){return U.sortData(ce)}),a.qex(12,5),a.DNE(13,s,1,0,"th",6)(14,p,3,1,"td",7),a.bVm(),a.qex(15,8),a.DNE(16,Y,2,0,"th",9)(17,ee,2,1,"td",10),a.bVm(),a.qex(18,11),a.DNE(19,oe,2,0,"th",12)(20,de,3,3,"td",13),a.bVm(),a.qex(21,14),a.DNE(22,Ae,2,0,"th",15)(23,Ie,3,3,"td",16),a.bVm(),a.DNE(24,Le,1,0,"tr",17)(25,xe,1,0,"tr",18),a.k0s()),2&w&&(a.R7$(2),a.vxM(U.folderLevel>1?2:-1),a.R7$(6),a.vxM(U.folderLevel<4?8:-1),a.R7$(),a.vxM(U.folderLevel>1?9:-1),a.R7$(2),a.Y8G("dataSource",U.dataSource),a.R7$(13),a.Y8G("matHeaderRowDef",U.displayedColumns),a.R7$(),a.Y8G("matRowDefColumns",U.displayedColumns))},dependencies:[o.Hu,o.RN,o.m2,_.Hl,_.$z,_.iY,K.tP,K.Zl,K.tL,K.ji,K.cC,K.YV,K.iL,K.KS,K.$R,K.YZ,K.NB,ue.NQ,ue.B4,ue.aE,me.M,R.MD,q.Fg,q.ZV,P.m_,P.An,re.g],styles:["table[_ngcontent-%COMP%]{width:100%}.icon-column[_ngcontent-%COMP%]{width:36px;max-width:36px;min-width:36px}@media (max-width: 600px){.hide-on-small-screen[_ngcontent-%COMP%]{display:none}}"]})}}return y})();var Te=function(y){return y.PDF="application/pdf",y.JPEG="image/jpeg",y.PNG="image/png",y.MP4="video/mp4",y.MP3="audio/mpeg",y}(Te||{});const ke=["*"],Se=y=>({transform:y});function Ee(y,c){if(1&y&&(a.j41(0,"div",1),a.nrm(1,"iframe",2),a.k0s()),2&y){const l=a.XpG();a.R7$(),a.Y8G("ngStyle",a.eq3(2,Se,"scale("+l.zoom+")"))("src",l.src,a.f$h)}}function ve(y,c){if(1&y&&a.nrm(0,"iframe",2),2&y){const l=a.XpG();a.Y8G("ngStyle",a.eq3(2,Se,"scale("+l.zoom+")"))("src",l.src,a.f$h)}}function Ce(y,c){if(1&y&&a.nrm(0,"iframe",2),2&y){const l=a.XpG();a.Y8G("ngStyle",a.eq3(2,Se,"scale("+l.zoom+")"))("src",l.src,a.f$h)}}function Re(y,c){if(1&y&&(a.j41(0,"video",3),a.nrm(1,"source",5),a.EFF(2," Your browser does not support HTML5 video. "),a.k0s()),2&y){const l=a.XpG();a.Y8G("ngStyle",a.eq3(2,Se,"scale("+l.zoom+")")),a.R7$(),a.Y8G("src",l.src,a.B4B)}}function Ye(y,c){if(1&y&&(a.j41(0,"audio",4),a.nrm(1,"source",6),a.EFF(2," Your browser does not support the audio element. "),a.k0s()),2&y){const l=a.XpG();a.Y8G("ngStyle",a.eq3(2,Se,"scale("+l.zoom+")")),a.R7$(),a.Y8G("src",l.src,a.B4B)}}function $e(y,c){1&y&&(a.j41(0,"span",null,0),a.SdG(2),a.k0s())}let nt=(()=>{class y{ngAfterViewInit(){const l=document.getElementById("frame");if(l&&l.contentDocument){const w=document.createElement("style");w.textContent="\n body {\n background-color: #f0f0f0;\n margin: 0;\n padding: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n ",l.contentDocument.head.appendChild(w)}}ngOnInit(){this.totalPages=this.getPdfTotalPages()}goToPage(){this.currentPage<1?this.currentPage=1:this.currentPage>this.totalPages&&(this.currentPage=this.totalPages)}constructor(){this.fileMimeType=Te,this.zoom=1,this.currentPage=1,this.totalPages=1,this.totalPages=this.getPdfTotalPages()}getPdfTotalPages(){return 10}goToPreviousPage(){this.currentPage>1&&this.currentPage--}goToNextPage(){this.currentPagef.e(4630).then(f.bind(f,64630)).then(y=>y.IntroductionComponent),title:"Introduction",data:{hide:!0,icon:"lightbulb"}},{path:"admin",loadComponent:()=>Promise.all([f.e(6850),f.e(4976)]).then(f.bind(f,44976)).then(y=>y.AdminComponent),title:"Admin",data:{hide:!0,icon:"dashboard"}},{path:"dashboard",loadComponent:()=>Promise.all([f.e(6195),f.e(2320)]).then(f.bind(f,62320)).then(y=>y.DashboardComponent),title:"Dashboard",data:{hide:!0,icon:"dashboard"}},{path:"communities",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(2076),f.e(6702)]).then(f.bind(f,6702)).then(y=>y.CommunitiesComponent),title:"Communities",data:{icon:"diversity_2"}},{path:"app/projects",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(8101)]).then(f.bind(f,18101)).then(y=>y.ProjectsComponent),title:"Projects",data:{hide:!0,icon:"diversity_1"}},{path:"communities/create",loadComponent:()=>Promise.all([f.e(2765),f.e(3475),f.e(2076),f.e(9847)]).then(f.bind(f,99847)).then(y=>y.CreateComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"communities/create/:id",loadComponent:()=>Promise.all([f.e(2765),f.e(3475),f.e(2076),f.e(9847)]).then(f.bind(f,99847)).then(y=>y.CreateComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"community/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(3028)]).then(f.bind(f,73028)).then(y=>y.CommunityComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"friends",loadComponent:()=>Promise.all([f.e(6850),f.e(9996),f.e(8834)]).then(f.bind(f,38834)).then(y=>y.FriendsComponent),title:"Friends",data:{hide:!0,icon:"people"}},{path:"app/friends",loadComponent:()=>Promise.all([f.e(6850),f.e(9996),f.e(8834)]).then(f.bind(f,38834)).then(y=>y.FriendsComponent),title:"Friends",data:{hide:!1,icon:"people"}},{path:"app/chat",redirectTo:"app/chat/home",pathMatch:"full"},{path:"app/chat/:id",loadComponent:()=>f.e(3446).then(f.bind(f,63446)).then(y=>y.ChatComponent),title:"Chat",data:{icon:"chat"}},{path:"app/voluntaryist-covenant",loadComponent:()=>Promise.all([f.e(6850),f.e(4885)]).then(f.bind(f,74885)).then(y=>y.VoluntaryistCovenantComponent),title:"Voluntaryist Covenant",data:{hide:!0,icon:"assured_workload"}},{path:"app/issuer",loadComponent:()=>Promise.all([f.e(6850),f.e(9461)]).then(f.bind(f,39461)).then(y=>y.IssuerComponent),title:"Issuer",data:{hide:!0,icon:"assured_workload"}},{path:"app/kcc",loadComponent:()=>Promise.all([f.e(6850),f.e(4101)]).then(f.bind(f,64101)).then(y=>y.KnownCustomerCredentialComponent),title:"Known Customer Credential",data:{hide:!0,icon:"assured_workload"}},{path:"marketplace",loadComponent:()=>f.e(4392).then(f.bind(f,94392)).then(y=>y.MarketplaceComponent),title:"Marketplace",data:{hide:!0,icon:"storefront"}},{path:"apps",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(946)]).then(f.bind(f,50946)).then(y=>y.AppsComponent),title:"Apps",data:{icon:"apps"}},{path:"app/files",loadComponent:()=>f.e(6797).then(f.bind(f,46797)).then(y=>y.FilesComponent),title:"Files",data:{icon:"folder",breadcrumb:"Files"},children:[{path:"",pathMatch:"full",redirectTo:"folder/root"},{path:"file/:id",component:(()=>{class y{constructor(){var l=this;this.entries=(0,a.vPA)([]),this.app=(0,a.WQX)(m.d),this.breadcrumb=(0,a.WQX)(ie),this.layout=(0,a.WQX)(S.Y),this.identity=(0,a.WQX)(g.K),this.dialog=(0,a.WQX)(j.bZ),this.router=(0,a.WQX)(x.Ix),this.route=(0,a.WQX)(x.nX),this.fileService=(0,a.WQX)(ae),this.uploadProgress=null,this.isUploading=!1,this.file=null,this.uploadSuccess=!1,this.fileError=null,this.fileId=null,this.sanitizer=(0,a.WQX)(i.up),this.navigation=(0,a.WQX)(Tt.o),this.zoom=1,this.loading=!1,this.fullscreen=(0,a.vPA)(!1),this.canZoomIn=!1,this.canZoomOut=!0,this.fileMimeType=Te,this.pdfZoom=1,(0,a.QZP)((0,B.A)(function*(){l.app.initialized()&&(yield l.loadEntries())})),this.route.paramMap.subscribe(w=>{console.log("ROUTING!!!",w.get("id")),this.fileId=w.get("id")})}toggleFullscreen(){var l=document.getElementById("file-viewer");this.fullscreen()?(document.exitFullscreen(),this.fullscreen.set(!1)):(l.requestFullscreen(),this.fullscreen.set(!0))}updateZoomControls(){this.canZoomIn=this.zoom<1,this.canZoomOut=this.zoom>.1}zoomIn(){this.zoom=Math.min(1,this.zoom+.1),this.updateZoomControls()}zoomOut(){this.zoom=Math.max(.1,this.zoom-.1),this.updateZoomControls()}download(){const l=URL.createObjectURL(this.fileUrl),w=document.createElement("a");console.log("File URL"),console.log(l),w.href=l;const U=this.record?.tags.name;w.download=U,w.click(),URL.revokeObjectURL(l)}pdfZoomIn(){this.pdfZoom++}pdfZoomOut(){this.pdfZoom>1&&this.pdfZoom--}editFile(l){return(0,B.A)(function*(){document.getElementById("input")?.click()})()}onFileSelected(l){var w=this;return(0,B.A)(function*(){const U=l.currentTarget.files;if(0!=U.length){console.log("Uploading number of files:",U.length);for(let J=0;J[...Ht,{record:Ot,data:ut}])}}})()}cancelUpload(){return(0,B.A)(function*(){})()}upload(){var l=this;return(0,B.A)(function*(){console.log("Uploading file");const{status:w,record:U}=yield l.identity.web5.dwn.records.create({data:l.file,message:{schema:E.Q.types.entry.schema}});return console.log("Record created:",U),console.log("Record status:",w),U})()}editFolder(l){var w=this;return(0,B.A)(function*(){let U={name:l.data.name,entryType:"folder"};const J=JSON.parse(JSON.stringify(U)),ce=w.dialog.open(Z,{maxWidth:"80vw",maxHeight:"80vh",data:U});return ce.afterClosed().subscribe(function(){var ge=(0,B.A)(function*(Pe){Pe?(console.log("data result for saving:",U),l.data=U,yield w.saveFolder(l,U)):U=J});return function(Pe){return ge.apply(this,arguments)}}()),ce.afterClosed()})()}saveFolder(l,w){var U=this;return(0,B.A)(function*(){if(l.record){const{status:J,record:ce}=yield l.record.update({data:w});console.log("Record created:",ce),console.log("Record status:",J)}else{const{record:J,status:ce}=yield U.identity.web5.dwn.records.create({data:w,message:{tags:{entryType:w.entryType},protocol:E.Q.protocol,protocolPath:"entry",schema:E.Q.types.entry.schema}});console.log("Record created:",J),console.log("Record status:",ce),J&&(l.record=J,U.entries.update(ge=>[...ge,l]))}})()}openEntry(l){var w=this;return(0,B.A)(function*(){w.router.navigate("folder"===l.entryType?["/app/files/folder",l.record.id]:["/app/files/file",l.record.id])})()}deleteFile(){var l=this;return(0,B.A)(function*(){l.loading=!0;const{status:w}=yield l.record.delete(),{status:U}=yield l.record.send(l.identity.did);console.log("Delete status:",w),console.log("Delete send status:",U),l.record=void 0,l.src=void 0,l.navigation.back()})()}loadEntries(l){var w=this;return(0,B.A)(function*(){if(console.log("VALUE OF TAGS:",l),!w.fileId)return;const{record:U}=yield w.identity.web5.dwn.records.read({message:{filter:{recordId:w.fileId}}});if(w.record=U,w.fileUrl=yield U.data.blob(),console.log(U),w.type=U.dataFormat,"application/pdf"===U.dataFormat){const J=URL.createObjectURL(w.fileUrl)+"#toolbar=0&navpanes=0&scrollbar=0&view=FitH";w.src=w.sanitizer.bypassSecurityTrustResourceUrl(J)}else{const J=URL.createObjectURL(w.fileUrl);w.src=w.sanitizer.bypassSecurityTrustResourceUrl(J)}})()}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-file"]],standalone:!0,features:[a.aNF],decls:3,vars:2,consts:[["id","file-viewer"],[3,"src","type","zoom"],["mat-icon-button","",3,"click","title","disabled"],["mat-icon-button","",3,"click","title"],[1,"ellipsis",3,"matTooltip"],[1,"toolbar-spacer"],["mat-icon-button","",3,"click","disabled"],["mat-icon-button","",3,"title"]],template:function(w,U){1&w&&(a.j41(0,"div",0),a.DNE(1,ne,17,7,"mat-toolbar")(2,X,3,3,"app-file-viewer",1),a.k0s()),2&w&&(a.R7$(),a.vxM(U.record?1:-1),a.R7$(),a.vxM(U.src?2:-1))},dependencies:[nt,R.MD,q.Fg,P.m_,P.An,Qe.s5,Qe.KQ,_.Hl,_.iY,W.uc,W.oV]})}}return y})(),data:{breadcrumb:"Folder"}},{path:"**",component:Xe,data:{breadcrumb:"Folder"}}]},{path:"app/notes",loadComponent:()=>Promise.all([f.e(6471),f.e(8067),f.e(5832)]).then(f.bind(f,55832)).then(y=>y.NotesComponent),title:"Notes",data:{icon:"note"}},{path:"app/player",loadComponent:()=>f.e(9379).then(f.bind(f,19379)).then(y=>y.PlayerComponent),title:"Player",data:{icon:"play_circle"}},{path:"app/text",loadComponent:()=>Promise.all([f.e(6471),f.e(2765),f.e(8067),f.e(6406)]).then(f.bind(f,86406)).then(y=>y.TextComponent),title:"Text",data:{icon:"notes"}},{path:"app/tasks",redirectTo:"app/tasks/home",pathMatch:"full"},{path:"app/tasks/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(2765),f.e(1391),f.e(3907)]).then(f.bind(f,93907)).then(y=>y.TasksComponent),title:"Tasks",data:{icon:"task"}},{path:"registries",loadComponent:()=>Promise.all([f.e(6695),f.e(9466)]).then(f.bind(f,69466)).then(y=>y.RegistriesComponent),title:"Registries",data:{icon:"folder_shared"}},{path:"registry/bsn",loadComponent:()=>Promise.all([f.e(6850),f.e(6695),f.e(6471),f.e(2076),f.e(5026)]).then(f.bind(f,65026)).then(y=>y.RegistryComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/freeid",loadComponent:()=>Promise.all([f.e(6850),f.e(7160)]).then(f.bind(f,47160)).then(y=>y.FreeIDComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/podcast",loadComponent:()=>f.e(60).then(f.bind(f,80060)).then(y=>y.PodcastComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/liberstad-land-registry",loadComponent:()=>f.e(8880).then(f.bind(f,68880)).then(y=>y.LiberstadLandComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/gaianet",loadComponent:()=>f.e(4388).then(f.bind(f,64388)).then(y=>y.GaianetComponent),title:"Gaianet",data:{hide:!0,icon:"folder_shared"}},{path:"registry/local-company-registry",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(2084)]).then(f.bind(f,32084)).then(y=>y.LocalCompanyComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/local-company-registry/:id",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(9158)]).then(f.bind(f,89158)).then(y=>y.LocalCompanyViewComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"data/view/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(3474)]).then(f.bind(f,53474)).then(y=>y.DataViewComponent),title:"Data View",data:{hide:!0,icon:"folder_shared"}},{path:"data",loadComponent:()=>Promise.all([f.e(6850),f.e(7358),f.e(9454),f.e(3287)]).then(f.bind(f,63287)).then(y=>y.DataComponent),title:"Data",data:{hide:!0,icon:"source"}},{path:"data/:source/:id",loadComponent:()=>Promise.all([f.e(2076),f.e(9533)]).then(f.bind(f,29533)).then(y=>y.DataEntryComponent),title:"Data Entry",data:{hide:!0,icon:"source"}},{path:"profile/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(6489)]).then(f.bind(f,96489)).then(y=>y.ProfileComponent),title:"Profile",data:{hide:!0,icon:"account_circle"}},{path:"profile/:id/edit",loadComponent:()=>Promise.all([f.e(3475),f.e(7380)]).then(f.bind(f,37380)).then(y=>y.ProfileEditComponent),title:"Edit Profile",data:{hide:!0,icon:"account_circle"}},{path:"profile/:id/posts/:postId",loadComponent:()=>f.e(5680).then(f.bind(f,45680)).then(y=>y.PostComponent),title:"Posts",data:{hide:!0,icon:"note"}},{path:"notifications",loadComponent:()=>f.e(2228).then(f.bind(f,92228)).then(y=>y.NotificationsComponent),title:"Notifications",data:{hide:!0,icon:"notifications"}},{path:"accounts",loadComponent:()=>Promise.all([f.e(6850),f.e(9454),f.e(6486)]).then(f.bind(f,96486)).then(y=>y.AccountsComponent),title:"Accounts",data:{hide:!0,icon:"account_circle"}},{path:"account/password",loadComponent:()=>f.e(8012).then(f.bind(f,88012)).then(y=>y.PasswordComponent),title:"Password",data:{hide:!0,icon:"account_circle"}},{path:"account/password/reset",loadComponent:()=>f.e(92).then(f.bind(f,10092)).then(y=>y.PasswordResetComponent),title:"Password",data:{hide:!0,icon:"account_circle"}},{path:"account/backup",loadComponent:()=>f.e(5962).then(f.bind(f,75962)).then(y=>y.BackupComponent),title:"Backup",data:{hide:!0,icon:"account_circle"}},{path:"account/create",loadComponent:()=>f.e(5806).then(f.bind(f,75806)).then(y=>y.CreateComponent),title:"Create Account",data:{hide:!0,icon:"account_circle"}},{path:"account/create/new",loadComponent:()=>f.e(9613).then(f.bind(f,29613)).then(y=>y.NewComponent),title:"Create new account",data:{hide:!0,icon:"account_circle"}},{path:"account/create/restore",loadComponent:()=>Promise.resolve().then(f.bind(f,33065)).then(y=>y.RestoreComponent),title:"Restore existing account",data:{hide:!0,icon:"account_circle"}},{path:"account/:id",loadComponent:()=>f.e(7880).then(f.bind(f,17880)).then(y=>y.AccountComponent),title:"Account",data:{hide:!0,icon:"account_circle"}},{path:"identity",loadComponent:()=>f.e(5854).then(f.bind(f,85854)).then(y=>y.IdentityComponent),title:"Identity",data:{hide:!0,icon:"account_circle"}},{path:"settings",loadComponent:()=>f.e(959).then(f.bind(f,60959)).then(y=>y.SettingsComponent),title:"Settings",data:{hide:!0,icon:"settings"}},{path:"settings/about",loadComponent:()=>f.e(5216).then(f.bind(f,85216)).then(y=>y.AboutComponent),title:"About",data:{hide:!0,icon:"settings"}},{path:"settings/licenses",loadComponent:()=>f.e(9727).then(f.bind(f,19727)).then(y=>y.LicensesComponent),title:"Licenses",data:{hide:!0,icon:"settings"}},{path:"settings/privacy",loadComponent:()=>f.e(9128).then(f.bind(f,99128)).then(y=>y.PrivacyComponent),title:"Privacy",data:{hide:!0,icon:"settings"}},{path:"settings/handler",loadComponent:()=>f.e(8552).then(f.bind(f,18552)).then(y=>y.HandlerComponent),title:"Protocol Handler",data:{hide:!0,icon:"search"}},{path:"settings/connections",loadComponent:()=>Promise.all([f.e(9996),f.e(2276)]).then(f.bind(f,62276)).then(y=>y.ConnectionsComponent),title:"Connections",data:{hide:!0,icon:"people"}},{path:"settings/blocks",loadComponent:()=>f.e(5874).then(f.bind(f,45874)).then(y=>y.BlocksComponent),title:"Blocks",data:{hide:!0,icon:"manage_accounts"}},{path:"settings/roles",loadComponent:()=>f.e(7660).then(f.bind(f,47660)).then(y=>y.RolesComponent),title:"Roles",data:{hide:!0,icon:"group"}},{path:"settings/notifications",loadComponent:()=>f.e(4500).then(f.bind(f,74500)).then(y=>y.NotificationsComponent),title:"Notifications",data:{hide:!0,icon:"settings"}},{path:"settings/debug",loadComponent:()=>f.e(3416).then(f.bind(f,13416)).then(y=>y.DebugComponent),title:"Debug",data:{hide:!0,icon:"bug_report"}},{path:"tree",loadComponent:()=>Promise.all([f.e(7358),f.e(9238)]).then(f.bind(f,9238)).then(y=>y.TreeComponent),title:"Tree",data:{hide:!0,icon:"folder"}},{path:"drag-drop",loadComponent:()=>Promise.all([f.e(1391),f.e(7988)]).then(f.bind(f,77988)).then(y=>y.DragDropComponent),title:"Drag-Drop",data:{hide:!0,icon:"folder"}},{path:"storage",loadComponent:()=>Promise.all([f.e(6471),f.e(7848)]).then(f.bind(f,17848)).then(y=>y.StorageComponent),title:"Storage",data:{icon:"cloud"}},{path:"management",loadComponent:()=>Promise.all([f.e(6850),f.e(8864)]).then(f.bind(f,48864)).then(y=>y.ManagementComponent),title:"Management",data:{hide:!0,icon:"manage_accounts"}}];let je=(()=>{class y{constructor(l,w,U,J,ce){this.doc=l,this.delegate=w,this.zone=U,this.animationType=J,this.moduleImpl=ce,this._rendererFactoryPromise=null,this.scheduler=(0,a.WQX)(a.An2,{optional:!0}),this.loadingSchedulerFn=(0,a.WQX)(ot,{optional:!0})}ngOnDestroy(){this._engine?.flush()}loadImpl(){const l=()=>this.moduleImpl??f.e(8008).then(f.bind(f,68008)).then(U=>U);let w;return w=this.loadingSchedulerFn?this.loadingSchedulerFn(l):l(),w.catch(U=>{throw new a.wOt(5300,!1)}).then(({\u0275createEngine:U,\u0275AnimationRendererFactory:J})=>{this._engine=U(this.animationType,this.doc);const ce=new J(this.delegate,this._engine,this.zone);return this.delegate=ce,ce})}createRenderer(l,w){const U=this.delegate.createRenderer(l,w);if(0===U.\u0275type)return U;"boolean"==typeof U.throwOnSyntheticProps&&(U.throwOnSyntheticProps=!1);const J=new Ne(U);return w?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(ce=>{const ge=ce.createRenderer(l,w);J.use(ge),this.scheduler?.notify(10)}).catch(ce=>{J.use(U)}),J}begin(){this.delegate.begin?.()}end(){this.delegate.end?.()}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}static{this.\u0275fac=function(w){a.QTQ()}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac})}}return y})();class Ne{constructor(c){this.delegate=c,this.replay=[],this.\u0275type=1}use(c){if(this.delegate=c,null!==this.replay){for(const l of this.replay)l(c);this.replay=null}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy()}createElement(c,l){return this.delegate.createElement(c,l)}createComment(c){return this.delegate.createComment(c)}createText(c){return this.delegate.createText(c)}get destroyNode(){return this.delegate.destroyNode}appendChild(c,l){this.delegate.appendChild(c,l)}insertBefore(c,l,w,U){this.delegate.insertBefore(c,l,w,U)}removeChild(c,l,w){this.delegate.removeChild(c,l,w)}selectRootElement(c,l){return this.delegate.selectRootElement(c,l)}parentNode(c){return this.delegate.parentNode(c)}nextSibling(c){return this.delegate.nextSibling(c)}setAttribute(c,l,w,U){this.delegate.setAttribute(c,l,w,U)}removeAttribute(c,l,w){this.delegate.removeAttribute(c,l,w)}addClass(c,l){this.delegate.addClass(c,l)}removeClass(c,l){this.delegate.removeClass(c,l)}setStyle(c,l,w,U){this.delegate.setStyle(c,l,w,U)}removeStyle(c,l,w){this.delegate.removeStyle(c,l,w)}setProperty(c,l,w){this.shouldReplay(l)&&this.replay.push(U=>U.setProperty(c,l,w)),this.delegate.setProperty(c,l,w)}setValue(c,l){this.delegate.setValue(c,l)}listen(c,l,w){return this.shouldReplay(l)&&this.replay.push(U=>U.listen(c,l,w)),this.delegate.listen(c,l,w)}shouldReplay(c){return null!==this.replay&&c.startsWith("@")}}const ot=new a.nKC("");var wt=f(59030),zt=f(18810),rr=f(33726),ar=f(7673),lr=f(28793),hn=f(21413),Wr=f(71985),vr=f(85343);const Tr=new Wr.c(vr.l);var lt=f(57786),Pt=f(86648),Dt=f(96354),jt=f(25558),Nr=f(30017),Ke=f(98071),Ze=f(58750),gt=f(39974);const mt={connector:()=>new hn.B};function Xt(y,c=mt){const{connector:l}=c;return(0,gt.N)((w,U)=>{const J=l();(0,Ze.Tg)(y(function st(y){return new Wr.c(c=>y.subscribe(c))}(J))).subscribe(U),U.add(w.subscribe(J))})}var Lr=f(96697),yr=f(88141),$r=f(91986);const mi="Service workers are disabled or not supported by this browser";class wn{constructor(c){if(this.serviceWorker=c,c){const w=(0,rr.R)(c,"controllerchange").pipe((0,Dt.T)(()=>c.controller)),U=(0,wt.v)(()=>(0,ar.of)(c.controller)),J=(0,lr.x)(U,w);this.worker=J.pipe((0,te.p)(ut=>!!ut)),this.registration=this.worker.pipe((0,jt.n)(()=>c.getRegistration()));const Ge=(0,rr.R)(c,"message").pipe((0,Dt.T)(ut=>ut.data)).pipe((0,te.p)(ut=>ut&&ut.type)).pipe(function Zt(y){return y?c=>Xt(y)(c):c=>function Et(y,c){const l=(0,Ke.T)(y)?y:()=>y;return(0,Ke.T)(c)?Xt(c,{connector:l}):w=>new Nr.G(w,l)}(new hn.B)(c)}());Ge.connect(),this.events=Ge}else this.worker=this.events=this.registration=function Vn(y){return(0,wt.v)(()=>(0,zt.$)(new Error(y)))}(mi)}postMessage(c,l){return this.worker.pipe((0,Lr.s)(1),(0,yr.M)(w=>{w.postMessage({action:c,...l})})).toPromise().then(()=>{})}postMessageWithOperation(c,l,w){const U=this.waitForOperationCompleted(w),J=this.postMessage(c,l);return Promise.all([J,U]).then(([,ce])=>ce)}generateNonce(){return Math.round(1e7*Math.random())}eventsOfType(c){let l;return l="string"==typeof c?w=>w.type===c:w=>c.includes(w.type),this.events.pipe((0,te.p)(l))}nextEventOfType(c){return this.eventsOfType(c).pipe((0,Lr.s)(1))}waitForOperationCompleted(c){return this.eventsOfType("OPERATION_COMPLETED").pipe((0,te.p)(l=>l.nonce===c),(0,Lr.s)(1),(0,Dt.T)(l=>{if(void 0!==l.result)return l.result;throw new Error(l.error)})).toPromise()}get isEnabled(){return!!this.serviceWorker}}let Yt=(()=>{class y{get isEnabled(){return this.sw.isEnabled}constructor(l){if(this.sw=l,this.pushManager=null,this.subscriptionChanges=new hn.B,!l.isEnabled)return this.messages=Tr,this.notificationClicks=Tr,void(this.subscription=Tr);this.messages=this.sw.eventsOfType("PUSH").pipe((0,Dt.T)(U=>U.data)),this.notificationClicks=this.sw.eventsOfType("NOTIFICATION_CLICK").pipe((0,Dt.T)(U=>U.data)),this.pushManager=this.sw.registration.pipe((0,Dt.T)(U=>U.pushManager));const w=this.pushManager.pipe((0,jt.n)(U=>U.getSubscription()));this.subscription=(0,lt.h)(w,this.subscriptionChanges)}requestSubscription(l){if(!this.sw.isEnabled||null===this.pushManager)return Promise.reject(new Error(mi));const w={userVisibleOnly:!0};let U=this.decodeBase64(l.serverPublicKey.replace(/_/g,"/").replace(/-/g,"+")),J=new Uint8Array(new ArrayBuffer(U.length));for(let ce=0;cece.subscribe(w)),(0,Lr.s)(1)).toPromise().then(ce=>(this.subscriptionChanges.next(ce),ce))}unsubscribe(){return this.sw.isEnabled?this.subscription.pipe((0,Lr.s)(1),(0,jt.n)(w=>{if(null===w)throw new Error("Not subscribed to push notifications.");return w.unsubscribe().then(U=>{if(!U)throw new Error("Unsubscribe failed!");this.subscriptionChanges.next(null)})})).toPromise():Promise.reject(new Error(mi))}decodeBase64(l){return atob(l)}static{this.\u0275fac=function(w){return new(w||y)(a.KVO(wn))}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac})}}return y})(),Hr=(()=>{class y{get isEnabled(){return this.sw.isEnabled}constructor(l){if(this.sw=l,!l.isEnabled)return this.versionUpdates=Tr,void(this.unrecoverable=Tr);this.versionUpdates=this.sw.eventsOfType(["VERSION_DETECTED","VERSION_INSTALLATION_FAILED","VERSION_READY","NO_NEW_VERSION_DETECTED"]),this.unrecoverable=this.sw.eventsOfType("UNRECOVERABLE_STATE")}checkForUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(mi));const l=this.sw.generateNonce();return this.sw.postMessageWithOperation("CHECK_FOR_UPDATES",{nonce:l},l)}activateUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(mi));const l=this.sw.generateNonce();return this.sw.postMessageWithOperation("ACTIVATE_UPDATE",{nonce:l},l)}static{this.\u0275fac=function(w){return new(w||y)(a.KVO(wn))}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac})}}return y})();const Lt=new a.nKC("");function dr(y,c,l,w){return()=>{if(!(0,R.UE)(w)||!("serviceWorker"in navigator)||!1===l.enabled)return;const U=y.get(a.SKi),J=y.get(a.o8S);let ce;if(U.runOutsideAngular(()=>{const ge=navigator.serviceWorker,Pe=()=>ge.controller?.postMessage({action:"INITIALIZE"});ge.addEventListener("controllerchange",Pe),J.onDestroy(()=>{ge.removeEventListener("controllerchange",Pe)})}),"function"==typeof l.registrationStrategy)ce=l.registrationStrategy();else{const[ge,...Pe]=(l.registrationStrategy||"registerWhenStable:30000").split(":");switch(ge){case"registerImmediately":ce=(0,ar.of)(null);break;case"registerWithDelay":ce=xr(+Pe[0]||0);break;case"registerWhenStable":const Ge=(0,Pt.H)(y.get(a.o8S).whenStable());ce=Pe[0]?(0,lt.h)(Ge,xr(+Pe[0])):Ge;break;default:throw new Error(`Unknown ServiceWorker registration strategy: ${l.registrationStrategy}`)}}U.runOutsideAngular(()=>ce.pipe((0,Lr.s)(1)).subscribe(()=>navigator.serviceWorker.register(c,{scope:l.scope}).catch(ge=>console.error("Service worker registration failed with:",ge))))}}function xr(y){return(0,ar.of)(null).pipe((0,$r.c)(y))}function fn(y,c){return new wn((0,R.UE)(c)&&!1!==y.enabled?navigator.serviceWorker:void 0)}class Sn{}var li=f(21626),Kr=f(1005);const ur={providers:[(0,li.$R)(),(0,a.Jn2)({eventCoalescing:!0}),(0,x.lh)(he,(0,x.Sn)(x.Kp)),function Ft(y="animations"){return(0,a.ngT)("NgAsyncAnimations"),(0,a.EmA)([{provide:a._9s,useFactory:(c,l,w)=>new je(c,l,w,y),deps:[R.qQ,i.B7,a.SKi]},{provide:a.bc$,useValue:"noop"===y?"NoopAnimations":"BrowserAnimations"}])}(),function Xn(y,c={}){return(0,a.EmA)([Yt,Hr,{provide:Lt,useValue:y},{provide:Sn,useValue:c},{provide:wn,useFactory:fn,deps:[Sn,a.Agw]},{provide:a.hnV,useFactory:dr,deps:[a.zZn,Lt,Sn,a.Agw],multi:!0}])}("ngsw-worker.js",{enabled:!(0,a.naY)(),registrationStrategy:"registerWhenStable:30000"}),{provide:a.hnV,useFactory:function er(y){return()=>y.load()},deps:[Kr.G],multi:!0}]};var Fr=f(99327),qt=f(67333),mr=f(86600),_r=f(18617),Gr=f(28203),gn=f(14085),An=f(67336),Pn=f(36860),Un=f(73703),oi=f(56977),$i=f(23294),Fi=f(99172),no=f(70152),Zi=f(49969);const Ao=["*"],Fo=["content"],Ki=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],ro=["mat-drawer","mat-drawer-content","*"];function uo(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",1),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U._onBackdropClicked())}),a.k0s()}if(2&y){const l=a.XpG();a.AVh("mat-drawer-shown",l._isShowingBackdrop())}}function Oi(y,c){1&y&&(a.j41(0,"mat-drawer-content"),a.SdG(1,2),a.k0s())}const Yn=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],Qo=["mat-sidenav","mat-sidenav-content","*"];function Gs(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",1),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U._onBackdropClicked())}),a.k0s()}if(2&y){const l=a.XpG();a.AVh("mat-drawer-shown",l._isShowingBackdrop())}}function Ss(y,c){1&y&&(a.j41(0,"mat-sidenav-content"),a.SdG(1,2),a.k0s())}const Na={transformDrawer:(0,Zi.hZ)("transform",[(0,Zi.wk)("open, open-instant",(0,Zi.iF)({transform:"none",visibility:"visible"})),(0,Zi.wk)("void",(0,Zi.iF)({"box-shadow":"none",visibility:"hidden"})),(0,Zi.kY)("void => open-instant",(0,Zi.i0)("0ms")),(0,Zi.kY)("void <=> open, open-instant => void",(0,Zi.i0)("400ms cubic-bezier(0.25, 0.8, 0.25, 1)"))])},Yi=new a.nKC("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:function uc(){return!1}}),ys=new a.nKC("MAT_DRAWER_CONTAINER");let yt=(()=>{class y extends qt.uv{constructor(l,w,U,J,ce){super(U,J,ce),this._changeDetectorRef=l,this._container=w}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(a.gRc),a.rXU((0,a.Rfq)(()=>wr)),a.rXU(a.aKT),a.rXU(qt.R),a.rXU(a.SKi))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:4,hostBindings:function(w,U){2&w&&a.xc7("margin-left",U._container._contentMargins.left,"px")("margin-right",U._container._contentMargins.right,"px")},standalone:!0,features:[a.Jv_([{provide:qt.uv,useExisting:y}]),a.Vt3,a.aNF],ngContentSelectors:Ao,decls:1,vars:0,template:function(w,U){1&w&&(a.NAR(),a.SdG(0))},encapsulation:2,changeDetection:0})}}return y})(),kt=(()=>{class y{get position(){return this._position}set position(l){(l="end"===l?"end":"start")!==this._position&&(this._isAttached&&this._updatePositionInParent(l),this._position=l,this.onPositionChanged.emit())}get mode(){return this._mode}set mode(l){this._mode=l,this._updateFocusTrapState(),this._modeChanged.next()}get disableClose(){return this._disableClose}set disableClose(l){this._disableClose=(0,gn.he)(l)}get autoFocus(){return this._autoFocus??("side"===this.mode?"dialog":"first-tabbable")}set autoFocus(l){("true"===l||"false"===l||null==l)&&(l=(0,gn.he)(l)),this._autoFocus=l}get opened(){return this._opened}set opened(l){this.toggle((0,gn.he)(l))}constructor(l,w,U,J,ce,ge,Pe,Ge){this._elementRef=l,this._focusTrapFactory=w,this._focusMonitor=U,this._platform=J,this._ngZone=ce,this._interactivityChecker=ge,this._doc=Pe,this._container=Ge,this._focusTrap=null,this._elementFocusedBeforeDrawerWasOpened=null,this._enableAnimations=!1,this._position="start",this._mode="over",this._disableClose=!1,this._opened=!1,this._animationStarted=new hn.B,this._animationEnd=new hn.B,this._animationState="void",this.openedChange=new a.bkB(!0),this._openedStream=this.openedChange.pipe((0,te.p)(ut=>ut),(0,Dt.T)(()=>{})),this.openedStart=this._animationStarted.pipe((0,te.p)(ut=>ut.fromState!==ut.toState&&0===ut.toState.indexOf("open")),(0,Un.u)(void 0)),this._closedStream=this.openedChange.pipe((0,te.p)(ut=>!ut),(0,Dt.T)(()=>{})),this.closedStart=this._animationStarted.pipe((0,te.p)(ut=>ut.fromState!==ut.toState&&"void"===ut.toState),(0,Un.u)(void 0)),this._destroyed=new hn.B,this.onPositionChanged=new a.bkB,this._modeChanged=new hn.B,this._injector=(0,a.WQX)(a.zZn),this._changeDetectorRef=(0,a.WQX)(a.gRc),this.openedChange.pipe((0,oi.Q)(this._destroyed)).subscribe(ut=>{ut?(this._doc&&(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement),this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus(this._openedVia||"program")}),this._ngZone.runOutsideAngular(()=>{(0,rr.R)(this._elementRef.nativeElement,"keydown").pipe((0,te.p)(ut=>ut.keyCode===An._f&&!this.disableClose&&!(0,An.rp)(ut)),(0,oi.Q)(this._destroyed)).subscribe(ut=>this._ngZone.run(()=>{this.close(),ut.stopPropagation(),ut.preventDefault()}))}),this._animationEnd.pipe((0,$i.F)((ut,_t)=>ut.fromState===_t.fromState&&ut.toState===_t.toState)).subscribe(ut=>{const{fromState:_t,toState:Ot}=ut;(0===Ot.indexOf("open")&&"void"===_t||"void"===Ot&&0===_t.indexOf("open"))&&this.openedChange.emit(this._opened)})}_forceFocus(l,w){this._interactivityChecker.isFocusable(l)||(l.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{const U=()=>{l.removeEventListener("blur",U),l.removeEventListener("mousedown",U),l.removeAttribute("tabindex")};l.addEventListener("blur",U),l.addEventListener("mousedown",U)})),l.focus(w)}_focusByCssSelector(l,w){let U=this._elementRef.nativeElement.querySelector(l);U&&this._forceFocus(U,w)}_takeFocus(){if(!this._focusTrap)return;const l=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":(0,a.mal)(()=>{!this._focusTrap.focusInitialElement()&&"function"==typeof l.focus&&l.focus()},{injector:this._injector});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this.autoFocus)}}_restoreFocus(l){"dialog"!==this.autoFocus&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,l):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null)}_isFocusWithinDrawer(){const l=this._doc.activeElement;return!!l&&this._elementRef.nativeElement.contains(l)}ngAfterViewInit(){this._isAttached=!0,"end"===this._position&&this._updatePositionInParent("end"),this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState())}ngAfterContentChecked(){this._platform.isBrowser&&(this._enableAnimations=!0)}ngOnDestroy(){this._focusTrap?.destroy(),this._anchor?.remove(),this._anchor=null,this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(l){return this.toggle(!0,l)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0,"mouse")}toggle(l=!this.opened,w){l&&w&&(this._openedVia=w);const U=this._setOpen(l,!l&&this._isFocusWithinDrawer(),this._openedVia||"program");return l||(this._openedVia=null),U}_setOpen(l,w,U){return this._opened=l,l?this._animationState=this._enableAnimations?"open":"open-instant":(this._animationState="void",w&&this._restoreFocus(U)),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(J=>{this.openedChange.pipe((0,Lr.s)(1)).subscribe(ce=>J(ce?"open":"close"))})}_getWidth(){return this._elementRef.nativeElement&&this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=!!this._container?.hasBackdrop&&this.opened)}_updatePositionInParent(l){if(!this._platform.isBrowser)return;const w=this._elementRef.nativeElement,U=w.parentNode;"end"===l?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),U.insertBefore(this._anchor,w)),U.appendChild(w)):this._anchor&&this._anchor.parentNode.insertBefore(w,this._anchor)}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(a.aKT),a.rXU(_r.GX),a.rXU(_r.FN),a.rXU(Pn.OD),a.rXU(a.SKi),a.rXU(_r.Z7),a.rXU(R.qQ,8),a.rXU(ys,8))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-drawer"]],viewQuery:function(w,U){if(1&w&&a.GBs(Fo,5),2&w){let J;a.mGM(J=a.lsd())&&(U._content=J.first)}},hostAttrs:["tabIndex","-1",1,"mat-drawer"],hostVars:12,hostBindings:function(w,U){1&w&&a.Kam("@transform.start",function(ce){return U._animationStarted.next(ce)})("@transform.done",function(ce){return U._animationEnd.next(ce)}),2&w&&(a.zvX("@transform",U._animationState),a.BMQ("align",null),a.AVh("mat-drawer-end","end"===U.position)("mat-drawer-over","over"===U.mode)("mat-drawer-push","push"===U.mode)("mat-drawer-side","side"===U.mode)("mat-drawer-opened",U.opened))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",openedStart:"openedStart",_closedStream:"closed",closedStart:"closedStart",onPositionChanged:"positionChanged"},exportAs:["matDrawer"],standalone:!0,features:[a.aNF],ngContentSelectors:Ao,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(w,U){1&w&&(a.NAR(),a.j41(0,"div",1,0),a.SdG(2),a.k0s())},dependencies:[qt.uv],encapsulation:2,data:{animation:[Na.transformDrawer]},changeDetection:0})}}return y})(),wr=(()=>{class y{get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(l){this._autosize=(0,gn.he)(l)}get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(l){this._backdropOverride=null==l?null:(0,gn.he)(l)}get scrollable(){return this._userContent||this._content}constructor(l,w,U,J,ce,ge=!1,Pe){this._dir=l,this._element=w,this._ngZone=U,this._changeDetectorRef=J,this._animationMode=Pe,this._drawers=new a.rOR,this.backdropClick=new a.bkB,this._destroyed=new hn.B,this._doCheckSubject=new hn.B,this._contentMargins={left:null,right:null},this._contentMarginChanges=new hn.B,this._injector=(0,a.WQX)(a.zZn),l&&l.change.pipe((0,oi.Q)(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),ce.change().pipe((0,oi.Q)(this._destroyed)).subscribe(()=>this.updateContentMargins()),this._autosize=ge}ngAfterContentInit(){this._allDrawers.changes.pipe((0,Fi.Z)(this._allDrawers),(0,oi.Q)(this._destroyed)).subscribe(l=>{this._drawers.reset(l.filter(w=>!w._container||w._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe((0,Fi.Z)(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(l=>{this._watchDrawerToggle(l),this._watchDrawerPosition(l),this._watchDrawerMode(l)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe((0,no.B)(10),(0,oi.Q)(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(l=>l.open())}close(){this._drawers.forEach(l=>l.close())}updateContentMargins(){let l=0,w=0;if(this._left&&this._left.opened)if("side"==this._left.mode)l+=this._left._getWidth();else if("push"==this._left.mode){const U=this._left._getWidth();l+=U,w-=U}if(this._right&&this._right.opened)if("side"==this._right.mode)w+=this._right._getWidth();else if("push"==this._right.mode){const U=this._right._getWidth();w+=U,l-=U}l=l||null,w=w||null,(l!==this._contentMargins.left||w!==this._contentMargins.right)&&(this._contentMargins={left:l,right:w},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(l){l._animationStarted.pipe((0,te.p)(w=>w.fromState!==w.toState),(0,oi.Q)(this._drawers.changes)).subscribe(w=>{"open-instant"!==w.toState&&"NoopAnimations"!==this._animationMode&&this._element.nativeElement.classList.add("mat-drawer-transition"),this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),"side"!==l.mode&&l.openedChange.pipe((0,oi.Q)(this._drawers.changes)).subscribe(()=>this._setContainerClass(l.opened))}_watchDrawerPosition(l){l&&l.onPositionChanged.pipe((0,oi.Q)(this._drawers.changes)).subscribe(()=>{(0,a.mal)(()=>{this._validateDrawers()},{injector:this._injector,phase:a.wjH.Read})})}_watchDrawerMode(l){l&&l._modeChanged.pipe((0,oi.Q)((0,lt.h)(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(l){const w=this._element.nativeElement.classList,U="mat-drawer-container-has-open";l?w.add(U):w.remove(U)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(l=>{"end"==l.position?this._end=l:this._start=l}),this._right=this._left=null,this._dir&&"rtl"===this._dir.value?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&"over"!=this._start.mode||this._isDrawerOpen(this._end)&&"over"!=this._end.mode}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(l=>l&&!l.disableClose&&this._drawerHasBackdrop(l)).forEach(l=>l._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._drawerHasBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._drawerHasBackdrop(this._end)}_isDrawerOpen(l){return null!=l&&l.opened}_drawerHasBackdrop(l){return null==this._backdropOverride?!!l&&"side"!==l.mode:this._backdropOverride}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(Gr.dS,8),a.rXU(a.aKT),a.rXU(a.SKi),a.rXU(a.gRc),a.rXU(qt.Xj),a.rXU(Yi),a.rXU(a.bc$,8))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-drawer-container"]],contentQueries:function(w,U,J){if(1&w&&(a.wni(J,yt,5),a.wni(J,kt,5)),2&w){let ce;a.mGM(ce=a.lsd())&&(U._content=ce.first),a.mGM(ce=a.lsd())&&(U._allDrawers=ce)}},viewQuery:function(w,U){if(1&w&&a.GBs(yt,5),2&w){let J;a.mGM(J=a.lsd())&&(U._userContent=J.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(w,U){2&w&&a.AVh("mat-drawer-container-explicit-backdrop",U._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],standalone:!0,features:[a.Jv_([{provide:ys,useExisting:y}]),a.aNF],ngContentSelectors:ro,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(w,U){1&w&&(a.NAR(Ki),a.DNE(0,uo,1,2,"div",0),a.SdG(1),a.SdG(2,1),a.DNE(3,Oi,2,0,"mat-drawer-content")),2&w&&(a.vxM(U.hasBackdrop?0:-1),a.R7$(3),a.vxM(U._content?-1:3))},dependencies:[yt],styles:['.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-app-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-app-background));box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color)}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-app-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow);background-color:var(--mat-sidenav-container-background-color, var(--mat-app-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));width:var(--mat-sidenav-container-width);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer[style*="visibility: hidden"]{display:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}'],encapsulation:2,changeDetection:0})}}return y})(),Jt=(()=>{class y extends yt{constructor(l,w,U,J,ce){super(l,w,U,J,ce)}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(a.gRc),a.rXU((0,a.Rfq)(()=>Or)),a.rXU(a.aKT),a.rXU(qt.R),a.rXU(a.SKi))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],hostVars:4,hostBindings:function(w,U){2&w&&a.xc7("margin-left",U._container._contentMargins.left,"px")("margin-right",U._container._contentMargins.right,"px")},standalone:!0,features:[a.Jv_([{provide:qt.uv,useExisting:y}]),a.Vt3,a.aNF],ngContentSelectors:Ao,decls:1,vars:0,template:function(w,U){1&w&&(a.NAR(),a.SdG(0))},encapsulation:2,changeDetection:0})}}return y})(),hr=(()=>{class y extends kt{constructor(){super(...arguments),this._fixedInViewport=!1,this._fixedTopGap=0,this._fixedBottomGap=0}get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(l){this._fixedInViewport=(0,gn.he)(l)}get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(l){this._fixedTopGap=(0,gn.OE)(l)}get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(l){this._fixedBottomGap=(0,gn.OE)(l)}static{this.\u0275fac=(()=>{let l;return function(U){return(l||(l=a.xGo(y)))(U||y)}})()}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-sidenav"]],hostAttrs:["tabIndex","-1",1,"mat-drawer","mat-sidenav"],hostVars:17,hostBindings:function(w,U){2&w&&(a.BMQ("align",null),a.xc7("top",U.fixedInViewport?U.fixedTopGap:null,"px")("bottom",U.fixedInViewport?U.fixedBottomGap:null,"px"),a.AVh("mat-drawer-end","end"===U.position)("mat-drawer-over","over"===U.mode)("mat-drawer-push","push"===U.mode)("mat-drawer-side","side"===U.mode)("mat-drawer-opened",U.opened)("mat-sidenav-fixed",U.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],standalone:!0,features:[a.Vt3,a.aNF],ngContentSelectors:Ao,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(w,U){1&w&&(a.NAR(),a.j41(0,"div",1,0),a.SdG(2),a.k0s())},dependencies:[qt.uv],encapsulation:2,data:{animation:[Na.transformDrawer]},changeDetection:0})}}return y})(),Or=(()=>{class y extends wr{constructor(){super(...arguments),this._allDrawers=void 0,this._content=void 0}static{this.\u0275fac=(()=>{let l;return function(U){return(l||(l=a.xGo(y)))(U||y)}})()}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-sidenav-container"]],contentQueries:function(w,U,J){if(1&w&&(a.wni(J,Jt,5),a.wni(J,hr,5)),2&w){let ce;a.mGM(ce=a.lsd())&&(U._content=ce.first),a.mGM(ce=a.lsd())&&(U._allDrawers=ce)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(w,U){2&w&&a.AVh("mat-drawer-container-explicit-backdrop",U._backdropOverride)},exportAs:["matSidenavContainer"],standalone:!0,features:[a.Jv_([{provide:ys,useExisting:y}]),a.Vt3,a.aNF],ngContentSelectors:Qo,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(w,U){1&w&&(a.NAR(Yn),a.DNE(0,Gs,1,2,"div",0),a.SdG(1),a.SdG(2,1),a.DNE(3,Ss,2,0,"mat-sidenav-content")),2&w&&(a.vxM(U.hasBackdrop?0:-1),a.R7$(3),a.vxM(U._content?-1:3))},dependencies:[Jt],styles:['.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-app-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-app-background));box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color)}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-app-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow);background-color:var(--mat-sidenav-container-background-color, var(--mat-app-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));width:var(--mat-sidenav-container-width);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer[style*="visibility: hidden"]{display:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}'],encapsulation:2,changeDetection:0})}}return y})(),pn=(()=>{class y{static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275mod=a.$C({type:y})}static{this.\u0275inj=a.G2t({imports:[mr.yE,qt.Gj,qt.Gj,mr.yE]})}}return y})();var bn=f(44668),_i=f(31948),Gi=f(40605);let Io=(()=>{class y{constructor(l,w){this.swUpdate=l,this.zone=w,this.isNewVersionAvailable=!1,this.intervalSource=(0,Gi.Y)(9e5),this.checkForUpdateOnInterval(),this.checkForUpdateOnLoad()}applyUpdate(){this.swUpdate.activateUpdate().then(()=>document.location.reload()).catch(l=>console.error("Failed to apply updates:",l))}checkForUpdateOnInterval(){var l=this;this.intervalSubscription?.unsubscribe(),this.swUpdate.isEnabled&&this.zone.runOutsideAngular(()=>{this.intervalSubscription=this.intervalSource.subscribe((0,B.A)(function*(){if(l.isNewVersionAvailable)yield l.swUpdate.checkForUpdate();else try{l.isNewVersionAvailable=yield l.swUpdate.checkForUpdate(),console.log(l.isNewVersionAvailable?"A new version is available.":"Already on the latest version.")}catch(w){console.error("Failed to check for updates:",w)}}))})}checkForUpdateOnLoad(){this.newVersionSubscription?.unsubscribe(),this.swUpdate.isEnabled?(this.newVersionSubscription=this.swUpdate.versionUpdates.subscribe(l=>{switch(console.log("New version update event:"),console.log(l),l.type){case"VERSION_DETECTED":console.log(`Downloading new app version: ${l.version.hash}`);break;case"VERSION_READY":console.log(`Current app version: ${l.currentVersion.hash}`),console.log(`New app version ready for use: ${l.latestVersion.hash}`),this.isNewVersionAvailable=!0;break;case"VERSION_INSTALLATION_FAILED":console.log(`Failed to install app version '${l.version.hash}': ${l.error}`)}}),console.log("Subscribed to new version updates.")):console.log("Service worker updates are disabled for this app.")}static{this.\u0275fac=function(w){return new(w||y)(a.KVO(Hr),a.KVO(a.SKi))}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();var Mo=f(33347),Ma=f(5794),Os=f(78013);var oc=function(){var y=function(l,w){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,J){U.__proto__=J}||function(U,J){for(var ce in J)Object.prototype.hasOwnProperty.call(J,ce)&&(U[ce]=J[ce])})(l,w)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),Si=function(y){function c(l,w){var U=this.constructor,J=y.call(this,l,w)||this;return Object.defineProperty(J,"name",{value:U.name,enumerable:!1,configurable:!0}),function Ua(y,c){var l=Object.setPrototypeOf;l?l(y,c):y.__proto__=c}(J,U.prototype),function cs(y,c){void 0===c&&(c=y.constructor);var l=Error.captureStackTrace;l&&l(y,c)}(J),J}return oc(c,y),c}(Error),ns=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Us=function(y){function c(l){void 0===l&&(l=void 0);var w=y.call(this,l)||this;return w.message=l,w}return ns(c,y),c.prototype.getKind=function(){return this.constructor.kind},c.kind="Exception",c}(Si);var Ec=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const vs=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return Ec(c,y),c.kind="ArgumentException",c}(Us);var As=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Bi=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return As(c,y),c.kind="IllegalArgumentException",c}(Us),jc=function(){function y(c){if(this.binarizer=c,null===c)throw new Bi("Binarizer must be non-null.")}return y.prototype.getWidth=function(){return this.binarizer.getWidth()},y.prototype.getHeight=function(){return this.binarizer.getHeight()},y.prototype.getBlackRow=function(c,l){return this.binarizer.getBlackRow(c,l)},y.prototype.getBlackMatrix=function(){return null==this.matrix&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},y.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},y.prototype.crop=function(c,l,w,U){var J=this.binarizer.getLuminanceSource().crop(c,l,w,U);return new y(this.binarizer.createBinarizer(J))},y.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},y.prototype.rotateCounterClockwise=function(){var c=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new y(this.binarizer.createBinarizer(c))},y.prototype.rotateCounterClockwise45=function(){var c=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new y(this.binarizer.createBinarizer(c))},y.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},y}();var Ta=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const rs=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return Ta(c,y),c.getChecksumInstance=function(){return new c},c.kind="ChecksumException",c}(Us),Qt=function(){function y(c){this.source=c}return y.prototype.getLuminanceSource=function(){return this.source},y.prototype.getWidth=function(){return this.source.getWidth()},y.prototype.getHeight=function(){return this.source.getHeight()},y}(),Rt=function(){function y(){}return y.arraycopy=function(c,l,w,U,J){for(;J--;)w[U++]=c[l++]},y.currentTimeMillis=function(){return Date.now()},y}();var Pr=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Qr=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return Pr(c,y),c.kind="IndexOutOfBoundsException",c}(Us);var zn=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Zn=function(y){function c(l,w){void 0===l&&(l=void 0),void 0===w&&(w=void 0);var U=y.call(this,w)||this;return U.index=l,U.message=w,U}return zn(c,y),c.kind="ArrayIndexOutOfBoundsException",c}(Qr),Vi=function(){function y(){}return y.fill=function(c,l){for(var w=0,U=c.length;ww)throw new Bi("fromIndex("+l+") > toIndex("+w+")");if(l<0)throw new Zn(l);if(w>c)throw new Zn(w)},y.asList=function(){for(var c=[],l=0;l=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),ce=J.next();!ce.done;ce=J.next())U=31*U+ce.value}catch(Pe){l={error:Pe}}finally{try{ce&&!ce.done&&(w=J.return)&&w.call(J)}finally{if(l)throw l.error}}return U},y.fillUint8Array=function(c,l){for(var w=0;w!==c.length;w++)c[w]=l},y.copyOf=function(c,l){return c.slice(0,l)},y.copyOfUint8Array=function(c,l){if(c.length<=l){var w=new Uint8Array(l);return w.set(c),w}return c.slice(0,l)},y.copyOfRange=function(c,l,w){var U=w-l,J=new Int32Array(U);return Rt.arraycopy(c,l,J,0,U),J},y.binarySearch=function(c,l,w){void 0===w&&(w=y.numberComparator);for(var U=0,J=c.length-1;U<=J;){var ce=J+U>>1,ge=w(l,c[ce]);if(ge>0)U=ce+1;else{if(!(ge<0))return ce;J=ce-1}}return-U-1},y.numberComparator=function(c,l){return c-l},y}(),pi=function(){function y(){}return y.numberOfTrailingZeros=function(c){var l;if(0===c)return 32;var w=31;return 0!=(l=c<<16)&&(w-=16,c=l),0!=(l=c<<8)&&(w-=8,c=l),0!=(l=c<<4)&&(w-=4,c=l),0!=(l=c<<2)&&(w-=2,c=l),w-(c<<1>>>31)},y.numberOfLeadingZeros=function(c){if(0===c)return 32;var l=1;return c>>>16||(l+=16,c<<=16),c>>>24||(l+=8,c<<=8),c>>>28||(l+=4,c<<=4),c>>>30||(l+=2,c<<=2),l-(c>>>31)},y.toHexString=function(c){return c.toString(16)},y.toBinaryString=function(c){return String(parseInt(String(c),2))},y.bitCount=function(c){return c=(c=(858993459&(c-=c>>>1&1431655765))+(c>>>2&858993459))+(c>>>4)&252645135,63&(c+=c>>>8)+(c>>>16)},y.truncDivision=function(c,l){return Math.trunc(c/l)},y.parseInt=function(c,l){return void 0===l&&(l=void 0),parseInt(c,l)},y.MIN_VALUE_32_BITS=-2147483648,y.MAX_VALUE=Number.MAX_SAFE_INTEGER,y}(),bi=function(){function y(c,l){void 0===c?(this.size=0,this.bits=new Int32Array(1)):(this.size=c,this.bits=null==l?y.makeArray(c):l)}return y.prototype.getSize=function(){return this.size},y.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},y.prototype.ensureCapacity=function(c){if(c>32*this.bits.length){var l=y.makeArray(c);Rt.arraycopy(this.bits,0,l,0,this.bits.length),this.bits=l}},y.prototype.get=function(c){return!!(this.bits[Math.floor(c/32)]&1<<(31&c))},y.prototype.set=function(c){this.bits[Math.floor(c/32)]|=1<<(31&c)},y.prototype.flip=function(c){this.bits[Math.floor(c/32)]^=1<<(31&c)},y.prototype.getNextSet=function(c){var l=this.size;if(c>=l)return l;var w=this.bits,U=Math.floor(c/32),J=w[U];J&=~((1<<(31&c))-1);for(var ce=w.length;0===J;){if(++U===ce)return l;J=w[U]}var ge=32*U+pi.numberOfTrailingZeros(J);return ge>l?l:ge},y.prototype.getNextUnset=function(c){var l=this.size;if(c>=l)return l;var w=this.bits,U=Math.floor(c/32),J=~w[U];J&=~((1<<(31&c))-1);for(var ce=w.length;0===J;){if(++U===ce)return l;J=~w[U]}var ge=32*U+pi.numberOfTrailingZeros(J);return ge>l?l:ge},y.prototype.setBulk=function(c,l){this.bits[Math.floor(c/32)]=l},y.prototype.setRange=function(c,l){if(lthis.size)throw new Bi;if(l!==c){l--;for(var w=Math.floor(c/32),U=Math.floor(l/32),J=this.bits,ce=w;ce<=U;ce++)J[ce]|=(2<<(cew?0:31&c))}},y.prototype.clear=function(){for(var c=this.bits.length,l=this.bits,w=0;wthis.size)throw new Bi;if(l===c)return!0;l--;for(var U=Math.floor(c/32),J=Math.floor(l/32),ce=this.bits,ge=U;ge<=J;ge++){var ut=(2<<(geU?0:31&c))&4294967295;if((ce[ge]&ut)!==(w?ut:0))return!1}return!0},y.prototype.appendBit=function(c){this.ensureCapacity(this.size+1),c&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},y.prototype.appendBits=function(c,l){if(l<0||l>32)throw new Bi("Num bits must be between 0 and 32");this.ensureCapacity(this.size+l);for(var w=l;w>0;w--)this.appendBit(1==(c>>w-1&1))},y.prototype.appendBitArray=function(c){var l=c.size;this.ensureCapacity(this.size+l);for(var w=0;w>1&1431655765|(1431655765&ce)<<1)>>2&858993459|(858993459&ce)<<2)>>4&252645135|(252645135&ce)<<4)>>8&16711935|(16711935&ce)<<8)>>16&65535|(65535&ce)<<16}if(this.size!==32*w){var ge=32*w-this.size,Pe=c[0]>>>ge;for(J=1;J>>ge}c[w-1]=Pe}this.bits=c},y.makeArray=function(c){return new Int32Array(Math.floor((c+31)/32))},y.prototype.equals=function(c){return c instanceof y&&(this.size===c.size&&Vi.equals(this.bits,c.bits))},y.prototype.hashCode=function(){return 31*this.size+Vi.hashCode(this.bits)},y.prototype.toString=function(){for(var c="",l=0,w=this.size;l=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(ce),Ht=Ot.next();!Ht.done;Ht=Ot.next())y.NAME_TO_ECI.set(Ht.value,this)}catch(jr){U={error:jr}}finally{try{Ht&&!Ht.done&&(J=Ot.return)&&J.call(Ot)}finally{if(U)throw U.error}}}return y.prototype.getValueIdentifier=function(){return this.valueIdentifier},y.prototype.getName=function(){return this.name},y.prototype.getValue=function(){return this.values[0]},y.getCharacterSetECIByValue=function(c){if(c<0||c>=900)throw new Qn("incorect value");var l=y.VALUES_TO_ECI.get(c);if(void 0===l)throw new Qn("incorect value");return l},y.getCharacterSetECIByName=function(c){var l=y.NAME_TO_ECI.get(c);if(void 0===l)throw new Qn("incorect value");return l},y.prototype.equals=function(c){if(!(c instanceof y))return!1;var l=c;return this.getName()===l.getName()},y.VALUE_IDENTIFIER_TO_ECI=new Map,y.VALUES_TO_ECI=new Map,y.NAME_TO_ECI=new Map,y.Cp437=new y(Ti.Cp437,Int32Array.from([0,2]),"Cp437"),y.ISO8859_1=new y(Ti.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),y.ISO8859_2=new y(Ti.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),y.ISO8859_3=new y(Ti.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),y.ISO8859_4=new y(Ti.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),y.ISO8859_5=new y(Ti.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),y.ISO8859_6=new y(Ti.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),y.ISO8859_7=new y(Ti.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),y.ISO8859_8=new y(Ti.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),y.ISO8859_9=new y(Ti.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),y.ISO8859_10=new y(Ti.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),y.ISO8859_11=new y(Ti.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),y.ISO8859_13=new y(Ti.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),y.ISO8859_14=new y(Ti.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),y.ISO8859_15=new y(Ti.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),y.ISO8859_16=new y(Ti.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),y.SJIS=new y(Ti.SJIS,20,"SJIS","Shift_JIS"),y.Cp1250=new y(Ti.Cp1250,21,"Cp1250","windows-1250"),y.Cp1251=new y(Ti.Cp1251,22,"Cp1251","windows-1251"),y.Cp1252=new y(Ti.Cp1252,23,"Cp1252","windows-1252"),y.Cp1256=new y(Ti.Cp1256,24,"Cp1256","windows-1256"),y.UnicodeBigUnmarked=new y(Ti.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),y.UTF8=new y(Ti.UTF8,26,"UTF8","UTF-8"),y.ASCII=new y(Ti.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),y.Big5=new y(Ti.Big5,28,"Big5"),y.GB18030=new y(Ti.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),y.EUC_KR=new y(Ti.EUC_KR,30,"EUC_KR","EUC-KR"),y}();var na=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const ia=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return na(c,y),c.kind="UnsupportedOperationException",c}(Us),Wt=function(){function y(){}return y.decode=function(c,l){var w=this.encodingName(l);return this.customDecoder?this.customDecoder(c,w):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(w)?this.decodeFallback(c,w):new TextDecoder(w).decode(c)},y.shouldDecodeOnFallback=function(c){return!y.isBrowser()&&"ISO-8859-1"===c},y.encode=function(c,l){var w=this.encodingName(l);return this.customEncoder?this.customEncoder(c,w):typeof TextEncoder>"u"?this.encodeFallback(c):(new TextEncoder).encode(c)},y.isBrowser=function(){return typeof window<"u"&&"[object Window]"==={}.toString.call(window)},y.encodingName=function(c){return"string"==typeof c?c:c.getName()},y.encodingCharacterSet=function(c){return c instanceof Yo?c:Yo.getCharacterSetECIByName(c)},y.decodeFallback=function(c,l){var w=this.encodingCharacterSet(l);if(y.isDecodeFallbackSupported(w)){for(var U="",J=0,ce=c.length;J3&&239===c[0]&&187===c[1]&&191===c[2],On=0;On0?128&Wn?ge--:ce=!1:128&Wn&&(64&Wn?(ge++,32&Wn?(ge++,16&Wn?(ge++,8&Wn?ce=!1:ut++):Ge++):Pe++):ce=!1)),U&&(Wn>127&&Wn<160?U=!1:Wn>159&&(Wn<192||215===Wn||247===Wn)&&dn++),J&&(_t>0?Wn<64||127===Wn||Wn>252?J=!1:_t--:128===Wn||160===Wn||Wn>239?J=!1:Wn>160&&Wn<224?(Ot++,Sr=0,++Ht>jr&&(jr=Ht)):Wn>127?(_t++,Ht=0,++Sr>sn&&(sn=Sr)):(Ht=0,Sr=0))}return ce&&ge>0&&(ce=!1),J&&_t>0&&(J=!1),ce&&(ln||Pe+Ge+ut>0)?y.UTF8:J&&(y.ASSUME_SHIFT_JIS||jr>=3||sn>=3)?y.SHIFT_JIS:U&&J?2===jr&&2===Ot||10*dn>=w?y.SHIFT_JIS:y.ISO88591:U?y.ISO88591:J?y.SHIFT_JIS:ce?y.UTF8:y.PLATFORM_DEFAULT_ENCODING},y.format=function(c){for(var l=[],w=1;wce){if(-1===ge)ge=J-ce;else if(J-ce!==ge)throw new Bi("row lengths do not match");ce=J,Pe++}Ge++}else if(c.substring(Ge,Ge+l.length)===l)Ge+=l.length,U[J]=!0,J++;else{if(c.substring(Ge,Ge+w.length)!==w)throw new Bi("illegal character encountered: "+c.substring(Ge));Ge+=w.length,U[J]=!1,J++}if(J>ce){if(-1===ge)ge=J-ce;else if(J-ce!==ge)throw new Bi("row lengths do not match");Pe++}for(var ut=new y(ge,Pe),_t=0;_t>>(31&c)&1)},y.prototype.set=function(c,l){var w=l*this.rowSize+Math.floor(c/32);this.bits[w]|=1<<(31&c)&4294967295},y.prototype.unset=function(c,l){var w=l*this.rowSize+Math.floor(c/32);this.bits[w]&=~(1<<(31&c)&4294967295)},y.prototype.flip=function(c,l){var w=l*this.rowSize+Math.floor(c/32);this.bits[w]^=1<<(31&c)&4294967295},y.prototype.xor=function(c){if(this.width!==c.getWidth()||this.height!==c.getHeight()||this.rowSize!==c.getRowSize())throw new Bi("input matrix dimensions do not match");for(var l=new bi(Math.floor(this.width/32)+1),w=this.rowSize,U=this.bits,J=0,ce=this.height;Jthis.height||J>this.width)throw new Bi("The region must fit inside the matrix");for(var ge=this.rowSize,Pe=this.bits,Ge=l;GePe&&(Pe=Ge),32*utge){for(Ot=31;!(_t>>>Ot);)Ot--;32*ut+Ot>ge&&(ge=32*ut+Ot)}}}return ge=0&&0===l[w];)w--;if(w<0)return null;for(var U=Math.floor(w/c),J=32*Math.floor(w%c),ce=l[w],ge=31;!(ce>>>ge);)ge--;return Int32Array.from([J+=ge,U])},y.prototype.getWidth=function(){return this.width},y.prototype.getHeight=function(){return this.height},y.prototype.getRowSize=function(){return this.rowSize},y.prototype.equals=function(c){return c instanceof y&&(this.width===c.width&&this.height===c.height&&this.rowSize===c.rowSize&&Vi.equals(this.bits,c.bits))},y.prototype.hashCode=function(){var c=this.width;return 31*(c=31*(c=31*(c=31*c+this.width)+this.height)+this.rowSize)+Vi.hashCode(this.bits)},y.prototype.toString=function(c,l,w){return void 0===c&&(c="X "),void 0===l&&(l=" "),void 0===w&&(w="\n"),this.buildToString(c,l,w)},y.prototype.buildToString=function(c,l,w){for(var U=new Ur,J=0,ce=this.height;J>c.LUMINANCE_SHIFT]++;var Ge=c.estimateBlackPoint(ge);if(J<3)for(Pe=0;Pe>c.LUMINANCE_SHIFT]++;var Ht=c.estimateBlackPoint(ce),Sr=l.getMatrix();for(ge=0;gece&&(J=ge,ce=l[ge]),l[ge]>U&&(U=l[ge]);var Pe=0,Ge=0;for(ge=0;geGe&&(Pe=ge,Ge=_t)}if(J>Pe){var Ot=J;J=Pe,Pe=Ot}if(Pe-J<=w/16)throw new Gn;var Ht=Pe-1,Sr=-1;for(ge=Pe-1;ge>J;ge--){var _t,jr=ge-J;(_t=jr*jr*(Pe-ge)*(U-l[ge]))>Sr&&(Ht=ge,Sr=_t)}return Ht<=c.MINIMUM_DIMENSION&&U>=c.MINIMUM_DIMENSION){var J=l.getMatrix(),ce=w>>c.BLOCK_SIZE_POWER;w&c.BLOCK_SIZE_MASK&&ce++;var ge=U>>c.BLOCK_SIZE_POWER;U&c.BLOCK_SIZE_MASK&&ge++;var Pe=c.calculateBlackPoints(J,ce,ge,w,U),Ge=new Qi(w,U);c.calculateThresholdForBlock(J,ce,ge,w,U,Pe,Ge),this.matrix=Ge}else this.matrix=y.prototype.getBlackMatrix.call(this);return this.matrix},c.prototype.createBinarizer=function(l){return new c(l)},c.calculateThresholdForBlock=function(l,w,U,J,ce,ge,Pe){for(var Ge=ce-c.BLOCK_SIZE,ut=J-c.BLOCK_SIZE,_t=0;_tGe&&(Ot=Ge);for(var Ht=c.cap(_t,2,U-3),Sr=0;Srut&&(jr=ut);for(var sn=c.cap(Sr,2,w-3),dn=0,ln=-2;ln<=2;ln++){var On=ge[Ht+ln];dn+=On[sn-2]+On[sn-1]+On[sn]+On[sn+1]+On[sn+2]}c.thresholdBlock(l,jr,Ot,dn/25,J,Pe)}}},c.cap=function(l,w,U){return lU?U:l},c.thresholdBlock=function(l,w,U,J,ce,ge){for(var Pe=0,Ge=U*ce+w;Pege&&(_t=ge);for(var Ot=0;OtPe&&(Ht=Pe);for(var Sr=0,jr=255,sn=0,dn=0,ln=_t*J+Ht;dnsn&&(sn=Wn)}if(sn-jr>c.MIN_DYNAMIC_RANGE)for(dn++,ln+=J;dn>2*c.BLOCK_SIZE_POWER;if(sn-jr<=c.MIN_DYNAMIC_RANGE&&(vi=jr/2,ut>0&&Ot>0)){var ki=(Ge[ut-1][Ot]+2*Ge[ut][Ot-1]+Ge[ut-1][Ot-1])/4;jr>10}else{ce=0,ge=0;for(var Sr=l.length;ce>10)}return J},c.prototype.getRow=function(l,w){if(l<0||l>=this.getHeight())throw new Bi("Requested row is outside the image: "+l);var U=this.getWidth(),J=l*U;return null===w?w=this.buffer.slice(J,J+U):(w.length0&&J[J.length-1])&&(6===Ge[0]||2===Ge[0])){l=0;continue}if(3===Ge[0]&&(!J||Ge[1]>J[0]&&Ge[1]=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),U=w.next();!U.done;U=w.next())"videoinput"===(ce="video"===(J=U.value).kind?"videoinput":J.kind)&&l.push({deviceId:J.deviceId||J.id,label:J.label||"Video device "+(l.length+1),kind:ce,groupId:J.groupId})}catch(Sr){_t={error:Sr}}finally{try{U&&!U.done&&(Ot=w.return)&&Ot.call(w)}finally{if(_t)throw _t.error}}return[2,l]}})})},y.prototype.getVideoInputDevices=function(){return Ka(this,void 0,void 0,function(){return sc(this,function(l){switch(l.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,l.sent().map(function(w){return new $s(w.deviceId,w.label)})]}})})},y.prototype.findDeviceById=function(c){return Ka(this,void 0,void 0,function(){var l;return sc(this,function(w){switch(w.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(l=w.sent())?[2,l.find(function(U){return U.deviceId===c})]:[2,null]}})})},y.prototype.decodeFromInputVideoDevice=function(c,l){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:return[4,this.decodeOnceFromVideoDevice(c,l)];case 1:return[2,w.sent()]}})})},y.prototype.decodeOnceFromVideoDevice=function(c,l){return Ka(this,void 0,void 0,function(){return sc(this,function(J){switch(J.label){case 0:return this.reset(),[4,this.decodeOnceFromConstraints({video:c?{deviceId:{exact:c}}:{facingMode:"environment"}},l)];case 1:return[2,J.sent()]}})})},y.prototype.decodeOnceFromConstraints=function(c,l){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(U){switch(U.label){case 0:return[4,navigator.mediaDevices.getUserMedia(c)];case 1:return w=U.sent(),[4,this.decodeOnceFromStream(w,l)];case 2:return[2,U.sent()]}})})},y.prototype.decodeOnceFromStream=function(c,l){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(J){switch(J.label){case 0:return this.reset(),[4,this.attachStreamToVideo(c,l)];case 1:return w=J.sent(),[4,this.decodeOnce(w)];case 2:return[2,J.sent()]}})})},y.prototype.decodeFromInputVideoDeviceContinuously=function(c,l,w){return Ka(this,void 0,void 0,function(){return sc(this,function(U){switch(U.label){case 0:return[4,this.decodeFromVideoDevice(c,l,w)];case 1:return[2,U.sent()]}})})},y.prototype.decodeFromVideoDevice=function(c,l,w){return Ka(this,void 0,void 0,function(){return sc(this,function(ce){switch(ce.label){case 0:return[4,this.decodeFromConstraints({video:c?{deviceId:{exact:c}}:{facingMode:"environment"}},l,w)];case 1:return[2,ce.sent()]}})})},y.prototype.decodeFromConstraints=function(c,l,w){return Ka(this,void 0,void 0,function(){var U;return sc(this,function(J){switch(J.label){case 0:return[4,navigator.mediaDevices.getUserMedia(c)];case 1:return U=J.sent(),[4,this.decodeFromStream(U,l,w)];case 2:return[2,J.sent()]}})})},y.prototype.decodeFromStream=function(c,l,w){return Ka(this,void 0,void 0,function(){var U;return sc(this,function(J){switch(J.label){case 0:return this.reset(),[4,this.attachStreamToVideo(c,l)];case 1:return U=J.sent(),[4,this.decodeContinuously(U,w)];case 2:return[2,J.sent()]}})})},y.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},y.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},y.prototype.attachStreamToVideo=function(c,l){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(U){switch(U.label){case 0:return w=this.prepareVideoElement(l),this.addVideoSource(w,c),this.videoElement=w,this.stream=c,[4,this.playVideoOnLoadAsync(w)];case 1:return U.sent(),[2,w]}})})},y.prototype.playVideoOnLoadAsync=function(c){var l=this;return new Promise(function(w,U){return l.playVideoOnLoad(c,function(){return w()})})},y.prototype.playVideoOnLoad=function(c,l){var w=this;this.videoEndedListener=function(){return w.stopStreams()},this.videoCanPlayListener=function(){return w.tryPlayVideo(c)},c.addEventListener("ended",this.videoEndedListener),c.addEventListener("canplay",this.videoCanPlayListener),c.addEventListener("playing",l),this.tryPlayVideo(c)},y.prototype.isVideoPlaying=function(c){return c.currentTime>0&&!c.paused&&!c.ended&&c.readyState>2},y.prototype.tryPlayVideo=function(c){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:if(this.isVideoPlaying(c))return console.warn("Trying to play video that is already playing."),[2];w.label=1;case 1:return w.trys.push([1,3,,4]),[4,c.play()];case 2:return w.sent(),[3,4];case 3:return w.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},y.prototype.getMediaElement=function(c,l){var w=document.getElementById(c);if(!w)throw new vs("element with id '"+c+"' not found");if(w.nodeName.toLowerCase()!==l.toLowerCase())throw new vs("element with id '"+c+"' must be an "+l+" element");return w},y.prototype.decodeFromImage=function(c,l){if(!c&&!l)throw new vs("either imageElement with a src set or an url must be provided");return l&&!c?this.decodeFromImageUrl(l):this.decodeFromImageElement(c)},y.prototype.decodeFromVideo=function(c,l){if(!c&&!l)throw new vs("Either an element with a src set or an URL must be provided");return l&&!c?this.decodeFromVideoUrl(l):this.decodeFromVideoElement(c)},y.prototype.decodeFromVideoContinuously=function(c,l,w){if(void 0===c&&void 0===l)throw new vs("Either an element with a src set or an URL must be provided");return l&&!c?this.decodeFromVideoUrlContinuously(l,w):this.decodeFromVideoElementContinuously(c,w)},y.prototype.decodeFromImageElement=function(c){if(!c)throw new vs("An image element must be provided.");this.reset();var l=this.prepareImageElement(c);return this.imageElement=l,this.isImageLoaded(l)?this.decodeOnce(l,!1,!0):this._decodeOnLoadImage(l)},y.prototype.decodeFromVideoElement=function(c){var l=this._decodeFromVideoElementSetup(c);return this._decodeOnLoadVideo(l)},y.prototype.decodeFromVideoElementContinuously=function(c,l){var w=this._decodeFromVideoElementSetup(c);return this._decodeOnLoadVideoContinuously(w,l)},y.prototype._decodeFromVideoElementSetup=function(c){if(!c)throw new vs("A video element must be provided.");this.reset();var l=this.prepareVideoElement(c);return this.videoElement=l,l},y.prototype.decodeFromImageUrl=function(c){if(!c)throw new vs("An URL must be provided.");this.reset();var l=this.prepareImageElement();this.imageElement=l;var w=this._decodeOnLoadImage(l);return l.src=c,w},y.prototype.decodeFromVideoUrl=function(c){if(!c)throw new vs("An URL must be provided.");this.reset();var l=this.prepareVideoElement(),w=this.decodeFromVideoElement(l);return l.src=c,w},y.prototype.decodeFromVideoUrlContinuously=function(c,l){if(!c)throw new vs("An URL must be provided.");this.reset();var w=this.prepareVideoElement(),U=this.decodeFromVideoElementContinuously(w,l);return w.src=c,U},y.prototype._decodeOnLoadImage=function(c){var l=this;return new Promise(function(w,U){l.imageLoadedListener=function(){return l.decodeOnce(c,!1,!0).then(w,U)},c.addEventListener("load",l.imageLoadedListener)})},y.prototype._decodeOnLoadVideo=function(c){return Ka(this,void 0,void 0,function(){return sc(this,function(l){switch(l.label){case 0:return[4,this.playVideoOnLoadAsync(c)];case 1:return l.sent(),[4,this.decodeOnce(c)];case 2:return[2,l.sent()]}})})},y.prototype._decodeOnLoadVideoContinuously=function(c,l){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:return[4,this.playVideoOnLoadAsync(c)];case 1:return w.sent(),this.decodeContinuously(c,l),[2]}})})},y.prototype.isImageLoaded=function(c){return!(!c.complete||0===c.naturalWidth)},y.prototype.prepareImageElement=function(c){var l;return typeof c>"u"&&((l=document.createElement("img")).width=200,l.height=200),"string"==typeof c&&(l=this.getMediaElement(c,"img")),c instanceof HTMLImageElement&&(l=c),l},y.prototype.prepareVideoElement=function(c){var l;return!c&&typeof document<"u"&&((l=document.createElement("video")).width=200,l.height=200),"string"==typeof c&&(l=this.getMediaElement(c,"video")),c instanceof HTMLVideoElement&&(l=c),l.setAttribute("autoplay","true"),l.setAttribute("muted","true"),l.setAttribute("playsinline","true"),l},y.prototype.decodeOnce=function(c,l,w){var U=this;void 0===l&&(l=!0),void 0===w&&(w=!0),this._stopAsyncDecode=!1;var J=function(ce,ge){if(U._stopAsyncDecode)return ge(new Gn("Video stream has ended before any code could be detected.")),void(U._stopAsyncDecode=void 0);try{ce(U.decode(c))}catch(Ot){if(l&&Ot instanceof Gn||(Ot instanceof rs||Ot instanceof Qn)&&w)return setTimeout(J,U._timeBetweenDecodingAttempts,ce,ge);ge(Ot)}};return new Promise(function(ce,ge){return J(ce,ge)})},y.prototype.decodeContinuously=function(c,l){var w=this;this._stopContinuousDecode=!1;var U=function(){if(w._stopContinuousDecode)w._stopContinuousDecode=void 0;else try{var J=w.decode(c);l(J,null),setTimeout(U,w.timeBetweenScansMillis)}catch(Pe){l(null,Pe),(Pe instanceof rs||Pe instanceof Qn||Pe instanceof Gn)&&setTimeout(U,w._timeBetweenDecodingAttempts)}};U()},y.prototype.decode=function(c){var l=this.createBinaryBitmap(c);return this.decodeBitmap(l)},y.prototype.createBinaryBitmap=function(c){this.getCaptureCanvasContext(c),c instanceof HTMLVideoElement?this.drawFrameOnCanvas(c):this.drawImageOnCanvas(c);var w=this.getCaptureCanvas(c),U=new dc(w),J=new mc(U);return new jc(J)},y.prototype.getCaptureCanvasContext=function(c){if(!this.captureCanvasContext){var l=this.getCaptureCanvas(c),w=void 0;try{w=l.getContext("2d",{willReadFrequently:!0})}catch{w=l.getContext("2d")}this.captureCanvasContext=w}return this.captureCanvasContext},y.prototype.getCaptureCanvas=function(c){if(!this.captureCanvas){var l=this.createCaptureCanvas(c);this.captureCanvas=l}return this.captureCanvas},y.prototype.drawFrameOnCanvas=function(c,l,w){void 0===l&&(l={sx:0,sy:0,sWidth:c.videoWidth,sHeight:c.videoHeight,dx:0,dy:0,dWidth:c.videoWidth,dHeight:c.videoHeight}),void 0===w&&(w=this.captureCanvasContext),w.drawImage(c,l.sx,l.sy,l.sWidth,l.sHeight,l.dx,l.dy,l.dWidth,l.dHeight)},y.prototype.drawImageOnCanvas=function(c,l,w){void 0===l&&(l={sx:0,sy:0,sWidth:c.naturalWidth,sHeight:c.naturalHeight,dx:0,dy:0,dWidth:c.naturalWidth,dHeight:c.naturalHeight}),void 0===w&&(w=this.captureCanvasContext),w.drawImage(c,l.sx,l.sy,l.sWidth,l.sHeight,l.dx,l.dy,l.dWidth,l.dHeight)},y.prototype.decodeBitmap=function(c){return this.reader.decode(c,this._hints)},y.prototype.createCaptureCanvas=function(c){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var w,U,l=document.createElement("canvas");return typeof c<"u"&&(c instanceof HTMLVideoElement?(w=c.videoWidth,U=c.videoHeight):c instanceof HTMLImageElement&&(w=c.naturalWidth||c.width,U=c.naturalHeight||c.height)),l.style.width=w+"px",l.style.height=U+"px",l.width=w,l.height=U,l},y.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(c){return c.stop()}),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},y.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},y.prototype._destroyVideoElement=function(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},y.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},y.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},y.prototype.addVideoSource=function(c,l){try{c.srcObject=l}catch{c.src=URL.createObjectURL(l)}},y.prototype.cleanVideoSource=function(c){try{c.srcObject=null}catch{c.src=""}this.videoElement.removeAttribute("src")},y}();const Cs=function(){function y(c,l,w,U,J,ce){void 0===w&&(w=null==l?0:8*l.length),void 0===ce&&(ce=Rt.currentTimeMillis()),this.text=c,this.rawBytes=l,this.numBits=w,this.resultPoints=U,this.format=J,this.timestamp=ce,this.text=c,this.rawBytes=l,this.numBits=null==w?null==l?0:8*l.length:w,this.resultPoints=U,this.format=J,this.resultMetadata=null,this.timestamp=null==ce?Rt.currentTimeMillis():ce}return y.prototype.getText=function(){return this.text},y.prototype.getRawBytes=function(){return this.rawBytes},y.prototype.getNumBits=function(){return this.numBits},y.prototype.getResultPoints=function(){return this.resultPoints},y.prototype.getBarcodeFormat=function(){return this.format},y.prototype.getResultMetadata=function(){return this.resultMetadata},y.prototype.putMetadata=function(c,l){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(c,l)},y.prototype.putAllMetadata=function(c){null!==c&&(this.resultMetadata=null===this.resultMetadata?c:new Map(c))},y.prototype.addResultPoints=function(c){var l=this.resultPoints;if(null===l)this.resultPoints=c;else if(null!==c&&c.length>0){var w=new Array(l.length+c.length);Rt.arraycopy(l,0,w,0,l.length),Rt.arraycopy(c,0,w,l.length,c.length),this.resultPoints=w}},y.prototype.getTimestamp=function(){return this.timestamp},y.prototype.toString=function(){return this.text},y}();var vf=function(y){return y[y.AZTEC=0]="AZTEC",y[y.CODABAR=1]="CODABAR",y[y.CODE_39=2]="CODE_39",y[y.CODE_93=3]="CODE_93",y[y.CODE_128=4]="CODE_128",y[y.DATA_MATRIX=5]="DATA_MATRIX",y[y.EAN_8=6]="EAN_8",y[y.EAN_13=7]="EAN_13",y[y.ITF=8]="ITF",y[y.MAXICODE=9]="MAXICODE",y[y.PDF_417=10]="PDF_417",y[y.QR_CODE=11]="QR_CODE",y[y.RSS_14=12]="RSS_14",y[y.RSS_EXPANDED=13]="RSS_EXPANDED",y[y.UPC_A=14]="UPC_A",y[y.UPC_E=15]="UPC_E",y[y.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION",y}(vf||{});const Co=vf;var vh=function(y){return y[y.OTHER=0]="OTHER",y[y.ORIENTATION=1]="ORIENTATION",y[y.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",y[y.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",y[y.ISSUE_NUMBER=4]="ISSUE_NUMBER",y[y.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",y[y.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",y[y.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",y[y.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",y[y.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",y[y.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY",y}(vh||{});const gc=vh,qu=function(){function y(c,l,w,U,J,ce){void 0===J&&(J=-1),void 0===ce&&(ce=-1),this.rawBytes=c,this.text=l,this.byteSegments=w,this.ecLevel=U,this.structuredAppendSequenceNumber=J,this.structuredAppendParity=ce,this.numBits=null==c?0:8*c.length}return y.prototype.getRawBytes=function(){return this.rawBytes},y.prototype.getNumBits=function(){return this.numBits},y.prototype.setNumBits=function(c){this.numBits=c},y.prototype.getText=function(){return this.text},y.prototype.getByteSegments=function(){return this.byteSegments},y.prototype.getECLevel=function(){return this.ecLevel},y.prototype.getErrorsCorrected=function(){return this.errorsCorrected},y.prototype.setErrorsCorrected=function(c){this.errorsCorrected=c},y.prototype.getErasures=function(){return this.erasures},y.prototype.setErasures=function(c){this.erasures=c},y.prototype.getOther=function(){return this.other},y.prototype.setOther=function(c){this.other=c},y.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},y.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},y.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},y}(),tl=function(){function y(){}return y.prototype.exp=function(c){return this.expTable[c]},y.prototype.log=function(c){if(0===c)throw new Bi;return this.logTable[c]},y.addOrSubtract=function(c,l){return c^l},y}(),mu=function(){function y(c,l){if(0===l.length)throw new Bi;this.field=c;var w=l.length;if(w>1&&0===l[0]){for(var U=1;Uw.length){var U=l;l=w,w=U}var J=new Int32Array(w.length),ce=w.length-l.length;Rt.arraycopy(w,0,J,0,ce);for(var ge=ce;ge=c.getDegree()&&!U.isZero();){var ge=U.getDegree()-c.getDegree(),Pe=l.multiply(U.getCoefficient(U.getDegree()),ce),Ge=c.multiplyByMonomial(ge,Pe),ut=l.buildMonomial(ge,Pe);w=w.addOrSubtract(ut),U=U.addOrSubtract(Ge)}return[w,U]},y.prototype.toString=function(){for(var c="",l=this.getDegree();l>=0;l--){var w=this.getCoefficient(l);if(0!==w){if(w<0?(c+=" - ",w=-w):c.length>0&&(c+=" + "),0===l||1!==w){var U=this.field.log(w);0===U?c+="1":1===U?c+="a":(c+="a^",c+=U)}0!==l&&(1===l?c+="x":(c+="x^",c+=l))}}return c},y}();var Ll=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Rd=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return Ll(c,y),c.kind="ArithmeticException",c}(Us);var ju=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Pa=function(y){function c(l,w,U){var J=y.call(this)||this;J.primitive=l,J.size=w,J.generatorBase=U;for(var ce=new Int32Array(w),ge=1,Pe=0;Pe=w&&(ge^=l,ge&=w-1);J.expTable=ce;var Ge=new Int32Array(w);for(Pe=0;Pe=(w/2|0);){var ut=ce,_t=Pe;if(Pe=Ge,(ce=ge).isZero())throw new Hl("r_{i-1} was zero");ge=ut;for(var Ot=J.getZero(),Ht=ce.getCoefficient(ce.getDegree()),Sr=J.inverse(Ht);ge.getDegree()>=ce.getDegree()&&!ge.isZero();){var jr=ge.getDegree()-ce.getDegree(),sn=J.multiply(ge.getCoefficient(ge.getDegree()),Sr);Ot=Ot.addOrSubtract(J.buildMonomial(jr,sn)),ge=ge.addOrSubtract(ce.multiplyByMonomial(jr,sn))}if(Ge=Ot.multiply(Pe).addOrSubtract(_t),ge.getDegree()>=ce.getDegree())throw new ou("Division algorithm failed to reduce polynomial?")}var dn=Ge.getCoefficient(0);if(0===dn)throw new Hl("sigmaTilde(0) was zero");var ln=J.inverse(dn);return[Ge.multiplyScalar(ln),ge.multiplyScalar(ln)]},y.prototype.findErrorLocations=function(c){var l=c.getDegree();if(1===l)return Int32Array.from([c.getCoefficient(1)]);for(var w=new Int32Array(l),U=0,J=this.field,ce=1;ce1,Sr,Sr+w-1),Sr+=w-1;else for(var jr=w-1;jr>=0;--jr)Ht[Sr++]=!!(Ot&1<=8?y.readCode(c,l,8):y.readCode(c,l,w)<<8-w},y.convertBoolArrayToByteArray=function(c){for(var l=new Uint8Array((c.length+7)/8),w=0;w","?","[","]","{","}","CTRL_UL"],y.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],y}(),Ys=function(){function y(){}return y.round=function(c){return isNaN(c)?0:c<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:c>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:c+(c<0?-.5:.5)|0},y.distance=function(c,l,w,U){var J=c-w,ce=l-U;return Math.sqrt(J*J+ce*ce)},y.sum=function(c){for(var l=0,w=0,U=c.length;w!==U;w++)l+=c[w];return l},y}(),yc=function(){function y(){}return y.floatToIntBits=function(c){return c},y.MAX_VALUE=Number.MAX_SAFE_INTEGER,y}(),_o=function(){function y(c,l){this.x=c,this.y=l}return y.prototype.getX=function(){return this.x},y.prototype.getY=function(){return this.y},y.prototype.equals=function(c){return c instanceof y&&(this.x===c.x&&this.y===c.y)},y.prototype.hashCode=function(){return 31*yc.floatToIntBits(this.x)+yc.floatToIntBits(this.y)},y.prototype.toString=function(){return"("+this.x+","+this.y+")"},y.orderBestPatterns=function(c){var J,ce,ge,l=this.distance(c[0],c[1]),w=this.distance(c[1],c[2]),U=this.distance(c[0],c[2]);if(w>=l&&w>=U?(ce=c[0],J=c[1],ge=c[2]):U>=w&&U>=l?(ce=c[1],J=c[0],ge=c[2]):(ce=c[2],J=c[0],ge=c[1]),this.crossProductZ(J,ce,ge)<0){var Pe=J;J=ge,ge=Pe}c[0]=J,c[1]=ce,c[2]=ge},y.distance=function(c,l){return Ys.distance(c.x,c.y,l.x,l.y)},y.crossProductZ=function(c,l,w){var U=l.x,J=l.y;return(w.x-U)*(c.y-J)-(w.y-J)*(c.x-U)},y}(),cr=function(){function y(c,l){this.bits=c,this.points=l}return y.prototype.getBits=function(){return this.bits},y.prototype.getPoints=function(){return this.points},y}();var Mt=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Xr=function(y){function c(l,w,U,J,ce){var ge=y.call(this,l,w)||this;return ge.compact=U,ge.nbDatablocks=J,ge.nbLayers=ce,ge}return Mt(c,y),c.prototype.getNbLayers=function(){return this.nbLayers},c.prototype.getNbDatablocks=function(){return this.nbDatablocks},c.prototype.isCompact=function(){return this.compact},c}(cr),ri=function(){function y(c,l,w,U){this.image=c,this.height=c.getHeight(),this.width=c.getWidth(),null==l&&(l=y.INIT_SIZE),null==w&&(w=c.getWidth()/2|0),null==U&&(U=c.getHeight()/2|0);var J=l/2|0;if(this.leftInit=w-J,this.rightInit=w+J,this.upInit=U-J,this.downInit=U+J,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Gn}return y.prototype.detect=function(){for(var c=this.leftInit,l=this.rightInit,w=this.upInit,U=this.downInit,J=!1,ce=!0,ge=!1,Pe=!1,Ge=!1,ut=!1,_t=!1,Ot=this.width,Ht=this.height;ce;){ce=!1;for(var Sr=!0;(Sr||!Pe)&&l=Ot){J=!0;break}for(var jr=!0;(jr||!Ge)&&U=Ht){J=!0;break}for(var sn=!0;(sn||!ut)&&c>=0;)(sn=this.containsBlackPoint(w,U,c,!1))?(c--,ce=!0,ut=!0):ut||c--;if(c<0){J=!0;break}for(var dn=!0;(dn||!_t)&&w>=0;)(dn=this.containsBlackPoint(c,l,w,!0))?(w--,ce=!0,_t=!0):_t||w--;if(w<0){J=!0;break}ce&&(ge=!0)}if(!J&&ge){for(var ln=l-c,On=null,Wn=1;null===On&&Wnw||Pe<-1||Pe>U)throw new Gn;J=!1,-1===ge?(l[ce]=0,J=!0):ge===w&&(l[ce]=w-1,J=!0),-1===Pe?(l[ce+1]=0,J=!0):Pe===U&&(l[ce+1]=U-1,J=!0)}for(J=!0,ce=l.length-2;ce>=0&&J;ce-=2){if(ge=Math.floor(l[ce]),Pe=Math.floor(l[ce+1]),ge<-1||ge>w||Pe<-1||Pe>U)throw new Gn;J=!1,-1===ge?(l[ce]=0,J=!0):ge===w&&(l[ce]=w-1,J=!0),-1===Pe?(l[ce+1]=0,J=!0):Pe===U&&(l[ce+1]=U-1,J=!0)}},y}(),Bs=function(){function y(c,l,w,U,J,ce,ge,Pe,Ge){this.a11=c,this.a21=l,this.a31=w,this.a12=U,this.a22=J,this.a32=ce,this.a13=ge,this.a23=Pe,this.a33=Ge}return y.quadrilateralToQuadrilateral=function(c,l,w,U,J,ce,ge,Pe,Ge,ut,_t,Ot,Ht,Sr,jr,sn){var dn=y.quadrilateralToSquare(c,l,w,U,J,ce,ge,Pe);return y.squareToQuadrilateral(Ge,ut,_t,Ot,Ht,Sr,jr,sn).times(dn)},y.prototype.transformPoints=function(c){for(var l=c.length,w=this.a11,U=this.a12,J=this.a13,ce=this.a21,ge=this.a22,Pe=this.a23,Ge=this.a31,ut=this.a32,_t=this.a33,Ot=0;Ot>1&127):(U<<=10,U+=(ce>>2&992)+(ce>>1&31))}var ge=this.getCorrectedParameterData(U,this.compact);this.compact?(this.nbLayers=1+(ge>>6),this.nbDataBlocks=1+(63&ge)):(this.nbLayers=1+(ge>>11),this.nbDataBlocks=1+(2047&ge))},y.prototype.getRotation=function(c,l){var w=0;c.forEach(function(J,ce,ge){w=(J>>l-2<<1)+(1&J)+(w<<3)}),w=((1&w)<<11)+(w>>1);for(var U=0;U<4;U++)if(pi.bitCount(w^this.EXPECTED_CORNER_BITS[U])<=2)return U;throw new Gn},y.prototype.getCorrectedParameterData=function(c,l){var w,U;l?(w=7,U=2):(w=10,U=4);for(var J=w-U,ce=new Int32Array(w),ge=w-1;ge>=0;--ge)ce[ge]=15&c,c>>=4;try{new xc(Pa.AZTEC_PARAM).decode(ce,J)}catch{throw new Gn}var Ge=0;for(ge=0;ge2){var _t=this.distancePoint(ut,ge)*this.nbCenterLayers/(this.distancePoint(J,l)*(this.nbCenterLayers+2));if(_t<.75||_t>1.25||!this.isWhiteOrBlackRectangle(ge,Pe,Ge,ut))break}l=ge,w=Pe,U=Ge,J=ut,ce=!ce}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new Gn;this.compact=5===this.nbCenterLayers;var Ot=new _o(l.getX()+.5,l.getY()-.5),Ht=new _o(w.getX()+.5,w.getY()+.5),Sr=new _o(U.getX()-.5,U.getY()+.5),jr=new _o(J.getX()-.5,J.getY()-.5);return this.expandSquare([Ot,Ht,Sr,jr],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},y.prototype.getMatrixCenter=function(){var c,l,w,U;try{c=(J=new ri(this.image).detect())[0],l=J[1],w=J[2],U=J[3]}catch{var ce=this.image.getWidth()/2,ge=this.image.getHeight()/2;c=this.getFirstDifferent(new is(ce+7,ge-7),!1,1,-1).toResultPoint(),l=this.getFirstDifferent(new is(ce+7,ge+7),!1,1,1).toResultPoint(),w=this.getFirstDifferent(new is(ce-7,ge+7),!1,-1,1).toResultPoint(),U=this.getFirstDifferent(new is(ce-7,ge-7),!1,-1,-1).toResultPoint()}var Pe=Ys.round((c.getX()+U.getX()+l.getX()+w.getX())/4),Ge=Ys.round((c.getY()+U.getY()+l.getY()+w.getY())/4);try{var J;c=(J=new ri(this.image,15,Pe,Ge).detect())[0],l=J[1],w=J[2],U=J[3]}catch{c=this.getFirstDifferent(new is(Pe+7,Ge-7),!1,1,-1).toResultPoint(),l=this.getFirstDifferent(new is(Pe+7,Ge+7),!1,1,1).toResultPoint(),w=this.getFirstDifferent(new is(Pe-7,Ge+7),!1,-1,1).toResultPoint(),U=this.getFirstDifferent(new is(Pe-7,Ge-7),!1,-1,-1).toResultPoint()}return Pe=Ys.round((c.getX()+U.getX()+l.getX()+w.getX())/4),Ge=Ys.round((c.getY()+U.getY()+l.getY()+w.getY())/4),new is(Pe,Ge)},y.prototype.getMatrixCornerPoints=function(c){return this.expandSquare(c,2*this.nbCenterLayers,this.getDimension())},y.prototype.sampleGrid=function(c,l,w,U,J){var ce=yo.getInstance(),ge=this.getDimension(),Pe=ge/2-this.nbCenterLayers,Ge=ge/2+this.nbCenterLayers;return ce.sampleGrid(c,ge,ge,Pe,Pe,Ge,Pe,Ge,Ge,Pe,Ge,l.getX(),l.getY(),w.getX(),w.getY(),U.getX(),U.getY(),J.getX(),J.getY())},y.prototype.sampleLine=function(c,l,w){for(var U=0,J=this.distanceResultPoint(c,l),ce=J/w,ge=c.getX(),Pe=c.getY(),Ge=ce*(l.getX()-c.getX())/J,ut=ce*(l.getY()-c.getY())/J,_t=0;_t.1&&Ot<.9?0:Ot<=.1===Ge?1:-1},y.prototype.getFirstDifferent=function(c,l,w,U){for(var J=c.getX()+w,ce=c.getY()+U;this.isValid(J,ce)&&this.image.get(J,ce)===l;)J+=w,ce+=U;for(J-=w,ce-=U;this.isValid(J,ce)&&this.image.get(J,ce)===l;)J+=w;for(J-=w;this.isValid(J,ce)&&this.image.get(J,ce)===l;)ce+=U;return new is(J,ce-=U)},y.prototype.expandSquare=function(c,l,w){var U=w/(2*l),J=c[0].getX()-c[2].getX(),ce=c[0].getY()-c[2].getY(),ge=(c[0].getX()+c[2].getX())/2,Pe=(c[0].getY()+c[2].getY())/2,Ge=new _o(ge+U*J,Pe+U*ce),ut=new _o(ge-U*J,Pe-U*ce);return J=c[1].getX()-c[3].getX(),ce=c[1].getY()-c[3].getY(),ge=(c[1].getX()+c[3].getX())/2,Pe=(c[1].getY()+c[3].getY())/2,[Ge,new _o(ge+U*J,Pe+U*ce),ut,new _o(ge-U*J,Pe-U*ce)]},y.prototype.isValid=function(c,l){return c>=0&&c0&&l>(ce?8:5));Pe=ce?U:15;for(var Ge=Math.trunc(U/2),ut=0;ut=U)break;try{J=c.getBlackRow(Ht,J)}catch{continue}for(var Sr=function(ln){if(1===ln&&(J.reverse(),l&&!0===l.get(Ci.NEED_RESULT_POINT_CALLBACK))){var On=new Map;l.forEach(function(ki,Xi){return On.set(Xi,ki)}),On.delete(Ci.NEED_RESULT_POINT_CALLBACK),l=On}try{var Wn=jr.decodeRow(Ht,J,l);if(1===ln){Wn.putMetadata(gc.ORIENTATION,180);var vi=Wn.getResultPoints();null!==vi&&(vi[0]=new _o(w-vi[0].getX()-1,vi[0].getY()),vi[1]=new _o(w-vi[1].getX()-1,vi[1].getY()))}return{value:Wn}}catch{}},jr=this,sn=0;sn<2;sn++){var dn=Sr(sn);if("object"==typeof dn)return dn.value}}throw new Gn},y.recordPattern=function(c,l,w){for(var U=w.length,J=0;J=ce)throw new Gn;for(var ge=!c.get(l),Pe=0,Ge=l;Ge0&&U>=0;)c.get(--l)!==J&&(U--,J=!J);if(U>=0)throw new Gn;y.recordPattern(c,l+1,w)},y.patternMatchVariance=function(c,l,w){for(var U=c.length,J=0,ce=0,ge=0;geOt?_t-Ot:Ot-_t;if(Ht>w)return Number.POSITIVE_INFINITY;Ge+=Ht}return Ge/J},y}();var gr=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const en=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return gr(c,y),c.findStartPattern=function(l){for(var w=l.getSize(),U=l.getNextSet(0),J=0,ce=Int32Array.from([0,0,0,0,0,0]),ge=U,Pe=!1,ut=U;ut=0&&l.isRange(Math.max(0,ge-(ut-ge)/2),ge,!1))return Int32Array.from([ge,ut,Ot]);ge+=ce[0]+ce[1],(ce=ce.slice(2,ce.length))[J-1]=0,ce[J]=0,J--}else J++;ce[J]=1,Pe=!Pe}throw new Gn},c.decodeCode=function(l,w,U){Ut.recordPattern(l,U,w);for(var J=c.MAX_AVG_VARIANCE,ce=-1,ge=0;ge=0)return ce;throw new Gn},c.prototype.decodeRow=function(l,w,U){var ut,J=U&&!0===U.get(Ci.ASSUME_GS1),ce=c.findStartPattern(w),ge=ce[2],Pe=0,Ge=new Uint8Array(20);switch(Ge[Pe++]=ge,ge){case c.CODE_START_A:ut=c.CODE_CODE_A;break;case c.CODE_START_B:ut=c.CODE_CODE_B;break;case c.CODE_START_C:ut=c.CODE_CODE_C;break;default:throw new Qn}for(var _t=!1,Ot=!1,Ht="",Sr=ce[0],jr=ce[1],sn=Int32Array.from([0,0,0,0,0,0]),dn=0,ln=0,On=ge,Wn=0,vi=!0,ki=!1,Xi=!1;!_t;){var So=Ot;switch(Ot=!1,dn=ln,ln=c.decodeCode(w,sn,jr),Ge[Pe++]=ln,ln!==c.CODE_STOP&&(vi=!0),ln!==c.CODE_STOP&&(On+=++Wn*ln),Sr=jr,jr+=sn.reduce(function(rb,nb){return rb+nb},0),ln){case c.CODE_START_A:case c.CODE_START_B:case c.CODE_START_C:throw new Qn}switch(ut){case c.CODE_CODE_A:if(ln<64)Ht+=String.fromCharCode(Xi===ki?32+ln:32+ln+128),Xi=!1;else if(ln<96)Ht+=String.fromCharCode(Xi===ki?ln-64:ln+64),Xi=!1;else switch(ln!==c.CODE_STOP&&(vi=!1),ln){case c.CODE_FNC_1:J&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case c.CODE_FNC_2:case c.CODE_FNC_3:break;case c.CODE_FNC_4_A:!ki&&Xi?(ki=!0,Xi=!1):ki&&Xi?(ki=!1,Xi=!1):Xi=!0;break;case c.CODE_SHIFT:Ot=!0,ut=c.CODE_CODE_B;break;case c.CODE_CODE_B:ut=c.CODE_CODE_B;break;case c.CODE_CODE_C:ut=c.CODE_CODE_C;break;case c.CODE_STOP:_t=!0}break;case c.CODE_CODE_B:if(ln<96)Ht+=String.fromCharCode(Xi===ki?32+ln:32+ln+128),Xi=!1;else switch(ln!==c.CODE_STOP&&(vi=!1),ln){case c.CODE_FNC_1:J&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case c.CODE_FNC_2:case c.CODE_FNC_3:break;case c.CODE_FNC_4_B:!ki&&Xi?(ki=!0,Xi=!1):ki&&Xi?(ki=!1,Xi=!1):Xi=!0;break;case c.CODE_SHIFT:Ot=!0,ut=c.CODE_CODE_A;break;case c.CODE_CODE_A:ut=c.CODE_CODE_A;break;case c.CODE_CODE_C:ut=c.CODE_CODE_C;break;case c.CODE_STOP:_t=!0}break;case c.CODE_CODE_C:if(ln<100)ln<10&&(Ht+="0"),Ht+=ln;else switch(ln!==c.CODE_STOP&&(vi=!1),ln){case c.CODE_FNC_1:J&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case c.CODE_CODE_A:ut=c.CODE_CODE_A;break;case c.CODE_CODE_B:ut=c.CODE_CODE_B;break;case c.CODE_STOP:_t=!0}}So&&(ut=ut===c.CODE_CODE_A?c.CODE_CODE_B:c.CODE_CODE_A)}var Ns=jr-Sr;if(jr=w.getNextUnset(jr),!w.isRange(jr,Math.min(w.getSize(),jr+(jr-Sr)/2),!1))throw new Gn;if((On-=Wn*dn)%103!==dn)throw new rs;var ps=Ht.length;if(0===ps)throw new Gn;ps>0&&vi&&(Ht=Ht.substring(0,ut===c.CODE_CODE_C?ps-2:ps-1));for(var Dl=(ce[1]+ce[0])/2,Ra=Sr+Ns/2,Xc=Ge.length,cd=new Uint8Array(Xc),ff=0;ff=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const ti=function(y){function c(l,w){void 0===l&&(l=!1),void 0===w&&(w=!1);var U=y.call(this)||this;return U.usingCheckDigit=l,U.extendedMode=w,U.decodeRowResult="",U.counters=new Int32Array(9),U}return En(c,y),c.prototype.decodeRow=function(l,w,U){var J,ce,ge,Pe,Ge=this.counters;Ge.fill(0),this.decodeRowResult="";var Ht,Sr,ut=c.findAsteriskPattern(w,Ge),_t=w.getNextSet(ut[1]),Ot=w.getSize();do{c.recordPattern(w,_t,Ge);var jr=c.toNarrowWidePattern(Ge);if(jr<0)throw new Gn;Ht=c.patternToChar(jr),this.decodeRowResult+=Ht,Sr=_t;try{for(var sn=(J=void 0,_n(Ge)),dn=sn.next();!dn.done;dn=sn.next())_t+=dn.value}catch(Xc){J={error:Xc}}finally{try{dn&&!dn.done&&(ce=sn.return)&&ce.call(sn)}finally{if(J)throw J.error}}_t=w.getNextSet(_t)}while("*"!==Ht);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var ps,On=0;try{for(var Wn=_n(Ge),vi=Wn.next();!vi.done;vi=Wn.next())On+=vi.value}catch(Xc){ge={error:Xc}}finally{try{vi&&!vi.done&&(Pe=Wn.return)&&Pe.call(Wn)}finally{if(ge)throw ge.error}}if(_t!==Ot&&2*(_t-Sr-On)ce&&(Pe=_t)}catch(jr){w={error:jr}}finally{try{ut&&!ut.done&&(U=Ge.return)&&U.call(Ge)}finally{if(w)throw w.error}}ce=Pe,ge=0;for(var Ot=0,Ht=0,Sr=0;Srce&&(Ht|=1<0;Sr++){var _t;if((_t=l[Sr])>ce&&(ge--,2*_t>=Ot))return-1}return Ht}}while(ge>3);return-1},c.patternToChar=function(l){for(var w=0;w="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)+32);break;case"$":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)-64);break;case"%":if(ge>="A"&&ge<="E")Pe=String.fromCharCode(ge.charCodeAt(0)-38);else if(ge>="F"&&ge<="J")Pe=String.fromCharCode(ge.charCodeAt(0)-11);else if(ge>="K"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)+16);else if(ge>="P"&&ge<="T")Pe=String.fromCharCode(ge.charCodeAt(0)+43);else if("U"===ge)Pe="\0";else if("V"===ge)Pe="@";else if("W"===ge)Pe="`";else{if("X"!==ge&&"Y"!==ge&&"Z"!==ge)throw new Qn;Pe="\x7f"}break;case"/":if(ge>="A"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)-32);else{if("Z"!==ge)throw new Qn;Pe=":"}}U+=Pe,J++}else U+=ce}return U},c.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",c.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],c.ASTERISK_ENCODING=148,c}(Ut);var xo=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),Vs=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const zs=function(y){function c(){var l=y.call(this)||this;return l.decodeRowResult="",l.counters=new Int32Array(6),l}return xo(c,y),c.prototype.decodeRow=function(l,w,U){var J,ce,ge,Pe,Ht,Sr,Ge=this.findAsteriskPattern(w),ut=w.getNextSet(Ge[1]),_t=w.getSize(),Ot=this.counters;Ot.fill(0),this.decodeRowResult="";do{c.recordPattern(w,ut,Ot);var jr=this.toPattern(Ot);if(jr<0)throw new Gn;Ht=this.patternToChar(jr),this.decodeRowResult+=Ht,Sr=ut;try{for(var sn=(J=void 0,Vs(Ot)),dn=sn.next();!dn.done;dn=sn.next())ut+=dn.value}catch(Ns){J={error:Ns}}finally{try{dn&&!dn.done&&(ce=sn.return)&&ce.call(sn)}finally{if(J)throw J.error}}ut=w.getNextSet(ut)}while("*"!==Ht);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var On=0;try{for(var Wn=Vs(Ot),vi=Wn.next();!vi.done;vi=Wn.next())On+=vi.value}catch(Ns){ge={error:Ns}}finally{try{vi&&!vi.done&&(Pe=Wn.return)&&Pe.call(Wn)}finally{if(ge)throw ge.error}}if(ut===_t||!w.get(ut))throw new Gn;if(this.decodeRowResult.length<2)throw new Gn;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var ki=this.decodeExtended(this.decodeRowResult),So=Sr+On/2;return new Cs(ki,null,0,[new _o((Ge[1]+Ge[0])/2,l),new _o(So,l)],Co.CODE_93,(new Date).getTime())},c.prototype.findAsteriskPattern=function(l){var w=l.getSize(),U=l.getNextSet(0);this.counters.fill(0);for(var J=this.counters,ce=U,ge=!1,Pe=J.length,Ge=0,ut=U;ut4)return-1;if(1&_t)Ge<<=Ot;else for(var Ht=0;Ht="a"&&ce<="d"){if(J>=w-1)throw new Qn;var ge=l.charAt(J+1),Pe="\0";switch(ce){case"d":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)+32);break;case"a":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)-64);break;case"b":if(ge>="A"&&ge<="E")Pe=String.fromCharCode(ge.charCodeAt(0)-38);else if(ge>="F"&&ge<="J")Pe=String.fromCharCode(ge.charCodeAt(0)-11);else if(ge>="K"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)+16);else if(ge>="P"&&ge<="T")Pe=String.fromCharCode(ge.charCodeAt(0)+43);else if("U"===ge)Pe="\0";else if("V"===ge)Pe="@";else if("W"===ge)Pe="`";else{if(!(ge>="X"&&ge<="Z"))throw new Qn;Pe="\x7f"}break;case"c":if(ge>="A"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)-32);else{if("Z"!==ge)throw new Qn;Pe=":"}}U+=Pe,J++}else U+=ce}return U},c.prototype.checkChecksums=function(l){var w=l.length;this.checkOneChecksum(l,w-2,20),this.checkOneChecksum(l,w-1,15)},c.prototype.checkOneChecksum=function(l,w,U){for(var J=1,ce=0,ge=w-1;ge>=0;ge--)ce+=J*c.ALPHABET_STRING.indexOf(l.charAt(ge)),++J>U&&(J=1);if(l.charAt(w)!==c.ALPHABET_STRING[ce%47])throw new rs},c.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",c.ASTERISK_ENCODING=(c.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350])[47],c}(Ut);var ea=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const ls=function(y){function c(){var l=null!==y&&y.apply(this,arguments)||this;return l.narrowLineWidth=-1,l}return ea(c,y),c.prototype.decodeRow=function(l,w,U){var J,ce,ge=this.decodeStart(w),Pe=this.decodeEnd(w),Ge=new Ur;c.decodeMiddle(w,ge[1],Pe[0],Ge);var ut=Ge.toString(),_t=null;null!=U&&(_t=U.get(Ci.ALLOWED_LENGTHS)),null==_t&&(_t=c.DEFAULT_ALLOWED_LENGTHS);var Ot=ut.length,Ht=!1,Sr=0;try{for(var jr=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(_t),sn=jr.next();!sn.done;sn=jr.next()){var dn=sn.value;if(Ot===dn){Ht=!0;break}dn>Sr&&(Sr=dn)}}catch(Wn){J={error:Wn}}finally{try{sn&&!sn.done&&(ce=jr.return)&&ce.call(jr)}finally{if(J)throw J.error}}if(!Ht&&Ot>Sr&&(Ht=!0),!Ht)throw new Qn;var ln=[new _o(ge[1],l),new _o(Pe[0],l)];return new Cs(ut,null,0,ln,Co.ITF,(new Date).getTime())},c.decodeMiddle=function(l,w,U,J){var ce=new Int32Array(10),ge=new Int32Array(5),Pe=new Int32Array(5);for(ce.fill(0),ge.fill(0),Pe.fill(0);w0&&J>=0&&!l.get(J);J--)U--;if(0!==U)throw new Gn},c.skipWhiteSpace=function(l){var w=l.getSize(),U=l.getNextSet(0);if(U===w)throw new Gn;return U},c.prototype.decodeEnd=function(l){l.reverse();try{var w=c.skipWhiteSpace(l),U=void 0;try{U=c.findGuardPattern(l,w,c.END_PATTERN_REVERSED[0])}catch(ce){ce instanceof Gn&&(U=c.findGuardPattern(l,w,c.END_PATTERN_REVERSED[1]))}this.validateQuietZone(l,U[0]);var J=U[0];return U[0]=l.getSize()-U[1],U[1]=l.getSize()-J,U}finally{l.reverse()}},c.findGuardPattern=function(l,w,U){var J=U.length,ce=new Int32Array(J),ge=l.getSize(),Pe=!1,Ge=0,ut=w;ce.fill(0);for(var _t=w;_t=0)return U%10;throw new Gn},c.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],c.MAX_AVG_VARIANCE=.38,c.MAX_INDIVIDUAL_VARIANCE=.5,c.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],c.START_PATTERN=Int32Array.from([1,1,1,1]),c.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],c}(Ut);var bs=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const mo=function(y){function c(){var l=null!==y&&y.apply(this,arguments)||this;return l.decodeRowStringBuffer="",l}return bs(c,y),c.findStartGuardPattern=function(l){for(var U,w=!1,J=0,ce=Int32Array.from([0,0,0]);!w;){ce=Int32Array.from([0,0,0]);var ge=(U=c.findGuardPattern(l,J,!1,this.START_END_PATTERN,ce))[0],Pe=ge-((J=U[1])-ge);Pe>=0&&(w=l.isRange(Pe,ge,!1))}return U},c.checkChecksum=function(l){return c.checkStandardUPCEANChecksum(l)},c.checkStandardUPCEANChecksum=function(l){var w=l.length;if(0===w)return!1;var U=parseInt(l.charAt(w-1),10);return c.getStandardUPCEANChecksum(l.substring(0,w-1))===U},c.getStandardUPCEANChecksum=function(l){for(var w=l.length,U=0,J=w-1;J>=0;J-=2){if((ce=l.charAt(J).charCodeAt(0)-48)<0||ce>9)throw new Qn;U+=ce}for(U*=3,J=w-2;J>=0;J-=2){var ce;if((ce=l.charAt(J).charCodeAt(0)-48)<0||ce>9)throw new Qn;U+=ce}return(1e3-U)%10},c.decodeEnd=function(l,w){return c.findGuardPattern(l,w,!1,c.START_END_PATTERN,new Int32Array(c.START_END_PATTERN.length).fill(0))},c.findGuardPatternWithoutCounters=function(l,w,U,J){return this.findGuardPattern(l,w,U,J,new Int32Array(J.length))},c.findGuardPattern=function(l,w,U,J,ce){for(var ge=l.getSize(),Pe=0,Ge=w=U?l.getNextUnset(w):l.getNextSet(w),ut=J.length,_t=U,Ot=w;Ot=0)return ge;throw new Gn},c.MAX_AVG_VARIANCE=.48,c.MAX_INDIVIDUAL_VARIANCE=.7,c.START_END_PATTERN=Int32Array.from([1,1,1]),c.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),c.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),c.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],c}(Ut);var Ks=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const ac=function(){function y(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return y.prototype.decodeRow=function(c,l,w){var U=this.decodeRowStringBuffer,J=this.decodeMiddle(l,w,U),ce=U.toString(),ge=y.parseExtensionString(ce),Pe=[new _o((w[0]+w[1])/2,c),new _o(J,c)],Ge=new Cs(ce,null,0,Pe,Co.UPC_EAN_EXTENSION,(new Date).getTime());return null!=ge&&Ge.putAllMetadata(ge),Ge},y.prototype.decodeMiddle=function(c,l,w){var U,J,ce=this.decodeMiddleCounters;ce[0]=0,ce[1]=0,ce[2]=0,ce[3]=0;for(var ge=c.getSize(),Pe=l[1],Ge=0,ut=0;ut<5&&Pe=10&&(Ge|=1<<4-ut),4!==ut&&(Pe=c.getNextSet(Pe),Pe=c.getNextUnset(Pe))}if(5!==w.length)throw new Gn;var jr=this.determineCheckDigit(Ge);if(y.extensionChecksum(w.toString())!==jr)throw new Gn;return Pe},y.extensionChecksum=function(c){for(var l=c.length,w=0,U=l-2;U>=0;U-=2)w+=c.charAt(U).charCodeAt(0)-48;for(w*=3,U=l-1;U>=0;U-=2)w+=c.charAt(U).charCodeAt(0)-48;return(w*=3)%10},y.prototype.determineCheckDigit=function(c){for(var l=0;l<10;l++)if(c===this.CHECK_DIGIT_ENCODINGS[l])return l;throw new Gn},y.parseExtensionString=function(c){if(5!==c.length)return null;var l=y.parseExtension5String(c);return null==l?null:new Map([[gc.SUGGESTED_PRICE,l]])},y.parseExtension5String=function(c){var l;switch(c.charAt(0)){case"0":l="\xa3";break;case"5":l="$";break;case"9":switch(c){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}l="";break;default:l=""}var w=parseInt(c.substring(1)),J=w%100;return l+(w/100).toString()+"."+(J<10?"0"+J:J.toString())},y}();var La=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Nd=function(){function y(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return y.prototype.decodeRow=function(c,l,w){var U=this.decodeRowStringBuffer,J=this.decodeMiddle(l,w,U),ce=U.toString(),ge=y.parseExtensionString(ce),Pe=[new _o((w[0]+w[1])/2,c),new _o(J,c)],Ge=new Cs(ce,null,0,Pe,Co.UPC_EAN_EXTENSION,(new Date).getTime());return null!=ge&&Ge.putAllMetadata(ge),Ge},y.prototype.decodeMiddle=function(c,l,w){var U,J,ce=this.decodeMiddleCounters;ce[0]=0,ce[1]=0,ce[2]=0,ce[3]=0;for(var ge=c.getSize(),Pe=l[1],Ge=0,ut=0;ut<2&&Pe=10&&(Ge|=1<<1-ut),1!==ut&&(Pe=c.getNextSet(Pe),Pe=c.getNextUnset(Pe))}if(2!==w.length)throw new Gn;if(parseInt(w.toString())%4!==Ge)throw new Gn;return Pe},y.parseExtensionString=function(c){return 2!==c.length?null:new Map([[gc.ISSUE_NUMBER,parseInt(c)]])},y}(),yu=function(){function y(){}return y.decodeRow=function(c,l,w){var U=mo.findGuardPattern(l,w,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new ac).decodeRow(c,l,U)}catch{return(new Nd).decodeRow(c,l,U)}},y.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),y}();var wh=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const hl=function(y){function c(){var l=y.call(this)||this;l.decodeRowStringBuffer="",c.L_AND_G_PATTERNS=c.L_PATTERNS.map(function(ge){return Int32Array.from(ge)});for(var w=10;w<20;w++){for(var U=c.L_PATTERNS[w-10],J=new Int32Array(U.length),ce=0;ce=w.getSize()||!w.isRange(Sr,jr,!1))throw new Gn;var sn=ut.toString();if(sn.length<8)throw new Qn;if(!c.checkChecksum(sn))throw new rs;var dn=(J[1]+J[0])/2,ln=(Ot[1]+Ot[0])/2,On=this.getBarcodeFormat(),Wn=[new _o(dn,l),new _o(ln,l)],vi=new Cs(sn,null,0,Wn,On,(new Date).getTime()),ki=0;try{var Xi=yu.decodeRow(l,w,Ot[1]);vi.putMetadata(gc.UPC_EAN_EXTENSION,Xi.getText()),vi.putAllMetadata(Xi.getResultMetadata()),vi.addResultPoints(Xi.getResultPoints()),ki=Xi.getText().length}catch{}var So=null==U?null:U.get(Ci.ALLOWED_EAN_EXTENSIONS);if(null!=So){var Ns=!1;for(var ps in So)if(ki.toString()===ps){Ns=!0;break}if(!Ns)throw new Gn}return vi},c.checkChecksum=function(l){return c.checkStandardUPCEANChecksum(l)},c.checkStandardUPCEANChecksum=function(l){var w=l.length;if(0===w)return!1;var U=parseInt(l.charAt(w-1),10);return c.getStandardUPCEANChecksum(l.substring(0,w-1))===U},c.getStandardUPCEANChecksum=function(l){for(var w=l.length,U=0,J=w-1;J>=0;J-=2){if((ce=l.charAt(J).charCodeAt(0)-48)<0||ce>9)throw new Qn;U+=ce}for(U*=3,J=w-2;J>=0;J-=2){var ce;if((ce=l.charAt(J).charCodeAt(0)-48)<0||ce>9)throw new Qn;U+=ce}return(1e3-U)%10},c.decodeEnd=function(l,w){return c.findGuardPattern(l,w,!1,c.START_END_PATTERN,new Int32Array(c.START_END_PATTERN.length).fill(0))},c}(mo);var Pp=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),Kh=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Hh=function(y){function c(){var l=y.call(this)||this;return l.decodeMiddleCounters=Int32Array.from([0,0,0,0]),l}return Pp(c,y),c.prototype.decodeMiddle=function(l,w,U){var J,ce,ge,Pe,Ge=this.decodeMiddleCounters;Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0;for(var ut=l.getSize(),_t=w[1],Ot=0,Ht=0;Ht<6&&_t=10&&(Ot|=1<<5-Ht)}for(U=c.determineFirstDigit(U,Ot),_t=hl.findGuardPattern(l,_t,!0,hl.MIDDLE_PATTERN,new Int32Array(hl.MIDDLE_PATTERN.length).fill(0))[1],Ht=0;Ht<6&&_t=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Kg=function(y){function c(){var l=y.call(this)||this;return l.decodeMiddleCounters=Int32Array.from([0,0,0,0]),l}return n1(c,y),c.prototype.decodeMiddle=function(l,w,U){var J,ce,ge,Pe,Ge=this.decodeMiddleCounters;Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0;for(var ut=l.getSize(),_t=w[1],Ot=0;Ot<4&&_t=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Cr=function(y){function c(){var l=y.call(this)||this;return l.decodeMiddleCounters=new Int32Array(4),l}return at(c,y),c.prototype.decodeMiddle=function(l,w,U){var J,ce,ge=this.decodeMiddleCounters.map(function(sn){return sn});ge[0]=0,ge[1]=0,ge[2]=0,ge[3]=0;for(var Pe=l.getSize(),Ge=w[1],ut=0,_t=0;_t<6&&Ge=10&&(ut|=1<<5-_t)}return c.determineNumSysAndCheckDigit(new Ur(U),ut),Ge},c.prototype.decodeEnd=function(l,w){return c.findGuardPatternWithoutCounters(l,w,!0,c.MIDDLE_END_PATTERN)},c.prototype.checkChecksum=function(l){return hl.checkChecksum(c.convertUPCEtoUPCA(l))},c.determineNumSysAndCheckDigit=function(l,w){for(var U=0;U<=1;U++)for(var J=0;J<10;J++)if(w===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[U][J])return l.insert(0,"0"+U),void l.append("0"+J);throw Gn.getNotFoundInstance()},c.prototype.getBarcodeFormat=function(){return Co.UPC_E},c.convertUPCEtoUPCA=function(l){var w=l.slice(1,7).split("").map(function(ce){return ce.charCodeAt(0)}),U=new Ur;U.append(l.charAt(0));var J=w[5];switch(J){case 0:case 1:case 2:U.appendChars(w,0,2),U.append(J),U.append("0000"),U.appendChars(w,2,3);break;case 3:U.appendChars(w,0,3),U.append("00000"),U.appendChars(w,3,2);break;case 4:U.appendChars(w,0,4),U.append("00000"),U.append(w[4]);break;default:U.appendChars(w,0,5),U.append("0000"),U.append(J)}return l.length>=8&&U.append(l.charAt(7)),U.toString()},c.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),c.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],c}(hl);var Zr=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),Kn=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Wi=function(y){function c(l){var w=y.call(this)||this,U=null==l?null:l.get(Ci.POSSIBLE_FORMATS),J=[];return null!=U&&(U.indexOf(Co.EAN_13)>-1&&J.push(new Hh),U.indexOf(Co.UPC_A)>-1&&J.push(new At),U.indexOf(Co.EAN_8)>-1&&J.push(new Kg),U.indexOf(Co.UPC_E)>-1&&J.push(new Cr)),0===J.length&&(J.push(new Hh),J.push(new At),J.push(new Kg),J.push(new Cr)),w.readers=J,w}return Zr(c,y),c.prototype.decodeRow=function(l,w,U){var J,ce;try{for(var ge=Kn(this.readers),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;try{var ut=Ge.decodeRow(l,w,U),_t=ut.getBarcodeFormat()===Co.EAN_13&&"0"===ut.getText().charAt(0),Ot=null==U?null:U.get(Ci.POSSIBLE_FORMATS),Ht=null==Ot||Ot.includes(Co.UPC_A);if(_t&&Ht){var Sr=ut.getRawBytes(),jr=new Cs(ut.getText().substring(1),Sr,Sr?Sr.length:null,ut.getResultPoints(),Co.UPC_A);return jr.putAllMetadata(ut.getResultMetadata()),jr}return ut}catch{}}}catch(sn){J={error:sn}}finally{try{Pe&&!Pe.done&&(ce=ge.return)&&ce.call(ge)}finally{if(J)throw J.error}}throw new Gn},c.prototype.reset=function(){var l,w;try{for(var U=Kn(this.readers),J=U.next();!J.done;J=U.next())J.value.reset()}catch(ge){l={error:ge}}finally{try{J&&!J.done&&(w=U.return)&&w.call(U)}finally{if(l)throw l.error}}},c}(Ut);var os=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const vc=function(y){function c(){var l=null!==y&&y.apply(this,arguments)||this;return l.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},l}return os(c,y),c.prototype.decodeRow=function(l,w,U){var J=this.getValidRowData(w);if(!J)throw new Gn;var ce=this.codaBarDecodeRow(J.row);if(!ce)throw new Gn;return new Cs(ce,null,0,[new _o(J.left,l),new _o(J.right,l)],Co.CODABAR,(new Date).getTime())},c.prototype.getValidRowData=function(l){var w=l.toArray(),U=w.indexOf(!0);if(-1===U)return null;var J=w.lastIndexOf(!0);if(J<=U)return null;for(var ce=[],ge=(w=w.slice(U,J+1))[0],Pe=1,Ge=1;Ge0;){var ce=l.splice(0,8).splice(0,7).map(function(Pe){return PeJ&&(J=w[ce],U=ce);l[U]++},c.decrement=function(l,w){for(var U=0,J=w[0],ce=1;ce=c.MIN_FINDER_PATTERN_RATIO&&ge<=c.MAX_FINDER_PATTERN_RATIO){var Pe=Number.MAX_SAFE_INTEGER,Ge=Number.MIN_SAFE_INTEGER;try{for(var ut=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(l),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value;Ot>Ge&&(Ge=Ot),Ot=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),Pe=ge.next();!Pe.done;Pe=ge.next())ce+=Pe.value}catch(ln){U={error:ln}}finally{try{Pe&&!Pe.done&&(J=ge.return)&&J.call(ge)}finally{if(U)throw U.error}}for(var ut=0,_t=0,Ot=c.length,Ht=0;Ht=Ot-Ht-1&&(jr-=y.combins(ce-Sr-(Ot-Ht),Ot-Ht-2)),Ot-Ht-1>1){for(var sn=0,dn=ce-Sr-(Ot-Ht-2);dn>l;dn--)sn+=y.combins(ce-Sr-dn-1,Ot-Ht-3);jr-=sn*(Ot-1-Ht)}else ce-Sr>l&&jr--;ut+=jr}ce-=Sr}return ut},y.combins=function(c,l){var w,U;c-l>l?(U=l,w=c-l):(U=c-l,w=l);for(var J=1,ce=1,ge=c;ge>w;ge--)J*=ge,ce<=U&&(J/=ce,ce++);for(;ce<=U;)J/=ce,ce++;return J},y}(),Wh=function(){function y(){}return y.buildBitArray=function(c){var l=2*c.length-1;null==c[c.length-1].getRightChar()&&(l-=1);for(var U=new bi(12*l),J=0,ge=c[0].getRightChar().getValue(),Pe=11;Pe>=0;--Pe)ge&1<=0;--_t)ut&1<<_t&&U.set(J),J++;if(null!==Ge.getRightChar()){var Ot=Ge.getRightChar().getValue();for(_t=11;_t>=0;--_t)Ot&1<<_t&&U.set(J),J++}}return U},y}(),Qs=function(){function y(c,l){l?this.decodedInformation=null:(this.finished=c,this.decodedInformation=l)}return y.prototype.getDecodedInformation=function(){return this.decodedInformation},y.prototype.isFinished=function(){return this.finished},y}(),_h=function(){function y(c){this.newPosition=c}return y.prototype.getNewPosition=function(){return this.newPosition},y}();var su=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const vu=function(y){function c(l,w){var U=y.call(this,l)||this;return U.value=w,U}return su(c,y),c.prototype.getValue=function(){return this.value},c.prototype.isFNC1=function(){return this.value===c.FNC1},c.FNC1="$",c}(_h);var Fe=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Je=function(y){function c(l,w,U){var J=y.call(this,l)||this;return U?(J.remaining=!0,J.remainingValue=J.remainingValue):(J.remaining=!1,J.remainingValue=0),J.newString=w,J}return Fe(c,y),c.prototype.getNewString=function(){return this.newString},c.prototype.isRemaining=function(){return this.remaining},c.prototype.getRemainingValue=function(){return this.remainingValue},c}(_h);var pr=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Er=function(y){function c(l,w,U){var J=y.call(this,l)||this;if(w<0||w>10||U<0||U>10)throw new Qn;return J.firstDigit=w,J.secondDigit=U,J}return pr(c,y),c.prototype.getFirstDigit=function(){return this.firstDigit},c.prototype.getSecondDigit=function(){return this.secondDigit},c.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},c.prototype.isFirstDigitFNC1=function(){return this.firstDigit===c.FNC1},c.prototype.isSecondDigitFNC1=function(){return this.secondDigit===c.FNC1},c.prototype.isAnyFNC1=function(){return this.firstDigit===c.FNC1||this.secondDigit===c.FNC1},c.FNC1=10,c}(_h);var nn=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Ri=function(){function y(){}return y.parseFieldsInGeneralPurpose=function(c){var l,w,U,J,ce,ge,Pe,Ge;if(!c)return null;if(c.length<2)throw new Gn;var ut=c.substring(0,2);try{for(var _t=nn(y.TWO_DIGIT_DATA_LENGTH),Ot=_t.next();!Ot.done;Ot=_t.next())if((Ht=Ot.value)[0]===ut)return Ht[1]===y.VARIABLE_LENGTH?y.processVariableAI(2,Ht[2],c):y.processFixedAI(2,Ht[1],c)}catch(ki){l={error:ki}}finally{try{Ot&&!Ot.done&&(w=_t.return)&&w.call(_t)}finally{if(l)throw l.error}}if(c.length<3)throw new Gn;var Sr=c.substring(0,3);try{for(var jr=nn(y.THREE_DIGIT_DATA_LENGTH),sn=jr.next();!sn.done;sn=jr.next())if((Ht=sn.value)[0]===Sr)return Ht[1]===y.VARIABLE_LENGTH?y.processVariableAI(3,Ht[2],c):y.processFixedAI(3,Ht[1],c)}catch(ki){U={error:ki}}finally{try{sn&&!sn.done&&(J=jr.return)&&J.call(jr)}finally{if(U)throw U.error}}try{for(var dn=nn(y.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),ln=dn.next();!ln.done;ln=dn.next())if((Ht=ln.value)[0]===Sr)return Ht[1]===y.VARIABLE_LENGTH?y.processVariableAI(4,Ht[2],c):y.processFixedAI(4,Ht[1],c)}catch(ki){ce={error:ki}}finally{try{ln&&!ln.done&&(ge=dn.return)&&ge.call(dn)}finally{if(ce)throw ce.error}}if(c.length<4)throw new Gn;var On=c.substring(0,4);try{for(var Wn=nn(y.FOUR_DIGIT_DATA_LENGTH),vi=Wn.next();!vi.done;vi=Wn.next()){var Ht;if((Ht=vi.value)[0]===On)return Ht[1]===y.VARIABLE_LENGTH?y.processVariableAI(4,Ht[2],c):y.processFixedAI(4,Ht[1],c)}}catch(ki){Pe={error:ki}}finally{try{vi&&!vi.done&&(Ge=Wn.return)&&Ge.call(Wn)}finally{if(Pe)throw Pe.error}}throw new Gn},y.processFixedAI=function(c,l,w){if(w.lengththis.information.getSize())return c+4<=this.information.getSize();for(var l=c;lthis.information.getSize()){var l=this.extractNumericValueFromBitArray(c,4);return new Er(this.information.getSize(),0===l?Er.FNC1:l-1,Er.FNC1)}var w=this.extractNumericValueFromBitArray(c,7);return new Er(c+7,(w-8)/11,(w-8)%11)},y.prototype.extractNumericValueFromBitArray=function(c,l){return y.extractNumericValueFromBitArray(this.information,c,l)},y.extractNumericValueFromBitArray=function(c,l,w){for(var U=0,J=0;Jthis.information.getSize())return!1;var l=this.extractNumericValueFromBitArray(c,5);if(l>=5&&l<16)return!0;if(c+7>this.information.getSize())return!1;var w=this.extractNumericValueFromBitArray(c,7);if(w>=64&&w<116)return!0;if(c+8>this.information.getSize())return!1;var U=this.extractNumericValueFromBitArray(c,8);return U>=232&&U<253},y.prototype.decodeIsoIec646=function(c){var l=this.extractNumericValueFromBitArray(c,5);if(15===l)return new vu(c+5,vu.FNC1);if(l>=5&&l<15)return new vu(c+5,"0"+(l-5));var J,w=this.extractNumericValueFromBitArray(c,7);if(w>=64&&w<90)return new vu(c+7,""+(w+1));if(w>=90&&w<116)return new vu(c+7,""+(w+7));switch(this.extractNumericValueFromBitArray(c,8)){case 232:J="!";break;case 233:J='"';break;case 234:J="%";break;case 235:J="&";break;case 236:J="'";break;case 237:J="(";break;case 238:J=")";break;case 239:J="*";break;case 240:J="+";break;case 241:J=",";break;case 242:J="-";break;case 243:J=".";break;case 244:J="/";break;case 245:J=":";break;case 246:J=";";break;case 247:J="<";break;case 248:J="=";break;case 249:J=">";break;case 250:J="?";break;case 251:J="_";break;case 252:J=" ";break;default:throw new Qn}return new vu(c+8,J)},y.prototype.isStillAlpha=function(c){if(c+5>this.information.getSize())return!1;var l=this.extractNumericValueFromBitArray(c,5);if(l>=5&&l<16)return!0;if(c+6>this.information.getSize())return!1;var w=this.extractNumericValueFromBitArray(c,6);return w>=16&&w<63},y.prototype.decodeAlphanumeric=function(c){var l=this.extractNumericValueFromBitArray(c,5);if(15===l)return new vu(c+5,vu.FNC1);if(l>=5&&l<15)return new vu(c+5,"0"+(l-5));var U,w=this.extractNumericValueFromBitArray(c,6);if(w>=32&&w<58)return new vu(c+6,""+(w+33));switch(w){case 58:U="*";break;case 59:U=",";break;case 60:U="-";break;case 61:U=".";break;case 62:U="/";break;default:throw new ou("Decoding invalid alphanumeric value: "+w)}return new vu(c+6,U)},y.prototype.isAlphaTo646ToAlphaLatch=function(c){if(c+1>this.information.getSize())return!1;for(var l=0;l<5&&l+cthis.information.getSize())return!1;for(var l=c;lthis.information.getSize())return!1;for(var l=0;l<4&&l+c=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const jl=function(y){function c(){var l=null!==y&&y.apply(this,arguments)||this;return l.pairs=new Array(c.MAX_PAIRS),l.rows=new Array,l.startEnd=[2],l}return Kw(c,y),c.prototype.decodeRow=function(l,w,U){this.pairs.length=0,this.startFromEven=!1;try{return c.constructResult(this.decodeRow2pairs(l,w))}catch{}return this.pairs.length=0,this.startFromEven=!0,c.constructResult(this.decodeRow2pairs(l,w))},c.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},c.prototype.decodeRow2pairs=function(l,w){for(var U=!1;!U;)try{this.pairs.push(this.retrieveNextPair(w,this.pairs,l))}catch(ge){if(ge instanceof Gn){if(!this.pairs.length)throw new Gn;U=!0}}if(this.checkChecksum())return this.pairs;var J;if(J=!!this.rows.length,this.storeRow(l,!1),J){var ce=this.checkRowsBoolean(!1);if(null!=ce||null!=(ce=this.checkRowsBoolean(!0)))return ce}throw new Gn},c.prototype.checkRowsBoolean=function(l){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,l&&(this.rows=this.rows.reverse());var w=null;try{w=this.checkRows(new Array,0)}catch(U){console.log(U)}return l&&(this.rows=this.rows.reverse()),w},c.prototype.checkRows=function(l,w){for(var U,J,ce=w;cege.length)){for(var Pe=!0,Ge=0;Gel){ce=ge.isEquivalent(this.pairs);break}J=ge.isEquivalent(this.pairs),U++}ce||J||c.isPartialRow(this.pairs,this.rows)||(this.rows.push(U,new Gh(this.pairs,l,w)),this.removePartialRows(this.pairs,this.rows))},c.prototype.removePartialRows=function(l,w){var U,J,ce,ge,Pe,Ge;try{for(var ut=Hc(w),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value;if(Ot.getPairs().length!==l.length)try{for(var Sr=(ce=void 0,Hc(Ot.getPairs())),jr=Sr.next();!jr.done;jr=Sr.next()){var sn=jr.value;try{for(var ln=(Pe=void 0,Hc(l)),On=ln.next();!On.done;On=ln.next())if(qf.equals(sn,On.value)){!0;break}}catch(vi){Pe={error:vi}}finally{try{On&&!On.done&&(Ge=ln.return)&&Ge.call(ln)}finally{if(Pe)throw Pe.error}}}}catch(vi){ce={error:vi}}finally{try{jr&&!jr.done&&(ge=Sr.return)&&ge.call(Sr)}finally{if(ce)throw ce.error}}}}catch(vi){U={error:vi}}finally{try{_t&&!_t.done&&(J=ut.return)&&J.call(ut)}finally{if(U)throw U.error}}},c.isPartialRow=function(l,w){var U,J,ce,ge,Pe,Ge;try{for(var ut=Hc(w),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value,Ht=!0;try{for(var Sr=(ce=void 0,Hc(l)),jr=Sr.next();!jr.done;jr=Sr.next()){var sn=jr.value,dn=!1;try{for(var ln=(Pe=void 0,Hc(Ot.getPairs())),On=ln.next();!On.done;On=ln.next())if(sn.equals(On.value)){dn=!0;break}}catch(vi){Pe={error:vi}}finally{try{On&&!On.done&&(Ge=ln.return)&&Ge.call(ln)}finally{if(Pe)throw Pe.error}}if(!dn){Ht=!1;break}}}catch(vi){ce={error:vi}}finally{try{jr&&!jr.done&&(ge=Sr.return)&&ge.call(Sr)}finally{if(ce)throw ce.error}}if(Ht)return!0}}catch(vi){U={error:vi}}finally{try{_t&&!_t.done&&(J=ut.return)&&J.call(ut)}finally{if(U)throw U.error}}return!1},c.prototype.getRows=function(){return this.rows},c.constructResult=function(l){var U=function rx(y){try{if(y.get(1))return new Xo(y);if(!y.get(2))return new Wa(y);switch(un.extractNumericValueFromBitArray(y,1,4)){case 4:return new qn(y);case 5:return new a1(y)}switch(un.extractNumericValueFromBitArray(y,1,5)){case 12:return new Xg(y);case 13:return new Eh(y)}switch(un.extractNumericValueFromBitArray(y,1,7)){case 56:return new Rp(y,"310","11");case 57:return new Rp(y,"320","11");case 58:return new Rp(y,"310","13");case 59:return new Rp(y,"320","13");case 60:return new Rp(y,"310","15");case 61:return new Rp(y,"320","15");case 62:return new Rp(y,"310","17");case 63:return new Rp(y,"320","17")}}catch(U){throw console.log(U),new ou("unknown decoder: "+y)}}(Wh.buildBitArray(l)),J=U.parseInformation(),ce=l[0].getFinderPattern().getResultPoints(),ge=l[l.length-1].getFinderPattern().getResultPoints();return new Cs(J,null,null,[ce[0],ce[1],ge[0],ge[1]],Co.RSS_EXPANDED,null)},c.prototype.checkChecksum=function(){var l=this.pairs.get(0),w=l.getLeftChar(),U=l.getRightChar();if(null===U)return!1;for(var J=U.getChecksumPortion(),ce=2,ge=1;ge=0?U:this.isEmptyPair(w)?0:w[w.length-1].getFinderPattern().getStartEnd()[1];var Ge=w.length%2!=0;this.startFromEven&&(Ge=!Ge);for(var ut=!1;ge=0&&!l.get(Pe);)Pe--;Pe++,J=this.startEnd[0]-Pe,ce=Pe,ge=this.startEnd[1]}else ce=this.startEnd[0],J=(ge=l.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var ut,Ge=this.getDecodeFinderCounters();Rt.arraycopy(Ge,0,Ge,1,Ge.length-1),Ge[0]=J;try{ut=this.parseFinderValue(Ge,c.FINDER_PATTERNS)}catch{return null}return new Hg(ut,[ce,ge],ce,ge,w)},c.prototype.decodeDataCharacter=function(l,w,U,J){for(var ce=this.getDataCharacterCounters(),ge=0;ge.3)throw new Gn;var Sr=this.getOddCounts(),jr=this.getEvenCounts(),sn=this.getOddRoundingErrors(),dn=this.getEvenRoundingErrors();for(Pe=0;Pe8){if(ln>8.7)throw new Gn;On=8}var Wn=Pe/2;1&Pe?(jr[Wn]=On,dn[Wn]=ln-On):(Sr[Wn]=On,sn[Wn]=ln-On)}this.adjustOddEvenCounts(17);var vi=4*w.getValue()+(U?0:2)+(J?0:1)-1,ki=0,Xi=0;for(Pe=Sr.length-1;Pe>=0;Pe--)c.isNotA1left(w,U,J)&&(Xi+=Sr[Pe]*c.WEIGHTS[vi][2*Pe]),ki+=Sr[Pe];var Ns=0;for(Pe=jr.length-1;Pe>=0;Pe--)c.isNotA1left(w,U,J)&&(Ns+=jr[Pe]*c.WEIGHTS[vi][2*Pe+1]);var ps=Xi+Ns;if(1&ki||ki>13||ki<4)throw new Gn;var Dl=(13-ki)/2,Ra=c.SYMBOL_WIDEST[Dl],Xc=9-Ra,cd=cf.getRSSvalue(Sr,Ra,!0),ff=cf.getRSSvalue(jr,Xc,!1);return new Yf(cd*c.EVEN_TOTAL_SUBSET[Dl]+ff+c.GSUM[Dl],ps)},c.isNotA1left=function(l,w,U){return!(0===l.getValue()&&w&&U)},c.prototype.adjustOddEvenCounts=function(l){var w=Ys.sum(new Int32Array(this.getOddCounts())),U=Ys.sum(new Int32Array(this.getEvenCounts())),J=!1,ce=!1;w>13?ce=!0:w<4&&(J=!0);var ge=!1,Pe=!1;U>13?Pe=!0:U<4&&(ge=!0);var Ge=w+U-l,ut=!(1&~w),_t=!(1&U);if(1===Ge)if(ut){if(_t)throw new Gn;ce=!0}else{if(!_t)throw new Gn;Pe=!0}else if(-1===Ge)if(ut){if(_t)throw new Gn;J=!0}else{if(!_t)throw new Gn;ge=!0}else{if(0!==Ge)throw new Gn;if(ut){if(!_t)throw new Gn;w=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const _m=function(y){function c(){var l=null!==y&&y.apply(this,arguments)||this;return l.possibleLeftPairs=[],l.possibleRightPairs=[],l}return Hw(c,y),c.prototype.decodeRow=function(l,w,U){var J,ce,ge,Pe,Ge=this.decodePair(w,!1,l,U);c.addOrTally(this.possibleLeftPairs,Ge),w.reverse();var ut=this.decodePair(w,!0,l,U);c.addOrTally(this.possibleRightPairs,ut),w.reverse();try{for(var _t=wm(this.possibleLeftPairs),Ot=_t.next();!Ot.done;Ot=_t.next()){var Ht=Ot.value;if(Ht.getCount()>1)try{for(var Sr=(ge=void 0,wm(this.possibleRightPairs)),jr=Sr.next();!jr.done;jr=Sr.next()){var sn=jr.value;if(sn.getCount()>1&&c.checkChecksum(Ht,sn))return c.constructResult(Ht,sn)}}catch(dn){ge={error:dn}}finally{try{jr&&!jr.done&&(Pe=Sr.return)&&Pe.call(Sr)}finally{if(ge)throw ge.error}}}}catch(dn){J={error:dn}}finally{try{Ot&&!Ot.done&&(ce=_t.return)&&ce.call(_t)}finally{if(J)throw J.error}}throw new Gn},c.addOrTally=function(l,w){var U,J;if(null!=w){var ce=!1;try{for(var ge=wm(l),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;if(Ge.getValue()===w.getValue()){Ge.incrementCount(),ce=!0;break}}}catch(ut){U={error:ut}}finally{try{Pe&&!Pe.done&&(J=ge.return)&&J.call(ge)}finally{if(U)throw U.error}}ce||l.push(w)}},c.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},c.constructResult=function(l,w){for(var U=4537077*l.getValue()+w.getValue(),J=new String(U).toString(),ce=new Ur,ge=13-J.length;ge>0;ge--)ce.append("0");ce.append(J);var Pe=0;for(ge=0;ge<13;ge++){var Ge=ce.charAt(ge).charCodeAt(0)-48;Pe+=1&ge?Ge:3*Ge}10==(Pe=10-Pe%10)&&(Pe=0),ce.append(Pe.toString());var ut=l.getFinderPattern().getResultPoints(),_t=w.getFinderPattern().getResultPoints();return new Cs(ce.toString(),null,0,[ut[0],ut[1],_t[0],_t[1]],Co.RSS_14,(new Date).getTime())},c.checkChecksum=function(l,w){var U=(l.getChecksumPortion()+16*w.getChecksumPortion())%79,J=9*l.getFinderPattern().getValue()+w.getFinderPattern().getValue();return J>72&&J--,J>8&&J--,U===J},c.prototype.decodePair=function(l,w,U,J){try{var ce=this.findFinderPattern(l,w),ge=this.parseFoundFinderPattern(l,U,w,ce),Pe=null==J?null:J.get(Ci.NEED_RESULT_POINT_CALLBACK);if(null!=Pe){var Ge=(ce[0]+ce[1])/2;w&&(Ge=l.getSize()-1-Ge),Pe.foundPossibleResultPoint(new _o(Ge,U))}var ut=this.decodeDataCharacter(l,ge,!0),_t=this.decodeDataCharacter(l,ge,!1);return new eh(1597*ut.getValue()+_t.getValue(),ut.getChecksumPortion()+4*_t.getChecksumPortion(),ge)}catch{return null}},c.prototype.decodeDataCharacter=function(l,w,U){for(var J=this.getDataCharacterCounters(),ce=0;ce8&&(dn=8);var ln=Math.floor(ge/2);1&ge?(Ht[ln]=dn,jr[ln]=sn-dn):(Ot[ln]=dn,Sr[ln]=sn-dn)}this.adjustOddEvenCounts(U,ut);var On=0,Wn=0;for(ge=Ot.length-1;ge>=0;ge--)Wn*=9,Wn+=Ot[ge],On+=Ot[ge];var vi=0,ki=0;for(ge=Ht.length-1;ge>=0;ge--)vi*=9,vi+=Ht[ge],ki+=Ht[ge];var So,Ns,Xi=Wn+3*vi;if(U){if(1&On||On>12||On<4)throw new Gn;var ps=9-(Ns=c.OUTSIDE_ODD_WIDEST[So=(12-On)/2]),Dl=cf.getRSSvalue(Ot,Ns,!1),Ra=cf.getRSSvalue(Ht,ps,!0);return new Yf(Dl*c.OUTSIDE_EVEN_TOTAL_SUBSET[So]+Ra+c.OUTSIDE_GSUM[So],Xi)}if(1&ki||ki>10||ki<4)throw new Gn;return ps=9-(Ns=c.INSIDE_ODD_WIDEST[So=(10-ki)/2]),Dl=cf.getRSSvalue(Ot,Ns,!0),Ra=cf.getRSSvalue(Ht,ps,!1),new Yf(Ra*c.INSIDE_ODD_TOTAL_SUBSET[So]+Dl+c.INSIDE_GSUM[So],Xi)},c.prototype.findFinderPattern=function(l,w){var U=this.getDecodeFinderCounters();U[0]=0,U[1]=0,U[2]=0,U[3]=0;for(var J=l.getSize(),ce=!1,ge=0;ge=0&&ce!==l.get(ge);)ge--;ge++;var Pe=J[0]-ge,Ge=this.getDecodeFinderCounters(),ut=new Int32Array(Ge.length);Rt.arraycopy(Ge,0,ut,1,Ge.length-1),ut[0]=Pe;var _t=this.parseFinderValue(ut,c.FINDER_PATTERNS),Ot=ge,Ht=J[1];return U&&(Ot=l.getSize()-1-Ot,Ht=l.getSize()-1-Ht),new Hg(_t,[ge,J[1]],Ot,Ht,w)},c.prototype.adjustOddEvenCounts=function(l,w){var U=Ys.sum(new Int32Array(this.getOddCounts())),J=Ys.sum(new Int32Array(this.getEvenCounts())),ce=!1,ge=!1,Pe=!1,Ge=!1;l?(U>12?ge=!0:U<4&&(ce=!0),J>12?Ge=!0:J<4&&(Pe=!0)):(U>11?ge=!0:U<5&&(ce=!0),J>10?Ge=!0:J<4&&(Pe=!0));var ut=U+J-w,_t=(1&U)==(l?1:0),Ot=!(1&~J);if(1===ut)if(_t){if(Ot)throw new Gn;ge=!0}else{if(!Ot)throw new Gn;Ge=!0}else if(-1===ut)if(_t){if(Ot)throw new Gn;ce=!0}else{if(!Ot)throw new Gn;Pe=!0}else{if(0!==ut)throw new Gn;if(_t){if(!Ot)throw new Gn;U=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}),Is=function(){function y(c,l,w){this.ecCodewords=c,this.ecBlocks=[l],w&&this.ecBlocks.push(w)}return y.prototype.getECCodewords=function(){return this.ecCodewords},y.prototype.getECBlocks=function(){return this.ecBlocks},y}(),Ya=function(){function y(c,l){this.count=c,this.dataCodewords=l}return y.prototype.getCount=function(){return this.count},y.prototype.getDataCodewords=function(){return this.dataCodewords},y}();const Gl=function(){function y(c,l,w,U,J,ce){var ge,Pe;this.versionNumber=c,this.symbolSizeRows=l,this.symbolSizeColumns=w,this.dataRegionSizeRows=U,this.dataRegionSizeColumns=J,this.ecBlocks=ce;var Ge=0,ut=ce.getECCodewords(),_t=ce.getECBlocks();try{for(var Ot=Zg(_t),Ht=Ot.next();!Ht.done;Ht=Ot.next()){var Sr=Ht.value;Ge+=Sr.getCount()*(Sr.getDataCodewords()+ut)}}catch(jr){ge={error:jr}}finally{try{Ht&&!Ht.done&&(Pe=Ot.return)&&Pe.call(Ot)}finally{if(ge)throw ge.error}}this.totalCodewords=Ge}return y.prototype.getVersionNumber=function(){return this.versionNumber},y.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},y.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},y.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},y.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},y.prototype.getTotalCodewords=function(){return this.totalCodewords},y.prototype.getECBlocks=function(){return this.ecBlocks},y.getVersionForDimensions=function(c,l){var w,U;if(1&c||1&l)throw new Qn;try{for(var J=Zg(y.VERSIONS),ce=J.next();!ce.done;ce=J.next()){var ge=ce.value;if(ge.symbolSizeRows===c&&ge.symbolSizeColumns===l)return ge}}catch(Pe){w={error:Pe}}finally{try{ce&&!ce.done&&(U=J.return)&&U.call(J)}finally{if(w)throw w.error}}throw new Qn},y.prototype.toString=function(){return""+this.versionNumber},y.buildVersions=function(){return[new y(1,10,10,8,8,new Is(5,new Ya(1,3))),new y(2,12,12,10,10,new Is(7,new Ya(1,5))),new y(3,14,14,12,12,new Is(10,new Ya(1,8))),new y(4,16,16,14,14,new Is(12,new Ya(1,12))),new y(5,18,18,16,16,new Is(14,new Ya(1,18))),new y(6,20,20,18,18,new Is(18,new Ya(1,22))),new y(7,22,22,20,20,new Is(20,new Ya(1,30))),new y(8,24,24,22,22,new Is(24,new Ya(1,36))),new y(9,26,26,24,24,new Is(28,new Ya(1,44))),new y(10,32,32,14,14,new Is(36,new Ya(1,62))),new y(11,36,36,16,16,new Is(42,new Ya(1,86))),new y(12,40,40,18,18,new Is(48,new Ya(1,114))),new y(13,44,44,20,20,new Is(56,new Ya(1,144))),new y(14,48,48,22,22,new Is(68,new Ya(1,174))),new y(15,52,52,24,24,new Is(42,new Ya(2,102))),new y(16,64,64,14,14,new Is(56,new Ya(2,140))),new y(17,72,72,16,16,new Is(36,new Ya(4,92))),new y(18,80,80,18,18,new Is(48,new Ya(4,114))),new y(19,88,88,20,20,new Is(56,new Ya(4,144))),new y(20,96,96,22,22,new Is(68,new Ya(4,174))),new y(21,104,104,24,24,new Is(56,new Ya(6,136))),new y(22,120,120,18,18,new Is(68,new Ya(6,175))),new y(23,132,132,20,20,new Is(62,new Ya(8,163))),new y(24,144,144,22,22,new Is(62,new Ya(8,156),new Ya(2,155))),new y(25,8,18,6,16,new Is(7,new Ya(1,5))),new y(26,8,32,6,14,new Is(11,new Ya(1,10))),new y(27,12,26,10,24,new Is(14,new Ya(1,16))),new y(28,12,36,10,16,new Is(18,new Ya(1,22))),new y(29,16,36,14,16,new Is(24,new Ya(1,32))),new y(30,16,48,14,22,new Is(28,new Ya(1,49)))]},y.VERSIONS=y.buildVersions(),y}(),Wc=function(){function y(c){var l=c.getHeight();if(l<8||l>144||1&l)throw new Qn;this.version=y.readVersion(c),this.mappingBitMatrix=this.extractDataRegion(c),this.readMappingMatrix=new Qi(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return y.prototype.getVersion=function(){return this.version},y.readVersion=function(c){var l=c.getHeight(),w=c.getWidth();return Gl.getVersionForDimensions(l,w)},y.prototype.readCodewords=function(){var c=new Int8Array(this.version.getTotalCodewords()),l=0,w=4,U=0,J=this.mappingBitMatrix.getHeight(),ce=this.mappingBitMatrix.getWidth(),ge=!1,Pe=!1,Ge=!1,ut=!1;do{if(w!==J||0!==U||ge)if(w===J-2&&0===U&&3&ce&&!Pe)c[l++]=255&this.readCorner2(J,ce),w-=2,U+=2,Pe=!0;else if(w!==J+4||2!==U||7&ce||Ge)if(w!==J-2||0!==U||4!=(7&ce)||ut){do{w=0&&!this.readMappingMatrix.get(U,w)&&(c[l++]=255&this.readUtah(w,U,J,ce)),w-=2,U+=2}while(w>=0&&U=0&&U=0);w+=3,U+=1}else c[l++]=255&this.readCorner4(J,ce),w-=2,U+=2,ut=!0;else c[l++]=255&this.readCorner3(J,ce),w-=2,U+=2,Ge=!0;else c[l++]=255&this.readCorner1(J,ce),w-=2,U+=2,ge=!0}while(w=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const wc=function(){function y(c,l){this.numDataCodewords=c,this.codewords=l}return y.getDataBlocks=function(c,l){var w,U,J,ce,ge=l.getECBlocks(),Pe=0,Ge=ge.getECBlocks();try{for(var ut=Gw(Ge),_t=ut.next();!_t.done;_t=ut.next())Pe+=(Ot=_t.value).getCount()}catch(cd){w={error:cd}}finally{try{_t&&!_t.done&&(U=ut.return)&&U.call(ut)}finally{if(w)throw w.error}}var Ht=new Array(Pe),Sr=0;try{for(var jr=Gw(Ge),sn=jr.next();!sn.done;sn=jr.next())for(var Ot=sn.value,dn=0;dn7?dn-1:dn]=c[Xi++]}if(Xi!==c.length)throw new Bi;return Ht},y.prototype.getNumDataCodewords=function(){return this.numDataCodewords},y.prototype.getCodewords=function(){return this.codewords},y}(),Yg=function(){function y(c){this.bytes=c,this.byteOffset=0,this.bitOffset=0}return y.prototype.getBitOffset=function(){return this.bitOffset},y.prototype.getByteOffset=function(){return this.byteOffset},y.prototype.readBits=function(c){if(c<1||c>32||c>this.available())throw new Bi(""+c);var l=0,w=this.bitOffset,U=this.byteOffset,J=this.bytes;if(w>0){var ce=8-w,ge=c>8-ge<<(Pe=ce-ge))>>Pe,c-=ge,8===(w+=ge)&&(w=0,U++)}if(c>0){for(;c>=8;)l=l<<8|255&J[U],U++,c-=8;var Pe;c>0&&(l=l<>(Pe=8-c)<>Pe,w+=c)}return this.bitOffset=w,this.byteOffset=U,l},y.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},y}();var Ga=function(y){return y[y.PAD_ENCODE=0]="PAD_ENCODE",y[y.ASCII_ENCODE=1]="ASCII_ENCODE",y[y.C40_ENCODE=2]="C40_ENCODE",y[y.TEXT_ENCODE=3]="TEXT_ENCODE",y[y.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",y[y.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",y[y.BASE256_ENCODE=6]="BASE256_ENCODE",y}(Ga||{});const Sh=function(){function y(){}return y.decode=function(c){var l=new Yg(c),w=new Ur,U=new Ur,J=new Array,ce=Ga.ASCII_ENCODE;do{if(ce===Ga.ASCII_ENCODE)ce=this.decodeAsciiSegment(l,w,U);else{switch(ce){case Ga.C40_ENCODE:this.decodeC40Segment(l,w);break;case Ga.TEXT_ENCODE:this.decodeTextSegment(l,w);break;case Ga.ANSIX12_ENCODE:this.decodeAnsiX12Segment(l,w);break;case Ga.EDIFACT_ENCODE:this.decodeEdifactSegment(l,w);break;case Ga.BASE256_ENCODE:this.decodeBase256Segment(l,w,J);break;default:throw new Qn}ce=Ga.ASCII_ENCODE}}while(ce!==Ga.PAD_ENCODE&&l.available()>0);return U.length()>0&&w.append(U.toString()),new qu(c,w.toString(),0===J.length?null:J,null)},y.decodeAsciiSegment=function(c,l,w){var U=!1;do{var J=c.readBits(8);if(0===J)throw new Qn;if(J<=128)return U&&(J+=128),l.append(String.fromCharCode(J-1)),Ga.ASCII_ENCODE;if(129===J)return Ga.PAD_ENCODE;if(J<=229){var ce=J-130;ce<10&&l.append("0"),l.append(""+ce)}else switch(J){case 230:return Ga.C40_ENCODE;case 231:return Ga.BASE256_ENCODE;case 232:l.append("\x1d");break;case 233:case 234:case 241:break;case 235:U=!0;break;case 236:l.append("[)>\x1e05\x1d"),w.insert(0,"\x1e\x04");break;case 237:l.append("[)>\x1e06\x1d"),w.insert(0,"\x1e\x04");break;case 238:return Ga.ANSIX12_ENCODE;case 239:return Ga.TEXT_ENCODE;case 240:return Ga.EDIFACT_ENCODE;default:if(254!==J||0!==c.available())throw new Qn}}while(c.available()>0);return Ga.ASCII_ENCODE},y.decodeC40Segment=function(c,l){var w=!1,U=[],J=0;do{if(8===c.available())return;var ce=c.readBits(8);if(254===ce)return;this.parseTwoBytes(ce,c.readBits(8),U);for(var ge=0;ge<3;ge++){var Pe=U[ge];switch(J){case 0:if(Pe<3)J=Pe+1;else{if(!(Pe0)},y.decodeTextSegment=function(c,l){var w=!1,U=[],J=0;do{if(8===c.available())return;var ce=c.readBits(8);if(254===ce)return;this.parseTwoBytes(ce,c.readBits(8),U);for(var ge=0;ge<3;ge++){var Pe=U[ge];switch(J){case 0:if(Pe<3)J=Pe+1;else{if(!(Pe0)},y.decodeAnsiX12Segment=function(c,l){var w=[];do{if(8===c.available())return;var U=c.readBits(8);if(254===U)return;this.parseTwoBytes(U,c.readBits(8),w);for(var J=0;J<3;J++){var ce=w[J];switch(ce){case 0:l.append("\r");break;case 1:l.append("*");break;case 2:l.append(">");break;case 3:l.append(" ");break;default:if(ce<14)l.append(String.fromCharCode(ce+44));else{if(!(ce<40))throw new Qn;l.append(String.fromCharCode(ce+51))}}}}while(c.available()>0)},y.parseTwoBytes=function(c,l,w){var U=(c<<8)+l-1,J=Math.floor(U/1600);w[0]=J,U-=1600*J,J=Math.floor(U/40),w[1]=J,w[2]=U-40*J},y.decodeEdifactSegment=function(c,l){do{if(c.available()<=16)return;for(var w=0;w<4;w++){var U=c.readBits(6);if(31===U){var J=8-c.getBitOffset();return void(8!==J&&c.readBits(J))}32&U||(U|=64),l.append(String.fromCharCode(U))}}while(c.available()>0)},y.decodeBase256Segment=function(c,l,w){var ce,U=1+c.getByteOffset(),J=this.unrandomize255State(c.readBits(8),U++);if((ce=0===J?c.available()/8|0:J<250?J:250*(J-249)+this.unrandomize255State(c.readBits(8),U++))<0)throw new Qn;for(var ge=new Uint8Array(ce),Pe=0;Pe=0?U:U+256},y.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],y.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],y.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],y.TEXT_SHIFT2_SET_CHARS=y.C40_SHIFT2_SET_CHARS,y.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~","\x7f"],y}(),Qg=function(){function y(){this.rsDecoder=new xc(Pa.DATA_MATRIX_FIELD_256)}return y.prototype.decode=function(c){var l,w,U=new Wc(c),J=U.getVersion(),ce=U.readCodewords(),ge=wc.getDataBlocks(ce,J),Pe=0;try{for(var Ge=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(ge),ut=Ge.next();!ut.done;ut=Ge.next())Pe+=ut.value.getNumDataCodewords()}catch(On){l={error:On}}finally{try{ut&&!ut.done&&(w=Ge.return)&&w.call(Ge)}finally{if(l)throw l.error}}for(var Ot=new Uint8Array(Pe),Ht=ge.length,Sr=0;Srge&&(ut=ge,_t[0]=l,_t[1]=w,_t[2]=U,_t[3]=J),ut>Pe&&(ut=Pe,_t[0]=w,_t[1]=U,_t[2]=J,_t[3]=l),ut>Ge&&(_t[0]=U,_t[1]=J,_t[2]=l,_t[3]=w),_t},y.prototype.detectSolid2=function(c){var l=c[0],w=c[1],U=c[2],J=c[3],ce=this.transitionsBetween(l,J),ge=y.shiftPoint(w,U,4*(ce+1)),Pe=y.shiftPoint(U,w,4*(ce+1));return this.transitionsBetween(ge,l)this.transitionsBetween(Pe,_t)+this.transitionsBetween(Ge,_t)?ut:_t:ut:this.isValid(_t)?_t:null},y.prototype.shiftToModuleCenter=function(c){var l=c[0],w=c[1],U=c[2],J=c[3],ce=this.transitionsBetween(l,J)+1,ge=this.transitionsBetween(U,J)+1,Pe=y.shiftPoint(l,w,4*ge),Ge=y.shiftPoint(U,w,4*ce);!(1&~(ce=this.transitionsBetween(Pe,J)+1))&&(ce+=1),!(1&~(ge=this.transitionsBetween(Ge,J)+1))&&(ge+=1);var Ot,Ht,ut=(l.getX()+w.getX()+U.getX()+J.getX())/4,_t=(l.getY()+w.getY()+U.getY()+J.getY())/4;return l=y.moveAway(l,ut,_t),w=y.moveAway(w,ut,_t),U=y.moveAway(U,ut,_t),J=y.moveAway(J,ut,_t),Pe=y.shiftPoint(l,w,4*ge),Pe=y.shiftPoint(Pe,J,4*ce),Ot=y.shiftPoint(w,l,4*ge),Ot=y.shiftPoint(Ot,U,4*ce),Ge=y.shiftPoint(U,J,4*ge),Ge=y.shiftPoint(Ge,w,4*ce),Ht=y.shiftPoint(J,U,4*ge),[Pe,Ot,Ge,Ht=y.shiftPoint(Ht,l,4*ce)]},y.prototype.isValid=function(c){return c.getX()>=0&&c.getX()0&&c.getY()Math.abs(J-w);if(ge){var Pe=w;w=U,U=Pe,Pe=J,J=ce,ce=Pe}for(var Ge=Math.abs(J-w),ut=Math.abs(ce-U),_t=-Ge/2,Ot=U0){if(dn===ce)break;dn+=Ot,_t-=Ge}}return Sr},y}(),v0=function(){function y(){this.decoder=new Qg}return y.prototype.decode=function(c,l){var w,U;if(void 0===l&&(l=null),null!=l&&l.has(Ci.PURE_BARCODE)){var J=y.extractPureBits(c.getBlackMatrix());w=this.decoder.decode(J),U=y.NO_POINTS}else{var ce=new Xw(c.getBlackMatrix()).detect();w=this.decoder.decode(ce.getBits()),U=ce.getPoints()}var ge=w.getRawBytes(),Pe=new Cs(w.getText(),ge,8*ge.length,U,Co.DATA_MATRIX,Rt.currentTimeMillis()),Ge=w.getByteSegments();null!=Ge&&Pe.putMetadata(gc.BYTE_SEGMENTS,Ge);var ut=w.getECLevel();return null!=ut&&Pe.putMetadata(gc.ERROR_CORRECTION_LEVEL,ut),Pe},y.prototype.reset=function(){},y.extractPureBits=function(c){var l=c.getTopLeftOnBit(),w=c.getBottomRightOnBit();if(null==l||null==w)throw new Gn;var U=this.moduleSize(l,c),J=l[1],ge=l[0],Ge=(w[0]-ge+1)/U,ut=(w[1]-J+1)/U;if(Ge<=0||ut<=0)throw new Gn;var _t=U/2;J+=_t,ge+=_t;for(var Ot=new Qi(Ge,ut),Ht=0;Ht=y.FOR_BITS.size)throw new Bi;return y.FOR_BITS.get(c)},y.FOR_BITS=new Map,y.FOR_VALUE=new Map,y.L=new y(Ah.L,"L",1),y.M=new y(Ah.M,"M",0),y.Q=new y(Ah.Q,"Q",3),y.H=new y(Ah.H,"H",2),y}(),Uc=function(){function y(c){this.errorCorrectionLevel=Sl.forBits(c>>3&3),this.dataMask=7&c}return y.numBitsDiffering=function(c,l){return pi.bitCount(c^l)},y.decodeFormatInformation=function(c,l){var w=y.doDecodeFormatInformation(c,l);return null!==w?w:y.doDecodeFormatInformation(c^y.FORMAT_INFO_MASK_QR,l^y.FORMAT_INFO_MASK_QR)},y.doDecodeFormatInformation=function(c,l){var w,U,J=Number.MAX_SAFE_INTEGER,ce=0;try{for(var ge=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(y.FORMAT_INFO_DECODE_LOOKUP),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value,ut=Ge[0];if(ut===c||ut===l)return new y(Ge[1]);var _t=y.numBitsDiffering(c,ut);_t=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(U),ce=J.next();!ce.done;ce=J.next())w+=ce.value.getCount()}catch(Pe){c={error:Pe}}finally{try{ce&&!ce.done&&(l=J.return)&&l.call(J)}finally{if(c)throw c.error}}return w},y.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},y.prototype.getECBlocks=function(){return this.ecBlocks},y}(),Vr=function(){function y(c,l){this.count=c,this.dataCodewords=l}return y.prototype.getCount=function(){return this.count},y.prototype.getDataCodewords=function(){return this.dataCodewords},y}(),Zh=function(){function y(c,l){for(var w,U,J=[],ce=2;ce=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(Ge),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value;ge+=Ot.getCount()*(Ot.getDataCodewords()+Pe)}}catch(Ht){w={error:Ht}}finally{try{_t&&!_t.done&&(U=ut.return)&&U.call(ut)}finally{if(w)throw w.error}}this.totalCodewords=ge}return y.prototype.getVersionNumber=function(){return this.versionNumber},y.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},y.prototype.getTotalCodewords=function(){return this.totalCodewords},y.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},y.prototype.getECBlocksForLevel=function(c){return this.ecBlocks[c.getValue()]},y.getProvisionalVersionForDimension=function(c){if(c%4!=1)throw new Qn;try{return this.getVersionForNumber((c-17)/4)}catch{throw new Qn}},y.getVersionForNumber=function(c){if(c<1||c>40)throw new Bi;return y.VERSIONS[c-1]},y.decodeVersionInformation=function(c){for(var l=Number.MAX_SAFE_INTEGER,w=0,U=0;U6&&(l.setRegion(c-11,0,3,6),l.setRegion(0,c-11,6,3)),l},y.prototype.toString=function(){return""+this.versionNumber},y.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),y.VERSIONS=[new y(1,new Int32Array(0),new Mn(7,new Vr(1,19)),new Mn(10,new Vr(1,16)),new Mn(13,new Vr(1,13)),new Mn(17,new Vr(1,9))),new y(2,Int32Array.from([6,18]),new Mn(10,new Vr(1,34)),new Mn(16,new Vr(1,28)),new Mn(22,new Vr(1,22)),new Mn(28,new Vr(1,16))),new y(3,Int32Array.from([6,22]),new Mn(15,new Vr(1,55)),new Mn(26,new Vr(1,44)),new Mn(18,new Vr(2,17)),new Mn(22,new Vr(2,13))),new y(4,Int32Array.from([6,26]),new Mn(20,new Vr(1,80)),new Mn(18,new Vr(2,32)),new Mn(26,new Vr(2,24)),new Mn(16,new Vr(4,9))),new y(5,Int32Array.from([6,30]),new Mn(26,new Vr(1,108)),new Mn(24,new Vr(2,43)),new Mn(18,new Vr(2,15),new Vr(2,16)),new Mn(22,new Vr(2,11),new Vr(2,12))),new y(6,Int32Array.from([6,34]),new Mn(18,new Vr(2,68)),new Mn(16,new Vr(4,27)),new Mn(24,new Vr(4,19)),new Mn(28,new Vr(4,15))),new y(7,Int32Array.from([6,22,38]),new Mn(20,new Vr(2,78)),new Mn(18,new Vr(4,31)),new Mn(18,new Vr(2,14),new Vr(4,15)),new Mn(26,new Vr(4,13),new Vr(1,14))),new y(8,Int32Array.from([6,24,42]),new Mn(24,new Vr(2,97)),new Mn(22,new Vr(2,38),new Vr(2,39)),new Mn(22,new Vr(4,18),new Vr(2,19)),new Mn(26,new Vr(4,14),new Vr(2,15))),new y(9,Int32Array.from([6,26,46]),new Mn(30,new Vr(2,116)),new Mn(22,new Vr(3,36),new Vr(2,37)),new Mn(20,new Vr(4,16),new Vr(4,17)),new Mn(24,new Vr(4,12),new Vr(4,13))),new y(10,Int32Array.from([6,28,50]),new Mn(18,new Vr(2,68),new Vr(2,69)),new Mn(26,new Vr(4,43),new Vr(1,44)),new Mn(24,new Vr(6,19),new Vr(2,20)),new Mn(28,new Vr(6,15),new Vr(2,16))),new y(11,Int32Array.from([6,30,54]),new Mn(20,new Vr(4,81)),new Mn(30,new Vr(1,50),new Vr(4,51)),new Mn(28,new Vr(4,22),new Vr(4,23)),new Mn(24,new Vr(3,12),new Vr(8,13))),new y(12,Int32Array.from([6,32,58]),new Mn(24,new Vr(2,92),new Vr(2,93)),new Mn(22,new Vr(6,36),new Vr(2,37)),new Mn(26,new Vr(4,20),new Vr(6,21)),new Mn(28,new Vr(7,14),new Vr(4,15))),new y(13,Int32Array.from([6,34,62]),new Mn(26,new Vr(4,107)),new Mn(22,new Vr(8,37),new Vr(1,38)),new Mn(24,new Vr(8,20),new Vr(4,21)),new Mn(22,new Vr(12,11),new Vr(4,12))),new y(14,Int32Array.from([6,26,46,66]),new Mn(30,new Vr(3,115),new Vr(1,116)),new Mn(24,new Vr(4,40),new Vr(5,41)),new Mn(20,new Vr(11,16),new Vr(5,17)),new Mn(24,new Vr(11,12),new Vr(5,13))),new y(15,Int32Array.from([6,26,48,70]),new Mn(22,new Vr(5,87),new Vr(1,88)),new Mn(24,new Vr(5,41),new Vr(5,42)),new Mn(30,new Vr(5,24),new Vr(7,25)),new Mn(24,new Vr(11,12),new Vr(7,13))),new y(16,Int32Array.from([6,26,50,74]),new Mn(24,new Vr(5,98),new Vr(1,99)),new Mn(28,new Vr(7,45),new Vr(3,46)),new Mn(24,new Vr(15,19),new Vr(2,20)),new Mn(30,new Vr(3,15),new Vr(13,16))),new y(17,Int32Array.from([6,30,54,78]),new Mn(28,new Vr(1,107),new Vr(5,108)),new Mn(28,new Vr(10,46),new Vr(1,47)),new Mn(28,new Vr(1,22),new Vr(15,23)),new Mn(28,new Vr(2,14),new Vr(17,15))),new y(18,Int32Array.from([6,30,56,82]),new Mn(30,new Vr(5,120),new Vr(1,121)),new Mn(26,new Vr(9,43),new Vr(4,44)),new Mn(28,new Vr(17,22),new Vr(1,23)),new Mn(28,new Vr(2,14),new Vr(19,15))),new y(19,Int32Array.from([6,30,58,86]),new Mn(28,new Vr(3,113),new Vr(4,114)),new Mn(26,new Vr(3,44),new Vr(11,45)),new Mn(26,new Vr(17,21),new Vr(4,22)),new Mn(26,new Vr(9,13),new Vr(16,14))),new y(20,Int32Array.from([6,34,62,90]),new Mn(28,new Vr(3,107),new Vr(5,108)),new Mn(26,new Vr(3,41),new Vr(13,42)),new Mn(30,new Vr(15,24),new Vr(5,25)),new Mn(28,new Vr(15,15),new Vr(10,16))),new y(21,Int32Array.from([6,28,50,72,94]),new Mn(28,new Vr(4,116),new Vr(4,117)),new Mn(26,new Vr(17,42)),new Mn(28,new Vr(17,22),new Vr(6,23)),new Mn(30,new Vr(19,16),new Vr(6,17))),new y(22,Int32Array.from([6,26,50,74,98]),new Mn(28,new Vr(2,111),new Vr(7,112)),new Mn(28,new Vr(17,46)),new Mn(30,new Vr(7,24),new Vr(16,25)),new Mn(24,new Vr(34,13))),new y(23,Int32Array.from([6,30,54,78,102]),new Mn(30,new Vr(4,121),new Vr(5,122)),new Mn(28,new Vr(4,47),new Vr(14,48)),new Mn(30,new Vr(11,24),new Vr(14,25)),new Mn(30,new Vr(16,15),new Vr(14,16))),new y(24,Int32Array.from([6,28,54,80,106]),new Mn(30,new Vr(6,117),new Vr(4,118)),new Mn(28,new Vr(6,45),new Vr(14,46)),new Mn(30,new Vr(11,24),new Vr(16,25)),new Mn(30,new Vr(30,16),new Vr(2,17))),new y(25,Int32Array.from([6,32,58,84,110]),new Mn(26,new Vr(8,106),new Vr(4,107)),new Mn(28,new Vr(8,47),new Vr(13,48)),new Mn(30,new Vr(7,24),new Vr(22,25)),new Mn(30,new Vr(22,15),new Vr(13,16))),new y(26,Int32Array.from([6,30,58,86,114]),new Mn(28,new Vr(10,114),new Vr(2,115)),new Mn(28,new Vr(19,46),new Vr(4,47)),new Mn(28,new Vr(28,22),new Vr(6,23)),new Mn(30,new Vr(33,16),new Vr(4,17))),new y(27,Int32Array.from([6,34,62,90,118]),new Mn(30,new Vr(8,122),new Vr(4,123)),new Mn(28,new Vr(22,45),new Vr(3,46)),new Mn(30,new Vr(8,23),new Vr(26,24)),new Mn(30,new Vr(12,15),new Vr(28,16))),new y(28,Int32Array.from([6,26,50,74,98,122]),new Mn(30,new Vr(3,117),new Vr(10,118)),new Mn(28,new Vr(3,45),new Vr(23,46)),new Mn(30,new Vr(4,24),new Vr(31,25)),new Mn(30,new Vr(11,15),new Vr(31,16))),new y(29,Int32Array.from([6,30,54,78,102,126]),new Mn(30,new Vr(7,116),new Vr(7,117)),new Mn(28,new Vr(21,45),new Vr(7,46)),new Mn(30,new Vr(1,23),new Vr(37,24)),new Mn(30,new Vr(19,15),new Vr(26,16))),new y(30,Int32Array.from([6,26,52,78,104,130]),new Mn(30,new Vr(5,115),new Vr(10,116)),new Mn(28,new Vr(19,47),new Vr(10,48)),new Mn(30,new Vr(15,24),new Vr(25,25)),new Mn(30,new Vr(23,15),new Vr(25,16))),new y(31,Int32Array.from([6,30,56,82,108,134]),new Mn(30,new Vr(13,115),new Vr(3,116)),new Mn(28,new Vr(2,46),new Vr(29,47)),new Mn(30,new Vr(42,24),new Vr(1,25)),new Mn(30,new Vr(23,15),new Vr(28,16))),new y(32,Int32Array.from([6,34,60,86,112,138]),new Mn(30,new Vr(17,115)),new Mn(28,new Vr(10,46),new Vr(23,47)),new Mn(30,new Vr(10,24),new Vr(35,25)),new Mn(30,new Vr(19,15),new Vr(35,16))),new y(33,Int32Array.from([6,30,58,86,114,142]),new Mn(30,new Vr(17,115),new Vr(1,116)),new Mn(28,new Vr(14,46),new Vr(21,47)),new Mn(30,new Vr(29,24),new Vr(19,25)),new Mn(30,new Vr(11,15),new Vr(46,16))),new y(34,Int32Array.from([6,34,62,90,118,146]),new Mn(30,new Vr(13,115),new Vr(6,116)),new Mn(28,new Vr(14,46),new Vr(23,47)),new Mn(30,new Vr(44,24),new Vr(7,25)),new Mn(30,new Vr(59,16),new Vr(1,17))),new y(35,Int32Array.from([6,30,54,78,102,126,150]),new Mn(30,new Vr(12,121),new Vr(7,122)),new Mn(28,new Vr(12,47),new Vr(26,48)),new Mn(30,new Vr(39,24),new Vr(14,25)),new Mn(30,new Vr(22,15),new Vr(41,16))),new y(36,Int32Array.from([6,24,50,76,102,128,154]),new Mn(30,new Vr(6,121),new Vr(14,122)),new Mn(28,new Vr(6,47),new Vr(34,48)),new Mn(30,new Vr(46,24),new Vr(10,25)),new Mn(30,new Vr(2,15),new Vr(64,16))),new y(37,Int32Array.from([6,28,54,80,106,132,158]),new Mn(30,new Vr(17,122),new Vr(4,123)),new Mn(28,new Vr(29,46),new Vr(14,47)),new Mn(30,new Vr(49,24),new Vr(10,25)),new Mn(30,new Vr(24,15),new Vr(46,16))),new y(38,Int32Array.from([6,32,58,84,110,136,162]),new Mn(30,new Vr(4,122),new Vr(18,123)),new Mn(28,new Vr(13,46),new Vr(32,47)),new Mn(30,new Vr(48,24),new Vr(14,25)),new Mn(30,new Vr(42,15),new Vr(32,16))),new y(39,Int32Array.from([6,26,54,82,110,138,166]),new Mn(30,new Vr(20,117),new Vr(4,118)),new Mn(28,new Vr(40,47),new Vr(7,48)),new Mn(30,new Vr(43,24),new Vr(22,25)),new Mn(30,new Vr(10,15),new Vr(67,16))),new y(40,Int32Array.from([6,30,58,86,114,142,170]),new Mn(30,new Vr(19,118),new Vr(6,119)),new Mn(28,new Vr(18,47),new Vr(31,48)),new Mn(30,new Vr(34,24),new Vr(34,25)),new Mn(30,new Vr(20,15),new Vr(61,16)))],y}();var Oa=function(y){return y[y.DATA_MASK_000=0]="DATA_MASK_000",y[y.DATA_MASK_001=1]="DATA_MASK_001",y[y.DATA_MASK_010=2]="DATA_MASK_010",y[y.DATA_MASK_011=3]="DATA_MASK_011",y[y.DATA_MASK_100=4]="DATA_MASK_100",y[y.DATA_MASK_101=5]="DATA_MASK_101",y[y.DATA_MASK_110=6]="DATA_MASK_110",y[y.DATA_MASK_111=7]="DATA_MASK_111",y}(Oa||{});const au=function(){function y(c,l){this.value=c,this.isMasked=l}return y.prototype.unmaskBitMatrix=function(c,l){for(var w=0;w=0;w--)c=this.copyBit(8,w,c);var U=this.bitMatrix.getHeight(),J=0,ce=U-7;for(w=U-1;w>=ce;w--)J=this.copyBit(8,w,J);for(l=U-8;l=0;J--)for(var ce=c-9;ce>=U;ce--)w=this.copyBit(ce,J,w);var ge=Zh.decodeVersionInformation(w);if(null!==ge&&ge.getDimensionForVersion()===c)return this.parsedVersion=ge,ge;for(w=0,ce=5;ce>=0;ce--)for(J=c-9;J>=U;J--)w=this.copyBit(ce,J,w);if(null!==(ge=Zh.decodeVersionInformation(w))&&ge.getDimensionForVersion()===c)return this.parsedVersion=ge,ge;throw new Qn},y.prototype.copyBit=function(c,l,w){return(this.isMirror?this.bitMatrix.get(l,c):this.bitMatrix.get(c,l))?w<<1|1:w<<1},y.prototype.readCodewords=function(){var c=this.readFormatInformation(),l=this.readVersion(),w=au.values.get(c.getDataMask()),U=this.bitMatrix.getHeight();w.unmaskBitMatrix(this.bitMatrix,U);for(var J=l.buildFunctionPattern(),ce=!0,ge=new Uint8Array(l.getTotalCodewords()),Pe=0,Ge=0,ut=0,_t=U-1;_t>0;_t-=2){6===_t&&_t--;for(var Ot=0;Ot=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Jw=function(){function y(c,l){this.numDataCodewords=c,this.codewords=l}return y.getDataBlocks=function(c,l,w){var U,J,ce,ge;if(c.length!==l.getTotalCodewords())throw new Bi;var Pe=l.getECBlocksForLevel(w),Ge=0,ut=Pe.getECBlocks();try{for(var _t=u1(ut),Ot=_t.next();!Ot.done;Ot=_t.next())Ge+=(Ht=Ot.value).getCount()}catch(Xc){U={error:Xc}}finally{try{Ot&&!Ot.done&&(J=_t.return)&&J.call(_t)}finally{if(U)throw U.error}}var Sr=new Array(Ge),jr=0;try{for(var sn=u1(ut),dn=sn.next();!dn.done;dn=sn.next())for(var Ht=dn.value,ln=0;ln=0&&Sr[ki].codewords.length!==vi;)ki--;ki++;var So=vi-Pe.getECCodewordsPerBlock(),Ns=0;for(ln=0;lnc.available())throw new Qn;for(var U=new Uint8Array(2*w),J=0;w>0;){var ce=c.readBits(13),ge=ce/96<<8&4294967295|ce%96;U[J]=(ge+=ge<959?41377:42657)>>8&255,U[J+1]=255&ge,J+=2,w--}try{l.append(Wt.decode(U,bt.GB2312))}catch(Pe){throw new Qn(Pe)}},y.decodeKanjiSegment=function(c,l,w){if(13*w>c.available())throw new Qn;for(var U=new Uint8Array(2*w),J=0;w>0;){var ce=c.readBits(13),ge=ce/192<<8&4294967295|ce%192;U[J]=(ge+=ge<7936?33088:49472)>>8,U[J+1]=ge,J+=2,w--}try{l.append(Wt.decode(U,bt.SHIFT_JIS))}catch(Pe){throw new Qn(Pe)}},y.decodeByteSegment=function(c,l,w,U,J,ce){if(8*w>c.available())throw new Qn;for(var ge=new Uint8Array(w),Pe=0;Pe=y.ALPHANUMERIC_CHARS.length)throw new Qn;return y.ALPHANUMERIC_CHARS[c]},y.decodeAlphanumericSegment=function(c,l,w,U){for(var J=l.length();w>1;){if(c.available()<11)throw new Qn;var ce=c.readBits(11);l.append(y.toAlphaNumericChar(Math.floor(ce/45))),l.append(y.toAlphaNumericChar(ce%45)),w-=2}if(1===w){if(c.available()<6)throw new Qn;l.append(y.toAlphaNumericChar(c.readBits(6)))}if(U)for(var ge=J;ge=3;){if(c.available()<10)throw new Qn;var U=c.readBits(10);if(U>=1e3)throw new Qn;l.append(y.toAlphaNumericChar(Math.floor(U/100))),l.append(y.toAlphaNumericChar(Math.floor(U/10)%10)),l.append(y.toAlphaNumericChar(U%10)),w-=3}if(2===w){if(c.available()<7)throw new Qn;var J=c.readBits(7);if(J>=100)throw new Qn;l.append(y.toAlphaNumericChar(Math.floor(J/10))),l.append(y.toAlphaNumericChar(J%10))}else if(1===w){if(c.available()<4)throw new Qn;var ce=c.readBits(4);if(ce>=10)throw new Qn;l.append(y.toAlphaNumericChar(ce))}},y.parseECIValue=function(c){var l=c.readBits(8);if(!(128&l))return 127&l;if(128==(192&l))return(63&l)<<8&4294967295|c.readBits(8);if(192==(224&l))return(31&l)<<16&4294967295|c.readBits(16);throw new Qn},y.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",y.GB2312_SUBSET=1,y}(),f1=function(){function y(c){this.mirrored=c}return y.prototype.isMirrored=function(){return this.mirrored},y.prototype.applyMirroredCorrection=function(c){if(this.mirrored&&null!==c&&!(c.length<3)){var l=c[0];c[0]=c[2],c[2]=l}},y}();var hx=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const mx=function(){function y(){this.rsDecoder=new xc(Pa.QR_CODE_FIELD_256)}return y.prototype.decodeBooleanArray=function(c,l){return this.decodeBitMatrix(Qi.parseFromBooleanArray(c),l)},y.prototype.decodeBitMatrix=function(c,l){var w=new Ch(c),U=null;try{return this.decodeBitMatrixParser(w,l)}catch(ce){U=ce}try{w.remask(),w.setMirror(!0),w.readVersion(),w.readFormatInformation(),w.mirror();var J=this.decodeBitMatrixParser(w,l);return J.setOther(new f1(!0)),J}catch(ce){throw null!==U?U:ce}},y.prototype.decodeBitMatrixParser=function(c,l){var w,U,J,ce,ge=c.readVersion(),Pe=c.readFormatInformation().getErrorCorrectionLevel(),Ge=c.readCodewords(),ut=Jw.getDataBlocks(Ge,ge,Pe),_t=0;try{for(var Ot=hx(ut),Ht=Ot.next();!Ht.done;Ht=Ot.next())_t+=(Sr=Ht.value).getNumDataCodewords()}catch(ki){w={error:ki}}finally{try{Ht&&!Ht.done&&(U=Ot.return)&&U.call(Ot)}finally{if(w)throw w.error}}var jr=new Uint8Array(_t),sn=0;try{for(var dn=hx(ut),ln=dn.next();!ln.done;ln=dn.next()){var Sr,On=(Sr=ln.value).getCodewords(),Wn=Sr.getNumDataCodewords();this.correctErrors(On,Wn);for(var vi=0;vi=w)return!1;return!0},y.prototype.crossCheckVertical=function(c,l,w,U){var J=this.image,ce=J.getHeight(),ge=this.crossCheckStateCount;ge[0]=0,ge[1]=0,ge[2]=0;for(var Pe=c;Pe>=0&&J.get(l,Pe)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&!J.get(l,Pe)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=c+1;Pew)return NaN;for(;Pew||5*Math.abs(ge[0]+ge[1]+ge[2]-U)>=2*U?NaN:this.foundPatternCross(ge)?y.centerFromEnd(ge,Pe):NaN},y.prototype.handlePossibleCenter=function(c,l,w){var U,J,ce=c[0]+c[1]+c[2],ge=y.centerFromEnd(c,w),Pe=this.crossCheckVertical(l,ge,2*c[1],ce);if(!isNaN(Pe)){var Ge=(c[0]+c[1]+c[2])/3;try{for(var ut=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.possibleCenters),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value;if(Ot.aboutEquals(Ge,Pe,ge))return Ot.combineEstimate(Pe,ge,Ge)}}catch(Sr){U={error:Sr}}finally{try{_t&&!_t.done&&(J=ut.return)&&J.call(ut)}finally{if(U)throw U.error}}var Ht=new Vu(ge,Pe,Ge);this.possibleCenters.push(Ht),null!=this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(Ht)}return null},y}();var vd=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const _0=function(y){function c(l,w,U,J){var ce=y.call(this,l,w)||this;return ce.estimatedModuleSize=U,ce.count=J,void 0===J&&(ce.count=1),ce}return vd(c,y),c.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},c.prototype.getCount=function(){return this.count},c.prototype.aboutEquals=function(l,w,U){if(Math.abs(w-this.getY())<=l&&Math.abs(U-this.getX())<=l){var J=Math.abs(l-this.estimatedModuleSize);return J<=1||J<=this.estimatedModuleSize}return!1},c.prototype.combineEstimate=function(l,w,U){var J=this.count+1;return new c((this.count*this.getX()+w)/J,(this.count*this.getY()+l)/J,(this.count*this.estimatedModuleSize+U)/J,J)},c}(_o),Yl=function(){function y(c){this.bottomLeft=c[0],this.topLeft=c[1],this.topRight=c[2]}return y.prototype.getBottomLeft=function(){return this.bottomLeft},y.prototype.getTopLeft=function(){return this.topLeft},y.prototype.getTopRight=function(){return this.topRight},y}();var ry=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const h1=function(){function y(c,l){this.image=c,this.resultPointCallback=l,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=l}return y.prototype.getImage=function(){return this.image},y.prototype.getPossibleCenters=function(){return this.possibleCenters},y.prototype.find=function(c){var l=null!=c&&void 0!==c.get(Ci.TRY_HARDER),w=null!=c&&void 0!==c.get(Ci.PURE_BARCODE),U=this.image,J=U.getHeight(),ce=U.getWidth(),ge=Math.floor(3*J/(4*y.MAX_MODULES));(geGe[2]&&(ut+=Sr-Ge[2]-ge,Ot=ce-1)}_t=0,Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0,Ge[4]=0}else Ge[0]=Ge[2],Ge[1]=Ge[3],Ge[2]=Ge[4],Ge[3]=1,Ge[4]=0,_t=3;else Ge[++_t]++;y.foundPatternCross(Ge)&&!0===this.handlePossibleCenter(Ge,ut,ce,w)&&(ge=Ge[0],this.hasSkipped&&(Pe=this.haveMultiplyConfirmedCenters()))}var jr=this.selectBestPatterns();return _o.orderBestPatterns(jr),new Yl(jr)},y.centerFromEnd=function(c,l){return l-c[4]-c[3]-c[2]/2},y.foundPatternCross=function(c){for(var l=0,w=0;w<5;w++){var U=c[w];if(0===U)return!1;l+=U}if(l<7)return!1;var J=l/7,ce=J/2;return Math.abs(J-c[0])=ce&&l>=ce&&ge.get(l-ce,c-ce);)J[2]++,ce++;if(c=ce&&l>=ce&&!ge.get(l-ce,c-ce)&&J[1]<=w;)J[1]++,ce++;if(cw)return!1;for(;c>=ce&&l>=ce&&ge.get(l-ce,c-ce)&&J[0]<=w;)J[0]++,ce++;if(J[0]>w)return!1;var Pe=ge.getHeight(),Ge=ge.getWidth();for(ce=1;c+ce=Pe||l+ce>=Ge)return!1;for(;c+ce=Pe||l+ce>=Ge||J[3]>=w)return!1;for(;c+ce=w)&&Math.abs(J[0]+J[1]+J[2]+J[3]+J[4]-U)<2*U&&y.foundPatternCross(J)},y.prototype.crossCheckVertical=function(c,l,w,U){for(var J=this.image,ce=J.getHeight(),ge=this.getCrossCheckStateCount(),Pe=c;Pe>=0&&J.get(l,Pe);)ge[2]++,Pe--;if(Pe<0)return NaN;for(;Pe>=0&&!J.get(l,Pe)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&J.get(l,Pe)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=c+1;Pe=w)return NaN;for(;Pe=w||5*Math.abs(ge[0]+ge[1]+ge[2]+ge[3]+ge[4]-U)>=2*U?NaN:y.foundPatternCross(ge)?y.centerFromEnd(ge,Pe):NaN},y.prototype.crossCheckHorizontal=function(c,l,w,U){for(var J=this.image,ce=J.getWidth(),ge=this.getCrossCheckStateCount(),Pe=c;Pe>=0&&J.get(Pe,l);)ge[2]++,Pe--;if(Pe<0)return NaN;for(;Pe>=0&&!J.get(Pe,l)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&J.get(Pe,l)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=c+1;Pe=w)return NaN;for(;Pe=w||5*Math.abs(ge[0]+ge[1]+ge[2]+ge[3]+ge[4]-U)>=U?NaN:y.foundPatternCross(ge)?y.centerFromEnd(ge,Pe):NaN},y.prototype.handlePossibleCenter=function(c,l,w,U){var J=c[0]+c[1]+c[2]+c[3]+c[4],ce=y.centerFromEnd(c,w),ge=this.crossCheckVertical(l,Math.floor(ce),c[2],J);if(!isNaN(ge)&&(ce=this.crossCheckHorizontal(Math.floor(ce),Math.floor(ge),c[2],J),!isNaN(ce)&&(!U||this.crossCheckDiagonal(Math.floor(ge),Math.floor(ce),c[2],J)))){for(var Pe=J/7,Ge=!1,ut=this.possibleCenters,_t=0,Ot=ut.length;_t=y.CENTER_QUORUM){if(null!=U)return this.hasSkipped=!0,Math.floor((Math.abs(U.getX()-ge.getX())-Math.abs(U.getY()-ge.getY()))/2);U=ge}}}catch(Pe){c={error:Pe}}finally{try{ce&&!ce.done&&(l=J.return)&&l.call(J)}finally{if(c)throw c.error}}return 0},y.prototype.haveMultiplyConfirmedCenters=function(){var c,l,w,U,J=0,ce=0,ge=this.possibleCenters.length;try{for(var Pe=ry(this.possibleCenters),Ge=Pe.next();!Ge.done;Ge=Pe.next())(ut=Ge.value).getCount()>=y.CENTER_QUORUM&&(J++,ce+=ut.getEstimatedModuleSize())}catch(jr){c={error:jr}}finally{try{Ge&&!Ge.done&&(l=Pe.return)&&l.call(Pe)}finally{if(c)throw c.error}}if(J<3)return!1;var _t=ce/ge,Ot=0;try{for(var Ht=ry(this.possibleCenters),Sr=Ht.next();!Sr.done;Sr=Ht.next()){var ut=Sr.value;Ot+=Math.abs(ut.getEstimatedModuleSize()-_t)}}catch(jr){w={error:jr}}finally{try{Sr&&!Sr.done&&(U=Ht.return)&&U.call(Ht)}finally{if(w)throw w.error}}return Ot<=.05*ce},y.prototype.selectBestPatterns=function(){var c,l,w,U,J=this.possibleCenters.length;if(J<3)throw new Gn;var ge,ce=this.possibleCenters;if(J>3){var Pe=0,Ge=0;try{for(var ut=ry(this.possibleCenters),_t=ut.next();!_t.done;_t=ut.next()){var Ht=_t.value.getEstimatedModuleSize();Pe+=Ht,Ge+=Ht*Ht}}catch(vi){c={error:vi}}finally{try{_t&&!_t.done&&(l=ut.return)&&l.call(ut)}finally{if(c)throw c.error}}ge=Pe/J;var Sr=Math.sqrt(Ge/J-ge*ge);ce.sort(function(vi,ki){var Xi=Math.abs(ki.getEstimatedModuleSize()-ge),So=Math.abs(vi.getEstimatedModuleSize()-ge);return XiSo?1:0});for(var jr=Math.max(.2*ge,Sr),sn=0;sn3;sn++)Math.abs(ce[sn].getEstimatedModuleSize()-ge)>jr&&(ce.splice(sn,1),sn--)}if(ce.length>3){Pe=0;try{for(var ln=ry(ce),On=ln.next();!On.done;On=ln.next())Pe+=On.value.getEstimatedModuleSize()}catch(ki){w={error:ki}}finally{try{On&&!On.done&&(U=ln.return)&&U.call(ln)}finally{if(w)throw w.error}}ge=Pe/ce.length,ce.sort(function(ki,Xi){if(Xi.getCount()===ki.getCount()){var So=Math.abs(Xi.getEstimatedModuleSize()-ge),Ns=Math.abs(ki.getEstimatedModuleSize()-ge);return SoNs?-1:0}return Xi.getCount()-ki.getCount()}),ce.splice(3)}return[ce[0],ce[1],ce[2]]},y.CENTER_QUORUM=2,y.MIN_SKIP=3,y.MAX_MODULES=57,y}(),Am=function(){function y(c){this.image=c}return y.prototype.getImage=function(){return this.image},y.prototype.getResultPointCallback=function(){return this.resultPointCallback},y.prototype.detect=function(c){this.resultPointCallback=null==c?null:c.get(Ci.NEED_RESULT_POINT_CALLBACK);var w=new h1(this.image,this.resultPointCallback).find(c);return this.processFinderPatternInfo(w)},y.prototype.processFinderPatternInfo=function(c){var l=c.getTopLeft(),w=c.getTopRight(),U=c.getBottomLeft(),J=this.calculateModuleSize(l,w,U);if(J<1)throw new Gn("No pattern found in proccess finder.");var ce=y.computeDimension(l,w,U,J),ge=Zh.getProvisionalVersionForDimension(ce),Pe=ge.getDimensionForVersion()-7,Ge=null;if(ge.getAlignmentPatternCenters().length>0)for(var ut=w.getX()-l.getX()+U.getX(),_t=w.getY()-l.getY()+U.getY(),Ot=1-3/Pe,Ht=Math.floor(l.getX()+Ot*(ut-l.getX())),Sr=Math.floor(l.getY()+Ot*(_t-l.getY())),jr=4;jr<=16;jr<<=1)try{Ge=this.findAlignmentInRegion(J,Ht,Sr,jr);break}catch(On){if(!(On instanceof Gn))throw On}var sn=y.createTransform(l,w,U,Ge,ce),dn=y.sampleGrid(this.image,sn,ce);return new cr(dn,null===Ge?[U,l,w]:[U,l,w,Ge])},y.createTransform=function(c,l,w,U,J){var ge,Pe,Ge,ut,ce=J-3.5;return null!==U?(ge=U.getX(),Pe=U.getY(),ut=Ge=ce-3):(ge=l.getX()-c.getX()+w.getX(),Pe=l.getY()-c.getY()+w.getY(),Ge=ce,ut=ce),Bs.quadrilateralToQuadrilateral(3.5,3.5,ce,3.5,Ge,ut,3.5,ce,c.getX(),c.getY(),l.getX(),l.getY(),ge,Pe,w.getX(),w.getY())},y.sampleGrid=function(c,l,w){return yo.getInstance().sampleGridWithTransform(c,w,w,l)},y.computeDimension=function(c,l,w,U){var J=Ys.round(_o.distance(c,l)/U),ce=Ys.round(_o.distance(c,w)/U),ge=Math.floor((J+ce)/2)+7;switch(3&ge){case 0:ge++;break;case 2:ge--;break;case 3:throw new Gn("Dimensions could be not found.")}return ge},y.prototype.calculateModuleSize=function(c,l,w){return(this.calculateModuleSizeOneWay(c,l)+this.calculateModuleSizeOneWay(c,w))/2},y.prototype.calculateModuleSizeOneWay=function(c,l){var w=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(c.getX()),Math.floor(c.getY()),Math.floor(l.getX()),Math.floor(l.getY())),U=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(l.getX()),Math.floor(l.getY()),Math.floor(c.getX()),Math.floor(c.getY()));return isNaN(w)?U/7:isNaN(U)?w/7:(w+U)/14},y.prototype.sizeOfBlackWhiteBlackRunBothWays=function(c,l,w,U){var J=this.sizeOfBlackWhiteBlackRun(c,l,w,U),ce=1,ge=c-(w-c);ge<0?(ce=c/(c-ge),ge=0):ge>=this.image.getWidth()&&(ce=(this.image.getWidth()-1-c)/(ge-c),ge=this.image.getWidth()-1);var Pe=Math.floor(l-(U-l)*ce);return ce=1,Pe<0?(ce=l/(l-Pe),Pe=0):Pe>=this.image.getHeight()&&(ce=(this.image.getHeight()-1-l)/(Pe-l),Pe=this.image.getHeight()-1),ge=Math.floor(c+(ge-c)*ce),(J+=this.sizeOfBlackWhiteBlackRun(c,l,ge,Pe))-1},y.prototype.sizeOfBlackWhiteBlackRun=function(c,l,w,U){var J=Math.abs(U-l)>Math.abs(w-c);if(J){var ce=c;c=l,l=ce,ce=w,w=U,U=ce}for(var ge=Math.abs(w-c),Pe=Math.abs(U-l),Ge=-ge/2,ut=c0){if(jr===U)break;jr+=_t,Ge-=ge}}return 2===Ot?Ys.distance(w+ut,U,c,l):NaN},y.prototype.findAlignmentInRegion=function(c,l,w,U){var J=Math.floor(U*c),ce=Math.max(0,l-J),ge=Math.min(this.image.getWidth()-1,l+J);if(ge-ce<3*c)throw new Gn("Alignment top exceeds estimated module size.");var Pe=Math.max(0,w-J),Ge=Math.min(this.image.getHeight()-1,w+J);if(Ge-Pe<3*c)throw new Gn("Alignment bottom exceeds estimated module size.");return new Bp(this.image,ce,Pe,ge-ce,Ge-Pe,c,this.resultPointCallback).find()},y}(),p1=function(){function y(){this.decoder=new mx}return y.prototype.getDecoder=function(){return this.decoder},y.prototype.decode=function(c,l){var w,U;if(null!=l&&void 0!==l.get(Ci.PURE_BARCODE)){var J=y.extractPureBits(c.getBlackMatrix());w=this.decoder.decodeBitMatrix(J,l),U=y.NO_POINTS}else{var ce=new Am(c.getBlackMatrix()).detect(l);w=this.decoder.decodeBitMatrix(ce.getBits(),l),U=ce.getPoints()}w.getOther()instanceof f1&&w.getOther().applyMirroredCorrection(U);var ge=new Cs(w.getText(),w.getRawBytes(),void 0,U,Co.QR_CODE,void 0),Pe=w.getByteSegments();null!==Pe&&ge.putMetadata(gc.BYTE_SEGMENTS,Pe);var Ge=w.getECLevel();return null!==Ge&&ge.putMetadata(gc.ERROR_CORRECTION_LEVEL,Ge),w.hasStructuredAppend()&&(ge.putMetadata(gc.STRUCTURED_APPEND_SEQUENCE,w.getStructuredAppendSequenceNumber()),ge.putMetadata(gc.STRUCTURED_APPEND_PARITY,w.getStructuredAppendParity())),ge},y.prototype.reset=function(){},y.extractPureBits=function(c){var l=c.getTopLeftOnBit(),w=c.getBottomRightOnBit();if(null===l||null===w)throw new Gn;var U=this.moduleSize(l,c),J=l[1],ce=w[1],ge=l[0],Pe=w[0];if(ge>=Pe||J>=ce)throw new Gn;if(ce-J!=Pe-ge&&(Pe=ge+(ce-J))>=c.getWidth())throw new Gn;var Ge=Math.round((Pe-ge+1)/U),ut=Math.round((ce-J+1)/U);if(Ge<=0||ut<=0)throw new Gn;if(ut!==Ge)throw new Gn;var _t=Math.floor(U/2);J+=_t;var Ot=(ge+=_t)+Math.floor((Ge-1)*U)-Pe;if(Ot>0){if(Ot>_t)throw new Gn;ge-=Ot}var Ht=J+Math.floor((ut-1)*U)-ce;if(Ht>0){if(Ht>_t)throw new Gn;J-=Ht}for(var Sr=new Qi(Ge,ut),jr=0;jr=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),ge=ce.next();!ge.done;ge=ce.next())U[J++]=ge.value}catch(Ge){l={error:Ge}}finally{try{ge&&!ge.done&&(w=ce.return)&&w.call(ce)}finally{if(l)throw l.error}}return U},y.getCodeword=function(c){var l=Vi.binarySearch(y.SYMBOL_TABLE,262143&c);return l<0?-1:(y.CODEWORD_TABLE[l]-1)%y.NUMBER_OF_CODEWORDS},y.MAX_CODEWORDS_IN_BARCODE=(y.NUMBER_OF_CODEWORDS=929)-1,y.MIN_ROWS_IN_BARCODE=3,y.MAX_ROWS_IN_BARCODE=90,y.MODULES_IN_CODEWORD=17,y.MODULES_IN_STOP_PATTERN=18,y.BARS_IN_MODULE=8,y.EMPTY_INT_ARRAY=new Int32Array([]),y.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),y.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),y}(),yx=function(){function y(c,l){this.bits=c,this.points=l}return y.prototype.getBits=function(){return this.bits},y.prototype.getPoints=function(){return this.points},y}();var t_=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const ya=function(){function y(){}return y.detectMultiple=function(c,l,w){var U=c.getBlackMatrix(),J=y.detect(w,U);return J.length||((U=U.clone()).rotate180(),J=y.detect(w,U)),new yx(U,J)},y.detect=function(c,l){for(var w,U,J=new Array,ce=0,ge=0,Pe=!1;ce0;){if(null==(_t=y.findGuardPattern(c,J,--U,w,!1,ce,Ge))){U++;break}ut=_t}ge[0]=new _o(ut[0],U),ge[1]=new _o(ut[1],U),Pe=!0;break}var Ot=U+1;if(Pe){for(var Ht=0,_t=Int32Array.from([Math.trunc(ge[0].getX()),Math.trunc(ge[1].getX())]);Oty.SKIPPED_ROW_COUNT_MAX)break;Ht++}}ge[2]=new _o(_t[0],Ot-=Ht+1),ge[3]=new _o(_t[1],Ot)}return Ot-U0&&Ge++Ot?_t-Ot:Ot-_t;if(Ht>w)return 1/0;Ge+=Ht}return Ge/J},y.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),y.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),y.MAX_AVG_VARIANCE=.42,y.MAX_INDIVIDUAL_VARIANCE=.8,y.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),y.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),y.MAX_PIXEL_DRIFT=3,y.MAX_PATTERN_DRIFT=5,y.SKIPPED_ROW_COUNT_MAX=25,y.ROW_STEP=5,y.BARCODE_MIN_HEIGHT=10,y}(),Fp=function(){function y(c,l){if(0===l.length)throw new Bi;this.field=c;var w=l.length;if(w>1&&0===l[0]){for(var U=1;U=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.coefficients),ce=J.next();!ce.done;ce=J.next())U=this.field.add(U,ce.value)}catch(_t){l={error:_t}}finally{try{ce&&!ce.done&&(w=J.return)&&w.call(J)}finally{if(l)throw l.error}}return U}for(var Pe=this.coefficients[0],Ge=this.coefficients.length,ut=1;utw.length){var U=l;l=w,w=U}var J=new Int32Array(w.length),ce=w.length-l.length;Rt.arraycopy(w,0,J,0,ce);for(var ge=ce;ge=0;l--){var w=this.getCoefficient(l);0!==w&&(w<0?(c.append(" - "),w=-w):c.length()>0&&c.append(" + "),(0===l||1!==w)&&c.append(w),0!==l&&(1===l?c.append("x"):(c.append("x^"),c.append(l))))}return c.toString()},y}(),ed=function(){function y(){}return y.prototype.add=function(c,l){return(c+l)%this.modulus},y.prototype.subtract=function(c,l){return(this.modulus+c-l)%this.modulus},y.prototype.exp=function(c){return this.expTable[c]},y.prototype.log=function(c){if(0===c)throw new Bi;return this.logTable[c]},y.prototype.inverse=function(c){if(0===c)throw new Rd;return this.expTable[this.modulus-this.logTable[c]-1]},y.prototype.multiply=function(c,l){return 0===c||0===l?0:this.expTable[(this.logTable[c]+this.logTable[l])%(this.modulus-1)]},y.prototype.getSize=function(){return this.modulus},y.prototype.equals=function(c){return c===this},y}();var i_=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Sa=function(y){function c(l,w){var U=y.call(this)||this;U.modulus=l,U.expTable=new Int32Array(l),U.logTable=new Int32Array(l);for(var J=1,ce=0;ce0;Ge--){var ut=ce.evaluateAt(this.field.exp(Ge));ge[l-Ge]=ut,0!==ut&&(Pe=!0)}if(!Pe)return 0;var _t=this.field.getOne();if(null!=w)try{for(var Ot=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(w),Ht=Ot.next();!Ht.done;Ht=Ot.next()){var jr=this.field.exp(c.length-1-Ht.value),sn=new Fp(this.field,new Int32Array([this.field.subtract(0,jr),1]));_t=_t.multiply(sn)}}catch(So){U={error:So}}finally{try{Ht&&!Ht.done&&(J=Ot.return)&&J.call(Ot)}finally{if(U)throw U.error}}var dn=new Fp(this.field,ge),ln=this.runEuclideanAlgorithm(this.field.buildMonomial(l,1),dn,l),On=ln[0],Wn=ln[1],vi=this.findErrorLocations(On),ki=this.findErrorMagnitudes(Wn,On,vi);for(Ge=0;Ge=Math.round(w/2);){var Ge=J,ut=ge;if(ge=Pe,(J=ce).isZero())throw rs.getChecksumInstance();ce=Ge;for(var _t=this.field.getZero(),Ot=J.getCoefficient(J.getDegree()),Ht=this.field.inverse(Ot);ce.getDegree()>=J.getDegree()&&!ce.isZero();){var Sr=ce.getDegree()-J.getDegree(),jr=this.field.multiply(ce.getCoefficient(ce.getDegree()),Ht);_t=_t.add(this.field.buildMonomial(Sr,jr)),ce=ce.subtract(J.multiplyByMonomial(Sr,jr))}Pe=_t.multiply(ge).subtract(ut).negative()}var sn=Pe.getCoefficient(0);if(0===sn)throw rs.getChecksumInstance();var dn=this.field.inverse(sn);return[Pe.multiply(dn),ce.multiply(dn)]},y.prototype.findErrorLocations=function(c){for(var l=c.getDegree(),w=new Int32Array(l),U=0,J=1;J0){var Pe=w?this.topLeft:this.topRight,Ge=Math.trunc(Pe.getY()-c);Ge<0&&(Ge=0);var ut=new _o(Pe.getX(),Ge);w?U=ut:ce=ut}if(l>0){var _t=w?this.bottomLeft:this.bottomRight,Ot=Math.trunc(_t.getY()+l);Ot>=this.image.getHeight()&&(Ot=this.image.getHeight()-1);var Ht=new _o(_t.getX(),Ot);w?J=Ht:ge=Ht}return new y(this.image,U,J,ce,ge)},y.prototype.getMinX=function(){return this.minX},y.prototype.getMaxX=function(){return this.maxX},y.prototype.getMinY=function(){return this.minY},y.prototype.getMaxY=function(){return this.maxY},y.prototype.getTopLeft=function(){return this.topLeft},y.prototype.getTopRight=function(){return this.topRight},y.prototype.getBottomLeft=function(){return this.bottomLeft},y.prototype.getBottomRight=function(){return this.bottomRight},y}(),vx=function(){function y(c,l,w,U){this.columnCount=c,this.errorCorrectionLevel=U,this.rowCountUpperPart=l,this.rowCountLowerPart=w,this.rowCount=l+w}return y.prototype.getColumnCount=function(){return this.columnCount},y.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},y.prototype.getRowCount=function(){return this.rowCount},y.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},y.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},y}(),b1=function(){function y(){this.buffer=""}return y.form=function(c,l){var w=-1;return c.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function U(ce,ge,Pe,Ge,ut,_t){if("%%"===ce)return"%";if(void 0!==l[++w]){ce=Ge?parseInt(Ge.substr(1)):void 0;var Ht,Ot=ut?parseInt(ut.substr(1)):void 0;switch(_t){case"s":Ht=l[w];break;case"c":Ht=l[w][0];break;case"f":Ht=parseFloat(l[w]).toFixed(ce);break;case"p":Ht=parseFloat(l[w]).toPrecision(ce);break;case"e":Ht=parseFloat(l[w]).toExponential(ce);break;case"x":Ht=parseInt(l[w]).toString(Ot||16);break;case"d":Ht=parseFloat(parseInt(l[w],Ot||10).toPrecision(ce)).toFixed(0)}Ht="object"==typeof Ht?JSON.stringify(Ht):(+Ht).toString(Ot);for(var Sr=parseInt(Pe),jr=Pe&&Pe[0]+""=="0"?"0":" ";Ht.length=0&&null!=(l=this.codewords[U])||(U=this.imageRowToCodewordIndex(c)+w)=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.codewords),ce=J.next();!ce.done;ce=J.next()){var ge=ce.value;null!=ge?w.format("%3d: %3d|%3d%n",U++,ge.getRowNumber(),ge.getValue()):w.format("%3d: | %n",U++)}}catch(Pe){c={error:Pe}}finally{try{ce&&!ce.done&&(l=J.return)&&l.call(J)}finally{if(c)throw c.error}}return w.toString()},y.MAX_NEARBY_DISTANCE=5,y}();var id=function(y,c){var l="function"==typeof Symbol&&y[Symbol.iterator];if(!l)return y;var U,ce,w=l.call(y),J=[];try{for(;(void 0===c||c-- >0)&&!(U=w.next()).done;)J.push(U.value)}catch(ge){ce={error:ge}}finally{try{U&&!U.done&&(l=w.return)&&l.call(w)}finally{if(ce)throw ce.error}}return J};const zu=function(){function y(){this.values=new Map}return y.prototype.setValue=function(c){c=Math.trunc(c);var l=this.values.get(c);null==l&&(l=0),l++,this.values.set(c,l)},y.prototype.getValue=function(){var c,l,w=-1,U=new Array,J=function(_t,Ot){var Ht_getKey=function(){return _t},Ht_getValue=function(){return Ot};Ht_getValue()>w?(w=Ht_getValue(),(U=[]).push(Ht_getKey())):Ht_getValue()===w&&U.push(Ht_getKey())};try{for(var ce=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.values.entries()),ge=ce.next();!ge.done;ge=ce.next()){var Pe=id(ge.value,2);J(Pe[0],Pe[1])}}catch(_t){c={error:_t}}finally{try{ge&&!ge.done&&(l=ce.return)&&l.call(ce)}finally{if(c)throw c.error}}return xa.toIntArray(U)},y.prototype.getConfidence=function(c){return this.values.get(c)},y}();var c_=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),l_=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const E0=function(y){function c(l,w){var U=y.call(this,l)||this;return U._isLeft=w,U}return c_(c,y),c.prototype.setRowNumbers=function(){var l,w;try{for(var U=l_(this.getCodewords()),J=U.next();!J.done;J=U.next()){var ce=J.value;ce?.setRowNumberAsRowIndicatorColumn()}}catch(ge){l={error:ge}}finally{try{J&&!J.done&&(w=U.return)&&w.call(U)}finally{if(l)throw l.error}}},c.prototype.adjustCompleteIndicatorColumnRowNumbers=function(l){var w=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(w,l);for(var U=this.getBoundingBox(),J=this._isLeft?U.getTopLeft():U.getTopRight(),ce=this._isLeft?U.getBottomLeft():U.getBottomRight(),ge=this.imageRowToCodewordIndex(Math.trunc(J.getY())),Pe=this.imageRowToCodewordIndex(Math.trunc(ce.getY())),Ge=-1,ut=1,_t=0,Ot=ge;Ot=l.getRowCount()||Sr>Ot)w[Ot]=null;else{for(var jr,sn=(jr=ut>2?(ut-2)*Sr:Sr)>=Ot,dn=1;dn<=jr&&!sn;dn++)sn=null!=w[Ot-dn];sn?w[Ot]=null:(Ge=Ht.getRowNumber(),_t=1)}}},c.prototype.getRowHeights=function(){var l,w,U=this.getBarcodeMetadata();if(null==U)return null;this.adjustIncompleteIndicatorColumnRowNumbers(U);var J=new Int32Array(U.getRowCount());try{for(var ce=l_(this.getCodewords()),ge=ce.next();!ge.done;ge=ce.next()){var Pe=ge.value;if(null!=Pe){var Ge=Pe.getRowNumber();if(Ge>=J.length)continue;J[Ge]++}}}catch(ut){l={error:ut}}finally{try{ge&&!ge.done&&(w=ce.return)&&w.call(ce)}finally{if(l)throw l.error}}return J},c.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(l){for(var w=this.getBoundingBox(),U=this._isLeft?w.getTopLeft():w.getTopRight(),J=this._isLeft?w.getBottomLeft():w.getBottomRight(),ce=this.imageRowToCodewordIndex(Math.trunc(U.getY())),ge=this.imageRowToCodewordIndex(Math.trunc(J.getY())),Pe=this.getCodewords(),Ge=-1,ut=1,_t=0,Ot=ce;Ot=l.getRowCount()?Pe[Ot]=null:(Ge=Ht.getRowNumber(),_t=1)}},c.prototype.getBarcodeMetadata=function(){var l,w,U=this.getCodewords(),J=new zu,ce=new zu,ge=new zu,Pe=new zu;try{for(var Ge=l_(U),ut=Ge.next();!ut.done;ut=Ge.next()){var _t=ut.value;if(null!=_t){_t.setRowNumberAsRowIndicatorColumn();var Ot=_t.getValue()%30,Ht=_t.getRowNumber();switch(this._isLeft||(Ht+=2),Ht%3){case 0:ce.setValue(3*Ot+1);break;case 1:Pe.setValue(Ot/3),ge.setValue(Ot%3);break;case 2:J.setValue(Ot+1)}}}}catch(jr){l={error:jr}}finally{try{ut&&!ut.done&&(w=Ge.return)&&w.call(Ge)}finally{if(l)throw l.error}}if(0===J.getValue().length||0===ce.getValue().length||0===ge.getValue().length||0===Pe.getValue().length||J.getValue()[0]<1||ce.getValue()[0]+ge.getValue()[0]xa.MAX_ROWS_IN_BARCODE)return null;var Sr=new vx(J.getValue()[0],ce.getValue()[0],ge.getValue()[0],Pe.getValue()[0]);return this.removeIncorrectCodewords(U,Sr),Sr},c.prototype.removeIncorrectCodewords=function(l,w){for(var U=0;Uw.getRowCount()){l[U]=null;continue}switch(this._isLeft||(ge+=2),ge%3){case 0:3*ce+1!==w.getRowCountUpperPart()&&(l[U]=null);break;case 1:(Math.trunc(ce/3)!==w.getErrorCorrectionLevel()||ce%3!==w.getRowCountLowerPart())&&(l[U]=null);break;case 2:ce+1!==w.getColumnCount()&&(l[U]=null)}}}},c.prototype.isLeft=function(){return this._isLeft},c.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+y.prototype.toString.call(this)},c}(bx),Jo=function(){function y(c,l){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=c,this.barcodeColumnCount=c.getColumnCount(),this.boundingBox=l,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return y.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var l,c=xa.MAX_CODEWORDS_IN_BARCODE;do{l=c,c=this.adjustRowNumbersAndGetCount()}while(c>0&&c0&&J0&&(Ge[0]=w[l-1],Ge[4]=ge[l-1],Ge[5]=Pe[l-1]),l>1&&(Ge[8]=w[l-2],Ge[10]=ge[l-2],Ge[11]=Pe[l-2]),l=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(Ge),_t=ut.next();!_t.done;_t=ut.next())if(y.adjustRowNumber(ce,_t.value))return}catch(Ht){U={error:Ht}}finally{try{_t&&!_t.done&&(J=ut.return)&&J.call(ut)}finally{if(U)throw U.error}}}},y.adjustRowNumber=function(c,l){return!(null==l||!l.hasValidRowNumber()||l.getBucket()!==c.getBucket()||(c.setRowNumber(l.getRowNumber()),0))},y.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},y.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},y.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},y.prototype.setBoundingBox=function(c){this.boundingBox=c},y.prototype.getBoundingBox=function(){return this.boundingBox},y.prototype.setDetectionResultColumn=function(c,l){this.detectionResultColumns[c]=l},y.prototype.getDetectionResultColumn=function(c){return this.detectionResultColumns[c]},y.prototype.toString=function(){var c=this.detectionResultColumns[0];null==c&&(c=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var l=new b1,w=0;w>=1;w=1&l,y.RATIOS_TABLE[c]||(y.RATIOS_TABLE[c]=new Array(xa.BARS_IN_MODULE)),y.RATIOS_TABLE[c][xa.BARS_IN_MODULE-U-1]=Math.fround(J/xa.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},y.getDecodedValue=function(c){var l=y.getDecodedCodewordValue(y.sampleBitCounts(c));return-1!==l?l:y.getClosestDecodedValue(c)},y.sampleBitCounts=function(c){for(var l=Ys.sum(c),w=new Int32Array(xa.BARS_IN_MODULE),U=0,J=0,ce=0;ce1)for(var U=0;U=J)break}Pec.length||w<0||l+w>c.length||l+w<0)throw new Qr;if(0!==w)for(var U=0;U0&&this.grow(l)},c.prototype.grow=function(l){var U=this.buf.length<<1;if(U-l<0&&(U=l),U<0){if(l<0)throw new Ax;U=pi.MAX_VALUE}this.buf=Vi.copyOfUint8Array(this.buf,U)},c.prototype.write=function(l){this.ensureCapacity(this.count+1),this.buf[this.count]=l,this.count+=1},c.prototype.writeBytesOffset=function(l,w,U){if(w<0||w>l.length||U<0||w+U-l.length>0)throw new Qr;this.ensureCapacity(this.count+U),Rt.arraycopy(l,w,this.buf,this.count,U),this.count+=U},c.prototype.writeTo=function(l){l.writeBytesOffset(this.buf,0,this.count)},c.prototype.reset=function(){this.count=0},c.prototype.toByteArray=function(){return Vi.copyOfUint8Array(this.buf,this.count)},c.prototype.size=function(){return this.count},c.prototype.toString=function(l){return l?"string"==typeof l?this.toString_string(l):this.toString_number(l):this.toString_void()},c.prototype.toString_void=function(){return new String(this.buf).toString()},c.prototype.toString_string=function(l){return new String(this.buf).toString()},c.prototype.toString_number=function(l){return new String(this.buf).toString()},c.prototype.close=function(){},c}(lD);var qs,Oc=function(y){return y[y.ALPHA=0]="ALPHA",y[y.LOWER=1]="LOWER",y[y.MIXED=2]="MIXED",y[y.PUNCT=3]="PUNCT",y[y.ALPHA_SHIFT=4]="ALPHA_SHIFT",y[y.PUNCT_SHIFT=5]="PUNCT_SHIFT",y}(Oc||{});function ep(){if(typeof window<"u")return window.BigInt||null;if(typeof globalThis<"u")return globalThis.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function rh(y){if(typeof qs>"u"&&(qs=ep()),null===qs)throw new Error("BigInt is not supported!");return qs(y)}const Cl=function(){function y(){}return y.decode=function(c,l){var w=new Ur(""),U=Yo.ISO8859_1;w.enableDecoding(U);for(var J=1,ce=c[J++],ge=new u_;Jc[0])throw Qn.getFormatInstance();for(var U=new Int32Array(y.NUMBER_OF_SEQUENCE_CODEWORDS),J=0;J0){for(var Ot=0;Ot<6;++Ot)ce.write(Number(rh(Pe)>>rh(8*(5-Ot))));Pe=0,ge=0}}U===l[0]&&_t0){for(Ot=0;Ot<6;++Ot)ce.write(Number(rh(Pe)>>rh(8*(5-Ot))));Pe=0,ge=0}}}return J.append(Wt.decode(ce.toByteArray(),w)),U},y.numericCompaction=function(c,l,w){for(var U=0,J=!1,ce=new Int32Array(y.MAX_NUMERIC_CODEWORDS);l0&&(w.append(y.decodeBase900toBase10(ce,U)),U=0)}return l},y.decodeBase900toBase10=function(c,l){for(var w=rh(0),U=0;U@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",y.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",y.EXP900=ep()?function x0(){var y=[];y[0]=rh(1);var c=rh(900);y[1]=c;for(var l=2;l<16;l++)y[l]=y[l-1]*c;return y}():[],y.NUMBER_OF_SEQUENCE_CODEWORDS=2,y}();var xf=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const tp=function(){function y(){}return y.decode=function(c,l,w,U,J,ce,ge){for(var _t,Pe=new a_(c,l,w,U,J),Ge=null,ut=null,Ot=!0;;Ot=!1){if(null!=l&&(Ge=y.getRowIndicatorColumn(c,Pe,l,!0,ce,ge)),null!=U&&(ut=y.getRowIndicatorColumn(c,Pe,U,!1,ce,ge)),null==(_t=y.merge(Ge,ut)))throw Gn.getNotFoundInstance();var Ht=_t.getBoundingBox();if(!Ot||null==Ht||!(Ht.getMinY()Pe.getMaxY()))break;Pe=Ht}_t.setBoundingBox(Pe);var Sr=_t.getBarcodeColumnCount()+1;_t.setDetectionResultColumn(0,Ge),_t.setDetectionResultColumn(Sr,ut);for(var jr=null!=Ge,sn=1;sn<=Sr;sn++){var dn=jr?sn:Sr-sn;if(void 0===_t.getDetectionResultColumn(dn)){var ln=void 0;ln=0===dn||dn===Sr?new E0(Pe,0===dn):new bx(Pe),_t.setDetectionResultColumn(dn,ln);for(var On=-1,Wn=On,vi=Pe.getMinY();vi<=Pe.getMaxY();vi++){if((On=y.getStartColumn(_t,dn,vi,jr))<0||On>Pe.getMaxX()){if(-1===Wn)continue;On=Wn}var ki=y.detectCodeword(c,Pe.getMinX(),Pe.getMaxX(),jr,On,vi,ce,ge);null!=ki&&(ln.setCodeword(vi,ki),Wn=On,ce=Math.min(ce,ki.getWidth()),ge=Math.max(ge,ki.getWidth()))}}}return y.createDecoderResult(_t)},y.merge=function(c,l){if(null==c&&null==l)return null;var w=y.getBarcodeMetadata(c,l);if(null==w)return null;var U=a_.merge(y.adjustBoundingBox(c),y.adjustBoundingBox(l));return new Jo(w,U)},y.adjustBoundingBox=function(c){var l,w;if(null==c)return null;var U=c.getRowHeights();if(null==U)return null;var J=y.getMax(U),ce=0;try{for(var ge=xf(U),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;if(ce+=J-Ge,Ge>0)break}}catch(Ht){l={error:Ht}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(l)throw l.error}}for(var ut=c.getCodewords(),_t=0;ce>0&&null==ut[_t];_t++)ce--;var Ot=0;for(_t=U.length-1;_t>=0&&(Ot+=J-U[_t],!(U[_t]>0));_t--);for(_t=ut.length-1;Ot>0&&null==ut[_t];_t--)Ot--;return c.getBoundingBox().addMissingRows(ce,Ot,c.isLeft())},y.getMax=function(c){var l,w,U=-1;try{for(var J=xf(c),ce=J.next();!ce.done;ce=J.next())U=Math.max(U,ce.value)}catch(Pe){l={error:Pe}}finally{try{ce&&!ce.done&&(w=J.return)&&w.call(J)}finally{if(l)throw l.error}}return U},y.getBarcodeMetadata=function(c,l){var w,U;return null==c||null==(w=c.getBarcodeMetadata())?null==l?null:l.getBarcodeMetadata():null==l||null==(U=l.getBarcodeMetadata())?w:w.getColumnCount()!==U.getColumnCount()&&w.getErrorCorrectionLevel()!==U.getErrorCorrectionLevel()&&w.getRowCount()!==U.getRowCount()?null:w},y.getRowIndicatorColumn=function(c,l,w,U,J,ce){for(var ge=new E0(l,U),Pe=0;Pe<2;Pe++)for(var Ge=0===Pe?1:-1,ut=Math.trunc(Math.trunc(w.getX())),_t=Math.trunc(Math.trunc(w.getY()));_t<=l.getMaxY()&&_t>=l.getMinY();_t+=Ge){var Ot=y.detectCodeword(c,0,c.getWidth(),U,ut,_t,J,ce);null!=Ot&&(ge.setCodeword(_t,Ot),ut=U?Ot.getStartX():Ot.getEndX())}return ge},y.adjustCodewordCount=function(c,l){var w=l[0][1],U=w.getValue(),J=c.getBarcodeColumnCount()*c.getBarcodeRowCount()-y.getNumberOfECCodeWords(c.getBarcodeECLevel());if(0===U.length){if(J<1||J>xa.MAX_CODEWORDS_IN_BARCODE)throw Gn.getNotFoundInstance();w.setValue(J)}else U[0]!==J&&w.setValue(J)},y.createDecoderResult=function(c){var l=y.createBarcodeMatrix(c);y.adjustCodewordCount(c,l);for(var w=new Array,U=new Int32Array(c.getBarcodeRowCount()*c.getBarcodeColumnCount()),J=[],ce=new Array,ge=0;ge0;){for(var Pe=0;Pe=0){if(sn>=ce.length)continue;ce[sn][Ge].setValue(jr.getValue())}}}}catch(dn){U={error:dn}}finally{try{Sr&&!Sr.done&&(J=Ht.return)&&J.call(Ht)}finally{if(U)throw U.error}}Ge++}}catch(dn){l={error:dn}}finally{try{_t&&!_t.done&&(w=ut.return)&&w.call(ut)}finally{if(l)throw l.error}}return ce},y.isValidBarcodeColumn=function(c,l){return l>=0&&l<=c.getBarcodeColumnCount()+1},y.getStartColumn=function(c,l,w,U){var J,ce,ge=U?1:-1,Pe=null;if(y.isValidBarcodeColumn(c,l-ge)&&(Pe=c.getDetectionResultColumn(l-ge).getCodeword(w)),null!=Pe)return U?Pe.getEndX():Pe.getStartX();if(null!=(Pe=c.getDetectionResultColumn(l).getCodewordNearby(w)))return U?Pe.getStartX():Pe.getEndX();if(y.isValidBarcodeColumn(c,l-ge)&&(Pe=c.getDetectionResultColumn(l-ge).getCodewordNearby(w)),null!=Pe)return U?Pe.getEndX():Pe.getStartX();for(var Ge=0;y.isValidBarcodeColumn(c,l-ge);){l-=ge;try{for(var ut=(J=void 0,xf(c.getDetectionResultColumn(l).getCodewords())),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value;if(null!=Ot)return(U?Ot.getEndX():Ot.getStartX())+ge*Ge*(Ot.getEndX()-Ot.getStartX())}}catch(Ht){J={error:Ht}}finally{try{_t&&!_t.done&&(ce=ut.return)&&ce.call(ut)}finally{if(J)throw J.error}}Ge++}return U?c.getBoundingBox().getMinX():c.getBoundingBox().getMaxX()},y.detectCodeword=function(c,l,w,U,J,ce,ge,Pe){J=y.adjustCodewordStartColumn(c,l,w,U,J,ce);var Ge=y.getModuleBitCount(c,l,w,U,J,ce);if(null==Ge)return null;var ut,_t=Ys.sum(Ge);if(U)ut=J+_t;else{for(var Ot=0;Ot=l)&&Ge=l:gey.CODEWORD_SKEW_SIZE)return J;ge+=Pe}Pe=-Pe,U=!U}return ge},y.checkCodewordSkew=function(c,l,w){return l-y.CODEWORD_SKEW_SIZE<=c&&c<=w+y.CODEWORD_SKEW_SIZE},y.decodeCodewords=function(c,l,w){if(0===c.length)throw Qn.getFormatInstance();var U=1<w/2+y.MAX_ERRORS||w<0||w>y.MAX_EC_CODEWORDS)throw rs.getChecksumInstance();return y.errorCorrection.decode(c,w,l)},y.verifyCodewordCount=function(c,l){if(c.length<4)throw Qn.getFormatInstance();var w=c[0];if(w>c.length)throw Qn.getFormatInstance();if(0===w){if(!(l>=1;return l},y.getCodewordBucketNumber=function(c){return c instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(c):this.getCodewordBucketNumber_number(c)},y.getCodewordBucketNumber_number=function(c){return y.getCodewordBucketNumber(y.getBitCountForCodeword(c))},y.getCodewordBucketNumber_Int32Array=function(c){return(c[0]-c[2]+c[4]-c[6]+9)%9},y.toString=function(c){for(var l=new b1,w=0;w=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(ge.getPoints()),Ge=Pe.next();!Ge.done;Ge=Pe.next()){var ut=Ge.value,_t=tp.decode(ge.getBits(),ut[4],ut[5],ut[6],ut[7],y.getMinCodewordWidth(ut),y.getMaxCodewordWidth(ut)),Ot=new Cs(_t.getText(),_t.getRawBytes(),void 0,ut,Co.PDF_417);Ot.putMetadata(gc.ERROR_CORRECTION_LEVEL,_t.getECLevel());var Ht=_t.getOther();null!=Ht&&Ot.putMetadata(gc.PDF417_EXTRA_METADATA,Ht),ce.push(Ot)}}catch(Sr){U={error:Sr}}finally{try{Ge&&!Ge.done&&(J=Pe.return)&&J.call(Pe)}finally{if(U)throw U.error}}return ce.map(function(Sr){return Sr})},y.getMaxWidth=function(c,l){return null==c||null==l?0:Math.trunc(Math.abs(c.getX()-l.getX()))},y.getMinWidth=function(c,l){return null==c||null==l?pi.MAX_VALUE:Math.trunc(Math.abs(c.getX()-l.getX()))},y.getMaxCodewordWidth=function(c){return Math.floor(Math.max(Math.max(y.getMaxWidth(c[0],c[4]),y.getMaxWidth(c[6],c[2])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN),Math.max(y.getMaxWidth(c[1],c[5]),y.getMaxWidth(c[7],c[3])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN)))},y.getMinCodewordWidth=function(c){return Math.floor(Math.min(Math.min(y.getMinWidth(c[0],c[4]),y.getMinWidth(c[6],c[2])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN),Math.min(y.getMinWidth(c[1],c[5]),y.getMinWidth(c[7],c[3])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN)))},y.prototype.reset=function(){},y}();var A1=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const rp=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return A1(c,y),c.kind="ReaderException",c}(Us);var $d=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const iy=function(){function y(){}return y.prototype.decode=function(c,l){return this.setHints(l),this.decodeInternal(c)},y.prototype.decodeWithState=function(c){return null==this.readers&&this.setHints(null),this.decodeInternal(c)},y.prototype.setHints=function(c){this.hints=c;var l=null!=c&&void 0!==c.get(Ci.TRY_HARDER),w=null==c?null:c.get(Ci.POSSIBLE_FORMATS),U=new Array;if(null!=w){var J=w.some(function(ce){return ce===Co.UPC_A||ce===Co.UPC_E||ce===Co.EAN_13||ce===Co.EAN_8||ce===Co.CODABAR||ce===Co.CODE_39||ce===Co.CODE_93||ce===Co.CODE_128||ce===Co.ITF||ce===Co.RSS_14||ce===Co.RSS_EXPANDED});J&&!l&&U.push(new Ac(c)),w.includes(Co.QR_CODE)&&U.push(new p1),w.includes(Co.DATA_MATRIX)&&U.push(new v0),w.includes(Co.AZTEC)&&U.push(new We),w.includes(Co.PDF_417)&&U.push(new A0),J&&l&&U.push(new Ac(c))}0===U.length&&(l||U.push(new Ac(c)),U.push(new p1),U.push(new v0),U.push(new We),U.push(new A0),l&&U.push(new Ac(c))),this.readers=U},y.prototype.reset=function(){var c,l;if(null!==this.readers)try{for(var w=$d(this.readers),U=w.next();!U.done;U=w.next())U.value.reset()}catch(ce){c={error:ce}}finally{try{U&&!U.done&&(l=w.return)&&l.call(w)}finally{if(c)throw c.error}}},y.prototype.decodeInternal=function(c){var l,w;if(null===this.readers)throw new rp("No readers where selected, nothing can be read.");try{for(var U=$d(this.readers),J=U.next();!J.done;J=U.next()){var ce=J.value;try{return ce.decode(c,this.hints)}catch(ge){if(ge instanceof rp)continue}}}catch(ge){l={error:ge}}finally{try{J&&!J.done&&(w=U.return)&&w.call(U)}finally{if(l)throw l.error}}throw new Gn("No MultiFormat Readers were able to detect the code.")},y}();var Ix=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),oy=(function(y){function c(l,w){void 0===l&&(l=null),void 0===w&&(w=500);var J=new iy;return J.setHints(l),y.call(this,J,w)||this}Ix(c,y),c.prototype.decodeBitmap=function(l){return this.reader.decodeWithState(l)}}(Qu),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),Im=(function(y){oy(function c(l){return void 0===l&&(l=500),y.call(this,new A0,l)||this},y)}(Qu),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),Tx=(function(y){Im(function c(l){return void 0===l&&(l=500),y.call(this,new p1,l)||this},y)}(Qu),function(y){return y[y.ERROR_CORRECTION=0]="ERROR_CORRECTION",y[y.CHARACTER_SET=1]="CHARACTER_SET",y[y.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",y[y.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",y[y.MIN_SIZE=4]="MIN_SIZE",y[y.MAX_SIZE=5]="MAX_SIZE",y[y.MARGIN=6]="MARGIN",y[y.PDF417_COMPACT=7]="PDF417_COMPACT",y[y.PDF417_COMPACTION=8]="PDF417_COMPACTION",y[y.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",y[y.AZTEC_LAYERS=10]="AZTEC_LAYERS",y[y.QR_VERSION=11]="QR_VERSION",y[y.GS1_FORMAT=12]="GS1_FORMAT",y[y.FORCE_C40=13]="FORCE_C40",y}(Tx||{}));const ss=Tx,D1=function(){function y(c){this.field=c,this.cachedGenerators=[],this.cachedGenerators.push(new mu(c,Int32Array.from([1])))}return y.prototype.buildGenerator=function(c){var l=this.cachedGenerators;if(c>=l.length)for(var w=l[l.length-1],U=this.field,J=l.length;J<=c;J++){var ce=w.multiply(new mu(U,Int32Array.from([1,U.exp(J-1+U.getGeneratorBase())])));l.push(ce),w=ce}return l[c]},y.prototype.encode=function(c,l){if(0===l)throw new Bi("No error correction bytes");var w=c.length-l;if(w<=0)throw new Bi("No data bytes provided");var U=this.buildGenerator(l),J=new Int32Array(w);Rt.arraycopy(c,0,J,0,w);for(var ce=new mu(this.field,J),Pe=(ce=ce.multiplyByMonomial(l,1)).divide(U)[1].getCoefficients(),Ge=l-Pe.length,ut=0;ut=5&&(w+=y.N1+(Pe-5)),Pe=1,Ge=_t)}Pe>=5&&(w+=y.N1+(Pe-5))}return w},y.N1=3,y.N2=3,y.N3=40,y.N4=10,y}(),Np=function(){function y(c,l){this.width=c,this.height=l;for(var w=new Array(l),U=0;U!==l;U++)w[U]=new Uint8Array(c);this.bytes=w}return y.prototype.getHeight=function(){return this.height},y.prototype.getWidth=function(){return this.width},y.prototype.get=function(c,l){return this.bytes[l][c]},y.prototype.getArray=function(){return this.bytes},y.prototype.setNumber=function(c,l,w){this.bytes[l][c]=w},y.prototype.setBoolean=function(c,l,w){this.bytes[l][c]=w?1:0},y.prototype.clear=function(c){var l,w;try{for(var U=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.bytes),J=U.next();!J.done;J=U.next())Vi.fill(J.value,c)}catch(ge){l={error:ge}}finally{try{J&&!J.done&&(w=U.return)&&w.call(U)}finally{if(l)throw l.error}}},y.prototype.equals=function(c){if(!(c instanceof y))return!1;var l=c;if(this.width!==l.width||this.height!==l.height)return!1;for(var w=0,U=this.height;w>\n"),c.toString()},y.prototype.setMode=function(c){this.mode=c},y.prototype.setECLevel=function(c){this.ecLevel=c},y.prototype.setVersion=function(c){this.version=c},y.prototype.setMaskPattern=function(c){this.maskPattern=c},y.prototype.setMatrix=function(c){this.matrix=c},y.isValidMaskPattern=function(c){return c>=0&&c0;){for(6===ce&&(ce-=1);ge>=0&&ge=w;)c^=l<=0)for(var Pe=0;Pe!==ce;Pe++){var Ge=U[Pe];Ge>=0&&y.isEmpty(l.get(Ge,ge))&&y.embedPositionAdjustmentPattern(Ge-2,ge-2,l)}}},y.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])]),y.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])]),y.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])]),y.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])]),y.VERSION_INFO_POLY=7973,y.TYPE_INFO_POLY=1335,y.TYPE_INFO_MASK_PATTERN=21522,y}(),g_=function(){function y(c,l){this.dataBytes=c,this.errorCorrectionBytes=l}return y.prototype.getDataBytes=function(){return this.dataBytes},y.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},y}();var D0=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const I0=function(){function y(){}return y.calculateMaskPenalty=function(c){return np.applyMaskPenaltyRule1(c)+np.applyMaskPenaltyRule2(c)+np.applyMaskPenaltyRule3(c)+np.applyMaskPenaltyRule4(c)},y.encode=function(c,l,w){void 0===w&&(w=null);var U=y.DEFAULT_BYTE_MODE_ENCODING,J=null!==w&&void 0!==w.get(ss.CHARACTER_SET);J&&(U=w.get(ss.CHARACTER_SET).toString());var ce=this.chooseMode(c,U),ge=new bi;if(ce===Pc.BYTE&&(J||y.DEFAULT_BYTE_MODE_ENCODING!==U)){var Pe=Yo.getCharacterSetECIByName(U);void 0!==Pe&&this.appendECI(Pe,ge)}this.appendModeInfo(ce,ge);var ut,Ge=new bi;if(this.appendBytes(c,ce,Ge,U),null!==w&&void 0!==w.get(ss.QR_VERSION)){var _t=Number.parseInt(w.get(ss.QR_VERSION).toString(),10);ut=Zh.getVersionForNumber(_t);var Ot=this.calculateBitsNeeded(ce,ge,Ge,ut);if(!this.willFit(Ot,ut,l))throw new Gc("Data too big for requested version")}else ut=this.recommendVersion(l,ce,ge,Ge);var Ht=new bi;Ht.appendBitArray(ge);var Sr=ce===Pc.BYTE?Ge.getSizeInBytes():c.length;this.appendLengthInfo(Sr,ut,ce,Ht),Ht.appendBitArray(Ge);var jr=ut.getECBlocksForLevel(l),sn=ut.getTotalCodewords()-jr.getTotalECCodewords();this.terminateBits(sn,Ht);var dn=this.interleaveWithECBytes(Ht,ut.getTotalCodewords(),sn,jr.getNumBlocks()),ln=new sy;ln.setECLevel(l),ln.setMode(ce),ln.setVersion(ut);var On=ut.getDimensionForVersion(),Wn=new Np(On,On),vi=this.chooseMaskPattern(dn,l,ut,Wn);return ln.setMaskPattern(vi),ip.buildMatrix(dn,l,ut,vi,Wn),ln.setMatrix(Wn),ln},y.recommendVersion=function(c,l,w,U){var J=this.calculateBitsNeeded(l,w,U,Zh.getVersionForNumber(1)),ce=this.chooseVersion(J,c),ge=this.calculateBitsNeeded(l,w,U,ce);return this.chooseVersion(ge,c)},y.calculateBitsNeeded=function(c,l,w,U){return l.getSize()+c.getCharacterCountBits(U)+w.getSize()},y.getAlphanumericCode=function(c){return c159)&&(J<224||J>235))return!1}return!0},y.chooseMaskPattern=function(c,l,w,U){for(var J=Number.MAX_SAFE_INTEGER,ce=-1,ge=0;ge=(c+7)/8},y.terminateBits=function(c,l){var w=8*c;if(l.getSize()>w)throw new Gc("data bits cannot fit in the QR Code"+l.getSize()+" > "+w);for(var U=0;U<4&&l.getSize()0)for(U=J;U<8;U++)l.appendBit(!1);var ce=c-l.getSizeInBytes();for(U=0;U=w)throw new Gc("Block ID too large");var ge=c%w,Pe=w-ge,Ge=Math.floor(c/w),ut=Ge+1,_t=Math.floor(l/w),Ot=_t+1,Ht=Ge-_t,Sr=ut-Ot;if(Ht!==Sr)throw new Gc("EC bytes mismatch");if(w!==Pe+ge)throw new Gc("RS blocks mismatch");if(c!==(_t+Ht)*Pe+(Ot+Sr)*ge)throw new Gc("Total bytes mismatch");U=1<=0&&l<=9},y.appendNumericBytes=function(c,l){for(var w=c.length,U=0;U=33088&&Pe<=40956?Ge=Pe-33088:Pe>=57408&&Pe<=60351&&(Ge=Pe-49472),-1===Ge)throw new Gc("Invalid byte sequence");l.appendBits(192*(Ge>>8)+(255&Ge),13)}},y.appendECI=function(c,l){l.appendBits(Pc.ECI.getBits(),4),l.appendBits(c.getValue(),8)},y.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]),y.DEFAULT_BYTE_MODE_ENCODING=Yo.UTF8.getName(),y}();!function(){function y(){}y.prototype.write=function(c,l,w,U){if(void 0===U&&(U=null),0===c.length)throw new Bi("Found empty contents");if(l<0||w<0)throw new Bi("Requested dimensions are too small: "+l+"x"+w);var J=Sl.L,ce=y.QUIET_ZONE_SIZE;null!==U&&(void 0!==U.get(ss.ERROR_CORRECTION)&&(J=Sl.fromString(U.get(ss.ERROR_CORRECTION).toString())),void 0!==U.get(ss.MARGIN)&&(ce=Number.parseInt(U.get(ss.MARGIN).toString(),10)));var ge=I0.encode(c,J,U);return this.renderResult(ge,l,w,ce)},y.prototype.writeToDom=function(c,l,w,U,J){void 0===J&&(J=null),"string"==typeof c&&(c=document.querySelector(c));var ce=this.write(l,w,U,J);c&&c.appendChild(ce)},y.prototype.renderResult=function(c,l,w,U){var J=c.getMatrix();if(null===J)throw new ou;for(var ce=J.getWidth(),ge=J.getHeight(),Pe=ce+2*U,Ge=ge+2*U,ut=Math.max(l,Pe),_t=Math.max(w,Ge),Ot=Math.min(Math.floor(ut/Pe),Math.floor(_t/Ge)),Ht=Math.floor((ut-ce*Ot)/2),Sr=Math.floor((_t-ge*Ot)/2),jr=this.createSVGElement(ut,_t),sn=0,dn=Sr;snw||ce+Pe>U)throw new Bi("Crop rectangle does not fit within image data.");return Ge&&ut.reverseHorizontal(ge,Pe),ut}Nx(c,y),c.prototype.getRow=function(l,w){if(l<0||l>=this.getHeight())throw new Bi("Requested row is outside the image: "+l);var U=this.getWidth();return(null==w||w.length>16&255)+(Ht>>7&510)+(255&Ht))/4&255}Ge.luminances=_t}else Ge.luminances=l;if(void 0===J&&(Ge.dataWidth=w),void 0===ce&&(Ge.dataHeight=U),void 0===ge&&(Ge.left=0),void 0===Pe&&(Ge.top=0),Ge.left+w>Ge.dataWidth||Ge.top+U>Ge.dataHeight)throw new Bi("Crop rectangle does not fit within image data.");return Ge}v_(c,y),c.prototype.getRow=function(l,w){if(l<0||l>=this.getHeight())throw new Bi("Requested row is outside the image: "+l);var U=this.getWidth();return(null==w||w.length=0&&this.noBit(w,l)&&this.utah(l,w,c++),l-=2,w+=2}while(l>=0&&w=0&&w=0);l+=3,w++}while(l=256&&(l^=301);return{LOG:y,ALOG:c}}([],[])).LOG,w_=M1.ALOG,uf="[)>\x1e05\x1d",eo="[)>\x1e06\x1d";const ap=function(){function y(){}return y.encodeECC200=function(c,l){if(c.length!==l.getDataCapacity())throw new Error("The number of codewords does not match the selected symbol");var w=new Ur;w.append(c);var U=l.getInterleavedBlockCount();if(1===U){var J=this.createECCBlock(c,l.getErrorCodewords());w.append(J)}else{for(var ce=[],ge=[],Pe=0;Pe0;Pe--)ce[Pe]=0!==ge&&0!==J[Pe]?ce[Pe-1]^w_[(fy[ge]+fy[J[Pe]])%255]:ce[Pe-1];ce[0]=0!==ge&&0!==J[0]?w_[(fy[ge]+fy[J[0]])%255]:0}var Ge=[];for(U=0;U=2)c.writeCodeword(this.encodeASCIIDigits(c.getMessage().charCodeAt(c.pos),c.getMessage().charCodeAt(c.pos+1))),c.pos+=2;else{var w=c.getCurrentChar(),U=Aa.lookAheadTest(c.getMessage(),c.pos,this.getEncodingMode());if(U!==this.getEncodingMode())switch(U){case 5:return c.writeCodeword(231),void c.signalEncoderChange(5);case 1:return c.writeCodeword(230),void c.signalEncoderChange(1);case 3:c.writeCodeword(238),c.signalEncoderChange(3);break;case 2:c.writeCodeword(239),c.signalEncoderChange(2);break;case 4:c.writeCodeword(240),c.signalEncoderChange(4);break;default:throw new Error("Illegal mode: "+U)}else Aa.isExtendedASCII(w)?(c.writeCodeword(235),c.writeCodeword(w-128+1),c.pos++):(c.writeCodeword(w+1),c.pos++)}},y.prototype.encodeASCIIDigits=function(c,l){if(Aa.isDigit(c)&&Aa.isDigit(l))return 10*(c-48)+(l-48)+130;throw new Error("not digits: "+c+l)},y}(),k1=function(){function y(){}return y.prototype.getEncodingMode=function(){return 5},y.prototype.encode=function(c){var l=new Ur;for(l.append(0);c.hasMoreCharacters();){var w=c.getCurrentChar();if(l.append(w),c.pos++,Aa.lookAheadTest(c.getMessage(),c.pos,this.getEncodingMode())!==this.getEncodingMode()){c.signalEncoderChange(0);break}}var J=l.length()-1,ge=c.getCodewordCount()+J+1;c.updateSymbolInfo(ge);var Pe=c.getSymbolInfo().getDataCapacity()-ge>0;if(c.hasMoreCharacters()||Pe)if(J<=249)l.setCharAt(0,bt.getCharAt(J));else{if(!(J<=1555))throw new Error("Message length not in valid ranges: "+J);l.setCharAt(0,bt.getCharAt(Math.floor(J/250)+249)),l.insert(1,bt.getCharAt(J%250))}var Ge=0;for(w=l.length();Ge3||1!==Ge))&&(c.pos=U)}l.length()>0&&c.writeCodeword(230),this.handleEOD(c,l)},y.prototype.encode=function(c){for(var l=new Ur;c.hasMoreCharacters();){var w=c.getCurrentChar();c.pos++;var U=this.encodeChar(w,l),J=2*Math.floor(l.length()/3),ce=c.getCodewordCount()+J;c.updateSymbolInfo(ce);var ge=c.getSymbolInfo().getDataCapacity()-ce;if(!c.hasMoreCharacters()){var Pe=new Ur;for(l.length()%3==2&&2!==ge&&(U=this.backtrackOneCharacter(c,l,Pe,U));l.length()%3==1&&(U>3||1!==ge);)U=this.backtrackOneCharacter(c,l,Pe,U);break}if(l.length()%3==0&&Aa.lookAheadTest(c.getMessage(),c.pos,this.getEncodingMode())!==this.getEncodingMode()){c.signalEncoderChange(0);break}}this.handleEOD(c,l)},y.prototype.backtrackOneCharacter=function(c,l,w,U){var J=l.length(),ce=l.toString().substring(0,J-U);l.setLengthToZero(),l.append(ce),c.pos--;var ge=c.getCurrentChar();return U=this.encodeChar(ge,w),c.resetSymbolInfo(),U},y.prototype.writeNextTriplet=function(c,l){c.writeCodewords(this.encodeToCodewords(l.toString()));var w=l.toString().substring(3);l.setLengthToZero(),l.append(w)},y.prototype.handleEOD=function(c,l){var w=Math.floor(l.length()/3*2),U=l.length()%3,J=c.getCodewordCount()+w;c.updateSymbolInfo(J);var ce=c.getSymbolInfo().getDataCapacity()-J;if(2===U){for(l.append("\0");l.length()>=3;)this.writeNextTriplet(c,l);c.hasMoreCharacters()&&c.writeCodeword(254)}else if(1===ce&&1===U){for(;l.length()>=3;)this.writeNextTriplet(c,l);c.hasMoreCharacters()&&c.writeCodeword(254),c.pos--}else{if(0!==U)throw new Error("Unexpected case. Please report!");for(;l.length()>=3;)this.writeNextTriplet(c,l);(ce>0||c.hasMoreCharacters())&&c.writeCodeword(254)}c.signalEncoderChange(0)},y.prototype.encodeChar=function(c,l){return 32===c?(l.append(3),1):c>=48&&c<=57?(l.append(c-48+4),1):c>=65&&c<=90?(l.append(c-65+14),1):c<32?(l.append(0),l.append(c),2):c<=47?(l.append(1),l.append(c-33),2):c<=64?(l.append(1),l.append(c-58+15),2):c<=95?(l.append(1),l.append(c-91+22),2):c<=127?(l.append(2),l.append(c-96),2):(l.append("1\x1e"),2+this.encodeChar(c-128,l))},y.prototype.encodeToCodewords=function(c){var l=1600*c.charCodeAt(0)+40*c.charCodeAt(1)+c.charCodeAt(2)+1,w=l/256,U=l%256,J=new Ur;return J.append(w),J.append(U),J.toString()},y}(),E_=function(){function y(){}return y.prototype.getEncodingMode=function(){return 4},y.prototype.encode=function(c){for(var l=new Ur;c.hasMoreCharacters();){var w=c.getCurrentChar();if(this.encodeChar(w,l),c.pos++,l.length()>=4){c.writeCodewords(this.encodeToCodewords(l.toString()));var J=l.toString().substring(4);if(l.setLengthToZero(),l.append(J),Aa.lookAheadTest(c.getMessage(),c.pos,this.getEncodingMode())!==this.getEncodingMode()){c.signalEncoderChange(0);break}}}l.append(bt.getCharAt(31)),this.handleEOD(c,l)},y.prototype.handleEOD=function(c,l){try{var w=l.length();if(0===w)return;if(1===w){c.updateSymbolInfo();var U=c.getSymbolInfo().getDataCapacity()-c.getCodewordCount(),J=c.getRemainingCharacters();if(J>U&&(c.updateSymbolInfo(c.getCodewordCount()+1),U=c.getSymbolInfo().getDataCapacity()-c.getCodewordCount()),J<=U&&U<=2)return}if(w>4)throw new Error("Count must not exceed 4");var ce=w-1,ge=this.encodeToCodewords(l.toString()),Ge=!c.hasMoreCharacters()&&ce<=2;ce<=2&&(c.updateSymbolInfo(c.getCodewordCount()+ce),(U=c.getSymbolInfo().getDataCapacity()-c.getCodewordCount())>=3&&(Ge=!1,c.updateSymbolInfo(c.getCodewordCount()+ge.length))),Ge?(c.resetSymbolInfo(),c.pos-=ce):c.writeCodewords(ge)}finally{c.signalEncoderChange(0)}},y.prototype.encodeChar=function(c,l){c>=32&&c<=63?l.append(c):c>=64&&c<=94?l.append(bt.getCharAt(c-64)):Aa.illegalCharacter(bt.getCharAt(c))},y.prototype.encodeToCodewords=function(c){var l=c.length;if(0===l)throw new Error("StringBuilder must not be empty");var ge=(c.charAt(0).charCodeAt(0)<<18)+((l>=2?c.charAt(1).charCodeAt(0):0)<<12)+((l>=3?c.charAt(2).charCodeAt(0):0)<<6)+(l>=4?c.charAt(3).charCodeAt(0):0),Pe=ge>>16&255,Ge=ge>>8&255,ut=255&ge,_t=new Ur;return _t.append(Pe),l>=2&&_t.append(Ge),l>=3&&_t.append(ut),_t.toString()},y}(),$x=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),nc=function(){function y(c,l,w,U,J,ce,ge,Pe){void 0===ge&&(ge=0),void 0===Pe&&(Pe=0),this.rectangular=c,this.dataCapacity=l,this.errorCodewords=w,this.matrixWidth=U,this.matrixHeight=J,this.dataRegions=ce,this.rsBlockData=ge,this.rsBlockError=Pe}return y.lookup=function(c,l,w,U,J){var ce,ge;void 0===l&&(l=0),void 0===w&&(w=null),void 0===U&&(U=null),void 0===J&&(J=!0);try{for(var Pe=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(B1),Ge=Pe.next();!Ge.done;Ge=Pe.next()){var ut=Ge.value;if((1!==l||!ut.rectangular)&&(2!==l||ut.rectangular)&&(null==w||!(ut.getSymbolWidth()U.getWidth()||ut.getSymbolHeight()>U.getHeight()))&&c<=ut.dataCapacity)return ut}}catch(_t){ce={error:_t}}finally{try{Ge&&!Ge.done&&(ge=Pe.return)&&ge.call(Pe)}finally{if(ce)throw ce.error}}if(J)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+c);return null},y.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},y.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},y.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},y.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},y.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+2*this.getHorizontalDataRegions()},y.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+2*this.getVerticalDataRegions()},y.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},y.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},y.prototype.getDataCapacity=function(){return this.dataCapacity},y.prototype.getErrorCodewords=function(){return this.errorCodewords},y.prototype.getDataLengthForInterleavedBlock=function(c){return this.rsBlockData},y.prototype.getErrorLengthForInterleavedBlock=function(c){return this.rsBlockError},y}();const gy=nc;var P0=function(y){function c(){return y.call(this,!1,1558,620,22,22,36,-1,62)||this}return $x(c,y),c.prototype.getInterleavedBlockCount=function(){return 10},c.prototype.getDataLengthForInterleavedBlock=function(l){return l<=8?156:155},c}(nc),B1=[new nc(!1,3,5,8,8,1),new nc(!1,5,7,10,10,1),new nc(!0,5,7,16,6,1),new nc(!1,8,10,12,12,1),new nc(!0,10,11,14,6,2),new nc(!1,12,12,14,14,1),new nc(!0,16,14,24,10,1),new nc(!1,18,14,16,16,1),new nc(!1,22,18,18,18,1),new nc(!0,22,18,16,10,2),new nc(!1,30,20,20,20,1),new nc(!0,32,24,16,14,2),new nc(!1,36,24,22,22,1),new nc(!1,44,28,24,24,1),new nc(!0,49,28,22,14,2),new nc(!1,62,36,14,14,4),new nc(!1,86,42,16,16,4),new nc(!1,114,48,18,18,4),new nc(!1,144,56,20,20,4),new nc(!1,174,68,22,22,4),new nc(!1,204,84,24,24,4,102,42),new nc(!1,280,112,14,14,16,140,56),new nc(!1,368,144,16,16,16,92,36),new nc(!1,456,192,18,18,16,114,48),new nc(!1,576,224,20,20,16,144,56),new nc(!1,696,272,22,22,16,174,68),new nc(!1,816,336,24,24,16,136,56),new nc(!1,1050,408,18,18,36,175,68),new nc(!1,1304,496,20,20,36,163,62),new P0],gD=function(){function y(c){this.msg=c,this.pos=0,this.skipAtEnd=0;for(var l=c.split("").map(function(ge){return ge.charCodeAt(0)}),w=new Ur,U=0,J=l.length;Uthis.symbolInfo.getDataCapacity())&&(this.symbolInfo=gy.lookup(c,this.shape,this.minSize,this.maxSize,!0))},y.prototype.resetSymbolInfo=function(){this.symbolInfo=null},y}(),O0=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),R0=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return O0(c,y),c.prototype.getEncodingMode=function(){return 3},c.prototype.encode=function(l){for(var w=new Ur;l.hasMoreCharacters();){var U=l.getCurrentChar();if(l.pos++,this.encodeChar(U,w),w.length()%3==0&&(this.writeNextTriplet(l,w),Aa.lookAheadTest(l.getMessage(),l.pos,this.getEncodingMode())!==this.getEncodingMode())){l.signalEncoderChange(0);break}}this.handleEOD(l,w)},c.prototype.encodeChar=function(l,w){switch(l){case 13:w.append(0);break;case 42:w.append(1);break;case 62:w.append(2);break;case 32:w.append(3);break;default:l>=48&&l<=57?w.append(l-48+4):l>=65&&l<=90?w.append(l-65+14):Aa.illegalCharacter(bt.getCharAt(l))}return 1},c.prototype.handleEOD=function(l,w){l.updateSymbolInfo();var U=l.getSymbolInfo().getDataCapacity()-l.getCodewordCount(),J=w.length();l.pos-=J,(l.getRemainingCharacters()>1||U>1||l.getRemainingCharacters()!==U)&&l.writeCodeword(254),l.getNewEncoding()<0&&l.signalEncoderChange(0)},c}(my),yy=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),F1=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return yy(c,y),c.prototype.getEncodingMode=function(){return 2},c.prototype.encodeChar=function(l,w){return 32===l?(w.append(3),1):l>=48&&l<=57?(w.append(l-48+4),1):l>=97&&l<=122?(w.append(l-97+14),1):l<32?(w.append(0),w.append(l),2):l<=47?(w.append(1),w.append(l-33),2):l<=64?(w.append(1),w.append(l-58+15),2):l>=91&&l<=95?(w.append(1),w.append(l-91+22),2):96===l?(w.append(2),w.append(0),2):l<=90?(w.append(2),w.append(l-65+1),2):l<=127?(w.append(2),w.append(l-123+27),2):(w.append("1\x1e"),2+this.encodeChar(l-128,w))},c}(my);const Aa=function(){function y(){}return y.randomize253State=function(c){var w=149*c%253+1+129;return w<=254?w:w-254},y.encodeHighLevel=function(c,l,w,U,J){void 0===l&&(l=0),void 0===w&&(w=null),void 0===U&&(U=null),void 0===J&&(J=!1);var ce=new my,ge=[new py,ce,new F1,new R0,new E_,new k1],Pe=new gD(c);Pe.setSymbolShape(l),Pe.setSizeConstraints(w,U),c.startsWith(uf)&&c.endsWith("\x1e\x04")?(Pe.writeCodeword(236),Pe.setSkipAtEnd(2),Pe.pos+=7):c.startsWith(eo)&&c.endsWith("\x1e\x04")&&(Pe.writeCodeword(237),Pe.setSkipAtEnd(2),Pe.pos+=7);var Ge=0;for(J&&(ce.encodeMaximal(Pe),Ge=Pe.getNewEncoding(),Pe.resetEncoderSignal());Pe.hasMoreCharacters();)ge[Ge].encode(Pe),Pe.getNewEncoding()>=0&&(Ge=Pe.getNewEncoding(),Pe.resetEncoderSignal());var ut=Pe.getCodewordCount();Pe.updateSymbolInfo();var _t=Pe.getSymbolInfo().getDataCapacity();ut<_t&&0!==Ge&&5!==Ge&&4!==Ge&&Pe.writeCodeword("\xfe");var Ot=Pe.getCodewords();for(Ot.length()<_t&&Ot.append(129);Ot.length()<_t;)Ot.append(this.randomize253State(Ot.length()+1));return Pe.getCodewords().toString()},y.lookAheadTest=function(c,l,w){var U=this.lookAheadTestIntern(c,l,w);if(3===w&&3===U){for(var J=Math.min(l+3,c.length),ce=l;ce=c.length)return w;var U;0===w?U=[0,1,1,1,1,1.25]:(U=[1,2,2,2,2,2.25])[w]=0;for(var J=0,ce=new Uint8Array(6),ge=[];;){if(l+J===c.length){Vi.fill(ce,0),Vi.fill(ge,0);var Pe=this.findMinimums(U,ge,pi.MAX_VALUE,ce),Ge=this.getMinimumCount(ce);if(ge[0]===Pe)return 0;if(1===Ge){if(ce[5]>0)return 5;if(ce[4]>0)return 4;if(ce[2]>0)return 2;if(ce[3]>0)return 3}return 1}var ut=c.charCodeAt(l+J);if(J++,this.isDigit(ut)?U[0]+=.5:this.isExtendedASCII(ut)?(U[0]=Math.ceil(U[0]),U[0]+=2):(U[0]=Math.ceil(U[0]),U[0]++),this.isNativeC40(ut)?U[1]+=2/3:this.isExtendedASCII(ut)?U[1]+=8/3:U[1]+=4/3,this.isNativeText(ut)?U[2]+=2/3:this.isExtendedASCII(ut)?U[2]+=8/3:U[2]+=4/3,this.isNativeX12(ut)?U[3]+=2/3:this.isExtendedASCII(ut)?U[3]+=13/3:U[3]+=10/3,this.isNativeEDIFACT(ut)?U[4]+=3/4:this.isExtendedASCII(ut)?U[4]+=4.25:U[4]+=3.25,this.isSpecialB256(ut)?U[5]+=4:U[5]++,J>=4){if(Vi.fill(ce,0),Vi.fill(ge,0),this.findMinimums(U,ge,pi.MAX_VALUE,ce),ge[0]ce&&(w=ce,Vi.fill(U,0)),w===ce&&(U[J]=U[J]+1)}return w},y.getMinimumCount=function(c){for(var l=0,w=0;w<6;w++)l+=c[w];return l||0},y.isDigit=function(c){return c>=48&&c<=57},y.isExtendedASCII=function(c){return c>=128&&c<=255},y.isNativeC40=function(c){return 32===c||c>=48&&c<=57||c>=65&&c<=90},y.isNativeText=function(c){return 32===c||c>=48&&c<=57||c>=97&&c<=122},y.isNativeX12=function(c){return this.isX12TermSep(c)||32===c||c>=48&&c<=57||c>=65&&c<=90},y.isX12TermSep=function(c){return 13===c||42===c||62===c},y.isNativeEDIFACT=function(c){return c>=32&&c<=94},y.isSpecialB256=function(c){return!1},y.determineConsecutiveDigitCount=function(c,l){void 0===l&&(l=0);for(var w=c.length,U=l;U=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")},by=function(){function y(c){this.charset=c,this.name=c.name}return y.prototype.canEncode=function(c){try{return null!=Wt.encode(c,this.charset)}catch{return!1}},y}(),Vx=function(){function y(c,l,w){var U,J,ce,ge,Pe,Ge;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(Ns){return new by(cy.forName(Ns))}),this.encoders=[];var ut=[];ut.push(new by(ly.ISO_8859_1));for(var _t=null!=l&&l.name.startsWith("UTF"),Ot=0;Ot=this.bytes.length)return!1;for(var w=0;w=this.length())throw new Error(""+c);if(this.isECI(c))throw new Error("value at "+c+" is not a character but an ECI");return this.isFNC1(c)?this.fnc1:this.bytes[c]},y.prototype.subSequence=function(c,l){if(c<0||c>l||l>this.length())throw new Error(""+c);for(var w=new Ur,U=c;U=this.length())throw new Error(""+c);return this.bytes[c]>255&&this.bytes[c]<=999},y.prototype.isFNC1=function(c){if(c<0||c>=this.length())throw new Error(""+c);return 1e3===this.bytes[c]},y.prototype.getECIValue=function(c){if(c<0||c>=this.length())throw new Error(""+c);if(!this.isECI(c))throw new Error("value at "+c+" is not an ECI but a character");return this.bytes[c]-256},y.prototype.addEdge=function(c,l,w){(null==c[l][w.encoderIndex]||c[l][w.encoderIndex].cachedTotalSize>w.cachedTotalSize)&&(c[l][w.encoderIndex]=w)},y.prototype.addEdges=function(c,l,w,U,J,ce){var ge=c.charAt(U).charCodeAt(0),Pe=0,Ge=l.length();l.getPriorityEncoderIndex()>=0&&(ge===ce||l.canEncode(ge,l.getPriorityEncoderIndex()))&&(Ge=(Pe=l.getPriorityEncoderIndex())+1);for(var ut=Pe;ut=0;ce--)_t.unshift(255&Ht[ce])}(null===Ot.previous?0:Ot.previous.encoderIndex)!==Ot.encoderIndex&&_t.unshift(256+l.getECIValue(Ot.encoderIndex)),Ot=Ot.previous}var jr=[];for(ce=0;ce=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")},Kx=function(y,c){var l="function"==typeof Symbol&&y[Symbol.iterator];if(!l)return y;var U,ce,w=l.call(y),J=[];try{for(;(void 0===c||c-- >0)&&!(U=w.next()).done;)J.push(U.value)}catch(ge){ce={error:ge}}finally{try{U&&!U.done&&(l=w.return)&&l.call(w)}finally{if(ce)throw ce.error}}return J},ao=function(y){return y[y.ASCII=0]="ASCII",y[y.C40=1]="C40",y[y.TEXT=2]="TEXT",y[y.X12=3]="X12",y[y.EDF=4]="EDF",y[y.B256=5]="B256",y}(ao||{}),wy=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],_u=function(){function y(){}return y.isExtendedASCII=function(c,l){return c!==l&&c>=128&&c<=255},y.isInC40Shift1Set=function(c){return c<=31},y.isInC40Shift2Set=function(c,l){var w,U;try{for(var J=k0(wy),ce=J.next();!ce.done;ce=J.next())if(ce.value.charCodeAt(0)===c)return!0}catch(Pe){w={error:Pe}}finally{try{ce&&!ce.done&&(U=J.return)&&U.call(J)}finally{if(w)throw w.error}}return c===l},y.isInTextShift1Set=function(c){return this.isInC40Shift1Set(c)},y.isInTextShift2Set=function(c,l){return this.isInC40Shift2Set(c,l)},y.encodeHighLevel=function(c,l,w,U){void 0===l&&(l=null),void 0===w&&(w=-1),void 0===U&&(U=0);var J=0;return c.startsWith(uf)&&c.endsWith("\x1e\x04")?(J=5,c=c.substring(7,c.length-2)):c.startsWith(eo)&&c.endsWith("\x1e\x04")&&(J=6,c=c.substring(7,c.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,function(){for(var y=[],c=0;cl.cachedTotalSize)&&(c[w][l.getEndMode()]=l)},y.getNumberOfC40Words=function(c,l,w,U){for(var J=0,ce=l;ce=128&&(w&&Aa.isNativeC40(Pe-128)||!w&&Aa.isNativeText(Pe-128))?J+=3:J+=4}else J+=2;if(J%3==0||(J-2)%3==0&&ce+1===c.length())return U[0]=ce-l+1,Math.ceil(J/3)}return U[0]=0,0},y.addEdges=function(c,l,w,U){var J,ce;if(c.isECI(w))this.addEdge(l,new Vd(c,ao.ASCII,w,1,U));else{var Ht,ge=c.charAt(w);if(null===U||U.getEndMode()!==ao.EDF){Aa.isDigit(ge)&&c.haveNCharacters(w,2)&&Aa.isDigit(c.charAt(w+1))?this.addEdge(l,new Vd(c,ao.ASCII,w,2,U)):this.addEdge(l,new Vd(c,ao.ASCII,w,1,U));var Pe=[ao.C40,ao.TEXT];try{for(var Ge=k0(Pe),ut=Ge.next();!ut.done;ut=Ge.next()){var _t=ut.value,Ot=[];y.getNumberOfC40Words(c,w,_t===ao.C40,Ot)>0&&this.addEdge(l,new Vd(c,_t,w,Ot[0],U))}}catch(jr){J={error:jr}}finally{try{ut&&!ut.done&&(ce=Ge.return)&&ce.call(Ge)}finally{if(J)throw J.error}}c.haveNCharacters(w,3)&&Aa.isNativeX12(c.charAt(w))&&Aa.isNativeX12(c.charAt(w+1))&&Aa.isNativeX12(c.charAt(w+2))&&this.addEdge(l,new Vd(c,ao.X12,w,3,U)),this.addEdge(l,new Vd(c,ao.B256,w,1,U))}for(Ht=0;Ht<3;Ht++){var Sr=w+Ht;if(!c.haveNCharacters(Sr,1)||!Aa.isNativeEDIFACT(c.charAt(Sr)))break;this.addEdge(l,new Vd(c,ao.EDF,w,Ht+1,U))}3===Ht&&c.haveNCharacters(w,4)&&Aa.isNativeEDIFACT(c.charAt(w+3))&&this.addEdge(l,new Vd(c,ao.EDF,w,4,U))}},y.encodeMinimally=function(c){var l=c.length(),w=Array(l+1).fill(null).map(function(){return Array(6).fill(0)});this.addEdges(c,w,0,null);for(var U=1;U<=l;U++){for(var J=0;J<6;J++)null!==w[U][J]&&U=1&&J<=3?Pe.cachedTotalSize+1:Pe.cachedTotalSize;Ge0&&(w+=this.prepend(Vd.getBytes(232),U));for(var Pe=0;Pe=0;w--)l.unshift(c[w]);return c.length},y.prototype.randomize253State=function(c){var w=149*c%253+1+129;return w<=254?w:w-254},y.prototype.applyRandomPattern=function(c,l,w){for(var U=0;U0&&this.getCodewordsRemaining(this.cachedTotalSize+c)<=2-c)return ao.ASCII}if(this.mode===ao.C40||this.mode===ao.TEXT||this.mode===ao.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&0===this.getCodewordsRemaining(this.cachedTotalSize))return ao.ASCII;var c;if(1===(c=this.getLastASCII())&&0===this.getCodewordsRemaining(this.cachedTotalSize+1))return ao.ASCII}return this.mode},y.prototype.getMode=function(){return this.mode},y.prototype.getLastASCII=function(){var c=this.input.length(),l=this.fromPosition+this.characterLength;return c-l>4||l>=c?0:c-l==1?_u.isExtendedASCII(this.input.charAt(l),this.input.getFNC1Character())?0:1:c-l==2?_u.isExtendedASCII(this.input.charAt(l),this.input.getFNC1Character())||_u.isExtendedASCII(this.input.charAt(l+1),this.input.getFNC1Character())?0:Aa.isDigit(this.input.charAt(l))&&Aa.isDigit(this.input.charAt(l+1))?1:2:c-l==3?Aa.isDigit(this.input.charAt(l))&&Aa.isDigit(this.input.charAt(l+1))&&!_u.isExtendedASCII(this.input.charAt(l+2),this.input.getFNC1Character())||Aa.isDigit(this.input.charAt(l+1))&&Aa.isDigit(this.input.charAt(l+2))&&!_u.isExtendedASCII(this.input.charAt(l),this.input.getFNC1Character())?2:0:Aa.isDigit(this.input.charAt(l))&&Aa.isDigit(this.input.charAt(l+1))&&Aa.isDigit(this.input.charAt(l+2))&&Aa.isDigit(this.input.charAt(l+3))?2:0},y.prototype.getMinSymbolSize=function(c){var l,w,U,J,ce,ge;switch(this.input.getShapeHint()){case 1:try{for(var Pe=k0(this.squareCodewordCapacities),Ge=Pe.next();!Ge.done;Ge=Pe.next())if((ut=Ge.value)>=c)return ut}catch(jr){l={error:jr}}finally{try{Ge&&!Ge.done&&(w=Pe.return)&&w.call(Pe)}finally{if(l)throw l.error}}break;case 2:try{for(var _t=k0(this.rectangularCodewordCapacities),Ot=_t.next();!Ot.done;Ot=_t.next())if((ut=Ot.value)>=c)return ut}catch(jr){U={error:jr}}finally{try{Ot&&!Ot.done&&(J=_t.return)&&J.call(_t)}finally{if(U)throw U.error}}}try{for(var Ht=k0(this.allCodewordCapacities),Sr=Ht.next();!Sr.done;Sr=Ht.next()){var ut;if((ut=Sr.value)>=c)return ut}}catch(jr){ce={error:jr}}finally{try{Sr&&!Sr.done&&(ge=Ht.return)&&ge.call(Ht)}finally{if(ce)throw ce.error}}return this.allCodewordCapacities[this.allCodewordCapacities.length-1]},y.prototype.getCodewordsRemaining=function(c){return this.getMinSymbolSize(c)-c},y.getBytes=function(c,l){var w=new Uint8Array(l?2:1);return w[0]=c,l&&(w[1]=l),w},y.prototype.setC40Word=function(c,l,w,U,J){var ce=1600*(255&w)+40*(255&U)+(255&J)+1;c[l]=ce/256,c[l+1]=ce%256},y.prototype.getX12Value=function(c){return 13===c?0:42===c?1:62===c?2:32===c?3:c>=48&&c<=57?c-44:c>=65&&c<=90?c-51:c},y.prototype.getX12Words=function(){if(this.characterLength%3!=0)throw new Error("X12 words must be a multiple of 3");for(var c=new Uint8Array(this.characterLength/3*2),l=0;l=33&&w<=47?w-33:w>=48&&w<=57?w-44:w>=58&&w<=64?w-43:w>=65&&w<=90?w-64:w>=91&&w<=95?w-69:96===w?0:w>=97&&w<=122?w-83:w>=123&&w<=127?w-96:w},y.prototype.getC40Words=function(c,l){for(var w=[],U=0;U>16&255,l[J+1]=Pe>>8&255,l[J+2]=255&Pe}return l},y.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case ao.ASCII:case ao.B256:switch(this.mode){case ao.B256:return y.getBytes(231);case ao.C40:return y.getBytes(230);case ao.TEXT:return y.getBytes(239);case ao.X12:return y.getBytes(238);case ao.EDF:return y.getBytes(240)}break;case ao.C40:case ao.TEXT:case ao.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case ao.ASCII:return y.getBytes(254);case ao.B256:return y.getBytes(254,231);case ao.C40:return y.getBytes(254,230);case ao.TEXT:return y.getBytes(254,239);case ao.X12:return y.getBytes(254,238);case ao.EDF:return y.getBytes(254,240)}break;case ao.EDF:if(this.mode!==ao.EDF)throw new Error("Cannot switch from EDF to "+this.mode)}return new Uint8Array(0)},y.prototype.getDataBytes=function(){switch(this.mode){case ao.ASCII:return this.input.isECI(this.fromPosition)?y.getBytes(241,this.input.getECIValue(this.fromPosition)+1):_u.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?y.getBytes(235,this.input.charAt(this.fromPosition)-127):2===this.characterLength?y.getBytes(10*this.input.charAt(this.fromPosition)+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?y.getBytes(232):y.getBytes(this.input.charAt(this.fromPosition)+1);case ao.B256:return y.getBytes(this.input.charAt(this.fromPosition));case ao.C40:return this.getC40Words(!0,this.input.getFNC1Character());case ao.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case ao.X12:return this.getX12Words();case ao.EDF:return this.getEDFBytes()}},y}(),A_=function(y){function c(l,w,U,J,ce){var ge=y.call(this,l,w,U)||this;return ge.shape=J,ge.macroId=ce,ge}return zx(c,y),c.prototype.getMacroId=function(){return this.macroId},c.prototype.getShapeHint=function(){return this.shape},c}(S_);!function(){function y(){}y.prototype.encode=function(c,l,w,U,J){if(void 0===J&&(J=null),""===c.trim())throw new Error("Found empty contents");if(l!==Co.DATA_MATRIX)throw new Error("Can only encode DATA_MATRIX, but got "+l);if(w<0||U<0)throw new Error("Requested dimensions can't be negative: "+w+"x"+U);var Ot,ce=0,ge=null,Pe=null;if(null!=J){var Ge=J.get(ss.DATA_MATRIX_SHAPE);null!=Ge&&(ce=Ge);var ut=J.get(ss.MIN_SIZE);null!=ut&&(ge=ut);var _t=J.get(ss.MAX_SIZE);null!=_t&&(Pe=_t)}if(null!=J&&J.has(ss.DATA_MATRIX_COMPACT)&&J.get(ss.DATA_MATRIX_COMPACT).toString()){var Sr=J.has(ss.GS1_FORMAT)&&!!J.get(ss.GS1_FORMAT).toString(),jr=null;J.has(ss.CHARACTER_SET)&&(jr=cy.forName(J.get(ss.CHARACTER_SET).toString())),Ot=_u.encodeHighLevel(c,jr,Sr?29:-1,ce)}else{var dn=null!=J&&J.has(ss.FORCE_C40)&&!!J.get(ss.FORCE_C40).toString();Ot=Aa.encodeHighLevel(c,ce,ge,Pe,dn)}var ln=gy.lookup(Ot.length,ce,ge,Pe,!0),On=ap.encodeECC200(Ot,ln),Wn=new uy(On,ln.getSymbolDataWidth(),ln.getSymbolDataHeight());return Wn.place(),this.encodeLowLevel(Wn,ln,w,U)},y.prototype.encodeLowLevel=function(c,l,w,U){for(var J=l.getSymbolDataWidth(),ce=l.getSymbolDataHeight(),ge=new Np(l.getSymbolWidth(),l.getSymbolHeight()),Pe=0,Ge=0;Ge"},c}(yD);var wD=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const F0=function(y){function c(l,w,U){var J=y.call(this,l,0,0)||this;return J.binaryShiftStart=w,J.binaryShiftByteCount=U,J}return wD(c,y),c.prototype.appendTo=function(l,w){for(var U=0;U62?l.appendBits(this.binaryShiftByteCount-31,16):l.appendBits(0===U?Math.min(this.binaryShiftByteCount,31):this.binaryShiftByteCount-31,5)),l.appendBits(w[this.binaryShiftStart+U],8)},c.prototype.addBinaryShift=function(l,w){return new c(this,l,w)},c.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},c}(D_);function Bm(y,c,l){return new D_(y,c,l)}var Gx=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],I_=new D_(null,0,0),N0=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])],ih=function Ey(y){var c,l;try{for(var w=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),U=w.next();!U.done;U=w.next())Vi.fill(U.value,-1)}catch(ce){c={error:ce}}finally{try{U&&!U.done&&(l=w.return)&&l.call(w)}finally{if(c)throw c.error}}return y[0][4]=0,y[1][4]=0,y[1][0]=28,y[3][4]=0,y[2][4]=0,y[2][0]=15,y}(Vi.createInt32Array(6,6));const T_=function(){function y(c,l,w,U){this.token=c,this.mode=l,this.binaryShiftByteCount=w,this.bitCount=U}return y.prototype.getMode=function(){return this.mode},y.prototype.getToken=function(){return this.token},y.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},y.prototype.getBitCount=function(){return this.bitCount},y.prototype.latchAndAppend=function(c,l){var w=this.bitCount,U=this.token;if(c!==this.mode){var J=N0[this.mode][c];U=Bm(U,65535&J,J>>16),w+=J>>16}var ce=2===c?4:5;return new y(U=Bm(U,l,ce),c,0,w+ce)},y.prototype.shiftAndAppend=function(c,l){var w=this.token,U=2===this.mode?4:5;return w=Bm(w,ih[this.mode][c],U),new y(w=Bm(w,l,5),this.mode,0,this.bitCount+U+5)},y.prototype.addBinaryShiftChar=function(c){var l=this.token,w=this.mode,U=this.bitCount;if(4===this.mode||2===this.mode){var J=N0[w][0];l=Bm(l,65535&J,J>>16),U+=J>>16,w=0}var ge=new y(l,w,this.binaryShiftByteCount+1,U+(0===this.binaryShiftByteCount||31===this.binaryShiftByteCount?18:62===this.binaryShiftByteCount?9:8));return 2078===ge.binaryShiftByteCount&&(ge=ge.endBinaryShift(c+1)),ge},y.prototype.endBinaryShift=function(c){if(0===this.binaryShiftByteCount)return this;var l=this.token;return l=function Wx(y,c,l){return new F0(y,c,l)}(l,c-this.binaryShiftByteCount,this.binaryShiftByteCount),new y(l,this.mode,0,this.bitCount)},y.prototype.isBetterThanOrEqualTo=function(c){var l=this.bitCount+(N0[this.mode][c.mode]>>16);return this.binaryShiftByteCountc.binaryShiftByteCount&&c.binaryShiftByteCount>0&&(l+=10),l<=c.bitCount},y.prototype.toBitArray=function(c){for(var l,w,U=[],J=this.endBinaryShift(c.length).token;null!==J;J=J.getPrevious())U.unshift(J);var ce=new bi;try{for(var ge=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(U),Pe=ge.next();!Pe.done;Pe=ge.next())Pe.value.appendTo(ce,c)}catch(ut){l={error:ut}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(l)throw l.error}}return ce},y.prototype.toString=function(){return bt.format("%s bits=%d bytes=%d",Gx[this.mode],this.bitCount,this.binaryShiftByteCount)},y.calculateBinaryShiftCost=function(c){return c.binaryShiftByteCount>62?21:c.binaryShiftByteCount>31?20:c.binaryShiftByteCount>0?10:0},y.INITIAL_STATE=new y(I_,0,0,0),y}();var O_=function P_(y){var c=bt.getCharCode(" "),l=bt.getCharCode("."),w=bt.getCharCode(",");y[0][c]=1;for(var U=bt.getCharCode("Z"),J=bt.getCharCode("A"),ce=J;ce<=U;ce++)y[0][ce]=ce-J+2;y[1][c]=1;var ge=bt.getCharCode("z"),Pe=bt.getCharCode("a");for(ce=Pe;ce<=ge;ce++)y[1][ce]=ce-Pe+2;y[2][c]=1;var Ge=bt.getCharCode("9"),ut=bt.getCharCode("0");for(ce=ut;ce<=Ge;ce++)y[2][ce]=ce-ut+2;y[2][w]=12,y[2][l]=13;for(var _t=["\0"," ","\x01","\x02","\x03","\x04","\x05","\x06","\x07","\b","\t","\n","\v","\f","\r","\x1b","\x1c","\x1d","\x1e","\x1f","@","\\","^","_","`","|","~","\x7f"],Ot=0;Ot<_t.length;Ot++)y[3][bt.getCharCode(_t[Ot])]=Ot;var Ht=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(Ot=0;Ot0&&(y[4][bt.getCharCode(Ht[Ot])]=Ot);return y}(Vi.createInt32Array(5,256)),U1=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const $1=function(){function y(c){this.text=c}return y.prototype.encode=function(){for(var c=bt.getCharCode(" "),l=bt.getCharCode("\n"),w=C_.singletonList(T_.INITIAL_STATE),U=0;U0?(w=y.updateStateListForPair(w,U,J),U++):w=this.updateStateListForChar(w,U)}return C_.min(w,function(Pe,Ge){return Pe.getBitCount()-Ge.getBitCount()}).toBitArray(this.text)},y.prototype.updateStateListForChar=function(c,l){var w,U,J=[];try{for(var ce=U1(c),ge=ce.next();!ge.done;ge=ce.next())this.updateStateForChar(ge.value,l,J)}catch(Ge){w={error:Ge}}finally{try{ge&&!ge.done&&(U=ce.return)&&U.call(ce)}finally{if(w)throw w.error}}return y.simplifyStates(J)},y.prototype.updateStateForChar=function(c,l,w){for(var U=255&this.text[l],J=O_[c.getMode()][U]>0,ce=null,ge=0;ge<=4;ge++){var Pe=O_[ge][U];if(Pe>0){if(null==ce&&(ce=c.endBinaryShift(l)),!J||ge===c.getMode()||2===ge){var Ge=ce.latchAndAppend(ge,Pe);w.push(Ge)}if(!J&&ih[c.getMode()][ge]>=0){var ut=ce.shiftAndAppend(ge,Pe);w.push(ut)}}}if(c.getBinaryShiftByteCount()>0||0===O_[c.getMode()][U]){var _t=c.addBinaryShiftChar(l);w.push(_t)}},y.updateStateListForPair=function(c,l,w){var U,J,ce=[];try{for(var ge=U1(c),Pe=ge.next();!Pe.done;Pe=ge.next())this.updateStateForPair(Pe.value,l,w,ce)}catch(ut){U={error:ut}}finally{try{Pe&&!Pe.done&&(J=ge.return)&&J.call(ge)}finally{if(U)throw U.error}}return this.simplifyStates(ce)},y.updateStateForPair=function(c,l,w,U){var J=c.endBinaryShift(l);if(U.push(J.latchAndAppend(4,w)),4!==c.getMode()&&U.push(J.shiftAndAppend(4,w)),3===w||4===w){var ce=J.latchAndAppend(2,16-w).latchAndAppend(2,1);U.push(ce)}if(c.getBinaryShiftByteCount()>0){var ge=c.addBinaryShiftChar(l).addBinaryShiftChar(l+1);U.push(ge)}},y.simplifyStates=function(c){var l,w,U,J,ce=[];try{for(var ge=U1(c),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value,ut=!0,_t=function(sn){if(sn.isBetterThanOrEqualTo(Ge))return ut=!1,"break";Ge.isBetterThanOrEqualTo(sn)&&(ce=ce.filter(function(dn){return dn!==sn}))};try{for(var Ot=(U=void 0,U1(ce)),Ht=Ot.next();!Ht.done&&"break"!==_t(Ht.value);Ht=Ot.next());}catch(sn){U={error:sn}}finally{try{Ht&&!Ht.done&&(J=Ot.return)&&J.call(Ot)}finally{if(U)throw U.error}}ut&&ce.push(Ge)}}catch(sn){l={error:sn}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(l)throw l.error}}return ce},y}(),xy=function(){function y(){}return y.encodeBytes=function(c){return y.encode(c,y.DEFAULT_EC_PERCENT,y.DEFAULT_AZTEC_LAYERS)},y.encode=function(c,l,w){var ge,Pe,Ge,ut,_t,U=new $1(c).encode(),J=pi.truncDivision(U.getSize()*l,100)+11,ce=U.getSize()+J;if(w!==y.DEFAULT_AZTEC_LAYERS){if(ge=w<0,(Pe=Math.abs(w))>(ge?y.MAX_NB_BITS_COMPACT:y.MAX_NB_BITS))throw new Bi(bt.format("Illegal value %s for layers",w));var Ot=(Ge=y.totalBitsInLayer(Pe,ge))-Ge%(ut=y.WORD_SIZE[Pe]);if((_t=y.stuffBits(U,ut)).getSize()+J>Ot)throw new Bi("Data to large for user specified layer");if(ge&&_t.getSize()>64*ut)throw new Bi("Data to large for user specified layer")}else{ut=0,_t=null;for(var Ht=0;;Ht++){if(Ht>y.MAX_NB_BITS)throw new Bi("Data too large for an Aztec code");if(!(ce>(Ge=y.totalBitsInLayer(Pe=(ge=Ht<=3)?Ht+1:Ht,ge)))&&((null==_t||ut!==y.WORD_SIZE[Pe])&&(_t=y.stuffBits(U,ut=y.WORD_SIZE[Pe])),Ot=Ge-Ge%ut,!(ge&&_t.getSize()>64*ut)&&_t.getSize()+J<=Ot))break}}var On,Sr=y.generateCheckWords(_t,Ge,ut),jr=_t.getSize()/ut,sn=y.generateModeMessage(ge,Pe,jr),dn=(ge?11:14)+4*Pe,ln=new Int32Array(dn);if(ge)for(On=dn,Ht=0;Ht=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(Array.from(Ge)),Ht=Ot.next();!Ht.done;Ht=Ot.next())_t.appendBits(Ht.value,w)}catch(jr){U={error:jr}}finally{try{Ht&&!Ht.done&&(J=Ot.return)&&J.call(Ot)}finally{if(U)throw U.error}}return _t},y.bitsToWords=function(c,l,w){var J,ce,U=new Int32Array(w);for(J=0,ce=c.getSize()/l;J=U||c.get(ce+Pe))&&(ge|=1<>10}return J},c.prototype.getRow=function(l,w){if(l<0||l>=this.getHeight())throw new Bi("Requested row is outside the image: "+l);var U=this.getWidth(),J=l*U;return null===w?w=this.buffer.slice(J,J+U):(w.length0&&J[J.length-1])&&(6===Ge[0]||2===Ge[0])){l=0;continue}if(3===Ge[0]&&(!J||Ge[1]>J[0]&&Ge[1]=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")},wl={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},df=function(){function y(c,l,w){void 0===l&&(l=new Map),void 0===w&&(w={}),this.reader=c,this.hints=l,this.options=Fm(Fm({},wl),w)}return Object.defineProperty(y.prototype,"possibleFormats",{set:function(c){this.hints.set(Ci.POSSIBLE_FORMATS,c)},enumerable:!1,configurable:!0}),y.addVideoSource=function(c,l){try{c.srcObject=l}catch{console.error("got interrupted by new loading request")}},y.mediaStreamSetTorch=function(c,l){return bl(this,void 0,void 0,function(){return nl(this,function(w){switch(w.label){case 0:return[4,c.applyConstraints({advanced:[{fillLightMode:l?"flash":"off",torch:!!l}]})];case 1:return w.sent(),[2]}})})},y.mediaStreamIsTorchCompatible=function(c){var l,w,U=c.getVideoTracks();try{for(var J=Nm(U),ce=J.next();!ce.done;ce=J.next())if(y.mediaStreamIsTorchCompatibleTrack(ce.value))return!0}catch(Pe){l={error:Pe}}finally{try{ce&&!ce.done&&(w=J.return)&&w.call(J)}finally{if(l)throw l.error}}return!1},y.mediaStreamIsTorchCompatibleTrack=function(c){try{return"torch"in c.getCapabilities()}catch(w){return console.error(w),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},y.isVideoPlaying=function(c){return c.currentTime>0&&!c.paused&&c.readyState>2},y.getMediaElement=function(c,l){var w=document.getElementById(c);if(!w)throw new vs("element with id '".concat(c,"' not found"));if(w.nodeName.toLowerCase()!==l.toLowerCase())throw new vs("element with id '".concat(c,"' must be an ").concat(l," element"));return w},y.createVideoElement=function(c){if(c instanceof HTMLVideoElement)return c;if("string"==typeof c)return y.getMediaElement(c,"video");if(!c&&typeof document<"u"){var l=document.createElement("video");return l.width=200,l.height=200,l}throw new Error("Couldn't get videoElement from videoSource!")},y.prepareImageElement=function(c){if(c instanceof HTMLImageElement)return c;if("string"==typeof c)return y.getMediaElement(c,"img");if(typeof c>"u"){var l=document.createElement("img");return l.width=200,l.height=200,l}throw new Error("Couldn't get imageElement from imageSource!")},y.prepareVideoElement=function(c){var l=y.createVideoElement(c);return l.setAttribute("autoplay","true"),l.setAttribute("muted","true"),l.setAttribute("playsinline","true"),l},y.isImageLoaded=function(c){return!(!c.complete||0===c.naturalWidth)},y.createBinaryBitmapFromCanvas=function(c){var l=new Yx(c),w=new mc(l);return new jc(w)},y.drawImageOnCanvas=function(c,l){c.drawImage(l,0,0)},y.getMediaElementDimensions=function(c){if(c instanceof HTMLVideoElement)return{height:c.videoHeight,width:c.videoWidth};if(c instanceof HTMLImageElement)return{height:c.naturalHeight||c.height,width:c.naturalWidth||c.width};throw new Error("Couldn't find the Source's dimensions!")},y.createCaptureCanvas=function(c){if(!c)throw new vs("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error('The page "Document" is undefined, make sure you\'re running in a browser.');var l=document.createElement("canvas"),w=y.getMediaElementDimensions(c),U=w.width,J=w.height;return l.style.width=U+"px",l.style.height=J+"px",l.width=U,l.height=J,l},y.tryPlayVideo=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(w){switch(w.label){case 0:if(c?.ended)return console.error("Trying to play video that has ended."),[2,!1];if(y.isVideoPlaying(c))return console.warn("Trying to play video that is already playing."),[2,!0];w.label=1;case 1:return w.trys.push([1,3,,4]),[4,c.play()];case 2:return w.sent(),[2,!0];case 3:return l=w.sent(),console.warn("It was not possible to play the video.",l),[2,!1];case 4:return[2]}})})},y.createCanvasFromMediaElement=function(c){var l=y.createCaptureCanvas(c),w=l.getContext("2d");if(!w)throw new Error("Couldn't find Canvas 2D Context.");return y.drawImageOnCanvas(w,c),l},y.createBinaryBitmapFromMediaElem=function(c){var l=y.createCanvasFromMediaElement(c);return y.createBinaryBitmapFromCanvas(l)},y.destroyImageElement=function(c){c.src="",c.removeAttribute("src"),c=void 0},y.listVideoInputDevices=function(){return bl(this,void 0,void 0,function(){var c,l,w,U,J,ce,ge,Pe,_t,Ot;return nl(this,function(Ht){switch(Ht.label){case 0:if(!R_())throw new Error("Can't enumerate devices, navigator is not present.");if(!function Ay(){return!(!function H1(){return R_()&&!!navigator.mediaDevices}()||!navigator.mediaDevices.enumerateDevices)}())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:c=Ht.sent(),l=[];try{for(w=Nm(c),U=w.next();!U.done;U=w.next())"videoinput"===(ce="video"===(J=U.value).kind?"videoinput":J.kind)&&(ge=J.deviceId||J.id,Pe=J.label||"Video device ".concat(l.length+1),l.push({deviceId:ge,label:Pe,kind:ce,groupId:J.groupId}))}catch(Sr){_t={error:Sr}}finally{try{U&&!U.done&&(Ot=w.return)&&Ot.call(w)}finally{if(_t)throw _t.error}}return[2,l]}})})},y.findDeviceById=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(w){switch(w.label){case 0:return[4,y.listVideoInputDevices()];case 1:return(l=w.sent())?[2,l.find(function(U){return U.deviceId===c})]:[2]}})})},y.cleanVideoSource=function(c){if(c){try{c.srcObject=null}catch{c.src=""}c&&c.removeAttribute("src")}},y.releaseAllStreams=function(){0!==y.streamTracker.length&&y.streamTracker.forEach(function(c){c.getTracks().forEach(function(l){return l.stop()})}),y.streamTracker=[]},y.playVideoOnLoadAsync=function(c,l){return bl(this,void 0,void 0,function(){return nl(this,function(U){switch(U.label){case 0:return[4,y.tryPlayVideo(c)];case 1:return U.sent()?[2,!0]:[2,new Promise(function(J,ce){var ge=setTimeout(function(){y.isVideoPlaying(c)||(ce(!1),c.removeEventListener("canplay",Pe))},l),Pe=function(){y.tryPlayVideo(c).then(function(Ge){clearTimeout(ge),c.removeEventListener("canplay",Pe),J(Ge)})};c.addEventListener("canplay",Pe)})]}})})},y.attachStreamToVideo=function(c,l,w){return void 0===w&&(w=5e3),bl(this,void 0,void 0,function(){var U;return nl(this,function(J){switch(J.label){case 0:return U=y.prepareVideoElement(l),y.addVideoSource(U,c),[4,y.playVideoOnLoadAsync(U,w)];case 1:return J.sent(),[2,U]}})})},y._waitImageLoad=function(c){return new Promise(function(l,w){var J=setTimeout(function(){y.isImageLoaded(c)||(c.removeEventListener("load",ce),w())},1e4),ce=function(){clearTimeout(J),c.removeEventListener("load",ce),l()};c.addEventListener("load",ce)})},y.checkCallbackFnOrThrow=function(c){if(!c)throw new vs("`callbackFn` is a required parameter, you cannot capture results without it.")},y.disposeMediaStream=function(c){c.getVideoTracks().forEach(function(l){return l.stop()}),c=void 0},y.prototype.decode=function(c){var l=y.createCanvasFromMediaElement(c);return this.decodeFromCanvas(l)},y.prototype.decodeBitmap=function(c){return this.reader.decode(c,this.hints)},y.prototype.decodeFromCanvas=function(c){var l=y.createBinaryBitmapFromCanvas(c);return this.decodeBitmap(l)},y.prototype.decodeFromImageElement=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(w){switch(w.label){case 0:if(!c)throw new vs("An image element must be provided.");return l=y.prepareImageElement(c),[4,this._decodeOnLoadImage(l)];case 1:return[2,w.sent()]}})})},y.prototype.decodeFromImageUrl=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(w){switch(w.label){case 0:if(!c)throw new vs("An URL must be provided.");(l=y.prepareImageElement()).src=c,w.label=1;case 1:return w.trys.push([1,,3,4]),[4,this.decodeFromImageElement(l)];case 2:return[2,w.sent()];case 3:return y.destroyImageElement(l),[7];case 4:return[2]}})})},y.prototype.decodeFromConstraints=function(c,l,w){return bl(this,void 0,void 0,function(){var U,J;return nl(this,function(ce){switch(ce.label){case 0:return y.checkCallbackFnOrThrow(w),[4,this.getUserMedia(c)];case 1:U=ce.sent(),ce.label=2;case 2:return ce.trys.push([2,4,,5]),[4,this.decodeFromStream(U,l,w)];case 3:return[2,ce.sent()];case 4:throw J=ce.sent(),y.disposeMediaStream(U),J;case 5:return[2]}})})},y.prototype.decodeFromStream=function(c,l,w){return bl(this,void 0,void 0,function(){var J,ge,Pe,Ge,_t,Ot,Ht=this;return nl(this,function(Sr){switch(Sr.label){case 0:return y.checkCallbackFnOrThrow(w),[4,y.attachStreamToVideo(c,l,this.options.tryPlayVideoTimeout)];case 1:return J=Sr.sent(),ge=this.scan(J,w,function(){y.disposeMediaStream(c),y.cleanVideoSource(J)}),Pe=c.getVideoTracks(),Ge=Fm(Fm({},ge),{stop:function(){ge.stop()},streamVideoConstraintsApply:function(jr,sn){return bl(this,void 0,void 0,function(){var dn,ln,On,vi,ki,Xi;return nl(this,function(So){switch(So.label){case 0:dn=sn?Pe.filter(sn):Pe,So.label=1;case 1:So.trys.push([1,6,7,8]),ln=Nm(dn),On=ln.next(),So.label=2;case 2:return On.done?[3,5]:[4,On.value.applyConstraints(jr)];case 3:So.sent(),So.label=4;case 4:return On=ln.next(),[3,2];case 5:return[3,8];case 6:return vi=So.sent(),ki={error:vi},[3,8];case 7:try{On&&!On.done&&(Xi=ln.return)&&Xi.call(ln)}finally{if(ki)throw ki.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(jr){return Pe.find(jr).getConstraints()},streamVideoSettingsGet:function(jr){return Pe.find(jr).getSettings()},streamVideoCapabilitiesGet:function(jr){return Pe.find(jr).getCapabilities()}}),y.mediaStreamIsTorchCompatible(c)&&(_t=Pe?.find(function(jr){return y.mediaStreamIsTorchCompatibleTrack(jr)}),Ge.switchTorch=Ot=function(jr){return bl(Ht,void 0,void 0,function(){return nl(this,function(sn){switch(sn.label){case 0:return[4,y.mediaStreamSetTorch(_t,jr)];case 1:return sn.sent(),[2]}})})},Ge.stop=function(){return bl(Ht,void 0,void 0,function(){return nl(this,function(jr){switch(jr.label){case 0:return ge.stop(),[4,Ot(!1)];case 1:return jr.sent(),[2]}})})}),[2,Ge]}})})},y.prototype.decodeFromVideoDevice=function(c,l,w){return bl(this,void 0,void 0,function(){return nl(this,function(ce){switch(ce.label){case 0:return y.checkCallbackFnOrThrow(w),[4,this.decodeFromConstraints({video:c?{deviceId:{exact:c}}:{facingMode:"environment"}},l,w)];case 1:return[2,ce.sent()]}})})},y.prototype.decodeFromVideoElement=function(c,l){return bl(this,void 0,void 0,function(){var w;return nl(this,function(J){switch(J.label){case 0:if(y.checkCallbackFnOrThrow(l),!c)throw new vs("A video element must be provided.");return w=y.prepareVideoElement(c),[4,y.playVideoOnLoadAsync(w,this.options.tryPlayVideoTimeout)];case 1:return J.sent(),[2,this.scan(w,l)]}})})},y.prototype.decodeFromVideoUrl=function(c,l){return bl(this,void 0,void 0,function(){var w,U;return nl(this,function(ge){switch(ge.label){case 0:if(y.checkCallbackFnOrThrow(l),!c)throw new vs("An URL must be provided.");return(w=y.prepareVideoElement()).src=c,U=function(){y.cleanVideoSource(w)},[4,y.playVideoOnLoadAsync(w,this.options.tryPlayVideoTimeout)];case 1:return ge.sent(),[2,this.scan(w,l,U)]}})})},y.prototype.decodeOnceFromConstraints=function(c,l){return bl(this,void 0,void 0,function(){var w;return nl(this,function(U){switch(U.label){case 0:return[4,this.getUserMedia(c)];case 1:return w=U.sent(),[4,this.decodeOnceFromStream(w,l)];case 2:return[2,U.sent()]}})})},y.prototype.decodeOnceFromStream=function(c,l){return bl(this,void 0,void 0,function(){var w,U;return nl(this,function(ce){switch(ce.label){case 0:return w=!!l,[4,y.attachStreamToVideo(c,l)];case 1:U=ce.sent(),ce.label=2;case 2:return ce.trys.push([2,,4,5]),[4,this.scanOneResult(U)];case 3:return[2,ce.sent()];case 4:return w||y.cleanVideoSource(U),[7];case 5:return[2]}})})},y.prototype.decodeOnceFromVideoDevice=function(c,l){return bl(this,void 0,void 0,function(){return nl(this,function(J){switch(J.label){case 0:return[4,this.decodeOnceFromConstraints({video:c?{deviceId:{exact:c}}:{facingMode:"environment"}},l)];case 1:return[2,J.sent()]}})})},y.prototype.decodeOnceFromVideoElement=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(U){switch(U.label){case 0:if(!c)throw new vs("A video element must be provided.");return l=y.prepareVideoElement(c),[4,y.playVideoOnLoadAsync(l,this.options.tryPlayVideoTimeout)];case 1:return U.sent(),[4,this.scanOneResult(l)];case 2:return[2,U.sent()]}})})},y.prototype.decodeOnceFromVideoUrl=function(c){return bl(this,void 0,void 0,function(){var l,w;return nl(this,function(U){switch(U.label){case 0:if(!c)throw new vs("An URL must be provided.");(l=y.prepareVideoElement()).src=c,w=this.decodeOnceFromVideoElement(l),U.label=1;case 1:return U.trys.push([1,,3,4]),[4,w];case 2:return[2,U.sent()];case 3:return y.cleanVideoSource(l),[7];case 4:return[2]}})})},y.prototype.scanOneResult=function(c,l,w,U){var J=this;return void 0===l&&(l=!0),void 0===w&&(w=!0),void 0===U&&(U=!0),new Promise(function(ce,ge){J.scan(c,function(Pe,Ge,ut){if(Pe)return ce(Pe),void ut.stop();if(Ge){if(Ge instanceof Gn&&l||Ge instanceof rs&&w||Ge instanceof Qn&&U)return;ut.stop(),ge(Ge)}})})},y.prototype.scan=function(c,l,w){var U=this;y.checkCallbackFnOrThrow(l);var ce,J=y.createCaptureCanvas(c);try{ce=J.getContext("2d",{willReadFrequently:!0})}catch{ce=J.getContext("2d")}if(!ce)throw new Error("Couldn't create canvas for visual element scan.");var Ge,ge=function(){ce=void 0,J=void 0},Pe=!1,_t={stop:function(){Pe=!0,clearTimeout(Ge),ge(),w&&w()}},Ot=function(){if(!Pe)try{y.drawImageOnCanvas(ce,c);var Ht=U.decodeFromCanvas(J);l(Ht,void 0,_t),Ge=setTimeout(Ot,U.options.delayBetweenScanSuccess)}catch(dn){if(l(void 0,dn,_t),dn instanceof rs||dn instanceof Qn||dn instanceof Gn)return void(Ge=setTimeout(Ot,U.options.delayBetweenScanAttempts));ge(),w&&w(dn)}};return Ot(),_t},y.prototype._decodeOnLoadImage=function(c){return bl(this,void 0,void 0,function(){return nl(this,function(w){switch(w.label){case 0:return y.isImageLoaded(c)?[3,2]:[4,y._waitImageLoad(c)];case 1:w.sent(),w.label=2;case 2:return[2,this.decode(c)]}})})},y.prototype.getUserMedia=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(w){switch(w.label){case 0:return[4,navigator.mediaDevices.getUserMedia(c)];case 1:return l=w.sent(),y.streamTracker.push(l),[2,l]}})})},y.streamTracker=[],y}(),W1=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),Df=(function(y){W1(function c(l,w){return y.call(this,new We,l,w)||this},y)}(df),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),k_=(function(y){Df(function c(l,w){return y.call(this,new Ac(l),l,w)||this},y)}(df),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),Cy=(function(y){k_(function c(l,w){return y.call(this,new v0,l,w)||this},y)}(df),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),Qx=function(y){function c(l,w){var U=this,J=new iy;return J.setHints(l),(U=y.call(this,J,l,w)||this).reader=J,U}return Cy(c,y),Object.defineProperty(c.prototype,"possibleFormats",{set:function(l){this.hints.set(Ci.POSSIBLE_FORMATS,l),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),c.prototype.decodeBitmap=function(l){return this.reader.decodeWithState(l)},c.prototype.setHints=function(l){this.hints=l,this.reader.setHints(this.hints)},c}(df),qx=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),tS=(function(y){qx(function c(l,w){return y.call(this,new A0,l,w)||this},y)}(df),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),Th=(function(y){tS(function c(l,w){return y.call(this,new p1,l,w)||this},y)}(df),"http://www.w3.org/2000/svg"),Ph=(function(){function y(c){if("string"==typeof c){var l=document.getElementById(c);if(!l)throw new Error("Could not find a Container element with '".concat(c,"'."));this.containerElement=l}else this.containerElement=c}y.prototype.write=function(c,l,w,U){if(0===c.length)throw new Bi("Found empty contents");if(l<0||w<0)throw new Bi("Requested dimensions are too small: "+l+"x"+w);var J=U&&void 0!==U.get(ss.MARGIN)?Number.parseInt(U.get(ss.MARGIN).toString(),10):y.QUIET_ZONE_SIZE,ce=this.encode(U,c);return this.renderResult(ce,l,w,J)},y.prototype.createSVGElement=function(c,l){var w=document.createElementNS(y.SVG_NS,"svg");return w.setAttributeNS(Th,"width",l.toString()),w.setAttributeNS(Th,"height",c.toString()),w},y.prototype.createSvgPathPlaceholderElement=function(c,l){var w=document.createElementNS(y.SVG_NS,"path");return w.setAttributeNS(Th,"d","M0 0h".concat(c,"v").concat(l,"H0z")),w.setAttributeNS(Th,"fill","none"),w},y.prototype.createSvgRectElement=function(c,l,w,U){var J=document.createElementNS(y.SVG_NS,"rect");return J.setAttributeNS(Th,"x",c.toString()),J.setAttributeNS(Th,"y",l.toString()),J.setAttributeNS(Th,"height",w.toString()),J.setAttributeNS(Th,"width",U.toString()),J.setAttributeNS(Th,"fill","#000000"),J},y.prototype.encode=function(c,l){var w=Sl.L;if(c&&void 0!==c.get(ss.ERROR_CORRECTION)){var U=c.get(ss.ERROR_CORRECTION).toString();w=Sl.fromString(U)}return I0.encode(l,w,c)},y.prototype.renderResult=function(c,l,w,U){var J=c.getMatrix();if(null===J)throw new ou;var ce=J.getWidth(),ge=J.getHeight(),Pe=ce+2*U,Ge=ge+2*U,ut=Math.max(l,Pe),_t=Math.max(w,Ge),Ot=Math.min(Math.floor(ut/Pe),Math.floor(_t/Ge)),Ht=Math.floor((ut-ce*Ot)/2),Sr=Math.floor((_t-ge*Ot)/2),jr=this.createSVGElement(ut,_t),sn=this.createSvgPathPlaceholderElement(l,w);jr.appendChild(sn),this.containerElement.appendChild(jr);for(var dn=0,ln=Sr;dn{if(!ge)return void U.next({result:ce});const Pe=ge.name;Pe===Gn.name||Pe===rs.name||Pe===Qn.name||ge.message.includes("No MultiFormat Readers were able to detect the code.")?U.next({error:ge}):(U.error(ge),w.scannerControls.stop(),w.scannerControls=void 0)}),w.scannerControls={...J,stop(){J.stop(),U.complete()}}}catch(ce){U.error(ce),w.scannerControls?.stop(),w.scannerControls=void 0}return U.asObservable()})()}}let Dy=(()=>{class y{get codeReader(){return this._codeReader}set device(l){this._ready?this.isAutostarting?console.warn("Avoid setting a device during auto-start."):this.isCurrentDevice(l)?console.warn("Setting the same device is not allowed."):this.hasPermission?this.setDevice(l):console.warn("Permissions not set yet, waiting for them to be set to apply device change."):this._devicePreStart=l}get device(){return this._device}get formats(){return this.hints.get(Ci.POSSIBLE_FORMATS)}set formats(l){if("string"==typeof l)throw new Error("Invalid formats, make sure the [formats] input is a binding.");const w=l.map(J=>this.getBarcodeFormatOrFail(J)),U=this.hints;U.set(Ci.POSSIBLE_FORMATS,w),this.hints=U}get hints(){return this._hints}set hints(l){this._hints=l,this.codeReader?.setHints(this._hints)}set videoConstraints(l){const w=this.codeReader?.getScannerControls();w&&w?.streamVideoConstraintsApply(l)}set isAutostarting(l){this._isAutostarting=l,this.autostarting.next(l)}get isAutostarting(){return this._isAutostarting}set torch(l){try{this.getCodeReader().getScannerControls().switchTorch(l)}catch{}}set enable(l){this._enabled!==!!l&&(this._enabled=!!l,this._enabled?this.device?this.scanFromDevice(this.device.deviceId):this.init():(this.reset(),G1.releaseAllStreams()))}get enabled(){return this._enabled}get tryHarder(){return this.hints.get(Ci.TRY_HARDER)}set tryHarder(l){const w=this.hints;l?w.set(Ci.TRY_HARDER,!0):w.delete(Ci.TRY_HARDER),this.hints=w}constructor(){this.timeBetweenScans=500,this.delayBetweenScanSuccess=500,this.previewFitMode="cover",this.poster="",this._ready=!1,this.autostarted=new a.bkB,this.autostarting=new a.bkB,this.torchCompatible=new a.bkB(!1),this.scanSuccess=new a.bkB,this.scanFailure=new a.bkB,this.scanError=new a.bkB,this.scanComplete=new a.bkB,this.camerasFound=new a.bkB,this.camerasNotFound=new a.bkB,this.permissionResponse=new a.bkB(!0),this.hasDevices=new a.bkB,this.deviceChange=new a.bkB,this._enabled=!0,this._hints=new Map,this.autofocusEnabled=!0,this.autostart=!0,this.formats=[Co.QR_CODE],this.hasNavigator=typeof navigator<"u",this.isMediaDevicesSupported=this.hasNavigator&&!!navigator.mediaDevices}askForPermission(){var l=this;return(0,B.A)(function*(){if(!l.hasNavigator)return console.error("@zxing/ngx-scanner","Can't ask permission, navigator is not present."),l.setPermission(null),l.hasPermission;if(!l.isMediaDevicesSupported)return console.error("@zxing/ngx-scanner","Can't get user media, this is not supported."),l.setPermission(null),l.hasPermission;let w,U;try{w=yield l.getAnyVideoDevice(),U=!!w}catch(J){return l.handlePermissionException(J)}finally{l.terminateStream(w)}return l.setPermission(U),U})()}getAnyVideoDevice(){return navigator.mediaDevices.getUserMedia({video:!0})}terminateStream(l){l&&l.getTracks().forEach(w=>w.stop()),l=void 0}init(){var l=this;return(0,B.A)(function*(){if(!l.autostart)return console.warn("Feature 'autostart' disabled. Permissions and devices recovery has to be run manually."),l.initAutostartOff(),void(l._ready=!0);yield l.initAutostartOn(),l._ready=!0})()}initAutostartOff(){this.isAutostarting=!1,this.updateVideoInputDevices(),this._device&&this._devicePreStart&&this.setDevice(this._devicePreStart)}initAutostartOn(){var l=this;return(0,B.A)(function*(){let w;l.isAutostarting=!0;try{w=yield l.askForPermission()}catch(U){return void console.error("Exception occurred while asking for permission:",U)}if(w){const U=yield l.updateVideoInputDevices();yield l.autostartScanner([...U])}l.isAutostarting=!1,l.autostarted.next()})()}isCurrentDevice(l){return l?.deviceId===this._device?.deviceId}ngOnDestroy(){this.reset(),df.cleanVideoSource(this.previewElemRef.nativeElement),G1.releaseAllStreams()}ngOnInit(){this.init()}scanStop(){this._scanSubscription&&(this.codeReader?.getScannerControls().stop(),this._scanSubscription?.unsubscribe(),this._scanSubscription=void 0)}scanStart(){if(this._scanSubscription)throw new Error("There is already a scan process running.");if(!this._device)throw new Error("No device defined, cannot start scan, please define a device.");this.scanFromDevice(this._device.deviceId)}restart(){this._codeReader=void 0;const l=this._reset();l&&(this.device=l)}updateVideoInputDevices(){var l=this;return(0,B.A)(function*(){const w=(yield df.listVideoInputDevices())||[],U=w&&w.length>0;return l.hasDevices.next(U),l.camerasFound.next([...w]),U||l.camerasNotFound.next(null),w})()}autostartScanner(l){var w=this;return(0,B.A)(function*(){const J=l.find(({label:ce})=>/back|tr\xe1s|rear|traseira|environment|ambiente/gi.test(ce))||l.pop();if(!J)throw new Error("Impossible to autostart, no input devices available.");yield w.setDevice(J),w.deviceChange.next(J)})()}dispatchScanSuccess(l){this.scanSuccess.next(l.getText())}dispatchScanFailure(l){this.scanFailure.next(l)}dispatchScanError(l){this.scanError.observed||(console.error(`zxing scanner component: ${l.name}`,l),console.warn("Use the `(scanError)` property to handle errors like this!")),this.scanError.next(l)}dispatchScanComplete(l){this.scanComplete.next(l)}handlePermissionException(l){let w;switch(console.error("@zxing/ngx-scanner","Error when asking for permission.",l),l.name){case"NotSupportedError":console.warn("@zxing/ngx-scanner",l.message),w=null,this.hasDevices.next(null);break;case"NotAllowedError":console.warn("@zxing/ngx-scanner",l.message),w=!1,this.hasDevices.next(!0);break;case"NotFoundError":console.warn("@zxing/ngx-scanner",l.message),w=null,this.hasDevices.next(!1),this.camerasNotFound.next(l);break;case"NotReadableError":console.warn("@zxing/ngx-scanner","Couldn't read the device(s)'s stream, it's probably in use by another app."),w=null,this.hasDevices.next(!1),this.camerasNotFound.next(l);break;default:console.warn("@zxing/ngx-scanner","I was not able to define if I have permissions for camera or not.",l),w=null}return this.setPermission(w),this.permissionResponse.error(l),w}getBarcodeFormatOrFail(l){return"string"==typeof l?Co[l.trim().toUpperCase()]:l}getCodeReader(){return this._codeReader||(this._codeReader=new G1(this.hints,{delayBetweenScanAttempts:this.timeBetweenScans,delayBetweenScanSuccess:this.delayBetweenScanSuccess})),this._codeReader}scanFromDevice(l){var w=this;return(0,B.A)(function*(){const U=w.previewElemRef.nativeElement,J=w.getCodeReader(),ce=yield J.scanFromDeviceObservable(l,U);if(!ce)throw new Error("Undefined decoding stream, aborting.");if(w._scanSubscription=ce.subscribe(Ot=>w._onDecodeResult(Ot.result,Ot.error),Ot=>w._onDecodeError(Ot),()=>{}),w._scanSubscription.closed)return;const _t=typeof J.getScannerControls().switchTorch<"u";w.torchCompatible.next(_t)})()}_onDecodeError(l){this.dispatchScanError(l)}_onDecodeResult(l,w){l?this.dispatchScanSuccess(l):this.dispatchScanFailure(w),this.dispatchScanComplete(l)}_reset(){if(!this._codeReader)return;this.scanStop();try{df.cleanVideoSource(this.previewElemRef.nativeElement)}catch{}try{df.releaseAllStreams()}catch{}this._codeReader=void 0;const l=this._device;return this.device=void 0,l}reset(){this._reset(),this.deviceChange.emit(null)}setDevice(l){var w=this;return(0,B.A)(function*(){w.scanStop(),w._device=l||void 0,w._device||df.cleanVideoSource(w.previewElemRef.nativeElement),w._enabled&&l&&(yield w.scanFromDevice(l.deviceId))})()}setPermission(l){this.hasPermission=l,this.permissionResponse.next(l)}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["zxing-scanner"]],viewQuery:function(w,U){if(1&w&&a.GBs(lp,7),2&w){let J;a.mGM(J=a.lsd())&&(U.previewElemRef=J.first)}},inputs:{autofocusEnabled:"autofocusEnabled",timeBetweenScans:"timeBetweenScans",delayBetweenScanSuccess:"delayBetweenScanSuccess",autostart:"autostart",previewFitMode:"previewFitMode",poster:"poster",device:"device",formats:"formats",videoConstraints:"videoConstraints",torch:"torch",enable:"enable",tryHarder:"tryHarder"},outputs:{autostarted:"autostarted",autostarting:"autostarting",torchCompatible:"torchCompatible",scanSuccess:"scanSuccess",scanFailure:"scanFailure",scanError:"scanError",scanComplete:"scanComplete",camerasFound:"camerasFound",camerasNotFound:"camerasNotFound",permissionResponse:"permissionResponse",hasDevices:"hasDevices",deviceChange:"deviceChange"},decls:6,vars:3,consts:[["preview",""],[3,"poster"]],template:function(w,U){1&w&&(a.j41(0,"video",1,0)(2,"p"),a.EFF(3," Your browser does not support this feature, please try to upgrade it. "),a.k0s(),a.j41(4,"p"),a.EFF(5," Seu navegador n\xe3o suporta este recurso, por favor tente atualiz\xe1-lo. "),a.k0s()()),2&w&&(a.xc7("object-fit",U.previewFitMode),a.Y8G("poster",U.poster,a.B4B))},styles:["[_nghost-%COMP%]{display:block}video[_ngcontent-%COMP%]{width:100%;height:auto;object-fit:contain}"],changeDetection:0})}}return y})(),nS=(()=>{class y{static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275mod=a.$C({type:y})}static{this.\u0275inj=a.G2t({imports:[R.MD,M.YN]})}}return y})(),SD=(()=>{class y{constructor(l,w){this.data=l,this.dialogRef=w}ngAfterViewInit(){}scanSuccessHandler(l){console.log("Scan success:",l),this.dialogRef.close(l)}scanErrorHandler(l){console.log("Scan success:",l)}scanFailureHandler(l){console.log("Scan success:",l)}scanCompleteHandler(l){console.log("Scan success:",l)}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(j.Vh),a.rXU(j.CP))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-qrcode-scan-dialog"]],standalone:!0,features:[a.aNF],decls:7,vars:0,consts:[["mat-dialog-title",""],[1,"qr-scanner",3,"scanSuccess","scanError","scanFailure","scanComplete"],["mat-flat-button","","mat-dialog-close","","cdkFocusInitial",""]],template:function(w,U){1&w&&(a.j41(0,"h2",0),a.EFF(1,"Scan QR Code"),a.k0s(),a.j41(2,"mat-dialog-content")(3,"zxing-scanner",1),a.bIt("scanSuccess",function(ce){return U.scanSuccessHandler(ce)})("scanError",function(ce){return U.scanErrorHandler(ce)})("scanFailure",function(ce){return U.scanFailureHandler(ce)})("scanComplete",function(ce){return U.scanCompleteHandler(ce)}),a.k0s()(),a.j41(4,"mat-dialog-actions")(5,"button",2),a.EFF(6,"Close"),a.k0s()())},dependencies:[nS,Dy,j.hM,j.tx,j.BI,j.E7,j.Yi,_.Hl,_.$z],styles:["[_nghost-%COMP%]{width:100vw;height:100vh}[_nghost-%COMP%] zxing-scanner[_ngcontent-%COMP%] {object-fit:contain}"]})}}return y})();var AD=f(82546),CD=f(63528),N_=f(43881);let X1=(()=>{class y{constructor(){}transform(l,...w){return l?y.time(l):"00:00:00"}static time(l){var w=Math.floor(l/60/60),U=Math.floor(l/60)-60*w,J=l%60;return w.toString().padStart(2,"0")+":"+U.toString().padStart(2,"0")+":"+J.toString().padStart(2,"0")}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275pipe=a.EJ8({name:"time",type:y,pure:!0,standalone:!0})}}return y})();const AM=y=>({miniplayer:y});function CM(y,c){if(1&y&&(a.j41(0,"div",1),a.EFF(1),a.k0s()),2&y){const l=a.XpG();a.R7$(),a.JRh(l.player.title())}}function j0(y,c){if(1&y){const l=a.RV6();a.j41(0,"div")(1,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.player.play())}),a.j41(2,"mat-icon"),a.EFF(3,"play_arrow"),a.k0s()()()}}function DM(y,c){if(1&y){const l=a.RV6();a.j41(0,"div")(1,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.player.pause())}),a.j41(2,"mat-icon"),a.EFF(3,"pause"),a.k0s()()()}}function IM(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",6)(1,"div",8),a.EFF(2),a.nI1(3,"time"),a.k0s(),a.j41(4,"div",9)(5,"mat-slider",10)(6,"input",11),a.mxI("ngModelChange",function(U){a.eBV(l);const J=a.XpG();return a.DH7(J.player.time,U)||(J.player.time=U),a.Njj(U)}),a.k0s()()(),a.j41(7,"div",12),a.EFF(8),a.nI1(9,"time"),a.k0s()()}if(2&y){const l=a.XpG();a.R7$(2),a.JRh(a.bMT(3,7,l.player.time)),a.R7$(3),a.Y8G("displayWith",l.formatLabel)("max",l.player.duration)("min",0)("step",1),a.R7$(),a.R50("ngModel",l.player.time),a.R7$(2),a.JRh(a.bMT(9,9,l.player.duration))}}function iS(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",7)(1,"div")(2,"button",13)(3,"mat-icon"),a.EFF(4,"queue"),a.k0s()()(),a.j41(5,"div")(6,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.closeTray())}),a.j41(7,"mat-icon"),a.EFF(8,"close"),a.k0s()()()()}}let L_=(()=>{class y{constructor(l,w){this.renderer=l,this.el=w,this.miniplayer=!1,this.layout=(0,a.WQX)(S.Y),this.player=(0,a.WQX)(CD.x)}formatLabel(l){return X1.time(l)}closeTray(){this.layout.tray.set(!1)}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(a.sFG),a.rXU(a.aKT))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-player-controls"]],inputs:{miniplayer:"miniplayer"},standalone:!0,features:[a.aNF],decls:16,vars:7,consts:[[1,"player",3,"ngClass"],[1,"player-media"],[1,"player-controls"],[1,"player-controls-top"],["mat-icon-button","",1,"nodrag",3,"click"],["mat-icon-button","",3,"click"],[1,"player-controls-bottom"],[1,"player-actions"],[1,"media-timeline-1","hide-small2"],[1,"media-timeline-2"],["discrete","",1,"media-slider",3,"displayWith","max","min","step"],["matSliderThumb","",3,"ngModelChange","ngModel"],[1,"media-timeline-3","hide-small2"],["mat-icon-button",""]],template:function(w,U){1&w&&(a.j41(0,"div",0),a.DNE(1,CM,2,1,"div",1),a.j41(2,"div",2)(3,"div",3)(4,"div")(5,"button",4),a.bIt("click",function(){return U.player.previous()}),a.j41(6,"mat-icon"),a.EFF(7,"skip_previous"),a.k0s()()(),a.DNE(8,j0,4,0,"div")(9,DM,4,0,"div"),a.j41(10,"div")(11,"button",5),a.bIt("click",function(){return U.player.next()}),a.j41(12,"mat-icon"),a.EFF(13,"skip_next"),a.k0s()()()(),a.DNE(14,IM,10,11,"div",6),a.k0s(),a.DNE(15,iS,9,0,"div",7),a.k0s()),2&w&&(a.Y8G("ngClass",a.eq3(5,AM,U.miniplayer)),a.R7$(),a.vxM(U.miniplayer?-1:1),a.R7$(7),a.vxM(U.player.paused?8:9),a.R7$(6),a.vxM(U.miniplayer?-1:14),a.R7$(),a.vxM(U.miniplayer?-1:15))},dependencies:[X1,_.Hl,_.iY,P.m_,P.An,R.MD,R.YU,N_.Ez,N_.IV,N_.OU,k.fS,M.YN,M.me,M.BC,M.vS],styles:[".player[_ngcontent-%COMP%]{display:flex;flex-direction:row;padding:1em}.miniplayer[_ngcontent-%COMP%]{padding:0;margin:-4px;-webkit-app-region:drag}.player-media[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1 1 25%;align-items:center}.player-controls[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 50%;justify-content:center}.player-actions[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1 1 25%;justify-content:flex-end;align-items:center}.smaller[_ngcontent-%COMP%]{font-size:.8em}.player-controls-top[_ngcontent-%COMP%]{display:flex;justify-content:center}.player-controls-bottom[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;font-size:.8em}"]})}}return y})();var va=f(51889),oS=f(43794),Iy=f(59564),My=f(71997);const Lm=["*"],j_=y=>({"title-bar-collapsed":y}),Z1=y=>({"sidenav-collapsed":y}),U_=()=>["/introduction"],up=()=>["/settings","notifications"],U0=y=>["/profile",y],pl=y=>["/profile",y,"edit"],Eu=()=>["/notifications"],wd=()=>["/settings"],Ty=()=>["/accounts"],jo=()=>["/account/create"],Qa=y=>({"sidenav-scroll-wrapper-tray":y}),Py=(y,c,l)=>({"sidenav-content":y,"sidenav-content-marginless":c,"sidenav-content-custom":l}),Ca=()=>["/admin"];function $0(y,c){1&y&&a.nrm(0,"img",15)}function V0(y,c){1&y&&a.EFF(0," Admin ")}function DD(y,c){if(1&y&&(a.j41(0,"a",16,5)(2,"mat-icon",18),a.EFF(3,"admin_panel_settings"),a.k0s(),a.DNE(4,V0,1,0),a.k0s()),2&y){const l=a.sdS(1),w=a.XpG();a.Y8G("routerLink",a.lJ4(3,Ca))("activated",l.isActive),a.R7$(4),a.vxM(w.collapsed()?-1:4)}}function Oy(y,c){if(1&y&&a.EFF(0),2&y){const l=a.XpG().$implicit;a.SpI(" ",l.title," ")}}function Ry(y,c){if(1&y&&(a.j41(0,"a",16,5)(2,"mat-icon",18),a.EFF(3),a.k0s(),a.DNE(4,Oy,1,1),a.k0s()),2&y){const l=c.$implicit,w=a.sdS(1),U=a.XpG();a.Y8G("routerLink",l.path)("activated",w.isActive),a.R7$(3),a.JRh(l.data.icon),a.R7$(),a.vxM(U.collapsed()?-1:4)}}function ky(y,c){1&y&&(a.j41(0,"mat-icon",18),a.EFF(1,"chevron_right"),a.k0s())}function Y1(y,c){1&y&&(a.j41(0,"mat-icon",18),a.EFF(1,"chevron_left"),a.k0s())}function z0(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",46),a.bIt("click",function(){a.eBV(l),a.XpG();const U=a.sdS(5);return a.Njj(U.toggle())}),a.j41(1,"mat-icon",47),a.EFF(2,"menu"),a.k0s()()}}function K0(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",26),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.navigateBack())}),a.j41(1,"mat-icon"),a.EFF(2,"arrow_back"),a.k0s()()}}function $_(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",48),a.bIt("click",function(){const U=a.eBV(l).$implicit;return a.Njj(U.action())}),a.j41(1,"mat-icon"),a.EFF(2),a.k0s()()}if(2&y){const l=c.$implicit;a.Y8G("title",l.name),a.R7$(2),a.JRh(l.icon)}}function By(y,c){if(1&y){const l=a.RV6();a.j41(0,"input",49),a.mxI("ngModelChange",function(U){a.eBV(l);const J=a.XpG();return a.DH7(J.layout.searchInput,U)||(J.layout.searchInput=U),a.Njj(U)}),a.bIt("input",function(U){a.eBV(l);const J=a.XpG();return a.Njj(J.onSearchInput(U))}),a.k0s()}if(2&y){const l=a.XpG();a.R50("ngModel",l.layout.searchInput)}}function H0(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",26),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.qrScan())}),a.j41(1,"mat-icon"),a.EFF(2,"qr_code_scanner"),a.k0s()()}}function Fy(y,c){1&y&&(a.j41(0,"mat-icon"),a.EFF(1,"close"),a.k0s())}function Up(y,c){1&y&&(a.j41(0,"mat-icon"),a.EFF(1,"search"),a.k0s())}function V_(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",50),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.applyUpdate())}),a.j41(1,"mat-icon"),a.EFF(2,"get_app"),a.k0s()()}}function sS(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",51),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.installPWA())}),a.j41(1,"mat-icon"),a.EFF(2,"install_mobile"),a.k0s()()}2&y&&a.Y8G("matTooltip","Install App")}function aS(y,c){if(1&y&&(a.j41(0,"button",31)(1,"mat-icon"),a.EFF(2),a.k0s(),a.j41(3,"span"),a.EFF(4),a.k0s(),a.j41(5,"div",52),a.EFF(6),a.nI1(7,"ago"),a.k0s()()),2&y){const l=c.$implicit;a.Y8G("routerLink",a.lJ4(7,Eu)),a.R7$(2),a.JRh(l.data.icon),a.R7$(2),a.JRh(l.data.title),a.R7$(2),a.Lme("",l.data.app," (",a.bMT(7,5,"2024-08-22 12:00"),")")}}function cS(y,c){if(1&y&&(a.j41(0,"button",32),a.nrm(1,"img",53),a.nI1(2,"safeResourceUrl"),a.k0s()),2&y){const l=a.XpG(),w=a.sdS(59);a.Y8G("matMenuTriggerFor",w),a.R7$(),a.Y8G("src",a.bMT(2,2,l.profileService.avatar()),a.B4B)}}function z_(y,c){if(1&y&&(a.j41(0,"button",33)(1,"mat-icon"),a.EFF(2,"account_circle"),a.k0s()()),2&y){a.XpG();const l=a.sdS(59);a.Y8G("matMenuTriggerFor",l)}}function W0(y,c){if(1&y&&(a.EFF(0),a.nrm(1,"br")),2&y){const l=a.XpG(2);a.SpI(" ",l.identity.identity.metadata.name,"")}}function jm(y,c){if(1&y&&(a.j41(0,"h2"),a.EFF(1),a.k0s(),a.EFF(2),a.nrm(3,"br"),a.EFF(4),a.nI1(5,"did"),a.nrm(6,"br"),a.DNE(7,W0,2,1,"br")),2&y){const l=a.XpG();a.R7$(),a.JRh(l.profileService.current().name),a.R7$(),a.SpI(" ",l.profileService.current().title,""),a.R7$(2),a.SpI(" ",a.bMT(5,4,l.identity.did),""),a.R7$(3),a.vxM(l.identity.identity?7:-1)}}function K_(y,c){if(1&y&&(a.EFF(0),a.nI1(1,"did")),2&y){const l=a.XpG();a.SpI(" ",a.bMT(1,1,l.identity.did)," ")}}function ID(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",54),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.installPWA())}),a.j41(1,"mat-icon"),a.EFF(2,"install_mobile"),a.k0s(),a.j41(3,"span"),a.EFF(4,"Install App"),a.k0s()()}}function MD(y,c){if(1&y&&(a.j41(0,"strong"),a.EFF(1),a.k0s()),2&y){const l=a.XpG().$implicit;a.R7$(),a.SpI("",l.metadata.name," *")}}function J1(y,c){if(1&y&&(a.j41(0,"span"),a.EFF(1),a.k0s()),2&y){const l=a.XpG().$implicit;a.R7$(),a.JRh(l.metadata.name)}}function H_(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",30),a.bIt("click",function(){const U=a.eBV(l).$implicit,J=a.XpG();return a.Njj(J.changeAccount(U.did.uri))}),a.j41(1,"mat-icon"),a.EFF(2,"account_circle"),a.k0s(),a.DNE(3,MD,2,1,"strong")(4,J1,2,1,"span"),a.k0s()}if(2&y){const l=c.$implicit,w=a.XpG();a.R7$(3),a.vxM(l.did.uri===w.identity.did?3:4)}}function $p(y,c){1&y&&(a.j41(0,"div",45),a.nrm(1,"app-player-controls"),a.k0s())}let W_=(()=>{class y{constructor(){var l=this;this.breakpointObserver=(0,a.WQX)(Fr.QP),this.localStorage=(0,a.WQX)(_i.s),this.storage=(0,a.WQX)(oS.n),this.identity=(0,a.WQX)(g.K),this.updateService=(0,a.WQX)(Io),this.profileService=(0,a.WQX)(Ma.p),this.app=(0,a.WQX)(m.d),this.layout=(0,a.WQX)(S.Y),this.admin=(0,a.WQX)(Iy.z),this.navigation=(0,a.WQX)(Tt.o),this.notification=(0,a.WQX)(AD.J),this.dialog=(0,a.WQX)(j.bZ),this.router=(0,a.WQX)(x.Ix),this.rootRoutes=he.filter(w=>w.path).filter(w=>w.data&&1!=w.data.hide),this.isHandset$=this.breakpointObserver.observe("(max-width: 700px)").pipe((0,Dt.T)(w=>w.matches),(0,bn.t)()),this.notifications=(0,a.vPA)([]),this.showInstallButton=!1,this.collapsed=(0,a.vPA)(!1),(0,a.QZP)((0,B.A)(function*(){l.app.initialized()&&(yield l.loadNotifications())}))}installPWA(){this.showInstallButton=!1,this.deferredPrompt.prompt(),this.deferredPrompt.userChoice.then(l=>{"accepted"===l.outcome?console.log("User accepted the install prompt"):console.log("User dismissed the install prompt"),this.deferredPrompt=null})}ngOnInit(){var l=this;return(0,B.A)(function*(){window.addEventListener("beforeinstallprompt",w=>{w.preventDefault(),l.deferredPrompt=w,l.showInstallButton=!0})})()}changeAccount(l){var w=this;return(0,B.A)(function*(){w.identity.changeAccount(l),w.router.navigate(["/introduction"])})()}loadNotifications(){var l=this;return(0,B.A)(function*(){const w=yield l.notification.load();l.notifications.set(w)})()}qrScan(){this.dialog.open(SD,{data:{did:""},width:"100vw",height:"100vh"}).afterClosed().subscribe(w=>{w&&(console.log("The dialog was closed",w),this.layout.toggleSearch(),this.router.navigate(["/profile",w]))})}onSearchInput(l){null!==l.target.value?(clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{console.log("Handle search called!"),this.handleSearch(l.target.value)},750)):clearTimeout(this.debounceTimer)}handleSearch(l){l&&(l.includes(":")?this.router.navigate(["/profile",l]):this.router.navigate(["/search"],{queryParams:{query:l}}))}showQR(l){this.dialog.open(va.k,{data:{did:l}})}wipe(){var l=this;return(0,B.A)(function*(){return l.app.wipe()})()}applyUpdate(){this.updateService.applyUpdate()}lock(){var l=this;return(0,B.A)(function*(){return l.app.lock()})()}navigateBack(){this.navigation.back()}collapseToggle(){this.collapsed.set(!this.collapsed())}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-layout"]],standalone:!0,features:[a.aNF],ngContentSelectors:Lm,decls:142,vars:66,consts:[["drawer",""],["menuNotifications","matMenu"],["menu","matMenu"],["menuAccounts","matMenu"],["menuLanguages","matMenu"],["link","routerLinkActive"],["id","title-bar",1,"title-bar",3,"ngClass"],["height","24","width","24","src","ariton-icon-dark.svg",1,"logo-icon-title-bar"],[3,"miniplayer"],["autosize","",1,"sidenav-container"],["fixedInViewport","",1,"sidenav",3,"ngClass","mode","opened"],[1,"toolbar-logo-container"],["src","ariton-icon-dark.svg",1,"toolbar-logo",3,"routerLink"],[1,"toolbar-text"],["srcset","ariton-text-light.svg","media","(prefers-color-scheme: dark)"],["src","ariton-text-dark.svg"],["mat-list-item","","routerLinkActive","",3,"routerLink","activated"],[3,"click"],["matListItemIcon",""],[1,"main-toolbar"],["type","button","aria-label","Toggle sidenav","mat-icon-button",""],["mat-icon-button",""],["mat-icon-button","",3,"title"],[1,"toolbar-spacer"],["type","search",1,"search-input",3,"ngModel"],[1,"toolbar-items"],["mat-icon-button","",3,"click"],["matTooltip","Update available. Click to update now.","mat-icon-button",""],["mat-icon-button","",1,"notification-toolbar",3,"matTooltip"],["mat-icon-button","",1,"notification-toolbar",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"routerLink"],["mat-icon-button","",1,"toolbar-profile-button",3,"matMenuTriggerFor"],["mat-icon-button","",3,"matMenuTriggerFor"],[1,"account-menu-profile",3,"routerLink"],["onerror","this.src='/avatar-placeholder.png';this.onerror='';",1,"account-menu-profile-icon",3,"src"],["mat-menu-item","",1,"account-menu-item",3,"routerLink"],["mat-menu-item","",3,"matMenuTriggerFor"],["mat-menu-item","",1,"notification-menu"],["mat-menu-item","",1,"notification-menu",3,"routerLink"],["href","https://help.ariton.app","target","_blank","mat-menu-item",""],["mat-menu-item",""],["mat-menu-item","",3,"disabled"],[1,"sidenav-scroll-wrapper",3,"ngClass"],["id","sidenav-content",3,"ngClass"],[1,"player"],["type","button","aria-label","Toggle sidenav","mat-icon-button","",3,"click"],["aria-label","Side nav toggle icon"],["mat-icon-button","",3,"click","title"],["type","search",1,"search-input",3,"ngModelChange","input","ngModel"],["matTooltip","Update available. Click to update now.","mat-icon-button","",3,"click"],["mat-icon-button","",1,"notification-toolbar",3,"click","matTooltip"],[1,"notification-details","dimmed"],["onerror","this.src='/avatar-placeholder.png';this.onerror='';",1,"toolbar-profile-icon",3,"src"],["mat-menu-item","",1,"notification-menu",3,"click"]],template:function(w,U){if(1&w){const J=a.RV6();a.NAR(),a.j41(0,"div",6),a.nrm(1,"img",7)(2,"app-player-controls",8),a.k0s(),a.j41(3,"mat-sidenav-container",9)(4,"mat-sidenav",10,0),a.nI1(6,"async"),a.nI1(7,"async"),a.nI1(8,"async"),a.j41(9,"mat-toolbar",11),a.nrm(10,"img",12),a.j41(11,"picture",13),a.nrm(12,"source",14),a.DNE(13,$0,1,0,"img",15),a.k0s()(),a.j41(14,"mat-nav-list"),a.DNE(15,DD,5,4,"a",16),a.Z7z(16,Ry,5,4,"a",16,a.Vm6),a.j41(18,"mat-list-item",17),a.bIt("click",function(){return a.eBV(J),a.Njj(U.collapseToggle())}),a.DNE(19,ky,2,0,"mat-icon",18)(20,Y1,2,0,"mat-icon",18),a.k0s()()(),a.j41(21,"mat-sidenav-content")(22,"mat-toolbar",19),a.DNE(23,z0,3,0,"button",20),a.nI1(24,"async"),a.DNE(25,K0,3,0,"button",21),a.Z7z(26,$_,3,2,"button",22,a.fX1),a.j41(28,"span",23),a.DNE(29,By,1,1,"input",24),a.k0s(),a.j41(30,"span",25),a.DNE(31,H0,3,0,"button",21),a.j41(32,"button",26),a.bIt("click",function(){return a.eBV(J),a.Njj(U.layout.toggleSearch())}),a.DNE(33,Fy,2,0,"mat-icon")(34,Up,2,0,"mat-icon"),a.k0s(),a.DNE(35,V_,3,0,"button",27)(36,sS,3,1,"button",28),a.j41(37,"button",29)(38,"mat-icon"),a.EFF(39,"notifications"),a.k0s()(),a.j41(40,"mat-menu",null,1)(42,"button",30),a.bIt("click",function(){return a.eBV(J),a.Njj(U.wipe())}),a.j41(43,"mat-icon"),a.EFF(44,"delete"),a.k0s(),a.j41(45,"span"),a.EFF(46,"Reset All Data (Wipe)"),a.k0s()(),a.nrm(47,"mat-divider"),a.j41(48,"button",31)(49,"mat-icon"),a.EFF(50,"settings"),a.k0s(),a.j41(51,"span"),a.EFF(52,"Notification Settings"),a.k0s()(),a.nrm(53,"mat-divider"),a.Z7z(54,aS,8,8,"button",31,a.fX1),a.k0s(),a.DNE(56,cS,3,4,"button",32)(57,z_,3,1,"button",33),a.j41(58,"mat-menu",null,2)(60,"div",34),a.nrm(61,"img",35),a.nI1(62,"safeResourceUrl"),a.j41(63,"div"),a.DNE(64,jm,8,6)(65,K_,2,3),a.k0s()(),a.j41(66,"button",36)(67,"mat-icon"),a.EFF(68,"account_circle"),a.k0s(),a.j41(69,"span"),a.EFF(70,"Edit Profile"),a.k0s()(),a.j41(71,"button",30),a.bIt("click",function(){return a.eBV(J),a.Njj(U.showQR(U.identity.did))}),a.j41(72,"mat-icon"),a.EFF(73,"qr_code"),a.k0s(),a.j41(74,"span"),a.EFF(75,"Show QR"),a.k0s()(),a.nrm(76,"mat-divider"),a.j41(77,"button",37)(78,"mat-icon"),a.EFF(79,"switch_account"),a.k0s(),a.j41(80,"span"),a.EFF(81,"Accounts"),a.k0s()(),a.j41(82,"button",30),a.bIt("click",function(){return a.eBV(J),a.Njj(U.lock())}),a.j41(83,"mat-icon"),a.EFF(84,"lock"),a.k0s(),a.j41(85,"span"),a.EFF(86,"Lock account"),a.k0s()(),a.nrm(87,"mat-divider"),a.j41(88,"button",37)(89,"mat-icon"),a.EFF(90,"translate"),a.k0s(),a.j41(91,"span"),a.EFF(92,"Language: English"),a.k0s()(),a.nrm(93,"mat-divider"),a.DNE(94,ID,5,0,"button",38),a.j41(95,"button",39)(96,"mat-icon"),a.EFF(97,"notifications"),a.k0s(),a.j41(98,"span"),a.EFF(99,"Notifications"),a.k0s()(),a.j41(100,"button",31)(101,"mat-icon"),a.EFF(102,"settings"),a.k0s(),a.j41(103,"span"),a.EFF(104,"Settings"),a.k0s()(),a.nrm(105,"mat-divider"),a.j41(106,"a",40)(107,"mat-icon"),a.EFF(108,"help"),a.k0s(),a.j41(109,"span"),a.EFF(110,"Help"),a.k0s()()(),a.j41(111,"mat-menu",null,3)(113,"button",31)(114,"mat-icon"),a.EFF(115,"manage_accounts"),a.k0s(),a.j41(116,"span"),a.EFF(117,"Manage"),a.k0s()(),a.nrm(118,"mat-divider"),a.Z7z(119,H_,5,1,"button",41,a.fX1),a.nrm(121,"mat-divider"),a.j41(122,"button",31)(123,"mat-icon"),a.EFF(124,"person_add"),a.k0s(),a.j41(125,"span"),a.EFF(126,"Add account"),a.k0s()()(),a.j41(127,"mat-menu",null,4)(129,"button",41)(130,"span"),a.EFF(131,"English"),a.k0s()(),a.j41(132,"button",42)(133,"span"),a.EFF(134,"Norwegian"),a.k0s()(),a.j41(135,"button",42)(136,"span"),a.EFF(137,"Serbian"),a.k0s()()()()(),a.j41(138,"div",43)(139,"div",44),a.SdG(140),a.k0s()(),a.DNE(141,$p,2,0,"div",45),a.k0s()()}if(2&w){const J=a.sdS(41),ce=a.sdS(112),ge=a.sdS(128);a.Y8G("ngClass",a.eq3(46,j_,U.collapsed())),a.R7$(2),a.Y8G("miniplayer",!0),a.R7$(2),a.Y8G("ngClass",a.eq3(48,Z1,U.collapsed()))("mode",a.bMT(6,36,U.isHandset$)?"over":"side")("opened",!1===a.bMT(7,38,U.isHandset$)),a.BMQ("role",a.bMT(8,40,U.isHandset$)?"dialog":"navigation"),a.R7$(6),a.Y8G("routerLink",a.lJ4(50,U_)),a.R7$(3),a.vxM(U.collapsed()?-1:13),a.R7$(2),a.vxM(U.admin.isAdmin(U.identity.did)?15:-1),a.R7$(),a.Dyx(U.rootRoutes),a.R7$(3),a.vxM(U.collapsed()?19:20),a.R7$(4),a.vxM(a.bMT(24,42,U.isHandset$)?23:-1),a.R7$(2),a.vxM(U.layout.navigation()?25:-1),a.R7$(),a.Dyx(U.layout.actions()),a.R7$(3),a.vxM(U.layout.search()?29:-1),a.R7$(2),a.vxM(U.layout.search()?31:-1),a.R7$(2),a.vxM(U.layout.search()?33:34),a.R7$(2),a.vxM(U.updateService.isNewVersionAvailable?35:-1),a.R7$(),a.vxM(U.showInstallButton?36:-1),a.R7$(),a.Y8G("matMenuTriggerFor",J),a.R7$(11),a.Y8G("routerLink",a.lJ4(51,up)),a.R7$(6),a.Dyx(U.notifications()),a.R7$(2),a.vxM(U.profileService.avatar()?56:57),a.R7$(4),a.Y8G("routerLink",a.eq3(52,U0,U.identity.did)),a.R7$(),a.Y8G("src",a.bMT(62,44,U.profileService.avatar()),a.B4B),a.R7$(3),a.vxM(U.profileService.current()?64:65),a.R7$(2),a.Y8G("routerLink",a.eq3(54,pl,U.identity.did)),a.R7$(11),a.Y8G("matMenuTriggerFor",ce),a.R7$(11),a.Y8G("matMenuTriggerFor",ge),a.R7$(6),a.vxM(U.showInstallButton?94:-1),a.R7$(),a.Y8G("routerLink",a.lJ4(56,Eu)),a.R7$(5),a.Y8G("routerLink",a.lJ4(57,wd)),a.R7$(13),a.Y8G("routerLink",a.lJ4(58,Ty)),a.R7$(6),a.Dyx(U.identity.identities),a.R7$(3),a.Y8G("routerLink",a.lJ4(59,jo)),a.R7$(10),a.Y8G("disabled",!0),a.R7$(3),a.Y8G("disabled",!0),a.R7$(3),a.Y8G("ngClass",a.eq3(60,Qa,U.layout.tray())),a.R7$(),a.Y8G("ngClass",a.sMw(62,Py,U.layout.margin(),!U.layout.margin(),U.layout.custom())),a.R7$(2),a.vxM(U.layout.tray()?141:-1)}},dependencies:[j.hM,nS,M.YN,M.me,M.BC,M.vS,V.RG,k.fS,R.MD,R.YU,R.Jj,Os.d,Qe.s5,Qe.KQ,_.Hl,_.iY,pn,hr,Or,Jt,q.Fg,q._L,q.YE,q.ZV,My.q,P.m_,P.An,z.Cn,z.kk,z.fb,z.Cp,x.Wk,x.wQ,W.uc,W.oV,Mo.k,re.g,L_],styles:[".toolbar-logo[_ngcontent-%COMP%]{max-height:40px;max-width:40px;width:100%;cursor:pointer}.player[_ngcontent-%COMP%]{height:96px}.account-menu-profile[_ngcontent-%COMP%]{color:var(--mat-menu-item-label-text-color);display:flex;gap:8px;margin:8px;align-items:center;cursor:pointer}.account-menu-profile[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;padding:0}.account-menu-profile-icon[_ngcontent-%COMP%]{width:64px;border-radius:50%}.toolbar-profile-button[_ngcontent-%COMP%]{padding:0}.toolbar-profile-icon[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:50%}.account-menu-profile[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex-grow:2}.toolbar-text[_ngcontent-%COMP%]{margin-left:.3em;margin-top:.5em;width:100px;height:32px}.sidenav-container[_ngcontent-%COMP%]{height:100%}.mat-toolbar.mat-primary[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1}.sidenav-scroll-wrapper[_ngcontent-%COMP%]{height:calc(100dvh - 80px - env(titlebar-area-height,0px));overflow:auto;border-radius:16px;box-sizing:border-box}.sidenav-scroll-wrapper-tray[_ngcontent-%COMP%]{height:calc(100dvh - 192px - env(titlebar-area-height,0px))}.sidenav-content[_ngcontent-%COMP%], .sidenav-content-marginless[_ngcontent-%COMP%]{max-height:100%;overflow-y:auto;padding:16px;box-sizing:border-box}.sidenav-content-marginless[_ngcontent-%COMP%]{padding:0}.sidenav-content-custom[_ngcontent-%COMP%]{height:100%;overflow:hidden!important}.column-content[_ngcontent-%COMP%]{overflow-y:scroll;box-sizing:border-box}.sidenav[_ngcontent-%COMP%]{width:200px;padding:0 8px;box-sizing:border-box}.sidenav-collapsed[_ngcontent-%COMP%]{width:72px}@media (max-width: 959.98px){.sidenav-scroll-wrapper[_ngcontent-%COMP%]{height:calc(100dvh - 64px - env(titlebar-area-height,0px))}.sidenav-scroll-wrapper-tray[_ngcontent-%COMP%]{height:calc(100dvh - 160px - env(titlebar-area-height,0px))}.sidenav-content[_ngcontent-%COMP%]{padding:8px}.sidenav-content-marginless[_ngcontent-%COMP%]{padding:0}}.notification-menu[_ngcontent-%COMP%]{display:none}@media (max-width: 420px){.notification-toolbar[_ngcontent-%COMP%]{display:none}.notification-menu[_ngcontent-%COMP%]{display:flex}}.title-bar[_ngcontent-%COMP%]{display:none}@media (display-mode: window-controls-overlay){.title-bar[_ngcontent-%COMP%]{-webkit-app-region:drag;flex:0 0 33px;display:flex;flex-direction:row;position:fixed;left:210px;top:env(titlebar-area-y,0);height:env(titlebar-area-height,33px);width:env(titlebar-area-width,100%);width:calc(env(titlebar-area-width,100%) - 210px);z-index:10000}mat-sidenav-content[_ngcontent-%COMP%]{padding-top:env(titlebar-area-height,0px)}}.title-bar-collapsed[_ngcontent-%COMP%]{left:80px!important;width:calc(env(titlebar-area-width,100%) - 80px)}.toolbar-logo-container[_ngcontent-%COMP%]{-webkit-app-region:drag}.logo-icon[_ngcontent-%COMP%]{cursor:pointer;-webkit-app-region:drag;margin-right:.4em}.logo-icon-title-bar[_ngcontent-%COMP%]{cursor:pointer;-webkit-app-region:drag;margin:4px 2em 4px 4px;display:none;flex:0 0 24px}@media screen and (max-height: 100px){.logo-icon-title-bar[_ngcontent-%COMP%]{display:inline}.logo-icon[_ngcontent-%COMP%]{display:none}.title-bar[_ngcontent-%COMP%]{left:0!important}.sidenav[_ngcontent-%COMP%], .main-toolbar[_ngcontent-%COMP%], mat-sidenav-content[_ngcontent-%COMP%]{display:none!important}}@media screen and (max-width: 599px){.logo-icon-title-bar[_ngcontent-%COMP%]{display:inline}}"]})}}return y})();var G0=f(9183);function Q1(y,c){1&y&&a.nrm(0,"mat-spinner",4)}function lS(y,c){1&y&&(a.j41(0,"span"),a.EFF(1,"Unlock"),a.k0s())}function q1(y,c){1&y&&(a.j41(0,"mat-error"),a.EFF(1,"Password is "),a.j41(2,"strong"),a.EFF(3,"invalid"),a.k0s()())}let G_=(()=>{class y{constructor(l){this.identityService=l,this.passwordInput=new M.MJ("",M.k0.required),this.unlocking=(0,a.vPA)(!1),this.invalidPassword=(0,a.vPA)(!1)}onSubmit(){var l=this;return(0,B.A)(function*(){l.unlocking.set(!0),l.passwordInput.disable(),(yield l.identityService.unlock(l.identityService.did,l.passwordInput.value))?(console.log("Vault unlocked"),l.invalidPassword.set(!1)):(console.log("Failed to unlock vault"),l.invalidPassword.set(!0),l.unlocking.set(!1),l.passwordInput.enable())})()}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(g.K))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-unlock"]],standalone:!0,features:[a.aNF],decls:18,vars:4,consts:[["src","ariton-icon-dark.svg",1,"unlock-logo"],[3,"ngSubmit"],["matInput","","type","password",3,"formControl"],["mat-flat-button","","type","submit","color","primary",3,"disabled"],["diameter","20"]],template:function(w,U){1&w&&(a.nrm(0,"img",0),a.j41(1,"h1"),a.EFF(2,"Unlock your account"),a.k0s(),a.j41(3,"p"),a.EFF(4," You have configured your Ariton account with a secure personal password."),a.nrm(5,"br"),a.EFF(6,"Enter password to unlock your account.\n"),a.k0s(),a.j41(7,"form",1),a.bIt("ngSubmit",function(){return U.onSubmit()}),a.j41(8,"mat-form-field")(9,"mat-label"),a.EFF(10,"Enter your password"),a.k0s(),a.nrm(11,"input",2),a.k0s(),a.EFF(12," \xa0 "),a.j41(13,"button",3),a.DNE(14,Q1,1,0,"mat-spinner",4)(15,lS,2,0,"span"),a.k0s(),a.j41(16,"p"),a.DNE(17,q1,4,0,"mat-error"),a.k0s()()),2&w&&(a.R7$(11),a.Y8G("formControl",U.passwordInput),a.R7$(2),a.Y8G("disabled",!(U.passwordInput.valid&&!U.unlocking())),a.R7$(),a.vxM(U.unlocking()?14:15),a.R7$(3),a.vxM(U.invalidPassword()?17:-1))},dependencies:[M.YN,M.qT,M.me,M.BC,M.cb,M.cV,G0.D6,G0.LG,M.X1,M.l_,V.RG,V.rl,V.nJ,V.TL,k.fS,k.fg,_.Hl,_.$z,P.m_],styles:["button[_ngcontent-%COMP%]{width:100px}.unlock-logo[_ngcontent-%COMP%]{max-width:200px}"]})}}return y})();var eb=f(33065);function Um(y,c){1&y&&(a.j41(0,"p"),a.EFF(1,"Starting Ariton..."),a.k0s())}function X_(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",7),a.bIt("click",function(){a.eBV(l);const U=a.XpG(3);return a.Njj(U.back())}),a.EFF(1,"Back"),a.k0s()}if(2&y){const l=a.XpG(3);a.Y8G("disabled",l.appService.loading())}}function Ny(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",8),a.bIt("click",function(){a.eBV(l);const U=a.XpG(3);return a.Njj(U.createAccount())}),a.EFF(1,"Create a new account"),a.k0s(),a.j41(2,"button",7),a.bIt("click",function(){a.eBV(l);const U=a.XpG(3);return a.Njj(U.restoreAccount())}),a.EFF(3,"Restore existing account"),a.k0s()}if(2&y){const l=a.XpG(3);a.Y8G("disabled",l.appService.loading()),a.R7$(2),a.Y8G("disabled",l.appService.loading())}}function ad(y,c){1&y&&a.nrm(0,"app-restore")}function X0(y,c){if(1&y&&(a.j41(0,"div",2),a.DNE(1,X_,2,1,"button",6)(2,Ny,4,2)(3,ad,1,0,"app-restore"),a.k0s()),2&y){const l=a.XpG(2);a.R7$(),a.vxM(l.restore()?1:2),a.R7$(2),a.vxM(l.restore()?3:-1)}}function Z_(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",3),a.nrm(1,"app-unlock"),a.j41(2,"p"),a.EFF(3," Issues? "),a.j41(4,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.forceClose())}),a.EFF(5,"Close loading sceen"),a.k0s(),a.EFF(6," or "),a.j41(7,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.wipe())}),a.EFF(8,"Reset All Data (Wipe)"),a.k0s()()()}}function Ly(y,c){1&y&&(a.j41(0,"p"),a.EFF(1,"Starting Ariton..."),a.k0s())}function uS(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",4)(1,"h1"),a.EFF(2,"Error during initialization. Offline?"),a.k0s(),a.j41(3,"p"),a.EFF(4,"You must be online to create your account."),a.nrm(5,"br"),a.EFF(6,"Please verify network connection and try again."),a.k0s(),a.j41(7,"p")(8,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.reload())}),a.EFF(9,"Reload"),a.k0s()()()}}function Y_(y,c){1&y&&a.nrm(0,"mat-spinner")}function tb(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",0),a.nrm(1,"img",1),a.DNE(2,Um,2,0,"p")(3,X0,4,2,"div",2)(4,Z_,9,0,"div",3)(5,Ly,2,0,"p")(6,uS,10,0,"div",4)(7,Y_,1,0,"mat-spinner"),a.j41(8,"p"),a.EFF(9," Issues? "),a.j41(10,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.forceClose())}),a.EFF(11,"Close loading sceen"),a.k0s(),a.EFF(12," or "),a.j41(13,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.wipe())}),a.EFF(14,"Reset All Data (Wipe)"),a.k0s()()()}if(2&y){let l;const w=a.XpG();a.R7$(2),a.vxM(0===(l=w.appService.onboardingState())?2:1===l?3:2===l?4:3===l?5:4===l?6:-1),a.R7$(5),a.vxM(w.appService.loading()?7:-1)}}(0,i.B8)((()=>{class y{constructor(l,w,U){this.router=l,this.layout=w,this.identityService=U,this.title="app",this.appService=(0,a.WQX)(m.d),this.previousUrl="",this.restore=(0,a.vPA)(!1);const J=globalThis.location.search;if(J){const ce=Object.fromEntries(new URLSearchParams(J));this.appService.params=ce}console.log("queryParam:",J),console.log("this.appService.params:",this.appService.params),(0,a.QZP)(()=>{this.appService.initialized()&&console.log("App has been initialized!!!!")})}forceClose(){this.appService.onboardingState.set(m.f.Unlocked),this.appService.initialized.set(!0)}wipe(){var l=this;return(0,B.A)(function*(){return l.appService.wipe()})()}restoreAccount(){var l=this;return(0,B.A)(function*(){l.restore.set(!0)})()}back(){this.restore.set(!1)}createAccount(){var l=this;return(0,B.A)(function*(){console.log("Creating new account..."),yield l.appService.createAccount(),l.router.navigate([l.appService.state().loginAction])})()}reload(){document.location=document.location}ngOnInit(){var l=this;return(0,B.A)(function*(){yield l.appService.initialize()})()}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(x.Ix),a.rXU(S.Y),a.rXU(g.K))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-root"]],standalone:!0,features:[a.Jv_([{provide:V.U$,useValue:{appearance:"outline"}}]),a.aNF],decls:3,vars:1,consts:[[1,"loading-container"],["src","ariton-icon-dark.svg",1,"loading-logo"],[1,"new-user-actions"],[1,"unlock-container"],[1,"loading-error"],["mat-button","",3,"click"],["mat-button","",3,"disabled"],["mat-button","",3,"click","disabled"],["mat-flat-button","",3,"click","disabled"]],template:function(w,U){1&w&&(a.DNE(0,tb,15,2,"div",0),a.j41(1,"app-layout"),a.nrm(2,"router-outlet"),a.k0s()),2&w&&a.vxM(U.appService.initialized()?-1:0)},dependencies:[eb.RestoreComponent,_.Hl,_.$z,G0.D6,G0.LG,x.n3,W_,G_],styles:[".unlock-container[_ngcontent-%COMP%]{background-color:var(--mat-app-background-color);color:var(--mat-app-text-color);padding:2em;position:absolute;box-sizing:border-box;width:100%;inset:0;z-index:1000;display:flex;justify-content:center;align-items:center;align-content:center;text-align:center;flex-direction:column}.loading-container[_ngcontent-%COMP%]{-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);color:var(--mat-app-text-color);padding:2em;position:absolute;box-sizing:border-box;width:100%;inset:0;z-index:1001;display:flex;flex-direction:column;align-items:center;justify-content:center}.loading-logo[_ngcontent-%COMP%]{max-width:96px;position:absolute;right:1em;bottom:1em}mat-spinner[_ngcontent-%COMP%]{margin:2em}.new-user-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-right:1em;margin-bottom:1em}"]})}}return y})(),ur).catch(y=>console.error(y))},49245:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://anyone-collaborate-protocol.xyz",published:!0,types:{doc:{}},structure:{doc:{$actions:[{who:"anyone",can:["read","co-update","co-delete"]}]}}}},62060:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/chat",published:!0,types:{message:{schema:"https://schema.ariton.app/chat/message",dataFormats:["application/json"]}},structure:{message:{$actions:[{who:"anyone",can:["create","update"]},{who:"author",of:"message",can:["read"]},{who:"recipient",of:"message",can:["read"]}]}}}},77949:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/community",published:!0,types:{community:{schema:"https://schema.ariton.app/community/schema/community",dataFormats:["application/json"]},album:{schema:"https://schema.ariton.app/community/schema/album",dataFormats:["text/plain"]},photo:{schema:"https://schema.ariton.app/community/schema/photo",dataFormats:["text/plain"]},friend:{schema:"https://schema.ariton.app/community/schema/friend",dataFormats:["text/plain"]},participant:{schema:"https://schema.ariton.app/community/schema/participant",dataFormats:["text/plain"]},updater:{schema:"https://schema.ariton.app/community/schema/updater",dataFormats:["text/plain"]},globalAdmin:{schema:"https://schema.ariton.app/community/schema/globalAdmin",dataFormats:["application/json"]},admin:{schema:"https://schema.ariton.app/community/schema/admin",dataFormats:["application/json"]}},structure:{globalAdmin:{$role:!0},friend:{$role:!0},community:{$actions:[{role:"globalAdmin",can:["create","update"]}],admin:{$role:!0,$actions:[{role:"globalAdmin",can:["create","update"]}]}}}}},68530:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/connections",published:!0,types:{request:{schema:"https://schema.ariton.app/connections/schema/request",dataFormats:["application/json"]},connection:{schema:"https://schema.ariton.app/connections/schema/connection",dataFormats:["application/json"]},block:{schema:"https://schema.ariton.app/connect/schema/block",dataFormats:["application/json"]}},structure:{block:{},connection:{},request:{$size:{max:3e3},$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]}}}},32794:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/data",published:!0,types:{data:{schema:"https://schema.ariton.app/data/schema/data",dataFormats:["application/json"]}},structure:{data:{}}}},97372:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/file",published:!0,types:{entry:{schema:"https://schema.ariton.app/file/schema/entry"},collaborator:{schema:"https://schema.ariton.app/file/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}}}}},67136:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://free-for-all-protocol.xyz",published:!0,types:{post:{schema:"eph",dataFormats:["application/json"]},attachment:{}},structure:{post:{$actions:[{who:"anyone",can:["create","update","delete","prune","read","co-delete","co-prune"]}],attachment:{$actions:[{who:"anyone",can:["create","update","delete","read","co-delete"]}]}}}}},22312:(Me,F,f)=>{"use strict";f.d(F,{Aq:()=>M,ME:()=>g,eE:()=>S,iU:()=>_,u5:()=>R});var i=f(4053),a=f(77949),B=(f(45189),f(2685)),m=f(69371);const S={format:"application/vc+jwt",friendship:"FriendshipCredential"},g={uri:i.Q.protocol,definition:i.Q},R={uri:B.Q.protocol,definition:B.Q},M={uri:a.Q.protocol,definition:a.Q},_={uri:m.Q.protocol,definition:m.Q}},69371:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/message",published:!0,types:{message:{schema:"https://schema.ariton.app/message/schema/message",dataFormats:["application/json"]},writer:{schema:"https://schema.ariton.app/message/schema/writer",dataFormats:["application/json"]},request:{schema:"https://schema.ariton.app/message/schema/request",dataFormats:["application/json"]},credential:{schema:"https://schema.ariton.app/message/schema/credential",dataFormats:["application/json"]}},structure:{writer:{$role:!0},message:{$actions:[{role:"writer",can:["create","update"]},{who:"author",of:"message",can:["read"]},{who:"recipient",of:"message",can:["read"]}]},request:{$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]},credential:{$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]}}}},1639:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://minimal.xyz",published:!1,types:{foo:{}},structure:{foo:{}}}},69314:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/note",published:!0,types:{note:{schema:"https://schema.ariton.app/note/schema/note",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/note/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},note:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}},5397:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/notification",published:!0,types:{event:{schema:"https://schema.ariton.app/notification/schema/event",dataFormats:["application/json"]}},structure:{event:{}}}},29508:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/post",published:!0,types:{post:{schema:"https://schema.ariton.app/post/schema/post",dataFormats:["application/json"]}},structure:{post:{}}}},4053:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={published:!0,protocol:"https://schema.ariton.app/profile",types:{profile:{schema:"https://schema.ariton.app/profile/schema/profile",dataFormats:["application/json"]},bio:{dataFormats:["application/json"]},status:{dataFormats:["application/json"]},location:{dataFormats:["application/json"]},birthDate:{dataFormats:["application/json"]},social:{dataFormats:["application/json"]},messaging:{dataFormats:["application/json"]},phone:{dataFormats:["application/json"]},address:{dataFormats:["application/json"]},career:{dataFormats:["application/json"]},payment:{dataFormats:["application/json"]},avatar:{dataFormats:["image/gif","image/png","image/jpeg"]},hero:{dataFormats:["image/gif","image/png","image/jpeg"]}},structure:{profile:{$actions:[{who:"anyone",can:["read"]}]},bio:{},status:{},location:{},birthDate:{},social:{},career:{},avatar:{$actions:[{who:"anyone",can:["read"]}]},hero:{$actions:[{who:"anyone",can:["read"]}]},messaging:{},address:{},phone:{},payment:{}}}},2685:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={published:!0,protocol:"https://schema.ariton.app/registry/entry",types:{profile:{dataFormats:["application/json"]},avatar:{dataFormats:["image/gif","image/png","image/jpeg"]},hero:{dataFormats:["image/gif","image/png","image/jpeg"]},admin:{schema:"https://schema.ariton.app/name/admin",dataFormats:["application/json"]}},structure:{admin:{$role:!0},profile:{$actions:[{role:"admin",can:["create","read","update","query","subscribe","co-update","co-delete"]}]},avatar:{},hero:{}}}},45189:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://social-media.xyz",published:!0,types:{post:{schema:"https://social-media.xyz/schemas/postSchema",dataFormats:["text/plain"]},reply:{schema:"https://social-media.xyz/schemas/replySchema",dataFormats:["text/plain"]},image:{dataFormats:["image/jpeg"]},caption:{schema:"https://social-media.xyz/schemas/captionSchema",dataFormats:["text/plain"]}},structure:{post:{$actions:[{who:"anyone",can:["create","read"]}],reply:{$actions:[{who:"recipient",of:"post",can:["create"]},{who:"author",of:"post",can:["create"]}]}},image:{$actions:[{who:"anyone",can:["create","read"]}],caption:{$actions:[{who:"anyone",can:["read"]},{who:"author",of:"image",can:["create"]}]},reply:{$actions:[{who:"author",of:"image",can:["read"]},{who:"recipient",of:"image",can:["create"]}]}}}}},50963:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/task",published:!0,types:{list:{schema:"https://schema.ariton.app/task/list",dataFormats:["application/json"]},task:{schema:"https://schema.ariton.app/task/task",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/task/collaborator",dataFormats:["application/json"]}},structure:{list:{collaborator:{$role:!0},$actions:[{role:"list/collaborator",can:["read","query","subscribe"]}],task:{$actions:[{role:"list/collaborator",can:["create","read","update","query","subscribe","co-update","co-delete"]}]}}}}},70669:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/text",published:!0,types:{entry:{schema:"https://schema.ariton.app/text/schema/entry",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/text/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}}}}},4521:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.createCurve=F.getHash=void 0;const i=f(44882),a=f(96492),x=f(73040);function B(S){return{hash:S,hmac:(g,...E)=>(0,i.hmac)(S,g,(0,a.concatBytes)(...E)),randomBytes:a.randomBytes}}F.getHash=B,F.createCurve=function m(S,g){const E=R=>(0,x.weierstrass)({...S,...B(R)});return Object.freeze({...E(g),create:E})}},25299:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateBasic=F.wNAF=void 0;const i=f(63834),a=f(84097),x=BigInt(0),B=BigInt(1);F.wNAF=function m(g,E){const R=(_,j)=>{const P=j.negate();return _?P:j},M=_=>({windows:Math.ceil(E/_)+1,windowSize:2**(_-1)});return{constTimeNegate:R,unsafeLadder(_,j){let P=g.ZERO,k=_;for(;j>x;)j&B&&(P=P.add(k)),k=k.double(),j>>=B;return P},precomputeWindow(_,j){const{windows:P,windowSize:k}=M(j),z=[];let W=_,V=W;for(let Z=0;Z>=re,ae>z&&(ae-=q,P+=B);const me=ie,ye=ie+Math.abs(ae)-1,K=ae<0;0===ae?V=V.add(R(te%2!=0,j[me])):W=W.add(R(K,j[ye]))}return{p:W,f:V}},wNAFCached(_,j,P,k){const z=_._WINDOW_SIZE||1;let W=j.get(_);return W||(W=this.precomputeWindow(_,z),1!==z&&j.set(_,k(W))),this.wNAF(z,W,P)}}},F.validateBasic=function S(g){return(0,i.validateField)(g.Fp),(0,a.validateObject)(g,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,i.nLength)(g.n,g.nBitLength),...g,p:g.Fp.ORDER})}},45068:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.twistedEdwards=void 0;const i=f(63834),a=f(84097),x=f(84097),B=f(25299),m=BigInt(0),S=BigInt(1),g=BigInt(2),E=BigInt(8),R={zip215:!0};F.twistedEdwards=function _(j){const P=function M(j){const P=(0,B.validateBasic)(j);return a.validateObject(j,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...P})}(j),{Fp:k,n:z,prehash:W,hash:V,randomBytes:Z,nByteLength:q,h:re}=P,te=g<{try{return{isValid:!0,value:k.sqrt(De*k.inv(Xe))}}catch{return{isValid:!1,value:m}}}),me=P.adjustScalarBytes||(De=>De),ye=P.domain||((De,Xe,Te)=>{if(Xe.length||Te)throw new Error("Contexts/pre-hash are not supported");return De}),ue=De=>"bigint"==typeof De&&mue(De)&&ue(Xe)&&DeDe===m||K(De,te);function h(De,Xe){if(K(De,Xe))return De;throw new Error(`Expected valid scalar < ${Xe}, got ${typeof De} ${De}`)}function A(De){return De===m?De:h(De,z)}const I=new Map;function O(De){if(!(De instanceof $))throw new Error("ExtendedPoint expected")}class ${constructor(Xe,Te,ke,Se){if(this.ex=Xe,this.ey=Te,this.ez=ke,this.et=Se,!o(Xe))throw new Error("x required");if(!o(Te))throw new Error("y required");if(!o(ke))throw new Error("z required");if(!o(Se))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(Xe){if(Xe instanceof $)throw new Error("extended point not allowed");const{x:Te,y:ke}=Xe||{};if(!o(Te)||!o(ke))throw new Error("invalid affine point");return new $(Te,ke,S,ie(Te*ke))}static normalizeZ(Xe){const Te=k.invertBatch(Xe.map(ke=>ke.ez));return Xe.map((ke,Se)=>ke.toAffine(Te[Se])).map($.fromAffine)}_setWindowSize(Xe){this._WINDOW_SIZE=Xe,I.delete(this)}assertValidity(){const{a:Xe,d:Te}=P;if(this.is0())throw new Error("bad point: ZERO");const{ex:ke,ey:Se,ez:Ee,et:ve}=this,Ce=ie(ke*ke),Re=ie(Se*Se),Ye=ie(Ee*Ee),$e=ie(Ye*Ye),nt=ie(Ce*Xe);if(ie(Ye*ie(nt+Re))!==ie($e+ie(Te*ie(Ce*Re))))throw new Error("bad point: equation left != right (1)");if(ie(ke*Se)!==ie(Ee*ve))throw new Error("bad point: equation left != right (2)")}equals(Xe){O(Xe);const{ex:Te,ey:ke,ez:Se}=this,{ex:Ee,ey:ve,ez:Ce}=Xe,Re=ie(Te*Ce),Ye=ie(Ee*Se),$e=ie(ke*Ce),nt=ie(ve*Se);return Re===Ye&&$e===nt}is0(){return this.equals($.ZERO)}negate(){return new $(ie(-this.ex),this.ey,this.ez,ie(-this.et))}double(){const{a:Xe}=P,{ex:Te,ey:ke,ez:Se}=this,Ee=ie(Te*Te),ve=ie(ke*ke),Ce=ie(g*ie(Se*Se)),Re=ie(Xe*Ee),Ye=Te+ke,$e=ie(ie(Ye*Ye)-Ee-ve),nt=Re+ve,Qe=nt-Ce,Tt=Re-ve,ct=ie($e*Qe),ze=ie(nt*Tt),St=ie($e*Tt),ne=ie(Qe*nt);return new $(ct,ze,ne,St)}add(Xe){O(Xe);const{a:Te,d:ke}=P,{ex:Se,ey:Ee,ez:ve,et:Ce}=this,{ex:Re,ey:Ye,ez:$e,et:nt}=Xe;if(Te===BigInt(-1)){const ot=ie((Ee-Se)*(Ye+Re)),Ft=ie((Ee+Se)*(Ye-Re)),wt=ie(Ft-ot);if(wt===m)return this.double();const zt=ie(ve*g*nt),rr=ie(Ce*g*$e),ar=rr+zt,lr=Ft+ot,hn=rr-zt,Wr=ie(ar*wt),vr=ie(lr*hn),Tr=ie(ar*hn),Ve=ie(wt*lr);return new $(Wr,vr,Ve,Tr)}const Qe=ie(Se*Re),Tt=ie(Ee*Ye),ct=ie(Ce*ke*nt),ze=ie(ve*$e),St=ie((Se+Ee)*(Re+Ye)-Qe-Tt),ne=ze-ct,X=ze+ct,G=ie(Tt-Te*Qe),he=ie(St*ne),_e=ie(X*G),je=ie(St*G),Ne=ie(ne*X);return new $(he,_e,Ne,je)}subtract(Xe){return this.add(Xe.negate())}wNAF(Xe){return s.wNAFCached(this,I,Xe,$.normalizeZ)}multiply(Xe){const{p:Te,f:ke}=this.wNAF(h(Xe,z));return $.normalizeZ([Te,ke])[0]}multiplyUnsafe(Xe){let Te=A(Xe);return Te===m?D:this.equals(D)||Te===S?this:this.equals(H)?this.wNAF(Te).p:s.unsafeLadder(this,Te)}isSmallOrder(){return this.multiplyUnsafe(re).is0()}isTorsionFree(){return s.unsafeLadder(this,z).is0()}toAffine(Xe){const{ex:Te,ey:ke,ez:Se}=this,Ee=this.is0();null==Xe&&(Xe=Ee?E:k.inv(Se));const ve=ie(Te*Xe),Ce=ie(ke*Xe),Re=ie(Se*Xe);if(Ee)return{x:m,y:S};if(Re!==S)throw new Error("invZ was invalid");return{x:ve,y:Ce}}clearCofactor(){const{h:Xe}=P;return Xe===S?this:this.multiplyUnsafe(Xe)}static fromHex(Xe,Te=!1){const{d:ke,a:Se}=P,Ee=k.BYTES,ve=(Xe=(0,x.ensureBytes)("pointHex",Xe,Ee)).slice(),Ce=Xe[Ee-1];ve[Ee-1]=-129&Ce;const Re=a.bytesToNumberLE(ve);Re===m||h(Re,Te?te:k.ORDER);const Ye=ie(Re*Re),$e=ie(Ye-S),nt=ie(ke*Ye-Se);let{isValid:Qe,value:Tt}=ae($e,nt);if(!Qe)throw new Error("Point.fromHex: invalid y coordinate");const ct=(Tt&S)===S,ze=!!(128&Ce);if(!Te&&Tt===m&&ze)throw new Error("Point.fromHex: x=0 and x_0=1");return ze!==ct&&(Tt=ie(-Tt)),$.fromAffine({x:Tt,y:Re})}static fromPrivateKey(Xe){return ee(Xe).point}toRawBytes(){const{x:Xe,y:Te}=this.toAffine(),ke=a.numberToBytesLE(Te,k.BYTES);return ke[ke.length-1]|=Xe&S?128:0,ke}toHex(){return a.bytesToHex(this.toRawBytes())}}$.BASE=new $(P.Gx,P.Gy,S,ie(P.Gx*P.Gy)),$.ZERO=new $(m,S,S,m);const{BASE:H,ZERO:D}=$,s=(0,B.wNAF)($,8*q);function p(De){return(0,i.mod)(De,z)}function Y(De){return p(a.bytesToNumberLE(De))}function ee(De){const Xe=q;De=(0,x.ensureBytes)("private key",De,Xe);const Te=(0,x.ensureBytes)("hashed private key",V(De),2*Xe),ke=me(Te.slice(0,Xe)),Se=Te.slice(Xe,2*Xe),Ee=Y(ke),ve=H.multiply(Ee),Ce=ve.toRawBytes();return{head:ke,prefix:Se,scalar:Ee,point:ve,pointBytes:Ce}}function de(De=new Uint8Array,...Xe){const Te=a.concatBytes(...Xe);return Y(V(ye(Te,(0,x.ensureBytes)("context",De),!!W)))}const Ie=R;return H._setWindowSize(8),{CURVE:P,getPublicKey:function oe(De){return ee(De).pointBytes},sign:function Ae(De,Xe,Te={}){De=(0,x.ensureBytes)("message",De),W&&(De=W(De));const{prefix:ke,scalar:Se,pointBytes:Ee}=ee(Xe),ve=de(Te.context,ke,De),Ce=H.multiply(ve).toRawBytes(),Ye=p(ve+de(Te.context,Ce,Ee,De)*Se);A(Ye);const $e=a.concatBytes(Ce,a.numberToBytesLE(Ye,k.BYTES));return(0,x.ensureBytes)("result",$e,2*q)},verify:function Le(De,Xe,Te,ke=Ie){const{context:Se,zip215:Ee}=ke,ve=k.BYTES;De=(0,x.ensureBytes)("signature",De,2*ve),Xe=(0,x.ensureBytes)("message",Xe),W&&(Xe=W(Xe));const Ce=a.bytesToNumberLE(De.slice(ve,2*ve));let Re,Ye,$e;try{Re=$.fromHex(Te,Ee),Ye=$.fromHex(De.slice(0,ve),Ee),$e=H.multiplyUnsafe(Ce)}catch{return!1}if(!Ee&&Re.isSmallOrder())return!1;const nt=de(Se,Ye.toRawBytes(),Re.toRawBytes(),Xe);return Ye.add(Re.multiplyUnsafe(nt)).subtract($e).clearCofactor().equals($.ZERO)},ExtendedPoint:$,utils:{getExtendedPublicKey:ee,randomPrivateKey:()=>Z(k.BYTES),precompute:(De=8,Xe=$.BASE)=>(Xe._setWindowSize(De),Xe.multiply(BigInt(3)),Xe)}}}},75752:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.createHasher=F.isogenyMap=F.hash_to_field=F.expand_message_xof=F.expand_message_xmd=void 0;const i=f(63834),a=f(84097),B=a.bytesToNumberBE;function m(k,z){if(k<0||k>=1<<8*z)throw new Error(`bad I2OSP call: value=${k} length=${z}`);const W=Array.from({length:z}).fill(0);for(let V=z-1;V>=0;V--)W[V]=255&k,k>>>=8;return new Uint8Array(W)}function S(k,z){const W=new Uint8Array(k.length);for(let V=0;V255&&(z=V((0,a.concatBytes)((0,a.utf8ToBytes)("H2C-OVERSIZE-DST-"),z)));const{outputLen:Z,blockLen:q}=V,re=Math.ceil(W/Z);if(re>255)throw new Error("Invalid xmd length");const te=(0,a.concatBytes)(z,m(z.length,1)),ie=m(0,q),ae=m(W,2),me=new Array(re),ye=V((0,a.concatBytes)(ie,k,ae,m(0,1),te));me[0]=V((0,a.concatBytes)(ye,m(1,1),te));for(let K=1;K<=re;K++){const o=[S(ye,me[K-1]),m(K+1,1),te];me[K]=V((0,a.concatBytes)(...o))}return(0,a.concatBytes)(...me).slice(0,W)}function M(k,z,W,V,Z){if(g(k),g(z),E(W),z.length>255){const q=Math.ceil(2*V/8);z=Z.create({dkLen:q}).update((0,a.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(z).digest()}if(W>65535||z.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return Z.create({dkLen:W}).update(k).update(m(W,2)).update(z).update(m(z.length,1)).digest()}function _(k,z,W){(0,a.validateObject)(W,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:V,k:Z,m:q,hash:re,expand:te,DST:ie}=W;g(k),E(z);const ae=function x(k){if((0,a.isBytes)(k))return k;if("string"==typeof k)return(0,a.utf8ToBytes)(k);throw new Error("DST must be Uint8Array or string")}(ie),me=V.toString(2).length,ye=Math.ceil((me+Z)/8),ue=z*q*ye;let K;if("xmd"===te)K=R(k,ae,ue,re);else if("xof"===te)K=M(k,ae,ue,Z,re);else{if("_internal_pass"!==te)throw new Error('expand must be "xmd" or "xof"');K=k}const o=new Array(z);for(let h=0;hArray.from(V).reverse());return(V,Z)=>{const[q,re,te,ie]=W.map(ae=>ae.reduce((me,ye)=>k.add(k.mul(me,V),ye)));return V=k.div(q,re),Z=k.mul(Z,k.div(te,ie)),{x:V,y:Z}}},F.createHasher=function P(k,z,W){if("function"!=typeof z)throw new Error("mapToCurve() must be defined");return{hashToCurve(V,Z){const q=_(V,2,{...W,DST:W.DST,...Z}),re=k.fromAffine(z(q[0])),te=k.fromAffine(z(q[1])),ie=re.add(te).clearCofactor();return ie.assertValidity(),ie},encodeToCurve(V,Z){const q=_(V,1,{...W,DST:W.encodeDST,...Z}),re=k.fromAffine(z(q[0])).clearCofactor();return re.assertValidity(),re}}}},63834:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapHashToField=F.getMinHashLength=F.getFieldBytesLength=F.hashToPrivateScalar=F.FpSqrtEven=F.FpSqrtOdd=F.Field=F.nLength=F.FpIsSquare=F.FpDiv=F.FpInvertBatch=F.FpPow=F.validateField=F.isNegativeLE=F.FpSqrt=F.tonelliShanks=F.invert=F.pow2=F.pow=F.mod=void 0;const i=f(84097),a=BigInt(0),x=BigInt(1),B=BigInt(2),m=BigInt(3),S=BigInt(4),g=BigInt(5),E=BigInt(8);function _(O,$){const H=O%$;return H>=a?H:$+H}function j(O,$,H){if(H<=a||$ 0");if(H===x)return a;let D=x;for(;$>a;)$&x&&(D=D*O%H),O=O*O%H,$>>=x;return D}function k(O,$){if(O===a||$<=a)throw new Error(`invert: expected positive integers, got n=${O} mod=${$}`);let H=_(O,$),D=$,s=a,p=x,Y=x,ee=a;for(;H!==a;){const de=D/H,Ae=D%H,Ie=s-Y*de,Le=p-ee*de;D=H,H=Ae,s=Y,p=ee,Y=Ie,ee=Le}if(D!==x)throw new Error("invert: does not exist");return _(s,$)}function z(O){const $=(O-x)/B;let H,D,s;for(H=O-x,D=0;H%B===a;H/=B,D++);for(s=B;sa;)D*=D,D%=H;return D},F.invert=k,F.tonelliShanks=z,F.FpSqrt=W,F.isNegativeLE=(O,$)=>(_(O,$)&x)===x;const Z=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function re(O,$,H){if(H 0");if(H===a)return O.ONE;if(H===x)return $;let D=O.ONE,s=$;for(;H>a;)H&x&&(D=O.mul(D,s)),s=O.sqr(s),H>>=x;return D}function te(O,$){const H=new Array($.length),D=$.reduce((p,Y,ee)=>O.is0(Y)?p:(H[ee]=p,O.mul(p,Y)),O.ONE),s=O.inv(D);return $.reduceRight((p,Y,ee)=>O.is0(Y)?p:(H[ee]=O.mul(p,H[ee]),O.mul(p,Y)),s),H}function me(O,$){const H=void 0!==$?$:O.toString(2).length;return{nBitLength:H,nByteLength:Math.ceil(H/8)}}function h(O){if("bigint"!=typeof O)throw new Error("field order must be bigint");const $=O.toString(2).length;return Math.ceil($/8)}function A(O){const $=h(O);return $+Math.ceil($/2)}F.validateField=function q(O){const H=Z.reduce((D,s)=>(D[s]="function",D),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,i.validateObject)(O,H)},F.FpPow=re,F.FpInvertBatch=te,F.FpDiv=function ie(O,$,H){return O.mul($,"bigint"==typeof H?k(H,O.ORDER):O.inv(H))},F.FpIsSquare=function ae(O){const $=(O.ORDER-x)/B;return H=>{const D=O.pow(H,$);return O.eql(D,O.ZERO)||O.eql(D,O.ONE)}},F.nLength=me,F.Field=function ye(O,$,H=!1,D={}){if(O<=a)throw new Error(`Expected Field ORDER > 0, got ${O}`);const{nBitLength:s,nByteLength:p}=me(O,$);if(p>2048)throw new Error("Field lengths over 2048 bytes are not supported");const Y=W(O),ee=Object.freeze({ORDER:O,BITS:s,BYTES:p,MASK:(0,i.bitMask)(s),ZERO:a,ONE:x,create:oe=>_(oe,O),isValid:oe=>{if("bigint"!=typeof oe)throw new Error("Invalid field element: expected bigint, got "+typeof oe);return a<=oe&&oeoe===a,isOdd:oe=>(oe&x)===x,neg:oe=>_(-oe,O),eql:(oe,de)=>oe===de,sqr:oe=>_(oe*oe,O),add:(oe,de)=>_(oe+de,O),sub:(oe,de)=>_(oe-de,O),mul:(oe,de)=>_(oe*de,O),pow:(oe,de)=>re(ee,oe,de),div:(oe,de)=>_(oe*k(de,O),O),sqrN:oe=>oe*oe,addN:(oe,de)=>oe+de,subN:(oe,de)=>oe-de,mulN:(oe,de)=>oe*de,inv:oe=>k(oe,O),sqrt:D.sqrt||(oe=>Y(ee,oe)),invertBatch:oe=>te(ee,oe),cmov:(oe,de,Ae)=>Ae?de:oe,toBytes:oe=>H?(0,i.numberToBytesLE)(oe,p):(0,i.numberToBytesBE)(oe,p),fromBytes:oe=>{if(oe.length!==p)throw new Error(`Fp.fromBytes: expected ${p}, got ${oe.length}`);return H?(0,i.bytesToNumberLE)(oe):(0,i.bytesToNumberBE)(oe)}});return Object.freeze(ee)},F.FpSqrtOdd=function ue(O,$){if(!O.isOdd)throw new Error("Field doesn't have isOdd");const H=O.sqrt($);return O.isOdd(H)?H:O.neg(H)},F.FpSqrtEven=function K(O,$){if(!O.isOdd)throw new Error("Field doesn't have isOdd");const H=O.sqrt($);return O.isOdd(H)?O.neg(H):H},F.hashToPrivateScalar=function o(O,$,H=!1){const D=(O=(0,i.ensureBytes)("privateHash",O)).length,s=me($).nByteLength+8;if(s<24||D1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${D}`);return _(H?(0,i.bytesToNumberLE)(O):(0,i.bytesToNumberBE)(O),$-x)+x},F.getFieldBytesLength=h,F.getMinHashLength=A,F.mapHashToField=function I(O,$,H=!1){const D=O.length,s=h($),p=A($);if(D<16||D1024)throw new Error(`expected ${p}-1024 bytes of input, got ${D}`);const ee=_(H?(0,i.bytesToNumberBE)(O):(0,i.bytesToNumberLE)(O),$-x)+x;return H?(0,i.numberToBytesLE)(ee,s):(0,i.numberToBytesBE)(ee,s)}},27661:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.montgomery=void 0;const i=f(63834),a=f(84097),x=BigInt(0),B=BigInt(1);F.montgomery=function S(g){const E=function m(g){return(0,a.validateObject)(g,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...g})}(g),{P:R}=E,M=ue=>(0,i.mod)(ue,R),_=E.montgomeryBits,j=Math.ceil(_/8),P=E.nByteLength,k=E.adjustScalarBytes||(ue=>ue),z=E.powPminus2||(ue=>(0,i.pow)(ue,R-BigInt(2),R));function W(ue,K,o){const h=M(ue*(K-o));return[K=M(K-h),o=M(o+h)]}function V(ue){if("bigint"==typeof ue&&x<=ue&&ue=x;Y--){const ee=h>>Y&B;D^=ee,s=W(D,I,$),I=s[0],$=s[1],s=W(D,O,H),O=s[0],H=s[1],D=ee;const oe=I+O,de=M(oe*oe),Ae=I-O,Ie=M(Ae*Ae),Le=de-Ie,xe=$+H,Xe=M(($-H)*oe),Te=M(xe*Ae),ke=Xe+Te,Se=Xe-Te;$=M(ke*ke),H=M(A*M(Se*Se)),I=M(de*Ie),O=M(Le*(de+M(Z*Le)))}s=W(D,I,$),I=s[0],$=s[1],s=W(D,O,H),O=s[0],H=s[1];const p=z(O);return M(I*p)}(o,h);if(A===x)throw new Error("Invalid private or public key received");return re(A)}const me=re(E.Gu);function ye(ue){return ae(ue,me)}return{scalarMult:ae,scalarMultBase:ye,getSharedSecret:(ue,K)=>ae(ue,K),getPublicKey:ue=>ye(ue),utils:{randomPrivateKey:()=>E.randomBytes(E.nByteLength)},GuBytes:me}}},84097:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateObject=F.createHmacDrbg=F.bitMask=F.bitSet=F.bitGet=F.bitLen=F.utf8ToBytes=F.equalBytes=F.concatBytes=F.ensureBytes=F.numberToVarBytesBE=F.numberToBytesLE=F.numberToBytesBE=F.bytesToNumberLE=F.bytesToNumberBE=F.hexToBytes=F.hexToNumber=F.numberToHexUnpadded=F.bytesToHex=F.isBytes=void 0;const f=BigInt(0),i=BigInt(1),a=BigInt(2);function x(h){return h instanceof Uint8Array||null!=h&&"object"==typeof h&&"Uint8Array"===h.constructor.name}F.isBytes=x;const B=Array.from({length:256},(h,A)=>A.toString(16).padStart(2,"0"));function m(h){if(!x(h))throw new Error("Uint8Array expected");let A="";for(let I=0;I=E._0&&h<=E._9?h-E._0:h>=E._A&&h<=E._F?h-(E._A-10):h>=E._a&&h<=E._f?h-(E._a-10):void 0}function M(h){if("string"!=typeof h)throw new Error("hex string expected, got "+typeof h);const A=h.length,I=A/2;if(A%2)throw new Error("padded hex string expected, got unpadded hex of length "+A);const O=new Uint8Array(I);for(let $=0,H=0;$f;h>>=i,A+=1);return A},F.bitGet=function te(h,A){return h>>BigInt(A)&i},F.bitSet=(h,A,I)=>h|(I?i:f)<(a<new Uint8Array(h),ye=h=>Uint8Array.from(h);F.createHmacDrbg=function ue(h,A,I){if("number"!=typeof h||h<2)throw new Error("hashLen must be a number");if("number"!=typeof A||A<2)throw new Error("qByteLen must be a number");if("function"!=typeof I)throw new Error("hmacFn must be a function");let O=me(h),$=me(h),H=0;const D=()=>{O.fill(1),$.fill(0),H=0},s=(...oe)=>I($,O,...oe),p=(oe=me())=>{$=s(ye([0]),oe),O=s(),0!==oe.length&&($=s(ye([1]),oe),O=s())},Y=()=>{if(H++>=1e3)throw new Error("drbg: tried 1000 values");let oe=0;const de=[];for(;oe{let Ae;for(D(),p(oe);!(Ae=de(Y()));)p();return D(),Ae}};const K={bigint:h=>"bigint"==typeof h,function:h=>"function"==typeof h,boolean:h=>"boolean"==typeof h,string:h=>"string"==typeof h,stringOrUint8Array:h=>"string"==typeof h||x(h),isSafeInteger:h=>Number.isSafeInteger(h),array:h=>Array.isArray(h),field:(h,A)=>A.Fp.isValid(h),hash:h=>"function"==typeof h&&Number.isSafeInteger(h.outputLen)};F.validateObject=function o(h,A,I={}){const O=($,H,D)=>{const s=K[H];if("function"!=typeof s)throw new Error(`Invalid validator "${H}", expected function`);const p=h[$];if(!(D&&void 0===p||s(p,h)))throw new Error(`Invalid param ${String($)}=${p} (${typeof p}), expected ${H}`)};for(const[$,H]of Object.entries(A))O($,H,!1);for(const[$,H]of Object.entries(I))O($,H,!0);return h}},73040:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapToCurveSimpleSWU=F.SWUFpSqrtRatio=F.weierstrass=F.weierstrassPoints=F.DER=void 0;const i=f(63834),a=f(84097),x=f(84097),B=f(25299),{bytesToNumberBE:S,hexToBytes:g}=a;F.DER={Err:class extends Error{constructor(q=""){super(q)}},_parseInt(Z){const{Err:q}=F.DER;if(Z.length<2||2!==Z[0])throw new q("Invalid signature integer tag");const re=Z[1],te=Z.subarray(2,re+2);if(!re||te.length!==re)throw new q("Invalid signature integer: wrong length");if(128&te[0])throw new q("Invalid signature integer: negative");if(0===te[0]&&!(128&te[1]))throw new q("Invalid signature integer: unnecessary leading zero");return{d:S(te),l:Z.subarray(re+2)}},toSig(Z){const{Err:q}=F.DER,re="string"==typeof Z?g(Z):Z;if(!a.isBytes(re))throw new Error("ui8a expected");let te=re.length;if(te<2||48!=re[0])throw new q("Invalid signature tag");if(re[1]!==te-2)throw new q("Invalid signature: incorrect length");const{d:ie,l:ae}=F.DER._parseInt(re.subarray(2)),{d:me,l:ye}=F.DER._parseInt(ae);if(ye.length)throw new q("Invalid signature: left bytes after parsing");return{r:ie,s:me}},hexFromSig(Z){const q=K=>8&Number.parseInt(K[0],16)?"00"+K:K,re=K=>{const o=K.toString(16);return 1&o.length?`0${o}`:o},te=q(re(Z.s)),ie=q(re(Z.r)),ae=te.length/2,me=ie.length/2,ye=re(ae),ue=re(me);return`30${re(me+ae+4)}02${ue}${ie}02${ye}${te}`}};const E=BigInt(0),R=BigInt(1),M=BigInt(2),_=BigInt(3),j=BigInt(4);function P(Z){const q=function m(Z){const q=(0,B.validateBasic)(Z);a.validateObject(q,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:re,Fp:te,a:ie}=q;if(re){if(!te.eql(ie,te.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof re||"bigint"!=typeof re.beta||"function"!=typeof re.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...q})}(Z),{Fp:re}=q,te=q.toBytes||((O,$,H)=>{const D=$.toAffine();return a.concatBytes(Uint8Array.from([4]),re.toBytes(D.x),re.toBytes(D.y))}),ie=q.fromBytes||(O=>{const $=O.subarray(1);return{x:re.fromBytes($.subarray(0,re.BYTES)),y:re.fromBytes($.subarray(re.BYTES,2*re.BYTES))}});function ae(O){const{a:$,b:H}=q,D=re.sqr(O),s=re.mul(D,O);return re.add(re.add(s,re.mul(O,$)),H)}if(!re.eql(re.sqr(q.Gy),ae(q.Gx)))throw new Error("bad generator point: equation left != right");function me(O){return"bigint"==typeof O&&Ere.eql(p,re.ZERO);return s(H)&&s(D)?h.ZERO:new h(H,D,re.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ($){const H=re.invertBatch($.map(D=>D.pz));return $.map((D,s)=>D.toAffine(H[s])).map(h.fromAffine)}static fromHex($){const H=h.fromAffine(ie((0,x.ensureBytes)("pointHex",$)));return H.assertValidity(),H}static fromPrivateKey($){return h.BASE.multiply(ue($))}_setWindowSize($){this._WINDOW_SIZE=$,K.delete(this)}assertValidity(){if(this.is0()){if(q.allowInfinityPoint&&!re.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:$,y:H}=this.toAffine();if(!re.isValid($)||!re.isValid(H))throw new Error("bad point: x or y not FE");const D=re.sqr(H),s=ae($);if(!re.eql(D,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:$}=this.toAffine();if(re.isOdd)return!re.isOdd($);throw new Error("Field doesn't support isOdd")}equals($){o($);const{px:H,py:D,pz:s}=this,{px:p,py:Y,pz:ee}=$,oe=re.eql(re.mul(H,ee),re.mul(p,s)),de=re.eql(re.mul(D,ee),re.mul(Y,s));return oe&&de}negate(){return new h(this.px,re.neg(this.py),this.pz)}double(){const{a:$,b:H}=q,D=re.mul(H,_),{px:s,py:p,pz:Y}=this;let ee=re.ZERO,oe=re.ZERO,de=re.ZERO,Ae=re.mul(s,s),Ie=re.mul(p,p),Le=re.mul(Y,Y),xe=re.mul(s,p);return xe=re.add(xe,xe),de=re.mul(s,Y),de=re.add(de,de),ee=re.mul($,de),oe=re.mul(D,Le),oe=re.add(ee,oe),ee=re.sub(Ie,oe),oe=re.add(Ie,oe),oe=re.mul(ee,oe),ee=re.mul(xe,ee),de=re.mul(D,de),Le=re.mul($,Le),xe=re.sub(Ae,Le),xe=re.mul($,xe),xe=re.add(xe,de),de=re.add(Ae,Ae),Ae=re.add(de,Ae),Ae=re.add(Ae,Le),Ae=re.mul(Ae,xe),oe=re.add(oe,Ae),Le=re.mul(p,Y),Le=re.add(Le,Le),Ae=re.mul(Le,xe),ee=re.sub(ee,Ae),de=re.mul(Le,Ie),de=re.add(de,de),de=re.add(de,de),new h(ee,oe,de)}add($){o($);const{px:H,py:D,pz:s}=this,{px:p,py:Y,pz:ee}=$;let oe=re.ZERO,de=re.ZERO,Ae=re.ZERO;const Ie=q.a,Le=re.mul(q.b,_);let xe=re.mul(H,p),De=re.mul(D,Y),Xe=re.mul(s,ee),Te=re.add(H,D),ke=re.add(p,Y);Te=re.mul(Te,ke),ke=re.add(xe,De),Te=re.sub(Te,ke),ke=re.add(H,s);let Se=re.add(p,ee);return ke=re.mul(ke,Se),Se=re.add(xe,Xe),ke=re.sub(ke,Se),Se=re.add(D,s),oe=re.add(Y,ee),Se=re.mul(Se,oe),oe=re.add(De,Xe),Se=re.sub(Se,oe),Ae=re.mul(Ie,ke),oe=re.mul(Le,Xe),Ae=re.add(oe,Ae),oe=re.sub(De,Ae),Ae=re.add(De,Ae),de=re.mul(oe,Ae),De=re.add(xe,xe),De=re.add(De,xe),Xe=re.mul(Ie,Xe),ke=re.mul(Le,ke),De=re.add(De,Xe),Xe=re.sub(xe,Xe),Xe=re.mul(Ie,Xe),ke=re.add(ke,Xe),xe=re.mul(De,ke),de=re.add(de,xe),xe=re.mul(Se,ke),oe=re.mul(Te,oe),oe=re.sub(oe,xe),xe=re.mul(Te,De),Ae=re.mul(Se,Ae),Ae=re.add(Ae,xe),new h(oe,de,Ae)}subtract($){return this.add($.negate())}is0(){return this.equals(h.ZERO)}wNAF($){return I.wNAFCached(this,K,$,H=>{const D=re.invertBatch(H.map(s=>s.pz));return H.map((s,p)=>s.toAffine(D[p])).map(h.fromAffine)})}multiplyUnsafe($){const H=h.ZERO;if($===E)return H;if(ye($),$===R)return this;const{endo:D}=q;if(!D)return I.unsafeLadder(this,$);let{k1neg:s,k1:p,k2neg:Y,k2:ee}=D.splitScalar($),oe=H,de=H,Ae=this;for(;p>E||ee>E;)p&R&&(oe=oe.add(Ae)),ee&R&&(de=de.add(Ae)),Ae=Ae.double(),p>>=R,ee>>=R;return s&&(oe=oe.negate()),Y&&(de=de.negate()),de=new h(re.mul(de.px,D.beta),de.py,de.pz),oe.add(de)}multiply($){ye($);let D,s,H=$;const{endo:p}=q;if(p){const{k1neg:Y,k1:ee,k2neg:oe,k2:de}=p.splitScalar(H);let{p:Ae,f:Ie}=this.wNAF(ee),{p:Le,f:xe}=this.wNAF(de);Ae=I.constTimeNegate(Y,Ae),Le=I.constTimeNegate(oe,Le),Le=new h(re.mul(Le.px,p.beta),Le.py,Le.pz),D=Ae.add(Le),s=Ie.add(xe)}else{const{p:Y,f:ee}=this.wNAF(H);D=Y,s=ee}return h.normalizeZ([D,s])[0]}multiplyAndAddUnsafe($,H,D){const s=h.BASE,p=(ee,oe)=>oe!==E&&oe!==R&&ee.equals(s)?ee.multiply(oe):ee.multiplyUnsafe(oe),Y=p(this,H).add(p($,D));return Y.is0()?void 0:Y}toAffine($){const{px:H,py:D,pz:s}=this,p=this.is0();null==$&&($=p?re.ONE:re.inv(s));const Y=re.mul(H,$),ee=re.mul(D,$),oe=re.mul(s,$);if(p)return{x:re.ZERO,y:re.ZERO};if(!re.eql(oe,re.ONE))throw new Error("invZ was invalid");return{x:Y,y:ee}}isTorsionFree(){const{h:$,isTorsionFree:H}=q;if($===R)return!0;if(H)return H(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:$,clearCofactor:H}=q;return $===R?this:H?H(h,this):this.multiplyUnsafe(q.h)}toRawBytes($=!0){return this.assertValidity(),te(h,this,$)}toHex($=!0){return a.bytesToHex(this.toRawBytes($))}}h.BASE=new h(q.Gx,q.Gy,re.ONE),h.ZERO=new h(re.ZERO,re.ONE,re.ZERO);const A=q.nBitLength,I=(0,B.wNAF)(h,q.endo?Math.ceil(A/2):A);return{CURVE:q,ProjectivePoint:h,normPrivateKeyToScalar:ue,weierstrassEquation:ae,isWithinCurveOrder:me}}function W(Z,q){const re=Z.ORDER;let te=E;for(let O=re-R;O%M===E;O/=M)te+=R;const ie=te,ae=M<{let H=h,D=Z.pow($,K),s=Z.sqr(D);s=Z.mul(s,$);let p=Z.mul(O,s);p=Z.pow(p,ue),p=Z.mul(p,D),D=Z.mul(p,$),s=Z.mul(p,O);let Y=Z.mul(s,D);p=Z.pow(Y,o);let ee=Z.eql(p,Z.ONE);D=Z.mul(s,A),p=Z.mul(Y,H),s=Z.cmov(D,s,ee),Y=Z.cmov(p,Y,ee);for(let oe=ie;oe>R;oe--){let de=oe-M;de=M<{let s=Z.sqr(D);const p=Z.mul(H,D);s=Z.mul(s,p);let Y=Z.pow(s,O);Y=Z.mul(Y,p);const ee=Z.mul(Y,$),oe=Z.mul(Z.sqr(Y),D),de=Z.eql(oe,H);return{isValid:de,value:Z.cmov(ee,Y,de)}}}return I}F.weierstrassPoints=P,F.weierstrass=function z(Z){const q=function k(Z){const q=(0,B.validateBasic)(Z);return a.validateObject(q,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...q})}(Z),{Fp:re,n:te}=q,ie=re.BYTES+1,ae=2*re.BYTES+1;function ye(ke){return i.mod(ke,te)}function ue(ke){return i.invert(ke,te)}const{ProjectivePoint:K,normPrivateKeyToScalar:o,weierstrassEquation:h,isWithinCurveOrder:A}=P({...q,toBytes(ke,Se,Ee){const ve=Se.toAffine(),Ce=re.toBytes(ve.x),Re=a.concatBytes;return Ee?Re(Uint8Array.from([Se.hasEvenY()?2:3]),Ce):Re(Uint8Array.from([4]),Ce,re.toBytes(ve.y))},fromBytes(ke){const Se=ke.length,Ee=ke[0],ve=ke.subarray(1);if(Se!==ie||2!==Ee&&3!==Ee){if(Se===ae&&4===Ee)return{x:re.fromBytes(ve.subarray(0,re.BYTES)),y:re.fromBytes(ve.subarray(re.BYTES,2*re.BYTES))};throw new Error(`Point of length ${Se} was invalid. Expected ${ie} compressed bytes or ${ae} uncompressed bytes`)}{const Ce=a.bytesToNumberBE(ve);if(!function me(ke){return Ea.bytesToHex(a.numberToBytesBE(ke,q.nByteLength));function O(ke){return ke>te>>R}const H=(ke,Se,Ee)=>a.bytesToNumberBE(ke.slice(Se,Ee));class D{constructor(Se,Ee,ve){this.r=Se,this.s=Ee,this.recovery=ve,this.assertValidity()}static fromCompact(Se){const Ee=q.nByteLength;return Se=(0,x.ensureBytes)("compactSignature",Se,2*Ee),new D(H(Se,0,Ee),H(Se,Ee,2*Ee))}static fromDER(Se){const{r:Ee,s:ve}=F.DER.toSig((0,x.ensureBytes)("DER",Se));return new D(Ee,ve)}assertValidity(){if(!A(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!A(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Se){return new D(this.r,this.s,Se)}recoverPublicKey(Se){const{r:Ee,s:ve,recovery:Ce}=this,Re=de((0,x.ensureBytes)("msgHash",Se));if(null==Ce||![0,1,2,3].includes(Ce))throw new Error("recovery id invalid");const Ye=2===Ce||3===Ce?Ee+q.n:Ee;if(Ye>=re.ORDER)throw new Error("recovery id 2 or 3 invalid");const nt=K.fromHex((1&Ce?"03":"02")+I(Ye)),Qe=ue(Ye),Tt=ye(-Re*Qe),ct=ye(ve*Qe),ze=K.BASE.multiplyAndAddUnsafe(nt,Tt,ct);if(!ze)throw new Error("point at infinify");return ze.assertValidity(),ze}hasHighS(){return O(this.s)}normalizeS(){return this.hasHighS()?new D(this.r,ye(-this.s),this.recovery):this}toDERRawBytes(){return a.hexToBytes(this.toDERHex())}toDERHex(){return F.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return a.hexToBytes(this.toCompactHex())}toCompactHex(){return I(this.r)+I(this.s)}}const s={isValidPrivateKey(ke){try{return o(ke),!0}catch{return!1}},normPrivateKeyToScalar:o,randomPrivateKey:()=>{const ke=i.getMinHashLength(q.n);return i.mapHashToField(q.randomBytes(ke),q.n)},precompute:(ke=8,Se=K.BASE)=>(Se._setWindowSize(ke),Se.multiply(BigInt(3)),Se)};function Y(ke){const Se=a.isBytes(ke),Ee="string"==typeof ke,ve=(Se||Ee)&&ke.length;return Se?ve===ie||ve===ae:Ee?ve===2*ie||ve===2*ae:ke instanceof K}const oe=q.bits2int||function(ke){const Se=a.bytesToNumberBE(ke),Ee=8*ke.length-q.nBitLength;return Ee>0?Se>>BigInt(Ee):Se},de=q.bits2int_modN||function(ke){return ye(oe(ke))},Ae=a.bitMask(q.nBitLength);function Ie(ke){if("bigint"!=typeof ke)throw new Error("bigint expected");if(!(E<=ke&&kene in Ee))throw new Error("sign() legacy options not supported");const{hash:ve,randomBytes:Ce}=q;let{lowS:Re,prehash:Ye,extraEntropy:$e}=Ee;null==Re&&(Re=!0),ke=(0,x.ensureBytes)("msgHash",ke),Ye&&(ke=(0,x.ensureBytes)("prehashed msgHash",ve(ke)));const nt=de(ke),Qe=o(Se),Tt=[Ie(Qe),Ie(nt)];if(null!=$e){const ne=!0===$e?Ce(re.BYTES):$e;Tt.push((0,x.ensureBytes)("extraEntropy",ne))}const ct=a.concatBytes(...Tt),ze=nt;return{seed:ct,k2sig:function St(ne){const X=oe(ne);if(!A(X))return;const G=ue(X),he=K.BASE.multiply(X).toAffine(),_e=ye(he.x);if(_e===E)return;const je=ye(G*ye(ze+_e*Qe));if(je===E)return;let Ne=(he.x===_e?0:2)|Number(he.y&R),ot=je;return Re&&O(je)&&(ot=function $(ke){return O(ke)?ye(-ke):ke}(je),Ne^=1),new D(_e,ot,Ne)}}}(ke,Se,Ee);return a.createHmacDrbg(q.hash.outputLen,q.nByteLength,q.hmac)(ve,Ce)},verify:function Te(ke,Se,Ee,ve=De){const Ce=ke;if(Se=(0,x.ensureBytes)("msgHash",Se),Ee=(0,x.ensureBytes)("publicKey",Ee),"strict"in ve)throw new Error("options.strict was renamed to lowS");const{lowS:Re,prehash:Ye}=ve;let $e,nt;try{if("string"==typeof Ce||a.isBytes(Ce))try{$e=D.fromDER(Ce)}catch(he){if(!(he instanceof F.DER.Err))throw he;$e=D.fromCompact(Ce)}else{if("object"!=typeof Ce||"bigint"!=typeof Ce.r||"bigint"!=typeof Ce.s)throw new Error("PARSE");{const{r:he,s:_e}=Ce;$e=new D(he,_e)}}nt=K.fromHex(Ee)}catch(he){if("PARSE"===he.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Re&&$e.hasHighS())return!1;Ye&&(Se=q.hash(Se));const{r:Qe,s:Tt}=$e,ct=de(Se),ze=ue(Tt),St=ye(ct*ze),ne=ye(Qe*ze),X=K.BASE.multiplyAndAddUnsafe(nt,St,ne)?.toAffine();return!!X&&ye(X.x)===Qe},ProjectivePoint:K,Signature:D,utils:s}},F.SWUFpSqrtRatio=W,F.mapToCurveSimpleSWU=function V(Z,q){if(i.validateField(Z),!Z.isValid(q.A)||!Z.isValid(q.B)||!Z.isValid(q.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const re=W(Z,q.Z);if(!Z.isOdd)throw new Error("Fp.isOdd is not implemented!");return te=>{let ie,ae,me,ye,ue,K,o,h;ie=Z.sqr(te),ie=Z.mul(ie,q.Z),ae=Z.sqr(ie),ae=Z.add(ae,ie),me=Z.add(ae,Z.ONE),me=Z.mul(me,q.B),ye=Z.cmov(q.Z,Z.neg(ae),!Z.eql(ae,Z.ZERO)),ye=Z.mul(ye,q.A),ae=Z.sqr(me),K=Z.sqr(ye),ue=Z.mul(K,q.A),ae=Z.add(ae,ue),ae=Z.mul(ae,me),K=Z.mul(K,ye),ue=Z.mul(K,q.B),ae=Z.add(ae,ue),o=Z.mul(ie,me);const{isValid:A,value:I}=re(ae,K);h=Z.mul(ie,te),h=Z.mul(h,I),o=Z.cmov(o,me,A),h=Z.cmov(h,I,A);const O=Z.isOdd(te)===Z.isOdd(h);return h=Z.cmov(Z.neg(h),h,O),o=Z.div(o,ye),{x:o,y:h}}}},57340:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hash_to_ristretto255=F.hashToRistretto255=F.RistrettoPoint=F.encodeToCurve=F.hashToCurve=F.edwardsToMontgomeryPriv=F.edwardsToMontgomery=F.edwardsToMontgomeryPub=F.x25519=F.ed25519ph=F.ed25519ctx=F.ed25519=F.ED25519_TORSION_SUBGROUP=void 0;const i=f(44207),a=f(96492),x=f(45068),B=f(27661),m=f(63834),S=f(84097),g=f(75752),E=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),R=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),M=BigInt(0),_=BigInt(1),j=BigInt(2),P=BigInt(5),k=BigInt(10),z=BigInt(20),W=BigInt(40),V=BigInt(80);function Z(Xe){const Te=E,Se=Xe*Xe%Te*Xe%Te,Ee=(0,m.pow2)(Se,j,Te)*Se%Te,ve=(0,m.pow2)(Ee,_,Te)*Xe%Te,Ce=(0,m.pow2)(ve,P,Te)*ve%Te,Re=(0,m.pow2)(Ce,k,Te)*Ce%Te,Ye=(0,m.pow2)(Re,z,Te)*Re%Te,$e=(0,m.pow2)(Ye,W,Te)*Ye%Te,nt=(0,m.pow2)($e,V,Te)*$e%Te,Qe=(0,m.pow2)(nt,V,Te)*$e%Te,Tt=(0,m.pow2)(Qe,k,Te)*Ce%Te;return{pow_p_5_8:(0,m.pow2)(Tt,j,Te)*Xe%Te,b2:Se}}function q(Xe){return Xe[0]&=248,Xe[31]&=127,Xe[31]|=64,Xe}function re(Xe,Te){const ke=E,Se=(0,m.mod)(Te*Te*Te,ke),ve=Z(Xe*(0,m.mod)(Se*Se*Te,ke)).pow_p_5_8;let Ce=(0,m.mod)(Xe*Se*ve,ke);const Re=(0,m.mod)(Te*Ce*Ce,ke),Ye=Ce,$e=(0,m.mod)(Ce*R,ke),nt=Re===Xe,Qe=Re===(0,m.mod)(-Xe,ke),Tt=Re===(0,m.mod)(-Xe*R,ke);return nt&&(Ce=Ye),(Qe||Tt)&&(Ce=$e),(0,m.isNegativeLE)(Ce,ke)&&(Ce=(0,m.mod)(-Ce,ke)),{isValid:nt||Qe,value:Ce}}F.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const te=(0,m.Field)(E,void 0,!0),ie={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:te,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:i.sha512,randomBytes:a.randomBytes,adjustScalarBytes:q,uvRatio:re};function ae(Xe,Te,ke){if(Te.length>255)throw new Error("Context is too big");return(0,a.concatBytes)((0,a.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([ke?1:0,Te.length]),Te,Xe)}function me(Xe){const{y:Te}=F.ed25519.ExtendedPoint.fromHex(Xe),ke=BigInt(1);return te.toBytes(te.create((ke+Te)*te.inv(ke-Te)))}F.ed25519=(0,x.twistedEdwards)(ie),F.ed25519ctx=(0,x.twistedEdwards)({...ie,domain:ae}),F.ed25519ph=(0,x.twistedEdwards)({...ie,domain:ae,prehash:i.sha512}),F.x25519=(0,B.montgomery)({P:E,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:Xe=>{const Te=E,{pow_p_5_8:ke,b2:Se}=Z(Xe);return(0,m.mod)((0,m.pow2)(ke,BigInt(3),Te)*Se,Te)},adjustScalarBytes:q,randomBytes:a.randomBytes}),F.edwardsToMontgomeryPub=me,F.edwardsToMontgomery=me,F.edwardsToMontgomeryPriv=function ye(Xe){const Te=ie.hash(Xe.subarray(0,32));return ie.adjustScalarBytes(Te).subarray(0,32)};const ue=(te.ORDER+BigInt(3))/BigInt(8),K=te.pow(j,ue),o=te.sqrt(te.neg(te.ONE)),h=(te.ORDER-BigInt(5))/BigInt(8),A=BigInt(486662),O=(0,m.FpSqrtEven)(te,te.neg(BigInt(486664)));const H=(0,g.createHasher)(F.ed25519.ExtendedPoint,Xe=>function $(Xe){const{xMn:Te,xMd:ke,yMn:Se,yMd:Ee}=function I(Xe){let Te=te.sqr(Xe);Te=te.mul(Te,j);let ke=te.add(Te,te.ONE),Se=te.neg(A),Ee=te.sqr(ke),ve=te.mul(Ee,ke),Ce=te.mul(Te,A);Ce=te.mul(Ce,Se),Ce=te.add(Ce,Ee),Ce=te.mul(Ce,Se);let Re=te.sqr(ve);Ee=te.sqr(Re),Re=te.mul(Re,ve),Re=te.mul(Re,Ce),Ee=te.mul(Ee,Re);let Ye=te.pow(Ee,h);Ye=te.mul(Ye,Re);let $e=te.mul(Ye,o);Ee=te.sqr(Ye),Ee=te.mul(Ee,ve);let nt=te.eql(Ee,Ce),Qe=te.cmov($e,Ye,nt),Tt=te.mul(Se,Te),ct=te.mul(Ye,Xe);ct=te.mul(ct,K);let ze=te.mul(ct,o),St=te.mul(Ce,Te);Ee=te.sqr(ct),Ee=te.mul(Ee,ve);let ne=te.eql(Ee,St),X=te.cmov(ze,ct,ne);Ee=te.sqr(Qe),Ee=te.mul(Ee,ve);let G=te.eql(Ee,Ce),he=te.cmov(Tt,Se,G),_e=te.cmov(X,Qe,G),je=te.isOdd(_e);return _e=te.cmov(_e,te.neg(_e),G!==je),{xMn:he,xMd:ke,yMn:_e,yMd:_}}(Xe);let ve=te.mul(Te,Ee);ve=te.mul(ve,O);let Ce=te.mul(ke,Se),Re=te.sub(Te,ke),Ye=te.add(Te,ke),$e=te.mul(Ce,Ye),nt=te.eql($e,te.ZERO);ve=te.cmov(ve,te.ZERO,nt),Ce=te.cmov(Ce,te.ONE,nt),Re=te.cmov(Re,te.ONE,nt),Ye=te.cmov(Ye,te.ONE,nt);const Qe=te.invertBatch([Ce,Ye]);return{x:te.mul(ve,Qe[0]),y:te.mul(Re,Qe[1])}}(Xe[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:te.ORDER,m:1,k:128,expand:"xmd",hash:i.sha512});function D(Xe){if(!(Xe instanceof xe))throw new Error("RistrettoPoint expected")}F.hashToCurve=H.hashToCurve,F.encodeToCurve=H.encodeToCurve;const s=R,p=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Y=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),ee=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),oe=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),de=Xe=>re(_,Xe),Ae=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Ie=Xe=>F.ed25519.CURVE.Fp.create((0,S.bytesToNumberLE)(Xe)&Ae);function Le(Xe){const{d:Te}=F.ed25519.CURVE,ke=F.ed25519.CURVE.Fp.ORDER,Se=F.ed25519.CURVE.Fp.create,Ee=Se(s*Xe*Xe),ve=Se((Ee+_)*ee);let Ce=BigInt(-1);const Re=Se((Ce-Te*Ee)*Se(Ee+Te));let{isValid:Ye,value:$e}=re(ve,Re),nt=Se($e*Xe);(0,m.isNegativeLE)(nt,ke)||(nt=Se(-nt)),Ye||($e=nt),Ye||(Ce=Ee);const Qe=Se(Ce*(Ee-_)*oe-Re),Tt=$e*$e,ct=Se(($e+$e)*Re),ze=Se(Qe*p),St=Se(_-Tt),ne=Se(_+Tt);return new F.ed25519.ExtendedPoint(Se(ct*ne),Se(St*ze),Se(ze*ne),Se(ct*St))}class xe{constructor(Te){this.ep=Te}static fromAffine(Te){return new xe(F.ed25519.ExtendedPoint.fromAffine(Te))}static hashToCurve(Te){Te=(0,S.ensureBytes)("ristrettoHash",Te,64);const Se=Le(Ie(Te.slice(0,32))),ve=Le(Ie(Te.slice(32,64)));return new xe(Se.add(ve))}static fromHex(Te){Te=(0,S.ensureBytes)("ristrettoHex",Te,32);const{a:ke,d:Se}=F.ed25519.CURVE,Ee=F.ed25519.CURVE.Fp.ORDER,ve=F.ed25519.CURVE.Fp.create,Ce="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",Re=Ie(Te);if(!(0,S.equalBytes)((0,S.numberToBytesLE)(Re,32),Te)||(0,m.isNegativeLE)(Re,Ee))throw new Error(Ce);const Ye=ve(Re*Re),$e=ve(_+ke*Ye),nt=ve(_-ke*Ye),Qe=ve($e*$e),Tt=ve(nt*nt),ct=ve(ke*Se*Qe-Tt),{isValid:ze,value:St}=de(ve(ct*Tt)),ne=ve(St*nt),X=ve(St*ne*ct);let G=ve((Re+Re)*ne);(0,m.isNegativeLE)(G,Ee)&&(G=ve(-G));const he=ve($e*X),_e=ve(G*he);if(!ze||(0,m.isNegativeLE)(_e,Ee)||he===M)throw new Error(Ce);return new xe(new F.ed25519.ExtendedPoint(G,he,_,_e))}toRawBytes(){let{ex:Te,ey:ke,ez:Se,et:Ee}=this.ep;const ve=F.ed25519.CURVE.Fp.ORDER,Ce=F.ed25519.CURVE.Fp.create,Re=Ce(Ce(Se+ke)*Ce(Se-ke)),Ye=Ce(Te*ke),$e=Ce(Ye*Ye),{value:nt}=de(Ce(Re*$e)),Qe=Ce(nt*Re),Tt=Ce(nt*Ye),ct=Ce(Qe*Tt*Ee);let ze;if((0,m.isNegativeLE)(Ee*ct,ve)){let ne=Ce(ke*s),X=Ce(Te*s);Te=ne,ke=X,ze=Ce(Qe*Y)}else ze=Tt;(0,m.isNegativeLE)(Te*ct,ve)&&(ke=Ce(-ke));let St=Ce((Se-ke)*ze);return(0,m.isNegativeLE)(St,ve)&&(St=Ce(-St)),(0,S.numberToBytesLE)(St,32)}toHex(){return(0,S.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(Te){D(Te);const{ex:ke,ey:Se}=this.ep,{ex:Ee,ey:ve}=Te.ep,Ce=F.ed25519.CURVE.Fp.create,Re=Ce(ke*ve)===Ce(Se*Ee),Ye=Ce(Se*ve)===Ce(ke*Ee);return Re||Ye}add(Te){return D(Te),new xe(this.ep.add(Te.ep))}subtract(Te){return D(Te),new xe(this.ep.subtract(Te.ep))}multiply(Te){return new xe(this.ep.multiply(Te))}multiplyUnsafe(Te){return new xe(this.ep.multiplyUnsafe(Te))}double(){return new xe(this.ep.double())}negate(){return new xe(this.ep.negate())}}F.RistrettoPoint=(xe.BASE||(xe.BASE=new xe(F.ed25519.ExtendedPoint.BASE)),xe.ZERO||(xe.ZERO=new xe(F.ed25519.ExtendedPoint.ZERO)),xe),F.hashToRistretto255=(Xe,Te)=>{const ke=Te.DST,Se="string"==typeof ke?(0,a.utf8ToBytes)(ke):ke,Ee=(0,g.expand_message_xmd)(Xe,Se,64,i.sha512);return xe.hashToCurve(Ee)},F.hash_to_ristretto255=F.hashToRistretto255},91717:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.encodeToCurve=F.hashToCurve=F.schnorr=F.secp256k1=void 0;const i=f(1806),a=f(96492),x=f(63834),B=f(73040),m=f(84097),S=f(75752),g=f(4521),E=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),R=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),M=BigInt(1),_=BigInt(2),j=(D,s)=>(D+s/_)/s;function P(D){const s=E,p=BigInt(3),Y=BigInt(6),ee=BigInt(11),oe=BigInt(22),de=BigInt(23),Ae=BigInt(44),Ie=BigInt(88),Le=D*D*D%s,xe=Le*Le*D%s,De=(0,x.pow2)(xe,p,s)*xe%s,Xe=(0,x.pow2)(De,p,s)*xe%s,Te=(0,x.pow2)(Xe,_,s)*Le%s,ke=(0,x.pow2)(Te,ee,s)*Te%s,Se=(0,x.pow2)(ke,oe,s)*ke%s,Ee=(0,x.pow2)(Se,Ae,s)*Se%s,ve=(0,x.pow2)(Ee,Ie,s)*Ee%s,Ce=(0,x.pow2)(ve,Ae,s)*Se%s,Re=(0,x.pow2)(Ce,p,s)*xe%s,Ye=(0,x.pow2)(Re,de,s)*ke%s,$e=(0,x.pow2)(Ye,Y,s)*Le%s,nt=(0,x.pow2)($e,_,s);if(!k.eql(k.sqr(nt),D))throw new Error("Cannot find square root");return nt}const k=(0,x.Field)(E,void 0,void 0,{sqrt:P});F.secp256k1=(0,g.createCurve)({a:BigInt(0),b:BigInt(7),Fp:k,n:R,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:D=>{const s=R,p=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),Y=-M*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),ee=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),oe=p,de=BigInt("0x100000000000000000000000000000000"),Ae=j(oe*D,s),Ie=j(-Y*D,s);let Le=(0,x.mod)(D-Ae*p-Ie*ee,s),xe=(0,x.mod)(-Ae*Y-Ie*oe,s);const De=Le>de,Xe=xe>de;if(De&&(Le=s-Le),Xe&&(xe=s-xe),Le>de||xe>de)throw new Error("splitScalar: Endomorphism failed, k="+D);return{k1neg:De,k1:Le,k2neg:Xe,k2:xe}}}},i.sha256);const z=BigInt(0),W=D=>"bigint"==typeof D&&zee.charCodeAt(0)));p=(0,m.concatBytes)(Y,Y),Z[D]=p}return(0,i.sha256)((0,m.concatBytes)(p,...s))}const re=D=>D.toRawBytes(!0).slice(1),te=D=>(0,m.numberToBytesBE)(D,32),ie=D=>(0,x.mod)(D,E),ae=D=>(0,x.mod)(D,R),me=F.secp256k1.ProjectivePoint;function ue(D){let s=F.secp256k1.utils.normPrivateKeyToScalar(D),p=me.fromPrivateKey(s);return{scalar:p.hasEvenY()?s:ae(-s),bytes:re(p)}}function K(D){if(!W(D))throw new Error("bad x: need 0 < x < p");const s=ie(D*D);let Y=P(ie(s*D+BigInt(7)));Y%_!==z&&(Y=ie(-Y));const ee=new me(D,Y,M);return ee.assertValidity(),ee}function o(...D){return ae((0,m.bytesToNumberBE)(q("BIP0340/challenge",...D)))}function I(D,s,p){const Y=(0,m.ensureBytes)("signature",D,64),ee=(0,m.ensureBytes)("message",s),oe=(0,m.ensureBytes)("publicKey",p,32);try{const de=K((0,m.bytesToNumberBE)(oe)),Ae=(0,m.bytesToNumberBE)(Y.subarray(0,32));if(!W(Ae))return!1;const Ie=(0,m.bytesToNumberBE)(Y.subarray(32,64));if(!(D=>"bigint"==typeof D&&zme.BASE.multiplyAndAddUnsafe(D,s,p))(de,Ie,ae(-Le));return!(!xe||!xe.hasEvenY()||xe.toAffine().x!==Ae)}catch{return!1}}F.schnorr={getPublicKey:function h(D){return ue(D).bytes},sign:function A(D,s,p=(0,a.randomBytes)(32)){const Y=(0,m.ensureBytes)("message",D),{bytes:ee,scalar:oe}=ue(s),de=(0,m.ensureBytes)("auxRand",p,32),Ae=te(oe^(0,m.bytesToNumberBE)(q("BIP0340/aux",de))),Ie=q("BIP0340/nonce",Ae,ee,Y),Le=ae((0,m.bytesToNumberBE)(Ie));if(Le===z)throw new Error("sign failed: k is zero");const{bytes:xe,scalar:De}=ue(Le),Xe=o(xe,ee,Y),Te=new Uint8Array(64);if(Te.set(xe,0),Te.set(te(ae(De+Xe*oe)),32),!I(Te,Y,ee))throw new Error("sign: Invalid signature produced");return Te},verify:I,utils:{randomPrivateKey:F.secp256k1.utils.randomPrivateKey,lift_x:K,pointToBytes:re,numberToBytesBE:m.numberToBytesBE,bytesToNumberBE:m.bytesToNumberBE,taggedHash:q,mod:x.mod}};const O=(0,S.isogenyMap)(k,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(D=>D.map(s=>BigInt(s)))),$=(0,B.mapToCurveSimpleSWU)(k,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:k.create(BigInt("-11"))}),H=(0,S.createHasher)(F.secp256k1.ProjectivePoint,D=>{const{x:s,y:p}=$(k.create(D[0]));return O(s,p)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:k.ORDER,m:1,k:128,expand:"xmd",hash:i.sha256});F.hashToCurve=H.hashToCurve,F.encodeToCurve=H.encodeToCurve},68578:(Me,F)=>{"use strict";function f(E){if(!Number.isSafeInteger(E)||E<0)throw new Error(`Wrong positive integer: ${E}`)}function i(E){if("boolean"!=typeof E)throw new Error(`Expected boolean, not ${E}`)}function x(E,...R){if(!function a(E){return E instanceof Uint8Array||null!=E&&"object"==typeof E&&"Uint8Array"===E.constructor.name}(E))throw new Error("Expected Uint8Array");if(R.length>0&&!R.includes(E.length))throw new Error(`Expected Uint8Array of length ${R}, not of length=${E.length}`)}function B(E){if("function"!=typeof E||"function"!=typeof E.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");f(E.outputLen),f(E.blockLen)}function m(E,R=!0){if(E.destroyed)throw new Error("Hash instance has been destroyed");if(R&&E.finished)throw new Error("Hash#digest() has already been called")}function S(E,R){x(E);const M=R.outputLen;if(E.length{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SHA2=void 0;const i=f(68578),a=f(96492);F.SHA2=class B extends a.Hash{constructor(S,g,E,R){super(),this.blockLen=S,this.outputLen=g,this.padOffset=E,this.isLE=R,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(S),this.view=(0,a.createView)(this.buffer)}update(S){(0,i.exists)(this);const{view:g,buffer:E,blockLen:R}=this,M=(S=(0,a.toBytes)(S)).length;for(let _=0;_R-_&&(this.process(E,0),_=0);for(let W=_;W>R&M),j=Number(g&M),k=E?0:4;m.setUint32(S+(E?4:0),_,E),m.setUint32(S+k,j,E)})(E,R-8,BigInt(8*this.length),M),this.process(E,0);const j=(0,a.createView)(S),P=this.outputLen;if(P%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const k=P/4,z=this.get();if(k>z.length)throw new Error("_sha2: outputLen bigger than state");for(let W=0;W{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.add5L=F.add5H=F.add4H=F.add4L=F.add3H=F.add3L=F.add=F.rotlBL=F.rotlBH=F.rotlSL=F.rotlSH=F.rotr32L=F.rotr32H=F.rotrBL=F.rotrBH=F.rotrSL=F.rotrSH=F.shrSL=F.shrSH=F.toBig=F.split=F.fromBig=void 0;const f=BigInt(2**32-1),i=BigInt(32);function a(ye,ue=!1){return ue?{h:Number(ye&f),l:Number(ye>>i&f)}:{h:0|Number(ye>>i&f),l:0|Number(ye&f)}}function x(ye,ue=!1){let K=new Uint32Array(ye.length),o=new Uint32Array(ye.length);for(let h=0;hBigInt(ye>>>0)<>>0);F.toBig=B;const m=(ye,ue,K)=>ye>>>K;F.shrSH=m;const S=(ye,ue,K)=>ye<<32-K|ue>>>K;F.shrSL=S;const g=(ye,ue,K)=>ye>>>K|ue<<32-K;F.rotrSH=g;const E=(ye,ue,K)=>ye<<32-K|ue>>>K;F.rotrSL=E;const R=(ye,ue,K)=>ye<<64-K|ue>>>K-32;F.rotrBH=R;const M=(ye,ue,K)=>ye>>>K-32|ue<<64-K;F.rotrBL=M;const _=(ye,ue)=>ue;F.rotr32H=_;const j=(ye,ue)=>ye;F.rotr32L=j;const P=(ye,ue,K)=>ye<>>32-K;F.rotlSH=P;const k=(ye,ue,K)=>ue<>>32-K;F.rotlSL=k;const z=(ye,ue,K)=>ue<>>64-K;F.rotlBH=z;const W=(ye,ue,K)=>ye<>>64-K;function V(ye,ue,K,o){const h=(ue>>>0)+(o>>>0);return{h:ye+K+(h/2**32|0)|0,l:0|h}}F.rotlBL=W,F.add=V;const Z=(ye,ue,K)=>(ye>>>0)+(ue>>>0)+(K>>>0);F.add3L=Z;const q=(ye,ue,K,o)=>ue+K+o+(ye/2**32|0)|0;F.add3H=q;const re=(ye,ue,K,o)=>(ye>>>0)+(ue>>>0)+(K>>>0)+(o>>>0);F.add4L=re;const te=(ye,ue,K,o,h)=>ue+K+o+h+(ye/2**32|0)|0;F.add4H=te;const ie=(ye,ue,K,o,h)=>(ye>>>0)+(ue>>>0)+(K>>>0)+(o>>>0)+(h>>>0);F.add5L=ie;const ae=(ye,ue,K,o,h,A)=>ue+K+o+h+A+(ye/2**32|0)|0;F.add5H=ae,F.default={fromBig:a,split:x,toBig:B,shrSH:m,shrSL:S,rotrSH:g,rotrSL:E,rotrBH:R,rotrBL:M,rotr32H:_,rotr32L:j,rotlSH:P,rotlSL:k,rotlBH:z,rotlBL:W,add:V,add3L:Z,add3H:q,add4L:re,add4H:te,add5H:ae,add5L:ie}},89948:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.crypto=void 0,F.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},57334:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hkdf=F.expand=F.extract=void 0;const i=f(68578),a=f(96492),x=f(44882);function B(R,M,_){return(0,i.hash)(R),void 0===_&&(_=new Uint8Array(R.outputLen)),(0,x.hmac)(R,(0,a.toBytes)(_),(0,a.toBytes)(M))}F.extract=B;const m=new Uint8Array([0]),S=new Uint8Array;function g(R,M,_,j=32){if((0,i.hash)(R),(0,i.number)(j),j>255*R.outputLen)throw new Error("Length should be <= 255*HashLen");const P=Math.ceil(j/R.outputLen);void 0===_&&(_=S);const k=new Uint8Array(P*R.outputLen),z=x.hmac.create(R,M),W=z._cloneInto(),V=new Uint8Array(z.outputLen);for(let Z=0;Zg(R,B(R,M,_),j,P)},44882:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hmac=F.HMAC=void 0;const i=f(68578),a=f(96492);class x extends a.Hash{constructor(S,g){super(),this.finished=!1,this.destroyed=!1,(0,i.hash)(S);const E=(0,a.toBytes)(g);if(this.iHash=S.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const R=this.blockLen,M=new Uint8Array(R);M.set(E.length>R?S.create().update(E).digest():E);for(let _=0;_new x(m,S).update(g).digest(),F.hmac.create=(m,S)=>new x(m,S)},1806:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.sha224=F.sha256=void 0;const i=f(25724),a=f(96492),x=(M,_,j)=>M&_^~M&j,B=(M,_,j)=>M&_^M&j^_&j,m=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),S=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),g=new Uint32Array(64);class E extends i.SHA2{constructor(){super(64,32,8,!1),this.A=0|S[0],this.B=0|S[1],this.C=0|S[2],this.D=0|S[3],this.E=0|S[4],this.F=0|S[5],this.G=0|S[6],this.H=0|S[7]}get(){const{A:_,B:j,C:P,D:k,E:z,F:W,G:V,H:Z}=this;return[_,j,P,k,z,W,V,Z]}set(_,j,P,k,z,W,V,Z){this.A=0|_,this.B=0|j,this.C=0|P,this.D=0|k,this.E=0|z,this.F=0|W,this.G=0|V,this.H=0|Z}process(_,j){for(let te=0;te<16;te++,j+=4)g[te]=_.getUint32(j,!1);for(let te=16;te<64;te++){const ie=g[te-15],ae=g[te-2],me=(0,a.rotr)(ie,7)^(0,a.rotr)(ie,18)^ie>>>3,ye=(0,a.rotr)(ae,17)^(0,a.rotr)(ae,19)^ae>>>10;g[te]=ye+g[te-7]+me+g[te-16]|0}let{A:P,B:k,C:z,D:W,E:V,F:Z,G:q,H:re}=this;for(let te=0;te<64;te++){const ae=re+((0,a.rotr)(V,6)^(0,a.rotr)(V,11)^(0,a.rotr)(V,25))+x(V,Z,q)+m[te]+g[te]|0,ye=((0,a.rotr)(P,2)^(0,a.rotr)(P,13)^(0,a.rotr)(P,22))+B(P,k,z)|0;re=q,q=Z,Z=V,V=W+ae|0,W=z,z=k,k=P,P=ae+ye|0}P=P+this.A|0,k=k+this.B|0,z=z+this.C|0,W=W+this.D|0,V=V+this.E|0,Z=Z+this.F|0,q=q+this.G|0,re=re+this.H|0,this.set(P,k,z,W,V,Z,q,re)}roundClean(){g.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class R extends E{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}F.sha256=(0,a.wrapConstructor)(()=>new E),F.sha224=(0,a.wrapConstructor)(()=>new R)},44207:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.sha384=F.sha512_256=F.sha512_224=F.sha512=F.SHA512=void 0;const i=f(25724),a=f(35059),x=f(96492),[B,m]=a.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(j=>BigInt(j))),S=new Uint32Array(80),g=new Uint32Array(80);class E extends i.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:P,Al:k,Bh:z,Bl:W,Ch:V,Cl:Z,Dh:q,Dl:re,Eh:te,El:ie,Fh:ae,Fl:me,Gh:ye,Gl:ue,Hh:K,Hl:o}=this;return[P,k,z,W,V,Z,q,re,te,ie,ae,me,ye,ue,K,o]}set(P,k,z,W,V,Z,q,re,te,ie,ae,me,ye,ue,K,o){this.Ah=0|P,this.Al=0|k,this.Bh=0|z,this.Bl=0|W,this.Ch=0|V,this.Cl=0|Z,this.Dh=0|q,this.Dl=0|re,this.Eh=0|te,this.El=0|ie,this.Fh=0|ae,this.Fl=0|me,this.Gh=0|ye,this.Gl=0|ue,this.Hh=0|K,this.Hl=0|o}process(P,k){for(let I=0;I<16;I++,k+=4)S[I]=P.getUint32(k),g[I]=P.getUint32(k+=4);for(let I=16;I<80;I++){const O=0|S[I-15],$=0|g[I-15],H=a.default.rotrSH(O,$,1)^a.default.rotrSH(O,$,8)^a.default.shrSH(O,$,7),D=a.default.rotrSL(O,$,1)^a.default.rotrSL(O,$,8)^a.default.shrSL(O,$,7),s=0|S[I-2],p=0|g[I-2],Y=a.default.rotrSH(s,p,19)^a.default.rotrBH(s,p,61)^a.default.shrSH(s,p,6),ee=a.default.rotrSL(s,p,19)^a.default.rotrBL(s,p,61)^a.default.shrSL(s,p,6),oe=a.default.add4L(D,ee,g[I-7],g[I-16]),de=a.default.add4H(oe,H,Y,S[I-7],S[I-16]);S[I]=0|de,g[I]=0|oe}let{Ah:z,Al:W,Bh:V,Bl:Z,Ch:q,Cl:re,Dh:te,Dl:ie,Eh:ae,El:me,Fh:ye,Fl:ue,Gh:K,Gl:o,Hh:h,Hl:A}=this;for(let I=0;I<80;I++){const O=a.default.rotrSH(ae,me,14)^a.default.rotrSH(ae,me,18)^a.default.rotrBH(ae,me,41),$=a.default.rotrSL(ae,me,14)^a.default.rotrSL(ae,me,18)^a.default.rotrBL(ae,me,41),H=ae&ye^~ae&K,s=a.default.add5L(A,$,me&ue^~me&o,m[I],g[I]),p=a.default.add5H(s,h,O,H,B[I],S[I]),Y=0|s,ee=a.default.rotrSH(z,W,28)^a.default.rotrBH(z,W,34)^a.default.rotrBH(z,W,39),oe=a.default.rotrSL(z,W,28)^a.default.rotrBL(z,W,34)^a.default.rotrBL(z,W,39),de=z&V^z&q^V&q,Ae=W&Z^W&re^Z&re;h=0|K,A=0|o,K=0|ye,o=0|ue,ye=0|ae,ue=0|me,({h:ae,l:me}=a.default.add(0|te,0|ie,0|p,0|Y)),te=0|q,ie=0|re,q=0|V,re=0|Z,V=0|z,Z=0|W;const Ie=a.default.add3L(Y,oe,Ae);z=a.default.add3H(Ie,p,ee,de),W=0|Ie}({h:z,l:W}=a.default.add(0|this.Ah,0|this.Al,0|z,0|W)),({h:V,l:Z}=a.default.add(0|this.Bh,0|this.Bl,0|V,0|Z)),({h:q,l:re}=a.default.add(0|this.Ch,0|this.Cl,0|q,0|re)),({h:te,l:ie}=a.default.add(0|this.Dh,0|this.Dl,0|te,0|ie)),({h:ae,l:me}=a.default.add(0|this.Eh,0|this.El,0|ae,0|me)),({h:ye,l:ue}=a.default.add(0|this.Fh,0|this.Fl,0|ye,0|ue)),({h:K,l:o}=a.default.add(0|this.Gh,0|this.Gl,0|K,0|o)),({h,l:A}=a.default.add(0|this.Hh,0|this.Hl,0|h,0|A)),this.set(z,W,V,Z,q,re,te,ie,ae,me,ye,ue,K,o,h,A)}roundClean(){S.fill(0),g.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}F.SHA512=E;class R extends E{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class M extends E{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class _ extends E{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}F.sha512=(0,x.wrapConstructor)(()=>new E),F.sha512_224=(0,x.wrapConstructor)(()=>new R),F.sha512_256=(0,x.wrapConstructor)(()=>new M),F.sha384=(0,x.wrapConstructor)(()=>new _)},96492:(Me,F,f)=>{"use strict";var i=f(29293).default;Object.defineProperty(F,"__esModule",{value:!0}),F.randomBytes=F.wrapXOFConstructorWithOpts=F.wrapConstructorWithOpts=F.wrapConstructor=F.checkOpts=F.Hash=F.concatBytes=F.toBytes=F.utf8ToBytes=F.asyncLoop=F.nextTick=F.hexToBytes=F.bytesToHex=F.isLE=F.rotr=F.createView=F.u32=F.u8=void 0;const a=f(89948);function m(ue){return ue instanceof Uint8Array||null!=ue&&"object"==typeof ue&&"Uint8Array"===ue.constructor.name}if(F.u8=ue=>new Uint8Array(ue.buffer,ue.byteOffset,ue.byteLength),F.u32=ue=>new Uint32Array(ue.buffer,ue.byteOffset,Math.floor(ue.byteLength/4)),F.createView=ue=>new DataView(ue.buffer,ue.byteOffset,ue.byteLength),F.rotr=(ue,K)=>ue<<32-K|ue>>>K,F.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!F.isLE)throw new Error("Non little-endian hardware is not supported");const E=Array.from({length:256},(ue,K)=>K.toString(16).padStart(2,"0"));F.bytesToHex=function R(ue){if(!m(ue))throw new Error("Uint8Array expected");let K="";for(let o=0;o=M__0&&ue<=M__9?ue-M__0:ue>=M__A&&ue<=M__F?ue-(M__A-10):ue>=M__a&&ue<=M__f?ue-(M__a-10):void 0}function z(){return(z=i(function*(ue,K,o){let h=Date.now();for(let A=0;A=0&&Iue().update(V(h)).digest(),o=ue();return K.outputLen=o.outputLen,K.blockLen=o.blockLen,K.create=()=>ue(),K},F.wrapConstructorWithOpts=function ae(ue){const K=(h,A)=>ue(A).update(V(h)).digest(),o=ue({});return K.outputLen=o.outputLen,K.blockLen=o.blockLen,K.create=h=>ue(h),K},F.wrapXOFConstructorWithOpts=function me(ue){const K=(h,A)=>ue(A).update(V(h)).digest(),o=ue({});return K.outputLen=o.outputLen,K.blockLen=o.blockLen,K.create=h=>ue(h),K},F.randomBytes=function ye(ue=32){if(a.crypto&&"function"==typeof a.crypto.getRandomValues)return a.crypto.getRandomValues(new Uint8Array(ue));throw new Error("crypto.getRandomValues must be defined")}},15315:(Me,F,f)=>{"use strict";var o,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,g=(o,h)=>{var A={};for(var I in o)m.call(o,I)&&h.indexOf(I)<0&&(A[I]=o[I]);if(null!=o&&B)for(var I of B(o))h.indexOf(I)<0&&S.call(o,I)&&(A[I]=o[I]);return A},_=(o,h,A)=>new Promise((I,O)=>{var $=s=>{try{D(A.next(s))}catch(p){O(p)}},H=s=>{try{D(A.throw(s))}catch(p){O(p)}},D=s=>s.done?I(s.value):Promise.resolve(s.value).then($,H);D((A=A.apply(o,h)).next())}),j={};((o,h)=>{for(var A in h)i(o,A,{get:h[A],enumerable:!0})})(j,{createHashMapping:()=>ae,createHashMappingSync:()=>me,decodeJwt:()=>z,decodeSdJwt:()=>V,decodeSdJwtSync:()=>Z,getClaims:()=>q,getClaimsSync:()=>re,getSDAlgAndPayload:()=>ye,splitSdJwt:()=>W,unpack:()=>ue,unpackArray:()=>te,unpackObj:()=>ie,unpackSync:()=>K}),Me.exports=(o=j,((o,h,A,I)=>{if(h&&"object"==typeof h||"function"==typeof h)for(let O of x(h))!m.call(o,O)&&undefined!==O&&i(o,O,{get:()=>h[O],enumerable:!(I=a(h,O))||I.enumerable});return o})(i({},"__esModule",{value:!0}),o));var P=f(47862),k=f(29994),z=o=>{const{0:h,1:A,2:I,length:O}=o.split(".");if(3!==O)throw new P.SDJWTException("Invalid JWT as input");return{header:JSON.parse((0,P.base64urlDecode)(h)),payload:JSON.parse((0,P.base64urlDecode)(A)),signature:I}},W=o=>{const[h,...A]=o.split(k.SD_SEPARATOR);if(0===A.length)return{jwt:h,disclosures:[]};const I=A.pop();return{jwt:h,disclosures:A,kbJwt:I||void 0}},V=(o,h)=>_(void 0,null,function*(){const[A,...I]=o.split(k.SD_SEPARATOR),O=z(A);if(0===I.length)return{jwt:O,disclosures:[]};const $=I.pop(),H=$?z($):void 0,{_sd_alg:D}=ye(O.payload);return{jwt:O,disclosures:yield Promise.all(I.map(p=>P.Disclosure.fromEncode(p,{alg:D,hasher:h}))),kbJwt:H}}),Z=(o,h)=>{const[A,...I]=o.split(k.SD_SEPARATOR),O=z(A);if(0===I.length)return{jwt:O,disclosures:[]};const $=I.pop(),H=$?z($):void 0,{_sd_alg:D}=ye(O.payload);return{jwt:O,disclosures:I.map(p=>P.Disclosure.fromEncodeSync(p,{alg:D,hasher:h})),kbJwt:H}},q=(o,h,A)=>_(void 0,null,function*(){const{unpackedObj:I}=yield ue(o,h,A);return I}),re=(o,h,A)=>{const{unpackedObj:I}=K(o,h,A);return I},te=(o,h,A="")=>{const I={},O=[];return o.forEach(($,H)=>{if("object"==typeof $&&null!==$){const D=$[k.SD_LIST_KEY];if(D){const s=h[D];if(s){const p=A?`${A}.${H}`:`${H}`;I[p]=D;const{unpackedObj:Y,disclosureKeymap:ee}=ie(s.value,h,p);O.push(Y),Object.assign(I,ee)}}else{const s=A?`${A}.${H}`:`${H}`,{unpackedObj:p,disclosureKeymap:Y}=ie($,h,s);O.push(p),Object.assign(I,Y)}}else O.push($)}),{unpackedObj:O,disclosureKeymap:I}},ie=(o,h,A="")=>{const I={};if("object"==typeof o&&null!==o){if(Array.isArray(o))return te(o,h,A);for(const p in o)if(p!==k.SD_DIGEST&&p!==k.SD_LIST_KEY&&"object"==typeof o[p]){const Y=A?`${A}.${p}`:p,{unpackedObj:ee,disclosureKeymap:oe}=ie(o[p],h,Y);o[p]=ee,Object.assign(I,oe)}const O=o,{_sd:$}=O,H=g(O,["_sd"]),D={};if($)for(const p of $){const Y=h[p];if(Y?.key){const ee=A?`${A}.${Y.key}`:Y.key;I[ee]=p;const{unpackedObj:oe,disclosureKeymap:de}=ie(Y.value,h,ee);D[Y.key]=oe,Object.assign(I,de)}}return{unpackedObj:Object.assign(H,D),disclosureKeymap:I}}return{unpackedObj:o,disclosureKeymap:I}},ae=(o,h)=>_(void 0,null,function*(){const A={};for(let I=0;I{const A={};for(let I=0;I{const h=o,{_sd_alg:A}=h,I=g(h,["_sd_alg"]);return"string"!=typeof A?{_sd_alg:"sha-256",payload:I}:{_sd_alg:A,payload:I}},ue=(o,h,A)=>_(void 0,null,function*(){const{_sd_alg:I,payload:O}=ye(o),H=yield ae(h,{hasher:A,alg:I});return ie(O,H)}),K=(o,h,A)=>{const{_sd_alg:I,payload:O}=ye(o),H=me(h,{hasher:A,alg:I});return ie(O,H)}},22084:(Me,F,f)=>{"use strict";var re,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.prototype.hasOwnProperty,E=(re,te,ie)=>new Promise((ae,me)=>{var ye=o=>{try{K(ie.next(o))}catch(h){me(h)}},ue=o=>{try{K(ie.throw(o))}catch(h){me(h)}},K=o=>o.done?ae(o.value):Promise.resolve(o.value).then(ye,ue);K((ie=ie.apply(re,te)).next())}),R={};((re,te)=>{for(var ie in te)i(re,ie,{get:te[ie],enumerable:!0})})(R,{createHashMappingForSerializedDisclosure:()=>Z,present:()=>z,presentSync:()=>W,presentableKeys:()=>P,presentableKeysSync:()=>k,selectDisclosures:()=>q,transformPresentationFrame:()=>V}),Me.exports=(re=R,((re,te,ie,ae)=>{if(te&&"object"==typeof te||"function"==typeof te)for(let me of x(te))!B.call(re,me)&&undefined!==me&&i(re,me,{get:()=>te[me],enumerable:!(ae=a(te,me))||ae.enumerable});return re})(i({},"__esModule",{value:!0}),re));var M=f(29994),_=f(47862),j=f(15315),P=(re,te,ie)=>E(void 0,null,function*(){const{disclosureKeymap:ae}=yield(0,j.unpack)(re,te,ie);return Object.keys(ae).sort()}),k=(re,te,ie)=>{const{disclosureKeymap:ae}=(0,j.unpackSync)(re,te,ie);return Object.keys(ae).sort()},z=(re,te,ie)=>E(void 0,null,function*(){const{jwt:ae,kbJwt:me}=(0,j.splitSdJwt)(re),{jwt:{payload:ye},disclosures:ue}=yield(0,j.decodeSdJwt)(re,ie),{_sd_alg:K}=(0,j.getSDAlgAndPayload)(ye),o={alg:K,hasher:ie},h=V(te),A=yield(0,j.createHashMapping)(ue,o),{disclosureKeymap:I}=yield(0,j.unpack)(ye,ue,ie);return[ae,...h.map($=>A[I[$]]).filter($=>void 0!==$).map($=>$.encode()),me??""].join(M.SD_SEPARATOR)}),W=(re,te,ie)=>{const{jwt:ae,kbJwt:me}=(0,j.splitSdJwt)(re),{jwt:{payload:ye},disclosures:ue}=(0,j.decodeSdJwtSync)(re,ie),{_sd_alg:K}=(0,j.getSDAlgAndPayload)(ye),o={alg:K,hasher:ie},h=V(te),A=(0,j.createHashMappingSync)(ue,o),{disclosureKeymap:I}=(0,j.unpackSync)(ye,ue,ie);return[ae,...h.map($=>A[I[$]]).filter($=>void 0!==$).map($=>$.encode()),me??""].join(M.SD_SEPARATOR)},V=(re,te="")=>Object.entries(re).reduce((ie,[ae,me])=>{const ye=te?`${te}.${ae}`:ae;return"boolean"==typeof me?me&&ie.push(ye):ie.push(ye,...V(me,ye)),ie},[]),Z=re=>{const te={};for(let ie=0;ie{if(0===te.length)return[];const ae=Z(te),{disclosureKeymap:me}=(0,j.unpackObj)(re,ae);return V(ie).map(o=>ae[me[o]]).filter(o=>void 0!==o).map(o=>{const{salt:h,key:A,value:I,_digest:O}=o;if(!O)throw new _.SDJWTException("Implementation error: _digest is not defined");return{digest:O,encoded:o.encode(),salt:h,key:A,value:I}})}},29994:Me=>{"use strict";var j,F=Object.defineProperty,f=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,S={};((j,P)=>{for(var k in P)F(j,k,{get:P[k],enumerable:!0})})(S,{KB_JWT_TYP:()=>_,SD_DECOY:()=>M,SD_DIGEST:()=>R,SD_LIST_KEY:()=>E,SD_SEPARATOR:()=>g}),Me.exports=(j=S,((j,P,k,z)=>{if(P&&"object"==typeof P||"function"==typeof P)for(let W of i(P))!a.call(j,W)&&undefined!==W&&F(j,W,{get:()=>P[W],enumerable:!(z=f(P,W))||z.enumerable});return j})(F({},"__esModule",{value:!0}),j));var g="~",E="...",R="_sd",M="_sd_decoy",_="kb+jwt"},47862:(Me,F,f)=>{"use strict";var W,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.prototype.hasOwnProperty,E=(W,V,Z)=>new Promise((q,re)=>{var te=me=>{try{ae(Z.next(me))}catch(ye){re(ye)}},ie=me=>{try{ae(Z.throw(me))}catch(ye){re(ye)}},ae=me=>me.done?q(me.value):Promise.resolve(me.value).then(te,ie);ae((Z=Z.apply(W,V)).next())}),R={};((W,V)=>{for(var Z in V)i(W,Z,{get:V[Z],enumerable:!0})})(R,{Disclosure:()=>z,SDJWTException:()=>k,base64urlDecode:()=>j,base64urlEncode:()=>_,uint8ArrayToBase64Url:()=>P}),Me.exports=(W=R,((W,V,Z,q)=>{if(V&&"object"==typeof V||"function"==typeof V)for(let re of x(V))!B.call(W,re)&&undefined!==re&&i(W,re,{get:()=>V[re],enumerable:!(q=a(V,re))||q.enumerable});return W})(i({},"__esModule",{value:!0}),W));var M=f(12398),_=M.Base64.encodeURI,j=M.Base64.decode,P=W=>M.Base64.fromUint8Array(W,!0),k=class hO extends Error{constructor(V,Z){super(V),Object.setPrototypeOf(this,hO.prototype),this.name="SDJWTException",this.details=Z}getFullMessage(){return`${this.name}: ${this.message} ${this.details?`- ${JSON.stringify(this.details)}`:""}`}},z=class _M{constructor(V,Z){if(this._digest=Z?.digest,this._encoded=Z?.encoded,2===V.length)return this.salt=V[0],void(this.value=V[1]);if(3===V.length)return this.salt=V[0],this.key=V[1],void(this.value=V[2]);throw new k("Invalid disclosure data")}static fromEncode(V,Z){return E(this,null,function*(){const{hasher:q,alg:re}=Z,te=yield q(V,re),ie=P(te),ae=JSON.parse(j(V));return _M.fromArray(ae,{digest:ie,encoded:V})})}static fromEncodeSync(V,Z){const{hasher:q,alg:re}=Z,te=q(V,re),ie=P(te),ae=JSON.parse(j(V));return _M.fromArray(ae,{digest:ie,encoded:V})}static fromArray(V,Z){return new _M(V,Z)}encode(){return this._encoded||(this._encoded=_(JSON.stringify(this.decode()))),this._encoded}decode(){return this.key?[this.salt,this.key,this.value]:[this.salt,this.value]}digest(V){return E(this,null,function*(){const{hasher:Z,alg:q}=V;if(!this._digest){const re=yield Z(this.encode(),q);this._digest=P(re)}return this._digest})}digestSync(V){const{hasher:Z,alg:q}=V;if(!this._digest){const re=Z(this.encode(),q);this._digest=P(re)}return this._digest}}},47636:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(83858),F)},66091:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},80723:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},25515:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},18414:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},95517:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},37728:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},39762:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Directives=void 0,F.Directives={Required:"required",Allowed:"allowed",Disallowed:"disallowed"}},891:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ExchangeStatus=void 0,F.ExchangeStatus={Created:"CREATED",Submitted:"SUBMITTED",HolderDeclined:"HOLDER_DECLINED",Expired:"EXPIRED",Accepted:"ACCEPTED",VerifierDeclined:"VERIFIER_DECLINED"}},67847:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},40826:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},56911:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},17954:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},79506:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},23843:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},39711:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},5179:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},68020:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},54078:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},81755:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},83947:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},73725:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},87260:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},75873:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},83858:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(66091),F),a(f(80723),F),a(f(25515),F),a(f(18414),F),a(f(95517),F),a(f(37728),F),a(f(39762),F),a(f(891),F),a(f(67847),F),a(f(40826),F),a(f(56911),F),a(f(17954),F),a(f(79506),F),a(f(23843),F),a(f(39711),F),a(f(5179),F),a(f(68020),F),a(f(54078),F),a(f(81755),F),a(f(83947),F),a(f(73725),F),a(f(87260),F),a(f(75873),F),a(f(99959),F),a(f(41787),F),a(f(25526),F),a(f(8946),F),a(f(62704),F),a(f(13065),F),a(f(42834),F),a(f(32206),F),a(f(35723),F),a(f(31748),F),a(f(80125),F),a(f(9668),F),a(f(57669),F),a(f(56179),F),a(f(79369),F),a(f(6982),F),a(f(46521),F),a(f(28858),F),a(f(78029),F),a(f(3296),F)},99959:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},41787:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},25526:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Optionality=void 0,F.Optionality={Required:"required",Preferred:"preferred"}},8946:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},62704:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},13065:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},42834:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},32206:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},35723:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},31748:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},80125:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},9668:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},57669:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Rules=void 0,F.Rules={All:"all",Pick:"pick"}},56179:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},79369:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},6982:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Status=void 0,F.Status={Success:"SUCCESS",Warn:"WARN",Error:"ERROR"}},46521:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},28858:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},78029:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},3296:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},30720:(Me,F,f)=>{"use strict";F.E8=void 0;const a=f(2700);Object.defineProperty(F,"E8",{enumerable:!0,get:function(){return a.PEX}})},55776:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hasErrors=F.Checked=F.Status=void 0,F.Status={INFO:"info",WARN:"warn",ERROR:"error"},F.Checked=class{constructor(a,x,B){this.tag=a,this.status=x,this.message=B}},F.hasErrors=a=>a.filter(B=>function x(B){return B.status===F.Status.ERROR}(B)).length>0},97889:function(Me,F,f){"use strict";var i=this&&this.__awaiter||function(M,_,j,P){return new(j||(j=Promise))(function(z,W){function V(re){try{q(P.next(re))}catch(te){W(te)}}function Z(re){try{q(P.throw(re))}catch(te){W(te)}}function q(re){re.done?z(re.value):function k(z){return z instanceof j?z:new j(function(W){W(z)})}(re.value).then(V,Z)}q((P=P.apply(M,_||[])).next())})};Object.defineProperty(F,"__esModule",{value:!0}),F.PEX=void 0;const a=f(11151),x=f(55776),B=f(70143),m=f(64864),S=f(99938),g=f(13486),E=f(80930);class R{constructor(_){this._evaluationClientWrapper=new B.EvaluationClientWrapper,this.options=_}evaluatePresentation(_,j,P){var k,z,W;const V=void 0!==P?.generatePresentationSubmission?P.generatePresentationSubmission:void 0===P?.presentationSubmission,Z=S.SSITypesBuilder.toInternalPresentationDefinition(_),q=JSON.parse(JSON.stringify(j)),re=S.SSITypesBuilder.mapExternalVerifiablePresentationToWrappedVP(q,null===(k=this.options)||void 0===k?void 0:k.hasher),te=null!==(z=P?.presentationSubmission)&&void 0!==z?z:re.decoded.presentation_submission;if(!te&&!V)throw Error("Either a presentation submission as part of the VP or provided separately was expected");const ie=a.CredentialMapper.isW3cPresentation(re.presentation)&&re.presentation.holder?[re.presentation.holder]:[],ae=Object.assign(Object.assign({},P),{holderDIDs:ie,presentationSubmission:te,generatePresentationSubmission:V}),me=this._evaluationClientWrapper.evaluate(Z,re.vcs,ae);return!(null===(W=me.value)||void 0===W)&&W.descriptor_map.length&&(new B.EvaluationClientWrapper).selectFrom(Z,re.vcs,ae).areRequiredCredentialsPresent!==x.Status.ERROR&&(me.errors=[]),me}evaluateCredentials(_,j,P){var k;const z=S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j,null===(k=this.options)||void 0===k?void 0:k.hasher);this._evaluationClientWrapper=new B.EvaluationClientWrapper;const W=S.SSITypesBuilder.toInternalPresentationDefinition(_),V=this._evaluationClientWrapper.evaluate(W,z,P);if(V.value&&V.value.descriptor_map.length){const q=(new B.EvaluationClientWrapper).selectFrom(W,z,P);V.areRequiredCredentialsPresent=q.areRequiredCredentialsPresent,V.errors=q.errors}else V.areRequiredCredentialsPresent=x.Status.ERROR;return V}selectFrom(_,j,P){var k;const z=JSON.parse(JSON.stringify(j)),W=S.SSITypesBuilder.toInternalPresentationDefinition(_);return this._evaluationClientWrapper=new B.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(W,S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(z,null===(k=this.options)||void 0===k?void 0:k.hasher),P)}presentationSubmissionFrom(_,j,P){var k;const z=S.SSITypesBuilder.toInternalPresentationDefinition(_);return this._evaluationClientWrapper.submissionFrom(z,S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j,null===(k=this.options)||void 0===k?void 0:k.hasher),P)}presentationFrom(_,j,P){var k,z;const W=this.presentationSubmissionFrom(_,j,P),V=j.some(re=>a.CredentialMapper.isSdJwtDecodedCredential(re)||a.CredentialMapper.isSdJwtEncoded(re));if(P?.presentationSubmissionLocation===m.PresentationSubmissionLocation.PRESENTATION&&V)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const Z=null!==(k=P?.presentationSubmissionLocation)&&void 0!==k?k:V?m.PresentationSubmissionLocation.EXTERNAL:m.PresentationSubmissionLocation.PRESENTATION;return{presentation:R.constructPresentation(j,Object.assign(Object.assign({},P),{presentationSubmission:Z===m.PresentationSubmissionLocation.PRESENTATION?W:void 0,hasher:null===(z=this.options)||void 0===z?void 0:z.hasher})),presentationSubmissionLocation:Z,presentationSubmission:W}}static constructPresentation(_,j){var P,k,z,W;const V=Array.isArray(_)?_:[_];if(V.some(Z=>a.CredentialMapper.isSdJwtDecodedCredential(Z)||a.CredentialMapper.isSdJwtEncoded(Z))){if(V.length>1)throw new Error("Only a single credential is supported when creating a presentation with an SD-JWT VC");if(j?.presentationSubmission)throw new Error("Presentation submission cannot be included in the presentation when creating a presentation with an SD-JWT VC");if(j?.basePresentationPayload)throw new Error("Base presentation payload cannot be when creating a presentation from an SD-JWT VC");const Z=a.CredentialMapper.isSdJwtEncoded(V[0])?a.CredentialMapper.decodeVerifiableCredential(V[0],j?.hasher):V[0];if(!j?.hasher)throw new Error("Hasher must be provided when creating a presentation with an SD-JWT VC");const q=null!==(P=Z.signedPayload._sd_alg)&&void 0!==P?P:"sha-256",re=(0,g.calculateSdHash)(Z.compactSdJwtVc,q,j.hasher),te={header:{typ:"kb+jwt"},payload:{iat:(new Date).getTime(),_sd_hash:re}};return Object.assign(Object.assign({},Z),{kbJwt:te})}{if(!_)throw Error("At least a verifiable credential needs to be passed in to create a presentation");const Z=Array.isArray(_)?_:[_],q=Z.map(me=>a.CredentialMapper.toWrappedVerifiableCredential(me)),re=Array.from(new Set(q.flatMap(me=>(0,g.getSubjectIdsAsString)(me.credential))));1!==re.length&&!j?.holderDID&&console.log(`We deduced ${re.length} subject from ${q.length} Verifiable Credentials, and no holder property was given. This might lead to undesired results`);const te=null!==(k=j?.holderDID)&&void 0!==k?k:1===re.length?re[0]:void 0,ie=null!==(z=j?.basePresentationPayload)&&void 0!==z&&z.type?Array.isArray(j.basePresentationPayload.type)?j.basePresentationPayload.type:[j.basePresentationPayload.type]:[];ie.includes("VerifiablePresentation")||ie.push("VerifiablePresentation");const ae=null!==(W=j?.basePresentationPayload)&&void 0!==W&&W["@context"]?Array.isArray(j.basePresentationPayload["@context"])?j.basePresentationPayload["@context"]:[j.basePresentationPayload["@context"]]:[];return ae.includes("https://www.w3.org/2018/credentials/v1")||ae.push("https://www.w3.org/2018/credentials/v1"),j?.presentationSubmission&&(ie.includes("PresentationSubmission")||ie.push("PresentationSubmission"),ae.includes("https://identity.foundation/presentation-exchange/submission/v1")||ae.push("https://identity.foundation/presentation-exchange/submission/v1")),Object.assign(Object.assign(Object.assign(Object.assign({},j?.basePresentationPayload),{"@context":ae,type:ie,holder:te}),!!j?.presentationSubmission&&{presentation_submission:j.presentationSubmission}),{verifiableCredential:Z})}}static validateDefinition(_){const j=(0,g.definitionVersionDiscovery)(_);if(j.error)throw new Error(j.error);const P=[];return P.push(j.version===S.PEVersion.v1?{bundler:new E.PresentationDefinitionV1VB("root"),target:S.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(_)}:{bundler:new E.PresentationDefinitionV2VB("root"),target:S.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(_)}),(new E.ValidationEngine).validate(P)}static validateSubmission(_){return(new E.ValidationEngine).validate([{bundler:new E.PresentationSubmissionVB("root"),target:_}])}verifiablePresentationFrom(_,j,P,k){return i(this,void 0,void 0,function*(){var z,W;const{holderDID:V,signatureOptions:Z,proofOptions:q}=k,te=V?[V]:[],ie=function re(){let A=[];if(q?.typeSupportsSelectiveDisclosure){if(!q?.type)throw Error("Please provide a proof type if you enable selective disclosure");A=[q.type]}return A}(),ae=this.evaluateCredentials(_,j,{holderDIDs:te,limitDisclosureSignatureSuites:ie}),me=this.presentationFrom(_,ae.verifiableCredential,k),ye=this.evaluatePresentation(_,me.presentation,Object.assign({limitDisclosureSignatureSuites:ie},me.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&{presentationSubmission:me.presentationSubmission}));if(!ye.value)throw new Error("Could not get evaluation results from presentationResult");const ue={type:q?.type,verificationMethod:Z?.verificationMethod,created:q?.created?q.created:(new Date).toISOString(),proofPurpose:q?.proofPurpose,proofValue:Z?.proofValue,jws:Z?.jws,challenge:q?.challenge,nonce:q?.nonce,domain:q?.domain};let K=me.presentation;if(a.CredentialMapper.isSdJwtDecodedCredential(me.presentation)){if(null===(z=this.options)||void 0===z||!z.hasher)throw new Error("Hasher must be provided when creating a presentation with an SD-JWT VC");const A=null!==(W=me.presentation.signedPayload._sd_alg)&&void 0!==W?W:"sha-256",I=(0,g.calculateSdHash)(me.presentation.compactSdJwtVc,A,this.options.hasher),O={header:{typ:"kb+jwt"},payload:{iat:(new Date).getTime(),nonce:q?.nonce,_sd_hash:I}};K=Object.assign(Object.assign({},K),{kbJwt:O})}const o={options:Object.assign(Object.assign({},k),{presentationSubmissionLocation:me.presentationSubmissionLocation}),presentation:K,presentationDefinition:_,selectedCredentials:j,proof:ue,presentationSubmission:ye.value,evaluationResults:ye};return{verifiablePresentation:yield P(o),presentationSubmissionLocation:me.presentationSubmissionLocation,presentationSubmission:ye.value}})}static definitionVersionDiscovery(_){return(0,g.definitionVersionDiscovery)(_)}}F.PEX=R},38992:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv1=void 0;const i=f(11151),a=f(97889),x=f(70143),B=f(64864),m=f(99938),S=f(80930);F.PEXv1=class g extends a.PEX{evaluatePresentation(R,M,_){return m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),super.evaluatePresentation(R,M,_)}evaluateCredentials(R,M,_){return m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),super.evaluateCredentials(R,M,_)}selectFrom(R,M,_){const j=JSON.parse(JSON.stringify(M));return this._evaluationClientWrapper=new x.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j),_)}presentationFrom(R,M,_){var j;const P=this._evaluationClientWrapper.submissionFrom(m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(M),_),k=M.some(V=>i.CredentialMapper.isSdJwtDecodedCredential(V)||i.CredentialMapper.isSdJwtEncoded(V));if(_?.presentationSubmissionLocation===B.PresentationSubmissionLocation.PRESENTATION&&k)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const z=null!==(j=_?.presentationSubmissionLocation)&&void 0!==j?j:k?B.PresentationSubmissionLocation.EXTERNAL:B.PresentationSubmissionLocation.PRESENTATION;return{presentation:a.PEX.constructPresentation(M,Object.assign(Object.assign({},_),{presentationSubmission:z===B.PresentationSubmissionLocation.PRESENTATION?P:void 0})),presentationSubmissionLocation:z,presentationSubmission:P}}static validateDefinition(R){const M=m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R);return(new S.ValidationEngine).validate([{bundler:new S.PresentationDefinitionV1VB("root"),target:M}])}static validateSubmission(R){return a.PEX.validateSubmission(R)}}},71945:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv2=void 0;const i=f(11151),a=f(97889),x=f(70143),B=f(64864),m=f(99938),S=f(80930);F.PEXv2=class g extends a.PEX{evaluatePresentation(R,M,_){return m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),super.evaluatePresentation(R,M,_)}evaluateCredentials(R,M,_){return m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),super.evaluateCredentials(R,M,_)}selectFrom(R,M,_){return this._evaluationClientWrapper=new x.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(M),_)}presentationFrom(R,M,_){var j;const P=this._evaluationClientWrapper.submissionFrom(m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(M),_),k=M.some(V=>i.CredentialMapper.isSdJwtDecodedCredential(V)||i.CredentialMapper.isSdJwtEncoded(V));if(_?.presentationSubmissionLocation===B.PresentationSubmissionLocation.PRESENTATION&&k)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const z=null!==(j=_?.presentationSubmissionLocation)&&void 0!==j?j:k?B.PresentationSubmissionLocation.EXTERNAL:B.PresentationSubmissionLocation.PRESENTATION;return{presentation:a.PEX.constructPresentation(M,Object.assign(Object.assign({},_),{presentationSubmission:z===B.PresentationSubmissionLocation.PRESENTATION?P:void 0})),presentationSubmissionLocation:z,presentationSubmission:P}}static validateDefinition(R){const M=m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R);return(new S.ValidationEngine).validate([{bundler:new S.PresentationDefinitionV2VB("root"),target:M}])}static validateSubmission(R){return a.PEX.validateSubmission(R)}}},38947:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},45994:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.HandlerCheckResult=void 0,F.HandlerCheckResult=class{constructor(i,a,x,B,m,S){this.input_descriptor_path=i,this.verifiable_credential_path=a,this.evaluator=x,this.status=B,this.message=m,this.payload=S}}},92127:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(38947),F),a(f(45994),F),a(f(83565),F),a(f(21235),F)},83565:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},21235:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},50950:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.EvaluationClient=void 0;const a=f(11151),x=f(55776),B=i(f(24080)),m=f(13486),S=f(71001),g=[a.IProofType.BbsBlsSignatureProof2020,"DataIntegrityProof.anoncreds-2023"];F.EvaluationClient=class E{constructor(){this.failed_catched={tag:"root",status:x.Status.ERROR,message:B.default.UNKNOWN_EXCEPTION,stacktrace:""},this._results=[],this._wrappedVcs=[],this._presentationSubmission={},this._dids=[],this._limitDisclosureSignatureSuites=g,this._restrictToDIDMethods=[],this._generatePresentationSubmission=!0}evaluate(M,_,j){this._restrictToDIDMethods=j?.restrictToDIDMethods?(0,m.uniformDIDMethods)(j?.restrictToDIDMethods):[],this._dids=j?.holderDIDs?(0,m.filterToRestrictedDIDs)(j.holderDIDs,this._restrictToDIDMethods):[],this._limitDisclosureSignatureSuites=j?.limitDisclosureSignatureSuites,this._restrictToFormats=j?.restrictToFormats,this._generatePresentationSubmission=void 0===j?.generatePresentationSubmission||j.generatePresentationSubmission,j?.presentationSubmission&&(this._presentationSubmission=j.presentationSubmission);let P=this.initEvaluationHandlers();for(P?.handle(M,_);P?.hasNext();){P=P.getNext();try{P?.handle(M,_)}catch(k){throw this.failed_catched.message+=k.message,this.failed_catched.stacktrace=k,this.failed_catched}}}get results(){return this._results}get dids(){return this._dids}set dids(M){this._dids=M}assertPresentationSubmission(){if("string"==typeof this._presentationSubmission&&(console.log("Presentation submission present, but as string not object. External calls did not follow contract. Correcting"),this._presentationSubmission=JSON.parse(this._presentationSubmission)),!(this.generatePresentationSubmission||this.presentationSubmission&&0!==Object.keys(this.presentationSubmission).length))throw Error("No presentation submission present, but required option was set")}get generatePresentationSubmission(){return this._generatePresentationSubmission}set generatePresentationSubmission(M){this._generatePresentationSubmission=M}get presentationSubmission(){return this._presentationSubmission}set presentationSubmission(M){this._presentationSubmission=M}get wrappedVcs(){return this._wrappedVcs}set wrappedVcs(M){this._wrappedVcs=M}get limitDisclosureSignatureSuites(){return this._limitDisclosureSignatureSuites||g}set limitDisclosureSignatureSuites(M){this._limitDisclosureSignatureSuites=M}get restrictToDIDMethods(){return this._restrictToDIDMethods}set restrictToDIDMethods(M){this._restrictToDIDMethods=(0,m.uniformDIDMethods)(M)}hasRestrictToDIDMethods(){return this.restrictToDIDMethods&&this.restrictToDIDMethods.length>0}get restrictToFormats(){return this._restrictToFormats}set restrictToFormats(M){this._restrictToFormats=M}initEvaluationHandlers(){const M=new S.UriEvaluationHandler(this);return M.setNext(new S.DIDRestrictionEvaluationHandler(this)).setNext(new S.FormatRestrictionEvaluationHandler(this)).setNext(new S.InputDescriptorFilterEvaluationHandler(this)).setNext(new S.PredicateRelatedFieldEvaluationHandler(this)).setNext(new S.LimitDisclosureEvaluationHandler(this)).setNext(new S.SubjectIsIssuerEvaluationHandler(this)).setNext(new S.SubjectIsHolderEvaluationHandler(this)).setNext(new S.SameSubjectEvaluationHandler(this)).setNext(new S.MarkForSubmissionEvaluationHandler(this)),M}}},78995:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.EvaluationClientWrapper=void 0;const i=f(44273),a=f(47636),x=f(11151),B=f(55776),m=f(64864),S=f(13486),g=f(50950);F.EvaluationClientWrapper=class E{constructor(){this._client=new g.EvaluationClient}getEvaluationClient(){return this._client}selectFrom(M,_,j){var P;let k;this._client.evaluate(M,_,j);const z=[...this.formatNotInfo(B.Status.WARN)],W=[...this.formatNotInfo(B.Status.ERROR)];if(M.submission_requirements){const V=this._client.results.filter(ae=>"MarkForSubmissionEvaluation"===ae.evaluator&&ae.payload.group&&ae.status!==B.Status.ERROR),Z=Array.from(new Set(V));let q;try{q=this.matchSubmissionRequirements(M,M.submission_requirements,Z)}catch(ae){const me={status:B.Status.ERROR,message:JSON.stringify(ae),tag:"matchSubmissionRequirements"};return{errors:W?[...W,me]:[me],warnings:z,areRequiredCredentialsPresent:B.Status.ERROR}}const te=this.extractMatches(q).map(ae=>i.JSONPath.nodes(this._client.wrappedVcs.map(me=>me.original),ae)[0].value),ie=this.determineAreRequiredCredentialsPresent(M,q);k={errors:ie===B.Status.INFO?[]:W,matches:[...q],areRequiredCredentialsPresent:ie,verifiableCredential:te,warnings:z}}else{const V=this._client.results.filter(q=>"MarkForSubmissionEvaluation"===q.evaluator&&q.status!==B.Status.ERROR);if(this.checkWithoutSubmissionRequirements(V,M).length)return{errors:W,matches:[],areRequiredCredentialsPresent:B.Status.ERROR,verifiableCredential:_.map(q=>q.original),warnings:z};{const q=this.matchWithoutSubmissionRequirements(V,M),te=this.extractMatches(q).map(ie=>i.JSONPath.nodes(this._client.wrappedVcs.map(ae=>ae.original),ie)[0].value);k={errors:[],matches:[...q],areRequiredCredentialsPresent:B.Status.INFO,verifiableCredential:te,warnings:z}}}return this.fillSelectableCredentialsToVerifiableCredentialsMapping(k,_),k.areRequiredCredentialsPresent=this.determineAreRequiredCredentialsPresent(M,k?.matches),this.remapMatches(_.map(V=>V.original),k.matches,k?.verifiableCredential),null===(P=k.matches)||void 0===P||P.forEach(V=>{this.updateSubmissionRequirementMatchPathToAlias(V,"verifiableCredential")}),k.areRequiredCredentialsPresent===B.Status.INFO?k.errors=[]:(k.errors=W,k.warnings=z,k.verifiableCredential=_.map(V=>V.original)),k}remapMatches(M,_,j){_?.forEach(P=>{P.from_nested?this.remapMatches(M,P.from_nested,j):P.vc_path.forEach((k,z,W)=>{const V=i.JSONPath.query(M,k)[0],Z=j?.findIndex(q=>JSON.stringify(q)===JSON.stringify(V));if(-1===Z)throw new Error(`The index of the VerifiableCredential in your current call can't be found in your previously submitted credentials. Are you trying to send a new Credential?\nverifiableCredential: ${V}`);W[z]=`$[${Z}]`})})}extractMatches(M){const _=[];return M.forEach(j=>{_.push(...j.vc_path),j.from_nested&&_.push(...this.extractMatches(j.from_nested))}),Array.from(new Set(_))}checkWithoutSubmissionRequirements(M,_){const j=[];if(!_.input_descriptors)return[];if(!M.length)return[{input_descriptor_path:"",evaluator:"checkWithoutSubmissionRequirement",verifiable_credential_path:"",status:B.Status.ERROR,payload:"Not all the InputDescriptors are addressed"}];const P=_.input_descriptors,k=S.ObjectUtils.getDistinctFieldInObject(M,"input_descriptor_path");if(k.length!==P.length){const z=k.map(W=>S.JsonPathUtils.extractInputField(_,[W])[0].value).map(W=>W.id);for(let W=0;W<_.input_descriptors.length;W++)-1==z.indexOf(_.input_descriptors[W].id)&&j.push({input_descriptor_path:`$.input_descriptors[${W}]`,evaluator:"checkWithoutSubmissionRequirement",verifiable_credential_path:"",status:B.Status.ERROR,payload:"Not all the InputDescriptors are addressed"})}return j}matchSubmissionRequirements(M,_,j){const P=[];for(const k of _){const z={name:M.name||M.id,rule:k.rule,vc_path:[]};if(k.from&&(z.from=k.from),k.min&&(z.min=k.min),k.max&&(z.max=k.max),k.count&&(z.count=k.count),k.from){const W=this.mapMatchingDescriptors(M,k,j);W&&(z.vc_path.push(...W.vc_path),z.name=W.name,P.push(z))}else{if(!k.from_nested)throw new Error("Invalid SubmissionRequirement object: Must contain either 'from' or 'from_nested'");try{z.from_nested=this.matchSubmissionRequirements(M,k.from_nested,j),P.push(z)}catch(W){throw new Error(`Error in handling value of from_nested: ${k.from_nested}: err: ${W}`)}}}return P}matchWithoutSubmissionRequirements(M,_){const j=[],P=this.createIdToVcMap(M);for(const[k,z]of P.entries())if(z&&z.length)for(const W of z){const V=S.JsonPathUtils.extractInputField(_,[k]);V.length&&j.push({name:V[0].value.name||V[0].value.id,rule:a.Rules.All,vc_path:[W]})}return this.removeDuplicateSubmissionRequirementMatches(j)}mapMatchingDescriptors(M,_,j){var P;const k={rule:_.rule,vc_path:[]};if(_?.from){k.from=_.from;for(const z of j){const W=i.JSONPath.query(M,z.input_descriptor_path)[0];W.group&&-1===W.group.indexOf(_.from)||(k.name=W.name||W.id,z.payload.group.includes(_.from)&&-1===(null===(P=k.vc_path)||void 0===P?void 0:P.indexOf(z.verifiable_credential_path))&&k.vc_path.push(z.verifiable_credential_path))}}return k}evaluate(M,_,j){var P,k,z,W;this._client.evaluate(M,_,j);const V={areRequiredCredentialsPresent:B.Status.INFO,verifiableCredential:_.map(Z=>Z.original)};if(V.warnings=this.formatNotInfo(B.Status.WARN),V.errors=this.formatNotInfo(B.Status.ERROR),this._client.assertPresentationSubmission(),null!==(P=this._client.presentationSubmission)&&void 0!==P&&P.descriptor_map.length){const Z=null===(k=this._client.presentationSubmission)||void 0===k?void 0:k.descriptor_map.length;for(let q=0;qZ.original),V.areRequiredCredentialsPresent=null!==(W=null===(z=V.value)||void 0===z?void 0:z.descriptor_map)&&void 0!==W&&W.length?B.Status.INFO:B.Status.ERROR,V}formatNotInfo(M){return this._client.results.filter(_=>_.status===M).map(_=>{const j=_.verifiable_credential_path.substring(1);return{tag:_.evaluator,status:_.status,message:`${_.message}: ${_.input_descriptor_path}: $.verifiableCredential${j}`}})}submissionFrom(M,_,j){if(!this._client.results.length)throw Error("You need to call evaluate() before pex.presentationFrom()");if(!this._client.generatePresentationSubmission)return this._client.presentationSubmission;if(M.submission_requirements){const z=this._client.results.filter(te=>"MarkForSubmissionEvaluation"===te.evaluator&&te.payload.group&&te.status!==B.Status.ERROR),[W,V]=this.matchUserSelectedVcs(z,_),Z=new Map;"input_descriptors"in M&&M.input_descriptors.forEach(te=>{te.group&&te.group.forEach(ie=>{Z.has(ie)?Z.set(ie,Z.get(ie)+1):Z.set(ie,1)})});const q=this.evaluateRequirements(M.submission_requirements,W,Z,0),re=V.filter(te=>q[1].find(ie=>ie.verifiable_credential_path===te[1]));return this.updatePresentationSubmission(re),this.updatePresentationSubmissionPathToVpPath(),j?.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&this.updatePresentationSubmissionToExternal(),this._client.presentationSubmission}const P=this._client.results.filter(z=>"MarkForSubmissionEvaluation"===z.evaluator&&z.status!==B.Status.ERROR),k=this.matchUserSelectedVcs(P,_);return this.updatePresentationSubmission(k[1]),this.updatePresentationSubmissionPathToVpPath(),j?.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&this.updatePresentationSubmissionToExternal(),this._client.presentationSubmission}updatePresentationSubmission(M){this._client.generatePresentationSubmission&&(this._client.presentationSubmission.descriptor_map=this._client.presentationSubmission.descriptor_map.filter(_=>M.find(j=>j[0]===_.path)).map(_=>{const j=M.find(P=>P[0]===_.path);return j&&(_.path=j[1]),_}))}updatePresentationSubmissionToExternal(){this._client.presentationSubmission.descriptor_map=this._client.presentationSubmission.descriptor_map.map(_=>{if(_.path_nested)return _;if("vc+sd-jwt"===_.format)return _;const j=_.format,P=Object.assign({},_);return P.path_nested=Object.assign({},_),P.path="$",j.startsWith("ldp_")?P.format="ldp_vp":j.startsWith("di_")?P.format="di_vp":"jwt_vc"===j?(P.format="jwt_vp",P.path_nested.path=P.path_nested.path.replace("$.verifiableCredential[","$.vp.verifiableCredential[")):"jwt_vc_json"===j&&(P.format="jwt_vp_json",P.path_nested.path=P.path_nested.path.replace("$.verifiableCredential[","$.vp.verifiableCredential[")),P})}matchUserSelectedVcs(M,_){const j=_.map((z,W)=>[W,JSON.stringify(z.original)]),P=this._client.wrappedVcs.map((z,W)=>[W,JSON.stringify(z.original)]),k=[];return j.forEach((z,W)=>{P.forEach((V,Z)=>{V[1]===z[1]&&k.push([`$[${Z}]`,`$[${W}]`])})}),[M=M.filter(z=>k.find(W=>W[0]===z.verifiable_credential_path)).map(z=>{const W=k.find(V=>V[0]===z.verifiable_credential_path);return W&&(z.verifiable_credential_path=W[1]),z}),k]}evaluateRequirements(M,_,j,P){let k=0;const z=[];for(const W of M)if(W.from){if(W.rule===a.Rules.All){const[V,Z]=this.countMatchingInputDescriptors(W,_);if(V!==(j.get(W.from)||0))throw Error(`Not all input descriptors are members of group ${W.from}`);k++,z.push(...Z)}else if(W.rule===a.Rules.Pick){const[V,Z]=this.countMatchingInputDescriptors(W,_);try{this.handleCount(W,V,P),k++}catch(q){if(0===P)throw q}z.push(...Z)}}else if(W.from_nested){const[V,Z]=this.evaluateRequirements(W.from_nested,_,j,++P);k+=V,z.push(...Z),this.handleCount(W,V,P)}return[k,z]}countMatchingInputDescriptors(M,_){let j=0;const P=[];for(const k of _)k.payload.group.includes(M.from)&&(P.push(k),j++);return[j,P]}handleCount(M,_,j){if(M.count&&_!==M.count)throw Error(`Count: expected: ${M.count} actual: ${_} at level: ${j}`);if(M.min&&_M.max)throw Error(`Max: expected: ${M.max} actual: ${_} at level: ${j}`)}removeDuplicateSubmissionRequirementMatches(M){return M.filter((_,j)=>{const P=JSON.stringify(_);return j===M.findIndex(k=>JSON.stringify(k)===P)})}fillSelectableCredentialsToVerifiableCredentialsMapping(M,_){var j;M&&(null===(j=M.verifiableCredential)||void 0===j||j.forEach(P=>{var k;const z=_.findIndex(W=>x.CredentialMapper.areOriginalVerifiableCredentialsEqual(W.original,P));if(-1===z)throw new Error("index is not right");null===(k=M.vcIndexes)||void 0===k||k.push(z)}))}determineAreRequiredCredentialsPresent(M,_,j){if(!_||!_.length)return B.Status.ERROR;const P=_.map(k=>this.determineSubmissionRequirementStatus(M,k));if(!j)return P.includes(B.Status.ERROR)?B.Status.ERROR:P.includes(B.Status.WARN)?B.Status.WARN:B.Status.INFO;{if(j.rule===a.Rules.All&&P.includes(B.Status.ERROR))return B.Status.ERROR;const k=P.filter(z=>z!==B.Status.ERROR).length;if(j.count)return j.count>k?B.Status.ERROR:j.countk)return B.Status.ERROR;if(j.max&&j.maxM.count?B.Status.WARN:B.Status.ERROR:M.min&&M.vc_path.lengthM.max?B.Status.WARN:B.Status.INFO}updateSubmissionRequirementMatchPathToAlias(M,_){const j=[];M.vc_path.forEach(P=>{j.push(P.replace("$","$."+_))}),M.vc_path=j,M.from_nested&&M.from_nested.forEach(P=>{this.updateSubmissionRequirementMatchPathToAlias(P,_)})}updatePresentationSubmissionPathToVpPath(M){const _=M?M.descriptor_map:this._client.generatePresentationSubmission?this._client.presentationSubmission.descriptor_map:void 0;_?.forEach(j=>{"vc+sd-jwt"===j.format?j.path="$":this.replacePathWithAlias(j,"verifiableCredential")})}replacePathWithAlias(M,_){M.path=M.path.replace("$[",`$.${_}[`),M.path_nested&&this.replacePathWithAlias(M.path_nested,_)}createIdToVcMap(M){const _=new Map,j=new Map;for(let P=0;P{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.AbstractEvaluationHandler=void 0;const i=f(44273),a=f(55776);F.AbstractEvaluationHandler=class x{constructor(m){this._client=m}setNext(m){return this.nextHandler=m,m}getNext(){return this.nextHandler}hasNext(){return null!=this.nextHandler}get client(){return this._client}get wrappedVcs(){return this._client.wrappedVcs}set wrappedVcs(m){this._client.wrappedVcs=m}get presentationSubmission(){return this._client.presentationSubmission}set presentationSubmission(m){this._client.presentationSubmission=m}getResults(){return this._client.results}updatePresentationSubmission(m){this._client.assertPresentationSubmission(),this.presentationSubmission.descriptor_map.forEach((S,g,E)=>{let R;this.getResults().filter(_=>_.status===a.Status.ERROR&&_.evaluator===this.getName()).find(_=>(R=i.JSONPath.query(m,_.input_descriptor_path)[0],_.verifiable_credential_path===S.path&&R?.id===S.id))&&delete E[g]})}removeDuplicate(m){return m.reduce((S,g)=>S.find(R=>R.input_descriptor_path===g.input_descriptor_path&&R.verifiable_credential_path===g.verifiable_credential_path)?S:S.concat([g]),[])}}},4028:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(F,"__esModule",{value:!0}),F.DIDRestrictionEvaluationHandler=void 0;const a=f(11151),x=f(55776),B=i(f(24080)),m=f(13486),S=f(32893);F.DIDRestrictionEvaluationHandler=class g extends S.AbstractEvaluationHandler{constructor(R){super(R)}getName(){return"DIDRestrictionEvaluation"}handle(R,M){R.input_descriptors.forEach((_,j)=>{M.forEach((P,k)=>{const z=this.getIssuerIdFromWrappedVerifiableCredential(P);this.client.hasRestrictToDIDMethods()&&z&&!(0,m.isRestrictedDID)(z,this.client.restrictToDIDMethods)&&z.toLowerCase().startsWith("did:")?this.getResults().push(this.generateErrorResult(j,`$[${k}]`,P)):this.getResults().push(this.generateSuccessResult(j,`$[${k}]`,P,`${z} is allowed`))})}),this.updatePresentationSubmission(R)}getIssuerIdFromWrappedVerifiableCredential(R){if(a.CredentialMapper.isW3cCredential(R.credential))return"object"==typeof R.credential.issuer?R.credential.issuer.id:R.credential.issuer;if(a.CredentialMapper.isSdJwtDecodedCredential(R.credential))return R.credential.decodedPayload.iss;throw new Error("Unsupported credential type")}generateErrorResult(R,M,_){return{input_descriptor_path:`$.input_descriptors[${R}]`,evaluator:this.getName(),status:x.Status.ERROR,message:B.default.FORMAT_RESTRICTION_DIDNT_PASS,verifiable_credential_path:M,payload:{format:_.format}}}generateSuccessResult(R,M,_,j){return{input_descriptor_path:`$.input_descriptors[${R}]`,evaluator:this.getName(),status:x.Status.INFO,message:j??B.default.FORMAT_RESTRICTION_PASSED,verifiable_credential_path:M,payload:{format:_.format}}}}},19819:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},30614:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(F,"__esModule",{value:!0}),F.FormatRestrictionEvaluationHandler=void 0;const a=f(55776),x=i(f(24080)),B=f(32893);F.FormatRestrictionEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g)}getName(){return"FormatRestrictionEvaluation"}handle(g,E){const R=this.client.restrictToFormats?Object.keys(this.client.restrictToFormats):void 0;g.input_descriptors.forEach((M,_)=>{E.forEach((j,P)=>{const k="format"in M&&M.format?Object.keys(M.format):[j.format];let z=R??k;"format"in M&&M.format&&void 0!==R&&(z=Object.keys(M.format).filter(W=>R.includes(W))),z.includes(j.format)?this.getResults().push(this.generateSuccessResult(_,`$[${P}]`,j,`${j.format} is allowed from ${JSON.stringify(z)}`)):this.getResults().push(this.generateErrorResult(_,`$[${P}]`,j))})}),this.updatePresentationSubmission(g)}generateErrorResult(g,E,R){return{input_descriptor_path:`$.input_descriptors[${g}]`,evaluator:this.getName(),status:a.Status.ERROR,message:x.default.FORMAT_RESTRICTION_DIDNT_PASS,verifiable_credential_path:E,payload:{format:R.format}}}generateSuccessResult(g,E,R,M){return{input_descriptor_path:`$.input_descriptors[${g}]`,evaluator:this.getName(),status:a.Status.INFO,message:M??x.default.FORMAT_RESTRICTION_PASSED,verifiable_credential_path:E,payload:{format:R.format}}}}},71001:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(32893),F),a(f(19819),F),a(f(298),F),a(f(19477),F),a(f(77918),F),a(f(60019),F),a(f(1599),F),a(f(4257),F),a(f(67966),F),a(f(63217),F),a(f(30614),F),a(f(4028),F)},298:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorFilterEvaluationHandler=void 0;const a=f(44273),x=i(f(39208)),B=i(f(21953)),m=f(55776),S=i(f(24080)),g=f(13486),E=f(32893),R=new x.default({verbose:!1,code:{source:!1,lines:!0,esm:!1},allowUnionTypes:!0,allErrors:!0,strict:!1});(0,B.default)(R);class M extends E.AbstractEvaluationHandler{constructor(j){super(j),M.keepCacheSizeInCheck()}getName(){return"FilterEvaluation"}handle(j,P){const k=a.JSONPath.nodes(j,"$..fields[*]");P.forEach((z,W)=>{this.createNoFieldResults(j,W,z),k.forEach(V=>{let Z=[];V.value.path&&(Z=g.JsonPathUtils.extractInputField(z.decoded,V.value.path));let q=!1;for(const re of Z)if(this.evaluateFilter(re,V.value)){q=!0;const te={result:Object.assign({},Z[0]),valid:!0,format:z.format};this.getResults().push(Object.assign({},this.createResultObject(a.JSONPath.stringify(V.path.slice(0,3)),W,te)))}if(!q)if(Z.length){const re={result:Object.assign({},Z[0]),valid:!1,format:z.format};this.createResponse(V,W,re,S.default.INPUT_CANDIDATE_FAILED_FILTER_EVALUATION)}else this.createResponse(V,W,{valid:!1,format:z.format},S.default.INPUT_CANDIDATE_DOESNT_CONTAIN_PROPERTY)})}),this.updatePresentationSubmission(j)}createNoFieldResults(j,P,k){j.input_descriptors.map((W,V)=>({index:V,inDesc:W})).filter(W=>{var V,Z,q;return void 0===(null===(V=W.inDesc.constraints)||void 0===V?void 0:V.fields)||0===(null===(q=null===(Z=W.inDesc.constraints)||void 0===Z?void 0:Z.fields)||void 0===q?void 0:q.length)}).forEach(W=>{const V={result:[],valid:!0,format:k.format};this.getResults().push(Object.assign({},this.createResultObject(`$.input_descriptors[${W.index}]`,P,V)))})}createResponse(j,P,k,z){this.getResults().push(Object.assign(Object.assign({},this.createResultObject(a.JSONPath.stringify(j.path.slice(0,3)),P,k)),{status:m.Status.ERROR,message:z}))}createResultObject(j,P,k){return{input_descriptor_path:j,verifiable_credential_path:`$[${P}]`,evaluator:this.getName(),status:m.Status.INFO,message:S.default.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION,payload:k}}evaluateFilter(j,P){var k,z;null!==(k=P.filter)&&void 0!==k&&k.format&&"date"===P.filter.format&&this.transformDateFormat(j);let W=!0;if(P.filter){const V=JSON.stringify({filter:P.filter,value:j.value}),Z=Date.now();W=null===(z=M.FILTER_CACHE.get(V))||void 0===z?void 0:z.value,void 0===W&&(M.keepCacheSizeInCheck(),W=R.validate(P.filter,j.value),M.FILTER_CACHE.set(V,{value:W,ts:Z+M.DEFAULT_FILTER_CACHE_TTL}))}return W}transformDateFormat(j){const P=new Date(j.value);let k=P.getUTCMonth()+1+"";1===k.length&&(k="0"+k);let z=P.getUTCDate()+"";1===z.length&&(z="0"+z),j.value=P.getUTCFullYear()+"-"+k+"-"+z,j.value=P.toISOString().substring(0,P.toISOString().indexOf("T"))}static keepCacheSizeInCheck(j){var P,k,z;const W=null!==(P=j?.ttl)&&void 0!==P?P:M.DEFAULT_FILTER_CACHE_TTL,V=null!==(k=j?.maxCacheSize)&&void 0!==k?k:M.DEFAULT_MAX_FILTER_CACHE_SIZE,Z=null!==(z=j?.resetCacheSize)&&void 0!==z?z:M.DEFAULT_RESET_CACHE_SIZE,q=Date.now();for(const[te,ie]of M.FILTER_CACHE)ie.ts+WV){const te=M.FILTER_CACHE.keys();for(let ie=0;ie{var k,z,W;null!==(k=j.constraints)&&void 0!==k&&k.fields&&((null===(z=j.constraints)||void 0===z?void 0:z.limit_disclosure)===a.Optionality.Required||(null===(W=j.constraints)||void 0===W?void 0:W.limit_disclosure)===a.Optionality.Preferred)&&this.evaluateLimitDisclosure(_,j.constraints,P)})}isLimitDisclosureSupported(M,_,j,P){if("vc+sd-jwt"===M.format)return!0;const k=this.client.limitDisclosureSignatureSuites,z=M.decoded.proof;if(!z||Array.isArray(z)||!z.type)return!1;const W=z.cryptosuite?`${z.type}.${z.cryptosuite}`:z.type;return!!k?.includes(W)||(P==a.Optionality.Required&&this.createLimitDisclosureNotSupportedResult(j,_),!1)}evaluateLimitDisclosure(M,_,j){const P=_?.fields,k=_.limit_disclosure;M.forEach((z,W)=>{k&&this.isLimitDisclosureSupported(z,W,j,k)&&this.enforceLimitDisclosure(z,P,j,W,M,k)})}enforceLimitDisclosure(M,_,j,P,k,z){if(x.CredentialMapper.isWrappedSdJwtVerifiableCredential(M)){const W=this.createSdJwtPresentationFrame(M.credential,_,j,P);W&&((0,S.applySdJwtLimitDisclosure)(M.credential,W),M.decoded=M.credential.decodedPayload,M.original=x.CredentialMapper.isSdJwtDecodedCredential(M.original)?M.credential:M.credential.compactSdJwtVc,this.createSuccessResult(j,`$[${P}]`,z))}else{if(!x.CredentialMapper.isW3cCredential(M.credential))throw new Error(`Unsupported format for selective disclosure ${M.format}`);{const W=this.createVcWithRequiredFields(M.credential,_,j,P);W&&(k[P].credential=W,this.createSuccessResult(j,`$[${P}]`,z))}}}createSdJwtPresentationFrame(M,_,j,P){const k={};for(const z of _)if(z.path){const W=S.JsonPathUtils.extractInputField(M.decodedPayload,z.path);if(!(W.length>0))return void this.createMandatoryFieldNotFoundResult(j,P,z.path);S.JsonPathUtils.setValue(k,W[0].path,!0)}return k}createVcWithRequiredFields(M,_,j,P){let k={};k=Object.assign(k,M),k.credentialSubject={};for(const z of _)if(z.path){const W=S.JsonPathUtils.extractInputField(M,z.path);if(!(W.length>0))return void this.createMandatoryFieldNotFoundResult(j,P,z.path);k=this.copyResultPathToDestinationCredential(W[0],M,k)}return k}copyResultPathToDestinationCredential(M,_,j){let P=Object.assign({},_.credentialSubject);return M.path.forEach(k=>{P[k]&&(P={[k]:P[k]})}),j.credentialSubject=Object.assign(Object.assign({},j.credentialSubject),P),j}createSuccessResult(M,_,j){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${M}]`,verifiable_credential_path:`${_}`,evaluator:this.getName(),status:j===a.Optionality.Required?B.Status.INFO:B.Status.WARN,message:m.default.LIMIT_DISCLOSURE_APPLIED,payload:void 0})}createMandatoryFieldNotFoundResult(M,_,j){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${M}]`,verifiable_credential_path:`$[${_}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.VERIFIABLE_CREDENTIAL_MANDATORY_FIELD_NOT_PRESENT,payload:j})}createLimitDisclosureNotSupportedResult(M,_){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${M}]`,verifiable_credential_path:`$[${_}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.LIMIT_DISCLOSURE_NOT_SUPPORTED})}}},60019:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(F,"__esModule",{value:!0}),F.MarkForSubmissionEvaluationHandler=void 0;const a=f(44273),x=f(55776),B=i(f(24080)),m=f(32893);F.MarkForSubmissionEvaluationHandler=class S extends m.AbstractEvaluationHandler{constructor(E){super(E)}getName(){return"MarkForSubmissionEvaluation"}handle(E,R){const M=[...this.getResults()],_=M.filter(P=>P.status===x.Status.ERROR),j=this.retrieveNoErrorStatus(M,_);this.client.wrappedVcs=R,this.produceErrorResults(_),this.produceSuccessResults(j,E)}retrieveNoErrorStatus(E,R){return E.filter(_=>_.status!==x.Status.ERROR).filter(_=>!R.find(j=>_.input_descriptor_path===j.input_descriptor_path&&_.verifiable_credential_path===j.verifiable_credential_path))}produceSuccessResults(E,R){this.removeDuplicate(E).forEach(M=>{const j=a.JSONPath.nodes(R,M.input_descriptor_path)[0].value.group;this.getResults().push({input_descriptor_path:M.input_descriptor_path,verifiable_credential_path:M.verifiable_credential_path,evaluator:this.getName(),status:x.Status.INFO,payload:{group:j},message:B.default.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION})})}produceErrorResults(E){this.removeDuplicate(E).forEach(R=>{const M=Object.assign({},R.payload);M.evaluator=R.evaluator,this.getResults().push(Object.assign(Object.assign({},R),{evaluator:this.getName(),message:B.default.INPUT_CANDIDATE_IS_NOT_ELIGIBLE_FOR_PRESENTATION_SUBMISSION,payload:M}))})}}},1599:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(F,"__esModule",{value:!0}),F.PredicateRelatedFieldEvaluationHandler=void 0;const a=f(47636),x=f(55776),B=i(f(24080)),m=f(32893);F.PredicateRelatedFieldEvaluationHandler=class S extends m.AbstractEvaluationHandler{constructor(E){super(E)}getName(){return"PredicateRelatedFieldEvaluation"}handle(E){E.input_descriptors.forEach((R,M)=>{R.constraints&&this.examinePredicateRelatedField(M,R.constraints)})}examinePredicateRelatedField(E,R){if(R?.fields)for(let M=0;M{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SameSubjectEvaluationHandler=void 0;const i=f(44273),a=f(47636),x=f(55776),B=f(32893);F.SameSubjectEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g),this.fieldIds=[],this.sameSubject=[],this.messages=new Map,this.messages.set(x.Status.INFO,"The field ids requiring the same subject to belong to same subject"),this.messages.set(x.Status.WARN,"The field ids preferring the same subject to belong to same subject"),this.messages.set(x.Status.ERROR,"The fields ids not belong to the same subject")}getName(){return"SameSubjectEvaluation"}handle(g,E){const R=this.mapSameSubjectFieldIdsToInputDescriptors(g),M=this.mapCredentialsToResultObjecs(E,R),_=this.countSameSubjectOccurrences(R,M);this.generateErrorResults(_,M),this.updatePresentationSubmission(g)}mapSameSubjectFieldIdsToInputDescriptors(g){this.fieldIds.push(...i.JSONPath.nodes(g,"$..fields[*].id")),this.sameSubject.push(...i.JSONPath.nodes(g,"$..same_subject[*]"));const E=[];return this.fieldIds.forEach(R=>{const M=this.sameSubject.find(_=>_.value.field_id.includes(R.value));M&&E.push([R,M])}),E}generateErrorResults(g,E){g.forEach((R,M)=>{const _=E.filter(j=>M===j.payload.fieldIdSet).map(j=>j.payload.credentialSubject.id);(_.length!==R||1!==new Set(_).size)&&E.forEach((j,P,k)=>{j.payload.fieldIdSet===M&&(j.status=x.Status.ERROR,j.message=this.messages.get(x.Status.ERROR),k[P]=j)})}),this.client.results.push(...E)}countSameSubjectOccurrences(g,E){const R=new Map;return g.forEach(M=>{E.filter(j=>M[1].value.field_id===j.payload.fieldIdSet)&&(R.has(M[1].value.field_id)&&R.get(M[1].value.field_id)?R.set(M[1].value.field_id,R.get(M[1].value.field_id)+1):R.set(M[1].value.field_id,1))}),R}mapCredentialsToResultObjecs(g,E){const R=[...i.JSONPath.nodes(g.map(_=>_.credential),"$..credentialSubject")],M=[];return R.forEach(_=>{const j=E.find(P=>0!==i.JSONPath.query(_.value,`$..${P[0].value}`).length);j&&j[1].value.directive===a.Optionality.Required?M.push({input_descriptor_path:i.JSONPath.stringify(j[0].path.slice(0,3)),status:x.Status.INFO,evaluator:this.getName(),payload:{fieldIdSet:j[1].value.field_id,credentialSubject:_.value},message:this.messages.get(x.Status.INFO),verifiable_credential_path:i.JSONPath.stringify(_.path.slice(0,2))}):j&&j[1].value.directive===a.Optionality.Preferred&&M.push({input_descriptor_path:i.JSONPath.stringify(j[0].path.slice(0,3)),status:x.Status.WARN,evaluator:this.getName(),payload:{fieldIdSet:j[1].value.field_id,credentialSubject:_.value},message:this.messages.get(x.Status.WARN),verifiable_credential_path:i.JSONPath.stringify(_.path.slice(0,2))})}),M}}},19477:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SubjectIsHolderEvaluationHandler=void 0;const i=f(44273),a=f(47636),x=f(55776),B=f(32893);F.SubjectIsHolderEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g),this.fieldIdzInputDescriptorsSameSubjectRequired=new Map,this.fieldIdzInputDescriptorsSameSubjectPreferred=new Map,this.isHolder=[],this.fieldIds=[],this.credentialsSubjectsByPath=new Map,this.credentialsByPath=new Map,this.messages=new Map,this.messages.set(x.Status.INFO,"The field ids requiring the subject to be the holder"),this.messages.set(x.Status.WARN,"The field ids preferring the subject to be the holder"),this.messages.set(x.Status.ERROR,"The field id missing")}getName(){return"IsHolderEvaluation"}handle(g,E){this.findIsHolderFieldIdsToInputDescriptorsSets(g),this.findAllCredentialSubjects(E),this.confirmAllFieldSetHasSameSubject(this.fieldIdzInputDescriptorsSameSubjectRequired,x.Status.INFO,a.Optionality.Required),this.confirmAllFieldSetHasSameSubject(this.fieldIdzInputDescriptorsSameSubjectPreferred,x.Status.WARN,a.Optionality.Preferred),this.updatePresentationSubmission(g)}findIsHolderFieldIdsToInputDescriptorsSets(g){var E;this.fieldIds.push(...i.JSONPath.nodes(g,"$..fields[*].id")),this.isHolder.push(...i.JSONPath.nodes(g,"$..is_holder[*]"));const R=null===(E=this.fieldIds)||void 0===E?void 0:E.map(_=>_.value),M=[];M.push(...this.evaluateFields(this.fieldIdzInputDescriptorsSameSubjectPreferred,this.isHolder,R,a.Optionality.Preferred)),M.push(...this.evaluateFields(this.fieldIdzInputDescriptorsSameSubjectRequired,this.isHolder,R,a.Optionality.Required)),M.forEach(_=>this.getResults().push(this.createResult(_[1],_[0],["",{}],x.Status.ERROR,void 0)))}evaluateFields(g,E,R,M){const _=[];return E.filter(j=>j.value.directive===M).filter(j=>j.value.field_id.every(P=>R.includes(P))).forEach(j=>g.set(i.JSONPath.stringify(j.path.slice(0,3)),j.value.field_id)),E.filter(j=>j.value.directive===M).filter(j=>!j.value.field_id.every(P=>R.includes(P))).forEach(j=>_.push([i.JSONPath.stringify(j.path.slice(0,3)),j.value.field_id])),_}findAllCredentialSubjects(g){const E=i.JSONPath.nodes(g.map(R=>R.credential),"$..credentialSubject");for(let R=0;RArray.from(this.credentialsSubjectsByPath).filter(z=>k[1].find(W=>Object.keys(z[1]).includes(W)))),_=this.mapCredentialPathsToInputDescriptors(R),j=Array.from(M).flatMap(k=>Object.keys(k[1]).filter(z=>"id"!==z)),P=Array.from(g.values()).flatMap(k=>k.every(z=>j.includes(z)))[0];M.forEach(k=>{const z=_.get(k[0]);P&&k[1].id&&this.client.dids.includes(k[1].id)?this.getResults().push(this.createResult(Object.keys(k[1]).filter(W=>"id"!==W),z,k,E,this.credentialsByPath.get(k[0]))):this.getResults().push(this.createResult(Object.keys(k[1]).filter(W=>"id"!==W),z,k,x.Status.ERROR,this.credentialsByPath.get(k[0])))})}mapCredentialPathsToInputDescriptors(g){var E;const R=new Map;return null===(E=this.fieldIds)||void 0===E||E.forEach(M=>{const _=i.JSONPath.stringify(M.path.slice(0,3));this.credentialsSubjectsByPath.forEach((j,P)=>{const k=this.isHolder.find(z=>i.JSONPath.stringify(z.path.slice(0,3))===_);Object.keys(j).includes(M.value)&&k?.value.directive===g&&R.set(P,_)})}),R}createResult(g,E,R,M,_,j){return{input_descriptor_path:E,verifiable_credential_path:R[0],evaluator:this.getName(),status:M,payload:Object.assign({fieldIdSet:g,credentialSubject:R[1]},_?{format:_.format}:{}),message:j??this.messages.get(M)}}}},67966:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.SubjectIsIssuerEvaluationHandler=void 0;const a=f(47636),x=f(11151),B=f(55776),m=i(f(24080)),S=f(13486),g=f(32893);F.SubjectIsIssuerEvaluationHandler=class E extends g.AbstractEvaluationHandler{constructor(M){super(M)}getName(){return"SubjectIsIssuerEvaluation"}handle(M,_){M.input_descriptors.forEach((j,P)=>{const k=j.constraints;k?.subject_is_issuer===a.Optionality.Required?this.checkSubjectIsIssuer(j.id,_,P):this.getResults().push(..._.map((z,W)=>this.generateSuccessResult(P,`$[${W}]`,z,"not applicable")))}),this.updatePresentationSubmission(M)}checkSubjectIsIssuer(M,_,j){this.client.presentationSubmission.descriptor_map.forEach(P=>{if(P.id===M){const k=S.JsonPathUtils.extractInputField(_.map(z=>z.credential),[P.path]);for(const z of k){const W=(0,S.getIssuerString)(z.value);z&&z.value&&(0,S.getSubjectIdsAsString)(z.value).every(V=>V===W)?this.getResults().push(this.generateSuccessResult(j,P.path,x.CredentialMapper.toWrappedVerifiableCredential(z.value))):this.getResults().push(this.generateErrorResult(j,P.path,x.CredentialMapper.toWrappedVerifiableCredential(z.value)))}}})}generateErrorResult(M,_,j){return{input_descriptor_path:`$.input_descriptors[${M}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.SUBJECT_IS_NOT_ISSUER,verifiable_credential_path:_,payload:{format:j.format}}}generateSuccessResult(M,_,j,P){return{input_descriptor_path:`$.input_descriptors[${M}]`,evaluator:this.getName(),status:B.Status.INFO,message:P??m.default.SUBJECT_IS_ISSUER,verifiable_credential_path:_,payload:{format:j.format}}}}},63217:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(F,"__esModule",{value:!0}),F.UriEvaluationHandler=void 0;const a=f(44273),x=f(11151),B=f(35975),m=f(55776),S=f(99938),g=i(f(24080)),E=f(32893);class R extends E.AbstractEvaluationHandler{constructor(_){super(_)}getName(){return"UriEvaluation"}handle(_,j){var P,k,z;_.input_descriptors.forEach((Z,q)=>{const re=_.getVersion()!==S.PEVersion.v2?Z.schema.map(te=>te.uri):[];j.forEach((te,ie)=>{const ae=R.buildVcContextAndSchemaUris(te.credential,_.getVersion());this.evaluateUris(te,ae,re,q,ie,_.getVersion())})});const W=(null===(P=_.format)||void 0===P?void 0:P.di)||(null===(k=_.format)||void 0===k?void 0:k.di_vc)||(null===(z=_.format)||void 0===z?void 0:z.di_vp),V=this.getResults().filter(Z=>Z.status===m.Status.INFO).map(Z=>{var q,re,te,ie;let ae=null===(q=Z.payload)||void 0===q?void 0:q.format;if(W&&("ldp_vc"===ae||"ldp"===ae)){const K=a.JSONPath.nodes(j,Z.verifiable_credential_path).map(A=>A.value).map(A=>A.type===x.OriginalType.JSONLD&&A.credential.proof?(Array.isArray(A.credential.proof)?A.credential.proof:[A.credential.proof]).filter($=>"DataIntegrityProof"===$.type&&void 0!==$.cryptosuite):[]).reduce((A,I)=>A.filter(O=>I.includes(O))),o=a.JSONPath.nodes(_,Z.input_descriptor_path)[0].value,h=!o.format||(null===(re=o?.format)||void 0===re?void 0:re.di)||(null===(te=o?.format)||void 0===te?void 0:te.di_vc)||(null===(ie=o?.format)||void 0===ie?void 0:ie.di_vp);K.length>0&&h&&(ae="di_vc")}return{id:a.JSONPath.nodes(_,Z.input_descriptor_path)[0].value.id,format:ae,path:Z.verifiable_credential_path}});this.client.generatePresentationSubmission&&(!this.presentationSubmission||0===Object.keys(this.presentationSubmission).length)&&(this.presentationSubmission={id:(0,B.nanoid)(),definition_id:_.id,descriptor_map:V})}evaluateUris(_,j,P,k,z,W){let V=!1;if(W===S.PEVersion.v1){for(let Z=0;Zq===j[Z])&&(V=!0)}else V=!0;V?this.getResults().push(this.createSuccessResultObject(_,P,k,z)):this.getResults().push(this.createErrorResultObject(_,P,k,z))}static buildVcContextAndSchemaUris(_,j){const P=[];return x.CredentialMapper.isW3cCredential(_)&&(Array.isArray(_["@context"])?_["@context"].forEach(k=>P.push(k)):P.push(_["@context"]),Array.isArray(_.credentialSchema)&&_.credentialSchema.length>0?_.credentialSchema.forEach(k=>P.push(k.id)):_.credentialSchema&&P.push(_.credentialSchema.id),j===S.PEVersion.v1&&(Array.isArray(_.type)?_.type.forEach(k=>P.push(k)):_.type&&P.push(_.type))),x.CredentialMapper.isSdJwtDecodedCredential(_)&&j===S.PEVersion.v1&&P.push(_.decodedPayload.vct),P}createSuccessResultObject(_,j,P,k){const z=this.createResult(P,k);return z.status=m.Status.INFO,z.message=g.default.URI_EVALUATION_PASSED,z.payload={format:_.format,vcContext:x.CredentialMapper.isW3cCredential(_.credential)?_.credential["@context"]:void 0,vcCredentialSchema:x.CredentialMapper.isW3cCredential(_.credential)?_.credential.credentialSchema:void 0,inputDescriptorsUris:j},z}createErrorResultObject(_,j,P,k){const z=this.createResult(P,k);return z.status=m.Status.ERROR,z.message=g.default.URI_EVALUATION_DIDNT_PASS,z.payload={format:_.format,vcContext:x.CredentialMapper.isW3cCredential(_.credential)?_.credential["@context"]:void 0,vcCredentialSchema:x.CredentialMapper.isW3cCredential(_.credential)?_.credential.credentialSchema:void 0,inputDescriptorsUris:j},z}createWarnResultObject(_,j){const P=this.createResult(_,j);return P.status=m.Status.WARN,P.message=g.default.URI_EVALUATION_DIDNT_PASS,P.payload=g.default.INPUT_DESCRIPTOR_CONTEXT_CONTAINS_HASHLINK_VERIFICATION_NOT_SUPPORTED,P}createResult(_,j){return{input_descriptor_path:`$.input_descriptors[${_}]`,verifiable_credential_path:`$[${j}]`,evaluator:this.getName(),status:m.Status.INFO,message:void 0}}static containsHashlink(_){return!(this.matchAll(_,R.HASHLINK_QUERY_URL_REGEX).next().done&&this.matchAll(_,R.HASHLINK_URL_ENCODED_REGEX).next().done)}}F.UriEvaluationHandler=R,R.matchAll=f(72373),R.HASHLINK_URL_ENCODED_REGEX=/hl:[a-zA-Z0-9]+:[a-zA-Z0-9]+/g,R.HASHLINK_QUERY_URL_REGEX=/https*?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)(hl=[a-zA-Z0-9]+)/g},70143:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.HandlerCheckResult=F.EvaluationClientWrapper=F.EvaluationClient=void 0;const i=f(92127);Object.defineProperty(F,"HandlerCheckResult",{enumerable:!0,get:function(){return i.HandlerCheckResult}});const a=f(50950);Object.defineProperty(F,"EvaluationClient",{enumerable:!0,get:function(){return a.EvaluationClient}});var x=f(78995);Object.defineProperty(F,"EvaluationClientWrapper",{enumerable:!0,get:function(){return x.EvaluationClientWrapper}})},2700:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(M,_,j,P){void 0===P&&(P=j);var k=Object.getOwnPropertyDescriptor(_,j);(!k||("get"in k?!_.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return _[j]}}),Object.defineProperty(M,P,k)}:function(M,_,j,P){void 0===P&&(P=j),M[P]=_[j]}),a=this&&this.__exportStar||function(M,_){for(var j in M)"default"!==j&&!Object.prototype.hasOwnProperty.call(_,j)&&i(_,M,j)};Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv2=F.PEXv1=F.PEX=F.Status=F.Checked=F.PEVersion=F.ValidationEngine=F.HandlerCheckResult=void 0;const x=f(55776);Object.defineProperty(F,"Checked",{enumerable:!0,get:function(){return x.Checked}}),Object.defineProperty(F,"Status",{enumerable:!0,get:function(){return x.Status}});const B=f(97889);Object.defineProperty(F,"PEX",{enumerable:!0,get:function(){return B.PEX}});const m=f(38992);Object.defineProperty(F,"PEXv1",{enumerable:!0,get:function(){return m.PEXv1}});const S=f(71945);Object.defineProperty(F,"PEXv2",{enumerable:!0,get:function(){return S.PEXv2}});const g=f(70143);Object.defineProperty(F,"HandlerCheckResult",{enumerable:!0,get:function(){return g.HandlerCheckResult}});const E=f(99938);Object.defineProperty(F,"PEVersion",{enumerable:!0,get:function(){return E.PEVersion}});const R=f(80930);Object.defineProperty(F,"ValidationEngine",{enumerable:!0,get:function(){return R.ValidationEngine}}),a(f(64864),F)},64864:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(34277),F)},34277:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.KeyEncoding=F.PresentationSubmissionLocation=void 0;var f=function(a){return a[a.EXTERNAL=0]="EXTERNAL",a[a.PRESENTATION=1]="PRESENTATION",a}(f||(F.PresentationSubmissionLocation=f={})),i=function(a){return a.Jwk="Jwk",a.Base58="Base58",a.Hex="Hex",a.Multibase="Multibase",a}(i||(F.KeyEncoding=i={}))},99358:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEVersion=F.InternalPresentationDefinitionV2=F.InternalPresentationDefinitionV1=void 0,F.InternalPresentationDefinitionV1=class f{constructor(B,m,S,g,E,R){this.id=B,this.input_descriptors=m,this.format=S,this.name=g,this.purpose=E,this.submission_requirements=R}getVersion(){return a.v1}},F.InternalPresentationDefinitionV2=class i{constructor(B,m,S,g,E,R,M){this.format=S,this.frame=g,this.id=B,this.input_descriptors=m,this.name=E,this.purpose=R,this.submission_requirements=M}getVersion(){return a.v2}};var a=function(x){return x.v1="v1",x.v2="v2",x}(a||(F.PEVersion=a={}))},24080:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var f=function(i){return i.INPUT_CANDIDATE_DOESNT_CONTAIN_PROPERTY="Input candidate does not contain property",i.INPUT_CANDIDATE_FAILED_FILTER_EVALUATION="Input candidate failed filter evaluation",i.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION="The input candidate is eligible for submission",i.INPUT_CANDIDATE_IS_NOT_ELIGIBLE_FOR_PRESENTATION_SUBMISSION="The input candidate is not eligible for submission",i.INPUT_DESCRIPTOR_CONTEXT_CONTAINS_HASHLINK_VERIFICATION_NOT_SUPPORTED="Input descriptor contains hashlink. This version doesn't support hashlink verification.",i.LIMIT_DISCLOSURE_APPLIED="added variable in the limit_disclosure to the verifiableCredential",i.LIMIT_DISCLOSURE_NOT_SUPPORTED="Limit disclosure not supported",i.SUBJECT_IS_NOT_ISSUER="subject is not issuer",i.SUBJECT_IS_ISSUER="subject is issuer",i.FORMAT_RESTRICTION_PASSED="the Credential format of the candidate inputs matches the required formats",i.FORMAT_RESTRICTION_DIDNT_PASS="the Credential format of the candidate inputs didn't match the required formats",i.URI_EVALUATION_PASSED="@context URI(s) for the schema of the candidate input is equal to one of the input_descriptors object uri values.",i.URI_EVALUATION_DIDNT_PASS="@context URI for the of the candidate input MUST be equal to one of the input_descriptors object uri values exactly.",i.UNKNOWN_EXCEPTION="unknown exception occurred: ",i.VERIFIABLE_CREDENTIAL_MANDATORY_FIELD_NOT_PRESENT="mandatory field not present in the verifiableCredential",i}(f||{});F.default=f},88819:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SSITypesBuilder=void 0;const i=f(11151),a=f(13486),x=f(99358);class B{static modelEntityToInternalPresentationDefinitionV1(S){const g=B.createCopyAndModifyPresentationDefinition(S);return new x.InternalPresentationDefinitionV1(g.id,g.input_descriptors,g.format,g.name,g.purpose,g.submission_requirements)}static modelEntityInternalPresentationDefinitionV2(S){const g=B.createCopyAndModifyPresentationDefinition(S);return new x.InternalPresentationDefinitionV2(g.id,g.input_descriptors,g.format,g.frame,g.name,g.purpose,g.submission_requirements)}static createCopyAndModifyPresentationDefinition(S){const g=JSON.parse(JSON.stringify(S));return a.JsonPathUtils.changePropertyNameRecursively(g,"_const","const"),a.JsonPathUtils.changePropertyNameRecursively(g,"_enum","enum"),a.JsonPathUtils.changeSpecialPathsRecursively(g),g}static mapExternalVerifiablePresentationToWrappedVP(S,g){return i.CredentialMapper.toWrappedVerifiablePresentation(S,{hasher:g})}static mapExternalVerifiableCredentialsToWrappedVcs(S,g){return i.CredentialMapper.toWrappedVerifiableCredentials(Array.isArray(S)?S:[S],{hasher:g})}static toInternalPresentationDefinition(S){const g=JSON.parse(JSON.stringify(S)),E=(0,a.definitionVersionDiscovery)(g);if(E.error)throw E.error;return E.version==x.PEVersion.v1?B.modelEntityToInternalPresentationDefinitionV1(g):B.modelEntityInternalPresentationDefinitionV2(g)}}F.SSITypesBuilder=B},99938:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(24080),F),a(f(99358),F),a(f(88819),F)},27426:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectUtils=void 0;class f{static asArray(a){return Array.isArray(a)?a:[a]}static isObject(a){return"[object Object]"===Object.prototype.toString.call(a)}static isUrlAbsolute(a){f.isString(a)&&/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/.test(a)}static isString(a){return"string"==typeof a||"[object String]"===Object.prototype.toString.call(a)}static getDistinctFieldInObject(a,x){const B=a.map(m=>m[x]);return Array.from(new Set(B))}static cloneDeep(a){return JSON.parse(JSON.stringify(a))}}F.ObjectUtils=f},18471:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectValidationUtils=void 0,F.ObjectValidationUtils=class f{static optionalNonEmptyString(a){return null==a||a.length>0}static nonEmptyString(a){return null!=a&&a.length>0}static isValidDIDURI(a){return new RegExp("^did:([a-z0-9]+)(:([a-zA-Z0-9\\.\\-_]|%[0-9a-fA-F]{2})+)+(/([a-zA-Z-\\._~]|%[0-9a-fA-F]{2}|[!$&'()*+,;=:@])*)?").test(a)}}},79446:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(P){return P&&P.__esModule?P:{default:P}};Object.defineProperty(F,"__esModule",{value:!0}),F.filterToRestrictedDIDs=F.isRestrictedDID=F.uniformDIDMethods=F.definitionVersionDiscovery=F.getIssuerString=F.getSubjectIdsAsString=void 0;const a=f(99938),x=i(f(86515)),B=i(f(93046)),m=f(27426),S=f(45408);function M(P,k){var z;let W=null!==(z=P?.map(V=>V.toLowerCase()).map(V=>V.startsWith("did:")?V:`did:${V}`))&&void 0!==z?z:[];if(k?.removePrefix){const V=k.removePrefix.endsWith(":")?k.removePrefix.length:k.removePrefix.length+1;W=W.map(Z=>Z.startsWith(k.removePrefix)?Z.substring(V):Z)}return W.includes("did")?[]:W}F.getSubjectIdsAsString=function g(P){return(Array.isArray(P.credentialSubject)?P.credentialSubject:[P.credentialSubject]).filter(z=>!!z.id).map(z=>z.id)},F.getIssuerString=function E(P){return m.ObjectUtils.isString(P.issuer)?P.issuer:P.issuer.id},F.definitionVersionDiscovery=function R(P){const k=JSON.parse(JSON.stringify(P));S.JsonPathUtils.changePropertyNameRecursively(k,"_const","const"),S.JsonPathUtils.changePropertyNameRecursively(k,"_enum","enum");const z={presentation_definition:k};let W=(0,B.default)(z);return W?{version:a.PEVersion.v2}:(W=(0,x.default)(z),W?{version:a.PEVersion.v1}:{error:"This is not a valid PresentationDefinition"})},F.uniformDIDMethods=M,F.isRestrictedDID=function _(P,k){const z=M(k);return 0===z.length||z.some(W=>P.toLowerCase().startsWith(W))},F.filterToRestrictedDIDs=function j(P,k){const z=M(k);return 0===z.length?P:z.flatMap(W=>P.filter(V=>V.toLowerCase().startsWith(W)))}},13486:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(45408),F),a(f(27426),F),a(f(18471),F),a(f(79446),F),a(f(58870),F)},45408:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.JsonPathUtils=void 0;const i=f(44273);class a{static extractInputField(B,m){let S=[];if(m)for(const g of m)if(S=i.JSONPath.nodes(B,g),S.length)break;return S}static changePropertyNameRecursively(B,m,S){const g=a.extractInputField(B,["$.."+m]);for(const E of g)this.copyResultPathToDestinationDefinition(E.path,B,S)}static setValue(B,m,S){const g="string"==typeof m?m:i.JSONPath.stringify(m);return i.JSONPath.value(B,g,S),B}static copyResultPathToDestinationDefinition(B,m,S){let g=m;for(let E=1;E1&&"['"!==m.substring(E-2,E)&&'["'!==m.substring(E-2,E))if(".."===m.substring(E-2,E)){m=m.substring(0,E-2)+"..['"+S.value[0]+"']"+m.substring(E+S.value[0].length),g=!0;const R=this.matchAll(m,this.REGEX_PATH);this.modifyPathRecursive(R,m)}else"."===m.charAt(E-1)&&(m=m.substring(0,E-1)+"['"+S.value[0]+"']"+m.substring(E+S.value[0].length),g=!0,this.modifyPathRecursive(B,m));S=B.next()}return m}}F.JsonPathUtils=a,a.matchAll=f(72373),a.REGEX_PATH=/@\w+/g},58870:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(M,_,j,P){void 0===P&&(P=j);var k=Object.getOwnPropertyDescriptor(_,j);(!k||("get"in k?!_.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return _[j]}}),Object.defineProperty(M,P,k)}:function(M,_,j,P){void 0===P&&(P=j),M[P]=_[j]}),a=this&&this.__setModuleDefault||(Object.create?function(M,_){Object.defineProperty(M,"default",{enumerable:!0,value:_})}:function(M,_){M.default=_}),x=this&&this.__importStar||function(M){if(M&&M.__esModule)return M;var _={};if(null!=M)for(var j in M)"default"!==j&&Object.prototype.hasOwnProperty.call(M,j)&&i(_,M,j);return a(_,M),_};Object.defineProperty(F,"__esModule",{value:!0}),F.applySdJwtLimitDisclosure=F.calculateSdHash=void 0;const B=f(15315),m=f(22084),S=x(f(75324)),g=f(27426);F.calculateSdHash=function E(M,_,j){const P=j(M,_);return S.toString(P,"base64url")},F.applySdJwtLimitDisclosure=function R(M,_){const j=M.disclosures.map(q=>({digest:q.digest,encoded:q.encoded,salt:q.decoded[0],value:3===q.decoded.length?q.decoded[2]:q.decoded[1],key:3===q.decoded.length?q.decoded[1]:void 0})),P=(0,m.selectDisclosures)(g.ObjectUtils.cloneDeep(M.signedPayload),j,_);M.disclosures=P.map(q=>({encoded:q.encoded,decoded:q.key?[q.salt,q.key,q.value]:[q.salt,q.value],digest:q.digest}));const k=M.disclosures.map(q=>q.encoded),z=M.compactSdJwtVc.split("~");M.compactSdJwtVc=z.filter((q,re)=>0===re||re===z.length-1||k.includes(q)).join("~");const{payload:W}=(0,B.getSDAlgAndPayload)(g.ObjectUtils.cloneDeep(M.signedPayload)),V=(0,m.createHashMappingForSerializedDisclosure)(P),{unpackedObj:Z}=(0,B.unpackObj)(W,V);M.decodedPayload=Z}},38612:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ConstraintsVB=void 0;const i=f(47636),a=f(30387),x=f(10767);class B extends x.ValidationBundler{constructor(S){super(S,"constraints"),this.disclosureLimitShouldHaveKnownValueMsg="limit_disclosure should have known value",this.statusShouldHaveKnownValueMsg="Unknown status property",this.statusDirectiveShouldHaveKnownValueMsg="status directive should have known value",this.subjectIsIssuerShouldBeKnownValueMsg="subject_is_issuer should be known value",this.fieldIdIsMandatoryMsg="field_id property is mandatory",this.fieldIdMustBeArrayOfStringsMsg="field_id property must be an array of strings",this.fieldIdMustCorrespondToFieldIdMsg="field_id must correspond to a present field object id property",this.directivePropertyIsMandatoryMsg="directive property is mandatory",this.oneOfTheKnownDirectivePropertiesMandatoryMsg="directive property must be one of [required, preferred]"}getValidations(S){let g=[];return S&&(g=[{tag:this.getTag(),target:S,predicate:E=>B.disclosureLimitShouldHaveKnownValue(E.limit_disclosure),message:this.disclosureLimitShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:E=>B.statusShouldHaveKnownValue(E.statuses),message:this.statusShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:B.statusDirectiveShouldHaveKnownValue(),message:this.statusDirectiveShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:E=>B.shouldBeKnownOption(E.is_holder),message:this.subjectIsIssuerShouldBeKnownValueMsg},{tag:this.getTag(),target:S,predicate:E=>this.fieldIdInSubjectMustCorrespondToFieldId(E,E.is_holder),message:this.fieldIdMustCorrespondToFieldIdMsg},{tag:this.getTag(),target:S,predicate:E=>this.fieldIdInSubjectMustCorrespondToFieldId(E,E.same_subject),message:this.fieldIdMustCorrespondToFieldIdMsg},...this.getSubjectsValidations(S?.is_holder),...this.getSubjectsValidations(S?.same_subject),...this.getFieldsValidations(S)]),g}getFieldsValidations(S){var g;return null!==(g=S?.fields)&&void 0!==g&&g.length?new a.FieldsVB(this.getTag()).getValidations(S.fields):[]}static disclosureLimitShouldHaveKnownValue(S){return!S||S===i.Optionality.Preferred||S===i.Optionality.Required}static statusShouldHaveKnownValue(S){return null==S||null!=S.active||null!=S.revoked||null!=S.suspended}static statusDirectiveShouldHaveKnownValue(){return S=>{var g,E,R;return this.pdStatusShouldBeKnown(null===(g=S?.statuses)||void 0===g?void 0:g.active)&&this.pdStatusShouldBeKnown(null===(E=S?.statuses)||void 0===E?void 0:E.revoked)&&this.pdStatusShouldBeKnown(null===(R=S?.statuses)||void 0===R?void 0:R.suspended)}}static pdStatusShouldBeKnown(S){return!S||S.directive===i.Directives.Allowed||S.directive===i.Directives.Disallowed||S.directive===i.Directives.Required}static shouldBeKnownOption(S){return!S||0===S.filter(g=>g.directive!==i.Optionality.Preferred&&g.directive!==i.Optionality.Required).length}getSubjectsValidations(S){if(S){let g=[];for(let E=0;EArray.isArray(R.field_id),message:this.fieldIdMustBeArrayOfStringsMsg},{tag:this.getMyTag(E),target:S[E],predicate:R=>!!R.field_id,message:this.fieldIdIsMandatoryMsg},{tag:this.getMyTag(E),target:S[E],predicate:R=>R.field_id.length===R.field_id.filter(M=>"string"==typeof M).length,message:this.fieldIdMustBeArrayOfStringsMsg},{tag:this.getMyTag(E),target:S[E],predicate:R=>void 0!==R.directive,message:this.directivePropertyIsMandatoryMsg},{tag:this.getMyTag(E),target:S[E],predicate:R=>R.directive===i.Optionality.Preferred||R.directive===i.Optionality.Required,message:this.oneOfTheKnownDirectivePropertiesMandatoryMsg}];return g}return[]}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}fieldIdInSubjectMustCorrespondToFieldId(S,g){if(g)for(const E of g)for(const R of E.field_id)if(!B.isValidFieldId(S,R))return!1;return!0}static isValidFieldId(S,g){return!!S?.fields&&S.fields.map(E=>E.id).includes(g)}}F.ConstraintsVB=B},30387:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(F,"__esModule",{value:!0}),F.FieldsVB=void 0;const a=f(44273),x=f(47636),B=i(f(94217)),m=i(f(61264)),S=f(10767);class g extends S.ValidationBundler{constructor(R){super(R,"fields"),this.mustHaveValidJsonPathsMsg='field object "path" property must contain array of valid json paths',this.pathObjMustHaveValidJsonPathMsg='field object "path" property must contain valid json paths.',this.filterMustBeValidJsonSchemaMsg='field object "filter" property must be valid json schema',this.filterIsMustInPresenceOfPredicateMsg='field object must have a "filter" property if "predicate" is present',this.filterIsNotValidJsonSchemaDescriptorMsg='could not parse "filter" object as a valid json schema descriptor.',this.purposeShouldBeANonEmptyStringMsg="purpose should be a non empty string",this.shouldBeKnownOptionMsg="Unknown predicate property"}getValidations(R){let M=[];if(R)for(let _=0;_g.optionalNonEmptyString(_?.purpose),message:this.purposeShouldBeANonEmptyStringMsg},{tag:this.getMyTag(M),target:R,predicate:_=>g.shouldBeKnownOption(_?.predicate),message:this.shouldBeKnownOptionMsg}]}getMyTag(R){return this.parentTag+"."+this.myTag+"["+R+"]"}mustHaveValidJsonPaths(){return R=>null!=R.path&&R.path.length>0&&this._validateJsonPaths(R.path)}_validateJsonPaths(R){const M=[];if(R.forEach(_=>{try{a.JSONPath.parse(_)}catch{M.push(_)}}),M.length>0)throw this.toChecked(this.pathObjMustHaveValidJsonPathMsg+" Got: "+JSON.stringify(M));return!0}filterMustBeValidJsonSchema(){return R=>this._validateFilter(R.filter)}_validateFilter(R){if(null==R)return!0;let M=!1;try{M=(0,m.default)(R),M||(M=(0,B.default)(R))}catch{throw this.toChecked(this.filterIsNotValidJsonSchemaDescriptorMsg+" Got "+JSON.stringify(R))}return M}filterIsMustInPresenceOfPredicate(){return R=>!(null!=R.predicate&&null==R.filter)}static optionalNonEmptyString(R){return null==R||R.length>0}static shouldBeKnownOption(R){return null==R||R==x.Optionality.Required||R==x.Optionality.Preferred}}F.FieldsVB=g},79241:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.FrameVB=void 0;const i=f(13486),a=f(10767);class x extends a.ValidationBundler{constructor(m){super(m,"frame"),this.frameIsValidMsg="frame value is not valid"}getValidations(m){let S=[];return S=[...S,...this.getMyValidations(m)],S}getMyValidations(m){return[{tag:this.getMyTag(),target:m,predicate:x.frameIsValid,message:this.frameIsValidMsg}]}getMyTag(){return this.parentTag+"."+this.myTag}static frameIsValid(m){if(!m||Array.isArray(m)||"object"!=typeof m)return!1;const S=m;if(S&&S["@id"])for(const g of i.ObjectUtils.asArray(m["@id"]))if(!i.ObjectUtils.isObject(g)&&!i.ObjectUtils.isUrlAbsolute(g)||i.ObjectUtils.isString(g)&&0===g.indexOf("_:"))return!1;if(S["@types"])for(const g of i.ObjectUtils.asArray(m["@types"]))if(!i.ObjectUtils.isObject(g)&&!i.ObjectUtils.isUrlAbsolute(g)||i.ObjectUtils.isString(g)&&0===g.indexOf("_:"))return!1;return!0}}F.FrameVB=x},75056:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(30387),F),a(f(853),F),a(f(74840),F),a(f(27506),F),a(f(12915),F),a(f(3170),F),a(f(97091),F),a(f(10767),F),a(f(38612),F)},853:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorsV1VB=void 0;const i=f(13486),a=f(38612),x=f(10767);F.InputDescriptorsV1VB=class B extends x.ValidationBundler{constructor(S){super(S,"input_descriptor"),this.idMustBeNonEmptyStringMsg="input descriptor id must be non-empty string",this.nameShouldBeNonEmptyStringMsg="input descriptor name should be non-empty string",this.purposeShouldBeNonEmptyStringMsg="input descriptor purpose should be non-empty string",this.shouldHaveValidSchemaURIMsg="schema should have valid URI"}getValidations(S){let g=[];return g.push({tag:this.getTag(),target:S,predicate:E=>this.shouldHaveUniqueIds(E),message:"input descriptor ids must be unique"},{tag:this.getTag(),target:S,predicate:E=>this.shouldHaveUniqueFieldsIds(E),message:"fields id must be unique"}),S.forEach((E,R)=>{g=[...g,...this.getValidationFor(E,R),...this.constraintsValidations(E,R)]}),g}getValidationFor(S,g){return[{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.nonEmptyString(E?.id),message:this.idMustBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:this.isValidSchema(),message:this.shouldHaveValidSchemaURIMsg},{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.optionalNonEmptyString(E?.name),message:this.nameShouldBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.optionalNonEmptyString(E?.purpose),message:this.purposeShouldBeNonEmptyStringMsg}]}shouldHaveUniqueFieldsIds(S){const g=[],E=new Set,R=[];return S.map(M=>{var _;return null===(_=M.constraints)||void 0===_?void 0:_.fields}).forEach(M=>{M&&R.push(...M)}),R.forEach(M=>{M.id&&g.push(M.id)}),g.forEach(M=>E.add(M)),g.length===E.size}shouldHaveUniqueIds(S){const g=[],E=new Set;return S.forEach(R=>g.push(R.id)),g.forEach(R=>E.add(R)),g.length===E.size}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}isValidSchema(){return S=>S.schema.filter(g=>this.isAValidURI(g.uri)&&(null==g.required||"boolean"==typeof g.required)).length>0}isAValidURI(S){if(!S)return!1;if(!i.ObjectValidationUtils.nonEmptyString(S))return!1;if(S.startsWith("http://")||S.startsWith("https://"))try{new URL(S)}catch{return i.ObjectValidationUtils.isValidDIDURI(S)}return!0}constraintsValidations(S,g){return S.constraints?new a.ConstraintsVB(this.getMyTag(g)).getValidations(S.constraints):[]}}},74840:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorsV2VB=void 0;const i=f(13486),a=f(38612),x=f(10767);F.InputDescriptorsV2VB=class B extends x.ValidationBundler{constructor(S){super(S,"input_descriptor"),this.idMustBeNonEmptyStringMsg="input descriptor id must be non-empty string",this.nameShouldBeNonEmptyStringMsg="input descriptor name should be non-empty string",this.purposeShouldBeNonEmptyStringMsg="input descriptor purpose should be non-empty string"}getValidations(S){let g=[];return g.push({tag:this.getTag(),target:S,predicate:E=>this.shouldNotHaveSchema(E),message:"input descriptor should not have schema property"},{tag:this.getTag(),target:S,predicate:E=>this.shouldHaveUniqueIds(E),message:"input descriptor ids must be unique"},{tag:this.getTag(),target:S,predicate:E=>this.shouldHaveUniqueFieldsIds(E),message:"fields id must be unique"}),S.forEach((E,R)=>{g=[...g,...this.getValidationFor(E,R),...this.constraintsValidations(E,R)]}),g}getValidationFor(S,g){return[{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.nonEmptyString(E?.id),message:this.idMustBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.optionalNonEmptyString(E?.name),message:this.nameShouldBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.optionalNonEmptyString(E?.purpose),message:this.purposeShouldBeNonEmptyStringMsg}]}shouldHaveUniqueFieldsIds(S){const g=[],E=new Set,R=[];return S.map(M=>{var _;return null===(_=M.constraints)||void 0===_?void 0:_.fields}).forEach(M=>{M&&R.push(...M)}),R.forEach(M=>{M.id&&g.push(M.id)}),g.forEach(M=>E.add(M)),g.length===E.size}shouldHaveUniqueIds(S){const g=[],E=new Set;return S.forEach(R=>g.push(R.id)),g.forEach(R=>E.add(R)),g.length===E.size}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}constraintsValidations(S,g){return S.constraints?new a.ConstraintsVB(this.getMyTag(g)).getValidations(S.constraints):[]}shouldNotHaveSchema(S){let g=!1;return S.forEach(E=>{E.schema&&(g=!0)}),!g}}},27506:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationDefinitionV1VB=void 0;const a=f(92209),x=f(83851),B=i(f(86515)),m=f(853),S=f(97091),g=f(10767);class E extends g.ValidationBundler{constructor(M){super(M,"presentation_definition")}getValidations(M){return M.submission_requirements?[...this.myValidations(M),...new m.InputDescriptorsV1VB(this.myTag).getValidations(M.input_descriptors),...new S.SubmissionRequirementVB(this.myTag).getValidations(M.submission_requirements)]:[...this.myValidations(M),...new m.InputDescriptorsV1VB(this.myTag).getValidations(M.input_descriptors)]}myValidations(M){return[{tag:this.getTag(),target:M,predicate:_=>null!=_,message:"presentation_definition should be non null."},{tag:this.getTag(),target:M,predicate:this.shouldBeAsPerJsonSchema(),message:"presentation_definition should be as per json schema."},{tag:this.getTag(),target:M,predicate:_=>E.nonEmptyString(_?.id),message:"id should not be empty"},{tag:this.getTag(),target:M,predicate:_=>E.optionalNonEmptyString(_?.name),message:"name should be a non-empty string"},{tag:this.getTag(),target:M,predicate:_=>E.optionalNonEmptyString(_?.purpose),message:"purpose should be a non-empty string"},{tag:this.getTag(),target:M,predicate:_=>E.formatValuesShouldNotBeEmpty(_?.format),message:"formats values should not empty"},{tag:this.getTag(),target:M,predicate:_=>E.formatValuesShouldBeAmongKnownValues(_?.format),message:"formats should only have known identifiers for alg or proof_type"},{tag:this.getTag(),target:M,predicate:_=>E.groupShouldMatchSubmissionRequirements(_),message:"input descriptor group should match the from in submission requirements."},{tag:this.getTag(),target:M,predicate:_=>E.shouldNotHaveFrameProperty(_),message:"input descriptor should not have frame property."}]}static optionalNonEmptyString(M){return null==M||M.length>0}static nonEmptyString(M){return null!=M&&M.length>0}static formatValuesShouldNotBeEmpty(M){var _,j,P,k,z,W,V,Z,q,re,te;let ie=!0;return null!=M?.jwt&&(ie=ie&&(null===(_=M.jwt.alg)||void 0===_?void 0:_.length)>0),null!=M?.jwt_vc&&(ie=ie&&(null===(j=M.jwt_vc.alg)||void 0===j?void 0:j.length)>0),null!=M?.jwt_vc_json&&(ie=ie&&(null===(P=M.jwt_vc_json.alg)||void 0===P?void 0:P.length)>0),null!=M?.jwt_vp&&(ie=ie&&(null===(k=M.jwt_vp.alg)||void 0===k?void 0:k.length)>0),null!=M?.jwt_vp_json&&(ie=ie&&(null===(z=M.jwt_vp_json.alg)||void 0===z?void 0:z.length)>0),null!=M?.ldp&&(ie=ie&&(null===(W=M.ldp.proof_type)||void 0===W?void 0:W.length)>0),null!=M?.ldp_vc&&(ie=ie&&(null===(V=M.ldp_vc.proof_type)||void 0===V?void 0:V.length)>0),null!=M?.ldp_vp&&(ie=ie&&(null===(Z=M.ldp_vp.proof_type)||void 0===Z?void 0:Z.length)>0),null!=M?.di&&(ie=ie&&(null===(q=M.di.proof_type)||void 0===q?void 0:q.length)>0),null!=M?.di_vc&&(ie=ie&&(null===(re=M.di_vc.proof_type)||void 0===re?void 0:re.length)>0),null!=M?.di_vp&&(ie=ie&&(null===(te=M.di_vp.proof_type)||void 0===te?void 0:te.length)>0),ie}static formatValuesShouldBeAmongKnownValues(M){let _=[];if(M){const j=a.JwtAlgos.getJwtAlgos(),P=x.LdpTypes.getLdpTypes();_=[];for(const[k,z]of Object.entries(M))k.startsWith("jwt")?_.push(...E.isJWTAlgoKnown(z,j)):_.push(...E.isLDPProofKnown(z,P))}return 0===_.length}static isJWTAlgoKnown(M,_){const j=[];if(null!=M&&null!=M.alg)for(const P of M.alg)_.includes(P)||j.push(P);return j}static isLDPProofKnown(M,_){const j=[];if(null!=M&&null!=M.proof_type)for(const P of M.proof_type)_.includes(P)||j.push(P);return j}static groupShouldMatchSubmissionRequirements(M){if(null!=M.submission_requirements&&M.submission_requirements.length>0){const _=[];M.input_descriptors.forEach(W=>{W.group&&_.push(...W.group)});const j=new Set(_),P=[];E.flatten(M.submission_requirements).forEach(W=>{W.from&&(Array.isArray(W.from)?P.push(...W.from):P.push(W.from))});const k=new Set(P);return 0===new Set([...k].filter(W=>null!=W&&W.length>0&&!j.has(W))).size}return!0}static flatten(M){return M?.reduce((_,j)=>_.concat(Array.isArray(j.from_nested)?this.flatten(j.from_nested):j),[])}shouldBeAsPerJsonSchema(){return M=>(0,B.default)({presentation_definition:M})}static shouldNotHaveFrameProperty(M){return!M.frame}}F.PresentationDefinitionV1VB=E},12915:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationDefinitionV2VB=void 0;const a=f(92209),x=f(83851),B=i(f(93046)),m=f(79241),S=f(74840),g=f(97091),E=f(10767);class R extends E.ValidationBundler{constructor(_){super(_,"presentation_definition")}getValidations(_){let j=[];return j=_.submission_requirements?[...this.myValidations(_),...new S.InputDescriptorsV2VB(this.myTag).getValidations(_.input_descriptors),...new g.SubmissionRequirementVB(this.myTag).getValidations(_.submission_requirements)]:[...this.myValidations(_),...new S.InputDescriptorsV2VB(this.myTag).getValidations(_.input_descriptors)],_.frame&&j.push(...new m.FrameVB(this.myTag).getValidations(_.frame)),j}myValidations(_){return[{tag:this.getTag(),target:_,predicate:j=>null!=j,message:"presentation_definition should be non null."},{tag:this.getTag(),target:_,predicate:this.shouldBeAsPerJsonSchema(),message:"presentation_definition should be as per json schema."},{tag:this.getTag(),target:_,predicate:j=>R.nonEmptyString(j?.id),message:"id should not be empty"},{tag:this.getTag(),target:_,predicate:j=>R.optionalNonEmptyString(j?.name),message:"name should be a non-empty string"},{tag:this.getTag(),target:_,predicate:j=>R.optionalNonEmptyString(j?.purpose),message:"purpose should be a non-empty string"},{tag:this.getTag(),target:_,predicate:j=>R.formatValuesShouldNotBeEmpty(j?.format),message:"formats values should not empty"},{tag:this.getTag(),target:_,predicate:j=>R.formatValuesShouldBeAmongKnownValues(j?.format),message:"formats should only have known identifiers for alg or proof_type"},{tag:this.getTag(),target:_,predicate:j=>R.groupShouldMatchSubmissionRequirements(j),message:"input descriptor group should match the from in submission requirements."}]}static optionalNonEmptyString(_){return null==_||_.length>0}static nonEmptyString(_){return null!=_&&_.length>0}static formatValuesShouldNotBeEmpty(_){var j,P,k,z,W,V,Z,q,re,te,ie;let ae=!0;return null!=_?.jwt&&(ae=ae&&(null===(j=_.jwt.alg)||void 0===j?void 0:j.length)>0),null!=_?.jwt_vc&&(ae=ae&&(null===(P=_.jwt_vc.alg)||void 0===P?void 0:P.length)>0),null!=_?.jwt_vc_json&&(ae=ae&&(null===(k=_.jwt_vc_json.alg)||void 0===k?void 0:k.length)>0),null!=_?.jwt_vp&&(ae=ae&&(null===(z=_.jwt_vp.alg)||void 0===z?void 0:z.length)>0),null!=_?.jwt_vp_json&&(ae=ae&&(null===(W=_.jwt_vp_json.alg)||void 0===W?void 0:W.length)>0),null!=_?.ldp&&(ae=ae&&(null===(V=_.ldp.proof_type)||void 0===V?void 0:V.length)>0),null!=_?.ldp_vc&&(ae=ae&&(null===(Z=_.ldp_vc.proof_type)||void 0===Z?void 0:Z.length)>0),null!=_?.ldp_vp&&(ae=ae&&(null===(q=_.ldp_vp.proof_type)||void 0===q?void 0:q.length)>0),null!=_?.di&&(ae=ae&&(null===(re=_.di.proof_type)||void 0===re?void 0:re.length)>0),null!=_?.di_vc&&(ae=ae&&(null===(te=_.di_vc.proof_type)||void 0===te?void 0:te.length)>0),null!=_?.di_vp&&(ae=ae&&(null===(ie=_.di_vp.proof_type)||void 0===ie?void 0:ie.length)>0),ae}static formatValuesShouldBeAmongKnownValues(_){let j=[];if(_){const P=a.JwtAlgos.getJwtAlgos(),k=x.LdpTypes.getLdpTypes();j=[];for(const[z,W]of Object.entries(_))z.startsWith("jwt")?j.push(...R.isJWTAlgoKnown(W,P)):j.push(...R.isLDPProofKnown(W,k))}return 0===j.length}static isJWTAlgoKnown(_,j){const P=[];if(null!=_&&null!=_.alg)for(const k of _.alg)j.includes(k)||P.push(k);return P}static isLDPProofKnown(_,j){const P=[];if(null!=_&&null!=_.proof_type)for(const k of _.proof_type)j.includes(k)||P.push(k);return P}static groupShouldMatchSubmissionRequirements(_){if(null!=_.submission_requirements&&_.submission_requirements.length>0){const j=[];_.input_descriptors.forEach(V=>{V.group&&j.push(...V.group)});const P=new Set(j),k=[];R.flatten(_.submission_requirements).forEach(V=>{V.from&&k.push(V.from)});const z=new Set(k);return 0===new Set([...z].filter(V=>null!=V&&V.length>0&&!P.has(V))).size}return!0}static flatten(_){return _?.reduce((j,P)=>j.concat(Array.isArray(P.from_nested)?this.flatten(P.from_nested):P),[])}shouldBeAsPerJsonSchema(){return _=>(0,B.default)({presentation_definition:_})}}F.PresentationDefinitionV2VB=R},3170:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationSubmissionVB=void 0;const i=f(44273),a=f(55776),x=f(10767);class B extends x.ValidationBundler{constructor(S){super(S,"presentation_submission")}getValidations(S){return[{tag:this.getTag(),target:S,predicate:g=>null!=g,message:"presentation_submission should be non null."},{tag:this.getTag(),target:S,predicate:g=>B.nonEmptyString(g?.id),message:"id should not be empty"},{tag:this.getTag(),target:S,predicate:g=>B.nonEmptyString(g?.definition_id),message:"presentation_definition_id should not be empty"},{tag:this.getTag(),target:S,predicate:g=>B.descriptorMapMustBePresent(g?.descriptor_map),message:"descriptor_map should be a non-empty list"},{tag:this.getTag(),target:S,predicate:g=>B.idMustBeSameForEachLevelOfNesting(g?.descriptor_map),message:"each descriptor should have a one id in it, on all levels"},{tag:this.getTag(),target:S,predicate:g=>B.formatsShouldBeKnown(g?.descriptor_map),message:"each format should be one of the known format"},{tag:this.getTag(),target:S,predicate:g=>B.pathsShouldBeValidJsonPaths(g?.descriptor_map),message:"each path should be a valid jsonPath"}]}static nonEmptyString(S){return null!=S&&S.length>0}static descriptorMapMustBePresent(S){return null!=S&&S.length>0}static idMustBeSameForEachLevelOfNesting(S){let g=!0;if(null!=S)for(let E=0;E0)throw new a.Checked("",a.Status.ERROR,"These were not parsable json paths: "+JSON.stringify(g));return!0}}F.PresentationSubmissionVB=B},97091:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SubmissionRequirementVB=void 0;const i=f(10767);class a extends i.ValidationBundler{constructor(B){super(B,"submission_requirements"),this.ruleIsMandatoryMsg="rule is a mandatory field",this.needsOneFromOrFromNestedMsg="needs exactly one of from or from_nested",this.fromNestedShouldBeArrayMsg="The value of the from_nested property MUST be an array",this.isCountPositiveIntMsg="count must be a practical positive number",this.isMinPositiveIntMsg="min must be a practical positive number",this.isMaxPositiveIntMsg="max must be a practical positive number",this.ruleShouldBePickOrAllMsg="rule should be either pick or all"}getValidations(B){let m=[];if(null!=B&&B.length>0)for(let S=0;S{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValidationBundler=void 0;const i=f(55776);F.ValidationBundler=class a{constructor(B,m){this.parentTag=B,this.myTag=m}getTag(){return null!=this.parentTag?this.parentTag+"."+this.myTag:this.myTag}toChecked(B){return new i.Checked(this.getTag(),i.Status.ERROR,B)}}},80320:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(51130),F),a(f(93398),F),a(f(50903),F)},92209:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.JwtAlgos=void 0,F.JwtAlgos=class f{static getJwtAlgos(){return["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512","PS256","PS384","PS512","none","RSA1_5","RSA-OAEP","RSA-OAEP-256","A128KW","A192KW","A256KW","dir","ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW","A128GCMKW","A192GCMKW","A256GCMKW","PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW"]}}},83851:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.LdpTypes=void 0,F.LdpTypes=class f{static getLdpTypes(){return["Ed25519VerificationKey2018","Ed25519Signature2018","RsaSignature2018","EcdsaSecp256k1Signature2019","EcdsaSecp256k1RecoverySignature2020","JsonWebSignature2020","GpgSignature2020","JcsEd25519Signature2020","BbsBlsSignature2020","Bls12381G2Key2020","DataIntegrityProof"]}}},93398:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},50903:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValidationEngine=void 0;const i=f(80320);F.ValidationEngine=class a{validate(B){let m=[];for(const S of B)m=m.concat(S.bundler.getValidations(S.target));return(0,i.validate)(m)}}},51130:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validate=void 0;const i=f(55776);F.validate=x=>{function m(M){return new i.Checked(M.tag,i.Status.ERROR,M.message)}function S(M){return new i.Checked(M,i.Status.INFO,"ok")}const R=x.map(M=>function g(M){let _;try{_=M.predicate(M.target)?S(M.tag):m(M)}catch{_=m(M)}return _}(M)).reduce((M,_)=>(_.status!==i.Status.INFO&&M.push(_),M),[]);return(0,i.hasErrors)(R)?R:[S("root")]}},80930:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(75056),F),a(f(80320),F)},94217:Me=>{"use strict";Me.exports=g,Me.exports.default=g;const f={additionalProperties:!1,properties:{const:{$ref:"#/definitions/OneOfNumberStringBoolean"},enum:{items:{$ref:"#/definitions/OneOfNumberString"},type:"array"},exclusiveMaximum:{$ref:"#/definitions/OneOfNumberString"},exclusiveMinimum:{$ref:"#/definitions/OneOfNumberString"},format:{type:"string"},maxLength:{type:"number"},maximum:{$ref:"#/definitions/OneOfNumberString"},minLength:{type:"number"},minimum:{$ref:"#/definitions/OneOfNumberString"},not:{type:"object"},pattern:{type:"string"},type:{type:"string"}},required:["type"],type:"object"},i=Object.prototype.hasOwnProperty,a={type:["number","string","boolean"]};function x(E,{instancePath:R="",rootData:j=E}={}){let P=null,k=0;if("number"!=typeof E&&"string"!=typeof E&&"boolean"!=typeof E){const z={instancePath:R,schemaPath:"#/type",keyword:"type",params:{type:a.type},message:"must be number,string,boolean",schema:a.type,parentSchema:a,data:E};null===P?P=[z]:P.push(z),k++}return x.errors=P,0===k}const B={type:["number","string"]};function m(E,{instancePath:R="",rootData:j=E}={}){let P=null,k=0;if("number"!=typeof E&&"string"!=typeof E){const z={instancePath:R,schemaPath:"#/type",keyword:"type",params:{type:B.type},message:"must be number,string",schema:B.type,parentSchema:B,data:E};null===P?P=[z]:P.push(z),k++}return m.errors=P,0===k}function S(E,{instancePath:R="",rootData:j=E}={}){let P=null,k=0;if(E&&"object"==typeof E&&!Array.isArray(E)){if(void 0===E.type){const z={instancePath:R,schemaPath:"#/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'",schema:f.required,parentSchema:f,data:E};null===P?P=[z]:P.push(z),k++}for(const z in E)if(!i.call(f.properties,z)){const W={instancePath:R,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:z},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:E};null===P?P=[W]:P.push(W),k++}if(void 0!==E.const&&(x(E.const,{instancePath:R+"/const",parentData:E,parentDataProperty:"const",rootData:j})||(P=null===P?x.errors:P.concat(x.errors),k=P.length)),void 0!==E.enum){let z=E.enum;if(Array.isArray(z)){const W=z.length;for(let V=0;V{"use strict";Me.exports=E,Me.exports.default=E;const f={additionalProperties:!1,properties:{const:{$ref:"#/definitions/OneOfNumberStringBoolean"},contains:{$ref:"#/definitions/FilterV2"},enum:{items:{$ref:"#/definitions/OneOfNumberString"},type:"array"},exclusiveMaximum:{$ref:"#/definitions/OneOfNumberString"},exclusiveMinimum:{$ref:"#/definitions/OneOfNumberString"},format:{type:"string"},formatExclusiveMaximum:{type:"string"},formatExclusiveMinimum:{type:"string"},formatMaximum:{type:"string"},formatMinimum:{type:"string"},items:{anyOf:[{$ref:"#/definitions/FilterV2"},{items:{$ref:"#/definitions/FilterV2"},minItems:1,type:"array"}]},maxLength:{type:"number"},maximum:{$ref:"#/definitions/OneOfNumberString"},minLength:{type:"number"},minimum:{$ref:"#/definitions/OneOfNumberString"},not:{type:"object"},pattern:{type:"string"},type:{type:"string"}},type:"object"},i=Object.prototype.hasOwnProperty,a={type:["number","string","boolean"]};function x(R,{instancePath:M="",rootData:P=R}={}){let k=null,z=0;if("number"!=typeof R&&"string"!=typeof R&&"boolean"!=typeof R){const W={instancePath:M,schemaPath:"#/type",keyword:"type",params:{type:a.type},message:"must be number,string,boolean",schema:a.type,parentSchema:a,data:R};null===k?k=[W]:k.push(W),z++}return x.errors=k,0===z}const B={type:["number","string"]};function m(R,{instancePath:M="",rootData:P=R}={}){let k=null,z=0;if("number"!=typeof R&&"string"!=typeof R){const W={instancePath:M,schemaPath:"#/type",keyword:"type",params:{type:B.type},message:"must be number,string",schema:B.type,parentSchema:B,data:R};null===k?k=[W]:k.push(W),z++}return m.errors=k,0===z}const S={validate:g};function g(R,{instancePath:M="",rootData:P=R}={}){let k=null,z=0;if(R&&"object"==typeof R&&!Array.isArray(R)){for(const V in R)if(!i.call(f.properties,V)){const Z={instancePath:M,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:V},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:R};null===k?k=[Z]:k.push(Z),z++}if(void 0!==R.const&&(x(R.const,{instancePath:M+"/const",parentData:R,parentDataProperty:"const",rootData:P})||(k=null===k?x.errors:k.concat(x.errors),z=k.length)),void 0!==R.contains&&(S.validate(R.contains,{instancePath:M+"/contains",parentData:R,parentDataProperty:"contains",rootData:P})||(k=null===k?S.validate.errors:k.concat(S.validate.errors),z=k.length)),void 0!==R.enum){let V=R.enum;if(Array.isArray(V)){const Z=V.length;for(let q=0;q{"use strict";Me.exports=re,Me.exports.default=re;const F={$schema:"http://json-schema.org/draft-07/schema#",title:"Presentation Definition",definitions:{schema:{type:"object",properties:{uri:{type:"string"},required:{type:"boolean"}},required:["uri"],additionalProperties:!1},issuance:{type:"object",properties:{manifest:{type:"string"}},additionalProperties:!0},filter:{type:"object",properties:{type:{type:"string"},format:{type:"string"},pattern:{type:"string"},minimum:{type:["number","string"]},minLength:{type:"integer"},maxLength:{type:"integer"},exclusiveMinimum:{type:["number","string"]},exclusiveMaximum:{type:["number","string"]},maximum:{type:["number","string"]},const:{type:["number","string"]},enum:{type:"array",items:{type:["number","string"]}},not:{type:"object",minProperties:1}},required:["type"],additionalProperties:!1},format:{type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},submission_requirements:{type:"object",oneOf:[{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from:{type:"string"}},required:["rule","from"],additionalProperties:!1},{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from_nested:{type:"array",minItems:1,items:{$ref:"#/definitions/submission_requirements"}}},required:["rule","from_nested"],additionalProperties:!1}]},input_descriptors:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},group:{type:"array",items:{type:"string"}},schema:{type:"array",items:{$ref:"#/definitions/schema"}},issuance:{type:"array",items:{$ref:"#/definitions/issuance"}},constraints:{type:"object",properties:{limit_disclosure:{type:"string",enum:["required","preferred"]},statuses:{type:"object",properties:{active:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},suspended:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},revoked:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}}}},fields:{type:"array",items:{$ref:"#/definitions/field"}},subject_is_issuer:{type:"string",enum:["required","preferred"]},is_holder:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}},same_subject:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}}},additionalProperties:!1}},required:["id","schema"],additionalProperties:!1},field:{type:"object",oneOf:[{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},filter:{$ref:"#/definitions/filter"}},required:["path"],additionalProperties:!1},{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},filter:{$ref:"#/definitions/filter"},predicate:{type:"string",enum:["required","preferred"]}},required:["path","filter","predicate"],additionalProperties:!1}]}},type:"object",properties:{presentation_definition:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},format:{$ref:"#/definitions/format"},submission_requirements:{type:"array",items:{$ref:"#/definitions/submission_requirements"}},input_descriptors:{type:"array",items:{$ref:"#/definitions/input_descriptors"}}},required:["id","input_descriptors"],additionalProperties:!1}}},f={type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},i=new RegExp("^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$","u"),a=new RegExp("^ldp_vc$|^ldp_vp$|^ldp$","u"),x=new RegExp("^di_vc$|^di_vp$|^di$","u"),B=new RegExp("additionalProperties","u");function m(te,{instancePath:ie="",rootData:ye=te}={}){let ue=null,K=0;if(te&&"object"==typeof te&&!Array.isArray(te)){for(const o in te)if(!("vc+sd-jwt"===o||i.test(o)||a.test(o)||x.test(o)||B.test(o))){const h={instancePath:ie,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:o},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:te};null===ue?ue=[h]:ue.push(h),K++}if(void 0!==te["vc+sd-jwt"]){let o=te["vc+sd-jwt"];if(o&&"object"==typeof o&&!Array.isArray(o)){for(const h in o)if("sd-jwt_alg_values"!==h&&"kb-jwt_alg_values"!==h){const A={instancePath:ie+"/vc+sd-jwt",schemaPath:"#/properties/vc%2Bsd-jwt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties",schema:!1,parentSchema:f.properties["vc+sd-jwt"],data:o};null===ue?ue=[A]:ue.push(A),K++}if(void 0!==o["sd-jwt_alg_values"]){let h=o["sd-jwt_alg_values"];if(Array.isArray(h)){if(h.length<1){const I={instancePath:ie+"/vc+sd-jwt/sd-jwt_alg_values",schemaPath:"#/properties/vc%2Bsd-jwt/properties/sd-jwt_alg_values/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:f.properties["vc+sd-jwt"].properties["sd-jwt_alg_values"],data:h};null===ue?ue=[I]:ue.push(I),K++}const A=h.length;for(let I=0;I=",limit:1},message:"must be >= 1",schema:1,parentSchema:S.oneOf[0].properties.count,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.min){let H=te.min;if("number"!=typeof H||H%1||isNaN(H)){const D={instancePath:ie+"/min",schemaPath:"#/oneOf/0/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[0].properties.min.type,parentSchema:S.oneOf[0].properties.min,data:H};null===ue?ue=[D]:ue.push(D),K++}if("number"==typeof H&&(H<0||isNaN(H))){const D={instancePath:ie+"/min",schemaPath:"#/oneOf/0/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[0].properties.min,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.max){let H=te.max;if("number"!=typeof H||H%1||isNaN(H)){const D={instancePath:ie+"/max",schemaPath:"#/oneOf/0/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[0].properties.max.type,parentSchema:S.oneOf[0].properties.max,data:H};null===ue?ue=[D]:ue.push(D),K++}if("number"==typeof H&&(H<0||isNaN(H))){const D={instancePath:ie+"/max",schemaPath:"#/oneOf/0/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[0].properties.max,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.from){let H=te.from;if("string"!=typeof H){const D={instancePath:ie+"/from",schemaPath:"#/oneOf/0/properties/from/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[0].properties.from.type,parentSchema:S.oneOf[0].properties.from,data:H};null===ue?ue=[D]:ue.push(D),K++}}}I===K&&(h=!0,A=0);const O=K;if(te&&"object"==typeof te&&!Array.isArray(te)){if(void 0===te.rule){const H={instancePath:ie,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"rule"},message:"must have required property 'rule'",schema:S.oneOf[1].required,parentSchema:S.oneOf[1],data:te};null===ue?ue=[H]:ue.push(H),K++}if(void 0===te.from_nested){const H={instancePath:ie,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"from_nested"},message:"must have required property 'from_nested'",schema:S.oneOf[1].required,parentSchema:S.oneOf[1],data:te};null===ue?ue=[H]:ue.push(H),K++}for(const H in te)if("name"!==H&&"purpose"!==H&&"rule"!==H&&"count"!==H&&"min"!==H&&"max"!==H&&"from_nested"!==H){const D={instancePath:ie,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:H},message:"must NOT have additional properties",schema:!1,parentSchema:S.oneOf[1],data:te};null===ue?ue=[D]:ue.push(D),K++}if(void 0!==te.name){let H=te.name;if("string"!=typeof H){const D={instancePath:ie+"/name",schemaPath:"#/oneOf/1/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.name.type,parentSchema:S.oneOf[1].properties.name,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.purpose){let H=te.purpose;if("string"!=typeof H){const D={instancePath:ie+"/purpose",schemaPath:"#/oneOf/1/properties/purpose/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.purpose.type,parentSchema:S.oneOf[1].properties.purpose,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.rule){let H=te.rule;if("string"!=typeof H){const D={instancePath:ie+"/rule",schemaPath:"#/oneOf/1/properties/rule/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.rule.type,parentSchema:S.oneOf[1].properties.rule,data:H};null===ue?ue=[D]:ue.push(D),K++}if("all"!==H&&"pick"!==H){const D={instancePath:ie+"/rule",schemaPath:"#/oneOf/1/properties/rule/enum",keyword:"enum",params:{allowedValues:S.oneOf[1].properties.rule.enum},message:"must be equal to one of the allowed values",schema:S.oneOf[1].properties.rule.enum,parentSchema:S.oneOf[1].properties.rule,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.count){let H=te.count;if("number"!=typeof H||H%1||isNaN(H)){const D={instancePath:ie+"/count",schemaPath:"#/oneOf/1/properties/count/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.count.type,parentSchema:S.oneOf[1].properties.count,data:H};null===ue?ue=[D]:ue.push(D),K++}if("number"==typeof H&&(H<1||isNaN(H))){const D={instancePath:ie+"/count",schemaPath:"#/oneOf/1/properties/count/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:S.oneOf[1].properties.count,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.min){let H=te.min;if("number"!=typeof H||H%1||isNaN(H)){const D={instancePath:ie+"/min",schemaPath:"#/oneOf/1/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.min.type,parentSchema:S.oneOf[1].properties.min,data:H};null===ue?ue=[D]:ue.push(D),K++}if("number"==typeof H&&(H<0||isNaN(H))){const D={instancePath:ie+"/min",schemaPath:"#/oneOf/1/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[1].properties.min,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.max){let H=te.max;if("number"!=typeof H||H%1||isNaN(H)){const D={instancePath:ie+"/max",schemaPath:"#/oneOf/1/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.max.type,parentSchema:S.oneOf[1].properties.max,data:H};null===ue?ue=[D]:ue.push(D),K++}if("number"==typeof H&&(H<0||isNaN(H))){const D={instancePath:ie+"/max",schemaPath:"#/oneOf/1/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[1].properties.max,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.from_nested){let H=te.from_nested;if(Array.isArray(H)){if(H.length<1){const s={instancePath:ie+"/from_nested",schemaPath:"#/oneOf/1/properties/from_nested/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:S.oneOf[1].properties.from_nested,data:H};null===ue?ue=[s]:ue.push(s),K++}const D=H.length;for(let s=0;s{"use strict";Me.exports=I,Me.exports.default=I;const i={$schema:"http://json-schema.org/draft-07/schema#",title:"Presentation Definition",definitions:{issuance:{type:"object",properties:{manifest:{type:"string"}},additionalProperties:!0},format:{type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},submission_requirements:{type:"object",oneOf:[{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from:{type:"string"}},required:["rule","from"],additionalProperties:!1},{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from_nested:{type:"array",minItems:1,items:{$ref:"#/definitions/submission_requirements"}}},required:["rule","from_nested"],additionalProperties:!1}]},input_descriptors:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},issuance:{type:"array",items:{$ref:"#/definitions/issuance"}},group:{type:"array",items:{type:"string"}},format:{$ref:"#/definitions/format"},constraints:{type:"object",properties:{limit_disclosure:{type:"string",enum:["required","preferred"]},statuses:{type:"object",properties:{active:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},suspended:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},revoked:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}}}},fields:{type:"array",items:{$ref:"#/definitions/field"}},subject_is_issuer:{type:"string",enum:["required","preferred"]},is_holder:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}},same_subject:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}}},additionalProperties:!1}},required:["id"],additionalProperties:!1},field:{type:"object",oneOf:[{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},intent_to_retain:{type:"boolean"},filter:{$ref:"http://json-schema.org/schema#"},name:{type:"string"}},required:["path"],additionalProperties:!1},{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},intent_to_retain:{type:"boolean"},filter:{$ref:"http://json-schema.org/schema#"},predicate:{type:"string",enum:["required","preferred"]},name:{type:"string"}},required:["path","filter","predicate"],additionalProperties:!1}]}},type:"object",properties:{presentation_definition:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},format:{$ref:"#/definitions/format"},frame:{type:"object",additionalProperties:!0},submission_requirements:{type:"array",items:{$ref:"#/definitions/submission_requirements"}},input_descriptors:{type:"array",items:{$ref:"#/definitions/input_descriptors"}}},required:["id","input_descriptors"],additionalProperties:!1}}},a={type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},x=new RegExp("^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$","u"),B=new RegExp("^ldp_vc$|^ldp_vp$|^ldp$","u"),m=new RegExp("^di_vc$|^di_vp$|^di$","u"),S=new RegExp("additionalProperties","u");function g(O,{instancePath:$="",rootData:s=O}={}){let p=null,Y=0;if(O&&"object"==typeof O&&!Array.isArray(O)){for(const ee in O)if(!("vc+sd-jwt"===ee||x.test(ee)||B.test(ee)||m.test(ee)||S.test(ee))){const oe={instancePath:$,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:ee},message:"must NOT have additional properties",schema:!1,parentSchema:a,data:O};null===p?p=[oe]:p.push(oe),Y++}if(void 0!==O["vc+sd-jwt"]){let ee=O["vc+sd-jwt"];if(ee&&"object"==typeof ee&&!Array.isArray(ee)){for(const oe in ee)if("sd-jwt_alg_values"!==oe&&"kb-jwt_alg_values"!==oe){const de={instancePath:$+"/vc+sd-jwt",schemaPath:"#/properties/vc%2Bsd-jwt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:oe},message:"must NOT have additional properties",schema:!1,parentSchema:a.properties["vc+sd-jwt"],data:ee};null===p?p=[de]:p.push(de),Y++}if(void 0!==ee["sd-jwt_alg_values"]){let oe=ee["sd-jwt_alg_values"];if(Array.isArray(oe)){if(oe.length<1){const Ae={instancePath:$+"/vc+sd-jwt/sd-jwt_alg_values",schemaPath:"#/properties/vc%2Bsd-jwt/properties/sd-jwt_alg_values/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:a.properties["vc+sd-jwt"].properties["sd-jwt_alg_values"],data:oe};null===p?p=[Ae]:p.push(Ae),Y++}const de=oe.length;for(let Ae=0;Ae=",limit:1},message:"must be >= 1",schema:1,parentSchema:E.oneOf[0].properties.count,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.min){let xe=O.min;if("number"!=typeof xe||xe%1||isNaN(xe)){const De={instancePath:$+"/min",schemaPath:"#/oneOf/0/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:E.oneOf[0].properties.min.type,parentSchema:E.oneOf[0].properties.min,data:xe};null===p?p=[De]:p.push(De),Y++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const De={instancePath:$+"/min",schemaPath:"#/oneOf/0/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:E.oneOf[0].properties.min,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.max){let xe=O.max;if("number"!=typeof xe||xe%1||isNaN(xe)){const De={instancePath:$+"/max",schemaPath:"#/oneOf/0/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:E.oneOf[0].properties.max.type,parentSchema:E.oneOf[0].properties.max,data:xe};null===p?p=[De]:p.push(De),Y++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const De={instancePath:$+"/max",schemaPath:"#/oneOf/0/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:E.oneOf[0].properties.max,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.from){let xe=O.from;if("string"!=typeof xe){const De={instancePath:$+"/from",schemaPath:"#/oneOf/0/properties/from/type",keyword:"type",params:{type:"string"},message:"must be string",schema:E.oneOf[0].properties.from.type,parentSchema:E.oneOf[0].properties.from,data:xe};null===p?p=[De]:p.push(De),Y++}}}Ae===Y&&(oe=!0,de=0);const Ie=Y;if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0===O.rule){const xe={instancePath:$,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"rule"},message:"must have required property 'rule'",schema:E.oneOf[1].required,parentSchema:E.oneOf[1],data:O};null===p?p=[xe]:p.push(xe),Y++}if(void 0===O.from_nested){const xe={instancePath:$,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"from_nested"},message:"must have required property 'from_nested'",schema:E.oneOf[1].required,parentSchema:E.oneOf[1],data:O};null===p?p=[xe]:p.push(xe),Y++}for(const xe in O)if("name"!==xe&&"purpose"!==xe&&"rule"!==xe&&"count"!==xe&&"min"!==xe&&"max"!==xe&&"from_nested"!==xe){const De={instancePath:$,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:xe},message:"must NOT have additional properties",schema:!1,parentSchema:E.oneOf[1],data:O};null===p?p=[De]:p.push(De),Y++}if(void 0!==O.name){let xe=O.name;if("string"!=typeof xe){const De={instancePath:$+"/name",schemaPath:"#/oneOf/1/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string",schema:E.oneOf[1].properties.name.type,parentSchema:E.oneOf[1].properties.name,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.purpose){let xe=O.purpose;if("string"!=typeof xe){const De={instancePath:$+"/purpose",schemaPath:"#/oneOf/1/properties/purpose/type",keyword:"type",params:{type:"string"},message:"must be string",schema:E.oneOf[1].properties.purpose.type,parentSchema:E.oneOf[1].properties.purpose,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.rule){let xe=O.rule;if("string"!=typeof xe){const De={instancePath:$+"/rule",schemaPath:"#/oneOf/1/properties/rule/type",keyword:"type",params:{type:"string"},message:"must be string",schema:E.oneOf[1].properties.rule.type,parentSchema:E.oneOf[1].properties.rule,data:xe};null===p?p=[De]:p.push(De),Y++}if("all"!==xe&&"pick"!==xe){const De={instancePath:$+"/rule",schemaPath:"#/oneOf/1/properties/rule/enum",keyword:"enum",params:{allowedValues:E.oneOf[1].properties.rule.enum},message:"must be equal to one of the allowed values",schema:E.oneOf[1].properties.rule.enum,parentSchema:E.oneOf[1].properties.rule,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.count){let xe=O.count;if("number"!=typeof xe||xe%1||isNaN(xe)){const De={instancePath:$+"/count",schemaPath:"#/oneOf/1/properties/count/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:E.oneOf[1].properties.count.type,parentSchema:E.oneOf[1].properties.count,data:xe};null===p?p=[De]:p.push(De),Y++}if("number"==typeof xe&&(xe<1||isNaN(xe))){const De={instancePath:$+"/count",schemaPath:"#/oneOf/1/properties/count/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:E.oneOf[1].properties.count,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.min){let xe=O.min;if("number"!=typeof xe||xe%1||isNaN(xe)){const De={instancePath:$+"/min",schemaPath:"#/oneOf/1/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:E.oneOf[1].properties.min.type,parentSchema:E.oneOf[1].properties.min,data:xe};null===p?p=[De]:p.push(De),Y++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const De={instancePath:$+"/min",schemaPath:"#/oneOf/1/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:E.oneOf[1].properties.min,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.max){let xe=O.max;if("number"!=typeof xe||xe%1||isNaN(xe)){const De={instancePath:$+"/max",schemaPath:"#/oneOf/1/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:E.oneOf[1].properties.max.type,parentSchema:E.oneOf[1].properties.max,data:xe};null===p?p=[De]:p.push(De),Y++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const De={instancePath:$+"/max",schemaPath:"#/oneOf/1/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:E.oneOf[1].properties.max,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.from_nested){let xe=O.from_nested;if(Array.isArray(xe)){if(xe.length<1){const Xe={instancePath:$+"/from_nested",schemaPath:"#/oneOf/1/properties/from_nested/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:E.oneOf[1].properties.from_nested,data:xe};null===p?p=[Xe]:p.push(Xe),Y++}const De=xe.length;for(let Xe=0;Xe=",limit:0},message:"must be >= 0",schema:0,parentSchema:W,data:O};null===p?p=[ee]:p.push(ee),Y++}return V.errors=p,0===Y}function q(O,{instancePath:$="",parentData:H,parentDataProperty:D,rootData:s=O}={}){let p=null,Y=0;return V(O,{instancePath:$,parentData:H,parentDataProperty:D,rootData:s})||(p=null===p?V.errors:p.concat(V.errors),Y=p.length),q.errors=p,0===Y}const re={type:"array",minItems:1,items:{$ref:"#"}},te={validate:o};function ie(O,{instancePath:$="",rootData:s=O}={}){let p=null,Y=0;if(Array.isArray(O)){if(O.length<1){const oe={instancePath:$,schemaPath:"#/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:re,data:O};null===p?p=[oe]:p.push(oe),Y++}const ee=O.length;for(let oe=0;oe1){const Ae={};for(;oe--;){let Ie=O[oe];if("string"==typeof Ie){if("number"==typeof Ae[Ie]){de=Ae[Ie];const Le={instancePath:$,schemaPath:"#/uniqueItems",keyword:"uniqueItems",params:{i:oe,j:de},message:"must NOT have duplicate items (items ## "+de+" and "+oe+" are identical)",schema:!0,parentSchema:ae,data:O};null===p?p=[Le]:p.push(Le),Y++;break}Ae[Ie]=oe}}}}else{const ee={instancePath:$,schemaPath:"#/type",keyword:"type",params:{type:"array"},message:"must be array",schema:ae.type,parentSchema:ae,data:O};null===p?p=[ee]:p.push(ee),Y++}return me.errors=p,0===Y}const ye={enum:["array","boolean","integer","null","number","object","string"]};function ue(O,{instancePath:$="",rootData:s=O}={}){let p=null,Y=0;if("array"!==O&&"boolean"!==O&&"integer"!==O&&"null"!==O&&"number"!==O&&"object"!==O&&"string"!==O){const ee={instancePath:$,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:ye.enum},message:"must be equal to one of the allowed values",schema:ye.enum,parentSchema:ye,data:O};null===p?p=[ee]:p.push(ee),Y++}return ue.errors=p,0===Y}const K=f(54195).default;function o(O,{instancePath:$="",rootData:s=O}={}){let p=null,Y=0;if((!O||"object"!=typeof O||Array.isArray(O))&&"boolean"!=typeof O){const Ie={instancePath:$,schemaPath:"#/type",keyword:"type",params:{type:z.type},message:"must be object,boolean",schema:z.type,parentSchema:z,data:O};null===p?p=[Ie]:p.push(Ie),Y++}if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0!==O.$id){let Ie=O.$id;if("string"!=typeof Ie){const Le={instancePath:$+"/$id",schemaPath:"#/properties/%24id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.$id.type,parentSchema:z.properties.$id,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.$schema){let Ie=O.$schema;if("string"!=typeof Ie){const Le={instancePath:$+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.$schema.type,parentSchema:z.properties.$schema,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.$ref){let Ie=O.$ref;if("string"!=typeof Ie){const Le={instancePath:$+"/$ref",schemaPath:"#/properties/%24ref/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.$ref.type,parentSchema:z.properties.$ref,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.$comment){let Ie=O.$comment;if("string"!=typeof Ie){const Le={instancePath:$+"/$comment",schemaPath:"#/properties/%24comment/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.$comment.type,parentSchema:z.properties.$comment,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.title){let Ie=O.title;if("string"!=typeof Ie){const Le={instancePath:$+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.title.type,parentSchema:z.properties.title,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.description){let Ie=O.description;if("string"!=typeof Ie){const Le={instancePath:$+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.description.type,parentSchema:z.properties.description,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.readOnly){let Ie=O.readOnly;if("boolean"!=typeof Ie){const Le={instancePath:$+"/readOnly",schemaPath:"#/properties/readOnly/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:z.properties.readOnly.type,parentSchema:z.properties.readOnly,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.examples){let Ie=O.examples;if(!Array.isArray(Ie)){const Le={instancePath:$+"/examples",schemaPath:"#/properties/examples/type",keyword:"type",params:{type:"array"},message:"must be array",schema:z.properties.examples.type,parentSchema:z.properties.examples,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.multipleOf){let Ie=O.multipleOf;if("number"==typeof Ie){if(Ie<=0||isNaN(Ie)){const Le={instancePath:$+"/multipleOf",schemaPath:"#/properties/multipleOf/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:z.properties.multipleOf,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}else{const Le={instancePath:$+"/multipleOf",schemaPath:"#/properties/multipleOf/type",keyword:"type",params:{type:"number"},message:"must be number",schema:z.properties.multipleOf.type,parentSchema:z.properties.multipleOf,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.maximum){let Ie=O.maximum;if("number"!=typeof Ie){const Le={instancePath:$+"/maximum",schemaPath:"#/properties/maximum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:z.properties.maximum.type,parentSchema:z.properties.maximum,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.exclusiveMaximum){let Ie=O.exclusiveMaximum;if("number"!=typeof Ie){const Le={instancePath:$+"/exclusiveMaximum",schemaPath:"#/properties/exclusiveMaximum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:z.properties.exclusiveMaximum.type,parentSchema:z.properties.exclusiveMaximum,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.minimum){let Ie=O.minimum;if("number"!=typeof Ie){const Le={instancePath:$+"/minimum",schemaPath:"#/properties/minimum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:z.properties.minimum.type,parentSchema:z.properties.minimum,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.exclusiveMinimum){let Ie=O.exclusiveMinimum;if("number"!=typeof Ie){const Le={instancePath:$+"/exclusiveMinimum",schemaPath:"#/properties/exclusiveMinimum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:z.properties.exclusiveMinimum.type,parentSchema:z.properties.exclusiveMinimum,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.maxLength&&(V(O.maxLength,{instancePath:$+"/maxLength",parentData:O,parentDataProperty:"maxLength",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),Y=p.length)),void 0!==O.minLength&&(q(O.minLength,{instancePath:$+"/minLength",parentData:O,parentDataProperty:"minLength",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),Y=p.length)),void 0!==O.pattern){let Ie=O.pattern;if("string"!=typeof Ie){const Le={instancePath:$+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.pattern.type,parentSchema:z.properties.pattern,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.additionalItems&&(o(O.additionalItems,{instancePath:$+"/additionalItems",parentData:O,parentDataProperty:"additionalItems",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.items){let Ie=O.items;const Le=Y;let xe=!1;const De=Y;o(Ie,{instancePath:$+"/items",parentData:O,parentDataProperty:"items",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length);var ee=De===Y;if(xe=xe||ee,!xe){const Xe=Y;ie(Ie,{instancePath:$+"/items",parentData:O,parentDataProperty:"items",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),Y=p.length),ee=Xe===Y,xe=xe||ee}if(xe)Y=Le,null!==p&&(Le?p.length=Le:p=null);else{const Xe={instancePath:$+"/items",schemaPath:"#/properties/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:z.properties.items.anyOf,parentSchema:z.properties.items,data:Ie};null===p?p=[Xe]:p.push(Xe),Y++}}if(void 0!==O.maxItems&&(V(O.maxItems,{instancePath:$+"/maxItems",parentData:O,parentDataProperty:"maxItems",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),Y=p.length)),void 0!==O.minItems&&(q(O.minItems,{instancePath:$+"/minItems",parentData:O,parentDataProperty:"minItems",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),Y=p.length)),void 0!==O.uniqueItems){let Ie=O.uniqueItems;if("boolean"!=typeof Ie){const Le={instancePath:$+"/uniqueItems",schemaPath:"#/properties/uniqueItems/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:z.properties.uniqueItems.type,parentSchema:z.properties.uniqueItems,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.contains&&(o(O.contains,{instancePath:$+"/contains",parentData:O,parentDataProperty:"contains",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.maxProperties&&(V(O.maxProperties,{instancePath:$+"/maxProperties",parentData:O,parentDataProperty:"maxProperties",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),Y=p.length)),void 0!==O.minProperties&&(q(O.minProperties,{instancePath:$+"/minProperties",parentData:O,parentDataProperty:"minProperties",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),Y=p.length)),void 0!==O.required&&(me(O.required,{instancePath:$+"/required",parentData:O,parentDataProperty:"required",rootData:s})||(p=null===p?me.errors:p.concat(me.errors),Y=p.length)),void 0!==O.additionalProperties&&(o(O.additionalProperties,{instancePath:$+"/additionalProperties",parentData:O,parentDataProperty:"additionalProperties",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.definitions){let Ie=O.definitions;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie)o(Ie[Le],{instancePath:$+"/definitions/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length);else{const Le={instancePath:$+"/definitions",schemaPath:"#/properties/definitions/type",keyword:"type",params:{type:"object"},message:"must be object",schema:z.properties.definitions.type,parentSchema:z.properties.definitions,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.properties){let Ie=O.properties;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie)o(Ie[Le],{instancePath:$+"/properties/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length);else{const Le={instancePath:$+"/properties",schemaPath:"#/properties/properties/type",keyword:"type",params:{type:"object"},message:"must be object",schema:z.properties.properties.type,parentSchema:z.properties.properties,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.patternProperties){let Ie=O.patternProperties;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie)){for(const Le in Ie)if(Y!=Y){const De={instancePath:$+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames",keyword:"propertyNames",params:{propertyName:Le},message:"property name must be valid",schema:z.properties.patternProperties.propertyNames,parentSchema:z.properties.patternProperties,data:Ie};null===p?p=[De]:p.push(De),Y++}for(const Le in Ie)o(Ie[Le],{instancePath:$+"/patternProperties/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)}else{const Le={instancePath:$+"/patternProperties",schemaPath:"#/properties/patternProperties/type",keyword:"type",params:{type:"object"},message:"must be object",schema:z.properties.patternProperties.type,parentSchema:z.properties.patternProperties,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.dependencies){let Ie=O.dependencies;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie){let xe=Ie[Le];const De=Y;let Xe=!1;const Te=Y;o(xe,{instancePath:$+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length);var de=Te===Y;if(Xe=Xe||de,!Xe){const ke=Y;me(xe,{instancePath:$+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?me.errors:p.concat(me.errors),Y=p.length),de=ke===Y,Xe=Xe||de}if(Xe)Y=De,null!==p&&(De?p.length=De:p=null);else{const ke={instancePath:$+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/dependencies/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:z.properties.dependencies.additionalProperties.anyOf,parentSchema:z.properties.dependencies.additionalProperties,data:xe};null===p?p=[ke]:p.push(ke),Y++}}else{const Le={instancePath:$+"/dependencies",schemaPath:"#/properties/dependencies/type",keyword:"type",params:{type:"object"},message:"must be object",schema:z.properties.dependencies.type,parentSchema:z.properties.dependencies,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.propertyNames&&(o(O.propertyNames,{instancePath:$+"/propertyNames",parentData:O,parentDataProperty:"propertyNames",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.enum){let Ie=O.enum;if(Array.isArray(Ie)){if(Ie.length<1){const De={instancePath:$+"/enum",schemaPath:"#/properties/enum/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:z.properties.enum,data:Ie};null===p?p=[De]:p.push(De),Y++}let xe,Le=Ie.length;if(Le>1)e:for(;Le--;)for(xe=Le;xe--;)if(K(Ie[Le],Ie[xe])){const De={instancePath:$+"/enum",schemaPath:"#/properties/enum/uniqueItems",keyword:"uniqueItems",params:{i:Le,j:xe},message:"must NOT have duplicate items (items ## "+xe+" and "+Le+" are identical)",schema:!0,parentSchema:z.properties.enum,data:Ie};null===p?p=[De]:p.push(De),Y++;break e}}else{const Le={instancePath:$+"/enum",schemaPath:"#/properties/enum/type",keyword:"type",params:{type:"array"},message:"must be array",schema:z.properties.enum.type,parentSchema:z.properties.enum,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.type){let Ie=O.type;const Le=Y;let xe=!1;const De=Y;ue(Ie,{instancePath:$+"/type",parentData:O,parentDataProperty:"type",rootData:s})||(p=null===p?ue.errors:p.concat(ue.errors),Y=p.length);var Ae=De===Y;if(xe=xe||Ae,!xe){const Xe=Y;if(Array.isArray(Ie)){if(Ie.length<1){const ve={instancePath:$+"/type",schemaPath:"#/properties/type/anyOf/1/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:z.properties.type.anyOf[1],data:Ie};null===p?p=[ve]:p.push(ve),Y++}const ke=Ie.length;for(let ve=0;ve1)e:for(;Se--;)for(Ee=Se;Ee--;)if(K(Ie[Se],Ie[Ee])){const ve={instancePath:$+"/type",schemaPath:"#/properties/type/anyOf/1/uniqueItems",keyword:"uniqueItems",params:{i:Se,j:Ee},message:"must NOT have duplicate items (items ## "+Ee+" and "+Se+" are identical)",schema:!0,parentSchema:z.properties.type.anyOf[1],data:Ie};null===p?p=[ve]:p.push(ve),Y++;break e}}else{const ke={instancePath:$+"/type",schemaPath:"#/properties/type/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array",schema:z.properties.type.anyOf[1].type,parentSchema:z.properties.type.anyOf[1],data:Ie};null===p?p=[ke]:p.push(ke),Y++}Ae=Xe===Y,xe=xe||Ae}if(xe)Y=Le,null!==p&&(Le?p.length=Le:p=null);else{const Xe={instancePath:$+"/type",schemaPath:"#/properties/type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:z.properties.type.anyOf,parentSchema:z.properties.type,data:Ie};null===p?p=[Xe]:p.push(Xe),Y++}}if(void 0!==O.format){let Ie=O.format;if("string"!=typeof Ie){const Le={instancePath:$+"/format",schemaPath:"#/properties/format/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.format.type,parentSchema:z.properties.format,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.contentMediaType){let Ie=O.contentMediaType;if("string"!=typeof Ie){const Le={instancePath:$+"/contentMediaType",schemaPath:"#/properties/contentMediaType/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.contentMediaType.type,parentSchema:z.properties.contentMediaType,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.contentEncoding){let Ie=O.contentEncoding;if("string"!=typeof Ie){const Le={instancePath:$+"/contentEncoding",schemaPath:"#/properties/contentEncoding/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.contentEncoding.type,parentSchema:z.properties.contentEncoding,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}void 0!==O.if&&(o(O.if,{instancePath:$+"/if",parentData:O,parentDataProperty:"if",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.then&&(o(O.then,{instancePath:$+"/then",parentData:O,parentDataProperty:"then",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.else&&(o(O.else,{instancePath:$+"/else",parentData:O,parentDataProperty:"else",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.allOf&&(ie(O.allOf,{instancePath:$+"/allOf",parentData:O,parentDataProperty:"allOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),Y=p.length)),void 0!==O.anyOf&&(ie(O.anyOf,{instancePath:$+"/anyOf",parentData:O,parentDataProperty:"anyOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),Y=p.length)),void 0!==O.oneOf&&(ie(O.oneOf,{instancePath:$+"/oneOf",parentData:O,parentDataProperty:"oneOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),Y=p.length)),void 0!==O.not&&(o(O.not,{instancePath:$+"/not",parentData:O,parentDataProperty:"not",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length))}return o.errors=p,0===Y}function h(O,{instancePath:$="",rootData:s=O}={}){let p=null,Y=0;if(!O||"object"!=typeof O||Array.isArray(O)){const xe={instancePath:$,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:k.type,parentSchema:k,data:O};null===p?p=[xe]:p.push(xe),Y++}const ee=Y;let oe=!1,de=null;const Ae=Y;if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0===O.path){const xe={instancePath:$,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"path"},message:"must have required property 'path'",schema:k.oneOf[0].required,parentSchema:k.oneOf[0],data:O};null===p?p=[xe]:p.push(xe),Y++}for(const xe in O)if("id"!==xe&&"path"!==xe&&"purpose"!==xe&&"intent_to_retain"!==xe&&"filter"!==xe&&"name"!==xe){const De={instancePath:$,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:xe},message:"must NOT have additional properties",schema:!1,parentSchema:k.oneOf[0],data:O};null===p?p=[De]:p.push(De),Y++}if(void 0!==O.id){let xe=O.id;if("string"!=typeof xe){const De={instancePath:$+"/id",schemaPath:"#/oneOf/0/properties/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:k.oneOf[0].properties.id.type,parentSchema:k.oneOf[0].properties.id,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.path){let xe=O.path;if(Array.isArray(xe)){const De=xe.length;for(let Xe=0;Xe{"use strict";function f(me,ye){return{validate:me,compare:ye}}Object.defineProperty(F,"__esModule",{value:!0}),F.formatNames=F.fastFormats=F.fullFormats=void 0,F.fullFormats={date:f(B,m),time:f(g,E),"date-time":f(function M(me){const ye=me.split(R);return 2===ye.length&&B(ye[0])&&g(ye[1],!0)},_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function k(me){return j.test(me)&&P.test(me)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function ae(me){if(ie.test(me))return!1;try{return new RegExp(me),!0}catch{return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function W(me){return z.lastIndex=0,z.test(me)},int32:{type:"number",validate:function q(me){return Number.isInteger(me)&&me<=Z&&me>=V}},int64:{type:"number",validate:function re(me){return Number.isInteger(me)}},float:{type:"number",validate:te},double:{type:"number",validate:te},password:!0,binary:!0},F.fastFormats={...F.fullFormats,date:f(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,m),time:f(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,E),"date-time":f(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},F.formatNames=Object.keys(F.fullFormats);const a=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,x=[0,31,28,31,30,31,30,31,31,30,31,30,31];function B(me){const ye=a.exec(me);if(!ye)return!1;const K=+ye[2],o=+ye[3];return K>=1&&K<=12&&o>=1&&o<=(2===K&&function i(me){return me%4==0&&(me%100!=0||me%400==0)}(+ye[1])?29:x[K])}function m(me,ye){if(me&&ye)return me>ye?1:me(ye=K[1]+K[2]+K[3]+(K[4]||""))?1:me{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(3993),a=f(10122),x=f(85432),B=new x.Name("fullFormats"),m=new x.Name("fastFormats"),S=(E,R={keywords:!0})=>{if(Array.isArray(R))return g(E,R,i.fullFormats,B),E;const[M,_]="fast"===R.mode?[i.fastFormats,m]:[i.fullFormats,B];return g(E,R.formats||i.formatNames,M,_),R.keywords&&a.default(E),E};function g(E,R,M,_){var j,P;null!==(j=(P=E.opts.code).formats)&&void 0!==j||(P.formats=x._`require("ajv-formats/dist/formats").${_}`);for(const k of R)E.addFormat(k,M[k])}S.get=(E,R="full")=>{const _=("fast"===R?i.fastFormats:i.fullFormats)[E];if(!_)throw new Error(`Unknown format "${E}"`);return _},Me.exports=F=S,Object.defineProperty(F,"__esModule",{value:!0}),F.default=S},10122:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.formatLimitDefinition=void 0;const i=f(39208),a=f(85432),x=a.operators,B={formatMaximum:{okStr:"<=",ok:x.LTE,fail:x.GT},formatMinimum:{okStr:">=",ok:x.GTE,fail:x.LT},formatExclusiveMaximum:{okStr:"<",ok:x.LT,fail:x.GTE},formatExclusiveMinimum:{okStr:">",ok:x.GT,fail:x.LTE}},m={message:({keyword:g,schemaCode:E})=>a.str`should be ${B[g].okStr} ${E}`,params:({keyword:g,schemaCode:E})=>a._`{comparison: ${B[g].okStr}, limit: ${E}}`};F.formatLimitDefinition={keyword:Object.keys(B),type:"string",schemaType:"string",$data:!0,error:m,code(g){const{gen:E,data:R,schemaCode:M,keyword:_,it:j}=g,{opts:P,self:k}=j;if(!P.validateFormats)return;const z=new i.KeywordCxt(j,k.RULES.all.format.definition,"format");function Z(q){return a._`${q}.compare(${R}, ${M}) ${B[_].fail} 0`}z.$data?function W(){const q=E.scopeValue("formats",{ref:k.formats,code:P.code.formats}),re=E.const("fmt",a._`${q}[${z.schemaCode}]`);g.fail$data(a.or(a._`typeof ${re} != "object"`,a._`${re} instanceof RegExp`,a._`typeof ${re}.compare != "function"`,Z(re)))}():function V(){const q=z.schema,re=k.formats[q];if(!re||!0===re)return;if("object"!=typeof re||re instanceof RegExp||"function"!=typeof re.compare)throw new Error(`"${_}": format "${q}" does not define "compare" function`);const te=E.scopeValue("formats",{key:q,ref:re,code:P.code.formats?a._`${P.code.formats}${a.getProperty(q)}`:void 0});g.fail$data(Z(te))}()},dependencies:["format"]},F.default=g=>(g.addKeyword(F.formatLimitDefinition),g)},11151:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(76533),F),a(f(59433),F),a(f(54065),F)},51236:function(Me,F,f){"use strict";var i=this&&this.__rest||function(g,E){var R={};for(var M in g)Object.prototype.hasOwnProperty.call(g,M)&&E.indexOf(M)<0&&(R[M]=g[M]);if(null!=g&&"function"==typeof Object.getOwnPropertySymbols){var _=0;for(M=Object.getOwnPropertySymbols(g);_S.toWrappedVerifiableCredential(M,R))}static toWrappedVerifiableCredential(E,R){var M;if(S.isSdJwtDecodedCredential(E)||S.isSdJwtEncoded(E)){let q;if(S.isSdJwtEncoded(E)){if(!R?.hasher)throw new Error("Hasher implementation is required to decode SD-JWT");q=(0,B.decodeSdJwtVc)(E,R.hasher)}else q=E;return{type:S.isSdJwtDecodedCredential(E)?B.OriginalType.SD_JWT_VC_DECODED:B.OriginalType.SD_JWT_VC_ENCODED,format:"vc+sd-jwt",original:E,credential:q,decoded:q.decodedPayload}}const _=S.getFirstProof(E),j=S.hasJWTProofType(E)&&_&&null!==(M=_.jwt)&&void 0!==M?M:E;if(!j)throw Error("Could not determine original credential, probably it was a converted JWT credential, that is now missing the JWT value in the proof");const P=S.decodeVerifiableCredential(j),k=S.isJwtEncoded(j),z=S.isJwtDecodedCredential(j);return{original:j,decoded:P,format:k||z?"jwt_vc":"ldp_vc",type:k?B.OriginalType.JWT_ENCODED:z?B.OriginalType.JWT_DECODED:B.OriginalType.JSONLD,credential:k||z?S.jwtDecodedCredentialToUniformCredential(P,R):P}}static isJwtEncoded(E){return m.ObjectUtils.isString(E)&&E.startsWith("ey")&&!E.includes("~")}static isSdJwtEncoded(E){return m.ObjectUtils.isString(E)&&E.startsWith("ey")&&E.includes("~")}static isW3cCredential(E){var R;return"@context"in E&&((null===(R=E.type)||void 0===R?void 0:R.includes("VerifiableCredential"))||!1)}static isCredential(E){try{if(S.isJwtEncoded(E)){const R=S.toUniformCredential(E);return S.isW3cCredential(R)}return!!S.isSdJwtEncoded(E)||S.isW3cCredential(E)||S.isSdJwtDecodedCredentialPayload(E)||S.isJwtDecodedCredential(E)||S.isSdJwtDecodedCredential(E)}catch{return!1}}static isPresentation(E){try{if(S.isJwtEncoded(E)){const R=S.toUniformPresentation(E);return S.isW3cPresentation(R)}return!S.isSdJwtEncoded(E)&&(S.isW3cPresentation(E)||S.isSdJwtDecodedCredentialPayload(E)||S.isJwtDecodedPresentation(E)||S.isSdJwtDecodedCredential(E))}catch{return!1}}static hasProof(E){try{return!!(S.isJwtEncoded(E)||S.isJwtDecodedCredential(E)||S.isSdJwtEncoded(E)||S.isSdJwtDecodedCredential(E)||"vc"in E&&E.vc.proof||"vp"in E&&E.vp.proof)||!!E.proof}catch{return!1}}static isW3cPresentation(E){var R;return"@context"in E&&((null===(R=E.type)||void 0===R?void 0:R.includes("VerifiablePresentation"))||!1)}static isSdJwtDecodedCredentialPayload(E){return"vct"in E}static areOriginalVerifiableCredentialsEqual(E,R){return"string"==typeof E||"string"==typeof R?E===R:S.isSdJwtDecodedCredential(E)||S.isSdJwtDecodedCredential(R)?E.compactSdJwtVc===R.compactSdJwtVc:JSON.stringify(R.proof)===JSON.stringify(E.proof)}static isJsonLdAsString(E){return m.ObjectUtils.isString(E)&&E.includes("@context")}static isSdJwtDecodedCredential(E){return void 0!==E.compactSdJwtVc}static isJwtDecodedCredential(E){return void 0!==E.vc&&void 0!==E.iss}static isJwtDecodedPresentation(E){return void 0!==E.vp&&void 0!==E.iss}static jwtEncodedPresentationToUniformPresentation(E,R=!0,M){return S.jwtDecodedPresentationToUniformPresentation((0,x.default)(E),R,M)}static jwtDecodedPresentationToUniformPresentation(E,R=!0,M){const{iss:_,aud:j,jti:P,vp:k}=E,z=i(E,["iss","aud","jti","vp"]),W=Object.assign(Object.assign({},z),k);if(R){if(!k.verifiableCredential)throw Error("Verifiable Presentation should have a verifiable credential at this point");W.verifiableCredential=k.verifiableCredential.map(V=>S.toUniformCredential(V,M))}if(_){const V=W.holder;if(V&&V!==_)throw new Error(`Inconsistent holders between JWT claim (${_}) and VC value (${V})`);W.holder=_}if(j){const V=W.verifier;if(V&&V!==j)throw new Error(`Inconsistent holders between JWT claim (${j}) and VC value (${V})`);W.verifier=j}if(P){const V=W.id;if(V&&V!==P)throw new Error(`Inconsistent VP ids between JWT claim (${P}) and VP value (${V})`);W.id=P}return W}static toUniformCredential(E,R){var M;if(S.isSdJwtDecodedCredential(E))throw new Error("Converting SD-JWT VC to uniform VC is not supported.");const _="string"!=typeof E&&S.hasJWTProofType(E)?null===(M=S.getFirstProof(E))||void 0===M?void 0:M.jwt:E;if(!_)throw Error("Could not determine original credential from passed in credential. Probably because a JWT proof type was present, but now is not available anymore");const j=S.decodeVerifiableCredential(_),P=S.isJwtEncoded(_);return S.isJwtDecodedCredential(_)||P?S.jwtDecodedCredentialToUniformCredential(j,R):j}static toUniformPresentation(E,R){var M;if(S.isSdJwtDecodedCredential(E))throw new Error("Converting SD-JWT VC to uniform VP is not supported.");const _=S.getFirstProof(E),j="string"!=typeof E&&S.hasJWTProofType(E)?_?.jwt:E;if(!j)throw Error("Could not determine original presentation, probably it was a converted JWT presentation, that is now missing the JWT value in the proof");const P=S.decodeVerifiablePresentation(j),k=S.isJwtEncoded(j),z=S.isJwtDecodedPresentation(j),W=k||z?S.jwtDecodedPresentationToUniformPresentation(P,!1):P;return R?.addContextIfMissing&&!W["@context"]&&(W["@context"]=["https://www.w3.org/2018/credentials/v1"]),W.verifiableCredential=null===(M=W.verifiableCredential)||void 0===M?void 0:M.map(V=>S.toUniformCredential(V,R)),W}static jwtEncodedCredentialToUniformCredential(E,R){return S.jwtDecodedCredentialToUniformCredential((0,x.default)(E),R)}static jwtDecodedCredentialToUniformCredential(E,R){var M;const{exp:_,nbf:j,iss:P,vc:k,sub:z,jti:W}=E,V=i(E,["exp","nbf","iss","vc","sub","jti"]),Z=Object.assign(Object.assign({},V),k),q=null!==(M=R?.maxTimeSkewInMS)&&void 0!==M?M:1500;if(_){const re=Z.expirationDate,te=parseInt(_.toString()),ie=te<9999999999?new Date(1e3*te).toISOString().replace(/\.000Z/,"Z"):new Date(te).toISOString();if(re&&re!==ie){const ae=Math.abs(new Date(ie).getTime()-new Date(re).getTime());if(!q||ae>q)throw new Error(`Inconsistent expiration dates between JWT claim (${ie}) and VC value (${re})`)}Z.expirationDate=ie}if(j){const re=Z.issuanceDate,te=parseInt(j.toString()),ie=te<9999999999?new Date(1e3*te).toISOString().replace(/\.000Z/,"Z"):new Date(te).toISOString();if(re&&re!==ie){const ae=Math.abs(new Date(ie).getTime()-new Date(re).getTime());if(!q||ae>q)throw new Error(`Inconsistent issuance dates between JWT claim (${ie}) and VC value (${re})`)}Z.issuanceDate=ie}if(P){const re=Z.issuer;if(re){if("string"==typeof re){if(re!==P)throw new Error(`Inconsistent issuers between JWT claim (${P}) and VC value (${re})`)}else if(!re.id&&Object.keys(re).length>0&&(re.id=P),re.id!==P)throw new Error(`Inconsistent issuers between JWT claim (${P}) and VC value (${re.id})`)}else Z.issuer=P}if(z){const re=Array.isArray(Z.credentialSubject)?Z.credentialSubject:[Z.credentialSubject];for(let te=0;te{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapLanguageValues=F.mapLanguageValue=F.toLanguageValueObjects=F.toLanguageValueObject=F.isLanguageValueObjects=F.isLanguageValueObject=void 0;const i=f(59433);F.isLanguageValueObject=E=>!(!E||!i.ObjectUtils.isObject(E)||Array.isArray(E)||2!==Object.keys(E).length||!("language"in E)||!E.language||!("value"in E)||!E.value),F.isLanguageValueObjects=E=>!(!E||!Array.isArray(E))&&E.every(R=>(0,F.isLanguageValueObject)(R)),F.toLanguageValueObject=E=>(0,F.isLanguageValueObject)(E)?E:void 0,F.toLanguageValueObjects=E=>(0,F.isLanguageValueObject)(E)?i.ObjectUtils.asArray((0,F.toLanguageValueObject)(E)):(0,F.isLanguageValueObjects)(E)?E:void 0,F.mapLanguageValue=(E,R)=>{const M=(0,F.toLanguageValueObjects)(E);if(Array.isArray(M)){if(0===M.length)return E;const _=M.filter(P=>!R?.language||P.language.toLowerCase().includes(R.language.toLowerCase()));let j;if(_.length>0)j=_[0];else{if(!1===R?.fallbackToFirstObject)return E;j=M[0]}return j.value}return E},F.mapLanguageValues=(E,R)=>{const M=R?.noDeepClone?E:JSON.parse(JSON.stringify(E));return Object.keys(E).forEach(_=>{M[_]=(0,F.mapLanguageValue)(M[_],R),(i.ObjectUtils.isObject(M[_])||Array.isArray(M[_]))&&(M[_]=(0,F.mapLanguageValues)(M[_],Object.assign(Object.assign({},R),{noDeepClone:!0})))}),M}},40528:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.parseDid=F.IProofType=F.IProofPurpose=void 0;var f=function(B){return B.verificationMethod="verificationMethod",B.assertionMethod="assertionMethod",B.authentication="authentication",B.keyAgreement="keyAgreement",B.contractAgreement="contactAgreement",B.capabilityInvocation="capabilityInvocation",B.capabilityDelegation="capabilityDelegation",B}(f||(F.IProofPurpose=f={})),i=function(B){return B.Ed25519Signature2018="Ed25519Signature2018",B.Ed25519Signature2020="Ed25519Signature2020",B.EcdsaSecp256k1Signature2019="EcdsaSecp256k1Signature2019",B.EcdsaSecp256k1RecoverySignature2020="EcdsaSecp256k1RecoverySignature2020",B.JsonWebSignature2020="JsonWebSignature2020",B.RsaSignature2018="RsaSignature2018",B.GpgSignature2020="GpgSignature2020",B.JcsEd25519Signature2020="JcsEd25519Signature2020",B.BbsBlsSignatureProof2020="BbsBlsSignatureProof2020",B.BbsBlsBoundSignatureProof2020="BbsBlsBoundSignatureProof2020",B.JwtProof2020="JwtProof2020",B}(i||(F.IProofType=i={}));F.parseDid=B=>{const m=x(B);if(null===m)throw new Error("invalid did");return m};const x=B=>{const S="(?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))",R="[a-zA-Z0-9_.:%-]",z=new RegExp(`^did:([a-z0-9]+):((?:${S}*:)*(${S}+))((;${R}+=${R}*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$`);if(""===B||!B)return null;const W=B.match(z);if(W){const V={did:`did:${W[1]}:${W[2]}`,method:W[1],id:W[2],didUrl:B};if(W[4]){const Z=W[4].slice(1).split(";");V.params={};for(const q of Z){const re=q.split("=");V.params[re[0]]=re[1]}}return W[6]&&(V.path=W[6]),W[7]&&(V.query=W[7].slice(1)),W[8]&&(V.fragment=W[8].slice(1)),V}return null}},5940:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},76533:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(40528),F),a(f(30988),F),a(f(69922),F),a(f(5940),F),a(f(86548),F),a(f(66996),F)},30988:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},86548:function(Me,F,f){"use strict";var i=this&&this.__awaiter||function(g,E,R,M){return new(R||(R=Promise))(function(j,P){function k(V){try{W(M.next(V))}catch(Z){P(Z)}}function z(V){try{W(M.throw(V))}catch(Z){P(Z)}}function W(V){V.done?j(V.value):function _(j){return j instanceof R?j:new R(function(P){P(j)})}(V.value).then(k,z)}W((M=M.apply(g,E||[])).next())})};Object.defineProperty(F,"__esModule",{value:!0}),F.decodeSdJwtVcAsync=F.decodeSdJwtVc=F.isWrappedSdJwtVerifiablePresentation=F.isWrappedSdJwtVerifiableCredential=void 0;const a=f(15315);F.isWrappedSdJwtVerifiableCredential=function x(g){return"vc+sd-jwt"===g.format},F.isWrappedSdJwtVerifiablePresentation=function B(g){return"vc+sd-jwt"===g.format},F.decodeSdJwtVc=function m(g,E){const{jwt:R,disclosures:M}=(0,a.decodeSdJwtSync)(g,E),_=R.payload;return{compactSdJwtVc:g,decodedPayload:(0,a.getClaimsSync)(_,M,E),disclosures:M.map(P=>{const k=P.key?[P.salt,P.key,P.value]:[P.salt,P.value];if(!P._digest)throw new Error("Implementation error: digest not present in disclosure");return{decoded:k,digest:P._digest,encoded:P.encode()}}),signedPayload:_}},F.decodeSdJwtVcAsync=function S(g,E){return i(this,void 0,void 0,function*(){const{jwt:R,disclosures:M}=yield(0,a.decodeSdJwt)(g,E),_=R.payload,j=yield(0,a.getClaims)(_,M,E);return{compactSdJwtVc:g,decodedPayload:j,disclosures:M.map(P=>{const k=P.key?[P.salt,P.key,P.value]:[P.salt,P.value];if(!P._digest)throw new Error("Implementation error: digest not present in disclosure");return{decoded:k,digest:P._digest,encoded:P.encode()}}),signedPayload:_}})}},69922:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.DocumentFormat=F.OriginalType=void 0;var f=function(a){return a.JSONLD="json-ld",a.JWT_ENCODED="jwt-encoded",a.JWT_DECODED="jwt-decoded",a.SD_JWT_VC_ENCODED="sd-jwt-vc-encoded",a.SD_JWT_VC_DECODED="sd-jwt-vc-decoded",a}(f||(F.OriginalType=f={})),i=function(a){return a[a.JWT=0]="JWT",a[a.JSONLD=1]="JSONLD",a[a.SD_JWT_VC=2]="SD_JWT_VC",a[a.EIP712=3]="EIP712",a}(i||(F.DocumentFormat=i={}))},66996:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.isWrappedW3CVerifiablePresentation=F.isWrappedW3CVerifiableCredential=F.StatusListDriverType=F.StatusListCredentialIdMode=F.StatusListType=F.JWT_PROOF_TYPE_2020=void 0,F.JWT_PROOF_TYPE_2020="JwtProof2020";var f=function(m){return m.StatusList2021="StatusList2021",m}(f||(F.StatusListType=f={})),i=function(m){return m.ISSUANCE="ISSUANCE",m.PERSISTENCE="PERSISTENCE",m.NEVER="NEVER",m}(i||(F.StatusListCredentialIdMode=i={})),a=function(m){return m.AGENT_TYPEORM="agent_typeorm",m.AGENT_KV_STORE="agent_kv_store",m.GITHUB="github",m.AGENT_FILESYSTEM="agent_filesystem",m}(a||(F.StatusListDriverType=a={}));F.isWrappedW3CVerifiableCredential=function x(m){return"jwt_vc"===m.format||"ldp_vc"===m.format},F.isWrappedW3CVerifiablePresentation=function B(m){return"jwt_vp"===m.format||"ldp_vp"===m.format}},59433:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(24418),F)},24418:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectUtils=void 0;class f{static asArray(a){return Array.isArray(a)?a:[a]}static isObject(a){return"object"==typeof a||"[object Object]"===Object.prototype.toString.call(a)}static isUrlAbsolute(a){f.isString(a)&&/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/.test(a)}static isString(a){return"string"==typeof a||"[object String]"===Object.prototype.toString.call(a)}}F.ObjectUtils=f},20844:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.MissingRefError=F.ValidationError=F.CodeGen=F.Name=F.nil=F.stringify=F.str=F._=F.KeywordCxt=void 0;const i=f(35419),a=f(98496),x=f(86980),B=f(87577),m="https://json-schema.org/draft/2020-12/schema";class S extends i.default{constructor(j={}){super({...j,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),a.default.forEach(j=>this.addVocabulary(j)),this.opts.discriminator&&this.addKeyword(x.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:j,meta:P}=this.opts;P&&(B.default.call(this,j),this.refs["http://json-schema.org/schema"]=m)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(m)?m:void 0)}}Me.exports=F=S,Object.defineProperty(F,"__esModule",{value:!0}),F.default=S;var g=f(40339);Object.defineProperty(F,"KeywordCxt",{enumerable:!0,get:function(){return g.KeywordCxt}});var E=f(1038);Object.defineProperty(F,"_",{enumerable:!0,get:function(){return E._}}),Object.defineProperty(F,"str",{enumerable:!0,get:function(){return E.str}}),Object.defineProperty(F,"stringify",{enumerable:!0,get:function(){return E.stringify}}),Object.defineProperty(F,"nil",{enumerable:!0,get:function(){return E.nil}}),Object.defineProperty(F,"Name",{enumerable:!0,get:function(){return E.Name}}),Object.defineProperty(F,"CodeGen",{enumerable:!0,get:function(){return E.CodeGen}});var R=f(42467);Object.defineProperty(F,"ValidationError",{enumerable:!0,get:function(){return R.default}});var M=f(26288);Object.defineProperty(F,"MissingRefError",{enumerable:!0,get:function(){return M.default}})},33337:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.regexpCode=F.getEsmExportName=F.getProperty=F.safeStringify=F.stringify=F.strConcat=F.addCodeArg=F.str=F._=F.nil=F._Code=F.Name=F.IDENTIFIER=F._CodeOrName=void 0;class f{}F._CodeOrName=f,F.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class i extends f{constructor(V){if(super(),!F.IDENTIFIER.test(V))throw new Error("CodeGen: name must be a valid identifier");this.str=V}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}F.Name=i;class a extends f{constructor(V){super(),this._items="string"==typeof V?[V]:V}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const V=this._items[0];return""===V||'""'===V}get str(){var V;return null!==(V=this._str)&&void 0!==V?V:this._str=this._items.reduce((Z,q)=>`${Z}${q}`,"")}get names(){var V;return null!==(V=this._names)&&void 0!==V?V:this._names=this._items.reduce((Z,q)=>(q instanceof i&&(Z[q.str]=(Z[q.str]||0)+1),Z),{})}}function x(W,...V){const Z=[W[0]];let q=0;for(;q{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.or=F.and=F.not=F.CodeGen=F.operators=F.varKinds=F.ValueScopeName=F.ValueScope=F.Scope=F.Name=F.regexpCode=F.stringify=F.getProperty=F.nil=F.strConcat=F.str=F._=void 0;const i=f(33337),a=f(85934);var x=f(33337);Object.defineProperty(F,"_",{enumerable:!0,get:function(){return x._}}),Object.defineProperty(F,"str",{enumerable:!0,get:function(){return x.str}}),Object.defineProperty(F,"strConcat",{enumerable:!0,get:function(){return x.strConcat}}),Object.defineProperty(F,"nil",{enumerable:!0,get:function(){return x.nil}}),Object.defineProperty(F,"getProperty",{enumerable:!0,get:function(){return x.getProperty}}),Object.defineProperty(F,"stringify",{enumerable:!0,get:function(){return x.stringify}}),Object.defineProperty(F,"regexpCode",{enumerable:!0,get:function(){return x.regexpCode}}),Object.defineProperty(F,"Name",{enumerable:!0,get:function(){return x.Name}});var B=f(85934);Object.defineProperty(F,"Scope",{enumerable:!0,get:function(){return B.Scope}}),Object.defineProperty(F,"ValueScope",{enumerable:!0,get:function(){return B.ValueScope}}),Object.defineProperty(F,"ValueScopeName",{enumerable:!0,get:function(){return B.ValueScopeName}}),Object.defineProperty(F,"varKinds",{enumerable:!0,get:function(){return B.varKinds}}),F.operators={GT:new i._Code(">"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._Code("+")};class m{optimizeNodes(){return this}optimizeNames(oe,de){return this}}class S extends m{constructor(oe,de,Ae){super(),this.varKind=oe,this.name=de,this.rhs=Ae}render({es5:oe,_n:de}){return`${oe?a.varKinds.var:this.varKind} ${this.name}${void 0===this.rhs?"":` = ${this.rhs}`};`+de}optimizeNames(oe,de){if(oe[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,oe,de)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class g extends m{constructor(oe,de,Ae){super(),this.lhs=oe,this.rhs=de,this.sideEffects=Ae}render({_n:oe}){return`${this.lhs} = ${this.rhs};`+oe}optimizeNames(oe,de){if(!(this.lhs instanceof i.Name)||oe[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,oe,de),this}get names(){return h(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class E extends g{constructor(oe,de,Ae,Ie){super(oe,Ae,Ie),this.op=de}render({_n:oe}){return`${this.lhs} ${this.op}= ${this.rhs};`+oe}}class R extends m{constructor(oe){super(),this.label=oe,this.names={}}render({_n:oe}){return`${this.label}:`+oe}}class M extends m{constructor(oe){super(),this.label=oe,this.names={}}render({_n:oe}){return`break${this.label?` ${this.label}`:""};`+oe}}class _ extends m{constructor(oe){super(),this.error=oe}render({_n:oe}){return`throw ${this.error};`+oe}get names(){return this.error.names}}class j extends m{constructor(oe){super(),this.code=oe}render({_n:oe}){return`${this.code};`+oe}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(oe,de){return this.code=A(this.code,oe,de),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class P extends m{constructor(oe=[]){super(),this.nodes=oe}render(oe){return this.nodes.reduce((de,Ae)=>de+Ae.render(oe),"")}optimizeNodes(){const{nodes:oe}=this;let de=oe.length;for(;de--;){const Ae=oe[de].optimizeNodes();Array.isArray(Ae)?oe.splice(de,1,...Ae):Ae?oe[de]=Ae:oe.splice(de,1)}return oe.length>0?this:void 0}optimizeNames(oe,de){const{nodes:Ae}=this;let Ie=Ae.length;for(;Ie--;){const Le=Ae[Ie];Le.optimizeNames(oe,de)||(I(oe,Le.names),Ae.splice(Ie,1))}return Ae.length>0?this:void 0}get names(){return this.nodes.reduce((oe,de)=>o(oe,de.names),{})}}class k extends P{render(oe){return"{"+oe._n+super.render(oe)+"}"+oe._n}}class z extends P{}let W=(()=>{class ee extends k{}return ee.kind="else",ee})(),V=(()=>{class ee extends k{constructor(de,Ae){super(Ae),this.condition=de}render(de){let Ae=`if(${this.condition})`+super.render(de);return this.else&&(Ae+="else "+this.else.render(de)),Ae}optimizeNodes(){super.optimizeNodes();const de=this.condition;if(!0===de)return this.nodes;let Ae=this.else;if(Ae){const Ie=Ae.optimizeNodes();Ae=this.else=Array.isArray(Ie)?new W(Ie):Ie}return Ae?!1===de?Ae instanceof ee?Ae:Ae.nodes:this.nodes.length?this:new ee(O(de),Ae instanceof ee?[Ae]:Ae.nodes):!1!==de&&this.nodes.length?this:void 0}optimizeNames(de,Ae){var Ie;if(this.else=null===(Ie=this.else)||void 0===Ie?void 0:Ie.optimizeNames(de,Ae),super.optimizeNames(de,Ae)||this.else)return this.condition=A(this.condition,de,Ae),this}get names(){const de=super.names;return h(de,this.condition),this.else&&o(de,this.else.names),de}}return ee.kind="if",ee})(),Z=(()=>{class ee extends k{}return ee.kind="for",ee})();class q extends Z{constructor(oe){super(),this.iteration=oe}render(oe){return`for(${this.iteration})`+super.render(oe)}optimizeNames(oe,de){if(super.optimizeNames(oe,de))return this.iteration=A(this.iteration,oe,de),this}get names(){return o(super.names,this.iteration.names)}}class re extends Z{constructor(oe,de,Ae,Ie){super(),this.varKind=oe,this.name=de,this.from=Ae,this.to=Ie}render(oe){const de=oe.es5?a.varKinds.var:this.varKind,{name:Ae,from:Ie,to:Le}=this;return`for(${de} ${Ae}=${Ie}; ${Ae}<${Le}; ${Ae}++)`+super.render(oe)}get names(){const oe=h(super.names,this.from);return h(oe,this.to)}}class te extends Z{constructor(oe,de,Ae,Ie){super(),this.loop=oe,this.varKind=de,this.name=Ae,this.iterable=Ie}render(oe){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(oe)}optimizeNames(oe,de){if(super.optimizeNames(oe,de))return this.iterable=A(this.iterable,oe,de),this}get names(){return o(super.names,this.iterable.names)}}let ie=(()=>{class ee extends k{constructor(de,Ae,Ie){super(),this.name=de,this.args=Ae,this.async=Ie}render(de){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(de)}}return ee.kind="func",ee})(),ae=(()=>{class ee extends P{render(de){return"return "+super.render(de)}}return ee.kind="return",ee})();class me extends k{render(oe){let de="try"+super.render(oe);return this.catch&&(de+=this.catch.render(oe)),this.finally&&(de+=this.finally.render(oe)),de}optimizeNodes(){var oe,de;return super.optimizeNodes(),null===(oe=this.catch)||void 0===oe||oe.optimizeNodes(),null===(de=this.finally)||void 0===de||de.optimizeNodes(),this}optimizeNames(oe,de){var Ae,Ie;return super.optimizeNames(oe,de),null===(Ae=this.catch)||void 0===Ae||Ae.optimizeNames(oe,de),null===(Ie=this.finally)||void 0===Ie||Ie.optimizeNames(oe,de),this}get names(){const oe=super.names;return this.catch&&o(oe,this.catch.names),this.finally&&o(oe,this.finally.names),oe}}let ye=(()=>{class ee extends k{constructor(de){super(),this.error=de}render(de){return`catch(${this.error})`+super.render(de)}}return ee.kind="catch",ee})(),ue=(()=>{class ee extends k{render(de){return"finally"+super.render(de)}}return ee.kind="finally",ee})();function o(ee,oe){for(const de in oe)ee[de]=(ee[de]||0)+(oe[de]||0);return ee}function h(ee,oe){return oe instanceof i._CodeOrName?o(ee,oe.names):ee}function A(ee,oe,de){return ee instanceof i.Name?Ae(ee):function Ie(Le){return Le instanceof i._Code&&Le._items.some(xe=>xe instanceof i.Name&&1===oe[xe.str]&&void 0!==de[xe.str])}(ee)?new i._Code(ee._items.reduce((Le,xe)=>(xe instanceof i.Name&&(xe=Ae(xe)),xe instanceof i._Code?Le.push(...xe._items):Le.push(xe),Le),[])):ee;function Ae(Le){const xe=de[Le.str];return void 0===xe||1!==oe[Le.str]?Le:(delete oe[Le.str],xe)}}function I(ee,oe){for(const de in oe)ee[de]=(ee[de]||0)-(oe[de]||0)}function O(ee){return"boolean"==typeof ee||"number"==typeof ee||null===ee?!ee:i._`!${Y(ee)}`}F.CodeGen=class K{constructor(oe,de={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...de,_n:de.lines?"\n":""},this._extScope=oe,this._scope=new a.Scope({parent:oe}),this._nodes=[new z]}toString(){return this._root.render(this.opts)}name(oe){return this._scope.name(oe)}scopeName(oe){return this._extScope.name(oe)}scopeValue(oe,de){const Ae=this._extScope.value(oe,de);return(this._values[Ae.prefix]||(this._values[Ae.prefix]=new Set)).add(Ae),Ae}getScopeValue(oe,de){return this._extScope.getValue(oe,de)}scopeRefs(oe){return this._extScope.scopeRefs(oe,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(oe,de,Ae,Ie){const Le=this._scope.toName(de);return void 0!==Ae&&Ie&&(this._constants[Le.str]=Ae),this._leafNode(new S(oe,Le,Ae)),Le}const(oe,de,Ae){return this._def(a.varKinds.const,oe,de,Ae)}let(oe,de,Ae){return this._def(a.varKinds.let,oe,de,Ae)}var(oe,de,Ae){return this._def(a.varKinds.var,oe,de,Ae)}assign(oe,de,Ae){return this._leafNode(new g(oe,de,Ae))}add(oe,de){return this._leafNode(new E(oe,F.operators.ADD,de))}code(oe){return"function"==typeof oe?oe():oe!==i.nil&&this._leafNode(new j(oe)),this}object(...oe){const de=["{"];for(const[Ae,Ie]of oe)de.length>1&&de.push(","),de.push(Ae),(Ae!==Ie||this.opts.es5)&&(de.push(":"),(0,i.addCodeArg)(de,Ie));return de.push("}"),new i._Code(de)}if(oe,de,Ae){if(this._blockNode(new V(oe)),de&&Ae)this.code(de).else().code(Ae).endIf();else if(de)this.code(de).endIf();else if(Ae)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(oe){return this._elseNode(new V(oe))}else(){return this._elseNode(new W)}endIf(){return this._endBlockNode(V,W)}_for(oe,de){return this._blockNode(oe),de&&this.code(de).endFor(),this}for(oe,de){return this._for(new q(oe),de)}forRange(oe,de,Ae,Ie,Le=(this.opts.es5?a.varKinds.var:a.varKinds.let)){const xe=this._scope.toName(oe);return this._for(new re(Le,xe,de,Ae),()=>Ie(xe))}forOf(oe,de,Ae,Ie=a.varKinds.const){const Le=this._scope.toName(oe);if(this.opts.es5){const xe=de instanceof i.Name?de:this.var("_arr",de);return this.forRange("_i",0,i._`${xe}.length`,De=>{this.var(Le,i._`${xe}[${De}]`),Ae(Le)})}return this._for(new te("of",Ie,Le,de),()=>Ae(Le))}forIn(oe,de,Ae,Ie=(this.opts.es5?a.varKinds.var:a.varKinds.const)){if(this.opts.ownProperties)return this.forOf(oe,i._`Object.keys(${de})`,Ae);const Le=this._scope.toName(oe);return this._for(new te("in",Ie,Le,de),()=>Ae(Le))}endFor(){return this._endBlockNode(Z)}label(oe){return this._leafNode(new R(oe))}break(oe){return this._leafNode(new M(oe))}return(oe){const de=new ae;if(this._blockNode(de),this.code(oe),1!==de.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ae)}try(oe,de,Ae){if(!de&&!Ae)throw new Error('CodeGen: "try" without "catch" and "finally"');const Ie=new me;if(this._blockNode(Ie),this.code(oe),de){const Le=this.name("e");this._currNode=Ie.catch=new ye(Le),de(Le)}return Ae&&(this._currNode=Ie.finally=new ue,this.code(Ae)),this._endBlockNode(ye,ue)}throw(oe){return this._leafNode(new _(oe))}block(oe,de){return this._blockStarts.push(this._nodes.length),oe&&this.code(oe).endBlock(de),this}endBlock(oe){const de=this._blockStarts.pop();if(void 0===de)throw new Error("CodeGen: not in self-balancing block");const Ae=this._nodes.length-de;if(Ae<0||void 0!==oe&&Ae!==oe)throw new Error(`CodeGen: wrong number of nodes: ${Ae} vs ${oe} expected`);return this._nodes.length=de,this}func(oe,de=i.nil,Ae,Ie){return this._blockNode(new ie(oe,de,Ae)),Ie&&this.code(Ie).endFunc(),this}endFunc(){return this._endBlockNode(ie)}optimize(oe=1){for(;oe-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(oe){return this._currNode.nodes.push(oe),this}_blockNode(oe){this._currNode.nodes.push(oe),this._nodes.push(oe)}_endBlockNode(oe,de){const Ae=this._currNode;if(Ae instanceof oe||de&&Ae instanceof de)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${de?`${oe.kind}/${de.kind}`:oe.kind}"`)}_elseNode(oe){const de=this._currNode;if(!(de instanceof V))throw new Error('CodeGen: "else" without "if"');return this._currNode=de.else=oe,this}get _root(){return this._nodes[0]}get _currNode(){const oe=this._nodes;return oe[oe.length-1]}set _currNode(oe){const de=this._nodes;de[de.length-1]=oe}},F.not=O;const $=p(F.operators.AND);F.and=function H(...ee){return ee.reduce($)};const D=p(F.operators.OR);function p(ee){return(oe,de)=>oe===i.nil?de:de===i.nil?oe:i._`${Y(oe)} ${ee} ${Y(de)}`}function Y(ee){return ee instanceof i.Name?ee:i._`(${ee})`}F.or=function s(...ee){return ee.reduce(D)}},85934:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValueScope=F.ValueScopeName=F.Scope=F.varKinds=F.UsedValueState=void 0;const i=f(33337);class a extends Error{constructor(R){super(`CodeGen: "code" for ${R} not defined`),this.value=R.value}}var x,E;(E=x=F.UsedValueState||(F.UsedValueState={}))[E.Started=0]="Started",E[E.Completed=1]="Completed",F.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class B{constructor({prefixes:R,parent:M}={}){this._names={},this._prefixes=R,this._parent=M}toName(R){return R instanceof i.Name?R:this.name(R)}name(R){return new i.Name(this._newName(R))}_newName(R){return`${R}${(this._names[R]||this._nameGroup(R)).index++}`}_nameGroup(R){var M,_;if(null!==(_=null===(M=this._parent)||void 0===M?void 0:M._prefixes)&&void 0!==_&&_.has(R)||this._prefixes&&!this._prefixes.has(R))throw new Error(`CodeGen: prefix "${R}" is not allowed in this scope`);return this._names[R]={prefix:R,index:0}}}F.Scope=B;class m extends i.Name{constructor(R,M){super(M),this.prefix=R}setValue(R,{property:M,itemIndex:_}){this.value=R,this.scopePath=i._`.${new i.Name(M)}[${_}]`}}F.ValueScopeName=m;const S=i._`\n`;F.ValueScope=class g extends B{constructor(R){super(R),this._values={},this._scope=R.scope,this.opts={...R,_n:R.lines?S:i.nil}}get(){return this._scope}name(R){return new m(R,this._newName(R))}value(R,M){var _;if(void 0===M.ref)throw new Error("CodeGen: ref must be passed in value");const j=this.toName(R),{prefix:P}=j,k=null!==(_=M.key)&&void 0!==_?_:M.ref;let z=this._values[P];if(z){const Z=z.get(k);if(Z)return Z}else z=this._values[P]=new Map;z.set(k,j);const W=this._scope[P]||(this._scope[P]=[]),V=W.length;return W[V]=M.ref,j.setValue(M,{property:P,itemIndex:V}),j}getValue(R,M){const _=this._values[R];if(_)return _.get(M)}scopeRefs(R,M=this._values){return this._reduceValues(M,_=>{if(void 0===_.scopePath)throw new Error(`CodeGen: name "${_}" has no value`);return i._`${R}${_.scopePath}`})}scopeCode(R=this._values,M,_){return this._reduceValues(R,j=>{if(void 0===j.value)throw new Error(`CodeGen: name "${j}" has no value`);return j.value.code},M,_)}_reduceValues(R,M,_={},j){let P=i.nil;for(const k in R){const z=R[k];if(!z)continue;const W=_[k]=_[k]||new Map;z.forEach(V=>{if(W.has(V))return;W.set(V,x.Started);let Z=M(V);if(Z)P=i._`${P}${this.opts.es5?F.varKinds.var:F.varKinds.const} ${V} = ${Z};${this.opts._n}`;else{if(!(Z=j?.(V)))throw new a(V);P=i._`${P}${Z}${this.opts._n}`}W.set(V,x.Completed)})}return P}}},53421:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.extendErrors=F.resetErrorsCount=F.reportExtraError=F.reportError=F.keyword$DataError=F.keywordError=void 0;const i=f(1038),a=f(27006),x=f(23432);function E(W,V){const Z=W.const("err",V);W.if(i._`${x.default.vErrors} === null`,()=>W.assign(x.default.vErrors,i._`[${Z}]`),i._`${x.default.vErrors}.push(${Z})`),W.code(i._`${x.default.errors}++`)}function R(W,V){const{gen:Z,validateName:q,schemaEnv:re}=W;re.$async?Z.throw(i._`new ${W.ValidationError}(${V})`):(Z.assign(i._`${q}.errors`,V),Z.return(!1))}F.keywordError={message:({keyword:W})=>i.str`must pass "${W}" keyword validation`},F.keyword$DataError={message:({keyword:W,schemaType:V})=>V?i.str`"${W}" keyword must be ${V} ($data)`:i.str`"${W}" keyword is invalid ($data)`},F.reportError=function B(W,V=F.keywordError,Z,q){const{it:re}=W,{gen:te,compositeRule:ie,allErrors:ae}=re,me=_(W,V,Z);q??(ie||ae)?E(te,me):R(re,i._`[${me}]`)},F.reportExtraError=function m(W,V=F.keywordError,Z){const{it:q}=W,{gen:re,compositeRule:te,allErrors:ie}=q;E(re,_(W,V,Z)),te||ie||R(q,x.default.vErrors)},F.resetErrorsCount=function S(W,V){W.assign(x.default.errors,V),W.if(i._`${x.default.vErrors} !== null`,()=>W.if(V,()=>W.assign(i._`${x.default.vErrors}.length`,V),()=>W.assign(x.default.vErrors,null)))},F.extendErrors=function g({gen:W,keyword:V,schemaValue:Z,data:q,errsCount:re,it:te}){if(void 0===re)throw new Error("ajv implementation error");const ie=W.name("err");W.forRange("i",re,x.default.errors,ae=>{W.const(ie,i._`${x.default.vErrors}[${ae}]`),W.if(i._`${ie}.instancePath === undefined`,()=>W.assign(i._`${ie}.instancePath`,(0,i.strConcat)(x.default.instancePath,te.errorPath))),W.assign(i._`${ie}.schemaPath`,i.str`${te.errSchemaPath}/${V}`),te.opts.verbose&&(W.assign(i._`${ie}.schema`,Z),W.assign(i._`${ie}.data`,q))})};const M={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function _(W,V,Z){const{createErrors:q}=W.it;return!1===q?i._`{}`:function j(W,V,Z={}){const{gen:q,it:re}=W,te=[P(re,Z),k(W,Z)];return function z(W,{params:V,message:Z},q){const{keyword:re,data:te,schemaValue:ie,it:ae}=W,{opts:me,propertyName:ye,topSchemaRef:ue,schemaPath:K}=ae;q.push([M.keyword,re],[M.params,"function"==typeof V?V(W):V||i._`{}`]),me.messages&&q.push([M.message,"function"==typeof Z?Z(W):Z]),me.verbose&&q.push([M.schema,ie],[M.parentSchema,i._`${ue}${K}`],[x.default.data,te]),ye&&q.push([M.propertyName,ye])}(W,V,te),q.object(...te)}(W,V,Z)}function P({errorPath:W},{instancePath:V}){const Z=V?i.str`${W}${(0,a.getErrorPath)(V,a.Type.Str)}`:W;return[x.default.instancePath,(0,i.strConcat)(x.default.instancePath,Z)]}function k({keyword:W,it:{errSchemaPath:V}},{schemaPath:Z,parentSchema:q}){let re=q?V:i.str`${V}/${W}`;return Z&&(re=i.str`${re}${(0,a.getErrorPath)(Z,a.Type.Str)}`),[M.schemaPath,re]}},97692:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.resolveSchema=F.getCompilingSchema=F.resolveRef=F.compileSchema=F.SchemaEnv=void 0;const i=f(1038),a=f(42467),x=f(23432),B=f(77172),m=f(27006),S=f(40339);class g{constructor(Z){var q;let re;this.refs={},this.dynamicAnchors={},"object"==typeof Z.schema&&(re=Z.schema),this.schema=Z.schema,this.schemaId=Z.schemaId,this.root=Z.root||this,this.baseId=null!==(q=Z.baseId)&&void 0!==q?q:(0,B.normalizeId)(re?.[Z.schemaId||"$id"]),this.schemaPath=Z.schemaPath,this.localRefs=Z.localRefs,this.meta=Z.meta,this.$async=re?.$async,this.refs={}}}function E(V){const Z=_.call(this,V);if(Z)return Z;const q=(0,B.getFullPath)(this.opts.uriResolver,V.root.baseId),{es5:re,lines:te}=this.opts.code,{ownProperties:ie}=this.opts,ae=new i.CodeGen(this.scope,{es5:re,lines:te,ownProperties:ie});let me;V.$async&&(me=ae.scopeValue("Error",{ref:a.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const ye=ae.scopeName("validate");V.validateName=ye;const ue={gen:ae,allErrors:this.opts.allErrors,data:x.default.data,parentData:x.default.parentData,parentDataProperty:x.default.parentDataProperty,dataNames:[x.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:ae.scopeValue("schema",!0===this.opts.code.source?{ref:V.schema,code:(0,i.stringify)(V.schema)}:{ref:V.schema}),validateName:ye,ValidationError:me,schema:V.schema,schemaEnv:V,rootId:q,baseId:V.baseId||q,schemaPath:i.nil,errSchemaPath:V.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let K;try{this._compilations.add(V),(0,S.validateFunctionCode)(ue),ae.optimize(this.opts.code.optimize);const o=ae.toString();K=`${ae.scopeRefs(x.default.scope)}return ${o}`,this.opts.code.process&&(K=this.opts.code.process(K,V));const A=new Function(`${x.default.self}`,`${x.default.scope}`,K)(this,this.scope.get());if(this.scope.value(ye,{ref:A}),A.errors=null,A.schema=V.schema,A.schemaEnv=V,V.$async&&(A.$async=!0),!0===this.opts.code.source&&(A.source={validateName:ye,validateCode:o,scopeValues:ae._values}),this.opts.unevaluated){const{props:I,items:O}=ue;A.evaluated={props:I instanceof i.Name?void 0:I,items:O instanceof i.Name?void 0:O,dynamicProps:I instanceof i.Name,dynamicItems:O instanceof i.Name},A.source&&(A.source.evaluated=(0,i.stringify)(A.evaluated))}return V.validate=A,V}catch(o){throw delete V.validate,delete V.validateName,K&&this.logger.error("Error compiling schema, function code:",K),o}finally{this._compilations.delete(V)}}function M(V){return(0,B.inlineRef)(V.schema,this.opts.inlineRefs)?V.schema:V.validate?V:E.call(this,V)}function _(V){for(const Z of this._compilations)if(j(Z,V))return Z}function j(V,Z){return V.schema===Z.schema&&V.root===Z.root&&V.baseId===Z.baseId}function P(V,Z){let q;for(;"string"==typeof(q=this.refs[Z]);)Z=q;return q||this.schemas[Z]||k.call(this,V,Z)}function k(V,Z){const q=this.opts.uriResolver.parse(Z),re=(0,B._getFullPath)(this.opts.uriResolver,q);let te=(0,B.getFullPath)(this.opts.uriResolver,V.baseId,void 0);if(Object.keys(V.schema).length>0&&re===te)return W.call(this,q,V);const ie=(0,B.normalizeId)(re),ae=this.refs[ie]||this.schemas[ie];if("string"==typeof ae){const me=k.call(this,V,ae);return"object"!=typeof me?.schema?void 0:W.call(this,q,me)}if("object"==typeof ae?.schema){if(ae.validate||E.call(this,ae),ie===(0,B.normalizeId)(Z)){const{schema:me}=ae,{schemaId:ye}=this.opts,ue=me[ye];return ue&&(te=(0,B.resolveUrl)(this.opts.uriResolver,te,ue)),new g({schema:me,schemaId:ye,root:V,baseId:te})}return W.call(this,q,ae)}}F.SchemaEnv=g,F.compileSchema=E,F.resolveRef=function R(V,Z,q){var re;q=(0,B.resolveUrl)(this.opts.uriResolver,Z,q);const te=V.refs[q];if(te)return te;let ie=P.call(this,V,q);if(void 0===ie){const ae=null===(re=V.localRefs)||void 0===re?void 0:re[q],{schemaId:me}=this.opts;ae&&(ie=new g({schema:ae,schemaId:me,root:V,baseId:Z}))}return void 0!==ie?V.refs[q]=M.call(this,ie):void 0},F.getCompilingSchema=_,F.resolveSchema=k;const z=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function W(V,{baseId:Z,schema:q,root:re}){var te;if("/"!==(null===(te=V.fragment)||void 0===te?void 0:te[0]))return;for(const me of V.fragment.slice(1).split("/")){if("boolean"==typeof q)return;const ye=q[(0,m.unescapeFragment)(me)];if(void 0===ye)return;const ue="object"==typeof(q=ye)&&q[this.opts.schemaId];!z.has(me)&&ue&&(Z=(0,B.resolveUrl)(this.opts.uriResolver,Z,ue))}let ie;if("boolean"!=typeof q&&q.$ref&&!(0,m.schemaHasRulesButRef)(q,this.RULES)){const me=(0,B.resolveUrl)(this.opts.uriResolver,Z,q.$ref);ie=k.call(this,re,me)}const{schemaId:ae}=this.opts;return ie=ie||new g({schema:q,schemaId:ae,root:re,baseId:Z}),ie.schema!==ie.root.schema?ie:void 0}},23432:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(1038),a={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};F.default=a},26288:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(77172);class a extends Error{constructor(B,m,S,g){super(g||`can't resolve reference ${S} from id ${m}`),this.missingRef=(0,i.resolveUrl)(B,m,S),this.missingSchema=(0,i.normalizeId)((0,i.getFullPath)(B,this.missingRef))}}F.default=a},77172:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.getSchemaRefs=F.resolveUrl=F.normalizeId=F._getFullPath=F.getFullPath=F.inlineRef=void 0;const i=f(27006),a=f(40362),x=f(44331),B=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);F.inlineRef=function m(W,V=!0){return"boolean"==typeof W||(!0===V?!g(W):!!V&&E(W)<=V)};const S=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function g(W){for(const V in W){if(S.has(V))return!0;const Z=W[V];if(Array.isArray(Z)&&Z.some(g)||"object"==typeof Z&&g(Z))return!0}return!1}function E(W){let V=0;for(const Z in W){if("$ref"===Z)return 1/0;if(V++,!B.has(Z)&&("object"==typeof W[Z]&&(0,i.eachItem)(W[Z],q=>V+=E(q)),V===1/0))return 1/0}return V}function R(W,V="",Z){!1!==Z&&(V=j(V));const q=W.parse(V);return M(W,q)}function M(W,V){return W.serialize(V).split("#")[0]+"#"}F.getFullPath=R,F._getFullPath=M;const _=/#\/?$/;function j(W){return W?W.replace(_,""):""}F.normalizeId=j,F.resolveUrl=function P(W,V,Z){return Z=j(Z),W.resolve(V,Z)};const k=/^[a-z_][-a-z0-9._]*$/i;F.getSchemaRefs=function z(W,V){if("boolean"==typeof W)return{};const{schemaId:Z,uriResolver:q}=this.opts,re=j(W[Z]||V),te={"":re},ie=R(q,re,!1),ae={},me=new Set;return x(W,{allKeys:!0},(K,o,h,A)=>{if(void 0===A)return;const I=ie+o;let O=te[A];function $(D){if(D=j(O?(0,this.opts.uriResolver.resolve)(O,D):D),me.has(D))throw ue(D);me.add(D);let p=this.refs[D];return"string"==typeof p&&(p=this.refs[p]),"object"==typeof p?ye(K,p.schema,D):D!==j(I)&&("#"===D[0]?(ye(K,ae[D],D),ae[D]=K):this.refs[D]=I),D}function H(D){if("string"==typeof D){if(!k.test(D))throw new Error(`invalid anchor "${D}"`);$.call(this,`#${D}`)}}"string"==typeof K[Z]&&(O=$.call(this,K[Z])),H.call(this,K.$anchor),H.call(this,K.$dynamicAnchor),te[o]=O}),ae;function ye(K,o,h){if(void 0!==o&&!a(K,o))throw ue(h)}function ue(K){return new Error(`reference "${K}" resolves to more than one schema`)}}},32203:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.getRules=F.isJSONType=void 0;const i=new Set(["string","number","integer","boolean","null","object","array"]);F.isJSONType=function a(B){return"string"==typeof B&&i.has(B)},F.getRules=function x(){const B={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...B,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},B.number,B.string,B.array,B.object],post:{rules:[]},all:{},keywords:{}}}},27006:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.checkStrictMode=F.getErrorPath=F.Type=F.useFunc=F.setEvaluated=F.evaluatedPropsToName=F.mergeEvaluated=F.eachItem=F.unescapeJsonPointer=F.escapeJsonPointer=F.escapeFragment=F.unescapeFragment=F.schemaRefOrVal=F.schemaHasRulesButRef=F.schemaHasRules=F.checkUnknownRules=F.alwaysValidSchema=F.toHash=void 0;const i=f(1038),a=f(33337);function m(ie,ae=ie.schema){const{opts:me,self:ye}=ie;if(!me.strictSchema||"boolean"==typeof ae)return;const ue=ye.RULES.keywords;for(const K in ae)ue[K]||te(ie,`unknown keyword: "${K}"`)}function S(ie,ae){if("boolean"==typeof ie)return!ie;for(const me in ie)if(ae[me])return!0;return!1}function _(ie){return"number"==typeof ie?`${ie}`:ie.replace(/~/g,"~0").replace(/\//g,"~1")}function j(ie){return ie.replace(/~1/g,"/").replace(/~0/g,"~")}function k({mergeNames:ie,mergeToName:ae,mergeValues:me,resultToName:ye}){return(ue,K,o,h)=>{const A=void 0===o?K:o instanceof i.Name?(K instanceof i.Name?ie(ue,K,o):ae(ue,K,o),o):K instanceof i.Name?(ae(ue,o,K),K):me(K,o);return h!==i.Name||A instanceof i.Name?A:ye(ue,A)}}function z(ie,ae){if(!0===ae)return ie.var("props",!0);const me=ie.var("props",i._`{}`);return void 0!==ae&&W(ie,me,ae),me}function W(ie,ae,me){Object.keys(me).forEach(ye=>ie.assign(i._`${ae}${(0,i.getProperty)(ye)}`,!0))}F.toHash=function x(ie){const ae={};for(const me of ie)ae[me]=!0;return ae},F.alwaysValidSchema=function B(ie,ae){return"boolean"==typeof ae?ae:0===Object.keys(ae).length||(m(ie,ae),!S(ae,ie.self.RULES.all))},F.checkUnknownRules=m,F.schemaHasRules=S,F.schemaHasRulesButRef=function g(ie,ae){if("boolean"==typeof ie)return!ie;for(const me in ie)if("$ref"!==me&&ae.all[me])return!0;return!1},F.schemaRefOrVal=function E({topSchemaRef:ie,schemaPath:ae},me,ye,ue){if(!ue){if("number"==typeof me||"boolean"==typeof me)return me;if("string"==typeof me)return i._`${me}`}return i._`${ie}${ae}${(0,i.getProperty)(ye)}`},F.unescapeFragment=function R(ie){return j(decodeURIComponent(ie))},F.escapeFragment=function M(ie){return encodeURIComponent(_(ie))},F.escapeJsonPointer=_,F.unescapeJsonPointer=j,F.eachItem=function P(ie,ae){if(Array.isArray(ie))for(const me of ie)ae(me);else ae(ie)},F.mergeEvaluated={props:k({mergeNames:(ie,ae,me)=>ie.if(i._`${me} !== true && ${ae} !== undefined`,()=>{ie.if(i._`${ae} === true`,()=>ie.assign(me,!0),()=>ie.assign(me,i._`${me} || {}`).code(i._`Object.assign(${me}, ${ae})`))}),mergeToName:(ie,ae,me)=>ie.if(i._`${me} !== true`,()=>{!0===ae?ie.assign(me,!0):(ie.assign(me,i._`${me} || {}`),W(ie,me,ae))}),mergeValues:(ie,ae)=>!0===ie||{...ie,...ae},resultToName:z}),items:k({mergeNames:(ie,ae,me)=>ie.if(i._`${me} !== true && ${ae} !== undefined`,()=>ie.assign(me,i._`${ae} === true ? true : ${me} > ${ae} ? ${me} : ${ae}`)),mergeToName:(ie,ae,me)=>ie.if(i._`${me} !== true`,()=>ie.assign(me,!0===ae||i._`${me} > ${ae} ? ${me} : ${ae}`)),mergeValues:(ie,ae)=>!0===ie||Math.max(ie,ae),resultToName:(ie,ae)=>ie.var("items",ae)})},F.evaluatedPropsToName=z,F.setEvaluated=W;const V={};var q,ie;function te(ie,ae,me=ie.opts.strictSchema){if(me){if(ae=`strict mode: ${ae}`,!0===me)throw new Error(ae);ie.self.logger.warn(ae)}}F.useFunc=function Z(ie,ae){return ie.scopeValue("func",{ref:ae,code:V[ae.code]||(V[ae.code]=new a._Code(ae.code))})},(ie=q=F.Type||(F.Type={}))[ie.Num=0]="Num",ie[ie.Str=1]="Str",F.getErrorPath=function re(ie,ae,me){if(ie instanceof i.Name){const ye=ae===q.Num;return me?ye?i._`"[" + ${ie} + "]"`:i._`"['" + ${ie} + "']"`:ye?i._`"/" + ${ie}`:i._`"/" + ${ie}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return me?(0,i.getProperty)(ie).toString():"/"+_(ie)},F.checkStrictMode=te},22650:(Me,F)=>{"use strict";function i(x,B){return B.rules.some(m=>a(x,m))}function a(x,B){var m;return void 0!==x[B.keyword]||(null===(m=B.definition.implements)||void 0===m?void 0:m.some(S=>void 0!==x[S]))}Object.defineProperty(F,"__esModule",{value:!0}),F.shouldUseRule=F.shouldUseGroup=F.schemaHasRulesForType=void 0,F.schemaHasRulesForType=function f({schema:x,self:B},m){const S=B.RULES.types[m];return S&&!0!==S&&i(x,S)},F.shouldUseGroup=i,F.shouldUseRule=a},37864:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.boolOrEmptySchema=F.topBoolOrEmptySchema=void 0;const i=f(53421),a=f(1038),x=f(23432),B={message:"boolean schema is false"};function g(E,R){const{gen:M,data:_}=E;(0,i.reportError)({gen:M,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:E},B,void 0,R)}F.topBoolOrEmptySchema=function m(E){const{gen:R,schema:M,validateName:_}=E;!1===M?g(E,!1):"object"==typeof M&&!0===M.$async?R.return(x.default.data):(R.assign(a._`${_}.errors`,null),R.return(!0))},F.boolOrEmptySchema=function S(E,R){const{gen:M,schema:_}=E;!1===_?(M.var(R,!1),g(E)):M.var(R,!0)}},55999:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.reportTypeError=F.checkDataTypes=F.checkDataType=F.coerceAndCheckDataType=F.getJSONTypes=F.getSchemaTypes=F.DataType=void 0;const i=f(32203),a=f(22650),x=f(53421),B=f(1038),m=f(27006);var S,q;function E(q){const re=Array.isArray(q)?q:q?[q]:[];if(re.every(i.isJSONType))return re;throw new Error("type must be JSONType or JSONType[]: "+re.join(","))}(q=S=F.DataType||(F.DataType={}))[q.Correct=0]="Correct",q[q.Wrong=1]="Wrong",F.getSchemaTypes=function g(q){const re=E(q.type);if(re.includes("null")){if(!1===q.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!re.length&&void 0!==q.nullable)throw new Error('"nullable" cannot be used without "type"');!0===q.nullable&&re.push("null")}return re},F.getJSONTypes=E,F.coerceAndCheckDataType=function R(q,re){const{gen:te,data:ie,opts:ae}=q,me=function _(q,re){return re?q.filter(te=>M.has(te)||"array"===re&&"array"===te):[]}(re,ae.coerceTypes),ye=re.length>0&&!(0===me.length&&1===re.length&&(0,a.schemaHasRulesForType)(q,re[0]));if(ye){const ue=z(re,ie,ae.strictNumbers,S.Wrong);te.if(ue,()=>{me.length?function j(q,re,te){const{gen:ie,data:ae,opts:me}=q,ye=ie.let("dataType",B._`typeof ${ae}`),ue=ie.let("coerced",B._`undefined`);"array"===me.coerceTypes&&ie.if(B._`${ye} == 'object' && Array.isArray(${ae}) && ${ae}.length == 1`,()=>ie.assign(ae,B._`${ae}[0]`).assign(ye,B._`typeof ${ae}`).if(z(re,ae,me.strictNumbers),()=>ie.assign(ue,ae))),ie.if(B._`${ue} !== undefined`);for(const o of te)(M.has(o)||"array"===o&&"array"===me.coerceTypes)&&K(o);function K(o){switch(o){case"string":return void ie.elseIf(B._`${ye} == "number" || ${ye} == "boolean"`).assign(ue,B._`"" + ${ae}`).elseIf(B._`${ae} === null`).assign(ue,B._`""`);case"number":return void ie.elseIf(B._`${ye} == "boolean" || ${ae} === null +(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8792],{44273:(Me,F,f)=>{"use strict";var i,a,x,B,m,S,g,E,R,M,_,j,P,k,z,W,V;f.r(F),f.d(F,{JSONPath:()=>uc}),(a={})[(i={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9}).BooleanLiteral]="Boolean",a[i.EOF]="",a[i.Identifier]="Identifier",a[i.Keyword]="Keyword",a[i.NullLiteral]="Null",a[i.NumericLiteral]="Numeric",a[i.Punctuator]="Punctuator",a[i.StringLiteral]="String",a[i.RegularExpression]="RegularExpression",x=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="];var Z={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"};function q(yt,kt){if(!yt)throw new Error("ASSERT: "+kt)}function re(yt){return yt>=48&&yt<=57}function te(yt){return"0123456789abcdefABCDEF".indexOf(yt)>=0}function ie(yt){return"01234567".indexOf(yt)>=0}function ae(yt){return 32===yt||9===yt||11===yt||12===yt||160===yt||yt>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(yt)>=0}function me(yt){return 10===yt||13===yt||8232===yt||8233===yt}function ye(yt){return 64==yt||36===yt||95===yt||yt>=65&&yt<=90||yt>=97&&yt<=122||92===yt||yt>=128&&S.NonAsciiIdentifierStart.test(String.fromCharCode(yt))}function ue(yt){return 36===yt||95===yt||yt>=65&&yt<=90||yt>=97&&yt<=122||yt>=48&&yt<=57||92===yt||yt>=128&&S.NonAsciiIdentifierPart.test(String.fromCharCode(yt))}function o(yt){switch(yt){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function h(yt){return"eval"===yt||"arguments"===yt}function I(yt,kt,wr,Jt,hr){var Or;q("number"==typeof wr,"Comment must have valid position"),!(W.lastCommentStart>=wr)&&(W.lastCommentStart=wr,Or={type:yt,value:kt},V.range&&(Or.range=[wr,Jt]),V.loc&&(Or.loc=hr),V.comments.push(Or),V.attachComment&&(V.leadingComments.push(Or),V.trailingComments.push(Or)))}function O(yt){var kt,wr,Jt,hr;for(kt=M-yt,wr={start:{line:_,column:M-j-yt}};M=P&&Qe({},m.UnexpectedToken,"ILLEGAL");else if(42===wr){if(47===E.charCodeAt(M+1))return++M,++M,void(V.comments&&(Jt=E.slice(yt+2,M-2),kt.end={line:_,column:M-j},I("Block",Jt,yt,M,kt)));++M}else++M;Qe({},m.UnexpectedToken,"ILLEGAL")}function H(){var yt,kt;for(kt=0===M;M>>="===(pn=E.substr(M,4))?{type:i.Punctuator,value:pn,lineNumber:_,lineStart:j,start:yt,end:M+=4}:">>>"===(Or=pn.substr(0,3))||"<<="===Or||">>="===Or?{type:i.Punctuator,value:Or,lineNumber:_,lineStart:j,start:yt,end:M+=3}:Jt===(hr=Or.substr(0,2))[1]&&"+-<>&|".indexOf(Jt)>=0||"=>"===hr?{type:i.Punctuator,value:hr,lineNumber:_,lineStart:j,start:yt,end:M+=2}:"<>=!+-*%&|^/".indexOf(Jt)>=0?(++M,{type:i.Punctuator,value:Jt,lineNumber:_,lineStart:j,start:yt,end:M}):void Qe({},m.UnexpectedToken,"ILLEGAL")}function Ae(){var yt,kt,wr;if(q(re((wr=E[M]).charCodeAt(0))||"."===wr,"Numeric literal must start with a decimal digit or a decimal point"),kt=M,yt="","."!==wr){if(yt=E[M++],wr=E[M],"0"===yt){if("x"===wr||"X"===wr)return++M,function oe(yt){for(var kt="";M0&&(Jt=V.tokens[V.tokens.length-1]).range[0]===yt&&"Punctuator"===Jt.type&&("/"===Jt.value||"/="===Jt.value)&&V.tokens.pop(),V.tokens.push({type:"RegularExpression",value:wr.literal,range:[yt,M],loc:kt})),wr}function Ee(){var yt;return H(),M>=P?{type:i.EOF,lineNumber:_,lineStart:j,start:M,end:M}:ye(yt=E.charCodeAt(M))?function Y(){var yt,kt,wr;return yt=M,kt=92===E.charCodeAt(M)?s():function p(){var yt,kt;for(yt=M++;M=0&&M=0?ee():Te()}return Te()}return"Keyword"===yt.type?Te():ee()}():ee()}function ve(){var yt,kt,Jt;return H(),yt={start:{line:_,column:M-j}},kt=Ee(),yt.end={line:_,column:M-j},kt.type!==i.EOF&&(Jt=E.slice(kt.start,kt.end),V.tokens.push({type:a[kt.type],value:Jt,range:[kt.start,kt.end],loc:yt})),kt}function Ce(){var yt;return M=(yt=z).end,_=yt.lineNumber,j=yt.lineStart,z=typeof V.tokens<"u"?ve():Ee(),M=yt.end,_=yt.lineNumber,j=yt.lineStart,yt}function Re(){var yt,kt,wr;yt=M,kt=_,wr=j,z=typeof V.tokens<"u"?ve():Ee(),M=yt,_=kt,j=wr}function Ye(yt,kt){this.line=yt,this.column=kt}function $e(yt,kt,wr,Jt){this.start=new Ye(yt,kt),this.end=new Ye(wr,Jt)}function nt(){var yt,kt,wr,Jt;return yt=M,kt=_,wr=j,H(),Jt=_!==kt,M=yt,_=kt,j=wr,Jt}function Qe(yt,kt){for(var wr=[],Jt=2;Jt":case"<=":case">=":case"instanceof":wr=7;break;case"in":wr=kt?7:0;break;case"<<":case">>":case">>>":wr=8;break;case"+":case"-":wr=9;break;case"*":case"/":case"%":wr=11}return wr}function Ke(){var yt,kt,wr,Jt,hr;return yt=z,hr=z,Jt=kt=function Nr(){var yt,kt,wr,Jt,hr;return hr=z,yt=function jt(){var yt,kt,wr,Jt,hr,Or,pn,bn,_i,Gi;if(yt=z,_i=Pt(),0===(hr=Dt(Jt=z,W.allowIn)))return _i;for(Jt.prec=hr,Ce(),kt=[yt,z],Or=[_i,Jt,pn=Pt()];(hr=Dt(z,W.allowIn))>0;){for(;Or.length>2&&hr<=Or[Or.length-2].prec;)pn=Or.pop(),bn=Or.pop().value,_i=Or.pop(),wr=k.createBinaryExpression(bn,_i,pn),kt.pop(),k.markEnd(wr,yt=kt[kt.length-1]),Or.push(wr);(Jt=Ce()).prec=hr,Or.push(Jt),kt.push(z),wr=Pt(),Or.push(wr)}for(wr=Or[Gi=Or.length-1],kt.pop();Gi>1;)wr=k.createBinaryExpression(Or[Gi-1].value,Or[Gi-2],wr),Gi-=2,yt=kt.pop(),k.markEnd(wr,yt);return wr}(),ne("?")&&(Ce(),kt=W.allowIn,W.allowIn=!0,wr=Ke(),W.allowIn=kt,ze(":"),Jt=Ke(),yt=k.createConditionalExpression(yt,wr,Jt),k.markEnd(yt,hr)),yt}(),function G(){var yt;return z.type===i.Punctuator&&("="===(yt=z.value)||"*="===yt||"/="===yt||"%="===yt||"+="===yt||"-="===yt||"<<="===yt||">>="===yt||">>>="===yt||"&="===yt||"^="===yt||"|="===yt)}()&&(_e(kt)||Tt({},m.InvalidLHSInAssignment),R&&kt.type===Z.Identifier&&h(kt.name)&&Tt(yt,m.StrictLHSAssignment),yt=Ce(),wr=Ke(),Jt=k.markEnd(k.createAssignmentExpression(yt.value,kt,wr),hr)),Jt}function Ze(){var yt,kt=z;if(yt=Ke(),ne(",")){for(yt=k.createSequenceExpression([yt]);M"u"));)yt.push(kt);return yt}(),ze("}"),k.markEnd(k.createBlockStatement(yt),kt)}function mt(){var yt,kt;return kt=z,(yt=Ce()).type!==i.Identifier&&ct(yt),k.markEnd(k.createIdentifier(yt.value),kt)}function Xt(yt){var wr,Jt,kt=null;return Jt=z,wr=mt(),R&&h(wr.name)&&Tt({},m.StrictVarName),"const"===yt?(ze("="),kt=Ke()):ne("=")&&(Ce(),kt=Ke()),k.markEnd(k.createVariableDeclarator(wr,kt),Jt)}function Et(yt){var kt=[];do{if(kt.push(Xt(yt)),!ne(","))break;Ce()}while(M"u"&&ze(";")),typeof Jt>"u"&&(ne(";")||(kt=Ze()),ze(";"),ne(")")||(wr=Ze())),ze(")"),pn=W.inIteration,W.inIteration=!0,Or=ur(),W.inIteration=pn,typeof Jt>"u"?k.createForStatement(yt,kt,wr,Or):k.createForInStatement(Jt,hr,Or)}(),hr);case"function":return k.markEnd(mr(),hr);case"if":return k.markEnd(function mi(){var yt,kt,wr;return St("if"),ze("("),yt=Ze(),ze(")"),kt=ur(),X("else")?(Ce(),wr=ur()):wr=null,k.createIfStatement(yt,kt,wr)}(),hr);case"return":return k.markEnd(function xr(){var yt=null;return St("return"),W.inFunctionBody||Tt({},m.IllegalReturn),32===E.charCodeAt(M)&&ye(E.charCodeAt(M+1))?(yt=Ze(),he(),k.createReturnStatement(yt)):nt()?k.createReturnStatement(null):(ne(";")||!ne("}")&&z.type!==i.EOF&&(yt=Ze()),he(),k.createReturnStatement(yt))}(),hr);case"switch":return k.markEnd(function Xn(){var yt,kt,wr,Jt,hr;if(St("switch"),ze("("),yt=Ze(),ze(")"),ze("{"),kt=[],ne("}"))return Ce(),k.createSwitchStatement(yt,kt);for(Jt=W.inSwitch,W.inSwitch=!0,hr=!1;M"u"));)kt.push(yt);return ze("}"),W.labelSet=Or,W.inIteration=pn,W.inSwitch=bn,W.inFunctionBody=_i,k.markEnd(k.createBlockStatement(kt),Gi)}function qt(yt){var kt,Jt,hr,Or,pn,bn,wr=[];if(ze("("),!ne(")"))for(Or={};M0?1:0,j=0,P=E.length,z=null,W={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},V={},typeof kt<"u"&&(V.range="boolean"==typeof kt.range&&kt.range,V.loc="boolean"==typeof kt.loc&&kt.loc,V.attachComment="boolean"==typeof kt.attachComment&&kt.attachComment,V.loc&&null!=kt.source&&(V.source=Jt(kt.source)),"boolean"==typeof kt.tokens&&kt.tokens&&(V.tokens=[]),"boolean"==typeof kt.comment&&kt.comment&&(V.comments=[]),"boolean"==typeof kt.tolerant&&kt.tolerant&&(V.errors=[]),V.attachComment&&(V.range=!0,V.comments=[],V.bottomRightStack=[],V.trailingComments=[],V.leadingComments=[]));try{wr=function An(){var yt,kt;return H(),Re(),kt=z,R=!1,yt=function gn(){for(var yt,wr,hr,kt=[];M"u");)kt.push(yt);return kt}(),k.markEnd(k.createProgram(yt),kt)}(),typeof V.comments<"u"&&(wr.comments=V.comments),typeof V.tokens<"u"&&(function Pn(){var yt,kt,wr,Jt=[];for(yt=0;yt0?0:Or-1)),wr=hr(0===wr?0:wr||(Jt>0?Or:-1)),kt=Jt>0?Math.max(0,kt):Math.min(Or,kt),wr=Jt>0?Math.min(wr,Or):Math.max(-1,wr),Jt>0&&wr<=kt)return[];if(Jt<0&&kt<=wr)return[];for(var pn=[],bn=kt;bn!=wr&&!(Jt<0&&bn<=wr||Jt>0&&bn>=wr);bn+=Jt)pn.push(yt[bn]);return pn}B={Data:1,Get:2,Set:4},m={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},S={NonAsciiIdentifierStart:new RegExp("[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),NonAsciiIdentifierPart:new RegExp("[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]")},g={name:"SyntaxTree",processComment:function(yt){var kt,wr;if(!(yt.type===Z.Program&&yt.body.length>0)){for(V.trailingComments.length>0?V.trailingComments[0].range[0]>=yt.range[1]?(wr=V.trailingComments,V.trailingComments=[]):V.trailingComments.length=0:V.bottomRightStack.length>0&&V.bottomRightStack[V.bottomRightStack.length-1].trailingComments&&V.bottomRightStack[V.bottomRightStack.length-1].trailingComments[0].range[0]>=yt.range[1]&&(wr=V.bottomRightStack[V.bottomRightStack.length-1].trailingComments,delete V.bottomRightStack[V.bottomRightStack.length-1].trailingComments);V.bottomRightStack.length>0&&V.bottomRightStack[V.bottomRightStack.length-1].range[0]>=yt.range[0];)kt=V.bottomRightStack.pop();kt?kt.leadingComments&&kt.leadingComments[kt.leadingComments.length-1].range[1]<=yt.range[0]&&(yt.leadingComments=kt.leadingComments,delete kt.leadingComments):V.leadingComments.length>0&&V.leadingComments[V.leadingComments.length-1].range[1]<=yt.range[0]&&(yt.leadingComments=V.leadingComments,V.leadingComments=[]),wr&&(yt.trailingComments=wr),V.bottomRightStack.push(yt)}},markEnd:function(yt,kt){return V.range&&(yt.range=[kt.start,M]),V.loc&&(yt.loc=new $e(void 0===kt.startLineNumber?kt.lineNumber:kt.startLineNumber,kt.start-(void 0===kt.startLineStart?kt.lineStart:kt.startLineStart),_,M-j),this.postProcess(yt)),V.attachComment&&this.processComment(yt),yt},postProcess:function(yt){return V.source&&(yt.loc.source=V.source),yt},createArrayExpression:function(yt){return{type:Z.ArrayExpression,elements:yt}},createAssignmentExpression:function(yt,kt,wr){return{type:Z.AssignmentExpression,operator:yt,left:kt,right:wr}},createBinaryExpression:function(yt,kt,wr){return{type:"||"===yt||"&&"===yt?Z.LogicalExpression:Z.BinaryExpression,operator:yt,left:kt,right:wr}},createBlockStatement:function(yt){return{type:Z.BlockStatement,body:yt}},createBreakStatement:function(yt){return{type:Z.BreakStatement,label:yt}},createCallExpression:function(yt,kt){return{type:Z.CallExpression,callee:yt,arguments:kt}},createCatchClause:function(yt,kt){return{type:Z.CatchClause,param:yt,body:kt}},createConditionalExpression:function(yt,kt,wr){return{type:Z.ConditionalExpression,test:yt,consequent:kt,alternate:wr}},createContinueStatement:function(yt){return{type:Z.ContinueStatement,label:yt}},createDebuggerStatement:function(){return{type:Z.DebuggerStatement}},createDoWhileStatement:function(yt,kt){return{type:Z.DoWhileStatement,body:yt,test:kt}},createEmptyStatement:function(){return{type:Z.EmptyStatement}},createExpressionStatement:function(yt){return{type:Z.ExpressionStatement,expression:yt}},createForStatement:function(yt,kt,wr,Jt){return{type:Z.ForStatement,init:yt,test:kt,update:wr,body:Jt}},createForInStatement:function(yt,kt,wr){return{type:Z.ForInStatement,left:yt,right:kt,body:wr,each:!1}},createFunctionDeclaration:function(yt,kt,wr,Jt){return{type:Z.FunctionDeclaration,id:yt,params:kt,defaults:wr,body:Jt,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(yt,kt,wr,Jt){return{type:Z.FunctionExpression,id:yt,params:kt,defaults:wr,body:Jt,rest:null,generator:!1,expression:!1}},createIdentifier:function(yt){return{type:Z.Identifier,name:yt}},createIfStatement:function(yt,kt,wr){return{type:Z.IfStatement,test:yt,consequent:kt,alternate:wr}},createLabeledStatement:function(yt,kt){return{type:Z.LabeledStatement,label:yt,body:kt}},createLiteral:function(yt){return{type:Z.Literal,value:yt.value,raw:E.slice(yt.start,yt.end)}},createMemberExpression:function(yt,kt,wr){return{type:Z.MemberExpression,computed:"["===yt,object:kt,property:wr}},createNewExpression:function(yt,kt){return{type:Z.NewExpression,callee:yt,arguments:kt}},createObjectExpression:function(yt){return{type:Z.ObjectExpression,properties:yt}},createPostfixExpression:function(yt,kt){return{type:Z.UpdateExpression,operator:yt,argument:kt,prefix:!1}},createProgram:function(yt){return{type:Z.Program,body:yt}},createProperty:function(yt,kt,wr){return{type:Z.Property,key:kt,value:wr,kind:yt}},createReturnStatement:function(yt){return{type:Z.ReturnStatement,argument:yt}},createSequenceExpression:function(yt){return{type:Z.SequenceExpression,expressions:yt}},createSwitchCase:function(yt,kt){return{type:Z.SwitchCase,test:yt,consequent:kt}},createSwitchStatement:function(yt,kt){return{type:Z.SwitchStatement,discriminant:yt,cases:kt}},createThisExpression:function(){return{type:Z.ThisExpression}},createThrowStatement:function(yt){return{type:Z.ThrowStatement,argument:yt}},createTryStatement:function(yt,kt,wr,Jt){return{type:Z.TryStatement,block:yt,guardedHandlers:kt,handlers:wr,finalizer:Jt}},createUnaryExpression:function(yt,kt){return"++"===yt||"--"===yt?{type:Z.UpdateExpression,operator:yt,argument:kt,prefix:!0}:{type:Z.UnaryExpression,operator:yt,argument:kt,prefix:!0}},createVariableDeclaration:function(yt,kt){return{type:Z.VariableDeclaration,declarations:yt,kind:kt}},createVariableDeclarator:function(yt,kt){return{type:Z.VariableDeclarator,id:yt,init:kt}},createWhileStatement:function(yt,kt){return{type:Z.WhileStatement,test:yt,body:kt}},createWithStatement:function(yt,kt){return{type:Z.WithStatement,object:yt,body:kt}}};var no=f(18911),Zi=f.n(no);function Ao(yt){return function(kt,wr,Jt,hr){var Or=kt.value,pn=kt.path,bn=[],_i=function(Gi,Io){Yn(Gi)?(Gi.forEach(function(Mo,Ma){bn.length>=hr||Jt(Ma,Mo,wr)&&bn.push({path:Io.concat(Ma),value:Mo})}),Gi.forEach(function(Mo,Ma){bn.length>=hr||yt&&_i(Mo,Io.concat(Ma))})):function Qo(yt){return yt&&!(yt instanceof Array)&&yt instanceof Object}(Gi)&&(Object.keys(Gi).forEach(function(Mo){bn.length>=hr||Jt(Mo,Gi[Mo],wr)&&bn.push({path:Io.concat(Mo),value:Gi[Mo]})}),Object.keys(Gi).forEach(function(Mo){bn.length>=hr||yt&&_i(Gi[Mo],Io.concat(Mo))}))}.bind(this);return _i(Or,pn),bn}}function Fo(yt,kt){try{return Zi()(yt,kt)}catch{}}function Ki(yt){return function(kt,wr,Jt){return this.descend(wr,kt.expression.value,yt,Jt)}}function ro(yt){return function(kt,wr,Jt){return this.traverse(wr,kt.expression.value,yt,Jt)}}function uo(yt){return function Rs(yt,kt){for(var wr=[],Jt=[],hr=0,Or=yt?.length;hr=Jt||kt.expression.value.forEach(function(_i){var Gi={operation:"subscript",scope:"child",expression:_i.expression},Mo=hr.resolve(Gi)(Gi,bn);Or=Or.concat(Mo)})}),uo(Or)},"subscript-child-filter_expression":function(kt,wr,Jt){var Or=oi(kt.expression.value.slice(2,-1)).body[0].expression;return this.descend(wr,null,function(bn,_i){return Fo(Or,{"@":_i})},Jt)},"subscript-descendant-filter_expression":function(kt,wr,Jt){var Or=oi(kt.expression.value.slice(2,-1)).body[0].expression;return this.traverse(wr,null,function(bn,_i){return Fo(Or,{"@":_i})},Jt)},"subscript-child-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$..value")}},this.initialize()}return yt.prototype.initialize=function(){this.traverse=Ao(!0),this.descend=Ao(),this._fns["subscript-child-string_literal"]=this._fns["member-child-identifier"],this._fns["member-descendant-numeric_literal"]=this._fns["subscript-descendant-string_literal"]=this._fns["member-descendant-identifier"]},yt.prototype.resolve=function(kt){var wr=[kt.operation,kt.scope,kt.expression.type].join("-"),Jt=this._fns[wr];if(!Jt)throw new Error("couldn't resolve key: "+wr);return Jt.bind(this)},yt.prototype.register=function(kt,wr){if(!(wr instanceof Function))throw new Error("handler must be a function");this._fns[kt]=wr},yt}(),gs=f(15320);function Yi(){var yt=new gs.iX,kt=yt.parseError;return yt.yy.parseError=function(){yt.yy.ast&&yt.yy.ast.initialize(),kt.apply(yt,arguments)},yt}var ys=function(){function yt(){}return yt.ok=function(kt,wr){if(!kt)throw new Error(wr)},yt.equal=function(kt,wr,Jt){if(kt!==wr)throw new Error(Jt)},yt}(),uc=function(){function yt(){}return yt.parse=function(kt){return ys.ok("string"==typeof kt,"we need a path"),(new Yi).parse(kt)},yt.parent=function(kt,wr){ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path");var Jt=this.nodes(kt,wr)[0];return Jt.path.pop(),this.value(kt,Jt.path)},yt.apply=function(kt,wr,Jt){ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path"),ys.equal(typeof Jt,"function","fn needs to be function");var hr=this.nodes(kt,wr).sort(function(Or,pn){return pn.path.length-Or.path.length});return hr.forEach(function(Or){var pn=Or.path.pop(),bn=this.value(kt,this.stringify(Or.path)),_i=Or.value=Jt.call(kt,bn[pn]);bn[pn]=_i},this),hr},yt.value=function(kt,wr,Jt){if(ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path"),void 0!==Jt){var hr=this.nodes(kt,wr).shift();if(!hr)return this._vivify(kt,wr,Jt);var Or=hr.path.slice(-1).shift();this.parent(kt,this.stringify(hr.path))[Or]=Jt}return this.query(kt,this.stringify(wr),1).shift()},yt._vivify=function(kt,wr,Jt){var hr=this;ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path");var Or=(new Yi).parse(wr).map(function(bn){return bn.expression.value}),pn=function(bn,_i){var Gi=bn.pop(),Io=hr.value(kt,bn);Io||(pn(bn.concat(),"string"==typeof Gi?{}:[]),Io=hr.value(kt,bn)),Io[Gi]=_i};return pn(Or,Jt),this.query(kt,wr)[0]},yt.query=function(kt,wr,Jt){return ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok("string"==typeof wr,"we need a path"),this.nodes(kt,wr,Jt).map(function(Or){return Or.value})},yt.paths=function(kt,wr,Jt){return ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path"),this.nodes(kt,wr,Jt).map(function(Or){return Or.path})},yt.nodes=function(kt,wr,Jt){if(ys.ok(kt instanceof Object,"obj needs to be an object"),ys.ok(wr,"we need a path"),0===Jt)return[];var hr=(new Yi).parse(wr),Or=new Ss,pn=[{path:["$"],value:kt}],bn=[];return hr.length&&"root"==hr[0].expression.type&&hr.shift(),hr.length?(hr.forEach(function(_i,Gi){if(!(bn.length>=Jt)){var Io=Or.resolve(_i),Mo=[];pn.forEach(function(Ma){if(!(bn.length>=Jt)){var Os=Io(_i,Ma,Jt);Gi==hr.length-1?bn=bn.concat(Os||[]):Mo=Mo.concat(Os||[])}}),pn=Mo}}),Jt?bn.slice(0,Jt):bn):pn},yt.stringify=function(kt){ys.ok(kt,"we need a path");var wr="$",Jt={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return(kt=this._normalize(kt)).forEach(function(hr){if("root"!=hr.expression.type){var bn,Or=[hr.scope,hr.operation].join("-"),pn=Jt[Or];if(bn="string_literal"==hr.expression.type?JSON.stringify(hr.expression.value):hr.expression.value,!pn)throw new Error("couldn't find template "+Or);wr+=pn.replace(/{{value}}/,bn)}}),wr},yt._normalize=function(kt){if(ys.ok(kt,"we need a path"),"string"==typeof kt)return(new Yi).parse(kt);if(Array.isArray(kt)&&"string"==typeof kt[0]){var wr=[{expression:{type:"root",value:"$"}}];return kt.forEach(function(Jt,hr){"$"==Jt&&0===hr||("string"==typeof Jt&&Jt.match("^[a-zA-Z_]+[a-zA-Z0-9_]*$")?wr.push({operation:"member",scope:"child",expression:{value:Jt,type:"identifier"}}):wr.push({operation:"subscript",scope:"child",expression:{value:Jt,type:"number"==typeof Jt?"numeric_literal":"string_literal"}}))}),wr}if(Array.isArray(kt)&&"object"==typeof kt[0])return kt;throw new Error("couldn't understand path "+kt)},yt}()},15320:(Me,F)=>{var i=function(){var a=function(me,ye,ue,K){for(ue=ue||{},K=me.length;K--;ue[me[K]]=ye);return ue},x=[1,5],B=[1,6],m=[1,7],S=[1,8],g=[1,9],E=[1,18],R=[1,19],M=[1,20],_=[1,12,14,22],j=[1,29],P=[1,30],k=[1,33],z=[1,35],W=[1,31],V=[1,36],Z=[1,37],q=[24,28],re={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(ye,ue,K,o,h,A,I){o.ast||(o.ast=te,te.initialize());var O=A.length-1;switch(h){case 1:return o.ast.set({expression:{type:"root",value:A[O]}}),o.ast.unshift(),o.ast.yield();case 2:return o.ast.set({expression:{type:"root",value:A[O-1]}}),o.ast.unshift(),o.ast.yield();case 3:return o.ast.unshift(),o.ast.yield();case 4:return o.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:A[O-1]}}),o.ast.unshift(),o.ast.yield();case 5:case 6:case 11:case 13:case 18:case 21:case 22:case 23:break;case 7:o.ast.set({operation:"member"}),o.ast.push();break;case 8:o.ast.set({operation:"subscript"}),o.ast.push();break;case 9:case 19:o.ast.set({scope:"child"});break;case 10:case 20:o.ast.set({scope:"descendant"});break;case 12:o.ast.set({scope:"child",operation:"member"});break;case 14:o.ast.set({expression:{type:"wildcard",value:A[O]}});break;case 15:o.ast.set({expression:{type:"identifier",value:A[O]}});break;case 16:o.ast.set({expression:{type:"script_expression",value:A[O]}});break;case 17:o.ast.set({expression:{type:"numeric_literal",value:parseInt(A[O])}});break;case 24:A[O].length>1?o.ast.set({expression:{type:"union",value:A[O]}}):this.$=A[O];break;case 25:this.$=[A[O]];break;case 26:this.$=A[O-2].concat(A[O]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(A[O])}},o.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:A[O]}},o.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:A[O]}},o.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:A[O]}},o.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:A[O]}},o.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:A[O]}},o.ast.set(this.$);break;case 33:case 34:this.$=A[O]}},table:[{3:1,4:[1,2],6:3,13:4,15:x,16:B,17:m,18:S,19:g},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:E,14:R,20:16,21:17,22:M},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:E,14:R,20:16,21:17,22:M},a(_,[2,12]),a(_,[2,14]),a(_,[2,15]),a(_,[2,16]),a(_,[2,17]),a(_,[2,18]),{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:E,14:R,20:16,21:17,22:M},a(_,[2,5]),a(_,[2,7]),a(_,[2,8]),a(_,[2,9]),a(_,[2,10]),a(_,[2,19]),a(_,[2,20]),{13:23,15:x,16:B,17:m,18:S,19:g},{13:24,15:x,16:B,17:m,18:S,19:g,22:[1,25]},{15:j,17:P,18:k,23:26,25:27,26:28,27:32,29:34,30:z,31:W,32:V,33:Z},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:E,14:R,20:16,21:17,22:M},a(_,[2,6]),a(_,[2,11]),a(_,[2,13]),{15:j,17:P,18:k,23:38,25:27,26:28,27:32,29:34,30:z,31:W,32:V,33:Z},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},a(q,[2,25]),a(q,[2,27]),a(q,[2,28]),a(q,[2,29]),a(q,[2,33]),a(q,[2,34]),{24:[1,41]},a(_,[2,21]),{18:k,27:42,29:34,30:z,32:V,33:Z},a(_,[2,22]),a(q,[2,26])],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(ye,ue){if(!ue.recoverable){var K=new Error(ye);throw K.hash=ue,K}this.trace(ye)},parse:function(ye){var K=[0],h=[null],A=[],I=this.table,O="",$=0,H=0,D=0,Y=A.slice.call(arguments,1),ee=Object.create(this.lexer),oe={yy:{}};for(var de in this.yy)Object.prototype.hasOwnProperty.call(this.yy,de)&&(oe.yy[de]=this.yy[de]);ee.setInput(ye,oe.yy),oe.yy.lexer=ee,oe.yy.parser=this,typeof ee.yylloc>"u"&&(ee.yylloc={});var Ae=ee.yylloc;A.push(Ae);var Qe,Ie=ee.options&&ee.options.ranges;this.parseError="function"==typeof oe.yy.parseError?oe.yy.parseError:Object.getPrototypeOf(this).parseError;for(var De,Xe,Te,ke,Ee,Ce,Re,$e,ve={};;){if(this.defaultActions[Te=K[K.length-1]]?ke=this.defaultActions[Te]:((null===De||typeof De>"u")&&(Qe=void 0,"number"!=typeof(Qe=ee.lex()||1)&&(Qe=this.symbols_[Qe]||Qe),De=Qe),ke=I[Te]&&I[Te][De]),typeof ke>"u"||!ke.length||!ke[0]){var nt;for(Ce in $e=[],I[Te])this.terminals_[Ce]&&Ce>2&&$e.push("'"+this.terminals_[Ce]+"'");nt=ee.showPosition?"Parse error on line "+($+1)+":\n"+ee.showPosition()+"\nExpecting "+$e.join(", ")+", got '"+(this.terminals_[De]||De)+"'":"Parse error on line "+($+1)+": Unexpected "+(1==De?"end of input":"'"+(this.terminals_[De]||De)+"'"),this.parseError(nt,{text:ee.match,token:this.terminals_[De]||De,line:ee.yylineno,loc:Ae,expected:$e})}if(ke[0]instanceof Array&&ke.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Te+", token: "+De);switch(ke[0]){case 1:K.push(De),h.push(ee.yytext),A.push(ee.yylloc),K.push(ke[1]),De=null,Xe?(De=Xe,Xe=null):(H=ee.yyleng,O=ee.yytext,$=ee.yylineno,Ae=ee.yylloc,D>0&&D--);break;case 2:if(ve.$=h[h.length-(Re=this.productions_[ke[1]][1])],ve._$={first_line:A[A.length-(Re||1)].first_line,last_line:A[A.length-1].last_line,first_column:A[A.length-(Re||1)].first_column,last_column:A[A.length-1].last_column},Ie&&(ve._$.range=[A[A.length-(Re||1)].range[0],A[A.length-1].range[1]]),typeof(Ee=this.performAction.apply(ve,[O,H,$,oe.yy,ke[1],h,A].concat(Y)))<"u")return Ee;Re&&(K=K.slice(0,-1*Re*2),h=h.slice(0,-1*Re),A=A.slice(0,-1*Re)),K.push(this.productions_[ke[1]][0]),h.push(ve.$),A.push(ve._$),K.push(I[K[K.length-2]][K[K.length-1]]);break;case 3:return!0}}return!0}},te={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(me){for(var ye in me)this._node[ye]=me[ye];return this._node},node:function(me){return arguments.length&&(this._node=me),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var me=this._nodes;return this.initialize(),me}};function ae(){this.yy={}}return re.lexer=function(){return{EOF:1,parseError:function(ue,K){if(!this.yy.parser)throw new Error(ue);this.yy.parser.parseError(ue,K)},setInput:function(ye,ue){return this.yy=ue||this.yy||{},this._input=ye,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},input:function(){var ye=this._input[0];return this.yytext+=ye,this.yyleng++,this.offset++,this.match+=ye,this.matched+=ye,ye.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ye},unput:function(ye){var ue=ye.length,K=ye.split(/(?:\r\n?|\n)/g);this._input=ye+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ue),this.offset-=ue;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),K.length-1&&(this.yylineno-=K.length-1);var h=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:K?(K.length===o.length?this.yylloc.first_column:0)+o[o.length-K.length].length-K[0].length:this.yylloc.first_column-ue},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-ue]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(ye){this.unput(this.match.slice(ye))},pastInput:function(){var ye=this.matched.substr(0,this.matched.length-this.match.length);return(ye.length>20?"...":"")+ye.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var ye=this.match;return ye.length<20&&(ye+=this._input.substr(0,20-ye.length)),(ye.substr(0,20)+(ye.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var ye=this.pastInput(),ue=new Array(ye.length+1).join("-");return ye+this.upcomingInput()+"\n"+ue+"^"},test_match:function(ye,ue){var K,o,h;if(this.options.backtrack_lexer&&(h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(h.yylloc.range=this.yylloc.range.slice(0))),(o=ye[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ye[0].length},this.yytext+=ye[0],this.match+=ye[0],this.matches=ye,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ye[0].length),this.matched+=ye[0],K=this.performAction.call(this,this.yy,this,ue,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),K)return K;if(this._backtrack){for(var A in h)this[A]=h[A];return!1}return!1},next:function(){if(this.done)return this.EOF;var ye,ue,K,o;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),A=0;Aue[0].length)){if(ue=K,o=A,this.options.backtrack_lexer){if(!1!==(ye=this.test_match(K,h[A])))return ye;if(this._backtrack){ue=!1;continue}return!1}if(!this.options.flex)break}return ue?!1!==(ye=this.test_match(ue,h[o]))&&ye:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(ue){this.conditionStack.push(ue)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(ue){return(ue=this.conditionStack.length-1-Math.abs(ue||0))>=0?this.conditionStack[ue]:"INITIAL"},pushState:function(ue){this.begin(ue)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(ue,K,o,h){switch(o){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return K.yytext=K.yytext.substr(1,K.yyleng-2),32;case 11:return K.yytext=K.yytext.substr(1,K.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}(),ae.prototype=re,re.Parser=ae,new ae}();F.iX=i.Parser},52191:(Me,F,f)=>{var i=f(40573);const a="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,x=()=>a.now(),m=g=>g===1/0||(g=>g&&g===Math.floor(g)&&g>0&&isFinite(g))(g);class S{constructor({max:E=1/0,ttl:R,updateAgeOnGet:M=!1,checkAgeOnGet:_=!1,noUpdateTTL:j=!1,dispose:P,noDisposeOnSet:k=!1}={}){if(this.expirations=Object.create(null),this.data=new Map,this.expirationMap=new Map,void 0!==R&&!m(R))throw new TypeError("ttl must be positive integer or Infinity if set");if(!m(E))throw new TypeError("max must be positive integer or Infinity");if(this.ttl=R,this.max=E,this.updateAgeOnGet=!!M,this.checkAgeOnGet=!!_,this.noUpdateTTL=!!j,this.noDisposeOnSet=!!k,void 0!==P){if("function"!=typeof P)throw new TypeError("dispose must be function if set");this.dispose=P}this.timer=void 0,this.timerExpiration=void 0}setTimer(E,R){if(this.timerExpiration{this.timer=void 0,this.timerExpiration=void 0,this.purgeStale();for(const _ in this.expirations){this.setTimer(_,_-x());break}},R);M.unref&&M.unref(),this.timerExpiration=E,this.timer=M}cancelTimer(){this.timer&&(clearTimeout(this.timer),this.timerExpiration=void 0,this.timer=void 0)}cancelTimers(){return i.emitWarning('TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no "s"), and will be removed in the next major version update'),this.cancelTimer()}clear(){const E=this.dispose!==S.prototype.dispose?[...this]:[];this.data.clear(),this.expirationMap.clear(),this.cancelTimer(),this.expirations=Object.create(null);for(const[R,M]of E)this.dispose(M,R,"delete")}setTTL(E,R=this.ttl){const M=this.expirationMap.get(E);if(void 0!==M){const _=this.expirations[M];!_||_.length<=1?delete this.expirations[M]:this.expirations[M]=_.filter(j=>j!==E)}if(R!==1/0){const _=Math.floor(x()+R);this.expirationMap.set(E,_),this.expirations[_]||(this.expirations[_]=[],this.setTimer(_,R)),this.expirations[_].push(E)}else this.expirationMap.set(E,1/0)}set(E,R,{ttl:M=this.ttl,noUpdateTTL:_=this.noUpdateTTL,noDisposeOnSet:j=this.noDisposeOnSet}={}){if(!m(M))throw new TypeError("ttl must be positive integer or Infinity");if(this.expirationMap.has(E)){_||this.setTTL(E,M);const P=this.data.get(E);P!==R&&(this.data.set(E,R),j||this.dispose(P,E,"set"))}else this.setTTL(E,M),this.data.set(E,R);for(;this.size>this.max;)this.purgeToCapacity();return this}has(E){return this.data.has(E)}getRemainingTTL(E){const R=this.expirationMap.get(E);return R===1/0?R:void 0!==R?Math.max(0,Math.ceil(R-x())):0}get(E,{updateAgeOnGet:R=this.updateAgeOnGet,ttl:M=this.ttl,checkAgeOnGet:_=this.checkAgeOnGet}={}){const j=this.data.get(E);if(!_||0!==this.getRemainingTTL(E))return R&&this.setTTL(E,M),j;this.delete(E)}dispose(E,R){}delete(E){const R=this.expirationMap.get(E);if(void 0!==R){const M=this.data.get(E);this.data.delete(E),this.expirationMap.delete(E);const _=this.expirations[R];return _&&(_.length<=1?delete this.expirations[R]:this.expirations[R]=_.filter(j=>j!==E)),this.dispose(M,E,"delete"),0===this.size&&this.cancelTimer(),!0}return!1}purgeToCapacity(){for(const E in this.expirations){const R=this.expirations[E];if(!(this.size-R.length>=this.max)){const M=this.size-this.max,_=[];for(const j of R.splice(0,M))_.push([j,this.data.get(j)]),this.data.delete(j),this.expirationMap.delete(j);for(const[j,P]of _)this.dispose(P,j,"evict");return}{delete this.expirations[E];const M=[];for(const _ of R)M.push([_,this.data.get(_)]),this.data.delete(_),this.expirationMap.delete(_);for(const[_,j]of M)this.dispose(j,_,"evict")}}}get size(){return this.data.size}purgeStale(){const E=Math.ceil(x());for(const R in this.expirations){if("Infinity"===R||R>E)return;const M=[...this.expirations[R]||[]],_=[];delete this.expirations[R];for(const j of M)_.push([j,this.data.get(j)]),this.data.delete(j),this.expirationMap.delete(j);for(const[j,P]of _)this.dispose(P,j,"stale")}0===this.size&&this.cancelTimer()}*entries(){for(const E in this.expirations)for(const R of this.expirations[E])yield[R,this.data.get(R)]}*keys(){for(const E in this.expirations)for(const R of this.expirations[E])yield R}*values(){for(const E in this.expirations)for(const R of this.expirations[E])yield this.data.get(R)}[Symbol.iterator](){return this.entries()}}Me.exports=S},33065:(Me,F,f)=>{"use strict";f.r(F),f.d(F,{RestoreComponent:()=>h});var i=f(10467),a=f(54438),x=f(89417),B=f(88834),m=f(25596),S=f(99213),g=f(99631),E=f(5951),R=f(82798),M=f(34635),_=f(20180),j=f(96084),P=f(65571),k=f(12621),z=f(30046),W=f(88020),V=f(3902),Z=f(9183),q=f(53719);const re=A=>["/account",A];function te(A,I){1&A&&(a.j41(0,"mat-error"),a.EFF(1,"Private key is "),a.j41(2,"strong"),a.EFF(3,"required"),a.k0s()())}function ie(A,I){if(1&A&&(a.j41(0,"mat-card",7)(1,"mat-card-header")(2,"mat-card-title"),a.EFF(3,"Private Key"),a.k0s(),a.j41(4,"mat-card-subtitle"),a.EFF(5,"Enter your Stellar private key (starts with 'S')"),a.k0s()(),a.j41(6,"mat-card-content"),a.nrm(7,"br"),a.j41(8,"mat-form-field",8)(9,"mat-label"),a.EFF(10,"Stellar Private Key"),a.k0s(),a.nrm(11,"textarea",9,0),a.DNE(13,te,4,0,"mat-error"),a.k0s()(),a.j41(14,"mat-card-actions",10)(15,"button",11),a.EFF(16,"Restore"),a.k0s()()()),2&A){const O=a.XpG();a.R7$(13),a.vxM(O.addressForm.controls.recoveryPhrase.hasError("required")?13:-1),a.R7$(2),a.Y8G("disabled",O.app.loading())}}function ae(A,I){1&A&&(a.j41(0,"mat-card",7)(1,"mat-card-header")(2,"mat-card-title"),a.EFF(3,"Importing..."),a.k0s(),a.j41(4,"mat-card-subtitle"),a.EFF(5,"Please wait. App will reload."),a.k0s()(),a.j41(6,"mat-card-content",12),a.nrm(7,"mat-spinner"),a.k0s()())}function me(A,I){if(1&A){const O=a.RV6();a.j41(0,"mat-card",7)(1,"mat-card-header")(2,"mat-card-title"),a.EFF(3,"Portable DID"),a.k0s(),a.j41(4,"mat-card-subtitle"),a.EFF(5,"Choose your backup file (portableIdentity.json)"),a.k0s()(),a.j41(6,"mat-card-content",12)(7,"button",13),a.bIt("click",function(){a.eBV(O);const H=a.XpG(2);return a.Njj(H.editFile({}))}),a.j41(8,"mat-icon"),a.EFF(9,"upload_file"),a.k0s(),a.j41(10,"span"),a.EFF(11,"Choose portable DID file"),a.k0s()(),a.j41(12,"input",14),a.bIt("change",function(H){a.eBV(O);const D=a.XpG(2);return a.Njj(D.onFileSelected(H))}),a.k0s()()()}}function ye(A,I){if(1&A&&(a.j41(0,"a",15)(1,"mat-icon",16),a.EFF(2,"account_circle"),a.k0s(),a.j41(3,"span",17),a.EFF(4),a.k0s(),a.j41(5,"span",18),a.EFF(6),a.k0s()()),2&A){const O=I.$implicit;a.Y8G("routerLink",a.eq3(3,re,O.did.uri)),a.R7$(4),a.JRh(O.metadata.name),a.R7$(2),a.JRh(O.did.uri)}}function ue(A,I){if(1&A&&(a.j41(0,"h1"),a.EFF(1,"Imported Accounts"),a.k0s(),a.j41(2,"mat-list"),a.Z7z(3,ye,7,5,"a",15,a.fX1),a.k0s()),2&A){const O=a.XpG(2);a.R7$(3),a.Dyx(O.importedIdentities)}}function K(A,I){if(1&A&&a.DNE(0,ae,8,0,"mat-card",7)(1,me,13,0,"mat-card",7)(2,ue,5,0),2&A){const O=a.XpG();a.vxM(O.loading?0:1),a.R7$(2),a.vxM(O.importedIdentities.length>0?2:-1)}}function o(A,I){1&A&&(a.j41(0,"mat-card",7)(1,"mat-card-content")(2,"p"),a.EFF(3,"Support for Nostr is coming in the future"),a.k0s()()())}let h=(()=>{class A{constructor(){this.fb=(0,a.WQX)(x.ok),this.crypto=(0,a.WQX)(_.j),this.app=(0,a.WQX)(j.d),this.protocol=(0,a.WQX)(W.w),this.route=(0,a.WQX)(z.Ix),this.identity=(0,a.WQX)(M.K),this.importedIdentities=[],this.addressForm=this.fb.group({recoveryPhrase:[null,x.k0.required],importType:["ariton",x.k0.required]}),this.loading=!1}editFile(O){return(0,i.A)(function*(){document.getElementById("input")?.click()})()}query(){var O=this;return(0,i.A)(function*(){const $={message:{filter:{protocol:"https://schema.ariton.app/note",schema:"https://schema.ariton.app/note/schema/note",dataFormat:"application/json"}}};console.log("Query:",$),console.log(O.identity.web5.agent),console.log(O.identity.web5.dwn),console.log(O.identity.web5.dwn.records),console.log("Object above");var{records:D,status:s}=yield O.identity.web5.dwn.records.query($);console.log("Status:",s),console.log(D);const H={from:O.identity.did,message:{filter:{protocol:"https://schema.ariton.app/note",schema:"https://schema.ariton.app/note/schema/note",dataFormat:"application/json"}}};console.log("Query:",H);var{records:D,status:s}=yield O.identity.web5.dwn.records.query(H);console.log("Status:",s),console.log(D)})()}onFileSelected(O){var $=this;return(0,i.A)(function*(){const H=O.target.files;if(H&&0!==H.length){console.log("Uploading number of files:",H.length);for(let D=0;D{$.app.openSnackBar(`Error reading file ${s.name}: ${p.error}`,3e3),console.error(`Error reading file ${s.name}:`,p.error)},p.readAsText(s)}}})()}onSubmit(){var O=this;return(0,i.A)(function*(){if(console.log(O.addressForm.controls.recoveryPhrase.value),O.addressForm.disable(),O.app.loading.set(!0),"stellar"===O.addressForm.controls.importType.value){const $=O.identity.activeAgent(),H=yield k.hX.fromPrivateKey({privateKey:O.addressForm.controls.recoveryPhrase.value});console.log("Bearer DID: ",H);const D=yield H.export(),s={portableDid:D,metadata:{name:"Stellar Identity",tenant:D.uri,uri:D.uri}};try{console.log("Portable Identity:",s),yield $.identity.import({portableIdentity:s})}catch(ee){console.error(ee)}O.identity.identities=yield $.identity.list();const p=yield O.identity.registerAccount(D.uri,O.app.account().password);console.log(`Register protocols for ${D.uri}`),yield O.protocol.register(p),O.app.account(),O.identity.changeAccount(D.uri),O.route.navigate(["/accounts"])}else{let $=yield O.crypto.createPassword();$="123"}O.app.initialized.set(!0),O.app.loading.set(!1)})()}static{this.\u0275fac=function($){return new($||A)}}static{this.\u0275cmp=a.VBU({type:A,selectors:[["app-restore"]],standalone:!0,features:[a.aNF],decls:16,vars:5,consts:[["recoveryPhrase",""],["novalidate","",3,"ngSubmit","formGroup"],["formControlName","importType"],["value","ariton"],["value","did:is",3,"disabled"],["value","stellar",3,"disabled"],["value","nostr",3,"disabled"],[1,"restore-card"],[1,"full-width"],["matInput","","placeholder","Secret Recovery Phrase","formControlName","recoveryPhrase"],["align","end"],["mat-flat-button","","color","primary","type","submit",3,"disabled"],[1,"restore-card-content"],["type","button","mat-button","",3,"click"],["type","file","id","input",2,"display","none",3,"change"],["mat-list-item","",1,"selectable-list-item",3,"routerLink"],["matListItemIcon",""],["matListItemTitle",""],["matListItemLine",""]],template:function($,H){1&$&&(a.j41(0,"h1"),a.EFF(1,"Restore your account"),a.k0s(),a.j41(2,"form",1),a.bIt("ngSubmit",function(){return H.onSubmit()}),a.j41(3,"p")(4,"mat-button-toggle-group",2)(5,"mat-button-toggle",3),a.EFF(6,"Ariton"),a.k0s(),a.j41(7,"mat-button-toggle",4),a.EFF(8,"FreeID"),a.k0s(),a.j41(9,"mat-button-toggle",5),a.EFF(10,"Stellar"),a.k0s(),a.j41(11,"mat-button-toggle",6),a.EFF(12,"Nostr"),a.k0s()()(),a.DNE(13,ie,17,2,"mat-card",7)(14,K,3,2)(15,o,4,0,"mat-card",7),a.k0s()),2&$&&(a.R7$(2),a.Y8G("formGroup",H.addressForm),a.R7$(5),a.Y8G("disabled",!0),a.R7$(2),a.Y8G("disabled",!0),a.R7$(2),a.Y8G("disabled",!0),a.R7$(2),a.vxM("stellar"==H.addressForm.controls.importType.value?13:"ariton"==H.addressForm.controls.importType.value?14:15))},dependencies:[g.fS,g.fg,q.rl,q.nJ,q.TL,B.Hl,B.$z,P.Vg,P.ec,P.pc,R.Ve,S.m_,S.An,V.Fg,V.jt,V.YE,V.ZV,V.C_,V.yE,z.iI,z.Wk,E.Wk,m.Hu,m.RN,m.YY,m.m2,m.MM,m.Lc,m.dh,x.X1,x.qT,x.me,x.BC,x.cb,x.j4,x.JD,Z.D6,Z.LG],styles:[".restore-card[_ngcontent-%COMP%]{min-width:120px;margin:20px auto}.restore-card-content[_ngcontent-%COMP%]{align-self:center;margin-top:1em}.mat-radio-button[_ngcontent-%COMP%]{display:block;margin:5px 0}.row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.col[_ngcontent-%COMP%]{flex:1;margin-right:20px}.col[_ngcontent-%COMP%]:last-child{margin-right:0}.link-input[_ngcontent-%COMP%]{display:flex;align-items:baseline}.link-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:.4em}.account-action-button[_ngcontent-%COMP%]{padding-top:1.2em}.example-action-buttons[_ngcontent-%COMP%]{padding-bottom:20px}.example-headers-align[_ngcontent-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%]{justify-content:space-between;align-items:center}.example-headers-align[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] + .mat-mdc-form-field[_ngcontent-%COMP%]{margin-left:8px}.selectable-list-item[_ngcontent-%COMP%]{cursor:pointer}.selectable-list-item[_ngcontent-%COMP%]:hover{background-color:var(--mdc-list-list-item-leading-avatar-color)}"]})}}return A})()},59564:(Me,F,f)=>{"use strict";f.d(F,{z:()=>a});var i=f(54438);let a=(()=>{class x{#n=["did:dht:jtubj7jooigmx9y7dz13j9kxhoy3pyo6jzizh3irkmwity3saxko"];#s={registries:"did:dht:jtubj7jooigmx9y7dz13j9kxhoy3pyo6jzizh3irkmwity3saxko"};#l=["did:dht:jtubj7jooigmx9y7dz13j9kxhoy3pyo6jzizh3irkmwity3saxko","did:dht:wfcf3guhgb183rbfx5r4a5u3kh9tgjnmdp75xdphyj6wbaxxym7o"];constructor(){}getAdminDids(){return[...this.#l]}isAdmin(m){return this.#l.includes(m)}getIdentifierForApp(m){return this.#s[m]}getOwnerDids(){return[...this.#n]}isOwner(m){return this.#n.includes(m)}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275prov=i.jDH({token:x,factory:x.\u0275fac,providedIn:"root"})}}return x})()},96084:(Me,F,f)=>{"use strict";f.d(F,{d:()=>Z,f:()=>V});var i=f(10467),a=f(54438),x=f(31948),B=f(20180),m=f(34635),g=f.t(JSON.parse('{"name":"ariton","version":"0.0.3","scripts":{"ng":"ng","start":"ng serve --port 4201","start2":"ng serve --port 4210","build":"ng build","watch":"ng build --watch --configuration development","test":"ng test","deploy":"ng deploy app","i18n":"ng extract-i18n --format=json --output-path src/locale"},"repository":{"type":"git","url":"git+https://github.com/block-core/ariton.git"},"private":true,"dependencies":{"@angular-builders/custom-webpack":"^18.0.0","@angular/animations":"^18.2.8","@angular/cdk":"^18.2.8","@angular/common":"^18.2.8","@angular/compiler":"^18.2.8","@angular/core":"^18.2.8","@angular/forms":"^18.2.8","@angular/material":"^18.2.8","@angular/platform-browser":"^18.2.8","@angular/platform-browser-dynamic":"^18.2.8","@angular/router":"^18.2.8","@angular/service-worker":"^18.2.8","@scure/bip39":"^1.4.0","@web5/agent":"^0.8.1","@web5/api":"^0.12.0","@web5/credentials":"^1.1.3","@web5/crypto":"^1.0.6","@web5/dids":"^1.2.0","@web5/identity-agent":"^0.7.1","@zxing/ngx-scanner":"^18.0.1","base32.js":"^0.1.0","cropperjs":"^1.6.2","crypto-browserify":"^3.12.1","process":"^0.11.10","qrcode":"^1.5.4","rxjs":"~7.8.1","stream":"^0.0.3","stream-browserify":"^3.0.0","tslib":"^2.7.0"},"devDependencies":{"@angular-devkit/build-angular":"^18.2.8","@angular/cli":"^18.2.8","@angular/compiler-cli":"^18.2.8","@angular/localize":"^18.2.8","@types/jasmine":"~5.1.4","@types/qrcode":"^1.5.5","angular-cli-ghpages":"^2.0.3","jasmine-core":"~5.3.0","karma":"~6.4.4","karma-chrome-launcher":"~3.2.0","karma-coverage":"~2.2.1","karma-jasmine":"~5.1.0","karma-jasmine-html-reporter":"~2.1.0","typescript":"~5.5.4"}}'),2),E=f(88020),R=f(5794),M=f(1005),_=f(95416),j=f(21093);let P=(()=>{class q{constructor(){this.connection=(0,a.WQX)(j.K)}start(){var te=this;return(0,i.A)(function*(){const ie=function(){var ae=(0,i.A)(function*(){try{console.log("Processing task..."),console.log("connections count:",te.connection.requests().length),console.log("CONNECTIONS:",te.connection.requests());const me=te.connection.requests().filter(ye=>"credential"===ye.record.tags.type);console.log("credentialRequests:",me);for(const ye of me){console.log("Processing connection:",ye);const ue=yield te.connection.acceptFriendRequest(ye);ye.data.recordId=ue?.id,ye.data.did=ye.record.creator,console.log("REQUEST DATA:",ye.data);const K=yield te.connection.create(ye,j.X.Friend);console.log("Connection Entry that was made: ",K),yield te.connection.deleteRequest(ye)}}catch(me){console.error("Error processing task:",me)}finally{setTimeout(ie,6e4)}});return function(){return ae.apply(this,arguments)}}();yield ie()})()}static{this.\u0275fac=function(ie){return new(ie||q)}}static{this.\u0275prov=a.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})();var k=f(56687),z=f(43794),W=f(30046),V=function(q){return q[q.Initial=0]="Initial",q[q.NewUser=1]="NewUser",q[q.Locked=2]="Locked",q[q.Unlocked=3]="Unlocked",q[q.Error=4]="Error",q}(V||{});let Z=(()=>{class q{constructor(){var te=this;this.onboardingState=(0,a.vPA)(V.Initial),this.initialized=(0,a.vPA)(!1),this.loading=(0,a.vPA)(!1),this.localStorage=(0,a.WQX)(x.s),this.storage=(0,a.WQX)(z.n),this.hash=(0,a.WQX)(M.G),this.worker=(0,a.WQX)(P),this.crypto=(0,a.WQX)(B.j),this.identity=(0,a.WQX)(m.K),this.profile=(0,a.WQX)(R.p),this.connection=(0,a.WQX)(j.K),this.protocol=(0,a.WQX)(E.w),this.snackBar=(0,a.WQX)(_.UG),this.event=(0,a.WQX)(k.U),this.router=(0,a.WQX)(W.Ix),this.state=(0,a.vPA)({loginAction:"/dashboard",selectedIdentity:"",hidden:{}}),this.account=(0,a.vPA)({did:"",recoveryPhrase:"",password:"",passwordHash:"",bundleTimestamp:""}),this.identities=(0,a.vPA)([]),this.agent=(0,a.vPA)(null),this.activeIdentity=(0,a.vPA)(null),this.params=(0,a.vPA)({}),this.package=g,console.log(`Ariton v${this.package.version} (${this.hash.getTimestamp()})`),this.dependencies=Object.entries(this.package.dependencies).map(([ie,ae])=>({name:ie,version:ae})),(0,a.QZP)((0,i.A)(function*(){te.identity.locked()||(yield te.onUnlocked())}))}saveAgent(te){this.localStorage.save("agent",te)}saveIdentities(te){te&&0!=te.length?this.localStorage.save("identities",te):console.log("IDENTITIES ARE EMPTY!!!")}saveAccounts(te){this.localStorage.save("accounts",te)}saveState(te){this.localStorage.save("state",te)}wipe(){var te=this;return(0,i.A)(function*(){te.localStorage.clear(),console.log("Local storage data has been wiped!"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DID_RESOLVERCACHE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_DATASTORE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_EVENTLOG"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_MESSAGEINDEX"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_MESSAGESTORE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/VAULT_STORE"),console.log("Data has been wiped!"),window.location.reload()})()}hasStateBeenSet(){return!!this.localStorage.read("state")}createAccount(){var te=this;return(0,i.A)(function*(){te.localStorage.save("state",{selectedIdentity:"",hidden:{},loginAction:"/introduction"}),yield te.initialize()})()}openSnackBar(te,ie=2e3){this.snackBar.open(te,void 0,{duration:ie})}initialize(){var te=this;return(0,i.A)(function*(){te.loading.set(!0),console.log("Initializing Ariton...");let ie=te.localStorage.read("state");if(!ie)return te.onboardingState.set(V.NewUser),void te.loading.set(!1);let ae=te.localStorage.read("identities");te.identities.set(ae);let ye,me=te.localStorage.read("agent");if(me){let ue;if(ie.selectedIdentity?(ue=ae.find(K=>K.did===ie.selectedIdentity),console.log("!!! IDENTITIES: ",ae),console.log("!!! IDENTITY: ",ue),te.activeIdentity.set(ue),te.agent.set(me)):0===ae.length&&(ue=ae[0],te.activeIdentity.set(ue),console.log("!!! IDENTITY2: ",ue)),me.password){if(ye=yield te.identity.connect(ue.did,me.password),0===ae.length){const o=yield(ye?.web5.agent).identity.list();console.log("IDENTITIES FROM identity.list:",o);const h=o.map(A=>({did:A.metadata.uri,bundleTimestamp:""}));console.log("Mapped identities:",h),te.saveIdentities(h),te.identities.set(h)}console.log("IDENTITIES FOR SAVING: ",ae),console.log("IDENTITIES SET: ",te.identities()),ye?(te.onboardingState.set(V.Unlocked),console.log("LOCKED FALSE, IDENTITIES2",te.identities()),te.identity.locked.set(!1)):te.loading.set(!1)}else console.log("LOCKED TRUE, IDENTITIES3",te.identities()),console.log("LOCKED TRUE, IDENTITIES4",ae),te.identity.locked.set(!0),te.onboardingState.set(V.Locked)}else{console.log("No agent found");const ue=yield te.crypto.createPassword();if(ye=yield te.identity.initialConnect(ue),void 0===ye)return te.localStorage.remove("state"),te.onboardingState.set(V.Error),void te.loading.set(!1);console.log(ye),console.log("Initialize connect finished."),me={did:ye.web5.agent.agentDid.uri,recoveryPhrase:ye.recoveryPhrase,password:ue},te.saveAgent(me);const K={did:ye.did,bundleTimestamp:""};ae=[K],te.saveIdentities(ae),te.identities.set(ae),console.log("Identities saved:",ae),ie.selectedIdentity=ye.did,te.saveState(ie),te.agent.set(me),te.activeIdentity.set(K),te.onboardingState.set(V.Unlocked),console.log("LOCKED FALSE, IDENTITIES1",te.identities()),te.identity.locked.set(!1)}te.state.set(ie)})()}lock(){var te=this;return(0,i.A)(function*(){te.agent()?.passwordHash&&""!==te.agent()?.passwordHash?(console.log("Locking account..."),yield te.identity.lock(),te.onboardingState.set(V.Locked),te.initialized.set(!1)):te.router.navigate(["/account","password"])})()}onUnlocked(){var te=this;return(0,i.A)(function*(){try{yield te.profile.openCurrentUserProfile(te.activeIdentity().did)}catch(ie){console.error("Failed to load user profile:",ie)}yield te.loadAppData(),te.initialized.set(!0),te.loading.set(!1),te.worker.start(),yield te.event.initialize(te.identity),yield te.firstTimeInitialization()})()}loadAppData(){var te=this;return(0,i.A)(function*(){console.log("Loading app data..."),yield te.connection.initialize(),console.log("App data loaded.")})()}firstTimeInitialization(){var te=this;return(0,i.A)(function*(){console.log("First time initialization..."),console.log(te.identities()),console.log(te.activeIdentity()),null==te.hash.getTimestamp()||te.activeIdentity().bundleTimestamp!==te.hash.getTimestamp()?(console.log("Bundle hash is different from the previous one. Re-registering protocols..."),console.log(`Register protocols for ${te.identity.did}`),te.protocol.register(te.identity.web5),te.activeIdentity().bundleTimestamp=te.hash.getTimestamp(),te.saveIdentities(te.identities())):console.log("Bundle hash is the same as the previous one. No need to re-register protocols.")})()}static{this.\u0275fac=function(ie){return new(ie||q)}}static{this.\u0275prov=a.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})()},21093:(Me,F,f)=>{"use strict";f.d(F,{K:()=>_,X:()=>M});var i=f(10467),a=f(54438),x=f(34635),B=f(68530),m=f(77494),S=f(26703),g=f(76336),E=f(22312),R=f(56687),M=function(j){return j.Data="data",j.Friend="friend",j.Credential="credential",j}(M||{});let _=(()=>{class j{constructor(){var k=this;this.identity=(0,a.WQX)(x.K),this.events=(0,a.WQX)(R.U),this.utility=(0,a.WQX)(S.Q),this.blocks=(0,a.vPA)([]),this.connections=(0,a.vPA)([]),this.friends=(0,a.EWP)(()=>this.connections().filter(z=>"friend"==z.record.tags.type)),this.friendRequests=(0,a.EWP)(()=>this.requests().filter(z=>"friend"==z.record.tags.type)),this.requests=(0,a.vPA)([]),this.loading=(0,a.vPA)(!1),(0,a.QZP)((0,i.A)(function*(){k.events.connectionProtocol()&&(yield k.reloadRequests())}),{allowSignalWrites:!0})}create(k,z){var W=this;return(0,i.A)(function*(){const V={type:z};let Z=k.data;console.log("CONNECTION SERVICE ENTRY DATA:",Z);const{record:q,status:re}=yield W.identity.web5.dwn.records.create({data:Z,message:{tags:V,recipient:k.record.creator,protocol:B.Q.protocol,protocolPath:"connection",schema:B.Q.types.connection.schema,dataFormat:B.Q.types.connection.dataFormats[0]}});console.log("Connection created:",re,q);const te={record:q,data:Z,id:q.id};return W.connections.update(ie=>[te,...ie]),W.utility.executeAsyncWithToast(k.record.send(W.identity.did)),te})()}validateAndStoreCredential(k){var z=this;return(0,i.A)(function*(){const W=k.data.vc;if(!W)throw new Error("The incoming VC is missing.");try{yield g.l6.verify({vcJwt:W})}catch(te){return void console.error("Error verifying VC:",te)}const V=g.l6.parseJwt({vcJwt:W});console.log("PARSED INVCOMING VC:",V),console.log("vc.issuer === this.identity.did:",V.issuer===z.identity.did);const{record:q}=yield z.identity.web5.dwn.records.create({data:W,message:{schema:E.eE.friendship,dataFormat:E.eE.format,published:!1}});console.log("TWO WAY VC RECORD:",q);const{status:re}=yield q.send(z.identity.did);console.log("Record sent:",re,q),yield k.record.delete(),k.record.send(z.identity.did),console.log("Friend request validated")})()}removeFriendship(k){return(0,i.A)(function*(){})()}acceptFriendRequest(k){var z=this;return(0,i.A)(function*(){const W=k.data.vc;if(!W)throw new Error("The incoming VC is missing.");if(console.log("signedVcJwt:",W),!W)return;try{yield g.l6.verify({vcJwt:W})}catch(ie){return void console.error("Error verifying VC:",ie)}const V=g.l6.parseJwt({vcJwt:W});if(V.subject!=z.identity.did)return void console.error("VC is not valid.");if(V.issuer!=k.record.creator)return void console.error("VC is not valid.");const q=V.vcDataModel.credentialSubject.vc;console.log("INNER VC JWT:",q);try{yield g.l6.verify({vcJwt:q})}catch(ie){return void console.error("Error verifying VC:",ie)}const re=g.l6.parseJwt({vcJwt:q});if(console.log("VC issuer: ",re.issuer),console.log("this.identity.did",z.identity.did),re.issuer!=z.identity.did)return void console.error("VC is not valid.");if(re.subject!=V.issuer)return void console.error("VC is not valid.");console.log("Friend request validated");const{record:te}=yield z.identity.web5.dwn.records.create({data:W,message:{schema:E.eE.friendship,dataFormat:E.eE.format,published:!1}});return console.log("TWO WAY VC RECORD:",te),te.send(z.identity.did),te})()}approveFriendRequest(k){var z=this;return(0,i.A)(function*(){const W=k.data.vc;if(!W)throw new Error("The incoming VC is missing.");if(console.log("signedVcJwt:",W),!W)return;try{yield g.l6.verify({vcJwt:W})}catch(q){return void console.error("Error verifying VC:",q)}const V=g.l6.parseJwt({vcJwt:W});if(V.subject!=z.identity.did)return void console.error("VC is not valid.");if(V.issuer!=k.record.creator)return void console.error("VC is not valid.");const{record:Z}=yield z.identity.web5.dwn.records.create({data:W,message:{schema:E.eE.friendship,dataFormat:E.eE.format,published:!1}});console.log("TWO WAY VC RECORD:",Z),Z.send(z.identity.did),yield z.deleteRequest(k)})()}initialize(){var k=this;return(0,i.A)(function*(){const z=yield k.loadBlocks();k.blocks.set(z);const W=yield k.loadConnections();k.connections.set(W),yield k.reloadRequests()})()}reloadRequests(){var k=this;return(0,i.A)(function*(){k.loading.set(!0);const z=yield k.loadRequests();k.requests.set(z),k.loading.set(!1)})()}request(k,z,W){var V=this;return(0,i.A)(function*(){const Z=z,q={type:W},{record:re,status:te}=yield V.identity.web5.dwn.records.create({data:Z,message:{tags:q,recipient:k,protocol:B.Q.protocol,protocolPath:"request",schema:B.Q.types.request.schema,dataFormat:B.Q.types.request.dataFormats[0]}});console.log("Notification created:",te,re);const ie={record:re,data:Z,id:re.id,direction:"out"};return V.requests.update(ae=>[ie,...ae]),V.utility.executeAsyncWithToast(ie.record.send(V.identity.did)),V.utility.executeAsyncWithToast(ie.record.send(k)),ie})()}deleteBlock(k){var z=this;return(0,i.A)(function*(){yield k.record.delete(),z.blocks.update(W=>[...W.filter(V=>V.id!==k.id)]),z.utility.executeAsyncWithToast(k.record.send(z.identity.did))})()}deleteConnection(k){var z=this;return(0,i.A)(function*(){yield k.record.delete(),z.connections.update(W=>[...W.filter(V=>V.id!==k.id)]),z.utility.executeAsyncWithToast(k.record.send(z.identity.did))})()}deleteRequest(k){var z=this;return(0,i.A)(function*(){const W=k.record.creator;console.log("Delete requested for this author:"+W),yield k.record.delete(),z.requests.update(V=>[...V.filter(Z=>Z.id!==k.id)]),z.utility.executeAsyncWithToast(k.record.send(z.identity.did)),z.utility.executeAsyncWithToast(k.record.send(W==z.identity.did?k.record.recipient:W))})()}deleteRequests(k){var z=this;return(0,i.A)(function*(){if(!k)return;const W=yield z.loadRequests(k);for(const V of W)console.log("DELETE THIS ENTRY:",V),yield z.deleteRequest(V)})()}deleteConnections(k){var z=this;return(0,i.A)(function*(){if(!k)return;const W=yield z.loadConnections(k);for(const V of W)yield V.record.delete(),yield V.record.send(z.identity.did),z.connections.update(Z=>[...Z.filter(q=>q.id!==V.id)])})()}block(k){var z=this;return(0,i.A)(function*(){if(console.log("BLOCKS THIS DID:",k),!k)return;const W={did:k};console.log("Delete all Requests and Connections before updating block list."),yield z.deleteRequests(k),yield z.deleteConnections(k);let V=z.blocks().find(Z=>Z.data.did==k);if(!V){const{records:Z}=yield z.identity.web5.dwn.records.query({message:{filter:{recipient:k,protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema,dataFormat:B.Q.types.block.dataFormats[0]},dateSort:m.U0.CreatedAscending}});let q;if(0==Z.length){const{record:re}=yield z.identity.web5.dwn.records.create({data:{did:k},message:{protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema,dataFormat:B.Q.types.block.dataFormats[0]}});q=re}else q=Z[0];V={record:q,data:W,id:q.id},z.blocks.update(re=>[...re,V])}return console.log("The Block record",V),V})()}loadRequests(k){var z=this;return(0,i.A)(function*(){const W=[],Z={from:z.identity.did,message:{filter:{author:k||void 0,protocol:B.Q.protocol,protocolPath:"request",schema:B.Q.types.request.schema},dateSort:m.U0.CreatedAscending}};console.log("IDENTITY: ",z.identity),console.log("LOAD REQUESTS:",Z);const{records:q}=yield z.identity.web5.dwn.records.query(Z);for(let re of q){if(z.blocked(re.creator)){re.delete(),re.send(z.identity.did),re.send(re.creator);continue}const te=yield re.data.json();let ie={record:re,data:te,id:re.id};re.creator==z.identity.did&&(ie.direction="out"),W.push(ie)}return console.log("REQUESTS: ",W),W})()}blocked(k){return void 0!==this.blocks().find(z=>z.data.did==k)}loadConnections(k){var z=this;return(0,i.A)(function*(){const W=[],V={recipient:k||void 0,protocol:B.Q.protocol,protocolPath:"connection",schema:B.Q.types.connection.schema},{records:Z}=yield z.identity.web5.dwn.records.query({message:{filter:V,dateSort:m.U0.CreatedDescending}});for(let q of Z){const re=yield q.data.json();W.push({record:q,data:re,id:q.id})}return W})()}loadBlocks(){var k=this;return(0,i.A)(function*(){const z=[],{records:W}=yield k.identity.web5.dwn.records.query({message:{filter:{protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema},dateSort:m.U0.CreatedAscending}});for(let V of W){const Z=yield V.data.json();z.push({record:V,data:Z,id:V.id})}return z})()}static{this.\u0275fac=function(z){return new(z||j)}}static{this.\u0275prov=a.jDH({token:j,factory:j.\u0275fac,providedIn:"root"})}}return j})()},20180:(Me,F,f)=>{"use strict";f.d(F,{j:()=>je});var i=f(10467),a=f(42512);function S(Ne,...ot){if(!function m(Ne){return Ne instanceof Uint8Array||null!=Ne&&"object"==typeof Ne&&"Uint8Array"===Ne.constructor.name}(Ne))throw new Error("Uint8Array expected");if(ot.length>0&&!ot.includes(Ne.length))throw new Error(`Uint8Array expected of length ${ot}, not of length=${Ne.length}`)}function E(Ne,ot=!0){if(Ne.destroyed)throw new Error("Hash instance has been destroyed");if(ot&&Ne.finished)throw new Error("Hash#digest() has already been called")}const j="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,W=Ne=>new DataView(Ne.buffer,Ne.byteOffset,Ne.byteLength),V=(Ne,ot)=>Ne<<32-ot|Ne>>>ot;function O(Ne){return"string"==typeof Ne&&(Ne=function I(Ne){if("string"!=typeof Ne)throw new Error("utf8ToBytes expected string, got "+typeof Ne);return new Uint8Array((new TextEncoder).encode(Ne))}(Ne)),S(Ne),Ne}new Uint8Array(new Uint32Array([287454020]).buffer);class H{clone(){return this._cloneInto()}}function p(Ne){const ot=wt=>Ne().update(O(wt)).digest(),Ft=Ne();return ot.outputLen=Ft.outputLen,ot.blockLen=Ft.blockLen,ot.create=()=>Ne(),ot}const Ae=(Ne,ot,Ft)=>Ne&ot^~Ne&Ft,Ie=(Ne,ot,Ft)=>Ne&ot^Ne&Ft^ot&Ft;class Le extends H{constructor(ot,Ft,wt,zt){super(),this.blockLen=ot,this.outputLen=Ft,this.padOffset=wt,this.isLE=zt,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(ot),this.view=W(this.buffer)}update(ot){E(this);const{view:Ft,buffer:wt,blockLen:zt}=this,rr=(ot=O(ot)).length;for(let ar=0;arzt-ar&&(this.process(wt,0),ar=0);for(let Tr=ar;Tr>zt&rr),lr=Number(Ft&rr),Wr=wt?0:4;Ne.setUint32(ot+(wt?4:0),ar,wt),Ne.setUint32(ot+Wr,lr,wt)})(wt,zt-8,BigInt(8*this.length),rr),this.process(wt,0);const lr=W(ot),hn=this.outputLen;if(hn%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const Wr=hn/4,vr=this.get();if(Wr>vr.length)throw new Error("_sha2: outputLen bigger than state");for(let Tr=0;Tr>>3,Dt=V(lt,17)^V(lt,19)^lt>>>10;Xe[Tr]=Dt+Xe[Tr-7]+Pt+Xe[Tr-16]|0}let{A:wt,B:zt,C:rr,D:ar,E:lr,F:hn,G:Wr,H:vr}=this;for(let Tr=0;Tr<64;Tr++){const lt=vr+(V(lr,6)^V(lr,11)^V(lr,25))+Ae(lr,hn,Wr)+xe[Tr]+Xe[Tr]|0,Dt=(V(wt,2)^V(wt,13)^V(wt,22))+Ie(wt,zt,rr)|0;vr=Wr,Wr=hn,hn=lr,lr=ar+lt|0,ar=rr,rr=zt,zt=wt,wt=lt+Dt|0}wt=wt+this.A|0,zt=zt+this.B|0,rr=rr+this.C|0,ar=ar+this.D|0,lr=lr+this.E|0,hn=hn+this.F|0,Wr=Wr+this.G|0,vr=vr+this.H|0,this.set(wt,zt,rr,ar,lr,hn,Wr,vr)}roundClean(){Xe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Se=p(()=>new Te);var ve=f(53813);function nt(Ne,ot=128){if(function x(Ne){if(!Number.isSafeInteger(Ne)||Ne<0)throw new Error(`positive integer expected, not ${Ne}`)}(ot),ot%32!=0||ot>256)throw new TypeError("Invalid entropy");return function ze(Ne,ot){return function $e(Ne){S(Ne,16,20,24,28,32)}(Ne),function Tt(Ne){if(!Array.isArray(Ne)||2048!==Ne.length||"string"!=typeof Ne[0])throw new Error("Wordlist: expected array of 2048 strings");return Ne.forEach(ot=>{if("string"!=typeof ot)throw new Error(`Wordlist: non-string element: ${ot}`)}),ve.Wp.chain(ve.Wp.checksum(1,Qe),ve.Wp.radix2(11,!0),ve.Wp.alphabet(Ne))}(ot).encode(Ne).join((Ne=>"\u3042\u3044\u3053\u304f\u3057\u3093"===Ne[0])(ot)?"\u3000":" ")}(function oe(Ne=32){if(j&&"function"==typeof j.getRandomValues)return j.getRandomValues(new Uint8Array(Ne));if(j&&"function"==typeof j.randomBytes)return j.randomBytes(Ne);throw new Error("crypto.getRandomValues must be defined")}(ot/8),Ne)}const Qe=Ne=>{const ot=8-Ne.length/4;return new Uint8Array([Se(Ne)[0]>>ot<{class Ne{constructor(){}createPassword(Ft=6,wt=128){return(0,i.A)(function*(){try{const zt=nt(he,wt).split(" "),rr=[];for(let ar=0;ar{"use strict";f.d(F,{U:()=>S});var i=f(10467),a=f(54438),x=f(68530),B=f(62060),m=f(50963);let S=(()=>{class g{#n=(0,a.vPA)(null);get connectionProtocol(){return this.#n}#s=(0,a.vPA)(null);get chatProtocol(){return this.#s}#l=(0,a.vPA)(null);get taskProtocol(){return this.#l}constructor(){}initialize(R){var M=this;return(0,i.A)(function*(){console.log("Event Service initializing..."),yield R.web5.dwn.records.subscribe({message:{filter:{protocol:x.Q.protocol}},subscriptionHandler:z=>{setTimeout(()=>{M.#n.set(z),console.log("!!!! Received local for connection:",z)},1e3)}}),yield R.web5.dwn.records.subscribe({message:{filter:{protocol:B.Q.protocol}},subscriptionHandler:z=>{setTimeout(()=>{M.#s.set(z),console.log("!!!! Received local for chat:",z)},1e3)}}),yield R.web5.dwn.records.subscribe({message:{filter:{protocol:m.Q.protocol}},subscriptionHandler:z=>{setTimeout(()=>{M.#l.set(z),console.log("!!!! Received local for task:",z)},1e3)}}),console.log("Event Service initialized.")})()}static{this.\u0275fac=function(M){return new(M||g)}}static{this.\u0275prov=a.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}}return g})()},1005:(Me,F,f)=>{"use strict";f.d(F,{G:()=>B});var i=f(10467),a=f(54438),x=f(21626);let B=(()=>{class m{constructor(g){this.http=g,this.timestamp=null}load(){var g=this;return(0,i.A)(function*(){const E=yield fetch("/ngsw.json");if(E.ok){const R=yield E.json();console.log("DATA FROM HASH",R),g.timestamp=R.timestamp}})()}getTimestamp(){return this.timestamp}static{this.\u0275fac=function(E){return new(E||m)(a.KVO(x.Qq))}}static{this.\u0275prov=a.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},34635:(Me,F,f)=>{"use strict";f.d(F,{K:()=>M});var i=f(10467),a=f(54438),x=f(25246),B=f(80785),m=f(20180),S=f(77494),g=f(80428),E=f(4080),R=f(12621);let M=(()=>{class _{constructor(P){this.cryptoService=P,this.syncInterval="15s",this.agents=(0,a.vPA)([]),this.identities=[],this.accounts={},this.crypto=(0,a.WQX)(m.j),this.activeAccount=(0,a.vPA)(void 0),this.activeIdentity=(0,a.vPA)(void 0),this.preinitialized=(0,a.vPA)(!1),this.initialized=(0,a.vPA)(!1),this.locked=(0,a.vPA)(!0)}initialConnect(P){var k=this;return(0,i.A)(function*(){try{console.log("Connecting to Web5...");const z=yield x.uW.connect({password:P,sync:k.syncInterval});return k.did=z.did,k.web5=z.web5,k.agent=z.web5.agent,console.log("Web5 Connected.",k.did),k.preinitialized.set(!0),k.initialized.set(!0),z}catch(z){console.error(z)}})()}get identity(){return this.identities.find(P=>P.metadata.uri===this.did)}connectWithIdentity(P){var k=this;return(0,i.A)(function*(){const z=yield k.crypto.createPassword();console.log("Password created");const W=new S.TX({keyDerivationWorkFactor:21e4,store:new E.cG({location:"DATA/AGENT/VAULT_STORE"})});let V;const Z=new S.Bq({didMethods:[B.ES,B.E6,R.hX],resolverCache:new S.Td({location:"DATA/AGENT/DID_RESOLVERCACHE"}),store:new S.QZ});k.store=new S.dk;const q=new S.yc({store:k.store});k.identityApi=q,console.log("Creating user agent...");const re=yield g.s.create({didApi:Z,identityApi:q,agentVault:W}),ie=yield re.firstLaunch();console.log("FIRST LAUNCH???",ie),ie&&(V=yield re.initialize({password:z,recoveryPhrase:V,dwnEndpoints:["https://dwn.tbddev.org/beta"]}),console.log("USER AGENT RECOVERY PHRASE:",V)),yield re.start({password:z});const ae=yield re.identity.import({portableIdentity:P});console.log("IDENTITY MADE IN IMPORT:",ae),yield re.sync.registerIdentity({did:ae.did.uri});const me=new x.uW({agent:re,connectedDid:ae.did.uri});return console.log("WEB5:",me),{password:z,agentDid:me.agent.agentDid.uri,did:ae.did.uri,recoveryPhrase:V,web5:me}})()}connect(P,k){var z=this;return(0,i.A)(function*(){try{console.log("Connecting to Web5...");const W=yield x.uW.connect({connectedDid:P,password:k,sync:z.syncInterval});return z.accounts[P]=W.web5,W.did!=P&&console.error("Connected DID does not match the result DID:",P,W.did),z.did=W.did,z.web5=W.web5,z.agent=W.web5.agent,console.log("Web5 Connected."),z.preinitialized.set(!0),z.initialized.set(!0),z.loadAccounts(k),W}catch(W){console.error("Failed to initialize web5:",W),alert("Failed to initialize Web5:"+W)}})()}changeAccount(P){var k=this;return(0,i.A)(function*(){const z=k.accounts[P];console.log("Changing to this Account:",z),z&&(k.web5=z,k.agent=z.agent,k.did=P,k.activeAccount.set(k.web5))})()}loadAccounts(P){var k=this;return(0,i.A)(function*(){k.identities=yield k.agent.identity.list();for(const z of k.identities){const W=z?.metadata?.uri;yield k.registerAccount(W,P)}})()}registerEndpoints(P,k,z=[]){return(0,i.A)(function*(){try{for(const W of z){const V=yield P.rpc.getServerInfo(W);console.log("SERVER INFO: ",V),0!==V.registrationRequirements.length?(yield S.Vu.registerTenant(W,P.agentDid.uri),yield S.Vu.registerTenant(W,k.did.uri)):console.log("No registration requirements")}}catch(W){console.error("Failed to register DWN endpoints",W)}})()}registerAccount(P,k){var z=this;return(0,i.A)(function*(){const{web5:W}=yield x.uW.connect({connectedDid:P,password:k,sync:z.syncInterval});return z.accounts[P]=W,W})()}activeAgent(){return this.web5.agent}changePassword(P,k){var z=this;return(0,i.A)(function*(){yield z.web5.agent.vault.changePassword({oldPassword:P,newPassword:k})})()}lock(){var P=this;return(0,i.A)(function*(){console.log("Locking account..."),yield P.web5.agent.vault.lock(),console.log("Vault locked"),P.locked.set(!0),P.initialized.set(!1)})()}unlock(P,k){var z=this;return(0,i.A)(function*(){try{console.log("Connecting to Web5...");const{did:W,web5:V}=yield x.uW.connect({connectedDid:P,sync:z.syncInterval,password:k});return z.did=W,z.web5=V,P!=W&&console.error("Connected DID does not match the result DID:",W,P),console.log("UNLOCK WAS CALLED!!"),z.initialized.set(!0),z.locked.set(!1),!0}catch(W){return console.error(W),console.log("Show unlock screen!"),z.locked.set(!0),!1}})()}static{this.\u0275fac=function(k){return new(k||_)(a.KVO(m.j))}}static{this.\u0275prov=a.jDH({token:_,factory:_.\u0275fac,providedIn:"root"})}}return _})()},36815:(Me,F,f)=>{"use strict";f.d(F,{Y:()=>B});var i=f(99327),a=f(54438),x=f(30046);let B=(()=>{class m{constructor(){this.search=(0,a.vPA)(!1),this.searchInput="",this.scrolling=(0,a.vPA)(!0),this.tray=(0,a.vPA)(!1),this.navigation=(0,a.vPA)(!1),this.margin=(0,a.vPA)(!0),this.custom=(0,a.vPA)(!1),this.actions=(0,a.vPA)([]),this.breakpointObserver=(0,a.WQX)(i.QP),this.router=(0,a.WQX)(x.Ix),this.small=(0,a.vPA)(!1),this.tiny=(0,a.vPA)(!1),this.router.events.subscribe(R=>{R instanceof x.Z?this.enableScrolling():R instanceof x.wF&&(this.scrollToTop(),this.countChar("/",R.url)>1?this.enableNavigation():this.disableNavigation())}),this.breakpointObserver.observe(["(max-width: 959.98px)"]).subscribe(R=>{this.small.set(!!R.matches)}),this.breakpointObserver.observe(["(max-width: 600px)"]).subscribe(R=>{this.tiny.set(!!R.matches)}),(0,a.QZP)(()=>{const R=document.querySelector(".sidenav-scroll-wrapper");R&&(R.style.overflow=this.scrolling()?"auto":"hidden");const M=document.getElementById("sidenav-content");M&&(M.style.overflow=this.scrolling()?"auto":"hidden")})}countChar(g,E){return E.split(g).length-1}ngAfterContentInit(){}toggleSearch(){this.search.set(!this.search()),this.searchInput=""}setActions(g){this.actions.set(g)}addAction(g){this.actions.update(E=>[...E,g])}customOff(){this.custom.set(!1)}customOn(){this.custom.set(!0)}marginOff(){this.margin.set(!1)}marginOn(){this.margin.set(!0)}resetActions(){this.actions.set([])}enableScrolling(){this.scrolling.set(!0)}scrollToTop(){const g=document.querySelector(".sidenav-content");g&&(g.scrollTop=0)}disableScrolling(){this.scrolling.set(!1)}enableNavigation(){this.navigation.set(!0)}disableNavigation(){this.navigation.set(!1)}static{this.\u0275fac=function(E){return new(E||m)}}static{this.\u0275prov=a.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},31948:(Me,F,f)=>{"use strict";f.d(F,{s:()=>x});var i=f(54438),a=f(36815);let x=(()=>{class B{constructor(){this.prefix="ariton-",this.layout=(0,i.WQX)(a.Y),this.layout.resetActions()}save(S,g){localStorage.setItem(this.prefix+S,JSON.stringify(g))}read(S){const g=localStorage.getItem(this.prefix+S);return g?JSON.parse(g):null}remove(S){localStorage.removeItem(this.prefix+S)}clear(){Object.keys(localStorage).forEach(S=>{S.startsWith(this.prefix)&&localStorage.removeItem(S)})}static{this.\u0275fac=function(g){return new(g||B)}}static{this.\u0275prov=i.jDH({token:B,factory:B.\u0275fac,providedIn:"root"})}}return B})()},55619:(Me,F,f)=>{"use strict";f.d(F,{o:()=>B});var i=f(30046),a=f(54438),x=f(60177);let B=(()=>{class m{constructor(g,E){this.router=g,this.location=E,this.history=[],this.router.events.subscribe(R=>{R instanceof i.wF&&this.history.push(R.urlAfterRedirects),R instanceof i.OY&&console.log("SCROLL EVENT",R)})}back(){this.history.pop(),this.history.length>0?this.location.back():this.router.navigateByUrl("/")}static{this.\u0275fac=function(E){return new(E||m)(a.KVO(i.Ix),a.KVO(x.aZ))}}static{this.\u0275prov=a.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},82546:(Me,F,f)=>{"use strict";f.d(F,{J:()=>S});var i=f(10467),a=f(54438),x=f(34635),B=f(5397),m=f(77494);let S=(()=>{class g{constructor(){this.identity=(0,a.WQX)(x.K)}create(R){var M=this;return(0,i.A)(function*(){const _=R,{record:j,status:P}=yield M.identity.web5.dwn.records.create({data:_,message:{protocol:B.Q.protocol,protocolPath:"event",schema:B.Q.types.event.schema,dataFormat:B.Q.types.event.dataFormats[0]}});return console.log("Notification created:",P,j),{record:j,data:_,id:j.id}})()}load(){var R=this;return(0,i.A)(function*(){const M=[],{records:_}=yield R.identity.web5.dwn.records.query({message:{filter:{protocol:B.Q.protocol,schema:B.Q.types.event.schema},dateSort:m.U0.CreatedAscending}});for(let j of _){const P=yield j.data.json();M.push({record:j,data:P,id:j.id})}return M})()}static{this.\u0275fac=function(M){return new(M||g)}}static{this.\u0275prov=a.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}}return g})()},63528:(Me,F,f)=>{"use strict";f.d(F,{x:()=>x});var i=f(10467),a=f(54438);let x=(()=>{class B{constructor(){this.title=(0,a.vPA)(""),this.timeUpdateEvent=new a.bkB,this.init()}init(){var S=this;navigator.mediaSession.setActionHandler("play",(0,i.A)(function*(){try{S.audio&&(yield S.audio.play())}catch(g){console.error(g.name,g.message)}})),navigator.mediaSession.setActionHandler("pause",()=>{this.audio&&this.audio.pause()})}previous(){}next(){}onTimeUpdate(S){this.timeUpdateEvent.subscribe(S)}createAudio(S){return this.audio||(this.audio=new Audio(S),this.audio.addEventListener("timeupdate",()=>{this.audio&&this.timeUpdateEvent.emit(this.audio.currentTime)})),this.audio}play(){var S=this;return(0,i.A)(function*(){const g="https://magazine.ariton.app/assets/creative-technology-showreel-241274.mp3";S.setTitle(g),S.audio||(S.audio=S.createAudio(g)),yield S.audio.play()})()}setTitle(S){const E=new URL(S).pathname,R=E.substring(E.lastIndexOf("/")+1);this.title=(0,a.vPA)(R),navigator.mediaSession.metadata=new MediaMetadata({title:R,artist:R,album:"Ariton",artwork:[{src:R}]}),navigator.mediaSession.playbackState="playing"}pause(){this.audio&&this.audio.pause(),navigator.mediaSession.playbackState="paused"}get paused(){return!this.audio||this.audio.paused}get time(){return this.audio?Math.floor(this.audio.currentTime):10}set time(S){this.audio&&(this.audio.currentTime=S)}get duration(){return this.audio?Math.floor(this.audio.duration):100}rate(){this.audio&&(console.log(this.audio.playbackRate),this.audio.playbackRate=2==this.audio.playbackRate?1:2)}static{this.\u0275fac=function(g){return new(g||B)}}static{this.\u0275prov=a.jDH({token:B,factory:B.\u0275fac,providedIn:"root"})}}return B})()},5794:(Me,F,f)=>{"use strict";f.d(F,{p:()=>E});var i=f(10467),a=f(54438),x=f(34635),B=f(22312);class m{constructor(){this.data={}}save(M,_,j){const P=j?Date.now()+j:1/0;this.data[M]={value:_,expiration:P}}read(M){const _=this.data[M];return _?_.expiration{class R{constructor(){var _=this;this.identity=(0,a.WQX)(x.K),this.connection=(0,a.WQX)(g.K),this.current=(0,a.vPA)({did:"",name:"",title:"",bio:"",profileImage:"",profileBanner:"",status:"",location:"",links:[],birthDate:""}),this.selected=(0,a.vPA)({did:"",name:"",title:"",bio:"",profileImage:"",profileBanner:"",status:"",location:"",links:[],birthDate:""}),this.avatar=(0,a.vPA)(null),this.avatarSelected=(0,a.vPA)(null),this.cache=new m,(0,a.QZP)((0,i.A)(function*(){_.identity.initialized()&&_.identity.activeIdentity()&&(console.log("Active account found, loading profile...",_.identity.did),_.openCurrentUserProfile(_.identity.did))}))}loadProfile(_){var j=this;return(0,i.A)(function*(){let P=j.cache.read(_);if(P)return P;const k=yield j.identity.web5.dwn.records.query({message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"profile",dataFormat:"application/json"}}});let z={};k.records&&k.records.length>0?(console.log(`Found local copy of profile. Only picking the first one of ${k.records.length} found.`),z={profile:yield k.records[0].data.json(),record:k.records[0]},j.loadProfileRemote(_)):z=yield j.loadProfileRemote(_);const W=yield j.loadAvatar(_),V=!!j.connection.friends().find(Z=>Z.data.did==_);return P={record:z.record,avatarRecord:W.avatarRecord,avatar:W.avatar,profile:z.profile,did:_,friend:V},j.cache.save(_,P,S.PROFILE),P})()}loadAvatar(_){var j=this;return(0,i.A)(function*(){var P=null,k=null;const z=yield j.identity.web5.dwn.records.query({message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"avatar",dataFormat:"image/jpeg"}}});if(z.records&&z.records.length>0){console.log(`Found avatar for user. Selecting the first of ${z.records.length} found.`);const W=z.records[0];k=yield W.data.text();let Z=j.cache.read(_);Z&&(Z.avatarRecord=W,Z.avatar=k),j.loadAvatarRemote(_)}else{const W=yield j.loadAvatarRemote(_);k=W.avatar,P=W.avatarRecord}return{avatar:k,avatarRecord:P}})()}loadAvatarRemote(_){var j=this;return(0,i.A)(function*(){var P=null,k=null;const z=yield j.identity.web5.dwn.records.query({from:_,message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"avatar",dataFormat:"image/jpeg"}}});if(z.records&&z.records.length>0){const W=z.records[0];W.import(),P=W,k=yield W.data.text();let Z=j.cache.read(_);Z&&(Z.avatar=k,Z.avatarRecord=P)}return{avatar:k,avatarRecord:P}})()}loadProfileRemote(_){var j=this;return(0,i.A)(function*(){console.log("Loading remote profile:",_);const P=yield j.identity.web5.dwn.records.query({from:_,message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"profile",dataFormat:"application/json"}}});let k={},z=null;if(P.records&&P.records.length>0){console.log(`Found a profile remotely. Selecting the first of ${P.records.length} found. Importing it to local DWN.`),z=P.records[0];let W=yield z.data.json();k={profile:W,record:z};let V=j.cache.read(_);V&&(V.profile=W,V.record=z),z.import()}else console.log(`No profile found for user. Returning empty result for ${_}`);return k})()}openCurrentUserProfile(_){var j=this;return(0,i.A)(function*(){console.log("Open current user profile",_);const P=yield j.loadProfile(_);j.avatar.set(P.avatar),j.current.set(P.profile)})()}openProfile(_){var j=this;return(0,i.A)(function*(){console.log("Open profile",_);const P=yield j.loadProfile(_);j.avatarSelected.set(P.avatar),j.selected.set(P.profile),_==j.identity.did&&(j.avatar.set(P.avatar),j.current.set(P.profile))})()}static{this.\u0275fac=function(j){return new(j||R)}}static{this.\u0275prov=a.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}}return R})()},88020:(Me,F,f)=>{"use strict";f.d(F,{w:()=>ye});var i=f(10467),a=f(54438),x=f(4053),B=f(77949),m=f(45189),S=f(49245),g=f(62060),E=f(67136),R=f(1639),M=f(69371),_=f(2685),j=f(69314),P=f(97372),k=f(70669),z=f(50963),W=f(68530),V=f(5397),Z=f(29508),q=f(32794);const re={protocol:"https://vc-to-dwn.tbddev.org/vc-protocol",published:!0,types:{credential:{schema:"https://vc-to-dwn.tbddev.org/vc-protocol/schema/credential",dataFormats:["application/vc+jwt"]},issuer:{schema:"https://vc-to-dwn.tbddev.org/vc-protocol/schema/issuer",dataFormats:["text/plain"]},judge:{schema:"https://vc-to-dwn.tbddev.org/vc-protocol/schema/judge",dataFormats:["text/plain"]}},structure:{issuer:{$role:!0},judge:{$role:!0},credential:{$actions:[{role:"issuer",can:["create"]},{role:"judge",can:["query","read","subscribe"]}]}}},te={published:!0,protocol:"https://schema.ariton.app/name",types:{name:{dataFormats:["application/json"]},admin:{schema:"https://schema.ariton.app/name/admin",dataFormats:["application/json"]}},structure:{name:{admin:{$role:!0},$actions:[{role:"name/admin",can:["create","read","update","query","subscribe","co-update","co-delete"]}]}}};var ie=f(34635),ae=f(95416),me=f(59564);let ye=(()=>{class ue{constructor(){this.identityService=(0,a.WQX)(ie.K),this.admin=(0,a.WQX)(me.z),this.snackBar=(0,a.WQX)(ae.UG)}register(o){var h=this;return(0,i.A)(function*(){let A=[j.Q,x.Q,B.Q,m.Q,S.Q,g.Q,E.Q,R.Q,M.Q,_.Q,P.Q,k.Q,z.Q,W.Q,V.Q,Z.Q,q.Q,re];h.admin.isOwner(h.identityService.did)&&(A=[...A,te]),h.admin.isAdmin(h.identityService.did)&&(A=[...A]);for(const I of A){const{protocol:O,status:$}=yield o.dwn.protocols.configure({message:{definition:I}});202!==$.code&&(console.error("Failed to install protocol:",$,O),h.snackBar.open(`Failed to install protocol. Code: ${$.code}, Protocol: ${I.protocol}`,"Close",{duration:1e3})),yield O?.send(h.identityService.did)}console.log("Protocols installed.")})()}static{this.\u0275fac=function(h){return new(h||ue)}}static{this.\u0275prov=a.jDH({token:ue,factory:ue.\u0275fac,providedIn:"root"})}}return ue})()},51889:(Me,F,f)=>{"use strict";f.d(F,{k:()=>R});var i=f(54438),a=f(89417),x=f(88834),B=f(65571),m=f(75351),S=f(99213),g=f(68314),E=f(26703);let R=(()=>{class M{constructor(j){this.data=j,this.qrStyle="did",this.qrValue="",this.util=(0,i.WQX)(E.Q)}ngAfterViewInit(){this.generateQR(this.data.did)}copyValue(){this.util.copyToClipboard(this.qrValue)}generateQR(j){this.qrValue=j;const P=document.querySelector("canvas");g.mo(P,j,{width:256},k=>{k&&console.error("Error generating QR code: ",k)})}onToggleGroupChange(j){this.generateQR("profile"==this.qrStyle?`https://profile.ariton.app/?did=${this.data.did}`:this.data.did)}static{this.\u0275fac=function(P){return new(P||M)(i.rXU(m.Vh))}}static{this.\u0275cmp=i.VBU({type:M,selectors:[["app-qrcode-dialog"]],standalone:!0,features:[i.aNF],decls:19,vars:3,consts:[["qrCanvas",""],["mat-dialog-title",""],[1,"qr-code-content","centered-dialog-content"],["hideSingleSelectionIndicator","true",3,"ngModelChange","change","ngModel"],["value","did"],["value","profile"],[1,"wrap"],["matTooltip","Copy the identifier","mat-icon-button","",1,"copy-button",3,"click"],["align","end"],["mat-button","","cdkFocusInitial","",3,"mat-dialog-close"]],template:function(P,k){if(1&P){const z=i.RV6();i.j41(0,"h2",1),i.EFF(1,"QR Code"),i.k0s(),i.j41(2,"mat-dialog-content",2),i.nrm(3,"canvas",null,0)(5,"br"),i.j41(6,"mat-button-toggle-group",3),i.mxI("ngModelChange",function(V){return i.eBV(z),i.DH7(k.qrStyle,V)||(k.qrStyle=V),i.Njj(V)}),i.bIt("change",function(V){return i.eBV(z),i.Njj(k.onToggleGroupChange(V))}),i.j41(7,"mat-button-toggle",4),i.EFF(8,"Identifier (in-app)"),i.k0s(),i.j41(9,"mat-button-toggle",5),i.EFF(10,"Profile URL (camera)"),i.k0s()(),i.j41(11,"p",6),i.EFF(12),i.j41(13,"button",7),i.bIt("click",function(){return i.eBV(z),i.Njj(k.copyValue())}),i.j41(14,"mat-icon"),i.EFF(15,"content_copy"),i.k0s()()()(),i.j41(16,"mat-dialog-actions",8)(17,"button",9),i.EFF(18,"Close"),i.k0s()()}2&P&&(i.R7$(6),i.R50("ngModel",k.qrStyle),i.R7$(6),i.SpI(" ",k.qrValue," "),i.R7$(5),i.Y8G("mat-dialog-close",!0))},dependencies:[m.hM,m.tx,m.BI,m.E7,m.Yi,x.Hl,x.$z,x.iY,B.Vg,B.ec,B.pc,a.YN,a.BC,a.vS,S.m_,S.An],styles:[".qr-code-content[_ngcontent-%COMP%]{margin:0;padding:2em}"]})}}return M})()},98703:(Me,F,f)=>{"use strict";f.d(F,{g:()=>a});var i=f(54438);let a=(()=>{class x{transform(m,S){if(m){const g=Math.floor((+new Date-+new Date(m))/1e3);if(g<29)return"Just now";const E={year:31536e3,month:2592e3,week:604800,day:86400,hour:3600,minute:60,second:1};let R;for(const M in E)if(R=Math.floor(g/E[M]),R>0)return 1===R?R+" "+M+" ago":R+" "+M+"s ago"}return m}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"ago",type:x,pure:!0,standalone:!0})}}return x})()},33347:(Me,F,f)=>{"use strict";f.d(F,{k:()=>a});var i=f(54438);let a=(()=>{class x{transform(m,S){if(m){const g=m.lastIndexOf(":");if(-1!==g){const E=m.slice(0,g+1),R=m.slice(g+1);return E+R.slice(0,5)+"..."+R.slice(-5)}return m.slice(0,5)+"..."+m.slice(-5)}return m}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"did",type:x,pure:!0,standalone:!0})}}return x})()},78013:(Me,F,f)=>{"use strict";f.d(F,{d:()=>x});var i=f(54438),a=f(345);let x=(()=>{class B{constructor(S){this.sanitizer=S}transform(S){return this.sanitizer.bypassSecurityTrustResourceUrl(S)}static{this.\u0275fac=function(g){return new(g||B)(i.rXU(a.up,16))}}static{this.\u0275pipe=i.EJ8({name:"safeResourceUrl",type:B,pure:!0,standalone:!0})}}return B})()},28741:(Me,F,f)=>{"use strict";f.d(F,{M:()=>a});var i=f(54438);let a=(()=>{class x{transform(m,S){if(null==m)return"";if(0===m)return"0 Bytes";const R=Math.floor(Math.log(m)/Math.log(1024));return parseFloat((m/Math.pow(1024,R)).toFixed(2))+" "+["Bytes","KB","MB","GB","TB","PB"][R]}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"size",type:x,pure:!0,standalone:!0})}}return x})()},43794:(Me,F,f)=>{"use strict";f.d(F,{n:()=>B});var i=f(10467),a=f(54438),x=f(34635);let B=(()=>{class m{constructor(){this.identity=(0,a.WQX)(x.K)}save(g,E,R,M=!1){var _=this;return(0,i.A)(function*(){const{record:j,status:P}=yield _.identity.web5.dwn.records.create({data:E,message:{published:M,tags:R,protocol:g.protocol,protocolPath:g.protocolPath,schema:g.schema,dataFormat:g.dataFormat}});if(202!==P.code)throw new Error(`Failed to save data (${P.code}): ${P.detail}`);return{data:E,id:j.id,record:j}})()}load(g,E){var R=this;return(0,i.A)(function*(){var{records:M}=yield R.identity.web5.dwn.records.query({message:{filter:{tags:E,protocol:g.protocol,schema:g.schema,dataFormat:g.dataFormat}}});if(!M||0===M.length)return[];const _=[];for(const j of M){let P=yield j.data.json();_.push({record:j,data:P,id:j.id})}return _})()}get(g){var E=this;return(0,i.A)(function*(){var{record:R,status:M}=yield E.identity.web5.dwn.records.read({message:{filter:{recordId:g}}});if(200!==M.code)throw new Error(`Failed to get data (${M.code}): ${M.detail}`);return{data:yield R.data.json(),id:R.id,record:R}})()}update(g,E,R,M=!1){return(0,i.A)(function*(){const{status:_}=yield g.update({published:M,data:E,tags:R});if(202!==_.code)throw new Error(`Failed to save data (${_.code}): ${_.detail}`);return{data:E,id:g.id,record:g}})()}delete(g){return(0,i.A)(function*(){const{status:E}=yield g.delete();if(202!==E.code)throw new Error(`Failed to delete data (${E.code}): ${E.detail}`)})()}static{this.\u0275fac=function(E){return new(E||m)}}static{this.\u0275prov=a.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},26703:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>B});var i=f(10467),a=f(54438),x=f(95416);let B=(()=>{class m{constructor(){this.snackBar=(0,a.WQX)(x.UG)}executeAsyncWithToast(g,E,R){var M=this;return(0,i.A)(function*(){try{yield g,E&&M.openSnackBar(E)}catch(_){M.openSnackBar(R||`Error: ${_}.`)}})()}openSnackBar(g){this.snackBar.open(g,void 0,{duration:2e3})}backupAccount({portableIdentity:g}={}){return(0,i.A)(function*(){if(g){const E=new Blob([JSON.stringify(g)],{type:"application/json"}),R=URL.createObjectURL(E),M=document.createElement("a");M.href=R,M.download="portableIdentity.json",document.body.appendChild(M),M.click(),document.body.removeChild(M),URL.revokeObjectURL(R)}})()}copyToClipboard(g){var E=this;return(0,i.A)(function*(){try{yield navigator.clipboard.writeText(g),E.snackBar.open("Copied to clipboard",void 0,{duration:2e3})}catch(R){console.error("Failed to copy: ",R)}})()}static{this.\u0275fac=function(E){return new(E||m)}}static{this.\u0275prov=a.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},12621:(Me,F,f)=>{"use strict";f.d(F,{hX:()=>Z});var i=f(10467),a=f(4080),x=f(42512),B=f(80785),m=f(70285),S=f(68989);const E={ed25519PublicKey:48,ed25519SecretSeed:144,med25519PublicKey:96,preAuthTx:152,sha256Hash:184,signedPayload:120,contract:16},R={G:"ed25519PublicKey",S:"ed25519SecretSeed",M:"med25519PublicKey",T:"preAuthTx",X:"sha256Hash",P:"signedPayload",C:"contract"};class M{static encodeEd25519PublicKey(te){return P("ed25519PublicKey",te)}static decodeEd25519PublicKey(te){return j("ed25519PublicKey",te)}static isValidEd25519PublicKey(te){return _("ed25519PublicKey",te)}static encodeEd25519SecretSeed(te){return P("ed25519SecretSeed",te)}static decodeEd25519SecretSeed(te){return j("ed25519SecretSeed",te)}static isValidEd25519SecretSeed(te){return _("ed25519SecretSeed",te)}static encodeMed25519PublicKey(te){return P("med25519PublicKey",te)}static decodeMed25519PublicKey(te){return j("med25519PublicKey",te)}static isValidMed25519PublicKey(te){return _("med25519PublicKey",te)}static encodePreAuthTx(te){return P("preAuthTx",te)}static decodePreAuthTx(te){return j("preAuthTx",te)}static encodeSha256Hash(te){return P("sha256Hash",te)}static decodeSha256Hash(te){return j("sha256Hash",te)}static encodeSignedPayload(te){return P("signedPayload",te)}static decodeSignedPayload(te){return j("signedPayload",te)}static isValidSignedPayload(te){return _("signedPayload",te)}static encodeContract(te){return P("contract",te)}static decodeContract(te){return j("contract",te)}static isValidContract(te){return _("contract",te)}static getVersionByteForPrefix(te){return R[te[0]]}}function _(re,te){if("string"!=typeof te)return!1;switch(re){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":if(56!==te.length)return!1;break;case"med25519PublicKey":if(69!==te.length)return!1;break;case"signedPayload":if(te.length<56||te.length>165)return!1;break;default:return!1}let ie="";try{ie=j(re,te).toString()}catch{return!1}switch(re){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":return 32===ie.length;case"med25519PublicKey":return 40===ie.length;case"signedPayload":return ie.length>=40&&ie.length<=100;default:return!1}}function j(re,te){if("string"!=typeof te)throw new TypeError("encoded argument must be of type String");const ie=S.decode(te),ae=ie[0],me=ie.slice(0,-2),ye=me.slice(1),ue=ie.slice(-2);if(te!==S.encode(ie))throw new Error("invalid encoded string");const K=E[re];if(void 0===K)throw new Error(`${re} is not a valid version byte name. Expected one of ${Object.keys(E).join(", ")}`);if(ae!==K)throw new Error(`invalid version byte. expected ${K}, got ${ae}`);if(!function g(re,te){if(re.length!==te.length)return!1;if(0===re.length)return!0;for(let ie=0;ie>8^re[me]],ie&=65535;const ae=new Uint8Array(2);return ae[0]=255&ie,ae[1]=ie>>8&255,ae}const W={Ed25519VerificationKey2020:"https://w3id.org/security/suites/ed25519-2020/v1",JsonWebKey2020:"https://w3id.org/security/suites/jws-2020/v1",X25519KeyAgreementKey2020:"https://w3id.org/security/suites/x25519-2020/v1"};let Z=(()=>{class re extends B.TI{static{this.methodName="stellar"}static create({keyManager:ie=new x.eP,options:ae={}}={}){return(0,i.A)(function*(){if(ae.algorithm&&ae.verificationMethods)throw new Error("The 'algorithm' and 'verificationMethods' options are mutually exclusive");if(ae.verificationMethods&&1!==ae.verificationMethods.length)throw new Error("The 'verificationMethods' option must contain exactly one entry");const me=ae.algorithm??ae.verificationMethods?.[0]?.algorithm??"Ed25519",ye=yield ie.generateKey({algorithm:me}),ue=yield ie.getPublicKey({keyUri:ye}),K=yield x.Mc.publicKeyToBytes({publicKey:ue}),o=M.encodeEd25519PublicKey(K),h=`did:${re.methodName}:${o}`,I=(yield re.resolve(h,ae)).didDocument;return new B.tW({uri:h,document:I,metadata:{},keyManager:ie})})()}static create2({keyManager:ie=new x.eP,options:ae={}}={}){return(0,i.A)(function*(){if(ae.algorithm&&ae.verificationMethods)throw new Error("The 'algorithm' and 'verificationMethods' options are mutually exclusive");if(ae.verificationMethods&&1!==ae.verificationMethods.length)throw new Error("The 'verificationMethods' option must contain exactly one entry");const me=ae.algorithm??ae.verificationMethods?.[0]?.algorithm??"Ed25519",ye=ie,ue=yield ie.generateKey({algorithm:me}),o=(yield ie.getPublicKey({keyUri:ue}),yield ye.exportKey({keyUri:ue}));console.log("privateKey",o);const A="GCFXHS4GXL6BVUCXBWXGTITROWLVYXQKQLF4YH5O5JT3YZXCYPAFBJZB",I=M.decodeEd25519SecretSeed("SAV76USXIJOBMEQXPANUOQM6F5LIOTLPDIDVRJBFFE2MDJXG24TAPUU7"),O=yield x.Mc.bytesToPrivateKey({privateKeyBytes:I});console.log("privateKeyJwk",O);const $=yield x.Mc.getPublicKey({key:O});console.log("publicKeyJwk",$);const H=yield x.Mc.publicKeyToBytes({publicKey:$}),D=M.encodeEd25519PublicKey(H);O.kid=D;const s=yield ye.getKeyUri({key:O});s===(yield ye.getKeyUri({key:$}))&&console.log("Yipppppi!!");const Y=yield ye.importKey({key:O});console.log("Import result: ",Y),(yield ye.exportKey({keyUri:s})).d==O.d&&console.log("Yipppppi!! PRIVATE KEY SAME!"),A==D?console.log("CORRECT!!!!"):console.warn("NO!!!!!!"),O.kid=yield(0,x.BA)({jwk:o}),O.kid=D,console.log("IDENTIFIER3: ",D),A==D?console.log("CORRECT!!!!"):console.warn("NO!!!!!!");let oe=yield q.keyConverter(o.crv).privateKeyToBytes({privateKey:o});console.log("privateKeyBytes",oe),console.log("Secret: ",M.encodeEd25519SecretSeed(oe));const de=`did:${re.methodName}:${D}`,Ie=(yield re.resolve(de,ae)).didDocument;return new B.tW({uri:de,document:Ie,metadata:{},keyManager:ie})})()}static fromPrivateKey({keyManager:ie=new x.eP,privateKey:ae}){return(0,i.A)(function*(){const me=M.decodeEd25519SecretSeed(ae),ye=yield x.Mc.bytesToPrivateKey({privateKeyBytes:me}),ue=yield ie.importKey({key:ye}),K=yield ie.getPublicKey({keyUri:ue}),o=yield x.Mc.publicKeyToBytes({publicKey:K}),h=M.encodeEd25519PublicKey(o),A=`did:${re.methodName}:${h}`,I=yield re.resolve(A,{});return console.log("didResolutionResult",I),new B.tW({uri:A,document:I.didDocument,metadata:{},keyManager:ie})})()}static getSigningMethod({didDocument:ie}){var ae=this;return(0,i.A)(function*(){const me=B.yR.parse(ie.id);if(me&&me.method!==ae.methodName)throw new B.WK(B.F8.MethodNotSupported,`Method not supported: ${me.method}`);const[ye]=ie.assertionMethod||[],ue=ie.verificationMethod?.find(K=>K.id===ye);if(!ue||!ue.publicKeyJwk)throw new B.WK(B.F8.InternalError,"A verification method intended for signing could not be determined from the DID Document");return ue})()}static import({portableDid:ie,keyManager:ae=new x.eP}){return(0,i.A)(function*(){if(B.yR.parse(ie.uri)?.method!==re.methodName)throw new B.WK(B.F8.MethodNotSupported,"Method not supported");const ye=yield B.tW.import({portableDid:ie,keyManager:ae});if(1!==ye.document.verificationMethod.length)throw new B.WK(B.F8.InvalidDidDocument,"DID document must contain exactly one verification method");return ye})()}static resolve(ie,ae){return(0,i.A)(function*(){try{const me=yield re.createDocument({didUri:ie,options:ae});return{...B.zh,didDocument:me}}catch(me){if(!(me instanceof B.WK))throw new Error(me);return{...B.zh,didResolutionMetadata:{error:me.code,...me.message&&{errorMessage:me.message}}}}})()}static createDocument({didUri:ie,options:ae={}}){return(0,i.A)(function*(){const{defaultContext:me="https://www.w3.org/ns/did/v1"}=ae,ye={id:ie},ue=B.yR.parse(ie);if(!ue)throw new B.WK(B.F8.InvalidDid,`Invalid DID URI: ${ie}`);const o=M.decodeEd25519PublicKey(ue.id),h=yield x.Mc.bytesToPublicKey({publicKeyBytes:o});if(ue.method!==re.methodName)throw new B.WK(B.F8.MethodNotSupported,`Method not supported: ${ue.method}`);if(!re.validateIdentifier(ue))throw new B.WK(B.F8.InvalidDid,`Invalid DID URI: ${ie}`);const I={id:`${ye.id}#0`,type:"JsonWebKey",controller:ye.id,publicKeyJwk:h};ye.id=ue.uri,ye.verificationMethod=[I],ye.authentication=[I.id],ye.assertionMethod=[I.id],ye.capabilityInvocation=[I.id],ye.capabilityDelegation=[I.id],ye.keyAgreement=[I.id];const O=[me];return(0,m.getVerificationMethodTypes)({didDocument:ye}).forEach(H=>{O.push(W[H])}),ye["@context"]=O,ye.service=[{id:"dwn",type:"DecentralizedWebNode",serviceEndpoint:["https://dwn.tbddev.org/beta"]}],ye})()}static deriveEncryptionKey({multibaseValue:ie}){return(0,i.A)(function*(){let ae={keyBytes:new Uint8Array,multicodecCode:0};const{keyBytes:me,multicodecCode:ye}=(0,m.multibaseIdToKeyBytes)({multibaseKeyId:ie});if(237===ye){const ue=yield q.keyConverter("Ed25519").bytesToPublicKey({publicKeyBytes:me}),K=yield x.Mc.convertPublicKeyToX25519({publicKey:ue});ae={keyBytes:yield q.keyConverter("Ed25519").publicKeyToBytes({publicKey:K}),multicodecCode:236}}return ae})()}static validateIdentifier(ie){const{method:ae,id:me}=ie,[ye]=ie.uri.split(":",1);return"did"===ye&&"stellar"===ae&&Number("1")>0&&"String"===(0,a.fc)(me)&&me.startsWith("G")}}return re})(),q=(()=>{class re{static{this.JWK_TO_MULTICODEC={"Ed25519:public":"ed25519-pub","Ed25519:private":"ed25519-priv","secp256k1:public":"secp256k1-pub","secp256k1:private":"secp256k1-priv","X25519:public":"x25519-pub","X25519:private":"x25519-priv"}}static{this.MULTICODEC_PUBLIC_KEY_LENGTH={231:33,236:32,237:32}}static{this.MULTICODEC_TO_JWK={"ed25519-pub":{crv:"Ed25519",kty:"OKP",x:""},"ed25519-priv":{crv:"Ed25519",kty:"OKP",x:"",d:""},"secp256k1-pub":{crv:"secp256k1",kty:"EC",x:"",y:""},"secp256k1-priv":{crv:"secp256k1",kty:"EC",x:"",y:"",d:""},"x25519-pub":{crv:"X25519",kty:"OKP",x:""},"x25519-priv":{crv:"X25519",kty:"OKP",x:"",d:""}}}static keyCompressor(ie){const me={"P-256":x.iH.compressPublicKey,secp256k1:x.jg.compressPublicKey}[ie];if(!me)throw new B.WK(B.F8.InvalidPublicKeyType,`Unsupported curve: ${ie}`);return me}static keyConverter(ie){const me={Ed25519:x.Mc,"P-256":x.iH,secp256k1:x.jg,X25519:x.Nx}[ie];if(!me)throw new B.WK(B.F8.InvalidPublicKeyType,`Unsupported curve: ${ie}`);return me}}return re})()},70236:(Me,F,f)=>{"use strict";var i=f(345),a=f(54438),x=f(30046),B=f(10467),m=f(96084),S=f(36815),g=f(34635),E=f(97372),R=f(60177),M=f(89417),_=f(88834),j=f(75351),P=f(99213),k=f(99631),z=f(59115),W=f(14823),V=f(53719);let Z=(()=>{class y{constructor(l,w){this.dialogRef=l,this.data=w,this.fb=(0,a.WQX)(M.ok),this.form=this.fb.group({name:[null,M.k0.required]})}ngAfterViewInit(){}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(j.CP),a.rXU(j.Vh))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-folder-dialog"]],standalone:!0,features:[a.aNF],decls:10,vars:2,consts:[["mat-dialog-title",""],["appearance","outline",1,"full-width"],["matInput","","cdkFocusInitial","","required","true","placeholder","Name","maxlength","200",3,"ngModelChange","ngModel"],["align","end"],["mat-button","","mat-dialog-close",""],["mat-flat-button","","type","submit",3,"mat-dialog-close"]],template:function(w,U){1&w&&(a.j41(0,"h2",0),a.EFF(1,"Folder name"),a.k0s(),a.j41(2,"mat-dialog-content")(3,"mat-form-field",1)(4,"input",2),a.mxI("ngModelChange",function(ce){return a.DH7(U.data.name,ce)||(U.data.name=ce),ce}),a.k0s()()(),a.j41(5,"mat-dialog-actions",3)(6,"button",4),a.EFF(7,"Cancel"),a.k0s(),a.j41(8,"button",5),a.EFF(9,"Save"),a.k0s()()),2&w&&(a.R7$(4),a.R50("ngModel",U.data.name),a.R7$(4),a.Y8G("mat-dialog-close",!0))},dependencies:[R.MD,W.uc,z.Cn,P.m_,_.Hl,_.$z,k.fS,k.fg,V.rl,j.hM,j.tx,j.BI,j.E7,j.Yi,M.YN,M.me,M.BC,M.YS,M.tU,M.vS],styles:["form[_ngcontent-%COMP%]{display:inline}"]})}}return y})();var q=f(3902),re=f(98703),te=f(5964);let ie=(()=>{class y{constructor(l,w){this.router=l,this.activatedRoute=w,this.breadcrumbs=[],this.router.events.pipe((0,te.p)(U=>U instanceof x.wF)).subscribe(()=>{this.breadcrumbs=this.createBreadcrumbs(this.activatedRoute.root)})}createBreadcrumbs(l,w="",U=[]){const J=l.children;if(0===J.length)return U;for(const ce of J){const ge=ce.snapshot.url.map(Pe=>Pe.path).join("/");return""!==ge&&(w+=`/${ge}`),U.push({label:ce.snapshot.data.breadcrumb,url:w}),this.createBreadcrumbs(ce,w,U)}return U}static{this.\u0275fac=function(w){return new(w||y)(a.KVO(x.Ix),a.KVO(x.nX))}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})(),ae=(()=>{class y{constructor(){}registerActions(l){}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();var me=f(28741),ye=f(77494),ue=f(2042),K=f(9159),o=f(25596);function h(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",19),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.up())}),a.j41(1,"mat-icon"),a.EFF(2,"arrow_upward"),a.k0s()()}}function A(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",19),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.editFolder(null))}),a.j41(1,"mat-icon"),a.EFF(2,"create_new_folder"),a.k0s()()}}function I(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",21),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.editFolder(null))}),a.j41(1,"mat-icon"),a.EFF(2,"create_new_folder"),a.k0s(),a.j41(3,"span"),a.EFF(4,"New folder"),a.k0s()()}}function O(y,c){if(1&y&&a.DNE(0,A,3,0,"button",1)(1,I,5,0,"button",20),2&y){const l=a.XpG();a.vxM(l.layout.small()?0:1)}}function $(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",22),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.editFolderById(U.parentId))}),a.j41(1,"mat-icon"),a.EFF(2,"edit"),a.k0s()(),a.j41(3,"button",22),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.deleteFolder())}),a.j41(4,"mat-icon"),a.EFF(5,"delete_forever"),a.k0s()()}}function H(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",2),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.editFolderById(U.parentId))}),a.j41(1,"mat-icon"),a.EFF(2,"edit"),a.k0s(),a.j41(3,"span"),a.EFF(4,"Rename folder"),a.k0s()(),a.j41(5,"button",2),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.deleteFolder())}),a.j41(6,"mat-icon"),a.EFF(7,"delete_forever"),a.k0s(),a.j41(8,"span"),a.EFF(9,"Delete folder"),a.k0s()()}}function D(y,c){if(1&y&&a.DNE(0,$,6,0)(1,H,10,0),2&y){const l=a.XpG();a.vxM(l.layout.small()?0:1)}}function s(y,c){1&y&&a.nrm(0,"th",23)}function p(y,c){if(1&y){const l=a.RV6();a.j41(0,"td",24),a.bIt("click",function(){const U=a.eBV(l).$implicit,J=a.XpG();return a.Njj(J.openEntry(U))}),a.j41(1,"mat-icon",25),a.EFF(2),a.k0s()()}if(2&y){const l=c.$implicit;a.R7$(2),a.JRh(l.icon)}}function Y(y,c){1&y&&(a.j41(0,"th",26),a.EFF(1,"Name"),a.k0s())}function ee(y,c){if(1&y){const l=a.RV6();a.j41(0,"td",27),a.bIt("click",function(){const U=a.eBV(l).$implicit,J=a.XpG();return a.Njj(J.openEntry(U))}),a.EFF(1),a.k0s()}if(2&y){const l=c.$implicit;a.R7$(),a.JRh(l.name)}}function oe(y,c){1&y&&(a.j41(0,"th",28),a.EFF(1," Modified "),a.k0s())}function de(y,c){if(1&y&&(a.j41(0,"td",29),a.EFF(1),a.nI1(2,"ago"),a.k0s()),2&y){const l=c.$implicit;a.R7$(),a.SpI(" ",a.bMT(2,1,l.modified)," ")}}function Ae(y,c){1&y&&(a.j41(0,"th",30),a.EFF(1,"File size"),a.k0s())}function Ie(y,c){if(1&y&&(a.j41(0,"td",31),a.EFF(1),a.nI1(2,"size"),a.k0s()),2&y){const l=c.$implicit;a.R7$(),a.JRh(a.bMT(2,1,l.size))}}function Le(y,c){1&y&&a.nrm(0,"tr",32)}function xe(y,c){1&y&&a.nrm(0,"tr",33)}class De{constructor(c){this.icon="folder"==c.tags.entryType?"folder":"note",this.name=c.tags.name,this.modified="folder"===c.tags.entryType?c.dateModified:c.tags.lastModified,this.size=c.tags.size,this.type=c.tags.type,this.entryType=c.tags.entryType,this.record=c}}let Xe=(()=>{class y{constructor(){var l=this;this.entries=(0,a.vPA)([]),this.app=(0,a.WQX)(m.d),this.breadcrumb=(0,a.WQX)(ie),this.layout=(0,a.WQX)(S.Y),this.identity=(0,a.WQX)(g.K),this.dialog=(0,a.WQX)(j.bZ),this.router=(0,a.WQX)(x.Ix),this.route=(0,a.WQX)(x.nX),this.fileService=(0,a.WQX)(ae),this.uploadProgress=null,this.isUploading=!1,this.file=null,this.uploadSuccess=!1,this.fileError=null,this.protocolPath="entry",this.hasInitialized=!1,this.folderLevel=1,this.displayedColumns=["icon","name","modified","size"],this.dataSource=new K.I6([]),this.changeDetectorRefs=(0,a.WQX)(a.gRc),this.layout.resetActions(),(0,a.QZP)((0,B.A)(function*(){if(l.app.initialized()){if(l.hasInitialized)return;const w=l.getResolvedUrl(l.route.snapshot);yield l.processUrl(w)}}),{allowSignalWrites:!0}),(0,a.QZP)((0,B.A)(function*(){l.updateTable()})),this.routingSub=this.router.events.subscribe(function(){var w=(0,B.A)(function*(U){U instanceof x.wF&&(yield l.processUrl(U.urlAfterRedirects))});return function(U){return w.apply(this,arguments)}}()),this.layout.disableNavigation(),console.log("FOLDER COMPONENT INITIALIZED")}ngAfterViewInit(){this.dataSource.sort=this.sort}updateTable(){this.dataSource.data=this.entries().map(l=>new De(l))}up(){const w=this.router.url.split("/");if(w.length>1){w.pop();const U=w.join("/");this.router.navigate([U])}}sortData(l){}announceSortChange(l){}getValueAfterFolder(l){const w=l.match(/\/folder\/(.+)/);return w?w[1]:null}generateUrl(l){const w=[];for(let U=0;UJ.url.map(ce=>ce.toString()).join("/")).join("/");const U=l.queryParamMap;return U.keys.length>0&&(w+="?"+U.keys.map(J=>U.getAll(J).map(ce=>J+"="+ce).join("&")).join("&")),w}editFile(l){return(0,B.A)(function*(){document.getElementById("input")?.click()})()}ngOnDestroy(){console.log("ON DESTROY!!!);"),this.routingSub.unsubscribe(),this.layout.resetActions()}onFileSelected(l){var w=this;return(0,B.A)(function*(){const U=l.currentTarget.files;if(0!=U.length){console.log("Uploading number of files:",U.length);for(let J=0;J[..._t,ut])}}})()}cancelUpload(){return(0,B.A)(function*(){})()}upload(){var l=this;return(0,B.A)(function*(){console.log("Uploading file");const{status:w,record:U}=yield l.identity.web5.dwn.records.create({data:l.file,message:{schema:E.Q.types.entry.schema}});return console.log("Record created:",U),console.log("Record status:",w),U})()}deleteFolder(){var l=this;return(0,B.A)(function*(){const{record:w}=yield l.identity.web5.dwn.records.read({message:{filter:{recordId:l.parentId}}});if(w){const{status:U}=yield w.delete({prune:!0});console.log("Delete status:",U);const J=l.contextId.split("/").slice(0,-1);console.log("Parent path:",J),l.router.navigate(["app","files","folder",...J])}})()}editFolderById(l){var w=this;return(0,B.A)(function*(){const{record:U}=yield w.identity.web5.dwn.records.read({message:{filter:{recordId:l}}});yield w.editFolder(U)})()}editFolder(l){var w=this;return(0,B.A)(function*(){let U={name:l?l.tags.name:"",entryType:"folder"};const J=JSON.parse(JSON.stringify(U)),ce=w.dialog.open(Z,{maxWidth:"80vw",maxHeight:"80vh",data:U});return ce.afterClosed().subscribe(function(){var ge=(0,B.A)(function*(Pe){Pe?(console.log("data result for saving:",U),yield w.saveFolder(l,U)):U=J});return function(Pe){return ge.apply(this,arguments)}}()),ce.afterClosed()})()}saveFolder(l,w){var U=this;return(0,B.A)(function*(){if(l){const J={name:w.name,entryType:w.entryType},{status:ce}=yield l.update({tags:J,data:{}});console.log("Record status:",ce)}else{const J={tags:{name:w.name,entryType:w.entryType},protocol:E.Q.protocol,protocolPath:U.protocolPath,parentContextId:U.contextId??=void 0,schema:E.Q.types.entry.schema};console.log("Create folder:",J);const{record:ce,status:ge}=yield U.identity.web5.dwn.records.create({data:{},message:J});console.log("Record created:",ce),console.log("Record status:",ge),ce&&U.entries.update(Pe=>[...Pe,ce])}})()}openEntry(l){var w=this;return(0,B.A)(function*(){console.log(l),w.router.navigate("folder"===l.entryType?["/app/files/folder/"+l.record.contextId]:["/app/files/file/"+l.record.id])})()}loadEntries(l){var w=this;return(0,B.A)(function*(){console.log("VALUE OF TAGS:",l),console.log("PARENT ID:",w.parentId),console.log("PARENT CONTEXT ID:",w.contextId);const U={filter:{protocolPath:w.protocolPath,protocol:E.Q.protocol,schema:E.Q.types.entry.schema},dateSort:ye.U0.CreatedDescending};w.parentId&&"root"!==w.parentId&&(U.filter.parentId=w.parentId),console.log(U);var{records:J}=yield w.identity.web5.dwn.records.query({message:U});w.entries.set(J??[]),console.log("All entries:",w.entries())})()}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-folder"]],viewQuery:function(w,U){if(1&w&&a.GBs(ue.B4,5),2&w){let J;a.mGM(J=a.lsd())&&(U.sort=J.first)}},standalone:!0,features:[a.aNF],decls:26,vars:6,consts:[[1,"toolbar-actions","margin-bottom"],["mat-icon-button","",1,"toolbar-icon-button"],["type","button","mat-button","",3,"click"],["type","file","id","input","multiple","",2,"display","none",3,"change"],["mat-table","","matSort","",3,"matSortChange","dataSource"],["matColumnDef","icon"],["mat-header-cell","","mat-sort-header","","class","icon-column",4,"matHeaderCellDef"],["mat-cell","","class","clickable icon-column",3,"click",4,"matCellDef"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by name",4,"matHeaderCellDef"],["mat-cell","","class","clickable",3,"click",4,"matCellDef"],["matColumnDef","modified"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by modified","class","hide-on-small-screen",4,"matHeaderCellDef"],["mat-cell","","class","hide-on-small-screen",4,"matCellDef"],["matColumnDef","size"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by file size",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-icon-button","",1,"toolbar-icon-button",3,"click"],["mat-button",""],["mat-button","",3,"click"],["type","button","mat-icon-button","",1,"toolbar-icon-button",3,"click"],["mat-header-cell","","mat-sort-header","",1,"icon-column"],["mat-cell","",1,"clickable","icon-column",3,"click"],["matListItemIcon",""],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by name"],["mat-cell","",1,"clickable",3,"click"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by modified",1,"hide-on-small-screen"],["mat-cell","",1,"hide-on-small-screen"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by file size"],["mat-cell",""],["mat-header-row",""],["mat-row",""]],template:function(w,U){1&w&&(a.j41(0,"mat-card",0)(1,"mat-card-content"),a.DNE(2,h,3,0,"button",1),a.j41(3,"button",2),a.bIt("click",function(){return U.editFile({})}),a.j41(4,"mat-icon"),a.EFF(5,"upload_file"),a.k0s(),a.j41(6,"span"),a.EFF(7,"Upload files"),a.k0s()(),a.DNE(8,O,2,1)(9,D,2,1),a.k0s()(),a.j41(10,"input",3),a.bIt("change",function(ce){return U.onFileSelected(ce)}),a.k0s(),a.j41(11,"table",4),a.bIt("matSortChange",function(ce){return U.sortData(ce)}),a.qex(12,5),a.DNE(13,s,1,0,"th",6)(14,p,3,1,"td",7),a.bVm(),a.qex(15,8),a.DNE(16,Y,2,0,"th",9)(17,ee,2,1,"td",10),a.bVm(),a.qex(18,11),a.DNE(19,oe,2,0,"th",12)(20,de,3,3,"td",13),a.bVm(),a.qex(21,14),a.DNE(22,Ae,2,0,"th",15)(23,Ie,3,3,"td",16),a.bVm(),a.DNE(24,Le,1,0,"tr",17)(25,xe,1,0,"tr",18),a.k0s()),2&w&&(a.R7$(2),a.vxM(U.folderLevel>1?2:-1),a.R7$(6),a.vxM(U.folderLevel<4?8:-1),a.R7$(),a.vxM(U.folderLevel>1?9:-1),a.R7$(2),a.Y8G("dataSource",U.dataSource),a.R7$(13),a.Y8G("matHeaderRowDef",U.displayedColumns),a.R7$(),a.Y8G("matRowDefColumns",U.displayedColumns))},dependencies:[o.Hu,o.RN,o.m2,_.Hl,_.$z,_.iY,K.tP,K.Zl,K.tL,K.ji,K.cC,K.YV,K.iL,K.KS,K.$R,K.YZ,K.NB,ue.NQ,ue.B4,ue.aE,me.M,R.MD,q.Fg,q.ZV,P.m_,P.An,re.g],styles:["table[_ngcontent-%COMP%]{width:100%}.icon-column[_ngcontent-%COMP%]{width:36px;max-width:36px;min-width:36px}@media (max-width: 600px){.hide-on-small-screen[_ngcontent-%COMP%]{display:none}}"]})}}return y})();var Te=function(y){return y.PDF="application/pdf",y.JPEG="image/jpeg",y.PNG="image/png",y.MP4="video/mp4",y.MP3="audio/mpeg",y}(Te||{});const ke=["*"],Se=y=>({transform:y});function Ee(y,c){if(1&y&&(a.j41(0,"div",1),a.nrm(1,"iframe",2),a.k0s()),2&y){const l=a.XpG();a.R7$(),a.Y8G("ngStyle",a.eq3(2,Se,"scale("+l.zoom+")"))("src",l.src,a.f$h)}}function ve(y,c){if(1&y&&a.nrm(0,"iframe",2),2&y){const l=a.XpG();a.Y8G("ngStyle",a.eq3(2,Se,"scale("+l.zoom+")"))("src",l.src,a.f$h)}}function Ce(y,c){if(1&y&&a.nrm(0,"iframe",2),2&y){const l=a.XpG();a.Y8G("ngStyle",a.eq3(2,Se,"scale("+l.zoom+")"))("src",l.src,a.f$h)}}function Re(y,c){if(1&y&&(a.j41(0,"video",3),a.nrm(1,"source",5),a.EFF(2," Your browser does not support HTML5 video. "),a.k0s()),2&y){const l=a.XpG();a.Y8G("ngStyle",a.eq3(2,Se,"scale("+l.zoom+")")),a.R7$(),a.Y8G("src",l.src,a.B4B)}}function Ye(y,c){if(1&y&&(a.j41(0,"audio",4),a.nrm(1,"source",6),a.EFF(2," Your browser does not support the audio element. "),a.k0s()),2&y){const l=a.XpG();a.Y8G("ngStyle",a.eq3(2,Se,"scale("+l.zoom+")")),a.R7$(),a.Y8G("src",l.src,a.B4B)}}function $e(y,c){1&y&&(a.j41(0,"span",null,0),a.SdG(2),a.k0s())}let nt=(()=>{class y{ngAfterViewInit(){const l=document.getElementById("frame");if(l&&l.contentDocument){const w=document.createElement("style");w.textContent="\n body {\n background-color: #f0f0f0;\n margin: 0;\n padding: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n ",l.contentDocument.head.appendChild(w)}}ngOnInit(){this.totalPages=this.getPdfTotalPages()}goToPage(){this.currentPage<1?this.currentPage=1:this.currentPage>this.totalPages&&(this.currentPage=this.totalPages)}constructor(){this.fileMimeType=Te,this.zoom=1,this.currentPage=1,this.totalPages=1,this.totalPages=this.getPdfTotalPages()}getPdfTotalPages(){return 10}goToPreviousPage(){this.currentPage>1&&this.currentPage--}goToNextPage(){this.currentPagef.e(4630).then(f.bind(f,64630)).then(y=>y.IntroductionComponent),title:"Introduction",data:{hide:!0,icon:"lightbulb"}},{path:"admin",loadComponent:()=>Promise.all([f.e(6850),f.e(4976)]).then(f.bind(f,44976)).then(y=>y.AdminComponent),title:"Admin",data:{hide:!0,icon:"dashboard"}},{path:"dashboard",loadComponent:()=>Promise.all([f.e(6195),f.e(2320)]).then(f.bind(f,62320)).then(y=>y.DashboardComponent),title:"Dashboard",data:{hide:!0,icon:"dashboard"}},{path:"communities",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(2076),f.e(6702)]).then(f.bind(f,6702)).then(y=>y.CommunitiesComponent),title:"Communities",data:{icon:"diversity_2"}},{path:"app/projects",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(8101)]).then(f.bind(f,18101)).then(y=>y.ProjectsComponent),title:"Projects",data:{hide:!0,icon:"diversity_1"}},{path:"communities/create",loadComponent:()=>Promise.all([f.e(2765),f.e(3475),f.e(2076),f.e(9847)]).then(f.bind(f,99847)).then(y=>y.CreateComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"communities/create/:id",loadComponent:()=>Promise.all([f.e(2765),f.e(3475),f.e(2076),f.e(9847)]).then(f.bind(f,99847)).then(y=>y.CreateComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"community/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(2076),f.e(3028)]).then(f.bind(f,73028)).then(y=>y.CommunityComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"friends",loadComponent:()=>Promise.all([f.e(6850),f.e(9996),f.e(8834)]).then(f.bind(f,38834)).then(y=>y.FriendsComponent),title:"Friends",data:{hide:!0,icon:"people"}},{path:"app/friends",loadComponent:()=>Promise.all([f.e(6850),f.e(9996),f.e(8834)]).then(f.bind(f,38834)).then(y=>y.FriendsComponent),title:"Friends",data:{hide:!1,icon:"people"}},{path:"app/chat",redirectTo:"app/chat/home",pathMatch:"full"},{path:"app/chat/:id",loadComponent:()=>f.e(3446).then(f.bind(f,63446)).then(y=>y.ChatComponent),title:"Chat",data:{icon:"chat"}},{path:"app/voluntaryist-covenant",loadComponent:()=>Promise.all([f.e(6850),f.e(4885)]).then(f.bind(f,74885)).then(y=>y.VoluntaryistCovenantComponent),title:"Voluntaryist Covenant",data:{hide:!0,icon:"assured_workload"}},{path:"app/issuer",loadComponent:()=>Promise.all([f.e(6850),f.e(9461)]).then(f.bind(f,39461)).then(y=>y.IssuerComponent),title:"Issuer",data:{hide:!0,icon:"assured_workload"}},{path:"app/kcc",loadComponent:()=>Promise.all([f.e(6850),f.e(4101)]).then(f.bind(f,64101)).then(y=>y.KnownCustomerCredentialComponent),title:"Known Customer Credential",data:{hide:!0,icon:"assured_workload"}},{path:"marketplace",loadComponent:()=>f.e(4392).then(f.bind(f,94392)).then(y=>y.MarketplaceComponent),title:"Marketplace",data:{hide:!0,icon:"storefront"}},{path:"apps",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(946)]).then(f.bind(f,50946)).then(y=>y.AppsComponent),title:"Apps",data:{icon:"apps"}},{path:"app/files",loadComponent:()=>f.e(6797).then(f.bind(f,46797)).then(y=>y.FilesComponent),title:"Files",data:{icon:"folder",breadcrumb:"Files"},children:[{path:"",pathMatch:"full",redirectTo:"folder/root"},{path:"file/:id",component:(()=>{class y{constructor(){var l=this;this.entries=(0,a.vPA)([]),this.app=(0,a.WQX)(m.d),this.breadcrumb=(0,a.WQX)(ie),this.layout=(0,a.WQX)(S.Y),this.identity=(0,a.WQX)(g.K),this.dialog=(0,a.WQX)(j.bZ),this.router=(0,a.WQX)(x.Ix),this.route=(0,a.WQX)(x.nX),this.fileService=(0,a.WQX)(ae),this.uploadProgress=null,this.isUploading=!1,this.file=null,this.uploadSuccess=!1,this.fileError=null,this.fileId=null,this.sanitizer=(0,a.WQX)(i.up),this.navigation=(0,a.WQX)(Tt.o),this.zoom=1,this.loading=!1,this.fullscreen=(0,a.vPA)(!1),this.canZoomIn=!1,this.canZoomOut=!0,this.fileMimeType=Te,this.pdfZoom=1,(0,a.QZP)((0,B.A)(function*(){l.app.initialized()&&(yield l.loadEntries())})),this.route.paramMap.subscribe(w=>{console.log("ROUTING!!!",w.get("id")),this.fileId=w.get("id")})}toggleFullscreen(){var l=document.getElementById("file-viewer");this.fullscreen()?(document.exitFullscreen(),this.fullscreen.set(!1)):(l.requestFullscreen(),this.fullscreen.set(!0))}updateZoomControls(){this.canZoomIn=this.zoom<1,this.canZoomOut=this.zoom>.1}zoomIn(){this.zoom=Math.min(1,this.zoom+.1),this.updateZoomControls()}zoomOut(){this.zoom=Math.max(.1,this.zoom-.1),this.updateZoomControls()}download(){const l=URL.createObjectURL(this.fileUrl),w=document.createElement("a");console.log("File URL"),console.log(l),w.href=l;const U=this.record?.tags.name;w.download=U,w.click(),URL.revokeObjectURL(l)}pdfZoomIn(){this.pdfZoom++}pdfZoomOut(){this.pdfZoom>1&&this.pdfZoom--}editFile(l){return(0,B.A)(function*(){document.getElementById("input")?.click()})()}onFileSelected(l){var w=this;return(0,B.A)(function*(){const U=l.currentTarget.files;if(0!=U.length){console.log("Uploading number of files:",U.length);for(let J=0;J[...Ht,{record:Ot,data:ut}])}}})()}cancelUpload(){return(0,B.A)(function*(){})()}upload(){var l=this;return(0,B.A)(function*(){console.log("Uploading file");const{status:w,record:U}=yield l.identity.web5.dwn.records.create({data:l.file,message:{schema:E.Q.types.entry.schema}});return console.log("Record created:",U),console.log("Record status:",w),U})()}editFolder(l){var w=this;return(0,B.A)(function*(){let U={name:l.data.name,entryType:"folder"};const J=JSON.parse(JSON.stringify(U)),ce=w.dialog.open(Z,{maxWidth:"80vw",maxHeight:"80vh",data:U});return ce.afterClosed().subscribe(function(){var ge=(0,B.A)(function*(Pe){Pe?(console.log("data result for saving:",U),l.data=U,yield w.saveFolder(l,U)):U=J});return function(Pe){return ge.apply(this,arguments)}}()),ce.afterClosed()})()}saveFolder(l,w){var U=this;return(0,B.A)(function*(){if(l.record){const{status:J,record:ce}=yield l.record.update({data:w});console.log("Record created:",ce),console.log("Record status:",J)}else{const{record:J,status:ce}=yield U.identity.web5.dwn.records.create({data:w,message:{tags:{entryType:w.entryType},protocol:E.Q.protocol,protocolPath:"entry",schema:E.Q.types.entry.schema}});console.log("Record created:",J),console.log("Record status:",ce),J&&(l.record=J,U.entries.update(ge=>[...ge,l]))}})()}openEntry(l){var w=this;return(0,B.A)(function*(){w.router.navigate("folder"===l.entryType?["/app/files/folder",l.record.id]:["/app/files/file",l.record.id])})()}deleteFile(){var l=this;return(0,B.A)(function*(){l.loading=!0;const{status:w}=yield l.record.delete(),{status:U}=yield l.record.send(l.identity.did);console.log("Delete status:",w),console.log("Delete send status:",U),l.record=void 0,l.src=void 0,l.navigation.back()})()}loadEntries(l){var w=this;return(0,B.A)(function*(){if(console.log("VALUE OF TAGS:",l),!w.fileId)return;const{record:U}=yield w.identity.web5.dwn.records.read({message:{filter:{recordId:w.fileId}}});if(w.record=U,w.fileUrl=yield U.data.blob(),console.log(U),w.type=U.dataFormat,"application/pdf"===U.dataFormat){const J=URL.createObjectURL(w.fileUrl)+"#toolbar=0&navpanes=0&scrollbar=0&view=FitH";w.src=w.sanitizer.bypassSecurityTrustResourceUrl(J)}else{const J=URL.createObjectURL(w.fileUrl);w.src=w.sanitizer.bypassSecurityTrustResourceUrl(J)}})()}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-file"]],standalone:!0,features:[a.aNF],decls:3,vars:2,consts:[["id","file-viewer"],[3,"src","type","zoom"],["mat-icon-button","",3,"click","title","disabled"],["mat-icon-button","",3,"click","title"],[1,"ellipsis",3,"matTooltip"],[1,"toolbar-spacer"],["mat-icon-button","",3,"click","disabled"],["mat-icon-button","",3,"title"]],template:function(w,U){1&w&&(a.j41(0,"div",0),a.DNE(1,ne,17,7,"mat-toolbar")(2,X,3,3,"app-file-viewer",1),a.k0s()),2&w&&(a.R7$(),a.vxM(U.record?1:-1),a.R7$(),a.vxM(U.src?2:-1))},dependencies:[nt,R.MD,q.Fg,P.m_,P.An,Qe.s5,Qe.KQ,_.Hl,_.iY,W.uc,W.oV]})}}return y})(),data:{breadcrumb:"Folder"}},{path:"**",component:Xe,data:{breadcrumb:"Folder"}}]},{path:"app/notes",loadComponent:()=>Promise.all([f.e(6471),f.e(8067),f.e(5832)]).then(f.bind(f,55832)).then(y=>y.NotesComponent),title:"Notes",data:{icon:"note"}},{path:"app/player",loadComponent:()=>f.e(9379).then(f.bind(f,19379)).then(y=>y.PlayerComponent),title:"Player",data:{icon:"play_circle"}},{path:"app/text",loadComponent:()=>Promise.all([f.e(6471),f.e(2765),f.e(8067),f.e(6406)]).then(f.bind(f,86406)).then(y=>y.TextComponent),title:"Text",data:{icon:"notes"}},{path:"app/tasks",redirectTo:"app/tasks/home",pathMatch:"full"},{path:"app/tasks/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(2765),f.e(1391),f.e(3907)]).then(f.bind(f,93907)).then(y=>y.TasksComponent),title:"Tasks",data:{icon:"task"}},{path:"registries",loadComponent:()=>Promise.all([f.e(6695),f.e(9466)]).then(f.bind(f,69466)).then(y=>y.RegistriesComponent),title:"Registries",data:{icon:"folder_shared"}},{path:"registry/bsn",loadComponent:()=>Promise.all([f.e(6850),f.e(6695),f.e(6471),f.e(2076),f.e(5026)]).then(f.bind(f,65026)).then(y=>y.RegistryComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/freeid",loadComponent:()=>Promise.all([f.e(6850),f.e(7160)]).then(f.bind(f,47160)).then(y=>y.FreeIDComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/podcast",loadComponent:()=>f.e(60).then(f.bind(f,80060)).then(y=>y.PodcastComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/liberstad-land-registry",loadComponent:()=>f.e(8880).then(f.bind(f,68880)).then(y=>y.LiberstadLandComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/gaianet",loadComponent:()=>f.e(4388).then(f.bind(f,64388)).then(y=>y.GaianetComponent),title:"Gaianet",data:{hide:!0,icon:"folder_shared"}},{path:"registry/local-company-registry",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(2084)]).then(f.bind(f,32084)).then(y=>y.LocalCompanyComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/local-company-registry/:id",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(9158)]).then(f.bind(f,89158)).then(y=>y.LocalCompanyViewComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"data/view/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(3474)]).then(f.bind(f,53474)).then(y=>y.DataViewComponent),title:"Data View",data:{hide:!0,icon:"folder_shared"}},{path:"data",loadComponent:()=>Promise.all([f.e(6850),f.e(7358),f.e(9454),f.e(3287)]).then(f.bind(f,63287)).then(y=>y.DataComponent),title:"Data",data:{hide:!0,icon:"source"}},{path:"data/:source/:id",loadComponent:()=>Promise.all([f.e(2076),f.e(9533)]).then(f.bind(f,29533)).then(y=>y.DataEntryComponent),title:"Data Entry",data:{hide:!0,icon:"source"}},{path:"profile/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(6489)]).then(f.bind(f,96489)).then(y=>y.ProfileComponent),title:"Profile",data:{hide:!0,icon:"account_circle"}},{path:"profile/:id/edit",loadComponent:()=>Promise.all([f.e(3475),f.e(7380)]).then(f.bind(f,37380)).then(y=>y.ProfileEditComponent),title:"Edit Profile",data:{hide:!0,icon:"account_circle"}},{path:"profile/:id/posts/:postId",loadComponent:()=>f.e(5680).then(f.bind(f,45680)).then(y=>y.PostComponent),title:"Posts",data:{hide:!0,icon:"note"}},{path:"notifications",loadComponent:()=>f.e(2228).then(f.bind(f,92228)).then(y=>y.NotificationsComponent),title:"Notifications",data:{hide:!0,icon:"notifications"}},{path:"accounts",loadComponent:()=>Promise.all([f.e(6850),f.e(9454),f.e(6486)]).then(f.bind(f,96486)).then(y=>y.AccountsComponent),title:"Accounts",data:{hide:!0,icon:"account_circle"}},{path:"account/password",loadComponent:()=>f.e(8012).then(f.bind(f,88012)).then(y=>y.PasswordComponent),title:"Password",data:{hide:!0,icon:"account_circle"}},{path:"account/password/reset",loadComponent:()=>f.e(92).then(f.bind(f,10092)).then(y=>y.PasswordResetComponent),title:"Password",data:{hide:!0,icon:"account_circle"}},{path:"account/backup",loadComponent:()=>f.e(5962).then(f.bind(f,75962)).then(y=>y.BackupComponent),title:"Backup",data:{hide:!0,icon:"account_circle"}},{path:"account/create",loadComponent:()=>f.e(5806).then(f.bind(f,75806)).then(y=>y.CreateComponent),title:"Create Account",data:{hide:!0,icon:"account_circle"}},{path:"account/create/new",loadComponent:()=>f.e(9613).then(f.bind(f,29613)).then(y=>y.NewComponent),title:"Create new account",data:{hide:!0,icon:"account_circle"}},{path:"account/create/restore",loadComponent:()=>Promise.resolve().then(f.bind(f,33065)).then(y=>y.RestoreComponent),title:"Restore existing account",data:{hide:!0,icon:"account_circle"}},{path:"account/:id",loadComponent:()=>f.e(7880).then(f.bind(f,17880)).then(y=>y.AccountComponent),title:"Account",data:{hide:!0,icon:"account_circle"}},{path:"identity",loadComponent:()=>f.e(5854).then(f.bind(f,85854)).then(y=>y.IdentityComponent),title:"Identity",data:{hide:!0,icon:"account_circle"}},{path:"settings",loadComponent:()=>f.e(959).then(f.bind(f,60959)).then(y=>y.SettingsComponent),title:"Settings",data:{hide:!0,icon:"settings"}},{path:"settings/about",loadComponent:()=>f.e(5216).then(f.bind(f,85216)).then(y=>y.AboutComponent),title:"About",data:{hide:!0,icon:"settings"}},{path:"settings/licenses",loadComponent:()=>f.e(9727).then(f.bind(f,19727)).then(y=>y.LicensesComponent),title:"Licenses",data:{hide:!0,icon:"settings"}},{path:"settings/privacy",loadComponent:()=>f.e(9128).then(f.bind(f,99128)).then(y=>y.PrivacyComponent),title:"Privacy",data:{hide:!0,icon:"settings"}},{path:"settings/handler",loadComponent:()=>f.e(8552).then(f.bind(f,18552)).then(y=>y.HandlerComponent),title:"Protocol Handler",data:{hide:!0,icon:"search"}},{path:"settings/connections",loadComponent:()=>Promise.all([f.e(9996),f.e(2276)]).then(f.bind(f,62276)).then(y=>y.ConnectionsComponent),title:"Connections",data:{hide:!0,icon:"people"}},{path:"settings/blocks",loadComponent:()=>f.e(5874).then(f.bind(f,45874)).then(y=>y.BlocksComponent),title:"Blocks",data:{hide:!0,icon:"manage_accounts"}},{path:"settings/roles",loadComponent:()=>f.e(7660).then(f.bind(f,47660)).then(y=>y.RolesComponent),title:"Roles",data:{hide:!0,icon:"group"}},{path:"settings/notifications",loadComponent:()=>f.e(4500).then(f.bind(f,74500)).then(y=>y.NotificationsComponent),title:"Notifications",data:{hide:!0,icon:"settings"}},{path:"settings/debug",loadComponent:()=>f.e(3416).then(f.bind(f,13416)).then(y=>y.DebugComponent),title:"Debug",data:{hide:!0,icon:"bug_report"}},{path:"tree",loadComponent:()=>Promise.all([f.e(7358),f.e(9238)]).then(f.bind(f,9238)).then(y=>y.TreeComponent),title:"Tree",data:{hide:!0,icon:"folder"}},{path:"drag-drop",loadComponent:()=>Promise.all([f.e(1391),f.e(7988)]).then(f.bind(f,77988)).then(y=>y.DragDropComponent),title:"Drag-Drop",data:{hide:!0,icon:"folder"}},{path:"storage",loadComponent:()=>Promise.all([f.e(6471),f.e(7848)]).then(f.bind(f,17848)).then(y=>y.StorageComponent),title:"Storage",data:{icon:"cloud"}},{path:"management",loadComponent:()=>Promise.all([f.e(6850),f.e(8864)]).then(f.bind(f,48864)).then(y=>y.ManagementComponent),title:"Management",data:{hide:!0,icon:"manage_accounts"}}];let je=(()=>{class y{constructor(l,w,U,J,ce){this.doc=l,this.delegate=w,this.zone=U,this.animationType=J,this.moduleImpl=ce,this._rendererFactoryPromise=null,this.scheduler=(0,a.WQX)(a.An2,{optional:!0}),this.loadingSchedulerFn=(0,a.WQX)(ot,{optional:!0})}ngOnDestroy(){this._engine?.flush()}loadImpl(){const l=()=>this.moduleImpl??f.e(8008).then(f.bind(f,68008)).then(U=>U);let w;return w=this.loadingSchedulerFn?this.loadingSchedulerFn(l):l(),w.catch(U=>{throw new a.wOt(5300,!1)}).then(({\u0275createEngine:U,\u0275AnimationRendererFactory:J})=>{this._engine=U(this.animationType,this.doc);const ce=new J(this.delegate,this._engine,this.zone);return this.delegate=ce,ce})}createRenderer(l,w){const U=this.delegate.createRenderer(l,w);if(0===U.\u0275type)return U;"boolean"==typeof U.throwOnSyntheticProps&&(U.throwOnSyntheticProps=!1);const J=new Ne(U);return w?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(ce=>{const ge=ce.createRenderer(l,w);J.use(ge),this.scheduler?.notify(10)}).catch(ce=>{J.use(U)}),J}begin(){this.delegate.begin?.()}end(){this.delegate.end?.()}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}static{this.\u0275fac=function(w){a.QTQ()}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac})}}return y})();class Ne{constructor(c){this.delegate=c,this.replay=[],this.\u0275type=1}use(c){if(this.delegate=c,null!==this.replay){for(const l of this.replay)l(c);this.replay=null}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy()}createElement(c,l){return this.delegate.createElement(c,l)}createComment(c){return this.delegate.createComment(c)}createText(c){return this.delegate.createText(c)}get destroyNode(){return this.delegate.destroyNode}appendChild(c,l){this.delegate.appendChild(c,l)}insertBefore(c,l,w,U){this.delegate.insertBefore(c,l,w,U)}removeChild(c,l,w){this.delegate.removeChild(c,l,w)}selectRootElement(c,l){return this.delegate.selectRootElement(c,l)}parentNode(c){return this.delegate.parentNode(c)}nextSibling(c){return this.delegate.nextSibling(c)}setAttribute(c,l,w,U){this.delegate.setAttribute(c,l,w,U)}removeAttribute(c,l,w){this.delegate.removeAttribute(c,l,w)}addClass(c,l){this.delegate.addClass(c,l)}removeClass(c,l){this.delegate.removeClass(c,l)}setStyle(c,l,w,U){this.delegate.setStyle(c,l,w,U)}removeStyle(c,l,w){this.delegate.removeStyle(c,l,w)}setProperty(c,l,w){this.shouldReplay(l)&&this.replay.push(U=>U.setProperty(c,l,w)),this.delegate.setProperty(c,l,w)}setValue(c,l){this.delegate.setValue(c,l)}listen(c,l,w){return this.shouldReplay(l)&&this.replay.push(U=>U.listen(c,l,w)),this.delegate.listen(c,l,w)}shouldReplay(c){return null!==this.replay&&c.startsWith("@")}}const ot=new a.nKC("");var wt=f(59030),zt=f(18810),rr=f(33726),ar=f(7673),lr=f(28793),hn=f(21413),Wr=f(71985),vr=f(85343);const Tr=new Wr.c(vr.l);var lt=f(57786),Pt=f(86648),Dt=f(96354),jt=f(25558),Nr=f(30017),Ke=f(98071),Ze=f(58750),gt=f(39974);const mt={connector:()=>new hn.B};function Xt(y,c=mt){const{connector:l}=c;return(0,gt.N)((w,U)=>{const J=l();(0,Ze.Tg)(y(function st(y){return new Wr.c(c=>y.subscribe(c))}(J))).subscribe(U),U.add(w.subscribe(J))})}var Lr=f(96697),yr=f(88141),$r=f(91986);const mi="Service workers are disabled or not supported by this browser";class wn{constructor(c){if(this.serviceWorker=c,c){const w=(0,rr.R)(c,"controllerchange").pipe((0,Dt.T)(()=>c.controller)),U=(0,wt.v)(()=>(0,ar.of)(c.controller)),J=(0,lr.x)(U,w);this.worker=J.pipe((0,te.p)(ut=>!!ut)),this.registration=this.worker.pipe((0,jt.n)(()=>c.getRegistration()));const Ge=(0,rr.R)(c,"message").pipe((0,Dt.T)(ut=>ut.data)).pipe((0,te.p)(ut=>ut&&ut.type)).pipe(function Zt(y){return y?c=>Xt(y)(c):c=>function Et(y,c){const l=(0,Ke.T)(y)?y:()=>y;return(0,Ke.T)(c)?Xt(c,{connector:l}):w=>new Nr.G(w,l)}(new hn.B)(c)}());Ge.connect(),this.events=Ge}else this.worker=this.events=this.registration=function Vn(y){return(0,wt.v)(()=>(0,zt.$)(new Error(y)))}(mi)}postMessage(c,l){return this.worker.pipe((0,Lr.s)(1),(0,yr.M)(w=>{w.postMessage({action:c,...l})})).toPromise().then(()=>{})}postMessageWithOperation(c,l,w){const U=this.waitForOperationCompleted(w),J=this.postMessage(c,l);return Promise.all([J,U]).then(([,ce])=>ce)}generateNonce(){return Math.round(1e7*Math.random())}eventsOfType(c){let l;return l="string"==typeof c?w=>w.type===c:w=>c.includes(w.type),this.events.pipe((0,te.p)(l))}nextEventOfType(c){return this.eventsOfType(c).pipe((0,Lr.s)(1))}waitForOperationCompleted(c){return this.eventsOfType("OPERATION_COMPLETED").pipe((0,te.p)(l=>l.nonce===c),(0,Lr.s)(1),(0,Dt.T)(l=>{if(void 0!==l.result)return l.result;throw new Error(l.error)})).toPromise()}get isEnabled(){return!!this.serviceWorker}}let Yt=(()=>{class y{get isEnabled(){return this.sw.isEnabled}constructor(l){if(this.sw=l,this.pushManager=null,this.subscriptionChanges=new hn.B,!l.isEnabled)return this.messages=Tr,this.notificationClicks=Tr,void(this.subscription=Tr);this.messages=this.sw.eventsOfType("PUSH").pipe((0,Dt.T)(U=>U.data)),this.notificationClicks=this.sw.eventsOfType("NOTIFICATION_CLICK").pipe((0,Dt.T)(U=>U.data)),this.pushManager=this.sw.registration.pipe((0,Dt.T)(U=>U.pushManager));const w=this.pushManager.pipe((0,jt.n)(U=>U.getSubscription()));this.subscription=(0,lt.h)(w,this.subscriptionChanges)}requestSubscription(l){if(!this.sw.isEnabled||null===this.pushManager)return Promise.reject(new Error(mi));const w={userVisibleOnly:!0};let U=this.decodeBase64(l.serverPublicKey.replace(/_/g,"/").replace(/-/g,"+")),J=new Uint8Array(new ArrayBuffer(U.length));for(let ce=0;cece.subscribe(w)),(0,Lr.s)(1)).toPromise().then(ce=>(this.subscriptionChanges.next(ce),ce))}unsubscribe(){return this.sw.isEnabled?this.subscription.pipe((0,Lr.s)(1),(0,jt.n)(w=>{if(null===w)throw new Error("Not subscribed to push notifications.");return w.unsubscribe().then(U=>{if(!U)throw new Error("Unsubscribe failed!");this.subscriptionChanges.next(null)})})).toPromise():Promise.reject(new Error(mi))}decodeBase64(l){return atob(l)}static{this.\u0275fac=function(w){return new(w||y)(a.KVO(wn))}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac})}}return y})(),Hr=(()=>{class y{get isEnabled(){return this.sw.isEnabled}constructor(l){if(this.sw=l,!l.isEnabled)return this.versionUpdates=Tr,void(this.unrecoverable=Tr);this.versionUpdates=this.sw.eventsOfType(["VERSION_DETECTED","VERSION_INSTALLATION_FAILED","VERSION_READY","NO_NEW_VERSION_DETECTED"]),this.unrecoverable=this.sw.eventsOfType("UNRECOVERABLE_STATE")}checkForUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(mi));const l=this.sw.generateNonce();return this.sw.postMessageWithOperation("CHECK_FOR_UPDATES",{nonce:l},l)}activateUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(mi));const l=this.sw.generateNonce();return this.sw.postMessageWithOperation("ACTIVATE_UPDATE",{nonce:l},l)}static{this.\u0275fac=function(w){return new(w||y)(a.KVO(wn))}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac})}}return y})();const Lt=new a.nKC("");function dr(y,c,l,w){return()=>{if(!(0,R.UE)(w)||!("serviceWorker"in navigator)||!1===l.enabled)return;const U=y.get(a.SKi),J=y.get(a.o8S);let ce;if(U.runOutsideAngular(()=>{const ge=navigator.serviceWorker,Pe=()=>ge.controller?.postMessage({action:"INITIALIZE"});ge.addEventListener("controllerchange",Pe),J.onDestroy(()=>{ge.removeEventListener("controllerchange",Pe)})}),"function"==typeof l.registrationStrategy)ce=l.registrationStrategy();else{const[ge,...Pe]=(l.registrationStrategy||"registerWhenStable:30000").split(":");switch(ge){case"registerImmediately":ce=(0,ar.of)(null);break;case"registerWithDelay":ce=xr(+Pe[0]||0);break;case"registerWhenStable":const Ge=(0,Pt.H)(y.get(a.o8S).whenStable());ce=Pe[0]?(0,lt.h)(Ge,xr(+Pe[0])):Ge;break;default:throw new Error(`Unknown ServiceWorker registration strategy: ${l.registrationStrategy}`)}}U.runOutsideAngular(()=>ce.pipe((0,Lr.s)(1)).subscribe(()=>navigator.serviceWorker.register(c,{scope:l.scope}).catch(ge=>console.error("Service worker registration failed with:",ge))))}}function xr(y){return(0,ar.of)(null).pipe((0,$r.c)(y))}function fn(y,c){return new wn((0,R.UE)(c)&&!1!==y.enabled?navigator.serviceWorker:void 0)}class Sn{}var li=f(21626),Kr=f(1005);const ur={providers:[(0,li.$R)(),(0,a.Jn2)({eventCoalescing:!0}),(0,x.lh)(he,(0,x.Sn)(x.Kp)),function Ft(y="animations"){return(0,a.ngT)("NgAsyncAnimations"),(0,a.EmA)([{provide:a._9s,useFactory:(c,l,w)=>new je(c,l,w,y),deps:[R.qQ,i.B7,a.SKi]},{provide:a.bc$,useValue:"noop"===y?"NoopAnimations":"BrowserAnimations"}])}(),function Xn(y,c={}){return(0,a.EmA)([Yt,Hr,{provide:Lt,useValue:y},{provide:Sn,useValue:c},{provide:wn,useFactory:fn,deps:[Sn,a.Agw]},{provide:a.hnV,useFactory:dr,deps:[a.zZn,Lt,Sn,a.Agw],multi:!0}])}("ngsw-worker.js",{enabled:!(0,a.naY)(),registrationStrategy:"registerWhenStable:30000"}),{provide:a.hnV,useFactory:function er(y){return()=>y.load()},deps:[Kr.G],multi:!0}]};var Fr=f(99327),qt=f(67333),mr=f(86600),_r=f(18617),Gr=f(28203),gn=f(14085),An=f(67336),Pn=f(36860),Un=f(73703),oi=f(56977),$i=f(23294),Fi=f(99172),no=f(70152),Zi=f(49969);const Ao=["*"],Fo=["content"],Ki=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],ro=["mat-drawer","mat-drawer-content","*"];function uo(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",1),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U._onBackdropClicked())}),a.k0s()}if(2&y){const l=a.XpG();a.AVh("mat-drawer-shown",l._isShowingBackdrop())}}function Oi(y,c){1&y&&(a.j41(0,"mat-drawer-content"),a.SdG(1,2),a.k0s())}const Yn=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],Qo=["mat-sidenav","mat-sidenav-content","*"];function Gs(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",1),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U._onBackdropClicked())}),a.k0s()}if(2&y){const l=a.XpG();a.AVh("mat-drawer-shown",l._isShowingBackdrop())}}function Ss(y,c){1&y&&(a.j41(0,"mat-sidenav-content"),a.SdG(1,2),a.k0s())}const Na={transformDrawer:(0,Zi.hZ)("transform",[(0,Zi.wk)("open, open-instant",(0,Zi.iF)({transform:"none",visibility:"visible"})),(0,Zi.wk)("void",(0,Zi.iF)({"box-shadow":"none",visibility:"hidden"})),(0,Zi.kY)("void => open-instant",(0,Zi.i0)("0ms")),(0,Zi.kY)("void <=> open, open-instant => void",(0,Zi.i0)("400ms cubic-bezier(0.25, 0.8, 0.25, 1)"))])},Yi=new a.nKC("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:function uc(){return!1}}),ys=new a.nKC("MAT_DRAWER_CONTAINER");let yt=(()=>{class y extends qt.uv{constructor(l,w,U,J,ce){super(U,J,ce),this._changeDetectorRef=l,this._container=w}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(a.gRc),a.rXU((0,a.Rfq)(()=>wr)),a.rXU(a.aKT),a.rXU(qt.R),a.rXU(a.SKi))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:4,hostBindings:function(w,U){2&w&&a.xc7("margin-left",U._container._contentMargins.left,"px")("margin-right",U._container._contentMargins.right,"px")},standalone:!0,features:[a.Jv_([{provide:qt.uv,useExisting:y}]),a.Vt3,a.aNF],ngContentSelectors:Ao,decls:1,vars:0,template:function(w,U){1&w&&(a.NAR(),a.SdG(0))},encapsulation:2,changeDetection:0})}}return y})(),kt=(()=>{class y{get position(){return this._position}set position(l){(l="end"===l?"end":"start")!==this._position&&(this._isAttached&&this._updatePositionInParent(l),this._position=l,this.onPositionChanged.emit())}get mode(){return this._mode}set mode(l){this._mode=l,this._updateFocusTrapState(),this._modeChanged.next()}get disableClose(){return this._disableClose}set disableClose(l){this._disableClose=(0,gn.he)(l)}get autoFocus(){return this._autoFocus??("side"===this.mode?"dialog":"first-tabbable")}set autoFocus(l){("true"===l||"false"===l||null==l)&&(l=(0,gn.he)(l)),this._autoFocus=l}get opened(){return this._opened}set opened(l){this.toggle((0,gn.he)(l))}constructor(l,w,U,J,ce,ge,Pe,Ge){this._elementRef=l,this._focusTrapFactory=w,this._focusMonitor=U,this._platform=J,this._ngZone=ce,this._interactivityChecker=ge,this._doc=Pe,this._container=Ge,this._focusTrap=null,this._elementFocusedBeforeDrawerWasOpened=null,this._enableAnimations=!1,this._position="start",this._mode="over",this._disableClose=!1,this._opened=!1,this._animationStarted=new hn.B,this._animationEnd=new hn.B,this._animationState="void",this.openedChange=new a.bkB(!0),this._openedStream=this.openedChange.pipe((0,te.p)(ut=>ut),(0,Dt.T)(()=>{})),this.openedStart=this._animationStarted.pipe((0,te.p)(ut=>ut.fromState!==ut.toState&&0===ut.toState.indexOf("open")),(0,Un.u)(void 0)),this._closedStream=this.openedChange.pipe((0,te.p)(ut=>!ut),(0,Dt.T)(()=>{})),this.closedStart=this._animationStarted.pipe((0,te.p)(ut=>ut.fromState!==ut.toState&&"void"===ut.toState),(0,Un.u)(void 0)),this._destroyed=new hn.B,this.onPositionChanged=new a.bkB,this._modeChanged=new hn.B,this._injector=(0,a.WQX)(a.zZn),this._changeDetectorRef=(0,a.WQX)(a.gRc),this.openedChange.pipe((0,oi.Q)(this._destroyed)).subscribe(ut=>{ut?(this._doc&&(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement),this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus(this._openedVia||"program")}),this._ngZone.runOutsideAngular(()=>{(0,rr.R)(this._elementRef.nativeElement,"keydown").pipe((0,te.p)(ut=>ut.keyCode===An._f&&!this.disableClose&&!(0,An.rp)(ut)),(0,oi.Q)(this._destroyed)).subscribe(ut=>this._ngZone.run(()=>{this.close(),ut.stopPropagation(),ut.preventDefault()}))}),this._animationEnd.pipe((0,$i.F)((ut,_t)=>ut.fromState===_t.fromState&&ut.toState===_t.toState)).subscribe(ut=>{const{fromState:_t,toState:Ot}=ut;(0===Ot.indexOf("open")&&"void"===_t||"void"===Ot&&0===_t.indexOf("open"))&&this.openedChange.emit(this._opened)})}_forceFocus(l,w){this._interactivityChecker.isFocusable(l)||(l.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{const U=()=>{l.removeEventListener("blur",U),l.removeEventListener("mousedown",U),l.removeAttribute("tabindex")};l.addEventListener("blur",U),l.addEventListener("mousedown",U)})),l.focus(w)}_focusByCssSelector(l,w){let U=this._elementRef.nativeElement.querySelector(l);U&&this._forceFocus(U,w)}_takeFocus(){if(!this._focusTrap)return;const l=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":(0,a.mal)(()=>{!this._focusTrap.focusInitialElement()&&"function"==typeof l.focus&&l.focus()},{injector:this._injector});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this.autoFocus)}}_restoreFocus(l){"dialog"!==this.autoFocus&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,l):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null)}_isFocusWithinDrawer(){const l=this._doc.activeElement;return!!l&&this._elementRef.nativeElement.contains(l)}ngAfterViewInit(){this._isAttached=!0,"end"===this._position&&this._updatePositionInParent("end"),this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState())}ngAfterContentChecked(){this._platform.isBrowser&&(this._enableAnimations=!0)}ngOnDestroy(){this._focusTrap?.destroy(),this._anchor?.remove(),this._anchor=null,this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(l){return this.toggle(!0,l)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0,"mouse")}toggle(l=!this.opened,w){l&&w&&(this._openedVia=w);const U=this._setOpen(l,!l&&this._isFocusWithinDrawer(),this._openedVia||"program");return l||(this._openedVia=null),U}_setOpen(l,w,U){return this._opened=l,l?this._animationState=this._enableAnimations?"open":"open-instant":(this._animationState="void",w&&this._restoreFocus(U)),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(J=>{this.openedChange.pipe((0,Lr.s)(1)).subscribe(ce=>J(ce?"open":"close"))})}_getWidth(){return this._elementRef.nativeElement&&this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=!!this._container?.hasBackdrop&&this.opened)}_updatePositionInParent(l){if(!this._platform.isBrowser)return;const w=this._elementRef.nativeElement,U=w.parentNode;"end"===l?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),U.insertBefore(this._anchor,w)),U.appendChild(w)):this._anchor&&this._anchor.parentNode.insertBefore(w,this._anchor)}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(a.aKT),a.rXU(_r.GX),a.rXU(_r.FN),a.rXU(Pn.OD),a.rXU(a.SKi),a.rXU(_r.Z7),a.rXU(R.qQ,8),a.rXU(ys,8))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-drawer"]],viewQuery:function(w,U){if(1&w&&a.GBs(Fo,5),2&w){let J;a.mGM(J=a.lsd())&&(U._content=J.first)}},hostAttrs:["tabIndex","-1",1,"mat-drawer"],hostVars:12,hostBindings:function(w,U){1&w&&a.Kam("@transform.start",function(ce){return U._animationStarted.next(ce)})("@transform.done",function(ce){return U._animationEnd.next(ce)}),2&w&&(a.zvX("@transform",U._animationState),a.BMQ("align",null),a.AVh("mat-drawer-end","end"===U.position)("mat-drawer-over","over"===U.mode)("mat-drawer-push","push"===U.mode)("mat-drawer-side","side"===U.mode)("mat-drawer-opened",U.opened))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",openedStart:"openedStart",_closedStream:"closed",closedStart:"closedStart",onPositionChanged:"positionChanged"},exportAs:["matDrawer"],standalone:!0,features:[a.aNF],ngContentSelectors:Ao,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(w,U){1&w&&(a.NAR(),a.j41(0,"div",1,0),a.SdG(2),a.k0s())},dependencies:[qt.uv],encapsulation:2,data:{animation:[Na.transformDrawer]},changeDetection:0})}}return y})(),wr=(()=>{class y{get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(l){this._autosize=(0,gn.he)(l)}get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(l){this._backdropOverride=null==l?null:(0,gn.he)(l)}get scrollable(){return this._userContent||this._content}constructor(l,w,U,J,ce,ge=!1,Pe){this._dir=l,this._element=w,this._ngZone=U,this._changeDetectorRef=J,this._animationMode=Pe,this._drawers=new a.rOR,this.backdropClick=new a.bkB,this._destroyed=new hn.B,this._doCheckSubject=new hn.B,this._contentMargins={left:null,right:null},this._contentMarginChanges=new hn.B,this._injector=(0,a.WQX)(a.zZn),l&&l.change.pipe((0,oi.Q)(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),ce.change().pipe((0,oi.Q)(this._destroyed)).subscribe(()=>this.updateContentMargins()),this._autosize=ge}ngAfterContentInit(){this._allDrawers.changes.pipe((0,Fi.Z)(this._allDrawers),(0,oi.Q)(this._destroyed)).subscribe(l=>{this._drawers.reset(l.filter(w=>!w._container||w._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe((0,Fi.Z)(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(l=>{this._watchDrawerToggle(l),this._watchDrawerPosition(l),this._watchDrawerMode(l)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe((0,no.B)(10),(0,oi.Q)(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(l=>l.open())}close(){this._drawers.forEach(l=>l.close())}updateContentMargins(){let l=0,w=0;if(this._left&&this._left.opened)if("side"==this._left.mode)l+=this._left._getWidth();else if("push"==this._left.mode){const U=this._left._getWidth();l+=U,w-=U}if(this._right&&this._right.opened)if("side"==this._right.mode)w+=this._right._getWidth();else if("push"==this._right.mode){const U=this._right._getWidth();w+=U,l-=U}l=l||null,w=w||null,(l!==this._contentMargins.left||w!==this._contentMargins.right)&&(this._contentMargins={left:l,right:w},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(l){l._animationStarted.pipe((0,te.p)(w=>w.fromState!==w.toState),(0,oi.Q)(this._drawers.changes)).subscribe(w=>{"open-instant"!==w.toState&&"NoopAnimations"!==this._animationMode&&this._element.nativeElement.classList.add("mat-drawer-transition"),this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),"side"!==l.mode&&l.openedChange.pipe((0,oi.Q)(this._drawers.changes)).subscribe(()=>this._setContainerClass(l.opened))}_watchDrawerPosition(l){l&&l.onPositionChanged.pipe((0,oi.Q)(this._drawers.changes)).subscribe(()=>{(0,a.mal)(()=>{this._validateDrawers()},{injector:this._injector,phase:a.wjH.Read})})}_watchDrawerMode(l){l&&l._modeChanged.pipe((0,oi.Q)((0,lt.h)(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(l){const w=this._element.nativeElement.classList,U="mat-drawer-container-has-open";l?w.add(U):w.remove(U)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(l=>{"end"==l.position?this._end=l:this._start=l}),this._right=this._left=null,this._dir&&"rtl"===this._dir.value?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&"over"!=this._start.mode||this._isDrawerOpen(this._end)&&"over"!=this._end.mode}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(l=>l&&!l.disableClose&&this._drawerHasBackdrop(l)).forEach(l=>l._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._drawerHasBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._drawerHasBackdrop(this._end)}_isDrawerOpen(l){return null!=l&&l.opened}_drawerHasBackdrop(l){return null==this._backdropOverride?!!l&&"side"!==l.mode:this._backdropOverride}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(Gr.dS,8),a.rXU(a.aKT),a.rXU(a.SKi),a.rXU(a.gRc),a.rXU(qt.Xj),a.rXU(Yi),a.rXU(a.bc$,8))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-drawer-container"]],contentQueries:function(w,U,J){if(1&w&&(a.wni(J,yt,5),a.wni(J,kt,5)),2&w){let ce;a.mGM(ce=a.lsd())&&(U._content=ce.first),a.mGM(ce=a.lsd())&&(U._allDrawers=ce)}},viewQuery:function(w,U){if(1&w&&a.GBs(yt,5),2&w){let J;a.mGM(J=a.lsd())&&(U._userContent=J.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(w,U){2&w&&a.AVh("mat-drawer-container-explicit-backdrop",U._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],standalone:!0,features:[a.Jv_([{provide:ys,useExisting:y}]),a.aNF],ngContentSelectors:ro,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(w,U){1&w&&(a.NAR(Ki),a.DNE(0,uo,1,2,"div",0),a.SdG(1),a.SdG(2,1),a.DNE(3,Oi,2,0,"mat-drawer-content")),2&w&&(a.vxM(U.hasBackdrop?0:-1),a.R7$(3),a.vxM(U._content?-1:3))},dependencies:[yt],styles:['.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-app-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-app-background));box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color)}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-app-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow);background-color:var(--mat-sidenav-container-background-color, var(--mat-app-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));width:var(--mat-sidenav-container-width);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer[style*="visibility: hidden"]{display:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}'],encapsulation:2,changeDetection:0})}}return y})(),Jt=(()=>{class y extends yt{constructor(l,w,U,J,ce){super(l,w,U,J,ce)}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(a.gRc),a.rXU((0,a.Rfq)(()=>Or)),a.rXU(a.aKT),a.rXU(qt.R),a.rXU(a.SKi))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],hostVars:4,hostBindings:function(w,U){2&w&&a.xc7("margin-left",U._container._contentMargins.left,"px")("margin-right",U._container._contentMargins.right,"px")},standalone:!0,features:[a.Jv_([{provide:qt.uv,useExisting:y}]),a.Vt3,a.aNF],ngContentSelectors:Ao,decls:1,vars:0,template:function(w,U){1&w&&(a.NAR(),a.SdG(0))},encapsulation:2,changeDetection:0})}}return y})(),hr=(()=>{class y extends kt{constructor(){super(...arguments),this._fixedInViewport=!1,this._fixedTopGap=0,this._fixedBottomGap=0}get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(l){this._fixedInViewport=(0,gn.he)(l)}get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(l){this._fixedTopGap=(0,gn.OE)(l)}get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(l){this._fixedBottomGap=(0,gn.OE)(l)}static{this.\u0275fac=(()=>{let l;return function(U){return(l||(l=a.xGo(y)))(U||y)}})()}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-sidenav"]],hostAttrs:["tabIndex","-1",1,"mat-drawer","mat-sidenav"],hostVars:17,hostBindings:function(w,U){2&w&&(a.BMQ("align",null),a.xc7("top",U.fixedInViewport?U.fixedTopGap:null,"px")("bottom",U.fixedInViewport?U.fixedBottomGap:null,"px"),a.AVh("mat-drawer-end","end"===U.position)("mat-drawer-over","over"===U.mode)("mat-drawer-push","push"===U.mode)("mat-drawer-side","side"===U.mode)("mat-drawer-opened",U.opened)("mat-sidenav-fixed",U.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],standalone:!0,features:[a.Vt3,a.aNF],ngContentSelectors:Ao,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(w,U){1&w&&(a.NAR(),a.j41(0,"div",1,0),a.SdG(2),a.k0s())},dependencies:[qt.uv],encapsulation:2,data:{animation:[Na.transformDrawer]},changeDetection:0})}}return y})(),Or=(()=>{class y extends wr{constructor(){super(...arguments),this._allDrawers=void 0,this._content=void 0}static{this.\u0275fac=(()=>{let l;return function(U){return(l||(l=a.xGo(y)))(U||y)}})()}static{this.\u0275cmp=a.VBU({type:y,selectors:[["mat-sidenav-container"]],contentQueries:function(w,U,J){if(1&w&&(a.wni(J,Jt,5),a.wni(J,hr,5)),2&w){let ce;a.mGM(ce=a.lsd())&&(U._content=ce.first),a.mGM(ce=a.lsd())&&(U._allDrawers=ce)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(w,U){2&w&&a.AVh("mat-drawer-container-explicit-backdrop",U._backdropOverride)},exportAs:["matSidenavContainer"],standalone:!0,features:[a.Jv_([{provide:ys,useExisting:y}]),a.Vt3,a.aNF],ngContentSelectors:Qo,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(w,U){1&w&&(a.NAR(Yn),a.DNE(0,Gs,1,2,"div",0),a.SdG(1),a.SdG(2,1),a.DNE(3,Ss,2,0,"mat-sidenav-content")),2&w&&(a.vxM(U.hasBackdrop?0:-1),a.R7$(3),a.vxM(U._content?-1:3))},dependencies:[Jt],styles:['.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-app-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-app-background));box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color)}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-app-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow);background-color:var(--mat-sidenav-container-background-color, var(--mat-app-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));width:var(--mat-sidenav-container-width);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer[style*="visibility: hidden"]{display:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}'],encapsulation:2,changeDetection:0})}}return y})(),pn=(()=>{class y{static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275mod=a.$C({type:y})}static{this.\u0275inj=a.G2t({imports:[mr.yE,qt.Gj,qt.Gj,mr.yE]})}}return y})();var bn=f(44668),_i=f(31948),Gi=f(40605);let Io=(()=>{class y{constructor(l,w){this.swUpdate=l,this.zone=w,this.isNewVersionAvailable=!1,this.intervalSource=(0,Gi.Y)(9e5),this.checkForUpdateOnInterval(),this.checkForUpdateOnLoad()}applyUpdate(){this.swUpdate.activateUpdate().then(()=>document.location.reload()).catch(l=>console.error("Failed to apply updates:",l))}checkForUpdateOnInterval(){var l=this;this.intervalSubscription?.unsubscribe(),this.swUpdate.isEnabled&&this.zone.runOutsideAngular(()=>{this.intervalSubscription=this.intervalSource.subscribe((0,B.A)(function*(){if(l.isNewVersionAvailable)yield l.swUpdate.checkForUpdate();else try{l.isNewVersionAvailable=yield l.swUpdate.checkForUpdate(),console.log(l.isNewVersionAvailable?"A new version is available.":"Already on the latest version.")}catch(w){console.error("Failed to check for updates:",w)}}))})}checkForUpdateOnLoad(){this.newVersionSubscription?.unsubscribe(),this.swUpdate.isEnabled?(this.newVersionSubscription=this.swUpdate.versionUpdates.subscribe(l=>{switch(console.log("New version update event:"),console.log(l),l.type){case"VERSION_DETECTED":console.log(`Downloading new app version: ${l.version.hash}`);break;case"VERSION_READY":console.log(`Current app version: ${l.currentVersion.hash}`),console.log(`New app version ready for use: ${l.latestVersion.hash}`),this.isNewVersionAvailable=!0;break;case"VERSION_INSTALLATION_FAILED":console.log(`Failed to install app version '${l.version.hash}': ${l.error}`)}}),console.log("Subscribed to new version updates.")):console.log("Service worker updates are disabled for this app.")}static{this.\u0275fac=function(w){return new(w||y)(a.KVO(Hr),a.KVO(a.SKi))}}static{this.\u0275prov=a.jDH({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();var Mo=f(33347),Ma=f(5794),Os=f(78013);var oc=function(){var y=function(l,w){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,J){U.__proto__=J}||function(U,J){for(var ce in J)Object.prototype.hasOwnProperty.call(J,ce)&&(U[ce]=J[ce])})(l,w)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),Si=function(y){function c(l,w){var U=this.constructor,J=y.call(this,l,w)||this;return Object.defineProperty(J,"name",{value:U.name,enumerable:!1,configurable:!0}),function Ua(y,c){var l=Object.setPrototypeOf;l?l(y,c):y.__proto__=c}(J,U.prototype),function cs(y,c){void 0===c&&(c=y.constructor);var l=Error.captureStackTrace;l&&l(y,c)}(J),J}return oc(c,y),c}(Error),ns=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Us=function(y){function c(l){void 0===l&&(l=void 0);var w=y.call(this,l)||this;return w.message=l,w}return ns(c,y),c.prototype.getKind=function(){return this.constructor.kind},c.kind="Exception",c}(Si);var Ec=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const vs=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return Ec(c,y),c.kind="ArgumentException",c}(Us);var As=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Bi=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return As(c,y),c.kind="IllegalArgumentException",c}(Us),jc=function(){function y(c){if(this.binarizer=c,null===c)throw new Bi("Binarizer must be non-null.")}return y.prototype.getWidth=function(){return this.binarizer.getWidth()},y.prototype.getHeight=function(){return this.binarizer.getHeight()},y.prototype.getBlackRow=function(c,l){return this.binarizer.getBlackRow(c,l)},y.prototype.getBlackMatrix=function(){return null==this.matrix&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},y.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},y.prototype.crop=function(c,l,w,U){var J=this.binarizer.getLuminanceSource().crop(c,l,w,U);return new y(this.binarizer.createBinarizer(J))},y.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},y.prototype.rotateCounterClockwise=function(){var c=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new y(this.binarizer.createBinarizer(c))},y.prototype.rotateCounterClockwise45=function(){var c=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new y(this.binarizer.createBinarizer(c))},y.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},y}();var Ta=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const rs=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return Ta(c,y),c.getChecksumInstance=function(){return new c},c.kind="ChecksumException",c}(Us),Qt=function(){function y(c){this.source=c}return y.prototype.getLuminanceSource=function(){return this.source},y.prototype.getWidth=function(){return this.source.getWidth()},y.prototype.getHeight=function(){return this.source.getHeight()},y}(),Rt=function(){function y(){}return y.arraycopy=function(c,l,w,U,J){for(;J--;)w[U++]=c[l++]},y.currentTimeMillis=function(){return Date.now()},y}();var Pr=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Qr=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return Pr(c,y),c.kind="IndexOutOfBoundsException",c}(Us);var zn=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Zn=function(y){function c(l,w){void 0===l&&(l=void 0),void 0===w&&(w=void 0);var U=y.call(this,w)||this;return U.index=l,U.message=w,U}return zn(c,y),c.kind="ArrayIndexOutOfBoundsException",c}(Qr),Vi=function(){function y(){}return y.fill=function(c,l){for(var w=0,U=c.length;ww)throw new Bi("fromIndex("+l+") > toIndex("+w+")");if(l<0)throw new Zn(l);if(w>c)throw new Zn(w)},y.asList=function(){for(var c=[],l=0;l=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),ce=J.next();!ce.done;ce=J.next())U=31*U+ce.value}catch(Pe){l={error:Pe}}finally{try{ce&&!ce.done&&(w=J.return)&&w.call(J)}finally{if(l)throw l.error}}return U},y.fillUint8Array=function(c,l){for(var w=0;w!==c.length;w++)c[w]=l},y.copyOf=function(c,l){return c.slice(0,l)},y.copyOfUint8Array=function(c,l){if(c.length<=l){var w=new Uint8Array(l);return w.set(c),w}return c.slice(0,l)},y.copyOfRange=function(c,l,w){var U=w-l,J=new Int32Array(U);return Rt.arraycopy(c,l,J,0,U),J},y.binarySearch=function(c,l,w){void 0===w&&(w=y.numberComparator);for(var U=0,J=c.length-1;U<=J;){var ce=J+U>>1,ge=w(l,c[ce]);if(ge>0)U=ce+1;else{if(!(ge<0))return ce;J=ce-1}}return-U-1},y.numberComparator=function(c,l){return c-l},y}(),pi=function(){function y(){}return y.numberOfTrailingZeros=function(c){var l;if(0===c)return 32;var w=31;return 0!=(l=c<<16)&&(w-=16,c=l),0!=(l=c<<8)&&(w-=8,c=l),0!=(l=c<<4)&&(w-=4,c=l),0!=(l=c<<2)&&(w-=2,c=l),w-(c<<1>>>31)},y.numberOfLeadingZeros=function(c){if(0===c)return 32;var l=1;return c>>>16||(l+=16,c<<=16),c>>>24||(l+=8,c<<=8),c>>>28||(l+=4,c<<=4),c>>>30||(l+=2,c<<=2),l-(c>>>31)},y.toHexString=function(c){return c.toString(16)},y.toBinaryString=function(c){return String(parseInt(String(c),2))},y.bitCount=function(c){return c=(c=(858993459&(c-=c>>>1&1431655765))+(c>>>2&858993459))+(c>>>4)&252645135,63&(c+=c>>>8)+(c>>>16)},y.truncDivision=function(c,l){return Math.trunc(c/l)},y.parseInt=function(c,l){return void 0===l&&(l=void 0),parseInt(c,l)},y.MIN_VALUE_32_BITS=-2147483648,y.MAX_VALUE=Number.MAX_SAFE_INTEGER,y}(),bi=function(){function y(c,l){void 0===c?(this.size=0,this.bits=new Int32Array(1)):(this.size=c,this.bits=null==l?y.makeArray(c):l)}return y.prototype.getSize=function(){return this.size},y.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},y.prototype.ensureCapacity=function(c){if(c>32*this.bits.length){var l=y.makeArray(c);Rt.arraycopy(this.bits,0,l,0,this.bits.length),this.bits=l}},y.prototype.get=function(c){return!!(this.bits[Math.floor(c/32)]&1<<(31&c))},y.prototype.set=function(c){this.bits[Math.floor(c/32)]|=1<<(31&c)},y.prototype.flip=function(c){this.bits[Math.floor(c/32)]^=1<<(31&c)},y.prototype.getNextSet=function(c){var l=this.size;if(c>=l)return l;var w=this.bits,U=Math.floor(c/32),J=w[U];J&=~((1<<(31&c))-1);for(var ce=w.length;0===J;){if(++U===ce)return l;J=w[U]}var ge=32*U+pi.numberOfTrailingZeros(J);return ge>l?l:ge},y.prototype.getNextUnset=function(c){var l=this.size;if(c>=l)return l;var w=this.bits,U=Math.floor(c/32),J=~w[U];J&=~((1<<(31&c))-1);for(var ce=w.length;0===J;){if(++U===ce)return l;J=~w[U]}var ge=32*U+pi.numberOfTrailingZeros(J);return ge>l?l:ge},y.prototype.setBulk=function(c,l){this.bits[Math.floor(c/32)]=l},y.prototype.setRange=function(c,l){if(lthis.size)throw new Bi;if(l!==c){l--;for(var w=Math.floor(c/32),U=Math.floor(l/32),J=this.bits,ce=w;ce<=U;ce++)J[ce]|=(2<<(cew?0:31&c))}},y.prototype.clear=function(){for(var c=this.bits.length,l=this.bits,w=0;wthis.size)throw new Bi;if(l===c)return!0;l--;for(var U=Math.floor(c/32),J=Math.floor(l/32),ce=this.bits,ge=U;ge<=J;ge++){var ut=(2<<(geU?0:31&c))&4294967295;if((ce[ge]&ut)!==(w?ut:0))return!1}return!0},y.prototype.appendBit=function(c){this.ensureCapacity(this.size+1),c&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},y.prototype.appendBits=function(c,l){if(l<0||l>32)throw new Bi("Num bits must be between 0 and 32");this.ensureCapacity(this.size+l);for(var w=l;w>0;w--)this.appendBit(1==(c>>w-1&1))},y.prototype.appendBitArray=function(c){var l=c.size;this.ensureCapacity(this.size+l);for(var w=0;w>1&1431655765|(1431655765&ce)<<1)>>2&858993459|(858993459&ce)<<2)>>4&252645135|(252645135&ce)<<4)>>8&16711935|(16711935&ce)<<8)>>16&65535|(65535&ce)<<16}if(this.size!==32*w){var ge=32*w-this.size,Pe=c[0]>>>ge;for(J=1;J>>ge}c[w-1]=Pe}this.bits=c},y.makeArray=function(c){return new Int32Array(Math.floor((c+31)/32))},y.prototype.equals=function(c){return c instanceof y&&(this.size===c.size&&Vi.equals(this.bits,c.bits))},y.prototype.hashCode=function(){return 31*this.size+Vi.hashCode(this.bits)},y.prototype.toString=function(){for(var c="",l=0,w=this.size;l=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(ce),Ht=Ot.next();!Ht.done;Ht=Ot.next())y.NAME_TO_ECI.set(Ht.value,this)}catch(jr){U={error:jr}}finally{try{Ht&&!Ht.done&&(J=Ot.return)&&J.call(Ot)}finally{if(U)throw U.error}}}return y.prototype.getValueIdentifier=function(){return this.valueIdentifier},y.prototype.getName=function(){return this.name},y.prototype.getValue=function(){return this.values[0]},y.getCharacterSetECIByValue=function(c){if(c<0||c>=900)throw new Qn("incorect value");var l=y.VALUES_TO_ECI.get(c);if(void 0===l)throw new Qn("incorect value");return l},y.getCharacterSetECIByName=function(c){var l=y.NAME_TO_ECI.get(c);if(void 0===l)throw new Qn("incorect value");return l},y.prototype.equals=function(c){if(!(c instanceof y))return!1;var l=c;return this.getName()===l.getName()},y.VALUE_IDENTIFIER_TO_ECI=new Map,y.VALUES_TO_ECI=new Map,y.NAME_TO_ECI=new Map,y.Cp437=new y(Ti.Cp437,Int32Array.from([0,2]),"Cp437"),y.ISO8859_1=new y(Ti.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),y.ISO8859_2=new y(Ti.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),y.ISO8859_3=new y(Ti.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),y.ISO8859_4=new y(Ti.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),y.ISO8859_5=new y(Ti.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),y.ISO8859_6=new y(Ti.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),y.ISO8859_7=new y(Ti.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),y.ISO8859_8=new y(Ti.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),y.ISO8859_9=new y(Ti.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),y.ISO8859_10=new y(Ti.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),y.ISO8859_11=new y(Ti.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),y.ISO8859_13=new y(Ti.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),y.ISO8859_14=new y(Ti.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),y.ISO8859_15=new y(Ti.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),y.ISO8859_16=new y(Ti.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),y.SJIS=new y(Ti.SJIS,20,"SJIS","Shift_JIS"),y.Cp1250=new y(Ti.Cp1250,21,"Cp1250","windows-1250"),y.Cp1251=new y(Ti.Cp1251,22,"Cp1251","windows-1251"),y.Cp1252=new y(Ti.Cp1252,23,"Cp1252","windows-1252"),y.Cp1256=new y(Ti.Cp1256,24,"Cp1256","windows-1256"),y.UnicodeBigUnmarked=new y(Ti.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),y.UTF8=new y(Ti.UTF8,26,"UTF8","UTF-8"),y.ASCII=new y(Ti.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),y.Big5=new y(Ti.Big5,28,"Big5"),y.GB18030=new y(Ti.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),y.EUC_KR=new y(Ti.EUC_KR,30,"EUC_KR","EUC-KR"),y}();var na=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const ia=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return na(c,y),c.kind="UnsupportedOperationException",c}(Us),Wt=function(){function y(){}return y.decode=function(c,l){var w=this.encodingName(l);return this.customDecoder?this.customDecoder(c,w):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(w)?this.decodeFallback(c,w):new TextDecoder(w).decode(c)},y.shouldDecodeOnFallback=function(c){return!y.isBrowser()&&"ISO-8859-1"===c},y.encode=function(c,l){var w=this.encodingName(l);return this.customEncoder?this.customEncoder(c,w):typeof TextEncoder>"u"?this.encodeFallback(c):(new TextEncoder).encode(c)},y.isBrowser=function(){return typeof window<"u"&&"[object Window]"==={}.toString.call(window)},y.encodingName=function(c){return"string"==typeof c?c:c.getName()},y.encodingCharacterSet=function(c){return c instanceof Yo?c:Yo.getCharacterSetECIByName(c)},y.decodeFallback=function(c,l){var w=this.encodingCharacterSet(l);if(y.isDecodeFallbackSupported(w)){for(var U="",J=0,ce=c.length;J3&&239===c[0]&&187===c[1]&&191===c[2],On=0;On0?128&Wn?ge--:ce=!1:128&Wn&&(64&Wn?(ge++,32&Wn?(ge++,16&Wn?(ge++,8&Wn?ce=!1:ut++):Ge++):Pe++):ce=!1)),U&&(Wn>127&&Wn<160?U=!1:Wn>159&&(Wn<192||215===Wn||247===Wn)&&dn++),J&&(_t>0?Wn<64||127===Wn||Wn>252?J=!1:_t--:128===Wn||160===Wn||Wn>239?J=!1:Wn>160&&Wn<224?(Ot++,Sr=0,++Ht>jr&&(jr=Ht)):Wn>127?(_t++,Ht=0,++Sr>sn&&(sn=Sr)):(Ht=0,Sr=0))}return ce&&ge>0&&(ce=!1),J&&_t>0&&(J=!1),ce&&(ln||Pe+Ge+ut>0)?y.UTF8:J&&(y.ASSUME_SHIFT_JIS||jr>=3||sn>=3)?y.SHIFT_JIS:U&&J?2===jr&&2===Ot||10*dn>=w?y.SHIFT_JIS:y.ISO88591:U?y.ISO88591:J?y.SHIFT_JIS:ce?y.UTF8:y.PLATFORM_DEFAULT_ENCODING},y.format=function(c){for(var l=[],w=1;wce){if(-1===ge)ge=J-ce;else if(J-ce!==ge)throw new Bi("row lengths do not match");ce=J,Pe++}Ge++}else if(c.substring(Ge,Ge+l.length)===l)Ge+=l.length,U[J]=!0,J++;else{if(c.substring(Ge,Ge+w.length)!==w)throw new Bi("illegal character encountered: "+c.substring(Ge));Ge+=w.length,U[J]=!1,J++}if(J>ce){if(-1===ge)ge=J-ce;else if(J-ce!==ge)throw new Bi("row lengths do not match");Pe++}for(var ut=new y(ge,Pe),_t=0;_t>>(31&c)&1)},y.prototype.set=function(c,l){var w=l*this.rowSize+Math.floor(c/32);this.bits[w]|=1<<(31&c)&4294967295},y.prototype.unset=function(c,l){var w=l*this.rowSize+Math.floor(c/32);this.bits[w]&=~(1<<(31&c)&4294967295)},y.prototype.flip=function(c,l){var w=l*this.rowSize+Math.floor(c/32);this.bits[w]^=1<<(31&c)&4294967295},y.prototype.xor=function(c){if(this.width!==c.getWidth()||this.height!==c.getHeight()||this.rowSize!==c.getRowSize())throw new Bi("input matrix dimensions do not match");for(var l=new bi(Math.floor(this.width/32)+1),w=this.rowSize,U=this.bits,J=0,ce=this.height;Jthis.height||J>this.width)throw new Bi("The region must fit inside the matrix");for(var ge=this.rowSize,Pe=this.bits,Ge=l;GePe&&(Pe=Ge),32*utge){for(Ot=31;!(_t>>>Ot);)Ot--;32*ut+Ot>ge&&(ge=32*ut+Ot)}}}return ge=0&&0===l[w];)w--;if(w<0)return null;for(var U=Math.floor(w/c),J=32*Math.floor(w%c),ce=l[w],ge=31;!(ce>>>ge);)ge--;return Int32Array.from([J+=ge,U])},y.prototype.getWidth=function(){return this.width},y.prototype.getHeight=function(){return this.height},y.prototype.getRowSize=function(){return this.rowSize},y.prototype.equals=function(c){return c instanceof y&&(this.width===c.width&&this.height===c.height&&this.rowSize===c.rowSize&&Vi.equals(this.bits,c.bits))},y.prototype.hashCode=function(){var c=this.width;return 31*(c=31*(c=31*(c=31*c+this.width)+this.height)+this.rowSize)+Vi.hashCode(this.bits)},y.prototype.toString=function(c,l,w){return void 0===c&&(c="X "),void 0===l&&(l=" "),void 0===w&&(w="\n"),this.buildToString(c,l,w)},y.prototype.buildToString=function(c,l,w){for(var U=new Ur,J=0,ce=this.height;J>c.LUMINANCE_SHIFT]++;var Ge=c.estimateBlackPoint(ge);if(J<3)for(Pe=0;Pe>c.LUMINANCE_SHIFT]++;var Ht=c.estimateBlackPoint(ce),Sr=l.getMatrix();for(ge=0;gece&&(J=ge,ce=l[ge]),l[ge]>U&&(U=l[ge]);var Pe=0,Ge=0;for(ge=0;geGe&&(Pe=ge,Ge=_t)}if(J>Pe){var Ot=J;J=Pe,Pe=Ot}if(Pe-J<=w/16)throw new Gn;var Ht=Pe-1,Sr=-1;for(ge=Pe-1;ge>J;ge--){var _t,jr=ge-J;(_t=jr*jr*(Pe-ge)*(U-l[ge]))>Sr&&(Ht=ge,Sr=_t)}return Ht<=c.MINIMUM_DIMENSION&&U>=c.MINIMUM_DIMENSION){var J=l.getMatrix(),ce=w>>c.BLOCK_SIZE_POWER;w&c.BLOCK_SIZE_MASK&&ce++;var ge=U>>c.BLOCK_SIZE_POWER;U&c.BLOCK_SIZE_MASK&&ge++;var Pe=c.calculateBlackPoints(J,ce,ge,w,U),Ge=new Qi(w,U);c.calculateThresholdForBlock(J,ce,ge,w,U,Pe,Ge),this.matrix=Ge}else this.matrix=y.prototype.getBlackMatrix.call(this);return this.matrix},c.prototype.createBinarizer=function(l){return new c(l)},c.calculateThresholdForBlock=function(l,w,U,J,ce,ge,Pe){for(var Ge=ce-c.BLOCK_SIZE,ut=J-c.BLOCK_SIZE,_t=0;_tGe&&(Ot=Ge);for(var Ht=c.cap(_t,2,U-3),Sr=0;Srut&&(jr=ut);for(var sn=c.cap(Sr,2,w-3),dn=0,ln=-2;ln<=2;ln++){var On=ge[Ht+ln];dn+=On[sn-2]+On[sn-1]+On[sn]+On[sn+1]+On[sn+2]}c.thresholdBlock(l,jr,Ot,dn/25,J,Pe)}}},c.cap=function(l,w,U){return lU?U:l},c.thresholdBlock=function(l,w,U,J,ce,ge){for(var Pe=0,Ge=U*ce+w;Pege&&(_t=ge);for(var Ot=0;OtPe&&(Ht=Pe);for(var Sr=0,jr=255,sn=0,dn=0,ln=_t*J+Ht;dnsn&&(sn=Wn)}if(sn-jr>c.MIN_DYNAMIC_RANGE)for(dn++,ln+=J;dn>2*c.BLOCK_SIZE_POWER;if(sn-jr<=c.MIN_DYNAMIC_RANGE&&(vi=jr/2,ut>0&&Ot>0)){var ki=(Ge[ut-1][Ot]+2*Ge[ut][Ot-1]+Ge[ut-1][Ot-1])/4;jr>10}else{ce=0,ge=0;for(var Sr=l.length;ce>10)}return J},c.prototype.getRow=function(l,w){if(l<0||l>=this.getHeight())throw new Bi("Requested row is outside the image: "+l);var U=this.getWidth(),J=l*U;return null===w?w=this.buffer.slice(J,J+U):(w.length0&&J[J.length-1])&&(6===Ge[0]||2===Ge[0])){l=0;continue}if(3===Ge[0]&&(!J||Ge[1]>J[0]&&Ge[1]=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),U=w.next();!U.done;U=w.next())"videoinput"===(ce="video"===(J=U.value).kind?"videoinput":J.kind)&&l.push({deviceId:J.deviceId||J.id,label:J.label||"Video device "+(l.length+1),kind:ce,groupId:J.groupId})}catch(Sr){_t={error:Sr}}finally{try{U&&!U.done&&(Ot=w.return)&&Ot.call(w)}finally{if(_t)throw _t.error}}return[2,l]}})})},y.prototype.getVideoInputDevices=function(){return Ka(this,void 0,void 0,function(){return sc(this,function(l){switch(l.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,l.sent().map(function(w){return new $s(w.deviceId,w.label)})]}})})},y.prototype.findDeviceById=function(c){return Ka(this,void 0,void 0,function(){var l;return sc(this,function(w){switch(w.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(l=w.sent())?[2,l.find(function(U){return U.deviceId===c})]:[2,null]}})})},y.prototype.decodeFromInputVideoDevice=function(c,l){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:return[4,this.decodeOnceFromVideoDevice(c,l)];case 1:return[2,w.sent()]}})})},y.prototype.decodeOnceFromVideoDevice=function(c,l){return Ka(this,void 0,void 0,function(){return sc(this,function(J){switch(J.label){case 0:return this.reset(),[4,this.decodeOnceFromConstraints({video:c?{deviceId:{exact:c}}:{facingMode:"environment"}},l)];case 1:return[2,J.sent()]}})})},y.prototype.decodeOnceFromConstraints=function(c,l){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(U){switch(U.label){case 0:return[4,navigator.mediaDevices.getUserMedia(c)];case 1:return w=U.sent(),[4,this.decodeOnceFromStream(w,l)];case 2:return[2,U.sent()]}})})},y.prototype.decodeOnceFromStream=function(c,l){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(J){switch(J.label){case 0:return this.reset(),[4,this.attachStreamToVideo(c,l)];case 1:return w=J.sent(),[4,this.decodeOnce(w)];case 2:return[2,J.sent()]}})})},y.prototype.decodeFromInputVideoDeviceContinuously=function(c,l,w){return Ka(this,void 0,void 0,function(){return sc(this,function(U){switch(U.label){case 0:return[4,this.decodeFromVideoDevice(c,l,w)];case 1:return[2,U.sent()]}})})},y.prototype.decodeFromVideoDevice=function(c,l,w){return Ka(this,void 0,void 0,function(){return sc(this,function(ce){switch(ce.label){case 0:return[4,this.decodeFromConstraints({video:c?{deviceId:{exact:c}}:{facingMode:"environment"}},l,w)];case 1:return[2,ce.sent()]}})})},y.prototype.decodeFromConstraints=function(c,l,w){return Ka(this,void 0,void 0,function(){var U;return sc(this,function(J){switch(J.label){case 0:return[4,navigator.mediaDevices.getUserMedia(c)];case 1:return U=J.sent(),[4,this.decodeFromStream(U,l,w)];case 2:return[2,J.sent()]}})})},y.prototype.decodeFromStream=function(c,l,w){return Ka(this,void 0,void 0,function(){var U;return sc(this,function(J){switch(J.label){case 0:return this.reset(),[4,this.attachStreamToVideo(c,l)];case 1:return U=J.sent(),[4,this.decodeContinuously(U,w)];case 2:return[2,J.sent()]}})})},y.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},y.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},y.prototype.attachStreamToVideo=function(c,l){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(U){switch(U.label){case 0:return w=this.prepareVideoElement(l),this.addVideoSource(w,c),this.videoElement=w,this.stream=c,[4,this.playVideoOnLoadAsync(w)];case 1:return U.sent(),[2,w]}})})},y.prototype.playVideoOnLoadAsync=function(c){var l=this;return new Promise(function(w,U){return l.playVideoOnLoad(c,function(){return w()})})},y.prototype.playVideoOnLoad=function(c,l){var w=this;this.videoEndedListener=function(){return w.stopStreams()},this.videoCanPlayListener=function(){return w.tryPlayVideo(c)},c.addEventListener("ended",this.videoEndedListener),c.addEventListener("canplay",this.videoCanPlayListener),c.addEventListener("playing",l),this.tryPlayVideo(c)},y.prototype.isVideoPlaying=function(c){return c.currentTime>0&&!c.paused&&!c.ended&&c.readyState>2},y.prototype.tryPlayVideo=function(c){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:if(this.isVideoPlaying(c))return console.warn("Trying to play video that is already playing."),[2];w.label=1;case 1:return w.trys.push([1,3,,4]),[4,c.play()];case 2:return w.sent(),[3,4];case 3:return w.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},y.prototype.getMediaElement=function(c,l){var w=document.getElementById(c);if(!w)throw new vs("element with id '"+c+"' not found");if(w.nodeName.toLowerCase()!==l.toLowerCase())throw new vs("element with id '"+c+"' must be an "+l+" element");return w},y.prototype.decodeFromImage=function(c,l){if(!c&&!l)throw new vs("either imageElement with a src set or an url must be provided");return l&&!c?this.decodeFromImageUrl(l):this.decodeFromImageElement(c)},y.prototype.decodeFromVideo=function(c,l){if(!c&&!l)throw new vs("Either an element with a src set or an URL must be provided");return l&&!c?this.decodeFromVideoUrl(l):this.decodeFromVideoElement(c)},y.prototype.decodeFromVideoContinuously=function(c,l,w){if(void 0===c&&void 0===l)throw new vs("Either an element with a src set or an URL must be provided");return l&&!c?this.decodeFromVideoUrlContinuously(l,w):this.decodeFromVideoElementContinuously(c,w)},y.prototype.decodeFromImageElement=function(c){if(!c)throw new vs("An image element must be provided.");this.reset();var l=this.prepareImageElement(c);return this.imageElement=l,this.isImageLoaded(l)?this.decodeOnce(l,!1,!0):this._decodeOnLoadImage(l)},y.prototype.decodeFromVideoElement=function(c){var l=this._decodeFromVideoElementSetup(c);return this._decodeOnLoadVideo(l)},y.prototype.decodeFromVideoElementContinuously=function(c,l){var w=this._decodeFromVideoElementSetup(c);return this._decodeOnLoadVideoContinuously(w,l)},y.prototype._decodeFromVideoElementSetup=function(c){if(!c)throw new vs("A video element must be provided.");this.reset();var l=this.prepareVideoElement(c);return this.videoElement=l,l},y.prototype.decodeFromImageUrl=function(c){if(!c)throw new vs("An URL must be provided.");this.reset();var l=this.prepareImageElement();this.imageElement=l;var w=this._decodeOnLoadImage(l);return l.src=c,w},y.prototype.decodeFromVideoUrl=function(c){if(!c)throw new vs("An URL must be provided.");this.reset();var l=this.prepareVideoElement(),w=this.decodeFromVideoElement(l);return l.src=c,w},y.prototype.decodeFromVideoUrlContinuously=function(c,l){if(!c)throw new vs("An URL must be provided.");this.reset();var w=this.prepareVideoElement(),U=this.decodeFromVideoElementContinuously(w,l);return w.src=c,U},y.prototype._decodeOnLoadImage=function(c){var l=this;return new Promise(function(w,U){l.imageLoadedListener=function(){return l.decodeOnce(c,!1,!0).then(w,U)},c.addEventListener("load",l.imageLoadedListener)})},y.prototype._decodeOnLoadVideo=function(c){return Ka(this,void 0,void 0,function(){return sc(this,function(l){switch(l.label){case 0:return[4,this.playVideoOnLoadAsync(c)];case 1:return l.sent(),[4,this.decodeOnce(c)];case 2:return[2,l.sent()]}})})},y.prototype._decodeOnLoadVideoContinuously=function(c,l){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:return[4,this.playVideoOnLoadAsync(c)];case 1:return w.sent(),this.decodeContinuously(c,l),[2]}})})},y.prototype.isImageLoaded=function(c){return!(!c.complete||0===c.naturalWidth)},y.prototype.prepareImageElement=function(c){var l;return typeof c>"u"&&((l=document.createElement("img")).width=200,l.height=200),"string"==typeof c&&(l=this.getMediaElement(c,"img")),c instanceof HTMLImageElement&&(l=c),l},y.prototype.prepareVideoElement=function(c){var l;return!c&&typeof document<"u"&&((l=document.createElement("video")).width=200,l.height=200),"string"==typeof c&&(l=this.getMediaElement(c,"video")),c instanceof HTMLVideoElement&&(l=c),l.setAttribute("autoplay","true"),l.setAttribute("muted","true"),l.setAttribute("playsinline","true"),l},y.prototype.decodeOnce=function(c,l,w){var U=this;void 0===l&&(l=!0),void 0===w&&(w=!0),this._stopAsyncDecode=!1;var J=function(ce,ge){if(U._stopAsyncDecode)return ge(new Gn("Video stream has ended before any code could be detected.")),void(U._stopAsyncDecode=void 0);try{ce(U.decode(c))}catch(Ot){if(l&&Ot instanceof Gn||(Ot instanceof rs||Ot instanceof Qn)&&w)return setTimeout(J,U._timeBetweenDecodingAttempts,ce,ge);ge(Ot)}};return new Promise(function(ce,ge){return J(ce,ge)})},y.prototype.decodeContinuously=function(c,l){var w=this;this._stopContinuousDecode=!1;var U=function(){if(w._stopContinuousDecode)w._stopContinuousDecode=void 0;else try{var J=w.decode(c);l(J,null),setTimeout(U,w.timeBetweenScansMillis)}catch(Pe){l(null,Pe),(Pe instanceof rs||Pe instanceof Qn||Pe instanceof Gn)&&setTimeout(U,w._timeBetweenDecodingAttempts)}};U()},y.prototype.decode=function(c){var l=this.createBinaryBitmap(c);return this.decodeBitmap(l)},y.prototype.createBinaryBitmap=function(c){this.getCaptureCanvasContext(c),c instanceof HTMLVideoElement?this.drawFrameOnCanvas(c):this.drawImageOnCanvas(c);var w=this.getCaptureCanvas(c),U=new dc(w),J=new mc(U);return new jc(J)},y.prototype.getCaptureCanvasContext=function(c){if(!this.captureCanvasContext){var l=this.getCaptureCanvas(c),w=void 0;try{w=l.getContext("2d",{willReadFrequently:!0})}catch{w=l.getContext("2d")}this.captureCanvasContext=w}return this.captureCanvasContext},y.prototype.getCaptureCanvas=function(c){if(!this.captureCanvas){var l=this.createCaptureCanvas(c);this.captureCanvas=l}return this.captureCanvas},y.prototype.drawFrameOnCanvas=function(c,l,w){void 0===l&&(l={sx:0,sy:0,sWidth:c.videoWidth,sHeight:c.videoHeight,dx:0,dy:0,dWidth:c.videoWidth,dHeight:c.videoHeight}),void 0===w&&(w=this.captureCanvasContext),w.drawImage(c,l.sx,l.sy,l.sWidth,l.sHeight,l.dx,l.dy,l.dWidth,l.dHeight)},y.prototype.drawImageOnCanvas=function(c,l,w){void 0===l&&(l={sx:0,sy:0,sWidth:c.naturalWidth,sHeight:c.naturalHeight,dx:0,dy:0,dWidth:c.naturalWidth,dHeight:c.naturalHeight}),void 0===w&&(w=this.captureCanvasContext),w.drawImage(c,l.sx,l.sy,l.sWidth,l.sHeight,l.dx,l.dy,l.dWidth,l.dHeight)},y.prototype.decodeBitmap=function(c){return this.reader.decode(c,this._hints)},y.prototype.createCaptureCanvas=function(c){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var w,U,l=document.createElement("canvas");return typeof c<"u"&&(c instanceof HTMLVideoElement?(w=c.videoWidth,U=c.videoHeight):c instanceof HTMLImageElement&&(w=c.naturalWidth||c.width,U=c.naturalHeight||c.height)),l.style.width=w+"px",l.style.height=U+"px",l.width=w,l.height=U,l},y.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(c){return c.stop()}),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},y.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},y.prototype._destroyVideoElement=function(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},y.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},y.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},y.prototype.addVideoSource=function(c,l){try{c.srcObject=l}catch{c.src=URL.createObjectURL(l)}},y.prototype.cleanVideoSource=function(c){try{c.srcObject=null}catch{c.src=""}this.videoElement.removeAttribute("src")},y}();const Cs=function(){function y(c,l,w,U,J,ce){void 0===w&&(w=null==l?0:8*l.length),void 0===ce&&(ce=Rt.currentTimeMillis()),this.text=c,this.rawBytes=l,this.numBits=w,this.resultPoints=U,this.format=J,this.timestamp=ce,this.text=c,this.rawBytes=l,this.numBits=null==w?null==l?0:8*l.length:w,this.resultPoints=U,this.format=J,this.resultMetadata=null,this.timestamp=null==ce?Rt.currentTimeMillis():ce}return y.prototype.getText=function(){return this.text},y.prototype.getRawBytes=function(){return this.rawBytes},y.prototype.getNumBits=function(){return this.numBits},y.prototype.getResultPoints=function(){return this.resultPoints},y.prototype.getBarcodeFormat=function(){return this.format},y.prototype.getResultMetadata=function(){return this.resultMetadata},y.prototype.putMetadata=function(c,l){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(c,l)},y.prototype.putAllMetadata=function(c){null!==c&&(this.resultMetadata=null===this.resultMetadata?c:new Map(c))},y.prototype.addResultPoints=function(c){var l=this.resultPoints;if(null===l)this.resultPoints=c;else if(null!==c&&c.length>0){var w=new Array(l.length+c.length);Rt.arraycopy(l,0,w,0,l.length),Rt.arraycopy(c,0,w,l.length,c.length),this.resultPoints=w}},y.prototype.getTimestamp=function(){return this.timestamp},y.prototype.toString=function(){return this.text},y}();var vf=function(y){return y[y.AZTEC=0]="AZTEC",y[y.CODABAR=1]="CODABAR",y[y.CODE_39=2]="CODE_39",y[y.CODE_93=3]="CODE_93",y[y.CODE_128=4]="CODE_128",y[y.DATA_MATRIX=5]="DATA_MATRIX",y[y.EAN_8=6]="EAN_8",y[y.EAN_13=7]="EAN_13",y[y.ITF=8]="ITF",y[y.MAXICODE=9]="MAXICODE",y[y.PDF_417=10]="PDF_417",y[y.QR_CODE=11]="QR_CODE",y[y.RSS_14=12]="RSS_14",y[y.RSS_EXPANDED=13]="RSS_EXPANDED",y[y.UPC_A=14]="UPC_A",y[y.UPC_E=15]="UPC_E",y[y.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION",y}(vf||{});const Co=vf;var vh=function(y){return y[y.OTHER=0]="OTHER",y[y.ORIENTATION=1]="ORIENTATION",y[y.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",y[y.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",y[y.ISSUE_NUMBER=4]="ISSUE_NUMBER",y[y.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",y[y.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",y[y.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",y[y.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",y[y.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",y[y.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY",y}(vh||{});const gc=vh,qu=function(){function y(c,l,w,U,J,ce){void 0===J&&(J=-1),void 0===ce&&(ce=-1),this.rawBytes=c,this.text=l,this.byteSegments=w,this.ecLevel=U,this.structuredAppendSequenceNumber=J,this.structuredAppendParity=ce,this.numBits=null==c?0:8*c.length}return y.prototype.getRawBytes=function(){return this.rawBytes},y.prototype.getNumBits=function(){return this.numBits},y.prototype.setNumBits=function(c){this.numBits=c},y.prototype.getText=function(){return this.text},y.prototype.getByteSegments=function(){return this.byteSegments},y.prototype.getECLevel=function(){return this.ecLevel},y.prototype.getErrorsCorrected=function(){return this.errorsCorrected},y.prototype.setErrorsCorrected=function(c){this.errorsCorrected=c},y.prototype.getErasures=function(){return this.erasures},y.prototype.setErasures=function(c){this.erasures=c},y.prototype.getOther=function(){return this.other},y.prototype.setOther=function(c){this.other=c},y.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},y.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},y.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},y}(),tl=function(){function y(){}return y.prototype.exp=function(c){return this.expTable[c]},y.prototype.log=function(c){if(0===c)throw new Bi;return this.logTable[c]},y.addOrSubtract=function(c,l){return c^l},y}(),mu=function(){function y(c,l){if(0===l.length)throw new Bi;this.field=c;var w=l.length;if(w>1&&0===l[0]){for(var U=1;Uw.length){var U=l;l=w,w=U}var J=new Int32Array(w.length),ce=w.length-l.length;Rt.arraycopy(w,0,J,0,ce);for(var ge=ce;ge=c.getDegree()&&!U.isZero();){var ge=U.getDegree()-c.getDegree(),Pe=l.multiply(U.getCoefficient(U.getDegree()),ce),Ge=c.multiplyByMonomial(ge,Pe),ut=l.buildMonomial(ge,Pe);w=w.addOrSubtract(ut),U=U.addOrSubtract(Ge)}return[w,U]},y.prototype.toString=function(){for(var c="",l=this.getDegree();l>=0;l--){var w=this.getCoefficient(l);if(0!==w){if(w<0?(c+=" - ",w=-w):c.length>0&&(c+=" + "),0===l||1!==w){var U=this.field.log(w);0===U?c+="1":1===U?c+="a":(c+="a^",c+=U)}0!==l&&(1===l?c+="x":(c+="x^",c+=l))}}return c},y}();var Ll=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Rd=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return Ll(c,y),c.kind="ArithmeticException",c}(Us);var ju=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Pa=function(y){function c(l,w,U){var J=y.call(this)||this;J.primitive=l,J.size=w,J.generatorBase=U;for(var ce=new Int32Array(w),ge=1,Pe=0;Pe=w&&(ge^=l,ge&=w-1);J.expTable=ce;var Ge=new Int32Array(w);for(Pe=0;Pe=(w/2|0);){var ut=ce,_t=Pe;if(Pe=Ge,(ce=ge).isZero())throw new Hl("r_{i-1} was zero");ge=ut;for(var Ot=J.getZero(),Ht=ce.getCoefficient(ce.getDegree()),Sr=J.inverse(Ht);ge.getDegree()>=ce.getDegree()&&!ge.isZero();){var jr=ge.getDegree()-ce.getDegree(),sn=J.multiply(ge.getCoefficient(ge.getDegree()),Sr);Ot=Ot.addOrSubtract(J.buildMonomial(jr,sn)),ge=ge.addOrSubtract(ce.multiplyByMonomial(jr,sn))}if(Ge=Ot.multiply(Pe).addOrSubtract(_t),ge.getDegree()>=ce.getDegree())throw new ou("Division algorithm failed to reduce polynomial?")}var dn=Ge.getCoefficient(0);if(0===dn)throw new Hl("sigmaTilde(0) was zero");var ln=J.inverse(dn);return[Ge.multiplyScalar(ln),ge.multiplyScalar(ln)]},y.prototype.findErrorLocations=function(c){var l=c.getDegree();if(1===l)return Int32Array.from([c.getCoefficient(1)]);for(var w=new Int32Array(l),U=0,J=this.field,ce=1;ce1,Sr,Sr+w-1),Sr+=w-1;else for(var jr=w-1;jr>=0;--jr)Ht[Sr++]=!!(Ot&1<=8?y.readCode(c,l,8):y.readCode(c,l,w)<<8-w},y.convertBoolArrayToByteArray=function(c){for(var l=new Uint8Array((c.length+7)/8),w=0;w","?","[","]","{","}","CTRL_UL"],y.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],y}(),Ys=function(){function y(){}return y.round=function(c){return isNaN(c)?0:c<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:c>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:c+(c<0?-.5:.5)|0},y.distance=function(c,l,w,U){var J=c-w,ce=l-U;return Math.sqrt(J*J+ce*ce)},y.sum=function(c){for(var l=0,w=0,U=c.length;w!==U;w++)l+=c[w];return l},y}(),yc=function(){function y(){}return y.floatToIntBits=function(c){return c},y.MAX_VALUE=Number.MAX_SAFE_INTEGER,y}(),_o=function(){function y(c,l){this.x=c,this.y=l}return y.prototype.getX=function(){return this.x},y.prototype.getY=function(){return this.y},y.prototype.equals=function(c){return c instanceof y&&(this.x===c.x&&this.y===c.y)},y.prototype.hashCode=function(){return 31*yc.floatToIntBits(this.x)+yc.floatToIntBits(this.y)},y.prototype.toString=function(){return"("+this.x+","+this.y+")"},y.orderBestPatterns=function(c){var J,ce,ge,l=this.distance(c[0],c[1]),w=this.distance(c[1],c[2]),U=this.distance(c[0],c[2]);if(w>=l&&w>=U?(ce=c[0],J=c[1],ge=c[2]):U>=w&&U>=l?(ce=c[1],J=c[0],ge=c[2]):(ce=c[2],J=c[0],ge=c[1]),this.crossProductZ(J,ce,ge)<0){var Pe=J;J=ge,ge=Pe}c[0]=J,c[1]=ce,c[2]=ge},y.distance=function(c,l){return Ys.distance(c.x,c.y,l.x,l.y)},y.crossProductZ=function(c,l,w){var U=l.x,J=l.y;return(w.x-U)*(c.y-J)-(w.y-J)*(c.x-U)},y}(),cr=function(){function y(c,l){this.bits=c,this.points=l}return y.prototype.getBits=function(){return this.bits},y.prototype.getPoints=function(){return this.points},y}();var Mt=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Xr=function(y){function c(l,w,U,J,ce){var ge=y.call(this,l,w)||this;return ge.compact=U,ge.nbDatablocks=J,ge.nbLayers=ce,ge}return Mt(c,y),c.prototype.getNbLayers=function(){return this.nbLayers},c.prototype.getNbDatablocks=function(){return this.nbDatablocks},c.prototype.isCompact=function(){return this.compact},c}(cr),ri=function(){function y(c,l,w,U){this.image=c,this.height=c.getHeight(),this.width=c.getWidth(),null==l&&(l=y.INIT_SIZE),null==w&&(w=c.getWidth()/2|0),null==U&&(U=c.getHeight()/2|0);var J=l/2|0;if(this.leftInit=w-J,this.rightInit=w+J,this.upInit=U-J,this.downInit=U+J,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Gn}return y.prototype.detect=function(){for(var c=this.leftInit,l=this.rightInit,w=this.upInit,U=this.downInit,J=!1,ce=!0,ge=!1,Pe=!1,Ge=!1,ut=!1,_t=!1,Ot=this.width,Ht=this.height;ce;){ce=!1;for(var Sr=!0;(Sr||!Pe)&&l=Ot){J=!0;break}for(var jr=!0;(jr||!Ge)&&U=Ht){J=!0;break}for(var sn=!0;(sn||!ut)&&c>=0;)(sn=this.containsBlackPoint(w,U,c,!1))?(c--,ce=!0,ut=!0):ut||c--;if(c<0){J=!0;break}for(var dn=!0;(dn||!_t)&&w>=0;)(dn=this.containsBlackPoint(c,l,w,!0))?(w--,ce=!0,_t=!0):_t||w--;if(w<0){J=!0;break}ce&&(ge=!0)}if(!J&&ge){for(var ln=l-c,On=null,Wn=1;null===On&&Wnw||Pe<-1||Pe>U)throw new Gn;J=!1,-1===ge?(l[ce]=0,J=!0):ge===w&&(l[ce]=w-1,J=!0),-1===Pe?(l[ce+1]=0,J=!0):Pe===U&&(l[ce+1]=U-1,J=!0)}for(J=!0,ce=l.length-2;ce>=0&&J;ce-=2){if(ge=Math.floor(l[ce]),Pe=Math.floor(l[ce+1]),ge<-1||ge>w||Pe<-1||Pe>U)throw new Gn;J=!1,-1===ge?(l[ce]=0,J=!0):ge===w&&(l[ce]=w-1,J=!0),-1===Pe?(l[ce+1]=0,J=!0):Pe===U&&(l[ce+1]=U-1,J=!0)}},y}(),Bs=function(){function y(c,l,w,U,J,ce,ge,Pe,Ge){this.a11=c,this.a21=l,this.a31=w,this.a12=U,this.a22=J,this.a32=ce,this.a13=ge,this.a23=Pe,this.a33=Ge}return y.quadrilateralToQuadrilateral=function(c,l,w,U,J,ce,ge,Pe,Ge,ut,_t,Ot,Ht,Sr,jr,sn){var dn=y.quadrilateralToSquare(c,l,w,U,J,ce,ge,Pe);return y.squareToQuadrilateral(Ge,ut,_t,Ot,Ht,Sr,jr,sn).times(dn)},y.prototype.transformPoints=function(c){for(var l=c.length,w=this.a11,U=this.a12,J=this.a13,ce=this.a21,ge=this.a22,Pe=this.a23,Ge=this.a31,ut=this.a32,_t=this.a33,Ot=0;Ot>1&127):(U<<=10,U+=(ce>>2&992)+(ce>>1&31))}var ge=this.getCorrectedParameterData(U,this.compact);this.compact?(this.nbLayers=1+(ge>>6),this.nbDataBlocks=1+(63&ge)):(this.nbLayers=1+(ge>>11),this.nbDataBlocks=1+(2047&ge))},y.prototype.getRotation=function(c,l){var w=0;c.forEach(function(J,ce,ge){w=(J>>l-2<<1)+(1&J)+(w<<3)}),w=((1&w)<<11)+(w>>1);for(var U=0;U<4;U++)if(pi.bitCount(w^this.EXPECTED_CORNER_BITS[U])<=2)return U;throw new Gn},y.prototype.getCorrectedParameterData=function(c,l){var w,U;l?(w=7,U=2):(w=10,U=4);for(var J=w-U,ce=new Int32Array(w),ge=w-1;ge>=0;--ge)ce[ge]=15&c,c>>=4;try{new xc(Pa.AZTEC_PARAM).decode(ce,J)}catch{throw new Gn}var Ge=0;for(ge=0;ge2){var _t=this.distancePoint(ut,ge)*this.nbCenterLayers/(this.distancePoint(J,l)*(this.nbCenterLayers+2));if(_t<.75||_t>1.25||!this.isWhiteOrBlackRectangle(ge,Pe,Ge,ut))break}l=ge,w=Pe,U=Ge,J=ut,ce=!ce}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new Gn;this.compact=5===this.nbCenterLayers;var Ot=new _o(l.getX()+.5,l.getY()-.5),Ht=new _o(w.getX()+.5,w.getY()+.5),Sr=new _o(U.getX()-.5,U.getY()+.5),jr=new _o(J.getX()-.5,J.getY()-.5);return this.expandSquare([Ot,Ht,Sr,jr],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},y.prototype.getMatrixCenter=function(){var c,l,w,U;try{c=(J=new ri(this.image).detect())[0],l=J[1],w=J[2],U=J[3]}catch{var ce=this.image.getWidth()/2,ge=this.image.getHeight()/2;c=this.getFirstDifferent(new is(ce+7,ge-7),!1,1,-1).toResultPoint(),l=this.getFirstDifferent(new is(ce+7,ge+7),!1,1,1).toResultPoint(),w=this.getFirstDifferent(new is(ce-7,ge+7),!1,-1,1).toResultPoint(),U=this.getFirstDifferent(new is(ce-7,ge-7),!1,-1,-1).toResultPoint()}var Pe=Ys.round((c.getX()+U.getX()+l.getX()+w.getX())/4),Ge=Ys.round((c.getY()+U.getY()+l.getY()+w.getY())/4);try{var J;c=(J=new ri(this.image,15,Pe,Ge).detect())[0],l=J[1],w=J[2],U=J[3]}catch{c=this.getFirstDifferent(new is(Pe+7,Ge-7),!1,1,-1).toResultPoint(),l=this.getFirstDifferent(new is(Pe+7,Ge+7),!1,1,1).toResultPoint(),w=this.getFirstDifferent(new is(Pe-7,Ge+7),!1,-1,1).toResultPoint(),U=this.getFirstDifferent(new is(Pe-7,Ge-7),!1,-1,-1).toResultPoint()}return Pe=Ys.round((c.getX()+U.getX()+l.getX()+w.getX())/4),Ge=Ys.round((c.getY()+U.getY()+l.getY()+w.getY())/4),new is(Pe,Ge)},y.prototype.getMatrixCornerPoints=function(c){return this.expandSquare(c,2*this.nbCenterLayers,this.getDimension())},y.prototype.sampleGrid=function(c,l,w,U,J){var ce=yo.getInstance(),ge=this.getDimension(),Pe=ge/2-this.nbCenterLayers,Ge=ge/2+this.nbCenterLayers;return ce.sampleGrid(c,ge,ge,Pe,Pe,Ge,Pe,Ge,Ge,Pe,Ge,l.getX(),l.getY(),w.getX(),w.getY(),U.getX(),U.getY(),J.getX(),J.getY())},y.prototype.sampleLine=function(c,l,w){for(var U=0,J=this.distanceResultPoint(c,l),ce=J/w,ge=c.getX(),Pe=c.getY(),Ge=ce*(l.getX()-c.getX())/J,ut=ce*(l.getY()-c.getY())/J,_t=0;_t.1&&Ot<.9?0:Ot<=.1===Ge?1:-1},y.prototype.getFirstDifferent=function(c,l,w,U){for(var J=c.getX()+w,ce=c.getY()+U;this.isValid(J,ce)&&this.image.get(J,ce)===l;)J+=w,ce+=U;for(J-=w,ce-=U;this.isValid(J,ce)&&this.image.get(J,ce)===l;)J+=w;for(J-=w;this.isValid(J,ce)&&this.image.get(J,ce)===l;)ce+=U;return new is(J,ce-=U)},y.prototype.expandSquare=function(c,l,w){var U=w/(2*l),J=c[0].getX()-c[2].getX(),ce=c[0].getY()-c[2].getY(),ge=(c[0].getX()+c[2].getX())/2,Pe=(c[0].getY()+c[2].getY())/2,Ge=new _o(ge+U*J,Pe+U*ce),ut=new _o(ge-U*J,Pe-U*ce);return J=c[1].getX()-c[3].getX(),ce=c[1].getY()-c[3].getY(),ge=(c[1].getX()+c[3].getX())/2,Pe=(c[1].getY()+c[3].getY())/2,[Ge,new _o(ge+U*J,Pe+U*ce),ut,new _o(ge-U*J,Pe-U*ce)]},y.prototype.isValid=function(c,l){return c>=0&&c0&&l>(ce?8:5));Pe=ce?U:15;for(var Ge=Math.trunc(U/2),ut=0;ut=U)break;try{J=c.getBlackRow(Ht,J)}catch{continue}for(var Sr=function(ln){if(1===ln&&(J.reverse(),l&&!0===l.get(Ci.NEED_RESULT_POINT_CALLBACK))){var On=new Map;l.forEach(function(ki,Xi){return On.set(Xi,ki)}),On.delete(Ci.NEED_RESULT_POINT_CALLBACK),l=On}try{var Wn=jr.decodeRow(Ht,J,l);if(1===ln){Wn.putMetadata(gc.ORIENTATION,180);var vi=Wn.getResultPoints();null!==vi&&(vi[0]=new _o(w-vi[0].getX()-1,vi[0].getY()),vi[1]=new _o(w-vi[1].getX()-1,vi[1].getY()))}return{value:Wn}}catch{}},jr=this,sn=0;sn<2;sn++){var dn=Sr(sn);if("object"==typeof dn)return dn.value}}throw new Gn},y.recordPattern=function(c,l,w){for(var U=w.length,J=0;J=ce)throw new Gn;for(var ge=!c.get(l),Pe=0,Ge=l;Ge0&&U>=0;)c.get(--l)!==J&&(U--,J=!J);if(U>=0)throw new Gn;y.recordPattern(c,l+1,w)},y.patternMatchVariance=function(c,l,w){for(var U=c.length,J=0,ce=0,ge=0;geOt?_t-Ot:Ot-_t;if(Ht>w)return Number.POSITIVE_INFINITY;Ge+=Ht}return Ge/J},y}();var gr=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const en=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return gr(c,y),c.findStartPattern=function(l){for(var w=l.getSize(),U=l.getNextSet(0),J=0,ce=Int32Array.from([0,0,0,0,0,0]),ge=U,Pe=!1,ut=U;ut=0&&l.isRange(Math.max(0,ge-(ut-ge)/2),ge,!1))return Int32Array.from([ge,ut,Ot]);ge+=ce[0]+ce[1],(ce=ce.slice(2,ce.length))[J-1]=0,ce[J]=0,J--}else J++;ce[J]=1,Pe=!Pe}throw new Gn},c.decodeCode=function(l,w,U){Ut.recordPattern(l,U,w);for(var J=c.MAX_AVG_VARIANCE,ce=-1,ge=0;ge=0)return ce;throw new Gn},c.prototype.decodeRow=function(l,w,U){var ut,J=U&&!0===U.get(Ci.ASSUME_GS1),ce=c.findStartPattern(w),ge=ce[2],Pe=0,Ge=new Uint8Array(20);switch(Ge[Pe++]=ge,ge){case c.CODE_START_A:ut=c.CODE_CODE_A;break;case c.CODE_START_B:ut=c.CODE_CODE_B;break;case c.CODE_START_C:ut=c.CODE_CODE_C;break;default:throw new Qn}for(var _t=!1,Ot=!1,Ht="",Sr=ce[0],jr=ce[1],sn=Int32Array.from([0,0,0,0,0,0]),dn=0,ln=0,On=ge,Wn=0,vi=!0,ki=!1,Xi=!1;!_t;){var So=Ot;switch(Ot=!1,dn=ln,ln=c.decodeCode(w,sn,jr),Ge[Pe++]=ln,ln!==c.CODE_STOP&&(vi=!0),ln!==c.CODE_STOP&&(On+=++Wn*ln),Sr=jr,jr+=sn.reduce(function(rb,nb){return rb+nb},0),ln){case c.CODE_START_A:case c.CODE_START_B:case c.CODE_START_C:throw new Qn}switch(ut){case c.CODE_CODE_A:if(ln<64)Ht+=String.fromCharCode(Xi===ki?32+ln:32+ln+128),Xi=!1;else if(ln<96)Ht+=String.fromCharCode(Xi===ki?ln-64:ln+64),Xi=!1;else switch(ln!==c.CODE_STOP&&(vi=!1),ln){case c.CODE_FNC_1:J&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case c.CODE_FNC_2:case c.CODE_FNC_3:break;case c.CODE_FNC_4_A:!ki&&Xi?(ki=!0,Xi=!1):ki&&Xi?(ki=!1,Xi=!1):Xi=!0;break;case c.CODE_SHIFT:Ot=!0,ut=c.CODE_CODE_B;break;case c.CODE_CODE_B:ut=c.CODE_CODE_B;break;case c.CODE_CODE_C:ut=c.CODE_CODE_C;break;case c.CODE_STOP:_t=!0}break;case c.CODE_CODE_B:if(ln<96)Ht+=String.fromCharCode(Xi===ki?32+ln:32+ln+128),Xi=!1;else switch(ln!==c.CODE_STOP&&(vi=!1),ln){case c.CODE_FNC_1:J&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case c.CODE_FNC_2:case c.CODE_FNC_3:break;case c.CODE_FNC_4_B:!ki&&Xi?(ki=!0,Xi=!1):ki&&Xi?(ki=!1,Xi=!1):Xi=!0;break;case c.CODE_SHIFT:Ot=!0,ut=c.CODE_CODE_A;break;case c.CODE_CODE_A:ut=c.CODE_CODE_A;break;case c.CODE_CODE_C:ut=c.CODE_CODE_C;break;case c.CODE_STOP:_t=!0}break;case c.CODE_CODE_C:if(ln<100)ln<10&&(Ht+="0"),Ht+=ln;else switch(ln!==c.CODE_STOP&&(vi=!1),ln){case c.CODE_FNC_1:J&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case c.CODE_CODE_A:ut=c.CODE_CODE_A;break;case c.CODE_CODE_B:ut=c.CODE_CODE_B;break;case c.CODE_STOP:_t=!0}}So&&(ut=ut===c.CODE_CODE_A?c.CODE_CODE_B:c.CODE_CODE_A)}var Ns=jr-Sr;if(jr=w.getNextUnset(jr),!w.isRange(jr,Math.min(w.getSize(),jr+(jr-Sr)/2),!1))throw new Gn;if((On-=Wn*dn)%103!==dn)throw new rs;var ps=Ht.length;if(0===ps)throw new Gn;ps>0&&vi&&(Ht=Ht.substring(0,ut===c.CODE_CODE_C?ps-2:ps-1));for(var Dl=(ce[1]+ce[0])/2,Ra=Sr+Ns/2,Xc=Ge.length,cd=new Uint8Array(Xc),ff=0;ff=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const ti=function(y){function c(l,w){void 0===l&&(l=!1),void 0===w&&(w=!1);var U=y.call(this)||this;return U.usingCheckDigit=l,U.extendedMode=w,U.decodeRowResult="",U.counters=new Int32Array(9),U}return En(c,y),c.prototype.decodeRow=function(l,w,U){var J,ce,ge,Pe,Ge=this.counters;Ge.fill(0),this.decodeRowResult="";var Ht,Sr,ut=c.findAsteriskPattern(w,Ge),_t=w.getNextSet(ut[1]),Ot=w.getSize();do{c.recordPattern(w,_t,Ge);var jr=c.toNarrowWidePattern(Ge);if(jr<0)throw new Gn;Ht=c.patternToChar(jr),this.decodeRowResult+=Ht,Sr=_t;try{for(var sn=(J=void 0,_n(Ge)),dn=sn.next();!dn.done;dn=sn.next())_t+=dn.value}catch(Xc){J={error:Xc}}finally{try{dn&&!dn.done&&(ce=sn.return)&&ce.call(sn)}finally{if(J)throw J.error}}_t=w.getNextSet(_t)}while("*"!==Ht);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var ps,On=0;try{for(var Wn=_n(Ge),vi=Wn.next();!vi.done;vi=Wn.next())On+=vi.value}catch(Xc){ge={error:Xc}}finally{try{vi&&!vi.done&&(Pe=Wn.return)&&Pe.call(Wn)}finally{if(ge)throw ge.error}}if(_t!==Ot&&2*(_t-Sr-On)ce&&(Pe=_t)}catch(jr){w={error:jr}}finally{try{ut&&!ut.done&&(U=Ge.return)&&U.call(Ge)}finally{if(w)throw w.error}}ce=Pe,ge=0;for(var Ot=0,Ht=0,Sr=0;Srce&&(Ht|=1<0;Sr++){var _t;if((_t=l[Sr])>ce&&(ge--,2*_t>=Ot))return-1}return Ht}}while(ge>3);return-1},c.patternToChar=function(l){for(var w=0;w="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)+32);break;case"$":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)-64);break;case"%":if(ge>="A"&&ge<="E")Pe=String.fromCharCode(ge.charCodeAt(0)-38);else if(ge>="F"&&ge<="J")Pe=String.fromCharCode(ge.charCodeAt(0)-11);else if(ge>="K"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)+16);else if(ge>="P"&&ge<="T")Pe=String.fromCharCode(ge.charCodeAt(0)+43);else if("U"===ge)Pe="\0";else if("V"===ge)Pe="@";else if("W"===ge)Pe="`";else{if("X"!==ge&&"Y"!==ge&&"Z"!==ge)throw new Qn;Pe="\x7f"}break;case"/":if(ge>="A"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)-32);else{if("Z"!==ge)throw new Qn;Pe=":"}}U+=Pe,J++}else U+=ce}return U},c.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",c.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],c.ASTERISK_ENCODING=148,c}(Ut);var xo=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),Vs=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const zs=function(y){function c(){var l=y.call(this)||this;return l.decodeRowResult="",l.counters=new Int32Array(6),l}return xo(c,y),c.prototype.decodeRow=function(l,w,U){var J,ce,ge,Pe,Ht,Sr,Ge=this.findAsteriskPattern(w),ut=w.getNextSet(Ge[1]),_t=w.getSize(),Ot=this.counters;Ot.fill(0),this.decodeRowResult="";do{c.recordPattern(w,ut,Ot);var jr=this.toPattern(Ot);if(jr<0)throw new Gn;Ht=this.patternToChar(jr),this.decodeRowResult+=Ht,Sr=ut;try{for(var sn=(J=void 0,Vs(Ot)),dn=sn.next();!dn.done;dn=sn.next())ut+=dn.value}catch(Ns){J={error:Ns}}finally{try{dn&&!dn.done&&(ce=sn.return)&&ce.call(sn)}finally{if(J)throw J.error}}ut=w.getNextSet(ut)}while("*"!==Ht);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var On=0;try{for(var Wn=Vs(Ot),vi=Wn.next();!vi.done;vi=Wn.next())On+=vi.value}catch(Ns){ge={error:Ns}}finally{try{vi&&!vi.done&&(Pe=Wn.return)&&Pe.call(Wn)}finally{if(ge)throw ge.error}}if(ut===_t||!w.get(ut))throw new Gn;if(this.decodeRowResult.length<2)throw new Gn;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var ki=this.decodeExtended(this.decodeRowResult),So=Sr+On/2;return new Cs(ki,null,0,[new _o((Ge[1]+Ge[0])/2,l),new _o(So,l)],Co.CODE_93,(new Date).getTime())},c.prototype.findAsteriskPattern=function(l){var w=l.getSize(),U=l.getNextSet(0);this.counters.fill(0);for(var J=this.counters,ce=U,ge=!1,Pe=J.length,Ge=0,ut=U;ut4)return-1;if(1&_t)Ge<<=Ot;else for(var Ht=0;Ht="a"&&ce<="d"){if(J>=w-1)throw new Qn;var ge=l.charAt(J+1),Pe="\0";switch(ce){case"d":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)+32);break;case"a":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)-64);break;case"b":if(ge>="A"&&ge<="E")Pe=String.fromCharCode(ge.charCodeAt(0)-38);else if(ge>="F"&&ge<="J")Pe=String.fromCharCode(ge.charCodeAt(0)-11);else if(ge>="K"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)+16);else if(ge>="P"&&ge<="T")Pe=String.fromCharCode(ge.charCodeAt(0)+43);else if("U"===ge)Pe="\0";else if("V"===ge)Pe="@";else if("W"===ge)Pe="`";else{if(!(ge>="X"&&ge<="Z"))throw new Qn;Pe="\x7f"}break;case"c":if(ge>="A"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)-32);else{if("Z"!==ge)throw new Qn;Pe=":"}}U+=Pe,J++}else U+=ce}return U},c.prototype.checkChecksums=function(l){var w=l.length;this.checkOneChecksum(l,w-2,20),this.checkOneChecksum(l,w-1,15)},c.prototype.checkOneChecksum=function(l,w,U){for(var J=1,ce=0,ge=w-1;ge>=0;ge--)ce+=J*c.ALPHABET_STRING.indexOf(l.charAt(ge)),++J>U&&(J=1);if(l.charAt(w)!==c.ALPHABET_STRING[ce%47])throw new rs},c.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",c.ASTERISK_ENCODING=(c.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350])[47],c}(Ut);var ea=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const ls=function(y){function c(){var l=null!==y&&y.apply(this,arguments)||this;return l.narrowLineWidth=-1,l}return ea(c,y),c.prototype.decodeRow=function(l,w,U){var J,ce,ge=this.decodeStart(w),Pe=this.decodeEnd(w),Ge=new Ur;c.decodeMiddle(w,ge[1],Pe[0],Ge);var ut=Ge.toString(),_t=null;null!=U&&(_t=U.get(Ci.ALLOWED_LENGTHS)),null==_t&&(_t=c.DEFAULT_ALLOWED_LENGTHS);var Ot=ut.length,Ht=!1,Sr=0;try{for(var jr=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(_t),sn=jr.next();!sn.done;sn=jr.next()){var dn=sn.value;if(Ot===dn){Ht=!0;break}dn>Sr&&(Sr=dn)}}catch(Wn){J={error:Wn}}finally{try{sn&&!sn.done&&(ce=jr.return)&&ce.call(jr)}finally{if(J)throw J.error}}if(!Ht&&Ot>Sr&&(Ht=!0),!Ht)throw new Qn;var ln=[new _o(ge[1],l),new _o(Pe[0],l)];return new Cs(ut,null,0,ln,Co.ITF,(new Date).getTime())},c.decodeMiddle=function(l,w,U,J){var ce=new Int32Array(10),ge=new Int32Array(5),Pe=new Int32Array(5);for(ce.fill(0),ge.fill(0),Pe.fill(0);w0&&J>=0&&!l.get(J);J--)U--;if(0!==U)throw new Gn},c.skipWhiteSpace=function(l){var w=l.getSize(),U=l.getNextSet(0);if(U===w)throw new Gn;return U},c.prototype.decodeEnd=function(l){l.reverse();try{var w=c.skipWhiteSpace(l),U=void 0;try{U=c.findGuardPattern(l,w,c.END_PATTERN_REVERSED[0])}catch(ce){ce instanceof Gn&&(U=c.findGuardPattern(l,w,c.END_PATTERN_REVERSED[1]))}this.validateQuietZone(l,U[0]);var J=U[0];return U[0]=l.getSize()-U[1],U[1]=l.getSize()-J,U}finally{l.reverse()}},c.findGuardPattern=function(l,w,U){var J=U.length,ce=new Int32Array(J),ge=l.getSize(),Pe=!1,Ge=0,ut=w;ce.fill(0);for(var _t=w;_t=0)return U%10;throw new Gn},c.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],c.MAX_AVG_VARIANCE=.38,c.MAX_INDIVIDUAL_VARIANCE=.5,c.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],c.START_PATTERN=Int32Array.from([1,1,1,1]),c.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],c}(Ut);var bs=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const mo=function(y){function c(){var l=null!==y&&y.apply(this,arguments)||this;return l.decodeRowStringBuffer="",l}return bs(c,y),c.findStartGuardPattern=function(l){for(var U,w=!1,J=0,ce=Int32Array.from([0,0,0]);!w;){ce=Int32Array.from([0,0,0]);var ge=(U=c.findGuardPattern(l,J,!1,this.START_END_PATTERN,ce))[0],Pe=ge-((J=U[1])-ge);Pe>=0&&(w=l.isRange(Pe,ge,!1))}return U},c.checkChecksum=function(l){return c.checkStandardUPCEANChecksum(l)},c.checkStandardUPCEANChecksum=function(l){var w=l.length;if(0===w)return!1;var U=parseInt(l.charAt(w-1),10);return c.getStandardUPCEANChecksum(l.substring(0,w-1))===U},c.getStandardUPCEANChecksum=function(l){for(var w=l.length,U=0,J=w-1;J>=0;J-=2){if((ce=l.charAt(J).charCodeAt(0)-48)<0||ce>9)throw new Qn;U+=ce}for(U*=3,J=w-2;J>=0;J-=2){var ce;if((ce=l.charAt(J).charCodeAt(0)-48)<0||ce>9)throw new Qn;U+=ce}return(1e3-U)%10},c.decodeEnd=function(l,w){return c.findGuardPattern(l,w,!1,c.START_END_PATTERN,new Int32Array(c.START_END_PATTERN.length).fill(0))},c.findGuardPatternWithoutCounters=function(l,w,U,J){return this.findGuardPattern(l,w,U,J,new Int32Array(J.length))},c.findGuardPattern=function(l,w,U,J,ce){for(var ge=l.getSize(),Pe=0,Ge=w=U?l.getNextUnset(w):l.getNextSet(w),ut=J.length,_t=U,Ot=w;Ot=0)return ge;throw new Gn},c.MAX_AVG_VARIANCE=.48,c.MAX_INDIVIDUAL_VARIANCE=.7,c.START_END_PATTERN=Int32Array.from([1,1,1]),c.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),c.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),c.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],c}(Ut);var Ks=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const ac=function(){function y(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return y.prototype.decodeRow=function(c,l,w){var U=this.decodeRowStringBuffer,J=this.decodeMiddle(l,w,U),ce=U.toString(),ge=y.parseExtensionString(ce),Pe=[new _o((w[0]+w[1])/2,c),new _o(J,c)],Ge=new Cs(ce,null,0,Pe,Co.UPC_EAN_EXTENSION,(new Date).getTime());return null!=ge&&Ge.putAllMetadata(ge),Ge},y.prototype.decodeMiddle=function(c,l,w){var U,J,ce=this.decodeMiddleCounters;ce[0]=0,ce[1]=0,ce[2]=0,ce[3]=0;for(var ge=c.getSize(),Pe=l[1],Ge=0,ut=0;ut<5&&Pe=10&&(Ge|=1<<4-ut),4!==ut&&(Pe=c.getNextSet(Pe),Pe=c.getNextUnset(Pe))}if(5!==w.length)throw new Gn;var jr=this.determineCheckDigit(Ge);if(y.extensionChecksum(w.toString())!==jr)throw new Gn;return Pe},y.extensionChecksum=function(c){for(var l=c.length,w=0,U=l-2;U>=0;U-=2)w+=c.charAt(U).charCodeAt(0)-48;for(w*=3,U=l-1;U>=0;U-=2)w+=c.charAt(U).charCodeAt(0)-48;return(w*=3)%10},y.prototype.determineCheckDigit=function(c){for(var l=0;l<10;l++)if(c===this.CHECK_DIGIT_ENCODINGS[l])return l;throw new Gn},y.parseExtensionString=function(c){if(5!==c.length)return null;var l=y.parseExtension5String(c);return null==l?null:new Map([[gc.SUGGESTED_PRICE,l]])},y.parseExtension5String=function(c){var l;switch(c.charAt(0)){case"0":l="\xa3";break;case"5":l="$";break;case"9":switch(c){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}l="";break;default:l=""}var w=parseInt(c.substring(1)),J=w%100;return l+(w/100).toString()+"."+(J<10?"0"+J:J.toString())},y}();var La=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Nd=function(){function y(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return y.prototype.decodeRow=function(c,l,w){var U=this.decodeRowStringBuffer,J=this.decodeMiddle(l,w,U),ce=U.toString(),ge=y.parseExtensionString(ce),Pe=[new _o((w[0]+w[1])/2,c),new _o(J,c)],Ge=new Cs(ce,null,0,Pe,Co.UPC_EAN_EXTENSION,(new Date).getTime());return null!=ge&&Ge.putAllMetadata(ge),Ge},y.prototype.decodeMiddle=function(c,l,w){var U,J,ce=this.decodeMiddleCounters;ce[0]=0,ce[1]=0,ce[2]=0,ce[3]=0;for(var ge=c.getSize(),Pe=l[1],Ge=0,ut=0;ut<2&&Pe=10&&(Ge|=1<<1-ut),1!==ut&&(Pe=c.getNextSet(Pe),Pe=c.getNextUnset(Pe))}if(2!==w.length)throw new Gn;if(parseInt(w.toString())%4!==Ge)throw new Gn;return Pe},y.parseExtensionString=function(c){return 2!==c.length?null:new Map([[gc.ISSUE_NUMBER,parseInt(c)]])},y}(),yu=function(){function y(){}return y.decodeRow=function(c,l,w){var U=mo.findGuardPattern(l,w,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new ac).decodeRow(c,l,U)}catch{return(new Nd).decodeRow(c,l,U)}},y.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),y}();var wh=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const hl=function(y){function c(){var l=y.call(this)||this;l.decodeRowStringBuffer="",c.L_AND_G_PATTERNS=c.L_PATTERNS.map(function(ge){return Int32Array.from(ge)});for(var w=10;w<20;w++){for(var U=c.L_PATTERNS[w-10],J=new Int32Array(U.length),ce=0;ce=w.getSize()||!w.isRange(Sr,jr,!1))throw new Gn;var sn=ut.toString();if(sn.length<8)throw new Qn;if(!c.checkChecksum(sn))throw new rs;var dn=(J[1]+J[0])/2,ln=(Ot[1]+Ot[0])/2,On=this.getBarcodeFormat(),Wn=[new _o(dn,l),new _o(ln,l)],vi=new Cs(sn,null,0,Wn,On,(new Date).getTime()),ki=0;try{var Xi=yu.decodeRow(l,w,Ot[1]);vi.putMetadata(gc.UPC_EAN_EXTENSION,Xi.getText()),vi.putAllMetadata(Xi.getResultMetadata()),vi.addResultPoints(Xi.getResultPoints()),ki=Xi.getText().length}catch{}var So=null==U?null:U.get(Ci.ALLOWED_EAN_EXTENSIONS);if(null!=So){var Ns=!1;for(var ps in So)if(ki.toString()===ps){Ns=!0;break}if(!Ns)throw new Gn}return vi},c.checkChecksum=function(l){return c.checkStandardUPCEANChecksum(l)},c.checkStandardUPCEANChecksum=function(l){var w=l.length;if(0===w)return!1;var U=parseInt(l.charAt(w-1),10);return c.getStandardUPCEANChecksum(l.substring(0,w-1))===U},c.getStandardUPCEANChecksum=function(l){for(var w=l.length,U=0,J=w-1;J>=0;J-=2){if((ce=l.charAt(J).charCodeAt(0)-48)<0||ce>9)throw new Qn;U+=ce}for(U*=3,J=w-2;J>=0;J-=2){var ce;if((ce=l.charAt(J).charCodeAt(0)-48)<0||ce>9)throw new Qn;U+=ce}return(1e3-U)%10},c.decodeEnd=function(l,w){return c.findGuardPattern(l,w,!1,c.START_END_PATTERN,new Int32Array(c.START_END_PATTERN.length).fill(0))},c}(mo);var Pp=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),Kh=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Hh=function(y){function c(){var l=y.call(this)||this;return l.decodeMiddleCounters=Int32Array.from([0,0,0,0]),l}return Pp(c,y),c.prototype.decodeMiddle=function(l,w,U){var J,ce,ge,Pe,Ge=this.decodeMiddleCounters;Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0;for(var ut=l.getSize(),_t=w[1],Ot=0,Ht=0;Ht<6&&_t=10&&(Ot|=1<<5-Ht)}for(U=c.determineFirstDigit(U,Ot),_t=hl.findGuardPattern(l,_t,!0,hl.MIDDLE_PATTERN,new Int32Array(hl.MIDDLE_PATTERN.length).fill(0))[1],Ht=0;Ht<6&&_t=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Kg=function(y){function c(){var l=y.call(this)||this;return l.decodeMiddleCounters=Int32Array.from([0,0,0,0]),l}return n1(c,y),c.prototype.decodeMiddle=function(l,w,U){var J,ce,ge,Pe,Ge=this.decodeMiddleCounters;Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0;for(var ut=l.getSize(),_t=w[1],Ot=0;Ot<4&&_t=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Cr=function(y){function c(){var l=y.call(this)||this;return l.decodeMiddleCounters=new Int32Array(4),l}return at(c,y),c.prototype.decodeMiddle=function(l,w,U){var J,ce,ge=this.decodeMiddleCounters.map(function(sn){return sn});ge[0]=0,ge[1]=0,ge[2]=0,ge[3]=0;for(var Pe=l.getSize(),Ge=w[1],ut=0,_t=0;_t<6&&Ge=10&&(ut|=1<<5-_t)}return c.determineNumSysAndCheckDigit(new Ur(U),ut),Ge},c.prototype.decodeEnd=function(l,w){return c.findGuardPatternWithoutCounters(l,w,!0,c.MIDDLE_END_PATTERN)},c.prototype.checkChecksum=function(l){return hl.checkChecksum(c.convertUPCEtoUPCA(l))},c.determineNumSysAndCheckDigit=function(l,w){for(var U=0;U<=1;U++)for(var J=0;J<10;J++)if(w===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[U][J])return l.insert(0,"0"+U),void l.append("0"+J);throw Gn.getNotFoundInstance()},c.prototype.getBarcodeFormat=function(){return Co.UPC_E},c.convertUPCEtoUPCA=function(l){var w=l.slice(1,7).split("").map(function(ce){return ce.charCodeAt(0)}),U=new Ur;U.append(l.charAt(0));var J=w[5];switch(J){case 0:case 1:case 2:U.appendChars(w,0,2),U.append(J),U.append("0000"),U.appendChars(w,2,3);break;case 3:U.appendChars(w,0,3),U.append("00000"),U.appendChars(w,3,2);break;case 4:U.appendChars(w,0,4),U.append("00000"),U.append(w[4]);break;default:U.appendChars(w,0,5),U.append("0000"),U.append(J)}return l.length>=8&&U.append(l.charAt(7)),U.toString()},c.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),c.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],c}(hl);var Zr=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),Kn=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Wi=function(y){function c(l){var w=y.call(this)||this,U=null==l?null:l.get(Ci.POSSIBLE_FORMATS),J=[];return null!=U&&(U.indexOf(Co.EAN_13)>-1&&J.push(new Hh),U.indexOf(Co.UPC_A)>-1&&J.push(new At),U.indexOf(Co.EAN_8)>-1&&J.push(new Kg),U.indexOf(Co.UPC_E)>-1&&J.push(new Cr)),0===J.length&&(J.push(new Hh),J.push(new At),J.push(new Kg),J.push(new Cr)),w.readers=J,w}return Zr(c,y),c.prototype.decodeRow=function(l,w,U){var J,ce;try{for(var ge=Kn(this.readers),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;try{var ut=Ge.decodeRow(l,w,U),_t=ut.getBarcodeFormat()===Co.EAN_13&&"0"===ut.getText().charAt(0),Ot=null==U?null:U.get(Ci.POSSIBLE_FORMATS),Ht=null==Ot||Ot.includes(Co.UPC_A);if(_t&&Ht){var Sr=ut.getRawBytes(),jr=new Cs(ut.getText().substring(1),Sr,Sr?Sr.length:null,ut.getResultPoints(),Co.UPC_A);return jr.putAllMetadata(ut.getResultMetadata()),jr}return ut}catch{}}}catch(sn){J={error:sn}}finally{try{Pe&&!Pe.done&&(ce=ge.return)&&ce.call(ge)}finally{if(J)throw J.error}}throw new Gn},c.prototype.reset=function(){var l,w;try{for(var U=Kn(this.readers),J=U.next();!J.done;J=U.next())J.value.reset()}catch(ge){l={error:ge}}finally{try{J&&!J.done&&(w=U.return)&&w.call(U)}finally{if(l)throw l.error}}},c}(Ut);var os=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const vc=function(y){function c(){var l=null!==y&&y.apply(this,arguments)||this;return l.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},l}return os(c,y),c.prototype.decodeRow=function(l,w,U){var J=this.getValidRowData(w);if(!J)throw new Gn;var ce=this.codaBarDecodeRow(J.row);if(!ce)throw new Gn;return new Cs(ce,null,0,[new _o(J.left,l),new _o(J.right,l)],Co.CODABAR,(new Date).getTime())},c.prototype.getValidRowData=function(l){var w=l.toArray(),U=w.indexOf(!0);if(-1===U)return null;var J=w.lastIndexOf(!0);if(J<=U)return null;for(var ce=[],ge=(w=w.slice(U,J+1))[0],Pe=1,Ge=1;Ge0;){var ce=l.splice(0,8).splice(0,7).map(function(Pe){return PeJ&&(J=w[ce],U=ce);l[U]++},c.decrement=function(l,w){for(var U=0,J=w[0],ce=1;ce=c.MIN_FINDER_PATTERN_RATIO&&ge<=c.MAX_FINDER_PATTERN_RATIO){var Pe=Number.MAX_SAFE_INTEGER,Ge=Number.MIN_SAFE_INTEGER;try{for(var ut=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(l),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value;Ot>Ge&&(Ge=Ot),Ot=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),Pe=ge.next();!Pe.done;Pe=ge.next())ce+=Pe.value}catch(ln){U={error:ln}}finally{try{Pe&&!Pe.done&&(J=ge.return)&&J.call(ge)}finally{if(U)throw U.error}}for(var ut=0,_t=0,Ot=c.length,Ht=0;Ht=Ot-Ht-1&&(jr-=y.combins(ce-Sr-(Ot-Ht),Ot-Ht-2)),Ot-Ht-1>1){for(var sn=0,dn=ce-Sr-(Ot-Ht-2);dn>l;dn--)sn+=y.combins(ce-Sr-dn-1,Ot-Ht-3);jr-=sn*(Ot-1-Ht)}else ce-Sr>l&&jr--;ut+=jr}ce-=Sr}return ut},y.combins=function(c,l){var w,U;c-l>l?(U=l,w=c-l):(U=c-l,w=l);for(var J=1,ce=1,ge=c;ge>w;ge--)J*=ge,ce<=U&&(J/=ce,ce++);for(;ce<=U;)J/=ce,ce++;return J},y}(),Wh=function(){function y(){}return y.buildBitArray=function(c){var l=2*c.length-1;null==c[c.length-1].getRightChar()&&(l-=1);for(var U=new bi(12*l),J=0,ge=c[0].getRightChar().getValue(),Pe=11;Pe>=0;--Pe)ge&1<=0;--_t)ut&1<<_t&&U.set(J),J++;if(null!==Ge.getRightChar()){var Ot=Ge.getRightChar().getValue();for(_t=11;_t>=0;--_t)Ot&1<<_t&&U.set(J),J++}}return U},y}(),Qs=function(){function y(c,l){l?this.decodedInformation=null:(this.finished=c,this.decodedInformation=l)}return y.prototype.getDecodedInformation=function(){return this.decodedInformation},y.prototype.isFinished=function(){return this.finished},y}(),_h=function(){function y(c){this.newPosition=c}return y.prototype.getNewPosition=function(){return this.newPosition},y}();var su=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const vu=function(y){function c(l,w){var U=y.call(this,l)||this;return U.value=w,U}return su(c,y),c.prototype.getValue=function(){return this.value},c.prototype.isFNC1=function(){return this.value===c.FNC1},c.FNC1="$",c}(_h);var Fe=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Je=function(y){function c(l,w,U){var J=y.call(this,l)||this;return U?(J.remaining=!0,J.remainingValue=J.remainingValue):(J.remaining=!1,J.remainingValue=0),J.newString=w,J}return Fe(c,y),c.prototype.getNewString=function(){return this.newString},c.prototype.isRemaining=function(){return this.remaining},c.prototype.getRemainingValue=function(){return this.remainingValue},c}(_h);var pr=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Er=function(y){function c(l,w,U){var J=y.call(this,l)||this;if(w<0||w>10||U<0||U>10)throw new Qn;return J.firstDigit=w,J.secondDigit=U,J}return pr(c,y),c.prototype.getFirstDigit=function(){return this.firstDigit},c.prototype.getSecondDigit=function(){return this.secondDigit},c.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},c.prototype.isFirstDigitFNC1=function(){return this.firstDigit===c.FNC1},c.prototype.isSecondDigitFNC1=function(){return this.secondDigit===c.FNC1},c.prototype.isAnyFNC1=function(){return this.firstDigit===c.FNC1||this.secondDigit===c.FNC1},c.FNC1=10,c}(_h);var nn=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Ri=function(){function y(){}return y.parseFieldsInGeneralPurpose=function(c){var l,w,U,J,ce,ge,Pe,Ge;if(!c)return null;if(c.length<2)throw new Gn;var ut=c.substring(0,2);try{for(var _t=nn(y.TWO_DIGIT_DATA_LENGTH),Ot=_t.next();!Ot.done;Ot=_t.next())if((Ht=Ot.value)[0]===ut)return Ht[1]===y.VARIABLE_LENGTH?y.processVariableAI(2,Ht[2],c):y.processFixedAI(2,Ht[1],c)}catch(ki){l={error:ki}}finally{try{Ot&&!Ot.done&&(w=_t.return)&&w.call(_t)}finally{if(l)throw l.error}}if(c.length<3)throw new Gn;var Sr=c.substring(0,3);try{for(var jr=nn(y.THREE_DIGIT_DATA_LENGTH),sn=jr.next();!sn.done;sn=jr.next())if((Ht=sn.value)[0]===Sr)return Ht[1]===y.VARIABLE_LENGTH?y.processVariableAI(3,Ht[2],c):y.processFixedAI(3,Ht[1],c)}catch(ki){U={error:ki}}finally{try{sn&&!sn.done&&(J=jr.return)&&J.call(jr)}finally{if(U)throw U.error}}try{for(var dn=nn(y.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),ln=dn.next();!ln.done;ln=dn.next())if((Ht=ln.value)[0]===Sr)return Ht[1]===y.VARIABLE_LENGTH?y.processVariableAI(4,Ht[2],c):y.processFixedAI(4,Ht[1],c)}catch(ki){ce={error:ki}}finally{try{ln&&!ln.done&&(ge=dn.return)&&ge.call(dn)}finally{if(ce)throw ce.error}}if(c.length<4)throw new Gn;var On=c.substring(0,4);try{for(var Wn=nn(y.FOUR_DIGIT_DATA_LENGTH),vi=Wn.next();!vi.done;vi=Wn.next()){var Ht;if((Ht=vi.value)[0]===On)return Ht[1]===y.VARIABLE_LENGTH?y.processVariableAI(4,Ht[2],c):y.processFixedAI(4,Ht[1],c)}}catch(ki){Pe={error:ki}}finally{try{vi&&!vi.done&&(Ge=Wn.return)&&Ge.call(Wn)}finally{if(Pe)throw Pe.error}}throw new Gn},y.processFixedAI=function(c,l,w){if(w.lengththis.information.getSize())return c+4<=this.information.getSize();for(var l=c;lthis.information.getSize()){var l=this.extractNumericValueFromBitArray(c,4);return new Er(this.information.getSize(),0===l?Er.FNC1:l-1,Er.FNC1)}var w=this.extractNumericValueFromBitArray(c,7);return new Er(c+7,(w-8)/11,(w-8)%11)},y.prototype.extractNumericValueFromBitArray=function(c,l){return y.extractNumericValueFromBitArray(this.information,c,l)},y.extractNumericValueFromBitArray=function(c,l,w){for(var U=0,J=0;Jthis.information.getSize())return!1;var l=this.extractNumericValueFromBitArray(c,5);if(l>=5&&l<16)return!0;if(c+7>this.information.getSize())return!1;var w=this.extractNumericValueFromBitArray(c,7);if(w>=64&&w<116)return!0;if(c+8>this.information.getSize())return!1;var U=this.extractNumericValueFromBitArray(c,8);return U>=232&&U<253},y.prototype.decodeIsoIec646=function(c){var l=this.extractNumericValueFromBitArray(c,5);if(15===l)return new vu(c+5,vu.FNC1);if(l>=5&&l<15)return new vu(c+5,"0"+(l-5));var J,w=this.extractNumericValueFromBitArray(c,7);if(w>=64&&w<90)return new vu(c+7,""+(w+1));if(w>=90&&w<116)return new vu(c+7,""+(w+7));switch(this.extractNumericValueFromBitArray(c,8)){case 232:J="!";break;case 233:J='"';break;case 234:J="%";break;case 235:J="&";break;case 236:J="'";break;case 237:J="(";break;case 238:J=")";break;case 239:J="*";break;case 240:J="+";break;case 241:J=",";break;case 242:J="-";break;case 243:J=".";break;case 244:J="/";break;case 245:J=":";break;case 246:J=";";break;case 247:J="<";break;case 248:J="=";break;case 249:J=">";break;case 250:J="?";break;case 251:J="_";break;case 252:J=" ";break;default:throw new Qn}return new vu(c+8,J)},y.prototype.isStillAlpha=function(c){if(c+5>this.information.getSize())return!1;var l=this.extractNumericValueFromBitArray(c,5);if(l>=5&&l<16)return!0;if(c+6>this.information.getSize())return!1;var w=this.extractNumericValueFromBitArray(c,6);return w>=16&&w<63},y.prototype.decodeAlphanumeric=function(c){var l=this.extractNumericValueFromBitArray(c,5);if(15===l)return new vu(c+5,vu.FNC1);if(l>=5&&l<15)return new vu(c+5,"0"+(l-5));var U,w=this.extractNumericValueFromBitArray(c,6);if(w>=32&&w<58)return new vu(c+6,""+(w+33));switch(w){case 58:U="*";break;case 59:U=",";break;case 60:U="-";break;case 61:U=".";break;case 62:U="/";break;default:throw new ou("Decoding invalid alphanumeric value: "+w)}return new vu(c+6,U)},y.prototype.isAlphaTo646ToAlphaLatch=function(c){if(c+1>this.information.getSize())return!1;for(var l=0;l<5&&l+cthis.information.getSize())return!1;for(var l=c;lthis.information.getSize())return!1;for(var l=0;l<4&&l+c=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const jl=function(y){function c(){var l=null!==y&&y.apply(this,arguments)||this;return l.pairs=new Array(c.MAX_PAIRS),l.rows=new Array,l.startEnd=[2],l}return Kw(c,y),c.prototype.decodeRow=function(l,w,U){this.pairs.length=0,this.startFromEven=!1;try{return c.constructResult(this.decodeRow2pairs(l,w))}catch{}return this.pairs.length=0,this.startFromEven=!0,c.constructResult(this.decodeRow2pairs(l,w))},c.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},c.prototype.decodeRow2pairs=function(l,w){for(var U=!1;!U;)try{this.pairs.push(this.retrieveNextPair(w,this.pairs,l))}catch(ge){if(ge instanceof Gn){if(!this.pairs.length)throw new Gn;U=!0}}if(this.checkChecksum())return this.pairs;var J;if(J=!!this.rows.length,this.storeRow(l,!1),J){var ce=this.checkRowsBoolean(!1);if(null!=ce||null!=(ce=this.checkRowsBoolean(!0)))return ce}throw new Gn},c.prototype.checkRowsBoolean=function(l){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,l&&(this.rows=this.rows.reverse());var w=null;try{w=this.checkRows(new Array,0)}catch(U){console.log(U)}return l&&(this.rows=this.rows.reverse()),w},c.prototype.checkRows=function(l,w){for(var U,J,ce=w;cege.length)){for(var Pe=!0,Ge=0;Gel){ce=ge.isEquivalent(this.pairs);break}J=ge.isEquivalent(this.pairs),U++}ce||J||c.isPartialRow(this.pairs,this.rows)||(this.rows.push(U,new Gh(this.pairs,l,w)),this.removePartialRows(this.pairs,this.rows))},c.prototype.removePartialRows=function(l,w){var U,J,ce,ge,Pe,Ge;try{for(var ut=Hc(w),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value;if(Ot.getPairs().length!==l.length)try{for(var Sr=(ce=void 0,Hc(Ot.getPairs())),jr=Sr.next();!jr.done;jr=Sr.next()){var sn=jr.value;try{for(var ln=(Pe=void 0,Hc(l)),On=ln.next();!On.done;On=ln.next())if(qf.equals(sn,On.value)){!0;break}}catch(vi){Pe={error:vi}}finally{try{On&&!On.done&&(Ge=ln.return)&&Ge.call(ln)}finally{if(Pe)throw Pe.error}}}}catch(vi){ce={error:vi}}finally{try{jr&&!jr.done&&(ge=Sr.return)&&ge.call(Sr)}finally{if(ce)throw ce.error}}}}catch(vi){U={error:vi}}finally{try{_t&&!_t.done&&(J=ut.return)&&J.call(ut)}finally{if(U)throw U.error}}},c.isPartialRow=function(l,w){var U,J,ce,ge,Pe,Ge;try{for(var ut=Hc(w),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value,Ht=!0;try{for(var Sr=(ce=void 0,Hc(l)),jr=Sr.next();!jr.done;jr=Sr.next()){var sn=jr.value,dn=!1;try{for(var ln=(Pe=void 0,Hc(Ot.getPairs())),On=ln.next();!On.done;On=ln.next())if(sn.equals(On.value)){dn=!0;break}}catch(vi){Pe={error:vi}}finally{try{On&&!On.done&&(Ge=ln.return)&&Ge.call(ln)}finally{if(Pe)throw Pe.error}}if(!dn){Ht=!1;break}}}catch(vi){ce={error:vi}}finally{try{jr&&!jr.done&&(ge=Sr.return)&&ge.call(Sr)}finally{if(ce)throw ce.error}}if(Ht)return!0}}catch(vi){U={error:vi}}finally{try{_t&&!_t.done&&(J=ut.return)&&J.call(ut)}finally{if(U)throw U.error}}return!1},c.prototype.getRows=function(){return this.rows},c.constructResult=function(l){var U=function rx(y){try{if(y.get(1))return new Xo(y);if(!y.get(2))return new Wa(y);switch(un.extractNumericValueFromBitArray(y,1,4)){case 4:return new qn(y);case 5:return new a1(y)}switch(un.extractNumericValueFromBitArray(y,1,5)){case 12:return new Xg(y);case 13:return new Eh(y)}switch(un.extractNumericValueFromBitArray(y,1,7)){case 56:return new Rp(y,"310","11");case 57:return new Rp(y,"320","11");case 58:return new Rp(y,"310","13");case 59:return new Rp(y,"320","13");case 60:return new Rp(y,"310","15");case 61:return new Rp(y,"320","15");case 62:return new Rp(y,"310","17");case 63:return new Rp(y,"320","17")}}catch(U){throw console.log(U),new ou("unknown decoder: "+y)}}(Wh.buildBitArray(l)),J=U.parseInformation(),ce=l[0].getFinderPattern().getResultPoints(),ge=l[l.length-1].getFinderPattern().getResultPoints();return new Cs(J,null,null,[ce[0],ce[1],ge[0],ge[1]],Co.RSS_EXPANDED,null)},c.prototype.checkChecksum=function(){var l=this.pairs.get(0),w=l.getLeftChar(),U=l.getRightChar();if(null===U)return!1;for(var J=U.getChecksumPortion(),ce=2,ge=1;ge=0?U:this.isEmptyPair(w)?0:w[w.length-1].getFinderPattern().getStartEnd()[1];var Ge=w.length%2!=0;this.startFromEven&&(Ge=!Ge);for(var ut=!1;ge=0&&!l.get(Pe);)Pe--;Pe++,J=this.startEnd[0]-Pe,ce=Pe,ge=this.startEnd[1]}else ce=this.startEnd[0],J=(ge=l.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var ut,Ge=this.getDecodeFinderCounters();Rt.arraycopy(Ge,0,Ge,1,Ge.length-1),Ge[0]=J;try{ut=this.parseFinderValue(Ge,c.FINDER_PATTERNS)}catch{return null}return new Hg(ut,[ce,ge],ce,ge,w)},c.prototype.decodeDataCharacter=function(l,w,U,J){for(var ce=this.getDataCharacterCounters(),ge=0;ge.3)throw new Gn;var Sr=this.getOddCounts(),jr=this.getEvenCounts(),sn=this.getOddRoundingErrors(),dn=this.getEvenRoundingErrors();for(Pe=0;Pe8){if(ln>8.7)throw new Gn;On=8}var Wn=Pe/2;1&Pe?(jr[Wn]=On,dn[Wn]=ln-On):(Sr[Wn]=On,sn[Wn]=ln-On)}this.adjustOddEvenCounts(17);var vi=4*w.getValue()+(U?0:2)+(J?0:1)-1,ki=0,Xi=0;for(Pe=Sr.length-1;Pe>=0;Pe--)c.isNotA1left(w,U,J)&&(Xi+=Sr[Pe]*c.WEIGHTS[vi][2*Pe]),ki+=Sr[Pe];var Ns=0;for(Pe=jr.length-1;Pe>=0;Pe--)c.isNotA1left(w,U,J)&&(Ns+=jr[Pe]*c.WEIGHTS[vi][2*Pe+1]);var ps=Xi+Ns;if(1&ki||ki>13||ki<4)throw new Gn;var Dl=(13-ki)/2,Ra=c.SYMBOL_WIDEST[Dl],Xc=9-Ra,cd=cf.getRSSvalue(Sr,Ra,!0),ff=cf.getRSSvalue(jr,Xc,!1);return new Yf(cd*c.EVEN_TOTAL_SUBSET[Dl]+ff+c.GSUM[Dl],ps)},c.isNotA1left=function(l,w,U){return!(0===l.getValue()&&w&&U)},c.prototype.adjustOddEvenCounts=function(l){var w=Ys.sum(new Int32Array(this.getOddCounts())),U=Ys.sum(new Int32Array(this.getEvenCounts())),J=!1,ce=!1;w>13?ce=!0:w<4&&(J=!0);var ge=!1,Pe=!1;U>13?Pe=!0:U<4&&(ge=!0);var Ge=w+U-l,ut=!(1&~w),_t=!(1&U);if(1===Ge)if(ut){if(_t)throw new Gn;ce=!0}else{if(!_t)throw new Gn;Pe=!0}else if(-1===Ge)if(ut){if(_t)throw new Gn;J=!0}else{if(!_t)throw new Gn;ge=!0}else{if(0!==Ge)throw new Gn;if(ut){if(!_t)throw new Gn;w=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const _m=function(y){function c(){var l=null!==y&&y.apply(this,arguments)||this;return l.possibleLeftPairs=[],l.possibleRightPairs=[],l}return Hw(c,y),c.prototype.decodeRow=function(l,w,U){var J,ce,ge,Pe,Ge=this.decodePair(w,!1,l,U);c.addOrTally(this.possibleLeftPairs,Ge),w.reverse();var ut=this.decodePair(w,!0,l,U);c.addOrTally(this.possibleRightPairs,ut),w.reverse();try{for(var _t=wm(this.possibleLeftPairs),Ot=_t.next();!Ot.done;Ot=_t.next()){var Ht=Ot.value;if(Ht.getCount()>1)try{for(var Sr=(ge=void 0,wm(this.possibleRightPairs)),jr=Sr.next();!jr.done;jr=Sr.next()){var sn=jr.value;if(sn.getCount()>1&&c.checkChecksum(Ht,sn))return c.constructResult(Ht,sn)}}catch(dn){ge={error:dn}}finally{try{jr&&!jr.done&&(Pe=Sr.return)&&Pe.call(Sr)}finally{if(ge)throw ge.error}}}}catch(dn){J={error:dn}}finally{try{Ot&&!Ot.done&&(ce=_t.return)&&ce.call(_t)}finally{if(J)throw J.error}}throw new Gn},c.addOrTally=function(l,w){var U,J;if(null!=w){var ce=!1;try{for(var ge=wm(l),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;if(Ge.getValue()===w.getValue()){Ge.incrementCount(),ce=!0;break}}}catch(ut){U={error:ut}}finally{try{Pe&&!Pe.done&&(J=ge.return)&&J.call(ge)}finally{if(U)throw U.error}}ce||l.push(w)}},c.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},c.constructResult=function(l,w){for(var U=4537077*l.getValue()+w.getValue(),J=new String(U).toString(),ce=new Ur,ge=13-J.length;ge>0;ge--)ce.append("0");ce.append(J);var Pe=0;for(ge=0;ge<13;ge++){var Ge=ce.charAt(ge).charCodeAt(0)-48;Pe+=1&ge?Ge:3*Ge}10==(Pe=10-Pe%10)&&(Pe=0),ce.append(Pe.toString());var ut=l.getFinderPattern().getResultPoints(),_t=w.getFinderPattern().getResultPoints();return new Cs(ce.toString(),null,0,[ut[0],ut[1],_t[0],_t[1]],Co.RSS_14,(new Date).getTime())},c.checkChecksum=function(l,w){var U=(l.getChecksumPortion()+16*w.getChecksumPortion())%79,J=9*l.getFinderPattern().getValue()+w.getFinderPattern().getValue();return J>72&&J--,J>8&&J--,U===J},c.prototype.decodePair=function(l,w,U,J){try{var ce=this.findFinderPattern(l,w),ge=this.parseFoundFinderPattern(l,U,w,ce),Pe=null==J?null:J.get(Ci.NEED_RESULT_POINT_CALLBACK);if(null!=Pe){var Ge=(ce[0]+ce[1])/2;w&&(Ge=l.getSize()-1-Ge),Pe.foundPossibleResultPoint(new _o(Ge,U))}var ut=this.decodeDataCharacter(l,ge,!0),_t=this.decodeDataCharacter(l,ge,!1);return new eh(1597*ut.getValue()+_t.getValue(),ut.getChecksumPortion()+4*_t.getChecksumPortion(),ge)}catch{return null}},c.prototype.decodeDataCharacter=function(l,w,U){for(var J=this.getDataCharacterCounters(),ce=0;ce8&&(dn=8);var ln=Math.floor(ge/2);1&ge?(Ht[ln]=dn,jr[ln]=sn-dn):(Ot[ln]=dn,Sr[ln]=sn-dn)}this.adjustOddEvenCounts(U,ut);var On=0,Wn=0;for(ge=Ot.length-1;ge>=0;ge--)Wn*=9,Wn+=Ot[ge],On+=Ot[ge];var vi=0,ki=0;for(ge=Ht.length-1;ge>=0;ge--)vi*=9,vi+=Ht[ge],ki+=Ht[ge];var So,Ns,Xi=Wn+3*vi;if(U){if(1&On||On>12||On<4)throw new Gn;var ps=9-(Ns=c.OUTSIDE_ODD_WIDEST[So=(12-On)/2]),Dl=cf.getRSSvalue(Ot,Ns,!1),Ra=cf.getRSSvalue(Ht,ps,!0);return new Yf(Dl*c.OUTSIDE_EVEN_TOTAL_SUBSET[So]+Ra+c.OUTSIDE_GSUM[So],Xi)}if(1&ki||ki>10||ki<4)throw new Gn;return ps=9-(Ns=c.INSIDE_ODD_WIDEST[So=(10-ki)/2]),Dl=cf.getRSSvalue(Ot,Ns,!0),Ra=cf.getRSSvalue(Ht,ps,!1),new Yf(Ra*c.INSIDE_ODD_TOTAL_SUBSET[So]+Dl+c.INSIDE_GSUM[So],Xi)},c.prototype.findFinderPattern=function(l,w){var U=this.getDecodeFinderCounters();U[0]=0,U[1]=0,U[2]=0,U[3]=0;for(var J=l.getSize(),ce=!1,ge=0;ge=0&&ce!==l.get(ge);)ge--;ge++;var Pe=J[0]-ge,Ge=this.getDecodeFinderCounters(),ut=new Int32Array(Ge.length);Rt.arraycopy(Ge,0,ut,1,Ge.length-1),ut[0]=Pe;var _t=this.parseFinderValue(ut,c.FINDER_PATTERNS),Ot=ge,Ht=J[1];return U&&(Ot=l.getSize()-1-Ot,Ht=l.getSize()-1-Ht),new Hg(_t,[ge,J[1]],Ot,Ht,w)},c.prototype.adjustOddEvenCounts=function(l,w){var U=Ys.sum(new Int32Array(this.getOddCounts())),J=Ys.sum(new Int32Array(this.getEvenCounts())),ce=!1,ge=!1,Pe=!1,Ge=!1;l?(U>12?ge=!0:U<4&&(ce=!0),J>12?Ge=!0:J<4&&(Pe=!0)):(U>11?ge=!0:U<5&&(ce=!0),J>10?Ge=!0:J<4&&(Pe=!0));var ut=U+J-w,_t=(1&U)==(l?1:0),Ot=!(1&~J);if(1===ut)if(_t){if(Ot)throw new Gn;ge=!0}else{if(!Ot)throw new Gn;Ge=!0}else if(-1===ut)if(_t){if(Ot)throw new Gn;ce=!0}else{if(!Ot)throw new Gn;Pe=!0}else{if(0!==ut)throw new Gn;if(_t){if(!Ot)throw new Gn;U=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}),Is=function(){function y(c,l,w){this.ecCodewords=c,this.ecBlocks=[l],w&&this.ecBlocks.push(w)}return y.prototype.getECCodewords=function(){return this.ecCodewords},y.prototype.getECBlocks=function(){return this.ecBlocks},y}(),Ya=function(){function y(c,l){this.count=c,this.dataCodewords=l}return y.prototype.getCount=function(){return this.count},y.prototype.getDataCodewords=function(){return this.dataCodewords},y}();const Gl=function(){function y(c,l,w,U,J,ce){var ge,Pe;this.versionNumber=c,this.symbolSizeRows=l,this.symbolSizeColumns=w,this.dataRegionSizeRows=U,this.dataRegionSizeColumns=J,this.ecBlocks=ce;var Ge=0,ut=ce.getECCodewords(),_t=ce.getECBlocks();try{for(var Ot=Zg(_t),Ht=Ot.next();!Ht.done;Ht=Ot.next()){var Sr=Ht.value;Ge+=Sr.getCount()*(Sr.getDataCodewords()+ut)}}catch(jr){ge={error:jr}}finally{try{Ht&&!Ht.done&&(Pe=Ot.return)&&Pe.call(Ot)}finally{if(ge)throw ge.error}}this.totalCodewords=Ge}return y.prototype.getVersionNumber=function(){return this.versionNumber},y.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},y.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},y.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},y.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},y.prototype.getTotalCodewords=function(){return this.totalCodewords},y.prototype.getECBlocks=function(){return this.ecBlocks},y.getVersionForDimensions=function(c,l){var w,U;if(1&c||1&l)throw new Qn;try{for(var J=Zg(y.VERSIONS),ce=J.next();!ce.done;ce=J.next()){var ge=ce.value;if(ge.symbolSizeRows===c&&ge.symbolSizeColumns===l)return ge}}catch(Pe){w={error:Pe}}finally{try{ce&&!ce.done&&(U=J.return)&&U.call(J)}finally{if(w)throw w.error}}throw new Qn},y.prototype.toString=function(){return""+this.versionNumber},y.buildVersions=function(){return[new y(1,10,10,8,8,new Is(5,new Ya(1,3))),new y(2,12,12,10,10,new Is(7,new Ya(1,5))),new y(3,14,14,12,12,new Is(10,new Ya(1,8))),new y(4,16,16,14,14,new Is(12,new Ya(1,12))),new y(5,18,18,16,16,new Is(14,new Ya(1,18))),new y(6,20,20,18,18,new Is(18,new Ya(1,22))),new y(7,22,22,20,20,new Is(20,new Ya(1,30))),new y(8,24,24,22,22,new Is(24,new Ya(1,36))),new y(9,26,26,24,24,new Is(28,new Ya(1,44))),new y(10,32,32,14,14,new Is(36,new Ya(1,62))),new y(11,36,36,16,16,new Is(42,new Ya(1,86))),new y(12,40,40,18,18,new Is(48,new Ya(1,114))),new y(13,44,44,20,20,new Is(56,new Ya(1,144))),new y(14,48,48,22,22,new Is(68,new Ya(1,174))),new y(15,52,52,24,24,new Is(42,new Ya(2,102))),new y(16,64,64,14,14,new Is(56,new Ya(2,140))),new y(17,72,72,16,16,new Is(36,new Ya(4,92))),new y(18,80,80,18,18,new Is(48,new Ya(4,114))),new y(19,88,88,20,20,new Is(56,new Ya(4,144))),new y(20,96,96,22,22,new Is(68,new Ya(4,174))),new y(21,104,104,24,24,new Is(56,new Ya(6,136))),new y(22,120,120,18,18,new Is(68,new Ya(6,175))),new y(23,132,132,20,20,new Is(62,new Ya(8,163))),new y(24,144,144,22,22,new Is(62,new Ya(8,156),new Ya(2,155))),new y(25,8,18,6,16,new Is(7,new Ya(1,5))),new y(26,8,32,6,14,new Is(11,new Ya(1,10))),new y(27,12,26,10,24,new Is(14,new Ya(1,16))),new y(28,12,36,10,16,new Is(18,new Ya(1,22))),new y(29,16,36,14,16,new Is(24,new Ya(1,32))),new y(30,16,48,14,22,new Is(28,new Ya(1,49)))]},y.VERSIONS=y.buildVersions(),y}(),Wc=function(){function y(c){var l=c.getHeight();if(l<8||l>144||1&l)throw new Qn;this.version=y.readVersion(c),this.mappingBitMatrix=this.extractDataRegion(c),this.readMappingMatrix=new Qi(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return y.prototype.getVersion=function(){return this.version},y.readVersion=function(c){var l=c.getHeight(),w=c.getWidth();return Gl.getVersionForDimensions(l,w)},y.prototype.readCodewords=function(){var c=new Int8Array(this.version.getTotalCodewords()),l=0,w=4,U=0,J=this.mappingBitMatrix.getHeight(),ce=this.mappingBitMatrix.getWidth(),ge=!1,Pe=!1,Ge=!1,ut=!1;do{if(w!==J||0!==U||ge)if(w===J-2&&0===U&&3&ce&&!Pe)c[l++]=255&this.readCorner2(J,ce),w-=2,U+=2,Pe=!0;else if(w!==J+4||2!==U||7&ce||Ge)if(w!==J-2||0!==U||4!=(7&ce)||ut){do{w=0&&!this.readMappingMatrix.get(U,w)&&(c[l++]=255&this.readUtah(w,U,J,ce)),w-=2,U+=2}while(w>=0&&U=0&&U=0);w+=3,U+=1}else c[l++]=255&this.readCorner4(J,ce),w-=2,U+=2,ut=!0;else c[l++]=255&this.readCorner3(J,ce),w-=2,U+=2,Ge=!0;else c[l++]=255&this.readCorner1(J,ce),w-=2,U+=2,ge=!0}while(w=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const wc=function(){function y(c,l){this.numDataCodewords=c,this.codewords=l}return y.getDataBlocks=function(c,l){var w,U,J,ce,ge=l.getECBlocks(),Pe=0,Ge=ge.getECBlocks();try{for(var ut=Gw(Ge),_t=ut.next();!_t.done;_t=ut.next())Pe+=(Ot=_t.value).getCount()}catch(cd){w={error:cd}}finally{try{_t&&!_t.done&&(U=ut.return)&&U.call(ut)}finally{if(w)throw w.error}}var Ht=new Array(Pe),Sr=0;try{for(var jr=Gw(Ge),sn=jr.next();!sn.done;sn=jr.next())for(var Ot=sn.value,dn=0;dn7?dn-1:dn]=c[Xi++]}if(Xi!==c.length)throw new Bi;return Ht},y.prototype.getNumDataCodewords=function(){return this.numDataCodewords},y.prototype.getCodewords=function(){return this.codewords},y}(),Yg=function(){function y(c){this.bytes=c,this.byteOffset=0,this.bitOffset=0}return y.prototype.getBitOffset=function(){return this.bitOffset},y.prototype.getByteOffset=function(){return this.byteOffset},y.prototype.readBits=function(c){if(c<1||c>32||c>this.available())throw new Bi(""+c);var l=0,w=this.bitOffset,U=this.byteOffset,J=this.bytes;if(w>0){var ce=8-w,ge=c>8-ge<<(Pe=ce-ge))>>Pe,c-=ge,8===(w+=ge)&&(w=0,U++)}if(c>0){for(;c>=8;)l=l<<8|255&J[U],U++,c-=8;var Pe;c>0&&(l=l<>(Pe=8-c)<>Pe,w+=c)}return this.bitOffset=w,this.byteOffset=U,l},y.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},y}();var Ga=function(y){return y[y.PAD_ENCODE=0]="PAD_ENCODE",y[y.ASCII_ENCODE=1]="ASCII_ENCODE",y[y.C40_ENCODE=2]="C40_ENCODE",y[y.TEXT_ENCODE=3]="TEXT_ENCODE",y[y.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",y[y.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",y[y.BASE256_ENCODE=6]="BASE256_ENCODE",y}(Ga||{});const Sh=function(){function y(){}return y.decode=function(c){var l=new Yg(c),w=new Ur,U=new Ur,J=new Array,ce=Ga.ASCII_ENCODE;do{if(ce===Ga.ASCII_ENCODE)ce=this.decodeAsciiSegment(l,w,U);else{switch(ce){case Ga.C40_ENCODE:this.decodeC40Segment(l,w);break;case Ga.TEXT_ENCODE:this.decodeTextSegment(l,w);break;case Ga.ANSIX12_ENCODE:this.decodeAnsiX12Segment(l,w);break;case Ga.EDIFACT_ENCODE:this.decodeEdifactSegment(l,w);break;case Ga.BASE256_ENCODE:this.decodeBase256Segment(l,w,J);break;default:throw new Qn}ce=Ga.ASCII_ENCODE}}while(ce!==Ga.PAD_ENCODE&&l.available()>0);return U.length()>0&&w.append(U.toString()),new qu(c,w.toString(),0===J.length?null:J,null)},y.decodeAsciiSegment=function(c,l,w){var U=!1;do{var J=c.readBits(8);if(0===J)throw new Qn;if(J<=128)return U&&(J+=128),l.append(String.fromCharCode(J-1)),Ga.ASCII_ENCODE;if(129===J)return Ga.PAD_ENCODE;if(J<=229){var ce=J-130;ce<10&&l.append("0"),l.append(""+ce)}else switch(J){case 230:return Ga.C40_ENCODE;case 231:return Ga.BASE256_ENCODE;case 232:l.append("\x1d");break;case 233:case 234:case 241:break;case 235:U=!0;break;case 236:l.append("[)>\x1e05\x1d"),w.insert(0,"\x1e\x04");break;case 237:l.append("[)>\x1e06\x1d"),w.insert(0,"\x1e\x04");break;case 238:return Ga.ANSIX12_ENCODE;case 239:return Ga.TEXT_ENCODE;case 240:return Ga.EDIFACT_ENCODE;default:if(254!==J||0!==c.available())throw new Qn}}while(c.available()>0);return Ga.ASCII_ENCODE},y.decodeC40Segment=function(c,l){var w=!1,U=[],J=0;do{if(8===c.available())return;var ce=c.readBits(8);if(254===ce)return;this.parseTwoBytes(ce,c.readBits(8),U);for(var ge=0;ge<3;ge++){var Pe=U[ge];switch(J){case 0:if(Pe<3)J=Pe+1;else{if(!(Pe0)},y.decodeTextSegment=function(c,l){var w=!1,U=[],J=0;do{if(8===c.available())return;var ce=c.readBits(8);if(254===ce)return;this.parseTwoBytes(ce,c.readBits(8),U);for(var ge=0;ge<3;ge++){var Pe=U[ge];switch(J){case 0:if(Pe<3)J=Pe+1;else{if(!(Pe0)},y.decodeAnsiX12Segment=function(c,l){var w=[];do{if(8===c.available())return;var U=c.readBits(8);if(254===U)return;this.parseTwoBytes(U,c.readBits(8),w);for(var J=0;J<3;J++){var ce=w[J];switch(ce){case 0:l.append("\r");break;case 1:l.append("*");break;case 2:l.append(">");break;case 3:l.append(" ");break;default:if(ce<14)l.append(String.fromCharCode(ce+44));else{if(!(ce<40))throw new Qn;l.append(String.fromCharCode(ce+51))}}}}while(c.available()>0)},y.parseTwoBytes=function(c,l,w){var U=(c<<8)+l-1,J=Math.floor(U/1600);w[0]=J,U-=1600*J,J=Math.floor(U/40),w[1]=J,w[2]=U-40*J},y.decodeEdifactSegment=function(c,l){do{if(c.available()<=16)return;for(var w=0;w<4;w++){var U=c.readBits(6);if(31===U){var J=8-c.getBitOffset();return void(8!==J&&c.readBits(J))}32&U||(U|=64),l.append(String.fromCharCode(U))}}while(c.available()>0)},y.decodeBase256Segment=function(c,l,w){var ce,U=1+c.getByteOffset(),J=this.unrandomize255State(c.readBits(8),U++);if((ce=0===J?c.available()/8|0:J<250?J:250*(J-249)+this.unrandomize255State(c.readBits(8),U++))<0)throw new Qn;for(var ge=new Uint8Array(ce),Pe=0;Pe=0?U:U+256},y.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],y.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],y.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],y.TEXT_SHIFT2_SET_CHARS=y.C40_SHIFT2_SET_CHARS,y.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~","\x7f"],y}(),Qg=function(){function y(){this.rsDecoder=new xc(Pa.DATA_MATRIX_FIELD_256)}return y.prototype.decode=function(c){var l,w,U=new Wc(c),J=U.getVersion(),ce=U.readCodewords(),ge=wc.getDataBlocks(ce,J),Pe=0;try{for(var Ge=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(ge),ut=Ge.next();!ut.done;ut=Ge.next())Pe+=ut.value.getNumDataCodewords()}catch(On){l={error:On}}finally{try{ut&&!ut.done&&(w=Ge.return)&&w.call(Ge)}finally{if(l)throw l.error}}for(var Ot=new Uint8Array(Pe),Ht=ge.length,Sr=0;Srge&&(ut=ge,_t[0]=l,_t[1]=w,_t[2]=U,_t[3]=J),ut>Pe&&(ut=Pe,_t[0]=w,_t[1]=U,_t[2]=J,_t[3]=l),ut>Ge&&(_t[0]=U,_t[1]=J,_t[2]=l,_t[3]=w),_t},y.prototype.detectSolid2=function(c){var l=c[0],w=c[1],U=c[2],J=c[3],ce=this.transitionsBetween(l,J),ge=y.shiftPoint(w,U,4*(ce+1)),Pe=y.shiftPoint(U,w,4*(ce+1));return this.transitionsBetween(ge,l)this.transitionsBetween(Pe,_t)+this.transitionsBetween(Ge,_t)?ut:_t:ut:this.isValid(_t)?_t:null},y.prototype.shiftToModuleCenter=function(c){var l=c[0],w=c[1],U=c[2],J=c[3],ce=this.transitionsBetween(l,J)+1,ge=this.transitionsBetween(U,J)+1,Pe=y.shiftPoint(l,w,4*ge),Ge=y.shiftPoint(U,w,4*ce);!(1&~(ce=this.transitionsBetween(Pe,J)+1))&&(ce+=1),!(1&~(ge=this.transitionsBetween(Ge,J)+1))&&(ge+=1);var Ot,Ht,ut=(l.getX()+w.getX()+U.getX()+J.getX())/4,_t=(l.getY()+w.getY()+U.getY()+J.getY())/4;return l=y.moveAway(l,ut,_t),w=y.moveAway(w,ut,_t),U=y.moveAway(U,ut,_t),J=y.moveAway(J,ut,_t),Pe=y.shiftPoint(l,w,4*ge),Pe=y.shiftPoint(Pe,J,4*ce),Ot=y.shiftPoint(w,l,4*ge),Ot=y.shiftPoint(Ot,U,4*ce),Ge=y.shiftPoint(U,J,4*ge),Ge=y.shiftPoint(Ge,w,4*ce),Ht=y.shiftPoint(J,U,4*ge),[Pe,Ot,Ge,Ht=y.shiftPoint(Ht,l,4*ce)]},y.prototype.isValid=function(c){return c.getX()>=0&&c.getX()0&&c.getY()Math.abs(J-w);if(ge){var Pe=w;w=U,U=Pe,Pe=J,J=ce,ce=Pe}for(var Ge=Math.abs(J-w),ut=Math.abs(ce-U),_t=-Ge/2,Ot=U0){if(dn===ce)break;dn+=Ot,_t-=Ge}}return Sr},y}(),v0=function(){function y(){this.decoder=new Qg}return y.prototype.decode=function(c,l){var w,U;if(void 0===l&&(l=null),null!=l&&l.has(Ci.PURE_BARCODE)){var J=y.extractPureBits(c.getBlackMatrix());w=this.decoder.decode(J),U=y.NO_POINTS}else{var ce=new Xw(c.getBlackMatrix()).detect();w=this.decoder.decode(ce.getBits()),U=ce.getPoints()}var ge=w.getRawBytes(),Pe=new Cs(w.getText(),ge,8*ge.length,U,Co.DATA_MATRIX,Rt.currentTimeMillis()),Ge=w.getByteSegments();null!=Ge&&Pe.putMetadata(gc.BYTE_SEGMENTS,Ge);var ut=w.getECLevel();return null!=ut&&Pe.putMetadata(gc.ERROR_CORRECTION_LEVEL,ut),Pe},y.prototype.reset=function(){},y.extractPureBits=function(c){var l=c.getTopLeftOnBit(),w=c.getBottomRightOnBit();if(null==l||null==w)throw new Gn;var U=this.moduleSize(l,c),J=l[1],ge=l[0],Ge=(w[0]-ge+1)/U,ut=(w[1]-J+1)/U;if(Ge<=0||ut<=0)throw new Gn;var _t=U/2;J+=_t,ge+=_t;for(var Ot=new Qi(Ge,ut),Ht=0;Ht=y.FOR_BITS.size)throw new Bi;return y.FOR_BITS.get(c)},y.FOR_BITS=new Map,y.FOR_VALUE=new Map,y.L=new y(Ah.L,"L",1),y.M=new y(Ah.M,"M",0),y.Q=new y(Ah.Q,"Q",3),y.H=new y(Ah.H,"H",2),y}(),Uc=function(){function y(c){this.errorCorrectionLevel=Sl.forBits(c>>3&3),this.dataMask=7&c}return y.numBitsDiffering=function(c,l){return pi.bitCount(c^l)},y.decodeFormatInformation=function(c,l){var w=y.doDecodeFormatInformation(c,l);return null!==w?w:y.doDecodeFormatInformation(c^y.FORMAT_INFO_MASK_QR,l^y.FORMAT_INFO_MASK_QR)},y.doDecodeFormatInformation=function(c,l){var w,U,J=Number.MAX_SAFE_INTEGER,ce=0;try{for(var ge=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(y.FORMAT_INFO_DECODE_LOOKUP),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value,ut=Ge[0];if(ut===c||ut===l)return new y(Ge[1]);var _t=y.numBitsDiffering(c,ut);_t=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(U),ce=J.next();!ce.done;ce=J.next())w+=ce.value.getCount()}catch(Pe){c={error:Pe}}finally{try{ce&&!ce.done&&(l=J.return)&&l.call(J)}finally{if(c)throw c.error}}return w},y.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},y.prototype.getECBlocks=function(){return this.ecBlocks},y}(),Vr=function(){function y(c,l){this.count=c,this.dataCodewords=l}return y.prototype.getCount=function(){return this.count},y.prototype.getDataCodewords=function(){return this.dataCodewords},y}(),Zh=function(){function y(c,l){for(var w,U,J=[],ce=2;ce=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(Ge),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value;ge+=Ot.getCount()*(Ot.getDataCodewords()+Pe)}}catch(Ht){w={error:Ht}}finally{try{_t&&!_t.done&&(U=ut.return)&&U.call(ut)}finally{if(w)throw w.error}}this.totalCodewords=ge}return y.prototype.getVersionNumber=function(){return this.versionNumber},y.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},y.prototype.getTotalCodewords=function(){return this.totalCodewords},y.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},y.prototype.getECBlocksForLevel=function(c){return this.ecBlocks[c.getValue()]},y.getProvisionalVersionForDimension=function(c){if(c%4!=1)throw new Qn;try{return this.getVersionForNumber((c-17)/4)}catch{throw new Qn}},y.getVersionForNumber=function(c){if(c<1||c>40)throw new Bi;return y.VERSIONS[c-1]},y.decodeVersionInformation=function(c){for(var l=Number.MAX_SAFE_INTEGER,w=0,U=0;U6&&(l.setRegion(c-11,0,3,6),l.setRegion(0,c-11,6,3)),l},y.prototype.toString=function(){return""+this.versionNumber},y.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),y.VERSIONS=[new y(1,new Int32Array(0),new Mn(7,new Vr(1,19)),new Mn(10,new Vr(1,16)),new Mn(13,new Vr(1,13)),new Mn(17,new Vr(1,9))),new y(2,Int32Array.from([6,18]),new Mn(10,new Vr(1,34)),new Mn(16,new Vr(1,28)),new Mn(22,new Vr(1,22)),new Mn(28,new Vr(1,16))),new y(3,Int32Array.from([6,22]),new Mn(15,new Vr(1,55)),new Mn(26,new Vr(1,44)),new Mn(18,new Vr(2,17)),new Mn(22,new Vr(2,13))),new y(4,Int32Array.from([6,26]),new Mn(20,new Vr(1,80)),new Mn(18,new Vr(2,32)),new Mn(26,new Vr(2,24)),new Mn(16,new Vr(4,9))),new y(5,Int32Array.from([6,30]),new Mn(26,new Vr(1,108)),new Mn(24,new Vr(2,43)),new Mn(18,new Vr(2,15),new Vr(2,16)),new Mn(22,new Vr(2,11),new Vr(2,12))),new y(6,Int32Array.from([6,34]),new Mn(18,new Vr(2,68)),new Mn(16,new Vr(4,27)),new Mn(24,new Vr(4,19)),new Mn(28,new Vr(4,15))),new y(7,Int32Array.from([6,22,38]),new Mn(20,new Vr(2,78)),new Mn(18,new Vr(4,31)),new Mn(18,new Vr(2,14),new Vr(4,15)),new Mn(26,new Vr(4,13),new Vr(1,14))),new y(8,Int32Array.from([6,24,42]),new Mn(24,new Vr(2,97)),new Mn(22,new Vr(2,38),new Vr(2,39)),new Mn(22,new Vr(4,18),new Vr(2,19)),new Mn(26,new Vr(4,14),new Vr(2,15))),new y(9,Int32Array.from([6,26,46]),new Mn(30,new Vr(2,116)),new Mn(22,new Vr(3,36),new Vr(2,37)),new Mn(20,new Vr(4,16),new Vr(4,17)),new Mn(24,new Vr(4,12),new Vr(4,13))),new y(10,Int32Array.from([6,28,50]),new Mn(18,new Vr(2,68),new Vr(2,69)),new Mn(26,new Vr(4,43),new Vr(1,44)),new Mn(24,new Vr(6,19),new Vr(2,20)),new Mn(28,new Vr(6,15),new Vr(2,16))),new y(11,Int32Array.from([6,30,54]),new Mn(20,new Vr(4,81)),new Mn(30,new Vr(1,50),new Vr(4,51)),new Mn(28,new Vr(4,22),new Vr(4,23)),new Mn(24,new Vr(3,12),new Vr(8,13))),new y(12,Int32Array.from([6,32,58]),new Mn(24,new Vr(2,92),new Vr(2,93)),new Mn(22,new Vr(6,36),new Vr(2,37)),new Mn(26,new Vr(4,20),new Vr(6,21)),new Mn(28,new Vr(7,14),new Vr(4,15))),new y(13,Int32Array.from([6,34,62]),new Mn(26,new Vr(4,107)),new Mn(22,new Vr(8,37),new Vr(1,38)),new Mn(24,new Vr(8,20),new Vr(4,21)),new Mn(22,new Vr(12,11),new Vr(4,12))),new y(14,Int32Array.from([6,26,46,66]),new Mn(30,new Vr(3,115),new Vr(1,116)),new Mn(24,new Vr(4,40),new Vr(5,41)),new Mn(20,new Vr(11,16),new Vr(5,17)),new Mn(24,new Vr(11,12),new Vr(5,13))),new y(15,Int32Array.from([6,26,48,70]),new Mn(22,new Vr(5,87),new Vr(1,88)),new Mn(24,new Vr(5,41),new Vr(5,42)),new Mn(30,new Vr(5,24),new Vr(7,25)),new Mn(24,new Vr(11,12),new Vr(7,13))),new y(16,Int32Array.from([6,26,50,74]),new Mn(24,new Vr(5,98),new Vr(1,99)),new Mn(28,new Vr(7,45),new Vr(3,46)),new Mn(24,new Vr(15,19),new Vr(2,20)),new Mn(30,new Vr(3,15),new Vr(13,16))),new y(17,Int32Array.from([6,30,54,78]),new Mn(28,new Vr(1,107),new Vr(5,108)),new Mn(28,new Vr(10,46),new Vr(1,47)),new Mn(28,new Vr(1,22),new Vr(15,23)),new Mn(28,new Vr(2,14),new Vr(17,15))),new y(18,Int32Array.from([6,30,56,82]),new Mn(30,new Vr(5,120),new Vr(1,121)),new Mn(26,new Vr(9,43),new Vr(4,44)),new Mn(28,new Vr(17,22),new Vr(1,23)),new Mn(28,new Vr(2,14),new Vr(19,15))),new y(19,Int32Array.from([6,30,58,86]),new Mn(28,new Vr(3,113),new Vr(4,114)),new Mn(26,new Vr(3,44),new Vr(11,45)),new Mn(26,new Vr(17,21),new Vr(4,22)),new Mn(26,new Vr(9,13),new Vr(16,14))),new y(20,Int32Array.from([6,34,62,90]),new Mn(28,new Vr(3,107),new Vr(5,108)),new Mn(26,new Vr(3,41),new Vr(13,42)),new Mn(30,new Vr(15,24),new Vr(5,25)),new Mn(28,new Vr(15,15),new Vr(10,16))),new y(21,Int32Array.from([6,28,50,72,94]),new Mn(28,new Vr(4,116),new Vr(4,117)),new Mn(26,new Vr(17,42)),new Mn(28,new Vr(17,22),new Vr(6,23)),new Mn(30,new Vr(19,16),new Vr(6,17))),new y(22,Int32Array.from([6,26,50,74,98]),new Mn(28,new Vr(2,111),new Vr(7,112)),new Mn(28,new Vr(17,46)),new Mn(30,new Vr(7,24),new Vr(16,25)),new Mn(24,new Vr(34,13))),new y(23,Int32Array.from([6,30,54,78,102]),new Mn(30,new Vr(4,121),new Vr(5,122)),new Mn(28,new Vr(4,47),new Vr(14,48)),new Mn(30,new Vr(11,24),new Vr(14,25)),new Mn(30,new Vr(16,15),new Vr(14,16))),new y(24,Int32Array.from([6,28,54,80,106]),new Mn(30,new Vr(6,117),new Vr(4,118)),new Mn(28,new Vr(6,45),new Vr(14,46)),new Mn(30,new Vr(11,24),new Vr(16,25)),new Mn(30,new Vr(30,16),new Vr(2,17))),new y(25,Int32Array.from([6,32,58,84,110]),new Mn(26,new Vr(8,106),new Vr(4,107)),new Mn(28,new Vr(8,47),new Vr(13,48)),new Mn(30,new Vr(7,24),new Vr(22,25)),new Mn(30,new Vr(22,15),new Vr(13,16))),new y(26,Int32Array.from([6,30,58,86,114]),new Mn(28,new Vr(10,114),new Vr(2,115)),new Mn(28,new Vr(19,46),new Vr(4,47)),new Mn(28,new Vr(28,22),new Vr(6,23)),new Mn(30,new Vr(33,16),new Vr(4,17))),new y(27,Int32Array.from([6,34,62,90,118]),new Mn(30,new Vr(8,122),new Vr(4,123)),new Mn(28,new Vr(22,45),new Vr(3,46)),new Mn(30,new Vr(8,23),new Vr(26,24)),new Mn(30,new Vr(12,15),new Vr(28,16))),new y(28,Int32Array.from([6,26,50,74,98,122]),new Mn(30,new Vr(3,117),new Vr(10,118)),new Mn(28,new Vr(3,45),new Vr(23,46)),new Mn(30,new Vr(4,24),new Vr(31,25)),new Mn(30,new Vr(11,15),new Vr(31,16))),new y(29,Int32Array.from([6,30,54,78,102,126]),new Mn(30,new Vr(7,116),new Vr(7,117)),new Mn(28,new Vr(21,45),new Vr(7,46)),new Mn(30,new Vr(1,23),new Vr(37,24)),new Mn(30,new Vr(19,15),new Vr(26,16))),new y(30,Int32Array.from([6,26,52,78,104,130]),new Mn(30,new Vr(5,115),new Vr(10,116)),new Mn(28,new Vr(19,47),new Vr(10,48)),new Mn(30,new Vr(15,24),new Vr(25,25)),new Mn(30,new Vr(23,15),new Vr(25,16))),new y(31,Int32Array.from([6,30,56,82,108,134]),new Mn(30,new Vr(13,115),new Vr(3,116)),new Mn(28,new Vr(2,46),new Vr(29,47)),new Mn(30,new Vr(42,24),new Vr(1,25)),new Mn(30,new Vr(23,15),new Vr(28,16))),new y(32,Int32Array.from([6,34,60,86,112,138]),new Mn(30,new Vr(17,115)),new Mn(28,new Vr(10,46),new Vr(23,47)),new Mn(30,new Vr(10,24),new Vr(35,25)),new Mn(30,new Vr(19,15),new Vr(35,16))),new y(33,Int32Array.from([6,30,58,86,114,142]),new Mn(30,new Vr(17,115),new Vr(1,116)),new Mn(28,new Vr(14,46),new Vr(21,47)),new Mn(30,new Vr(29,24),new Vr(19,25)),new Mn(30,new Vr(11,15),new Vr(46,16))),new y(34,Int32Array.from([6,34,62,90,118,146]),new Mn(30,new Vr(13,115),new Vr(6,116)),new Mn(28,new Vr(14,46),new Vr(23,47)),new Mn(30,new Vr(44,24),new Vr(7,25)),new Mn(30,new Vr(59,16),new Vr(1,17))),new y(35,Int32Array.from([6,30,54,78,102,126,150]),new Mn(30,new Vr(12,121),new Vr(7,122)),new Mn(28,new Vr(12,47),new Vr(26,48)),new Mn(30,new Vr(39,24),new Vr(14,25)),new Mn(30,new Vr(22,15),new Vr(41,16))),new y(36,Int32Array.from([6,24,50,76,102,128,154]),new Mn(30,new Vr(6,121),new Vr(14,122)),new Mn(28,new Vr(6,47),new Vr(34,48)),new Mn(30,new Vr(46,24),new Vr(10,25)),new Mn(30,new Vr(2,15),new Vr(64,16))),new y(37,Int32Array.from([6,28,54,80,106,132,158]),new Mn(30,new Vr(17,122),new Vr(4,123)),new Mn(28,new Vr(29,46),new Vr(14,47)),new Mn(30,new Vr(49,24),new Vr(10,25)),new Mn(30,new Vr(24,15),new Vr(46,16))),new y(38,Int32Array.from([6,32,58,84,110,136,162]),new Mn(30,new Vr(4,122),new Vr(18,123)),new Mn(28,new Vr(13,46),new Vr(32,47)),new Mn(30,new Vr(48,24),new Vr(14,25)),new Mn(30,new Vr(42,15),new Vr(32,16))),new y(39,Int32Array.from([6,26,54,82,110,138,166]),new Mn(30,new Vr(20,117),new Vr(4,118)),new Mn(28,new Vr(40,47),new Vr(7,48)),new Mn(30,new Vr(43,24),new Vr(22,25)),new Mn(30,new Vr(10,15),new Vr(67,16))),new y(40,Int32Array.from([6,30,58,86,114,142,170]),new Mn(30,new Vr(19,118),new Vr(6,119)),new Mn(28,new Vr(18,47),new Vr(31,48)),new Mn(30,new Vr(34,24),new Vr(34,25)),new Mn(30,new Vr(20,15),new Vr(61,16)))],y}();var Oa=function(y){return y[y.DATA_MASK_000=0]="DATA_MASK_000",y[y.DATA_MASK_001=1]="DATA_MASK_001",y[y.DATA_MASK_010=2]="DATA_MASK_010",y[y.DATA_MASK_011=3]="DATA_MASK_011",y[y.DATA_MASK_100=4]="DATA_MASK_100",y[y.DATA_MASK_101=5]="DATA_MASK_101",y[y.DATA_MASK_110=6]="DATA_MASK_110",y[y.DATA_MASK_111=7]="DATA_MASK_111",y}(Oa||{});const au=function(){function y(c,l){this.value=c,this.isMasked=l}return y.prototype.unmaskBitMatrix=function(c,l){for(var w=0;w=0;w--)c=this.copyBit(8,w,c);var U=this.bitMatrix.getHeight(),J=0,ce=U-7;for(w=U-1;w>=ce;w--)J=this.copyBit(8,w,J);for(l=U-8;l=0;J--)for(var ce=c-9;ce>=U;ce--)w=this.copyBit(ce,J,w);var ge=Zh.decodeVersionInformation(w);if(null!==ge&&ge.getDimensionForVersion()===c)return this.parsedVersion=ge,ge;for(w=0,ce=5;ce>=0;ce--)for(J=c-9;J>=U;J--)w=this.copyBit(ce,J,w);if(null!==(ge=Zh.decodeVersionInformation(w))&&ge.getDimensionForVersion()===c)return this.parsedVersion=ge,ge;throw new Qn},y.prototype.copyBit=function(c,l,w){return(this.isMirror?this.bitMatrix.get(l,c):this.bitMatrix.get(c,l))?w<<1|1:w<<1},y.prototype.readCodewords=function(){var c=this.readFormatInformation(),l=this.readVersion(),w=au.values.get(c.getDataMask()),U=this.bitMatrix.getHeight();w.unmaskBitMatrix(this.bitMatrix,U);for(var J=l.buildFunctionPattern(),ce=!0,ge=new Uint8Array(l.getTotalCodewords()),Pe=0,Ge=0,ut=0,_t=U-1;_t>0;_t-=2){6===_t&&_t--;for(var Ot=0;Ot=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const Jw=function(){function y(c,l){this.numDataCodewords=c,this.codewords=l}return y.getDataBlocks=function(c,l,w){var U,J,ce,ge;if(c.length!==l.getTotalCodewords())throw new Bi;var Pe=l.getECBlocksForLevel(w),Ge=0,ut=Pe.getECBlocks();try{for(var _t=u1(ut),Ot=_t.next();!Ot.done;Ot=_t.next())Ge+=(Ht=Ot.value).getCount()}catch(Xc){U={error:Xc}}finally{try{Ot&&!Ot.done&&(J=_t.return)&&J.call(_t)}finally{if(U)throw U.error}}var Sr=new Array(Ge),jr=0;try{for(var sn=u1(ut),dn=sn.next();!dn.done;dn=sn.next())for(var Ht=dn.value,ln=0;ln=0&&Sr[ki].codewords.length!==vi;)ki--;ki++;var So=vi-Pe.getECCodewordsPerBlock(),Ns=0;for(ln=0;lnc.available())throw new Qn;for(var U=new Uint8Array(2*w),J=0;w>0;){var ce=c.readBits(13),ge=ce/96<<8&4294967295|ce%96;U[J]=(ge+=ge<959?41377:42657)>>8&255,U[J+1]=255&ge,J+=2,w--}try{l.append(Wt.decode(U,bt.GB2312))}catch(Pe){throw new Qn(Pe)}},y.decodeKanjiSegment=function(c,l,w){if(13*w>c.available())throw new Qn;for(var U=new Uint8Array(2*w),J=0;w>0;){var ce=c.readBits(13),ge=ce/192<<8&4294967295|ce%192;U[J]=(ge+=ge<7936?33088:49472)>>8,U[J+1]=ge,J+=2,w--}try{l.append(Wt.decode(U,bt.SHIFT_JIS))}catch(Pe){throw new Qn(Pe)}},y.decodeByteSegment=function(c,l,w,U,J,ce){if(8*w>c.available())throw new Qn;for(var ge=new Uint8Array(w),Pe=0;Pe=y.ALPHANUMERIC_CHARS.length)throw new Qn;return y.ALPHANUMERIC_CHARS[c]},y.decodeAlphanumericSegment=function(c,l,w,U){for(var J=l.length();w>1;){if(c.available()<11)throw new Qn;var ce=c.readBits(11);l.append(y.toAlphaNumericChar(Math.floor(ce/45))),l.append(y.toAlphaNumericChar(ce%45)),w-=2}if(1===w){if(c.available()<6)throw new Qn;l.append(y.toAlphaNumericChar(c.readBits(6)))}if(U)for(var ge=J;ge=3;){if(c.available()<10)throw new Qn;var U=c.readBits(10);if(U>=1e3)throw new Qn;l.append(y.toAlphaNumericChar(Math.floor(U/100))),l.append(y.toAlphaNumericChar(Math.floor(U/10)%10)),l.append(y.toAlphaNumericChar(U%10)),w-=3}if(2===w){if(c.available()<7)throw new Qn;var J=c.readBits(7);if(J>=100)throw new Qn;l.append(y.toAlphaNumericChar(Math.floor(J/10))),l.append(y.toAlphaNumericChar(J%10))}else if(1===w){if(c.available()<4)throw new Qn;var ce=c.readBits(4);if(ce>=10)throw new Qn;l.append(y.toAlphaNumericChar(ce))}},y.parseECIValue=function(c){var l=c.readBits(8);if(!(128&l))return 127&l;if(128==(192&l))return(63&l)<<8&4294967295|c.readBits(8);if(192==(224&l))return(31&l)<<16&4294967295|c.readBits(16);throw new Qn},y.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",y.GB2312_SUBSET=1,y}(),f1=function(){function y(c){this.mirrored=c}return y.prototype.isMirrored=function(){return this.mirrored},y.prototype.applyMirroredCorrection=function(c){if(this.mirrored&&null!==c&&!(c.length<3)){var l=c[0];c[0]=c[2],c[2]=l}},y}();var hx=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const mx=function(){function y(){this.rsDecoder=new xc(Pa.QR_CODE_FIELD_256)}return y.prototype.decodeBooleanArray=function(c,l){return this.decodeBitMatrix(Qi.parseFromBooleanArray(c),l)},y.prototype.decodeBitMatrix=function(c,l){var w=new Ch(c),U=null;try{return this.decodeBitMatrixParser(w,l)}catch(ce){U=ce}try{w.remask(),w.setMirror(!0),w.readVersion(),w.readFormatInformation(),w.mirror();var J=this.decodeBitMatrixParser(w,l);return J.setOther(new f1(!0)),J}catch(ce){throw null!==U?U:ce}},y.prototype.decodeBitMatrixParser=function(c,l){var w,U,J,ce,ge=c.readVersion(),Pe=c.readFormatInformation().getErrorCorrectionLevel(),Ge=c.readCodewords(),ut=Jw.getDataBlocks(Ge,ge,Pe),_t=0;try{for(var Ot=hx(ut),Ht=Ot.next();!Ht.done;Ht=Ot.next())_t+=(Sr=Ht.value).getNumDataCodewords()}catch(ki){w={error:ki}}finally{try{Ht&&!Ht.done&&(U=Ot.return)&&U.call(Ot)}finally{if(w)throw w.error}}var jr=new Uint8Array(_t),sn=0;try{for(var dn=hx(ut),ln=dn.next();!ln.done;ln=dn.next()){var Sr,On=(Sr=ln.value).getCodewords(),Wn=Sr.getNumDataCodewords();this.correctErrors(On,Wn);for(var vi=0;vi=w)return!1;return!0},y.prototype.crossCheckVertical=function(c,l,w,U){var J=this.image,ce=J.getHeight(),ge=this.crossCheckStateCount;ge[0]=0,ge[1]=0,ge[2]=0;for(var Pe=c;Pe>=0&&J.get(l,Pe)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&!J.get(l,Pe)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=c+1;Pew)return NaN;for(;Pew||5*Math.abs(ge[0]+ge[1]+ge[2]-U)>=2*U?NaN:this.foundPatternCross(ge)?y.centerFromEnd(ge,Pe):NaN},y.prototype.handlePossibleCenter=function(c,l,w){var U,J,ce=c[0]+c[1]+c[2],ge=y.centerFromEnd(c,w),Pe=this.crossCheckVertical(l,ge,2*c[1],ce);if(!isNaN(Pe)){var Ge=(c[0]+c[1]+c[2])/3;try{for(var ut=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.possibleCenters),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value;if(Ot.aboutEquals(Ge,Pe,ge))return Ot.combineEstimate(Pe,ge,Ge)}}catch(Sr){U={error:Sr}}finally{try{_t&&!_t.done&&(J=ut.return)&&J.call(ut)}finally{if(U)throw U.error}}var Ht=new Vu(ge,Pe,Ge);this.possibleCenters.push(Ht),null!=this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(Ht)}return null},y}();var vd=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const _0=function(y){function c(l,w,U,J){var ce=y.call(this,l,w)||this;return ce.estimatedModuleSize=U,ce.count=J,void 0===J&&(ce.count=1),ce}return vd(c,y),c.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},c.prototype.getCount=function(){return this.count},c.prototype.aboutEquals=function(l,w,U){if(Math.abs(w-this.getY())<=l&&Math.abs(U-this.getX())<=l){var J=Math.abs(l-this.estimatedModuleSize);return J<=1||J<=this.estimatedModuleSize}return!1},c.prototype.combineEstimate=function(l,w,U){var J=this.count+1;return new c((this.count*this.getX()+w)/J,(this.count*this.getY()+l)/J,(this.count*this.estimatedModuleSize+U)/J,J)},c}(_o),Yl=function(){function y(c){this.bottomLeft=c[0],this.topLeft=c[1],this.topRight=c[2]}return y.prototype.getBottomLeft=function(){return this.bottomLeft},y.prototype.getTopLeft=function(){return this.topLeft},y.prototype.getTopRight=function(){return this.topRight},y}();var ry=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const h1=function(){function y(c,l){this.image=c,this.resultPointCallback=l,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=l}return y.prototype.getImage=function(){return this.image},y.prototype.getPossibleCenters=function(){return this.possibleCenters},y.prototype.find=function(c){var l=null!=c&&void 0!==c.get(Ci.TRY_HARDER),w=null!=c&&void 0!==c.get(Ci.PURE_BARCODE),U=this.image,J=U.getHeight(),ce=U.getWidth(),ge=Math.floor(3*J/(4*y.MAX_MODULES));(geGe[2]&&(ut+=Sr-Ge[2]-ge,Ot=ce-1)}_t=0,Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0,Ge[4]=0}else Ge[0]=Ge[2],Ge[1]=Ge[3],Ge[2]=Ge[4],Ge[3]=1,Ge[4]=0,_t=3;else Ge[++_t]++;y.foundPatternCross(Ge)&&!0===this.handlePossibleCenter(Ge,ut,ce,w)&&(ge=Ge[0],this.hasSkipped&&(Pe=this.haveMultiplyConfirmedCenters()))}var jr=this.selectBestPatterns();return _o.orderBestPatterns(jr),new Yl(jr)},y.centerFromEnd=function(c,l){return l-c[4]-c[3]-c[2]/2},y.foundPatternCross=function(c){for(var l=0,w=0;w<5;w++){var U=c[w];if(0===U)return!1;l+=U}if(l<7)return!1;var J=l/7,ce=J/2;return Math.abs(J-c[0])=ce&&l>=ce&&ge.get(l-ce,c-ce);)J[2]++,ce++;if(c=ce&&l>=ce&&!ge.get(l-ce,c-ce)&&J[1]<=w;)J[1]++,ce++;if(cw)return!1;for(;c>=ce&&l>=ce&&ge.get(l-ce,c-ce)&&J[0]<=w;)J[0]++,ce++;if(J[0]>w)return!1;var Pe=ge.getHeight(),Ge=ge.getWidth();for(ce=1;c+ce=Pe||l+ce>=Ge)return!1;for(;c+ce=Pe||l+ce>=Ge||J[3]>=w)return!1;for(;c+ce=w)&&Math.abs(J[0]+J[1]+J[2]+J[3]+J[4]-U)<2*U&&y.foundPatternCross(J)},y.prototype.crossCheckVertical=function(c,l,w,U){for(var J=this.image,ce=J.getHeight(),ge=this.getCrossCheckStateCount(),Pe=c;Pe>=0&&J.get(l,Pe);)ge[2]++,Pe--;if(Pe<0)return NaN;for(;Pe>=0&&!J.get(l,Pe)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&J.get(l,Pe)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=c+1;Pe=w)return NaN;for(;Pe=w||5*Math.abs(ge[0]+ge[1]+ge[2]+ge[3]+ge[4]-U)>=2*U?NaN:y.foundPatternCross(ge)?y.centerFromEnd(ge,Pe):NaN},y.prototype.crossCheckHorizontal=function(c,l,w,U){for(var J=this.image,ce=J.getWidth(),ge=this.getCrossCheckStateCount(),Pe=c;Pe>=0&&J.get(Pe,l);)ge[2]++,Pe--;if(Pe<0)return NaN;for(;Pe>=0&&!J.get(Pe,l)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&J.get(Pe,l)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=c+1;Pe=w)return NaN;for(;Pe=w||5*Math.abs(ge[0]+ge[1]+ge[2]+ge[3]+ge[4]-U)>=U?NaN:y.foundPatternCross(ge)?y.centerFromEnd(ge,Pe):NaN},y.prototype.handlePossibleCenter=function(c,l,w,U){var J=c[0]+c[1]+c[2]+c[3]+c[4],ce=y.centerFromEnd(c,w),ge=this.crossCheckVertical(l,Math.floor(ce),c[2],J);if(!isNaN(ge)&&(ce=this.crossCheckHorizontal(Math.floor(ce),Math.floor(ge),c[2],J),!isNaN(ce)&&(!U||this.crossCheckDiagonal(Math.floor(ge),Math.floor(ce),c[2],J)))){for(var Pe=J/7,Ge=!1,ut=this.possibleCenters,_t=0,Ot=ut.length;_t=y.CENTER_QUORUM){if(null!=U)return this.hasSkipped=!0,Math.floor((Math.abs(U.getX()-ge.getX())-Math.abs(U.getY()-ge.getY()))/2);U=ge}}}catch(Pe){c={error:Pe}}finally{try{ce&&!ce.done&&(l=J.return)&&l.call(J)}finally{if(c)throw c.error}}return 0},y.prototype.haveMultiplyConfirmedCenters=function(){var c,l,w,U,J=0,ce=0,ge=this.possibleCenters.length;try{for(var Pe=ry(this.possibleCenters),Ge=Pe.next();!Ge.done;Ge=Pe.next())(ut=Ge.value).getCount()>=y.CENTER_QUORUM&&(J++,ce+=ut.getEstimatedModuleSize())}catch(jr){c={error:jr}}finally{try{Ge&&!Ge.done&&(l=Pe.return)&&l.call(Pe)}finally{if(c)throw c.error}}if(J<3)return!1;var _t=ce/ge,Ot=0;try{for(var Ht=ry(this.possibleCenters),Sr=Ht.next();!Sr.done;Sr=Ht.next()){var ut=Sr.value;Ot+=Math.abs(ut.getEstimatedModuleSize()-_t)}}catch(jr){w={error:jr}}finally{try{Sr&&!Sr.done&&(U=Ht.return)&&U.call(Ht)}finally{if(w)throw w.error}}return Ot<=.05*ce},y.prototype.selectBestPatterns=function(){var c,l,w,U,J=this.possibleCenters.length;if(J<3)throw new Gn;var ge,ce=this.possibleCenters;if(J>3){var Pe=0,Ge=0;try{for(var ut=ry(this.possibleCenters),_t=ut.next();!_t.done;_t=ut.next()){var Ht=_t.value.getEstimatedModuleSize();Pe+=Ht,Ge+=Ht*Ht}}catch(vi){c={error:vi}}finally{try{_t&&!_t.done&&(l=ut.return)&&l.call(ut)}finally{if(c)throw c.error}}ge=Pe/J;var Sr=Math.sqrt(Ge/J-ge*ge);ce.sort(function(vi,ki){var Xi=Math.abs(ki.getEstimatedModuleSize()-ge),So=Math.abs(vi.getEstimatedModuleSize()-ge);return XiSo?1:0});for(var jr=Math.max(.2*ge,Sr),sn=0;sn3;sn++)Math.abs(ce[sn].getEstimatedModuleSize()-ge)>jr&&(ce.splice(sn,1),sn--)}if(ce.length>3){Pe=0;try{for(var ln=ry(ce),On=ln.next();!On.done;On=ln.next())Pe+=On.value.getEstimatedModuleSize()}catch(ki){w={error:ki}}finally{try{On&&!On.done&&(U=ln.return)&&U.call(ln)}finally{if(w)throw w.error}}ge=Pe/ce.length,ce.sort(function(ki,Xi){if(Xi.getCount()===ki.getCount()){var So=Math.abs(Xi.getEstimatedModuleSize()-ge),Ns=Math.abs(ki.getEstimatedModuleSize()-ge);return SoNs?-1:0}return Xi.getCount()-ki.getCount()}),ce.splice(3)}return[ce[0],ce[1],ce[2]]},y.CENTER_QUORUM=2,y.MIN_SKIP=3,y.MAX_MODULES=57,y}(),Am=function(){function y(c){this.image=c}return y.prototype.getImage=function(){return this.image},y.prototype.getResultPointCallback=function(){return this.resultPointCallback},y.prototype.detect=function(c){this.resultPointCallback=null==c?null:c.get(Ci.NEED_RESULT_POINT_CALLBACK);var w=new h1(this.image,this.resultPointCallback).find(c);return this.processFinderPatternInfo(w)},y.prototype.processFinderPatternInfo=function(c){var l=c.getTopLeft(),w=c.getTopRight(),U=c.getBottomLeft(),J=this.calculateModuleSize(l,w,U);if(J<1)throw new Gn("No pattern found in proccess finder.");var ce=y.computeDimension(l,w,U,J),ge=Zh.getProvisionalVersionForDimension(ce),Pe=ge.getDimensionForVersion()-7,Ge=null;if(ge.getAlignmentPatternCenters().length>0)for(var ut=w.getX()-l.getX()+U.getX(),_t=w.getY()-l.getY()+U.getY(),Ot=1-3/Pe,Ht=Math.floor(l.getX()+Ot*(ut-l.getX())),Sr=Math.floor(l.getY()+Ot*(_t-l.getY())),jr=4;jr<=16;jr<<=1)try{Ge=this.findAlignmentInRegion(J,Ht,Sr,jr);break}catch(On){if(!(On instanceof Gn))throw On}var sn=y.createTransform(l,w,U,Ge,ce),dn=y.sampleGrid(this.image,sn,ce);return new cr(dn,null===Ge?[U,l,w]:[U,l,w,Ge])},y.createTransform=function(c,l,w,U,J){var ge,Pe,Ge,ut,ce=J-3.5;return null!==U?(ge=U.getX(),Pe=U.getY(),ut=Ge=ce-3):(ge=l.getX()-c.getX()+w.getX(),Pe=l.getY()-c.getY()+w.getY(),Ge=ce,ut=ce),Bs.quadrilateralToQuadrilateral(3.5,3.5,ce,3.5,Ge,ut,3.5,ce,c.getX(),c.getY(),l.getX(),l.getY(),ge,Pe,w.getX(),w.getY())},y.sampleGrid=function(c,l,w){return yo.getInstance().sampleGridWithTransform(c,w,w,l)},y.computeDimension=function(c,l,w,U){var J=Ys.round(_o.distance(c,l)/U),ce=Ys.round(_o.distance(c,w)/U),ge=Math.floor((J+ce)/2)+7;switch(3&ge){case 0:ge++;break;case 2:ge--;break;case 3:throw new Gn("Dimensions could be not found.")}return ge},y.prototype.calculateModuleSize=function(c,l,w){return(this.calculateModuleSizeOneWay(c,l)+this.calculateModuleSizeOneWay(c,w))/2},y.prototype.calculateModuleSizeOneWay=function(c,l){var w=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(c.getX()),Math.floor(c.getY()),Math.floor(l.getX()),Math.floor(l.getY())),U=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(l.getX()),Math.floor(l.getY()),Math.floor(c.getX()),Math.floor(c.getY()));return isNaN(w)?U/7:isNaN(U)?w/7:(w+U)/14},y.prototype.sizeOfBlackWhiteBlackRunBothWays=function(c,l,w,U){var J=this.sizeOfBlackWhiteBlackRun(c,l,w,U),ce=1,ge=c-(w-c);ge<0?(ce=c/(c-ge),ge=0):ge>=this.image.getWidth()&&(ce=(this.image.getWidth()-1-c)/(ge-c),ge=this.image.getWidth()-1);var Pe=Math.floor(l-(U-l)*ce);return ce=1,Pe<0?(ce=l/(l-Pe),Pe=0):Pe>=this.image.getHeight()&&(ce=(this.image.getHeight()-1-l)/(Pe-l),Pe=this.image.getHeight()-1),ge=Math.floor(c+(ge-c)*ce),(J+=this.sizeOfBlackWhiteBlackRun(c,l,ge,Pe))-1},y.prototype.sizeOfBlackWhiteBlackRun=function(c,l,w,U){var J=Math.abs(U-l)>Math.abs(w-c);if(J){var ce=c;c=l,l=ce,ce=w,w=U,U=ce}for(var ge=Math.abs(w-c),Pe=Math.abs(U-l),Ge=-ge/2,ut=c0){if(jr===U)break;jr+=_t,Ge-=ge}}return 2===Ot?Ys.distance(w+ut,U,c,l):NaN},y.prototype.findAlignmentInRegion=function(c,l,w,U){var J=Math.floor(U*c),ce=Math.max(0,l-J),ge=Math.min(this.image.getWidth()-1,l+J);if(ge-ce<3*c)throw new Gn("Alignment top exceeds estimated module size.");var Pe=Math.max(0,w-J),Ge=Math.min(this.image.getHeight()-1,w+J);if(Ge-Pe<3*c)throw new Gn("Alignment bottom exceeds estimated module size.");return new Bp(this.image,ce,Pe,ge-ce,Ge-Pe,c,this.resultPointCallback).find()},y}(),p1=function(){function y(){this.decoder=new mx}return y.prototype.getDecoder=function(){return this.decoder},y.prototype.decode=function(c,l){var w,U;if(null!=l&&void 0!==l.get(Ci.PURE_BARCODE)){var J=y.extractPureBits(c.getBlackMatrix());w=this.decoder.decodeBitMatrix(J,l),U=y.NO_POINTS}else{var ce=new Am(c.getBlackMatrix()).detect(l);w=this.decoder.decodeBitMatrix(ce.getBits(),l),U=ce.getPoints()}w.getOther()instanceof f1&&w.getOther().applyMirroredCorrection(U);var ge=new Cs(w.getText(),w.getRawBytes(),void 0,U,Co.QR_CODE,void 0),Pe=w.getByteSegments();null!==Pe&&ge.putMetadata(gc.BYTE_SEGMENTS,Pe);var Ge=w.getECLevel();return null!==Ge&&ge.putMetadata(gc.ERROR_CORRECTION_LEVEL,Ge),w.hasStructuredAppend()&&(ge.putMetadata(gc.STRUCTURED_APPEND_SEQUENCE,w.getStructuredAppendSequenceNumber()),ge.putMetadata(gc.STRUCTURED_APPEND_PARITY,w.getStructuredAppendParity())),ge},y.prototype.reset=function(){},y.extractPureBits=function(c){var l=c.getTopLeftOnBit(),w=c.getBottomRightOnBit();if(null===l||null===w)throw new Gn;var U=this.moduleSize(l,c),J=l[1],ce=w[1],ge=l[0],Pe=w[0];if(ge>=Pe||J>=ce)throw new Gn;if(ce-J!=Pe-ge&&(Pe=ge+(ce-J))>=c.getWidth())throw new Gn;var Ge=Math.round((Pe-ge+1)/U),ut=Math.round((ce-J+1)/U);if(Ge<=0||ut<=0)throw new Gn;if(ut!==Ge)throw new Gn;var _t=Math.floor(U/2);J+=_t;var Ot=(ge+=_t)+Math.floor((Ge-1)*U)-Pe;if(Ot>0){if(Ot>_t)throw new Gn;ge-=Ot}var Ht=J+Math.floor((ut-1)*U)-ce;if(Ht>0){if(Ht>_t)throw new Gn;J-=Ht}for(var Sr=new Qi(Ge,ut),jr=0;jr=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),ge=ce.next();!ge.done;ge=ce.next())U[J++]=ge.value}catch(Ge){l={error:Ge}}finally{try{ge&&!ge.done&&(w=ce.return)&&w.call(ce)}finally{if(l)throw l.error}}return U},y.getCodeword=function(c){var l=Vi.binarySearch(y.SYMBOL_TABLE,262143&c);return l<0?-1:(y.CODEWORD_TABLE[l]-1)%y.NUMBER_OF_CODEWORDS},y.MAX_CODEWORDS_IN_BARCODE=(y.NUMBER_OF_CODEWORDS=929)-1,y.MIN_ROWS_IN_BARCODE=3,y.MAX_ROWS_IN_BARCODE=90,y.MODULES_IN_CODEWORD=17,y.MODULES_IN_STOP_PATTERN=18,y.BARS_IN_MODULE=8,y.EMPTY_INT_ARRAY=new Int32Array([]),y.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),y.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),y}(),yx=function(){function y(c,l){this.bits=c,this.points=l}return y.prototype.getBits=function(){return this.bits},y.prototype.getPoints=function(){return this.points},y}();var t_=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const ya=function(){function y(){}return y.detectMultiple=function(c,l,w){var U=c.getBlackMatrix(),J=y.detect(w,U);return J.length||((U=U.clone()).rotate180(),J=y.detect(w,U)),new yx(U,J)},y.detect=function(c,l){for(var w,U,J=new Array,ce=0,ge=0,Pe=!1;ce0;){if(null==(_t=y.findGuardPattern(c,J,--U,w,!1,ce,Ge))){U++;break}ut=_t}ge[0]=new _o(ut[0],U),ge[1]=new _o(ut[1],U),Pe=!0;break}var Ot=U+1;if(Pe){for(var Ht=0,_t=Int32Array.from([Math.trunc(ge[0].getX()),Math.trunc(ge[1].getX())]);Oty.SKIPPED_ROW_COUNT_MAX)break;Ht++}}ge[2]=new _o(_t[0],Ot-=Ht+1),ge[3]=new _o(_t[1],Ot)}return Ot-U0&&Ge++Ot?_t-Ot:Ot-_t;if(Ht>w)return 1/0;Ge+=Ht}return Ge/J},y.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),y.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),y.MAX_AVG_VARIANCE=.42,y.MAX_INDIVIDUAL_VARIANCE=.8,y.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),y.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),y.MAX_PIXEL_DRIFT=3,y.MAX_PATTERN_DRIFT=5,y.SKIPPED_ROW_COUNT_MAX=25,y.ROW_STEP=5,y.BARCODE_MIN_HEIGHT=10,y}(),Fp=function(){function y(c,l){if(0===l.length)throw new Bi;this.field=c;var w=l.length;if(w>1&&0===l[0]){for(var U=1;U=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.coefficients),ce=J.next();!ce.done;ce=J.next())U=this.field.add(U,ce.value)}catch(_t){l={error:_t}}finally{try{ce&&!ce.done&&(w=J.return)&&w.call(J)}finally{if(l)throw l.error}}return U}for(var Pe=this.coefficients[0],Ge=this.coefficients.length,ut=1;utw.length){var U=l;l=w,w=U}var J=new Int32Array(w.length),ce=w.length-l.length;Rt.arraycopy(w,0,J,0,ce);for(var ge=ce;ge=0;l--){var w=this.getCoefficient(l);0!==w&&(w<0?(c.append(" - "),w=-w):c.length()>0&&c.append(" + "),(0===l||1!==w)&&c.append(w),0!==l&&(1===l?c.append("x"):(c.append("x^"),c.append(l))))}return c.toString()},y}(),ed=function(){function y(){}return y.prototype.add=function(c,l){return(c+l)%this.modulus},y.prototype.subtract=function(c,l){return(this.modulus+c-l)%this.modulus},y.prototype.exp=function(c){return this.expTable[c]},y.prototype.log=function(c){if(0===c)throw new Bi;return this.logTable[c]},y.prototype.inverse=function(c){if(0===c)throw new Rd;return this.expTable[this.modulus-this.logTable[c]-1]},y.prototype.multiply=function(c,l){return 0===c||0===l?0:this.expTable[(this.logTable[c]+this.logTable[l])%(this.modulus-1)]},y.prototype.getSize=function(){return this.modulus},y.prototype.equals=function(c){return c===this},y}();var i_=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const Sa=function(y){function c(l,w){var U=y.call(this)||this;U.modulus=l,U.expTable=new Int32Array(l),U.logTable=new Int32Array(l);for(var J=1,ce=0;ce0;Ge--){var ut=ce.evaluateAt(this.field.exp(Ge));ge[l-Ge]=ut,0!==ut&&(Pe=!0)}if(!Pe)return 0;var _t=this.field.getOne();if(null!=w)try{for(var Ot=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(w),Ht=Ot.next();!Ht.done;Ht=Ot.next()){var jr=this.field.exp(c.length-1-Ht.value),sn=new Fp(this.field,new Int32Array([this.field.subtract(0,jr),1]));_t=_t.multiply(sn)}}catch(So){U={error:So}}finally{try{Ht&&!Ht.done&&(J=Ot.return)&&J.call(Ot)}finally{if(U)throw U.error}}var dn=new Fp(this.field,ge),ln=this.runEuclideanAlgorithm(this.field.buildMonomial(l,1),dn,l),On=ln[0],Wn=ln[1],vi=this.findErrorLocations(On),ki=this.findErrorMagnitudes(Wn,On,vi);for(Ge=0;Ge=Math.round(w/2);){var Ge=J,ut=ge;if(ge=Pe,(J=ce).isZero())throw rs.getChecksumInstance();ce=Ge;for(var _t=this.field.getZero(),Ot=J.getCoefficient(J.getDegree()),Ht=this.field.inverse(Ot);ce.getDegree()>=J.getDegree()&&!ce.isZero();){var Sr=ce.getDegree()-J.getDegree(),jr=this.field.multiply(ce.getCoefficient(ce.getDegree()),Ht);_t=_t.add(this.field.buildMonomial(Sr,jr)),ce=ce.subtract(J.multiplyByMonomial(Sr,jr))}Pe=_t.multiply(ge).subtract(ut).negative()}var sn=Pe.getCoefficient(0);if(0===sn)throw rs.getChecksumInstance();var dn=this.field.inverse(sn);return[Pe.multiply(dn),ce.multiply(dn)]},y.prototype.findErrorLocations=function(c){for(var l=c.getDegree(),w=new Int32Array(l),U=0,J=1;J0){var Pe=w?this.topLeft:this.topRight,Ge=Math.trunc(Pe.getY()-c);Ge<0&&(Ge=0);var ut=new _o(Pe.getX(),Ge);w?U=ut:ce=ut}if(l>0){var _t=w?this.bottomLeft:this.bottomRight,Ot=Math.trunc(_t.getY()+l);Ot>=this.image.getHeight()&&(Ot=this.image.getHeight()-1);var Ht=new _o(_t.getX(),Ot);w?J=Ht:ge=Ht}return new y(this.image,U,J,ce,ge)},y.prototype.getMinX=function(){return this.minX},y.prototype.getMaxX=function(){return this.maxX},y.prototype.getMinY=function(){return this.minY},y.prototype.getMaxY=function(){return this.maxY},y.prototype.getTopLeft=function(){return this.topLeft},y.prototype.getTopRight=function(){return this.topRight},y.prototype.getBottomLeft=function(){return this.bottomLeft},y.prototype.getBottomRight=function(){return this.bottomRight},y}(),vx=function(){function y(c,l,w,U){this.columnCount=c,this.errorCorrectionLevel=U,this.rowCountUpperPart=l,this.rowCountLowerPart=w,this.rowCount=l+w}return y.prototype.getColumnCount=function(){return this.columnCount},y.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},y.prototype.getRowCount=function(){return this.rowCount},y.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},y.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},y}(),b1=function(){function y(){this.buffer=""}return y.form=function(c,l){var w=-1;return c.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function U(ce,ge,Pe,Ge,ut,_t){if("%%"===ce)return"%";if(void 0!==l[++w]){ce=Ge?parseInt(Ge.substr(1)):void 0;var Ht,Ot=ut?parseInt(ut.substr(1)):void 0;switch(_t){case"s":Ht=l[w];break;case"c":Ht=l[w][0];break;case"f":Ht=parseFloat(l[w]).toFixed(ce);break;case"p":Ht=parseFloat(l[w]).toPrecision(ce);break;case"e":Ht=parseFloat(l[w]).toExponential(ce);break;case"x":Ht=parseInt(l[w]).toString(Ot||16);break;case"d":Ht=parseFloat(parseInt(l[w],Ot||10).toPrecision(ce)).toFixed(0)}Ht="object"==typeof Ht?JSON.stringify(Ht):(+Ht).toString(Ot);for(var Sr=parseInt(Pe),jr=Pe&&Pe[0]+""=="0"?"0":" ";Ht.length=0&&null!=(l=this.codewords[U])||(U=this.imageRowToCodewordIndex(c)+w)=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.codewords),ce=J.next();!ce.done;ce=J.next()){var ge=ce.value;null!=ge?w.format("%3d: %3d|%3d%n",U++,ge.getRowNumber(),ge.getValue()):w.format("%3d: | %n",U++)}}catch(Pe){c={error:Pe}}finally{try{ce&&!ce.done&&(l=J.return)&&l.call(J)}finally{if(c)throw c.error}}return w.toString()},y.MAX_NEARBY_DISTANCE=5,y}();var id=function(y,c){var l="function"==typeof Symbol&&y[Symbol.iterator];if(!l)return y;var U,ce,w=l.call(y),J=[];try{for(;(void 0===c||c-- >0)&&!(U=w.next()).done;)J.push(U.value)}catch(ge){ce={error:ge}}finally{try{U&&!U.done&&(l=w.return)&&l.call(w)}finally{if(ce)throw ce.error}}return J};const zu=function(){function y(){this.values=new Map}return y.prototype.setValue=function(c){c=Math.trunc(c);var l=this.values.get(c);null==l&&(l=0),l++,this.values.set(c,l)},y.prototype.getValue=function(){var c,l,w=-1,U=new Array,J=function(_t,Ot){var Ht_getKey=function(){return _t},Ht_getValue=function(){return Ot};Ht_getValue()>w?(w=Ht_getValue(),(U=[]).push(Ht_getKey())):Ht_getValue()===w&&U.push(Ht_getKey())};try{for(var ce=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.values.entries()),ge=ce.next();!ge.done;ge=ce.next()){var Pe=id(ge.value,2);J(Pe[0],Pe[1])}}catch(_t){c={error:_t}}finally{try{ge&&!ge.done&&(l=ce.return)&&l.call(ce)}finally{if(c)throw c.error}}return xa.toIntArray(U)},y.prototype.getConfidence=function(c){return this.values.get(c)},y}();var c_=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),l_=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const E0=function(y){function c(l,w){var U=y.call(this,l)||this;return U._isLeft=w,U}return c_(c,y),c.prototype.setRowNumbers=function(){var l,w;try{for(var U=l_(this.getCodewords()),J=U.next();!J.done;J=U.next()){var ce=J.value;ce?.setRowNumberAsRowIndicatorColumn()}}catch(ge){l={error:ge}}finally{try{J&&!J.done&&(w=U.return)&&w.call(U)}finally{if(l)throw l.error}}},c.prototype.adjustCompleteIndicatorColumnRowNumbers=function(l){var w=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(w,l);for(var U=this.getBoundingBox(),J=this._isLeft?U.getTopLeft():U.getTopRight(),ce=this._isLeft?U.getBottomLeft():U.getBottomRight(),ge=this.imageRowToCodewordIndex(Math.trunc(J.getY())),Pe=this.imageRowToCodewordIndex(Math.trunc(ce.getY())),Ge=-1,ut=1,_t=0,Ot=ge;Ot=l.getRowCount()||Sr>Ot)w[Ot]=null;else{for(var jr,sn=(jr=ut>2?(ut-2)*Sr:Sr)>=Ot,dn=1;dn<=jr&&!sn;dn++)sn=null!=w[Ot-dn];sn?w[Ot]=null:(Ge=Ht.getRowNumber(),_t=1)}}},c.prototype.getRowHeights=function(){var l,w,U=this.getBarcodeMetadata();if(null==U)return null;this.adjustIncompleteIndicatorColumnRowNumbers(U);var J=new Int32Array(U.getRowCount());try{for(var ce=l_(this.getCodewords()),ge=ce.next();!ge.done;ge=ce.next()){var Pe=ge.value;if(null!=Pe){var Ge=Pe.getRowNumber();if(Ge>=J.length)continue;J[Ge]++}}}catch(ut){l={error:ut}}finally{try{ge&&!ge.done&&(w=ce.return)&&w.call(ce)}finally{if(l)throw l.error}}return J},c.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(l){for(var w=this.getBoundingBox(),U=this._isLeft?w.getTopLeft():w.getTopRight(),J=this._isLeft?w.getBottomLeft():w.getBottomRight(),ce=this.imageRowToCodewordIndex(Math.trunc(U.getY())),ge=this.imageRowToCodewordIndex(Math.trunc(J.getY())),Pe=this.getCodewords(),Ge=-1,ut=1,_t=0,Ot=ce;Ot=l.getRowCount()?Pe[Ot]=null:(Ge=Ht.getRowNumber(),_t=1)}},c.prototype.getBarcodeMetadata=function(){var l,w,U=this.getCodewords(),J=new zu,ce=new zu,ge=new zu,Pe=new zu;try{for(var Ge=l_(U),ut=Ge.next();!ut.done;ut=Ge.next()){var _t=ut.value;if(null!=_t){_t.setRowNumberAsRowIndicatorColumn();var Ot=_t.getValue()%30,Ht=_t.getRowNumber();switch(this._isLeft||(Ht+=2),Ht%3){case 0:ce.setValue(3*Ot+1);break;case 1:Pe.setValue(Ot/3),ge.setValue(Ot%3);break;case 2:J.setValue(Ot+1)}}}}catch(jr){l={error:jr}}finally{try{ut&&!ut.done&&(w=Ge.return)&&w.call(Ge)}finally{if(l)throw l.error}}if(0===J.getValue().length||0===ce.getValue().length||0===ge.getValue().length||0===Pe.getValue().length||J.getValue()[0]<1||ce.getValue()[0]+ge.getValue()[0]xa.MAX_ROWS_IN_BARCODE)return null;var Sr=new vx(J.getValue()[0],ce.getValue()[0],ge.getValue()[0],Pe.getValue()[0]);return this.removeIncorrectCodewords(U,Sr),Sr},c.prototype.removeIncorrectCodewords=function(l,w){for(var U=0;Uw.getRowCount()){l[U]=null;continue}switch(this._isLeft||(ge+=2),ge%3){case 0:3*ce+1!==w.getRowCountUpperPart()&&(l[U]=null);break;case 1:(Math.trunc(ce/3)!==w.getErrorCorrectionLevel()||ce%3!==w.getRowCountLowerPart())&&(l[U]=null);break;case 2:ce+1!==w.getColumnCount()&&(l[U]=null)}}}},c.prototype.isLeft=function(){return this._isLeft},c.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+y.prototype.toString.call(this)},c}(bx),Jo=function(){function y(c,l){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=c,this.barcodeColumnCount=c.getColumnCount(),this.boundingBox=l,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return y.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var l,c=xa.MAX_CODEWORDS_IN_BARCODE;do{l=c,c=this.adjustRowNumbersAndGetCount()}while(c>0&&c0&&J0&&(Ge[0]=w[l-1],Ge[4]=ge[l-1],Ge[5]=Pe[l-1]),l>1&&(Ge[8]=w[l-2],Ge[10]=ge[l-2],Ge[11]=Pe[l-2]),l=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(Ge),_t=ut.next();!_t.done;_t=ut.next())if(y.adjustRowNumber(ce,_t.value))return}catch(Ht){U={error:Ht}}finally{try{_t&&!_t.done&&(J=ut.return)&&J.call(ut)}finally{if(U)throw U.error}}}},y.adjustRowNumber=function(c,l){return!(null==l||!l.hasValidRowNumber()||l.getBucket()!==c.getBucket()||(c.setRowNumber(l.getRowNumber()),0))},y.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},y.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},y.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},y.prototype.setBoundingBox=function(c){this.boundingBox=c},y.prototype.getBoundingBox=function(){return this.boundingBox},y.prototype.setDetectionResultColumn=function(c,l){this.detectionResultColumns[c]=l},y.prototype.getDetectionResultColumn=function(c){return this.detectionResultColumns[c]},y.prototype.toString=function(){var c=this.detectionResultColumns[0];null==c&&(c=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var l=new b1,w=0;w>=1;w=1&l,y.RATIOS_TABLE[c]||(y.RATIOS_TABLE[c]=new Array(xa.BARS_IN_MODULE)),y.RATIOS_TABLE[c][xa.BARS_IN_MODULE-U-1]=Math.fround(J/xa.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},y.getDecodedValue=function(c){var l=y.getDecodedCodewordValue(y.sampleBitCounts(c));return-1!==l?l:y.getClosestDecodedValue(c)},y.sampleBitCounts=function(c){for(var l=Ys.sum(c),w=new Int32Array(xa.BARS_IN_MODULE),U=0,J=0,ce=0;ce1)for(var U=0;U=J)break}Pec.length||w<0||l+w>c.length||l+w<0)throw new Qr;if(0!==w)for(var U=0;U0&&this.grow(l)},c.prototype.grow=function(l){var U=this.buf.length<<1;if(U-l<0&&(U=l),U<0){if(l<0)throw new Ax;U=pi.MAX_VALUE}this.buf=Vi.copyOfUint8Array(this.buf,U)},c.prototype.write=function(l){this.ensureCapacity(this.count+1),this.buf[this.count]=l,this.count+=1},c.prototype.writeBytesOffset=function(l,w,U){if(w<0||w>l.length||U<0||w+U-l.length>0)throw new Qr;this.ensureCapacity(this.count+U),Rt.arraycopy(l,w,this.buf,this.count,U),this.count+=U},c.prototype.writeTo=function(l){l.writeBytesOffset(this.buf,0,this.count)},c.prototype.reset=function(){this.count=0},c.prototype.toByteArray=function(){return Vi.copyOfUint8Array(this.buf,this.count)},c.prototype.size=function(){return this.count},c.prototype.toString=function(l){return l?"string"==typeof l?this.toString_string(l):this.toString_number(l):this.toString_void()},c.prototype.toString_void=function(){return new String(this.buf).toString()},c.prototype.toString_string=function(l){return new String(this.buf).toString()},c.prototype.toString_number=function(l){return new String(this.buf).toString()},c.prototype.close=function(){},c}(lD);var qs,Oc=function(y){return y[y.ALPHA=0]="ALPHA",y[y.LOWER=1]="LOWER",y[y.MIXED=2]="MIXED",y[y.PUNCT=3]="PUNCT",y[y.ALPHA_SHIFT=4]="ALPHA_SHIFT",y[y.PUNCT_SHIFT=5]="PUNCT_SHIFT",y}(Oc||{});function ep(){if(typeof window<"u")return window.BigInt||null;if(typeof globalThis<"u")return globalThis.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function rh(y){if(typeof qs>"u"&&(qs=ep()),null===qs)throw new Error("BigInt is not supported!");return qs(y)}const Cl=function(){function y(){}return y.decode=function(c,l){var w=new Ur(""),U=Yo.ISO8859_1;w.enableDecoding(U);for(var J=1,ce=c[J++],ge=new u_;Jc[0])throw Qn.getFormatInstance();for(var U=new Int32Array(y.NUMBER_OF_SEQUENCE_CODEWORDS),J=0;J0){for(var Ot=0;Ot<6;++Ot)ce.write(Number(rh(Pe)>>rh(8*(5-Ot))));Pe=0,ge=0}}U===l[0]&&_t0){for(Ot=0;Ot<6;++Ot)ce.write(Number(rh(Pe)>>rh(8*(5-Ot))));Pe=0,ge=0}}}return J.append(Wt.decode(ce.toByteArray(),w)),U},y.numericCompaction=function(c,l,w){for(var U=0,J=!1,ce=new Int32Array(y.MAX_NUMERIC_CODEWORDS);l0&&(w.append(y.decodeBase900toBase10(ce,U)),U=0)}return l},y.decodeBase900toBase10=function(c,l){for(var w=rh(0),U=0;U@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",y.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",y.EXP900=ep()?function x0(){var y=[];y[0]=rh(1);var c=rh(900);y[1]=c;for(var l=2;l<16;l++)y[l]=y[l-1]*c;return y}():[],y.NUMBER_OF_SEQUENCE_CODEWORDS=2,y}();var xf=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const tp=function(){function y(){}return y.decode=function(c,l,w,U,J,ce,ge){for(var _t,Pe=new a_(c,l,w,U,J),Ge=null,ut=null,Ot=!0;;Ot=!1){if(null!=l&&(Ge=y.getRowIndicatorColumn(c,Pe,l,!0,ce,ge)),null!=U&&(ut=y.getRowIndicatorColumn(c,Pe,U,!1,ce,ge)),null==(_t=y.merge(Ge,ut)))throw Gn.getNotFoundInstance();var Ht=_t.getBoundingBox();if(!Ot||null==Ht||!(Ht.getMinY()Pe.getMaxY()))break;Pe=Ht}_t.setBoundingBox(Pe);var Sr=_t.getBarcodeColumnCount()+1;_t.setDetectionResultColumn(0,Ge),_t.setDetectionResultColumn(Sr,ut);for(var jr=null!=Ge,sn=1;sn<=Sr;sn++){var dn=jr?sn:Sr-sn;if(void 0===_t.getDetectionResultColumn(dn)){var ln=void 0;ln=0===dn||dn===Sr?new E0(Pe,0===dn):new bx(Pe),_t.setDetectionResultColumn(dn,ln);for(var On=-1,Wn=On,vi=Pe.getMinY();vi<=Pe.getMaxY();vi++){if((On=y.getStartColumn(_t,dn,vi,jr))<0||On>Pe.getMaxX()){if(-1===Wn)continue;On=Wn}var ki=y.detectCodeword(c,Pe.getMinX(),Pe.getMaxX(),jr,On,vi,ce,ge);null!=ki&&(ln.setCodeword(vi,ki),Wn=On,ce=Math.min(ce,ki.getWidth()),ge=Math.max(ge,ki.getWidth()))}}}return y.createDecoderResult(_t)},y.merge=function(c,l){if(null==c&&null==l)return null;var w=y.getBarcodeMetadata(c,l);if(null==w)return null;var U=a_.merge(y.adjustBoundingBox(c),y.adjustBoundingBox(l));return new Jo(w,U)},y.adjustBoundingBox=function(c){var l,w;if(null==c)return null;var U=c.getRowHeights();if(null==U)return null;var J=y.getMax(U),ce=0;try{for(var ge=xf(U),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;if(ce+=J-Ge,Ge>0)break}}catch(Ht){l={error:Ht}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(l)throw l.error}}for(var ut=c.getCodewords(),_t=0;ce>0&&null==ut[_t];_t++)ce--;var Ot=0;for(_t=U.length-1;_t>=0&&(Ot+=J-U[_t],!(U[_t]>0));_t--);for(_t=ut.length-1;Ot>0&&null==ut[_t];_t--)Ot--;return c.getBoundingBox().addMissingRows(ce,Ot,c.isLeft())},y.getMax=function(c){var l,w,U=-1;try{for(var J=xf(c),ce=J.next();!ce.done;ce=J.next())U=Math.max(U,ce.value)}catch(Pe){l={error:Pe}}finally{try{ce&&!ce.done&&(w=J.return)&&w.call(J)}finally{if(l)throw l.error}}return U},y.getBarcodeMetadata=function(c,l){var w,U;return null==c||null==(w=c.getBarcodeMetadata())?null==l?null:l.getBarcodeMetadata():null==l||null==(U=l.getBarcodeMetadata())?w:w.getColumnCount()!==U.getColumnCount()&&w.getErrorCorrectionLevel()!==U.getErrorCorrectionLevel()&&w.getRowCount()!==U.getRowCount()?null:w},y.getRowIndicatorColumn=function(c,l,w,U,J,ce){for(var ge=new E0(l,U),Pe=0;Pe<2;Pe++)for(var Ge=0===Pe?1:-1,ut=Math.trunc(Math.trunc(w.getX())),_t=Math.trunc(Math.trunc(w.getY()));_t<=l.getMaxY()&&_t>=l.getMinY();_t+=Ge){var Ot=y.detectCodeword(c,0,c.getWidth(),U,ut,_t,J,ce);null!=Ot&&(ge.setCodeword(_t,Ot),ut=U?Ot.getStartX():Ot.getEndX())}return ge},y.adjustCodewordCount=function(c,l){var w=l[0][1],U=w.getValue(),J=c.getBarcodeColumnCount()*c.getBarcodeRowCount()-y.getNumberOfECCodeWords(c.getBarcodeECLevel());if(0===U.length){if(J<1||J>xa.MAX_CODEWORDS_IN_BARCODE)throw Gn.getNotFoundInstance();w.setValue(J)}else U[0]!==J&&w.setValue(J)},y.createDecoderResult=function(c){var l=y.createBarcodeMatrix(c);y.adjustCodewordCount(c,l);for(var w=new Array,U=new Int32Array(c.getBarcodeRowCount()*c.getBarcodeColumnCount()),J=[],ce=new Array,ge=0;ge0;){for(var Pe=0;Pe=0){if(sn>=ce.length)continue;ce[sn][Ge].setValue(jr.getValue())}}}}catch(dn){U={error:dn}}finally{try{Sr&&!Sr.done&&(J=Ht.return)&&J.call(Ht)}finally{if(U)throw U.error}}Ge++}}catch(dn){l={error:dn}}finally{try{_t&&!_t.done&&(w=ut.return)&&w.call(ut)}finally{if(l)throw l.error}}return ce},y.isValidBarcodeColumn=function(c,l){return l>=0&&l<=c.getBarcodeColumnCount()+1},y.getStartColumn=function(c,l,w,U){var J,ce,ge=U?1:-1,Pe=null;if(y.isValidBarcodeColumn(c,l-ge)&&(Pe=c.getDetectionResultColumn(l-ge).getCodeword(w)),null!=Pe)return U?Pe.getEndX():Pe.getStartX();if(null!=(Pe=c.getDetectionResultColumn(l).getCodewordNearby(w)))return U?Pe.getStartX():Pe.getEndX();if(y.isValidBarcodeColumn(c,l-ge)&&(Pe=c.getDetectionResultColumn(l-ge).getCodewordNearby(w)),null!=Pe)return U?Pe.getEndX():Pe.getStartX();for(var Ge=0;y.isValidBarcodeColumn(c,l-ge);){l-=ge;try{for(var ut=(J=void 0,xf(c.getDetectionResultColumn(l).getCodewords())),_t=ut.next();!_t.done;_t=ut.next()){var Ot=_t.value;if(null!=Ot)return(U?Ot.getEndX():Ot.getStartX())+ge*Ge*(Ot.getEndX()-Ot.getStartX())}}catch(Ht){J={error:Ht}}finally{try{_t&&!_t.done&&(ce=ut.return)&&ce.call(ut)}finally{if(J)throw J.error}}Ge++}return U?c.getBoundingBox().getMinX():c.getBoundingBox().getMaxX()},y.detectCodeword=function(c,l,w,U,J,ce,ge,Pe){J=y.adjustCodewordStartColumn(c,l,w,U,J,ce);var Ge=y.getModuleBitCount(c,l,w,U,J,ce);if(null==Ge)return null;var ut,_t=Ys.sum(Ge);if(U)ut=J+_t;else{for(var Ot=0;Ot=l)&&Ge=l:gey.CODEWORD_SKEW_SIZE)return J;ge+=Pe}Pe=-Pe,U=!U}return ge},y.checkCodewordSkew=function(c,l,w){return l-y.CODEWORD_SKEW_SIZE<=c&&c<=w+y.CODEWORD_SKEW_SIZE},y.decodeCodewords=function(c,l,w){if(0===c.length)throw Qn.getFormatInstance();var U=1<w/2+y.MAX_ERRORS||w<0||w>y.MAX_EC_CODEWORDS)throw rs.getChecksumInstance();return y.errorCorrection.decode(c,w,l)},y.verifyCodewordCount=function(c,l){if(c.length<4)throw Qn.getFormatInstance();var w=c[0];if(w>c.length)throw Qn.getFormatInstance();if(0===w){if(!(l>=1;return l},y.getCodewordBucketNumber=function(c){return c instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(c):this.getCodewordBucketNumber_number(c)},y.getCodewordBucketNumber_number=function(c){return y.getCodewordBucketNumber(y.getBitCountForCodeword(c))},y.getCodewordBucketNumber_Int32Array=function(c){return(c[0]-c[2]+c[4]-c[6]+9)%9},y.toString=function(c){for(var l=new b1,w=0;w=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(ge.getPoints()),Ge=Pe.next();!Ge.done;Ge=Pe.next()){var ut=Ge.value,_t=tp.decode(ge.getBits(),ut[4],ut[5],ut[6],ut[7],y.getMinCodewordWidth(ut),y.getMaxCodewordWidth(ut)),Ot=new Cs(_t.getText(),_t.getRawBytes(),void 0,ut,Co.PDF_417);Ot.putMetadata(gc.ERROR_CORRECTION_LEVEL,_t.getECLevel());var Ht=_t.getOther();null!=Ht&&Ot.putMetadata(gc.PDF417_EXTRA_METADATA,Ht),ce.push(Ot)}}catch(Sr){U={error:Sr}}finally{try{Ge&&!Ge.done&&(J=Pe.return)&&J.call(Pe)}finally{if(U)throw U.error}}return ce.map(function(Sr){return Sr})},y.getMaxWidth=function(c,l){return null==c||null==l?0:Math.trunc(Math.abs(c.getX()-l.getX()))},y.getMinWidth=function(c,l){return null==c||null==l?pi.MAX_VALUE:Math.trunc(Math.abs(c.getX()-l.getX()))},y.getMaxCodewordWidth=function(c){return Math.floor(Math.max(Math.max(y.getMaxWidth(c[0],c[4]),y.getMaxWidth(c[6],c[2])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN),Math.max(y.getMaxWidth(c[1],c[5]),y.getMaxWidth(c[7],c[3])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN)))},y.getMinCodewordWidth=function(c){return Math.floor(Math.min(Math.min(y.getMinWidth(c[0],c[4]),y.getMinWidth(c[6],c[2])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN),Math.min(y.getMinWidth(c[1],c[5]),y.getMinWidth(c[7],c[3])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN)))},y.prototype.reset=function(){},y}();var A1=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const rp=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return A1(c,y),c.kind="ReaderException",c}(Us);var $d=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const iy=function(){function y(){}return y.prototype.decode=function(c,l){return this.setHints(l),this.decodeInternal(c)},y.prototype.decodeWithState=function(c){return null==this.readers&&this.setHints(null),this.decodeInternal(c)},y.prototype.setHints=function(c){this.hints=c;var l=null!=c&&void 0!==c.get(Ci.TRY_HARDER),w=null==c?null:c.get(Ci.POSSIBLE_FORMATS),U=new Array;if(null!=w){var J=w.some(function(ce){return ce===Co.UPC_A||ce===Co.UPC_E||ce===Co.EAN_13||ce===Co.EAN_8||ce===Co.CODABAR||ce===Co.CODE_39||ce===Co.CODE_93||ce===Co.CODE_128||ce===Co.ITF||ce===Co.RSS_14||ce===Co.RSS_EXPANDED});J&&!l&&U.push(new Ac(c)),w.includes(Co.QR_CODE)&&U.push(new p1),w.includes(Co.DATA_MATRIX)&&U.push(new v0),w.includes(Co.AZTEC)&&U.push(new We),w.includes(Co.PDF_417)&&U.push(new A0),J&&l&&U.push(new Ac(c))}0===U.length&&(l||U.push(new Ac(c)),U.push(new p1),U.push(new v0),U.push(new We),U.push(new A0),l&&U.push(new Ac(c))),this.readers=U},y.prototype.reset=function(){var c,l;if(null!==this.readers)try{for(var w=$d(this.readers),U=w.next();!U.done;U=w.next())U.value.reset()}catch(ce){c={error:ce}}finally{try{U&&!U.done&&(l=w.return)&&l.call(w)}finally{if(c)throw c.error}}},y.prototype.decodeInternal=function(c){var l,w;if(null===this.readers)throw new rp("No readers where selected, nothing can be read.");try{for(var U=$d(this.readers),J=U.next();!J.done;J=U.next()){var ce=J.value;try{return ce.decode(c,this.hints)}catch(ge){if(ge instanceof rp)continue}}}catch(ge){l={error:ge}}finally{try{J&&!J.done&&(w=U.return)&&w.call(U)}finally{if(l)throw l.error}}throw new Gn("No MultiFormat Readers were able to detect the code.")},y}();var Ix=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),oy=(function(y){function c(l,w){void 0===l&&(l=null),void 0===w&&(w=500);var J=new iy;return J.setHints(l),y.call(this,J,w)||this}Ix(c,y),c.prototype.decodeBitmap=function(l){return this.reader.decodeWithState(l)}}(Qu),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),Im=(function(y){oy(function c(l){return void 0===l&&(l=500),y.call(this,new A0,l)||this},y)}(Qu),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),Tx=(function(y){Im(function c(l){return void 0===l&&(l=500),y.call(this,new p1,l)||this},y)}(Qu),function(y){return y[y.ERROR_CORRECTION=0]="ERROR_CORRECTION",y[y.CHARACTER_SET=1]="CHARACTER_SET",y[y.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",y[y.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",y[y.MIN_SIZE=4]="MIN_SIZE",y[y.MAX_SIZE=5]="MAX_SIZE",y[y.MARGIN=6]="MARGIN",y[y.PDF417_COMPACT=7]="PDF417_COMPACT",y[y.PDF417_COMPACTION=8]="PDF417_COMPACTION",y[y.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",y[y.AZTEC_LAYERS=10]="AZTEC_LAYERS",y[y.QR_VERSION=11]="QR_VERSION",y[y.GS1_FORMAT=12]="GS1_FORMAT",y[y.FORCE_C40=13]="FORCE_C40",y}(Tx||{}));const ss=Tx,D1=function(){function y(c){this.field=c,this.cachedGenerators=[],this.cachedGenerators.push(new mu(c,Int32Array.from([1])))}return y.prototype.buildGenerator=function(c){var l=this.cachedGenerators;if(c>=l.length)for(var w=l[l.length-1],U=this.field,J=l.length;J<=c;J++){var ce=w.multiply(new mu(U,Int32Array.from([1,U.exp(J-1+U.getGeneratorBase())])));l.push(ce),w=ce}return l[c]},y.prototype.encode=function(c,l){if(0===l)throw new Bi("No error correction bytes");var w=c.length-l;if(w<=0)throw new Bi("No data bytes provided");var U=this.buildGenerator(l),J=new Int32Array(w);Rt.arraycopy(c,0,J,0,w);for(var ce=new mu(this.field,J),Pe=(ce=ce.multiplyByMonomial(l,1)).divide(U)[1].getCoefficients(),Ge=l-Pe.length,ut=0;ut=5&&(w+=y.N1+(Pe-5)),Pe=1,Ge=_t)}Pe>=5&&(w+=y.N1+(Pe-5))}return w},y.N1=3,y.N2=3,y.N3=40,y.N4=10,y}(),Np=function(){function y(c,l){this.width=c,this.height=l;for(var w=new Array(l),U=0;U!==l;U++)w[U]=new Uint8Array(c);this.bytes=w}return y.prototype.getHeight=function(){return this.height},y.prototype.getWidth=function(){return this.width},y.prototype.get=function(c,l){return this.bytes[l][c]},y.prototype.getArray=function(){return this.bytes},y.prototype.setNumber=function(c,l,w){this.bytes[l][c]=w},y.prototype.setBoolean=function(c,l,w){this.bytes[l][c]=w?1:0},y.prototype.clear=function(c){var l,w;try{for(var U=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.bytes),J=U.next();!J.done;J=U.next())Vi.fill(J.value,c)}catch(ge){l={error:ge}}finally{try{J&&!J.done&&(w=U.return)&&w.call(U)}finally{if(l)throw l.error}}},y.prototype.equals=function(c){if(!(c instanceof y))return!1;var l=c;if(this.width!==l.width||this.height!==l.height)return!1;for(var w=0,U=this.height;w>\n"),c.toString()},y.prototype.setMode=function(c){this.mode=c},y.prototype.setECLevel=function(c){this.ecLevel=c},y.prototype.setVersion=function(c){this.version=c},y.prototype.setMaskPattern=function(c){this.maskPattern=c},y.prototype.setMatrix=function(c){this.matrix=c},y.isValidMaskPattern=function(c){return c>=0&&c0;){for(6===ce&&(ce-=1);ge>=0&&ge=w;)c^=l<=0)for(var Pe=0;Pe!==ce;Pe++){var Ge=U[Pe];Ge>=0&&y.isEmpty(l.get(Ge,ge))&&y.embedPositionAdjustmentPattern(Ge-2,ge-2,l)}}},y.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])]),y.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])]),y.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])]),y.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])]),y.VERSION_INFO_POLY=7973,y.TYPE_INFO_POLY=1335,y.TYPE_INFO_MASK_PATTERN=21522,y}(),g_=function(){function y(c,l){this.dataBytes=c,this.errorCorrectionBytes=l}return y.prototype.getDataBytes=function(){return this.dataBytes},y.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},y}();var D0=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const I0=function(){function y(){}return y.calculateMaskPenalty=function(c){return np.applyMaskPenaltyRule1(c)+np.applyMaskPenaltyRule2(c)+np.applyMaskPenaltyRule3(c)+np.applyMaskPenaltyRule4(c)},y.encode=function(c,l,w){void 0===w&&(w=null);var U=y.DEFAULT_BYTE_MODE_ENCODING,J=null!==w&&void 0!==w.get(ss.CHARACTER_SET);J&&(U=w.get(ss.CHARACTER_SET).toString());var ce=this.chooseMode(c,U),ge=new bi;if(ce===Pc.BYTE&&(J||y.DEFAULT_BYTE_MODE_ENCODING!==U)){var Pe=Yo.getCharacterSetECIByName(U);void 0!==Pe&&this.appendECI(Pe,ge)}this.appendModeInfo(ce,ge);var ut,Ge=new bi;if(this.appendBytes(c,ce,Ge,U),null!==w&&void 0!==w.get(ss.QR_VERSION)){var _t=Number.parseInt(w.get(ss.QR_VERSION).toString(),10);ut=Zh.getVersionForNumber(_t);var Ot=this.calculateBitsNeeded(ce,ge,Ge,ut);if(!this.willFit(Ot,ut,l))throw new Gc("Data too big for requested version")}else ut=this.recommendVersion(l,ce,ge,Ge);var Ht=new bi;Ht.appendBitArray(ge);var Sr=ce===Pc.BYTE?Ge.getSizeInBytes():c.length;this.appendLengthInfo(Sr,ut,ce,Ht),Ht.appendBitArray(Ge);var jr=ut.getECBlocksForLevel(l),sn=ut.getTotalCodewords()-jr.getTotalECCodewords();this.terminateBits(sn,Ht);var dn=this.interleaveWithECBytes(Ht,ut.getTotalCodewords(),sn,jr.getNumBlocks()),ln=new sy;ln.setECLevel(l),ln.setMode(ce),ln.setVersion(ut);var On=ut.getDimensionForVersion(),Wn=new Np(On,On),vi=this.chooseMaskPattern(dn,l,ut,Wn);return ln.setMaskPattern(vi),ip.buildMatrix(dn,l,ut,vi,Wn),ln.setMatrix(Wn),ln},y.recommendVersion=function(c,l,w,U){var J=this.calculateBitsNeeded(l,w,U,Zh.getVersionForNumber(1)),ce=this.chooseVersion(J,c),ge=this.calculateBitsNeeded(l,w,U,ce);return this.chooseVersion(ge,c)},y.calculateBitsNeeded=function(c,l,w,U){return l.getSize()+c.getCharacterCountBits(U)+w.getSize()},y.getAlphanumericCode=function(c){return c159)&&(J<224||J>235))return!1}return!0},y.chooseMaskPattern=function(c,l,w,U){for(var J=Number.MAX_SAFE_INTEGER,ce=-1,ge=0;ge=(c+7)/8},y.terminateBits=function(c,l){var w=8*c;if(l.getSize()>w)throw new Gc("data bits cannot fit in the QR Code"+l.getSize()+" > "+w);for(var U=0;U<4&&l.getSize()0)for(U=J;U<8;U++)l.appendBit(!1);var ce=c-l.getSizeInBytes();for(U=0;U=w)throw new Gc("Block ID too large");var ge=c%w,Pe=w-ge,Ge=Math.floor(c/w),ut=Ge+1,_t=Math.floor(l/w),Ot=_t+1,Ht=Ge-_t,Sr=ut-Ot;if(Ht!==Sr)throw new Gc("EC bytes mismatch");if(w!==Pe+ge)throw new Gc("RS blocks mismatch");if(c!==(_t+Ht)*Pe+(Ot+Sr)*ge)throw new Gc("Total bytes mismatch");U=1<=0&&l<=9},y.appendNumericBytes=function(c,l){for(var w=c.length,U=0;U=33088&&Pe<=40956?Ge=Pe-33088:Pe>=57408&&Pe<=60351&&(Ge=Pe-49472),-1===Ge)throw new Gc("Invalid byte sequence");l.appendBits(192*(Ge>>8)+(255&Ge),13)}},y.appendECI=function(c,l){l.appendBits(Pc.ECI.getBits(),4),l.appendBits(c.getValue(),8)},y.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]),y.DEFAULT_BYTE_MODE_ENCODING=Yo.UTF8.getName(),y}();!function(){function y(){}y.prototype.write=function(c,l,w,U){if(void 0===U&&(U=null),0===c.length)throw new Bi("Found empty contents");if(l<0||w<0)throw new Bi("Requested dimensions are too small: "+l+"x"+w);var J=Sl.L,ce=y.QUIET_ZONE_SIZE;null!==U&&(void 0!==U.get(ss.ERROR_CORRECTION)&&(J=Sl.fromString(U.get(ss.ERROR_CORRECTION).toString())),void 0!==U.get(ss.MARGIN)&&(ce=Number.parseInt(U.get(ss.MARGIN).toString(),10)));var ge=I0.encode(c,J,U);return this.renderResult(ge,l,w,ce)},y.prototype.writeToDom=function(c,l,w,U,J){void 0===J&&(J=null),"string"==typeof c&&(c=document.querySelector(c));var ce=this.write(l,w,U,J);c&&c.appendChild(ce)},y.prototype.renderResult=function(c,l,w,U){var J=c.getMatrix();if(null===J)throw new ou;for(var ce=J.getWidth(),ge=J.getHeight(),Pe=ce+2*U,Ge=ge+2*U,ut=Math.max(l,Pe),_t=Math.max(w,Ge),Ot=Math.min(Math.floor(ut/Pe),Math.floor(_t/Ge)),Ht=Math.floor((ut-ce*Ot)/2),Sr=Math.floor((_t-ge*Ot)/2),jr=this.createSVGElement(ut,_t),sn=0,dn=Sr;snw||ce+Pe>U)throw new Bi("Crop rectangle does not fit within image data.");return Ge&&ut.reverseHorizontal(ge,Pe),ut}Nx(c,y),c.prototype.getRow=function(l,w){if(l<0||l>=this.getHeight())throw new Bi("Requested row is outside the image: "+l);var U=this.getWidth();return(null==w||w.length>16&255)+(Ht>>7&510)+(255&Ht))/4&255}Ge.luminances=_t}else Ge.luminances=l;if(void 0===J&&(Ge.dataWidth=w),void 0===ce&&(Ge.dataHeight=U),void 0===ge&&(Ge.left=0),void 0===Pe&&(Ge.top=0),Ge.left+w>Ge.dataWidth||Ge.top+U>Ge.dataHeight)throw new Bi("Crop rectangle does not fit within image data.");return Ge}v_(c,y),c.prototype.getRow=function(l,w){if(l<0||l>=this.getHeight())throw new Bi("Requested row is outside the image: "+l);var U=this.getWidth();return(null==w||w.length=0&&this.noBit(w,l)&&this.utah(l,w,c++),l-=2,w+=2}while(l>=0&&w=0&&w=0);l+=3,w++}while(l=256&&(l^=301);return{LOG:y,ALOG:c}}([],[])).LOG,w_=M1.ALOG,uf="[)>\x1e05\x1d",eo="[)>\x1e06\x1d";const ap=function(){function y(){}return y.encodeECC200=function(c,l){if(c.length!==l.getDataCapacity())throw new Error("The number of codewords does not match the selected symbol");var w=new Ur;w.append(c);var U=l.getInterleavedBlockCount();if(1===U){var J=this.createECCBlock(c,l.getErrorCodewords());w.append(J)}else{for(var ce=[],ge=[],Pe=0;Pe0;Pe--)ce[Pe]=0!==ge&&0!==J[Pe]?ce[Pe-1]^w_[(fy[ge]+fy[J[Pe]])%255]:ce[Pe-1];ce[0]=0!==ge&&0!==J[0]?w_[(fy[ge]+fy[J[0]])%255]:0}var Ge=[];for(U=0;U=2)c.writeCodeword(this.encodeASCIIDigits(c.getMessage().charCodeAt(c.pos),c.getMessage().charCodeAt(c.pos+1))),c.pos+=2;else{var w=c.getCurrentChar(),U=Aa.lookAheadTest(c.getMessage(),c.pos,this.getEncodingMode());if(U!==this.getEncodingMode())switch(U){case 5:return c.writeCodeword(231),void c.signalEncoderChange(5);case 1:return c.writeCodeword(230),void c.signalEncoderChange(1);case 3:c.writeCodeword(238),c.signalEncoderChange(3);break;case 2:c.writeCodeword(239),c.signalEncoderChange(2);break;case 4:c.writeCodeword(240),c.signalEncoderChange(4);break;default:throw new Error("Illegal mode: "+U)}else Aa.isExtendedASCII(w)?(c.writeCodeword(235),c.writeCodeword(w-128+1),c.pos++):(c.writeCodeword(w+1),c.pos++)}},y.prototype.encodeASCIIDigits=function(c,l){if(Aa.isDigit(c)&&Aa.isDigit(l))return 10*(c-48)+(l-48)+130;throw new Error("not digits: "+c+l)},y}(),k1=function(){function y(){}return y.prototype.getEncodingMode=function(){return 5},y.prototype.encode=function(c){var l=new Ur;for(l.append(0);c.hasMoreCharacters();){var w=c.getCurrentChar();if(l.append(w),c.pos++,Aa.lookAheadTest(c.getMessage(),c.pos,this.getEncodingMode())!==this.getEncodingMode()){c.signalEncoderChange(0);break}}var J=l.length()-1,ge=c.getCodewordCount()+J+1;c.updateSymbolInfo(ge);var Pe=c.getSymbolInfo().getDataCapacity()-ge>0;if(c.hasMoreCharacters()||Pe)if(J<=249)l.setCharAt(0,bt.getCharAt(J));else{if(!(J<=1555))throw new Error("Message length not in valid ranges: "+J);l.setCharAt(0,bt.getCharAt(Math.floor(J/250)+249)),l.insert(1,bt.getCharAt(J%250))}var Ge=0;for(w=l.length();Ge3||1!==Ge))&&(c.pos=U)}l.length()>0&&c.writeCodeword(230),this.handleEOD(c,l)},y.prototype.encode=function(c){for(var l=new Ur;c.hasMoreCharacters();){var w=c.getCurrentChar();c.pos++;var U=this.encodeChar(w,l),J=2*Math.floor(l.length()/3),ce=c.getCodewordCount()+J;c.updateSymbolInfo(ce);var ge=c.getSymbolInfo().getDataCapacity()-ce;if(!c.hasMoreCharacters()){var Pe=new Ur;for(l.length()%3==2&&2!==ge&&(U=this.backtrackOneCharacter(c,l,Pe,U));l.length()%3==1&&(U>3||1!==ge);)U=this.backtrackOneCharacter(c,l,Pe,U);break}if(l.length()%3==0&&Aa.lookAheadTest(c.getMessage(),c.pos,this.getEncodingMode())!==this.getEncodingMode()){c.signalEncoderChange(0);break}}this.handleEOD(c,l)},y.prototype.backtrackOneCharacter=function(c,l,w,U){var J=l.length(),ce=l.toString().substring(0,J-U);l.setLengthToZero(),l.append(ce),c.pos--;var ge=c.getCurrentChar();return U=this.encodeChar(ge,w),c.resetSymbolInfo(),U},y.prototype.writeNextTriplet=function(c,l){c.writeCodewords(this.encodeToCodewords(l.toString()));var w=l.toString().substring(3);l.setLengthToZero(),l.append(w)},y.prototype.handleEOD=function(c,l){var w=Math.floor(l.length()/3*2),U=l.length()%3,J=c.getCodewordCount()+w;c.updateSymbolInfo(J);var ce=c.getSymbolInfo().getDataCapacity()-J;if(2===U){for(l.append("\0");l.length()>=3;)this.writeNextTriplet(c,l);c.hasMoreCharacters()&&c.writeCodeword(254)}else if(1===ce&&1===U){for(;l.length()>=3;)this.writeNextTriplet(c,l);c.hasMoreCharacters()&&c.writeCodeword(254),c.pos--}else{if(0!==U)throw new Error("Unexpected case. Please report!");for(;l.length()>=3;)this.writeNextTriplet(c,l);(ce>0||c.hasMoreCharacters())&&c.writeCodeword(254)}c.signalEncoderChange(0)},y.prototype.encodeChar=function(c,l){return 32===c?(l.append(3),1):c>=48&&c<=57?(l.append(c-48+4),1):c>=65&&c<=90?(l.append(c-65+14),1):c<32?(l.append(0),l.append(c),2):c<=47?(l.append(1),l.append(c-33),2):c<=64?(l.append(1),l.append(c-58+15),2):c<=95?(l.append(1),l.append(c-91+22),2):c<=127?(l.append(2),l.append(c-96),2):(l.append("1\x1e"),2+this.encodeChar(c-128,l))},y.prototype.encodeToCodewords=function(c){var l=1600*c.charCodeAt(0)+40*c.charCodeAt(1)+c.charCodeAt(2)+1,w=l/256,U=l%256,J=new Ur;return J.append(w),J.append(U),J.toString()},y}(),E_=function(){function y(){}return y.prototype.getEncodingMode=function(){return 4},y.prototype.encode=function(c){for(var l=new Ur;c.hasMoreCharacters();){var w=c.getCurrentChar();if(this.encodeChar(w,l),c.pos++,l.length()>=4){c.writeCodewords(this.encodeToCodewords(l.toString()));var J=l.toString().substring(4);if(l.setLengthToZero(),l.append(J),Aa.lookAheadTest(c.getMessage(),c.pos,this.getEncodingMode())!==this.getEncodingMode()){c.signalEncoderChange(0);break}}}l.append(bt.getCharAt(31)),this.handleEOD(c,l)},y.prototype.handleEOD=function(c,l){try{var w=l.length();if(0===w)return;if(1===w){c.updateSymbolInfo();var U=c.getSymbolInfo().getDataCapacity()-c.getCodewordCount(),J=c.getRemainingCharacters();if(J>U&&(c.updateSymbolInfo(c.getCodewordCount()+1),U=c.getSymbolInfo().getDataCapacity()-c.getCodewordCount()),J<=U&&U<=2)return}if(w>4)throw new Error("Count must not exceed 4");var ce=w-1,ge=this.encodeToCodewords(l.toString()),Ge=!c.hasMoreCharacters()&&ce<=2;ce<=2&&(c.updateSymbolInfo(c.getCodewordCount()+ce),(U=c.getSymbolInfo().getDataCapacity()-c.getCodewordCount())>=3&&(Ge=!1,c.updateSymbolInfo(c.getCodewordCount()+ge.length))),Ge?(c.resetSymbolInfo(),c.pos-=ce):c.writeCodewords(ge)}finally{c.signalEncoderChange(0)}},y.prototype.encodeChar=function(c,l){c>=32&&c<=63?l.append(c):c>=64&&c<=94?l.append(bt.getCharAt(c-64)):Aa.illegalCharacter(bt.getCharAt(c))},y.prototype.encodeToCodewords=function(c){var l=c.length;if(0===l)throw new Error("StringBuilder must not be empty");var ge=(c.charAt(0).charCodeAt(0)<<18)+((l>=2?c.charAt(1).charCodeAt(0):0)<<12)+((l>=3?c.charAt(2).charCodeAt(0):0)<<6)+(l>=4?c.charAt(3).charCodeAt(0):0),Pe=ge>>16&255,Ge=ge>>8&255,ut=255&ge,_t=new Ur;return _t.append(Pe),l>=2&&_t.append(Ge),l>=3&&_t.append(ut),_t.toString()},y}(),$x=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),nc=function(){function y(c,l,w,U,J,ce,ge,Pe){void 0===ge&&(ge=0),void 0===Pe&&(Pe=0),this.rectangular=c,this.dataCapacity=l,this.errorCodewords=w,this.matrixWidth=U,this.matrixHeight=J,this.dataRegions=ce,this.rsBlockData=ge,this.rsBlockError=Pe}return y.lookup=function(c,l,w,U,J){var ce,ge;void 0===l&&(l=0),void 0===w&&(w=null),void 0===U&&(U=null),void 0===J&&(J=!0);try{for(var Pe=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(B1),Ge=Pe.next();!Ge.done;Ge=Pe.next()){var ut=Ge.value;if((1!==l||!ut.rectangular)&&(2!==l||ut.rectangular)&&(null==w||!(ut.getSymbolWidth()U.getWidth()||ut.getSymbolHeight()>U.getHeight()))&&c<=ut.dataCapacity)return ut}}catch(_t){ce={error:_t}}finally{try{Ge&&!Ge.done&&(ge=Pe.return)&&ge.call(Pe)}finally{if(ce)throw ce.error}}if(J)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+c);return null},y.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},y.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},y.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},y.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},y.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+2*this.getHorizontalDataRegions()},y.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+2*this.getVerticalDataRegions()},y.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},y.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},y.prototype.getDataCapacity=function(){return this.dataCapacity},y.prototype.getErrorCodewords=function(){return this.errorCodewords},y.prototype.getDataLengthForInterleavedBlock=function(c){return this.rsBlockData},y.prototype.getErrorLengthForInterleavedBlock=function(c){return this.rsBlockError},y}();const gy=nc;var P0=function(y){function c(){return y.call(this,!1,1558,620,22,22,36,-1,62)||this}return $x(c,y),c.prototype.getInterleavedBlockCount=function(){return 10},c.prototype.getDataLengthForInterleavedBlock=function(l){return l<=8?156:155},c}(nc),B1=[new nc(!1,3,5,8,8,1),new nc(!1,5,7,10,10,1),new nc(!0,5,7,16,6,1),new nc(!1,8,10,12,12,1),new nc(!0,10,11,14,6,2),new nc(!1,12,12,14,14,1),new nc(!0,16,14,24,10,1),new nc(!1,18,14,16,16,1),new nc(!1,22,18,18,18,1),new nc(!0,22,18,16,10,2),new nc(!1,30,20,20,20,1),new nc(!0,32,24,16,14,2),new nc(!1,36,24,22,22,1),new nc(!1,44,28,24,24,1),new nc(!0,49,28,22,14,2),new nc(!1,62,36,14,14,4),new nc(!1,86,42,16,16,4),new nc(!1,114,48,18,18,4),new nc(!1,144,56,20,20,4),new nc(!1,174,68,22,22,4),new nc(!1,204,84,24,24,4,102,42),new nc(!1,280,112,14,14,16,140,56),new nc(!1,368,144,16,16,16,92,36),new nc(!1,456,192,18,18,16,114,48),new nc(!1,576,224,20,20,16,144,56),new nc(!1,696,272,22,22,16,174,68),new nc(!1,816,336,24,24,16,136,56),new nc(!1,1050,408,18,18,36,175,68),new nc(!1,1304,496,20,20,36,163,62),new P0],gD=function(){function y(c){this.msg=c,this.pos=0,this.skipAtEnd=0;for(var l=c.split("").map(function(ge){return ge.charCodeAt(0)}),w=new Ur,U=0,J=l.length;Uthis.symbolInfo.getDataCapacity())&&(this.symbolInfo=gy.lookup(c,this.shape,this.minSize,this.maxSize,!0))},y.prototype.resetSymbolInfo=function(){this.symbolInfo=null},y}(),O0=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),R0=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return O0(c,y),c.prototype.getEncodingMode=function(){return 3},c.prototype.encode=function(l){for(var w=new Ur;l.hasMoreCharacters();){var U=l.getCurrentChar();if(l.pos++,this.encodeChar(U,w),w.length()%3==0&&(this.writeNextTriplet(l,w),Aa.lookAheadTest(l.getMessage(),l.pos,this.getEncodingMode())!==this.getEncodingMode())){l.signalEncoderChange(0);break}}this.handleEOD(l,w)},c.prototype.encodeChar=function(l,w){switch(l){case 13:w.append(0);break;case 42:w.append(1);break;case 62:w.append(2);break;case 32:w.append(3);break;default:l>=48&&l<=57?w.append(l-48+4):l>=65&&l<=90?w.append(l-65+14):Aa.illegalCharacter(bt.getCharAt(l))}return 1},c.prototype.handleEOD=function(l,w){l.updateSymbolInfo();var U=l.getSymbolInfo().getDataCapacity()-l.getCodewordCount(),J=w.length();l.pos-=J,(l.getRemainingCharacters()>1||U>1||l.getRemainingCharacters()!==U)&&l.writeCodeword(254),l.getNewEncoding()<0&&l.signalEncoderChange(0)},c}(my),yy=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),F1=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return yy(c,y),c.prototype.getEncodingMode=function(){return 2},c.prototype.encodeChar=function(l,w){return 32===l?(w.append(3),1):l>=48&&l<=57?(w.append(l-48+4),1):l>=97&&l<=122?(w.append(l-97+14),1):l<32?(w.append(0),w.append(l),2):l<=47?(w.append(1),w.append(l-33),2):l<=64?(w.append(1),w.append(l-58+15),2):l>=91&&l<=95?(w.append(1),w.append(l-91+22),2):96===l?(w.append(2),w.append(0),2):l<=90?(w.append(2),w.append(l-65+1),2):l<=127?(w.append(2),w.append(l-123+27),2):(w.append("1\x1e"),2+this.encodeChar(l-128,w))},c}(my);const Aa=function(){function y(){}return y.randomize253State=function(c){var w=149*c%253+1+129;return w<=254?w:w-254},y.encodeHighLevel=function(c,l,w,U,J){void 0===l&&(l=0),void 0===w&&(w=null),void 0===U&&(U=null),void 0===J&&(J=!1);var ce=new my,ge=[new py,ce,new F1,new R0,new E_,new k1],Pe=new gD(c);Pe.setSymbolShape(l),Pe.setSizeConstraints(w,U),c.startsWith(uf)&&c.endsWith("\x1e\x04")?(Pe.writeCodeword(236),Pe.setSkipAtEnd(2),Pe.pos+=7):c.startsWith(eo)&&c.endsWith("\x1e\x04")&&(Pe.writeCodeword(237),Pe.setSkipAtEnd(2),Pe.pos+=7);var Ge=0;for(J&&(ce.encodeMaximal(Pe),Ge=Pe.getNewEncoding(),Pe.resetEncoderSignal());Pe.hasMoreCharacters();)ge[Ge].encode(Pe),Pe.getNewEncoding()>=0&&(Ge=Pe.getNewEncoding(),Pe.resetEncoderSignal());var ut=Pe.getCodewordCount();Pe.updateSymbolInfo();var _t=Pe.getSymbolInfo().getDataCapacity();ut<_t&&0!==Ge&&5!==Ge&&4!==Ge&&Pe.writeCodeword("\xfe");var Ot=Pe.getCodewords();for(Ot.length()<_t&&Ot.append(129);Ot.length()<_t;)Ot.append(this.randomize253State(Ot.length()+1));return Pe.getCodewords().toString()},y.lookAheadTest=function(c,l,w){var U=this.lookAheadTestIntern(c,l,w);if(3===w&&3===U){for(var J=Math.min(l+3,c.length),ce=l;ce=c.length)return w;var U;0===w?U=[0,1,1,1,1,1.25]:(U=[1,2,2,2,2,2.25])[w]=0;for(var J=0,ce=new Uint8Array(6),ge=[];;){if(l+J===c.length){Vi.fill(ce,0),Vi.fill(ge,0);var Pe=this.findMinimums(U,ge,pi.MAX_VALUE,ce),Ge=this.getMinimumCount(ce);if(ge[0]===Pe)return 0;if(1===Ge){if(ce[5]>0)return 5;if(ce[4]>0)return 4;if(ce[2]>0)return 2;if(ce[3]>0)return 3}return 1}var ut=c.charCodeAt(l+J);if(J++,this.isDigit(ut)?U[0]+=.5:this.isExtendedASCII(ut)?(U[0]=Math.ceil(U[0]),U[0]+=2):(U[0]=Math.ceil(U[0]),U[0]++),this.isNativeC40(ut)?U[1]+=2/3:this.isExtendedASCII(ut)?U[1]+=8/3:U[1]+=4/3,this.isNativeText(ut)?U[2]+=2/3:this.isExtendedASCII(ut)?U[2]+=8/3:U[2]+=4/3,this.isNativeX12(ut)?U[3]+=2/3:this.isExtendedASCII(ut)?U[3]+=13/3:U[3]+=10/3,this.isNativeEDIFACT(ut)?U[4]+=3/4:this.isExtendedASCII(ut)?U[4]+=4.25:U[4]+=3.25,this.isSpecialB256(ut)?U[5]+=4:U[5]++,J>=4){if(Vi.fill(ce,0),Vi.fill(ge,0),this.findMinimums(U,ge,pi.MAX_VALUE,ce),ge[0]ce&&(w=ce,Vi.fill(U,0)),w===ce&&(U[J]=U[J]+1)}return w},y.getMinimumCount=function(c){for(var l=0,w=0;w<6;w++)l+=c[w];return l||0},y.isDigit=function(c){return c>=48&&c<=57},y.isExtendedASCII=function(c){return c>=128&&c<=255},y.isNativeC40=function(c){return 32===c||c>=48&&c<=57||c>=65&&c<=90},y.isNativeText=function(c){return 32===c||c>=48&&c<=57||c>=97&&c<=122},y.isNativeX12=function(c){return this.isX12TermSep(c)||32===c||c>=48&&c<=57||c>=65&&c<=90},y.isX12TermSep=function(c){return 13===c||42===c||62===c},y.isNativeEDIFACT=function(c){return c>=32&&c<=94},y.isSpecialB256=function(c){return!1},y.determineConsecutiveDigitCount=function(c,l){void 0===l&&(l=0);for(var w=c.length,U=l;U=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")},by=function(){function y(c){this.charset=c,this.name=c.name}return y.prototype.canEncode=function(c){try{return null!=Wt.encode(c,this.charset)}catch{return!1}},y}(),Vx=function(){function y(c,l,w){var U,J,ce,ge,Pe,Ge;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(Ns){return new by(cy.forName(Ns))}),this.encoders=[];var ut=[];ut.push(new by(ly.ISO_8859_1));for(var _t=null!=l&&l.name.startsWith("UTF"),Ot=0;Ot=this.bytes.length)return!1;for(var w=0;w=this.length())throw new Error(""+c);if(this.isECI(c))throw new Error("value at "+c+" is not a character but an ECI");return this.isFNC1(c)?this.fnc1:this.bytes[c]},y.prototype.subSequence=function(c,l){if(c<0||c>l||l>this.length())throw new Error(""+c);for(var w=new Ur,U=c;U=this.length())throw new Error(""+c);return this.bytes[c]>255&&this.bytes[c]<=999},y.prototype.isFNC1=function(c){if(c<0||c>=this.length())throw new Error(""+c);return 1e3===this.bytes[c]},y.prototype.getECIValue=function(c){if(c<0||c>=this.length())throw new Error(""+c);if(!this.isECI(c))throw new Error("value at "+c+" is not an ECI but a character");return this.bytes[c]-256},y.prototype.addEdge=function(c,l,w){(null==c[l][w.encoderIndex]||c[l][w.encoderIndex].cachedTotalSize>w.cachedTotalSize)&&(c[l][w.encoderIndex]=w)},y.prototype.addEdges=function(c,l,w,U,J,ce){var ge=c.charAt(U).charCodeAt(0),Pe=0,Ge=l.length();l.getPriorityEncoderIndex()>=0&&(ge===ce||l.canEncode(ge,l.getPriorityEncoderIndex()))&&(Ge=(Pe=l.getPriorityEncoderIndex())+1);for(var ut=Pe;ut=0;ce--)_t.unshift(255&Ht[ce])}(null===Ot.previous?0:Ot.previous.encoderIndex)!==Ot.encoderIndex&&_t.unshift(256+l.getECIValue(Ot.encoderIndex)),Ot=Ot.previous}var jr=[];for(ce=0;ce=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")},Kx=function(y,c){var l="function"==typeof Symbol&&y[Symbol.iterator];if(!l)return y;var U,ce,w=l.call(y),J=[];try{for(;(void 0===c||c-- >0)&&!(U=w.next()).done;)J.push(U.value)}catch(ge){ce={error:ge}}finally{try{U&&!U.done&&(l=w.return)&&l.call(w)}finally{if(ce)throw ce.error}}return J},ao=function(y){return y[y.ASCII=0]="ASCII",y[y.C40=1]="C40",y[y.TEXT=2]="TEXT",y[y.X12=3]="X12",y[y.EDF=4]="EDF",y[y.B256=5]="B256",y}(ao||{}),wy=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],_u=function(){function y(){}return y.isExtendedASCII=function(c,l){return c!==l&&c>=128&&c<=255},y.isInC40Shift1Set=function(c){return c<=31},y.isInC40Shift2Set=function(c,l){var w,U;try{for(var J=k0(wy),ce=J.next();!ce.done;ce=J.next())if(ce.value.charCodeAt(0)===c)return!0}catch(Pe){w={error:Pe}}finally{try{ce&&!ce.done&&(U=J.return)&&U.call(J)}finally{if(w)throw w.error}}return c===l},y.isInTextShift1Set=function(c){return this.isInC40Shift1Set(c)},y.isInTextShift2Set=function(c,l){return this.isInC40Shift2Set(c,l)},y.encodeHighLevel=function(c,l,w,U){void 0===l&&(l=null),void 0===w&&(w=-1),void 0===U&&(U=0);var J=0;return c.startsWith(uf)&&c.endsWith("\x1e\x04")?(J=5,c=c.substring(7,c.length-2)):c.startsWith(eo)&&c.endsWith("\x1e\x04")&&(J=6,c=c.substring(7,c.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,function(){for(var y=[],c=0;cl.cachedTotalSize)&&(c[w][l.getEndMode()]=l)},y.getNumberOfC40Words=function(c,l,w,U){for(var J=0,ce=l;ce=128&&(w&&Aa.isNativeC40(Pe-128)||!w&&Aa.isNativeText(Pe-128))?J+=3:J+=4}else J+=2;if(J%3==0||(J-2)%3==0&&ce+1===c.length())return U[0]=ce-l+1,Math.ceil(J/3)}return U[0]=0,0},y.addEdges=function(c,l,w,U){var J,ce;if(c.isECI(w))this.addEdge(l,new Vd(c,ao.ASCII,w,1,U));else{var Ht,ge=c.charAt(w);if(null===U||U.getEndMode()!==ao.EDF){Aa.isDigit(ge)&&c.haveNCharacters(w,2)&&Aa.isDigit(c.charAt(w+1))?this.addEdge(l,new Vd(c,ao.ASCII,w,2,U)):this.addEdge(l,new Vd(c,ao.ASCII,w,1,U));var Pe=[ao.C40,ao.TEXT];try{for(var Ge=k0(Pe),ut=Ge.next();!ut.done;ut=Ge.next()){var _t=ut.value,Ot=[];y.getNumberOfC40Words(c,w,_t===ao.C40,Ot)>0&&this.addEdge(l,new Vd(c,_t,w,Ot[0],U))}}catch(jr){J={error:jr}}finally{try{ut&&!ut.done&&(ce=Ge.return)&&ce.call(Ge)}finally{if(J)throw J.error}}c.haveNCharacters(w,3)&&Aa.isNativeX12(c.charAt(w))&&Aa.isNativeX12(c.charAt(w+1))&&Aa.isNativeX12(c.charAt(w+2))&&this.addEdge(l,new Vd(c,ao.X12,w,3,U)),this.addEdge(l,new Vd(c,ao.B256,w,1,U))}for(Ht=0;Ht<3;Ht++){var Sr=w+Ht;if(!c.haveNCharacters(Sr,1)||!Aa.isNativeEDIFACT(c.charAt(Sr)))break;this.addEdge(l,new Vd(c,ao.EDF,w,Ht+1,U))}3===Ht&&c.haveNCharacters(w,4)&&Aa.isNativeEDIFACT(c.charAt(w+3))&&this.addEdge(l,new Vd(c,ao.EDF,w,4,U))}},y.encodeMinimally=function(c){var l=c.length(),w=Array(l+1).fill(null).map(function(){return Array(6).fill(0)});this.addEdges(c,w,0,null);for(var U=1;U<=l;U++){for(var J=0;J<6;J++)null!==w[U][J]&&U=1&&J<=3?Pe.cachedTotalSize+1:Pe.cachedTotalSize;Ge0&&(w+=this.prepend(Vd.getBytes(232),U));for(var Pe=0;Pe=0;w--)l.unshift(c[w]);return c.length},y.prototype.randomize253State=function(c){var w=149*c%253+1+129;return w<=254?w:w-254},y.prototype.applyRandomPattern=function(c,l,w){for(var U=0;U0&&this.getCodewordsRemaining(this.cachedTotalSize+c)<=2-c)return ao.ASCII}if(this.mode===ao.C40||this.mode===ao.TEXT||this.mode===ao.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&0===this.getCodewordsRemaining(this.cachedTotalSize))return ao.ASCII;var c;if(1===(c=this.getLastASCII())&&0===this.getCodewordsRemaining(this.cachedTotalSize+1))return ao.ASCII}return this.mode},y.prototype.getMode=function(){return this.mode},y.prototype.getLastASCII=function(){var c=this.input.length(),l=this.fromPosition+this.characterLength;return c-l>4||l>=c?0:c-l==1?_u.isExtendedASCII(this.input.charAt(l),this.input.getFNC1Character())?0:1:c-l==2?_u.isExtendedASCII(this.input.charAt(l),this.input.getFNC1Character())||_u.isExtendedASCII(this.input.charAt(l+1),this.input.getFNC1Character())?0:Aa.isDigit(this.input.charAt(l))&&Aa.isDigit(this.input.charAt(l+1))?1:2:c-l==3?Aa.isDigit(this.input.charAt(l))&&Aa.isDigit(this.input.charAt(l+1))&&!_u.isExtendedASCII(this.input.charAt(l+2),this.input.getFNC1Character())||Aa.isDigit(this.input.charAt(l+1))&&Aa.isDigit(this.input.charAt(l+2))&&!_u.isExtendedASCII(this.input.charAt(l),this.input.getFNC1Character())?2:0:Aa.isDigit(this.input.charAt(l))&&Aa.isDigit(this.input.charAt(l+1))&&Aa.isDigit(this.input.charAt(l+2))&&Aa.isDigit(this.input.charAt(l+3))?2:0},y.prototype.getMinSymbolSize=function(c){var l,w,U,J,ce,ge;switch(this.input.getShapeHint()){case 1:try{for(var Pe=k0(this.squareCodewordCapacities),Ge=Pe.next();!Ge.done;Ge=Pe.next())if((ut=Ge.value)>=c)return ut}catch(jr){l={error:jr}}finally{try{Ge&&!Ge.done&&(w=Pe.return)&&w.call(Pe)}finally{if(l)throw l.error}}break;case 2:try{for(var _t=k0(this.rectangularCodewordCapacities),Ot=_t.next();!Ot.done;Ot=_t.next())if((ut=Ot.value)>=c)return ut}catch(jr){U={error:jr}}finally{try{Ot&&!Ot.done&&(J=_t.return)&&J.call(_t)}finally{if(U)throw U.error}}}try{for(var Ht=k0(this.allCodewordCapacities),Sr=Ht.next();!Sr.done;Sr=Ht.next()){var ut;if((ut=Sr.value)>=c)return ut}}catch(jr){ce={error:jr}}finally{try{Sr&&!Sr.done&&(ge=Ht.return)&&ge.call(Ht)}finally{if(ce)throw ce.error}}return this.allCodewordCapacities[this.allCodewordCapacities.length-1]},y.prototype.getCodewordsRemaining=function(c){return this.getMinSymbolSize(c)-c},y.getBytes=function(c,l){var w=new Uint8Array(l?2:1);return w[0]=c,l&&(w[1]=l),w},y.prototype.setC40Word=function(c,l,w,U,J){var ce=1600*(255&w)+40*(255&U)+(255&J)+1;c[l]=ce/256,c[l+1]=ce%256},y.prototype.getX12Value=function(c){return 13===c?0:42===c?1:62===c?2:32===c?3:c>=48&&c<=57?c-44:c>=65&&c<=90?c-51:c},y.prototype.getX12Words=function(){if(this.characterLength%3!=0)throw new Error("X12 words must be a multiple of 3");for(var c=new Uint8Array(this.characterLength/3*2),l=0;l=33&&w<=47?w-33:w>=48&&w<=57?w-44:w>=58&&w<=64?w-43:w>=65&&w<=90?w-64:w>=91&&w<=95?w-69:96===w?0:w>=97&&w<=122?w-83:w>=123&&w<=127?w-96:w},y.prototype.getC40Words=function(c,l){for(var w=[],U=0;U>16&255,l[J+1]=Pe>>8&255,l[J+2]=255&Pe}return l},y.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case ao.ASCII:case ao.B256:switch(this.mode){case ao.B256:return y.getBytes(231);case ao.C40:return y.getBytes(230);case ao.TEXT:return y.getBytes(239);case ao.X12:return y.getBytes(238);case ao.EDF:return y.getBytes(240)}break;case ao.C40:case ao.TEXT:case ao.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case ao.ASCII:return y.getBytes(254);case ao.B256:return y.getBytes(254,231);case ao.C40:return y.getBytes(254,230);case ao.TEXT:return y.getBytes(254,239);case ao.X12:return y.getBytes(254,238);case ao.EDF:return y.getBytes(254,240)}break;case ao.EDF:if(this.mode!==ao.EDF)throw new Error("Cannot switch from EDF to "+this.mode)}return new Uint8Array(0)},y.prototype.getDataBytes=function(){switch(this.mode){case ao.ASCII:return this.input.isECI(this.fromPosition)?y.getBytes(241,this.input.getECIValue(this.fromPosition)+1):_u.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?y.getBytes(235,this.input.charAt(this.fromPosition)-127):2===this.characterLength?y.getBytes(10*this.input.charAt(this.fromPosition)+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?y.getBytes(232):y.getBytes(this.input.charAt(this.fromPosition)+1);case ao.B256:return y.getBytes(this.input.charAt(this.fromPosition));case ao.C40:return this.getC40Words(!0,this.input.getFNC1Character());case ao.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case ao.X12:return this.getX12Words();case ao.EDF:return this.getEDFBytes()}},y}(),A_=function(y){function c(l,w,U,J,ce){var ge=y.call(this,l,w,U)||this;return ge.shape=J,ge.macroId=ce,ge}return zx(c,y),c.prototype.getMacroId=function(){return this.macroId},c.prototype.getShapeHint=function(){return this.shape},c}(S_);!function(){function y(){}y.prototype.encode=function(c,l,w,U,J){if(void 0===J&&(J=null),""===c.trim())throw new Error("Found empty contents");if(l!==Co.DATA_MATRIX)throw new Error("Can only encode DATA_MATRIX, but got "+l);if(w<0||U<0)throw new Error("Requested dimensions can't be negative: "+w+"x"+U);var Ot,ce=0,ge=null,Pe=null;if(null!=J){var Ge=J.get(ss.DATA_MATRIX_SHAPE);null!=Ge&&(ce=Ge);var ut=J.get(ss.MIN_SIZE);null!=ut&&(ge=ut);var _t=J.get(ss.MAX_SIZE);null!=_t&&(Pe=_t)}if(null!=J&&J.has(ss.DATA_MATRIX_COMPACT)&&J.get(ss.DATA_MATRIX_COMPACT).toString()){var Sr=J.has(ss.GS1_FORMAT)&&!!J.get(ss.GS1_FORMAT).toString(),jr=null;J.has(ss.CHARACTER_SET)&&(jr=cy.forName(J.get(ss.CHARACTER_SET).toString())),Ot=_u.encodeHighLevel(c,jr,Sr?29:-1,ce)}else{var dn=null!=J&&J.has(ss.FORCE_C40)&&!!J.get(ss.FORCE_C40).toString();Ot=Aa.encodeHighLevel(c,ce,ge,Pe,dn)}var ln=gy.lookup(Ot.length,ce,ge,Pe,!0),On=ap.encodeECC200(Ot,ln),Wn=new uy(On,ln.getSymbolDataWidth(),ln.getSymbolDataHeight());return Wn.place(),this.encodeLowLevel(Wn,ln,w,U)},y.prototype.encodeLowLevel=function(c,l,w,U){for(var J=l.getSymbolDataWidth(),ce=l.getSymbolDataHeight(),ge=new Np(l.getSymbolWidth(),l.getSymbolHeight()),Pe=0,Ge=0;Ge"},c}(yD);var wD=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)U.hasOwnProperty(J)&&(w[J]=U[J])})(c,l)};return function(c,l){function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}();const F0=function(y){function c(l,w,U){var J=y.call(this,l,0,0)||this;return J.binaryShiftStart=w,J.binaryShiftByteCount=U,J}return wD(c,y),c.prototype.appendTo=function(l,w){for(var U=0;U62?l.appendBits(this.binaryShiftByteCount-31,16):l.appendBits(0===U?Math.min(this.binaryShiftByteCount,31):this.binaryShiftByteCount-31,5)),l.appendBits(w[this.binaryShiftStart+U],8)},c.prototype.addBinaryShift=function(l,w){return new c(this,l,w)},c.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},c}(D_);function Bm(y,c,l){return new D_(y,c,l)}var Gx=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],I_=new D_(null,0,0),N0=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])],ih=function Ey(y){var c,l;try{for(var w=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),U=w.next();!U.done;U=w.next())Vi.fill(U.value,-1)}catch(ce){c={error:ce}}finally{try{U&&!U.done&&(l=w.return)&&l.call(w)}finally{if(c)throw c.error}}return y[0][4]=0,y[1][4]=0,y[1][0]=28,y[3][4]=0,y[2][4]=0,y[2][0]=15,y}(Vi.createInt32Array(6,6));const T_=function(){function y(c,l,w,U){this.token=c,this.mode=l,this.binaryShiftByteCount=w,this.bitCount=U}return y.prototype.getMode=function(){return this.mode},y.prototype.getToken=function(){return this.token},y.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},y.prototype.getBitCount=function(){return this.bitCount},y.prototype.latchAndAppend=function(c,l){var w=this.bitCount,U=this.token;if(c!==this.mode){var J=N0[this.mode][c];U=Bm(U,65535&J,J>>16),w+=J>>16}var ce=2===c?4:5;return new y(U=Bm(U,l,ce),c,0,w+ce)},y.prototype.shiftAndAppend=function(c,l){var w=this.token,U=2===this.mode?4:5;return w=Bm(w,ih[this.mode][c],U),new y(w=Bm(w,l,5),this.mode,0,this.bitCount+U+5)},y.prototype.addBinaryShiftChar=function(c){var l=this.token,w=this.mode,U=this.bitCount;if(4===this.mode||2===this.mode){var J=N0[w][0];l=Bm(l,65535&J,J>>16),U+=J>>16,w=0}var ge=new y(l,w,this.binaryShiftByteCount+1,U+(0===this.binaryShiftByteCount||31===this.binaryShiftByteCount?18:62===this.binaryShiftByteCount?9:8));return 2078===ge.binaryShiftByteCount&&(ge=ge.endBinaryShift(c+1)),ge},y.prototype.endBinaryShift=function(c){if(0===this.binaryShiftByteCount)return this;var l=this.token;return l=function Wx(y,c,l){return new F0(y,c,l)}(l,c-this.binaryShiftByteCount,this.binaryShiftByteCount),new y(l,this.mode,0,this.bitCount)},y.prototype.isBetterThanOrEqualTo=function(c){var l=this.bitCount+(N0[this.mode][c.mode]>>16);return this.binaryShiftByteCountc.binaryShiftByteCount&&c.binaryShiftByteCount>0&&(l+=10),l<=c.bitCount},y.prototype.toBitArray=function(c){for(var l,w,U=[],J=this.endBinaryShift(c.length).token;null!==J;J=J.getPrevious())U.unshift(J);var ce=new bi;try{for(var ge=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(U),Pe=ge.next();!Pe.done;Pe=ge.next())Pe.value.appendTo(ce,c)}catch(ut){l={error:ut}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(l)throw l.error}}return ce},y.prototype.toString=function(){return bt.format("%s bits=%d bytes=%d",Gx[this.mode],this.bitCount,this.binaryShiftByteCount)},y.calculateBinaryShiftCost=function(c){return c.binaryShiftByteCount>62?21:c.binaryShiftByteCount>31?20:c.binaryShiftByteCount>0?10:0},y.INITIAL_STATE=new y(I_,0,0,0),y}();var O_=function P_(y){var c=bt.getCharCode(" "),l=bt.getCharCode("."),w=bt.getCharCode(",");y[0][c]=1;for(var U=bt.getCharCode("Z"),J=bt.getCharCode("A"),ce=J;ce<=U;ce++)y[0][ce]=ce-J+2;y[1][c]=1;var ge=bt.getCharCode("z"),Pe=bt.getCharCode("a");for(ce=Pe;ce<=ge;ce++)y[1][ce]=ce-Pe+2;y[2][c]=1;var Ge=bt.getCharCode("9"),ut=bt.getCharCode("0");for(ce=ut;ce<=Ge;ce++)y[2][ce]=ce-ut+2;y[2][w]=12,y[2][l]=13;for(var _t=["\0"," ","\x01","\x02","\x03","\x04","\x05","\x06","\x07","\b","\t","\n","\v","\f","\r","\x1b","\x1c","\x1d","\x1e","\x1f","@","\\","^","_","`","|","~","\x7f"],Ot=0;Ot<_t.length;Ot++)y[3][bt.getCharCode(_t[Ot])]=Ot;var Ht=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(Ot=0;Ot0&&(y[4][bt.getCharCode(Ht[Ot])]=Ot);return y}(Vi.createInt32Array(5,256)),U1=function(y){var c="function"==typeof Symbol&&Symbol.iterator,l=c&&y[c],w=0;if(l)return l.call(y);if(y&&"number"==typeof y.length)return{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};const $1=function(){function y(c){this.text=c}return y.prototype.encode=function(){for(var c=bt.getCharCode(" "),l=bt.getCharCode("\n"),w=C_.singletonList(T_.INITIAL_STATE),U=0;U0?(w=y.updateStateListForPair(w,U,J),U++):w=this.updateStateListForChar(w,U)}return C_.min(w,function(Pe,Ge){return Pe.getBitCount()-Ge.getBitCount()}).toBitArray(this.text)},y.prototype.updateStateListForChar=function(c,l){var w,U,J=[];try{for(var ce=U1(c),ge=ce.next();!ge.done;ge=ce.next())this.updateStateForChar(ge.value,l,J)}catch(Ge){w={error:Ge}}finally{try{ge&&!ge.done&&(U=ce.return)&&U.call(ce)}finally{if(w)throw w.error}}return y.simplifyStates(J)},y.prototype.updateStateForChar=function(c,l,w){for(var U=255&this.text[l],J=O_[c.getMode()][U]>0,ce=null,ge=0;ge<=4;ge++){var Pe=O_[ge][U];if(Pe>0){if(null==ce&&(ce=c.endBinaryShift(l)),!J||ge===c.getMode()||2===ge){var Ge=ce.latchAndAppend(ge,Pe);w.push(Ge)}if(!J&&ih[c.getMode()][ge]>=0){var ut=ce.shiftAndAppend(ge,Pe);w.push(ut)}}}if(c.getBinaryShiftByteCount()>0||0===O_[c.getMode()][U]){var _t=c.addBinaryShiftChar(l);w.push(_t)}},y.updateStateListForPair=function(c,l,w){var U,J,ce=[];try{for(var ge=U1(c),Pe=ge.next();!Pe.done;Pe=ge.next())this.updateStateForPair(Pe.value,l,w,ce)}catch(ut){U={error:ut}}finally{try{Pe&&!Pe.done&&(J=ge.return)&&J.call(ge)}finally{if(U)throw U.error}}return this.simplifyStates(ce)},y.updateStateForPair=function(c,l,w,U){var J=c.endBinaryShift(l);if(U.push(J.latchAndAppend(4,w)),4!==c.getMode()&&U.push(J.shiftAndAppend(4,w)),3===w||4===w){var ce=J.latchAndAppend(2,16-w).latchAndAppend(2,1);U.push(ce)}if(c.getBinaryShiftByteCount()>0){var ge=c.addBinaryShiftChar(l).addBinaryShiftChar(l+1);U.push(ge)}},y.simplifyStates=function(c){var l,w,U,J,ce=[];try{for(var ge=U1(c),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value,ut=!0,_t=function(sn){if(sn.isBetterThanOrEqualTo(Ge))return ut=!1,"break";Ge.isBetterThanOrEqualTo(sn)&&(ce=ce.filter(function(dn){return dn!==sn}))};try{for(var Ot=(U=void 0,U1(ce)),Ht=Ot.next();!Ht.done&&"break"!==_t(Ht.value);Ht=Ot.next());}catch(sn){U={error:sn}}finally{try{Ht&&!Ht.done&&(J=Ot.return)&&J.call(Ot)}finally{if(U)throw U.error}}ut&&ce.push(Ge)}}catch(sn){l={error:sn}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(l)throw l.error}}return ce},y}(),xy=function(){function y(){}return y.encodeBytes=function(c){return y.encode(c,y.DEFAULT_EC_PERCENT,y.DEFAULT_AZTEC_LAYERS)},y.encode=function(c,l,w){var ge,Pe,Ge,ut,_t,U=new $1(c).encode(),J=pi.truncDivision(U.getSize()*l,100)+11,ce=U.getSize()+J;if(w!==y.DEFAULT_AZTEC_LAYERS){if(ge=w<0,(Pe=Math.abs(w))>(ge?y.MAX_NB_BITS_COMPACT:y.MAX_NB_BITS))throw new Bi(bt.format("Illegal value %s for layers",w));var Ot=(Ge=y.totalBitsInLayer(Pe,ge))-Ge%(ut=y.WORD_SIZE[Pe]);if((_t=y.stuffBits(U,ut)).getSize()+J>Ot)throw new Bi("Data to large for user specified layer");if(ge&&_t.getSize()>64*ut)throw new Bi("Data to large for user specified layer")}else{ut=0,_t=null;for(var Ht=0;;Ht++){if(Ht>y.MAX_NB_BITS)throw new Bi("Data too large for an Aztec code");if(!(ce>(Ge=y.totalBitsInLayer(Pe=(ge=Ht<=3)?Ht+1:Ht,ge)))&&((null==_t||ut!==y.WORD_SIZE[Pe])&&(_t=y.stuffBits(U,ut=y.WORD_SIZE[Pe])),Ot=Ge-Ge%ut,!(ge&&_t.getSize()>64*ut)&&_t.getSize()+J<=Ot))break}}var On,Sr=y.generateCheckWords(_t,Ge,ut),jr=_t.getSize()/ut,sn=y.generateModeMessage(ge,Pe,jr),dn=(ge?11:14)+4*Pe,ln=new Int32Array(dn);if(ge)for(On=dn,Ht=0;Ht=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}(Array.from(Ge)),Ht=Ot.next();!Ht.done;Ht=Ot.next())_t.appendBits(Ht.value,w)}catch(jr){U={error:jr}}finally{try{Ht&&!Ht.done&&(J=Ot.return)&&J.call(Ot)}finally{if(U)throw U.error}}return _t},y.bitsToWords=function(c,l,w){var J,ce,U=new Int32Array(w);for(J=0,ce=c.getSize()/l;J=U||c.get(ce+Pe))&&(ge|=1<>10}return J},c.prototype.getRow=function(l,w){if(l<0||l>=this.getHeight())throw new Bi("Requested row is outside the image: "+l);var U=this.getWidth(),J=l*U;return null===w?w=this.buffer.slice(J,J+U):(w.length0&&J[J.length-1])&&(6===Ge[0]||2===Ge[0])){l=0;continue}if(3===Ge[0]&&(!J||Ge[1]>J[0]&&Ge[1]=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")},wl={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},df=function(){function y(c,l,w){void 0===l&&(l=new Map),void 0===w&&(w={}),this.reader=c,this.hints=l,this.options=Fm(Fm({},wl),w)}return Object.defineProperty(y.prototype,"possibleFormats",{set:function(c){this.hints.set(Ci.POSSIBLE_FORMATS,c)},enumerable:!1,configurable:!0}),y.addVideoSource=function(c,l){try{c.srcObject=l}catch{console.error("got interrupted by new loading request")}},y.mediaStreamSetTorch=function(c,l){return bl(this,void 0,void 0,function(){return nl(this,function(w){switch(w.label){case 0:return[4,c.applyConstraints({advanced:[{fillLightMode:l?"flash":"off",torch:!!l}]})];case 1:return w.sent(),[2]}})})},y.mediaStreamIsTorchCompatible=function(c){var l,w,U=c.getVideoTracks();try{for(var J=Nm(U),ce=J.next();!ce.done;ce=J.next())if(y.mediaStreamIsTorchCompatibleTrack(ce.value))return!0}catch(Pe){l={error:Pe}}finally{try{ce&&!ce.done&&(w=J.return)&&w.call(J)}finally{if(l)throw l.error}}return!1},y.mediaStreamIsTorchCompatibleTrack=function(c){try{return"torch"in c.getCapabilities()}catch(w){return console.error(w),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},y.isVideoPlaying=function(c){return c.currentTime>0&&!c.paused&&c.readyState>2},y.getMediaElement=function(c,l){var w=document.getElementById(c);if(!w)throw new vs("element with id '".concat(c,"' not found"));if(w.nodeName.toLowerCase()!==l.toLowerCase())throw new vs("element with id '".concat(c,"' must be an ").concat(l," element"));return w},y.createVideoElement=function(c){if(c instanceof HTMLVideoElement)return c;if("string"==typeof c)return y.getMediaElement(c,"video");if(!c&&typeof document<"u"){var l=document.createElement("video");return l.width=200,l.height=200,l}throw new Error("Couldn't get videoElement from videoSource!")},y.prepareImageElement=function(c){if(c instanceof HTMLImageElement)return c;if("string"==typeof c)return y.getMediaElement(c,"img");if(typeof c>"u"){var l=document.createElement("img");return l.width=200,l.height=200,l}throw new Error("Couldn't get imageElement from imageSource!")},y.prepareVideoElement=function(c){var l=y.createVideoElement(c);return l.setAttribute("autoplay","true"),l.setAttribute("muted","true"),l.setAttribute("playsinline","true"),l},y.isImageLoaded=function(c){return!(!c.complete||0===c.naturalWidth)},y.createBinaryBitmapFromCanvas=function(c){var l=new Yx(c),w=new mc(l);return new jc(w)},y.drawImageOnCanvas=function(c,l){c.drawImage(l,0,0)},y.getMediaElementDimensions=function(c){if(c instanceof HTMLVideoElement)return{height:c.videoHeight,width:c.videoWidth};if(c instanceof HTMLImageElement)return{height:c.naturalHeight||c.height,width:c.naturalWidth||c.width};throw new Error("Couldn't find the Source's dimensions!")},y.createCaptureCanvas=function(c){if(!c)throw new vs("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error('The page "Document" is undefined, make sure you\'re running in a browser.');var l=document.createElement("canvas"),w=y.getMediaElementDimensions(c),U=w.width,J=w.height;return l.style.width=U+"px",l.style.height=J+"px",l.width=U,l.height=J,l},y.tryPlayVideo=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(w){switch(w.label){case 0:if(c?.ended)return console.error("Trying to play video that has ended."),[2,!1];if(y.isVideoPlaying(c))return console.warn("Trying to play video that is already playing."),[2,!0];w.label=1;case 1:return w.trys.push([1,3,,4]),[4,c.play()];case 2:return w.sent(),[2,!0];case 3:return l=w.sent(),console.warn("It was not possible to play the video.",l),[2,!1];case 4:return[2]}})})},y.createCanvasFromMediaElement=function(c){var l=y.createCaptureCanvas(c),w=l.getContext("2d");if(!w)throw new Error("Couldn't find Canvas 2D Context.");return y.drawImageOnCanvas(w,c),l},y.createBinaryBitmapFromMediaElem=function(c){var l=y.createCanvasFromMediaElement(c);return y.createBinaryBitmapFromCanvas(l)},y.destroyImageElement=function(c){c.src="",c.removeAttribute("src"),c=void 0},y.listVideoInputDevices=function(){return bl(this,void 0,void 0,function(){var c,l,w,U,J,ce,ge,Pe,_t,Ot;return nl(this,function(Ht){switch(Ht.label){case 0:if(!R_())throw new Error("Can't enumerate devices, navigator is not present.");if(!function Ay(){return!(!function H1(){return R_()&&!!navigator.mediaDevices}()||!navigator.mediaDevices.enumerateDevices)}())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:c=Ht.sent(),l=[];try{for(w=Nm(c),U=w.next();!U.done;U=w.next())"videoinput"===(ce="video"===(J=U.value).kind?"videoinput":J.kind)&&(ge=J.deviceId||J.id,Pe=J.label||"Video device ".concat(l.length+1),l.push({deviceId:ge,label:Pe,kind:ce,groupId:J.groupId}))}catch(Sr){_t={error:Sr}}finally{try{U&&!U.done&&(Ot=w.return)&&Ot.call(w)}finally{if(_t)throw _t.error}}return[2,l]}})})},y.findDeviceById=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(w){switch(w.label){case 0:return[4,y.listVideoInputDevices()];case 1:return(l=w.sent())?[2,l.find(function(U){return U.deviceId===c})]:[2]}})})},y.cleanVideoSource=function(c){if(c){try{c.srcObject=null}catch{c.src=""}c&&c.removeAttribute("src")}},y.releaseAllStreams=function(){0!==y.streamTracker.length&&y.streamTracker.forEach(function(c){c.getTracks().forEach(function(l){return l.stop()})}),y.streamTracker=[]},y.playVideoOnLoadAsync=function(c,l){return bl(this,void 0,void 0,function(){return nl(this,function(U){switch(U.label){case 0:return[4,y.tryPlayVideo(c)];case 1:return U.sent()?[2,!0]:[2,new Promise(function(J,ce){var ge=setTimeout(function(){y.isVideoPlaying(c)||(ce(!1),c.removeEventListener("canplay",Pe))},l),Pe=function(){y.tryPlayVideo(c).then(function(Ge){clearTimeout(ge),c.removeEventListener("canplay",Pe),J(Ge)})};c.addEventListener("canplay",Pe)})]}})})},y.attachStreamToVideo=function(c,l,w){return void 0===w&&(w=5e3),bl(this,void 0,void 0,function(){var U;return nl(this,function(J){switch(J.label){case 0:return U=y.prepareVideoElement(l),y.addVideoSource(U,c),[4,y.playVideoOnLoadAsync(U,w)];case 1:return J.sent(),[2,U]}})})},y._waitImageLoad=function(c){return new Promise(function(l,w){var J=setTimeout(function(){y.isImageLoaded(c)||(c.removeEventListener("load",ce),w())},1e4),ce=function(){clearTimeout(J),c.removeEventListener("load",ce),l()};c.addEventListener("load",ce)})},y.checkCallbackFnOrThrow=function(c){if(!c)throw new vs("`callbackFn` is a required parameter, you cannot capture results without it.")},y.disposeMediaStream=function(c){c.getVideoTracks().forEach(function(l){return l.stop()}),c=void 0},y.prototype.decode=function(c){var l=y.createCanvasFromMediaElement(c);return this.decodeFromCanvas(l)},y.prototype.decodeBitmap=function(c){return this.reader.decode(c,this.hints)},y.prototype.decodeFromCanvas=function(c){var l=y.createBinaryBitmapFromCanvas(c);return this.decodeBitmap(l)},y.prototype.decodeFromImageElement=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(w){switch(w.label){case 0:if(!c)throw new vs("An image element must be provided.");return l=y.prepareImageElement(c),[4,this._decodeOnLoadImage(l)];case 1:return[2,w.sent()]}})})},y.prototype.decodeFromImageUrl=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(w){switch(w.label){case 0:if(!c)throw new vs("An URL must be provided.");(l=y.prepareImageElement()).src=c,w.label=1;case 1:return w.trys.push([1,,3,4]),[4,this.decodeFromImageElement(l)];case 2:return[2,w.sent()];case 3:return y.destroyImageElement(l),[7];case 4:return[2]}})})},y.prototype.decodeFromConstraints=function(c,l,w){return bl(this,void 0,void 0,function(){var U,J;return nl(this,function(ce){switch(ce.label){case 0:return y.checkCallbackFnOrThrow(w),[4,this.getUserMedia(c)];case 1:U=ce.sent(),ce.label=2;case 2:return ce.trys.push([2,4,,5]),[4,this.decodeFromStream(U,l,w)];case 3:return[2,ce.sent()];case 4:throw J=ce.sent(),y.disposeMediaStream(U),J;case 5:return[2]}})})},y.prototype.decodeFromStream=function(c,l,w){return bl(this,void 0,void 0,function(){var J,ge,Pe,Ge,_t,Ot,Ht=this;return nl(this,function(Sr){switch(Sr.label){case 0:return y.checkCallbackFnOrThrow(w),[4,y.attachStreamToVideo(c,l,this.options.tryPlayVideoTimeout)];case 1:return J=Sr.sent(),ge=this.scan(J,w,function(){y.disposeMediaStream(c),y.cleanVideoSource(J)}),Pe=c.getVideoTracks(),Ge=Fm(Fm({},ge),{stop:function(){ge.stop()},streamVideoConstraintsApply:function(jr,sn){return bl(this,void 0,void 0,function(){var dn,ln,On,vi,ki,Xi;return nl(this,function(So){switch(So.label){case 0:dn=sn?Pe.filter(sn):Pe,So.label=1;case 1:So.trys.push([1,6,7,8]),ln=Nm(dn),On=ln.next(),So.label=2;case 2:return On.done?[3,5]:[4,On.value.applyConstraints(jr)];case 3:So.sent(),So.label=4;case 4:return On=ln.next(),[3,2];case 5:return[3,8];case 6:return vi=So.sent(),ki={error:vi},[3,8];case 7:try{On&&!On.done&&(Xi=ln.return)&&Xi.call(ln)}finally{if(ki)throw ki.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(jr){return Pe.find(jr).getConstraints()},streamVideoSettingsGet:function(jr){return Pe.find(jr).getSettings()},streamVideoCapabilitiesGet:function(jr){return Pe.find(jr).getCapabilities()}}),y.mediaStreamIsTorchCompatible(c)&&(_t=Pe?.find(function(jr){return y.mediaStreamIsTorchCompatibleTrack(jr)}),Ge.switchTorch=Ot=function(jr){return bl(Ht,void 0,void 0,function(){return nl(this,function(sn){switch(sn.label){case 0:return[4,y.mediaStreamSetTorch(_t,jr)];case 1:return sn.sent(),[2]}})})},Ge.stop=function(){return bl(Ht,void 0,void 0,function(){return nl(this,function(jr){switch(jr.label){case 0:return ge.stop(),[4,Ot(!1)];case 1:return jr.sent(),[2]}})})}),[2,Ge]}})})},y.prototype.decodeFromVideoDevice=function(c,l,w){return bl(this,void 0,void 0,function(){return nl(this,function(ce){switch(ce.label){case 0:return y.checkCallbackFnOrThrow(w),[4,this.decodeFromConstraints({video:c?{deviceId:{exact:c}}:{facingMode:"environment"}},l,w)];case 1:return[2,ce.sent()]}})})},y.prototype.decodeFromVideoElement=function(c,l){return bl(this,void 0,void 0,function(){var w;return nl(this,function(J){switch(J.label){case 0:if(y.checkCallbackFnOrThrow(l),!c)throw new vs("A video element must be provided.");return w=y.prepareVideoElement(c),[4,y.playVideoOnLoadAsync(w,this.options.tryPlayVideoTimeout)];case 1:return J.sent(),[2,this.scan(w,l)]}})})},y.prototype.decodeFromVideoUrl=function(c,l){return bl(this,void 0,void 0,function(){var w,U;return nl(this,function(ge){switch(ge.label){case 0:if(y.checkCallbackFnOrThrow(l),!c)throw new vs("An URL must be provided.");return(w=y.prepareVideoElement()).src=c,U=function(){y.cleanVideoSource(w)},[4,y.playVideoOnLoadAsync(w,this.options.tryPlayVideoTimeout)];case 1:return ge.sent(),[2,this.scan(w,l,U)]}})})},y.prototype.decodeOnceFromConstraints=function(c,l){return bl(this,void 0,void 0,function(){var w;return nl(this,function(U){switch(U.label){case 0:return[4,this.getUserMedia(c)];case 1:return w=U.sent(),[4,this.decodeOnceFromStream(w,l)];case 2:return[2,U.sent()]}})})},y.prototype.decodeOnceFromStream=function(c,l){return bl(this,void 0,void 0,function(){var w,U;return nl(this,function(ce){switch(ce.label){case 0:return w=!!l,[4,y.attachStreamToVideo(c,l)];case 1:U=ce.sent(),ce.label=2;case 2:return ce.trys.push([2,,4,5]),[4,this.scanOneResult(U)];case 3:return[2,ce.sent()];case 4:return w||y.cleanVideoSource(U),[7];case 5:return[2]}})})},y.prototype.decodeOnceFromVideoDevice=function(c,l){return bl(this,void 0,void 0,function(){return nl(this,function(J){switch(J.label){case 0:return[4,this.decodeOnceFromConstraints({video:c?{deviceId:{exact:c}}:{facingMode:"environment"}},l)];case 1:return[2,J.sent()]}})})},y.prototype.decodeOnceFromVideoElement=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(U){switch(U.label){case 0:if(!c)throw new vs("A video element must be provided.");return l=y.prepareVideoElement(c),[4,y.playVideoOnLoadAsync(l,this.options.tryPlayVideoTimeout)];case 1:return U.sent(),[4,this.scanOneResult(l)];case 2:return[2,U.sent()]}})})},y.prototype.decodeOnceFromVideoUrl=function(c){return bl(this,void 0,void 0,function(){var l,w;return nl(this,function(U){switch(U.label){case 0:if(!c)throw new vs("An URL must be provided.");(l=y.prepareVideoElement()).src=c,w=this.decodeOnceFromVideoElement(l),U.label=1;case 1:return U.trys.push([1,,3,4]),[4,w];case 2:return[2,U.sent()];case 3:return y.cleanVideoSource(l),[7];case 4:return[2]}})})},y.prototype.scanOneResult=function(c,l,w,U){var J=this;return void 0===l&&(l=!0),void 0===w&&(w=!0),void 0===U&&(U=!0),new Promise(function(ce,ge){J.scan(c,function(Pe,Ge,ut){if(Pe)return ce(Pe),void ut.stop();if(Ge){if(Ge instanceof Gn&&l||Ge instanceof rs&&w||Ge instanceof Qn&&U)return;ut.stop(),ge(Ge)}})})},y.prototype.scan=function(c,l,w){var U=this;y.checkCallbackFnOrThrow(l);var ce,J=y.createCaptureCanvas(c);try{ce=J.getContext("2d",{willReadFrequently:!0})}catch{ce=J.getContext("2d")}if(!ce)throw new Error("Couldn't create canvas for visual element scan.");var Ge,ge=function(){ce=void 0,J=void 0},Pe=!1,_t={stop:function(){Pe=!0,clearTimeout(Ge),ge(),w&&w()}},Ot=function(){if(!Pe)try{y.drawImageOnCanvas(ce,c);var Ht=U.decodeFromCanvas(J);l(Ht,void 0,_t),Ge=setTimeout(Ot,U.options.delayBetweenScanSuccess)}catch(dn){if(l(void 0,dn,_t),dn instanceof rs||dn instanceof Qn||dn instanceof Gn)return void(Ge=setTimeout(Ot,U.options.delayBetweenScanAttempts));ge(),w&&w(dn)}};return Ot(),_t},y.prototype._decodeOnLoadImage=function(c){return bl(this,void 0,void 0,function(){return nl(this,function(w){switch(w.label){case 0:return y.isImageLoaded(c)?[3,2]:[4,y._waitImageLoad(c)];case 1:w.sent(),w.label=2;case 2:return[2,this.decode(c)]}})})},y.prototype.getUserMedia=function(c){return bl(this,void 0,void 0,function(){var l;return nl(this,function(w){switch(w.label){case 0:return[4,navigator.mediaDevices.getUserMedia(c)];case 1:return l=w.sent(),y.streamTracker.push(l),[2,l]}})})},y.streamTracker=[],y}(),W1=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),Df=(function(y){W1(function c(l,w){return y.call(this,new We,l,w)||this},y)}(df),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),k_=(function(y){Df(function c(l,w){return y.call(this,new Ac(l),l,w)||this},y)}(df),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),Cy=(function(y){k_(function c(l,w){return y.call(this,new v0,l,w)||this},y)}(df),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),Qx=function(y){function c(l,w){var U=this,J=new iy;return J.setHints(l),(U=y.call(this,J,l,w)||this).reader=J,U}return Cy(c,y),Object.defineProperty(c.prototype,"possibleFormats",{set:function(l){this.hints.set(Ci.POSSIBLE_FORMATS,l),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),c.prototype.decodeBitmap=function(l){return this.reader.decodeWithState(l)},c.prototype.setHints=function(l){this.hints=l,this.reader.setHints(this.hints)},c}(df),qx=function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}(),tS=(function(y){qx(function c(l,w){return y.call(this,new A0,l,w)||this},y)}(df),function(){var y=function(c,l){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(w[J]=U[J])})(c,l)};return function(c,l){if("function"!=typeof l&&null!==l)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function w(){this.constructor=c}y(c,l),c.prototype=null===l?Object.create(l):(w.prototype=l.prototype,new w)}}()),Th=(function(y){tS(function c(l,w){return y.call(this,new p1,l,w)||this},y)}(df),"http://www.w3.org/2000/svg"),Ph=(function(){function y(c){if("string"==typeof c){var l=document.getElementById(c);if(!l)throw new Error("Could not find a Container element with '".concat(c,"'."));this.containerElement=l}else this.containerElement=c}y.prototype.write=function(c,l,w,U){if(0===c.length)throw new Bi("Found empty contents");if(l<0||w<0)throw new Bi("Requested dimensions are too small: "+l+"x"+w);var J=U&&void 0!==U.get(ss.MARGIN)?Number.parseInt(U.get(ss.MARGIN).toString(),10):y.QUIET_ZONE_SIZE,ce=this.encode(U,c);return this.renderResult(ce,l,w,J)},y.prototype.createSVGElement=function(c,l){var w=document.createElementNS(y.SVG_NS,"svg");return w.setAttributeNS(Th,"width",l.toString()),w.setAttributeNS(Th,"height",c.toString()),w},y.prototype.createSvgPathPlaceholderElement=function(c,l){var w=document.createElementNS(y.SVG_NS,"path");return w.setAttributeNS(Th,"d","M0 0h".concat(c,"v").concat(l,"H0z")),w.setAttributeNS(Th,"fill","none"),w},y.prototype.createSvgRectElement=function(c,l,w,U){var J=document.createElementNS(y.SVG_NS,"rect");return J.setAttributeNS(Th,"x",c.toString()),J.setAttributeNS(Th,"y",l.toString()),J.setAttributeNS(Th,"height",w.toString()),J.setAttributeNS(Th,"width",U.toString()),J.setAttributeNS(Th,"fill","#000000"),J},y.prototype.encode=function(c,l){var w=Sl.L;if(c&&void 0!==c.get(ss.ERROR_CORRECTION)){var U=c.get(ss.ERROR_CORRECTION).toString();w=Sl.fromString(U)}return I0.encode(l,w,c)},y.prototype.renderResult=function(c,l,w,U){var J=c.getMatrix();if(null===J)throw new ou;var ce=J.getWidth(),ge=J.getHeight(),Pe=ce+2*U,Ge=ge+2*U,ut=Math.max(l,Pe),_t=Math.max(w,Ge),Ot=Math.min(Math.floor(ut/Pe),Math.floor(_t/Ge)),Ht=Math.floor((ut-ce*Ot)/2),Sr=Math.floor((_t-ge*Ot)/2),jr=this.createSVGElement(ut,_t),sn=this.createSvgPathPlaceholderElement(l,w);jr.appendChild(sn),this.containerElement.appendChild(jr);for(var dn=0,ln=Sr;dn{if(!ge)return void U.next({result:ce});const Pe=ge.name;Pe===Gn.name||Pe===rs.name||Pe===Qn.name||ge.message.includes("No MultiFormat Readers were able to detect the code.")?U.next({error:ge}):(U.error(ge),w.scannerControls.stop(),w.scannerControls=void 0)}),w.scannerControls={...J,stop(){J.stop(),U.complete()}}}catch(ce){U.error(ce),w.scannerControls?.stop(),w.scannerControls=void 0}return U.asObservable()})()}}let Dy=(()=>{class y{get codeReader(){return this._codeReader}set device(l){this._ready?this.isAutostarting?console.warn("Avoid setting a device during auto-start."):this.isCurrentDevice(l)?console.warn("Setting the same device is not allowed."):this.hasPermission?this.setDevice(l):console.warn("Permissions not set yet, waiting for them to be set to apply device change."):this._devicePreStart=l}get device(){return this._device}get formats(){return this.hints.get(Ci.POSSIBLE_FORMATS)}set formats(l){if("string"==typeof l)throw new Error("Invalid formats, make sure the [formats] input is a binding.");const w=l.map(J=>this.getBarcodeFormatOrFail(J)),U=this.hints;U.set(Ci.POSSIBLE_FORMATS,w),this.hints=U}get hints(){return this._hints}set hints(l){this._hints=l,this.codeReader?.setHints(this._hints)}set videoConstraints(l){const w=this.codeReader?.getScannerControls();w&&w?.streamVideoConstraintsApply(l)}set isAutostarting(l){this._isAutostarting=l,this.autostarting.next(l)}get isAutostarting(){return this._isAutostarting}set torch(l){try{this.getCodeReader().getScannerControls().switchTorch(l)}catch{}}set enable(l){this._enabled!==!!l&&(this._enabled=!!l,this._enabled?this.device?this.scanFromDevice(this.device.deviceId):this.init():(this.reset(),G1.releaseAllStreams()))}get enabled(){return this._enabled}get tryHarder(){return this.hints.get(Ci.TRY_HARDER)}set tryHarder(l){const w=this.hints;l?w.set(Ci.TRY_HARDER,!0):w.delete(Ci.TRY_HARDER),this.hints=w}constructor(){this.timeBetweenScans=500,this.delayBetweenScanSuccess=500,this.previewFitMode="cover",this.poster="",this._ready=!1,this.autostarted=new a.bkB,this.autostarting=new a.bkB,this.torchCompatible=new a.bkB(!1),this.scanSuccess=new a.bkB,this.scanFailure=new a.bkB,this.scanError=new a.bkB,this.scanComplete=new a.bkB,this.camerasFound=new a.bkB,this.camerasNotFound=new a.bkB,this.permissionResponse=new a.bkB(!0),this.hasDevices=new a.bkB,this.deviceChange=new a.bkB,this._enabled=!0,this._hints=new Map,this.autofocusEnabled=!0,this.autostart=!0,this.formats=[Co.QR_CODE],this.hasNavigator=typeof navigator<"u",this.isMediaDevicesSupported=this.hasNavigator&&!!navigator.mediaDevices}askForPermission(){var l=this;return(0,B.A)(function*(){if(!l.hasNavigator)return console.error("@zxing/ngx-scanner","Can't ask permission, navigator is not present."),l.setPermission(null),l.hasPermission;if(!l.isMediaDevicesSupported)return console.error("@zxing/ngx-scanner","Can't get user media, this is not supported."),l.setPermission(null),l.hasPermission;let w,U;try{w=yield l.getAnyVideoDevice(),U=!!w}catch(J){return l.handlePermissionException(J)}finally{l.terminateStream(w)}return l.setPermission(U),U})()}getAnyVideoDevice(){return navigator.mediaDevices.getUserMedia({video:!0})}terminateStream(l){l&&l.getTracks().forEach(w=>w.stop()),l=void 0}init(){var l=this;return(0,B.A)(function*(){if(!l.autostart)return console.warn("Feature 'autostart' disabled. Permissions and devices recovery has to be run manually."),l.initAutostartOff(),void(l._ready=!0);yield l.initAutostartOn(),l._ready=!0})()}initAutostartOff(){this.isAutostarting=!1,this.updateVideoInputDevices(),this._device&&this._devicePreStart&&this.setDevice(this._devicePreStart)}initAutostartOn(){var l=this;return(0,B.A)(function*(){let w;l.isAutostarting=!0;try{w=yield l.askForPermission()}catch(U){return void console.error("Exception occurred while asking for permission:",U)}if(w){const U=yield l.updateVideoInputDevices();yield l.autostartScanner([...U])}l.isAutostarting=!1,l.autostarted.next()})()}isCurrentDevice(l){return l?.deviceId===this._device?.deviceId}ngOnDestroy(){this.reset(),df.cleanVideoSource(this.previewElemRef.nativeElement),G1.releaseAllStreams()}ngOnInit(){this.init()}scanStop(){this._scanSubscription&&(this.codeReader?.getScannerControls().stop(),this._scanSubscription?.unsubscribe(),this._scanSubscription=void 0)}scanStart(){if(this._scanSubscription)throw new Error("There is already a scan process running.");if(!this._device)throw new Error("No device defined, cannot start scan, please define a device.");this.scanFromDevice(this._device.deviceId)}restart(){this._codeReader=void 0;const l=this._reset();l&&(this.device=l)}updateVideoInputDevices(){var l=this;return(0,B.A)(function*(){const w=(yield df.listVideoInputDevices())||[],U=w&&w.length>0;return l.hasDevices.next(U),l.camerasFound.next([...w]),U||l.camerasNotFound.next(null),w})()}autostartScanner(l){var w=this;return(0,B.A)(function*(){const J=l.find(({label:ce})=>/back|tr\xe1s|rear|traseira|environment|ambiente/gi.test(ce))||l.pop();if(!J)throw new Error("Impossible to autostart, no input devices available.");yield w.setDevice(J),w.deviceChange.next(J)})()}dispatchScanSuccess(l){this.scanSuccess.next(l.getText())}dispatchScanFailure(l){this.scanFailure.next(l)}dispatchScanError(l){this.scanError.observed||(console.error(`zxing scanner component: ${l.name}`,l),console.warn("Use the `(scanError)` property to handle errors like this!")),this.scanError.next(l)}dispatchScanComplete(l){this.scanComplete.next(l)}handlePermissionException(l){let w;switch(console.error("@zxing/ngx-scanner","Error when asking for permission.",l),l.name){case"NotSupportedError":console.warn("@zxing/ngx-scanner",l.message),w=null,this.hasDevices.next(null);break;case"NotAllowedError":console.warn("@zxing/ngx-scanner",l.message),w=!1,this.hasDevices.next(!0);break;case"NotFoundError":console.warn("@zxing/ngx-scanner",l.message),w=null,this.hasDevices.next(!1),this.camerasNotFound.next(l);break;case"NotReadableError":console.warn("@zxing/ngx-scanner","Couldn't read the device(s)'s stream, it's probably in use by another app."),w=null,this.hasDevices.next(!1),this.camerasNotFound.next(l);break;default:console.warn("@zxing/ngx-scanner","I was not able to define if I have permissions for camera or not.",l),w=null}return this.setPermission(w),this.permissionResponse.error(l),w}getBarcodeFormatOrFail(l){return"string"==typeof l?Co[l.trim().toUpperCase()]:l}getCodeReader(){return this._codeReader||(this._codeReader=new G1(this.hints,{delayBetweenScanAttempts:this.timeBetweenScans,delayBetweenScanSuccess:this.delayBetweenScanSuccess})),this._codeReader}scanFromDevice(l){var w=this;return(0,B.A)(function*(){const U=w.previewElemRef.nativeElement,J=w.getCodeReader(),ce=yield J.scanFromDeviceObservable(l,U);if(!ce)throw new Error("Undefined decoding stream, aborting.");if(w._scanSubscription=ce.subscribe(Ot=>w._onDecodeResult(Ot.result,Ot.error),Ot=>w._onDecodeError(Ot),()=>{}),w._scanSubscription.closed)return;const _t=typeof J.getScannerControls().switchTorch<"u";w.torchCompatible.next(_t)})()}_onDecodeError(l){this.dispatchScanError(l)}_onDecodeResult(l,w){l?this.dispatchScanSuccess(l):this.dispatchScanFailure(w),this.dispatchScanComplete(l)}_reset(){if(!this._codeReader)return;this.scanStop();try{df.cleanVideoSource(this.previewElemRef.nativeElement)}catch{}try{df.releaseAllStreams()}catch{}this._codeReader=void 0;const l=this._device;return this.device=void 0,l}reset(){this._reset(),this.deviceChange.emit(null)}setDevice(l){var w=this;return(0,B.A)(function*(){w.scanStop(),w._device=l||void 0,w._device||df.cleanVideoSource(w.previewElemRef.nativeElement),w._enabled&&l&&(yield w.scanFromDevice(l.deviceId))})()}setPermission(l){this.hasPermission=l,this.permissionResponse.next(l)}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["zxing-scanner"]],viewQuery:function(w,U){if(1&w&&a.GBs(lp,7),2&w){let J;a.mGM(J=a.lsd())&&(U.previewElemRef=J.first)}},inputs:{autofocusEnabled:"autofocusEnabled",timeBetweenScans:"timeBetweenScans",delayBetweenScanSuccess:"delayBetweenScanSuccess",autostart:"autostart",previewFitMode:"previewFitMode",poster:"poster",device:"device",formats:"formats",videoConstraints:"videoConstraints",torch:"torch",enable:"enable",tryHarder:"tryHarder"},outputs:{autostarted:"autostarted",autostarting:"autostarting",torchCompatible:"torchCompatible",scanSuccess:"scanSuccess",scanFailure:"scanFailure",scanError:"scanError",scanComplete:"scanComplete",camerasFound:"camerasFound",camerasNotFound:"camerasNotFound",permissionResponse:"permissionResponse",hasDevices:"hasDevices",deviceChange:"deviceChange"},decls:6,vars:3,consts:[["preview",""],[3,"poster"]],template:function(w,U){1&w&&(a.j41(0,"video",1,0)(2,"p"),a.EFF(3," Your browser does not support this feature, please try to upgrade it. "),a.k0s(),a.j41(4,"p"),a.EFF(5," Seu navegador n\xe3o suporta este recurso, por favor tente atualiz\xe1-lo. "),a.k0s()()),2&w&&(a.xc7("object-fit",U.previewFitMode),a.Y8G("poster",U.poster,a.B4B))},styles:["[_nghost-%COMP%]{display:block}video[_ngcontent-%COMP%]{width:100%;height:auto;object-fit:contain}"],changeDetection:0})}}return y})(),nS=(()=>{class y{static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275mod=a.$C({type:y})}static{this.\u0275inj=a.G2t({imports:[R.MD,M.YN]})}}return y})(),SD=(()=>{class y{constructor(l,w){this.data=l,this.dialogRef=w}ngAfterViewInit(){}scanSuccessHandler(l){console.log("Scan success:",l),this.dialogRef.close(l)}scanErrorHandler(l){console.log("Scan success:",l)}scanFailureHandler(l){console.log("Scan success:",l)}scanCompleteHandler(l){console.log("Scan success:",l)}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(j.Vh),a.rXU(j.CP))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-qrcode-scan-dialog"]],standalone:!0,features:[a.aNF],decls:7,vars:0,consts:[["mat-dialog-title",""],[1,"qr-scanner",3,"scanSuccess","scanError","scanFailure","scanComplete"],["mat-flat-button","","mat-dialog-close","","cdkFocusInitial",""]],template:function(w,U){1&w&&(a.j41(0,"h2",0),a.EFF(1,"Scan QR Code"),a.k0s(),a.j41(2,"mat-dialog-content")(3,"zxing-scanner",1),a.bIt("scanSuccess",function(ce){return U.scanSuccessHandler(ce)})("scanError",function(ce){return U.scanErrorHandler(ce)})("scanFailure",function(ce){return U.scanFailureHandler(ce)})("scanComplete",function(ce){return U.scanCompleteHandler(ce)}),a.k0s()(),a.j41(4,"mat-dialog-actions")(5,"button",2),a.EFF(6,"Close"),a.k0s()())},dependencies:[nS,Dy,j.hM,j.tx,j.BI,j.E7,j.Yi,_.Hl,_.$z],styles:["[_nghost-%COMP%]{width:100vw;height:100vh}[_nghost-%COMP%] zxing-scanner[_ngcontent-%COMP%] {object-fit:contain}"]})}}return y})();var AD=f(82546),CD=f(63528),N_=f(43881);let X1=(()=>{class y{constructor(){}transform(l,...w){return l?y.time(l):"00:00:00"}static time(l){var w=Math.floor(l/60/60),U=Math.floor(l/60)-60*w,J=l%60;return w.toString().padStart(2,"0")+":"+U.toString().padStart(2,"0")+":"+J.toString().padStart(2,"0")}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275pipe=a.EJ8({name:"time",type:y,pure:!0,standalone:!0})}}return y})();const AM=y=>({miniplayer:y});function CM(y,c){if(1&y&&(a.j41(0,"div",1),a.EFF(1),a.k0s()),2&y){const l=a.XpG();a.R7$(),a.JRh(l.player.title())}}function j0(y,c){if(1&y){const l=a.RV6();a.j41(0,"div")(1,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.player.play())}),a.j41(2,"mat-icon"),a.EFF(3,"play_arrow"),a.k0s()()()}}function DM(y,c){if(1&y){const l=a.RV6();a.j41(0,"div")(1,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.player.pause())}),a.j41(2,"mat-icon"),a.EFF(3,"pause"),a.k0s()()()}}function IM(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",6)(1,"div",8),a.EFF(2),a.nI1(3,"time"),a.k0s(),a.j41(4,"div",9)(5,"mat-slider",10)(6,"input",11),a.mxI("ngModelChange",function(U){a.eBV(l);const J=a.XpG();return a.DH7(J.player.time,U)||(J.player.time=U),a.Njj(U)}),a.k0s()()(),a.j41(7,"div",12),a.EFF(8),a.nI1(9,"time"),a.k0s()()}if(2&y){const l=a.XpG();a.R7$(2),a.JRh(a.bMT(3,7,l.player.time)),a.R7$(3),a.Y8G("displayWith",l.formatLabel)("max",l.player.duration)("min",0)("step",1),a.R7$(),a.R50("ngModel",l.player.time),a.R7$(2),a.JRh(a.bMT(9,9,l.player.duration))}}function iS(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",7)(1,"div")(2,"button",13)(3,"mat-icon"),a.EFF(4,"queue"),a.k0s()()(),a.j41(5,"div")(6,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.closeTray())}),a.j41(7,"mat-icon"),a.EFF(8,"close"),a.k0s()()()()}}let L_=(()=>{class y{constructor(l,w){this.renderer=l,this.el=w,this.miniplayer=!1,this.layout=(0,a.WQX)(S.Y),this.player=(0,a.WQX)(CD.x)}formatLabel(l){return X1.time(l)}closeTray(){this.layout.tray.set(!1)}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(a.sFG),a.rXU(a.aKT))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-player-controls"]],inputs:{miniplayer:"miniplayer"},standalone:!0,features:[a.aNF],decls:16,vars:7,consts:[[1,"player",3,"ngClass"],[1,"player-media"],[1,"player-controls"],[1,"player-controls-top"],["mat-icon-button","",1,"nodrag",3,"click"],["mat-icon-button","",3,"click"],[1,"player-controls-bottom"],[1,"player-actions"],[1,"media-timeline-1","hide-small2"],[1,"media-timeline-2"],["discrete","",1,"media-slider",3,"displayWith","max","min","step"],["matSliderThumb","",3,"ngModelChange","ngModel"],[1,"media-timeline-3","hide-small2"],["mat-icon-button",""]],template:function(w,U){1&w&&(a.j41(0,"div",0),a.DNE(1,CM,2,1,"div",1),a.j41(2,"div",2)(3,"div",3)(4,"div")(5,"button",4),a.bIt("click",function(){return U.player.previous()}),a.j41(6,"mat-icon"),a.EFF(7,"skip_previous"),a.k0s()()(),a.DNE(8,j0,4,0,"div")(9,DM,4,0,"div"),a.j41(10,"div")(11,"button",5),a.bIt("click",function(){return U.player.next()}),a.j41(12,"mat-icon"),a.EFF(13,"skip_next"),a.k0s()()()(),a.DNE(14,IM,10,11,"div",6),a.k0s(),a.DNE(15,iS,9,0,"div",7),a.k0s()),2&w&&(a.Y8G("ngClass",a.eq3(5,AM,U.miniplayer)),a.R7$(),a.vxM(U.miniplayer?-1:1),a.R7$(7),a.vxM(U.player.paused?8:9),a.R7$(6),a.vxM(U.miniplayer?-1:14),a.R7$(),a.vxM(U.miniplayer?-1:15))},dependencies:[X1,_.Hl,_.iY,P.m_,P.An,R.MD,R.YU,N_.Ez,N_.IV,N_.OU,k.fS,M.YN,M.me,M.BC,M.vS],styles:[".player[_ngcontent-%COMP%]{display:flex;flex-direction:row;padding:1em}.miniplayer[_ngcontent-%COMP%]{padding:0;margin:-4px;-webkit-app-region:drag}.player-media[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1 1 25%;align-items:center}.player-controls[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 50%;justify-content:center}.player-actions[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1 1 25%;justify-content:flex-end;align-items:center}.smaller[_ngcontent-%COMP%]{font-size:.8em}.player-controls-top[_ngcontent-%COMP%]{display:flex;justify-content:center}.player-controls-bottom[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;font-size:.8em}"]})}}return y})();var va=f(51889),oS=f(43794),Iy=f(59564),My=f(71997);const Lm=["*"],j_=y=>({"title-bar-collapsed":y}),Z1=y=>({"sidenav-collapsed":y}),U_=()=>["/introduction"],up=()=>["/settings","notifications"],U0=y=>["/profile",y],pl=y=>["/profile",y,"edit"],Eu=()=>["/notifications"],wd=()=>["/settings"],Ty=()=>["/accounts"],jo=()=>["/account/create"],Qa=y=>({"sidenav-scroll-wrapper-tray":y}),Py=(y,c,l)=>({"sidenav-content":y,"sidenav-content-marginless":c,"sidenav-content-custom":l}),Ca=()=>["/admin"];function $0(y,c){1&y&&a.nrm(0,"img",15)}function V0(y,c){1&y&&a.EFF(0," Admin ")}function DD(y,c){if(1&y&&(a.j41(0,"a",16,5)(2,"mat-icon",18),a.EFF(3,"admin_panel_settings"),a.k0s(),a.DNE(4,V0,1,0),a.k0s()),2&y){const l=a.sdS(1),w=a.XpG();a.Y8G("routerLink",a.lJ4(3,Ca))("activated",l.isActive),a.R7$(4),a.vxM(w.collapsed()?-1:4)}}function Oy(y,c){if(1&y&&a.EFF(0),2&y){const l=a.XpG().$implicit;a.SpI(" ",l.title," ")}}function Ry(y,c){if(1&y&&(a.j41(0,"a",16,5)(2,"mat-icon",18),a.EFF(3),a.k0s(),a.DNE(4,Oy,1,1),a.k0s()),2&y){const l=c.$implicit,w=a.sdS(1),U=a.XpG();a.Y8G("routerLink",l.path)("activated",w.isActive),a.R7$(3),a.JRh(l.data.icon),a.R7$(),a.vxM(U.collapsed()?-1:4)}}function ky(y,c){1&y&&(a.j41(0,"mat-icon",18),a.EFF(1,"chevron_right"),a.k0s())}function Y1(y,c){1&y&&(a.j41(0,"mat-icon",18),a.EFF(1,"chevron_left"),a.k0s())}function z0(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",46),a.bIt("click",function(){a.eBV(l),a.XpG();const U=a.sdS(5);return a.Njj(U.toggle())}),a.j41(1,"mat-icon",47),a.EFF(2,"menu"),a.k0s()()}}function K0(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",26),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.navigateBack())}),a.j41(1,"mat-icon"),a.EFF(2,"arrow_back"),a.k0s()()}}function $_(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",48),a.bIt("click",function(){const U=a.eBV(l).$implicit;return a.Njj(U.action())}),a.j41(1,"mat-icon"),a.EFF(2),a.k0s()()}if(2&y){const l=c.$implicit;a.Y8G("title",l.name),a.R7$(2),a.JRh(l.icon)}}function By(y,c){if(1&y){const l=a.RV6();a.j41(0,"input",49),a.mxI("ngModelChange",function(U){a.eBV(l);const J=a.XpG();return a.DH7(J.layout.searchInput,U)||(J.layout.searchInput=U),a.Njj(U)}),a.bIt("input",function(U){a.eBV(l);const J=a.XpG();return a.Njj(J.onSearchInput(U))}),a.k0s()}if(2&y){const l=a.XpG();a.R50("ngModel",l.layout.searchInput)}}function H0(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",26),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.qrScan())}),a.j41(1,"mat-icon"),a.EFF(2,"qr_code_scanner"),a.k0s()()}}function Fy(y,c){1&y&&(a.j41(0,"mat-icon"),a.EFF(1,"close"),a.k0s())}function Up(y,c){1&y&&(a.j41(0,"mat-icon"),a.EFF(1,"search"),a.k0s())}function V_(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",50),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.applyUpdate())}),a.j41(1,"mat-icon"),a.EFF(2,"get_app"),a.k0s()()}}function sS(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",51),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.installPWA())}),a.j41(1,"mat-icon"),a.EFF(2,"install_mobile"),a.k0s()()}2&y&&a.Y8G("matTooltip","Install App")}function aS(y,c){if(1&y&&(a.j41(0,"button",31)(1,"mat-icon"),a.EFF(2),a.k0s(),a.j41(3,"span"),a.EFF(4),a.k0s(),a.j41(5,"div",52),a.EFF(6),a.nI1(7,"ago"),a.k0s()()),2&y){const l=c.$implicit;a.Y8G("routerLink",a.lJ4(7,Eu)),a.R7$(2),a.JRh(l.data.icon),a.R7$(2),a.JRh(l.data.title),a.R7$(2),a.Lme("",l.data.app," (",a.bMT(7,5,"2024-08-22 12:00"),")")}}function cS(y,c){if(1&y&&(a.j41(0,"button",32),a.nrm(1,"img",53),a.nI1(2,"safeResourceUrl"),a.k0s()),2&y){const l=a.XpG(),w=a.sdS(59);a.Y8G("matMenuTriggerFor",w),a.R7$(),a.Y8G("src",a.bMT(2,2,l.profileService.avatar()),a.B4B)}}function z_(y,c){if(1&y&&(a.j41(0,"button",33)(1,"mat-icon"),a.EFF(2,"account_circle"),a.k0s()()),2&y){a.XpG();const l=a.sdS(59);a.Y8G("matMenuTriggerFor",l)}}function W0(y,c){if(1&y&&(a.EFF(0),a.nrm(1,"br")),2&y){const l=a.XpG(2);a.SpI(" ",l.identity.identity.metadata.name,"")}}function jm(y,c){if(1&y&&(a.j41(0,"h2"),a.EFF(1),a.k0s(),a.EFF(2),a.nrm(3,"br"),a.EFF(4),a.nI1(5,"did"),a.nrm(6,"br"),a.DNE(7,W0,2,1,"br")),2&y){const l=a.XpG();a.R7$(),a.JRh(l.profileService.current().name),a.R7$(),a.SpI(" ",l.profileService.current().title,""),a.R7$(2),a.SpI(" ",a.bMT(5,4,l.identity.did),""),a.R7$(3),a.vxM(l.identity.identity?7:-1)}}function K_(y,c){if(1&y&&(a.EFF(0),a.nI1(1,"did")),2&y){const l=a.XpG();a.SpI(" ",a.bMT(1,1,l.identity.did)," ")}}function ID(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",54),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.installPWA())}),a.j41(1,"mat-icon"),a.EFF(2,"install_mobile"),a.k0s(),a.j41(3,"span"),a.EFF(4,"Install App"),a.k0s()()}}function MD(y,c){if(1&y&&(a.j41(0,"strong"),a.EFF(1),a.k0s()),2&y){const l=a.XpG().$implicit;a.R7$(),a.SpI("",l.metadata.name," *")}}function J1(y,c){if(1&y&&(a.j41(0,"span"),a.EFF(1),a.k0s()),2&y){const l=a.XpG().$implicit;a.R7$(),a.JRh(l.metadata.name)}}function H_(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",30),a.bIt("click",function(){const U=a.eBV(l).$implicit,J=a.XpG();return a.Njj(J.changeAccount(U.did.uri))}),a.j41(1,"mat-icon"),a.EFF(2,"account_circle"),a.k0s(),a.DNE(3,MD,2,1,"strong")(4,J1,2,1,"span"),a.k0s()}if(2&y){const l=c.$implicit,w=a.XpG();a.R7$(3),a.vxM(l.did.uri===w.identity.did?3:4)}}function $p(y,c){1&y&&(a.j41(0,"div",45),a.nrm(1,"app-player-controls"),a.k0s())}let W_=(()=>{class y{constructor(){var l=this;this.breakpointObserver=(0,a.WQX)(Fr.QP),this.localStorage=(0,a.WQX)(_i.s),this.storage=(0,a.WQX)(oS.n),this.identity=(0,a.WQX)(g.K),this.updateService=(0,a.WQX)(Io),this.profileService=(0,a.WQX)(Ma.p),this.app=(0,a.WQX)(m.d),this.layout=(0,a.WQX)(S.Y),this.admin=(0,a.WQX)(Iy.z),this.navigation=(0,a.WQX)(Tt.o),this.notification=(0,a.WQX)(AD.J),this.dialog=(0,a.WQX)(j.bZ),this.router=(0,a.WQX)(x.Ix),this.rootRoutes=he.filter(w=>w.path).filter(w=>w.data&&1!=w.data.hide),this.isHandset$=this.breakpointObserver.observe("(max-width: 700px)").pipe((0,Dt.T)(w=>w.matches),(0,bn.t)()),this.notifications=(0,a.vPA)([]),this.showInstallButton=!1,this.collapsed=(0,a.vPA)(!1),(0,a.QZP)((0,B.A)(function*(){l.app.initialized()&&(yield l.loadNotifications())}))}installPWA(){this.showInstallButton=!1,this.deferredPrompt.prompt(),this.deferredPrompt.userChoice.then(l=>{"accepted"===l.outcome?console.log("User accepted the install prompt"):console.log("User dismissed the install prompt"),this.deferredPrompt=null})}ngOnInit(){var l=this;return(0,B.A)(function*(){window.addEventListener("beforeinstallprompt",w=>{w.preventDefault(),l.deferredPrompt=w,l.showInstallButton=!0})})()}changeAccount(l){var w=this;return(0,B.A)(function*(){w.identity.changeAccount(l),w.router.navigate(["/introduction"])})()}loadNotifications(){var l=this;return(0,B.A)(function*(){const w=yield l.notification.load();l.notifications.set(w)})()}qrScan(){this.dialog.open(SD,{data:{did:""},width:"100vw",height:"100vh"}).afterClosed().subscribe(w=>{w&&(console.log("The dialog was closed",w),this.layout.toggleSearch(),this.router.navigate(["/profile",w]))})}onSearchInput(l){null!==l.target.value?(clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{console.log("Handle search called!"),this.handleSearch(l.target.value)},750)):clearTimeout(this.debounceTimer)}handleSearch(l){l&&(l.includes(":")?this.router.navigate(["/profile",l]):this.router.navigate(["/search"],{queryParams:{query:l}}))}showQR(l){this.dialog.open(va.k,{data:{did:l}})}wipe(){var l=this;return(0,B.A)(function*(){return l.app.wipe()})()}applyUpdate(){this.updateService.applyUpdate()}lock(){var l=this;return(0,B.A)(function*(){return l.app.lock()})()}navigateBack(){this.navigation.back()}collapseToggle(){this.collapsed.set(!this.collapsed())}static{this.\u0275fac=function(w){return new(w||y)}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-layout"]],standalone:!0,features:[a.aNF],ngContentSelectors:Lm,decls:142,vars:66,consts:[["drawer",""],["menuNotifications","matMenu"],["menu","matMenu"],["menuAccounts","matMenu"],["menuLanguages","matMenu"],["link","routerLinkActive"],["id","title-bar",1,"title-bar",3,"ngClass"],["height","24","width","24","src","ariton-icon-dark.svg",1,"logo-icon-title-bar"],[3,"miniplayer"],["autosize","",1,"sidenav-container"],["fixedInViewport","",1,"sidenav",3,"ngClass","mode","opened"],[1,"toolbar-logo-container"],["src","ariton-icon-dark.svg",1,"toolbar-logo",3,"routerLink"],[1,"toolbar-text"],["srcset","ariton-text-light.svg","media","(prefers-color-scheme: dark)"],["src","ariton-text-dark.svg"],["mat-list-item","","routerLinkActive","",3,"routerLink","activated"],[3,"click"],["matListItemIcon",""],[1,"main-toolbar"],["type","button","aria-label","Toggle sidenav","mat-icon-button",""],["mat-icon-button",""],["mat-icon-button","",3,"title"],[1,"toolbar-spacer"],["type","search",1,"search-input",3,"ngModel"],[1,"toolbar-items"],["mat-icon-button","",3,"click"],["matTooltip","Update available. Click to update now.","mat-icon-button",""],["mat-icon-button","",1,"notification-toolbar",3,"matTooltip"],["mat-icon-button","",1,"notification-toolbar",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"routerLink"],["mat-icon-button","",1,"toolbar-profile-button",3,"matMenuTriggerFor"],["mat-icon-button","",3,"matMenuTriggerFor"],[1,"account-menu-profile",3,"routerLink"],["onerror","this.src='/avatar-placeholder.png';this.onerror='';",1,"account-menu-profile-icon",3,"src"],["mat-menu-item","",1,"account-menu-item",3,"routerLink"],["mat-menu-item","",3,"matMenuTriggerFor"],["mat-menu-item","",1,"notification-menu"],["mat-menu-item","",1,"notification-menu",3,"routerLink"],["href","https://help.ariton.app","target","_blank","mat-menu-item",""],["mat-menu-item",""],["mat-menu-item","",3,"disabled"],[1,"sidenav-scroll-wrapper",3,"ngClass"],["id","sidenav-content",3,"ngClass"],[1,"player"],["type","button","aria-label","Toggle sidenav","mat-icon-button","",3,"click"],["aria-label","Side nav toggle icon"],["mat-icon-button","",3,"click","title"],["type","search",1,"search-input",3,"ngModelChange","input","ngModel"],["matTooltip","Update available. Click to update now.","mat-icon-button","",3,"click"],["mat-icon-button","",1,"notification-toolbar",3,"click","matTooltip"],[1,"notification-details","dimmed"],["onerror","this.src='/avatar-placeholder.png';this.onerror='';",1,"toolbar-profile-icon",3,"src"],["mat-menu-item","",1,"notification-menu",3,"click"]],template:function(w,U){if(1&w){const J=a.RV6();a.NAR(),a.j41(0,"div",6),a.nrm(1,"img",7)(2,"app-player-controls",8),a.k0s(),a.j41(3,"mat-sidenav-container",9)(4,"mat-sidenav",10,0),a.nI1(6,"async"),a.nI1(7,"async"),a.nI1(8,"async"),a.j41(9,"mat-toolbar",11),a.nrm(10,"img",12),a.j41(11,"picture",13),a.nrm(12,"source",14),a.DNE(13,$0,1,0,"img",15),a.k0s()(),a.j41(14,"mat-nav-list"),a.DNE(15,DD,5,4,"a",16),a.Z7z(16,Ry,5,4,"a",16,a.Vm6),a.j41(18,"mat-list-item",17),a.bIt("click",function(){return a.eBV(J),a.Njj(U.collapseToggle())}),a.DNE(19,ky,2,0,"mat-icon",18)(20,Y1,2,0,"mat-icon",18),a.k0s()()(),a.j41(21,"mat-sidenav-content")(22,"mat-toolbar",19),a.DNE(23,z0,3,0,"button",20),a.nI1(24,"async"),a.DNE(25,K0,3,0,"button",21),a.Z7z(26,$_,3,2,"button",22,a.fX1),a.j41(28,"span",23),a.DNE(29,By,1,1,"input",24),a.k0s(),a.j41(30,"span",25),a.DNE(31,H0,3,0,"button",21),a.j41(32,"button",26),a.bIt("click",function(){return a.eBV(J),a.Njj(U.layout.toggleSearch())}),a.DNE(33,Fy,2,0,"mat-icon")(34,Up,2,0,"mat-icon"),a.k0s(),a.DNE(35,V_,3,0,"button",27)(36,sS,3,1,"button",28),a.j41(37,"button",29)(38,"mat-icon"),a.EFF(39,"notifications"),a.k0s()(),a.j41(40,"mat-menu",null,1)(42,"button",30),a.bIt("click",function(){return a.eBV(J),a.Njj(U.wipe())}),a.j41(43,"mat-icon"),a.EFF(44,"delete"),a.k0s(),a.j41(45,"span"),a.EFF(46,"Reset All Data (Wipe)"),a.k0s()(),a.nrm(47,"mat-divider"),a.j41(48,"button",31)(49,"mat-icon"),a.EFF(50,"settings"),a.k0s(),a.j41(51,"span"),a.EFF(52,"Notification Settings"),a.k0s()(),a.nrm(53,"mat-divider"),a.Z7z(54,aS,8,8,"button",31,a.fX1),a.k0s(),a.DNE(56,cS,3,4,"button",32)(57,z_,3,1,"button",33),a.j41(58,"mat-menu",null,2)(60,"div",34),a.nrm(61,"img",35),a.nI1(62,"safeResourceUrl"),a.j41(63,"div"),a.DNE(64,jm,8,6)(65,K_,2,3),a.k0s()(),a.j41(66,"button",36)(67,"mat-icon"),a.EFF(68,"account_circle"),a.k0s(),a.j41(69,"span"),a.EFF(70,"Edit Profile"),a.k0s()(),a.j41(71,"button",30),a.bIt("click",function(){return a.eBV(J),a.Njj(U.showQR(U.identity.did))}),a.j41(72,"mat-icon"),a.EFF(73,"qr_code"),a.k0s(),a.j41(74,"span"),a.EFF(75,"Show QR"),a.k0s()(),a.nrm(76,"mat-divider"),a.j41(77,"button",37)(78,"mat-icon"),a.EFF(79,"switch_account"),a.k0s(),a.j41(80,"span"),a.EFF(81,"Accounts"),a.k0s()(),a.j41(82,"button",30),a.bIt("click",function(){return a.eBV(J),a.Njj(U.lock())}),a.j41(83,"mat-icon"),a.EFF(84,"lock"),a.k0s(),a.j41(85,"span"),a.EFF(86,"Lock account"),a.k0s()(),a.nrm(87,"mat-divider"),a.j41(88,"button",37)(89,"mat-icon"),a.EFF(90,"translate"),a.k0s(),a.j41(91,"span"),a.EFF(92,"Language: English"),a.k0s()(),a.nrm(93,"mat-divider"),a.DNE(94,ID,5,0,"button",38),a.j41(95,"button",39)(96,"mat-icon"),a.EFF(97,"notifications"),a.k0s(),a.j41(98,"span"),a.EFF(99,"Notifications"),a.k0s()(),a.j41(100,"button",31)(101,"mat-icon"),a.EFF(102,"settings"),a.k0s(),a.j41(103,"span"),a.EFF(104,"Settings"),a.k0s()(),a.nrm(105,"mat-divider"),a.j41(106,"a",40)(107,"mat-icon"),a.EFF(108,"help"),a.k0s(),a.j41(109,"span"),a.EFF(110,"Help"),a.k0s()()(),a.j41(111,"mat-menu",null,3)(113,"button",31)(114,"mat-icon"),a.EFF(115,"manage_accounts"),a.k0s(),a.j41(116,"span"),a.EFF(117,"Manage"),a.k0s()(),a.nrm(118,"mat-divider"),a.Z7z(119,H_,5,1,"button",41,a.fX1),a.nrm(121,"mat-divider"),a.j41(122,"button",31)(123,"mat-icon"),a.EFF(124,"person_add"),a.k0s(),a.j41(125,"span"),a.EFF(126,"Add account"),a.k0s()()(),a.j41(127,"mat-menu",null,4)(129,"button",41)(130,"span"),a.EFF(131,"English"),a.k0s()(),a.j41(132,"button",42)(133,"span"),a.EFF(134,"Norwegian"),a.k0s()(),a.j41(135,"button",42)(136,"span"),a.EFF(137,"Serbian"),a.k0s()()()()(),a.j41(138,"div",43)(139,"div",44),a.SdG(140),a.k0s()(),a.DNE(141,$p,2,0,"div",45),a.k0s()()}if(2&w){const J=a.sdS(41),ce=a.sdS(112),ge=a.sdS(128);a.Y8G("ngClass",a.eq3(46,j_,U.collapsed())),a.R7$(2),a.Y8G("miniplayer",!0),a.R7$(2),a.Y8G("ngClass",a.eq3(48,Z1,U.collapsed()))("mode",a.bMT(6,36,U.isHandset$)?"over":"side")("opened",!1===a.bMT(7,38,U.isHandset$)),a.BMQ("role",a.bMT(8,40,U.isHandset$)?"dialog":"navigation"),a.R7$(6),a.Y8G("routerLink",a.lJ4(50,U_)),a.R7$(3),a.vxM(U.collapsed()?-1:13),a.R7$(2),a.vxM(U.admin.isAdmin(U.identity.did)?15:-1),a.R7$(),a.Dyx(U.rootRoutes),a.R7$(3),a.vxM(U.collapsed()?19:20),a.R7$(4),a.vxM(a.bMT(24,42,U.isHandset$)?23:-1),a.R7$(2),a.vxM(U.layout.navigation()?25:-1),a.R7$(),a.Dyx(U.layout.actions()),a.R7$(3),a.vxM(U.layout.search()?29:-1),a.R7$(2),a.vxM(U.layout.search()?31:-1),a.R7$(2),a.vxM(U.layout.search()?33:34),a.R7$(2),a.vxM(U.updateService.isNewVersionAvailable?35:-1),a.R7$(),a.vxM(U.showInstallButton?36:-1),a.R7$(),a.Y8G("matMenuTriggerFor",J),a.R7$(11),a.Y8G("routerLink",a.lJ4(51,up)),a.R7$(6),a.Dyx(U.notifications()),a.R7$(2),a.vxM(U.profileService.avatar()?56:57),a.R7$(4),a.Y8G("routerLink",a.eq3(52,U0,U.identity.did)),a.R7$(),a.Y8G("src",a.bMT(62,44,U.profileService.avatar()),a.B4B),a.R7$(3),a.vxM(U.profileService.current()?64:65),a.R7$(2),a.Y8G("routerLink",a.eq3(54,pl,U.identity.did)),a.R7$(11),a.Y8G("matMenuTriggerFor",ce),a.R7$(11),a.Y8G("matMenuTriggerFor",ge),a.R7$(6),a.vxM(U.showInstallButton?94:-1),a.R7$(),a.Y8G("routerLink",a.lJ4(56,Eu)),a.R7$(5),a.Y8G("routerLink",a.lJ4(57,wd)),a.R7$(13),a.Y8G("routerLink",a.lJ4(58,Ty)),a.R7$(6),a.Dyx(U.identity.identities),a.R7$(3),a.Y8G("routerLink",a.lJ4(59,jo)),a.R7$(10),a.Y8G("disabled",!0),a.R7$(3),a.Y8G("disabled",!0),a.R7$(3),a.Y8G("ngClass",a.eq3(60,Qa,U.layout.tray())),a.R7$(),a.Y8G("ngClass",a.sMw(62,Py,U.layout.margin(),!U.layout.margin(),U.layout.custom())),a.R7$(2),a.vxM(U.layout.tray()?141:-1)}},dependencies:[j.hM,nS,M.YN,M.me,M.BC,M.vS,V.RG,k.fS,R.MD,R.YU,R.Jj,Os.d,Qe.s5,Qe.KQ,_.Hl,_.iY,pn,hr,Or,Jt,q.Fg,q._L,q.YE,q.ZV,My.q,P.m_,P.An,z.Cn,z.kk,z.fb,z.Cp,x.Wk,x.wQ,W.uc,W.oV,Mo.k,re.g,L_],styles:[".toolbar-logo[_ngcontent-%COMP%]{max-height:40px;max-width:40px;width:100%;cursor:pointer}.player[_ngcontent-%COMP%]{height:96px}.account-menu-profile[_ngcontent-%COMP%]{color:var(--mat-menu-item-label-text-color);display:flex;gap:8px;margin:8px;align-items:center;cursor:pointer}.account-menu-profile[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;padding:0}.account-menu-profile-icon[_ngcontent-%COMP%]{width:64px;border-radius:50%}.toolbar-profile-button[_ngcontent-%COMP%]{padding:0}.toolbar-profile-icon[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:50%}.account-menu-profile[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex-grow:2}.toolbar-text[_ngcontent-%COMP%]{margin-left:.3em;margin-top:.5em;width:100px;height:32px}.sidenav-container[_ngcontent-%COMP%]{height:100%}.mat-toolbar.mat-primary[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1}.sidenav-scroll-wrapper[_ngcontent-%COMP%]{height:calc(100dvh - 80px - env(titlebar-area-height,0px));overflow:auto;border-radius:16px;box-sizing:border-box}.sidenav-scroll-wrapper-tray[_ngcontent-%COMP%]{height:calc(100dvh - 192px - env(titlebar-area-height,0px))}.sidenav-content[_ngcontent-%COMP%], .sidenav-content-marginless[_ngcontent-%COMP%]{max-height:100%;overflow-y:auto;padding:16px;box-sizing:border-box}.sidenav-content-marginless[_ngcontent-%COMP%]{padding:0}.sidenav-content-custom[_ngcontent-%COMP%]{height:100%;overflow:hidden!important}.column-content[_ngcontent-%COMP%]{overflow-y:scroll;box-sizing:border-box}.sidenav[_ngcontent-%COMP%]{width:200px;padding:0 8px;box-sizing:border-box}.sidenav-collapsed[_ngcontent-%COMP%]{width:72px}@media (max-width: 959.98px){.sidenav-scroll-wrapper[_ngcontent-%COMP%]{height:calc(100dvh - 64px - env(titlebar-area-height,0px))}.sidenav-scroll-wrapper-tray[_ngcontent-%COMP%]{height:calc(100dvh - 160px - env(titlebar-area-height,0px))}.sidenav-content[_ngcontent-%COMP%]{padding:8px}.sidenav-content-marginless[_ngcontent-%COMP%]{padding:0}}.notification-menu[_ngcontent-%COMP%]{display:none}@media (max-width: 420px){.notification-toolbar[_ngcontent-%COMP%]{display:none}.notification-menu[_ngcontent-%COMP%]{display:flex}}.title-bar[_ngcontent-%COMP%]{display:none}@media (display-mode: window-controls-overlay){.title-bar[_ngcontent-%COMP%]{-webkit-app-region:drag;flex:0 0 33px;display:flex;flex-direction:row;position:fixed;left:210px;top:env(titlebar-area-y,0);height:env(titlebar-area-height,33px);width:env(titlebar-area-width,100%);width:calc(env(titlebar-area-width,100%) - 210px);z-index:10000}mat-sidenav-content[_ngcontent-%COMP%]{padding-top:env(titlebar-area-height,0px)}}.title-bar-collapsed[_ngcontent-%COMP%]{left:80px!important;width:calc(env(titlebar-area-width,100%) - 80px)}.toolbar-logo-container[_ngcontent-%COMP%]{-webkit-app-region:drag}.logo-icon[_ngcontent-%COMP%]{cursor:pointer;-webkit-app-region:drag;margin-right:.4em}.logo-icon-title-bar[_ngcontent-%COMP%]{cursor:pointer;-webkit-app-region:drag;margin:4px 2em 4px 4px;display:none;flex:0 0 24px}@media screen and (max-height: 100px){.logo-icon-title-bar[_ngcontent-%COMP%]{display:inline}.logo-icon[_ngcontent-%COMP%]{display:none}.title-bar[_ngcontent-%COMP%]{left:0!important}.sidenav[_ngcontent-%COMP%], .main-toolbar[_ngcontent-%COMP%], mat-sidenav-content[_ngcontent-%COMP%]{display:none!important}}@media screen and (max-width: 599px){.logo-icon-title-bar[_ngcontent-%COMP%]{display:inline}}"]})}}return y})();var G0=f(9183);function Q1(y,c){1&y&&a.nrm(0,"mat-spinner",4)}function lS(y,c){1&y&&(a.j41(0,"span"),a.EFF(1,"Unlock"),a.k0s())}function q1(y,c){1&y&&(a.j41(0,"mat-error"),a.EFF(1,"Password is "),a.j41(2,"strong"),a.EFF(3,"invalid"),a.k0s()())}let G_=(()=>{class y{constructor(l){this.identityService=l,this.passwordInput=new M.MJ("",M.k0.required),this.unlocking=(0,a.vPA)(!1),this.invalidPassword=(0,a.vPA)(!1)}onSubmit(){var l=this;return(0,B.A)(function*(){l.unlocking.set(!0),l.passwordInput.disable(),(yield l.identityService.unlock(l.identityService.did,l.passwordInput.value))?(console.log("Vault unlocked"),l.invalidPassword.set(!1)):(console.log("Failed to unlock vault"),l.invalidPassword.set(!0),l.unlocking.set(!1),l.passwordInput.enable())})()}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(g.K))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-unlock"]],standalone:!0,features:[a.aNF],decls:18,vars:4,consts:[["src","ariton-icon-dark.svg",1,"unlock-logo"],[3,"ngSubmit"],["matInput","","type","password",3,"formControl"],["mat-flat-button","","type","submit","color","primary",3,"disabled"],["diameter","20"]],template:function(w,U){1&w&&(a.nrm(0,"img",0),a.j41(1,"h1"),a.EFF(2,"Unlock your account"),a.k0s(),a.j41(3,"p"),a.EFF(4," You have configured your Ariton account with a secure personal password."),a.nrm(5,"br"),a.EFF(6,"Enter password to unlock your account.\n"),a.k0s(),a.j41(7,"form",1),a.bIt("ngSubmit",function(){return U.onSubmit()}),a.j41(8,"mat-form-field")(9,"mat-label"),a.EFF(10,"Enter your password"),a.k0s(),a.nrm(11,"input",2),a.k0s(),a.EFF(12," \xa0 "),a.j41(13,"button",3),a.DNE(14,Q1,1,0,"mat-spinner",4)(15,lS,2,0,"span"),a.k0s(),a.j41(16,"p"),a.DNE(17,q1,4,0,"mat-error"),a.k0s()()),2&w&&(a.R7$(11),a.Y8G("formControl",U.passwordInput),a.R7$(2),a.Y8G("disabled",!(U.passwordInput.valid&&!U.unlocking())),a.R7$(),a.vxM(U.unlocking()?14:15),a.R7$(3),a.vxM(U.invalidPassword()?17:-1))},dependencies:[M.YN,M.qT,M.me,M.BC,M.cb,M.cV,G0.D6,G0.LG,M.X1,M.l_,V.RG,V.rl,V.nJ,V.TL,k.fS,k.fg,_.Hl,_.$z,P.m_],styles:["button[_ngcontent-%COMP%]{width:100px}.unlock-logo[_ngcontent-%COMP%]{max-width:200px}"]})}}return y})();var eb=f(33065);function Um(y,c){1&y&&(a.j41(0,"p"),a.EFF(1,"Starting Ariton..."),a.k0s())}function X_(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",7),a.bIt("click",function(){a.eBV(l);const U=a.XpG(3);return a.Njj(U.back())}),a.EFF(1,"Back"),a.k0s()}if(2&y){const l=a.XpG(3);a.Y8G("disabled",l.appService.loading())}}function Ny(y,c){if(1&y){const l=a.RV6();a.j41(0,"button",8),a.bIt("click",function(){a.eBV(l);const U=a.XpG(3);return a.Njj(U.createAccount())}),a.EFF(1,"Create a new account"),a.k0s(),a.j41(2,"button",7),a.bIt("click",function(){a.eBV(l);const U=a.XpG(3);return a.Njj(U.restoreAccount())}),a.EFF(3,"Restore existing account"),a.k0s()}if(2&y){const l=a.XpG(3);a.Y8G("disabled",l.appService.loading()),a.R7$(2),a.Y8G("disabled",l.appService.loading())}}function ad(y,c){1&y&&a.nrm(0,"app-restore")}function X0(y,c){if(1&y&&(a.j41(0,"div",2),a.DNE(1,X_,2,1,"button",6)(2,Ny,4,2)(3,ad,1,0,"app-restore"),a.k0s()),2&y){const l=a.XpG(2);a.R7$(),a.vxM(l.restore()?1:2),a.R7$(2),a.vxM(l.restore()?3:-1)}}function Z_(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",3),a.nrm(1,"app-unlock"),a.j41(2,"p"),a.EFF(3," Issues? "),a.j41(4,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.forceClose())}),a.EFF(5,"Close loading sceen"),a.k0s(),a.EFF(6," or "),a.j41(7,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.wipe())}),a.EFF(8,"Reset All Data (Wipe)"),a.k0s()()()}}function Ly(y,c){1&y&&(a.j41(0,"p"),a.EFF(1,"Starting Ariton..."),a.k0s())}function uS(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",4)(1,"h1"),a.EFF(2,"Error during initialization. Offline?"),a.k0s(),a.j41(3,"p"),a.EFF(4,"You must be online to create your account."),a.nrm(5,"br"),a.EFF(6,"Please verify network connection and try again."),a.k0s(),a.j41(7,"p")(8,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG(2);return a.Njj(U.reload())}),a.EFF(9,"Reload"),a.k0s()()()}}function Y_(y,c){1&y&&a.nrm(0,"mat-spinner")}function tb(y,c){if(1&y){const l=a.RV6();a.j41(0,"div",0),a.nrm(1,"img",1),a.DNE(2,Um,2,0,"p")(3,X0,4,2,"div",2)(4,Z_,9,0,"div",3)(5,Ly,2,0,"p")(6,uS,10,0,"div",4)(7,Y_,1,0,"mat-spinner"),a.j41(8,"p"),a.EFF(9," Issues? "),a.j41(10,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.forceClose())}),a.EFF(11,"Close loading sceen"),a.k0s(),a.EFF(12," or "),a.j41(13,"button",5),a.bIt("click",function(){a.eBV(l);const U=a.XpG();return a.Njj(U.wipe())}),a.EFF(14,"Reset All Data (Wipe)"),a.k0s()()()}if(2&y){let l;const w=a.XpG();a.R7$(2),a.vxM(0===(l=w.appService.onboardingState())?2:1===l?3:2===l?4:3===l?5:4===l?6:-1),a.R7$(5),a.vxM(w.appService.loading()?7:-1)}}(0,i.B8)((()=>{class y{constructor(l,w,U){this.router=l,this.layout=w,this.identityService=U,this.title="app",this.appService=(0,a.WQX)(m.d),this.previousUrl="",this.restore=(0,a.vPA)(!1);const J=globalThis.location.search;if(J){const ce=Object.fromEntries(new URLSearchParams(J));this.appService.params=ce}console.log("queryParam:",J),console.log("this.appService.params:",this.appService.params),(0,a.QZP)(()=>{this.appService.initialized()&&console.log("App has been initialized!!!!")})}forceClose(){this.appService.onboardingState.set(m.f.Unlocked),this.appService.initialized.set(!0)}wipe(){var l=this;return(0,B.A)(function*(){return l.appService.wipe()})()}restoreAccount(){var l=this;return(0,B.A)(function*(){l.restore.set(!0)})()}back(){this.restore.set(!1)}createAccount(){var l=this;return(0,B.A)(function*(){console.log("Creating new account..."),yield l.appService.createAccount(),l.router.navigate([l.appService.state().loginAction])})()}reload(){document.location=document.location}ngOnInit(){var l=this;return(0,B.A)(function*(){yield l.appService.initialize()})()}static{this.\u0275fac=function(w){return new(w||y)(a.rXU(x.Ix),a.rXU(S.Y),a.rXU(g.K))}}static{this.\u0275cmp=a.VBU({type:y,selectors:[["app-root"]],standalone:!0,features:[a.Jv_([{provide:V.U$,useValue:{appearance:"outline"}}]),a.aNF],decls:3,vars:1,consts:[[1,"loading-container"],["src","ariton-icon-dark.svg",1,"loading-logo"],[1,"new-user-actions"],[1,"unlock-container"],[1,"loading-error"],["mat-button","",3,"click"],["mat-button","",3,"disabled"],["mat-button","",3,"click","disabled"],["mat-flat-button","",3,"click","disabled"]],template:function(w,U){1&w&&(a.DNE(0,tb,15,2,"div",0),a.j41(1,"app-layout"),a.nrm(2,"router-outlet"),a.k0s()),2&w&&a.vxM(U.appService.initialized()?-1:0)},dependencies:[eb.RestoreComponent,_.Hl,_.$z,G0.D6,G0.LG,x.n3,W_,G_],styles:[".unlock-container[_ngcontent-%COMP%]{background-color:var(--mat-app-background-color);color:var(--mat-app-text-color);padding:2em;position:absolute;box-sizing:border-box;width:100%;inset:0;z-index:1000;display:flex;justify-content:center;align-items:center;align-content:center;text-align:center;flex-direction:column}.loading-container[_ngcontent-%COMP%]{-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);color:var(--mat-app-text-color);padding:2em;position:absolute;box-sizing:border-box;width:100%;inset:0;z-index:1001;display:flex;flex-direction:column;align-items:center;justify-content:center}.loading-logo[_ngcontent-%COMP%]{max-width:96px;position:absolute;right:1em;bottom:1em}mat-spinner[_ngcontent-%COMP%]{margin:2em}.new-user-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-right:1em;margin-bottom:1em}"]})}}return y})(),ur).catch(y=>console.error(y))},49245:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://anyone-collaborate-protocol.xyz",published:!0,types:{doc:{}},structure:{doc:{$actions:[{who:"anyone",can:["read","co-update","co-delete"]}]}}}},62060:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/chat",published:!0,types:{message:{schema:"https://schema.ariton.app/chat/message",dataFormats:["application/json"]}},structure:{message:{$actions:[{who:"anyone",can:["create","update"]},{who:"author",of:"message",can:["read"]},{who:"recipient",of:"message",can:["read"]}]}}}},77949:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/community",published:!0,types:{community:{schema:"https://schema.ariton.app/community/schema/community",dataFormats:["application/json"]},album:{schema:"https://schema.ariton.app/community/schema/album",dataFormats:["text/plain"]},photo:{schema:"https://schema.ariton.app/community/schema/photo",dataFormats:["text/plain"]},friend:{schema:"https://schema.ariton.app/community/schema/friend",dataFormats:["text/plain"]},participant:{schema:"https://schema.ariton.app/community/schema/participant",dataFormats:["text/plain"]},updater:{schema:"https://schema.ariton.app/community/schema/updater",dataFormats:["text/plain"]},globalAdmin:{schema:"https://schema.ariton.app/community/schema/globalAdmin",dataFormats:["application/json"]},admin:{schema:"https://schema.ariton.app/community/schema/admin",dataFormats:["application/json"]}},structure:{globalAdmin:{$role:!0},friend:{$role:!0},community:{$actions:[{role:"globalAdmin",can:["create","update"]}],admin:{$role:!0,$actions:[{role:"globalAdmin",can:["create","update"]}]}}}}},68530:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/connections",published:!0,types:{request:{schema:"https://schema.ariton.app/connections/schema/request",dataFormats:["application/json"]},connection:{schema:"https://schema.ariton.app/connections/schema/connection",dataFormats:["application/json"]},block:{schema:"https://schema.ariton.app/connect/schema/block",dataFormats:["application/json"]}},structure:{block:{},connection:{},request:{$size:{max:3e3},$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]}}}},32794:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/data",published:!0,types:{data:{schema:"https://schema.ariton.app/data/schema/data",dataFormats:["application/json"]}},structure:{data:{}}}},97372:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/file",published:!0,types:{entry:{schema:"https://schema.ariton.app/file/schema/entry"},collaborator:{schema:"https://schema.ariton.app/file/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}}}}},67136:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://free-for-all-protocol.xyz",published:!0,types:{post:{schema:"eph",dataFormats:["application/json"]},attachment:{}},structure:{post:{$actions:[{who:"anyone",can:["create","update","delete","prune","read","co-delete","co-prune"]}],attachment:{$actions:[{who:"anyone",can:["create","update","delete","read","co-delete"]}]}}}}},22312:(Me,F,f)=>{"use strict";f.d(F,{Aq:()=>M,ME:()=>g,eE:()=>S,iU:()=>_,u5:()=>R});var i=f(4053),a=f(77949),B=(f(45189),f(2685)),m=f(69371);const S={format:"application/vc+jwt",friendship:"FriendshipCredential"},g={uri:i.Q.protocol,definition:i.Q},R={uri:B.Q.protocol,definition:B.Q},M={uri:a.Q.protocol,definition:a.Q},_={uri:m.Q.protocol,definition:m.Q}},69371:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/message",published:!0,types:{message:{schema:"https://schema.ariton.app/message/schema/message",dataFormats:["application/json"]},writer:{schema:"https://schema.ariton.app/message/schema/writer",dataFormats:["application/json"]},request:{schema:"https://schema.ariton.app/message/schema/request",dataFormats:["application/json"]},credential:{schema:"https://schema.ariton.app/message/schema/credential",dataFormats:["application/json"]}},structure:{writer:{$role:!0},message:{$actions:[{role:"writer",can:["create","update"]},{who:"author",of:"message",can:["read"]},{who:"recipient",of:"message",can:["read"]}]},request:{$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]},credential:{$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]}}}},1639:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://minimal.xyz",published:!1,types:{foo:{}},structure:{foo:{}}}},69314:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/note",published:!0,types:{note:{schema:"https://schema.ariton.app/note/schema/note",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/note/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},note:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}},5397:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/notification",published:!0,types:{event:{schema:"https://schema.ariton.app/notification/schema/event",dataFormats:["application/json"]}},structure:{event:{}}}},29508:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/post",published:!0,types:{post:{schema:"https://schema.ariton.app/post/schema/post",dataFormats:["application/json"]}},structure:{post:{}}}},4053:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={published:!0,protocol:"https://schema.ariton.app/profile",types:{profile:{schema:"https://schema.ariton.app/profile/schema/profile",dataFormats:["application/json"]},bio:{dataFormats:["application/json"]},status:{dataFormats:["application/json"]},location:{dataFormats:["application/json"]},birthDate:{dataFormats:["application/json"]},social:{dataFormats:["application/json"]},messaging:{dataFormats:["application/json"]},phone:{dataFormats:["application/json"]},address:{dataFormats:["application/json"]},career:{dataFormats:["application/json"]},payment:{dataFormats:["application/json"]},avatar:{dataFormats:["image/gif","image/png","image/jpeg"]},hero:{dataFormats:["image/gif","image/png","image/jpeg"]}},structure:{profile:{$actions:[{who:"anyone",can:["read"]}]},bio:{},status:{},location:{},birthDate:{},social:{},career:{},avatar:{$actions:[{who:"anyone",can:["read"]}]},hero:{$actions:[{who:"anyone",can:["read"]}]},messaging:{},address:{},phone:{},payment:{}}}},2685:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={published:!0,protocol:"https://schema.ariton.app/registry/entry",types:{profile:{dataFormats:["application/json"]},avatar:{dataFormats:["image/gif","image/png","image/jpeg"]},hero:{dataFormats:["image/gif","image/png","image/jpeg"]},admin:{schema:"https://schema.ariton.app/name/admin",dataFormats:["application/json"]}},structure:{admin:{$role:!0},profile:{$actions:[{role:"admin",can:["create","read","update","query","subscribe","co-update","co-delete"]}]},avatar:{},hero:{}}}},45189:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://social-media.xyz",published:!0,types:{post:{schema:"https://social-media.xyz/schemas/postSchema",dataFormats:["text/plain"]},reply:{schema:"https://social-media.xyz/schemas/replySchema",dataFormats:["text/plain"]},image:{dataFormats:["image/jpeg"]},caption:{schema:"https://social-media.xyz/schemas/captionSchema",dataFormats:["text/plain"]}},structure:{post:{$actions:[{who:"anyone",can:["create","read"]}],reply:{$actions:[{who:"recipient",of:"post",can:["create"]},{who:"author",of:"post",can:["create"]}]}},image:{$actions:[{who:"anyone",can:["create","read"]}],caption:{$actions:[{who:"anyone",can:["read"]},{who:"author",of:"image",can:["create"]}]},reply:{$actions:[{who:"author",of:"image",can:["read"]},{who:"recipient",of:"image",can:["create"]}]}}}}},50963:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/task",published:!0,types:{list:{schema:"https://schema.ariton.app/task/list",dataFormats:["application/json"]},task:{schema:"https://schema.ariton.app/task/task",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/task/collaborator",dataFormats:["application/json"]}},structure:{list:{collaborator:{$role:!0},$actions:[{role:"list/collaborator",can:["read","query","subscribe"]}],task:{$actions:[{role:"list/collaborator",can:["create","read","update","query","subscribe","co-update","co-delete"]}]}}}}},70669:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/text",published:!0,types:{entry:{schema:"https://schema.ariton.app/text/schema/entry",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/text/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}}}}},4521:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.createCurve=F.getHash=void 0;const i=f(44882),a=f(96492),x=f(73040);function B(S){return{hash:S,hmac:(g,...E)=>(0,i.hmac)(S,g,(0,a.concatBytes)(...E)),randomBytes:a.randomBytes}}F.getHash=B,F.createCurve=function m(S,g){const E=R=>(0,x.weierstrass)({...S,...B(R)});return Object.freeze({...E(g),create:E})}},25299:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateBasic=F.wNAF=void 0;const i=f(63834),a=f(84097),x=BigInt(0),B=BigInt(1);F.wNAF=function m(g,E){const R=(_,j)=>{const P=j.negate();return _?P:j},M=_=>({windows:Math.ceil(E/_)+1,windowSize:2**(_-1)});return{constTimeNegate:R,unsafeLadder(_,j){let P=g.ZERO,k=_;for(;j>x;)j&B&&(P=P.add(k)),k=k.double(),j>>=B;return P},precomputeWindow(_,j){const{windows:P,windowSize:k}=M(j),z=[];let W=_,V=W;for(let Z=0;Z>=re,ae>z&&(ae-=q,P+=B);const me=ie,ye=ie+Math.abs(ae)-1,K=ae<0;0===ae?V=V.add(R(te%2!=0,j[me])):W=W.add(R(K,j[ye]))}return{p:W,f:V}},wNAFCached(_,j,P,k){const z=_._WINDOW_SIZE||1;let W=j.get(_);return W||(W=this.precomputeWindow(_,z),1!==z&&j.set(_,k(W))),this.wNAF(z,W,P)}}},F.validateBasic=function S(g){return(0,i.validateField)(g.Fp),(0,a.validateObject)(g,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,i.nLength)(g.n,g.nBitLength),...g,p:g.Fp.ORDER})}},45068:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.twistedEdwards=void 0;const i=f(63834),a=f(84097),x=f(84097),B=f(25299),m=BigInt(0),S=BigInt(1),g=BigInt(2),E=BigInt(8),R={zip215:!0};F.twistedEdwards=function _(j){const P=function M(j){const P=(0,B.validateBasic)(j);return a.validateObject(j,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...P})}(j),{Fp:k,n:z,prehash:W,hash:V,randomBytes:Z,nByteLength:q,h:re}=P,te=g<{try{return{isValid:!0,value:k.sqrt(De*k.inv(Xe))}}catch{return{isValid:!1,value:m}}}),me=P.adjustScalarBytes||(De=>De),ye=P.domain||((De,Xe,Te)=>{if(Xe.length||Te)throw new Error("Contexts/pre-hash are not supported");return De}),ue=De=>"bigint"==typeof De&&mue(De)&&ue(Xe)&&DeDe===m||K(De,te);function h(De,Xe){if(K(De,Xe))return De;throw new Error(`Expected valid scalar < ${Xe}, got ${typeof De} ${De}`)}function A(De){return De===m?De:h(De,z)}const I=new Map;function O(De){if(!(De instanceof $))throw new Error("ExtendedPoint expected")}class ${constructor(Xe,Te,ke,Se){if(this.ex=Xe,this.ey=Te,this.ez=ke,this.et=Se,!o(Xe))throw new Error("x required");if(!o(Te))throw new Error("y required");if(!o(ke))throw new Error("z required");if(!o(Se))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(Xe){if(Xe instanceof $)throw new Error("extended point not allowed");const{x:Te,y:ke}=Xe||{};if(!o(Te)||!o(ke))throw new Error("invalid affine point");return new $(Te,ke,S,ie(Te*ke))}static normalizeZ(Xe){const Te=k.invertBatch(Xe.map(ke=>ke.ez));return Xe.map((ke,Se)=>ke.toAffine(Te[Se])).map($.fromAffine)}_setWindowSize(Xe){this._WINDOW_SIZE=Xe,I.delete(this)}assertValidity(){const{a:Xe,d:Te}=P;if(this.is0())throw new Error("bad point: ZERO");const{ex:ke,ey:Se,ez:Ee,et:ve}=this,Ce=ie(ke*ke),Re=ie(Se*Se),Ye=ie(Ee*Ee),$e=ie(Ye*Ye),nt=ie(Ce*Xe);if(ie(Ye*ie(nt+Re))!==ie($e+ie(Te*ie(Ce*Re))))throw new Error("bad point: equation left != right (1)");if(ie(ke*Se)!==ie(Ee*ve))throw new Error("bad point: equation left != right (2)")}equals(Xe){O(Xe);const{ex:Te,ey:ke,ez:Se}=this,{ex:Ee,ey:ve,ez:Ce}=Xe,Re=ie(Te*Ce),Ye=ie(Ee*Se),$e=ie(ke*Ce),nt=ie(ve*Se);return Re===Ye&&$e===nt}is0(){return this.equals($.ZERO)}negate(){return new $(ie(-this.ex),this.ey,this.ez,ie(-this.et))}double(){const{a:Xe}=P,{ex:Te,ey:ke,ez:Se}=this,Ee=ie(Te*Te),ve=ie(ke*ke),Ce=ie(g*ie(Se*Se)),Re=ie(Xe*Ee),Ye=Te+ke,$e=ie(ie(Ye*Ye)-Ee-ve),nt=Re+ve,Qe=nt-Ce,Tt=Re-ve,ct=ie($e*Qe),ze=ie(nt*Tt),St=ie($e*Tt),ne=ie(Qe*nt);return new $(ct,ze,ne,St)}add(Xe){O(Xe);const{a:Te,d:ke}=P,{ex:Se,ey:Ee,ez:ve,et:Ce}=this,{ex:Re,ey:Ye,ez:$e,et:nt}=Xe;if(Te===BigInt(-1)){const ot=ie((Ee-Se)*(Ye+Re)),Ft=ie((Ee+Se)*(Ye-Re)),wt=ie(Ft-ot);if(wt===m)return this.double();const zt=ie(ve*g*nt),rr=ie(Ce*g*$e),ar=rr+zt,lr=Ft+ot,hn=rr-zt,Wr=ie(ar*wt),vr=ie(lr*hn),Tr=ie(ar*hn),Ve=ie(wt*lr);return new $(Wr,vr,Ve,Tr)}const Qe=ie(Se*Re),Tt=ie(Ee*Ye),ct=ie(Ce*ke*nt),ze=ie(ve*$e),St=ie((Se+Ee)*(Re+Ye)-Qe-Tt),ne=ze-ct,X=ze+ct,G=ie(Tt-Te*Qe),he=ie(St*ne),_e=ie(X*G),je=ie(St*G),Ne=ie(ne*X);return new $(he,_e,Ne,je)}subtract(Xe){return this.add(Xe.negate())}wNAF(Xe){return s.wNAFCached(this,I,Xe,$.normalizeZ)}multiply(Xe){const{p:Te,f:ke}=this.wNAF(h(Xe,z));return $.normalizeZ([Te,ke])[0]}multiplyUnsafe(Xe){let Te=A(Xe);return Te===m?D:this.equals(D)||Te===S?this:this.equals(H)?this.wNAF(Te).p:s.unsafeLadder(this,Te)}isSmallOrder(){return this.multiplyUnsafe(re).is0()}isTorsionFree(){return s.unsafeLadder(this,z).is0()}toAffine(Xe){const{ex:Te,ey:ke,ez:Se}=this,Ee=this.is0();null==Xe&&(Xe=Ee?E:k.inv(Se));const ve=ie(Te*Xe),Ce=ie(ke*Xe),Re=ie(Se*Xe);if(Ee)return{x:m,y:S};if(Re!==S)throw new Error("invZ was invalid");return{x:ve,y:Ce}}clearCofactor(){const{h:Xe}=P;return Xe===S?this:this.multiplyUnsafe(Xe)}static fromHex(Xe,Te=!1){const{d:ke,a:Se}=P,Ee=k.BYTES,ve=(Xe=(0,x.ensureBytes)("pointHex",Xe,Ee)).slice(),Ce=Xe[Ee-1];ve[Ee-1]=-129&Ce;const Re=a.bytesToNumberLE(ve);Re===m||h(Re,Te?te:k.ORDER);const Ye=ie(Re*Re),$e=ie(Ye-S),nt=ie(ke*Ye-Se);let{isValid:Qe,value:Tt}=ae($e,nt);if(!Qe)throw new Error("Point.fromHex: invalid y coordinate");const ct=(Tt&S)===S,ze=!!(128&Ce);if(!Te&&Tt===m&&ze)throw new Error("Point.fromHex: x=0 and x_0=1");return ze!==ct&&(Tt=ie(-Tt)),$.fromAffine({x:Tt,y:Re})}static fromPrivateKey(Xe){return ee(Xe).point}toRawBytes(){const{x:Xe,y:Te}=this.toAffine(),ke=a.numberToBytesLE(Te,k.BYTES);return ke[ke.length-1]|=Xe&S?128:0,ke}toHex(){return a.bytesToHex(this.toRawBytes())}}$.BASE=new $(P.Gx,P.Gy,S,ie(P.Gx*P.Gy)),$.ZERO=new $(m,S,S,m);const{BASE:H,ZERO:D}=$,s=(0,B.wNAF)($,8*q);function p(De){return(0,i.mod)(De,z)}function Y(De){return p(a.bytesToNumberLE(De))}function ee(De){const Xe=q;De=(0,x.ensureBytes)("private key",De,Xe);const Te=(0,x.ensureBytes)("hashed private key",V(De),2*Xe),ke=me(Te.slice(0,Xe)),Se=Te.slice(Xe,2*Xe),Ee=Y(ke),ve=H.multiply(Ee),Ce=ve.toRawBytes();return{head:ke,prefix:Se,scalar:Ee,point:ve,pointBytes:Ce}}function de(De=new Uint8Array,...Xe){const Te=a.concatBytes(...Xe);return Y(V(ye(Te,(0,x.ensureBytes)("context",De),!!W)))}const Ie=R;return H._setWindowSize(8),{CURVE:P,getPublicKey:function oe(De){return ee(De).pointBytes},sign:function Ae(De,Xe,Te={}){De=(0,x.ensureBytes)("message",De),W&&(De=W(De));const{prefix:ke,scalar:Se,pointBytes:Ee}=ee(Xe),ve=de(Te.context,ke,De),Ce=H.multiply(ve).toRawBytes(),Ye=p(ve+de(Te.context,Ce,Ee,De)*Se);A(Ye);const $e=a.concatBytes(Ce,a.numberToBytesLE(Ye,k.BYTES));return(0,x.ensureBytes)("result",$e,2*q)},verify:function Le(De,Xe,Te,ke=Ie){const{context:Se,zip215:Ee}=ke,ve=k.BYTES;De=(0,x.ensureBytes)("signature",De,2*ve),Xe=(0,x.ensureBytes)("message",Xe),W&&(Xe=W(Xe));const Ce=a.bytesToNumberLE(De.slice(ve,2*ve));let Re,Ye,$e;try{Re=$.fromHex(Te,Ee),Ye=$.fromHex(De.slice(0,ve),Ee),$e=H.multiplyUnsafe(Ce)}catch{return!1}if(!Ee&&Re.isSmallOrder())return!1;const nt=de(Se,Ye.toRawBytes(),Re.toRawBytes(),Xe);return Ye.add(Re.multiplyUnsafe(nt)).subtract($e).clearCofactor().equals($.ZERO)},ExtendedPoint:$,utils:{getExtendedPublicKey:ee,randomPrivateKey:()=>Z(k.BYTES),precompute:(De=8,Xe=$.BASE)=>(Xe._setWindowSize(De),Xe.multiply(BigInt(3)),Xe)}}}},75752:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.createHasher=F.isogenyMap=F.hash_to_field=F.expand_message_xof=F.expand_message_xmd=void 0;const i=f(63834),a=f(84097),B=a.bytesToNumberBE;function m(k,z){if(k<0||k>=1<<8*z)throw new Error(`bad I2OSP call: value=${k} length=${z}`);const W=Array.from({length:z}).fill(0);for(let V=z-1;V>=0;V--)W[V]=255&k,k>>>=8;return new Uint8Array(W)}function S(k,z){const W=new Uint8Array(k.length);for(let V=0;V255&&(z=V((0,a.concatBytes)((0,a.utf8ToBytes)("H2C-OVERSIZE-DST-"),z)));const{outputLen:Z,blockLen:q}=V,re=Math.ceil(W/Z);if(re>255)throw new Error("Invalid xmd length");const te=(0,a.concatBytes)(z,m(z.length,1)),ie=m(0,q),ae=m(W,2),me=new Array(re),ye=V((0,a.concatBytes)(ie,k,ae,m(0,1),te));me[0]=V((0,a.concatBytes)(ye,m(1,1),te));for(let K=1;K<=re;K++){const o=[S(ye,me[K-1]),m(K+1,1),te];me[K]=V((0,a.concatBytes)(...o))}return(0,a.concatBytes)(...me).slice(0,W)}function M(k,z,W,V,Z){if(g(k),g(z),E(W),z.length>255){const q=Math.ceil(2*V/8);z=Z.create({dkLen:q}).update((0,a.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(z).digest()}if(W>65535||z.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return Z.create({dkLen:W}).update(k).update(m(W,2)).update(z).update(m(z.length,1)).digest()}function _(k,z,W){(0,a.validateObject)(W,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:V,k:Z,m:q,hash:re,expand:te,DST:ie}=W;g(k),E(z);const ae=function x(k){if((0,a.isBytes)(k))return k;if("string"==typeof k)return(0,a.utf8ToBytes)(k);throw new Error("DST must be Uint8Array or string")}(ie),me=V.toString(2).length,ye=Math.ceil((me+Z)/8),ue=z*q*ye;let K;if("xmd"===te)K=R(k,ae,ue,re);else if("xof"===te)K=M(k,ae,ue,Z,re);else{if("_internal_pass"!==te)throw new Error('expand must be "xmd" or "xof"');K=k}const o=new Array(z);for(let h=0;hArray.from(V).reverse());return(V,Z)=>{const[q,re,te,ie]=W.map(ae=>ae.reduce((me,ye)=>k.add(k.mul(me,V),ye)));return V=k.div(q,re),Z=k.mul(Z,k.div(te,ie)),{x:V,y:Z}}},F.createHasher=function P(k,z,W){if("function"!=typeof z)throw new Error("mapToCurve() must be defined");return{hashToCurve(V,Z){const q=_(V,2,{...W,DST:W.DST,...Z}),re=k.fromAffine(z(q[0])),te=k.fromAffine(z(q[1])),ie=re.add(te).clearCofactor();return ie.assertValidity(),ie},encodeToCurve(V,Z){const q=_(V,1,{...W,DST:W.encodeDST,...Z}),re=k.fromAffine(z(q[0])).clearCofactor();return re.assertValidity(),re}}}},63834:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapHashToField=F.getMinHashLength=F.getFieldBytesLength=F.hashToPrivateScalar=F.FpSqrtEven=F.FpSqrtOdd=F.Field=F.nLength=F.FpIsSquare=F.FpDiv=F.FpInvertBatch=F.FpPow=F.validateField=F.isNegativeLE=F.FpSqrt=F.tonelliShanks=F.invert=F.pow2=F.pow=F.mod=void 0;const i=f(84097),a=BigInt(0),x=BigInt(1),B=BigInt(2),m=BigInt(3),S=BigInt(4),g=BigInt(5),E=BigInt(8);function _(O,$){const H=O%$;return H>=a?H:$+H}function j(O,$,H){if(H<=a||$ 0");if(H===x)return a;let D=x;for(;$>a;)$&x&&(D=D*O%H),O=O*O%H,$>>=x;return D}function k(O,$){if(O===a||$<=a)throw new Error(`invert: expected positive integers, got n=${O} mod=${$}`);let H=_(O,$),D=$,s=a,p=x,Y=x,ee=a;for(;H!==a;){const de=D/H,Ae=D%H,Ie=s-Y*de,Le=p-ee*de;D=H,H=Ae,s=Y,p=ee,Y=Ie,ee=Le}if(D!==x)throw new Error("invert: does not exist");return _(s,$)}function z(O){const $=(O-x)/B;let H,D,s;for(H=O-x,D=0;H%B===a;H/=B,D++);for(s=B;sa;)D*=D,D%=H;return D},F.invert=k,F.tonelliShanks=z,F.FpSqrt=W,F.isNegativeLE=(O,$)=>(_(O,$)&x)===x;const Z=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function re(O,$,H){if(H 0");if(H===a)return O.ONE;if(H===x)return $;let D=O.ONE,s=$;for(;H>a;)H&x&&(D=O.mul(D,s)),s=O.sqr(s),H>>=x;return D}function te(O,$){const H=new Array($.length),D=$.reduce((p,Y,ee)=>O.is0(Y)?p:(H[ee]=p,O.mul(p,Y)),O.ONE),s=O.inv(D);return $.reduceRight((p,Y,ee)=>O.is0(Y)?p:(H[ee]=O.mul(p,H[ee]),O.mul(p,Y)),s),H}function me(O,$){const H=void 0!==$?$:O.toString(2).length;return{nBitLength:H,nByteLength:Math.ceil(H/8)}}function h(O){if("bigint"!=typeof O)throw new Error("field order must be bigint");const $=O.toString(2).length;return Math.ceil($/8)}function A(O){const $=h(O);return $+Math.ceil($/2)}F.validateField=function q(O){const H=Z.reduce((D,s)=>(D[s]="function",D),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,i.validateObject)(O,H)},F.FpPow=re,F.FpInvertBatch=te,F.FpDiv=function ie(O,$,H){return O.mul($,"bigint"==typeof H?k(H,O.ORDER):O.inv(H))},F.FpIsSquare=function ae(O){const $=(O.ORDER-x)/B;return H=>{const D=O.pow(H,$);return O.eql(D,O.ZERO)||O.eql(D,O.ONE)}},F.nLength=me,F.Field=function ye(O,$,H=!1,D={}){if(O<=a)throw new Error(`Expected Field ORDER > 0, got ${O}`);const{nBitLength:s,nByteLength:p}=me(O,$);if(p>2048)throw new Error("Field lengths over 2048 bytes are not supported");const Y=W(O),ee=Object.freeze({ORDER:O,BITS:s,BYTES:p,MASK:(0,i.bitMask)(s),ZERO:a,ONE:x,create:oe=>_(oe,O),isValid:oe=>{if("bigint"!=typeof oe)throw new Error("Invalid field element: expected bigint, got "+typeof oe);return a<=oe&&oeoe===a,isOdd:oe=>(oe&x)===x,neg:oe=>_(-oe,O),eql:(oe,de)=>oe===de,sqr:oe=>_(oe*oe,O),add:(oe,de)=>_(oe+de,O),sub:(oe,de)=>_(oe-de,O),mul:(oe,de)=>_(oe*de,O),pow:(oe,de)=>re(ee,oe,de),div:(oe,de)=>_(oe*k(de,O),O),sqrN:oe=>oe*oe,addN:(oe,de)=>oe+de,subN:(oe,de)=>oe-de,mulN:(oe,de)=>oe*de,inv:oe=>k(oe,O),sqrt:D.sqrt||(oe=>Y(ee,oe)),invertBatch:oe=>te(ee,oe),cmov:(oe,de,Ae)=>Ae?de:oe,toBytes:oe=>H?(0,i.numberToBytesLE)(oe,p):(0,i.numberToBytesBE)(oe,p),fromBytes:oe=>{if(oe.length!==p)throw new Error(`Fp.fromBytes: expected ${p}, got ${oe.length}`);return H?(0,i.bytesToNumberLE)(oe):(0,i.bytesToNumberBE)(oe)}});return Object.freeze(ee)},F.FpSqrtOdd=function ue(O,$){if(!O.isOdd)throw new Error("Field doesn't have isOdd");const H=O.sqrt($);return O.isOdd(H)?H:O.neg(H)},F.FpSqrtEven=function K(O,$){if(!O.isOdd)throw new Error("Field doesn't have isOdd");const H=O.sqrt($);return O.isOdd(H)?O.neg(H):H},F.hashToPrivateScalar=function o(O,$,H=!1){const D=(O=(0,i.ensureBytes)("privateHash",O)).length,s=me($).nByteLength+8;if(s<24||D1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${D}`);return _(H?(0,i.bytesToNumberLE)(O):(0,i.bytesToNumberBE)(O),$-x)+x},F.getFieldBytesLength=h,F.getMinHashLength=A,F.mapHashToField=function I(O,$,H=!1){const D=O.length,s=h($),p=A($);if(D<16||D1024)throw new Error(`expected ${p}-1024 bytes of input, got ${D}`);const ee=_(H?(0,i.bytesToNumberBE)(O):(0,i.bytesToNumberLE)(O),$-x)+x;return H?(0,i.numberToBytesLE)(ee,s):(0,i.numberToBytesBE)(ee,s)}},27661:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.montgomery=void 0;const i=f(63834),a=f(84097),x=BigInt(0),B=BigInt(1);F.montgomery=function S(g){const E=function m(g){return(0,a.validateObject)(g,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...g})}(g),{P:R}=E,M=ue=>(0,i.mod)(ue,R),_=E.montgomeryBits,j=Math.ceil(_/8),P=E.nByteLength,k=E.adjustScalarBytes||(ue=>ue),z=E.powPminus2||(ue=>(0,i.pow)(ue,R-BigInt(2),R));function W(ue,K,o){const h=M(ue*(K-o));return[K=M(K-h),o=M(o+h)]}function V(ue){if("bigint"==typeof ue&&x<=ue&&ue=x;Y--){const ee=h>>Y&B;D^=ee,s=W(D,I,$),I=s[0],$=s[1],s=W(D,O,H),O=s[0],H=s[1],D=ee;const oe=I+O,de=M(oe*oe),Ae=I-O,Ie=M(Ae*Ae),Le=de-Ie,xe=$+H,Xe=M(($-H)*oe),Te=M(xe*Ae),ke=Xe+Te,Se=Xe-Te;$=M(ke*ke),H=M(A*M(Se*Se)),I=M(de*Ie),O=M(Le*(de+M(Z*Le)))}s=W(D,I,$),I=s[0],$=s[1],s=W(D,O,H),O=s[0],H=s[1];const p=z(O);return M(I*p)}(o,h);if(A===x)throw new Error("Invalid private or public key received");return re(A)}const me=re(E.Gu);function ye(ue){return ae(ue,me)}return{scalarMult:ae,scalarMultBase:ye,getSharedSecret:(ue,K)=>ae(ue,K),getPublicKey:ue=>ye(ue),utils:{randomPrivateKey:()=>E.randomBytes(E.nByteLength)},GuBytes:me}}},84097:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateObject=F.createHmacDrbg=F.bitMask=F.bitSet=F.bitGet=F.bitLen=F.utf8ToBytes=F.equalBytes=F.concatBytes=F.ensureBytes=F.numberToVarBytesBE=F.numberToBytesLE=F.numberToBytesBE=F.bytesToNumberLE=F.bytesToNumberBE=F.hexToBytes=F.hexToNumber=F.numberToHexUnpadded=F.bytesToHex=F.isBytes=void 0;const f=BigInt(0),i=BigInt(1),a=BigInt(2);function x(h){return h instanceof Uint8Array||null!=h&&"object"==typeof h&&"Uint8Array"===h.constructor.name}F.isBytes=x;const B=Array.from({length:256},(h,A)=>A.toString(16).padStart(2,"0"));function m(h){if(!x(h))throw new Error("Uint8Array expected");let A="";for(let I=0;I=E._0&&h<=E._9?h-E._0:h>=E._A&&h<=E._F?h-(E._A-10):h>=E._a&&h<=E._f?h-(E._a-10):void 0}function M(h){if("string"!=typeof h)throw new Error("hex string expected, got "+typeof h);const A=h.length,I=A/2;if(A%2)throw new Error("padded hex string expected, got unpadded hex of length "+A);const O=new Uint8Array(I);for(let $=0,H=0;$f;h>>=i,A+=1);return A},F.bitGet=function te(h,A){return h>>BigInt(A)&i},F.bitSet=(h,A,I)=>h|(I?i:f)<(a<new Uint8Array(h),ye=h=>Uint8Array.from(h);F.createHmacDrbg=function ue(h,A,I){if("number"!=typeof h||h<2)throw new Error("hashLen must be a number");if("number"!=typeof A||A<2)throw new Error("qByteLen must be a number");if("function"!=typeof I)throw new Error("hmacFn must be a function");let O=me(h),$=me(h),H=0;const D=()=>{O.fill(1),$.fill(0),H=0},s=(...oe)=>I($,O,...oe),p=(oe=me())=>{$=s(ye([0]),oe),O=s(),0!==oe.length&&($=s(ye([1]),oe),O=s())},Y=()=>{if(H++>=1e3)throw new Error("drbg: tried 1000 values");let oe=0;const de=[];for(;oe{let Ae;for(D(),p(oe);!(Ae=de(Y()));)p();return D(),Ae}};const K={bigint:h=>"bigint"==typeof h,function:h=>"function"==typeof h,boolean:h=>"boolean"==typeof h,string:h=>"string"==typeof h,stringOrUint8Array:h=>"string"==typeof h||x(h),isSafeInteger:h=>Number.isSafeInteger(h),array:h=>Array.isArray(h),field:(h,A)=>A.Fp.isValid(h),hash:h=>"function"==typeof h&&Number.isSafeInteger(h.outputLen)};F.validateObject=function o(h,A,I={}){const O=($,H,D)=>{const s=K[H];if("function"!=typeof s)throw new Error(`Invalid validator "${H}", expected function`);const p=h[$];if(!(D&&void 0===p||s(p,h)))throw new Error(`Invalid param ${String($)}=${p} (${typeof p}), expected ${H}`)};for(const[$,H]of Object.entries(A))O($,H,!1);for(const[$,H]of Object.entries(I))O($,H,!0);return h}},73040:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapToCurveSimpleSWU=F.SWUFpSqrtRatio=F.weierstrass=F.weierstrassPoints=F.DER=void 0;const i=f(63834),a=f(84097),x=f(84097),B=f(25299),{bytesToNumberBE:S,hexToBytes:g}=a;F.DER={Err:class extends Error{constructor(q=""){super(q)}},_parseInt(Z){const{Err:q}=F.DER;if(Z.length<2||2!==Z[0])throw new q("Invalid signature integer tag");const re=Z[1],te=Z.subarray(2,re+2);if(!re||te.length!==re)throw new q("Invalid signature integer: wrong length");if(128&te[0])throw new q("Invalid signature integer: negative");if(0===te[0]&&!(128&te[1]))throw new q("Invalid signature integer: unnecessary leading zero");return{d:S(te),l:Z.subarray(re+2)}},toSig(Z){const{Err:q}=F.DER,re="string"==typeof Z?g(Z):Z;if(!a.isBytes(re))throw new Error("ui8a expected");let te=re.length;if(te<2||48!=re[0])throw new q("Invalid signature tag");if(re[1]!==te-2)throw new q("Invalid signature: incorrect length");const{d:ie,l:ae}=F.DER._parseInt(re.subarray(2)),{d:me,l:ye}=F.DER._parseInt(ae);if(ye.length)throw new q("Invalid signature: left bytes after parsing");return{r:ie,s:me}},hexFromSig(Z){const q=K=>8&Number.parseInt(K[0],16)?"00"+K:K,re=K=>{const o=K.toString(16);return 1&o.length?`0${o}`:o},te=q(re(Z.s)),ie=q(re(Z.r)),ae=te.length/2,me=ie.length/2,ye=re(ae),ue=re(me);return`30${re(me+ae+4)}02${ue}${ie}02${ye}${te}`}};const E=BigInt(0),R=BigInt(1),M=BigInt(2),_=BigInt(3),j=BigInt(4);function P(Z){const q=function m(Z){const q=(0,B.validateBasic)(Z);a.validateObject(q,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:re,Fp:te,a:ie}=q;if(re){if(!te.eql(ie,te.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof re||"bigint"!=typeof re.beta||"function"!=typeof re.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...q})}(Z),{Fp:re}=q,te=q.toBytes||((O,$,H)=>{const D=$.toAffine();return a.concatBytes(Uint8Array.from([4]),re.toBytes(D.x),re.toBytes(D.y))}),ie=q.fromBytes||(O=>{const $=O.subarray(1);return{x:re.fromBytes($.subarray(0,re.BYTES)),y:re.fromBytes($.subarray(re.BYTES,2*re.BYTES))}});function ae(O){const{a:$,b:H}=q,D=re.sqr(O),s=re.mul(D,O);return re.add(re.add(s,re.mul(O,$)),H)}if(!re.eql(re.sqr(q.Gy),ae(q.Gx)))throw new Error("bad generator point: equation left != right");function me(O){return"bigint"==typeof O&&Ere.eql(p,re.ZERO);return s(H)&&s(D)?h.ZERO:new h(H,D,re.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ($){const H=re.invertBatch($.map(D=>D.pz));return $.map((D,s)=>D.toAffine(H[s])).map(h.fromAffine)}static fromHex($){const H=h.fromAffine(ie((0,x.ensureBytes)("pointHex",$)));return H.assertValidity(),H}static fromPrivateKey($){return h.BASE.multiply(ue($))}_setWindowSize($){this._WINDOW_SIZE=$,K.delete(this)}assertValidity(){if(this.is0()){if(q.allowInfinityPoint&&!re.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:$,y:H}=this.toAffine();if(!re.isValid($)||!re.isValid(H))throw new Error("bad point: x or y not FE");const D=re.sqr(H),s=ae($);if(!re.eql(D,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:$}=this.toAffine();if(re.isOdd)return!re.isOdd($);throw new Error("Field doesn't support isOdd")}equals($){o($);const{px:H,py:D,pz:s}=this,{px:p,py:Y,pz:ee}=$,oe=re.eql(re.mul(H,ee),re.mul(p,s)),de=re.eql(re.mul(D,ee),re.mul(Y,s));return oe&&de}negate(){return new h(this.px,re.neg(this.py),this.pz)}double(){const{a:$,b:H}=q,D=re.mul(H,_),{px:s,py:p,pz:Y}=this;let ee=re.ZERO,oe=re.ZERO,de=re.ZERO,Ae=re.mul(s,s),Ie=re.mul(p,p),Le=re.mul(Y,Y),xe=re.mul(s,p);return xe=re.add(xe,xe),de=re.mul(s,Y),de=re.add(de,de),ee=re.mul($,de),oe=re.mul(D,Le),oe=re.add(ee,oe),ee=re.sub(Ie,oe),oe=re.add(Ie,oe),oe=re.mul(ee,oe),ee=re.mul(xe,ee),de=re.mul(D,de),Le=re.mul($,Le),xe=re.sub(Ae,Le),xe=re.mul($,xe),xe=re.add(xe,de),de=re.add(Ae,Ae),Ae=re.add(de,Ae),Ae=re.add(Ae,Le),Ae=re.mul(Ae,xe),oe=re.add(oe,Ae),Le=re.mul(p,Y),Le=re.add(Le,Le),Ae=re.mul(Le,xe),ee=re.sub(ee,Ae),de=re.mul(Le,Ie),de=re.add(de,de),de=re.add(de,de),new h(ee,oe,de)}add($){o($);const{px:H,py:D,pz:s}=this,{px:p,py:Y,pz:ee}=$;let oe=re.ZERO,de=re.ZERO,Ae=re.ZERO;const Ie=q.a,Le=re.mul(q.b,_);let xe=re.mul(H,p),De=re.mul(D,Y),Xe=re.mul(s,ee),Te=re.add(H,D),ke=re.add(p,Y);Te=re.mul(Te,ke),ke=re.add(xe,De),Te=re.sub(Te,ke),ke=re.add(H,s);let Se=re.add(p,ee);return ke=re.mul(ke,Se),Se=re.add(xe,Xe),ke=re.sub(ke,Se),Se=re.add(D,s),oe=re.add(Y,ee),Se=re.mul(Se,oe),oe=re.add(De,Xe),Se=re.sub(Se,oe),Ae=re.mul(Ie,ke),oe=re.mul(Le,Xe),Ae=re.add(oe,Ae),oe=re.sub(De,Ae),Ae=re.add(De,Ae),de=re.mul(oe,Ae),De=re.add(xe,xe),De=re.add(De,xe),Xe=re.mul(Ie,Xe),ke=re.mul(Le,ke),De=re.add(De,Xe),Xe=re.sub(xe,Xe),Xe=re.mul(Ie,Xe),ke=re.add(ke,Xe),xe=re.mul(De,ke),de=re.add(de,xe),xe=re.mul(Se,ke),oe=re.mul(Te,oe),oe=re.sub(oe,xe),xe=re.mul(Te,De),Ae=re.mul(Se,Ae),Ae=re.add(Ae,xe),new h(oe,de,Ae)}subtract($){return this.add($.negate())}is0(){return this.equals(h.ZERO)}wNAF($){return I.wNAFCached(this,K,$,H=>{const D=re.invertBatch(H.map(s=>s.pz));return H.map((s,p)=>s.toAffine(D[p])).map(h.fromAffine)})}multiplyUnsafe($){const H=h.ZERO;if($===E)return H;if(ye($),$===R)return this;const{endo:D}=q;if(!D)return I.unsafeLadder(this,$);let{k1neg:s,k1:p,k2neg:Y,k2:ee}=D.splitScalar($),oe=H,de=H,Ae=this;for(;p>E||ee>E;)p&R&&(oe=oe.add(Ae)),ee&R&&(de=de.add(Ae)),Ae=Ae.double(),p>>=R,ee>>=R;return s&&(oe=oe.negate()),Y&&(de=de.negate()),de=new h(re.mul(de.px,D.beta),de.py,de.pz),oe.add(de)}multiply($){ye($);let D,s,H=$;const{endo:p}=q;if(p){const{k1neg:Y,k1:ee,k2neg:oe,k2:de}=p.splitScalar(H);let{p:Ae,f:Ie}=this.wNAF(ee),{p:Le,f:xe}=this.wNAF(de);Ae=I.constTimeNegate(Y,Ae),Le=I.constTimeNegate(oe,Le),Le=new h(re.mul(Le.px,p.beta),Le.py,Le.pz),D=Ae.add(Le),s=Ie.add(xe)}else{const{p:Y,f:ee}=this.wNAF(H);D=Y,s=ee}return h.normalizeZ([D,s])[0]}multiplyAndAddUnsafe($,H,D){const s=h.BASE,p=(ee,oe)=>oe!==E&&oe!==R&&ee.equals(s)?ee.multiply(oe):ee.multiplyUnsafe(oe),Y=p(this,H).add(p($,D));return Y.is0()?void 0:Y}toAffine($){const{px:H,py:D,pz:s}=this,p=this.is0();null==$&&($=p?re.ONE:re.inv(s));const Y=re.mul(H,$),ee=re.mul(D,$),oe=re.mul(s,$);if(p)return{x:re.ZERO,y:re.ZERO};if(!re.eql(oe,re.ONE))throw new Error("invZ was invalid");return{x:Y,y:ee}}isTorsionFree(){const{h:$,isTorsionFree:H}=q;if($===R)return!0;if(H)return H(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:$,clearCofactor:H}=q;return $===R?this:H?H(h,this):this.multiplyUnsafe(q.h)}toRawBytes($=!0){return this.assertValidity(),te(h,this,$)}toHex($=!0){return a.bytesToHex(this.toRawBytes($))}}h.BASE=new h(q.Gx,q.Gy,re.ONE),h.ZERO=new h(re.ZERO,re.ONE,re.ZERO);const A=q.nBitLength,I=(0,B.wNAF)(h,q.endo?Math.ceil(A/2):A);return{CURVE:q,ProjectivePoint:h,normPrivateKeyToScalar:ue,weierstrassEquation:ae,isWithinCurveOrder:me}}function W(Z,q){const re=Z.ORDER;let te=E;for(let O=re-R;O%M===E;O/=M)te+=R;const ie=te,ae=M<{let H=h,D=Z.pow($,K),s=Z.sqr(D);s=Z.mul(s,$);let p=Z.mul(O,s);p=Z.pow(p,ue),p=Z.mul(p,D),D=Z.mul(p,$),s=Z.mul(p,O);let Y=Z.mul(s,D);p=Z.pow(Y,o);let ee=Z.eql(p,Z.ONE);D=Z.mul(s,A),p=Z.mul(Y,H),s=Z.cmov(D,s,ee),Y=Z.cmov(p,Y,ee);for(let oe=ie;oe>R;oe--){let de=oe-M;de=M<{let s=Z.sqr(D);const p=Z.mul(H,D);s=Z.mul(s,p);let Y=Z.pow(s,O);Y=Z.mul(Y,p);const ee=Z.mul(Y,$),oe=Z.mul(Z.sqr(Y),D),de=Z.eql(oe,H);return{isValid:de,value:Z.cmov(ee,Y,de)}}}return I}F.weierstrassPoints=P,F.weierstrass=function z(Z){const q=function k(Z){const q=(0,B.validateBasic)(Z);return a.validateObject(q,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...q})}(Z),{Fp:re,n:te}=q,ie=re.BYTES+1,ae=2*re.BYTES+1;function ye(ke){return i.mod(ke,te)}function ue(ke){return i.invert(ke,te)}const{ProjectivePoint:K,normPrivateKeyToScalar:o,weierstrassEquation:h,isWithinCurveOrder:A}=P({...q,toBytes(ke,Se,Ee){const ve=Se.toAffine(),Ce=re.toBytes(ve.x),Re=a.concatBytes;return Ee?Re(Uint8Array.from([Se.hasEvenY()?2:3]),Ce):Re(Uint8Array.from([4]),Ce,re.toBytes(ve.y))},fromBytes(ke){const Se=ke.length,Ee=ke[0],ve=ke.subarray(1);if(Se!==ie||2!==Ee&&3!==Ee){if(Se===ae&&4===Ee)return{x:re.fromBytes(ve.subarray(0,re.BYTES)),y:re.fromBytes(ve.subarray(re.BYTES,2*re.BYTES))};throw new Error(`Point of length ${Se} was invalid. Expected ${ie} compressed bytes or ${ae} uncompressed bytes`)}{const Ce=a.bytesToNumberBE(ve);if(!function me(ke){return Ea.bytesToHex(a.numberToBytesBE(ke,q.nByteLength));function O(ke){return ke>te>>R}const H=(ke,Se,Ee)=>a.bytesToNumberBE(ke.slice(Se,Ee));class D{constructor(Se,Ee,ve){this.r=Se,this.s=Ee,this.recovery=ve,this.assertValidity()}static fromCompact(Se){const Ee=q.nByteLength;return Se=(0,x.ensureBytes)("compactSignature",Se,2*Ee),new D(H(Se,0,Ee),H(Se,Ee,2*Ee))}static fromDER(Se){const{r:Ee,s:ve}=F.DER.toSig((0,x.ensureBytes)("DER",Se));return new D(Ee,ve)}assertValidity(){if(!A(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!A(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Se){return new D(this.r,this.s,Se)}recoverPublicKey(Se){const{r:Ee,s:ve,recovery:Ce}=this,Re=de((0,x.ensureBytes)("msgHash",Se));if(null==Ce||![0,1,2,3].includes(Ce))throw new Error("recovery id invalid");const Ye=2===Ce||3===Ce?Ee+q.n:Ee;if(Ye>=re.ORDER)throw new Error("recovery id 2 or 3 invalid");const nt=K.fromHex((1&Ce?"03":"02")+I(Ye)),Qe=ue(Ye),Tt=ye(-Re*Qe),ct=ye(ve*Qe),ze=K.BASE.multiplyAndAddUnsafe(nt,Tt,ct);if(!ze)throw new Error("point at infinify");return ze.assertValidity(),ze}hasHighS(){return O(this.s)}normalizeS(){return this.hasHighS()?new D(this.r,ye(-this.s),this.recovery):this}toDERRawBytes(){return a.hexToBytes(this.toDERHex())}toDERHex(){return F.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return a.hexToBytes(this.toCompactHex())}toCompactHex(){return I(this.r)+I(this.s)}}const s={isValidPrivateKey(ke){try{return o(ke),!0}catch{return!1}},normPrivateKeyToScalar:o,randomPrivateKey:()=>{const ke=i.getMinHashLength(q.n);return i.mapHashToField(q.randomBytes(ke),q.n)},precompute:(ke=8,Se=K.BASE)=>(Se._setWindowSize(ke),Se.multiply(BigInt(3)),Se)};function Y(ke){const Se=a.isBytes(ke),Ee="string"==typeof ke,ve=(Se||Ee)&&ke.length;return Se?ve===ie||ve===ae:Ee?ve===2*ie||ve===2*ae:ke instanceof K}const oe=q.bits2int||function(ke){const Se=a.bytesToNumberBE(ke),Ee=8*ke.length-q.nBitLength;return Ee>0?Se>>BigInt(Ee):Se},de=q.bits2int_modN||function(ke){return ye(oe(ke))},Ae=a.bitMask(q.nBitLength);function Ie(ke){if("bigint"!=typeof ke)throw new Error("bigint expected");if(!(E<=ke&&kene in Ee))throw new Error("sign() legacy options not supported");const{hash:ve,randomBytes:Ce}=q;let{lowS:Re,prehash:Ye,extraEntropy:$e}=Ee;null==Re&&(Re=!0),ke=(0,x.ensureBytes)("msgHash",ke),Ye&&(ke=(0,x.ensureBytes)("prehashed msgHash",ve(ke)));const nt=de(ke),Qe=o(Se),Tt=[Ie(Qe),Ie(nt)];if(null!=$e){const ne=!0===$e?Ce(re.BYTES):$e;Tt.push((0,x.ensureBytes)("extraEntropy",ne))}const ct=a.concatBytes(...Tt),ze=nt;return{seed:ct,k2sig:function St(ne){const X=oe(ne);if(!A(X))return;const G=ue(X),he=K.BASE.multiply(X).toAffine(),_e=ye(he.x);if(_e===E)return;const je=ye(G*ye(ze+_e*Qe));if(je===E)return;let Ne=(he.x===_e?0:2)|Number(he.y&R),ot=je;return Re&&O(je)&&(ot=function $(ke){return O(ke)?ye(-ke):ke}(je),Ne^=1),new D(_e,ot,Ne)}}}(ke,Se,Ee);return a.createHmacDrbg(q.hash.outputLen,q.nByteLength,q.hmac)(ve,Ce)},verify:function Te(ke,Se,Ee,ve=De){const Ce=ke;if(Se=(0,x.ensureBytes)("msgHash",Se),Ee=(0,x.ensureBytes)("publicKey",Ee),"strict"in ve)throw new Error("options.strict was renamed to lowS");const{lowS:Re,prehash:Ye}=ve;let $e,nt;try{if("string"==typeof Ce||a.isBytes(Ce))try{$e=D.fromDER(Ce)}catch(he){if(!(he instanceof F.DER.Err))throw he;$e=D.fromCompact(Ce)}else{if("object"!=typeof Ce||"bigint"!=typeof Ce.r||"bigint"!=typeof Ce.s)throw new Error("PARSE");{const{r:he,s:_e}=Ce;$e=new D(he,_e)}}nt=K.fromHex(Ee)}catch(he){if("PARSE"===he.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Re&&$e.hasHighS())return!1;Ye&&(Se=q.hash(Se));const{r:Qe,s:Tt}=$e,ct=de(Se),ze=ue(Tt),St=ye(ct*ze),ne=ye(Qe*ze),X=K.BASE.multiplyAndAddUnsafe(nt,St,ne)?.toAffine();return!!X&&ye(X.x)===Qe},ProjectivePoint:K,Signature:D,utils:s}},F.SWUFpSqrtRatio=W,F.mapToCurveSimpleSWU=function V(Z,q){if(i.validateField(Z),!Z.isValid(q.A)||!Z.isValid(q.B)||!Z.isValid(q.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const re=W(Z,q.Z);if(!Z.isOdd)throw new Error("Fp.isOdd is not implemented!");return te=>{let ie,ae,me,ye,ue,K,o,h;ie=Z.sqr(te),ie=Z.mul(ie,q.Z),ae=Z.sqr(ie),ae=Z.add(ae,ie),me=Z.add(ae,Z.ONE),me=Z.mul(me,q.B),ye=Z.cmov(q.Z,Z.neg(ae),!Z.eql(ae,Z.ZERO)),ye=Z.mul(ye,q.A),ae=Z.sqr(me),K=Z.sqr(ye),ue=Z.mul(K,q.A),ae=Z.add(ae,ue),ae=Z.mul(ae,me),K=Z.mul(K,ye),ue=Z.mul(K,q.B),ae=Z.add(ae,ue),o=Z.mul(ie,me);const{isValid:A,value:I}=re(ae,K);h=Z.mul(ie,te),h=Z.mul(h,I),o=Z.cmov(o,me,A),h=Z.cmov(h,I,A);const O=Z.isOdd(te)===Z.isOdd(h);return h=Z.cmov(Z.neg(h),h,O),o=Z.div(o,ye),{x:o,y:h}}}},57340:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hash_to_ristretto255=F.hashToRistretto255=F.RistrettoPoint=F.encodeToCurve=F.hashToCurve=F.edwardsToMontgomeryPriv=F.edwardsToMontgomery=F.edwardsToMontgomeryPub=F.x25519=F.ed25519ph=F.ed25519ctx=F.ed25519=F.ED25519_TORSION_SUBGROUP=void 0;const i=f(44207),a=f(96492),x=f(45068),B=f(27661),m=f(63834),S=f(84097),g=f(75752),E=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),R=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),M=BigInt(0),_=BigInt(1),j=BigInt(2),P=BigInt(5),k=BigInt(10),z=BigInt(20),W=BigInt(40),V=BigInt(80);function Z(Xe){const Te=E,Se=Xe*Xe%Te*Xe%Te,Ee=(0,m.pow2)(Se,j,Te)*Se%Te,ve=(0,m.pow2)(Ee,_,Te)*Xe%Te,Ce=(0,m.pow2)(ve,P,Te)*ve%Te,Re=(0,m.pow2)(Ce,k,Te)*Ce%Te,Ye=(0,m.pow2)(Re,z,Te)*Re%Te,$e=(0,m.pow2)(Ye,W,Te)*Ye%Te,nt=(0,m.pow2)($e,V,Te)*$e%Te,Qe=(0,m.pow2)(nt,V,Te)*$e%Te,Tt=(0,m.pow2)(Qe,k,Te)*Ce%Te;return{pow_p_5_8:(0,m.pow2)(Tt,j,Te)*Xe%Te,b2:Se}}function q(Xe){return Xe[0]&=248,Xe[31]&=127,Xe[31]|=64,Xe}function re(Xe,Te){const ke=E,Se=(0,m.mod)(Te*Te*Te,ke),ve=Z(Xe*(0,m.mod)(Se*Se*Te,ke)).pow_p_5_8;let Ce=(0,m.mod)(Xe*Se*ve,ke);const Re=(0,m.mod)(Te*Ce*Ce,ke),Ye=Ce,$e=(0,m.mod)(Ce*R,ke),nt=Re===Xe,Qe=Re===(0,m.mod)(-Xe,ke),Tt=Re===(0,m.mod)(-Xe*R,ke);return nt&&(Ce=Ye),(Qe||Tt)&&(Ce=$e),(0,m.isNegativeLE)(Ce,ke)&&(Ce=(0,m.mod)(-Ce,ke)),{isValid:nt||Qe,value:Ce}}F.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const te=(0,m.Field)(E,void 0,!0),ie={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:te,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:i.sha512,randomBytes:a.randomBytes,adjustScalarBytes:q,uvRatio:re};function ae(Xe,Te,ke){if(Te.length>255)throw new Error("Context is too big");return(0,a.concatBytes)((0,a.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([ke?1:0,Te.length]),Te,Xe)}function me(Xe){const{y:Te}=F.ed25519.ExtendedPoint.fromHex(Xe),ke=BigInt(1);return te.toBytes(te.create((ke+Te)*te.inv(ke-Te)))}F.ed25519=(0,x.twistedEdwards)(ie),F.ed25519ctx=(0,x.twistedEdwards)({...ie,domain:ae}),F.ed25519ph=(0,x.twistedEdwards)({...ie,domain:ae,prehash:i.sha512}),F.x25519=(0,B.montgomery)({P:E,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:Xe=>{const Te=E,{pow_p_5_8:ke,b2:Se}=Z(Xe);return(0,m.mod)((0,m.pow2)(ke,BigInt(3),Te)*Se,Te)},adjustScalarBytes:q,randomBytes:a.randomBytes}),F.edwardsToMontgomeryPub=me,F.edwardsToMontgomery=me,F.edwardsToMontgomeryPriv=function ye(Xe){const Te=ie.hash(Xe.subarray(0,32));return ie.adjustScalarBytes(Te).subarray(0,32)};const ue=(te.ORDER+BigInt(3))/BigInt(8),K=te.pow(j,ue),o=te.sqrt(te.neg(te.ONE)),h=(te.ORDER-BigInt(5))/BigInt(8),A=BigInt(486662),O=(0,m.FpSqrtEven)(te,te.neg(BigInt(486664)));const H=(0,g.createHasher)(F.ed25519.ExtendedPoint,Xe=>function $(Xe){const{xMn:Te,xMd:ke,yMn:Se,yMd:Ee}=function I(Xe){let Te=te.sqr(Xe);Te=te.mul(Te,j);let ke=te.add(Te,te.ONE),Se=te.neg(A),Ee=te.sqr(ke),ve=te.mul(Ee,ke),Ce=te.mul(Te,A);Ce=te.mul(Ce,Se),Ce=te.add(Ce,Ee),Ce=te.mul(Ce,Se);let Re=te.sqr(ve);Ee=te.sqr(Re),Re=te.mul(Re,ve),Re=te.mul(Re,Ce),Ee=te.mul(Ee,Re);let Ye=te.pow(Ee,h);Ye=te.mul(Ye,Re);let $e=te.mul(Ye,o);Ee=te.sqr(Ye),Ee=te.mul(Ee,ve);let nt=te.eql(Ee,Ce),Qe=te.cmov($e,Ye,nt),Tt=te.mul(Se,Te),ct=te.mul(Ye,Xe);ct=te.mul(ct,K);let ze=te.mul(ct,o),St=te.mul(Ce,Te);Ee=te.sqr(ct),Ee=te.mul(Ee,ve);let ne=te.eql(Ee,St),X=te.cmov(ze,ct,ne);Ee=te.sqr(Qe),Ee=te.mul(Ee,ve);let G=te.eql(Ee,Ce),he=te.cmov(Tt,Se,G),_e=te.cmov(X,Qe,G),je=te.isOdd(_e);return _e=te.cmov(_e,te.neg(_e),G!==je),{xMn:he,xMd:ke,yMn:_e,yMd:_}}(Xe);let ve=te.mul(Te,Ee);ve=te.mul(ve,O);let Ce=te.mul(ke,Se),Re=te.sub(Te,ke),Ye=te.add(Te,ke),$e=te.mul(Ce,Ye),nt=te.eql($e,te.ZERO);ve=te.cmov(ve,te.ZERO,nt),Ce=te.cmov(Ce,te.ONE,nt),Re=te.cmov(Re,te.ONE,nt),Ye=te.cmov(Ye,te.ONE,nt);const Qe=te.invertBatch([Ce,Ye]);return{x:te.mul(ve,Qe[0]),y:te.mul(Re,Qe[1])}}(Xe[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:te.ORDER,m:1,k:128,expand:"xmd",hash:i.sha512});function D(Xe){if(!(Xe instanceof xe))throw new Error("RistrettoPoint expected")}F.hashToCurve=H.hashToCurve,F.encodeToCurve=H.encodeToCurve;const s=R,p=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Y=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),ee=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),oe=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),de=Xe=>re(_,Xe),Ae=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Ie=Xe=>F.ed25519.CURVE.Fp.create((0,S.bytesToNumberLE)(Xe)&Ae);function Le(Xe){const{d:Te}=F.ed25519.CURVE,ke=F.ed25519.CURVE.Fp.ORDER,Se=F.ed25519.CURVE.Fp.create,Ee=Se(s*Xe*Xe),ve=Se((Ee+_)*ee);let Ce=BigInt(-1);const Re=Se((Ce-Te*Ee)*Se(Ee+Te));let{isValid:Ye,value:$e}=re(ve,Re),nt=Se($e*Xe);(0,m.isNegativeLE)(nt,ke)||(nt=Se(-nt)),Ye||($e=nt),Ye||(Ce=Ee);const Qe=Se(Ce*(Ee-_)*oe-Re),Tt=$e*$e,ct=Se(($e+$e)*Re),ze=Se(Qe*p),St=Se(_-Tt),ne=Se(_+Tt);return new F.ed25519.ExtendedPoint(Se(ct*ne),Se(St*ze),Se(ze*ne),Se(ct*St))}class xe{constructor(Te){this.ep=Te}static fromAffine(Te){return new xe(F.ed25519.ExtendedPoint.fromAffine(Te))}static hashToCurve(Te){Te=(0,S.ensureBytes)("ristrettoHash",Te,64);const Se=Le(Ie(Te.slice(0,32))),ve=Le(Ie(Te.slice(32,64)));return new xe(Se.add(ve))}static fromHex(Te){Te=(0,S.ensureBytes)("ristrettoHex",Te,32);const{a:ke,d:Se}=F.ed25519.CURVE,Ee=F.ed25519.CURVE.Fp.ORDER,ve=F.ed25519.CURVE.Fp.create,Ce="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",Re=Ie(Te);if(!(0,S.equalBytes)((0,S.numberToBytesLE)(Re,32),Te)||(0,m.isNegativeLE)(Re,Ee))throw new Error(Ce);const Ye=ve(Re*Re),$e=ve(_+ke*Ye),nt=ve(_-ke*Ye),Qe=ve($e*$e),Tt=ve(nt*nt),ct=ve(ke*Se*Qe-Tt),{isValid:ze,value:St}=de(ve(ct*Tt)),ne=ve(St*nt),X=ve(St*ne*ct);let G=ve((Re+Re)*ne);(0,m.isNegativeLE)(G,Ee)&&(G=ve(-G));const he=ve($e*X),_e=ve(G*he);if(!ze||(0,m.isNegativeLE)(_e,Ee)||he===M)throw new Error(Ce);return new xe(new F.ed25519.ExtendedPoint(G,he,_,_e))}toRawBytes(){let{ex:Te,ey:ke,ez:Se,et:Ee}=this.ep;const ve=F.ed25519.CURVE.Fp.ORDER,Ce=F.ed25519.CURVE.Fp.create,Re=Ce(Ce(Se+ke)*Ce(Se-ke)),Ye=Ce(Te*ke),$e=Ce(Ye*Ye),{value:nt}=de(Ce(Re*$e)),Qe=Ce(nt*Re),Tt=Ce(nt*Ye),ct=Ce(Qe*Tt*Ee);let ze;if((0,m.isNegativeLE)(Ee*ct,ve)){let ne=Ce(ke*s),X=Ce(Te*s);Te=ne,ke=X,ze=Ce(Qe*Y)}else ze=Tt;(0,m.isNegativeLE)(Te*ct,ve)&&(ke=Ce(-ke));let St=Ce((Se-ke)*ze);return(0,m.isNegativeLE)(St,ve)&&(St=Ce(-St)),(0,S.numberToBytesLE)(St,32)}toHex(){return(0,S.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(Te){D(Te);const{ex:ke,ey:Se}=this.ep,{ex:Ee,ey:ve}=Te.ep,Ce=F.ed25519.CURVE.Fp.create,Re=Ce(ke*ve)===Ce(Se*Ee),Ye=Ce(Se*ve)===Ce(ke*Ee);return Re||Ye}add(Te){return D(Te),new xe(this.ep.add(Te.ep))}subtract(Te){return D(Te),new xe(this.ep.subtract(Te.ep))}multiply(Te){return new xe(this.ep.multiply(Te))}multiplyUnsafe(Te){return new xe(this.ep.multiplyUnsafe(Te))}double(){return new xe(this.ep.double())}negate(){return new xe(this.ep.negate())}}F.RistrettoPoint=(xe.BASE||(xe.BASE=new xe(F.ed25519.ExtendedPoint.BASE)),xe.ZERO||(xe.ZERO=new xe(F.ed25519.ExtendedPoint.ZERO)),xe),F.hashToRistretto255=(Xe,Te)=>{const ke=Te.DST,Se="string"==typeof ke?(0,a.utf8ToBytes)(ke):ke,Ee=(0,g.expand_message_xmd)(Xe,Se,64,i.sha512);return xe.hashToCurve(Ee)},F.hash_to_ristretto255=F.hashToRistretto255},91717:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.encodeToCurve=F.hashToCurve=F.schnorr=F.secp256k1=void 0;const i=f(1806),a=f(96492),x=f(63834),B=f(73040),m=f(84097),S=f(75752),g=f(4521),E=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),R=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),M=BigInt(1),_=BigInt(2),j=(D,s)=>(D+s/_)/s;function P(D){const s=E,p=BigInt(3),Y=BigInt(6),ee=BigInt(11),oe=BigInt(22),de=BigInt(23),Ae=BigInt(44),Ie=BigInt(88),Le=D*D*D%s,xe=Le*Le*D%s,De=(0,x.pow2)(xe,p,s)*xe%s,Xe=(0,x.pow2)(De,p,s)*xe%s,Te=(0,x.pow2)(Xe,_,s)*Le%s,ke=(0,x.pow2)(Te,ee,s)*Te%s,Se=(0,x.pow2)(ke,oe,s)*ke%s,Ee=(0,x.pow2)(Se,Ae,s)*Se%s,ve=(0,x.pow2)(Ee,Ie,s)*Ee%s,Ce=(0,x.pow2)(ve,Ae,s)*Se%s,Re=(0,x.pow2)(Ce,p,s)*xe%s,Ye=(0,x.pow2)(Re,de,s)*ke%s,$e=(0,x.pow2)(Ye,Y,s)*Le%s,nt=(0,x.pow2)($e,_,s);if(!k.eql(k.sqr(nt),D))throw new Error("Cannot find square root");return nt}const k=(0,x.Field)(E,void 0,void 0,{sqrt:P});F.secp256k1=(0,g.createCurve)({a:BigInt(0),b:BigInt(7),Fp:k,n:R,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:D=>{const s=R,p=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),Y=-M*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),ee=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),oe=p,de=BigInt("0x100000000000000000000000000000000"),Ae=j(oe*D,s),Ie=j(-Y*D,s);let Le=(0,x.mod)(D-Ae*p-Ie*ee,s),xe=(0,x.mod)(-Ae*Y-Ie*oe,s);const De=Le>de,Xe=xe>de;if(De&&(Le=s-Le),Xe&&(xe=s-xe),Le>de||xe>de)throw new Error("splitScalar: Endomorphism failed, k="+D);return{k1neg:De,k1:Le,k2neg:Xe,k2:xe}}}},i.sha256);const z=BigInt(0),W=D=>"bigint"==typeof D&&zee.charCodeAt(0)));p=(0,m.concatBytes)(Y,Y),Z[D]=p}return(0,i.sha256)((0,m.concatBytes)(p,...s))}const re=D=>D.toRawBytes(!0).slice(1),te=D=>(0,m.numberToBytesBE)(D,32),ie=D=>(0,x.mod)(D,E),ae=D=>(0,x.mod)(D,R),me=F.secp256k1.ProjectivePoint;function ue(D){let s=F.secp256k1.utils.normPrivateKeyToScalar(D),p=me.fromPrivateKey(s);return{scalar:p.hasEvenY()?s:ae(-s),bytes:re(p)}}function K(D){if(!W(D))throw new Error("bad x: need 0 < x < p");const s=ie(D*D);let Y=P(ie(s*D+BigInt(7)));Y%_!==z&&(Y=ie(-Y));const ee=new me(D,Y,M);return ee.assertValidity(),ee}function o(...D){return ae((0,m.bytesToNumberBE)(q("BIP0340/challenge",...D)))}function I(D,s,p){const Y=(0,m.ensureBytes)("signature",D,64),ee=(0,m.ensureBytes)("message",s),oe=(0,m.ensureBytes)("publicKey",p,32);try{const de=K((0,m.bytesToNumberBE)(oe)),Ae=(0,m.bytesToNumberBE)(Y.subarray(0,32));if(!W(Ae))return!1;const Ie=(0,m.bytesToNumberBE)(Y.subarray(32,64));if(!(D=>"bigint"==typeof D&&zme.BASE.multiplyAndAddUnsafe(D,s,p))(de,Ie,ae(-Le));return!(!xe||!xe.hasEvenY()||xe.toAffine().x!==Ae)}catch{return!1}}F.schnorr={getPublicKey:function h(D){return ue(D).bytes},sign:function A(D,s,p=(0,a.randomBytes)(32)){const Y=(0,m.ensureBytes)("message",D),{bytes:ee,scalar:oe}=ue(s),de=(0,m.ensureBytes)("auxRand",p,32),Ae=te(oe^(0,m.bytesToNumberBE)(q("BIP0340/aux",de))),Ie=q("BIP0340/nonce",Ae,ee,Y),Le=ae((0,m.bytesToNumberBE)(Ie));if(Le===z)throw new Error("sign failed: k is zero");const{bytes:xe,scalar:De}=ue(Le),Xe=o(xe,ee,Y),Te=new Uint8Array(64);if(Te.set(xe,0),Te.set(te(ae(De+Xe*oe)),32),!I(Te,Y,ee))throw new Error("sign: Invalid signature produced");return Te},verify:I,utils:{randomPrivateKey:F.secp256k1.utils.randomPrivateKey,lift_x:K,pointToBytes:re,numberToBytesBE:m.numberToBytesBE,bytesToNumberBE:m.bytesToNumberBE,taggedHash:q,mod:x.mod}};const O=(0,S.isogenyMap)(k,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(D=>D.map(s=>BigInt(s)))),$=(0,B.mapToCurveSimpleSWU)(k,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:k.create(BigInt("-11"))}),H=(0,S.createHasher)(F.secp256k1.ProjectivePoint,D=>{const{x:s,y:p}=$(k.create(D[0]));return O(s,p)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:k.ORDER,m:1,k:128,expand:"xmd",hash:i.sha256});F.hashToCurve=H.hashToCurve,F.encodeToCurve=H.encodeToCurve},68578:(Me,F)=>{"use strict";function f(E){if(!Number.isSafeInteger(E)||E<0)throw new Error(`Wrong positive integer: ${E}`)}function i(E){if("boolean"!=typeof E)throw new Error(`Expected boolean, not ${E}`)}function x(E,...R){if(!function a(E){return E instanceof Uint8Array||null!=E&&"object"==typeof E&&"Uint8Array"===E.constructor.name}(E))throw new Error("Expected Uint8Array");if(R.length>0&&!R.includes(E.length))throw new Error(`Expected Uint8Array of length ${R}, not of length=${E.length}`)}function B(E){if("function"!=typeof E||"function"!=typeof E.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");f(E.outputLen),f(E.blockLen)}function m(E,R=!0){if(E.destroyed)throw new Error("Hash instance has been destroyed");if(R&&E.finished)throw new Error("Hash#digest() has already been called")}function S(E,R){x(E);const M=R.outputLen;if(E.length{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SHA2=void 0;const i=f(68578),a=f(96492);F.SHA2=class B extends a.Hash{constructor(S,g,E,R){super(),this.blockLen=S,this.outputLen=g,this.padOffset=E,this.isLE=R,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(S),this.view=(0,a.createView)(this.buffer)}update(S){(0,i.exists)(this);const{view:g,buffer:E,blockLen:R}=this,M=(S=(0,a.toBytes)(S)).length;for(let _=0;_R-_&&(this.process(E,0),_=0);for(let W=_;W>R&M),j=Number(g&M),k=E?0:4;m.setUint32(S+(E?4:0),_,E),m.setUint32(S+k,j,E)})(E,R-8,BigInt(8*this.length),M),this.process(E,0);const j=(0,a.createView)(S),P=this.outputLen;if(P%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const k=P/4,z=this.get();if(k>z.length)throw new Error("_sha2: outputLen bigger than state");for(let W=0;W{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.add5L=F.add5H=F.add4H=F.add4L=F.add3H=F.add3L=F.add=F.rotlBL=F.rotlBH=F.rotlSL=F.rotlSH=F.rotr32L=F.rotr32H=F.rotrBL=F.rotrBH=F.rotrSL=F.rotrSH=F.shrSL=F.shrSH=F.toBig=F.split=F.fromBig=void 0;const f=BigInt(2**32-1),i=BigInt(32);function a(ye,ue=!1){return ue?{h:Number(ye&f),l:Number(ye>>i&f)}:{h:0|Number(ye>>i&f),l:0|Number(ye&f)}}function x(ye,ue=!1){let K=new Uint32Array(ye.length),o=new Uint32Array(ye.length);for(let h=0;hBigInt(ye>>>0)<>>0);F.toBig=B;const m=(ye,ue,K)=>ye>>>K;F.shrSH=m;const S=(ye,ue,K)=>ye<<32-K|ue>>>K;F.shrSL=S;const g=(ye,ue,K)=>ye>>>K|ue<<32-K;F.rotrSH=g;const E=(ye,ue,K)=>ye<<32-K|ue>>>K;F.rotrSL=E;const R=(ye,ue,K)=>ye<<64-K|ue>>>K-32;F.rotrBH=R;const M=(ye,ue,K)=>ye>>>K-32|ue<<64-K;F.rotrBL=M;const _=(ye,ue)=>ue;F.rotr32H=_;const j=(ye,ue)=>ye;F.rotr32L=j;const P=(ye,ue,K)=>ye<>>32-K;F.rotlSH=P;const k=(ye,ue,K)=>ue<>>32-K;F.rotlSL=k;const z=(ye,ue,K)=>ue<>>64-K;F.rotlBH=z;const W=(ye,ue,K)=>ye<>>64-K;function V(ye,ue,K,o){const h=(ue>>>0)+(o>>>0);return{h:ye+K+(h/2**32|0)|0,l:0|h}}F.rotlBL=W,F.add=V;const Z=(ye,ue,K)=>(ye>>>0)+(ue>>>0)+(K>>>0);F.add3L=Z;const q=(ye,ue,K,o)=>ue+K+o+(ye/2**32|0)|0;F.add3H=q;const re=(ye,ue,K,o)=>(ye>>>0)+(ue>>>0)+(K>>>0)+(o>>>0);F.add4L=re;const te=(ye,ue,K,o,h)=>ue+K+o+h+(ye/2**32|0)|0;F.add4H=te;const ie=(ye,ue,K,o,h)=>(ye>>>0)+(ue>>>0)+(K>>>0)+(o>>>0)+(h>>>0);F.add5L=ie;const ae=(ye,ue,K,o,h,A)=>ue+K+o+h+A+(ye/2**32|0)|0;F.add5H=ae,F.default={fromBig:a,split:x,toBig:B,shrSH:m,shrSL:S,rotrSH:g,rotrSL:E,rotrBH:R,rotrBL:M,rotr32H:_,rotr32L:j,rotlSH:P,rotlSL:k,rotlBH:z,rotlBL:W,add:V,add3L:Z,add3H:q,add4L:re,add4H:te,add5H:ae,add5L:ie}},89948:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.crypto=void 0,F.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},57334:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hkdf=F.expand=F.extract=void 0;const i=f(68578),a=f(96492),x=f(44882);function B(R,M,_){return(0,i.hash)(R),void 0===_&&(_=new Uint8Array(R.outputLen)),(0,x.hmac)(R,(0,a.toBytes)(_),(0,a.toBytes)(M))}F.extract=B;const m=new Uint8Array([0]),S=new Uint8Array;function g(R,M,_,j=32){if((0,i.hash)(R),(0,i.number)(j),j>255*R.outputLen)throw new Error("Length should be <= 255*HashLen");const P=Math.ceil(j/R.outputLen);void 0===_&&(_=S);const k=new Uint8Array(P*R.outputLen),z=x.hmac.create(R,M),W=z._cloneInto(),V=new Uint8Array(z.outputLen);for(let Z=0;Zg(R,B(R,M,_),j,P)},44882:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hmac=F.HMAC=void 0;const i=f(68578),a=f(96492);class x extends a.Hash{constructor(S,g){super(),this.finished=!1,this.destroyed=!1,(0,i.hash)(S);const E=(0,a.toBytes)(g);if(this.iHash=S.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const R=this.blockLen,M=new Uint8Array(R);M.set(E.length>R?S.create().update(E).digest():E);for(let _=0;_new x(m,S).update(g).digest(),F.hmac.create=(m,S)=>new x(m,S)},1806:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.sha224=F.sha256=void 0;const i=f(25724),a=f(96492),x=(M,_,j)=>M&_^~M&j,B=(M,_,j)=>M&_^M&j^_&j,m=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),S=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),g=new Uint32Array(64);class E extends i.SHA2{constructor(){super(64,32,8,!1),this.A=0|S[0],this.B=0|S[1],this.C=0|S[2],this.D=0|S[3],this.E=0|S[4],this.F=0|S[5],this.G=0|S[6],this.H=0|S[7]}get(){const{A:_,B:j,C:P,D:k,E:z,F:W,G:V,H:Z}=this;return[_,j,P,k,z,W,V,Z]}set(_,j,P,k,z,W,V,Z){this.A=0|_,this.B=0|j,this.C=0|P,this.D=0|k,this.E=0|z,this.F=0|W,this.G=0|V,this.H=0|Z}process(_,j){for(let te=0;te<16;te++,j+=4)g[te]=_.getUint32(j,!1);for(let te=16;te<64;te++){const ie=g[te-15],ae=g[te-2],me=(0,a.rotr)(ie,7)^(0,a.rotr)(ie,18)^ie>>>3,ye=(0,a.rotr)(ae,17)^(0,a.rotr)(ae,19)^ae>>>10;g[te]=ye+g[te-7]+me+g[te-16]|0}let{A:P,B:k,C:z,D:W,E:V,F:Z,G:q,H:re}=this;for(let te=0;te<64;te++){const ae=re+((0,a.rotr)(V,6)^(0,a.rotr)(V,11)^(0,a.rotr)(V,25))+x(V,Z,q)+m[te]+g[te]|0,ye=((0,a.rotr)(P,2)^(0,a.rotr)(P,13)^(0,a.rotr)(P,22))+B(P,k,z)|0;re=q,q=Z,Z=V,V=W+ae|0,W=z,z=k,k=P,P=ae+ye|0}P=P+this.A|0,k=k+this.B|0,z=z+this.C|0,W=W+this.D|0,V=V+this.E|0,Z=Z+this.F|0,q=q+this.G|0,re=re+this.H|0,this.set(P,k,z,W,V,Z,q,re)}roundClean(){g.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class R extends E{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}F.sha256=(0,a.wrapConstructor)(()=>new E),F.sha224=(0,a.wrapConstructor)(()=>new R)},44207:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.sha384=F.sha512_256=F.sha512_224=F.sha512=F.SHA512=void 0;const i=f(25724),a=f(35059),x=f(96492),[B,m]=a.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(j=>BigInt(j))),S=new Uint32Array(80),g=new Uint32Array(80);class E extends i.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:P,Al:k,Bh:z,Bl:W,Ch:V,Cl:Z,Dh:q,Dl:re,Eh:te,El:ie,Fh:ae,Fl:me,Gh:ye,Gl:ue,Hh:K,Hl:o}=this;return[P,k,z,W,V,Z,q,re,te,ie,ae,me,ye,ue,K,o]}set(P,k,z,W,V,Z,q,re,te,ie,ae,me,ye,ue,K,o){this.Ah=0|P,this.Al=0|k,this.Bh=0|z,this.Bl=0|W,this.Ch=0|V,this.Cl=0|Z,this.Dh=0|q,this.Dl=0|re,this.Eh=0|te,this.El=0|ie,this.Fh=0|ae,this.Fl=0|me,this.Gh=0|ye,this.Gl=0|ue,this.Hh=0|K,this.Hl=0|o}process(P,k){for(let I=0;I<16;I++,k+=4)S[I]=P.getUint32(k),g[I]=P.getUint32(k+=4);for(let I=16;I<80;I++){const O=0|S[I-15],$=0|g[I-15],H=a.default.rotrSH(O,$,1)^a.default.rotrSH(O,$,8)^a.default.shrSH(O,$,7),D=a.default.rotrSL(O,$,1)^a.default.rotrSL(O,$,8)^a.default.shrSL(O,$,7),s=0|S[I-2],p=0|g[I-2],Y=a.default.rotrSH(s,p,19)^a.default.rotrBH(s,p,61)^a.default.shrSH(s,p,6),ee=a.default.rotrSL(s,p,19)^a.default.rotrBL(s,p,61)^a.default.shrSL(s,p,6),oe=a.default.add4L(D,ee,g[I-7],g[I-16]),de=a.default.add4H(oe,H,Y,S[I-7],S[I-16]);S[I]=0|de,g[I]=0|oe}let{Ah:z,Al:W,Bh:V,Bl:Z,Ch:q,Cl:re,Dh:te,Dl:ie,Eh:ae,El:me,Fh:ye,Fl:ue,Gh:K,Gl:o,Hh:h,Hl:A}=this;for(let I=0;I<80;I++){const O=a.default.rotrSH(ae,me,14)^a.default.rotrSH(ae,me,18)^a.default.rotrBH(ae,me,41),$=a.default.rotrSL(ae,me,14)^a.default.rotrSL(ae,me,18)^a.default.rotrBL(ae,me,41),H=ae&ye^~ae&K,s=a.default.add5L(A,$,me&ue^~me&o,m[I],g[I]),p=a.default.add5H(s,h,O,H,B[I],S[I]),Y=0|s,ee=a.default.rotrSH(z,W,28)^a.default.rotrBH(z,W,34)^a.default.rotrBH(z,W,39),oe=a.default.rotrSL(z,W,28)^a.default.rotrBL(z,W,34)^a.default.rotrBL(z,W,39),de=z&V^z&q^V&q,Ae=W&Z^W&re^Z&re;h=0|K,A=0|o,K=0|ye,o=0|ue,ye=0|ae,ue=0|me,({h:ae,l:me}=a.default.add(0|te,0|ie,0|p,0|Y)),te=0|q,ie=0|re,q=0|V,re=0|Z,V=0|z,Z=0|W;const Ie=a.default.add3L(Y,oe,Ae);z=a.default.add3H(Ie,p,ee,de),W=0|Ie}({h:z,l:W}=a.default.add(0|this.Ah,0|this.Al,0|z,0|W)),({h:V,l:Z}=a.default.add(0|this.Bh,0|this.Bl,0|V,0|Z)),({h:q,l:re}=a.default.add(0|this.Ch,0|this.Cl,0|q,0|re)),({h:te,l:ie}=a.default.add(0|this.Dh,0|this.Dl,0|te,0|ie)),({h:ae,l:me}=a.default.add(0|this.Eh,0|this.El,0|ae,0|me)),({h:ye,l:ue}=a.default.add(0|this.Fh,0|this.Fl,0|ye,0|ue)),({h:K,l:o}=a.default.add(0|this.Gh,0|this.Gl,0|K,0|o)),({h,l:A}=a.default.add(0|this.Hh,0|this.Hl,0|h,0|A)),this.set(z,W,V,Z,q,re,te,ie,ae,me,ye,ue,K,o,h,A)}roundClean(){S.fill(0),g.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}F.SHA512=E;class R extends E{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class M extends E{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class _ extends E{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}F.sha512=(0,x.wrapConstructor)(()=>new E),F.sha512_224=(0,x.wrapConstructor)(()=>new R),F.sha512_256=(0,x.wrapConstructor)(()=>new M),F.sha384=(0,x.wrapConstructor)(()=>new _)},96492:(Me,F,f)=>{"use strict";var i=f(29293).default;Object.defineProperty(F,"__esModule",{value:!0}),F.randomBytes=F.wrapXOFConstructorWithOpts=F.wrapConstructorWithOpts=F.wrapConstructor=F.checkOpts=F.Hash=F.concatBytes=F.toBytes=F.utf8ToBytes=F.asyncLoop=F.nextTick=F.hexToBytes=F.bytesToHex=F.isLE=F.rotr=F.createView=F.u32=F.u8=void 0;const a=f(89948);function m(ue){return ue instanceof Uint8Array||null!=ue&&"object"==typeof ue&&"Uint8Array"===ue.constructor.name}if(F.u8=ue=>new Uint8Array(ue.buffer,ue.byteOffset,ue.byteLength),F.u32=ue=>new Uint32Array(ue.buffer,ue.byteOffset,Math.floor(ue.byteLength/4)),F.createView=ue=>new DataView(ue.buffer,ue.byteOffset,ue.byteLength),F.rotr=(ue,K)=>ue<<32-K|ue>>>K,F.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!F.isLE)throw new Error("Non little-endian hardware is not supported");const E=Array.from({length:256},(ue,K)=>K.toString(16).padStart(2,"0"));F.bytesToHex=function R(ue){if(!m(ue))throw new Error("Uint8Array expected");let K="";for(let o=0;o=M__0&&ue<=M__9?ue-M__0:ue>=M__A&&ue<=M__F?ue-(M__A-10):ue>=M__a&&ue<=M__f?ue-(M__a-10):void 0}function z(){return(z=i(function*(ue,K,o){let h=Date.now();for(let A=0;A=0&&Iue().update(V(h)).digest(),o=ue();return K.outputLen=o.outputLen,K.blockLen=o.blockLen,K.create=()=>ue(),K},F.wrapConstructorWithOpts=function ae(ue){const K=(h,A)=>ue(A).update(V(h)).digest(),o=ue({});return K.outputLen=o.outputLen,K.blockLen=o.blockLen,K.create=h=>ue(h),K},F.wrapXOFConstructorWithOpts=function me(ue){const K=(h,A)=>ue(A).update(V(h)).digest(),o=ue({});return K.outputLen=o.outputLen,K.blockLen=o.blockLen,K.create=h=>ue(h),K},F.randomBytes=function ye(ue=32){if(a.crypto&&"function"==typeof a.crypto.getRandomValues)return a.crypto.getRandomValues(new Uint8Array(ue));throw new Error("crypto.getRandomValues must be defined")}},15315:(Me,F,f)=>{"use strict";var o,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,g=(o,h)=>{var A={};for(var I in o)m.call(o,I)&&h.indexOf(I)<0&&(A[I]=o[I]);if(null!=o&&B)for(var I of B(o))h.indexOf(I)<0&&S.call(o,I)&&(A[I]=o[I]);return A},_=(o,h,A)=>new Promise((I,O)=>{var $=s=>{try{D(A.next(s))}catch(p){O(p)}},H=s=>{try{D(A.throw(s))}catch(p){O(p)}},D=s=>s.done?I(s.value):Promise.resolve(s.value).then($,H);D((A=A.apply(o,h)).next())}),j={};((o,h)=>{for(var A in h)i(o,A,{get:h[A],enumerable:!0})})(j,{createHashMapping:()=>ae,createHashMappingSync:()=>me,decodeJwt:()=>z,decodeSdJwt:()=>V,decodeSdJwtSync:()=>Z,getClaims:()=>q,getClaimsSync:()=>re,getSDAlgAndPayload:()=>ye,splitSdJwt:()=>W,unpack:()=>ue,unpackArray:()=>te,unpackObj:()=>ie,unpackSync:()=>K}),Me.exports=(o=j,((o,h,A,I)=>{if(h&&"object"==typeof h||"function"==typeof h)for(let O of x(h))!m.call(o,O)&&undefined!==O&&i(o,O,{get:()=>h[O],enumerable:!(I=a(h,O))||I.enumerable});return o})(i({},"__esModule",{value:!0}),o));var P=f(47862),k=f(29994),z=o=>{const{0:h,1:A,2:I,length:O}=o.split(".");if(3!==O)throw new P.SDJWTException("Invalid JWT as input");return{header:JSON.parse((0,P.base64urlDecode)(h)),payload:JSON.parse((0,P.base64urlDecode)(A)),signature:I}},W=o=>{const[h,...A]=o.split(k.SD_SEPARATOR);if(0===A.length)return{jwt:h,disclosures:[]};const I=A.pop();return{jwt:h,disclosures:A,kbJwt:I||void 0}},V=(o,h)=>_(void 0,null,function*(){const[A,...I]=o.split(k.SD_SEPARATOR),O=z(A);if(0===I.length)return{jwt:O,disclosures:[]};const $=I.pop(),H=$?z($):void 0,{_sd_alg:D}=ye(O.payload);return{jwt:O,disclosures:yield Promise.all(I.map(p=>P.Disclosure.fromEncode(p,{alg:D,hasher:h}))),kbJwt:H}}),Z=(o,h)=>{const[A,...I]=o.split(k.SD_SEPARATOR),O=z(A);if(0===I.length)return{jwt:O,disclosures:[]};const $=I.pop(),H=$?z($):void 0,{_sd_alg:D}=ye(O.payload);return{jwt:O,disclosures:I.map(p=>P.Disclosure.fromEncodeSync(p,{alg:D,hasher:h})),kbJwt:H}},q=(o,h,A)=>_(void 0,null,function*(){const{unpackedObj:I}=yield ue(o,h,A);return I}),re=(o,h,A)=>{const{unpackedObj:I}=K(o,h,A);return I},te=(o,h,A="")=>{const I={},O=[];return o.forEach(($,H)=>{if("object"==typeof $&&null!==$){const D=$[k.SD_LIST_KEY];if(D){const s=h[D];if(s){const p=A?`${A}.${H}`:`${H}`;I[p]=D;const{unpackedObj:Y,disclosureKeymap:ee}=ie(s.value,h,p);O.push(Y),Object.assign(I,ee)}}else{const s=A?`${A}.${H}`:`${H}`,{unpackedObj:p,disclosureKeymap:Y}=ie($,h,s);O.push(p),Object.assign(I,Y)}}else O.push($)}),{unpackedObj:O,disclosureKeymap:I}},ie=(o,h,A="")=>{const I={};if("object"==typeof o&&null!==o){if(Array.isArray(o))return te(o,h,A);for(const p in o)if(p!==k.SD_DIGEST&&p!==k.SD_LIST_KEY&&"object"==typeof o[p]){const Y=A?`${A}.${p}`:p,{unpackedObj:ee,disclosureKeymap:oe}=ie(o[p],h,Y);o[p]=ee,Object.assign(I,oe)}const O=o,{_sd:$}=O,H=g(O,["_sd"]),D={};if($)for(const p of $){const Y=h[p];if(Y?.key){const ee=A?`${A}.${Y.key}`:Y.key;I[ee]=p;const{unpackedObj:oe,disclosureKeymap:de}=ie(Y.value,h,ee);D[Y.key]=oe,Object.assign(I,de)}}return{unpackedObj:Object.assign(H,D),disclosureKeymap:I}}return{unpackedObj:o,disclosureKeymap:I}},ae=(o,h)=>_(void 0,null,function*(){const A={};for(let I=0;I{const A={};for(let I=0;I{const h=o,{_sd_alg:A}=h,I=g(h,["_sd_alg"]);return"string"!=typeof A?{_sd_alg:"sha-256",payload:I}:{_sd_alg:A,payload:I}},ue=(o,h,A)=>_(void 0,null,function*(){const{_sd_alg:I,payload:O}=ye(o),H=yield ae(h,{hasher:A,alg:I});return ie(O,H)}),K=(o,h,A)=>{const{_sd_alg:I,payload:O}=ye(o),H=me(h,{hasher:A,alg:I});return ie(O,H)}},22084:(Me,F,f)=>{"use strict";var re,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.prototype.hasOwnProperty,E=(re,te,ie)=>new Promise((ae,me)=>{var ye=o=>{try{K(ie.next(o))}catch(h){me(h)}},ue=o=>{try{K(ie.throw(o))}catch(h){me(h)}},K=o=>o.done?ae(o.value):Promise.resolve(o.value).then(ye,ue);K((ie=ie.apply(re,te)).next())}),R={};((re,te)=>{for(var ie in te)i(re,ie,{get:te[ie],enumerable:!0})})(R,{createHashMappingForSerializedDisclosure:()=>Z,present:()=>z,presentSync:()=>W,presentableKeys:()=>P,presentableKeysSync:()=>k,selectDisclosures:()=>q,transformPresentationFrame:()=>V}),Me.exports=(re=R,((re,te,ie,ae)=>{if(te&&"object"==typeof te||"function"==typeof te)for(let me of x(te))!B.call(re,me)&&undefined!==me&&i(re,me,{get:()=>te[me],enumerable:!(ae=a(te,me))||ae.enumerable});return re})(i({},"__esModule",{value:!0}),re));var M=f(29994),_=f(47862),j=f(15315),P=(re,te,ie)=>E(void 0,null,function*(){const{disclosureKeymap:ae}=yield(0,j.unpack)(re,te,ie);return Object.keys(ae).sort()}),k=(re,te,ie)=>{const{disclosureKeymap:ae}=(0,j.unpackSync)(re,te,ie);return Object.keys(ae).sort()},z=(re,te,ie)=>E(void 0,null,function*(){const{jwt:ae,kbJwt:me}=(0,j.splitSdJwt)(re),{jwt:{payload:ye},disclosures:ue}=yield(0,j.decodeSdJwt)(re,ie),{_sd_alg:K}=(0,j.getSDAlgAndPayload)(ye),o={alg:K,hasher:ie},h=V(te),A=yield(0,j.createHashMapping)(ue,o),{disclosureKeymap:I}=yield(0,j.unpack)(ye,ue,ie);return[ae,...h.map($=>A[I[$]]).filter($=>void 0!==$).map($=>$.encode()),me??""].join(M.SD_SEPARATOR)}),W=(re,te,ie)=>{const{jwt:ae,kbJwt:me}=(0,j.splitSdJwt)(re),{jwt:{payload:ye},disclosures:ue}=(0,j.decodeSdJwtSync)(re,ie),{_sd_alg:K}=(0,j.getSDAlgAndPayload)(ye),o={alg:K,hasher:ie},h=V(te),A=(0,j.createHashMappingSync)(ue,o),{disclosureKeymap:I}=(0,j.unpackSync)(ye,ue,ie);return[ae,...h.map($=>A[I[$]]).filter($=>void 0!==$).map($=>$.encode()),me??""].join(M.SD_SEPARATOR)},V=(re,te="")=>Object.entries(re).reduce((ie,[ae,me])=>{const ye=te?`${te}.${ae}`:ae;return"boolean"==typeof me?me&&ie.push(ye):ie.push(ye,...V(me,ye)),ie},[]),Z=re=>{const te={};for(let ie=0;ie{if(0===te.length)return[];const ae=Z(te),{disclosureKeymap:me}=(0,j.unpackObj)(re,ae);return V(ie).map(o=>ae[me[o]]).filter(o=>void 0!==o).map(o=>{const{salt:h,key:A,value:I,_digest:O}=o;if(!O)throw new _.SDJWTException("Implementation error: _digest is not defined");return{digest:O,encoded:o.encode(),salt:h,key:A,value:I}})}},29994:Me=>{"use strict";var j,F=Object.defineProperty,f=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,S={};((j,P)=>{for(var k in P)F(j,k,{get:P[k],enumerable:!0})})(S,{KB_JWT_TYP:()=>_,SD_DECOY:()=>M,SD_DIGEST:()=>R,SD_LIST_KEY:()=>E,SD_SEPARATOR:()=>g}),Me.exports=(j=S,((j,P,k,z)=>{if(P&&"object"==typeof P||"function"==typeof P)for(let W of i(P))!a.call(j,W)&&undefined!==W&&F(j,W,{get:()=>P[W],enumerable:!(z=f(P,W))||z.enumerable});return j})(F({},"__esModule",{value:!0}),j));var g="~",E="...",R="_sd",M="_sd_decoy",_="kb+jwt"},47862:(Me,F,f)=>{"use strict";var W,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.prototype.hasOwnProperty,E=(W,V,Z)=>new Promise((q,re)=>{var te=me=>{try{ae(Z.next(me))}catch(ye){re(ye)}},ie=me=>{try{ae(Z.throw(me))}catch(ye){re(ye)}},ae=me=>me.done?q(me.value):Promise.resolve(me.value).then(te,ie);ae((Z=Z.apply(W,V)).next())}),R={};((W,V)=>{for(var Z in V)i(W,Z,{get:V[Z],enumerable:!0})})(R,{Disclosure:()=>z,SDJWTException:()=>k,base64urlDecode:()=>j,base64urlEncode:()=>_,uint8ArrayToBase64Url:()=>P}),Me.exports=(W=R,((W,V,Z,q)=>{if(V&&"object"==typeof V||"function"==typeof V)for(let re of x(V))!B.call(W,re)&&undefined!==re&&i(W,re,{get:()=>V[re],enumerable:!(q=a(V,re))||q.enumerable});return W})(i({},"__esModule",{value:!0}),W));var M=f(12398),_=M.Base64.encodeURI,j=M.Base64.decode,P=W=>M.Base64.fromUint8Array(W,!0),k=class hO extends Error{constructor(V,Z){super(V),Object.setPrototypeOf(this,hO.prototype),this.name="SDJWTException",this.details=Z}getFullMessage(){return`${this.name}: ${this.message} ${this.details?`- ${JSON.stringify(this.details)}`:""}`}},z=class _M{constructor(V,Z){if(this._digest=Z?.digest,this._encoded=Z?.encoded,2===V.length)return this.salt=V[0],void(this.value=V[1]);if(3===V.length)return this.salt=V[0],this.key=V[1],void(this.value=V[2]);throw new k("Invalid disclosure data")}static fromEncode(V,Z){return E(this,null,function*(){const{hasher:q,alg:re}=Z,te=yield q(V,re),ie=P(te),ae=JSON.parse(j(V));return _M.fromArray(ae,{digest:ie,encoded:V})})}static fromEncodeSync(V,Z){const{hasher:q,alg:re}=Z,te=q(V,re),ie=P(te),ae=JSON.parse(j(V));return _M.fromArray(ae,{digest:ie,encoded:V})}static fromArray(V,Z){return new _M(V,Z)}encode(){return this._encoded||(this._encoded=_(JSON.stringify(this.decode()))),this._encoded}decode(){return this.key?[this.salt,this.key,this.value]:[this.salt,this.value]}digest(V){return E(this,null,function*(){const{hasher:Z,alg:q}=V;if(!this._digest){const re=yield Z(this.encode(),q);this._digest=P(re)}return this._digest})}digestSync(V){const{hasher:Z,alg:q}=V;if(!this._digest){const re=Z(this.encode(),q);this._digest=P(re)}return this._digest}}},47636:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(83858),F)},66091:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},80723:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},25515:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},18414:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},95517:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},37728:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},39762:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Directives=void 0,F.Directives={Required:"required",Allowed:"allowed",Disallowed:"disallowed"}},891:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ExchangeStatus=void 0,F.ExchangeStatus={Created:"CREATED",Submitted:"SUBMITTED",HolderDeclined:"HOLDER_DECLINED",Expired:"EXPIRED",Accepted:"ACCEPTED",VerifierDeclined:"VERIFIER_DECLINED"}},67847:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},40826:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},56911:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},17954:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},79506:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},23843:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},39711:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},5179:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},68020:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},54078:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},81755:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},83947:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},73725:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},87260:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},75873:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},83858:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(66091),F),a(f(80723),F),a(f(25515),F),a(f(18414),F),a(f(95517),F),a(f(37728),F),a(f(39762),F),a(f(891),F),a(f(67847),F),a(f(40826),F),a(f(56911),F),a(f(17954),F),a(f(79506),F),a(f(23843),F),a(f(39711),F),a(f(5179),F),a(f(68020),F),a(f(54078),F),a(f(81755),F),a(f(83947),F),a(f(73725),F),a(f(87260),F),a(f(75873),F),a(f(99959),F),a(f(41787),F),a(f(25526),F),a(f(8946),F),a(f(62704),F),a(f(13065),F),a(f(42834),F),a(f(32206),F),a(f(35723),F),a(f(31748),F),a(f(80125),F),a(f(9668),F),a(f(57669),F),a(f(56179),F),a(f(79369),F),a(f(6982),F),a(f(46521),F),a(f(28858),F),a(f(78029),F),a(f(3296),F)},99959:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},41787:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},25526:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Optionality=void 0,F.Optionality={Required:"required",Preferred:"preferred"}},8946:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},62704:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},13065:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},42834:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},32206:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},35723:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},31748:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},80125:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},9668:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},57669:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Rules=void 0,F.Rules={All:"all",Pick:"pick"}},56179:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},79369:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},6982:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Status=void 0,F.Status={Success:"SUCCESS",Warn:"WARN",Error:"ERROR"}},46521:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},28858:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},78029:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},3296:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},30720:(Me,F,f)=>{"use strict";F.E8=void 0;const a=f(2700);Object.defineProperty(F,"E8",{enumerable:!0,get:function(){return a.PEX}})},55776:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hasErrors=F.Checked=F.Status=void 0,F.Status={INFO:"info",WARN:"warn",ERROR:"error"},F.Checked=class{constructor(a,x,B){this.tag=a,this.status=x,this.message=B}},F.hasErrors=a=>a.filter(B=>function x(B){return B.status===F.Status.ERROR}(B)).length>0},97889:function(Me,F,f){"use strict";var i=this&&this.__awaiter||function(M,_,j,P){return new(j||(j=Promise))(function(z,W){function V(re){try{q(P.next(re))}catch(te){W(te)}}function Z(re){try{q(P.throw(re))}catch(te){W(te)}}function q(re){re.done?z(re.value):function k(z){return z instanceof j?z:new j(function(W){W(z)})}(re.value).then(V,Z)}q((P=P.apply(M,_||[])).next())})};Object.defineProperty(F,"__esModule",{value:!0}),F.PEX=void 0;const a=f(11151),x=f(55776),B=f(70143),m=f(64864),S=f(99938),g=f(13486),E=f(80930);class R{constructor(_){this._evaluationClientWrapper=new B.EvaluationClientWrapper,this.options=_}evaluatePresentation(_,j,P){var k,z,W;const V=void 0!==P?.generatePresentationSubmission?P.generatePresentationSubmission:void 0===P?.presentationSubmission,Z=S.SSITypesBuilder.toInternalPresentationDefinition(_),q=JSON.parse(JSON.stringify(j)),re=S.SSITypesBuilder.mapExternalVerifiablePresentationToWrappedVP(q,null===(k=this.options)||void 0===k?void 0:k.hasher),te=null!==(z=P?.presentationSubmission)&&void 0!==z?z:re.decoded.presentation_submission;if(!te&&!V)throw Error("Either a presentation submission as part of the VP or provided separately was expected");const ie=a.CredentialMapper.isW3cPresentation(re.presentation)&&re.presentation.holder?[re.presentation.holder]:[],ae=Object.assign(Object.assign({},P),{holderDIDs:ie,presentationSubmission:te,generatePresentationSubmission:V}),me=this._evaluationClientWrapper.evaluate(Z,re.vcs,ae);return!(null===(W=me.value)||void 0===W)&&W.descriptor_map.length&&(new B.EvaluationClientWrapper).selectFrom(Z,re.vcs,ae).areRequiredCredentialsPresent!==x.Status.ERROR&&(me.errors=[]),me}evaluateCredentials(_,j,P){var k;const z=S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j,null===(k=this.options)||void 0===k?void 0:k.hasher);this._evaluationClientWrapper=new B.EvaluationClientWrapper;const W=S.SSITypesBuilder.toInternalPresentationDefinition(_),V=this._evaluationClientWrapper.evaluate(W,z,P);if(V.value&&V.value.descriptor_map.length){const q=(new B.EvaluationClientWrapper).selectFrom(W,z,P);V.areRequiredCredentialsPresent=q.areRequiredCredentialsPresent,V.errors=q.errors}else V.areRequiredCredentialsPresent=x.Status.ERROR;return V}selectFrom(_,j,P){var k;const z=JSON.parse(JSON.stringify(j)),W=S.SSITypesBuilder.toInternalPresentationDefinition(_);return this._evaluationClientWrapper=new B.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(W,S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(z,null===(k=this.options)||void 0===k?void 0:k.hasher),P)}presentationSubmissionFrom(_,j,P){var k;const z=S.SSITypesBuilder.toInternalPresentationDefinition(_);return this._evaluationClientWrapper.submissionFrom(z,S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j,null===(k=this.options)||void 0===k?void 0:k.hasher),P)}presentationFrom(_,j,P){var k,z;const W=this.presentationSubmissionFrom(_,j,P),V=j.some(re=>a.CredentialMapper.isSdJwtDecodedCredential(re)||a.CredentialMapper.isSdJwtEncoded(re));if(P?.presentationSubmissionLocation===m.PresentationSubmissionLocation.PRESENTATION&&V)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const Z=null!==(k=P?.presentationSubmissionLocation)&&void 0!==k?k:V?m.PresentationSubmissionLocation.EXTERNAL:m.PresentationSubmissionLocation.PRESENTATION;return{presentation:R.constructPresentation(j,Object.assign(Object.assign({},P),{presentationSubmission:Z===m.PresentationSubmissionLocation.PRESENTATION?W:void 0,hasher:null===(z=this.options)||void 0===z?void 0:z.hasher})),presentationSubmissionLocation:Z,presentationSubmission:W}}static constructPresentation(_,j){var P,k,z,W;const V=Array.isArray(_)?_:[_];if(V.some(Z=>a.CredentialMapper.isSdJwtDecodedCredential(Z)||a.CredentialMapper.isSdJwtEncoded(Z))){if(V.length>1)throw new Error("Only a single credential is supported when creating a presentation with an SD-JWT VC");if(j?.presentationSubmission)throw new Error("Presentation submission cannot be included in the presentation when creating a presentation with an SD-JWT VC");if(j?.basePresentationPayload)throw new Error("Base presentation payload cannot be when creating a presentation from an SD-JWT VC");const Z=a.CredentialMapper.isSdJwtEncoded(V[0])?a.CredentialMapper.decodeVerifiableCredential(V[0],j?.hasher):V[0];if(!j?.hasher)throw new Error("Hasher must be provided when creating a presentation with an SD-JWT VC");const q=null!==(P=Z.signedPayload._sd_alg)&&void 0!==P?P:"sha-256",re=(0,g.calculateSdHash)(Z.compactSdJwtVc,q,j.hasher),te={header:{typ:"kb+jwt"},payload:{iat:(new Date).getTime(),_sd_hash:re}};return Object.assign(Object.assign({},Z),{kbJwt:te})}{if(!_)throw Error("At least a verifiable credential needs to be passed in to create a presentation");const Z=Array.isArray(_)?_:[_],q=Z.map(me=>a.CredentialMapper.toWrappedVerifiableCredential(me)),re=Array.from(new Set(q.flatMap(me=>(0,g.getSubjectIdsAsString)(me.credential))));1!==re.length&&!j?.holderDID&&console.log(`We deduced ${re.length} subject from ${q.length} Verifiable Credentials, and no holder property was given. This might lead to undesired results`);const te=null!==(k=j?.holderDID)&&void 0!==k?k:1===re.length?re[0]:void 0,ie=null!==(z=j?.basePresentationPayload)&&void 0!==z&&z.type?Array.isArray(j.basePresentationPayload.type)?j.basePresentationPayload.type:[j.basePresentationPayload.type]:[];ie.includes("VerifiablePresentation")||ie.push("VerifiablePresentation");const ae=null!==(W=j?.basePresentationPayload)&&void 0!==W&&W["@context"]?Array.isArray(j.basePresentationPayload["@context"])?j.basePresentationPayload["@context"]:[j.basePresentationPayload["@context"]]:[];return ae.includes("https://www.w3.org/2018/credentials/v1")||ae.push("https://www.w3.org/2018/credentials/v1"),j?.presentationSubmission&&(ie.includes("PresentationSubmission")||ie.push("PresentationSubmission"),ae.includes("https://identity.foundation/presentation-exchange/submission/v1")||ae.push("https://identity.foundation/presentation-exchange/submission/v1")),Object.assign(Object.assign(Object.assign(Object.assign({},j?.basePresentationPayload),{"@context":ae,type:ie,holder:te}),!!j?.presentationSubmission&&{presentation_submission:j.presentationSubmission}),{verifiableCredential:Z})}}static validateDefinition(_){const j=(0,g.definitionVersionDiscovery)(_);if(j.error)throw new Error(j.error);const P=[];return P.push(j.version===S.PEVersion.v1?{bundler:new E.PresentationDefinitionV1VB("root"),target:S.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(_)}:{bundler:new E.PresentationDefinitionV2VB("root"),target:S.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(_)}),(new E.ValidationEngine).validate(P)}static validateSubmission(_){return(new E.ValidationEngine).validate([{bundler:new E.PresentationSubmissionVB("root"),target:_}])}verifiablePresentationFrom(_,j,P,k){return i(this,void 0,void 0,function*(){var z,W;const{holderDID:V,signatureOptions:Z,proofOptions:q}=k,te=V?[V]:[],ie=function re(){let A=[];if(q?.typeSupportsSelectiveDisclosure){if(!q?.type)throw Error("Please provide a proof type if you enable selective disclosure");A=[q.type]}return A}(),ae=this.evaluateCredentials(_,j,{holderDIDs:te,limitDisclosureSignatureSuites:ie}),me=this.presentationFrom(_,ae.verifiableCredential,k),ye=this.evaluatePresentation(_,me.presentation,Object.assign({limitDisclosureSignatureSuites:ie},me.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&{presentationSubmission:me.presentationSubmission}));if(!ye.value)throw new Error("Could not get evaluation results from presentationResult");const ue={type:q?.type,verificationMethod:Z?.verificationMethod,created:q?.created?q.created:(new Date).toISOString(),proofPurpose:q?.proofPurpose,proofValue:Z?.proofValue,jws:Z?.jws,challenge:q?.challenge,nonce:q?.nonce,domain:q?.domain};let K=me.presentation;if(a.CredentialMapper.isSdJwtDecodedCredential(me.presentation)){if(null===(z=this.options)||void 0===z||!z.hasher)throw new Error("Hasher must be provided when creating a presentation with an SD-JWT VC");const A=null!==(W=me.presentation.signedPayload._sd_alg)&&void 0!==W?W:"sha-256",I=(0,g.calculateSdHash)(me.presentation.compactSdJwtVc,A,this.options.hasher),O={header:{typ:"kb+jwt"},payload:{iat:(new Date).getTime(),nonce:q?.nonce,_sd_hash:I}};K=Object.assign(Object.assign({},K),{kbJwt:O})}const o={options:Object.assign(Object.assign({},k),{presentationSubmissionLocation:me.presentationSubmissionLocation}),presentation:K,presentationDefinition:_,selectedCredentials:j,proof:ue,presentationSubmission:ye.value,evaluationResults:ye};return{verifiablePresentation:yield P(o),presentationSubmissionLocation:me.presentationSubmissionLocation,presentationSubmission:ye.value}})}static definitionVersionDiscovery(_){return(0,g.definitionVersionDiscovery)(_)}}F.PEX=R},38992:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv1=void 0;const i=f(11151),a=f(97889),x=f(70143),B=f(64864),m=f(99938),S=f(80930);F.PEXv1=class g extends a.PEX{evaluatePresentation(R,M,_){return m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),super.evaluatePresentation(R,M,_)}evaluateCredentials(R,M,_){return m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),super.evaluateCredentials(R,M,_)}selectFrom(R,M,_){const j=JSON.parse(JSON.stringify(M));return this._evaluationClientWrapper=new x.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j),_)}presentationFrom(R,M,_){var j;const P=this._evaluationClientWrapper.submissionFrom(m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(M),_),k=M.some(V=>i.CredentialMapper.isSdJwtDecodedCredential(V)||i.CredentialMapper.isSdJwtEncoded(V));if(_?.presentationSubmissionLocation===B.PresentationSubmissionLocation.PRESENTATION&&k)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const z=null!==(j=_?.presentationSubmissionLocation)&&void 0!==j?j:k?B.PresentationSubmissionLocation.EXTERNAL:B.PresentationSubmissionLocation.PRESENTATION;return{presentation:a.PEX.constructPresentation(M,Object.assign(Object.assign({},_),{presentationSubmission:z===B.PresentationSubmissionLocation.PRESENTATION?P:void 0})),presentationSubmissionLocation:z,presentationSubmission:P}}static validateDefinition(R){const M=m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R);return(new S.ValidationEngine).validate([{bundler:new S.PresentationDefinitionV1VB("root"),target:M}])}static validateSubmission(R){return a.PEX.validateSubmission(R)}}},71945:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv2=void 0;const i=f(11151),a=f(97889),x=f(70143),B=f(64864),m=f(99938),S=f(80930);F.PEXv2=class g extends a.PEX{evaluatePresentation(R,M,_){return m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),super.evaluatePresentation(R,M,_)}evaluateCredentials(R,M,_){return m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),super.evaluateCredentials(R,M,_)}selectFrom(R,M,_){return this._evaluationClientWrapper=new x.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(M),_)}presentationFrom(R,M,_){var j;const P=this._evaluationClientWrapper.submissionFrom(m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(M),_),k=M.some(V=>i.CredentialMapper.isSdJwtDecodedCredential(V)||i.CredentialMapper.isSdJwtEncoded(V));if(_?.presentationSubmissionLocation===B.PresentationSubmissionLocation.PRESENTATION&&k)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const z=null!==(j=_?.presentationSubmissionLocation)&&void 0!==j?j:k?B.PresentationSubmissionLocation.EXTERNAL:B.PresentationSubmissionLocation.PRESENTATION;return{presentation:a.PEX.constructPresentation(M,Object.assign(Object.assign({},_),{presentationSubmission:z===B.PresentationSubmissionLocation.PRESENTATION?P:void 0})),presentationSubmissionLocation:z,presentationSubmission:P}}static validateDefinition(R){const M=m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R);return(new S.ValidationEngine).validate([{bundler:new S.PresentationDefinitionV2VB("root"),target:M}])}static validateSubmission(R){return a.PEX.validateSubmission(R)}}},38947:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},45994:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.HandlerCheckResult=void 0,F.HandlerCheckResult=class{constructor(i,a,x,B,m,S){this.input_descriptor_path=i,this.verifiable_credential_path=a,this.evaluator=x,this.status=B,this.message=m,this.payload=S}}},92127:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(38947),F),a(f(45994),F),a(f(83565),F),a(f(21235),F)},83565:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},21235:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},50950:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.EvaluationClient=void 0;const a=f(11151),x=f(55776),B=i(f(24080)),m=f(13486),S=f(71001),g=[a.IProofType.BbsBlsSignatureProof2020,"DataIntegrityProof.anoncreds-2023"];F.EvaluationClient=class E{constructor(){this.failed_catched={tag:"root",status:x.Status.ERROR,message:B.default.UNKNOWN_EXCEPTION,stacktrace:""},this._results=[],this._wrappedVcs=[],this._presentationSubmission={},this._dids=[],this._limitDisclosureSignatureSuites=g,this._restrictToDIDMethods=[],this._generatePresentationSubmission=!0}evaluate(M,_,j){this._restrictToDIDMethods=j?.restrictToDIDMethods?(0,m.uniformDIDMethods)(j?.restrictToDIDMethods):[],this._dids=j?.holderDIDs?(0,m.filterToRestrictedDIDs)(j.holderDIDs,this._restrictToDIDMethods):[],this._limitDisclosureSignatureSuites=j?.limitDisclosureSignatureSuites,this._restrictToFormats=j?.restrictToFormats,this._generatePresentationSubmission=void 0===j?.generatePresentationSubmission||j.generatePresentationSubmission,j?.presentationSubmission&&(this._presentationSubmission=j.presentationSubmission);let P=this.initEvaluationHandlers();for(P?.handle(M,_);P?.hasNext();){P=P.getNext();try{P?.handle(M,_)}catch(k){throw this.failed_catched.message+=k.message,this.failed_catched.stacktrace=k,this.failed_catched}}}get results(){return this._results}get dids(){return this._dids}set dids(M){this._dids=M}assertPresentationSubmission(){if("string"==typeof this._presentationSubmission&&(console.log("Presentation submission present, but as string not object. External calls did not follow contract. Correcting"),this._presentationSubmission=JSON.parse(this._presentationSubmission)),!(this.generatePresentationSubmission||this.presentationSubmission&&0!==Object.keys(this.presentationSubmission).length))throw Error("No presentation submission present, but required option was set")}get generatePresentationSubmission(){return this._generatePresentationSubmission}set generatePresentationSubmission(M){this._generatePresentationSubmission=M}get presentationSubmission(){return this._presentationSubmission}set presentationSubmission(M){this._presentationSubmission=M}get wrappedVcs(){return this._wrappedVcs}set wrappedVcs(M){this._wrappedVcs=M}get limitDisclosureSignatureSuites(){return this._limitDisclosureSignatureSuites||g}set limitDisclosureSignatureSuites(M){this._limitDisclosureSignatureSuites=M}get restrictToDIDMethods(){return this._restrictToDIDMethods}set restrictToDIDMethods(M){this._restrictToDIDMethods=(0,m.uniformDIDMethods)(M)}hasRestrictToDIDMethods(){return this.restrictToDIDMethods&&this.restrictToDIDMethods.length>0}get restrictToFormats(){return this._restrictToFormats}set restrictToFormats(M){this._restrictToFormats=M}initEvaluationHandlers(){const M=new S.UriEvaluationHandler(this);return M.setNext(new S.DIDRestrictionEvaluationHandler(this)).setNext(new S.FormatRestrictionEvaluationHandler(this)).setNext(new S.InputDescriptorFilterEvaluationHandler(this)).setNext(new S.PredicateRelatedFieldEvaluationHandler(this)).setNext(new S.LimitDisclosureEvaluationHandler(this)).setNext(new S.SubjectIsIssuerEvaluationHandler(this)).setNext(new S.SubjectIsHolderEvaluationHandler(this)).setNext(new S.SameSubjectEvaluationHandler(this)).setNext(new S.MarkForSubmissionEvaluationHandler(this)),M}}},78995:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.EvaluationClientWrapper=void 0;const i=f(44273),a=f(47636),x=f(11151),B=f(55776),m=f(64864),S=f(13486),g=f(50950);F.EvaluationClientWrapper=class E{constructor(){this._client=new g.EvaluationClient}getEvaluationClient(){return this._client}selectFrom(M,_,j){var P;let k;this._client.evaluate(M,_,j);const z=[...this.formatNotInfo(B.Status.WARN)],W=[...this.formatNotInfo(B.Status.ERROR)];if(M.submission_requirements){const V=this._client.results.filter(ae=>"MarkForSubmissionEvaluation"===ae.evaluator&&ae.payload.group&&ae.status!==B.Status.ERROR),Z=Array.from(new Set(V));let q;try{q=this.matchSubmissionRequirements(M,M.submission_requirements,Z)}catch(ae){const me={status:B.Status.ERROR,message:JSON.stringify(ae),tag:"matchSubmissionRequirements"};return{errors:W?[...W,me]:[me],warnings:z,areRequiredCredentialsPresent:B.Status.ERROR}}const te=this.extractMatches(q).map(ae=>i.JSONPath.nodes(this._client.wrappedVcs.map(me=>me.original),ae)[0].value),ie=this.determineAreRequiredCredentialsPresent(M,q);k={errors:ie===B.Status.INFO?[]:W,matches:[...q],areRequiredCredentialsPresent:ie,verifiableCredential:te,warnings:z}}else{const V=this._client.results.filter(q=>"MarkForSubmissionEvaluation"===q.evaluator&&q.status!==B.Status.ERROR);if(this.checkWithoutSubmissionRequirements(V,M).length)return{errors:W,matches:[],areRequiredCredentialsPresent:B.Status.ERROR,verifiableCredential:_.map(q=>q.original),warnings:z};{const q=this.matchWithoutSubmissionRequirements(V,M),te=this.extractMatches(q).map(ie=>i.JSONPath.nodes(this._client.wrappedVcs.map(ae=>ae.original),ie)[0].value);k={errors:[],matches:[...q],areRequiredCredentialsPresent:B.Status.INFO,verifiableCredential:te,warnings:z}}}return this.fillSelectableCredentialsToVerifiableCredentialsMapping(k,_),k.areRequiredCredentialsPresent=this.determineAreRequiredCredentialsPresent(M,k?.matches),this.remapMatches(_.map(V=>V.original),k.matches,k?.verifiableCredential),null===(P=k.matches)||void 0===P||P.forEach(V=>{this.updateSubmissionRequirementMatchPathToAlias(V,"verifiableCredential")}),k.areRequiredCredentialsPresent===B.Status.INFO?k.errors=[]:(k.errors=W,k.warnings=z,k.verifiableCredential=_.map(V=>V.original)),k}remapMatches(M,_,j){_?.forEach(P=>{P.from_nested?this.remapMatches(M,P.from_nested,j):P.vc_path.forEach((k,z,W)=>{const V=i.JSONPath.query(M,k)[0],Z=j?.findIndex(q=>JSON.stringify(q)===JSON.stringify(V));if(-1===Z)throw new Error(`The index of the VerifiableCredential in your current call can't be found in your previously submitted credentials. Are you trying to send a new Credential?\nverifiableCredential: ${V}`);W[z]=`$[${Z}]`})})}extractMatches(M){const _=[];return M.forEach(j=>{_.push(...j.vc_path),j.from_nested&&_.push(...this.extractMatches(j.from_nested))}),Array.from(new Set(_))}checkWithoutSubmissionRequirements(M,_){const j=[];if(!_.input_descriptors)return[];if(!M.length)return[{input_descriptor_path:"",evaluator:"checkWithoutSubmissionRequirement",verifiable_credential_path:"",status:B.Status.ERROR,payload:"Not all the InputDescriptors are addressed"}];const P=_.input_descriptors,k=S.ObjectUtils.getDistinctFieldInObject(M,"input_descriptor_path");if(k.length!==P.length){const z=k.map(W=>S.JsonPathUtils.extractInputField(_,[W])[0].value).map(W=>W.id);for(let W=0;W<_.input_descriptors.length;W++)-1==z.indexOf(_.input_descriptors[W].id)&&j.push({input_descriptor_path:`$.input_descriptors[${W}]`,evaluator:"checkWithoutSubmissionRequirement",verifiable_credential_path:"",status:B.Status.ERROR,payload:"Not all the InputDescriptors are addressed"})}return j}matchSubmissionRequirements(M,_,j){const P=[];for(const k of _){const z={name:M.name||M.id,rule:k.rule,vc_path:[]};if(k.from&&(z.from=k.from),k.min&&(z.min=k.min),k.max&&(z.max=k.max),k.count&&(z.count=k.count),k.from){const W=this.mapMatchingDescriptors(M,k,j);W&&(z.vc_path.push(...W.vc_path),z.name=W.name,P.push(z))}else{if(!k.from_nested)throw new Error("Invalid SubmissionRequirement object: Must contain either 'from' or 'from_nested'");try{z.from_nested=this.matchSubmissionRequirements(M,k.from_nested,j),P.push(z)}catch(W){throw new Error(`Error in handling value of from_nested: ${k.from_nested}: err: ${W}`)}}}return P}matchWithoutSubmissionRequirements(M,_){const j=[],P=this.createIdToVcMap(M);for(const[k,z]of P.entries())if(z&&z.length)for(const W of z){const V=S.JsonPathUtils.extractInputField(_,[k]);V.length&&j.push({name:V[0].value.name||V[0].value.id,rule:a.Rules.All,vc_path:[W]})}return this.removeDuplicateSubmissionRequirementMatches(j)}mapMatchingDescriptors(M,_,j){var P;const k={rule:_.rule,vc_path:[]};if(_?.from){k.from=_.from;for(const z of j){const W=i.JSONPath.query(M,z.input_descriptor_path)[0];W.group&&-1===W.group.indexOf(_.from)||(k.name=W.name||W.id,z.payload.group.includes(_.from)&&-1===(null===(P=k.vc_path)||void 0===P?void 0:P.indexOf(z.verifiable_credential_path))&&k.vc_path.push(z.verifiable_credential_path))}}return k}evaluate(M,_,j){var P,k,z,W;this._client.evaluate(M,_,j);const V={areRequiredCredentialsPresent:B.Status.INFO,verifiableCredential:_.map(Z=>Z.original)};if(V.warnings=this.formatNotInfo(B.Status.WARN),V.errors=this.formatNotInfo(B.Status.ERROR),this._client.assertPresentationSubmission(),null!==(P=this._client.presentationSubmission)&&void 0!==P&&P.descriptor_map.length){const Z=null===(k=this._client.presentationSubmission)||void 0===k?void 0:k.descriptor_map.length;for(let q=0;qZ.original),V.areRequiredCredentialsPresent=null!==(W=null===(z=V.value)||void 0===z?void 0:z.descriptor_map)&&void 0!==W&&W.length?B.Status.INFO:B.Status.ERROR,V}formatNotInfo(M){return this._client.results.filter(_=>_.status===M).map(_=>{const j=_.verifiable_credential_path.substring(1);return{tag:_.evaluator,status:_.status,message:`${_.message}: ${_.input_descriptor_path}: $.verifiableCredential${j}`}})}submissionFrom(M,_,j){if(!this._client.results.length)throw Error("You need to call evaluate() before pex.presentationFrom()");if(!this._client.generatePresentationSubmission)return this._client.presentationSubmission;if(M.submission_requirements){const z=this._client.results.filter(te=>"MarkForSubmissionEvaluation"===te.evaluator&&te.payload.group&&te.status!==B.Status.ERROR),[W,V]=this.matchUserSelectedVcs(z,_),Z=new Map;"input_descriptors"in M&&M.input_descriptors.forEach(te=>{te.group&&te.group.forEach(ie=>{Z.has(ie)?Z.set(ie,Z.get(ie)+1):Z.set(ie,1)})});const q=this.evaluateRequirements(M.submission_requirements,W,Z,0),re=V.filter(te=>q[1].find(ie=>ie.verifiable_credential_path===te[1]));return this.updatePresentationSubmission(re),this.updatePresentationSubmissionPathToVpPath(),j?.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&this.updatePresentationSubmissionToExternal(),this._client.presentationSubmission}const P=this._client.results.filter(z=>"MarkForSubmissionEvaluation"===z.evaluator&&z.status!==B.Status.ERROR),k=this.matchUserSelectedVcs(P,_);return this.updatePresentationSubmission(k[1]),this.updatePresentationSubmissionPathToVpPath(),j?.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&this.updatePresentationSubmissionToExternal(),this._client.presentationSubmission}updatePresentationSubmission(M){this._client.generatePresentationSubmission&&(this._client.presentationSubmission.descriptor_map=this._client.presentationSubmission.descriptor_map.filter(_=>M.find(j=>j[0]===_.path)).map(_=>{const j=M.find(P=>P[0]===_.path);return j&&(_.path=j[1]),_}))}updatePresentationSubmissionToExternal(){this._client.presentationSubmission.descriptor_map=this._client.presentationSubmission.descriptor_map.map(_=>{if(_.path_nested)return _;if("vc+sd-jwt"===_.format)return _;const j=_.format,P=Object.assign({},_);return P.path_nested=Object.assign({},_),P.path="$",j.startsWith("ldp_")?P.format="ldp_vp":j.startsWith("di_")?P.format="di_vp":"jwt_vc"===j?(P.format="jwt_vp",P.path_nested.path=P.path_nested.path.replace("$.verifiableCredential[","$.vp.verifiableCredential[")):"jwt_vc_json"===j&&(P.format="jwt_vp_json",P.path_nested.path=P.path_nested.path.replace("$.verifiableCredential[","$.vp.verifiableCredential[")),P})}matchUserSelectedVcs(M,_){const j=_.map((z,W)=>[W,JSON.stringify(z.original)]),P=this._client.wrappedVcs.map((z,W)=>[W,JSON.stringify(z.original)]),k=[];return j.forEach((z,W)=>{P.forEach((V,Z)=>{V[1]===z[1]&&k.push([`$[${Z}]`,`$[${W}]`])})}),[M=M.filter(z=>k.find(W=>W[0]===z.verifiable_credential_path)).map(z=>{const W=k.find(V=>V[0]===z.verifiable_credential_path);return W&&(z.verifiable_credential_path=W[1]),z}),k]}evaluateRequirements(M,_,j,P){let k=0;const z=[];for(const W of M)if(W.from){if(W.rule===a.Rules.All){const[V,Z]=this.countMatchingInputDescriptors(W,_);if(V!==(j.get(W.from)||0))throw Error(`Not all input descriptors are members of group ${W.from}`);k++,z.push(...Z)}else if(W.rule===a.Rules.Pick){const[V,Z]=this.countMatchingInputDescriptors(W,_);try{this.handleCount(W,V,P),k++}catch(q){if(0===P)throw q}z.push(...Z)}}else if(W.from_nested){const[V,Z]=this.evaluateRequirements(W.from_nested,_,j,++P);k+=V,z.push(...Z),this.handleCount(W,V,P)}return[k,z]}countMatchingInputDescriptors(M,_){let j=0;const P=[];for(const k of _)k.payload.group.includes(M.from)&&(P.push(k),j++);return[j,P]}handleCount(M,_,j){if(M.count&&_!==M.count)throw Error(`Count: expected: ${M.count} actual: ${_} at level: ${j}`);if(M.min&&_M.max)throw Error(`Max: expected: ${M.max} actual: ${_} at level: ${j}`)}removeDuplicateSubmissionRequirementMatches(M){return M.filter((_,j)=>{const P=JSON.stringify(_);return j===M.findIndex(k=>JSON.stringify(k)===P)})}fillSelectableCredentialsToVerifiableCredentialsMapping(M,_){var j;M&&(null===(j=M.verifiableCredential)||void 0===j||j.forEach(P=>{var k;const z=_.findIndex(W=>x.CredentialMapper.areOriginalVerifiableCredentialsEqual(W.original,P));if(-1===z)throw new Error("index is not right");null===(k=M.vcIndexes)||void 0===k||k.push(z)}))}determineAreRequiredCredentialsPresent(M,_,j){if(!_||!_.length)return B.Status.ERROR;const P=_.map(k=>this.determineSubmissionRequirementStatus(M,k));if(!j)return P.includes(B.Status.ERROR)?B.Status.ERROR:P.includes(B.Status.WARN)?B.Status.WARN:B.Status.INFO;{if(j.rule===a.Rules.All&&P.includes(B.Status.ERROR))return B.Status.ERROR;const k=P.filter(z=>z!==B.Status.ERROR).length;if(j.count)return j.count>k?B.Status.ERROR:j.countk)return B.Status.ERROR;if(j.max&&j.maxM.count?B.Status.WARN:B.Status.ERROR:M.min&&M.vc_path.lengthM.max?B.Status.WARN:B.Status.INFO}updateSubmissionRequirementMatchPathToAlias(M,_){const j=[];M.vc_path.forEach(P=>{j.push(P.replace("$","$."+_))}),M.vc_path=j,M.from_nested&&M.from_nested.forEach(P=>{this.updateSubmissionRequirementMatchPathToAlias(P,_)})}updatePresentationSubmissionPathToVpPath(M){const _=M?M.descriptor_map:this._client.generatePresentationSubmission?this._client.presentationSubmission.descriptor_map:void 0;_?.forEach(j=>{"vc+sd-jwt"===j.format?j.path="$":this.replacePathWithAlias(j,"verifiableCredential")})}replacePathWithAlias(M,_){M.path=M.path.replace("$[",`$.${_}[`),M.path_nested&&this.replacePathWithAlias(M.path_nested,_)}createIdToVcMap(M){const _=new Map,j=new Map;for(let P=0;P{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.AbstractEvaluationHandler=void 0;const i=f(44273),a=f(55776);F.AbstractEvaluationHandler=class x{constructor(m){this._client=m}setNext(m){return this.nextHandler=m,m}getNext(){return this.nextHandler}hasNext(){return null!=this.nextHandler}get client(){return this._client}get wrappedVcs(){return this._client.wrappedVcs}set wrappedVcs(m){this._client.wrappedVcs=m}get presentationSubmission(){return this._client.presentationSubmission}set presentationSubmission(m){this._client.presentationSubmission=m}getResults(){return this._client.results}updatePresentationSubmission(m){this._client.assertPresentationSubmission(),this.presentationSubmission.descriptor_map.forEach((S,g,E)=>{let R;this.getResults().filter(_=>_.status===a.Status.ERROR&&_.evaluator===this.getName()).find(_=>(R=i.JSONPath.query(m,_.input_descriptor_path)[0],_.verifiable_credential_path===S.path&&R?.id===S.id))&&delete E[g]})}removeDuplicate(m){return m.reduce((S,g)=>S.find(R=>R.input_descriptor_path===g.input_descriptor_path&&R.verifiable_credential_path===g.verifiable_credential_path)?S:S.concat([g]),[])}}},4028:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(F,"__esModule",{value:!0}),F.DIDRestrictionEvaluationHandler=void 0;const a=f(11151),x=f(55776),B=i(f(24080)),m=f(13486),S=f(32893);F.DIDRestrictionEvaluationHandler=class g extends S.AbstractEvaluationHandler{constructor(R){super(R)}getName(){return"DIDRestrictionEvaluation"}handle(R,M){R.input_descriptors.forEach((_,j)=>{M.forEach((P,k)=>{const z=this.getIssuerIdFromWrappedVerifiableCredential(P);this.client.hasRestrictToDIDMethods()&&z&&!(0,m.isRestrictedDID)(z,this.client.restrictToDIDMethods)&&z.toLowerCase().startsWith("did:")?this.getResults().push(this.generateErrorResult(j,`$[${k}]`,P)):this.getResults().push(this.generateSuccessResult(j,`$[${k}]`,P,`${z} is allowed`))})}),this.updatePresentationSubmission(R)}getIssuerIdFromWrappedVerifiableCredential(R){if(a.CredentialMapper.isW3cCredential(R.credential))return"object"==typeof R.credential.issuer?R.credential.issuer.id:R.credential.issuer;if(a.CredentialMapper.isSdJwtDecodedCredential(R.credential))return R.credential.decodedPayload.iss;throw new Error("Unsupported credential type")}generateErrorResult(R,M,_){return{input_descriptor_path:`$.input_descriptors[${R}]`,evaluator:this.getName(),status:x.Status.ERROR,message:B.default.FORMAT_RESTRICTION_DIDNT_PASS,verifiable_credential_path:M,payload:{format:_.format}}}generateSuccessResult(R,M,_,j){return{input_descriptor_path:`$.input_descriptors[${R}]`,evaluator:this.getName(),status:x.Status.INFO,message:j??B.default.FORMAT_RESTRICTION_PASSED,verifiable_credential_path:M,payload:{format:_.format}}}}},19819:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},30614:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(F,"__esModule",{value:!0}),F.FormatRestrictionEvaluationHandler=void 0;const a=f(55776),x=i(f(24080)),B=f(32893);F.FormatRestrictionEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g)}getName(){return"FormatRestrictionEvaluation"}handle(g,E){const R=this.client.restrictToFormats?Object.keys(this.client.restrictToFormats):void 0;g.input_descriptors.forEach((M,_)=>{E.forEach((j,P)=>{const k="format"in M&&M.format?Object.keys(M.format):[j.format];let z=R??k;"format"in M&&M.format&&void 0!==R&&(z=Object.keys(M.format).filter(W=>R.includes(W))),z.includes(j.format)?this.getResults().push(this.generateSuccessResult(_,`$[${P}]`,j,`${j.format} is allowed from ${JSON.stringify(z)}`)):this.getResults().push(this.generateErrorResult(_,`$[${P}]`,j))})}),this.updatePresentationSubmission(g)}generateErrorResult(g,E,R){return{input_descriptor_path:`$.input_descriptors[${g}]`,evaluator:this.getName(),status:a.Status.ERROR,message:x.default.FORMAT_RESTRICTION_DIDNT_PASS,verifiable_credential_path:E,payload:{format:R.format}}}generateSuccessResult(g,E,R,M){return{input_descriptor_path:`$.input_descriptors[${g}]`,evaluator:this.getName(),status:a.Status.INFO,message:M??x.default.FORMAT_RESTRICTION_PASSED,verifiable_credential_path:E,payload:{format:R.format}}}}},71001:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(32893),F),a(f(19819),F),a(f(298),F),a(f(19477),F),a(f(77918),F),a(f(60019),F),a(f(1599),F),a(f(4257),F),a(f(67966),F),a(f(63217),F),a(f(30614),F),a(f(4028),F)},298:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorFilterEvaluationHandler=void 0;const a=f(44273),x=i(f(39208)),B=i(f(21953)),m=f(55776),S=i(f(24080)),g=f(13486),E=f(32893),R=new x.default({verbose:!1,code:{source:!1,lines:!0,esm:!1},allowUnionTypes:!0,allErrors:!0,strict:!1});(0,B.default)(R);class M extends E.AbstractEvaluationHandler{constructor(j){super(j),M.keepCacheSizeInCheck()}getName(){return"FilterEvaluation"}handle(j,P){const k=a.JSONPath.nodes(j,"$..fields[*]");P.forEach((z,W)=>{this.createNoFieldResults(j,W,z),k.forEach(V=>{let Z=[];V.value.path&&(Z=g.JsonPathUtils.extractInputField(z.decoded,V.value.path));let q=!1;for(const re of Z)if(this.evaluateFilter(re,V.value)){q=!0;const te={result:Object.assign({},Z[0]),valid:!0,format:z.format};this.getResults().push(Object.assign({},this.createResultObject(a.JSONPath.stringify(V.path.slice(0,3)),W,te)))}if(!q)if(Z.length){const re={result:Object.assign({},Z[0]),valid:!1,format:z.format};this.createResponse(V,W,re,S.default.INPUT_CANDIDATE_FAILED_FILTER_EVALUATION)}else this.createResponse(V,W,{valid:!1,format:z.format},S.default.INPUT_CANDIDATE_DOESNT_CONTAIN_PROPERTY)})}),this.updatePresentationSubmission(j)}createNoFieldResults(j,P,k){j.input_descriptors.map((W,V)=>({index:V,inDesc:W})).filter(W=>{var V,Z,q;return void 0===(null===(V=W.inDesc.constraints)||void 0===V?void 0:V.fields)||0===(null===(q=null===(Z=W.inDesc.constraints)||void 0===Z?void 0:Z.fields)||void 0===q?void 0:q.length)}).forEach(W=>{const V={result:[],valid:!0,format:k.format};this.getResults().push(Object.assign({},this.createResultObject(`$.input_descriptors[${W.index}]`,P,V)))})}createResponse(j,P,k,z){this.getResults().push(Object.assign(Object.assign({},this.createResultObject(a.JSONPath.stringify(j.path.slice(0,3)),P,k)),{status:m.Status.ERROR,message:z}))}createResultObject(j,P,k){return{input_descriptor_path:j,verifiable_credential_path:`$[${P}]`,evaluator:this.getName(),status:m.Status.INFO,message:S.default.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION,payload:k}}evaluateFilter(j,P){var k,z;null!==(k=P.filter)&&void 0!==k&&k.format&&"date"===P.filter.format&&this.transformDateFormat(j);let W=!0;if(P.filter){const V=JSON.stringify({filter:P.filter,value:j.value}),Z=Date.now();W=null===(z=M.FILTER_CACHE.get(V))||void 0===z?void 0:z.value,void 0===W&&(M.keepCacheSizeInCheck(),W=R.validate(P.filter,j.value),M.FILTER_CACHE.set(V,{value:W,ts:Z+M.DEFAULT_FILTER_CACHE_TTL}))}return W}transformDateFormat(j){const P=new Date(j.value);let k=P.getUTCMonth()+1+"";1===k.length&&(k="0"+k);let z=P.getUTCDate()+"";1===z.length&&(z="0"+z),j.value=P.getUTCFullYear()+"-"+k+"-"+z,j.value=P.toISOString().substring(0,P.toISOString().indexOf("T"))}static keepCacheSizeInCheck(j){var P,k,z;const W=null!==(P=j?.ttl)&&void 0!==P?P:M.DEFAULT_FILTER_CACHE_TTL,V=null!==(k=j?.maxCacheSize)&&void 0!==k?k:M.DEFAULT_MAX_FILTER_CACHE_SIZE,Z=null!==(z=j?.resetCacheSize)&&void 0!==z?z:M.DEFAULT_RESET_CACHE_SIZE,q=Date.now();for(const[te,ie]of M.FILTER_CACHE)ie.ts+WV){const te=M.FILTER_CACHE.keys();for(let ie=0;ie{var k,z,W;null!==(k=j.constraints)&&void 0!==k&&k.fields&&((null===(z=j.constraints)||void 0===z?void 0:z.limit_disclosure)===a.Optionality.Required||(null===(W=j.constraints)||void 0===W?void 0:W.limit_disclosure)===a.Optionality.Preferred)&&this.evaluateLimitDisclosure(_,j.constraints,P)})}isLimitDisclosureSupported(M,_,j,P){if("vc+sd-jwt"===M.format)return!0;const k=this.client.limitDisclosureSignatureSuites,z=M.decoded.proof;if(!z||Array.isArray(z)||!z.type)return!1;const W=z.cryptosuite?`${z.type}.${z.cryptosuite}`:z.type;return!!k?.includes(W)||(P==a.Optionality.Required&&this.createLimitDisclosureNotSupportedResult(j,_),!1)}evaluateLimitDisclosure(M,_,j){const P=_?.fields,k=_.limit_disclosure;M.forEach((z,W)=>{k&&this.isLimitDisclosureSupported(z,W,j,k)&&this.enforceLimitDisclosure(z,P,j,W,M,k)})}enforceLimitDisclosure(M,_,j,P,k,z){if(x.CredentialMapper.isWrappedSdJwtVerifiableCredential(M)){const W=this.createSdJwtPresentationFrame(M.credential,_,j,P);W&&((0,S.applySdJwtLimitDisclosure)(M.credential,W),M.decoded=M.credential.decodedPayload,M.original=x.CredentialMapper.isSdJwtDecodedCredential(M.original)?M.credential:M.credential.compactSdJwtVc,this.createSuccessResult(j,`$[${P}]`,z))}else{if(!x.CredentialMapper.isW3cCredential(M.credential))throw new Error(`Unsupported format for selective disclosure ${M.format}`);{const W=this.createVcWithRequiredFields(M.credential,_,j,P);W&&(k[P].credential=W,this.createSuccessResult(j,`$[${P}]`,z))}}}createSdJwtPresentationFrame(M,_,j,P){const k={};for(const z of _)if(z.path){const W=S.JsonPathUtils.extractInputField(M.decodedPayload,z.path);if(!(W.length>0))return void this.createMandatoryFieldNotFoundResult(j,P,z.path);S.JsonPathUtils.setValue(k,W[0].path,!0)}return k}createVcWithRequiredFields(M,_,j,P){let k={};k=Object.assign(k,M),k.credentialSubject={};for(const z of _)if(z.path){const W=S.JsonPathUtils.extractInputField(M,z.path);if(!(W.length>0))return void this.createMandatoryFieldNotFoundResult(j,P,z.path);k=this.copyResultPathToDestinationCredential(W[0],M,k)}return k}copyResultPathToDestinationCredential(M,_,j){let P=Object.assign({},_.credentialSubject);return M.path.forEach(k=>{P[k]&&(P={[k]:P[k]})}),j.credentialSubject=Object.assign(Object.assign({},j.credentialSubject),P),j}createSuccessResult(M,_,j){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${M}]`,verifiable_credential_path:`${_}`,evaluator:this.getName(),status:j===a.Optionality.Required?B.Status.INFO:B.Status.WARN,message:m.default.LIMIT_DISCLOSURE_APPLIED,payload:void 0})}createMandatoryFieldNotFoundResult(M,_,j){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${M}]`,verifiable_credential_path:`$[${_}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.VERIFIABLE_CREDENTIAL_MANDATORY_FIELD_NOT_PRESENT,payload:j})}createLimitDisclosureNotSupportedResult(M,_){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${M}]`,verifiable_credential_path:`$[${_}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.LIMIT_DISCLOSURE_NOT_SUPPORTED})}}},60019:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(F,"__esModule",{value:!0}),F.MarkForSubmissionEvaluationHandler=void 0;const a=f(44273),x=f(55776),B=i(f(24080)),m=f(32893);F.MarkForSubmissionEvaluationHandler=class S extends m.AbstractEvaluationHandler{constructor(E){super(E)}getName(){return"MarkForSubmissionEvaluation"}handle(E,R){const M=[...this.getResults()],_=M.filter(P=>P.status===x.Status.ERROR),j=this.retrieveNoErrorStatus(M,_);this.client.wrappedVcs=R,this.produceErrorResults(_),this.produceSuccessResults(j,E)}retrieveNoErrorStatus(E,R){return E.filter(_=>_.status!==x.Status.ERROR).filter(_=>!R.find(j=>_.input_descriptor_path===j.input_descriptor_path&&_.verifiable_credential_path===j.verifiable_credential_path))}produceSuccessResults(E,R){this.removeDuplicate(E).forEach(M=>{const j=a.JSONPath.nodes(R,M.input_descriptor_path)[0].value.group;this.getResults().push({input_descriptor_path:M.input_descriptor_path,verifiable_credential_path:M.verifiable_credential_path,evaluator:this.getName(),status:x.Status.INFO,payload:{group:j},message:B.default.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION})})}produceErrorResults(E){this.removeDuplicate(E).forEach(R=>{const M=Object.assign({},R.payload);M.evaluator=R.evaluator,this.getResults().push(Object.assign(Object.assign({},R),{evaluator:this.getName(),message:B.default.INPUT_CANDIDATE_IS_NOT_ELIGIBLE_FOR_PRESENTATION_SUBMISSION,payload:M}))})}}},1599:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(F,"__esModule",{value:!0}),F.PredicateRelatedFieldEvaluationHandler=void 0;const a=f(47636),x=f(55776),B=i(f(24080)),m=f(32893);F.PredicateRelatedFieldEvaluationHandler=class S extends m.AbstractEvaluationHandler{constructor(E){super(E)}getName(){return"PredicateRelatedFieldEvaluation"}handle(E){E.input_descriptors.forEach((R,M)=>{R.constraints&&this.examinePredicateRelatedField(M,R.constraints)})}examinePredicateRelatedField(E,R){if(R?.fields)for(let M=0;M{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SameSubjectEvaluationHandler=void 0;const i=f(44273),a=f(47636),x=f(55776),B=f(32893);F.SameSubjectEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g),this.fieldIds=[],this.sameSubject=[],this.messages=new Map,this.messages.set(x.Status.INFO,"The field ids requiring the same subject to belong to same subject"),this.messages.set(x.Status.WARN,"The field ids preferring the same subject to belong to same subject"),this.messages.set(x.Status.ERROR,"The fields ids not belong to the same subject")}getName(){return"SameSubjectEvaluation"}handle(g,E){const R=this.mapSameSubjectFieldIdsToInputDescriptors(g),M=this.mapCredentialsToResultObjecs(E,R),_=this.countSameSubjectOccurrences(R,M);this.generateErrorResults(_,M),this.updatePresentationSubmission(g)}mapSameSubjectFieldIdsToInputDescriptors(g){this.fieldIds.push(...i.JSONPath.nodes(g,"$..fields[*].id")),this.sameSubject.push(...i.JSONPath.nodes(g,"$..same_subject[*]"));const E=[];return this.fieldIds.forEach(R=>{const M=this.sameSubject.find(_=>_.value.field_id.includes(R.value));M&&E.push([R,M])}),E}generateErrorResults(g,E){g.forEach((R,M)=>{const _=E.filter(j=>M===j.payload.fieldIdSet).map(j=>j.payload.credentialSubject.id);(_.length!==R||1!==new Set(_).size)&&E.forEach((j,P,k)=>{j.payload.fieldIdSet===M&&(j.status=x.Status.ERROR,j.message=this.messages.get(x.Status.ERROR),k[P]=j)})}),this.client.results.push(...E)}countSameSubjectOccurrences(g,E){const R=new Map;return g.forEach(M=>{E.filter(j=>M[1].value.field_id===j.payload.fieldIdSet)&&(R.has(M[1].value.field_id)&&R.get(M[1].value.field_id)?R.set(M[1].value.field_id,R.get(M[1].value.field_id)+1):R.set(M[1].value.field_id,1))}),R}mapCredentialsToResultObjecs(g,E){const R=[...i.JSONPath.nodes(g.map(_=>_.credential),"$..credentialSubject")],M=[];return R.forEach(_=>{const j=E.find(P=>0!==i.JSONPath.query(_.value,`$..${P[0].value}`).length);j&&j[1].value.directive===a.Optionality.Required?M.push({input_descriptor_path:i.JSONPath.stringify(j[0].path.slice(0,3)),status:x.Status.INFO,evaluator:this.getName(),payload:{fieldIdSet:j[1].value.field_id,credentialSubject:_.value},message:this.messages.get(x.Status.INFO),verifiable_credential_path:i.JSONPath.stringify(_.path.slice(0,2))}):j&&j[1].value.directive===a.Optionality.Preferred&&M.push({input_descriptor_path:i.JSONPath.stringify(j[0].path.slice(0,3)),status:x.Status.WARN,evaluator:this.getName(),payload:{fieldIdSet:j[1].value.field_id,credentialSubject:_.value},message:this.messages.get(x.Status.WARN),verifiable_credential_path:i.JSONPath.stringify(_.path.slice(0,2))})}),M}}},19477:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SubjectIsHolderEvaluationHandler=void 0;const i=f(44273),a=f(47636),x=f(55776),B=f(32893);F.SubjectIsHolderEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g),this.fieldIdzInputDescriptorsSameSubjectRequired=new Map,this.fieldIdzInputDescriptorsSameSubjectPreferred=new Map,this.isHolder=[],this.fieldIds=[],this.credentialsSubjectsByPath=new Map,this.credentialsByPath=new Map,this.messages=new Map,this.messages.set(x.Status.INFO,"The field ids requiring the subject to be the holder"),this.messages.set(x.Status.WARN,"The field ids preferring the subject to be the holder"),this.messages.set(x.Status.ERROR,"The field id missing")}getName(){return"IsHolderEvaluation"}handle(g,E){this.findIsHolderFieldIdsToInputDescriptorsSets(g),this.findAllCredentialSubjects(E),this.confirmAllFieldSetHasSameSubject(this.fieldIdzInputDescriptorsSameSubjectRequired,x.Status.INFO,a.Optionality.Required),this.confirmAllFieldSetHasSameSubject(this.fieldIdzInputDescriptorsSameSubjectPreferred,x.Status.WARN,a.Optionality.Preferred),this.updatePresentationSubmission(g)}findIsHolderFieldIdsToInputDescriptorsSets(g){var E;this.fieldIds.push(...i.JSONPath.nodes(g,"$..fields[*].id")),this.isHolder.push(...i.JSONPath.nodes(g,"$..is_holder[*]"));const R=null===(E=this.fieldIds)||void 0===E?void 0:E.map(_=>_.value),M=[];M.push(...this.evaluateFields(this.fieldIdzInputDescriptorsSameSubjectPreferred,this.isHolder,R,a.Optionality.Preferred)),M.push(...this.evaluateFields(this.fieldIdzInputDescriptorsSameSubjectRequired,this.isHolder,R,a.Optionality.Required)),M.forEach(_=>this.getResults().push(this.createResult(_[1],_[0],["",{}],x.Status.ERROR,void 0)))}evaluateFields(g,E,R,M){const _=[];return E.filter(j=>j.value.directive===M).filter(j=>j.value.field_id.every(P=>R.includes(P))).forEach(j=>g.set(i.JSONPath.stringify(j.path.slice(0,3)),j.value.field_id)),E.filter(j=>j.value.directive===M).filter(j=>!j.value.field_id.every(P=>R.includes(P))).forEach(j=>_.push([i.JSONPath.stringify(j.path.slice(0,3)),j.value.field_id])),_}findAllCredentialSubjects(g){const E=i.JSONPath.nodes(g.map(R=>R.credential),"$..credentialSubject");for(let R=0;RArray.from(this.credentialsSubjectsByPath).filter(z=>k[1].find(W=>Object.keys(z[1]).includes(W)))),_=this.mapCredentialPathsToInputDescriptors(R),j=Array.from(M).flatMap(k=>Object.keys(k[1]).filter(z=>"id"!==z)),P=Array.from(g.values()).flatMap(k=>k.every(z=>j.includes(z)))[0];M.forEach(k=>{const z=_.get(k[0]);P&&k[1].id&&this.client.dids.includes(k[1].id)?this.getResults().push(this.createResult(Object.keys(k[1]).filter(W=>"id"!==W),z,k,E,this.credentialsByPath.get(k[0]))):this.getResults().push(this.createResult(Object.keys(k[1]).filter(W=>"id"!==W),z,k,x.Status.ERROR,this.credentialsByPath.get(k[0])))})}mapCredentialPathsToInputDescriptors(g){var E;const R=new Map;return null===(E=this.fieldIds)||void 0===E||E.forEach(M=>{const _=i.JSONPath.stringify(M.path.slice(0,3));this.credentialsSubjectsByPath.forEach((j,P)=>{const k=this.isHolder.find(z=>i.JSONPath.stringify(z.path.slice(0,3))===_);Object.keys(j).includes(M.value)&&k?.value.directive===g&&R.set(P,_)})}),R}createResult(g,E,R,M,_,j){return{input_descriptor_path:E,verifiable_credential_path:R[0],evaluator:this.getName(),status:M,payload:Object.assign({fieldIdSet:g,credentialSubject:R[1]},_?{format:_.format}:{}),message:j??this.messages.get(M)}}}},67966:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.SubjectIsIssuerEvaluationHandler=void 0;const a=f(47636),x=f(11151),B=f(55776),m=i(f(24080)),S=f(13486),g=f(32893);F.SubjectIsIssuerEvaluationHandler=class E extends g.AbstractEvaluationHandler{constructor(M){super(M)}getName(){return"SubjectIsIssuerEvaluation"}handle(M,_){M.input_descriptors.forEach((j,P)=>{const k=j.constraints;k?.subject_is_issuer===a.Optionality.Required?this.checkSubjectIsIssuer(j.id,_,P):this.getResults().push(..._.map((z,W)=>this.generateSuccessResult(P,`$[${W}]`,z,"not applicable")))}),this.updatePresentationSubmission(M)}checkSubjectIsIssuer(M,_,j){this.client.presentationSubmission.descriptor_map.forEach(P=>{if(P.id===M){const k=S.JsonPathUtils.extractInputField(_.map(z=>z.credential),[P.path]);for(const z of k){const W=(0,S.getIssuerString)(z.value);z&&z.value&&(0,S.getSubjectIdsAsString)(z.value).every(V=>V===W)?this.getResults().push(this.generateSuccessResult(j,P.path,x.CredentialMapper.toWrappedVerifiableCredential(z.value))):this.getResults().push(this.generateErrorResult(j,P.path,x.CredentialMapper.toWrappedVerifiableCredential(z.value)))}}})}generateErrorResult(M,_,j){return{input_descriptor_path:`$.input_descriptors[${M}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.SUBJECT_IS_NOT_ISSUER,verifiable_credential_path:_,payload:{format:j.format}}}generateSuccessResult(M,_,j,P){return{input_descriptor_path:`$.input_descriptors[${M}]`,evaluator:this.getName(),status:B.Status.INFO,message:P??m.default.SUBJECT_IS_ISSUER,verifiable_credential_path:_,payload:{format:j.format}}}}},63217:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(F,"__esModule",{value:!0}),F.UriEvaluationHandler=void 0;const a=f(44273),x=f(11151),B=f(35975),m=f(55776),S=f(99938),g=i(f(24080)),E=f(32893);class R extends E.AbstractEvaluationHandler{constructor(_){super(_)}getName(){return"UriEvaluation"}handle(_,j){var P,k,z;_.input_descriptors.forEach((Z,q)=>{const re=_.getVersion()!==S.PEVersion.v2?Z.schema.map(te=>te.uri):[];j.forEach((te,ie)=>{const ae=R.buildVcContextAndSchemaUris(te.credential,_.getVersion());this.evaluateUris(te,ae,re,q,ie,_.getVersion())})});const W=(null===(P=_.format)||void 0===P?void 0:P.di)||(null===(k=_.format)||void 0===k?void 0:k.di_vc)||(null===(z=_.format)||void 0===z?void 0:z.di_vp),V=this.getResults().filter(Z=>Z.status===m.Status.INFO).map(Z=>{var q,re,te,ie;let ae=null===(q=Z.payload)||void 0===q?void 0:q.format;if(W&&("ldp_vc"===ae||"ldp"===ae)){const K=a.JSONPath.nodes(j,Z.verifiable_credential_path).map(A=>A.value).map(A=>A.type===x.OriginalType.JSONLD&&A.credential.proof?(Array.isArray(A.credential.proof)?A.credential.proof:[A.credential.proof]).filter($=>"DataIntegrityProof"===$.type&&void 0!==$.cryptosuite):[]).reduce((A,I)=>A.filter(O=>I.includes(O))),o=a.JSONPath.nodes(_,Z.input_descriptor_path)[0].value,h=!o.format||(null===(re=o?.format)||void 0===re?void 0:re.di)||(null===(te=o?.format)||void 0===te?void 0:te.di_vc)||(null===(ie=o?.format)||void 0===ie?void 0:ie.di_vp);K.length>0&&h&&(ae="di_vc")}return{id:a.JSONPath.nodes(_,Z.input_descriptor_path)[0].value.id,format:ae,path:Z.verifiable_credential_path}});this.client.generatePresentationSubmission&&(!this.presentationSubmission||0===Object.keys(this.presentationSubmission).length)&&(this.presentationSubmission={id:(0,B.nanoid)(),definition_id:_.id,descriptor_map:V})}evaluateUris(_,j,P,k,z,W){let V=!1;if(W===S.PEVersion.v1){for(let Z=0;Zq===j[Z])&&(V=!0)}else V=!0;V?this.getResults().push(this.createSuccessResultObject(_,P,k,z)):this.getResults().push(this.createErrorResultObject(_,P,k,z))}static buildVcContextAndSchemaUris(_,j){const P=[];return x.CredentialMapper.isW3cCredential(_)&&(Array.isArray(_["@context"])?_["@context"].forEach(k=>P.push(k)):P.push(_["@context"]),Array.isArray(_.credentialSchema)&&_.credentialSchema.length>0?_.credentialSchema.forEach(k=>P.push(k.id)):_.credentialSchema&&P.push(_.credentialSchema.id),j===S.PEVersion.v1&&(Array.isArray(_.type)?_.type.forEach(k=>P.push(k)):_.type&&P.push(_.type))),x.CredentialMapper.isSdJwtDecodedCredential(_)&&j===S.PEVersion.v1&&P.push(_.decodedPayload.vct),P}createSuccessResultObject(_,j,P,k){const z=this.createResult(P,k);return z.status=m.Status.INFO,z.message=g.default.URI_EVALUATION_PASSED,z.payload={format:_.format,vcContext:x.CredentialMapper.isW3cCredential(_.credential)?_.credential["@context"]:void 0,vcCredentialSchema:x.CredentialMapper.isW3cCredential(_.credential)?_.credential.credentialSchema:void 0,inputDescriptorsUris:j},z}createErrorResultObject(_,j,P,k){const z=this.createResult(P,k);return z.status=m.Status.ERROR,z.message=g.default.URI_EVALUATION_DIDNT_PASS,z.payload={format:_.format,vcContext:x.CredentialMapper.isW3cCredential(_.credential)?_.credential["@context"]:void 0,vcCredentialSchema:x.CredentialMapper.isW3cCredential(_.credential)?_.credential.credentialSchema:void 0,inputDescriptorsUris:j},z}createWarnResultObject(_,j){const P=this.createResult(_,j);return P.status=m.Status.WARN,P.message=g.default.URI_EVALUATION_DIDNT_PASS,P.payload=g.default.INPUT_DESCRIPTOR_CONTEXT_CONTAINS_HASHLINK_VERIFICATION_NOT_SUPPORTED,P}createResult(_,j){return{input_descriptor_path:`$.input_descriptors[${_}]`,verifiable_credential_path:`$[${j}]`,evaluator:this.getName(),status:m.Status.INFO,message:void 0}}static containsHashlink(_){return!(this.matchAll(_,R.HASHLINK_QUERY_URL_REGEX).next().done&&this.matchAll(_,R.HASHLINK_URL_ENCODED_REGEX).next().done)}}F.UriEvaluationHandler=R,R.matchAll=f(72373),R.HASHLINK_URL_ENCODED_REGEX=/hl:[a-zA-Z0-9]+:[a-zA-Z0-9]+/g,R.HASHLINK_QUERY_URL_REGEX=/https*?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)(hl=[a-zA-Z0-9]+)/g},70143:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.HandlerCheckResult=F.EvaluationClientWrapper=F.EvaluationClient=void 0;const i=f(92127);Object.defineProperty(F,"HandlerCheckResult",{enumerable:!0,get:function(){return i.HandlerCheckResult}});const a=f(50950);Object.defineProperty(F,"EvaluationClient",{enumerable:!0,get:function(){return a.EvaluationClient}});var x=f(78995);Object.defineProperty(F,"EvaluationClientWrapper",{enumerable:!0,get:function(){return x.EvaluationClientWrapper}})},2700:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(M,_,j,P){void 0===P&&(P=j);var k=Object.getOwnPropertyDescriptor(_,j);(!k||("get"in k?!_.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return _[j]}}),Object.defineProperty(M,P,k)}:function(M,_,j,P){void 0===P&&(P=j),M[P]=_[j]}),a=this&&this.__exportStar||function(M,_){for(var j in M)"default"!==j&&!Object.prototype.hasOwnProperty.call(_,j)&&i(_,M,j)};Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv2=F.PEXv1=F.PEX=F.Status=F.Checked=F.PEVersion=F.ValidationEngine=F.HandlerCheckResult=void 0;const x=f(55776);Object.defineProperty(F,"Checked",{enumerable:!0,get:function(){return x.Checked}}),Object.defineProperty(F,"Status",{enumerable:!0,get:function(){return x.Status}});const B=f(97889);Object.defineProperty(F,"PEX",{enumerable:!0,get:function(){return B.PEX}});const m=f(38992);Object.defineProperty(F,"PEXv1",{enumerable:!0,get:function(){return m.PEXv1}});const S=f(71945);Object.defineProperty(F,"PEXv2",{enumerable:!0,get:function(){return S.PEXv2}});const g=f(70143);Object.defineProperty(F,"HandlerCheckResult",{enumerable:!0,get:function(){return g.HandlerCheckResult}});const E=f(99938);Object.defineProperty(F,"PEVersion",{enumerable:!0,get:function(){return E.PEVersion}});const R=f(80930);Object.defineProperty(F,"ValidationEngine",{enumerable:!0,get:function(){return R.ValidationEngine}}),a(f(64864),F)},64864:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(34277),F)},34277:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.KeyEncoding=F.PresentationSubmissionLocation=void 0;var f=function(a){return a[a.EXTERNAL=0]="EXTERNAL",a[a.PRESENTATION=1]="PRESENTATION",a}(f||(F.PresentationSubmissionLocation=f={})),i=function(a){return a.Jwk="Jwk",a.Base58="Base58",a.Hex="Hex",a.Multibase="Multibase",a}(i||(F.KeyEncoding=i={}))},99358:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEVersion=F.InternalPresentationDefinitionV2=F.InternalPresentationDefinitionV1=void 0,F.InternalPresentationDefinitionV1=class f{constructor(B,m,S,g,E,R){this.id=B,this.input_descriptors=m,this.format=S,this.name=g,this.purpose=E,this.submission_requirements=R}getVersion(){return a.v1}},F.InternalPresentationDefinitionV2=class i{constructor(B,m,S,g,E,R,M){this.format=S,this.frame=g,this.id=B,this.input_descriptors=m,this.name=E,this.purpose=R,this.submission_requirements=M}getVersion(){return a.v2}};var a=function(x){return x.v1="v1",x.v2="v2",x}(a||(F.PEVersion=a={}))},24080:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var f=function(i){return i.INPUT_CANDIDATE_DOESNT_CONTAIN_PROPERTY="Input candidate does not contain property",i.INPUT_CANDIDATE_FAILED_FILTER_EVALUATION="Input candidate failed filter evaluation",i.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION="The input candidate is eligible for submission",i.INPUT_CANDIDATE_IS_NOT_ELIGIBLE_FOR_PRESENTATION_SUBMISSION="The input candidate is not eligible for submission",i.INPUT_DESCRIPTOR_CONTEXT_CONTAINS_HASHLINK_VERIFICATION_NOT_SUPPORTED="Input descriptor contains hashlink. This version doesn't support hashlink verification.",i.LIMIT_DISCLOSURE_APPLIED="added variable in the limit_disclosure to the verifiableCredential",i.LIMIT_DISCLOSURE_NOT_SUPPORTED="Limit disclosure not supported",i.SUBJECT_IS_NOT_ISSUER="subject is not issuer",i.SUBJECT_IS_ISSUER="subject is issuer",i.FORMAT_RESTRICTION_PASSED="the Credential format of the candidate inputs matches the required formats",i.FORMAT_RESTRICTION_DIDNT_PASS="the Credential format of the candidate inputs didn't match the required formats",i.URI_EVALUATION_PASSED="@context URI(s) for the schema of the candidate input is equal to one of the input_descriptors object uri values.",i.URI_EVALUATION_DIDNT_PASS="@context URI for the of the candidate input MUST be equal to one of the input_descriptors object uri values exactly.",i.UNKNOWN_EXCEPTION="unknown exception occurred: ",i.VERIFIABLE_CREDENTIAL_MANDATORY_FIELD_NOT_PRESENT="mandatory field not present in the verifiableCredential",i}(f||{});F.default=f},88819:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SSITypesBuilder=void 0;const i=f(11151),a=f(13486),x=f(99358);class B{static modelEntityToInternalPresentationDefinitionV1(S){const g=B.createCopyAndModifyPresentationDefinition(S);return new x.InternalPresentationDefinitionV1(g.id,g.input_descriptors,g.format,g.name,g.purpose,g.submission_requirements)}static modelEntityInternalPresentationDefinitionV2(S){const g=B.createCopyAndModifyPresentationDefinition(S);return new x.InternalPresentationDefinitionV2(g.id,g.input_descriptors,g.format,g.frame,g.name,g.purpose,g.submission_requirements)}static createCopyAndModifyPresentationDefinition(S){const g=JSON.parse(JSON.stringify(S));return a.JsonPathUtils.changePropertyNameRecursively(g,"_const","const"),a.JsonPathUtils.changePropertyNameRecursively(g,"_enum","enum"),a.JsonPathUtils.changeSpecialPathsRecursively(g),g}static mapExternalVerifiablePresentationToWrappedVP(S,g){return i.CredentialMapper.toWrappedVerifiablePresentation(S,{hasher:g})}static mapExternalVerifiableCredentialsToWrappedVcs(S,g){return i.CredentialMapper.toWrappedVerifiableCredentials(Array.isArray(S)?S:[S],{hasher:g})}static toInternalPresentationDefinition(S){const g=JSON.parse(JSON.stringify(S)),E=(0,a.definitionVersionDiscovery)(g);if(E.error)throw E.error;return E.version==x.PEVersion.v1?B.modelEntityToInternalPresentationDefinitionV1(g):B.modelEntityInternalPresentationDefinitionV2(g)}}F.SSITypesBuilder=B},99938:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(24080),F),a(f(99358),F),a(f(88819),F)},27426:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectUtils=void 0;class f{static asArray(a){return Array.isArray(a)?a:[a]}static isObject(a){return"[object Object]"===Object.prototype.toString.call(a)}static isUrlAbsolute(a){f.isString(a)&&/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/.test(a)}static isString(a){return"string"==typeof a||"[object String]"===Object.prototype.toString.call(a)}static getDistinctFieldInObject(a,x){const B=a.map(m=>m[x]);return Array.from(new Set(B))}static cloneDeep(a){return JSON.parse(JSON.stringify(a))}}F.ObjectUtils=f},18471:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectValidationUtils=void 0,F.ObjectValidationUtils=class f{static optionalNonEmptyString(a){return null==a||a.length>0}static nonEmptyString(a){return null!=a&&a.length>0}static isValidDIDURI(a){return new RegExp("^did:([a-z0-9]+)(:([a-zA-Z0-9\\.\\-_]|%[0-9a-fA-F]{2})+)+(/([a-zA-Z-\\._~]|%[0-9a-fA-F]{2}|[!$&'()*+,;=:@])*)?").test(a)}}},79446:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(P){return P&&P.__esModule?P:{default:P}};Object.defineProperty(F,"__esModule",{value:!0}),F.filterToRestrictedDIDs=F.isRestrictedDID=F.uniformDIDMethods=F.definitionVersionDiscovery=F.getIssuerString=F.getSubjectIdsAsString=void 0;const a=f(99938),x=i(f(86515)),B=i(f(93046)),m=f(27426),S=f(45408);function M(P,k){var z;let W=null!==(z=P?.map(V=>V.toLowerCase()).map(V=>V.startsWith("did:")?V:`did:${V}`))&&void 0!==z?z:[];if(k?.removePrefix){const V=k.removePrefix.endsWith(":")?k.removePrefix.length:k.removePrefix.length+1;W=W.map(Z=>Z.startsWith(k.removePrefix)?Z.substring(V):Z)}return W.includes("did")?[]:W}F.getSubjectIdsAsString=function g(P){return(Array.isArray(P.credentialSubject)?P.credentialSubject:[P.credentialSubject]).filter(z=>!!z.id).map(z=>z.id)},F.getIssuerString=function E(P){return m.ObjectUtils.isString(P.issuer)?P.issuer:P.issuer.id},F.definitionVersionDiscovery=function R(P){const k=JSON.parse(JSON.stringify(P));S.JsonPathUtils.changePropertyNameRecursively(k,"_const","const"),S.JsonPathUtils.changePropertyNameRecursively(k,"_enum","enum");const z={presentation_definition:k};let W=(0,B.default)(z);return W?{version:a.PEVersion.v2}:(W=(0,x.default)(z),W?{version:a.PEVersion.v1}:{error:"This is not a valid PresentationDefinition"})},F.uniformDIDMethods=M,F.isRestrictedDID=function _(P,k){const z=M(k);return 0===z.length||z.some(W=>P.toLowerCase().startsWith(W))},F.filterToRestrictedDIDs=function j(P,k){const z=M(k);return 0===z.length?P:z.flatMap(W=>P.filter(V=>V.toLowerCase().startsWith(W)))}},13486:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(45408),F),a(f(27426),F),a(f(18471),F),a(f(79446),F),a(f(58870),F)},45408:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.JsonPathUtils=void 0;const i=f(44273);class a{static extractInputField(B,m){let S=[];if(m)for(const g of m)if(S=i.JSONPath.nodes(B,g),S.length)break;return S}static changePropertyNameRecursively(B,m,S){const g=a.extractInputField(B,["$.."+m]);for(const E of g)this.copyResultPathToDestinationDefinition(E.path,B,S)}static setValue(B,m,S){const g="string"==typeof m?m:i.JSONPath.stringify(m);return i.JSONPath.value(B,g,S),B}static copyResultPathToDestinationDefinition(B,m,S){let g=m;for(let E=1;E1&&"['"!==m.substring(E-2,E)&&'["'!==m.substring(E-2,E))if(".."===m.substring(E-2,E)){m=m.substring(0,E-2)+"..['"+S.value[0]+"']"+m.substring(E+S.value[0].length),g=!0;const R=this.matchAll(m,this.REGEX_PATH);this.modifyPathRecursive(R,m)}else"."===m.charAt(E-1)&&(m=m.substring(0,E-1)+"['"+S.value[0]+"']"+m.substring(E+S.value[0].length),g=!0,this.modifyPathRecursive(B,m));S=B.next()}return m}}F.JsonPathUtils=a,a.matchAll=f(72373),a.REGEX_PATH=/@\w+/g},58870:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(M,_,j,P){void 0===P&&(P=j);var k=Object.getOwnPropertyDescriptor(_,j);(!k||("get"in k?!_.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return _[j]}}),Object.defineProperty(M,P,k)}:function(M,_,j,P){void 0===P&&(P=j),M[P]=_[j]}),a=this&&this.__setModuleDefault||(Object.create?function(M,_){Object.defineProperty(M,"default",{enumerable:!0,value:_})}:function(M,_){M.default=_}),x=this&&this.__importStar||function(M){if(M&&M.__esModule)return M;var _={};if(null!=M)for(var j in M)"default"!==j&&Object.prototype.hasOwnProperty.call(M,j)&&i(_,M,j);return a(_,M),_};Object.defineProperty(F,"__esModule",{value:!0}),F.applySdJwtLimitDisclosure=F.calculateSdHash=void 0;const B=f(15315),m=f(22084),S=x(f(75324)),g=f(27426);F.calculateSdHash=function E(M,_,j){const P=j(M,_);return S.toString(P,"base64url")},F.applySdJwtLimitDisclosure=function R(M,_){const j=M.disclosures.map(q=>({digest:q.digest,encoded:q.encoded,salt:q.decoded[0],value:3===q.decoded.length?q.decoded[2]:q.decoded[1],key:3===q.decoded.length?q.decoded[1]:void 0})),P=(0,m.selectDisclosures)(g.ObjectUtils.cloneDeep(M.signedPayload),j,_);M.disclosures=P.map(q=>({encoded:q.encoded,decoded:q.key?[q.salt,q.key,q.value]:[q.salt,q.value],digest:q.digest}));const k=M.disclosures.map(q=>q.encoded),z=M.compactSdJwtVc.split("~");M.compactSdJwtVc=z.filter((q,re)=>0===re||re===z.length-1||k.includes(q)).join("~");const{payload:W}=(0,B.getSDAlgAndPayload)(g.ObjectUtils.cloneDeep(M.signedPayload)),V=(0,m.createHashMappingForSerializedDisclosure)(P),{unpackedObj:Z}=(0,B.unpackObj)(W,V);M.decodedPayload=Z}},38612:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ConstraintsVB=void 0;const i=f(47636),a=f(30387),x=f(10767);class B extends x.ValidationBundler{constructor(S){super(S,"constraints"),this.disclosureLimitShouldHaveKnownValueMsg="limit_disclosure should have known value",this.statusShouldHaveKnownValueMsg="Unknown status property",this.statusDirectiveShouldHaveKnownValueMsg="status directive should have known value",this.subjectIsIssuerShouldBeKnownValueMsg="subject_is_issuer should be known value",this.fieldIdIsMandatoryMsg="field_id property is mandatory",this.fieldIdMustBeArrayOfStringsMsg="field_id property must be an array of strings",this.fieldIdMustCorrespondToFieldIdMsg="field_id must correspond to a present field object id property",this.directivePropertyIsMandatoryMsg="directive property is mandatory",this.oneOfTheKnownDirectivePropertiesMandatoryMsg="directive property must be one of [required, preferred]"}getValidations(S){let g=[];return S&&(g=[{tag:this.getTag(),target:S,predicate:E=>B.disclosureLimitShouldHaveKnownValue(E.limit_disclosure),message:this.disclosureLimitShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:E=>B.statusShouldHaveKnownValue(E.statuses),message:this.statusShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:B.statusDirectiveShouldHaveKnownValue(),message:this.statusDirectiveShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:E=>B.shouldBeKnownOption(E.is_holder),message:this.subjectIsIssuerShouldBeKnownValueMsg},{tag:this.getTag(),target:S,predicate:E=>this.fieldIdInSubjectMustCorrespondToFieldId(E,E.is_holder),message:this.fieldIdMustCorrespondToFieldIdMsg},{tag:this.getTag(),target:S,predicate:E=>this.fieldIdInSubjectMustCorrespondToFieldId(E,E.same_subject),message:this.fieldIdMustCorrespondToFieldIdMsg},...this.getSubjectsValidations(S?.is_holder),...this.getSubjectsValidations(S?.same_subject),...this.getFieldsValidations(S)]),g}getFieldsValidations(S){var g;return null!==(g=S?.fields)&&void 0!==g&&g.length?new a.FieldsVB(this.getTag()).getValidations(S.fields):[]}static disclosureLimitShouldHaveKnownValue(S){return!S||S===i.Optionality.Preferred||S===i.Optionality.Required}static statusShouldHaveKnownValue(S){return null==S||null!=S.active||null!=S.revoked||null!=S.suspended}static statusDirectiveShouldHaveKnownValue(){return S=>{var g,E,R;return this.pdStatusShouldBeKnown(null===(g=S?.statuses)||void 0===g?void 0:g.active)&&this.pdStatusShouldBeKnown(null===(E=S?.statuses)||void 0===E?void 0:E.revoked)&&this.pdStatusShouldBeKnown(null===(R=S?.statuses)||void 0===R?void 0:R.suspended)}}static pdStatusShouldBeKnown(S){return!S||S.directive===i.Directives.Allowed||S.directive===i.Directives.Disallowed||S.directive===i.Directives.Required}static shouldBeKnownOption(S){return!S||0===S.filter(g=>g.directive!==i.Optionality.Preferred&&g.directive!==i.Optionality.Required).length}getSubjectsValidations(S){if(S){let g=[];for(let E=0;EArray.isArray(R.field_id),message:this.fieldIdMustBeArrayOfStringsMsg},{tag:this.getMyTag(E),target:S[E],predicate:R=>!!R.field_id,message:this.fieldIdIsMandatoryMsg},{tag:this.getMyTag(E),target:S[E],predicate:R=>R.field_id.length===R.field_id.filter(M=>"string"==typeof M).length,message:this.fieldIdMustBeArrayOfStringsMsg},{tag:this.getMyTag(E),target:S[E],predicate:R=>void 0!==R.directive,message:this.directivePropertyIsMandatoryMsg},{tag:this.getMyTag(E),target:S[E],predicate:R=>R.directive===i.Optionality.Preferred||R.directive===i.Optionality.Required,message:this.oneOfTheKnownDirectivePropertiesMandatoryMsg}];return g}return[]}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}fieldIdInSubjectMustCorrespondToFieldId(S,g){if(g)for(const E of g)for(const R of E.field_id)if(!B.isValidFieldId(S,R))return!1;return!0}static isValidFieldId(S,g){return!!S?.fields&&S.fields.map(E=>E.id).includes(g)}}F.ConstraintsVB=B},30387:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(F,"__esModule",{value:!0}),F.FieldsVB=void 0;const a=f(44273),x=f(47636),B=i(f(94217)),m=i(f(61264)),S=f(10767);class g extends S.ValidationBundler{constructor(R){super(R,"fields"),this.mustHaveValidJsonPathsMsg='field object "path" property must contain array of valid json paths',this.pathObjMustHaveValidJsonPathMsg='field object "path" property must contain valid json paths.',this.filterMustBeValidJsonSchemaMsg='field object "filter" property must be valid json schema',this.filterIsMustInPresenceOfPredicateMsg='field object must have a "filter" property if "predicate" is present',this.filterIsNotValidJsonSchemaDescriptorMsg='could not parse "filter" object as a valid json schema descriptor.',this.purposeShouldBeANonEmptyStringMsg="purpose should be a non empty string",this.shouldBeKnownOptionMsg="Unknown predicate property"}getValidations(R){let M=[];if(R)for(let _=0;_g.optionalNonEmptyString(_?.purpose),message:this.purposeShouldBeANonEmptyStringMsg},{tag:this.getMyTag(M),target:R,predicate:_=>g.shouldBeKnownOption(_?.predicate),message:this.shouldBeKnownOptionMsg}]}getMyTag(R){return this.parentTag+"."+this.myTag+"["+R+"]"}mustHaveValidJsonPaths(){return R=>null!=R.path&&R.path.length>0&&this._validateJsonPaths(R.path)}_validateJsonPaths(R){const M=[];if(R.forEach(_=>{try{a.JSONPath.parse(_)}catch{M.push(_)}}),M.length>0)throw this.toChecked(this.pathObjMustHaveValidJsonPathMsg+" Got: "+JSON.stringify(M));return!0}filterMustBeValidJsonSchema(){return R=>this._validateFilter(R.filter)}_validateFilter(R){if(null==R)return!0;let M=!1;try{M=(0,m.default)(R),M||(M=(0,B.default)(R))}catch{throw this.toChecked(this.filterIsNotValidJsonSchemaDescriptorMsg+" Got "+JSON.stringify(R))}return M}filterIsMustInPresenceOfPredicate(){return R=>!(null!=R.predicate&&null==R.filter)}static optionalNonEmptyString(R){return null==R||R.length>0}static shouldBeKnownOption(R){return null==R||R==x.Optionality.Required||R==x.Optionality.Preferred}}F.FieldsVB=g},79241:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.FrameVB=void 0;const i=f(13486),a=f(10767);class x extends a.ValidationBundler{constructor(m){super(m,"frame"),this.frameIsValidMsg="frame value is not valid"}getValidations(m){let S=[];return S=[...S,...this.getMyValidations(m)],S}getMyValidations(m){return[{tag:this.getMyTag(),target:m,predicate:x.frameIsValid,message:this.frameIsValidMsg}]}getMyTag(){return this.parentTag+"."+this.myTag}static frameIsValid(m){if(!m||Array.isArray(m)||"object"!=typeof m)return!1;const S=m;if(S&&S["@id"])for(const g of i.ObjectUtils.asArray(m["@id"]))if(!i.ObjectUtils.isObject(g)&&!i.ObjectUtils.isUrlAbsolute(g)||i.ObjectUtils.isString(g)&&0===g.indexOf("_:"))return!1;if(S["@types"])for(const g of i.ObjectUtils.asArray(m["@types"]))if(!i.ObjectUtils.isObject(g)&&!i.ObjectUtils.isUrlAbsolute(g)||i.ObjectUtils.isString(g)&&0===g.indexOf("_:"))return!1;return!0}}F.FrameVB=x},75056:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(30387),F),a(f(853),F),a(f(74840),F),a(f(27506),F),a(f(12915),F),a(f(3170),F),a(f(97091),F),a(f(10767),F),a(f(38612),F)},853:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorsV1VB=void 0;const i=f(13486),a=f(38612),x=f(10767);F.InputDescriptorsV1VB=class B extends x.ValidationBundler{constructor(S){super(S,"input_descriptor"),this.idMustBeNonEmptyStringMsg="input descriptor id must be non-empty string",this.nameShouldBeNonEmptyStringMsg="input descriptor name should be non-empty string",this.purposeShouldBeNonEmptyStringMsg="input descriptor purpose should be non-empty string",this.shouldHaveValidSchemaURIMsg="schema should have valid URI"}getValidations(S){let g=[];return g.push({tag:this.getTag(),target:S,predicate:E=>this.shouldHaveUniqueIds(E),message:"input descriptor ids must be unique"},{tag:this.getTag(),target:S,predicate:E=>this.shouldHaveUniqueFieldsIds(E),message:"fields id must be unique"}),S.forEach((E,R)=>{g=[...g,...this.getValidationFor(E,R),...this.constraintsValidations(E,R)]}),g}getValidationFor(S,g){return[{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.nonEmptyString(E?.id),message:this.idMustBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:this.isValidSchema(),message:this.shouldHaveValidSchemaURIMsg},{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.optionalNonEmptyString(E?.name),message:this.nameShouldBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.optionalNonEmptyString(E?.purpose),message:this.purposeShouldBeNonEmptyStringMsg}]}shouldHaveUniqueFieldsIds(S){const g=[],E=new Set,R=[];return S.map(M=>{var _;return null===(_=M.constraints)||void 0===_?void 0:_.fields}).forEach(M=>{M&&R.push(...M)}),R.forEach(M=>{M.id&&g.push(M.id)}),g.forEach(M=>E.add(M)),g.length===E.size}shouldHaveUniqueIds(S){const g=[],E=new Set;return S.forEach(R=>g.push(R.id)),g.forEach(R=>E.add(R)),g.length===E.size}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}isValidSchema(){return S=>S.schema.filter(g=>this.isAValidURI(g.uri)&&(null==g.required||"boolean"==typeof g.required)).length>0}isAValidURI(S){if(!S)return!1;if(!i.ObjectValidationUtils.nonEmptyString(S))return!1;if(S.startsWith("http://")||S.startsWith("https://"))try{new URL(S)}catch{return i.ObjectValidationUtils.isValidDIDURI(S)}return!0}constraintsValidations(S,g){return S.constraints?new a.ConstraintsVB(this.getMyTag(g)).getValidations(S.constraints):[]}}},74840:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorsV2VB=void 0;const i=f(13486),a=f(38612),x=f(10767);F.InputDescriptorsV2VB=class B extends x.ValidationBundler{constructor(S){super(S,"input_descriptor"),this.idMustBeNonEmptyStringMsg="input descriptor id must be non-empty string",this.nameShouldBeNonEmptyStringMsg="input descriptor name should be non-empty string",this.purposeShouldBeNonEmptyStringMsg="input descriptor purpose should be non-empty string"}getValidations(S){let g=[];return g.push({tag:this.getTag(),target:S,predicate:E=>this.shouldNotHaveSchema(E),message:"input descriptor should not have schema property"},{tag:this.getTag(),target:S,predicate:E=>this.shouldHaveUniqueIds(E),message:"input descriptor ids must be unique"},{tag:this.getTag(),target:S,predicate:E=>this.shouldHaveUniqueFieldsIds(E),message:"fields id must be unique"}),S.forEach((E,R)=>{g=[...g,...this.getValidationFor(E,R),...this.constraintsValidations(E,R)]}),g}getValidationFor(S,g){return[{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.nonEmptyString(E?.id),message:this.idMustBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.optionalNonEmptyString(E?.name),message:this.nameShouldBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:E=>i.ObjectValidationUtils.optionalNonEmptyString(E?.purpose),message:this.purposeShouldBeNonEmptyStringMsg}]}shouldHaveUniqueFieldsIds(S){const g=[],E=new Set,R=[];return S.map(M=>{var _;return null===(_=M.constraints)||void 0===_?void 0:_.fields}).forEach(M=>{M&&R.push(...M)}),R.forEach(M=>{M.id&&g.push(M.id)}),g.forEach(M=>E.add(M)),g.length===E.size}shouldHaveUniqueIds(S){const g=[],E=new Set;return S.forEach(R=>g.push(R.id)),g.forEach(R=>E.add(R)),g.length===E.size}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}constraintsValidations(S,g){return S.constraints?new a.ConstraintsVB(this.getMyTag(g)).getValidations(S.constraints):[]}shouldNotHaveSchema(S){let g=!1;return S.forEach(E=>{E.schema&&(g=!0)}),!g}}},27506:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationDefinitionV1VB=void 0;const a=f(92209),x=f(83851),B=i(f(86515)),m=f(853),S=f(97091),g=f(10767);class E extends g.ValidationBundler{constructor(M){super(M,"presentation_definition")}getValidations(M){return M.submission_requirements?[...this.myValidations(M),...new m.InputDescriptorsV1VB(this.myTag).getValidations(M.input_descriptors),...new S.SubmissionRequirementVB(this.myTag).getValidations(M.submission_requirements)]:[...this.myValidations(M),...new m.InputDescriptorsV1VB(this.myTag).getValidations(M.input_descriptors)]}myValidations(M){return[{tag:this.getTag(),target:M,predicate:_=>null!=_,message:"presentation_definition should be non null."},{tag:this.getTag(),target:M,predicate:this.shouldBeAsPerJsonSchema(),message:"presentation_definition should be as per json schema."},{tag:this.getTag(),target:M,predicate:_=>E.nonEmptyString(_?.id),message:"id should not be empty"},{tag:this.getTag(),target:M,predicate:_=>E.optionalNonEmptyString(_?.name),message:"name should be a non-empty string"},{tag:this.getTag(),target:M,predicate:_=>E.optionalNonEmptyString(_?.purpose),message:"purpose should be a non-empty string"},{tag:this.getTag(),target:M,predicate:_=>E.formatValuesShouldNotBeEmpty(_?.format),message:"formats values should not empty"},{tag:this.getTag(),target:M,predicate:_=>E.formatValuesShouldBeAmongKnownValues(_?.format),message:"formats should only have known identifiers for alg or proof_type"},{tag:this.getTag(),target:M,predicate:_=>E.groupShouldMatchSubmissionRequirements(_),message:"input descriptor group should match the from in submission requirements."},{tag:this.getTag(),target:M,predicate:_=>E.shouldNotHaveFrameProperty(_),message:"input descriptor should not have frame property."}]}static optionalNonEmptyString(M){return null==M||M.length>0}static nonEmptyString(M){return null!=M&&M.length>0}static formatValuesShouldNotBeEmpty(M){var _,j,P,k,z,W,V,Z,q,re,te;let ie=!0;return null!=M?.jwt&&(ie=ie&&(null===(_=M.jwt.alg)||void 0===_?void 0:_.length)>0),null!=M?.jwt_vc&&(ie=ie&&(null===(j=M.jwt_vc.alg)||void 0===j?void 0:j.length)>0),null!=M?.jwt_vc_json&&(ie=ie&&(null===(P=M.jwt_vc_json.alg)||void 0===P?void 0:P.length)>0),null!=M?.jwt_vp&&(ie=ie&&(null===(k=M.jwt_vp.alg)||void 0===k?void 0:k.length)>0),null!=M?.jwt_vp_json&&(ie=ie&&(null===(z=M.jwt_vp_json.alg)||void 0===z?void 0:z.length)>0),null!=M?.ldp&&(ie=ie&&(null===(W=M.ldp.proof_type)||void 0===W?void 0:W.length)>0),null!=M?.ldp_vc&&(ie=ie&&(null===(V=M.ldp_vc.proof_type)||void 0===V?void 0:V.length)>0),null!=M?.ldp_vp&&(ie=ie&&(null===(Z=M.ldp_vp.proof_type)||void 0===Z?void 0:Z.length)>0),null!=M?.di&&(ie=ie&&(null===(q=M.di.proof_type)||void 0===q?void 0:q.length)>0),null!=M?.di_vc&&(ie=ie&&(null===(re=M.di_vc.proof_type)||void 0===re?void 0:re.length)>0),null!=M?.di_vp&&(ie=ie&&(null===(te=M.di_vp.proof_type)||void 0===te?void 0:te.length)>0),ie}static formatValuesShouldBeAmongKnownValues(M){let _=[];if(M){const j=a.JwtAlgos.getJwtAlgos(),P=x.LdpTypes.getLdpTypes();_=[];for(const[k,z]of Object.entries(M))k.startsWith("jwt")?_.push(...E.isJWTAlgoKnown(z,j)):_.push(...E.isLDPProofKnown(z,P))}return 0===_.length}static isJWTAlgoKnown(M,_){const j=[];if(null!=M&&null!=M.alg)for(const P of M.alg)_.includes(P)||j.push(P);return j}static isLDPProofKnown(M,_){const j=[];if(null!=M&&null!=M.proof_type)for(const P of M.proof_type)_.includes(P)||j.push(P);return j}static groupShouldMatchSubmissionRequirements(M){if(null!=M.submission_requirements&&M.submission_requirements.length>0){const _=[];M.input_descriptors.forEach(W=>{W.group&&_.push(...W.group)});const j=new Set(_),P=[];E.flatten(M.submission_requirements).forEach(W=>{W.from&&(Array.isArray(W.from)?P.push(...W.from):P.push(W.from))});const k=new Set(P);return 0===new Set([...k].filter(W=>null!=W&&W.length>0&&!j.has(W))).size}return!0}static flatten(M){return M?.reduce((_,j)=>_.concat(Array.isArray(j.from_nested)?this.flatten(j.from_nested):j),[])}shouldBeAsPerJsonSchema(){return M=>(0,B.default)({presentation_definition:M})}static shouldNotHaveFrameProperty(M){return!M.frame}}F.PresentationDefinitionV1VB=E},12915:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationDefinitionV2VB=void 0;const a=f(92209),x=f(83851),B=i(f(93046)),m=f(79241),S=f(74840),g=f(97091),E=f(10767);class R extends E.ValidationBundler{constructor(_){super(_,"presentation_definition")}getValidations(_){let j=[];return j=_.submission_requirements?[...this.myValidations(_),...new S.InputDescriptorsV2VB(this.myTag).getValidations(_.input_descriptors),...new g.SubmissionRequirementVB(this.myTag).getValidations(_.submission_requirements)]:[...this.myValidations(_),...new S.InputDescriptorsV2VB(this.myTag).getValidations(_.input_descriptors)],_.frame&&j.push(...new m.FrameVB(this.myTag).getValidations(_.frame)),j}myValidations(_){return[{tag:this.getTag(),target:_,predicate:j=>null!=j,message:"presentation_definition should be non null."},{tag:this.getTag(),target:_,predicate:this.shouldBeAsPerJsonSchema(),message:"presentation_definition should be as per json schema."},{tag:this.getTag(),target:_,predicate:j=>R.nonEmptyString(j?.id),message:"id should not be empty"},{tag:this.getTag(),target:_,predicate:j=>R.optionalNonEmptyString(j?.name),message:"name should be a non-empty string"},{tag:this.getTag(),target:_,predicate:j=>R.optionalNonEmptyString(j?.purpose),message:"purpose should be a non-empty string"},{tag:this.getTag(),target:_,predicate:j=>R.formatValuesShouldNotBeEmpty(j?.format),message:"formats values should not empty"},{tag:this.getTag(),target:_,predicate:j=>R.formatValuesShouldBeAmongKnownValues(j?.format),message:"formats should only have known identifiers for alg or proof_type"},{tag:this.getTag(),target:_,predicate:j=>R.groupShouldMatchSubmissionRequirements(j),message:"input descriptor group should match the from in submission requirements."}]}static optionalNonEmptyString(_){return null==_||_.length>0}static nonEmptyString(_){return null!=_&&_.length>0}static formatValuesShouldNotBeEmpty(_){var j,P,k,z,W,V,Z,q,re,te,ie;let ae=!0;return null!=_?.jwt&&(ae=ae&&(null===(j=_.jwt.alg)||void 0===j?void 0:j.length)>0),null!=_?.jwt_vc&&(ae=ae&&(null===(P=_.jwt_vc.alg)||void 0===P?void 0:P.length)>0),null!=_?.jwt_vc_json&&(ae=ae&&(null===(k=_.jwt_vc_json.alg)||void 0===k?void 0:k.length)>0),null!=_?.jwt_vp&&(ae=ae&&(null===(z=_.jwt_vp.alg)||void 0===z?void 0:z.length)>0),null!=_?.jwt_vp_json&&(ae=ae&&(null===(W=_.jwt_vp_json.alg)||void 0===W?void 0:W.length)>0),null!=_?.ldp&&(ae=ae&&(null===(V=_.ldp.proof_type)||void 0===V?void 0:V.length)>0),null!=_?.ldp_vc&&(ae=ae&&(null===(Z=_.ldp_vc.proof_type)||void 0===Z?void 0:Z.length)>0),null!=_?.ldp_vp&&(ae=ae&&(null===(q=_.ldp_vp.proof_type)||void 0===q?void 0:q.length)>0),null!=_?.di&&(ae=ae&&(null===(re=_.di.proof_type)||void 0===re?void 0:re.length)>0),null!=_?.di_vc&&(ae=ae&&(null===(te=_.di_vc.proof_type)||void 0===te?void 0:te.length)>0),null!=_?.di_vp&&(ae=ae&&(null===(ie=_.di_vp.proof_type)||void 0===ie?void 0:ie.length)>0),ae}static formatValuesShouldBeAmongKnownValues(_){let j=[];if(_){const P=a.JwtAlgos.getJwtAlgos(),k=x.LdpTypes.getLdpTypes();j=[];for(const[z,W]of Object.entries(_))z.startsWith("jwt")?j.push(...R.isJWTAlgoKnown(W,P)):j.push(...R.isLDPProofKnown(W,k))}return 0===j.length}static isJWTAlgoKnown(_,j){const P=[];if(null!=_&&null!=_.alg)for(const k of _.alg)j.includes(k)||P.push(k);return P}static isLDPProofKnown(_,j){const P=[];if(null!=_&&null!=_.proof_type)for(const k of _.proof_type)j.includes(k)||P.push(k);return P}static groupShouldMatchSubmissionRequirements(_){if(null!=_.submission_requirements&&_.submission_requirements.length>0){const j=[];_.input_descriptors.forEach(V=>{V.group&&j.push(...V.group)});const P=new Set(j),k=[];R.flatten(_.submission_requirements).forEach(V=>{V.from&&k.push(V.from)});const z=new Set(k);return 0===new Set([...z].filter(V=>null!=V&&V.length>0&&!P.has(V))).size}return!0}static flatten(_){return _?.reduce((j,P)=>j.concat(Array.isArray(P.from_nested)?this.flatten(P.from_nested):P),[])}shouldBeAsPerJsonSchema(){return _=>(0,B.default)({presentation_definition:_})}}F.PresentationDefinitionV2VB=R},3170:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationSubmissionVB=void 0;const i=f(44273),a=f(55776),x=f(10767);class B extends x.ValidationBundler{constructor(S){super(S,"presentation_submission")}getValidations(S){return[{tag:this.getTag(),target:S,predicate:g=>null!=g,message:"presentation_submission should be non null."},{tag:this.getTag(),target:S,predicate:g=>B.nonEmptyString(g?.id),message:"id should not be empty"},{tag:this.getTag(),target:S,predicate:g=>B.nonEmptyString(g?.definition_id),message:"presentation_definition_id should not be empty"},{tag:this.getTag(),target:S,predicate:g=>B.descriptorMapMustBePresent(g?.descriptor_map),message:"descriptor_map should be a non-empty list"},{tag:this.getTag(),target:S,predicate:g=>B.idMustBeSameForEachLevelOfNesting(g?.descriptor_map),message:"each descriptor should have a one id in it, on all levels"},{tag:this.getTag(),target:S,predicate:g=>B.formatsShouldBeKnown(g?.descriptor_map),message:"each format should be one of the known format"},{tag:this.getTag(),target:S,predicate:g=>B.pathsShouldBeValidJsonPaths(g?.descriptor_map),message:"each path should be a valid jsonPath"}]}static nonEmptyString(S){return null!=S&&S.length>0}static descriptorMapMustBePresent(S){return null!=S&&S.length>0}static idMustBeSameForEachLevelOfNesting(S){let g=!0;if(null!=S)for(let E=0;E0)throw new a.Checked("",a.Status.ERROR,"These were not parsable json paths: "+JSON.stringify(g));return!0}}F.PresentationSubmissionVB=B},97091:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SubmissionRequirementVB=void 0;const i=f(10767);class a extends i.ValidationBundler{constructor(B){super(B,"submission_requirements"),this.ruleIsMandatoryMsg="rule is a mandatory field",this.needsOneFromOrFromNestedMsg="needs exactly one of from or from_nested",this.fromNestedShouldBeArrayMsg="The value of the from_nested property MUST be an array",this.isCountPositiveIntMsg="count must be a practical positive number",this.isMinPositiveIntMsg="min must be a practical positive number",this.isMaxPositiveIntMsg="max must be a practical positive number",this.ruleShouldBePickOrAllMsg="rule should be either pick or all"}getValidations(B){let m=[];if(null!=B&&B.length>0)for(let S=0;S{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValidationBundler=void 0;const i=f(55776);F.ValidationBundler=class a{constructor(B,m){this.parentTag=B,this.myTag=m}getTag(){return null!=this.parentTag?this.parentTag+"."+this.myTag:this.myTag}toChecked(B){return new i.Checked(this.getTag(),i.Status.ERROR,B)}}},80320:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(51130),F),a(f(93398),F),a(f(50903),F)},92209:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.JwtAlgos=void 0,F.JwtAlgos=class f{static getJwtAlgos(){return["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512","PS256","PS384","PS512","none","RSA1_5","RSA-OAEP","RSA-OAEP-256","A128KW","A192KW","A256KW","dir","ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW","A128GCMKW","A192GCMKW","A256GCMKW","PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW"]}}},83851:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.LdpTypes=void 0,F.LdpTypes=class f{static getLdpTypes(){return["Ed25519VerificationKey2018","Ed25519Signature2018","RsaSignature2018","EcdsaSecp256k1Signature2019","EcdsaSecp256k1RecoverySignature2020","JsonWebSignature2020","GpgSignature2020","JcsEd25519Signature2020","BbsBlsSignature2020","Bls12381G2Key2020","DataIntegrityProof"]}}},93398:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},50903:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValidationEngine=void 0;const i=f(80320);F.ValidationEngine=class a{validate(B){let m=[];for(const S of B)m=m.concat(S.bundler.getValidations(S.target));return(0,i.validate)(m)}}},51130:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validate=void 0;const i=f(55776);F.validate=x=>{function m(M){return new i.Checked(M.tag,i.Status.ERROR,M.message)}function S(M){return new i.Checked(M,i.Status.INFO,"ok")}const R=x.map(M=>function g(M){let _;try{_=M.predicate(M.target)?S(M.tag):m(M)}catch{_=m(M)}return _}(M)).reduce((M,_)=>(_.status!==i.Status.INFO&&M.push(_),M),[]);return(0,i.hasErrors)(R)?R:[S("root")]}},80930:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(75056),F),a(f(80320),F)},94217:Me=>{"use strict";Me.exports=g,Me.exports.default=g;const f={additionalProperties:!1,properties:{const:{$ref:"#/definitions/OneOfNumberStringBoolean"},enum:{items:{$ref:"#/definitions/OneOfNumberString"},type:"array"},exclusiveMaximum:{$ref:"#/definitions/OneOfNumberString"},exclusiveMinimum:{$ref:"#/definitions/OneOfNumberString"},format:{type:"string"},maxLength:{type:"number"},maximum:{$ref:"#/definitions/OneOfNumberString"},minLength:{type:"number"},minimum:{$ref:"#/definitions/OneOfNumberString"},not:{type:"object"},pattern:{type:"string"},type:{type:"string"}},required:["type"],type:"object"},i=Object.prototype.hasOwnProperty,a={type:["number","string","boolean"]};function x(E,{instancePath:R="",rootData:j=E}={}){let P=null,k=0;if("number"!=typeof E&&"string"!=typeof E&&"boolean"!=typeof E){const z={instancePath:R,schemaPath:"#/type",keyword:"type",params:{type:a.type},message:"must be number,string,boolean",schema:a.type,parentSchema:a,data:E};null===P?P=[z]:P.push(z),k++}return x.errors=P,0===k}const B={type:["number","string"]};function m(E,{instancePath:R="",rootData:j=E}={}){let P=null,k=0;if("number"!=typeof E&&"string"!=typeof E){const z={instancePath:R,schemaPath:"#/type",keyword:"type",params:{type:B.type},message:"must be number,string",schema:B.type,parentSchema:B,data:E};null===P?P=[z]:P.push(z),k++}return m.errors=P,0===k}function S(E,{instancePath:R="",rootData:j=E}={}){let P=null,k=0;if(E&&"object"==typeof E&&!Array.isArray(E)){if(void 0===E.type){const z={instancePath:R,schemaPath:"#/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'",schema:f.required,parentSchema:f,data:E};null===P?P=[z]:P.push(z),k++}for(const z in E)if(!i.call(f.properties,z)){const W={instancePath:R,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:z},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:E};null===P?P=[W]:P.push(W),k++}if(void 0!==E.const&&(x(E.const,{instancePath:R+"/const",parentData:E,parentDataProperty:"const",rootData:j})||(P=null===P?x.errors:P.concat(x.errors),k=P.length)),void 0!==E.enum){let z=E.enum;if(Array.isArray(z)){const W=z.length;for(let V=0;V{"use strict";Me.exports=E,Me.exports.default=E;const f={additionalProperties:!1,properties:{const:{$ref:"#/definitions/OneOfNumberStringBoolean"},contains:{$ref:"#/definitions/FilterV2"},enum:{items:{$ref:"#/definitions/OneOfNumberString"},type:"array"},exclusiveMaximum:{$ref:"#/definitions/OneOfNumberString"},exclusiveMinimum:{$ref:"#/definitions/OneOfNumberString"},format:{type:"string"},formatExclusiveMaximum:{type:"string"},formatExclusiveMinimum:{type:"string"},formatMaximum:{type:"string"},formatMinimum:{type:"string"},items:{anyOf:[{$ref:"#/definitions/FilterV2"},{items:{$ref:"#/definitions/FilterV2"},minItems:1,type:"array"}]},maxLength:{type:"number"},maximum:{$ref:"#/definitions/OneOfNumberString"},minLength:{type:"number"},minimum:{$ref:"#/definitions/OneOfNumberString"},not:{type:"object"},pattern:{type:"string"},type:{type:"string"}},type:"object"},i=Object.prototype.hasOwnProperty,a={type:["number","string","boolean"]};function x(R,{instancePath:M="",rootData:P=R}={}){let k=null,z=0;if("number"!=typeof R&&"string"!=typeof R&&"boolean"!=typeof R){const W={instancePath:M,schemaPath:"#/type",keyword:"type",params:{type:a.type},message:"must be number,string,boolean",schema:a.type,parentSchema:a,data:R};null===k?k=[W]:k.push(W),z++}return x.errors=k,0===z}const B={type:["number","string"]};function m(R,{instancePath:M="",rootData:P=R}={}){let k=null,z=0;if("number"!=typeof R&&"string"!=typeof R){const W={instancePath:M,schemaPath:"#/type",keyword:"type",params:{type:B.type},message:"must be number,string",schema:B.type,parentSchema:B,data:R};null===k?k=[W]:k.push(W),z++}return m.errors=k,0===z}const S={validate:g};function g(R,{instancePath:M="",rootData:P=R}={}){let k=null,z=0;if(R&&"object"==typeof R&&!Array.isArray(R)){for(const V in R)if(!i.call(f.properties,V)){const Z={instancePath:M,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:V},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:R};null===k?k=[Z]:k.push(Z),z++}if(void 0!==R.const&&(x(R.const,{instancePath:M+"/const",parentData:R,parentDataProperty:"const",rootData:P})||(k=null===k?x.errors:k.concat(x.errors),z=k.length)),void 0!==R.contains&&(S.validate(R.contains,{instancePath:M+"/contains",parentData:R,parentDataProperty:"contains",rootData:P})||(k=null===k?S.validate.errors:k.concat(S.validate.errors),z=k.length)),void 0!==R.enum){let V=R.enum;if(Array.isArray(V)){const Z=V.length;for(let q=0;q{"use strict";Me.exports=re,Me.exports.default=re;const F={$schema:"http://json-schema.org/draft-07/schema#",title:"Presentation Definition",definitions:{schema:{type:"object",properties:{uri:{type:"string"},required:{type:"boolean"}},required:["uri"],additionalProperties:!1},issuance:{type:"object",properties:{manifest:{type:"string"}},additionalProperties:!0},filter:{type:"object",properties:{type:{type:"string"},format:{type:"string"},pattern:{type:"string"},minimum:{type:["number","string"]},minLength:{type:"integer"},maxLength:{type:"integer"},exclusiveMinimum:{type:["number","string"]},exclusiveMaximum:{type:["number","string"]},maximum:{type:["number","string"]},const:{type:["number","string"]},enum:{type:"array",items:{type:["number","string"]}},not:{type:"object",minProperties:1}},required:["type"],additionalProperties:!1},format:{type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},submission_requirements:{type:"object",oneOf:[{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from:{type:"string"}},required:["rule","from"],additionalProperties:!1},{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from_nested:{type:"array",minItems:1,items:{$ref:"#/definitions/submission_requirements"}}},required:["rule","from_nested"],additionalProperties:!1}]},input_descriptors:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},group:{type:"array",items:{type:"string"}},schema:{type:"array",items:{$ref:"#/definitions/schema"}},issuance:{type:"array",items:{$ref:"#/definitions/issuance"}},constraints:{type:"object",properties:{limit_disclosure:{type:"string",enum:["required","preferred"]},statuses:{type:"object",properties:{active:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},suspended:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},revoked:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}}}},fields:{type:"array",items:{$ref:"#/definitions/field"}},subject_is_issuer:{type:"string",enum:["required","preferred"]},is_holder:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}},same_subject:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}}},additionalProperties:!1}},required:["id","schema"],additionalProperties:!1},field:{type:"object",oneOf:[{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},filter:{$ref:"#/definitions/filter"}},required:["path"],additionalProperties:!1},{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},filter:{$ref:"#/definitions/filter"},predicate:{type:"string",enum:["required","preferred"]}},required:["path","filter","predicate"],additionalProperties:!1}]}},type:"object",properties:{presentation_definition:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},format:{$ref:"#/definitions/format"},submission_requirements:{type:"array",items:{$ref:"#/definitions/submission_requirements"}},input_descriptors:{type:"array",items:{$ref:"#/definitions/input_descriptors"}}},required:["id","input_descriptors"],additionalProperties:!1}}},f={type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},i=new RegExp("^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$","u"),a=new RegExp("^ldp_vc$|^ldp_vp$|^ldp$","u"),x=new RegExp("^di_vc$|^di_vp$|^di$","u"),B=new RegExp("additionalProperties","u");function m(te,{instancePath:ie="",rootData:ye=te}={}){let ue=null,K=0;if(te&&"object"==typeof te&&!Array.isArray(te)){for(const o in te)if(!("vc+sd-jwt"===o||i.test(o)||a.test(o)||x.test(o)||B.test(o))){const h={instancePath:ie,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:o},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:te};null===ue?ue=[h]:ue.push(h),K++}if(void 0!==te["vc+sd-jwt"]){let o=te["vc+sd-jwt"];if(o&&"object"==typeof o&&!Array.isArray(o)){for(const h in o)if("sd-jwt_alg_values"!==h&&"kb-jwt_alg_values"!==h){const A={instancePath:ie+"/vc+sd-jwt",schemaPath:"#/properties/vc%2Bsd-jwt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties",schema:!1,parentSchema:f.properties["vc+sd-jwt"],data:o};null===ue?ue=[A]:ue.push(A),K++}if(void 0!==o["sd-jwt_alg_values"]){let h=o["sd-jwt_alg_values"];if(Array.isArray(h)){if(h.length<1){const I={instancePath:ie+"/vc+sd-jwt/sd-jwt_alg_values",schemaPath:"#/properties/vc%2Bsd-jwt/properties/sd-jwt_alg_values/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:f.properties["vc+sd-jwt"].properties["sd-jwt_alg_values"],data:h};null===ue?ue=[I]:ue.push(I),K++}const A=h.length;for(let I=0;I=",limit:1},message:"must be >= 1",schema:1,parentSchema:S.oneOf[0].properties.count,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.min){let H=te.min;if("number"!=typeof H||H%1||isNaN(H)){const D={instancePath:ie+"/min",schemaPath:"#/oneOf/0/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[0].properties.min.type,parentSchema:S.oneOf[0].properties.min,data:H};null===ue?ue=[D]:ue.push(D),K++}if("number"==typeof H&&(H<0||isNaN(H))){const D={instancePath:ie+"/min",schemaPath:"#/oneOf/0/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[0].properties.min,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.max){let H=te.max;if("number"!=typeof H||H%1||isNaN(H)){const D={instancePath:ie+"/max",schemaPath:"#/oneOf/0/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[0].properties.max.type,parentSchema:S.oneOf[0].properties.max,data:H};null===ue?ue=[D]:ue.push(D),K++}if("number"==typeof H&&(H<0||isNaN(H))){const D={instancePath:ie+"/max",schemaPath:"#/oneOf/0/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[0].properties.max,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.from){let H=te.from;if("string"!=typeof H){const D={instancePath:ie+"/from",schemaPath:"#/oneOf/0/properties/from/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[0].properties.from.type,parentSchema:S.oneOf[0].properties.from,data:H};null===ue?ue=[D]:ue.push(D),K++}}}I===K&&(h=!0,A=0);const O=K;if(te&&"object"==typeof te&&!Array.isArray(te)){if(void 0===te.rule){const H={instancePath:ie,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"rule"},message:"must have required property 'rule'",schema:S.oneOf[1].required,parentSchema:S.oneOf[1],data:te};null===ue?ue=[H]:ue.push(H),K++}if(void 0===te.from_nested){const H={instancePath:ie,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"from_nested"},message:"must have required property 'from_nested'",schema:S.oneOf[1].required,parentSchema:S.oneOf[1],data:te};null===ue?ue=[H]:ue.push(H),K++}for(const H in te)if("name"!==H&&"purpose"!==H&&"rule"!==H&&"count"!==H&&"min"!==H&&"max"!==H&&"from_nested"!==H){const D={instancePath:ie,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:H},message:"must NOT have additional properties",schema:!1,parentSchema:S.oneOf[1],data:te};null===ue?ue=[D]:ue.push(D),K++}if(void 0!==te.name){let H=te.name;if("string"!=typeof H){const D={instancePath:ie+"/name",schemaPath:"#/oneOf/1/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.name.type,parentSchema:S.oneOf[1].properties.name,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.purpose){let H=te.purpose;if("string"!=typeof H){const D={instancePath:ie+"/purpose",schemaPath:"#/oneOf/1/properties/purpose/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.purpose.type,parentSchema:S.oneOf[1].properties.purpose,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.rule){let H=te.rule;if("string"!=typeof H){const D={instancePath:ie+"/rule",schemaPath:"#/oneOf/1/properties/rule/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.rule.type,parentSchema:S.oneOf[1].properties.rule,data:H};null===ue?ue=[D]:ue.push(D),K++}if("all"!==H&&"pick"!==H){const D={instancePath:ie+"/rule",schemaPath:"#/oneOf/1/properties/rule/enum",keyword:"enum",params:{allowedValues:S.oneOf[1].properties.rule.enum},message:"must be equal to one of the allowed values",schema:S.oneOf[1].properties.rule.enum,parentSchema:S.oneOf[1].properties.rule,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.count){let H=te.count;if("number"!=typeof H||H%1||isNaN(H)){const D={instancePath:ie+"/count",schemaPath:"#/oneOf/1/properties/count/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.count.type,parentSchema:S.oneOf[1].properties.count,data:H};null===ue?ue=[D]:ue.push(D),K++}if("number"==typeof H&&(H<1||isNaN(H))){const D={instancePath:ie+"/count",schemaPath:"#/oneOf/1/properties/count/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:S.oneOf[1].properties.count,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.min){let H=te.min;if("number"!=typeof H||H%1||isNaN(H)){const D={instancePath:ie+"/min",schemaPath:"#/oneOf/1/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.min.type,parentSchema:S.oneOf[1].properties.min,data:H};null===ue?ue=[D]:ue.push(D),K++}if("number"==typeof H&&(H<0||isNaN(H))){const D={instancePath:ie+"/min",schemaPath:"#/oneOf/1/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[1].properties.min,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.max){let H=te.max;if("number"!=typeof H||H%1||isNaN(H)){const D={instancePath:ie+"/max",schemaPath:"#/oneOf/1/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.max.type,parentSchema:S.oneOf[1].properties.max,data:H};null===ue?ue=[D]:ue.push(D),K++}if("number"==typeof H&&(H<0||isNaN(H))){const D={instancePath:ie+"/max",schemaPath:"#/oneOf/1/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[1].properties.max,data:H};null===ue?ue=[D]:ue.push(D),K++}}if(void 0!==te.from_nested){let H=te.from_nested;if(Array.isArray(H)){if(H.length<1){const s={instancePath:ie+"/from_nested",schemaPath:"#/oneOf/1/properties/from_nested/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:S.oneOf[1].properties.from_nested,data:H};null===ue?ue=[s]:ue.push(s),K++}const D=H.length;for(let s=0;s{"use strict";Me.exports=I,Me.exports.default=I;const i={$schema:"http://json-schema.org/draft-07/schema#",title:"Presentation Definition",definitions:{issuance:{type:"object",properties:{manifest:{type:"string"}},additionalProperties:!0},format:{type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},submission_requirements:{type:"object",oneOf:[{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from:{type:"string"}},required:["rule","from"],additionalProperties:!1},{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from_nested:{type:"array",minItems:1,items:{$ref:"#/definitions/submission_requirements"}}},required:["rule","from_nested"],additionalProperties:!1}]},input_descriptors:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},issuance:{type:"array",items:{$ref:"#/definitions/issuance"}},group:{type:"array",items:{type:"string"}},format:{$ref:"#/definitions/format"},constraints:{type:"object",properties:{limit_disclosure:{type:"string",enum:["required","preferred"]},statuses:{type:"object",properties:{active:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},suspended:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},revoked:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}}}},fields:{type:"array",items:{$ref:"#/definitions/field"}},subject_is_issuer:{type:"string",enum:["required","preferred"]},is_holder:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}},same_subject:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}}},additionalProperties:!1}},required:["id"],additionalProperties:!1},field:{type:"object",oneOf:[{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},intent_to_retain:{type:"boolean"},filter:{$ref:"http://json-schema.org/schema#"},name:{type:"string"}},required:["path"],additionalProperties:!1},{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},intent_to_retain:{type:"boolean"},filter:{$ref:"http://json-schema.org/schema#"},predicate:{type:"string",enum:["required","preferred"]},name:{type:"string"}},required:["path","filter","predicate"],additionalProperties:!1}]}},type:"object",properties:{presentation_definition:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},format:{$ref:"#/definitions/format"},frame:{type:"object",additionalProperties:!0},submission_requirements:{type:"array",items:{$ref:"#/definitions/submission_requirements"}},input_descriptors:{type:"array",items:{$ref:"#/definitions/input_descriptors"}}},required:["id","input_descriptors"],additionalProperties:!1}}},a={type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},x=new RegExp("^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$","u"),B=new RegExp("^ldp_vc$|^ldp_vp$|^ldp$","u"),m=new RegExp("^di_vc$|^di_vp$|^di$","u"),S=new RegExp("additionalProperties","u");function g(O,{instancePath:$="",rootData:s=O}={}){let p=null,Y=0;if(O&&"object"==typeof O&&!Array.isArray(O)){for(const ee in O)if(!("vc+sd-jwt"===ee||x.test(ee)||B.test(ee)||m.test(ee)||S.test(ee))){const oe={instancePath:$,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:ee},message:"must NOT have additional properties",schema:!1,parentSchema:a,data:O};null===p?p=[oe]:p.push(oe),Y++}if(void 0!==O["vc+sd-jwt"]){let ee=O["vc+sd-jwt"];if(ee&&"object"==typeof ee&&!Array.isArray(ee)){for(const oe in ee)if("sd-jwt_alg_values"!==oe&&"kb-jwt_alg_values"!==oe){const de={instancePath:$+"/vc+sd-jwt",schemaPath:"#/properties/vc%2Bsd-jwt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:oe},message:"must NOT have additional properties",schema:!1,parentSchema:a.properties["vc+sd-jwt"],data:ee};null===p?p=[de]:p.push(de),Y++}if(void 0!==ee["sd-jwt_alg_values"]){let oe=ee["sd-jwt_alg_values"];if(Array.isArray(oe)){if(oe.length<1){const Ae={instancePath:$+"/vc+sd-jwt/sd-jwt_alg_values",schemaPath:"#/properties/vc%2Bsd-jwt/properties/sd-jwt_alg_values/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:a.properties["vc+sd-jwt"].properties["sd-jwt_alg_values"],data:oe};null===p?p=[Ae]:p.push(Ae),Y++}const de=oe.length;for(let Ae=0;Ae=",limit:1},message:"must be >= 1",schema:1,parentSchema:E.oneOf[0].properties.count,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.min){let xe=O.min;if("number"!=typeof xe||xe%1||isNaN(xe)){const De={instancePath:$+"/min",schemaPath:"#/oneOf/0/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:E.oneOf[0].properties.min.type,parentSchema:E.oneOf[0].properties.min,data:xe};null===p?p=[De]:p.push(De),Y++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const De={instancePath:$+"/min",schemaPath:"#/oneOf/0/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:E.oneOf[0].properties.min,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.max){let xe=O.max;if("number"!=typeof xe||xe%1||isNaN(xe)){const De={instancePath:$+"/max",schemaPath:"#/oneOf/0/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:E.oneOf[0].properties.max.type,parentSchema:E.oneOf[0].properties.max,data:xe};null===p?p=[De]:p.push(De),Y++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const De={instancePath:$+"/max",schemaPath:"#/oneOf/0/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:E.oneOf[0].properties.max,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.from){let xe=O.from;if("string"!=typeof xe){const De={instancePath:$+"/from",schemaPath:"#/oneOf/0/properties/from/type",keyword:"type",params:{type:"string"},message:"must be string",schema:E.oneOf[0].properties.from.type,parentSchema:E.oneOf[0].properties.from,data:xe};null===p?p=[De]:p.push(De),Y++}}}Ae===Y&&(oe=!0,de=0);const Ie=Y;if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0===O.rule){const xe={instancePath:$,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"rule"},message:"must have required property 'rule'",schema:E.oneOf[1].required,parentSchema:E.oneOf[1],data:O};null===p?p=[xe]:p.push(xe),Y++}if(void 0===O.from_nested){const xe={instancePath:$,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"from_nested"},message:"must have required property 'from_nested'",schema:E.oneOf[1].required,parentSchema:E.oneOf[1],data:O};null===p?p=[xe]:p.push(xe),Y++}for(const xe in O)if("name"!==xe&&"purpose"!==xe&&"rule"!==xe&&"count"!==xe&&"min"!==xe&&"max"!==xe&&"from_nested"!==xe){const De={instancePath:$,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:xe},message:"must NOT have additional properties",schema:!1,parentSchema:E.oneOf[1],data:O};null===p?p=[De]:p.push(De),Y++}if(void 0!==O.name){let xe=O.name;if("string"!=typeof xe){const De={instancePath:$+"/name",schemaPath:"#/oneOf/1/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string",schema:E.oneOf[1].properties.name.type,parentSchema:E.oneOf[1].properties.name,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.purpose){let xe=O.purpose;if("string"!=typeof xe){const De={instancePath:$+"/purpose",schemaPath:"#/oneOf/1/properties/purpose/type",keyword:"type",params:{type:"string"},message:"must be string",schema:E.oneOf[1].properties.purpose.type,parentSchema:E.oneOf[1].properties.purpose,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.rule){let xe=O.rule;if("string"!=typeof xe){const De={instancePath:$+"/rule",schemaPath:"#/oneOf/1/properties/rule/type",keyword:"type",params:{type:"string"},message:"must be string",schema:E.oneOf[1].properties.rule.type,parentSchema:E.oneOf[1].properties.rule,data:xe};null===p?p=[De]:p.push(De),Y++}if("all"!==xe&&"pick"!==xe){const De={instancePath:$+"/rule",schemaPath:"#/oneOf/1/properties/rule/enum",keyword:"enum",params:{allowedValues:E.oneOf[1].properties.rule.enum},message:"must be equal to one of the allowed values",schema:E.oneOf[1].properties.rule.enum,parentSchema:E.oneOf[1].properties.rule,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.count){let xe=O.count;if("number"!=typeof xe||xe%1||isNaN(xe)){const De={instancePath:$+"/count",schemaPath:"#/oneOf/1/properties/count/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:E.oneOf[1].properties.count.type,parentSchema:E.oneOf[1].properties.count,data:xe};null===p?p=[De]:p.push(De),Y++}if("number"==typeof xe&&(xe<1||isNaN(xe))){const De={instancePath:$+"/count",schemaPath:"#/oneOf/1/properties/count/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:E.oneOf[1].properties.count,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.min){let xe=O.min;if("number"!=typeof xe||xe%1||isNaN(xe)){const De={instancePath:$+"/min",schemaPath:"#/oneOf/1/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:E.oneOf[1].properties.min.type,parentSchema:E.oneOf[1].properties.min,data:xe};null===p?p=[De]:p.push(De),Y++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const De={instancePath:$+"/min",schemaPath:"#/oneOf/1/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:E.oneOf[1].properties.min,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.max){let xe=O.max;if("number"!=typeof xe||xe%1||isNaN(xe)){const De={instancePath:$+"/max",schemaPath:"#/oneOf/1/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:E.oneOf[1].properties.max.type,parentSchema:E.oneOf[1].properties.max,data:xe};null===p?p=[De]:p.push(De),Y++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const De={instancePath:$+"/max",schemaPath:"#/oneOf/1/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:E.oneOf[1].properties.max,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.from_nested){let xe=O.from_nested;if(Array.isArray(xe)){if(xe.length<1){const Xe={instancePath:$+"/from_nested",schemaPath:"#/oneOf/1/properties/from_nested/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:E.oneOf[1].properties.from_nested,data:xe};null===p?p=[Xe]:p.push(Xe),Y++}const De=xe.length;for(let Xe=0;Xe=",limit:0},message:"must be >= 0",schema:0,parentSchema:W,data:O};null===p?p=[ee]:p.push(ee),Y++}return V.errors=p,0===Y}function q(O,{instancePath:$="",parentData:H,parentDataProperty:D,rootData:s=O}={}){let p=null,Y=0;return V(O,{instancePath:$,parentData:H,parentDataProperty:D,rootData:s})||(p=null===p?V.errors:p.concat(V.errors),Y=p.length),q.errors=p,0===Y}const re={type:"array",minItems:1,items:{$ref:"#"}},te={validate:o};function ie(O,{instancePath:$="",rootData:s=O}={}){let p=null,Y=0;if(Array.isArray(O)){if(O.length<1){const oe={instancePath:$,schemaPath:"#/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:re,data:O};null===p?p=[oe]:p.push(oe),Y++}const ee=O.length;for(let oe=0;oe1){const Ae={};for(;oe--;){let Ie=O[oe];if("string"==typeof Ie){if("number"==typeof Ae[Ie]){de=Ae[Ie];const Le={instancePath:$,schemaPath:"#/uniqueItems",keyword:"uniqueItems",params:{i:oe,j:de},message:"must NOT have duplicate items (items ## "+de+" and "+oe+" are identical)",schema:!0,parentSchema:ae,data:O};null===p?p=[Le]:p.push(Le),Y++;break}Ae[Ie]=oe}}}}else{const ee={instancePath:$,schemaPath:"#/type",keyword:"type",params:{type:"array"},message:"must be array",schema:ae.type,parentSchema:ae,data:O};null===p?p=[ee]:p.push(ee),Y++}return me.errors=p,0===Y}const ye={enum:["array","boolean","integer","null","number","object","string"]};function ue(O,{instancePath:$="",rootData:s=O}={}){let p=null,Y=0;if("array"!==O&&"boolean"!==O&&"integer"!==O&&"null"!==O&&"number"!==O&&"object"!==O&&"string"!==O){const ee={instancePath:$,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:ye.enum},message:"must be equal to one of the allowed values",schema:ye.enum,parentSchema:ye,data:O};null===p?p=[ee]:p.push(ee),Y++}return ue.errors=p,0===Y}const K=f(54195).default;function o(O,{instancePath:$="",rootData:s=O}={}){let p=null,Y=0;if((!O||"object"!=typeof O||Array.isArray(O))&&"boolean"!=typeof O){const Ie={instancePath:$,schemaPath:"#/type",keyword:"type",params:{type:z.type},message:"must be object,boolean",schema:z.type,parentSchema:z,data:O};null===p?p=[Ie]:p.push(Ie),Y++}if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0!==O.$id){let Ie=O.$id;if("string"!=typeof Ie){const Le={instancePath:$+"/$id",schemaPath:"#/properties/%24id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.$id.type,parentSchema:z.properties.$id,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.$schema){let Ie=O.$schema;if("string"!=typeof Ie){const Le={instancePath:$+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.$schema.type,parentSchema:z.properties.$schema,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.$ref){let Ie=O.$ref;if("string"!=typeof Ie){const Le={instancePath:$+"/$ref",schemaPath:"#/properties/%24ref/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.$ref.type,parentSchema:z.properties.$ref,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.$comment){let Ie=O.$comment;if("string"!=typeof Ie){const Le={instancePath:$+"/$comment",schemaPath:"#/properties/%24comment/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.$comment.type,parentSchema:z.properties.$comment,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.title){let Ie=O.title;if("string"!=typeof Ie){const Le={instancePath:$+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.title.type,parentSchema:z.properties.title,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.description){let Ie=O.description;if("string"!=typeof Ie){const Le={instancePath:$+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.description.type,parentSchema:z.properties.description,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.readOnly){let Ie=O.readOnly;if("boolean"!=typeof Ie){const Le={instancePath:$+"/readOnly",schemaPath:"#/properties/readOnly/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:z.properties.readOnly.type,parentSchema:z.properties.readOnly,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.examples){let Ie=O.examples;if(!Array.isArray(Ie)){const Le={instancePath:$+"/examples",schemaPath:"#/properties/examples/type",keyword:"type",params:{type:"array"},message:"must be array",schema:z.properties.examples.type,parentSchema:z.properties.examples,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.multipleOf){let Ie=O.multipleOf;if("number"==typeof Ie){if(Ie<=0||isNaN(Ie)){const Le={instancePath:$+"/multipleOf",schemaPath:"#/properties/multipleOf/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:z.properties.multipleOf,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}else{const Le={instancePath:$+"/multipleOf",schemaPath:"#/properties/multipleOf/type",keyword:"type",params:{type:"number"},message:"must be number",schema:z.properties.multipleOf.type,parentSchema:z.properties.multipleOf,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.maximum){let Ie=O.maximum;if("number"!=typeof Ie){const Le={instancePath:$+"/maximum",schemaPath:"#/properties/maximum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:z.properties.maximum.type,parentSchema:z.properties.maximum,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.exclusiveMaximum){let Ie=O.exclusiveMaximum;if("number"!=typeof Ie){const Le={instancePath:$+"/exclusiveMaximum",schemaPath:"#/properties/exclusiveMaximum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:z.properties.exclusiveMaximum.type,parentSchema:z.properties.exclusiveMaximum,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.minimum){let Ie=O.minimum;if("number"!=typeof Ie){const Le={instancePath:$+"/minimum",schemaPath:"#/properties/minimum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:z.properties.minimum.type,parentSchema:z.properties.minimum,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.exclusiveMinimum){let Ie=O.exclusiveMinimum;if("number"!=typeof Ie){const Le={instancePath:$+"/exclusiveMinimum",schemaPath:"#/properties/exclusiveMinimum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:z.properties.exclusiveMinimum.type,parentSchema:z.properties.exclusiveMinimum,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.maxLength&&(V(O.maxLength,{instancePath:$+"/maxLength",parentData:O,parentDataProperty:"maxLength",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),Y=p.length)),void 0!==O.minLength&&(q(O.minLength,{instancePath:$+"/minLength",parentData:O,parentDataProperty:"minLength",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),Y=p.length)),void 0!==O.pattern){let Ie=O.pattern;if("string"!=typeof Ie){const Le={instancePath:$+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.pattern.type,parentSchema:z.properties.pattern,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.additionalItems&&(o(O.additionalItems,{instancePath:$+"/additionalItems",parentData:O,parentDataProperty:"additionalItems",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.items){let Ie=O.items;const Le=Y;let xe=!1;const De=Y;o(Ie,{instancePath:$+"/items",parentData:O,parentDataProperty:"items",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length);var ee=De===Y;if(xe=xe||ee,!xe){const Xe=Y;ie(Ie,{instancePath:$+"/items",parentData:O,parentDataProperty:"items",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),Y=p.length),ee=Xe===Y,xe=xe||ee}if(xe)Y=Le,null!==p&&(Le?p.length=Le:p=null);else{const Xe={instancePath:$+"/items",schemaPath:"#/properties/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:z.properties.items.anyOf,parentSchema:z.properties.items,data:Ie};null===p?p=[Xe]:p.push(Xe),Y++}}if(void 0!==O.maxItems&&(V(O.maxItems,{instancePath:$+"/maxItems",parentData:O,parentDataProperty:"maxItems",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),Y=p.length)),void 0!==O.minItems&&(q(O.minItems,{instancePath:$+"/minItems",parentData:O,parentDataProperty:"minItems",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),Y=p.length)),void 0!==O.uniqueItems){let Ie=O.uniqueItems;if("boolean"!=typeof Ie){const Le={instancePath:$+"/uniqueItems",schemaPath:"#/properties/uniqueItems/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:z.properties.uniqueItems.type,parentSchema:z.properties.uniqueItems,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.contains&&(o(O.contains,{instancePath:$+"/contains",parentData:O,parentDataProperty:"contains",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.maxProperties&&(V(O.maxProperties,{instancePath:$+"/maxProperties",parentData:O,parentDataProperty:"maxProperties",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),Y=p.length)),void 0!==O.minProperties&&(q(O.minProperties,{instancePath:$+"/minProperties",parentData:O,parentDataProperty:"minProperties",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),Y=p.length)),void 0!==O.required&&(me(O.required,{instancePath:$+"/required",parentData:O,parentDataProperty:"required",rootData:s})||(p=null===p?me.errors:p.concat(me.errors),Y=p.length)),void 0!==O.additionalProperties&&(o(O.additionalProperties,{instancePath:$+"/additionalProperties",parentData:O,parentDataProperty:"additionalProperties",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.definitions){let Ie=O.definitions;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie)o(Ie[Le],{instancePath:$+"/definitions/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length);else{const Le={instancePath:$+"/definitions",schemaPath:"#/properties/definitions/type",keyword:"type",params:{type:"object"},message:"must be object",schema:z.properties.definitions.type,parentSchema:z.properties.definitions,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.properties){let Ie=O.properties;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie)o(Ie[Le],{instancePath:$+"/properties/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length);else{const Le={instancePath:$+"/properties",schemaPath:"#/properties/properties/type",keyword:"type",params:{type:"object"},message:"must be object",schema:z.properties.properties.type,parentSchema:z.properties.properties,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.patternProperties){let Ie=O.patternProperties;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie)){for(const Le in Ie)if(Y!=Y){const De={instancePath:$+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames",keyword:"propertyNames",params:{propertyName:Le},message:"property name must be valid",schema:z.properties.patternProperties.propertyNames,parentSchema:z.properties.patternProperties,data:Ie};null===p?p=[De]:p.push(De),Y++}for(const Le in Ie)o(Ie[Le],{instancePath:$+"/patternProperties/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)}else{const Le={instancePath:$+"/patternProperties",schemaPath:"#/properties/patternProperties/type",keyword:"type",params:{type:"object"},message:"must be object",schema:z.properties.patternProperties.type,parentSchema:z.properties.patternProperties,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.dependencies){let Ie=O.dependencies;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie){let xe=Ie[Le];const De=Y;let Xe=!1;const Te=Y;o(xe,{instancePath:$+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length);var de=Te===Y;if(Xe=Xe||de,!Xe){const ke=Y;me(xe,{instancePath:$+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?me.errors:p.concat(me.errors),Y=p.length),de=ke===Y,Xe=Xe||de}if(Xe)Y=De,null!==p&&(De?p.length=De:p=null);else{const ke={instancePath:$+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/dependencies/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:z.properties.dependencies.additionalProperties.anyOf,parentSchema:z.properties.dependencies.additionalProperties,data:xe};null===p?p=[ke]:p.push(ke),Y++}}else{const Le={instancePath:$+"/dependencies",schemaPath:"#/properties/dependencies/type",keyword:"type",params:{type:"object"},message:"must be object",schema:z.properties.dependencies.type,parentSchema:z.properties.dependencies,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.propertyNames&&(o(O.propertyNames,{instancePath:$+"/propertyNames",parentData:O,parentDataProperty:"propertyNames",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.enum){let Ie=O.enum;if(Array.isArray(Ie)){if(Ie.length<1){const De={instancePath:$+"/enum",schemaPath:"#/properties/enum/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:z.properties.enum,data:Ie};null===p?p=[De]:p.push(De),Y++}let xe,Le=Ie.length;if(Le>1)e:for(;Le--;)for(xe=Le;xe--;)if(K(Ie[Le],Ie[xe])){const De={instancePath:$+"/enum",schemaPath:"#/properties/enum/uniqueItems",keyword:"uniqueItems",params:{i:Le,j:xe},message:"must NOT have duplicate items (items ## "+xe+" and "+Le+" are identical)",schema:!0,parentSchema:z.properties.enum,data:Ie};null===p?p=[De]:p.push(De),Y++;break e}}else{const Le={instancePath:$+"/enum",schemaPath:"#/properties/enum/type",keyword:"type",params:{type:"array"},message:"must be array",schema:z.properties.enum.type,parentSchema:z.properties.enum,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.type){let Ie=O.type;const Le=Y;let xe=!1;const De=Y;ue(Ie,{instancePath:$+"/type",parentData:O,parentDataProperty:"type",rootData:s})||(p=null===p?ue.errors:p.concat(ue.errors),Y=p.length);var Ae=De===Y;if(xe=xe||Ae,!xe){const Xe=Y;if(Array.isArray(Ie)){if(Ie.length<1){const ve={instancePath:$+"/type",schemaPath:"#/properties/type/anyOf/1/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:z.properties.type.anyOf[1],data:Ie};null===p?p=[ve]:p.push(ve),Y++}const ke=Ie.length;for(let ve=0;ve1)e:for(;Se--;)for(Ee=Se;Ee--;)if(K(Ie[Se],Ie[Ee])){const ve={instancePath:$+"/type",schemaPath:"#/properties/type/anyOf/1/uniqueItems",keyword:"uniqueItems",params:{i:Se,j:Ee},message:"must NOT have duplicate items (items ## "+Ee+" and "+Se+" are identical)",schema:!0,parentSchema:z.properties.type.anyOf[1],data:Ie};null===p?p=[ve]:p.push(ve),Y++;break e}}else{const ke={instancePath:$+"/type",schemaPath:"#/properties/type/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array",schema:z.properties.type.anyOf[1].type,parentSchema:z.properties.type.anyOf[1],data:Ie};null===p?p=[ke]:p.push(ke),Y++}Ae=Xe===Y,xe=xe||Ae}if(xe)Y=Le,null!==p&&(Le?p.length=Le:p=null);else{const Xe={instancePath:$+"/type",schemaPath:"#/properties/type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:z.properties.type.anyOf,parentSchema:z.properties.type,data:Ie};null===p?p=[Xe]:p.push(Xe),Y++}}if(void 0!==O.format){let Ie=O.format;if("string"!=typeof Ie){const Le={instancePath:$+"/format",schemaPath:"#/properties/format/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.format.type,parentSchema:z.properties.format,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.contentMediaType){let Ie=O.contentMediaType;if("string"!=typeof Ie){const Le={instancePath:$+"/contentMediaType",schemaPath:"#/properties/contentMediaType/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.contentMediaType.type,parentSchema:z.properties.contentMediaType,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}if(void 0!==O.contentEncoding){let Ie=O.contentEncoding;if("string"!=typeof Ie){const Le={instancePath:$+"/contentEncoding",schemaPath:"#/properties/contentEncoding/type",keyword:"type",params:{type:"string"},message:"must be string",schema:z.properties.contentEncoding.type,parentSchema:z.properties.contentEncoding,data:Ie};null===p?p=[Le]:p.push(Le),Y++}}void 0!==O.if&&(o(O.if,{instancePath:$+"/if",parentData:O,parentDataProperty:"if",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.then&&(o(O.then,{instancePath:$+"/then",parentData:O,parentDataProperty:"then",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.else&&(o(O.else,{instancePath:$+"/else",parentData:O,parentDataProperty:"else",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length)),void 0!==O.allOf&&(ie(O.allOf,{instancePath:$+"/allOf",parentData:O,parentDataProperty:"allOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),Y=p.length)),void 0!==O.anyOf&&(ie(O.anyOf,{instancePath:$+"/anyOf",parentData:O,parentDataProperty:"anyOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),Y=p.length)),void 0!==O.oneOf&&(ie(O.oneOf,{instancePath:$+"/oneOf",parentData:O,parentDataProperty:"oneOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),Y=p.length)),void 0!==O.not&&(o(O.not,{instancePath:$+"/not",parentData:O,parentDataProperty:"not",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),Y=p.length))}return o.errors=p,0===Y}function h(O,{instancePath:$="",rootData:s=O}={}){let p=null,Y=0;if(!O||"object"!=typeof O||Array.isArray(O)){const xe={instancePath:$,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:k.type,parentSchema:k,data:O};null===p?p=[xe]:p.push(xe),Y++}const ee=Y;let oe=!1,de=null;const Ae=Y;if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0===O.path){const xe={instancePath:$,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"path"},message:"must have required property 'path'",schema:k.oneOf[0].required,parentSchema:k.oneOf[0],data:O};null===p?p=[xe]:p.push(xe),Y++}for(const xe in O)if("id"!==xe&&"path"!==xe&&"purpose"!==xe&&"intent_to_retain"!==xe&&"filter"!==xe&&"name"!==xe){const De={instancePath:$,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:xe},message:"must NOT have additional properties",schema:!1,parentSchema:k.oneOf[0],data:O};null===p?p=[De]:p.push(De),Y++}if(void 0!==O.id){let xe=O.id;if("string"!=typeof xe){const De={instancePath:$+"/id",schemaPath:"#/oneOf/0/properties/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:k.oneOf[0].properties.id.type,parentSchema:k.oneOf[0].properties.id,data:xe};null===p?p=[De]:p.push(De),Y++}}if(void 0!==O.path){let xe=O.path;if(Array.isArray(xe)){const De=xe.length;for(let Xe=0;Xe{"use strict";function f(me,ye){return{validate:me,compare:ye}}Object.defineProperty(F,"__esModule",{value:!0}),F.formatNames=F.fastFormats=F.fullFormats=void 0,F.fullFormats={date:f(B,m),time:f(g,E),"date-time":f(function M(me){const ye=me.split(R);return 2===ye.length&&B(ye[0])&&g(ye[1],!0)},_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function k(me){return j.test(me)&&P.test(me)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function ae(me){if(ie.test(me))return!1;try{return new RegExp(me),!0}catch{return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function W(me){return z.lastIndex=0,z.test(me)},int32:{type:"number",validate:function q(me){return Number.isInteger(me)&&me<=Z&&me>=V}},int64:{type:"number",validate:function re(me){return Number.isInteger(me)}},float:{type:"number",validate:te},double:{type:"number",validate:te},password:!0,binary:!0},F.fastFormats={...F.fullFormats,date:f(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,m),time:f(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,E),"date-time":f(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},F.formatNames=Object.keys(F.fullFormats);const a=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,x=[0,31,28,31,30,31,30,31,31,30,31,30,31];function B(me){const ye=a.exec(me);if(!ye)return!1;const K=+ye[2],o=+ye[3];return K>=1&&K<=12&&o>=1&&o<=(2===K&&function i(me){return me%4==0&&(me%100!=0||me%400==0)}(+ye[1])?29:x[K])}function m(me,ye){if(me&&ye)return me>ye?1:me(ye=K[1]+K[2]+K[3]+(K[4]||""))?1:me{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(3993),a=f(10122),x=f(85432),B=new x.Name("fullFormats"),m=new x.Name("fastFormats"),S=(E,R={keywords:!0})=>{if(Array.isArray(R))return g(E,R,i.fullFormats,B),E;const[M,_]="fast"===R.mode?[i.fastFormats,m]:[i.fullFormats,B];return g(E,R.formats||i.formatNames,M,_),R.keywords&&a.default(E),E};function g(E,R,M,_){var j,P;null!==(j=(P=E.opts.code).formats)&&void 0!==j||(P.formats=x._`require("ajv-formats/dist/formats").${_}`);for(const k of R)E.addFormat(k,M[k])}S.get=(E,R="full")=>{const _=("fast"===R?i.fastFormats:i.fullFormats)[E];if(!_)throw new Error(`Unknown format "${E}"`);return _},Me.exports=F=S,Object.defineProperty(F,"__esModule",{value:!0}),F.default=S},10122:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.formatLimitDefinition=void 0;const i=f(39208),a=f(85432),x=a.operators,B={formatMaximum:{okStr:"<=",ok:x.LTE,fail:x.GT},formatMinimum:{okStr:">=",ok:x.GTE,fail:x.LT},formatExclusiveMaximum:{okStr:"<",ok:x.LT,fail:x.GTE},formatExclusiveMinimum:{okStr:">",ok:x.GT,fail:x.LTE}},m={message:({keyword:g,schemaCode:E})=>a.str`should be ${B[g].okStr} ${E}`,params:({keyword:g,schemaCode:E})=>a._`{comparison: ${B[g].okStr}, limit: ${E}}`};F.formatLimitDefinition={keyword:Object.keys(B),type:"string",schemaType:"string",$data:!0,error:m,code(g){const{gen:E,data:R,schemaCode:M,keyword:_,it:j}=g,{opts:P,self:k}=j;if(!P.validateFormats)return;const z=new i.KeywordCxt(j,k.RULES.all.format.definition,"format");function Z(q){return a._`${q}.compare(${R}, ${M}) ${B[_].fail} 0`}z.$data?function W(){const q=E.scopeValue("formats",{ref:k.formats,code:P.code.formats}),re=E.const("fmt",a._`${q}[${z.schemaCode}]`);g.fail$data(a.or(a._`typeof ${re} != "object"`,a._`${re} instanceof RegExp`,a._`typeof ${re}.compare != "function"`,Z(re)))}():function V(){const q=z.schema,re=k.formats[q];if(!re||!0===re)return;if("object"!=typeof re||re instanceof RegExp||"function"!=typeof re.compare)throw new Error(`"${_}": format "${q}" does not define "compare" function`);const te=E.scopeValue("formats",{key:q,ref:re,code:P.code.formats?a._`${P.code.formats}${a.getProperty(q)}`:void 0});g.fail$data(Z(te))}()},dependencies:["format"]},F.default=g=>(g.addKeyword(F.formatLimitDefinition),g)},11151:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(76533),F),a(f(59433),F),a(f(54065),F)},51236:function(Me,F,f){"use strict";var i=this&&this.__rest||function(g,E){var R={};for(var M in g)Object.prototype.hasOwnProperty.call(g,M)&&E.indexOf(M)<0&&(R[M]=g[M]);if(null!=g&&"function"==typeof Object.getOwnPropertySymbols){var _=0;for(M=Object.getOwnPropertySymbols(g);_S.toWrappedVerifiableCredential(M,R))}static toWrappedVerifiableCredential(E,R){var M;if(S.isSdJwtDecodedCredential(E)||S.isSdJwtEncoded(E)){let q;if(S.isSdJwtEncoded(E)){if(!R?.hasher)throw new Error("Hasher implementation is required to decode SD-JWT");q=(0,B.decodeSdJwtVc)(E,R.hasher)}else q=E;return{type:S.isSdJwtDecodedCredential(E)?B.OriginalType.SD_JWT_VC_DECODED:B.OriginalType.SD_JWT_VC_ENCODED,format:"vc+sd-jwt",original:E,credential:q,decoded:q.decodedPayload}}const _=S.getFirstProof(E),j=S.hasJWTProofType(E)&&_&&null!==(M=_.jwt)&&void 0!==M?M:E;if(!j)throw Error("Could not determine original credential, probably it was a converted JWT credential, that is now missing the JWT value in the proof");const P=S.decodeVerifiableCredential(j),k=S.isJwtEncoded(j),z=S.isJwtDecodedCredential(j);return{original:j,decoded:P,format:k||z?"jwt_vc":"ldp_vc",type:k?B.OriginalType.JWT_ENCODED:z?B.OriginalType.JWT_DECODED:B.OriginalType.JSONLD,credential:k||z?S.jwtDecodedCredentialToUniformCredential(P,R):P}}static isJwtEncoded(E){return m.ObjectUtils.isString(E)&&E.startsWith("ey")&&!E.includes("~")}static isSdJwtEncoded(E){return m.ObjectUtils.isString(E)&&E.startsWith("ey")&&E.includes("~")}static isW3cCredential(E){var R;return"@context"in E&&((null===(R=E.type)||void 0===R?void 0:R.includes("VerifiableCredential"))||!1)}static isCredential(E){try{if(S.isJwtEncoded(E)){const R=S.toUniformCredential(E);return S.isW3cCredential(R)}return!!S.isSdJwtEncoded(E)||S.isW3cCredential(E)||S.isSdJwtDecodedCredentialPayload(E)||S.isJwtDecodedCredential(E)||S.isSdJwtDecodedCredential(E)}catch{return!1}}static isPresentation(E){try{if(S.isJwtEncoded(E)){const R=S.toUniformPresentation(E);return S.isW3cPresentation(R)}return!S.isSdJwtEncoded(E)&&(S.isW3cPresentation(E)||S.isSdJwtDecodedCredentialPayload(E)||S.isJwtDecodedPresentation(E)||S.isSdJwtDecodedCredential(E))}catch{return!1}}static hasProof(E){try{return!!(S.isJwtEncoded(E)||S.isJwtDecodedCredential(E)||S.isSdJwtEncoded(E)||S.isSdJwtDecodedCredential(E)||"vc"in E&&E.vc.proof||"vp"in E&&E.vp.proof)||!!E.proof}catch{return!1}}static isW3cPresentation(E){var R;return"@context"in E&&((null===(R=E.type)||void 0===R?void 0:R.includes("VerifiablePresentation"))||!1)}static isSdJwtDecodedCredentialPayload(E){return"vct"in E}static areOriginalVerifiableCredentialsEqual(E,R){return"string"==typeof E||"string"==typeof R?E===R:S.isSdJwtDecodedCredential(E)||S.isSdJwtDecodedCredential(R)?E.compactSdJwtVc===R.compactSdJwtVc:JSON.stringify(R.proof)===JSON.stringify(E.proof)}static isJsonLdAsString(E){return m.ObjectUtils.isString(E)&&E.includes("@context")}static isSdJwtDecodedCredential(E){return void 0!==E.compactSdJwtVc}static isJwtDecodedCredential(E){return void 0!==E.vc&&void 0!==E.iss}static isJwtDecodedPresentation(E){return void 0!==E.vp&&void 0!==E.iss}static jwtEncodedPresentationToUniformPresentation(E,R=!0,M){return S.jwtDecodedPresentationToUniformPresentation((0,x.default)(E),R,M)}static jwtDecodedPresentationToUniformPresentation(E,R=!0,M){const{iss:_,aud:j,jti:P,vp:k}=E,z=i(E,["iss","aud","jti","vp"]),W=Object.assign(Object.assign({},z),k);if(R){if(!k.verifiableCredential)throw Error("Verifiable Presentation should have a verifiable credential at this point");W.verifiableCredential=k.verifiableCredential.map(V=>S.toUniformCredential(V,M))}if(_){const V=W.holder;if(V&&V!==_)throw new Error(`Inconsistent holders between JWT claim (${_}) and VC value (${V})`);W.holder=_}if(j){const V=W.verifier;if(V&&V!==j)throw new Error(`Inconsistent holders between JWT claim (${j}) and VC value (${V})`);W.verifier=j}if(P){const V=W.id;if(V&&V!==P)throw new Error(`Inconsistent VP ids between JWT claim (${P}) and VP value (${V})`);W.id=P}return W}static toUniformCredential(E,R){var M;if(S.isSdJwtDecodedCredential(E))throw new Error("Converting SD-JWT VC to uniform VC is not supported.");const _="string"!=typeof E&&S.hasJWTProofType(E)?null===(M=S.getFirstProof(E))||void 0===M?void 0:M.jwt:E;if(!_)throw Error("Could not determine original credential from passed in credential. Probably because a JWT proof type was present, but now is not available anymore");const j=S.decodeVerifiableCredential(_),P=S.isJwtEncoded(_);return S.isJwtDecodedCredential(_)||P?S.jwtDecodedCredentialToUniformCredential(j,R):j}static toUniformPresentation(E,R){var M;if(S.isSdJwtDecodedCredential(E))throw new Error("Converting SD-JWT VC to uniform VP is not supported.");const _=S.getFirstProof(E),j="string"!=typeof E&&S.hasJWTProofType(E)?_?.jwt:E;if(!j)throw Error("Could not determine original presentation, probably it was a converted JWT presentation, that is now missing the JWT value in the proof");const P=S.decodeVerifiablePresentation(j),k=S.isJwtEncoded(j),z=S.isJwtDecodedPresentation(j),W=k||z?S.jwtDecodedPresentationToUniformPresentation(P,!1):P;return R?.addContextIfMissing&&!W["@context"]&&(W["@context"]=["https://www.w3.org/2018/credentials/v1"]),W.verifiableCredential=null===(M=W.verifiableCredential)||void 0===M?void 0:M.map(V=>S.toUniformCredential(V,R)),W}static jwtEncodedCredentialToUniformCredential(E,R){return S.jwtDecodedCredentialToUniformCredential((0,x.default)(E),R)}static jwtDecodedCredentialToUniformCredential(E,R){var M;const{exp:_,nbf:j,iss:P,vc:k,sub:z,jti:W}=E,V=i(E,["exp","nbf","iss","vc","sub","jti"]),Z=Object.assign(Object.assign({},V),k),q=null!==(M=R?.maxTimeSkewInMS)&&void 0!==M?M:1500;if(_){const re=Z.expirationDate,te=parseInt(_.toString()),ie=te<9999999999?new Date(1e3*te).toISOString().replace(/\.000Z/,"Z"):new Date(te).toISOString();if(re&&re!==ie){const ae=Math.abs(new Date(ie).getTime()-new Date(re).getTime());if(!q||ae>q)throw new Error(`Inconsistent expiration dates between JWT claim (${ie}) and VC value (${re})`)}Z.expirationDate=ie}if(j){const re=Z.issuanceDate,te=parseInt(j.toString()),ie=te<9999999999?new Date(1e3*te).toISOString().replace(/\.000Z/,"Z"):new Date(te).toISOString();if(re&&re!==ie){const ae=Math.abs(new Date(ie).getTime()-new Date(re).getTime());if(!q||ae>q)throw new Error(`Inconsistent issuance dates between JWT claim (${ie}) and VC value (${re})`)}Z.issuanceDate=ie}if(P){const re=Z.issuer;if(re){if("string"==typeof re){if(re!==P)throw new Error(`Inconsistent issuers between JWT claim (${P}) and VC value (${re})`)}else if(!re.id&&Object.keys(re).length>0&&(re.id=P),re.id!==P)throw new Error(`Inconsistent issuers between JWT claim (${P}) and VC value (${re.id})`)}else Z.issuer=P}if(z){const re=Array.isArray(Z.credentialSubject)?Z.credentialSubject:[Z.credentialSubject];for(let te=0;te{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapLanguageValues=F.mapLanguageValue=F.toLanguageValueObjects=F.toLanguageValueObject=F.isLanguageValueObjects=F.isLanguageValueObject=void 0;const i=f(59433);F.isLanguageValueObject=E=>!(!E||!i.ObjectUtils.isObject(E)||Array.isArray(E)||2!==Object.keys(E).length||!("language"in E)||!E.language||!("value"in E)||!E.value),F.isLanguageValueObjects=E=>!(!E||!Array.isArray(E))&&E.every(R=>(0,F.isLanguageValueObject)(R)),F.toLanguageValueObject=E=>(0,F.isLanguageValueObject)(E)?E:void 0,F.toLanguageValueObjects=E=>(0,F.isLanguageValueObject)(E)?i.ObjectUtils.asArray((0,F.toLanguageValueObject)(E)):(0,F.isLanguageValueObjects)(E)?E:void 0,F.mapLanguageValue=(E,R)=>{const M=(0,F.toLanguageValueObjects)(E);if(Array.isArray(M)){if(0===M.length)return E;const _=M.filter(P=>!R?.language||P.language.toLowerCase().includes(R.language.toLowerCase()));let j;if(_.length>0)j=_[0];else{if(!1===R?.fallbackToFirstObject)return E;j=M[0]}return j.value}return E},F.mapLanguageValues=(E,R)=>{const M=R?.noDeepClone?E:JSON.parse(JSON.stringify(E));return Object.keys(E).forEach(_=>{M[_]=(0,F.mapLanguageValue)(M[_],R),(i.ObjectUtils.isObject(M[_])||Array.isArray(M[_]))&&(M[_]=(0,F.mapLanguageValues)(M[_],Object.assign(Object.assign({},R),{noDeepClone:!0})))}),M}},40528:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.parseDid=F.IProofType=F.IProofPurpose=void 0;var f=function(B){return B.verificationMethod="verificationMethod",B.assertionMethod="assertionMethod",B.authentication="authentication",B.keyAgreement="keyAgreement",B.contractAgreement="contactAgreement",B.capabilityInvocation="capabilityInvocation",B.capabilityDelegation="capabilityDelegation",B}(f||(F.IProofPurpose=f={})),i=function(B){return B.Ed25519Signature2018="Ed25519Signature2018",B.Ed25519Signature2020="Ed25519Signature2020",B.EcdsaSecp256k1Signature2019="EcdsaSecp256k1Signature2019",B.EcdsaSecp256k1RecoverySignature2020="EcdsaSecp256k1RecoverySignature2020",B.JsonWebSignature2020="JsonWebSignature2020",B.RsaSignature2018="RsaSignature2018",B.GpgSignature2020="GpgSignature2020",B.JcsEd25519Signature2020="JcsEd25519Signature2020",B.BbsBlsSignatureProof2020="BbsBlsSignatureProof2020",B.BbsBlsBoundSignatureProof2020="BbsBlsBoundSignatureProof2020",B.JwtProof2020="JwtProof2020",B}(i||(F.IProofType=i={}));F.parseDid=B=>{const m=x(B);if(null===m)throw new Error("invalid did");return m};const x=B=>{const S="(?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))",R="[a-zA-Z0-9_.:%-]",z=new RegExp(`^did:([a-z0-9]+):((?:${S}*:)*(${S}+))((;${R}+=${R}*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$`);if(""===B||!B)return null;const W=B.match(z);if(W){const V={did:`did:${W[1]}:${W[2]}`,method:W[1],id:W[2],didUrl:B};if(W[4]){const Z=W[4].slice(1).split(";");V.params={};for(const q of Z){const re=q.split("=");V.params[re[0]]=re[1]}}return W[6]&&(V.path=W[6]),W[7]&&(V.query=W[7].slice(1)),W[8]&&(V.fragment=W[8].slice(1)),V}return null}},5940:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},76533:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(40528),F),a(f(30988),F),a(f(69922),F),a(f(5940),F),a(f(86548),F),a(f(66996),F)},30988:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},86548:function(Me,F,f){"use strict";var i=this&&this.__awaiter||function(g,E,R,M){return new(R||(R=Promise))(function(j,P){function k(V){try{W(M.next(V))}catch(Z){P(Z)}}function z(V){try{W(M.throw(V))}catch(Z){P(Z)}}function W(V){V.done?j(V.value):function _(j){return j instanceof R?j:new R(function(P){P(j)})}(V.value).then(k,z)}W((M=M.apply(g,E||[])).next())})};Object.defineProperty(F,"__esModule",{value:!0}),F.decodeSdJwtVcAsync=F.decodeSdJwtVc=F.isWrappedSdJwtVerifiablePresentation=F.isWrappedSdJwtVerifiableCredential=void 0;const a=f(15315);F.isWrappedSdJwtVerifiableCredential=function x(g){return"vc+sd-jwt"===g.format},F.isWrappedSdJwtVerifiablePresentation=function B(g){return"vc+sd-jwt"===g.format},F.decodeSdJwtVc=function m(g,E){const{jwt:R,disclosures:M}=(0,a.decodeSdJwtSync)(g,E),_=R.payload;return{compactSdJwtVc:g,decodedPayload:(0,a.getClaimsSync)(_,M,E),disclosures:M.map(P=>{const k=P.key?[P.salt,P.key,P.value]:[P.salt,P.value];if(!P._digest)throw new Error("Implementation error: digest not present in disclosure");return{decoded:k,digest:P._digest,encoded:P.encode()}}),signedPayload:_}},F.decodeSdJwtVcAsync=function S(g,E){return i(this,void 0,void 0,function*(){const{jwt:R,disclosures:M}=yield(0,a.decodeSdJwt)(g,E),_=R.payload,j=yield(0,a.getClaims)(_,M,E);return{compactSdJwtVc:g,decodedPayload:j,disclosures:M.map(P=>{const k=P.key?[P.salt,P.key,P.value]:[P.salt,P.value];if(!P._digest)throw new Error("Implementation error: digest not present in disclosure");return{decoded:k,digest:P._digest,encoded:P.encode()}}),signedPayload:_}})}},69922:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.DocumentFormat=F.OriginalType=void 0;var f=function(a){return a.JSONLD="json-ld",a.JWT_ENCODED="jwt-encoded",a.JWT_DECODED="jwt-decoded",a.SD_JWT_VC_ENCODED="sd-jwt-vc-encoded",a.SD_JWT_VC_DECODED="sd-jwt-vc-decoded",a}(f||(F.OriginalType=f={})),i=function(a){return a[a.JWT=0]="JWT",a[a.JSONLD=1]="JSONLD",a[a.SD_JWT_VC=2]="SD_JWT_VC",a[a.EIP712=3]="EIP712",a}(i||(F.DocumentFormat=i={}))},66996:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.isWrappedW3CVerifiablePresentation=F.isWrappedW3CVerifiableCredential=F.StatusListDriverType=F.StatusListCredentialIdMode=F.StatusListType=F.JWT_PROOF_TYPE_2020=void 0,F.JWT_PROOF_TYPE_2020="JwtProof2020";var f=function(m){return m.StatusList2021="StatusList2021",m}(f||(F.StatusListType=f={})),i=function(m){return m.ISSUANCE="ISSUANCE",m.PERSISTENCE="PERSISTENCE",m.NEVER="NEVER",m}(i||(F.StatusListCredentialIdMode=i={})),a=function(m){return m.AGENT_TYPEORM="agent_typeorm",m.AGENT_KV_STORE="agent_kv_store",m.GITHUB="github",m.AGENT_FILESYSTEM="agent_filesystem",m}(a||(F.StatusListDriverType=a={}));F.isWrappedW3CVerifiableCredential=function x(m){return"jwt_vc"===m.format||"ldp_vc"===m.format},F.isWrappedW3CVerifiablePresentation=function B(m){return"jwt_vp"===m.format||"ldp_vp"===m.format}},59433:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),a=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),a(f(24418),F)},24418:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectUtils=void 0;class f{static asArray(a){return Array.isArray(a)?a:[a]}static isObject(a){return"object"==typeof a||"[object Object]"===Object.prototype.toString.call(a)}static isUrlAbsolute(a){f.isString(a)&&/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/.test(a)}static isString(a){return"string"==typeof a||"[object String]"===Object.prototype.toString.call(a)}}F.ObjectUtils=f},20844:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.MissingRefError=F.ValidationError=F.CodeGen=F.Name=F.nil=F.stringify=F.str=F._=F.KeywordCxt=void 0;const i=f(35419),a=f(98496),x=f(86980),B=f(87577),m="https://json-schema.org/draft/2020-12/schema";class S extends i.default{constructor(j={}){super({...j,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),a.default.forEach(j=>this.addVocabulary(j)),this.opts.discriminator&&this.addKeyword(x.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:j,meta:P}=this.opts;P&&(B.default.call(this,j),this.refs["http://json-schema.org/schema"]=m)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(m)?m:void 0)}}Me.exports=F=S,Object.defineProperty(F,"__esModule",{value:!0}),F.default=S;var g=f(40339);Object.defineProperty(F,"KeywordCxt",{enumerable:!0,get:function(){return g.KeywordCxt}});var E=f(1038);Object.defineProperty(F,"_",{enumerable:!0,get:function(){return E._}}),Object.defineProperty(F,"str",{enumerable:!0,get:function(){return E.str}}),Object.defineProperty(F,"stringify",{enumerable:!0,get:function(){return E.stringify}}),Object.defineProperty(F,"nil",{enumerable:!0,get:function(){return E.nil}}),Object.defineProperty(F,"Name",{enumerable:!0,get:function(){return E.Name}}),Object.defineProperty(F,"CodeGen",{enumerable:!0,get:function(){return E.CodeGen}});var R=f(42467);Object.defineProperty(F,"ValidationError",{enumerable:!0,get:function(){return R.default}});var M=f(26288);Object.defineProperty(F,"MissingRefError",{enumerable:!0,get:function(){return M.default}})},33337:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.regexpCode=F.getEsmExportName=F.getProperty=F.safeStringify=F.stringify=F.strConcat=F.addCodeArg=F.str=F._=F.nil=F._Code=F.Name=F.IDENTIFIER=F._CodeOrName=void 0;class f{}F._CodeOrName=f,F.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class i extends f{constructor(V){if(super(),!F.IDENTIFIER.test(V))throw new Error("CodeGen: name must be a valid identifier");this.str=V}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}F.Name=i;class a extends f{constructor(V){super(),this._items="string"==typeof V?[V]:V}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const V=this._items[0];return""===V||'""'===V}get str(){var V;return null!==(V=this._str)&&void 0!==V?V:this._str=this._items.reduce((Z,q)=>`${Z}${q}`,"")}get names(){var V;return null!==(V=this._names)&&void 0!==V?V:this._names=this._items.reduce((Z,q)=>(q instanceof i&&(Z[q.str]=(Z[q.str]||0)+1),Z),{})}}function x(W,...V){const Z=[W[0]];let q=0;for(;q{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.or=F.and=F.not=F.CodeGen=F.operators=F.varKinds=F.ValueScopeName=F.ValueScope=F.Scope=F.Name=F.regexpCode=F.stringify=F.getProperty=F.nil=F.strConcat=F.str=F._=void 0;const i=f(33337),a=f(85934);var x=f(33337);Object.defineProperty(F,"_",{enumerable:!0,get:function(){return x._}}),Object.defineProperty(F,"str",{enumerable:!0,get:function(){return x.str}}),Object.defineProperty(F,"strConcat",{enumerable:!0,get:function(){return x.strConcat}}),Object.defineProperty(F,"nil",{enumerable:!0,get:function(){return x.nil}}),Object.defineProperty(F,"getProperty",{enumerable:!0,get:function(){return x.getProperty}}),Object.defineProperty(F,"stringify",{enumerable:!0,get:function(){return x.stringify}}),Object.defineProperty(F,"regexpCode",{enumerable:!0,get:function(){return x.regexpCode}}),Object.defineProperty(F,"Name",{enumerable:!0,get:function(){return x.Name}});var B=f(85934);Object.defineProperty(F,"Scope",{enumerable:!0,get:function(){return B.Scope}}),Object.defineProperty(F,"ValueScope",{enumerable:!0,get:function(){return B.ValueScope}}),Object.defineProperty(F,"ValueScopeName",{enumerable:!0,get:function(){return B.ValueScopeName}}),Object.defineProperty(F,"varKinds",{enumerable:!0,get:function(){return B.varKinds}}),F.operators={GT:new i._Code(">"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._Code("+")};class m{optimizeNodes(){return this}optimizeNames(oe,de){return this}}class S extends m{constructor(oe,de,Ae){super(),this.varKind=oe,this.name=de,this.rhs=Ae}render({es5:oe,_n:de}){return`${oe?a.varKinds.var:this.varKind} ${this.name}${void 0===this.rhs?"":` = ${this.rhs}`};`+de}optimizeNames(oe,de){if(oe[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,oe,de)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class g extends m{constructor(oe,de,Ae){super(),this.lhs=oe,this.rhs=de,this.sideEffects=Ae}render({_n:oe}){return`${this.lhs} = ${this.rhs};`+oe}optimizeNames(oe,de){if(!(this.lhs instanceof i.Name)||oe[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,oe,de),this}get names(){return h(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class E extends g{constructor(oe,de,Ae,Ie){super(oe,Ae,Ie),this.op=de}render({_n:oe}){return`${this.lhs} ${this.op}= ${this.rhs};`+oe}}class R extends m{constructor(oe){super(),this.label=oe,this.names={}}render({_n:oe}){return`${this.label}:`+oe}}class M extends m{constructor(oe){super(),this.label=oe,this.names={}}render({_n:oe}){return`break${this.label?` ${this.label}`:""};`+oe}}class _ extends m{constructor(oe){super(),this.error=oe}render({_n:oe}){return`throw ${this.error};`+oe}get names(){return this.error.names}}class j extends m{constructor(oe){super(),this.code=oe}render({_n:oe}){return`${this.code};`+oe}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(oe,de){return this.code=A(this.code,oe,de),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class P extends m{constructor(oe=[]){super(),this.nodes=oe}render(oe){return this.nodes.reduce((de,Ae)=>de+Ae.render(oe),"")}optimizeNodes(){const{nodes:oe}=this;let de=oe.length;for(;de--;){const Ae=oe[de].optimizeNodes();Array.isArray(Ae)?oe.splice(de,1,...Ae):Ae?oe[de]=Ae:oe.splice(de,1)}return oe.length>0?this:void 0}optimizeNames(oe,de){const{nodes:Ae}=this;let Ie=Ae.length;for(;Ie--;){const Le=Ae[Ie];Le.optimizeNames(oe,de)||(I(oe,Le.names),Ae.splice(Ie,1))}return Ae.length>0?this:void 0}get names(){return this.nodes.reduce((oe,de)=>o(oe,de.names),{})}}class k extends P{render(oe){return"{"+oe._n+super.render(oe)+"}"+oe._n}}class z extends P{}let W=(()=>{class ee extends k{}return ee.kind="else",ee})(),V=(()=>{class ee extends k{constructor(de,Ae){super(Ae),this.condition=de}render(de){let Ae=`if(${this.condition})`+super.render(de);return this.else&&(Ae+="else "+this.else.render(de)),Ae}optimizeNodes(){super.optimizeNodes();const de=this.condition;if(!0===de)return this.nodes;let Ae=this.else;if(Ae){const Ie=Ae.optimizeNodes();Ae=this.else=Array.isArray(Ie)?new W(Ie):Ie}return Ae?!1===de?Ae instanceof ee?Ae:Ae.nodes:this.nodes.length?this:new ee(O(de),Ae instanceof ee?[Ae]:Ae.nodes):!1!==de&&this.nodes.length?this:void 0}optimizeNames(de,Ae){var Ie;if(this.else=null===(Ie=this.else)||void 0===Ie?void 0:Ie.optimizeNames(de,Ae),super.optimizeNames(de,Ae)||this.else)return this.condition=A(this.condition,de,Ae),this}get names(){const de=super.names;return h(de,this.condition),this.else&&o(de,this.else.names),de}}return ee.kind="if",ee})(),Z=(()=>{class ee extends k{}return ee.kind="for",ee})();class q extends Z{constructor(oe){super(),this.iteration=oe}render(oe){return`for(${this.iteration})`+super.render(oe)}optimizeNames(oe,de){if(super.optimizeNames(oe,de))return this.iteration=A(this.iteration,oe,de),this}get names(){return o(super.names,this.iteration.names)}}class re extends Z{constructor(oe,de,Ae,Ie){super(),this.varKind=oe,this.name=de,this.from=Ae,this.to=Ie}render(oe){const de=oe.es5?a.varKinds.var:this.varKind,{name:Ae,from:Ie,to:Le}=this;return`for(${de} ${Ae}=${Ie}; ${Ae}<${Le}; ${Ae}++)`+super.render(oe)}get names(){const oe=h(super.names,this.from);return h(oe,this.to)}}class te extends Z{constructor(oe,de,Ae,Ie){super(),this.loop=oe,this.varKind=de,this.name=Ae,this.iterable=Ie}render(oe){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(oe)}optimizeNames(oe,de){if(super.optimizeNames(oe,de))return this.iterable=A(this.iterable,oe,de),this}get names(){return o(super.names,this.iterable.names)}}let ie=(()=>{class ee extends k{constructor(de,Ae,Ie){super(),this.name=de,this.args=Ae,this.async=Ie}render(de){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(de)}}return ee.kind="func",ee})(),ae=(()=>{class ee extends P{render(de){return"return "+super.render(de)}}return ee.kind="return",ee})();class me extends k{render(oe){let de="try"+super.render(oe);return this.catch&&(de+=this.catch.render(oe)),this.finally&&(de+=this.finally.render(oe)),de}optimizeNodes(){var oe,de;return super.optimizeNodes(),null===(oe=this.catch)||void 0===oe||oe.optimizeNodes(),null===(de=this.finally)||void 0===de||de.optimizeNodes(),this}optimizeNames(oe,de){var Ae,Ie;return super.optimizeNames(oe,de),null===(Ae=this.catch)||void 0===Ae||Ae.optimizeNames(oe,de),null===(Ie=this.finally)||void 0===Ie||Ie.optimizeNames(oe,de),this}get names(){const oe=super.names;return this.catch&&o(oe,this.catch.names),this.finally&&o(oe,this.finally.names),oe}}let ye=(()=>{class ee extends k{constructor(de){super(),this.error=de}render(de){return`catch(${this.error})`+super.render(de)}}return ee.kind="catch",ee})(),ue=(()=>{class ee extends k{render(de){return"finally"+super.render(de)}}return ee.kind="finally",ee})();function o(ee,oe){for(const de in oe)ee[de]=(ee[de]||0)+(oe[de]||0);return ee}function h(ee,oe){return oe instanceof i._CodeOrName?o(ee,oe.names):ee}function A(ee,oe,de){return ee instanceof i.Name?Ae(ee):function Ie(Le){return Le instanceof i._Code&&Le._items.some(xe=>xe instanceof i.Name&&1===oe[xe.str]&&void 0!==de[xe.str])}(ee)?new i._Code(ee._items.reduce((Le,xe)=>(xe instanceof i.Name&&(xe=Ae(xe)),xe instanceof i._Code?Le.push(...xe._items):Le.push(xe),Le),[])):ee;function Ae(Le){const xe=de[Le.str];return void 0===xe||1!==oe[Le.str]?Le:(delete oe[Le.str],xe)}}function I(ee,oe){for(const de in oe)ee[de]=(ee[de]||0)-(oe[de]||0)}function O(ee){return"boolean"==typeof ee||"number"==typeof ee||null===ee?!ee:i._`!${Y(ee)}`}F.CodeGen=class K{constructor(oe,de={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...de,_n:de.lines?"\n":""},this._extScope=oe,this._scope=new a.Scope({parent:oe}),this._nodes=[new z]}toString(){return this._root.render(this.opts)}name(oe){return this._scope.name(oe)}scopeName(oe){return this._extScope.name(oe)}scopeValue(oe,de){const Ae=this._extScope.value(oe,de);return(this._values[Ae.prefix]||(this._values[Ae.prefix]=new Set)).add(Ae),Ae}getScopeValue(oe,de){return this._extScope.getValue(oe,de)}scopeRefs(oe){return this._extScope.scopeRefs(oe,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(oe,de,Ae,Ie){const Le=this._scope.toName(de);return void 0!==Ae&&Ie&&(this._constants[Le.str]=Ae),this._leafNode(new S(oe,Le,Ae)),Le}const(oe,de,Ae){return this._def(a.varKinds.const,oe,de,Ae)}let(oe,de,Ae){return this._def(a.varKinds.let,oe,de,Ae)}var(oe,de,Ae){return this._def(a.varKinds.var,oe,de,Ae)}assign(oe,de,Ae){return this._leafNode(new g(oe,de,Ae))}add(oe,de){return this._leafNode(new E(oe,F.operators.ADD,de))}code(oe){return"function"==typeof oe?oe():oe!==i.nil&&this._leafNode(new j(oe)),this}object(...oe){const de=["{"];for(const[Ae,Ie]of oe)de.length>1&&de.push(","),de.push(Ae),(Ae!==Ie||this.opts.es5)&&(de.push(":"),(0,i.addCodeArg)(de,Ie));return de.push("}"),new i._Code(de)}if(oe,de,Ae){if(this._blockNode(new V(oe)),de&&Ae)this.code(de).else().code(Ae).endIf();else if(de)this.code(de).endIf();else if(Ae)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(oe){return this._elseNode(new V(oe))}else(){return this._elseNode(new W)}endIf(){return this._endBlockNode(V,W)}_for(oe,de){return this._blockNode(oe),de&&this.code(de).endFor(),this}for(oe,de){return this._for(new q(oe),de)}forRange(oe,de,Ae,Ie,Le=(this.opts.es5?a.varKinds.var:a.varKinds.let)){const xe=this._scope.toName(oe);return this._for(new re(Le,xe,de,Ae),()=>Ie(xe))}forOf(oe,de,Ae,Ie=a.varKinds.const){const Le=this._scope.toName(oe);if(this.opts.es5){const xe=de instanceof i.Name?de:this.var("_arr",de);return this.forRange("_i",0,i._`${xe}.length`,De=>{this.var(Le,i._`${xe}[${De}]`),Ae(Le)})}return this._for(new te("of",Ie,Le,de),()=>Ae(Le))}forIn(oe,de,Ae,Ie=(this.opts.es5?a.varKinds.var:a.varKinds.const)){if(this.opts.ownProperties)return this.forOf(oe,i._`Object.keys(${de})`,Ae);const Le=this._scope.toName(oe);return this._for(new te("in",Ie,Le,de),()=>Ae(Le))}endFor(){return this._endBlockNode(Z)}label(oe){return this._leafNode(new R(oe))}break(oe){return this._leafNode(new M(oe))}return(oe){const de=new ae;if(this._blockNode(de),this.code(oe),1!==de.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ae)}try(oe,de,Ae){if(!de&&!Ae)throw new Error('CodeGen: "try" without "catch" and "finally"');const Ie=new me;if(this._blockNode(Ie),this.code(oe),de){const Le=this.name("e");this._currNode=Ie.catch=new ye(Le),de(Le)}return Ae&&(this._currNode=Ie.finally=new ue,this.code(Ae)),this._endBlockNode(ye,ue)}throw(oe){return this._leafNode(new _(oe))}block(oe,de){return this._blockStarts.push(this._nodes.length),oe&&this.code(oe).endBlock(de),this}endBlock(oe){const de=this._blockStarts.pop();if(void 0===de)throw new Error("CodeGen: not in self-balancing block");const Ae=this._nodes.length-de;if(Ae<0||void 0!==oe&&Ae!==oe)throw new Error(`CodeGen: wrong number of nodes: ${Ae} vs ${oe} expected`);return this._nodes.length=de,this}func(oe,de=i.nil,Ae,Ie){return this._blockNode(new ie(oe,de,Ae)),Ie&&this.code(Ie).endFunc(),this}endFunc(){return this._endBlockNode(ie)}optimize(oe=1){for(;oe-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(oe){return this._currNode.nodes.push(oe),this}_blockNode(oe){this._currNode.nodes.push(oe),this._nodes.push(oe)}_endBlockNode(oe,de){const Ae=this._currNode;if(Ae instanceof oe||de&&Ae instanceof de)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${de?`${oe.kind}/${de.kind}`:oe.kind}"`)}_elseNode(oe){const de=this._currNode;if(!(de instanceof V))throw new Error('CodeGen: "else" without "if"');return this._currNode=de.else=oe,this}get _root(){return this._nodes[0]}get _currNode(){const oe=this._nodes;return oe[oe.length-1]}set _currNode(oe){const de=this._nodes;de[de.length-1]=oe}},F.not=O;const $=p(F.operators.AND);F.and=function H(...ee){return ee.reduce($)};const D=p(F.operators.OR);function p(ee){return(oe,de)=>oe===i.nil?de:de===i.nil?oe:i._`${Y(oe)} ${ee} ${Y(de)}`}function Y(ee){return ee instanceof i.Name?ee:i._`(${ee})`}F.or=function s(...ee){return ee.reduce(D)}},85934:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValueScope=F.ValueScopeName=F.Scope=F.varKinds=F.UsedValueState=void 0;const i=f(33337);class a extends Error{constructor(R){super(`CodeGen: "code" for ${R} not defined`),this.value=R.value}}var x,E;(E=x=F.UsedValueState||(F.UsedValueState={}))[E.Started=0]="Started",E[E.Completed=1]="Completed",F.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class B{constructor({prefixes:R,parent:M}={}){this._names={},this._prefixes=R,this._parent=M}toName(R){return R instanceof i.Name?R:this.name(R)}name(R){return new i.Name(this._newName(R))}_newName(R){return`${R}${(this._names[R]||this._nameGroup(R)).index++}`}_nameGroup(R){var M,_;if(null!==(_=null===(M=this._parent)||void 0===M?void 0:M._prefixes)&&void 0!==_&&_.has(R)||this._prefixes&&!this._prefixes.has(R))throw new Error(`CodeGen: prefix "${R}" is not allowed in this scope`);return this._names[R]={prefix:R,index:0}}}F.Scope=B;class m extends i.Name{constructor(R,M){super(M),this.prefix=R}setValue(R,{property:M,itemIndex:_}){this.value=R,this.scopePath=i._`.${new i.Name(M)}[${_}]`}}F.ValueScopeName=m;const S=i._`\n`;F.ValueScope=class g extends B{constructor(R){super(R),this._values={},this._scope=R.scope,this.opts={...R,_n:R.lines?S:i.nil}}get(){return this._scope}name(R){return new m(R,this._newName(R))}value(R,M){var _;if(void 0===M.ref)throw new Error("CodeGen: ref must be passed in value");const j=this.toName(R),{prefix:P}=j,k=null!==(_=M.key)&&void 0!==_?_:M.ref;let z=this._values[P];if(z){const Z=z.get(k);if(Z)return Z}else z=this._values[P]=new Map;z.set(k,j);const W=this._scope[P]||(this._scope[P]=[]),V=W.length;return W[V]=M.ref,j.setValue(M,{property:P,itemIndex:V}),j}getValue(R,M){const _=this._values[R];if(_)return _.get(M)}scopeRefs(R,M=this._values){return this._reduceValues(M,_=>{if(void 0===_.scopePath)throw new Error(`CodeGen: name "${_}" has no value`);return i._`${R}${_.scopePath}`})}scopeCode(R=this._values,M,_){return this._reduceValues(R,j=>{if(void 0===j.value)throw new Error(`CodeGen: name "${j}" has no value`);return j.value.code},M,_)}_reduceValues(R,M,_={},j){let P=i.nil;for(const k in R){const z=R[k];if(!z)continue;const W=_[k]=_[k]||new Map;z.forEach(V=>{if(W.has(V))return;W.set(V,x.Started);let Z=M(V);if(Z)P=i._`${P}${this.opts.es5?F.varKinds.var:F.varKinds.const} ${V} = ${Z};${this.opts._n}`;else{if(!(Z=j?.(V)))throw new a(V);P=i._`${P}${Z}${this.opts._n}`}W.set(V,x.Completed)})}return P}}},53421:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.extendErrors=F.resetErrorsCount=F.reportExtraError=F.reportError=F.keyword$DataError=F.keywordError=void 0;const i=f(1038),a=f(27006),x=f(23432);function E(W,V){const Z=W.const("err",V);W.if(i._`${x.default.vErrors} === null`,()=>W.assign(x.default.vErrors,i._`[${Z}]`),i._`${x.default.vErrors}.push(${Z})`),W.code(i._`${x.default.errors}++`)}function R(W,V){const{gen:Z,validateName:q,schemaEnv:re}=W;re.$async?Z.throw(i._`new ${W.ValidationError}(${V})`):(Z.assign(i._`${q}.errors`,V),Z.return(!1))}F.keywordError={message:({keyword:W})=>i.str`must pass "${W}" keyword validation`},F.keyword$DataError={message:({keyword:W,schemaType:V})=>V?i.str`"${W}" keyword must be ${V} ($data)`:i.str`"${W}" keyword is invalid ($data)`},F.reportError=function B(W,V=F.keywordError,Z,q){const{it:re}=W,{gen:te,compositeRule:ie,allErrors:ae}=re,me=_(W,V,Z);q??(ie||ae)?E(te,me):R(re,i._`[${me}]`)},F.reportExtraError=function m(W,V=F.keywordError,Z){const{it:q}=W,{gen:re,compositeRule:te,allErrors:ie}=q;E(re,_(W,V,Z)),te||ie||R(q,x.default.vErrors)},F.resetErrorsCount=function S(W,V){W.assign(x.default.errors,V),W.if(i._`${x.default.vErrors} !== null`,()=>W.if(V,()=>W.assign(i._`${x.default.vErrors}.length`,V),()=>W.assign(x.default.vErrors,null)))},F.extendErrors=function g({gen:W,keyword:V,schemaValue:Z,data:q,errsCount:re,it:te}){if(void 0===re)throw new Error("ajv implementation error");const ie=W.name("err");W.forRange("i",re,x.default.errors,ae=>{W.const(ie,i._`${x.default.vErrors}[${ae}]`),W.if(i._`${ie}.instancePath === undefined`,()=>W.assign(i._`${ie}.instancePath`,(0,i.strConcat)(x.default.instancePath,te.errorPath))),W.assign(i._`${ie}.schemaPath`,i.str`${te.errSchemaPath}/${V}`),te.opts.verbose&&(W.assign(i._`${ie}.schema`,Z),W.assign(i._`${ie}.data`,q))})};const M={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function _(W,V,Z){const{createErrors:q}=W.it;return!1===q?i._`{}`:function j(W,V,Z={}){const{gen:q,it:re}=W,te=[P(re,Z),k(W,Z)];return function z(W,{params:V,message:Z},q){const{keyword:re,data:te,schemaValue:ie,it:ae}=W,{opts:me,propertyName:ye,topSchemaRef:ue,schemaPath:K}=ae;q.push([M.keyword,re],[M.params,"function"==typeof V?V(W):V||i._`{}`]),me.messages&&q.push([M.message,"function"==typeof Z?Z(W):Z]),me.verbose&&q.push([M.schema,ie],[M.parentSchema,i._`${ue}${K}`],[x.default.data,te]),ye&&q.push([M.propertyName,ye])}(W,V,te),q.object(...te)}(W,V,Z)}function P({errorPath:W},{instancePath:V}){const Z=V?i.str`${W}${(0,a.getErrorPath)(V,a.Type.Str)}`:W;return[x.default.instancePath,(0,i.strConcat)(x.default.instancePath,Z)]}function k({keyword:W,it:{errSchemaPath:V}},{schemaPath:Z,parentSchema:q}){let re=q?V:i.str`${V}/${W}`;return Z&&(re=i.str`${re}${(0,a.getErrorPath)(Z,a.Type.Str)}`),[M.schemaPath,re]}},97692:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.resolveSchema=F.getCompilingSchema=F.resolveRef=F.compileSchema=F.SchemaEnv=void 0;const i=f(1038),a=f(42467),x=f(23432),B=f(77172),m=f(27006),S=f(40339);class g{constructor(Z){var q;let re;this.refs={},this.dynamicAnchors={},"object"==typeof Z.schema&&(re=Z.schema),this.schema=Z.schema,this.schemaId=Z.schemaId,this.root=Z.root||this,this.baseId=null!==(q=Z.baseId)&&void 0!==q?q:(0,B.normalizeId)(re?.[Z.schemaId||"$id"]),this.schemaPath=Z.schemaPath,this.localRefs=Z.localRefs,this.meta=Z.meta,this.$async=re?.$async,this.refs={}}}function E(V){const Z=_.call(this,V);if(Z)return Z;const q=(0,B.getFullPath)(this.opts.uriResolver,V.root.baseId),{es5:re,lines:te}=this.opts.code,{ownProperties:ie}=this.opts,ae=new i.CodeGen(this.scope,{es5:re,lines:te,ownProperties:ie});let me;V.$async&&(me=ae.scopeValue("Error",{ref:a.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const ye=ae.scopeName("validate");V.validateName=ye;const ue={gen:ae,allErrors:this.opts.allErrors,data:x.default.data,parentData:x.default.parentData,parentDataProperty:x.default.parentDataProperty,dataNames:[x.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:ae.scopeValue("schema",!0===this.opts.code.source?{ref:V.schema,code:(0,i.stringify)(V.schema)}:{ref:V.schema}),validateName:ye,ValidationError:me,schema:V.schema,schemaEnv:V,rootId:q,baseId:V.baseId||q,schemaPath:i.nil,errSchemaPath:V.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let K;try{this._compilations.add(V),(0,S.validateFunctionCode)(ue),ae.optimize(this.opts.code.optimize);const o=ae.toString();K=`${ae.scopeRefs(x.default.scope)}return ${o}`,this.opts.code.process&&(K=this.opts.code.process(K,V));const A=new Function(`${x.default.self}`,`${x.default.scope}`,K)(this,this.scope.get());if(this.scope.value(ye,{ref:A}),A.errors=null,A.schema=V.schema,A.schemaEnv=V,V.$async&&(A.$async=!0),!0===this.opts.code.source&&(A.source={validateName:ye,validateCode:o,scopeValues:ae._values}),this.opts.unevaluated){const{props:I,items:O}=ue;A.evaluated={props:I instanceof i.Name?void 0:I,items:O instanceof i.Name?void 0:O,dynamicProps:I instanceof i.Name,dynamicItems:O instanceof i.Name},A.source&&(A.source.evaluated=(0,i.stringify)(A.evaluated))}return V.validate=A,V}catch(o){throw delete V.validate,delete V.validateName,K&&this.logger.error("Error compiling schema, function code:",K),o}finally{this._compilations.delete(V)}}function M(V){return(0,B.inlineRef)(V.schema,this.opts.inlineRefs)?V.schema:V.validate?V:E.call(this,V)}function _(V){for(const Z of this._compilations)if(j(Z,V))return Z}function j(V,Z){return V.schema===Z.schema&&V.root===Z.root&&V.baseId===Z.baseId}function P(V,Z){let q;for(;"string"==typeof(q=this.refs[Z]);)Z=q;return q||this.schemas[Z]||k.call(this,V,Z)}function k(V,Z){const q=this.opts.uriResolver.parse(Z),re=(0,B._getFullPath)(this.opts.uriResolver,q);let te=(0,B.getFullPath)(this.opts.uriResolver,V.baseId,void 0);if(Object.keys(V.schema).length>0&&re===te)return W.call(this,q,V);const ie=(0,B.normalizeId)(re),ae=this.refs[ie]||this.schemas[ie];if("string"==typeof ae){const me=k.call(this,V,ae);return"object"!=typeof me?.schema?void 0:W.call(this,q,me)}if("object"==typeof ae?.schema){if(ae.validate||E.call(this,ae),ie===(0,B.normalizeId)(Z)){const{schema:me}=ae,{schemaId:ye}=this.opts,ue=me[ye];return ue&&(te=(0,B.resolveUrl)(this.opts.uriResolver,te,ue)),new g({schema:me,schemaId:ye,root:V,baseId:te})}return W.call(this,q,ae)}}F.SchemaEnv=g,F.compileSchema=E,F.resolveRef=function R(V,Z,q){var re;q=(0,B.resolveUrl)(this.opts.uriResolver,Z,q);const te=V.refs[q];if(te)return te;let ie=P.call(this,V,q);if(void 0===ie){const ae=null===(re=V.localRefs)||void 0===re?void 0:re[q],{schemaId:me}=this.opts;ae&&(ie=new g({schema:ae,schemaId:me,root:V,baseId:Z}))}return void 0!==ie?V.refs[q]=M.call(this,ie):void 0},F.getCompilingSchema=_,F.resolveSchema=k;const z=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function W(V,{baseId:Z,schema:q,root:re}){var te;if("/"!==(null===(te=V.fragment)||void 0===te?void 0:te[0]))return;for(const me of V.fragment.slice(1).split("/")){if("boolean"==typeof q)return;const ye=q[(0,m.unescapeFragment)(me)];if(void 0===ye)return;const ue="object"==typeof(q=ye)&&q[this.opts.schemaId];!z.has(me)&&ue&&(Z=(0,B.resolveUrl)(this.opts.uriResolver,Z,ue))}let ie;if("boolean"!=typeof q&&q.$ref&&!(0,m.schemaHasRulesButRef)(q,this.RULES)){const me=(0,B.resolveUrl)(this.opts.uriResolver,Z,q.$ref);ie=k.call(this,re,me)}const{schemaId:ae}=this.opts;return ie=ie||new g({schema:q,schemaId:ae,root:re,baseId:Z}),ie.schema!==ie.root.schema?ie:void 0}},23432:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(1038),a={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};F.default=a},26288:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(77172);class a extends Error{constructor(B,m,S,g){super(g||`can't resolve reference ${S} from id ${m}`),this.missingRef=(0,i.resolveUrl)(B,m,S),this.missingSchema=(0,i.normalizeId)((0,i.getFullPath)(B,this.missingRef))}}F.default=a},77172:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.getSchemaRefs=F.resolveUrl=F.normalizeId=F._getFullPath=F.getFullPath=F.inlineRef=void 0;const i=f(27006),a=f(40362),x=f(44331),B=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);F.inlineRef=function m(W,V=!0){return"boolean"==typeof W||(!0===V?!g(W):!!V&&E(W)<=V)};const S=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function g(W){for(const V in W){if(S.has(V))return!0;const Z=W[V];if(Array.isArray(Z)&&Z.some(g)||"object"==typeof Z&&g(Z))return!0}return!1}function E(W){let V=0;for(const Z in W){if("$ref"===Z)return 1/0;if(V++,!B.has(Z)&&("object"==typeof W[Z]&&(0,i.eachItem)(W[Z],q=>V+=E(q)),V===1/0))return 1/0}return V}function R(W,V="",Z){!1!==Z&&(V=j(V));const q=W.parse(V);return M(W,q)}function M(W,V){return W.serialize(V).split("#")[0]+"#"}F.getFullPath=R,F._getFullPath=M;const _=/#\/?$/;function j(W){return W?W.replace(_,""):""}F.normalizeId=j,F.resolveUrl=function P(W,V,Z){return Z=j(Z),W.resolve(V,Z)};const k=/^[a-z_][-a-z0-9._]*$/i;F.getSchemaRefs=function z(W,V){if("boolean"==typeof W)return{};const{schemaId:Z,uriResolver:q}=this.opts,re=j(W[Z]||V),te={"":re},ie=R(q,re,!1),ae={},me=new Set;return x(W,{allKeys:!0},(K,o,h,A)=>{if(void 0===A)return;const I=ie+o;let O=te[A];function $(D){if(D=j(O?(0,this.opts.uriResolver.resolve)(O,D):D),me.has(D))throw ue(D);me.add(D);let p=this.refs[D];return"string"==typeof p&&(p=this.refs[p]),"object"==typeof p?ye(K,p.schema,D):D!==j(I)&&("#"===D[0]?(ye(K,ae[D],D),ae[D]=K):this.refs[D]=I),D}function H(D){if("string"==typeof D){if(!k.test(D))throw new Error(`invalid anchor "${D}"`);$.call(this,`#${D}`)}}"string"==typeof K[Z]&&(O=$.call(this,K[Z])),H.call(this,K.$anchor),H.call(this,K.$dynamicAnchor),te[o]=O}),ae;function ye(K,o,h){if(void 0!==o&&!a(K,o))throw ue(h)}function ue(K){return new Error(`reference "${K}" resolves to more than one schema`)}}},32203:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.getRules=F.isJSONType=void 0;const i=new Set(["string","number","integer","boolean","null","object","array"]);F.isJSONType=function a(B){return"string"==typeof B&&i.has(B)},F.getRules=function x(){const B={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...B,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},B.number,B.string,B.array,B.object],post:{rules:[]},all:{},keywords:{}}}},27006:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.checkStrictMode=F.getErrorPath=F.Type=F.useFunc=F.setEvaluated=F.evaluatedPropsToName=F.mergeEvaluated=F.eachItem=F.unescapeJsonPointer=F.escapeJsonPointer=F.escapeFragment=F.unescapeFragment=F.schemaRefOrVal=F.schemaHasRulesButRef=F.schemaHasRules=F.checkUnknownRules=F.alwaysValidSchema=F.toHash=void 0;const i=f(1038),a=f(33337);function m(ie,ae=ie.schema){const{opts:me,self:ye}=ie;if(!me.strictSchema||"boolean"==typeof ae)return;const ue=ye.RULES.keywords;for(const K in ae)ue[K]||te(ie,`unknown keyword: "${K}"`)}function S(ie,ae){if("boolean"==typeof ie)return!ie;for(const me in ie)if(ae[me])return!0;return!1}function _(ie){return"number"==typeof ie?`${ie}`:ie.replace(/~/g,"~0").replace(/\//g,"~1")}function j(ie){return ie.replace(/~1/g,"/").replace(/~0/g,"~")}function k({mergeNames:ie,mergeToName:ae,mergeValues:me,resultToName:ye}){return(ue,K,o,h)=>{const A=void 0===o?K:o instanceof i.Name?(K instanceof i.Name?ie(ue,K,o):ae(ue,K,o),o):K instanceof i.Name?(ae(ue,o,K),K):me(K,o);return h!==i.Name||A instanceof i.Name?A:ye(ue,A)}}function z(ie,ae){if(!0===ae)return ie.var("props",!0);const me=ie.var("props",i._`{}`);return void 0!==ae&&W(ie,me,ae),me}function W(ie,ae,me){Object.keys(me).forEach(ye=>ie.assign(i._`${ae}${(0,i.getProperty)(ye)}`,!0))}F.toHash=function x(ie){const ae={};for(const me of ie)ae[me]=!0;return ae},F.alwaysValidSchema=function B(ie,ae){return"boolean"==typeof ae?ae:0===Object.keys(ae).length||(m(ie,ae),!S(ae,ie.self.RULES.all))},F.checkUnknownRules=m,F.schemaHasRules=S,F.schemaHasRulesButRef=function g(ie,ae){if("boolean"==typeof ie)return!ie;for(const me in ie)if("$ref"!==me&&ae.all[me])return!0;return!1},F.schemaRefOrVal=function E({topSchemaRef:ie,schemaPath:ae},me,ye,ue){if(!ue){if("number"==typeof me||"boolean"==typeof me)return me;if("string"==typeof me)return i._`${me}`}return i._`${ie}${ae}${(0,i.getProperty)(ye)}`},F.unescapeFragment=function R(ie){return j(decodeURIComponent(ie))},F.escapeFragment=function M(ie){return encodeURIComponent(_(ie))},F.escapeJsonPointer=_,F.unescapeJsonPointer=j,F.eachItem=function P(ie,ae){if(Array.isArray(ie))for(const me of ie)ae(me);else ae(ie)},F.mergeEvaluated={props:k({mergeNames:(ie,ae,me)=>ie.if(i._`${me} !== true && ${ae} !== undefined`,()=>{ie.if(i._`${ae} === true`,()=>ie.assign(me,!0),()=>ie.assign(me,i._`${me} || {}`).code(i._`Object.assign(${me}, ${ae})`))}),mergeToName:(ie,ae,me)=>ie.if(i._`${me} !== true`,()=>{!0===ae?ie.assign(me,!0):(ie.assign(me,i._`${me} || {}`),W(ie,me,ae))}),mergeValues:(ie,ae)=>!0===ie||{...ie,...ae},resultToName:z}),items:k({mergeNames:(ie,ae,me)=>ie.if(i._`${me} !== true && ${ae} !== undefined`,()=>ie.assign(me,i._`${ae} === true ? true : ${me} > ${ae} ? ${me} : ${ae}`)),mergeToName:(ie,ae,me)=>ie.if(i._`${me} !== true`,()=>ie.assign(me,!0===ae||i._`${me} > ${ae} ? ${me} : ${ae}`)),mergeValues:(ie,ae)=>!0===ie||Math.max(ie,ae),resultToName:(ie,ae)=>ie.var("items",ae)})},F.evaluatedPropsToName=z,F.setEvaluated=W;const V={};var q,ie;function te(ie,ae,me=ie.opts.strictSchema){if(me){if(ae=`strict mode: ${ae}`,!0===me)throw new Error(ae);ie.self.logger.warn(ae)}}F.useFunc=function Z(ie,ae){return ie.scopeValue("func",{ref:ae,code:V[ae.code]||(V[ae.code]=new a._Code(ae.code))})},(ie=q=F.Type||(F.Type={}))[ie.Num=0]="Num",ie[ie.Str=1]="Str",F.getErrorPath=function re(ie,ae,me){if(ie instanceof i.Name){const ye=ae===q.Num;return me?ye?i._`"[" + ${ie} + "]"`:i._`"['" + ${ie} + "']"`:ye?i._`"/" + ${ie}`:i._`"/" + ${ie}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return me?(0,i.getProperty)(ie).toString():"/"+_(ie)},F.checkStrictMode=te},22650:(Me,F)=>{"use strict";function i(x,B){return B.rules.some(m=>a(x,m))}function a(x,B){var m;return void 0!==x[B.keyword]||(null===(m=B.definition.implements)||void 0===m?void 0:m.some(S=>void 0!==x[S]))}Object.defineProperty(F,"__esModule",{value:!0}),F.shouldUseRule=F.shouldUseGroup=F.schemaHasRulesForType=void 0,F.schemaHasRulesForType=function f({schema:x,self:B},m){const S=B.RULES.types[m];return S&&!0!==S&&i(x,S)},F.shouldUseGroup=i,F.shouldUseRule=a},37864:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.boolOrEmptySchema=F.topBoolOrEmptySchema=void 0;const i=f(53421),a=f(1038),x=f(23432),B={message:"boolean schema is false"};function g(E,R){const{gen:M,data:_}=E;(0,i.reportError)({gen:M,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:E},B,void 0,R)}F.topBoolOrEmptySchema=function m(E){const{gen:R,schema:M,validateName:_}=E;!1===M?g(E,!1):"object"==typeof M&&!0===M.$async?R.return(x.default.data):(R.assign(a._`${_}.errors`,null),R.return(!0))},F.boolOrEmptySchema=function S(E,R){const{gen:M,schema:_}=E;!1===_?(M.var(R,!1),g(E)):M.var(R,!0)}},55999:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.reportTypeError=F.checkDataTypes=F.checkDataType=F.coerceAndCheckDataType=F.getJSONTypes=F.getSchemaTypes=F.DataType=void 0;const i=f(32203),a=f(22650),x=f(53421),B=f(1038),m=f(27006);var S,q;function E(q){const re=Array.isArray(q)?q:q?[q]:[];if(re.every(i.isJSONType))return re;throw new Error("type must be JSONType or JSONType[]: "+re.join(","))}(q=S=F.DataType||(F.DataType={}))[q.Correct=0]="Correct",q[q.Wrong=1]="Wrong",F.getSchemaTypes=function g(q){const re=E(q.type);if(re.includes("null")){if(!1===q.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!re.length&&void 0!==q.nullable)throw new Error('"nullable" cannot be used without "type"');!0===q.nullable&&re.push("null")}return re},F.getJSONTypes=E,F.coerceAndCheckDataType=function R(q,re){const{gen:te,data:ie,opts:ae}=q,me=function _(q,re){return re?q.filter(te=>M.has(te)||"array"===re&&"array"===te):[]}(re,ae.coerceTypes),ye=re.length>0&&!(0===me.length&&1===re.length&&(0,a.schemaHasRulesForType)(q,re[0]));if(ye){const ue=z(re,ie,ae.strictNumbers,S.Wrong);te.if(ue,()=>{me.length?function j(q,re,te){const{gen:ie,data:ae,opts:me}=q,ye=ie.let("dataType",B._`typeof ${ae}`),ue=ie.let("coerced",B._`undefined`);"array"===me.coerceTypes&&ie.if(B._`${ye} == 'object' && Array.isArray(${ae}) && ${ae}.length == 1`,()=>ie.assign(ae,B._`${ae}[0]`).assign(ye,B._`typeof ${ae}`).if(z(re,ae,me.strictNumbers),()=>ie.assign(ue,ae))),ie.if(B._`${ue} !== undefined`);for(const o of te)(M.has(o)||"array"===o&&"array"===me.coerceTypes)&&K(o);function K(o){switch(o){case"string":return void ie.elseIf(B._`${ye} == "number" || ${ye} == "boolean"`).assign(ue,B._`"" + ${ae}`).elseIf(B._`${ae} === null`).assign(ue,B._`""`);case"number":return void ie.elseIf(B._`${ye} == "boolean" || ${ae} === null || (${ye} == "string" && ${ae} && ${ae} == +${ae})`).assign(ue,B._`+${ae}`);case"integer":return void ie.elseIf(B._`${ye} === "boolean" || ${ae} === null || (${ye} === "string" && ${ae} && ${ae} == +${ae} && !(${ae} % 1))`).assign(ue,B._`+${ae}`);case"boolean":return void ie.elseIf(B._`${ae} === "false" || ${ae} === 0 || ${ae} === null`).assign(ue,!1).elseIf(B._`${ae} === "true" || ${ae} === 1`).assign(ue,!0);case"null":return ie.elseIf(B._`${ae} === "" || ${ae} === 0 || ${ae} === false`),void ie.assign(ue,null);case"array":ie.elseIf(B._`${ye} === "string" || ${ye} === "number" || ${ye} === "boolean" || ${ae} === null`).assign(ue,B._`[${ae}]`)}}ie.else(),V(q),ie.endIf(),ie.if(B._`${ue} !== undefined`,()=>{ie.assign(ae,ue),function P({gen:q,parentData:re,parentDataProperty:te},ie){q.if(B._`${re} !== undefined`,()=>q.assign(B._`${re}[${te}]`,ie))}(q,ue)})}(q,re,me):V(q)})}return ye};const M=new Set(["string","number","integer","boolean","null"]);function k(q,re,te,ie=S.Correct){const ae=ie===S.Correct?B.operators.EQ:B.operators.NEQ;let me;switch(q){case"null":return B._`${re} ${ae} null`;case"array":me=B._`Array.isArray(${re})`;break;case"object":me=B._`${re} && typeof ${re} == "object" && !Array.isArray(${re})`;break;case"integer":me=ye(B._`!(${re} % 1) && !isNaN(${re})`);break;case"number":me=ye();break;default:return B._`typeof ${re} ${ae} ${q}`}return ie===S.Correct?me:(0,B.not)(me);function ye(ue=B.nil){return(0,B.and)(B._`typeof ${re} == "number"`,ue,te?B._`isFinite(${re})`:B.nil)}}function z(q,re,te,ie){if(1===q.length)return k(q[0],re,te,ie);let ae;const me=(0,m.toHash)(q);if(me.array&&me.object){const ye=B._`typeof ${re} != "object"`;ae=me.null?ye:B._`!${re} || ${ye}`,delete me.null,delete me.array,delete me.object}else ae=B.nil;me.number&&delete me.integer;for(const ye in me)ae=(0,B.and)(ae,k(ye,re,te,ie));return ae}F.checkDataType=k,F.checkDataTypes=z;const W={message:({schema:q})=>`must be ${q}`,params:({schema:q,schemaValue:re})=>"string"==typeof q?B._`{type: ${q}}`:B._`{type: ${re}}`};function V(q){const re=function Z(q){const{gen:re,data:te,schema:ie}=q,ae=(0,m.schemaRefOrVal)(q,ie,"type");return{gen:re,keyword:"type",data:te,schema:ie.type,schemaCode:ae,schemaValue:ae,parentSchema:ie,params:{},it:q}}(q);(0,x.reportError)(re,W)}F.reportTypeError=V},48733:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.assignDefaults=void 0;const i=f(1038),a=f(27006);function B(m,S,g){const{gen:E,compositeRule:R,data:M,opts:_}=m;if(void 0===g)return;const j=i._`${M}${(0,i.getProperty)(S)}`;if(R)return void(0,a.checkStrictMode)(m,`default is ignored for: ${j}`);let P=i._`${j} === undefined`;"empty"===_.useDefaults&&(P=i._`${P} || ${j} === null || ${j} === ""`),E.if(P,i._`${j} = ${(0,i.stringify)(g)}`)}F.assignDefaults=function x(m,S){const{properties:g,items:E}=m.schema;if("object"===S&&g)for(const R in g)B(m,R,g[R].default);else"array"===S&&Array.isArray(E)&&E.forEach((R,M)=>B(m,M,R.default))}},40339:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.getData=F.KeywordCxt=F.validateFunctionCode=void 0;const i=f(37864),a=f(55999),x=f(22650),B=f(55999),m=f(48733),S=f(76800),g=f(16334),E=f(1038),R=f(23432),M=f(77172),_=f(27006),j=f(53421);function k({gen:Te,validateName:ke,schema:Se,schemaEnv:Ee,opts:ve},Ce){ve.code.es5?Te.func(ke,E._`${R.default.data}, ${R.default.valCxt}`,Ee.$async,()=>{Te.code(E._`"use strict"; ${q(Se,ve)}`),function W(Te,ke){Te.if(R.default.valCxt,()=>{Te.var(R.default.instancePath,E._`${R.default.valCxt}.${R.default.instancePath}`),Te.var(R.default.parentData,E._`${R.default.valCxt}.${R.default.parentData}`),Te.var(R.default.parentDataProperty,E._`${R.default.valCxt}.${R.default.parentDataProperty}`),Te.var(R.default.rootData,E._`${R.default.valCxt}.${R.default.rootData}`),ke.dynamicRef&&Te.var(R.default.dynamicAnchors,E._`${R.default.valCxt}.${R.default.dynamicAnchors}`)},()=>{Te.var(R.default.instancePath,E._`""`),Te.var(R.default.parentData,E._`undefined`),Te.var(R.default.parentDataProperty,E._`undefined`),Te.var(R.default.rootData,R.default.data),ke.dynamicRef&&Te.var(R.default.dynamicAnchors,E._`{}`)})}(Te,ve),Te.code(Ce)}):Te.func(ke,E._`${R.default.data}, ${function z(Te){return E._`{${R.default.instancePath}="", ${R.default.parentData}, ${R.default.parentDataProperty}, ${R.default.rootData}=${R.default.data}${Te.dynamicRef?E._`, ${R.default.dynamicAnchors}={}`:E.nil}}={}`}(ve)}`,Ee.$async,()=>Te.code(q(Se,ve)).code(Ce))}function q(Te,ke){const Se="object"==typeof Te&&Te[ke.schemaId];return Se&&(ke.code.source||ke.code.process)?E._`/*# sourceURL=${Se} */`:E.nil}function te({schema:Te,self:ke}){if("boolean"==typeof Te)return!Te;for(const Se in Te)if(ke.RULES.all[Se])return!0;return!1}function ie(Te){return"boolean"!=typeof Te.schema}function me(Te){(0,_.checkUnknownRules)(Te),function ue(Te){const{schema:ke,errSchemaPath:Se,opts:Ee,self:ve}=Te;ke.$ref&&Ee.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(ke,ve.RULES)&&ve.logger.warn(`$ref: keywords ignored in schema at path "${Se}"`)}(Te)}function ye(Te,ke){if(Te.opts.jtd)return $(Te,[],!1,ke);const Se=(0,a.getSchemaTypes)(Te.schema);$(Te,Se,!(0,a.coerceAndCheckDataType)(Te,Se),ke)}function A({gen:Te,schemaEnv:ke,schema:Se,errSchemaPath:Ee,opts:ve}){const Ce=Se.$comment;if(!0===ve.$comment)Te.code(E._`${R.default.self}.logger.log(${Ce})`);else if("function"==typeof ve.$comment){const Re=E.str`${Ee}/$comment`,Ye=Te.scopeValue("root",{ref:ke.root});Te.code(E._`${R.default.self}.opts.$comment(${Ce}, ${Re}, ${Ye}.schema)`)}}function $(Te,ke,Se,Ee){const{gen:ve,schema:Ce,data:Re,allErrors:Ye,opts:$e,self:nt}=Te,{RULES:Qe}=nt;function Tt(ct){(0,x.shouldUseGroup)(Ce,ct)&&(ct.type?(ve.if((0,B.checkDataType)(ct.type,Re,$e.strictNumbers)),H(Te,ct),1===ke.length&&ke[0]===ct.type&&Se&&(ve.else(),(0,B.reportTypeError)(Te)),ve.endIf()):H(Te,ct),Ye||ve.if(E._`${R.default.errors} === ${Ee||0}`))}!Ce.$ref||!$e.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(Ce,Qe)?($e.jtd||function D(Te,ke){Te.schemaEnv.meta||!Te.opts.strictTypes||(function s(Te,ke){if(ke.length){if(!Te.dataTypes.length)return void(Te.dataTypes=ke);ke.forEach(Se=>{oe(Te.dataTypes,Se)||Ae(Te,`type "${Se}" not allowed by context "${Te.dataTypes.join(",")}"`)}),function de(Te,ke){const Se=[];for(const Ee of Te.dataTypes)oe(ke,Ee)?Se.push(Ee):ke.includes("integer")&&"number"===Ee&&Se.push("integer");Te.dataTypes=Se}(Te,ke)}}(Te,ke),Te.opts.allowUnionTypes||function p(Te,ke){ke.length>1&&(2!==ke.length||!ke.includes("null"))&&Ae(Te,"use allowUnionTypes to allow union type keyword")}(Te,ke),function Y(Te,ke){const Se=Te.self.RULES.all;for(const Ee in Se){const ve=Se[Ee];if("object"==typeof ve&&(0,x.shouldUseRule)(Te.schema,ve)){const{type:Ce}=ve.definition;Ce.length&&!Ce.some(Re=>ee(ke,Re))&&Ae(Te,`missing type "${Ce.join(",")}" for keyword "${Ee}"`)}}}(Te,Te.dataTypes))}(Te,ke),ve.block(()=>{for(const ct of Qe.rules)Tt(ct);Tt(Qe.post)})):ve.block(()=>Le(Te,"$ref",Qe.all.$ref.definition))}function H(Te,ke){const{gen:Se,schema:Ee,opts:{useDefaults:ve}}=Te;ve&&(0,m.assignDefaults)(Te,ke.type),Se.block(()=>{for(const Ce of ke.rules)(0,x.shouldUseRule)(Ee,Ce)&&Le(Te,Ce.keyword,Ce.definition,ke.type)})}function ee(Te,ke){return Te.includes(ke)||"number"===ke&&Te.includes("integer")}function oe(Te,ke){return Te.includes(ke)||"integer"===ke&&Te.includes("number")}function Ae(Te,ke){(0,_.checkStrictMode)(Te,ke+=` at "${Te.schemaEnv.baseId+Te.errSchemaPath}" (strictTypes)`,Te.opts.strictTypes)}F.validateFunctionCode=function P(Te){ie(Te)&&(me(Te),te(Te))?function V(Te){const{schema:ke,opts:Se,gen:Ee}=Te;k(Te,()=>{Se.$comment&&ke.$comment&&A(Te),function K(Te){const{schema:ke,opts:Se}=Te;void 0!==ke.default&&Se.useDefaults&&Se.strictSchema&&(0,_.checkStrictMode)(Te,"default is ignored in the schema root")}(Te),Ee.let(R.default.vErrors,null),Ee.let(R.default.errors,0),Se.unevaluated&&function Z(Te){const{gen:ke,validateName:Se}=Te;Te.evaluated=ke.const("evaluated",E._`${Se}.evaluated`),ke.if(E._`${Te.evaluated}.dynamicProps`,()=>ke.assign(E._`${Te.evaluated}.props`,E._`undefined`)),ke.if(E._`${Te.evaluated}.dynamicItems`,()=>ke.assign(E._`${Te.evaluated}.items`,E._`undefined`))}(Te),ye(Te),function I(Te){const{gen:ke,schemaEnv:Se,validateName:Ee,ValidationError:ve,opts:Ce}=Te;Se.$async?ke.if(E._`${R.default.errors} === 0`,()=>ke.return(R.default.data),()=>ke.throw(E._`new ${ve}(${R.default.vErrors})`)):(ke.assign(E._`${Ee}.errors`,R.default.vErrors),Ce.unevaluated&&function O({gen:Te,evaluated:ke,props:Se,items:Ee}){Se instanceof E.Name&&Te.assign(E._`${ke}.props`,Se),Ee instanceof E.Name&&Te.assign(E._`${ke}.items`,Ee)}(Te),ke.return(E._`${R.default.errors} === 0`))}(Te)})}(Te):k(Te,()=>(0,i.topBoolOrEmptySchema)(Te))};class Ie{constructor(ke,Se,Ee){if((0,S.validateKeywordUsage)(ke,Se,Ee),this.gen=ke.gen,this.allErrors=ke.allErrors,this.keyword=Ee,this.data=ke.data,this.schema=ke.schema[Ee],this.$data=Se.$data&&ke.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(ke,this.schema,Ee,this.$data),this.schemaType=Se.schemaType,this.parentSchema=ke.schema,this.params={},this.it=ke,this.def=Se,this.$data)this.schemaCode=ke.gen.const("vSchema",Xe(this.$data,ke));else if(this.schemaCode=this.schemaValue,!(0,S.validSchemaType)(this.schema,Se.schemaType,Se.allowUndefined))throw new Error(`${Ee} value must be ${JSON.stringify(Se.schemaType)}`);("code"in Se?Se.trackErrors:!1!==Se.errors)&&(this.errsCount=ke.gen.const("_errs",R.default.errors))}result(ke,Se,Ee){this.failResult((0,E.not)(ke),Se,Ee)}failResult(ke,Se,Ee){this.gen.if(ke),Ee?Ee():this.error(),Se?(this.gen.else(),Se(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(ke,Se){this.failResult((0,E.not)(ke),void 0,Se)}fail(ke){if(void 0===ke)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(ke),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(ke){if(!this.$data)return this.fail(ke);const{schemaCode:Se}=this;this.fail(E._`${Se} !== undefined && (${(0,E.or)(this.invalid$data(),ke)})`)}error(ke,Se,Ee){if(Se)return this.setParams(Se),this._error(ke,Ee),void this.setParams({});this._error(ke,Ee)}_error(ke,Se){(ke?j.reportExtraError:j.reportError)(this,this.def.error,Se)}$dataError(){(0,j.reportError)(this,this.def.$dataError||j.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,j.resetErrorsCount)(this.gen,this.errsCount)}ok(ke){this.allErrors||this.gen.if(ke)}setParams(ke,Se){Se?Object.assign(this.params,ke):this.params=ke}block$data(ke,Se,Ee=E.nil){this.gen.block(()=>{this.check$data(ke,Ee),Se()})}check$data(ke=E.nil,Se=E.nil){if(!this.$data)return;const{gen:Ee,schemaCode:ve,schemaType:Ce,def:Re}=this;Ee.if((0,E.or)(E._`${ve} === undefined`,Se)),ke!==E.nil&&Ee.assign(ke,!0),(Ce.length||Re.validateSchema)&&(Ee.elseIf(this.invalid$data()),this.$dataError(),ke!==E.nil&&Ee.assign(ke,!1)),Ee.else()}invalid$data(){const{gen:ke,schemaCode:Se,schemaType:Ee,def:ve,it:Ce}=this;return(0,E.or)(function Re(){if(Ee.length){if(!(Se instanceof E.Name))throw new Error("ajv implementation error");const $e=Array.isArray(Ee)?Ee:[Ee];return E._`${(0,B.checkDataTypes)($e,Se,Ce.opts.strictNumbers,B.DataType.Wrong)}`}return E.nil}(),function Ye(){if(ve.validateSchema){const $e=ke.scopeValue("validate$data",{ref:ve.validateSchema});return E._`!${$e}(${Se})`}return E.nil}())}subschema(ke,Se){const Ee=(0,g.getSubschema)(this.it,ke);(0,g.extendSubschemaData)(Ee,this.it,ke),(0,g.extendSubschemaMode)(Ee,ke);const ve={...this.it,...Ee,items:void 0,props:void 0};return function re(Te,ke){ie(Te)&&(me(Te),te(Te))?function ae(Te,ke){const{schema:Se,gen:Ee,opts:ve}=Te;ve.$comment&&Se.$comment&&A(Te),function o(Te){const ke=Te.schema[Te.opts.schemaId];ke&&(Te.baseId=(0,M.resolveUrl)(Te.opts.uriResolver,Te.baseId,ke))}(Te),function h(Te){if(Te.schema.$async&&!Te.schemaEnv.$async)throw new Error("async schema in sync schema")}(Te);const Ce=Ee.const("_errs",R.default.errors);ye(Te,Ce),Ee.var(ke,E._`${Ce} === ${R.default.errors}`)}(Te,ke):(0,i.boolOrEmptySchema)(Te,ke)}(ve,Se),ve}mergeEvaluated(ke,Se){const{it:Ee,gen:ve}=this;Ee.opts.unevaluated&&(!0!==Ee.props&&void 0!==ke.props&&(Ee.props=_.mergeEvaluated.props(ve,ke.props,Ee.props,Se)),!0!==Ee.items&&void 0!==ke.items&&(Ee.items=_.mergeEvaluated.items(ve,ke.items,Ee.items,Se)))}mergeValidEvaluated(ke,Se){const{it:Ee,gen:ve}=this;if(Ee.opts.unevaluated&&(!0!==Ee.props||!0!==Ee.items))return ve.if(Se,()=>this.mergeEvaluated(ke,E.Name)),!0}}function Le(Te,ke,Se,Ee){const ve=new Ie(Te,Se,ke);"code"in Se?Se.code(ve,Ee):ve.$data&&Se.validate?(0,S.funcKeywordCode)(ve,Se):"macro"in Se?(0,S.macroKeywordCode)(ve,Se):(Se.compile||Se.validate)&&(0,S.funcKeywordCode)(ve,Se)}F.KeywordCxt=Ie;const xe=/^\/(?:[^~]|~0|~1)*$/,De=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Xe(Te,{dataLevel:ke,dataNames:Se,dataPathArr:Ee}){let ve,Ce;if(""===Te)return R.default.rootData;if("/"===Te[0]){if(!xe.test(Te))throw new Error(`Invalid JSON-pointer: ${Te}`);ve=Te,Ce=R.default.rootData}else{const nt=De.exec(Te);if(!nt)throw new Error(`Invalid JSON-pointer: ${Te}`);const Qe=+nt[1];if(ve=nt[2],"#"===ve){if(Qe>=ke)throw new Error($e("property/index",Qe));return Ee[ke-Qe]}if(Qe>ke)throw new Error($e("data",Qe));if(Ce=Se[ke-Qe],!ve)return Ce}let Re=Ce;const Ye=ve.split("/");for(const nt of Ye)nt&&(Ce=E._`${Ce}${(0,E.getProperty)((0,_.unescapeJsonPointer)(nt))}`,Re=E._`${Re} && ${Ce}`);return Re;function $e(nt,Qe){return`Cannot access ${nt} ${Qe} levels up, current level is ${ke}`}}F.getData=Xe},76800:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateKeywordUsage=F.validSchemaType=F.funcKeywordCode=F.macroKeywordCode=void 0;const i=f(1038),a=f(23432),x=f(42406),B=f(53421);function g(P){const{gen:k,data:z,it:W}=P;k.if(W.parentData,()=>k.assign(z,i._`${W.parentData}[${W.parentDataProperty}]`))}function M(P,k,z){if(void 0===z)throw new Error(`keyword "${k}" failed to compile`);return P.scopeValue("keyword","function"==typeof z?{ref:z}:{ref:z,code:(0,i.stringify)(z)})}F.macroKeywordCode=function m(P,k){const{gen:z,keyword:W,schema:V,parentSchema:Z,it:q}=P,re=k.macro.call(q.self,V,Z,q),te=M(z,W,re);!1!==q.opts.validateSchema&&q.self.validateSchema(re,!0);const ie=z.name("valid");P.subschema({schema:re,schemaPath:i.nil,errSchemaPath:`${q.errSchemaPath}/${W}`,topSchemaRef:te,compositeRule:!0},ie),P.pass(ie,()=>P.error(!0))},F.funcKeywordCode=function S(P,k){var z;const{gen:W,keyword:V,schema:Z,parentSchema:q,$data:re,it:te}=P;!function R({schemaEnv:P},k){if(k.async&&!P.$async)throw new Error("async keyword in sync schema")}(te,k);const ie=!re&&k.compile?k.compile.call(te.self,Z,q,te):k.validate,ae=M(W,V,ie),me=W.let("valid");function o(A=(k.async?i._`await `:i.nil)){W.assign(me,i._`${A}${(0,x.callValidateCode)(P,ae,te.opts.passContext?a.default.this:a.default.self,!("compile"in k&&!re||!1===k.schema))}`,k.modifying)}function h(A){var I;W.if((0,i.not)(null!==(I=k.valid)&&void 0!==I?I:me),A)}P.block$data(me,function ye(){if(!1===k.errors)o(),k.modifying&&g(P),h(()=>P.error());else{const A=k.async?function ue(){const A=W.let("ruleErrs",null);return W.try(()=>o(i._`await `),I=>W.assign(me,!1).if(i._`${I} instanceof ${te.ValidationError}`,()=>W.assign(A,i._`${I}.errors`),()=>W.throw(I))),A}():function K(){const A=i._`${ae}.errors`;return W.assign(A,null),o(i.nil),A}();k.modifying&&g(P),h(()=>function E(P,k){const{gen:z}=P;z.if(i._`Array.isArray(${k})`,()=>{z.assign(a.default.vErrors,i._`${a.default.vErrors} === null ? ${k} : ${a.default.vErrors}.concat(${k})`).assign(a.default.errors,i._`${a.default.vErrors}.length`),(0,B.extendErrors)(P)},()=>P.error())}(P,A))}}),P.ok(null!==(z=k.valid)&&void 0!==z?z:me)},F.validSchemaType=function _(P,k,z=!1){return!k.length||k.some(W=>"array"===W?Array.isArray(P):"object"===W?P&&"object"==typeof P&&!Array.isArray(P):typeof P==W||z&&typeof P>"u")},F.validateKeywordUsage=function j({schema:P,opts:k,self:z,errSchemaPath:W},V,Z){if(Array.isArray(V.keyword)?!V.keyword.includes(Z):V.keyword!==Z)throw new Error("ajv implementation error");const q=V.dependencies;if(q?.some(re=>!Object.prototype.hasOwnProperty.call(P,re)))throw new Error(`parent schema must have dependencies of ${Z}: ${q.join(",")}`);if(V.validateSchema&&!V.validateSchema(P[Z])){const te=`keyword "${Z}" value is invalid at path "${W}": `+z.errorsText(V.validateSchema.errors);if("log"!==k.validateSchema)throw new Error(te);z.logger.error(te)}}},16334:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.extendSubschemaMode=F.extendSubschemaData=F.getSubschema=void 0;const i=f(1038),a=f(27006);F.getSubschema=function x(S,{keyword:g,schemaProp:E,schema:R,schemaPath:M,errSchemaPath:_,topSchemaRef:j}){if(void 0!==g&&void 0!==R)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==g){const P=S.schema[g];return void 0===E?{schema:P,schemaPath:i._`${S.schemaPath}${(0,i.getProperty)(g)}`,errSchemaPath:`${S.errSchemaPath}/${g}`}:{schema:P[E],schemaPath:i._`${S.schemaPath}${(0,i.getProperty)(g)}${(0,i.getProperty)(E)}`,errSchemaPath:`${S.errSchemaPath}/${g}/${(0,a.escapeFragment)(E)}`}}if(void 0!==R){if(void 0===M||void 0===_||void 0===j)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:R,schemaPath:M,topSchemaRef:j,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')},F.extendSubschemaData=function B(S,g,{dataProp:E,dataPropType:R,data:M,dataTypes:_,propertyName:j}){if(void 0!==M&&void 0!==E)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:P}=g;if(void 0!==E){const{errorPath:z,dataPathArr:W,opts:V}=g;k(P.let("data",i._`${g.data}${(0,i.getProperty)(E)}`,!0)),S.errorPath=i.str`${z}${(0,a.getErrorPath)(E,R,V.jsPropertySyntax)}`,S.parentDataProperty=i._`${E}`,S.dataPathArr=[...W,S.parentDataProperty]}function k(z){S.data=z,S.dataLevel=g.dataLevel+1,S.dataTypes=[],g.definedProperties=new Set,S.parentData=g.data,S.dataNames=[...g.dataNames,z]}void 0!==M&&(k(M instanceof i.Name?M:P.let("data",M,!0)),void 0!==j&&(S.propertyName=j)),_&&(S.dataTypes=_)},F.extendSubschemaMode=function m(S,{jtdDiscriminator:g,jtdMetadata:E,compositeRule:R,createErrors:M,allErrors:_}){void 0!==R&&(S.compositeRule=R),void 0!==M&&(S.createErrors=M),void 0!==_&&(S.allErrors=_),S.jtdDiscriminator=g,S.jtdMetadata=E}},35419:(Me,F,f)=>{"use strict";var i=f(29293).default;Object.defineProperty(F,"__esModule",{value:!0}),F.CodeGen=F.Name=F.nil=F.stringify=F.str=F._=F.KeywordCxt=void 0;var a=f(40339);Object.defineProperty(F,"KeywordCxt",{enumerable:!0,get:function(){return a.KeywordCxt}});var x=f(1038);Object.defineProperty(F,"_",{enumerable:!0,get:function(){return x._}}),Object.defineProperty(F,"str",{enumerable:!0,get:function(){return x.str}}),Object.defineProperty(F,"stringify",{enumerable:!0,get:function(){return x.stringify}}),Object.defineProperty(F,"nil",{enumerable:!0,get:function(){return x.nil}}),Object.defineProperty(F,"Name",{enumerable:!0,get:function(){return x.Name}}),Object.defineProperty(F,"CodeGen",{enumerable:!0,get:function(){return x.CodeGen}});const B=f(42467),m=f(26288),S=f(32203),g=f(97692),E=f(1038),R=f(77172),M=f(55999),_=f(27006),j=f(83813),P=f(13203),k=(p,Y)=>new RegExp(p,Y);k.code="new RegExp";const z=["removeAdditional","useDefaults","coerceTypes"],W=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),V={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Z={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function re(p){var Y,ee,oe,de,Ae,Ie,Le,xe,De,Xe,Te,ke,Se,Ee,ve,Ce,Re,Ye,$e,nt,Qe,Tt,ct,ze,St;const ne=p.strict,X=null===(Y=p.code)||void 0===Y?void 0:Y.optimize,G=!0===X||void 0===X?1:X||0,he=null!==(oe=null===(ee=p.code)||void 0===ee?void 0:ee.regExp)&&void 0!==oe?oe:k,_e=null!==(de=p.uriResolver)&&void 0!==de?de:P.default;return{strictSchema:null===(Ie=null!==(Ae=p.strictSchema)&&void 0!==Ae?Ae:ne)||void 0===Ie||Ie,strictNumbers:null===(xe=null!==(Le=p.strictNumbers)&&void 0!==Le?Le:ne)||void 0===xe||xe,strictTypes:null!==(Xe=null!==(De=p.strictTypes)&&void 0!==De?De:ne)&&void 0!==Xe?Xe:"log",strictTuples:null!==(ke=null!==(Te=p.strictTuples)&&void 0!==Te?Te:ne)&&void 0!==ke?ke:"log",strictRequired:null!==(Ee=null!==(Se=p.strictRequired)&&void 0!==Se?Se:ne)&&void 0!==Ee&&Ee,code:p.code?{...p.code,optimize:G,regExp:he}:{optimize:G,regExp:he},loopRequired:null!==(ve=p.loopRequired)&&void 0!==ve?ve:200,loopEnum:null!==(Ce=p.loopEnum)&&void 0!==Ce?Ce:200,meta:null===(Re=p.meta)||void 0===Re||Re,messages:null===(Ye=p.messages)||void 0===Ye||Ye,inlineRefs:null===($e=p.inlineRefs)||void 0===$e||$e,schemaId:null!==(nt=p.schemaId)&&void 0!==nt?nt:"$id",addUsedSchema:null===(Qe=p.addUsedSchema)||void 0===Qe||Qe,validateSchema:null===(Tt=p.validateSchema)||void 0===Tt||Tt,validateFormats:null===(ct=p.validateFormats)||void 0===ct||ct,unicodeRegExp:null===(ze=p.unicodeRegExp)||void 0===ze||ze,int32range:null===(St=p.int32range)||void 0===St||St,uriResolver:_e}}class te{constructor(Y={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,Y=this.opts={...Y,...re(Y)};const{es5:ee,lines:oe}=this.opts.code;this.scope=new E.ValueScope({scope:{},prefixes:W,es5:ee,lines:oe}),this.logger=function h(p){if(!1===p)return o;if(void 0===p)return console;if(p.log&&p.warn&&p.error)return p;throw new Error("logger must implement log, warn and error methods")}(Y.logger);const de=Y.validateFormats;Y.validateFormats=!1,this.RULES=(0,S.getRules)(),ie.call(this,V,Y,"NOT SUPPORTED"),ie.call(this,Z,Y,"DEPRECATED","warn"),this._metaOpts=K.call(this),Y.formats&&ye.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),Y.keywords&&ue.call(this,Y.keywords),"object"==typeof Y.meta&&this.addMetaSchema(Y.meta),me.call(this),Y.validateFormats=de}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:Y,meta:ee,schemaId:oe}=this.opts;let de=j;"id"===oe&&(de={...j},de.id=de.$id,delete de.$id),ee&&Y&&this.addMetaSchema(de,de[oe],!1)}defaultMeta(){const{meta:Y,schemaId:ee}=this.opts;return this.opts.defaultMeta="object"==typeof Y?Y[ee]||Y:void 0}validate(Y,ee){let oe;if("string"==typeof Y){if(oe=this.getSchema(Y),!oe)throw new Error(`no schema with key or ref "${Y}"`)}else oe=this.compile(Y);const de=oe(ee);return"$async"in oe||(this.errors=oe.errors),de}compile(Y,ee){const oe=this._addSchema(Y,ee);return oe.validate||this._compileSchemaEnv(oe)}compileAsync(Y,ee){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:oe}=this.opts;return de.call(this,Y,ee);function de(ve,Ce){return Ae.apply(this,arguments)}function Ae(){return(Ae=i(function*(ve,Ce){yield Ie.call(this,ve.$schema);const Re=this._addSchema(ve,Ce);return Re.validate||xe.call(this,Re)})).apply(this,arguments)}function Ie(ve){return Le.apply(this,arguments)}function Le(){return(Le=i(function*(ve){ve&&!this.getSchema(ve)&&(yield de.call(this,{$ref:ve},!0))})).apply(this,arguments)}function xe(ve){return De.apply(this,arguments)}function De(){return(De=i(function*(ve){try{return this._compileSchemaEnv(ve)}catch(Ce){if(!(Ce instanceof m.default))throw Ce;return Xe.call(this,Ce),yield Te.call(this,Ce.missingSchema),xe.call(this,ve)}})).apply(this,arguments)}function Xe({missingSchema:ve,missingRef:Ce}){if(this.refs[ve])throw new Error(`AnySchema ${ve} is loaded but ${Ce} cannot be resolved`)}function Te(ve){return ke.apply(this,arguments)}function ke(){return(ke=i(function*(ve){const Ce=yield Se.call(this,ve);this.refs[ve]||(yield Ie.call(this,Ce.$schema)),this.refs[ve]||this.addSchema(Ce,ve,ee)})).apply(this,arguments)}function Se(ve){return Ee.apply(this,arguments)}function Ee(){return(Ee=i(function*(ve){const Ce=this._loading[ve];if(Ce)return Ce;try{return yield this._loading[ve]=oe(ve)}finally{delete this._loading[ve]}})).apply(this,arguments)}}addSchema(Y,ee,oe,de=this.opts.validateSchema){if(Array.isArray(Y)){for(const Ie of Y)this.addSchema(Ie,void 0,oe,de);return this}let Ae;if("object"==typeof Y){const{schemaId:Ie}=this.opts;if(Ae=Y[Ie],void 0!==Ae&&"string"!=typeof Ae)throw new Error(`schema ${Ie} must be string`)}return ee=(0,R.normalizeId)(ee||Ae),this._checkUnique(ee),this.schemas[ee]=this._addSchema(Y,oe,ee,de,!0),this}addMetaSchema(Y,ee,oe=this.opts.validateSchema){return this.addSchema(Y,ee,!0,oe),this}validateSchema(Y,ee){if("boolean"==typeof Y)return!0;let oe;if(oe=Y.$schema,void 0!==oe&&"string"!=typeof oe)throw new Error("$schema must be a string");if(oe=oe||this.opts.defaultMeta||this.defaultMeta(),!oe)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const de=this.validate(oe,Y);if(!de&&ee){const Ae="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(Ae);this.logger.error(Ae)}return de}getSchema(Y){let ee;for(;"string"==typeof(ee=ae.call(this,Y));)Y=ee;if(void 0===ee){const{schemaId:oe}=this.opts,de=new g.SchemaEnv({schema:{},schemaId:oe});if(ee=g.resolveSchema.call(this,de,Y),!ee)return;this.refs[Y]=ee}return ee.validate||this._compileSchemaEnv(ee)}removeSchema(Y){if(Y instanceof RegExp)return this._removeAllSchemas(this.schemas,Y),this._removeAllSchemas(this.refs,Y),this;switch(typeof Y){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const ee=ae.call(this,Y);return"object"==typeof ee&&this._cache.delete(ee.schema),delete this.schemas[Y],delete this.refs[Y],this}case"object":{this._cache.delete(Y);let oe=Y[this.opts.schemaId];return oe&&(oe=(0,R.normalizeId)(oe),delete this.schemas[oe],delete this.refs[oe]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(Y){for(const ee of Y)this.addKeyword(ee);return this}addKeyword(Y,ee){let oe;if("string"==typeof Y)oe=Y,"object"==typeof ee&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),ee.keyword=oe);else{if("object"!=typeof Y||void 0!==ee)throw new Error("invalid addKeywords parameters");if(oe=(ee=Y).keyword,Array.isArray(oe)&&!oe.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(I.call(this,oe,ee),!ee)return(0,_.eachItem)(oe,Ae=>O.call(this,Ae)),this;H.call(this,ee);const de={...ee,type:(0,M.getJSONTypes)(ee.type),schemaType:(0,M.getJSONTypes)(ee.schemaType)};return(0,_.eachItem)(oe,0===de.type.length?Ae=>O.call(this,Ae,de):Ae=>de.type.forEach(Ie=>O.call(this,Ae,de,Ie))),this}getKeyword(Y){const ee=this.RULES.all[Y];return"object"==typeof ee?ee.definition:!!ee}removeKeyword(Y){const{RULES:ee}=this;delete ee.keywords[Y],delete ee.all[Y];for(const oe of ee.rules){const de=oe.rules.findIndex(Ae=>Ae.keyword===Y);de>=0&&oe.rules.splice(de,1)}return this}addFormat(Y,ee){return"string"==typeof ee&&(ee=new RegExp(ee)),this.formats[Y]=ee,this}errorsText(Y=this.errors,{separator:ee=", ",dataVar:oe="data"}={}){return Y&&0!==Y.length?Y.map(de=>`${oe}${de.instancePath} ${de.message}`).reduce((de,Ae)=>de+ee+Ae):"No errors"}$dataMetaSchema(Y,ee){const oe=this.RULES.all;Y=JSON.parse(JSON.stringify(Y));for(const de of ee){const Ae=de.split("/").slice(1);let Ie=Y;for(const Le of Ae)Ie=Ie[Le];for(const Le in oe){const xe=oe[Le];if("object"!=typeof xe)continue;const{$data:De}=xe.definition,Xe=Ie[Le];De&&Xe&&(Ie[Le]=s(Xe))}}return Y}_removeAllSchemas(Y,ee){for(const oe in Y){const de=Y[oe];(!ee||ee.test(oe))&&("string"==typeof de?delete Y[oe]:de&&!de.meta&&(this._cache.delete(de.schema),delete Y[oe]))}}_addSchema(Y,ee,oe,de=this.opts.validateSchema,Ae=this.opts.addUsedSchema){let Ie;const{schemaId:Le}=this.opts;if("object"==typeof Y)Ie=Y[Le];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof Y)throw new Error("schema must be object or boolean")}let xe=this._cache.get(Y);if(void 0!==xe)return xe;oe=(0,R.normalizeId)(Ie||oe);const De=R.getSchemaRefs.call(this,Y,oe);return xe=new g.SchemaEnv({schema:Y,schemaId:Le,meta:ee,baseId:oe,localRefs:De}),this._cache.set(xe.schema,xe),Ae&&!oe.startsWith("#")&&(oe&&this._checkUnique(oe),this.refs[oe]=xe),de&&this.validateSchema(Y,!0),xe}_checkUnique(Y){if(this.schemas[Y]||this.refs[Y])throw new Error(`schema with key or id "${Y}" already exists`)}_compileSchemaEnv(Y){if(Y.meta?this._compileMetaSchema(Y):g.compileSchema.call(this,Y),!Y.validate)throw new Error("ajv implementation error");return Y.validate}_compileMetaSchema(Y){const ee=this.opts;this.opts=this._metaOpts;try{g.compileSchema.call(this,Y)}finally{this.opts=ee}}}function ie(p,Y,ee,oe="error"){for(const de in p)de in Y&&this.logger[oe](`${ee}: option ${de}. ${p[de]}`)}function ae(p){return p=(0,R.normalizeId)(p),this.schemas[p]||this.refs[p]}function me(){const p=this.opts.schemas;if(p)if(Array.isArray(p))this.addSchema(p);else for(const Y in p)this.addSchema(p[Y],Y)}function ye(){for(const p in this.opts.formats){const Y=this.opts.formats[p];Y&&this.addFormat(p,Y)}}function ue(p){if(Array.isArray(p))this.addVocabulary(p);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const Y in p){const ee=p[Y];ee.keyword||(ee.keyword=Y),this.addKeyword(ee)}}}function K(){const p={...this.opts};for(const Y of z)delete p[Y];return p}F.default=te,te.ValidationError=B.default,te.MissingRefError=m.default;const o={log(){},warn(){},error(){}},A=/^[a-z_$][a-z0-9_$:-]*$/i;function I(p,Y){const{RULES:ee}=this;if((0,_.eachItem)(p,oe=>{if(ee.keywords[oe])throw new Error(`Keyword ${oe} is already defined`);if(!A.test(oe))throw new Error(`Keyword ${oe} has invalid name`)}),Y&&Y.$data&&!("code"in Y)&&!("validate"in Y))throw new Error('$data keyword must have "code" or "validate" function')}function O(p,Y,ee){var oe;const de=Y?.post;if(ee&&de)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:Ae}=this;let Ie=de?Ae.post:Ae.rules.find(({type:xe})=>xe===ee);if(Ie||(Ie={type:ee,rules:[]},Ae.rules.push(Ie)),Ae.keywords[p]=!0,!Y)return;const Le={keyword:p,definition:{...Y,type:(0,M.getJSONTypes)(Y.type),schemaType:(0,M.getJSONTypes)(Y.schemaType)}};Y.before?$.call(this,Ie,Le,Y.before):Ie.rules.push(Le),Ae.all[p]=Le,null===(oe=Y.implements)||void 0===oe||oe.forEach(xe=>this.addKeyword(xe))}function $(p,Y,ee){const oe=p.rules.findIndex(de=>de.keyword===ee);oe>=0?p.rules.splice(oe,0,Y):(p.rules.push(Y),this.logger.warn(`rule ${ee} is not defined`))}function H(p){let{metaSchema:Y}=p;void 0!==Y&&(p.$data&&this.opts.$data&&(Y=s(Y)),p.validateSchema=this.compile(Y,!0))}const D={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function s(p){return{anyOf:[p,D]}}},87577:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(6438),a=f(59608),x=f(8307),B=f(11082),m=f(93406),S=f(14516),g=f(3059),E=f(18738),R=["/properties"];F.default=function M(_){return[i,a,x,B,m,j(this,S),g,j(this,E)].forEach(P=>this.addMetaSchema(P,void 0,!1)),this;function j(P,k){return _?P.$dataMetaSchema(k,R):k}}},92281:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(40362);i.code='require("ajv/dist/runtime/equal").default',F.default=i},26488:(Me,F)=>{"use strict";function f(i){const a=i.length;let m,x=0,B=0;for(;B=55296&&m<=56319&&B{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(95568);i.code='require("ajv/dist/runtime/uri").default',F.default=i},42467:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});class f extends Error{constructor(a){super("validation failed"),this.errors=a,this.ajv=this.validation=!0}}F.default=f},46934:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateAdditionalItems=void 0;const i=f(1038),a=f(27006),B={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:S}})=>i.str`must NOT have more than ${S} items`,params:({params:{len:S}})=>i._`{limit: ${S}}`},code(S){const{parentSchema:g,it:E}=S,{items:R}=g;Array.isArray(R)?m(S,R):(0,a.checkStrictMode)(E,'"additionalItems" is ignored when "items" is not an array of schemas')}};function m(S,g){const{gen:E,schema:R,data:M,keyword:_,it:j}=S;j.items=!0;const P=E.const("len",i._`${M}.length`);if(!1===R)S.setParams({len:g.length}),S.pass(i._`${P} <= ${g.length}`);else if("object"==typeof R&&!(0,a.alwaysValidSchema)(j,R)){const z=E.var("valid",i._`${P} <= ${g.length}`);E.if((0,i.not)(z),()=>function k(z){E.forRange("i",g.length,P,W=>{S.subschema({keyword:_,dataProp:W,dataPropType:a.Type.Num},z),j.allErrors||E.if((0,i.not)(z),()=>E.break())})}(z)),S.ok(z)}}F.validateAdditionalItems=m,F.default=B},18445:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(42406),a=f(1038),x=f(23432),B=f(27006);F.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:g})=>a._`{additionalProperty: ${g.additionalProperty}}`},code(g){const{gen:E,schema:R,parentSchema:M,data:_,errsCount:j,it:P}=g;if(!j)throw new Error("ajv implementation error");const{allErrors:k,opts:z}=P;if(P.props=!0,"all"!==z.removeAdditional&&(0,B.alwaysValidSchema)(P,R))return;const W=(0,i.allSchemaProperties)(M.properties),V=(0,i.allSchemaProperties)(M.patternProperties);function re(ae){E.code(a._`delete ${_}[${ae}]`)}function te(ae){if("all"===z.removeAdditional||z.removeAdditional&&!1===R)re(ae);else{if(!1===R)return g.setParams({additionalProperty:ae}),g.error(),void(k||E.break());if("object"==typeof R&&!(0,B.alwaysValidSchema)(P,R)){const me=E.name("valid");"failing"===z.removeAdditional?(ie(ae,me,!1),E.if((0,a.not)(me),()=>{g.reset(),re(ae)})):(ie(ae,me),k||E.if((0,a.not)(me),()=>E.break()))}}}function ie(ae,me,ye){const ue={keyword:"additionalProperties",dataProp:ae,dataPropType:B.Type.Str};!1===ye&&Object.assign(ue,{compositeRule:!0,createErrors:!1,allErrors:!1}),g.subschema(ue,me)}(function Z(){E.forIn("key",_,ae=>{W.length||V.length?E.if(function q(ae){let me;if(W.length>8){const ye=(0,B.schemaRefOrVal)(P,M.properties,"properties");me=(0,i.isOwnProperty)(E,ye,ae)}else me=W.length?(0,a.or)(...W.map(ye=>a._`${ae} === ${ye}`)):a.nil;return V.length&&(me=(0,a.or)(me,...V.map(ye=>a._`${(0,i.usePattern)(g,ye)}.test(${ae})`))),(0,a.not)(me)}(ae),()=>te(ae)):te(ae)})})(),g.ok(a._`${j} === ${x.default.errors}`)}}},77783:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(27006);F.default={keyword:"allOf",schemaType:"array",code(x){const{gen:B,schema:m,it:S}=x;if(!Array.isArray(m))throw new Error("ajv implementation error");const g=B.name("valid");m.forEach((E,R)=>{if((0,i.alwaysValidSchema)(S,E))return;const M=x.subschema({keyword:"allOf",schemaProp:R},g);x.ok(g),x.mergeEvaluated(M)})}}},60922:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const a={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:f(42406).validateUnion,error:{message:"must match a schema in anyOf"}};F.default=a},57568:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(1038),a=f(27006);F.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:m,max:S}})=>void 0===S?i.str`must contain at least ${m} valid item(s)`:i.str`must contain at least ${m} and no more than ${S} valid item(s)`,params:({params:{min:m,max:S}})=>void 0===S?i._`{minContains: ${m}}`:i._`{minContains: ${m}, maxContains: ${S}}`},code(m){const{gen:S,schema:g,parentSchema:E,data:R,it:M}=m;let _,j;const{minContains:P,maxContains:k}=E;M.opts.next?(_=void 0===P?1:P,j=k):_=1;const z=S.const("len",i._`${R}.length`);if(m.setParams({min:_,max:j}),void 0===j&&0===_)return void(0,a.checkStrictMode)(M,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==j&&_>j)return(0,a.checkStrictMode)(M,'"minContains" > "maxContains" is always invalid'),void m.fail();if((0,a.alwaysValidSchema)(M,g)){let re=i._`${z} >= ${_}`;return void 0!==j&&(re=i._`${re} && ${z} <= ${j}`),void m.pass(re)}M.items=!0;const W=S.name("valid");function V(){const re=S.name("_valid"),te=S.let("count",0);Z(re,()=>S.if(re,()=>function q(re){S.code(i._`${re}++`),void 0===j?S.if(i._`${re} >= ${_}`,()=>S.assign(W,!0).break()):(S.if(i._`${re} > ${j}`,()=>S.assign(W,!1).break()),1===_?S.assign(W,!0):S.if(i._`${re} >= ${_}`,()=>S.assign(W,!0)))}(te)))}function Z(re,te){S.forRange("i",0,z,ie=>{m.subschema({keyword:"contains",dataProp:ie,dataPropType:a.Type.Num,compositeRule:!0},re),te()})}void 0===j&&1===_?Z(W,()=>S.if(W,()=>S.break())):0===_?(S.let(W,!0),void 0!==j&&S.if(i._`${R}.length > 0`,V)):(S.let(W,!1),V()),m.result(W,()=>m.reset())}}},68032:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateSchemaDeps=F.validatePropertyDeps=F.error=void 0;const i=f(1038),a=f(27006),x=f(42406);F.error={message:({params:{property:E,depsCount:R,deps:M}})=>i.str`must have ${1===R?"property":"properties"} ${M} when property ${E} is present`,params:({params:{property:E,depsCount:R,deps:M,missingProperty:_}})=>i._`{property: ${E}, diff --git a/ngsw.json b/ngsw.json index 942cbc83..7f086590 100644 --- a/ngsw.json +++ b/ngsw.json @@ -1,6 +1,6 @@ { "configVersion": 1, - "timestamp": 1730969532990, + "timestamp": 1730973757382, "index": "/index.html", "assetGroups": [], "dataGroups": [], diff --git a/runtime.dcef4d62731106c8.js b/runtime.229e676babc282dc.js similarity index 93% rename from runtime.dcef4d62731106c8.js rename to runtime.229e676babc282dc.js index 51448ca5..32d18584 100644 --- a/runtime.dcef4d62731106c8.js +++ b/runtime.229e676babc282dc.js @@ -1 +1 @@ -(()=>{"use strict";var e,v={},g={};function f(e){var r=g[e];if(void 0!==r)return r.exports;var a=g[e]={id:e,loaded:!1,exports:{}};return v[e].call(a.exports,a,a.exports,f),a.loaded=!0,a.exports}f.m=v,e=[],f.O=(r,a,c,b)=>{if(!a){var t=1/0;for(d=0;d=b)&&Object.keys(f.O).every(p=>f.O[p](a[n]))?a.splice(n--,1):(l=!1,b0&&e[d-1][2]>b;d--)e[d]=e[d-1];e[d]=[a,c,b]},f.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return f.d(r,{a:r}),r},(()=>{var r,e=Object.getPrototypeOf?a=>Object.getPrototypeOf(a):a=>a.__proto__;f.t=function(a,c){if(1&c&&(a=this(a)),8&c||"object"==typeof a&&a&&(4&c&&a.__esModule||16&c&&"function"==typeof a.then))return a;var b=Object.create(null);f.r(b);var d={};r=r||[null,e({}),e([]),e(e)];for(var t=2&c&&a;"object"==typeof t&&!~r.indexOf(t);t=e(t))Object.getOwnPropertyNames(t).forEach(l=>d[l]=()=>a[l]);return d.default=()=>a,f.d(b,d),b}})(),f.d=(e,r)=>{for(var a in r)f.o(r,a)&&!f.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce((r,a)=>(f.f[a](e,r),r),[])),f.u=e=>(2076===e?"common":e)+"."+{60:"dd56a698bb4b11c7",92:"29548a9b964df122",450:"6408b8e5de5d627d",946:"5d801615b29684a3",959:"8a6a267f2c68265a",1391:"5982e61fcbdbcc04",2076:"5c3cced81c20707e",2084:"16c5e5b6f2f8f212",2228:"6c8ca37f85dbbad6",2276:"955ff276a2528ff4",2320:"8ab6ed1f9557e52c",2765:"e0758a1ca25e97e4",3028:"703e9966d0e318f5",3287:"866db70e75e9dbdd",3416:"dcd3877ff49a5bb2",3446:"12e41e58066efacd",3474:"d0b0ac5fb6caeba1",3475:"1d4960c80daccb08",3907:"a586520cb47ea37c",4101:"1521732a9048a277",4388:"b853de9ef7ccf425",4392:"0d56e23507a649aa",4500:"98c54e798a0bf78e",4630:"88eab6ada321c6ce",4885:"90fe7ee70b20f1f5",4976:"f3c92980a94bb178",5026:"9bf2c634b0697f7d",5216:"c26f14292868335d",5680:"672856de26505dc5",5806:"0d0e0c845b25dee6",5832:"d521a1fe1209029e",5854:"a51cd4a644a7c25f",5874:"0df7182c5d9edeaf",5962:"16d2e48cc9f4b210",6195:"7857de4ac4543855",6406:"46747b6961e189b8",6471:"f9d95bbc4d6d59f9",6486:"bee23a6261a70679",6489:"955d60f01c43053b",6695:"d8e9a5f98e779dd2",6702:"17c7d6c5d0ce9ae3",6797:"12edfd8f3e319402",6850:"88865711a8a6fcb3",7160:"7c337d7f794a5ae1",7358:"440b00fbfb0f64be",7380:"d52677bc1c14dedc",7660:"20118dbe1a9a2047",7848:"fcadeb3cc9aa00d2",7880:"471f4da76baf114d",7988:"aa19765ddea12d37",8008:"4013eed772c0bedc",8012:"fa72aa7e6b5b041f",8067:"d53f5ca6c5591a04",8101:"d98e82825e786d48",8552:"222c77f601c5c66c",8834:"e245eb68c89f83e8",8864:"6764927e933490e0",8880:"b11a9499df5ed9f5",9128:"24964fbc6e92e42a",9158:"842ef26f15a3579f",9238:"d9292fac7f9d7c5a",9379:"6965cb033e50010d",9454:"fdb6542e7277673f",9461:"28cb55a7dce9fed1",9466:"4362b5ce66b1d9c6",9533:"e7aedbb0b758d1d3",9613:"79015bd91f9b1a5e",9727:"df1eefe0b7f531c9",9847:"0eeb70bef87a6954",9996:"24d0b0fa3c2c70a4"}[e]+".js",f.miniCssF=e=>{},f.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={},r="app:";f.l=(a,c,b,d)=>{if(e[a])e[a].push(c);else{var t,l;if(void 0!==b)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(u);var h=e[a];if(delete e[a],t.parentNode&&t.parentNode.removeChild(t),h&&h.forEach(y=>y(p)),_)return _(p)},u=setTimeout(s.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),l&&document.head.appendChild(t)}}})(),f.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;f.tt=()=>(void 0===e&&(e={createScriptURL:r=>r},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),f.tu=e=>f.tt().createScriptURL(e),f.p="",(()=>{var e={9121:0};f.f.j=(c,b)=>{var d=f.o(e,c)?e[c]:void 0;if(0!==d)if(d)b.push(d[2]);else if(9121!=c){var t=new Promise((o,s)=>d=e[c]=[o,s]);b.push(d[2]=t);var l=f.p+f.u(c),n=new Error;f.l(l,o=>{if(f.o(e,c)&&(0!==(d=e[c])&&(e[c]=void 0),d)){var s=o&&("load"===o.type?"missing":o.type),u=o&&o.target&&o.target.src;n.message="Loading chunk "+c+" failed.\n("+s+": "+u+")",n.name="ChunkLoadError",n.type=s,n.request=u,d[1](n)}},"chunk-"+c,c)}else e[c]=0},f.O.j=c=>0===e[c];var r=(c,b)=>{var n,i,[d,t,l]=b,o=0;if(d.some(u=>0!==e[u])){for(n in t)f.o(t,n)&&(f.m[n]=t[n]);if(l)var s=l(f)}for(c&&c(b);o{"use strict";var e,v={},g={};function f(e){var r=g[e];if(void 0!==r)return r.exports;var a=g[e]={id:e,loaded:!1,exports:{}};return v[e].call(a.exports,a,a.exports,f),a.loaded=!0,a.exports}f.m=v,e=[],f.O=(r,a,c,b)=>{if(!a){var t=1/0;for(d=0;d=b)&&Object.keys(f.O).every(p=>f.O[p](a[n]))?a.splice(n--,1):(l=!1,b0&&e[d-1][2]>b;d--)e[d]=e[d-1];e[d]=[a,c,b]},f.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return f.d(r,{a:r}),r},(()=>{var r,e=Object.getPrototypeOf?a=>Object.getPrototypeOf(a):a=>a.__proto__;f.t=function(a,c){if(1&c&&(a=this(a)),8&c||"object"==typeof a&&a&&(4&c&&a.__esModule||16&c&&"function"==typeof a.then))return a;var b=Object.create(null);f.r(b);var d={};r=r||[null,e({}),e([]),e(e)];for(var t=2&c&&a;"object"==typeof t&&!~r.indexOf(t);t=e(t))Object.getOwnPropertyNames(t).forEach(l=>d[l]=()=>a[l]);return d.default=()=>a,f.d(b,d),b}})(),f.d=(e,r)=>{for(var a in r)f.o(r,a)&&!f.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce((r,a)=>(f.f[a](e,r),r),[])),f.u=e=>(2076===e?"common":e)+"."+{60:"dd56a698bb4b11c7",92:"29548a9b964df122",450:"6408b8e5de5d627d",946:"5d801615b29684a3",959:"8a6a267f2c68265a",1391:"5982e61fcbdbcc04",2076:"5c3cced81c20707e",2084:"16c5e5b6f2f8f212",2228:"6c8ca37f85dbbad6",2276:"955ff276a2528ff4",2320:"8ab6ed1f9557e52c",2765:"e0758a1ca25e97e4",3028:"97d518034656f736",3287:"866db70e75e9dbdd",3416:"dcd3877ff49a5bb2",3446:"12e41e58066efacd",3474:"d0b0ac5fb6caeba1",3475:"1d4960c80daccb08",3907:"a586520cb47ea37c",4101:"1521732a9048a277",4388:"b853de9ef7ccf425",4392:"0d56e23507a649aa",4500:"98c54e798a0bf78e",4630:"88eab6ada321c6ce",4885:"90fe7ee70b20f1f5",4976:"f3c92980a94bb178",5026:"9bf2c634b0697f7d",5216:"c26f14292868335d",5680:"672856de26505dc5",5806:"0d0e0c845b25dee6",5832:"d521a1fe1209029e",5854:"a51cd4a644a7c25f",5874:"0df7182c5d9edeaf",5962:"16d2e48cc9f4b210",6195:"7857de4ac4543855",6406:"46747b6961e189b8",6471:"f9d95bbc4d6d59f9",6486:"bee23a6261a70679",6489:"955d60f01c43053b",6695:"d8e9a5f98e779dd2",6702:"203c75ec9fca1fea",6797:"12edfd8f3e319402",6850:"88865711a8a6fcb3",7160:"7c337d7f794a5ae1",7358:"440b00fbfb0f64be",7380:"d52677bc1c14dedc",7660:"20118dbe1a9a2047",7848:"fcadeb3cc9aa00d2",7880:"471f4da76baf114d",7988:"aa19765ddea12d37",8008:"4013eed772c0bedc",8012:"fa72aa7e6b5b041f",8067:"d53f5ca6c5591a04",8101:"d98e82825e786d48",8552:"222c77f601c5c66c",8834:"e245eb68c89f83e8",8864:"6764927e933490e0",8880:"b11a9499df5ed9f5",9128:"24964fbc6e92e42a",9158:"842ef26f15a3579f",9238:"d9292fac7f9d7c5a",9379:"6965cb033e50010d",9454:"fdb6542e7277673f",9461:"28cb55a7dce9fed1",9466:"4362b5ce66b1d9c6",9533:"e7aedbb0b758d1d3",9613:"79015bd91f9b1a5e",9727:"df1eefe0b7f531c9",9847:"dc3a89a6bba25fff",9996:"24d0b0fa3c2c70a4"}[e]+".js",f.miniCssF=e=>{},f.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={},r="app:";f.l=(a,c,b,d)=>{if(e[a])e[a].push(c);else{var t,l;if(void 0!==b)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(u);var h=e[a];if(delete e[a],t.parentNode&&t.parentNode.removeChild(t),h&&h.forEach(y=>y(p)),_)return _(p)},u=setTimeout(s.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),l&&document.head.appendChild(t)}}})(),f.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;f.tt=()=>(void 0===e&&(e={createScriptURL:r=>r},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),f.tu=e=>f.tt().createScriptURL(e),f.p="",(()=>{var e={9121:0};f.f.j=(c,b)=>{var d=f.o(e,c)?e[c]:void 0;if(0!==d)if(d)b.push(d[2]);else if(9121!=c){var t=new Promise((o,s)=>d=e[c]=[o,s]);b.push(d[2]=t);var l=f.p+f.u(c),n=new Error;f.l(l,o=>{if(f.o(e,c)&&(0!==(d=e[c])&&(e[c]=void 0),d)){var s=o&&("load"===o.type?"missing":o.type),u=o&&o.target&&o.target.src;n.message="Loading chunk "+c+" failed.\n("+s+": "+u+")",n.name="ChunkLoadError",n.type=s,n.request=u,d[1](n)}},"chunk-"+c,c)}else e[c]=0},f.O.j=c=>0===e[c];var r=(c,b)=>{var n,i,[d,t,l]=b,o=0;if(d.some(u=>0!==e[u])){for(n in t)f.o(t,n)&&(f.m[n]=t[n]);if(l)var s=l(f)}for(c&&c(b);o